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
33/// Backup runs delete request.
34#[serde_with::serde_as]
35#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
36#[serde(default, rename_all = "camelCase")]
37#[non_exhaustive]
38pub struct SqlBackupRunsDeleteRequest {
39    /// The ID of the backup run to delete. To find a backup run ID, use the
40    /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
41    /// method.
42    #[serde(skip_serializing_if = "wkt::internal::is_default")]
43    #[serde_as(as = "serde_with::DisplayFromStr")]
44    pub id: i64,
45
46    /// Cloud SQL instance ID. This does not include the project ID.
47    #[serde(skip_serializing_if = "std::string::String::is_empty")]
48    pub instance: std::string::String,
49
50    /// Project ID of the project that contains the instance.
51    #[serde(skip_serializing_if = "std::string::String::is_empty")]
52    pub project: std::string::String,
53
54    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
55    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
56}
57
58impl SqlBackupRunsDeleteRequest {
59    pub fn new() -> Self {
60        std::default::Default::default()
61    }
62
63    /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
64    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
65        self.id = v.into();
66        self
67    }
68
69    /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
70    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
71        self.instance = v.into();
72        self
73    }
74
75    /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
76    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
77        self.project = v.into();
78        self
79    }
80}
81
82impl wkt::message::Message for SqlBackupRunsDeleteRequest {
83    fn typename() -> &'static str {
84        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
85    }
86}
87
88/// Backup runs get request.
89#[serde_with::serde_as]
90#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
91#[serde(default, rename_all = "camelCase")]
92#[non_exhaustive]
93pub struct SqlBackupRunsGetRequest {
94    /// The ID of this backup run.
95    #[serde(skip_serializing_if = "wkt::internal::is_default")]
96    #[serde_as(as = "serde_with::DisplayFromStr")]
97    pub id: i64,
98
99    /// Cloud SQL instance ID. This does not include the project ID.
100    #[serde(skip_serializing_if = "std::string::String::is_empty")]
101    pub instance: std::string::String,
102
103    /// Project ID of the project that contains the instance.
104    #[serde(skip_serializing_if = "std::string::String::is_empty")]
105    pub project: std::string::String,
106
107    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
108    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
109}
110
111impl SqlBackupRunsGetRequest {
112    pub fn new() -> Self {
113        std::default::Default::default()
114    }
115
116    /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
117    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
118        self.id = v.into();
119        self
120    }
121
122    /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
123    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.instance = v.into();
125        self
126    }
127
128    /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
129    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
130        self.project = v.into();
131        self
132    }
133}
134
135impl wkt::message::Message for SqlBackupRunsGetRequest {
136    fn typename() -> &'static str {
137        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
138    }
139}
140
141/// Backup runs insert request.
142#[serde_with::serde_as]
143#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
144#[serde(default, rename_all = "camelCase")]
145#[non_exhaustive]
146pub struct SqlBackupRunsInsertRequest {
147    /// Cloud SQL instance ID. This does not include the project ID.
148    #[serde(skip_serializing_if = "std::string::String::is_empty")]
149    pub instance: std::string::String,
150
151    /// Project ID of the project that contains the instance.
152    #[serde(skip_serializing_if = "std::string::String::is_empty")]
153    pub project: std::string::String,
154
155    #[serde(skip_serializing_if = "std::option::Option::is_none")]
156    pub body: std::option::Option<crate::model::BackupRun>,
157
158    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
159    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
160}
161
162impl SqlBackupRunsInsertRequest {
163    pub fn new() -> Self {
164        std::default::Default::default()
165    }
166
167    /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
168    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169        self.instance = v.into();
170        self
171    }
172
173    /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
174    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
175        self.project = v.into();
176        self
177    }
178
179    /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
180    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::BackupRun>>>(
181        mut self,
182        v: T,
183    ) -> Self {
184        self.body = v.into();
185        self
186    }
187}
188
189impl wkt::message::Message for SqlBackupRunsInsertRequest {
190    fn typename() -> &'static str {
191        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
192    }
193}
194
195/// Backup runs list request.
196#[serde_with::serde_as]
197#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
198#[serde(default, rename_all = "camelCase")]
199#[non_exhaustive]
200pub struct SqlBackupRunsListRequest {
201    /// Cloud SQL instance ID, or "-" for all instances. This does not include
202    /// the project ID.
203    #[serde(skip_serializing_if = "std::string::String::is_empty")]
204    pub instance: std::string::String,
205
206    /// Maximum number of backup runs per response.
207    #[serde(skip_serializing_if = "wkt::internal::is_default")]
208    pub max_results: i32,
209
210    /// A previously-returned page token representing part of the larger set of
211    /// results to view.
212    #[serde(skip_serializing_if = "std::string::String::is_empty")]
213    pub page_token: std::string::String,
214
215    /// Project ID of the project that contains the instance.
216    #[serde(skip_serializing_if = "std::string::String::is_empty")]
217    pub project: std::string::String,
218
219    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
220    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
221}
222
223impl SqlBackupRunsListRequest {
224    pub fn new() -> Self {
225        std::default::Default::default()
226    }
227
228    /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
229    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
230        self.instance = v.into();
231        self
232    }
233
234    /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
235    pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
236        self.max_results = v.into();
237        self
238    }
239
240    /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
241    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
242        self.page_token = v.into();
243        self
244    }
245
246    /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
247    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
248        self.project = v.into();
249        self
250    }
251}
252
253impl wkt::message::Message for SqlBackupRunsListRequest {
254    fn typename() -> &'static str {
255        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
256    }
257}
258
259/// A BackupRun resource.
260#[serde_with::serde_as]
261#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
262#[serde(default, rename_all = "camelCase")]
263#[non_exhaustive]
264pub struct BackupRun {
265    /// This is always `sql#backupRun`.
266    #[serde(skip_serializing_if = "std::string::String::is_empty")]
267    pub kind: std::string::String,
268
269    /// The status of this run.
270    pub status: crate::model::SqlBackupRunStatus,
271
272    /// The time the run was enqueued in UTC timezone in
273    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
274    /// `2012-11-15T16:19:00.094Z`.
275    #[serde(skip_serializing_if = "std::option::Option::is_none")]
276    pub enqueued_time: std::option::Option<wkt::Timestamp>,
277
278    /// The identifier for this backup run. Unique only for a specific Cloud SQL
279    /// instance.
280    #[serde(skip_serializing_if = "wkt::internal::is_default")]
281    #[serde_as(as = "serde_with::DisplayFromStr")]
282    pub id: i64,
283
284    /// The time the backup operation actually started in UTC timezone in
285    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
286    /// `2012-11-15T16:19:00.094Z`.
287    #[serde(skip_serializing_if = "std::option::Option::is_none")]
288    pub start_time: std::option::Option<wkt::Timestamp>,
289
290    /// The time the backup operation completed in UTC timezone in
291    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
292    /// `2012-11-15T16:19:00.094Z`.
293    #[serde(skip_serializing_if = "std::option::Option::is_none")]
294    pub end_time: std::option::Option<wkt::Timestamp>,
295
296    /// Information about why the backup operation failed. This is only present if
297    /// the run has the FAILED status.
298    #[serde(skip_serializing_if = "std::option::Option::is_none")]
299    pub error: std::option::Option<crate::model::OperationError>,
300
301    /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
302    /// This field defaults to "ON_DEMAND" and is ignored, when specified for
303    /// insert requests.
304    #[serde(rename = "type")]
305    pub r#type: crate::model::SqlBackupRunType,
306
307    /// The description of this run, only applicable to on-demand backups.
308    #[serde(skip_serializing_if = "std::string::String::is_empty")]
309    pub description: std::string::String,
310
311    /// The start time of the backup window during which this the backup was
312    /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
313    /// example `2012-11-15T16:19:00.094Z`.
314    #[serde(skip_serializing_if = "std::option::Option::is_none")]
315    pub window_start_time: std::option::Option<wkt::Timestamp>,
316
317    /// Name of the database instance.
318    #[serde(skip_serializing_if = "std::string::String::is_empty")]
319    pub instance: std::string::String,
320
321    /// The URI of this resource.
322    #[serde(skip_serializing_if = "std::string::String::is_empty")]
323    pub self_link: std::string::String,
324
325    /// Location of the backups.
326    #[serde(skip_serializing_if = "std::string::String::is_empty")]
327    pub location: std::string::String,
328
329    /// Encryption configuration specific to a backup.
330    #[serde(skip_serializing_if = "std::option::Option::is_none")]
331    pub disk_encryption_configuration:
332        std::option::Option<crate::model::DiskEncryptionConfiguration>,
333
334    /// Encryption status specific to a backup.
335    #[serde(skip_serializing_if = "std::option::Option::is_none")]
336    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
337
338    /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
339    pub backup_kind: crate::model::SqlBackupKind,
340
341    /// Backup time zone to prevent restores to an instance with
342    /// a different time zone. Now relevant only for SQL Server.
343    #[serde(skip_serializing_if = "std::string::String::is_empty")]
344    pub time_zone: std::string::String,
345
346    /// Output only. The maximum chargeable bytes for the backup.
347    #[serde(skip_serializing_if = "std::option::Option::is_none")]
348    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
349    pub max_chargeable_bytes: std::option::Option<i64>,
350
351    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
352    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
353}
354
355impl BackupRun {
356    pub fn new() -> Self {
357        std::default::Default::default()
358    }
359
360    /// Sets the value of [kind][crate::model::BackupRun::kind].
361    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
362        self.kind = v.into();
363        self
364    }
365
366    /// Sets the value of [status][crate::model::BackupRun::status].
367    pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
368        mut self,
369        v: T,
370    ) -> Self {
371        self.status = v.into();
372        self
373    }
374
375    /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
376    pub fn set_enqueued_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
377        mut self,
378        v: T,
379    ) -> Self {
380        self.enqueued_time = v.into();
381        self
382    }
383
384    /// Sets the value of [id][crate::model::BackupRun::id].
385    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
386        self.id = v.into();
387        self
388    }
389
390    /// Sets the value of [start_time][crate::model::BackupRun::start_time].
391    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
392        mut self,
393        v: T,
394    ) -> Self {
395        self.start_time = v.into();
396        self
397    }
398
399    /// Sets the value of [end_time][crate::model::BackupRun::end_time].
400    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
401        mut self,
402        v: T,
403    ) -> Self {
404        self.end_time = v.into();
405        self
406    }
407
408    /// Sets the value of [error][crate::model::BackupRun::error].
409    pub fn set_error<T: std::convert::Into<std::option::Option<crate::model::OperationError>>>(
410        mut self,
411        v: T,
412    ) -> Self {
413        self.error = v.into();
414        self
415    }
416
417    /// Sets the value of [r#type][crate::model::BackupRun::type].
418    pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
419        self.r#type = v.into();
420        self
421    }
422
423    /// Sets the value of [description][crate::model::BackupRun::description].
424    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
425        self.description = v.into();
426        self
427    }
428
429    /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
430    pub fn set_window_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
431        mut self,
432        v: T,
433    ) -> Self {
434        self.window_start_time = v.into();
435        self
436    }
437
438    /// Sets the value of [instance][crate::model::BackupRun::instance].
439    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
440        self.instance = v.into();
441        self
442    }
443
444    /// Sets the value of [self_link][crate::model::BackupRun::self_link].
445    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
446        self.self_link = v.into();
447        self
448    }
449
450    /// Sets the value of [location][crate::model::BackupRun::location].
451    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452        self.location = v.into();
453        self
454    }
455
456    /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
457    pub fn set_disk_encryption_configuration<
458        T: std::convert::Into<std::option::Option<crate::model::DiskEncryptionConfiguration>>,
459    >(
460        mut self,
461        v: T,
462    ) -> Self {
463        self.disk_encryption_configuration = v.into();
464        self
465    }
466
467    /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
468    pub fn set_disk_encryption_status<
469        T: std::convert::Into<std::option::Option<crate::model::DiskEncryptionStatus>>,
470    >(
471        mut self,
472        v: T,
473    ) -> Self {
474        self.disk_encryption_status = v.into();
475        self
476    }
477
478    /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
479    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
480        mut self,
481        v: T,
482    ) -> Self {
483        self.backup_kind = v.into();
484        self
485    }
486
487    /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
488    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
489        self.time_zone = v.into();
490        self
491    }
492
493    /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
494    pub fn set_max_chargeable_bytes<T: std::convert::Into<std::option::Option<i64>>>(
495        mut self,
496        v: T,
497    ) -> Self {
498        self.max_chargeable_bytes = v.into();
499        self
500    }
501}
502
503impl wkt::message::Message for BackupRun {
504    fn typename() -> &'static str {
505        "type.googleapis.com/google.cloud.sql.v1.BackupRun"
506    }
507}
508
509/// Backup run list results.
510#[serde_with::serde_as]
511#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
512#[serde(default, rename_all = "camelCase")]
513#[non_exhaustive]
514pub struct BackupRunsListResponse {
515    /// This is always `sql#backupRunsList`.
516    #[serde(skip_serializing_if = "std::string::String::is_empty")]
517    pub kind: std::string::String,
518
519    /// A list of backup runs in reverse chronological order of the enqueued time.
520    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
521    pub items: std::vec::Vec<crate::model::BackupRun>,
522
523    /// The continuation token, used to page through large result sets. Provide
524    /// this value in a subsequent request to return the next page of results.
525    #[serde(skip_serializing_if = "std::string::String::is_empty")]
526    pub next_page_token: std::string::String,
527
528    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
529    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
530}
531
532impl BackupRunsListResponse {
533    pub fn new() -> Self {
534        std::default::Default::default()
535    }
536
537    /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
538    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
539        self.kind = v.into();
540        self
541    }
542
543    /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
544    pub fn set_items<T, V>(mut self, v: T) -> Self
545    where
546        T: std::iter::IntoIterator<Item = V>,
547        V: std::convert::Into<crate::model::BackupRun>,
548    {
549        use std::iter::Iterator;
550        self.items = v.into_iter().map(|i| i.into()).collect();
551        self
552    }
553
554    /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
555    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
556        self.next_page_token = v.into();
557        self
558    }
559}
560
561impl wkt::message::Message for BackupRunsListResponse {
562    fn typename() -> &'static str {
563        "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
564    }
565}
566
567#[doc(hidden)]
568impl gax::paginator::internal::PageableResponse for BackupRunsListResponse {
569    type PageItem = crate::model::BackupRun;
570
571    fn items(self) -> std::vec::Vec<Self::PageItem> {
572        self.items
573    }
574
575    fn next_page_token(&self) -> std::string::String {
576        use std::clone::Clone;
577        self.next_page_token.clone()
578    }
579}
580
581/// Connect settings retrieval request.
582#[serde_with::serde_as]
583#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
584#[serde(default, rename_all = "camelCase")]
585#[non_exhaustive]
586pub struct GetConnectSettingsRequest {
587    /// Cloud SQL instance ID. This does not include the project ID.
588    #[serde(skip_serializing_if = "std::string::String::is_empty")]
589    pub instance: std::string::String,
590
591    /// Project ID of the project that contains the instance.
592    #[serde(skip_serializing_if = "std::string::String::is_empty")]
593    pub project: std::string::String,
594
595    /// Optional. Optional snapshot read timestamp to trade freshness for
596    /// performance.
597    #[serde(skip_serializing_if = "std::option::Option::is_none")]
598    pub read_time: std::option::Option<wkt::Timestamp>,
599
600    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
601    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
602}
603
604impl GetConnectSettingsRequest {
605    pub fn new() -> Self {
606        std::default::Default::default()
607    }
608
609    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
610    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
611        self.instance = v.into();
612        self
613    }
614
615    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
616    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
617        self.project = v.into();
618        self
619    }
620
621    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
622    pub fn set_read_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
623        mut self,
624        v: T,
625    ) -> Self {
626        self.read_time = v.into();
627        self
628    }
629}
630
631impl wkt::message::Message for GetConnectSettingsRequest {
632    fn typename() -> &'static str {
633        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
634    }
635}
636
637/// Connect settings retrieval response.
638#[serde_with::serde_as]
639#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
640#[serde(default, rename_all = "camelCase")]
641#[non_exhaustive]
642pub struct ConnectSettings {
643    /// This is always `sql#connectSettings`.
644    #[serde(skip_serializing_if = "std::string::String::is_empty")]
645    pub kind: std::string::String,
646
647    /// SSL configuration.
648    #[serde(skip_serializing_if = "std::option::Option::is_none")]
649    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
650
651    /// The assigned IP addresses for the instance.
652    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
653    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
654
655    /// The cloud region for the instance. For example, `us-central1`,
656    /// `europe-west1`. The region cannot be changed after instance creation.
657    #[serde(skip_serializing_if = "std::string::String::is_empty")]
658    pub region: std::string::String,
659
660    /// The database engine type and version. The `databaseVersion`
661    /// field cannot be changed after instance creation.
662    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
663    /// or `MYSQL_5_6`.
664    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
665    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
666    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
667    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
668    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
669    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
670    /// `SQLSERVER_2019_WEB`.
671    pub database_version: crate::model::SqlDatabaseVersion,
672
673    /// `SECOND_GEN`: Cloud SQL database instance.
674    /// `EXTERNAL`: A database server that is not managed by Google.
675    /// This property is read-only; use the `tier` property in the `settings`
676    /// object to determine the database type.
677    pub backend_type: crate::model::SqlBackendType,
678
679    /// Whether PSC connectivity is enabled for this instance.
680    #[serde(skip_serializing_if = "wkt::internal::is_default")]
681    pub psc_enabled: bool,
682
683    /// The dns name of the instance.
684    #[serde(skip_serializing_if = "std::string::String::is_empty")]
685    pub dns_name: std::string::String,
686
687    /// Specify what type of CA is used for the server certificate.
688    pub server_ca_mode: crate::model::connect_settings::CaMode,
689
690    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
691    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
692}
693
694impl ConnectSettings {
695    pub fn new() -> Self {
696        std::default::Default::default()
697    }
698
699    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
700    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
701        self.kind = v.into();
702        self
703    }
704
705    /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
706    pub fn set_server_ca_cert<T: std::convert::Into<std::option::Option<crate::model::SslCert>>>(
707        mut self,
708        v: T,
709    ) -> Self {
710        self.server_ca_cert = v.into();
711        self
712    }
713
714    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
715    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
716    where
717        T: std::iter::IntoIterator<Item = V>,
718        V: std::convert::Into<crate::model::IpMapping>,
719    {
720        use std::iter::Iterator;
721        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
722        self
723    }
724
725    /// Sets the value of [region][crate::model::ConnectSettings::region].
726    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
727        self.region = v.into();
728        self
729    }
730
731    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
732    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
733        mut self,
734        v: T,
735    ) -> Self {
736        self.database_version = v.into();
737        self
738    }
739
740    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
741    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
742        mut self,
743        v: T,
744    ) -> Self {
745        self.backend_type = v.into();
746        self
747    }
748
749    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
750    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
751        self.psc_enabled = v.into();
752        self
753    }
754
755    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
756    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
757        self.dns_name = v.into();
758        self
759    }
760
761    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
762    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
763        mut self,
764        v: T,
765    ) -> Self {
766        self.server_ca_mode = v.into();
767        self
768    }
769}
770
771impl wkt::message::Message for ConnectSettings {
772    fn typename() -> &'static str {
773        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
774    }
775}
776
777/// Defines additional types related to [ConnectSettings].
778pub mod connect_settings {
779    #[allow(unused_imports)]
780    use super::*;
781
782    /// Various Certificate Authority (CA) modes for certificate signing.
783    ///
784    /// # Working with unknown values
785    ///
786    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
787    /// additional enum variants at any time. Adding new variants is not considered
788    /// a breaking change. Applications should write their code in anticipation of:
789    ///
790    /// - New values appearing in future releases of the client library, **and**
791    /// - New values received dynamically, without application changes.
792    ///
793    /// Please consult the [Working with enums] section in the user guide for some
794    /// guidelines.
795    ///
796    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
797    #[derive(Clone, Debug, PartialEq)]
798    #[non_exhaustive]
799    pub enum CaMode {
800        /// CA mode is unknown.
801        Unspecified,
802        /// Google-managed self-signed internal CA.
803        GoogleManagedInternalCa,
804        /// Google-managed regional CA part of root CA hierarchy hosted on Google
805        /// Cloud's Certificate Authority Service (CAS).
806        GoogleManagedCasCa,
807        /// If set, the enum was initialized with an unknown value.
808        ///
809        /// Applications can examine the value using [CaMode::value] or
810        /// [CaMode::name].
811        UnknownValue(ca_mode::UnknownValue),
812    }
813
814    #[doc(hidden)]
815    pub mod ca_mode {
816        #[allow(unused_imports)]
817        use super::*;
818        #[derive(Clone, Debug, PartialEq)]
819        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
820    }
821
822    impl CaMode {
823        /// Gets the enum value.
824        ///
825        /// Returns `None` if the enum contains an unknown value deserialized from
826        /// the string representation of enums.
827        pub fn value(&self) -> std::option::Option<i32> {
828            match self {
829                Self::Unspecified => std::option::Option::Some(0),
830                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
831                Self::GoogleManagedCasCa => std::option::Option::Some(2),
832                Self::UnknownValue(u) => u.0.value(),
833            }
834        }
835
836        /// Gets the enum value as a string.
837        ///
838        /// Returns `None` if the enum contains an unknown value deserialized from
839        /// the integer representation of enums.
840        pub fn name(&self) -> std::option::Option<&str> {
841            match self {
842                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
843                Self::GoogleManagedInternalCa => {
844                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
845                }
846                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
847                Self::UnknownValue(u) => u.0.name(),
848            }
849        }
850    }
851
852    impl std::default::Default for CaMode {
853        fn default() -> Self {
854            use std::convert::From;
855            Self::from(0)
856        }
857    }
858
859    impl std::fmt::Display for CaMode {
860        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
861            wkt::internal::display_enum(f, self.name(), self.value())
862        }
863    }
864
865    impl std::convert::From<i32> for CaMode {
866        fn from(value: i32) -> Self {
867            match value {
868                0 => Self::Unspecified,
869                1 => Self::GoogleManagedInternalCa,
870                2 => Self::GoogleManagedCasCa,
871                _ => Self::UnknownValue(ca_mode::UnknownValue(
872                    wkt::internal::UnknownEnumValue::Integer(value),
873                )),
874            }
875        }
876    }
877
878    impl std::convert::From<&str> for CaMode {
879        fn from(value: &str) -> Self {
880            use std::string::ToString;
881            match value {
882                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
883                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
884                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
885                _ => Self::UnknownValue(ca_mode::UnknownValue(
886                    wkt::internal::UnknownEnumValue::String(value.to_string()),
887                )),
888            }
889        }
890    }
891
892    impl serde::ser::Serialize for CaMode {
893        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
894        where
895            S: serde::Serializer,
896        {
897            match self {
898                Self::Unspecified => serializer.serialize_i32(0),
899                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
900                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
901                Self::UnknownValue(u) => u.0.serialize(serializer),
902            }
903        }
904    }
905
906    impl<'de> serde::de::Deserialize<'de> for CaMode {
907        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
908        where
909            D: serde::Deserializer<'de>,
910        {
911            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
912                ".google.cloud.sql.v1.ConnectSettings.CaMode",
913            ))
914        }
915    }
916}
917
918/// Ephemeral certificate creation request.
919#[serde_with::serde_as]
920#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
921#[serde(default, rename_all = "camelCase")]
922#[non_exhaustive]
923pub struct GenerateEphemeralCertRequest {
924    /// Cloud SQL instance ID. This does not include the project ID.
925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
926    pub instance: std::string::String,
927
928    /// Project ID of the project that contains the instance.
929    #[serde(skip_serializing_if = "std::string::String::is_empty")]
930    pub project: std::string::String,
931
932    /// PEM encoded public key to include in the signed certificate.
933    #[serde(rename = "public_key")]
934    #[serde(skip_serializing_if = "std::string::String::is_empty")]
935    pub public_key: std::string::String,
936
937    /// Optional. Access token to include in the signed certificate.
938    #[serde(rename = "access_token")]
939    #[serde(skip_serializing_if = "std::string::String::is_empty")]
940    pub access_token: std::string::String,
941
942    /// Optional. Optional snapshot read timestamp to trade freshness for
943    /// performance.
944    #[serde(skip_serializing_if = "std::option::Option::is_none")]
945    pub read_time: std::option::Option<wkt::Timestamp>,
946
947    /// Optional. If set, it will contain the cert valid duration.
948    #[serde(skip_serializing_if = "std::option::Option::is_none")]
949    pub valid_duration: std::option::Option<wkt::Duration>,
950
951    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
952    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
953}
954
955impl GenerateEphemeralCertRequest {
956    pub fn new() -> Self {
957        std::default::Default::default()
958    }
959
960    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
961    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
962        self.instance = v.into();
963        self
964    }
965
966    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
967    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
968        self.project = v.into();
969        self
970    }
971
972    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
973    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
974        self.public_key = v.into();
975        self
976    }
977
978    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
979    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
980        self.access_token = v.into();
981        self
982    }
983
984    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
985    pub fn set_read_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
986        mut self,
987        v: T,
988    ) -> Self {
989        self.read_time = v.into();
990        self
991    }
992
993    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
994    pub fn set_valid_duration<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
995        mut self,
996        v: T,
997    ) -> Self {
998        self.valid_duration = v.into();
999        self
1000    }
1001}
1002
1003impl wkt::message::Message for GenerateEphemeralCertRequest {
1004    fn typename() -> &'static str {
1005        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
1006    }
1007}
1008
1009/// Ephemeral certificate creation request.
1010#[serde_with::serde_as]
1011#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1012#[serde(default, rename_all = "camelCase")]
1013#[non_exhaustive]
1014pub struct GenerateEphemeralCertResponse {
1015    /// Generated cert
1016    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1017    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
1018
1019    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1020    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1021}
1022
1023impl GenerateEphemeralCertResponse {
1024    pub fn new() -> Self {
1025        std::default::Default::default()
1026    }
1027
1028    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
1029    pub fn set_ephemeral_cert<T: std::convert::Into<std::option::Option<crate::model::SslCert>>>(
1030        mut self,
1031        v: T,
1032    ) -> Self {
1033        self.ephemeral_cert = v.into();
1034        self
1035    }
1036}
1037
1038impl wkt::message::Message for GenerateEphemeralCertResponse {
1039    fn typename() -> &'static str {
1040        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
1041    }
1042}
1043
1044/// Database delete request.
1045#[serde_with::serde_as]
1046#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1047#[serde(default, rename_all = "camelCase")]
1048#[non_exhaustive]
1049pub struct SqlDatabasesDeleteRequest {
1050    /// Name of the database to be deleted in the instance.
1051    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1052    pub database: std::string::String,
1053
1054    /// Database instance ID. This does not include the project ID.
1055    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1056    pub instance: std::string::String,
1057
1058    /// Project ID of the project that contains the instance.
1059    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1060    pub project: std::string::String,
1061
1062    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1063    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1064}
1065
1066impl SqlDatabasesDeleteRequest {
1067    pub fn new() -> Self {
1068        std::default::Default::default()
1069    }
1070
1071    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
1072    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1073        self.database = v.into();
1074        self
1075    }
1076
1077    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
1078    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1079        self.instance = v.into();
1080        self
1081    }
1082
1083    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
1084    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1085        self.project = v.into();
1086        self
1087    }
1088}
1089
1090impl wkt::message::Message for SqlDatabasesDeleteRequest {
1091    fn typename() -> &'static str {
1092        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
1093    }
1094}
1095
1096/// Database get request.
1097#[serde_with::serde_as]
1098#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1099#[serde(default, rename_all = "camelCase")]
1100#[non_exhaustive]
1101pub struct SqlDatabasesGetRequest {
1102    /// Name of the database in the instance.
1103    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1104    pub database: std::string::String,
1105
1106    /// Database instance ID. This does not include the project ID.
1107    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1108    pub instance: std::string::String,
1109
1110    /// Project ID of the project that contains the instance.
1111    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1112    pub project: std::string::String,
1113
1114    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1115    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1116}
1117
1118impl SqlDatabasesGetRequest {
1119    pub fn new() -> Self {
1120        std::default::Default::default()
1121    }
1122
1123    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
1124    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1125        self.database = v.into();
1126        self
1127    }
1128
1129    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
1130    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131        self.instance = v.into();
1132        self
1133    }
1134
1135    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
1136    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1137        self.project = v.into();
1138        self
1139    }
1140}
1141
1142impl wkt::message::Message for SqlDatabasesGetRequest {
1143    fn typename() -> &'static str {
1144        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
1145    }
1146}
1147
1148/// Database insert request.
1149#[serde_with::serde_as]
1150#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1151#[serde(default, rename_all = "camelCase")]
1152#[non_exhaustive]
1153pub struct SqlDatabasesInsertRequest {
1154    /// Database instance ID. This does not include the project ID.
1155    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1156    pub instance: std::string::String,
1157
1158    /// Project ID of the project that contains the instance.
1159    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1160    pub project: std::string::String,
1161
1162    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1163    pub body: std::option::Option<crate::model::Database>,
1164
1165    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1166    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1167}
1168
1169impl SqlDatabasesInsertRequest {
1170    pub fn new() -> Self {
1171        std::default::Default::default()
1172    }
1173
1174    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
1175    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1176        self.instance = v.into();
1177        self
1178    }
1179
1180    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
1181    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1182        self.project = v.into();
1183        self
1184    }
1185
1186    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1187    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::Database>>>(
1188        mut self,
1189        v: T,
1190    ) -> Self {
1191        self.body = v.into();
1192        self
1193    }
1194}
1195
1196impl wkt::message::Message for SqlDatabasesInsertRequest {
1197    fn typename() -> &'static str {
1198        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
1199    }
1200}
1201
1202/// Database list request.
1203#[serde_with::serde_as]
1204#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1205#[serde(default, rename_all = "camelCase")]
1206#[non_exhaustive]
1207pub struct SqlDatabasesListRequest {
1208    /// Cloud SQL instance ID. This does not include the project ID.
1209    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1210    pub instance: std::string::String,
1211
1212    /// Project ID of the project that contains the instance.
1213    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1214    pub project: std::string::String,
1215
1216    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1217    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1218}
1219
1220impl SqlDatabasesListRequest {
1221    pub fn new() -> Self {
1222        std::default::Default::default()
1223    }
1224
1225    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
1226    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1227        self.instance = v.into();
1228        self
1229    }
1230
1231    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
1232    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1233        self.project = v.into();
1234        self
1235    }
1236}
1237
1238impl wkt::message::Message for SqlDatabasesListRequest {
1239    fn typename() -> &'static str {
1240        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
1241    }
1242}
1243
1244/// Database update request.
1245#[serde_with::serde_as]
1246#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1247#[serde(default, rename_all = "camelCase")]
1248#[non_exhaustive]
1249pub struct SqlDatabasesUpdateRequest {
1250    /// Name of the database to be updated in the instance.
1251    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1252    pub database: std::string::String,
1253
1254    /// Database instance ID. This does not include the project ID.
1255    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1256    pub instance: std::string::String,
1257
1258    /// Project ID of the project that contains the instance.
1259    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1260    pub project: std::string::String,
1261
1262    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1263    pub body: std::option::Option<crate::model::Database>,
1264
1265    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1266    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1267}
1268
1269impl SqlDatabasesUpdateRequest {
1270    pub fn new() -> Self {
1271        std::default::Default::default()
1272    }
1273
1274    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1275    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276        self.database = v.into();
1277        self
1278    }
1279
1280    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1281    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1282        self.instance = v.into();
1283        self
1284    }
1285
1286    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1287    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1288        self.project = v.into();
1289        self
1290    }
1291
1292    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1293    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::Database>>>(
1294        mut self,
1295        v: T,
1296    ) -> Self {
1297        self.body = v.into();
1298        self
1299    }
1300}
1301
1302impl wkt::message::Message for SqlDatabasesUpdateRequest {
1303    fn typename() -> &'static str {
1304        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
1305    }
1306}
1307
1308/// Database list response.
1309#[serde_with::serde_as]
1310#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1311#[serde(default, rename_all = "camelCase")]
1312#[non_exhaustive]
1313pub struct DatabasesListResponse {
1314    /// This is always `sql#databasesList`.
1315    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1316    pub kind: std::string::String,
1317
1318    /// List of database resources in the instance.
1319    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1320    pub items: std::vec::Vec<crate::model::Database>,
1321
1322    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1323    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1324}
1325
1326impl DatabasesListResponse {
1327    pub fn new() -> Self {
1328        std::default::Default::default()
1329    }
1330
1331    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
1332    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1333        self.kind = v.into();
1334        self
1335    }
1336
1337    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
1338    pub fn set_items<T, V>(mut self, v: T) -> Self
1339    where
1340        T: std::iter::IntoIterator<Item = V>,
1341        V: std::convert::Into<crate::model::Database>,
1342    {
1343        use std::iter::Iterator;
1344        self.items = v.into_iter().map(|i| i.into()).collect();
1345        self
1346    }
1347}
1348
1349impl wkt::message::Message for DatabasesListResponse {
1350    fn typename() -> &'static str {
1351        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
1352    }
1353}
1354
1355/// Flags list request.
1356#[serde_with::serde_as]
1357#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1358#[serde(default, rename_all = "camelCase")]
1359#[non_exhaustive]
1360pub struct SqlFlagsListRequest {
1361    /// Database type and version you want to retrieve flags for. By default, this
1362    /// method returns flags for all database types and versions.
1363    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1364    pub database_version: std::string::String,
1365
1366    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1367    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1368}
1369
1370impl SqlFlagsListRequest {
1371    pub fn new() -> Self {
1372        std::default::Default::default()
1373    }
1374
1375    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
1376    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
1377        mut self,
1378        v: T,
1379    ) -> Self {
1380        self.database_version = v.into();
1381        self
1382    }
1383}
1384
1385impl wkt::message::Message for SqlFlagsListRequest {
1386    fn typename() -> &'static str {
1387        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
1388    }
1389}
1390
1391/// Flags list response.
1392#[serde_with::serde_as]
1393#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1394#[serde(default, rename_all = "camelCase")]
1395#[non_exhaustive]
1396pub struct FlagsListResponse {
1397    /// This is always `sql#flagsList`.
1398    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399    pub kind: std::string::String,
1400
1401    /// List of flags.
1402    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1403    pub items: std::vec::Vec<crate::model::Flag>,
1404
1405    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1406    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1407}
1408
1409impl FlagsListResponse {
1410    pub fn new() -> Self {
1411        std::default::Default::default()
1412    }
1413
1414    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
1415    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1416        self.kind = v.into();
1417        self
1418    }
1419
1420    /// Sets the value of [items][crate::model::FlagsListResponse::items].
1421    pub fn set_items<T, V>(mut self, v: T) -> Self
1422    where
1423        T: std::iter::IntoIterator<Item = V>,
1424        V: std::convert::Into<crate::model::Flag>,
1425    {
1426        use std::iter::Iterator;
1427        self.items = v.into_iter().map(|i| i.into()).collect();
1428        self
1429    }
1430}
1431
1432impl wkt::message::Message for FlagsListResponse {
1433    fn typename() -> &'static str {
1434        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
1435    }
1436}
1437
1438/// A flag resource.
1439#[serde_with::serde_as]
1440#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1441#[serde(default, rename_all = "camelCase")]
1442#[non_exhaustive]
1443pub struct Flag {
1444    /// This is the name of the flag. Flag names always use underscores, not
1445    /// hyphens, for example: `max_allowed_packet`
1446    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1447    pub name: std::string::String,
1448
1449    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
1450    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
1451    /// value, such as `skip_grant_tables`.
1452    #[serde(rename = "type")]
1453    pub r#type: crate::model::SqlFlagType,
1454
1455    /// The database version this flag applies to. Can be
1456    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
1457    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
1458    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
1459    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
1460    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
1461    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
1462    /// `SQLSERVER_2019_WEB`.
1463    /// See [the complete
1464    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
1465    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1466    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
1467
1468    /// For `STRING` flags, a list of strings that the value can be set to.
1469    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1470    pub allowed_string_values: std::vec::Vec<std::string::String>,
1471
1472    /// For `INTEGER` flags, the minimum allowed value.
1473    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1474    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1475    pub min_value: std::option::Option<wkt::Int64Value>,
1476
1477    /// For `INTEGER` flags, the maximum allowed value.
1478    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1479    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1480    pub max_value: std::option::Option<wkt::Int64Value>,
1481
1482    /// Indicates whether changing this flag will trigger a database restart. Only
1483    /// applicable to Second Generation instances.
1484    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1485    pub requires_restart: std::option::Option<wkt::BoolValue>,
1486
1487    /// This is always `sql#flag`.
1488    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1489    pub kind: std::string::String,
1490
1491    /// Whether or not the flag is considered in beta.
1492    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1493    pub in_beta: std::option::Option<wkt::BoolValue>,
1494
1495    /// Use this field if only certain integers are accepted. Can be combined
1496    /// with min_value and max_value to add additional values.
1497    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1498    #[serde_as(as = "std::vec::Vec<serde_with::DisplayFromStr>")]
1499    pub allowed_int_values: std::vec::Vec<i64>,
1500
1501    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1502    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1503}
1504
1505impl Flag {
1506    pub fn new() -> Self {
1507        std::default::Default::default()
1508    }
1509
1510    /// Sets the value of [name][crate::model::Flag::name].
1511    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1512        self.name = v.into();
1513        self
1514    }
1515
1516    /// Sets the value of [r#type][crate::model::Flag::type].
1517    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
1518        self.r#type = v.into();
1519        self
1520    }
1521
1522    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
1523    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
1524    where
1525        T: std::iter::IntoIterator<Item = V>,
1526        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
1527    {
1528        use std::iter::Iterator;
1529        self.applies_to = v.into_iter().map(|i| i.into()).collect();
1530        self
1531    }
1532
1533    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
1534    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
1535    where
1536        T: std::iter::IntoIterator<Item = V>,
1537        V: std::convert::Into<std::string::String>,
1538    {
1539        use std::iter::Iterator;
1540        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
1541        self
1542    }
1543
1544    /// Sets the value of [min_value][crate::model::Flag::min_value].
1545    pub fn set_min_value<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
1546        mut self,
1547        v: T,
1548    ) -> Self {
1549        self.min_value = v.into();
1550        self
1551    }
1552
1553    /// Sets the value of [max_value][crate::model::Flag::max_value].
1554    pub fn set_max_value<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
1555        mut self,
1556        v: T,
1557    ) -> Self {
1558        self.max_value = v.into();
1559        self
1560    }
1561
1562    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
1563    pub fn set_requires_restart<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
1564        mut self,
1565        v: T,
1566    ) -> Self {
1567        self.requires_restart = v.into();
1568        self
1569    }
1570
1571    /// Sets the value of [kind][crate::model::Flag::kind].
1572    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1573        self.kind = v.into();
1574        self
1575    }
1576
1577    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
1578    pub fn set_in_beta<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
1579        mut self,
1580        v: T,
1581    ) -> Self {
1582        self.in_beta = v.into();
1583        self
1584    }
1585
1586    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
1587    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
1588    where
1589        T: std::iter::IntoIterator<Item = V>,
1590        V: std::convert::Into<i64>,
1591    {
1592        use std::iter::Iterator;
1593        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
1594        self
1595    }
1596}
1597
1598impl wkt::message::Message for Flag {
1599    fn typename() -> &'static str {
1600        "type.googleapis.com/google.cloud.sql.v1.Flag"
1601    }
1602}
1603
1604/// Instance add server CA request.
1605#[serde_with::serde_as]
1606#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1607#[serde(default, rename_all = "camelCase")]
1608#[non_exhaustive]
1609pub struct SqlInstancesAddServerCaRequest {
1610    /// Cloud SQL instance ID. This does not include the project ID.
1611    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1612    pub instance: std::string::String,
1613
1614    /// Project ID of the project that contains the instance.
1615    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1616    pub project: std::string::String,
1617
1618    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1619    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1620}
1621
1622impl SqlInstancesAddServerCaRequest {
1623    pub fn new() -> Self {
1624        std::default::Default::default()
1625    }
1626
1627    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
1628    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1629        self.instance = v.into();
1630        self
1631    }
1632
1633    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
1634    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635        self.project = v.into();
1636        self
1637    }
1638}
1639
1640impl wkt::message::Message for SqlInstancesAddServerCaRequest {
1641    fn typename() -> &'static str {
1642        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
1643    }
1644}
1645
1646/// Instance clone request.
1647#[serde_with::serde_as]
1648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1649#[serde(default, rename_all = "camelCase")]
1650#[non_exhaustive]
1651pub struct SqlInstancesCloneRequest {
1652    /// The ID of the Cloud SQL instance to be cloned (source). This does not
1653    /// include the project ID.
1654    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1655    pub instance: std::string::String,
1656
1657    /// Project ID of the source as well as the clone Cloud SQL instance.
1658    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1659    pub project: std::string::String,
1660
1661    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1662    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
1663
1664    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1665    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1666}
1667
1668impl SqlInstancesCloneRequest {
1669    pub fn new() -> Self {
1670        std::default::Default::default()
1671    }
1672
1673    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
1674    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1675        self.instance = v.into();
1676        self
1677    }
1678
1679    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
1680    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1681        self.project = v.into();
1682        self
1683    }
1684
1685    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
1686    pub fn set_body<
1687        T: std::convert::Into<std::option::Option<crate::model::InstancesCloneRequest>>,
1688    >(
1689        mut self,
1690        v: T,
1691    ) -> Self {
1692        self.body = v.into();
1693        self
1694    }
1695}
1696
1697impl wkt::message::Message for SqlInstancesCloneRequest {
1698    fn typename() -> &'static str {
1699        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
1700    }
1701}
1702
1703/// Instance delete request.
1704#[serde_with::serde_as]
1705#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1706#[serde(default, rename_all = "camelCase")]
1707#[non_exhaustive]
1708pub struct SqlInstancesDeleteRequest {
1709    /// Cloud SQL instance ID. This does not include the project ID.
1710    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1711    pub instance: std::string::String,
1712
1713    /// Project ID of the project that contains the instance to be deleted.
1714    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1715    pub project: std::string::String,
1716
1717    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1718    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1719}
1720
1721impl SqlInstancesDeleteRequest {
1722    pub fn new() -> Self {
1723        std::default::Default::default()
1724    }
1725
1726    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
1727    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1728        self.instance = v.into();
1729        self
1730    }
1731
1732    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
1733    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1734        self.project = v.into();
1735        self
1736    }
1737}
1738
1739impl wkt::message::Message for SqlInstancesDeleteRequest {
1740    fn typename() -> &'static str {
1741        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
1742    }
1743}
1744
1745/// Instance demote master request.
1746#[serde_with::serde_as]
1747#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1748#[serde(default, rename_all = "camelCase")]
1749#[non_exhaustive]
1750pub struct SqlInstancesDemoteMasterRequest {
1751    /// Cloud SQL instance name.
1752    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1753    pub instance: std::string::String,
1754
1755    /// ID of the project that contains the instance.
1756    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1757    pub project: std::string::String,
1758
1759    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1760    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
1761
1762    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1763    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1764}
1765
1766impl SqlInstancesDemoteMasterRequest {
1767    pub fn new() -> Self {
1768        std::default::Default::default()
1769    }
1770
1771    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
1772    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1773        self.instance = v.into();
1774        self
1775    }
1776
1777    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
1778    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1779        self.project = v.into();
1780        self
1781    }
1782
1783    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
1784    pub fn set_body<
1785        T: std::convert::Into<std::option::Option<crate::model::InstancesDemoteMasterRequest>>,
1786    >(
1787        mut self,
1788        v: T,
1789    ) -> Self {
1790        self.body = v.into();
1791        self
1792    }
1793}
1794
1795impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
1796    fn typename() -> &'static str {
1797        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
1798    }
1799}
1800
1801/// Instance demote request.
1802#[serde_with::serde_as]
1803#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1804#[serde(default, rename_all = "camelCase")]
1805#[non_exhaustive]
1806pub struct SqlInstancesDemoteRequest {
1807    /// Required. Cloud SQL instance name.
1808    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1809    pub instance: std::string::String,
1810
1811    /// Required. ID of the project that contains the instance.
1812    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1813    pub project: std::string::String,
1814
1815    /// Required. The request body.
1816    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1817    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
1818
1819    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1820    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1821}
1822
1823impl SqlInstancesDemoteRequest {
1824    pub fn new() -> Self {
1825        std::default::Default::default()
1826    }
1827
1828    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
1829    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1830        self.instance = v.into();
1831        self
1832    }
1833
1834    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
1835    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1836        self.project = v.into();
1837        self
1838    }
1839
1840    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
1841    pub fn set_body<
1842        T: std::convert::Into<std::option::Option<crate::model::InstancesDemoteRequest>>,
1843    >(
1844        mut self,
1845        v: T,
1846    ) -> Self {
1847        self.body = v.into();
1848        self
1849    }
1850}
1851
1852impl wkt::message::Message for SqlInstancesDemoteRequest {
1853    fn typename() -> &'static str {
1854        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
1855    }
1856}
1857
1858/// Instance export request.
1859#[serde_with::serde_as]
1860#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1861#[serde(default, rename_all = "camelCase")]
1862#[non_exhaustive]
1863pub struct SqlInstancesExportRequest {
1864    /// Cloud SQL instance ID. This does not include the project ID.
1865    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1866    pub instance: std::string::String,
1867
1868    /// Project ID of the project that contains the instance to be exported.
1869    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1870    pub project: std::string::String,
1871
1872    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1873    pub body: std::option::Option<crate::model::InstancesExportRequest>,
1874
1875    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1876    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1877}
1878
1879impl SqlInstancesExportRequest {
1880    pub fn new() -> Self {
1881        std::default::Default::default()
1882    }
1883
1884    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
1885    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886        self.instance = v.into();
1887        self
1888    }
1889
1890    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
1891    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1892        self.project = v.into();
1893        self
1894    }
1895
1896    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
1897    pub fn set_body<
1898        T: std::convert::Into<std::option::Option<crate::model::InstancesExportRequest>>,
1899    >(
1900        mut self,
1901        v: T,
1902    ) -> Self {
1903        self.body = v.into();
1904        self
1905    }
1906}
1907
1908impl wkt::message::Message for SqlInstancesExportRequest {
1909    fn typename() -> &'static str {
1910        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
1911    }
1912}
1913
1914/// Instance failover request.
1915#[serde_with::serde_as]
1916#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1917#[serde(default, rename_all = "camelCase")]
1918#[non_exhaustive]
1919pub struct SqlInstancesFailoverRequest {
1920    /// Cloud SQL instance ID. This does not include the project ID.
1921    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1922    pub instance: std::string::String,
1923
1924    /// ID of the project that contains the read replica.
1925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1926    pub project: std::string::String,
1927
1928    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1929    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
1930
1931    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1932    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1933}
1934
1935impl SqlInstancesFailoverRequest {
1936    pub fn new() -> Self {
1937        std::default::Default::default()
1938    }
1939
1940    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
1941    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1942        self.instance = v.into();
1943        self
1944    }
1945
1946    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
1947    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1948        self.project = v.into();
1949        self
1950    }
1951
1952    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
1953    pub fn set_body<
1954        T: std::convert::Into<std::option::Option<crate::model::InstancesFailoverRequest>>,
1955    >(
1956        mut self,
1957        v: T,
1958    ) -> Self {
1959        self.body = v.into();
1960        self
1961    }
1962}
1963
1964impl wkt::message::Message for SqlInstancesFailoverRequest {
1965    fn typename() -> &'static str {
1966        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
1967    }
1968}
1969
1970/// Instance get request.
1971#[serde_with::serde_as]
1972#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1973#[serde(default, rename_all = "camelCase")]
1974#[non_exhaustive]
1975pub struct SqlInstancesGetRequest {
1976    /// Database instance ID. This does not include the project ID.
1977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1978    pub instance: std::string::String,
1979
1980    /// Project ID of the project that contains the instance.
1981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1982    pub project: std::string::String,
1983
1984    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1985    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1986}
1987
1988impl SqlInstancesGetRequest {
1989    pub fn new() -> Self {
1990        std::default::Default::default()
1991    }
1992
1993    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
1994    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1995        self.instance = v.into();
1996        self
1997    }
1998
1999    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
2000    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2001        self.project = v.into();
2002        self
2003    }
2004}
2005
2006impl wkt::message::Message for SqlInstancesGetRequest {
2007    fn typename() -> &'static str {
2008        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
2009    }
2010}
2011
2012/// Instance import request.
2013#[serde_with::serde_as]
2014#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2015#[serde(default, rename_all = "camelCase")]
2016#[non_exhaustive]
2017pub struct SqlInstancesImportRequest {
2018    /// Cloud SQL instance ID. This does not include the project ID.
2019    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2020    pub instance: std::string::String,
2021
2022    /// Project ID of the project that contains the instance.
2023    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2024    pub project: std::string::String,
2025
2026    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2027    pub body: std::option::Option<crate::model::InstancesImportRequest>,
2028
2029    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2030    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2031}
2032
2033impl SqlInstancesImportRequest {
2034    pub fn new() -> Self {
2035        std::default::Default::default()
2036    }
2037
2038    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
2039    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040        self.instance = v.into();
2041        self
2042    }
2043
2044    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
2045    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2046        self.project = v.into();
2047        self
2048    }
2049
2050    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
2051    pub fn set_body<
2052        T: std::convert::Into<std::option::Option<crate::model::InstancesImportRequest>>,
2053    >(
2054        mut self,
2055        v: T,
2056    ) -> Self {
2057        self.body = v.into();
2058        self
2059    }
2060}
2061
2062impl wkt::message::Message for SqlInstancesImportRequest {
2063    fn typename() -> &'static str {
2064        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
2065    }
2066}
2067
2068/// Instance insert request.
2069#[serde_with::serde_as]
2070#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2071#[serde(default, rename_all = "camelCase")]
2072#[non_exhaustive]
2073pub struct SqlInstancesInsertRequest {
2074    /// Project ID of the project to which the newly created Cloud SQL instances
2075    /// should belong.
2076    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2077    pub project: std::string::String,
2078
2079    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2080    pub body: std::option::Option<crate::model::DatabaseInstance>,
2081
2082    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2083    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2084}
2085
2086impl SqlInstancesInsertRequest {
2087    pub fn new() -> Self {
2088        std::default::Default::default()
2089    }
2090
2091    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
2092    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2093        self.project = v.into();
2094        self
2095    }
2096
2097    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
2098    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::DatabaseInstance>>>(
2099        mut self,
2100        v: T,
2101    ) -> Self {
2102        self.body = v.into();
2103        self
2104    }
2105}
2106
2107impl wkt::message::Message for SqlInstancesInsertRequest {
2108    fn typename() -> &'static str {
2109        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
2110    }
2111}
2112
2113/// Instance list request.
2114#[serde_with::serde_as]
2115#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2116#[serde(default, rename_all = "camelCase")]
2117#[non_exhaustive]
2118pub struct SqlInstancesListRequest {
2119    /// A filter expression that filters resources listed in the response.
2120    /// The expression is in the form of field:value. For example,
2121    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
2122    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
2123    ///
2124    /// Multiple filter queries are space-separated. For example.
2125    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
2126    /// expression is an AND expression. However, you can include AND and OR
2127    /// expressions explicitly.
2128    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2129    pub filter: std::string::String,
2130
2131    /// The maximum number of instances to return. The service may return fewer
2132    /// than this value.
2133    /// If unspecified, at most 500 instances are returned.
2134    /// The maximum value is 1000; values above 1000 are coerced to 1000.
2135    #[serde(skip_serializing_if = "wkt::internal::is_default")]
2136    pub max_results: u32,
2137
2138    /// A previously-returned page token representing part of the larger set of
2139    /// results to view.
2140    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2141    pub page_token: std::string::String,
2142
2143    /// Project ID of the project for which to list Cloud SQL instances.
2144    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2145    pub project: std::string::String,
2146
2147    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2148    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2149}
2150
2151impl SqlInstancesListRequest {
2152    pub fn new() -> Self {
2153        std::default::Default::default()
2154    }
2155
2156    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
2157    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2158        self.filter = v.into();
2159        self
2160    }
2161
2162    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
2163    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
2164        self.max_results = v.into();
2165        self
2166    }
2167
2168    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
2169    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170        self.page_token = v.into();
2171        self
2172    }
2173
2174    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
2175    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2176        self.project = v.into();
2177        self
2178    }
2179}
2180
2181impl wkt::message::Message for SqlInstancesListRequest {
2182    fn typename() -> &'static str {
2183        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
2184    }
2185}
2186
2187/// Instance list server CAs request.
2188#[serde_with::serde_as]
2189#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2190#[serde(default, rename_all = "camelCase")]
2191#[non_exhaustive]
2192pub struct SqlInstancesListServerCasRequest {
2193    /// Cloud SQL instance ID. This does not include the project ID.
2194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2195    pub instance: std::string::String,
2196
2197    /// Project ID of the project that contains the instance.
2198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2199    pub project: std::string::String,
2200
2201    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2203}
2204
2205impl SqlInstancesListServerCasRequest {
2206    pub fn new() -> Self {
2207        std::default::Default::default()
2208    }
2209
2210    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
2211    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2212        self.instance = v.into();
2213        self
2214    }
2215
2216    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
2217    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218        self.project = v.into();
2219        self
2220    }
2221}
2222
2223impl wkt::message::Message for SqlInstancesListServerCasRequest {
2224    fn typename() -> &'static str {
2225        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
2226    }
2227}
2228
2229/// Instance patch request.
2230#[serde_with::serde_as]
2231#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2232#[serde(default, rename_all = "camelCase")]
2233#[non_exhaustive]
2234pub struct SqlInstancesPatchRequest {
2235    /// Cloud SQL instance ID. This does not include the project ID.
2236    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2237    pub instance: std::string::String,
2238
2239    /// Project ID of the project that contains the instance.
2240    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2241    pub project: std::string::String,
2242
2243    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2244    pub body: std::option::Option<crate::model::DatabaseInstance>,
2245
2246    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2247    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2248}
2249
2250impl SqlInstancesPatchRequest {
2251    pub fn new() -> Self {
2252        std::default::Default::default()
2253    }
2254
2255    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
2256    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2257        self.instance = v.into();
2258        self
2259    }
2260
2261    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
2262    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2263        self.project = v.into();
2264        self
2265    }
2266
2267    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
2268    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::DatabaseInstance>>>(
2269        mut self,
2270        v: T,
2271    ) -> Self {
2272        self.body = v.into();
2273        self
2274    }
2275}
2276
2277impl wkt::message::Message for SqlInstancesPatchRequest {
2278    fn typename() -> &'static str {
2279        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
2280    }
2281}
2282
2283/// Instance promote replica request.
2284#[serde_with::serde_as]
2285#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2286#[serde(default, rename_all = "camelCase")]
2287#[non_exhaustive]
2288pub struct SqlInstancesPromoteReplicaRequest {
2289    /// Cloud SQL read replica instance name.
2290    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2291    pub instance: std::string::String,
2292
2293    /// ID of the project that contains the read replica.
2294    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2295    pub project: std::string::String,
2296
2297    /// Set to true to invoke a replica failover to the designated DR
2298    /// replica. As part of replica failover, the promote operation attempts
2299    /// to add the original primary instance as a replica of the promoted
2300    /// DR replica when the original primary instance comes back online.
2301    /// If set to false or not specified, then the original primary
2302    /// instance becomes an independent Cloud SQL primary instance.
2303    /// Only applicable to MySQL.
2304    #[serde(skip_serializing_if = "wkt::internal::is_default")]
2305    pub failover: bool,
2306
2307    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2308    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2309}
2310
2311impl SqlInstancesPromoteReplicaRequest {
2312    pub fn new() -> Self {
2313        std::default::Default::default()
2314    }
2315
2316    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
2317    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318        self.instance = v.into();
2319        self
2320    }
2321
2322    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
2323    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2324        self.project = v.into();
2325        self
2326    }
2327
2328    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
2329    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2330        self.failover = v.into();
2331        self
2332    }
2333}
2334
2335impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
2336    fn typename() -> &'static str {
2337        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
2338    }
2339}
2340
2341/// Instance switchover request.
2342#[serde_with::serde_as]
2343#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2344#[serde(default, rename_all = "camelCase")]
2345#[non_exhaustive]
2346pub struct SqlInstancesSwitchoverRequest {
2347    /// Cloud SQL read replica instance name.
2348    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2349    pub instance: std::string::String,
2350
2351    /// ID of the project that contains the replica.
2352    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2353    pub project: std::string::String,
2354
2355    /// Optional. (MySQL only) Cloud SQL instance operations timeout, which is a
2356    /// sum of all database operations. Default value is 10 minutes and can be
2357    /// modified to a maximum value of 24 hours.
2358    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2359    pub db_timeout: std::option::Option<wkt::Duration>,
2360
2361    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2362    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2363}
2364
2365impl SqlInstancesSwitchoverRequest {
2366    pub fn new() -> Self {
2367        std::default::Default::default()
2368    }
2369
2370    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
2371    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2372        self.instance = v.into();
2373        self
2374    }
2375
2376    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
2377    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2378        self.project = v.into();
2379        self
2380    }
2381
2382    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
2383    pub fn set_db_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
2384        mut self,
2385        v: T,
2386    ) -> Self {
2387        self.db_timeout = v.into();
2388        self
2389    }
2390}
2391
2392impl wkt::message::Message for SqlInstancesSwitchoverRequest {
2393    fn typename() -> &'static str {
2394        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
2395    }
2396}
2397
2398/// Instance reset SSL config request.
2399#[serde_with::serde_as]
2400#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2401#[serde(default, rename_all = "camelCase")]
2402#[non_exhaustive]
2403pub struct SqlInstancesResetSslConfigRequest {
2404    /// Cloud SQL instance ID. This does not include the project ID.
2405    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2406    pub instance: std::string::String,
2407
2408    /// Project ID of the project that contains the instance.
2409    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2410    pub project: std::string::String,
2411
2412    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2413    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2414}
2415
2416impl SqlInstancesResetSslConfigRequest {
2417    pub fn new() -> Self {
2418        std::default::Default::default()
2419    }
2420
2421    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
2422    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2423        self.instance = v.into();
2424        self
2425    }
2426
2427    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
2428    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2429        self.project = v.into();
2430        self
2431    }
2432}
2433
2434impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
2435    fn typename() -> &'static str {
2436        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
2437    }
2438}
2439
2440/// Instance restart request.
2441#[serde_with::serde_as]
2442#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2443#[serde(default, rename_all = "camelCase")]
2444#[non_exhaustive]
2445pub struct SqlInstancesRestartRequest {
2446    /// Cloud SQL instance ID. This does not include the project ID.
2447    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2448    pub instance: std::string::String,
2449
2450    /// Project ID of the project that contains the instance to be restarted.
2451    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2452    pub project: std::string::String,
2453
2454    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2455    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2456}
2457
2458impl SqlInstancesRestartRequest {
2459    pub fn new() -> Self {
2460        std::default::Default::default()
2461    }
2462
2463    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
2464    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2465        self.instance = v.into();
2466        self
2467    }
2468
2469    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
2470    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2471        self.project = v.into();
2472        self
2473    }
2474}
2475
2476impl wkt::message::Message for SqlInstancesRestartRequest {
2477    fn typename() -> &'static str {
2478        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
2479    }
2480}
2481
2482/// Instance restore backup request.
2483#[serde_with::serde_as]
2484#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2485#[serde(default, rename_all = "camelCase")]
2486#[non_exhaustive]
2487pub struct SqlInstancesRestoreBackupRequest {
2488    /// Cloud SQL instance ID. This does not include the project ID.
2489    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2490    pub instance: std::string::String,
2491
2492    /// Project ID of the project that contains the instance.
2493    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2494    pub project: std::string::String,
2495
2496    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2497    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
2498
2499    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2500    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2501}
2502
2503impl SqlInstancesRestoreBackupRequest {
2504    pub fn new() -> Self {
2505        std::default::Default::default()
2506    }
2507
2508    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
2509    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2510        self.instance = v.into();
2511        self
2512    }
2513
2514    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
2515    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2516        self.project = v.into();
2517        self
2518    }
2519
2520    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
2521    pub fn set_body<
2522        T: std::convert::Into<std::option::Option<crate::model::InstancesRestoreBackupRequest>>,
2523    >(
2524        mut self,
2525        v: T,
2526    ) -> Self {
2527        self.body = v.into();
2528        self
2529    }
2530}
2531
2532impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
2533    fn typename() -> &'static str {
2534        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
2535    }
2536}
2537
2538/// Instance rotate server CA request.
2539#[serde_with::serde_as]
2540#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2541#[serde(default, rename_all = "camelCase")]
2542#[non_exhaustive]
2543pub struct SqlInstancesRotateServerCaRequest {
2544    /// Cloud SQL instance ID. This does not include the project ID.
2545    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2546    pub instance: std::string::String,
2547
2548    /// Project ID of the project that contains the instance.
2549    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2550    pub project: std::string::String,
2551
2552    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2553    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
2554
2555    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2556    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2557}
2558
2559impl SqlInstancesRotateServerCaRequest {
2560    pub fn new() -> Self {
2561        std::default::Default::default()
2562    }
2563
2564    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
2565    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2566        self.instance = v.into();
2567        self
2568    }
2569
2570    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
2571    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2572        self.project = v.into();
2573        self
2574    }
2575
2576    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
2577    pub fn set_body<
2578        T: std::convert::Into<std::option::Option<crate::model::InstancesRotateServerCaRequest>>,
2579    >(
2580        mut self,
2581        v: T,
2582    ) -> Self {
2583        self.body = v.into();
2584        self
2585    }
2586}
2587
2588impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
2589    fn typename() -> &'static str {
2590        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
2591    }
2592}
2593
2594/// Instance start replica request.
2595#[serde_with::serde_as]
2596#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2597#[serde(default, rename_all = "camelCase")]
2598#[non_exhaustive]
2599pub struct SqlInstancesStartReplicaRequest {
2600    /// Cloud SQL read replica instance name.
2601    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2602    pub instance: std::string::String,
2603
2604    /// ID of the project that contains the read replica.
2605    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2606    pub project: std::string::String,
2607
2608    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2609    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2610}
2611
2612impl SqlInstancesStartReplicaRequest {
2613    pub fn new() -> Self {
2614        std::default::Default::default()
2615    }
2616
2617    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
2618    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2619        self.instance = v.into();
2620        self
2621    }
2622
2623    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
2624    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2625        self.project = v.into();
2626        self
2627    }
2628}
2629
2630impl wkt::message::Message for SqlInstancesStartReplicaRequest {
2631    fn typename() -> &'static str {
2632        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
2633    }
2634}
2635
2636/// Instance stop replica request.
2637#[serde_with::serde_as]
2638#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2639#[serde(default, rename_all = "camelCase")]
2640#[non_exhaustive]
2641pub struct SqlInstancesStopReplicaRequest {
2642    /// Cloud SQL read replica instance name.
2643    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2644    pub instance: std::string::String,
2645
2646    /// ID of the project that contains the read replica.
2647    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2648    pub project: std::string::String,
2649
2650    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2651    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2652}
2653
2654impl SqlInstancesStopReplicaRequest {
2655    pub fn new() -> Self {
2656        std::default::Default::default()
2657    }
2658
2659    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
2660    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2661        self.instance = v.into();
2662        self
2663    }
2664
2665    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
2666    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2667        self.project = v.into();
2668        self
2669    }
2670}
2671
2672impl wkt::message::Message for SqlInstancesStopReplicaRequest {
2673    fn typename() -> &'static str {
2674        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
2675    }
2676}
2677
2678/// Instance truncate log request.
2679#[serde_with::serde_as]
2680#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2681#[serde(default, rename_all = "camelCase")]
2682#[non_exhaustive]
2683pub struct SqlInstancesTruncateLogRequest {
2684    /// Cloud SQL instance ID. This does not include the project ID.
2685    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2686    pub instance: std::string::String,
2687
2688    /// Project ID of the Cloud SQL project.
2689    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2690    pub project: std::string::String,
2691
2692    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2693    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
2694
2695    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2696    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2697}
2698
2699impl SqlInstancesTruncateLogRequest {
2700    pub fn new() -> Self {
2701        std::default::Default::default()
2702    }
2703
2704    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
2705    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2706        self.instance = v.into();
2707        self
2708    }
2709
2710    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
2711    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2712        self.project = v.into();
2713        self
2714    }
2715
2716    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
2717    pub fn set_body<
2718        T: std::convert::Into<std::option::Option<crate::model::InstancesTruncateLogRequest>>,
2719    >(
2720        mut self,
2721        v: T,
2722    ) -> Self {
2723        self.body = v.into();
2724        self
2725    }
2726}
2727
2728impl wkt::message::Message for SqlInstancesTruncateLogRequest {
2729    fn typename() -> &'static str {
2730        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
2731    }
2732}
2733
2734/// Instance perform disk shrink request.
2735#[serde_with::serde_as]
2736#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2737#[serde(default, rename_all = "camelCase")]
2738#[non_exhaustive]
2739pub struct SqlInstancesPerformDiskShrinkRequest {
2740    /// Cloud SQL instance ID. This does not include the project ID.
2741    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2742    pub instance: std::string::String,
2743
2744    /// Project ID of the project that contains the instance.
2745    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2746    pub project: std::string::String,
2747
2748    /// Perform disk shrink context.
2749    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2750    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
2751
2752    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2753    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2754}
2755
2756impl SqlInstancesPerformDiskShrinkRequest {
2757    pub fn new() -> Self {
2758        std::default::Default::default()
2759    }
2760
2761    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
2762    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2763        self.instance = v.into();
2764        self
2765    }
2766
2767    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
2768    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2769        self.project = v.into();
2770        self
2771    }
2772
2773    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
2774    pub fn set_body<
2775        T: std::convert::Into<std::option::Option<crate::model::PerformDiskShrinkContext>>,
2776    >(
2777        mut self,
2778        v: T,
2779    ) -> Self {
2780        self.body = v.into();
2781        self
2782    }
2783}
2784
2785impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
2786    fn typename() -> &'static str {
2787        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
2788    }
2789}
2790
2791/// Instance update request.
2792#[serde_with::serde_as]
2793#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2794#[serde(default, rename_all = "camelCase")]
2795#[non_exhaustive]
2796pub struct SqlInstancesUpdateRequest {
2797    /// Cloud SQL instance ID. This does not include the project ID.
2798    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2799    pub instance: std::string::String,
2800
2801    /// Project ID of the project that contains the instance.
2802    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2803    pub project: std::string::String,
2804
2805    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2806    pub body: std::option::Option<crate::model::DatabaseInstance>,
2807
2808    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2809    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2810}
2811
2812impl SqlInstancesUpdateRequest {
2813    pub fn new() -> Self {
2814        std::default::Default::default()
2815    }
2816
2817    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
2818    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2819        self.instance = v.into();
2820        self
2821    }
2822
2823    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
2824    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2825        self.project = v.into();
2826        self
2827    }
2828
2829    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
2830    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::DatabaseInstance>>>(
2831        mut self,
2832        v: T,
2833    ) -> Self {
2834        self.body = v.into();
2835        self
2836    }
2837}
2838
2839impl wkt::message::Message for SqlInstancesUpdateRequest {
2840    fn typename() -> &'static str {
2841        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
2842    }
2843}
2844
2845/// Instance reschedule maintenance request.
2846#[serde_with::serde_as]
2847#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2848#[serde(default, rename_all = "camelCase")]
2849#[non_exhaustive]
2850pub struct SqlInstancesRescheduleMaintenanceRequest {
2851    /// Cloud SQL instance ID. This does not include the project ID.
2852    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2853    pub instance: std::string::String,
2854
2855    /// ID of the project that contains the instance.
2856    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2857    pub project: std::string::String,
2858
2859    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2860    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2861
2862    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2863    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864}
2865
2866impl SqlInstancesRescheduleMaintenanceRequest {
2867    pub fn new() -> Self {
2868        std::default::Default::default()
2869    }
2870
2871    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
2872    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873        self.instance = v.into();
2874        self
2875    }
2876
2877    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
2878    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2879        self.project = v.into();
2880        self
2881    }
2882
2883    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
2884    pub fn set_body<
2885        T: std::convert::Into<
2886                std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2887            >,
2888    >(
2889        mut self,
2890        v: T,
2891    ) -> Self {
2892        self.body = v.into();
2893        self
2894    }
2895}
2896
2897impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
2898    fn typename() -> &'static str {
2899        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
2900    }
2901}
2902
2903/// Instance reencrypt request.
2904#[serde_with::serde_as]
2905#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2906#[serde(default, rename_all = "camelCase")]
2907#[non_exhaustive]
2908pub struct SqlInstancesReencryptRequest {
2909    /// Cloud SQL instance ID. This does not include the project ID.
2910    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2911    pub instance: std::string::String,
2912
2913    /// ID of the project that contains the instance.
2914    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2915    pub project: std::string::String,
2916
2917    /// Reencrypt body that users request
2918    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2919    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
2920
2921    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2922    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2923}
2924
2925impl SqlInstancesReencryptRequest {
2926    pub fn new() -> Self {
2927        std::default::Default::default()
2928    }
2929
2930    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
2931    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2932        self.instance = v.into();
2933        self
2934    }
2935
2936    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
2937    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2938        self.project = v.into();
2939        self
2940    }
2941
2942    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2943    pub fn set_body<
2944        T: std::convert::Into<std::option::Option<crate::model::InstancesReencryptRequest>>,
2945    >(
2946        mut self,
2947        v: T,
2948    ) -> Self {
2949        self.body = v.into();
2950        self
2951    }
2952}
2953
2954impl wkt::message::Message for SqlInstancesReencryptRequest {
2955    fn typename() -> &'static str {
2956        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
2957    }
2958}
2959
2960/// Database Instance reencrypt request.
2961#[serde_with::serde_as]
2962#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2963#[serde(default, rename_all = "camelCase")]
2964#[non_exhaustive]
2965pub struct InstancesReencryptRequest {
2966    /// Configuration specific to backup re-encryption
2967    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2968    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
2969
2970    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2971    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2972}
2973
2974impl InstancesReencryptRequest {
2975    pub fn new() -> Self {
2976        std::default::Default::default()
2977    }
2978
2979    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
2980    pub fn set_backup_reencryption_config<
2981        T: std::convert::Into<std::option::Option<crate::model::BackupReencryptionConfig>>,
2982    >(
2983        mut self,
2984        v: T,
2985    ) -> Self {
2986        self.backup_reencryption_config = v.into();
2987        self
2988    }
2989}
2990
2991impl wkt::message::Message for InstancesReencryptRequest {
2992    fn typename() -> &'static str {
2993        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
2994    }
2995}
2996
2997/// Backup Reencryption Config
2998#[serde_with::serde_as]
2999#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3000#[serde(default, rename_all = "camelCase")]
3001#[non_exhaustive]
3002pub struct BackupReencryptionConfig {
3003    /// Backup re-encryption limit
3004    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3005    pub backup_limit: std::option::Option<i32>,
3006
3007    /// Type of backups users want to re-encrypt.
3008    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3009    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
3010
3011    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3012    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3013}
3014
3015impl BackupReencryptionConfig {
3016    pub fn new() -> Self {
3017        std::default::Default::default()
3018    }
3019
3020    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
3021    pub fn set_backup_limit<T: std::convert::Into<std::option::Option<i32>>>(
3022        mut self,
3023        v: T,
3024    ) -> Self {
3025        self.backup_limit = v.into();
3026        self
3027    }
3028
3029    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
3030    pub fn set_backup_type<
3031        T: std::convert::Into<
3032                std::option::Option<crate::model::backup_reencryption_config::BackupType>,
3033            >,
3034    >(
3035        mut self,
3036        v: T,
3037    ) -> Self {
3038        self.backup_type = v.into();
3039        self
3040    }
3041}
3042
3043impl wkt::message::Message for BackupReencryptionConfig {
3044    fn typename() -> &'static str {
3045        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
3046    }
3047}
3048
3049/// Defines additional types related to [BackupReencryptionConfig].
3050pub mod backup_reencryption_config {
3051    #[allow(unused_imports)]
3052    use super::*;
3053
3054    /// Backup type for re-encryption
3055    ///
3056    /// # Working with unknown values
3057    ///
3058    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3059    /// additional enum variants at any time. Adding new variants is not considered
3060    /// a breaking change. Applications should write their code in anticipation of:
3061    ///
3062    /// - New values appearing in future releases of the client library, **and**
3063    /// - New values received dynamically, without application changes.
3064    ///
3065    /// Please consult the [Working with enums] section in the user guide for some
3066    /// guidelines.
3067    ///
3068    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3069    #[derive(Clone, Debug, PartialEq)]
3070    #[non_exhaustive]
3071    pub enum BackupType {
3072        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
3073        Unspecified,
3074        /// Reencrypt automatic backups
3075        Automated,
3076        /// Reencrypt on-demand backups
3077        OnDemand,
3078        /// If set, the enum was initialized with an unknown value.
3079        ///
3080        /// Applications can examine the value using [BackupType::value] or
3081        /// [BackupType::name].
3082        UnknownValue(backup_type::UnknownValue),
3083    }
3084
3085    #[doc(hidden)]
3086    pub mod backup_type {
3087        #[allow(unused_imports)]
3088        use super::*;
3089        #[derive(Clone, Debug, PartialEq)]
3090        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3091    }
3092
3093    impl BackupType {
3094        /// Gets the enum value.
3095        ///
3096        /// Returns `None` if the enum contains an unknown value deserialized from
3097        /// the string representation of enums.
3098        pub fn value(&self) -> std::option::Option<i32> {
3099            match self {
3100                Self::Unspecified => std::option::Option::Some(0),
3101                Self::Automated => std::option::Option::Some(1),
3102                Self::OnDemand => std::option::Option::Some(2),
3103                Self::UnknownValue(u) => u.0.value(),
3104            }
3105        }
3106
3107        /// Gets the enum value as a string.
3108        ///
3109        /// Returns `None` if the enum contains an unknown value deserialized from
3110        /// the integer representation of enums.
3111        pub fn name(&self) -> std::option::Option<&str> {
3112            match self {
3113                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
3114                Self::Automated => std::option::Option::Some("AUTOMATED"),
3115                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
3116                Self::UnknownValue(u) => u.0.name(),
3117            }
3118        }
3119    }
3120
3121    impl std::default::Default for BackupType {
3122        fn default() -> Self {
3123            use std::convert::From;
3124            Self::from(0)
3125        }
3126    }
3127
3128    impl std::fmt::Display for BackupType {
3129        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3130            wkt::internal::display_enum(f, self.name(), self.value())
3131        }
3132    }
3133
3134    impl std::convert::From<i32> for BackupType {
3135        fn from(value: i32) -> Self {
3136            match value {
3137                0 => Self::Unspecified,
3138                1 => Self::Automated,
3139                2 => Self::OnDemand,
3140                _ => Self::UnknownValue(backup_type::UnknownValue(
3141                    wkt::internal::UnknownEnumValue::Integer(value),
3142                )),
3143            }
3144        }
3145    }
3146
3147    impl std::convert::From<&str> for BackupType {
3148        fn from(value: &str) -> Self {
3149            use std::string::ToString;
3150            match value {
3151                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
3152                "AUTOMATED" => Self::Automated,
3153                "ON_DEMAND" => Self::OnDemand,
3154                _ => Self::UnknownValue(backup_type::UnknownValue(
3155                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3156                )),
3157            }
3158        }
3159    }
3160
3161    impl serde::ser::Serialize for BackupType {
3162        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3163        where
3164            S: serde::Serializer,
3165        {
3166            match self {
3167                Self::Unspecified => serializer.serialize_i32(0),
3168                Self::Automated => serializer.serialize_i32(1),
3169                Self::OnDemand => serializer.serialize_i32(2),
3170                Self::UnknownValue(u) => u.0.serialize(serializer),
3171            }
3172        }
3173    }
3174
3175    impl<'de> serde::de::Deserialize<'de> for BackupType {
3176        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3177        where
3178            D: serde::Deserializer<'de>,
3179        {
3180            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
3181                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
3182            ))
3183        }
3184    }
3185}
3186
3187/// Instance get disk shrink config request.
3188#[serde_with::serde_as]
3189#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3190#[serde(default, rename_all = "camelCase")]
3191#[non_exhaustive]
3192pub struct SqlInstancesGetDiskShrinkConfigRequest {
3193    /// Cloud SQL instance ID. This does not include the project ID.
3194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3195    pub instance: std::string::String,
3196
3197    /// Project ID of the project that contains the instance.
3198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3199    pub project: std::string::String,
3200
3201    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3203}
3204
3205impl SqlInstancesGetDiskShrinkConfigRequest {
3206    pub fn new() -> Self {
3207        std::default::Default::default()
3208    }
3209
3210    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
3211    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3212        self.instance = v.into();
3213        self
3214    }
3215
3216    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
3217    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3218        self.project = v.into();
3219        self
3220    }
3221}
3222
3223impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
3224    fn typename() -> &'static str {
3225        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
3226    }
3227}
3228
3229/// Instance verify external sync settings request.
3230#[serde_with::serde_as]
3231#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3232#[serde(default, rename_all = "camelCase")]
3233#[non_exhaustive]
3234pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
3235    /// Cloud SQL instance ID. This does not include the project ID.
3236    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3237    pub instance: std::string::String,
3238
3239    /// Project ID of the project that contains the instance.
3240    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3241    pub project: std::string::String,
3242
3243    /// Flag to enable verifying connection only
3244    #[serde(skip_serializing_if = "wkt::internal::is_default")]
3245    pub verify_connection_only: bool,
3246
3247    /// External sync mode
3248    pub sync_mode:
3249        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3250
3251    /// Optional. Flag to verify settings required by replication setup only
3252    #[serde(skip_serializing_if = "wkt::internal::is_default")]
3253    pub verify_replication_only: bool,
3254
3255    /// Optional. MigrationType configures the migration to use physical files or
3256    /// logical dump files. If not set, then the logical dump file configuration is
3257    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3258    pub migration_type:
3259        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3260
3261    /// Optional. Parallel level for initial data sync. Only applicable for
3262    /// PostgreSQL.
3263    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3264
3265    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3266    pub sync_config: std::option::Option<
3267        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3268    >,
3269
3270    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3271    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3272}
3273
3274impl SqlInstancesVerifyExternalSyncSettingsRequest {
3275    pub fn new() -> Self {
3276        std::default::Default::default()
3277    }
3278
3279    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
3280    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3281        self.instance = v.into();
3282        self
3283    }
3284
3285    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
3286    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3287        self.project = v.into();
3288        self
3289    }
3290
3291    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
3292    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3293        self.verify_connection_only = v.into();
3294        self
3295    }
3296
3297    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
3298    pub fn set_sync_mode<
3299        T: std::convert::Into<
3300                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3301            >,
3302    >(
3303        mut self,
3304        v: T,
3305    ) -> Self {
3306        self.sync_mode = v.into();
3307        self
3308    }
3309
3310    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
3311    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3312        self.verify_replication_only = v.into();
3313        self
3314    }
3315
3316    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
3317    pub fn set_migration_type<
3318        T: std::convert::Into<
3319                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3320            >,
3321    >(
3322        mut self,
3323        v: T,
3324    ) -> Self {
3325        self.migration_type = v.into();
3326        self
3327    }
3328
3329    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
3330    pub fn set_sync_parallel_level<
3331        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3332    >(
3333        mut self,
3334        v: T,
3335    ) -> Self {
3336        self.sync_parallel_level = v.into();
3337        self
3338    }
3339
3340    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
3341    ///
3342    /// Note that all the setters affecting `sync_config` are mutually
3343    /// exclusive.
3344    pub fn set_sync_config<
3345        T: std::convert::Into<
3346                std::option::Option<
3347                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3348                >,
3349            >,
3350    >(
3351        mut self,
3352        v: T,
3353    ) -> Self {
3354        self.sync_config = v.into();
3355        self
3356    }
3357
3358    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
3359    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
3360    /// holds a different branch.
3361    pub fn mysql_sync_config(
3362        &self,
3363    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3364        #[allow(unreachable_patterns)]
3365        self.sync_config.as_ref().and_then(|v| match v {
3366            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3367            _ => std::option::Option::None,
3368        })
3369    }
3370
3371    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
3372    /// to hold a `MysqlSyncConfig`.
3373    ///
3374    /// Note that all the setters affecting `sync_config` are
3375    /// mutually exclusive.
3376    pub fn set_mysql_sync_config<
3377        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3378    >(
3379        mut self,
3380        v: T,
3381    ) -> Self {
3382        self.sync_config = std::option::Option::Some(
3383            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
3384                v.into()
3385            )
3386        );
3387        self
3388    }
3389}
3390
3391impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
3392    fn typename() -> &'static str {
3393        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
3394    }
3395}
3396
3397/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
3398pub mod sql_instances_verify_external_sync_settings_request {
3399    #[allow(unused_imports)]
3400    use super::*;
3401
3402    ///
3403    /// # Working with unknown values
3404    ///
3405    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3406    /// additional enum variants at any time. Adding new variants is not considered
3407    /// a breaking change. Applications should write their code in anticipation of:
3408    ///
3409    /// - New values appearing in future releases of the client library, **and**
3410    /// - New values received dynamically, without application changes.
3411    ///
3412    /// Please consult the [Working with enums] section in the user guide for some
3413    /// guidelines.
3414    ///
3415    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3416    #[derive(Clone, Debug, PartialEq)]
3417    #[non_exhaustive]
3418    pub enum ExternalSyncMode {
3419        /// Unknown external sync mode, will be defaulted to ONLINE mode
3420        Unspecified,
3421        /// Online external sync will set up replication after initial data external
3422        /// sync
3423        Online,
3424        /// Offline external sync only dumps and loads a one-time snapshot of
3425        /// the primary instance's data
3426        Offline,
3427        /// If set, the enum was initialized with an unknown value.
3428        ///
3429        /// Applications can examine the value using [ExternalSyncMode::value] or
3430        /// [ExternalSyncMode::name].
3431        UnknownValue(external_sync_mode::UnknownValue),
3432    }
3433
3434    #[doc(hidden)]
3435    pub mod external_sync_mode {
3436        #[allow(unused_imports)]
3437        use super::*;
3438        #[derive(Clone, Debug, PartialEq)]
3439        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3440    }
3441
3442    impl ExternalSyncMode {
3443        /// Gets the enum value.
3444        ///
3445        /// Returns `None` if the enum contains an unknown value deserialized from
3446        /// the string representation of enums.
3447        pub fn value(&self) -> std::option::Option<i32> {
3448            match self {
3449                Self::Unspecified => std::option::Option::Some(0),
3450                Self::Online => std::option::Option::Some(1),
3451                Self::Offline => std::option::Option::Some(2),
3452                Self::UnknownValue(u) => u.0.value(),
3453            }
3454        }
3455
3456        /// Gets the enum value as a string.
3457        ///
3458        /// Returns `None` if the enum contains an unknown value deserialized from
3459        /// the integer representation of enums.
3460        pub fn name(&self) -> std::option::Option<&str> {
3461            match self {
3462                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
3463                Self::Online => std::option::Option::Some("ONLINE"),
3464                Self::Offline => std::option::Option::Some("OFFLINE"),
3465                Self::UnknownValue(u) => u.0.name(),
3466            }
3467        }
3468    }
3469
3470    impl std::default::Default for ExternalSyncMode {
3471        fn default() -> Self {
3472            use std::convert::From;
3473            Self::from(0)
3474        }
3475    }
3476
3477    impl std::fmt::Display for ExternalSyncMode {
3478        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3479            wkt::internal::display_enum(f, self.name(), self.value())
3480        }
3481    }
3482
3483    impl std::convert::From<i32> for ExternalSyncMode {
3484        fn from(value: i32) -> Self {
3485            match value {
3486                0 => Self::Unspecified,
3487                1 => Self::Online,
3488                2 => Self::Offline,
3489                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3490                    wkt::internal::UnknownEnumValue::Integer(value),
3491                )),
3492            }
3493        }
3494    }
3495
3496    impl std::convert::From<&str> for ExternalSyncMode {
3497        fn from(value: &str) -> Self {
3498            use std::string::ToString;
3499            match value {
3500                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
3501                "ONLINE" => Self::Online,
3502                "OFFLINE" => Self::Offline,
3503                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3504                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3505                )),
3506            }
3507        }
3508    }
3509
3510    impl serde::ser::Serialize for ExternalSyncMode {
3511        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3512        where
3513            S: serde::Serializer,
3514        {
3515            match self {
3516                Self::Unspecified => serializer.serialize_i32(0),
3517                Self::Online => serializer.serialize_i32(1),
3518                Self::Offline => serializer.serialize_i32(2),
3519                Self::UnknownValue(u) => u.0.serialize(serializer),
3520            }
3521        }
3522    }
3523
3524    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
3525        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3526        where
3527            D: serde::Deserializer<'de>,
3528        {
3529            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
3530                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
3531        }
3532    }
3533
3534    /// MigrationType determines whether the migration is a physical file-based
3535    /// migration or a logical dump file-based migration.
3536    ///
3537    /// # Working with unknown values
3538    ///
3539    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3540    /// additional enum variants at any time. Adding new variants is not considered
3541    /// a breaking change. Applications should write their code in anticipation of:
3542    ///
3543    /// - New values appearing in future releases of the client library, **and**
3544    /// - New values received dynamically, without application changes.
3545    ///
3546    /// Please consult the [Working with enums] section in the user guide for some
3547    /// guidelines.
3548    ///
3549    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3550    #[derive(Clone, Debug, PartialEq)]
3551    #[non_exhaustive]
3552    pub enum MigrationType {
3553        /// Default value is a logical dump file-based migration
3554        Unspecified,
3555        /// Logical dump file-based migration
3556        Logical,
3557        /// Physical file-based migration
3558        Physical,
3559        /// If set, the enum was initialized with an unknown value.
3560        ///
3561        /// Applications can examine the value using [MigrationType::value] or
3562        /// [MigrationType::name].
3563        UnknownValue(migration_type::UnknownValue),
3564    }
3565
3566    #[doc(hidden)]
3567    pub mod migration_type {
3568        #[allow(unused_imports)]
3569        use super::*;
3570        #[derive(Clone, Debug, PartialEq)]
3571        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3572    }
3573
3574    impl MigrationType {
3575        /// Gets the enum value.
3576        ///
3577        /// Returns `None` if the enum contains an unknown value deserialized from
3578        /// the string representation of enums.
3579        pub fn value(&self) -> std::option::Option<i32> {
3580            match self {
3581                Self::Unspecified => std::option::Option::Some(0),
3582                Self::Logical => std::option::Option::Some(1),
3583                Self::Physical => std::option::Option::Some(2),
3584                Self::UnknownValue(u) => u.0.value(),
3585            }
3586        }
3587
3588        /// Gets the enum value as a string.
3589        ///
3590        /// Returns `None` if the enum contains an unknown value deserialized from
3591        /// the integer representation of enums.
3592        pub fn name(&self) -> std::option::Option<&str> {
3593            match self {
3594                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
3595                Self::Logical => std::option::Option::Some("LOGICAL"),
3596                Self::Physical => std::option::Option::Some("PHYSICAL"),
3597                Self::UnknownValue(u) => u.0.name(),
3598            }
3599        }
3600    }
3601
3602    impl std::default::Default for MigrationType {
3603        fn default() -> Self {
3604            use std::convert::From;
3605            Self::from(0)
3606        }
3607    }
3608
3609    impl std::fmt::Display for MigrationType {
3610        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3611            wkt::internal::display_enum(f, self.name(), self.value())
3612        }
3613    }
3614
3615    impl std::convert::From<i32> for MigrationType {
3616        fn from(value: i32) -> Self {
3617            match value {
3618                0 => Self::Unspecified,
3619                1 => Self::Logical,
3620                2 => Self::Physical,
3621                _ => Self::UnknownValue(migration_type::UnknownValue(
3622                    wkt::internal::UnknownEnumValue::Integer(value),
3623                )),
3624            }
3625        }
3626    }
3627
3628    impl std::convert::From<&str> for MigrationType {
3629        fn from(value: &str) -> Self {
3630            use std::string::ToString;
3631            match value {
3632                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
3633                "LOGICAL" => Self::Logical,
3634                "PHYSICAL" => Self::Physical,
3635                _ => Self::UnknownValue(migration_type::UnknownValue(
3636                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3637                )),
3638            }
3639        }
3640    }
3641
3642    impl serde::ser::Serialize for MigrationType {
3643        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3644        where
3645            S: serde::Serializer,
3646        {
3647            match self {
3648                Self::Unspecified => serializer.serialize_i32(0),
3649                Self::Logical => serializer.serialize_i32(1),
3650                Self::Physical => serializer.serialize_i32(2),
3651                Self::UnknownValue(u) => u.0.serialize(serializer),
3652            }
3653        }
3654    }
3655
3656    impl<'de> serde::de::Deserialize<'de> for MigrationType {
3657        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3658        where
3659            D: serde::Deserializer<'de>,
3660        {
3661            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
3662                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
3663            ))
3664        }
3665    }
3666
3667    #[serde_with::serde_as]
3668    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3669    #[serde(rename_all = "camelCase")]
3670    #[non_exhaustive]
3671    pub enum SyncConfig {
3672        /// Optional. MySQL-specific settings for start external sync.
3673        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3674    }
3675}
3676
3677/// Instance start external sync request.
3678#[serde_with::serde_as]
3679#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3680#[serde(default, rename_all = "camelCase")]
3681#[non_exhaustive]
3682pub struct SqlInstancesStartExternalSyncRequest {
3683    /// Cloud SQL instance ID. This does not include the project ID.
3684    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3685    pub instance: std::string::String,
3686
3687    /// ID of the project that contains the instance.
3688    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3689    pub project: std::string::String,
3690
3691    /// External sync mode.
3692    pub sync_mode:
3693        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3694
3695    /// Whether to skip the verification step (VESS).
3696    #[serde(skip_serializing_if = "wkt::internal::is_default")]
3697    pub skip_verification: bool,
3698
3699    /// Optional. Parallel level for initial data sync. Currently only applicable
3700    /// for MySQL.
3701    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3702
3703    /// Optional. MigrationType configures the migration to use physical files or
3704    /// logical dump files. If not set, then the logical dump file configuration is
3705    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3706    pub migration_type:
3707        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3708
3709    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3710    pub sync_config:
3711        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
3712
3713    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3714    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3715}
3716
3717impl SqlInstancesStartExternalSyncRequest {
3718    pub fn new() -> Self {
3719        std::default::Default::default()
3720    }
3721
3722    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
3723    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3724        self.instance = v.into();
3725        self
3726    }
3727
3728    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
3729    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3730        self.project = v.into();
3731        self
3732    }
3733
3734    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
3735    pub fn set_sync_mode<
3736        T: std::convert::Into<
3737                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3738            >,
3739    >(
3740        mut self,
3741        v: T,
3742    ) -> Self {
3743        self.sync_mode = v.into();
3744        self
3745    }
3746
3747    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
3748    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3749        self.skip_verification = v.into();
3750        self
3751    }
3752
3753    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
3754    pub fn set_sync_parallel_level<
3755        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3756    >(
3757        mut self,
3758        v: T,
3759    ) -> Self {
3760        self.sync_parallel_level = v.into();
3761        self
3762    }
3763
3764    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
3765    pub fn set_migration_type<
3766        T: std::convert::Into<
3767                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3768            >,
3769    >(
3770        mut self,
3771        v: T,
3772    ) -> Self {
3773        self.migration_type = v.into();
3774        self
3775    }
3776
3777    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
3778    ///
3779    /// Note that all the setters affecting `sync_config` are mutually
3780    /// exclusive.
3781    pub fn set_sync_config<
3782        T: std::convert::Into<
3783                std::option::Option<
3784                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
3785                >,
3786            >,
3787    >(
3788        mut self,
3789        v: T,
3790    ) -> Self {
3791        self.sync_config = v.into();
3792        self
3793    }
3794
3795    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
3796    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
3797    /// holds a different branch.
3798    pub fn mysql_sync_config(
3799        &self,
3800    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3801        #[allow(unreachable_patterns)]
3802        self.sync_config.as_ref().and_then(|v| match v {
3803            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3804            _ => std::option::Option::None,
3805        })
3806    }
3807
3808    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
3809    /// to hold a `MysqlSyncConfig`.
3810    ///
3811    /// Note that all the setters affecting `sync_config` are
3812    /// mutually exclusive.
3813    pub fn set_mysql_sync_config<
3814        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3815    >(
3816        mut self,
3817        v: T,
3818    ) -> Self {
3819        self.sync_config = std::option::Option::Some(
3820            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
3821                v.into(),
3822            ),
3823        );
3824        self
3825    }
3826}
3827
3828impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
3829    fn typename() -> &'static str {
3830        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
3831    }
3832}
3833
3834/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
3835pub mod sql_instances_start_external_sync_request {
3836    #[allow(unused_imports)]
3837    use super::*;
3838
3839    #[serde_with::serde_as]
3840    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3841    #[serde(rename_all = "camelCase")]
3842    #[non_exhaustive]
3843    pub enum SyncConfig {
3844        /// MySQL-specific settings for start external sync.
3845        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3846    }
3847}
3848
3849/// Instance reset replica size request.
3850#[serde_with::serde_as]
3851#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3852#[serde(default, rename_all = "camelCase")]
3853#[non_exhaustive]
3854pub struct SqlInstancesResetReplicaSizeRequest {
3855    /// Cloud SQL read replica instance name.
3856    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3857    pub instance: std::string::String,
3858
3859    /// ID of the project that contains the read replica.
3860    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3861    pub project: std::string::String,
3862
3863    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3864    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3865}
3866
3867impl SqlInstancesResetReplicaSizeRequest {
3868    pub fn new() -> Self {
3869        std::default::Default::default()
3870    }
3871
3872    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
3873    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3874        self.instance = v.into();
3875        self
3876    }
3877
3878    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
3879    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3880        self.project = v.into();
3881        self
3882    }
3883}
3884
3885impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
3886    fn typename() -> &'static str {
3887        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
3888    }
3889}
3890
3891/// Instance create ephemeral certificate request.
3892#[serde_with::serde_as]
3893#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3894#[serde(default, rename_all = "camelCase")]
3895#[non_exhaustive]
3896pub struct SqlInstancesCreateEphemeralCertRequest {
3897    /// Cloud SQL instance ID. This does not include the project ID.
3898    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3899    pub instance: std::string::String,
3900
3901    /// Project ID of the Cloud SQL project.
3902    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3903    pub project: std::string::String,
3904
3905    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3906    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
3907
3908    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3909    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3910}
3911
3912impl SqlInstancesCreateEphemeralCertRequest {
3913    pub fn new() -> Self {
3914        std::default::Default::default()
3915    }
3916
3917    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
3918    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3919        self.instance = v.into();
3920        self
3921    }
3922
3923    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
3924    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3925        self.project = v.into();
3926        self
3927    }
3928
3929    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
3930    pub fn set_body<
3931        T: std::convert::Into<std::option::Option<crate::model::SslCertsCreateEphemeralRequest>>,
3932    >(
3933        mut self,
3934        v: T,
3935    ) -> Self {
3936        self.body = v.into();
3937        self
3938    }
3939}
3940
3941impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
3942    fn typename() -> &'static str {
3943        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
3944    }
3945}
3946
3947/// Database instance clone request.
3948#[serde_with::serde_as]
3949#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3950#[serde(default, rename_all = "camelCase")]
3951#[non_exhaustive]
3952pub struct InstancesCloneRequest {
3953    /// Contains details about the clone operation.
3954    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3955    pub clone_context: std::option::Option<crate::model::CloneContext>,
3956
3957    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3958    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3959}
3960
3961impl InstancesCloneRequest {
3962    pub fn new() -> Self {
3963        std::default::Default::default()
3964    }
3965
3966    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
3967    pub fn set_clone_context<
3968        T: std::convert::Into<std::option::Option<crate::model::CloneContext>>,
3969    >(
3970        mut self,
3971        v: T,
3972    ) -> Self {
3973        self.clone_context = v.into();
3974        self
3975    }
3976}
3977
3978impl wkt::message::Message for InstancesCloneRequest {
3979    fn typename() -> &'static str {
3980        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
3981    }
3982}
3983
3984/// Database demote primary instance request.
3985#[serde_with::serde_as]
3986#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3987#[serde(default, rename_all = "camelCase")]
3988#[non_exhaustive]
3989pub struct InstancesDemoteMasterRequest {
3990    /// Contains details about the demoteMaster operation.
3991    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3992    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
3993
3994    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3995    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3996}
3997
3998impl InstancesDemoteMasterRequest {
3999    pub fn new() -> Self {
4000        std::default::Default::default()
4001    }
4002
4003    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
4004    pub fn set_demote_master_context<
4005        T: std::convert::Into<std::option::Option<crate::model::DemoteMasterContext>>,
4006    >(
4007        mut self,
4008        v: T,
4009    ) -> Self {
4010        self.demote_master_context = v.into();
4011        self
4012    }
4013}
4014
4015impl wkt::message::Message for InstancesDemoteMasterRequest {
4016    fn typename() -> &'static str {
4017        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
4018    }
4019}
4020
4021/// This request is used to demote an existing standalone instance to be a
4022/// Cloud SQL read replica for an external database server.
4023#[serde_with::serde_as]
4024#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4025#[serde(default, rename_all = "camelCase")]
4026#[non_exhaustive]
4027pub struct InstancesDemoteRequest {
4028    /// Required. Contains details about the demote operation.
4029    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4030    pub demote_context: std::option::Option<crate::model::DemoteContext>,
4031
4032    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4033    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4034}
4035
4036impl InstancesDemoteRequest {
4037    pub fn new() -> Self {
4038        std::default::Default::default()
4039    }
4040
4041    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
4042    pub fn set_demote_context<
4043        T: std::convert::Into<std::option::Option<crate::model::DemoteContext>>,
4044    >(
4045        mut self,
4046        v: T,
4047    ) -> Self {
4048        self.demote_context = v.into();
4049        self
4050    }
4051}
4052
4053impl wkt::message::Message for InstancesDemoteRequest {
4054    fn typename() -> &'static str {
4055        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
4056    }
4057}
4058
4059/// Database instance export request.
4060#[serde_with::serde_as]
4061#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4062#[serde(default, rename_all = "camelCase")]
4063#[non_exhaustive]
4064pub struct InstancesExportRequest {
4065    /// Contains details about the export operation.
4066    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4067    pub export_context: std::option::Option<crate::model::ExportContext>,
4068
4069    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4070    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4071}
4072
4073impl InstancesExportRequest {
4074    pub fn new() -> Self {
4075        std::default::Default::default()
4076    }
4077
4078    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
4079    pub fn set_export_context<
4080        T: std::convert::Into<std::option::Option<crate::model::ExportContext>>,
4081    >(
4082        mut self,
4083        v: T,
4084    ) -> Self {
4085        self.export_context = v.into();
4086        self
4087    }
4088}
4089
4090impl wkt::message::Message for InstancesExportRequest {
4091    fn typename() -> &'static str {
4092        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
4093    }
4094}
4095
4096/// Instance failover request.
4097#[serde_with::serde_as]
4098#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4099#[serde(default, rename_all = "camelCase")]
4100#[non_exhaustive]
4101pub struct InstancesFailoverRequest {
4102    /// Failover Context.
4103    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4104    pub failover_context: std::option::Option<crate::model::FailoverContext>,
4105
4106    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4107    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4108}
4109
4110impl InstancesFailoverRequest {
4111    pub fn new() -> Self {
4112        std::default::Default::default()
4113    }
4114
4115    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
4116    pub fn set_failover_context<
4117        T: std::convert::Into<std::option::Option<crate::model::FailoverContext>>,
4118    >(
4119        mut self,
4120        v: T,
4121    ) -> Self {
4122        self.failover_context = v.into();
4123        self
4124    }
4125}
4126
4127impl wkt::message::Message for InstancesFailoverRequest {
4128    fn typename() -> &'static str {
4129        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
4130    }
4131}
4132
4133/// SslCerts create ephemeral certificate request.
4134#[serde_with::serde_as]
4135#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4136#[serde(default, rename_all = "camelCase")]
4137#[non_exhaustive]
4138pub struct SslCertsCreateEphemeralRequest {
4139    /// PEM encoded public key to include in the signed certificate.
4140    #[serde(rename = "public_key")]
4141    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4142    pub public_key: std::string::String,
4143
4144    /// Access token to include in the signed certificate.
4145    #[serde(rename = "access_token")]
4146    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4147    pub access_token: std::string::String,
4148
4149    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4150    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4151}
4152
4153impl SslCertsCreateEphemeralRequest {
4154    pub fn new() -> Self {
4155        std::default::Default::default()
4156    }
4157
4158    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
4159    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4160        self.public_key = v.into();
4161        self
4162    }
4163
4164    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
4165    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4166        self.access_token = v.into();
4167        self
4168    }
4169}
4170
4171impl wkt::message::Message for SslCertsCreateEphemeralRequest {
4172    fn typename() -> &'static str {
4173        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
4174    }
4175}
4176
4177/// Database instance import request.
4178#[serde_with::serde_as]
4179#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4180#[serde(default, rename_all = "camelCase")]
4181#[non_exhaustive]
4182pub struct InstancesImportRequest {
4183    /// Contains details about the import operation.
4184    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4185    pub import_context: std::option::Option<crate::model::ImportContext>,
4186
4187    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4188    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4189}
4190
4191impl InstancesImportRequest {
4192    pub fn new() -> Self {
4193        std::default::Default::default()
4194    }
4195
4196    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
4197    pub fn set_import_context<
4198        T: std::convert::Into<std::option::Option<crate::model::ImportContext>>,
4199    >(
4200        mut self,
4201        v: T,
4202    ) -> Self {
4203        self.import_context = v.into();
4204        self
4205    }
4206}
4207
4208impl wkt::message::Message for InstancesImportRequest {
4209    fn typename() -> &'static str {
4210        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
4211    }
4212}
4213
4214/// Database instances list response.
4215#[serde_with::serde_as]
4216#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4217#[serde(default, rename_all = "camelCase")]
4218#[non_exhaustive]
4219pub struct InstancesListResponse {
4220    /// This is always `sql#instancesList`.
4221    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4222    pub kind: std::string::String,
4223
4224    /// List of warnings that occurred while handling the request.
4225    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4226    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
4227
4228    /// List of database instance resources.
4229    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4230    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
4231
4232    /// The continuation token, used to page through large result sets. Provide
4233    /// this value in a subsequent request to return the next page of results.
4234    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4235    pub next_page_token: std::string::String,
4236
4237    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4238    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4239}
4240
4241impl InstancesListResponse {
4242    pub fn new() -> Self {
4243        std::default::Default::default()
4244    }
4245
4246    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
4247    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4248        self.kind = v.into();
4249        self
4250    }
4251
4252    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
4253    pub fn set_warnings<T, V>(mut self, v: T) -> Self
4254    where
4255        T: std::iter::IntoIterator<Item = V>,
4256        V: std::convert::Into<crate::model::ApiWarning>,
4257    {
4258        use std::iter::Iterator;
4259        self.warnings = v.into_iter().map(|i| i.into()).collect();
4260        self
4261    }
4262
4263    /// Sets the value of [items][crate::model::InstancesListResponse::items].
4264    pub fn set_items<T, V>(mut self, v: T) -> Self
4265    where
4266        T: std::iter::IntoIterator<Item = V>,
4267        V: std::convert::Into<crate::model::DatabaseInstance>,
4268    {
4269        use std::iter::Iterator;
4270        self.items = v.into_iter().map(|i| i.into()).collect();
4271        self
4272    }
4273
4274    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
4275    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4276        self.next_page_token = v.into();
4277        self
4278    }
4279}
4280
4281impl wkt::message::Message for InstancesListResponse {
4282    fn typename() -> &'static str {
4283        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
4284    }
4285}
4286
4287#[doc(hidden)]
4288impl gax::paginator::internal::PageableResponse for InstancesListResponse {
4289    type PageItem = crate::model::DatabaseInstance;
4290
4291    fn items(self) -> std::vec::Vec<Self::PageItem> {
4292        self.items
4293    }
4294
4295    fn next_page_token(&self) -> std::string::String {
4296        use std::clone::Clone;
4297        self.next_page_token.clone()
4298    }
4299}
4300
4301/// Instances ListServerCas response.
4302#[serde_with::serde_as]
4303#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4304#[serde(default, rename_all = "camelCase")]
4305#[non_exhaustive]
4306pub struct InstancesListServerCasResponse {
4307    /// List of server CA certificates for the instance.
4308    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4309    pub certs: std::vec::Vec<crate::model::SslCert>,
4310
4311    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4312    pub active_version: std::string::String,
4313
4314    /// This is always `sql#instancesListServerCas`.
4315    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4316    pub kind: std::string::String,
4317
4318    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4319    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4320}
4321
4322impl InstancesListServerCasResponse {
4323    pub fn new() -> Self {
4324        std::default::Default::default()
4325    }
4326
4327    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
4328    pub fn set_certs<T, V>(mut self, v: T) -> Self
4329    where
4330        T: std::iter::IntoIterator<Item = V>,
4331        V: std::convert::Into<crate::model::SslCert>,
4332    {
4333        use std::iter::Iterator;
4334        self.certs = v.into_iter().map(|i| i.into()).collect();
4335        self
4336    }
4337
4338    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
4339    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340        self.active_version = v.into();
4341        self
4342    }
4343
4344    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
4345    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4346        self.kind = v.into();
4347        self
4348    }
4349}
4350
4351impl wkt::message::Message for InstancesListServerCasResponse {
4352    fn typename() -> &'static str {
4353        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
4354    }
4355}
4356
4357/// Database instance restore backup request.
4358#[serde_with::serde_as]
4359#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4360#[serde(default, rename_all = "camelCase")]
4361#[non_exhaustive]
4362pub struct InstancesRestoreBackupRequest {
4363    /// Parameters required to perform the restore backup operation.
4364    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4365    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
4366
4367    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4368    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4369}
4370
4371impl InstancesRestoreBackupRequest {
4372    pub fn new() -> Self {
4373        std::default::Default::default()
4374    }
4375
4376    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
4377    pub fn set_restore_backup_context<
4378        T: std::convert::Into<std::option::Option<crate::model::RestoreBackupContext>>,
4379    >(
4380        mut self,
4381        v: T,
4382    ) -> Self {
4383        self.restore_backup_context = v.into();
4384        self
4385    }
4386}
4387
4388impl wkt::message::Message for InstancesRestoreBackupRequest {
4389    fn typename() -> &'static str {
4390        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
4391    }
4392}
4393
4394/// Rotate server CA request.
4395#[serde_with::serde_as]
4396#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4397#[serde(default, rename_all = "camelCase")]
4398#[non_exhaustive]
4399pub struct InstancesRotateServerCaRequest {
4400    /// Contains details about the rotate server CA operation.
4401    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4402    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
4403
4404    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4405    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4406}
4407
4408impl InstancesRotateServerCaRequest {
4409    pub fn new() -> Self {
4410        std::default::Default::default()
4411    }
4412
4413    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
4414    pub fn set_rotate_server_ca_context<
4415        T: std::convert::Into<std::option::Option<crate::model::RotateServerCaContext>>,
4416    >(
4417        mut self,
4418        v: T,
4419    ) -> Self {
4420        self.rotate_server_ca_context = v.into();
4421        self
4422    }
4423}
4424
4425impl wkt::message::Message for InstancesRotateServerCaRequest {
4426    fn typename() -> &'static str {
4427        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
4428    }
4429}
4430
4431/// Instance truncate log request.
4432#[serde_with::serde_as]
4433#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4434#[serde(default, rename_all = "camelCase")]
4435#[non_exhaustive]
4436pub struct InstancesTruncateLogRequest {
4437    /// Contains details about the truncate log operation.
4438    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4439    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
4440
4441    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4442    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4443}
4444
4445impl InstancesTruncateLogRequest {
4446    pub fn new() -> Self {
4447        std::default::Default::default()
4448    }
4449
4450    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
4451    pub fn set_truncate_log_context<
4452        T: std::convert::Into<std::option::Option<crate::model::TruncateLogContext>>,
4453    >(
4454        mut self,
4455        v: T,
4456    ) -> Self {
4457        self.truncate_log_context = v.into();
4458        self
4459    }
4460}
4461
4462impl wkt::message::Message for InstancesTruncateLogRequest {
4463    fn typename() -> &'static str {
4464        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
4465    }
4466}
4467
4468/// Request to acquire a lease for SSRS.
4469#[serde_with::serde_as]
4470#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4471#[serde(default, rename_all = "camelCase")]
4472#[non_exhaustive]
4473pub struct InstancesAcquireSsrsLeaseRequest {
4474    /// Contains details about the acquire SSRS lease operation.
4475    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4476    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
4477
4478    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4479    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl InstancesAcquireSsrsLeaseRequest {
4483    pub fn new() -> Self {
4484        std::default::Default::default()
4485    }
4486
4487    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
4488    pub fn set_acquire_ssrs_lease_context<
4489        T: std::convert::Into<std::option::Option<crate::model::AcquireSsrsLeaseContext>>,
4490    >(
4491        mut self,
4492        v: T,
4493    ) -> Self {
4494        self.acquire_ssrs_lease_context = v.into();
4495        self
4496    }
4497}
4498
4499impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
4500    fn typename() -> &'static str {
4501        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
4502    }
4503}
4504
4505/// Instance verify external sync settings response.
4506#[serde_with::serde_as]
4507#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4508#[serde(default, rename_all = "camelCase")]
4509#[non_exhaustive]
4510pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
4511    /// This is always `sql#migrationSettingErrorList`.
4512    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4513    pub kind: std::string::String,
4514
4515    /// List of migration violations.
4516    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4517    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4518
4519    /// List of migration warnings.
4520    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4521    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4522
4523    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4524    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4525}
4526
4527impl SqlInstancesVerifyExternalSyncSettingsResponse {
4528    pub fn new() -> Self {
4529        std::default::Default::default()
4530    }
4531
4532    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
4533    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4534        self.kind = v.into();
4535        self
4536    }
4537
4538    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
4539    pub fn set_errors<T, V>(mut self, v: T) -> Self
4540    where
4541        T: std::iter::IntoIterator<Item = V>,
4542        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4543    {
4544        use std::iter::Iterator;
4545        self.errors = v.into_iter().map(|i| i.into()).collect();
4546        self
4547    }
4548
4549    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
4550    pub fn set_warnings<T, V>(mut self, v: T) -> Self
4551    where
4552        T: std::iter::IntoIterator<Item = V>,
4553        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4554    {
4555        use std::iter::Iterator;
4556        self.warnings = v.into_iter().map(|i| i.into()).collect();
4557        self
4558    }
4559}
4560
4561impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
4562    fn typename() -> &'static str {
4563        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
4564    }
4565}
4566
4567/// Instance get disk shrink config response.
4568#[serde_with::serde_as]
4569#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4570#[serde(default, rename_all = "camelCase")]
4571#[non_exhaustive]
4572pub struct SqlInstancesGetDiskShrinkConfigResponse {
4573    /// This is always `sql#getDiskShrinkConfig`.
4574    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4575    pub kind: std::string::String,
4576
4577    /// The minimum size to which a disk can be shrunk in GigaBytes.
4578    #[serde(skip_serializing_if = "wkt::internal::is_default")]
4579    #[serde_as(as = "serde_with::DisplayFromStr")]
4580    pub minimal_target_size_gb: i64,
4581
4582    /// Additional message to customers.
4583    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4584    pub message: std::string::String,
4585
4586    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4587    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4588}
4589
4590impl SqlInstancesGetDiskShrinkConfigResponse {
4591    pub fn new() -> Self {
4592        std::default::Default::default()
4593    }
4594
4595    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
4596    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4597        self.kind = v.into();
4598        self
4599    }
4600
4601    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
4602    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4603        self.minimal_target_size_gb = v.into();
4604        self
4605    }
4606
4607    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
4608    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4609        self.message = v.into();
4610        self
4611    }
4612}
4613
4614impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
4615    fn typename() -> &'static str {
4616        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
4617    }
4618}
4619
4620/// Instance get latest recovery time request.
4621#[serde_with::serde_as]
4622#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4623#[serde(default, rename_all = "camelCase")]
4624#[non_exhaustive]
4625pub struct SqlInstancesGetLatestRecoveryTimeRequest {
4626    /// Cloud SQL instance ID. This does not include the project ID.
4627    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4628    pub instance: std::string::String,
4629
4630    /// Project ID of the project that contains the instance.
4631    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4632    pub project: std::string::String,
4633
4634    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4635    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4636}
4637
4638impl SqlInstancesGetLatestRecoveryTimeRequest {
4639    pub fn new() -> Self {
4640        std::default::Default::default()
4641    }
4642
4643    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
4644    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4645        self.instance = v.into();
4646        self
4647    }
4648
4649    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
4650    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4651        self.project = v.into();
4652        self
4653    }
4654}
4655
4656impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
4657    fn typename() -> &'static str {
4658        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
4659    }
4660}
4661
4662/// Instance get latest recovery time response.
4663#[serde_with::serde_as]
4664#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4665#[serde(default, rename_all = "camelCase")]
4666#[non_exhaustive]
4667pub struct SqlInstancesGetLatestRecoveryTimeResponse {
4668    /// This is always `sql#getLatestRecoveryTime`.
4669    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4670    pub kind: std::string::String,
4671
4672    /// Timestamp, identifies the latest recovery time of the source instance.
4673    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4674    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
4675
4676    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4677    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4678}
4679
4680impl SqlInstancesGetLatestRecoveryTimeResponse {
4681    pub fn new() -> Self {
4682        std::default::Default::default()
4683    }
4684
4685    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
4686    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4687        self.kind = v.into();
4688        self
4689    }
4690
4691    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
4692    pub fn set_latest_recovery_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4693        mut self,
4694        v: T,
4695    ) -> Self {
4696        self.latest_recovery_time = v.into();
4697        self
4698    }
4699}
4700
4701impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
4702    fn typename() -> &'static str {
4703        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
4704    }
4705}
4706
4707/// Database instance clone context.
4708#[serde_with::serde_as]
4709#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4710#[serde(default, rename_all = "camelCase")]
4711#[non_exhaustive]
4712pub struct CloneContext {
4713    /// This is always `sql#cloneContext`.
4714    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4715    pub kind: std::string::String,
4716
4717    /// Reserved for future use.
4718    #[serde(skip_serializing_if = "wkt::internal::is_default")]
4719    #[serde_as(as = "serde_with::DisplayFromStr")]
4720    pub pitr_timestamp_ms: i64,
4721
4722    /// Name of the Cloud SQL instance to be created as a clone.
4723    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4724    pub destination_instance_name: std::string::String,
4725
4726    /// Binary log coordinates, if specified, identify the position up to which the
4727    /// source instance is cloned. If not specified, the source instance is
4728    /// cloned up to the most recent binary log coordinates.
4729    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4730    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
4731
4732    /// Timestamp, if specified, identifies the time to which the source instance
4733    /// is cloned.
4734    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4735    pub point_in_time: std::option::Option<wkt::Timestamp>,
4736
4737    /// The name of the allocated ip range for the private ip Cloud SQL instance.
4738    /// For example: "google-managed-services-default". If set, the cloned instance
4739    /// ip will be created in the allocated range. The range name must comply with
4740    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
4741    /// must be 1-63 characters long and match the regular expression
4742    /// [a-z]([-a-z0-9]*[a-z0-9])?.
4743    /// Reserved for future use.
4744    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4745    pub allocated_ip_range: std::string::String,
4746
4747    /// (SQL Server only) Clone only the specified databases from the source
4748    /// instance. Clone all databases if empty.
4749    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4750    pub database_names: std::vec::Vec<std::string::String>,
4751
4752    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
4753    /// specified zone. If no zone is specified, clone to the same primary zone as
4754    /// the source instance. This field applies to all DB types.
4755    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4756    pub preferred_zone: std::option::Option<std::string::String>,
4757
4758    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4759    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4760}
4761
4762impl CloneContext {
4763    pub fn new() -> Self {
4764        std::default::Default::default()
4765    }
4766
4767    /// Sets the value of [kind][crate::model::CloneContext::kind].
4768    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4769        self.kind = v.into();
4770        self
4771    }
4772
4773    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
4774    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4775        self.pitr_timestamp_ms = v.into();
4776        self
4777    }
4778
4779    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
4780    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
4781        mut self,
4782        v: T,
4783    ) -> Self {
4784        self.destination_instance_name = v.into();
4785        self
4786    }
4787
4788    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
4789    pub fn set_bin_log_coordinates<
4790        T: std::convert::Into<std::option::Option<crate::model::BinLogCoordinates>>,
4791    >(
4792        mut self,
4793        v: T,
4794    ) -> Self {
4795        self.bin_log_coordinates = v.into();
4796        self
4797    }
4798
4799    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
4800    pub fn set_point_in_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4801        mut self,
4802        v: T,
4803    ) -> Self {
4804        self.point_in_time = v.into();
4805        self
4806    }
4807
4808    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
4809    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
4810        mut self,
4811        v: T,
4812    ) -> Self {
4813        self.allocated_ip_range = v.into();
4814        self
4815    }
4816
4817    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
4818    pub fn set_database_names<T, V>(mut self, v: T) -> Self
4819    where
4820        T: std::iter::IntoIterator<Item = V>,
4821        V: std::convert::Into<std::string::String>,
4822    {
4823        use std::iter::Iterator;
4824        self.database_names = v.into_iter().map(|i| i.into()).collect();
4825        self
4826    }
4827
4828    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
4829    pub fn set_preferred_zone<T: std::convert::Into<std::option::Option<std::string::String>>>(
4830        mut self,
4831        v: T,
4832    ) -> Self {
4833        self.preferred_zone = v.into();
4834        self
4835    }
4836}
4837
4838impl wkt::message::Message for CloneContext {
4839    fn typename() -> &'static str {
4840        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
4841    }
4842}
4843
4844/// Binary log coordinates.
4845#[serde_with::serde_as]
4846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4847#[serde(default, rename_all = "camelCase")]
4848#[non_exhaustive]
4849pub struct BinLogCoordinates {
4850    /// Name of the binary log file for a Cloud SQL instance.
4851    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4852    pub bin_log_file_name: std::string::String,
4853
4854    /// Position (offset) within the binary log file.
4855    #[serde(skip_serializing_if = "wkt::internal::is_default")]
4856    #[serde_as(as = "serde_with::DisplayFromStr")]
4857    pub bin_log_position: i64,
4858
4859    /// This is always `sql#binLogCoordinates`.
4860    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4861    pub kind: std::string::String,
4862
4863    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4864    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4865}
4866
4867impl BinLogCoordinates {
4868    pub fn new() -> Self {
4869        std::default::Default::default()
4870    }
4871
4872    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
4873    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
4874        mut self,
4875        v: T,
4876    ) -> Self {
4877        self.bin_log_file_name = v.into();
4878        self
4879    }
4880
4881    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
4882    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4883        self.bin_log_position = v.into();
4884        self
4885    }
4886
4887    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
4888    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4889        self.kind = v.into();
4890        self
4891    }
4892}
4893
4894impl wkt::message::Message for BinLogCoordinates {
4895    fn typename() -> &'static str {
4896        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
4897    }
4898}
4899
4900/// A Cloud SQL instance resource.
4901#[serde_with::serde_as]
4902#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4903#[serde(default, rename_all = "camelCase")]
4904#[non_exhaustive]
4905pub struct DatabaseInstance {
4906    /// This is always `sql#instance`.
4907    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4908    pub kind: std::string::String,
4909
4910    /// The current serving state of the Cloud SQL instance.
4911    pub state: crate::model::database_instance::SqlInstanceState,
4912
4913    /// The database engine type and version. The `databaseVersion` field cannot
4914    /// be changed after instance creation.
4915    pub database_version: crate::model::SqlDatabaseVersion,
4916
4917    /// The user settings.
4918    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4919    pub settings: std::option::Option<crate::model::Settings>,
4920
4921    /// This field is deprecated and will be removed from a future version of the
4922    /// API. Use the `settings.settingsVersion` field instead.
4923    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4924    pub etag: std::string::String,
4925
4926    /// The name and status of the failover replica.
4927    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4928    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
4929
4930    /// The name of the instance which will act as primary in the replication
4931    /// setup.
4932    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4933    pub master_instance_name: std::string::String,
4934
4935    /// The replicas of the instance.
4936    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4937    pub replica_names: std::vec::Vec<std::string::String>,
4938
4939    /// The maximum disk size of the instance in bytes.
4940    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4941    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4942    #[deprecated]
4943    pub max_disk_size: std::option::Option<wkt::Int64Value>,
4944
4945    /// The current disk usage of the instance in bytes. This property has been
4946    /// deprecated. Use the
4947    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
4948    /// Monitoring API instead. Please see [this
4949    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
4950    /// for details.
4951    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4952    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4953    #[deprecated]
4954    pub current_disk_size: std::option::Option<wkt::Int64Value>,
4955
4956    /// The assigned IP addresses for the instance.
4957    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4958    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
4959
4960    /// SSL configuration.
4961    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4962    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
4963
4964    /// The instance type.
4965    pub instance_type: crate::model::SqlInstanceType,
4966
4967    /// The project ID of the project containing the Cloud SQL instance. The Google
4968    /// apps domain is prefixed if applicable.
4969    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4970    pub project: std::string::String,
4971
4972    /// The IPv6 address assigned to the instance.
4973    /// (Deprecated) This property was applicable only
4974    /// to First Generation instances.
4975    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4976    #[deprecated]
4977    pub ipv6_address: std::string::String,
4978
4979    /// The service account email address assigned to the instance.\This
4980    /// property is read-only.
4981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4982    pub service_account_email_address: std::string::String,
4983
4984    /// Configuration specific to on-premises instances.
4985    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4986    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
4987
4988    /// Configuration specific to failover replicas and read replicas.
4989    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4990    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
4991
4992    /// The backend type.
4993    /// `SECOND_GEN`: Cloud SQL database instance.
4994    /// `EXTERNAL`: A database server that is not managed by Google.
4995    ///
4996    /// This property is read-only; use the `tier` property in the `settings`
4997    /// object to determine the database type.
4998    pub backend_type: crate::model::SqlBackendType,
4999
5000    /// The URI of this resource.
5001    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5002    pub self_link: std::string::String,
5003
5004    /// If the instance state is SUSPENDED, the reason for the suspension.
5005    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5006    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
5007
5008    /// Connection name of the Cloud SQL instance used in connection strings.
5009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5010    pub connection_name: std::string::String,
5011
5012    /// Name of the Cloud SQL instance. This does not include the project ID.
5013    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5014    pub name: std::string::String,
5015
5016    /// The geographical region of the Cloud SQL instance.
5017    ///
5018    /// It can be one of the
5019    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
5020    /// where Cloud SQL operates:
5021    ///
5022    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
5023    /// The default value is `us-central1`.
5024    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5025    pub region: std::string::String,
5026
5027    /// The Compute Engine zone that the instance is currently serving from. This
5028    /// value could be different from the zone that was specified when the instance
5029    /// was created if the instance has failed over to its secondary zone. WARNING:
5030    /// Changing this might restart the instance.
5031    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5032    pub gce_zone: std::string::String,
5033
5034    /// The Compute Engine zone that the failover instance is currently serving
5035    /// from for a regional instance. This value could be different
5036    /// from the zone that was specified when the instance
5037    /// was created if the instance has failed over to its secondary/failover zone.
5038    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5039    pub secondary_gce_zone: std::string::String,
5040
5041    /// Disk encryption configuration specific to an instance.
5042    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5043    pub disk_encryption_configuration:
5044        std::option::Option<crate::model::DiskEncryptionConfiguration>,
5045
5046    /// Disk encryption status specific to an instance.
5047    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5048    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
5049
5050    /// Initial root password. Use only on creation. You must set root passwords
5051    /// before you can connect to PostgreSQL instances.
5052    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5053    pub root_password: std::string::String,
5054
5055    /// The start time of any upcoming scheduled maintenance for this instance.
5056    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5057    pub scheduled_maintenance:
5058        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
5059
5060    /// This status indicates whether the instance satisfies PZS.
5061    ///
5062    /// The status is reserved for future use.
5063    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5064    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
5065
5066    /// Output only. Stores the current database version running on the instance
5067    /// including minor version such as `MYSQL_8_0_18`.
5068    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5069    pub database_installed_version: std::string::String,
5070
5071    /// This field represents the report generated by the proactive database
5072    /// wellness job for OutOfDisk issues.
5073    ///
5074    /// * Writers:
5075    /// * the proactive database wellness job for OOD.
5076    /// * Readers:
5077    /// * the proactive database wellness job
5078    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5079    pub out_of_disk_report:
5080        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
5081
5082    /// Output only. The time when the instance was created in
5083    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
5084    /// `2012-11-15T16:19:00.094Z`.
5085    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5086    pub create_time: std::option::Option<wkt::Timestamp>,
5087
5088    /// Output only. List all maintenance versions applicable on the instance
5089    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5090    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
5091
5092    /// The current software version on the instance.
5093    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5094    pub maintenance_version: std::string::String,
5095
5096    /// Output only. All database versions that are available for upgrade.
5097    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5098    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
5099
5100    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5101    pub sql_network_architecture:
5102        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
5103
5104    /// Output only. The link to service attachment of PSC instance.
5105    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5106    pub psc_service_attachment_link: std::option::Option<std::string::String>,
5107
5108    /// Output only. The dns name of the instance.
5109    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5110    pub dns_name: std::option::Option<std::string::String>,
5111
5112    /// Output only. DEPRECATED: please use write_endpoint instead.
5113    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5114    #[deprecated]
5115    pub primary_dns_name: std::option::Option<std::string::String>,
5116
5117    /// Output only. The dns name of the primary instance in a replication group.
5118    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5119    pub write_endpoint: std::option::Option<std::string::String>,
5120
5121    /// Optional. A primary instance and disaster recovery (DR) replica pair.
5122    /// A DR replica is a cross-region replica that you designate
5123    /// for failover in the event that the primary instance
5124    /// experiences regional failure. Only applicable to MySQL.
5125    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5126    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
5127
5128    /// Gemini instance configuration.
5129    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5130    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
5131
5132    /// Output only. This status indicates whether the instance satisfies PZI.
5133    ///
5134    /// The status is reserved for future use.
5135    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5136    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
5137
5138    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
5139    /// recovery log files from a data disk to Cloud Storage.
5140    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5141    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
5142
5143    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5144    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5145}
5146
5147impl DatabaseInstance {
5148    pub fn new() -> Self {
5149        std::default::Default::default()
5150    }
5151
5152    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
5153    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5154        self.kind = v.into();
5155        self
5156    }
5157
5158    /// Sets the value of [state][crate::model::DatabaseInstance::state].
5159    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
5160        mut self,
5161        v: T,
5162    ) -> Self {
5163        self.state = v.into();
5164        self
5165    }
5166
5167    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
5168    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
5169        mut self,
5170        v: T,
5171    ) -> Self {
5172        self.database_version = v.into();
5173        self
5174    }
5175
5176    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
5177    pub fn set_settings<T: std::convert::Into<std::option::Option<crate::model::Settings>>>(
5178        mut self,
5179        v: T,
5180    ) -> Self {
5181        self.settings = v.into();
5182        self
5183    }
5184
5185    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
5186    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5187        self.etag = v.into();
5188        self
5189    }
5190
5191    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
5192    pub fn set_failover_replica<
5193        T: std::convert::Into<
5194                std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
5195            >,
5196    >(
5197        mut self,
5198        v: T,
5199    ) -> Self {
5200        self.failover_replica = v.into();
5201        self
5202    }
5203
5204    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
5205    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
5206        mut self,
5207        v: T,
5208    ) -> Self {
5209        self.master_instance_name = v.into();
5210        self
5211    }
5212
5213    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
5214    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
5215    where
5216        T: std::iter::IntoIterator<Item = V>,
5217        V: std::convert::Into<std::string::String>,
5218    {
5219        use std::iter::Iterator;
5220        self.replica_names = v.into_iter().map(|i| i.into()).collect();
5221        self
5222    }
5223
5224    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
5225    #[deprecated]
5226    pub fn set_max_disk_size<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
5227        mut self,
5228        v: T,
5229    ) -> Self {
5230        self.max_disk_size = v.into();
5231        self
5232    }
5233
5234    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
5235    #[deprecated]
5236    pub fn set_current_disk_size<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
5237        mut self,
5238        v: T,
5239    ) -> Self {
5240        self.current_disk_size = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
5245    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
5246    where
5247        T: std::iter::IntoIterator<Item = V>,
5248        V: std::convert::Into<crate::model::IpMapping>,
5249    {
5250        use std::iter::Iterator;
5251        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
5252        self
5253    }
5254
5255    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
5256    pub fn set_server_ca_cert<T: std::convert::Into<std::option::Option<crate::model::SslCert>>>(
5257        mut self,
5258        v: T,
5259    ) -> Self {
5260        self.server_ca_cert = v.into();
5261        self
5262    }
5263
5264    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
5265    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
5266        mut self,
5267        v: T,
5268    ) -> Self {
5269        self.instance_type = v.into();
5270        self
5271    }
5272
5273    /// Sets the value of [project][crate::model::DatabaseInstance::project].
5274    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5275        self.project = v.into();
5276        self
5277    }
5278
5279    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
5280    #[deprecated]
5281    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5282        self.ipv6_address = v.into();
5283        self
5284    }
5285
5286    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
5287    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
5288        mut self,
5289        v: T,
5290    ) -> Self {
5291        self.service_account_email_address = v.into();
5292        self
5293    }
5294
5295    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
5296    pub fn set_on_premises_configuration<
5297        T: std::convert::Into<std::option::Option<crate::model::OnPremisesConfiguration>>,
5298    >(
5299        mut self,
5300        v: T,
5301    ) -> Self {
5302        self.on_premises_configuration = v.into();
5303        self
5304    }
5305
5306    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
5307    pub fn set_replica_configuration<
5308        T: std::convert::Into<std::option::Option<crate::model::ReplicaConfiguration>>,
5309    >(
5310        mut self,
5311        v: T,
5312    ) -> Self {
5313        self.replica_configuration = v.into();
5314        self
5315    }
5316
5317    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
5318    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
5319        mut self,
5320        v: T,
5321    ) -> Self {
5322        self.backend_type = v.into();
5323        self
5324    }
5325
5326    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
5327    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5328        self.self_link = v.into();
5329        self
5330    }
5331
5332    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
5333    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
5334    where
5335        T: std::iter::IntoIterator<Item = V>,
5336        V: std::convert::Into<crate::model::SqlSuspensionReason>,
5337    {
5338        use std::iter::Iterator;
5339        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
5340        self
5341    }
5342
5343    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
5344    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5345        self.connection_name = v.into();
5346        self
5347    }
5348
5349    /// Sets the value of [name][crate::model::DatabaseInstance::name].
5350    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5351        self.name = v.into();
5352        self
5353    }
5354
5355    /// Sets the value of [region][crate::model::DatabaseInstance::region].
5356    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5357        self.region = v.into();
5358        self
5359    }
5360
5361    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
5362    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363        self.gce_zone = v.into();
5364        self
5365    }
5366
5367    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
5368    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
5369        mut self,
5370        v: T,
5371    ) -> Self {
5372        self.secondary_gce_zone = v.into();
5373        self
5374    }
5375
5376    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
5377    pub fn set_disk_encryption_configuration<
5378        T: std::convert::Into<std::option::Option<crate::model::DiskEncryptionConfiguration>>,
5379    >(
5380        mut self,
5381        v: T,
5382    ) -> Self {
5383        self.disk_encryption_configuration = v.into();
5384        self
5385    }
5386
5387    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
5388    pub fn set_disk_encryption_status<
5389        T: std::convert::Into<std::option::Option<crate::model::DiskEncryptionStatus>>,
5390    >(
5391        mut self,
5392        v: T,
5393    ) -> Self {
5394        self.disk_encryption_status = v.into();
5395        self
5396    }
5397
5398    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
5399    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5400        self.root_password = v.into();
5401        self
5402    }
5403
5404    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
5405    pub fn set_scheduled_maintenance<
5406        T: std::convert::Into<
5407                std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
5408            >,
5409    >(
5410        mut self,
5411        v: T,
5412    ) -> Self {
5413        self.scheduled_maintenance = v.into();
5414        self
5415    }
5416
5417    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
5418    pub fn set_satisfies_pzs<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
5419        mut self,
5420        v: T,
5421    ) -> Self {
5422        self.satisfies_pzs = v.into();
5423        self
5424    }
5425
5426    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
5427    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
5428        mut self,
5429        v: T,
5430    ) -> Self {
5431        self.database_installed_version = v.into();
5432        self
5433    }
5434
5435    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
5436    pub fn set_out_of_disk_report<
5437        T: std::convert::Into<
5438                std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
5439            >,
5440    >(
5441        mut self,
5442        v: T,
5443    ) -> Self {
5444        self.out_of_disk_report = v.into();
5445        self
5446    }
5447
5448    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
5449    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5450        mut self,
5451        v: T,
5452    ) -> Self {
5453        self.create_time = v.into();
5454        self
5455    }
5456
5457    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
5458    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
5459    where
5460        T: std::iter::IntoIterator<Item = V>,
5461        V: std::convert::Into<std::string::String>,
5462    {
5463        use std::iter::Iterator;
5464        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
5465        self
5466    }
5467
5468    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
5469    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
5470        mut self,
5471        v: T,
5472    ) -> Self {
5473        self.maintenance_version = v.into();
5474        self
5475    }
5476
5477    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
5478    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
5479    where
5480        T: std::iter::IntoIterator<Item = V>,
5481        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
5482    {
5483        use std::iter::Iterator;
5484        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
5485        self
5486    }
5487
5488    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
5489    pub fn set_sql_network_architecture<
5490        T: std::convert::Into<
5491                std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
5492            >,
5493    >(
5494        mut self,
5495        v: T,
5496    ) -> Self {
5497        self.sql_network_architecture = v.into();
5498        self
5499    }
5500
5501    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
5502    pub fn set_psc_service_attachment_link<
5503        T: std::convert::Into<std::option::Option<std::string::String>>,
5504    >(
5505        mut self,
5506        v: T,
5507    ) -> Self {
5508        self.psc_service_attachment_link = v.into();
5509        self
5510    }
5511
5512    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
5513    pub fn set_dns_name<T: std::convert::Into<std::option::Option<std::string::String>>>(
5514        mut self,
5515        v: T,
5516    ) -> Self {
5517        self.dns_name = v.into();
5518        self
5519    }
5520
5521    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
5522    #[deprecated]
5523    pub fn set_primary_dns_name<T: std::convert::Into<std::option::Option<std::string::String>>>(
5524        mut self,
5525        v: T,
5526    ) -> Self {
5527        self.primary_dns_name = v.into();
5528        self
5529    }
5530
5531    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
5532    pub fn set_write_endpoint<T: std::convert::Into<std::option::Option<std::string::String>>>(
5533        mut self,
5534        v: T,
5535    ) -> Self {
5536        self.write_endpoint = v.into();
5537        self
5538    }
5539
5540    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
5541    pub fn set_replication_cluster<
5542        T: std::convert::Into<std::option::Option<crate::model::ReplicationCluster>>,
5543    >(
5544        mut self,
5545        v: T,
5546    ) -> Self {
5547        self.replication_cluster = v.into();
5548        self
5549    }
5550
5551    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
5552    pub fn set_gemini_config<
5553        T: std::convert::Into<std::option::Option<crate::model::GeminiInstanceConfig>>,
5554    >(
5555        mut self,
5556        v: T,
5557    ) -> Self {
5558        self.gemini_config = v.into();
5559        self
5560    }
5561
5562    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
5563    pub fn set_satisfies_pzi<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
5564        mut self,
5565        v: T,
5566    ) -> Self {
5567        self.satisfies_pzi = v.into();
5568        self
5569    }
5570
5571    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
5572    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<
5573        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
5574    >(
5575        mut self,
5576        v: T,
5577    ) -> Self {
5578        self.switch_transaction_logs_to_cloud_storage_enabled = v.into();
5579        self
5580    }
5581}
5582
5583impl wkt::message::Message for DatabaseInstance {
5584    fn typename() -> &'static str {
5585        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
5586    }
5587}
5588
5589/// Defines additional types related to [DatabaseInstance].
5590pub mod database_instance {
5591    #[allow(unused_imports)]
5592    use super::*;
5593
5594    #[serde_with::serde_as]
5595    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5596    #[serde(default, rename_all = "camelCase")]
5597    #[non_exhaustive]
5598    pub struct SqlFailoverReplica {
5599        /// The name of the failover replica. If specified at instance creation, a
5600        /// failover replica is created for the instance. The name
5601        /// doesn't include the project ID.
5602        #[serde(skip_serializing_if = "std::string::String::is_empty")]
5603        pub name: std::string::String,
5604
5605        /// The availability status of the failover replica. A false status indicates
5606        /// that the failover replica is out of sync. The primary instance can only
5607        /// failover to the failover replica when the status is true.
5608        #[serde(skip_serializing_if = "std::option::Option::is_none")]
5609        pub available: std::option::Option<wkt::BoolValue>,
5610
5611        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5612        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5613    }
5614
5615    impl SqlFailoverReplica {
5616        pub fn new() -> Self {
5617            std::default::Default::default()
5618        }
5619
5620        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
5621        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5622            self.name = v.into();
5623            self
5624        }
5625
5626        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
5627        pub fn set_available<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
5628            mut self,
5629            v: T,
5630        ) -> Self {
5631            self.available = v.into();
5632            self
5633        }
5634    }
5635
5636    impl wkt::message::Message for SqlFailoverReplica {
5637        fn typename() -> &'static str {
5638            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
5639        }
5640    }
5641
5642    /// Any scheduled maintenance for this instance.
5643    #[serde_with::serde_as]
5644    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5645    #[serde(default, rename_all = "camelCase")]
5646    #[non_exhaustive]
5647    pub struct SqlScheduledMaintenance {
5648        /// The start time of any upcoming scheduled maintenance for this instance.
5649        #[serde(skip_serializing_if = "std::option::Option::is_none")]
5650        pub start_time: std::option::Option<wkt::Timestamp>,
5651
5652        #[serde(skip_serializing_if = "wkt::internal::is_default")]
5653        #[deprecated]
5654        pub can_defer: bool,
5655
5656        /// If the scheduled maintenance can be rescheduled.
5657        #[serde(skip_serializing_if = "wkt::internal::is_default")]
5658        pub can_reschedule: bool,
5659
5660        /// Maintenance cannot be rescheduled to start beyond this deadline.
5661        #[serde(skip_serializing_if = "std::option::Option::is_none")]
5662        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
5663
5664        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5665        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5666    }
5667
5668    impl SqlScheduledMaintenance {
5669        pub fn new() -> Self {
5670            std::default::Default::default()
5671        }
5672
5673        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
5674        pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5675            mut self,
5676            v: T,
5677        ) -> Self {
5678            self.start_time = v.into();
5679            self
5680        }
5681
5682        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
5683        #[deprecated]
5684        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5685            self.can_defer = v.into();
5686            self
5687        }
5688
5689        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
5690        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5691            self.can_reschedule = v.into();
5692            self
5693        }
5694
5695        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
5696        pub fn set_schedule_deadline_time<
5697            T: std::convert::Into<std::option::Option<wkt::Timestamp>>,
5698        >(
5699            mut self,
5700            v: T,
5701        ) -> Self {
5702            self.schedule_deadline_time = v.into();
5703            self
5704        }
5705    }
5706
5707    impl wkt::message::Message for SqlScheduledMaintenance {
5708        fn typename() -> &'static str {
5709            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
5710        }
5711    }
5712
5713    /// This message wraps up the information written by out-of-disk detection job.
5714    #[serde_with::serde_as]
5715    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5716    #[serde(default, rename_all = "camelCase")]
5717    #[non_exhaustive]
5718    pub struct SqlOutOfDiskReport {
5719        /// This field represents the state generated by the proactive database
5720        /// wellness job for OutOfDisk issues.
5721        ///
5722        /// * Writers:
5723        /// * the proactive database wellness job for OOD.
5724        /// * Readers:
5725        /// * the proactive database wellness job
5726        #[serde(skip_serializing_if = "std::option::Option::is_none")]
5727        pub sql_out_of_disk_state: std::option::Option<
5728            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5729        >,
5730
5731        /// The minimum recommended increase size in GigaBytes
5732        /// This field is consumed by the frontend
5733        ///
5734        /// * Writers:
5735        /// * the proactive database wellness job for OOD.
5736        /// * Readers:
5737        #[serde(skip_serializing_if = "std::option::Option::is_none")]
5738        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
5739
5740        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5741        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5742    }
5743
5744    impl SqlOutOfDiskReport {
5745        pub fn new() -> Self {
5746            std::default::Default::default()
5747        }
5748
5749        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
5750        pub fn set_sql_out_of_disk_state<
5751            T: std::convert::Into<
5752                    std::option::Option<
5753                        crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5754                    >,
5755                >,
5756        >(
5757            mut self,
5758            v: T,
5759        ) -> Self {
5760            self.sql_out_of_disk_state = v.into();
5761            self
5762        }
5763
5764        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
5765        pub fn set_sql_min_recommended_increase_size_gb<
5766            T: std::convert::Into<std::option::Option<i32>>,
5767        >(
5768            mut self,
5769            v: T,
5770        ) -> Self {
5771            self.sql_min_recommended_increase_size_gb = v.into();
5772            self
5773        }
5774    }
5775
5776    impl wkt::message::Message for SqlOutOfDiskReport {
5777        fn typename() -> &'static str {
5778            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
5779        }
5780    }
5781
5782    /// Defines additional types related to [SqlOutOfDiskReport].
5783    pub mod sql_out_of_disk_report {
5784        #[allow(unused_imports)]
5785        use super::*;
5786
5787        /// This enum lists all possible states regarding out-of-disk issues.
5788        ///
5789        /// # Working with unknown values
5790        ///
5791        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5792        /// additional enum variants at any time. Adding new variants is not considered
5793        /// a breaking change. Applications should write their code in anticipation of:
5794        ///
5795        /// - New values appearing in future releases of the client library, **and**
5796        /// - New values received dynamically, without application changes.
5797        ///
5798        /// Please consult the [Working with enums] section in the user guide for some
5799        /// guidelines.
5800        ///
5801        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5802        #[derive(Clone, Debug, PartialEq)]
5803        #[non_exhaustive]
5804        pub enum SqlOutOfDiskState {
5805            /// Unspecified state
5806            Unspecified,
5807            /// The instance has plenty space on data disk
5808            Normal,
5809            /// Data disk is almost used up. It is shutdown to prevent data
5810            /// corruption.
5811            SoftShutdown,
5812            /// If set, the enum was initialized with an unknown value.
5813            ///
5814            /// Applications can examine the value using [SqlOutOfDiskState::value] or
5815            /// [SqlOutOfDiskState::name].
5816            UnknownValue(sql_out_of_disk_state::UnknownValue),
5817        }
5818
5819        #[doc(hidden)]
5820        pub mod sql_out_of_disk_state {
5821            #[allow(unused_imports)]
5822            use super::*;
5823            #[derive(Clone, Debug, PartialEq)]
5824            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5825        }
5826
5827        impl SqlOutOfDiskState {
5828            /// Gets the enum value.
5829            ///
5830            /// Returns `None` if the enum contains an unknown value deserialized from
5831            /// the string representation of enums.
5832            pub fn value(&self) -> std::option::Option<i32> {
5833                match self {
5834                    Self::Unspecified => std::option::Option::Some(0),
5835                    Self::Normal => std::option::Option::Some(1),
5836                    Self::SoftShutdown => std::option::Option::Some(2),
5837                    Self::UnknownValue(u) => u.0.value(),
5838                }
5839            }
5840
5841            /// Gets the enum value as a string.
5842            ///
5843            /// Returns `None` if the enum contains an unknown value deserialized from
5844            /// the integer representation of enums.
5845            pub fn name(&self) -> std::option::Option<&str> {
5846                match self {
5847                    Self::Unspecified => {
5848                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
5849                    }
5850                    Self::Normal => std::option::Option::Some("NORMAL"),
5851                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
5852                    Self::UnknownValue(u) => u.0.name(),
5853                }
5854            }
5855        }
5856
5857        impl std::default::Default for SqlOutOfDiskState {
5858            fn default() -> Self {
5859                use std::convert::From;
5860                Self::from(0)
5861            }
5862        }
5863
5864        impl std::fmt::Display for SqlOutOfDiskState {
5865            fn fmt(
5866                &self,
5867                f: &mut std::fmt::Formatter<'_>,
5868            ) -> std::result::Result<(), std::fmt::Error> {
5869                wkt::internal::display_enum(f, self.name(), self.value())
5870            }
5871        }
5872
5873        impl std::convert::From<i32> for SqlOutOfDiskState {
5874            fn from(value: i32) -> Self {
5875                match value {
5876                    0 => Self::Unspecified,
5877                    1 => Self::Normal,
5878                    2 => Self::SoftShutdown,
5879                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
5880                        wkt::internal::UnknownEnumValue::Integer(value),
5881                    )),
5882                }
5883            }
5884        }
5885
5886        impl std::convert::From<&str> for SqlOutOfDiskState {
5887            fn from(value: &str) -> Self {
5888                use std::string::ToString;
5889                match value {
5890                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
5891                    "NORMAL" => Self::Normal,
5892                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
5893                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
5894                        wkt::internal::UnknownEnumValue::String(value.to_string()),
5895                    )),
5896                }
5897            }
5898        }
5899
5900        impl serde::ser::Serialize for SqlOutOfDiskState {
5901            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5902            where
5903                S: serde::Serializer,
5904            {
5905                match self {
5906                    Self::Unspecified => serializer.serialize_i32(0),
5907                    Self::Normal => serializer.serialize_i32(1),
5908                    Self::SoftShutdown => serializer.serialize_i32(2),
5909                    Self::UnknownValue(u) => u.0.serialize(serializer),
5910                }
5911            }
5912        }
5913
5914        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
5915            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5916            where
5917                D: serde::Deserializer<'de>,
5918            {
5919                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
5920                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
5921                ))
5922            }
5923        }
5924    }
5925
5926    /// The current serving state of the database instance.
5927    ///
5928    /// # Working with unknown values
5929    ///
5930    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5931    /// additional enum variants at any time. Adding new variants is not considered
5932    /// a breaking change. Applications should write their code in anticipation of:
5933    ///
5934    /// - New values appearing in future releases of the client library, **and**
5935    /// - New values received dynamically, without application changes.
5936    ///
5937    /// Please consult the [Working with enums] section in the user guide for some
5938    /// guidelines.
5939    ///
5940    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5941    #[derive(Clone, Debug, PartialEq)]
5942    #[non_exhaustive]
5943    pub enum SqlInstanceState {
5944        /// The state of the instance is unknown.
5945        Unspecified,
5946        /// The instance is running, or has been stopped by owner.
5947        Runnable,
5948        /// The instance is not available, for example due to problems with billing.
5949        Suspended,
5950        /// The instance is being deleted.
5951        PendingDelete,
5952        /// The instance is being created.
5953        PendingCreate,
5954        /// The instance is down for maintenance.
5955        Maintenance,
5956        /// The creation of the instance failed or a fatal error occurred during
5957        /// maintenance.
5958        Failed,
5959        /// Deprecated
5960        #[deprecated]
5961        OnlineMaintenance,
5962        /// If set, the enum was initialized with an unknown value.
5963        ///
5964        /// Applications can examine the value using [SqlInstanceState::value] or
5965        /// [SqlInstanceState::name].
5966        UnknownValue(sql_instance_state::UnknownValue),
5967    }
5968
5969    #[doc(hidden)]
5970    pub mod sql_instance_state {
5971        #[allow(unused_imports)]
5972        use super::*;
5973        #[derive(Clone, Debug, PartialEq)]
5974        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5975    }
5976
5977    impl SqlInstanceState {
5978        /// Gets the enum value.
5979        ///
5980        /// Returns `None` if the enum contains an unknown value deserialized from
5981        /// the string representation of enums.
5982        pub fn value(&self) -> std::option::Option<i32> {
5983            match self {
5984                Self::Unspecified => std::option::Option::Some(0),
5985                Self::Runnable => std::option::Option::Some(1),
5986                Self::Suspended => std::option::Option::Some(2),
5987                Self::PendingDelete => std::option::Option::Some(3),
5988                Self::PendingCreate => std::option::Option::Some(4),
5989                Self::Maintenance => std::option::Option::Some(5),
5990                Self::Failed => std::option::Option::Some(6),
5991                Self::OnlineMaintenance => std::option::Option::Some(7),
5992                Self::UnknownValue(u) => u.0.value(),
5993            }
5994        }
5995
5996        /// Gets the enum value as a string.
5997        ///
5998        /// Returns `None` if the enum contains an unknown value deserialized from
5999        /// the integer representation of enums.
6000        pub fn name(&self) -> std::option::Option<&str> {
6001            match self {
6002                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
6003                Self::Runnable => std::option::Option::Some("RUNNABLE"),
6004                Self::Suspended => std::option::Option::Some("SUSPENDED"),
6005                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
6006                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
6007                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
6008                Self::Failed => std::option::Option::Some("FAILED"),
6009                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
6010                Self::UnknownValue(u) => u.0.name(),
6011            }
6012        }
6013    }
6014
6015    impl std::default::Default for SqlInstanceState {
6016        fn default() -> Self {
6017            use std::convert::From;
6018            Self::from(0)
6019        }
6020    }
6021
6022    impl std::fmt::Display for SqlInstanceState {
6023        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6024            wkt::internal::display_enum(f, self.name(), self.value())
6025        }
6026    }
6027
6028    impl std::convert::From<i32> for SqlInstanceState {
6029        fn from(value: i32) -> Self {
6030            match value {
6031                0 => Self::Unspecified,
6032                1 => Self::Runnable,
6033                2 => Self::Suspended,
6034                3 => Self::PendingDelete,
6035                4 => Self::PendingCreate,
6036                5 => Self::Maintenance,
6037                6 => Self::Failed,
6038                7 => Self::OnlineMaintenance,
6039                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6040                    wkt::internal::UnknownEnumValue::Integer(value),
6041                )),
6042            }
6043        }
6044    }
6045
6046    impl std::convert::From<&str> for SqlInstanceState {
6047        fn from(value: &str) -> Self {
6048            use std::string::ToString;
6049            match value {
6050                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
6051                "RUNNABLE" => Self::Runnable,
6052                "SUSPENDED" => Self::Suspended,
6053                "PENDING_DELETE" => Self::PendingDelete,
6054                "PENDING_CREATE" => Self::PendingCreate,
6055                "MAINTENANCE" => Self::Maintenance,
6056                "FAILED" => Self::Failed,
6057                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
6058                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6059                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6060                )),
6061            }
6062        }
6063    }
6064
6065    impl serde::ser::Serialize for SqlInstanceState {
6066        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6067        where
6068            S: serde::Serializer,
6069        {
6070            match self {
6071                Self::Unspecified => serializer.serialize_i32(0),
6072                Self::Runnable => serializer.serialize_i32(1),
6073                Self::Suspended => serializer.serialize_i32(2),
6074                Self::PendingDelete => serializer.serialize_i32(3),
6075                Self::PendingCreate => serializer.serialize_i32(4),
6076                Self::Maintenance => serializer.serialize_i32(5),
6077                Self::Failed => serializer.serialize_i32(6),
6078                Self::OnlineMaintenance => serializer.serialize_i32(7),
6079                Self::UnknownValue(u) => u.0.serialize(serializer),
6080            }
6081        }
6082    }
6083
6084    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
6085        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6086        where
6087            D: serde::Deserializer<'de>,
6088        {
6089            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
6090                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
6091            ))
6092        }
6093    }
6094
6095    /// The SQL network architecture for the instance.
6096    ///
6097    /// # Working with unknown values
6098    ///
6099    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6100    /// additional enum variants at any time. Adding new variants is not considered
6101    /// a breaking change. Applications should write their code in anticipation of:
6102    ///
6103    /// - New values appearing in future releases of the client library, **and**
6104    /// - New values received dynamically, without application changes.
6105    ///
6106    /// Please consult the [Working with enums] section in the user guide for some
6107    /// guidelines.
6108    ///
6109    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6110    #[derive(Clone, Debug, PartialEq)]
6111    #[non_exhaustive]
6112    pub enum SqlNetworkArchitecture {
6113        Unspecified,
6114        /// The instance uses the new network architecture.
6115        NewNetworkArchitecture,
6116        /// The instance uses the old network architecture.
6117        OldNetworkArchitecture,
6118        /// If set, the enum was initialized with an unknown value.
6119        ///
6120        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
6121        /// [SqlNetworkArchitecture::name].
6122        UnknownValue(sql_network_architecture::UnknownValue),
6123    }
6124
6125    #[doc(hidden)]
6126    pub mod sql_network_architecture {
6127        #[allow(unused_imports)]
6128        use super::*;
6129        #[derive(Clone, Debug, PartialEq)]
6130        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6131    }
6132
6133    impl SqlNetworkArchitecture {
6134        /// Gets the enum value.
6135        ///
6136        /// Returns `None` if the enum contains an unknown value deserialized from
6137        /// the string representation of enums.
6138        pub fn value(&self) -> std::option::Option<i32> {
6139            match self {
6140                Self::Unspecified => std::option::Option::Some(0),
6141                Self::NewNetworkArchitecture => std::option::Option::Some(1),
6142                Self::OldNetworkArchitecture => std::option::Option::Some(2),
6143                Self::UnknownValue(u) => u.0.value(),
6144            }
6145        }
6146
6147        /// Gets the enum value as a string.
6148        ///
6149        /// Returns `None` if the enum contains an unknown value deserialized from
6150        /// the integer representation of enums.
6151        pub fn name(&self) -> std::option::Option<&str> {
6152            match self {
6153                Self::Unspecified => {
6154                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
6155                }
6156                Self::NewNetworkArchitecture => {
6157                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
6158                }
6159                Self::OldNetworkArchitecture => {
6160                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
6161                }
6162                Self::UnknownValue(u) => u.0.name(),
6163            }
6164        }
6165    }
6166
6167    impl std::default::Default for SqlNetworkArchitecture {
6168        fn default() -> Self {
6169            use std::convert::From;
6170            Self::from(0)
6171        }
6172    }
6173
6174    impl std::fmt::Display for SqlNetworkArchitecture {
6175        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6176            wkt::internal::display_enum(f, self.name(), self.value())
6177        }
6178    }
6179
6180    impl std::convert::From<i32> for SqlNetworkArchitecture {
6181        fn from(value: i32) -> Self {
6182            match value {
6183                0 => Self::Unspecified,
6184                1 => Self::NewNetworkArchitecture,
6185                2 => Self::OldNetworkArchitecture,
6186                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6187                    wkt::internal::UnknownEnumValue::Integer(value),
6188                )),
6189            }
6190        }
6191    }
6192
6193    impl std::convert::From<&str> for SqlNetworkArchitecture {
6194        fn from(value: &str) -> Self {
6195            use std::string::ToString;
6196            match value {
6197                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
6198                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
6199                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
6200                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6201                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6202                )),
6203            }
6204        }
6205    }
6206
6207    impl serde::ser::Serialize for SqlNetworkArchitecture {
6208        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6209        where
6210            S: serde::Serializer,
6211        {
6212            match self {
6213                Self::Unspecified => serializer.serialize_i32(0),
6214                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
6215                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
6216                Self::UnknownValue(u) => u.0.serialize(serializer),
6217            }
6218        }
6219    }
6220
6221    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
6222        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6223        where
6224            D: serde::Deserializer<'de>,
6225        {
6226            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
6227                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
6228            ))
6229        }
6230    }
6231}
6232
6233/// Gemini instance configuration.
6234#[serde_with::serde_as]
6235#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6236#[serde(default, rename_all = "camelCase")]
6237#[non_exhaustive]
6238pub struct GeminiInstanceConfig {
6239    /// Output only. Whether Gemini is enabled.
6240    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6241    pub entitled: std::option::Option<bool>,
6242
6243    /// Output only. Whether the vacuum management is enabled.
6244    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6245    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
6246
6247    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
6248    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6249    pub oom_session_cancel_enabled: std::option::Option<bool>,
6250
6251    /// Output only. Whether the active query is enabled.
6252    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6253    pub active_query_enabled: std::option::Option<bool>,
6254
6255    /// Output only. Whether the index advisor is enabled.
6256    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6257    pub index_advisor_enabled: std::option::Option<bool>,
6258
6259    /// Output only. Whether the flag recommender is enabled.
6260    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6261    pub flag_recommender_enabled: std::option::Option<bool>,
6262
6263    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6264    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6265}
6266
6267impl GeminiInstanceConfig {
6268    pub fn new() -> Self {
6269        std::default::Default::default()
6270    }
6271
6272    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
6273    pub fn set_entitled<T: std::convert::Into<std::option::Option<bool>>>(mut self, v: T) -> Self {
6274        self.entitled = v.into();
6275        self
6276    }
6277
6278    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
6279    pub fn set_google_vacuum_mgmt_enabled<T: std::convert::Into<std::option::Option<bool>>>(
6280        mut self,
6281        v: T,
6282    ) -> Self {
6283        self.google_vacuum_mgmt_enabled = v.into();
6284        self
6285    }
6286
6287    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
6288    pub fn set_oom_session_cancel_enabled<T: std::convert::Into<std::option::Option<bool>>>(
6289        mut self,
6290        v: T,
6291    ) -> Self {
6292        self.oom_session_cancel_enabled = v.into();
6293        self
6294    }
6295
6296    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
6297    pub fn set_active_query_enabled<T: std::convert::Into<std::option::Option<bool>>>(
6298        mut self,
6299        v: T,
6300    ) -> Self {
6301        self.active_query_enabled = v.into();
6302        self
6303    }
6304
6305    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
6306    pub fn set_index_advisor_enabled<T: std::convert::Into<std::option::Option<bool>>>(
6307        mut self,
6308        v: T,
6309    ) -> Self {
6310        self.index_advisor_enabled = v.into();
6311        self
6312    }
6313
6314    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
6315    pub fn set_flag_recommender_enabled<T: std::convert::Into<std::option::Option<bool>>>(
6316        mut self,
6317        v: T,
6318    ) -> Self {
6319        self.flag_recommender_enabled = v.into();
6320        self
6321    }
6322}
6323
6324impl wkt::message::Message for GeminiInstanceConfig {
6325    fn typename() -> &'static str {
6326        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
6327    }
6328}
6329
6330/// A primary instance and disaster recovery (DR) replica pair.
6331/// A DR replica is a cross-region replica that you designate for failover in
6332/// the event that the primary instance experiences regional failure.
6333/// Only applicable to MySQL.
6334#[serde_with::serde_as]
6335#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6336#[serde(default, rename_all = "camelCase")]
6337#[non_exhaustive]
6338pub struct ReplicationCluster {
6339    /// Output only. If set, it indicates this instance has a private service
6340    /// access (PSA) dns endpoint that is pointing to the primary instance of the
6341    /// cluster. If this instance is the primary, the dns should be pointing to
6342    /// this instance. After Switchover or Replica failover, this DNS endpoint
6343    /// points to the promoted instance. This is a read-only field, returned to the
6344    /// user as information. This field can exist even if a standalone instance
6345    /// does not yet have a replica, or had a DR replica that was deleted.
6346    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6347    pub psa_write_endpoint: std::string::String,
6348
6349    /// Optional. If the instance is a primary instance, then this field identifies
6350    /// the disaster recovery (DR) replica. A DR replica is an optional
6351    /// configuration for Enterprise Plus edition instances. If the instance is a
6352    /// read replica, then the field is not set. Set this field to a replica name
6353    /// to designate a DR replica for a primary instance. Remove the replica name
6354    /// to remove the DR replica designation.
6355    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6356    pub failover_dr_replica_name: std::string::String,
6357
6358    /// Output only. Read-only field that indicates whether the replica is a DR
6359    /// replica. This field is not set if the instance is a primary instance.
6360    #[serde(skip_serializing_if = "wkt::internal::is_default")]
6361    pub dr_replica: bool,
6362
6363    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6364    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6365}
6366
6367impl ReplicationCluster {
6368    pub fn new() -> Self {
6369        std::default::Default::default()
6370    }
6371
6372    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
6373    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
6374        mut self,
6375        v: T,
6376    ) -> Self {
6377        self.psa_write_endpoint = v.into();
6378        self
6379    }
6380
6381    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
6382    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
6383        mut self,
6384        v: T,
6385    ) -> Self {
6386        self.failover_dr_replica_name = v.into();
6387        self
6388    }
6389
6390    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
6391    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6392        self.dr_replica = v.into();
6393        self
6394    }
6395}
6396
6397impl wkt::message::Message for ReplicationCluster {
6398    fn typename() -> &'static str {
6399        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
6400    }
6401}
6402
6403/// An available database version. It can be a major or a minor version.
6404#[serde_with::serde_as]
6405#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6406#[serde(default, rename_all = "camelCase")]
6407#[non_exhaustive]
6408pub struct AvailableDatabaseVersion {
6409    /// The version's major version name.
6410    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6411    pub major_version: std::option::Option<std::string::String>,
6412
6413    /// The database version name. For MySQL 8.0, this string provides the database
6414    /// major and minor version.
6415    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6416    pub name: std::option::Option<std::string::String>,
6417
6418    /// The database version's display name.
6419    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6420    pub display_name: std::option::Option<std::string::String>,
6421
6422    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6423    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6424}
6425
6426impl AvailableDatabaseVersion {
6427    pub fn new() -> Self {
6428        std::default::Default::default()
6429    }
6430
6431    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
6432    pub fn set_major_version<T: std::convert::Into<std::option::Option<std::string::String>>>(
6433        mut self,
6434        v: T,
6435    ) -> Self {
6436        self.major_version = v.into();
6437        self
6438    }
6439
6440    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
6441    pub fn set_name<T: std::convert::Into<std::option::Option<std::string::String>>>(
6442        mut self,
6443        v: T,
6444    ) -> Self {
6445        self.name = v.into();
6446        self
6447    }
6448
6449    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
6450    pub fn set_display_name<T: std::convert::Into<std::option::Option<std::string::String>>>(
6451        mut self,
6452        v: T,
6453    ) -> Self {
6454        self.display_name = v.into();
6455        self
6456    }
6457}
6458
6459impl wkt::message::Message for AvailableDatabaseVersion {
6460    fn typename() -> &'static str {
6461        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
6462    }
6463}
6464
6465/// Reschedule options for maintenance windows.
6466#[serde_with::serde_as]
6467#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6468#[serde(default, rename_all = "camelCase")]
6469#[non_exhaustive]
6470pub struct SqlInstancesRescheduleMaintenanceRequestBody {
6471    /// Required. The type of the reschedule the user wants.
6472    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6473    pub reschedule: std::option::Option<
6474        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6475    >,
6476
6477    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6478    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6479}
6480
6481impl SqlInstancesRescheduleMaintenanceRequestBody {
6482    pub fn new() -> Self {
6483        std::default::Default::default()
6484    }
6485
6486    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
6487    pub fn set_reschedule<
6488        T: std::convert::Into<
6489                std::option::Option<
6490                    crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6491                >,
6492            >,
6493    >(
6494        mut self,
6495        v: T,
6496    ) -> Self {
6497        self.reschedule = v.into();
6498        self
6499    }
6500}
6501
6502impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
6503    fn typename() -> &'static str {
6504        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
6505    }
6506}
6507
6508/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
6509pub mod sql_instances_reschedule_maintenance_request_body {
6510    #[allow(unused_imports)]
6511    use super::*;
6512
6513    #[serde_with::serde_as]
6514    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6515    #[serde(default, rename_all = "camelCase")]
6516    #[non_exhaustive]
6517    pub struct Reschedule {
6518        /// Required. The type of the reschedule.
6519        pub reschedule_type:
6520            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6521
6522        /// Optional. Timestamp when the maintenance shall be rescheduled to if
6523        /// reschedule_type=SPECIFIC_TIME, in
6524        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
6525        /// `2012-11-15T16:19:00.094Z`.
6526        #[serde(skip_serializing_if = "std::option::Option::is_none")]
6527        pub schedule_time: std::option::Option<wkt::Timestamp>,
6528
6529        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6530        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6531    }
6532
6533    impl Reschedule {
6534        pub fn new() -> Self {
6535            std::default::Default::default()
6536        }
6537
6538        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
6539        pub fn set_reschedule_type<
6540            T: std::convert::Into<
6541                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6542                >,
6543        >(
6544            mut self,
6545            v: T,
6546        ) -> Self {
6547            self.reschedule_type = v.into();
6548            self
6549        }
6550
6551        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
6552        pub fn set_schedule_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6553            mut self,
6554            v: T,
6555        ) -> Self {
6556            self.schedule_time = v.into();
6557            self
6558        }
6559    }
6560
6561    impl wkt::message::Message for Reschedule {
6562        fn typename() -> &'static str {
6563            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
6564        }
6565    }
6566
6567    ///
6568    /// # Working with unknown values
6569    ///
6570    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6571    /// additional enum variants at any time. Adding new variants is not considered
6572    /// a breaking change. Applications should write their code in anticipation of:
6573    ///
6574    /// - New values appearing in future releases of the client library, **and**
6575    /// - New values received dynamically, without application changes.
6576    ///
6577    /// Please consult the [Working with enums] section in the user guide for some
6578    /// guidelines.
6579    ///
6580    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6581    #[derive(Clone, Debug, PartialEq)]
6582    #[non_exhaustive]
6583    pub enum RescheduleType {
6584        Unspecified,
6585        /// Reschedules maintenance to happen now (within 5 minutes).
6586        Immediate,
6587        /// Reschedules maintenance to occur within one week from the originally
6588        /// scheduled day and time.
6589        NextAvailableWindow,
6590        /// Reschedules maintenance to a specific time and day.
6591        SpecificTime,
6592        /// If set, the enum was initialized with an unknown value.
6593        ///
6594        /// Applications can examine the value using [RescheduleType::value] or
6595        /// [RescheduleType::name].
6596        UnknownValue(reschedule_type::UnknownValue),
6597    }
6598
6599    #[doc(hidden)]
6600    pub mod reschedule_type {
6601        #[allow(unused_imports)]
6602        use super::*;
6603        #[derive(Clone, Debug, PartialEq)]
6604        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6605    }
6606
6607    impl RescheduleType {
6608        /// Gets the enum value.
6609        ///
6610        /// Returns `None` if the enum contains an unknown value deserialized from
6611        /// the string representation of enums.
6612        pub fn value(&self) -> std::option::Option<i32> {
6613            match self {
6614                Self::Unspecified => std::option::Option::Some(0),
6615                Self::Immediate => std::option::Option::Some(1),
6616                Self::NextAvailableWindow => std::option::Option::Some(2),
6617                Self::SpecificTime => std::option::Option::Some(3),
6618                Self::UnknownValue(u) => u.0.value(),
6619            }
6620        }
6621
6622        /// Gets the enum value as a string.
6623        ///
6624        /// Returns `None` if the enum contains an unknown value deserialized from
6625        /// the integer representation of enums.
6626        pub fn name(&self) -> std::option::Option<&str> {
6627            match self {
6628                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
6629                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
6630                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
6631                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
6632                Self::UnknownValue(u) => u.0.name(),
6633            }
6634        }
6635    }
6636
6637    impl std::default::Default for RescheduleType {
6638        fn default() -> Self {
6639            use std::convert::From;
6640            Self::from(0)
6641        }
6642    }
6643
6644    impl std::fmt::Display for RescheduleType {
6645        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6646            wkt::internal::display_enum(f, self.name(), self.value())
6647        }
6648    }
6649
6650    impl std::convert::From<i32> for RescheduleType {
6651        fn from(value: i32) -> Self {
6652            match value {
6653                0 => Self::Unspecified,
6654                1 => Self::Immediate,
6655                2 => Self::NextAvailableWindow,
6656                3 => Self::SpecificTime,
6657                _ => Self::UnknownValue(reschedule_type::UnknownValue(
6658                    wkt::internal::UnknownEnumValue::Integer(value),
6659                )),
6660            }
6661        }
6662    }
6663
6664    impl std::convert::From<&str> for RescheduleType {
6665        fn from(value: &str) -> Self {
6666            use std::string::ToString;
6667            match value {
6668                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
6669                "IMMEDIATE" => Self::Immediate,
6670                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
6671                "SPECIFIC_TIME" => Self::SpecificTime,
6672                _ => Self::UnknownValue(reschedule_type::UnknownValue(
6673                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6674                )),
6675            }
6676        }
6677    }
6678
6679    impl serde::ser::Serialize for RescheduleType {
6680        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6681        where
6682            S: serde::Serializer,
6683        {
6684            match self {
6685                Self::Unspecified => serializer.serialize_i32(0),
6686                Self::Immediate => serializer.serialize_i32(1),
6687                Self::NextAvailableWindow => serializer.serialize_i32(2),
6688                Self::SpecificTime => serializer.serialize_i32(3),
6689                Self::UnknownValue(u) => u.0.serialize(serializer),
6690            }
6691        }
6692    }
6693
6694    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
6695        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6696        where
6697            D: serde::Deserializer<'de>,
6698        {
6699            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
6700                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
6701            ))
6702        }
6703    }
6704}
6705
6706/// Database instance demote primary instance context.
6707#[serde_with::serde_as]
6708#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6709#[serde(default, rename_all = "camelCase")]
6710#[non_exhaustive]
6711pub struct DemoteMasterContext {
6712    /// This is always `sql#demoteMasterContext`.
6713    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6714    pub kind: std::string::String,
6715
6716    /// Verify the GTID consistency for demote operation. Default value:
6717    /// `True`. Setting this flag to `false` enables you to bypass the GTID
6718    /// consistency check between on-premises primary instance and Cloud SQL
6719    /// instance during the demotion operation but also exposes you to the risk of
6720    /// future replication failures. Change the value only if you know the reason
6721    /// for the GTID divergence and are confident that doing so will not cause any
6722    /// replication issues.
6723    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6724    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
6725
6726    /// The name of the instance which will act as on-premises primary instance
6727    /// in the replication setup.
6728    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6729    pub master_instance_name: std::string::String,
6730
6731    /// Configuration specific to read-replicas replicating from the on-premises
6732    /// primary instance.
6733    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6734    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
6735
6736    /// Flag to skip replication setup on the instance.
6737    #[serde(skip_serializing_if = "wkt::internal::is_default")]
6738    pub skip_replication_setup: bool,
6739
6740    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6741    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6742}
6743
6744impl DemoteMasterContext {
6745    pub fn new() -> Self {
6746        std::default::Default::default()
6747    }
6748
6749    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
6750    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6751        self.kind = v.into();
6752        self
6753    }
6754
6755    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
6756    pub fn set_verify_gtid_consistency<
6757        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
6758    >(
6759        mut self,
6760        v: T,
6761    ) -> Self {
6762        self.verify_gtid_consistency = v.into();
6763        self
6764    }
6765
6766    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
6767    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
6768        mut self,
6769        v: T,
6770    ) -> Self {
6771        self.master_instance_name = v.into();
6772        self
6773    }
6774
6775    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
6776    pub fn set_replica_configuration<
6777        T: std::convert::Into<std::option::Option<crate::model::DemoteMasterConfiguration>>,
6778    >(
6779        mut self,
6780        v: T,
6781    ) -> Self {
6782        self.replica_configuration = v.into();
6783        self
6784    }
6785
6786    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
6787    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6788        self.skip_replication_setup = v.into();
6789        self
6790    }
6791}
6792
6793impl wkt::message::Message for DemoteMasterContext {
6794    fn typename() -> &'static str {
6795        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
6796    }
6797}
6798
6799/// This context is used to demote an existing standalone instance to be
6800/// a Cloud SQL read replica for an external database server.
6801#[serde_with::serde_as]
6802#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6803#[serde(default, rename_all = "camelCase")]
6804#[non_exhaustive]
6805pub struct DemoteContext {
6806    /// This is always `sql#demoteContext`.
6807    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6808    pub kind: std::string::String,
6809
6810    /// Required. The name of the instance which acts as the on-premises primary
6811    /// instance in the replication setup.
6812    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6813    pub source_representative_instance_name: std::string::String,
6814
6815    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6816    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6817}
6818
6819impl DemoteContext {
6820    pub fn new() -> Self {
6821        std::default::Default::default()
6822    }
6823
6824    /// Sets the value of [kind][crate::model::DemoteContext::kind].
6825    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6826        self.kind = v.into();
6827        self
6828    }
6829
6830    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
6831    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
6832        mut self,
6833        v: T,
6834    ) -> Self {
6835        self.source_representative_instance_name = v.into();
6836        self
6837    }
6838}
6839
6840impl wkt::message::Message for DemoteContext {
6841    fn typename() -> &'static str {
6842        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
6843    }
6844}
6845
6846/// Database instance failover context.
6847#[serde_with::serde_as]
6848#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6849#[serde(default, rename_all = "camelCase")]
6850#[non_exhaustive]
6851pub struct FailoverContext {
6852    /// The current settings version of this instance. Request will be rejected if
6853    /// this version doesn't match the current settings version.
6854    #[serde(skip_serializing_if = "wkt::internal::is_default")]
6855    #[serde_as(as = "serde_with::DisplayFromStr")]
6856    pub settings_version: i64,
6857
6858    /// This is always `sql#failoverContext`.
6859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6860    pub kind: std::string::String,
6861
6862    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6863    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6864}
6865
6866impl FailoverContext {
6867    pub fn new() -> Self {
6868        std::default::Default::default()
6869    }
6870
6871    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
6872    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6873        self.settings_version = v.into();
6874        self
6875    }
6876
6877    /// Sets the value of [kind][crate::model::FailoverContext::kind].
6878    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6879        self.kind = v.into();
6880        self
6881    }
6882}
6883
6884impl wkt::message::Message for FailoverContext {
6885    fn typename() -> &'static str {
6886        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
6887    }
6888}
6889
6890/// Database instance restore from backup context.
6891/// Backup context contains source instance id and project id.
6892#[serde_with::serde_as]
6893#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6894#[serde(default, rename_all = "camelCase")]
6895#[non_exhaustive]
6896pub struct RestoreBackupContext {
6897    /// This is always `sql#restoreBackupContext`.
6898    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6899    pub kind: std::string::String,
6900
6901    /// The ID of the backup run to restore from.
6902    #[serde(skip_serializing_if = "wkt::internal::is_default")]
6903    #[serde_as(as = "serde_with::DisplayFromStr")]
6904    pub backup_run_id: i64,
6905
6906    /// The ID of the instance that the backup was taken from.
6907    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6908    pub instance_id: std::string::String,
6909
6910    /// The full project ID of the source instance.
6911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6912    pub project: std::string::String,
6913
6914    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6915    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6916}
6917
6918impl RestoreBackupContext {
6919    pub fn new() -> Self {
6920        std::default::Default::default()
6921    }
6922
6923    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
6924    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6925        self.kind = v.into();
6926        self
6927    }
6928
6929    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
6930    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6931        self.backup_run_id = v.into();
6932        self
6933    }
6934
6935    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
6936    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6937        self.instance_id = v.into();
6938        self
6939    }
6940
6941    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
6942    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6943        self.project = v.into();
6944        self
6945    }
6946}
6947
6948impl wkt::message::Message for RestoreBackupContext {
6949    fn typename() -> &'static str {
6950        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
6951    }
6952}
6953
6954/// Instance rotate server CA context.
6955#[serde_with::serde_as]
6956#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6957#[serde(default, rename_all = "camelCase")]
6958#[non_exhaustive]
6959pub struct RotateServerCaContext {
6960    /// This is always `sql#rotateServerCaContext`.
6961    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6962    pub kind: std::string::String,
6963
6964    /// The fingerprint of the next version to be rotated to. If left unspecified,
6965    /// will be rotated to the most recently added server CA version.
6966    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6967    pub next_version: std::string::String,
6968
6969    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6970    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6971}
6972
6973impl RotateServerCaContext {
6974    pub fn new() -> Self {
6975        std::default::Default::default()
6976    }
6977
6978    /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
6979    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6980        self.kind = v.into();
6981        self
6982    }
6983
6984    /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
6985    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6986        self.next_version = v.into();
6987        self
6988    }
6989}
6990
6991impl wkt::message::Message for RotateServerCaContext {
6992    fn typename() -> &'static str {
6993        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
6994    }
6995}
6996
6997/// Database Instance truncate log context.
6998#[serde_with::serde_as]
6999#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7000#[serde(default, rename_all = "camelCase")]
7001#[non_exhaustive]
7002pub struct TruncateLogContext {
7003    /// This is always `sql#truncateLogContext`.
7004    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7005    pub kind: std::string::String,
7006
7007    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
7008    /// `MYSQL_SLOW_TABLE`.
7009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7010    pub log_type: std::string::String,
7011
7012    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7013    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7014}
7015
7016impl TruncateLogContext {
7017    pub fn new() -> Self {
7018        std::default::Default::default()
7019    }
7020
7021    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
7022    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7023        self.kind = v.into();
7024        self
7025    }
7026
7027    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
7028    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7029        self.log_type = v.into();
7030        self
7031    }
7032}
7033
7034impl wkt::message::Message for TruncateLogContext {
7035    fn typename() -> &'static str {
7036        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
7037    }
7038}
7039
7040/// External primary instance migration setting error/warning.
7041#[serde_with::serde_as]
7042#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7043#[serde(default, rename_all = "camelCase")]
7044#[non_exhaustive]
7045pub struct SqlExternalSyncSettingError {
7046    /// Can be `sql#externalSyncSettingError` or
7047    /// `sql#externalSyncSettingWarning`.
7048    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7049    pub kind: std::string::String,
7050
7051    /// Identifies the specific error that occurred.
7052    #[serde(rename = "type")]
7053    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7054
7055    /// Additional information about the error encountered.
7056    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7057    pub detail: std::string::String,
7058
7059    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7060    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7061}
7062
7063impl SqlExternalSyncSettingError {
7064    pub fn new() -> Self {
7065        std::default::Default::default()
7066    }
7067
7068    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
7069    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7070        self.kind = v.into();
7071        self
7072    }
7073
7074    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
7075    pub fn set_type<
7076        T: std::convert::Into<
7077                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7078            >,
7079    >(
7080        mut self,
7081        v: T,
7082    ) -> Self {
7083        self.r#type = v.into();
7084        self
7085    }
7086
7087    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
7088    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7089        self.detail = v.into();
7090        self
7091    }
7092}
7093
7094impl wkt::message::Message for SqlExternalSyncSettingError {
7095    fn typename() -> &'static str {
7096        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
7097    }
7098}
7099
7100/// Defines additional types related to [SqlExternalSyncSettingError].
7101pub mod sql_external_sync_setting_error {
7102    #[allow(unused_imports)]
7103    use super::*;
7104
7105    ///
7106    /// # Working with unknown values
7107    ///
7108    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7109    /// additional enum variants at any time. Adding new variants is not considered
7110    /// a breaking change. Applications should write their code in anticipation of:
7111    ///
7112    /// - New values appearing in future releases of the client library, **and**
7113    /// - New values received dynamically, without application changes.
7114    ///
7115    /// Please consult the [Working with enums] section in the user guide for some
7116    /// guidelines.
7117    ///
7118    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7119    #[derive(Clone, Debug, PartialEq)]
7120    #[non_exhaustive]
7121    pub enum SqlExternalSyncSettingErrorType {
7122        Unspecified,
7123        ConnectionFailure,
7124        BinlogNotEnabled,
7125        IncompatibleDatabaseVersion,
7126        ReplicaAlreadySetup,
7127        /// The replication user is missing privileges that are required.
7128        InsufficientPrivilege,
7129        /// Unsupported migration type.
7130        UnsupportedMigrationType,
7131        /// No pglogical extension installed on databases, applicable for postgres.
7132        NoPglogicalInstalled,
7133        /// pglogical node already exists on databases, applicable for postgres.
7134        PglogicalNodeAlreadyExists,
7135        /// The value of parameter wal_level is not set to logical.
7136        InvalidWalLevel,
7137        /// The value of parameter shared_preload_libraries does not include
7138        /// pglogical.
7139        InvalidSharedPreloadLibrary,
7140        /// The value of parameter max_replication_slots is not sufficient.
7141        InsufficientMaxReplicationSlots,
7142        /// The value of parameter max_wal_senders is not sufficient.
7143        InsufficientMaxWalSenders,
7144        /// The value of parameter max_worker_processes is not sufficient.
7145        InsufficientMaxWorkerProcesses,
7146        /// Extensions installed are either not supported or having unsupported
7147        /// versions.
7148        UnsupportedExtensions,
7149        /// The value of parameter rds.logical_replication is not set to 1.
7150        InvalidRdsLogicalReplication,
7151        /// The primary instance logging setup doesn't allow EM sync.
7152        InvalidLoggingSetup,
7153        /// The primary instance database parameter setup doesn't allow EM sync.
7154        InvalidDbParam,
7155        /// The gtid_mode is not supported, applicable for MySQL.
7156        UnsupportedGtidMode,
7157        /// SQL Server Agent is not running.
7158        SqlserverAgentNotRunning,
7159        /// The table definition is not support due to missing primary key or replica
7160        /// identity, applicable for postgres.
7161        UnsupportedTableDefinition,
7162        /// The customer has a definer that will break EM setup.
7163        UnsupportedDefiner,
7164        /// SQL Server @@SERVERNAME does not match actual host name.
7165        SqlserverServernameMismatch,
7166        /// The primary instance has been setup and will fail the setup.
7167        PrimaryAlreadySetup,
7168        /// The primary instance has unsupported binary log format.
7169        UnsupportedBinlogFormat,
7170        /// The primary instance's binary log retention setting.
7171        BinlogRetentionSetting,
7172        /// The primary instance has tables with unsupported storage engine.
7173        UnsupportedStorageEngine,
7174        /// Source has tables with limited support
7175        /// eg: PostgreSQL tables without primary keys.
7176        LimitedSupportTables,
7177        /// The replica instance contains existing data.
7178        ExistingDataInReplica,
7179        /// The replication user is missing privileges that are optional.
7180        MissingOptionalPrivileges,
7181        /// Additional BACKUP_ADMIN privilege is granted to the replication user
7182        /// which may lock source MySQL 8 instance for DDLs during initial sync.
7183        RiskyBackupAdminPrivilege,
7184        /// The Cloud Storage bucket is missing necessary permissions.
7185        InsufficientGcsPermissions,
7186        /// The Cloud Storage bucket has an error in the file or contains invalid
7187        /// file information.
7188        InvalidFileInfo,
7189        /// The source instance has unsupported database settings for migration.
7190        UnsupportedDatabaseSettings,
7191        /// The replication user is missing parallel import specific privileges.
7192        /// (e.g. LOCK TABLES) for MySQL.
7193        MysqlParallelImportInsufficientPrivilege,
7194        /// The global variable local_infile is off on external server replica.
7195        LocalInfileOff,
7196        /// This code instructs customers to turn on point-in-time recovery manually
7197        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
7198        TurnOnPitrAfterPromote,
7199        /// The minor version of replica database is incompatible with the source.
7200        IncompatibleDatabaseMinorVersion,
7201        /// This warning message indicates that Cloud SQL uses the maximum number of
7202        /// subscriptions to migrate data from the source to the destination.
7203        SourceMaxSubscriptions,
7204        /// Unable to verify definers on the source for MySQL.
7205        UnableToVerifyDefiners,
7206        /// If a time out occurs while the subscription counts are calculated, then
7207        /// this value is set to 1. Otherwise, this value is set to 2.
7208        SubscriptionCalculationStatus,
7209        /// Count of subscriptions needed to sync source data for PostgreSQL
7210        /// database.
7211        PgSubscriptionCount,
7212        /// Final parallel level that is used to do migration.
7213        PgSyncParallelLevel,
7214        /// The disk size of the replica instance is smaller than the data size of
7215        /// the source instance.
7216        InsufficientDiskSize,
7217        /// The data size of the source instance is greater than 1 TB, the number of
7218        /// cores of the replica instance is less than 8, and the memory of the
7219        /// replica is less than 32 GB.
7220        InsufficientMachineTier,
7221        /// The warning message indicates the unsupported extensions will not be
7222        /// migrated to the destination.
7223        UnsupportedExtensionsNotMigrated,
7224        /// The warning message indicates the pg_cron extension and settings will not
7225        /// be migrated to the destination.
7226        ExtensionsNotMigrated,
7227        /// The error message indicates that pg_cron flags are enabled on the
7228        /// destination which is not supported during the migration.
7229        PgCronFlagEnabledInReplica,
7230        /// This error message indicates that the specified extensions are not
7231        /// enabled on destination instance. For example, before you can migrate
7232        /// data to the destination instance, you must enable the PGAudit extension
7233        /// on the instance.
7234        ExtensionsNotEnabledInReplica,
7235        /// The source database has generated columns that can't be migrated. Please
7236        /// change them to regular columns before migration.
7237        UnsupportedColumns,
7238        /// If set, the enum was initialized with an unknown value.
7239        ///
7240        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
7241        /// [SqlExternalSyncSettingErrorType::name].
7242        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
7243    }
7244
7245    #[doc(hidden)]
7246    pub mod sql_external_sync_setting_error_type {
7247        #[allow(unused_imports)]
7248        use super::*;
7249        #[derive(Clone, Debug, PartialEq)]
7250        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7251    }
7252
7253    impl SqlExternalSyncSettingErrorType {
7254        /// Gets the enum value.
7255        ///
7256        /// Returns `None` if the enum contains an unknown value deserialized from
7257        /// the string representation of enums.
7258        pub fn value(&self) -> std::option::Option<i32> {
7259            match self {
7260                Self::Unspecified => std::option::Option::Some(0),
7261                Self::ConnectionFailure => std::option::Option::Some(1),
7262                Self::BinlogNotEnabled => std::option::Option::Some(2),
7263                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
7264                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
7265                Self::InsufficientPrivilege => std::option::Option::Some(5),
7266                Self::UnsupportedMigrationType => std::option::Option::Some(6),
7267                Self::NoPglogicalInstalled => std::option::Option::Some(7),
7268                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
7269                Self::InvalidWalLevel => std::option::Option::Some(9),
7270                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
7271                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
7272                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
7273                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
7274                Self::UnsupportedExtensions => std::option::Option::Some(14),
7275                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
7276                Self::InvalidLoggingSetup => std::option::Option::Some(16),
7277                Self::InvalidDbParam => std::option::Option::Some(17),
7278                Self::UnsupportedGtidMode => std::option::Option::Some(18),
7279                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
7280                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
7281                Self::UnsupportedDefiner => std::option::Option::Some(21),
7282                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
7283                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
7284                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
7285                Self::BinlogRetentionSetting => std::option::Option::Some(25),
7286                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
7287                Self::LimitedSupportTables => std::option::Option::Some(27),
7288                Self::ExistingDataInReplica => std::option::Option::Some(28),
7289                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
7290                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
7291                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
7292                Self::InvalidFileInfo => std::option::Option::Some(32),
7293                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
7294                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
7295                Self::LocalInfileOff => std::option::Option::Some(35),
7296                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
7297                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
7298                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
7299                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
7300                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
7301                Self::PgSubscriptionCount => std::option::Option::Some(41),
7302                Self::PgSyncParallelLevel => std::option::Option::Some(42),
7303                Self::InsufficientDiskSize => std::option::Option::Some(43),
7304                Self::InsufficientMachineTier => std::option::Option::Some(44),
7305                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
7306                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
7307                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
7308                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
7309                Self::UnsupportedColumns => std::option::Option::Some(49),
7310                Self::UnknownValue(u) => u.0.value(),
7311            }
7312        }
7313
7314        /// Gets the enum value as a string.
7315        ///
7316        /// Returns `None` if the enum contains an unknown value deserialized from
7317        /// the integer representation of enums.
7318        pub fn name(&self) -> std::option::Option<&str> {
7319            match self {
7320                Self::Unspecified => {
7321                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
7322                }
7323                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
7324                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
7325                Self::IncompatibleDatabaseVersion => {
7326                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
7327                }
7328                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
7329                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
7330                Self::UnsupportedMigrationType => {
7331                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
7332                }
7333                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
7334                Self::PglogicalNodeAlreadyExists => {
7335                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
7336                }
7337                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
7338                Self::InvalidSharedPreloadLibrary => {
7339                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
7340                }
7341                Self::InsufficientMaxReplicationSlots => {
7342                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
7343                }
7344                Self::InsufficientMaxWalSenders => {
7345                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
7346                }
7347                Self::InsufficientMaxWorkerProcesses => {
7348                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
7349                }
7350                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
7351                Self::InvalidRdsLogicalReplication => {
7352                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
7353                }
7354                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
7355                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
7356                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
7357                Self::SqlserverAgentNotRunning => {
7358                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
7359                }
7360                Self::UnsupportedTableDefinition => {
7361                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
7362                }
7363                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
7364                Self::SqlserverServernameMismatch => {
7365                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
7366                }
7367                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
7368                Self::UnsupportedBinlogFormat => {
7369                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
7370                }
7371                Self::BinlogRetentionSetting => {
7372                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
7373                }
7374                Self::UnsupportedStorageEngine => {
7375                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
7376                }
7377                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
7378                Self::ExistingDataInReplica => {
7379                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
7380                }
7381                Self::MissingOptionalPrivileges => {
7382                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
7383                }
7384                Self::RiskyBackupAdminPrivilege => {
7385                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
7386                }
7387                Self::InsufficientGcsPermissions => {
7388                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
7389                }
7390                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
7391                Self::UnsupportedDatabaseSettings => {
7392                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
7393                }
7394                Self::MysqlParallelImportInsufficientPrivilege => {
7395                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
7396                }
7397                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
7398                Self::TurnOnPitrAfterPromote => {
7399                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
7400                }
7401                Self::IncompatibleDatabaseMinorVersion => {
7402                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
7403                }
7404                Self::SourceMaxSubscriptions => {
7405                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
7406                }
7407                Self::UnableToVerifyDefiners => {
7408                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
7409                }
7410                Self::SubscriptionCalculationStatus => {
7411                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
7412                }
7413                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
7414                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
7415                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
7416                Self::InsufficientMachineTier => {
7417                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
7418                }
7419                Self::UnsupportedExtensionsNotMigrated => {
7420                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
7421                }
7422                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
7423                Self::PgCronFlagEnabledInReplica => {
7424                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
7425                }
7426                Self::ExtensionsNotEnabledInReplica => {
7427                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
7428                }
7429                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
7430                Self::UnknownValue(u) => u.0.name(),
7431            }
7432        }
7433    }
7434
7435    impl std::default::Default for SqlExternalSyncSettingErrorType {
7436        fn default() -> Self {
7437            use std::convert::From;
7438            Self::from(0)
7439        }
7440    }
7441
7442    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
7443        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7444            wkt::internal::display_enum(f, self.name(), self.value())
7445        }
7446    }
7447
7448    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
7449        fn from(value: i32) -> Self {
7450            match value {
7451                0 => Self::Unspecified,
7452                1 => Self::ConnectionFailure,
7453                2 => Self::BinlogNotEnabled,
7454                3 => Self::IncompatibleDatabaseVersion,
7455                4 => Self::ReplicaAlreadySetup,
7456                5 => Self::InsufficientPrivilege,
7457                6 => Self::UnsupportedMigrationType,
7458                7 => Self::NoPglogicalInstalled,
7459                8 => Self::PglogicalNodeAlreadyExists,
7460                9 => Self::InvalidWalLevel,
7461                10 => Self::InvalidSharedPreloadLibrary,
7462                11 => Self::InsufficientMaxReplicationSlots,
7463                12 => Self::InsufficientMaxWalSenders,
7464                13 => Self::InsufficientMaxWorkerProcesses,
7465                14 => Self::UnsupportedExtensions,
7466                15 => Self::InvalidRdsLogicalReplication,
7467                16 => Self::InvalidLoggingSetup,
7468                17 => Self::InvalidDbParam,
7469                18 => Self::UnsupportedGtidMode,
7470                19 => Self::SqlserverAgentNotRunning,
7471                20 => Self::UnsupportedTableDefinition,
7472                21 => Self::UnsupportedDefiner,
7473                22 => Self::SqlserverServernameMismatch,
7474                23 => Self::PrimaryAlreadySetup,
7475                24 => Self::UnsupportedBinlogFormat,
7476                25 => Self::BinlogRetentionSetting,
7477                26 => Self::UnsupportedStorageEngine,
7478                27 => Self::LimitedSupportTables,
7479                28 => Self::ExistingDataInReplica,
7480                29 => Self::MissingOptionalPrivileges,
7481                30 => Self::RiskyBackupAdminPrivilege,
7482                31 => Self::InsufficientGcsPermissions,
7483                32 => Self::InvalidFileInfo,
7484                33 => Self::UnsupportedDatabaseSettings,
7485                34 => Self::MysqlParallelImportInsufficientPrivilege,
7486                35 => Self::LocalInfileOff,
7487                36 => Self::TurnOnPitrAfterPromote,
7488                37 => Self::IncompatibleDatabaseMinorVersion,
7489                38 => Self::SourceMaxSubscriptions,
7490                39 => Self::UnableToVerifyDefiners,
7491                40 => Self::SubscriptionCalculationStatus,
7492                41 => Self::PgSubscriptionCount,
7493                42 => Self::PgSyncParallelLevel,
7494                43 => Self::InsufficientDiskSize,
7495                44 => Self::InsufficientMachineTier,
7496                45 => Self::UnsupportedExtensionsNotMigrated,
7497                46 => Self::ExtensionsNotMigrated,
7498                47 => Self::PgCronFlagEnabledInReplica,
7499                48 => Self::ExtensionsNotEnabledInReplica,
7500                49 => Self::UnsupportedColumns,
7501                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7502                    wkt::internal::UnknownEnumValue::Integer(value),
7503                )),
7504            }
7505        }
7506    }
7507
7508    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
7509        fn from(value: &str) -> Self {
7510            use std::string::ToString;
7511            match value {
7512                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
7513                "CONNECTION_FAILURE" => Self::ConnectionFailure,
7514                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
7515                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
7516                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
7517                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
7518                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
7519                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
7520                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
7521                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
7522                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
7523                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
7524                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
7525                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
7526                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
7527                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
7528                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
7529                "INVALID_DB_PARAM" => Self::InvalidDbParam,
7530                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
7531                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
7532                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
7533                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
7534                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
7535                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
7536                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
7537                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
7538                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
7539                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
7540                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
7541                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
7542                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
7543                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
7544                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
7545                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
7546                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
7547                    Self::MysqlParallelImportInsufficientPrivilege
7548                }
7549                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
7550                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
7551                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
7552                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
7553                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
7554                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
7555                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
7556                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
7557                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
7558                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
7559                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
7560                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
7561                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
7562                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
7563                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
7564                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7565                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7566                )),
7567            }
7568        }
7569    }
7570
7571    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
7572        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7573        where
7574            S: serde::Serializer,
7575        {
7576            match self {
7577                Self::Unspecified => serializer.serialize_i32(0),
7578                Self::ConnectionFailure => serializer.serialize_i32(1),
7579                Self::BinlogNotEnabled => serializer.serialize_i32(2),
7580                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
7581                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
7582                Self::InsufficientPrivilege => serializer.serialize_i32(5),
7583                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
7584                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
7585                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
7586                Self::InvalidWalLevel => serializer.serialize_i32(9),
7587                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
7588                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
7589                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
7590                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
7591                Self::UnsupportedExtensions => serializer.serialize_i32(14),
7592                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
7593                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
7594                Self::InvalidDbParam => serializer.serialize_i32(17),
7595                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
7596                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
7597                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
7598                Self::UnsupportedDefiner => serializer.serialize_i32(21),
7599                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
7600                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
7601                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
7602                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
7603                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
7604                Self::LimitedSupportTables => serializer.serialize_i32(27),
7605                Self::ExistingDataInReplica => serializer.serialize_i32(28),
7606                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
7607                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
7608                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
7609                Self::InvalidFileInfo => serializer.serialize_i32(32),
7610                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
7611                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
7612                Self::LocalInfileOff => serializer.serialize_i32(35),
7613                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
7614                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
7615                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
7616                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
7617                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
7618                Self::PgSubscriptionCount => serializer.serialize_i32(41),
7619                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
7620                Self::InsufficientDiskSize => serializer.serialize_i32(43),
7621                Self::InsufficientMachineTier => serializer.serialize_i32(44),
7622                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
7623                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
7624                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
7625                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
7626                Self::UnsupportedColumns => serializer.serialize_i32(49),
7627                Self::UnknownValue(u) => u.0.serialize(serializer),
7628            }
7629        }
7630    }
7631
7632    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
7633        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7634        where
7635            D: serde::Deserializer<'de>,
7636        {
7637            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
7638                SqlExternalSyncSettingErrorType,
7639            >::new(
7640                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
7641            ))
7642        }
7643    }
7644}
7645
7646/// On-premises instance configuration.
7647#[serde_with::serde_as]
7648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7649#[serde(default, rename_all = "camelCase")]
7650#[non_exhaustive]
7651pub struct OnPremisesConfiguration {
7652    /// The host and port of the on-premises instance in host:port format
7653    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7654    pub host_port: std::string::String,
7655
7656    /// This is always `sql#onPremisesConfiguration`.
7657    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7658    pub kind: std::string::String,
7659
7660    /// The username for connecting to on-premises instance.
7661    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7662    pub username: std::string::String,
7663
7664    /// The password for connecting to on-premises instance.
7665    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7666    pub password: std::string::String,
7667
7668    /// PEM representation of the trusted CA's x509 certificate.
7669    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7670    pub ca_certificate: std::string::String,
7671
7672    /// PEM representation of the replica's x509 certificate.
7673    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7674    pub client_certificate: std::string::String,
7675
7676    /// PEM representation of the replica's private key. The corresponsing public
7677    /// key is encoded in the client's certificate.
7678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7679    pub client_key: std::string::String,
7680
7681    /// The dump file to create the Cloud SQL replica.
7682    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7683    pub dump_file_path: std::string::String,
7684
7685    /// The reference to Cloud SQL instance if the source is Cloud SQL.
7686    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7687    pub source_instance: std::option::Option<crate::model::InstanceReference>,
7688
7689    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7690    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7691}
7692
7693impl OnPremisesConfiguration {
7694    pub fn new() -> Self {
7695        std::default::Default::default()
7696    }
7697
7698    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
7699    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7700        self.host_port = v.into();
7701        self
7702    }
7703
7704    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
7705    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7706        self.kind = v.into();
7707        self
7708    }
7709
7710    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
7711    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7712        self.username = v.into();
7713        self
7714    }
7715
7716    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
7717    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7718        self.password = v.into();
7719        self
7720    }
7721
7722    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
7723    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7724        self.ca_certificate = v.into();
7725        self
7726    }
7727
7728    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
7729    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7730        mut self,
7731        v: T,
7732    ) -> Self {
7733        self.client_certificate = v.into();
7734        self
7735    }
7736
7737    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
7738    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7739        self.client_key = v.into();
7740        self
7741    }
7742
7743    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
7744    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7745        self.dump_file_path = v.into();
7746        self
7747    }
7748
7749    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
7750    pub fn set_source_instance<
7751        T: std::convert::Into<std::option::Option<crate::model::InstanceReference>>,
7752    >(
7753        mut self,
7754        v: T,
7755    ) -> Self {
7756        self.source_instance = v.into();
7757        self
7758    }
7759}
7760
7761impl wkt::message::Message for OnPremisesConfiguration {
7762    fn typename() -> &'static str {
7763        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
7764    }
7765}
7766
7767/// Read-replica configuration for connecting to the primary instance.
7768#[serde_with::serde_as]
7769#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7770#[serde(default, rename_all = "camelCase")]
7771#[non_exhaustive]
7772pub struct ReplicaConfiguration {
7773    /// This is always `sql#replicaConfiguration`.
7774    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7775    pub kind: std::string::String,
7776
7777    /// MySQL specific configuration when replicating from a MySQL on-premises
7778    /// primary instance. Replication configuration information such as the
7779    /// username, password, certificates, and keys are not stored in the instance
7780    /// metadata. The configuration information is used only to set up the
7781    /// replication connection and is stored by MySQL in a file named
7782    /// `master.info` in the data directory.
7783    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7784    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
7785
7786    /// Specifies if the replica is the failover target. If the field is set to
7787    /// `true`, the replica will be designated as a failover replica. In case the
7788    /// primary instance fails, the replica instance will be promoted as the new
7789    /// primary instance. Only one replica can be specified as failover target, and
7790    /// the replica has to be in different zone with the primary instance.
7791    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7792    pub failover_target: std::option::Option<wkt::BoolValue>,
7793
7794    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
7795    /// cascadable replica is a SQL Server cross region replica that supports
7796    /// replica(s) under it.
7797    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7798    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
7799
7800    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7801    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7802}
7803
7804impl ReplicaConfiguration {
7805    pub fn new() -> Self {
7806        std::default::Default::default()
7807    }
7808
7809    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
7810    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7811        self.kind = v.into();
7812        self
7813    }
7814
7815    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
7816    pub fn set_mysql_replica_configuration<
7817        T: std::convert::Into<std::option::Option<crate::model::MySqlReplicaConfiguration>>,
7818    >(
7819        mut self,
7820        v: T,
7821    ) -> Self {
7822        self.mysql_replica_configuration = v.into();
7823        self
7824    }
7825
7826    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
7827    pub fn set_failover_target<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
7828        mut self,
7829        v: T,
7830    ) -> Self {
7831        self.failover_target = v.into();
7832        self
7833    }
7834
7835    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
7836    pub fn set_cascadable_replica<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
7837        mut self,
7838        v: T,
7839    ) -> Self {
7840        self.cascadable_replica = v.into();
7841        self
7842    }
7843}
7844
7845impl wkt::message::Message for ReplicaConfiguration {
7846    fn typename() -> &'static str {
7847        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
7848    }
7849}
7850
7851/// Request to acquire a lease for SSRS.
7852#[serde_with::serde_as]
7853#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7854#[serde(default, rename_all = "camelCase")]
7855#[non_exhaustive]
7856pub struct SqlInstancesAcquireSsrsLeaseRequest {
7857    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
7858    /// composed of lowercase letters, numbers, and hyphens, and it must start with
7859    /// a letter. The total length must be 98 characters or less (Example:
7860    /// instance-id).
7861    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7862    pub instance: std::string::String,
7863
7864    /// Required. Project ID of the project that contains the instance (Example:
7865    /// project-id).
7866    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7867    pub project: std::string::String,
7868
7869    /// Required. The request body.
7870    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7871    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
7872
7873    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7874    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7875}
7876
7877impl SqlInstancesAcquireSsrsLeaseRequest {
7878    pub fn new() -> Self {
7879        std::default::Default::default()
7880    }
7881
7882    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
7883    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7884        self.instance = v.into();
7885        self
7886    }
7887
7888    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
7889    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7890        self.project = v.into();
7891        self
7892    }
7893
7894    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
7895    pub fn set_body<
7896        T: std::convert::Into<std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>>,
7897    >(
7898        mut self,
7899        v: T,
7900    ) -> Self {
7901        self.body = v.into();
7902        self
7903    }
7904}
7905
7906impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
7907    fn typename() -> &'static str {
7908        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
7909    }
7910}
7911
7912/// Response for the acquire SSRS lease request.
7913#[serde_with::serde_as]
7914#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7915#[serde(default, rename_all = "camelCase")]
7916#[non_exhaustive]
7917pub struct SqlInstancesAcquireSsrsLeaseResponse {
7918    /// The unique identifier for this operation.
7919    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7920    pub operation_id: std::string::String,
7921
7922    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7923    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7924}
7925
7926impl SqlInstancesAcquireSsrsLeaseResponse {
7927    pub fn new() -> Self {
7928        std::default::Default::default()
7929    }
7930
7931    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
7932    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7933        self.operation_id = v.into();
7934        self
7935    }
7936}
7937
7938impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
7939    fn typename() -> &'static str {
7940        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
7941    }
7942}
7943
7944/// Request to release a lease for SSRS.
7945#[serde_with::serde_as]
7946#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7947#[serde(default, rename_all = "camelCase")]
7948#[non_exhaustive]
7949pub struct SqlInstancesReleaseSsrsLeaseRequest {
7950    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
7951    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
7952    /// must start with a letter. This ID can have a maximum length of 98
7953    /// characters.
7954    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7955    pub instance: std::string::String,
7956
7957    /// Required. The project ID that contains the instance.
7958    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7959    pub project: std::string::String,
7960
7961    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7962    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7963}
7964
7965impl SqlInstancesReleaseSsrsLeaseRequest {
7966    pub fn new() -> Self {
7967        std::default::Default::default()
7968    }
7969
7970    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
7971    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7972        self.instance = v.into();
7973        self
7974    }
7975
7976    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
7977    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7978        self.project = v.into();
7979        self
7980    }
7981}
7982
7983impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
7984    fn typename() -> &'static str {
7985        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
7986    }
7987}
7988
7989/// Response for the release SSRS lease request.
7990#[serde_with::serde_as]
7991#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7992#[serde(default, rename_all = "camelCase")]
7993#[non_exhaustive]
7994pub struct SqlInstancesReleaseSsrsLeaseResponse {
7995    /// The unique identifier for this operation.
7996    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7997    pub operation_id: std::string::String,
7998
7999    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8000    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl SqlInstancesReleaseSsrsLeaseResponse {
8004    pub fn new() -> Self {
8005        std::default::Default::default()
8006    }
8007
8008    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
8009    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8010        self.operation_id = v.into();
8011        self
8012    }
8013}
8014
8015impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
8016    fn typename() -> &'static str {
8017        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
8018    }
8019}
8020
8021/// Operations get request.
8022#[serde_with::serde_as]
8023#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8024#[serde(default, rename_all = "camelCase")]
8025#[non_exhaustive]
8026pub struct SqlOperationsGetRequest {
8027    /// Instance operation ID.
8028    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8029    pub operation: std::string::String,
8030
8031    /// Project ID of the project that contains the instance.
8032    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8033    pub project: std::string::String,
8034
8035    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8036    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8037}
8038
8039impl SqlOperationsGetRequest {
8040    pub fn new() -> Self {
8041        std::default::Default::default()
8042    }
8043
8044    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
8045    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8046        self.operation = v.into();
8047        self
8048    }
8049
8050    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
8051    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8052        self.project = v.into();
8053        self
8054    }
8055}
8056
8057impl wkt::message::Message for SqlOperationsGetRequest {
8058    fn typename() -> &'static str {
8059        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
8060    }
8061}
8062
8063/// Operations list request.
8064#[serde_with::serde_as]
8065#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8066#[serde(default, rename_all = "camelCase")]
8067#[non_exhaustive]
8068pub struct SqlOperationsListRequest {
8069    /// Cloud SQL instance ID. This does not include the project ID.
8070    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8071    pub instance: std::string::String,
8072
8073    /// Maximum number of operations per response.
8074    #[serde(skip_serializing_if = "wkt::internal::is_default")]
8075    pub max_results: u32,
8076
8077    /// A previously-returned page token representing part of the larger set of
8078    /// results to view.
8079    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8080    pub page_token: std::string::String,
8081
8082    /// Project ID of the project that contains the instance.
8083    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8084    pub project: std::string::String,
8085
8086    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8087    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8088}
8089
8090impl SqlOperationsListRequest {
8091    pub fn new() -> Self {
8092        std::default::Default::default()
8093    }
8094
8095    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
8096    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8097        self.instance = v.into();
8098        self
8099    }
8100
8101    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
8102    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
8103        self.max_results = v.into();
8104        self
8105    }
8106
8107    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
8108    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8109        self.page_token = v.into();
8110        self
8111    }
8112
8113    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
8114    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8115        self.project = v.into();
8116        self
8117    }
8118}
8119
8120impl wkt::message::Message for SqlOperationsListRequest {
8121    fn typename() -> &'static str {
8122        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
8123    }
8124}
8125
8126/// Operations list response.
8127#[serde_with::serde_as]
8128#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8129#[serde(default, rename_all = "camelCase")]
8130#[non_exhaustive]
8131pub struct OperationsListResponse {
8132    /// This is always `sql#operationsList`.
8133    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8134    pub kind: std::string::String,
8135
8136    /// List of operation resources.
8137    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8138    pub items: std::vec::Vec<crate::model::Operation>,
8139
8140    /// The continuation token, used to page through large result sets. Provide
8141    /// this value in a subsequent request to return the next page of results.
8142    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8143    pub next_page_token: std::string::String,
8144
8145    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8146    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8147}
8148
8149impl OperationsListResponse {
8150    pub fn new() -> Self {
8151        std::default::Default::default()
8152    }
8153
8154    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
8155    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8156        self.kind = v.into();
8157        self
8158    }
8159
8160    /// Sets the value of [items][crate::model::OperationsListResponse::items].
8161    pub fn set_items<T, V>(mut self, v: T) -> Self
8162    where
8163        T: std::iter::IntoIterator<Item = V>,
8164        V: std::convert::Into<crate::model::Operation>,
8165    {
8166        use std::iter::Iterator;
8167        self.items = v.into_iter().map(|i| i.into()).collect();
8168        self
8169    }
8170
8171    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
8172    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8173        self.next_page_token = v.into();
8174        self
8175    }
8176}
8177
8178impl wkt::message::Message for OperationsListResponse {
8179    fn typename() -> &'static str {
8180        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
8181    }
8182}
8183
8184#[doc(hidden)]
8185impl gax::paginator::internal::PageableResponse for OperationsListResponse {
8186    type PageItem = crate::model::Operation;
8187
8188    fn items(self) -> std::vec::Vec<Self::PageItem> {
8189        self.items
8190    }
8191
8192    fn next_page_token(&self) -> std::string::String {
8193        use std::clone::Clone;
8194        self.next_page_token.clone()
8195    }
8196}
8197
8198/// Operations cancel request.
8199#[serde_with::serde_as]
8200#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8201#[serde(default, rename_all = "camelCase")]
8202#[non_exhaustive]
8203pub struct SqlOperationsCancelRequest {
8204    /// Instance operation ID.
8205    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8206    pub operation: std::string::String,
8207
8208    /// Project ID of the project that contains the instance.
8209    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8210    pub project: std::string::String,
8211
8212    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8213    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8214}
8215
8216impl SqlOperationsCancelRequest {
8217    pub fn new() -> Self {
8218        std::default::Default::default()
8219    }
8220
8221    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
8222    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8223        self.operation = v.into();
8224        self
8225    }
8226
8227    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
8228    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8229        self.project = v.into();
8230        self
8231    }
8232}
8233
8234impl wkt::message::Message for SqlOperationsCancelRequest {
8235    fn typename() -> &'static str {
8236        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
8237    }
8238}
8239
8240/// An entry for an Access Control list.
8241#[serde_with::serde_as]
8242#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8243#[serde(default, rename_all = "camelCase")]
8244#[non_exhaustive]
8245pub struct AclEntry {
8246    /// The allowlisted value for the access control list.
8247    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8248    pub value: std::string::String,
8249
8250    /// The time when this access control entry expires in
8251    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
8252    /// `2012-11-15T16:19:00.094Z`.
8253    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8254    pub expiration_time: std::option::Option<wkt::Timestamp>,
8255
8256    /// Optional. A label to identify this entry.
8257    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8258    pub name: std::string::String,
8259
8260    /// This is always `sql#aclEntry`.
8261    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8262    pub kind: std::string::String,
8263
8264    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8265    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8266}
8267
8268impl AclEntry {
8269    pub fn new() -> Self {
8270        std::default::Default::default()
8271    }
8272
8273    /// Sets the value of [value][crate::model::AclEntry::value].
8274    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8275        self.value = v.into();
8276        self
8277    }
8278
8279    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
8280    pub fn set_expiration_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8281        mut self,
8282        v: T,
8283    ) -> Self {
8284        self.expiration_time = v.into();
8285        self
8286    }
8287
8288    /// Sets the value of [name][crate::model::AclEntry::name].
8289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8290        self.name = v.into();
8291        self
8292    }
8293
8294    /// Sets the value of [kind][crate::model::AclEntry::kind].
8295    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8296        self.kind = v.into();
8297        self
8298    }
8299}
8300
8301impl wkt::message::Message for AclEntry {
8302    fn typename() -> &'static str {
8303        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
8304    }
8305}
8306
8307/// An Admin API warning message.
8308#[serde_with::serde_as]
8309#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8310#[serde(default, rename_all = "camelCase")]
8311#[non_exhaustive]
8312pub struct ApiWarning {
8313    /// Code to uniquely identify the warning type.
8314    pub code: crate::model::api_warning::SqlApiWarningCode,
8315
8316    /// The warning message.
8317    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8318    pub message: std::string::String,
8319
8320    /// The region name for REGION_UNREACHABLE warning.
8321    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8322    pub region: std::string::String,
8323
8324    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8325    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8326}
8327
8328impl ApiWarning {
8329    pub fn new() -> Self {
8330        std::default::Default::default()
8331    }
8332
8333    /// Sets the value of [code][crate::model::ApiWarning::code].
8334    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
8335        mut self,
8336        v: T,
8337    ) -> Self {
8338        self.code = v.into();
8339        self
8340    }
8341
8342    /// Sets the value of [message][crate::model::ApiWarning::message].
8343    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8344        self.message = v.into();
8345        self
8346    }
8347
8348    /// Sets the value of [region][crate::model::ApiWarning::region].
8349    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8350        self.region = v.into();
8351        self
8352    }
8353}
8354
8355impl wkt::message::Message for ApiWarning {
8356    fn typename() -> &'static str {
8357        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
8358    }
8359}
8360
8361/// Defines additional types related to [ApiWarning].
8362pub mod api_warning {
8363    #[allow(unused_imports)]
8364    use super::*;
8365
8366    ///
8367    /// # Working with unknown values
8368    ///
8369    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8370    /// additional enum variants at any time. Adding new variants is not considered
8371    /// a breaking change. Applications should write their code in anticipation of:
8372    ///
8373    /// - New values appearing in future releases of the client library, **and**
8374    /// - New values received dynamically, without application changes.
8375    ///
8376    /// Please consult the [Working with enums] section in the user guide for some
8377    /// guidelines.
8378    ///
8379    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8380    #[derive(Clone, Debug, PartialEq)]
8381    #[non_exhaustive]
8382    pub enum SqlApiWarningCode {
8383        /// An unknown or unset warning type from Cloud SQL API.
8384        Unspecified,
8385        /// Warning when one or more regions are not reachable.  The returned result
8386        /// set may be incomplete.
8387        RegionUnreachable,
8388        /// Warning when user provided maxResults parameter exceeds the limit.  The
8389        /// returned result set may be incomplete.
8390        MaxResultsExceedsLimit,
8391        /// Warning when user tries to create/update a user with credentials that
8392        /// have previously been compromised by a public data breach.
8393        CompromisedCredentials,
8394        /// Warning when the operation succeeds but some non-critical workflow state
8395        /// failed.
8396        InternalStateFailure,
8397        /// If set, the enum was initialized with an unknown value.
8398        ///
8399        /// Applications can examine the value using [SqlApiWarningCode::value] or
8400        /// [SqlApiWarningCode::name].
8401        UnknownValue(sql_api_warning_code::UnknownValue),
8402    }
8403
8404    #[doc(hidden)]
8405    pub mod sql_api_warning_code {
8406        #[allow(unused_imports)]
8407        use super::*;
8408        #[derive(Clone, Debug, PartialEq)]
8409        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8410    }
8411
8412    impl SqlApiWarningCode {
8413        /// Gets the enum value.
8414        ///
8415        /// Returns `None` if the enum contains an unknown value deserialized from
8416        /// the string representation of enums.
8417        pub fn value(&self) -> std::option::Option<i32> {
8418            match self {
8419                Self::Unspecified => std::option::Option::Some(0),
8420                Self::RegionUnreachable => std::option::Option::Some(1),
8421                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
8422                Self::CompromisedCredentials => std::option::Option::Some(3),
8423                Self::InternalStateFailure => std::option::Option::Some(4),
8424                Self::UnknownValue(u) => u.0.value(),
8425            }
8426        }
8427
8428        /// Gets the enum value as a string.
8429        ///
8430        /// Returns `None` if the enum contains an unknown value deserialized from
8431        /// the integer representation of enums.
8432        pub fn name(&self) -> std::option::Option<&str> {
8433            match self {
8434                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
8435                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
8436                Self::MaxResultsExceedsLimit => {
8437                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
8438                }
8439                Self::CompromisedCredentials => {
8440                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
8441                }
8442                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
8443                Self::UnknownValue(u) => u.0.name(),
8444            }
8445        }
8446    }
8447
8448    impl std::default::Default for SqlApiWarningCode {
8449        fn default() -> Self {
8450            use std::convert::From;
8451            Self::from(0)
8452        }
8453    }
8454
8455    impl std::fmt::Display for SqlApiWarningCode {
8456        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8457            wkt::internal::display_enum(f, self.name(), self.value())
8458        }
8459    }
8460
8461    impl std::convert::From<i32> for SqlApiWarningCode {
8462        fn from(value: i32) -> Self {
8463            match value {
8464                0 => Self::Unspecified,
8465                1 => Self::RegionUnreachable,
8466                2 => Self::MaxResultsExceedsLimit,
8467                3 => Self::CompromisedCredentials,
8468                4 => Self::InternalStateFailure,
8469                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8470                    wkt::internal::UnknownEnumValue::Integer(value),
8471                )),
8472            }
8473        }
8474    }
8475
8476    impl std::convert::From<&str> for SqlApiWarningCode {
8477        fn from(value: &str) -> Self {
8478            use std::string::ToString;
8479            match value {
8480                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
8481                "REGION_UNREACHABLE" => Self::RegionUnreachable,
8482                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
8483                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
8484                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
8485                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8486                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8487                )),
8488            }
8489        }
8490    }
8491
8492    impl serde::ser::Serialize for SqlApiWarningCode {
8493        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8494        where
8495            S: serde::Serializer,
8496        {
8497            match self {
8498                Self::Unspecified => serializer.serialize_i32(0),
8499                Self::RegionUnreachable => serializer.serialize_i32(1),
8500                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
8501                Self::CompromisedCredentials => serializer.serialize_i32(3),
8502                Self::InternalStateFailure => serializer.serialize_i32(4),
8503                Self::UnknownValue(u) => u.0.serialize(serializer),
8504            }
8505        }
8506    }
8507
8508    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
8509        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8510        where
8511            D: serde::Deserializer<'de>,
8512        {
8513            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
8514                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
8515            ))
8516        }
8517    }
8518}
8519
8520/// We currently only support backup retention by specifying the number
8521/// of backups we will retain.
8522#[serde_with::serde_as]
8523#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8524#[serde(default, rename_all = "camelCase")]
8525#[non_exhaustive]
8526pub struct BackupRetentionSettings {
8527    /// The unit that 'retained_backups' represents.
8528    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
8529
8530    /// Depending on the value of retention_unit, this is used to determine
8531    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
8532    /// retain this many backups.
8533    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8534    pub retained_backups: std::option::Option<wkt::Int32Value>,
8535
8536    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8537    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8538}
8539
8540impl BackupRetentionSettings {
8541    pub fn new() -> Self {
8542        std::default::Default::default()
8543    }
8544
8545    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
8546    pub fn set_retention_unit<
8547        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
8548    >(
8549        mut self,
8550        v: T,
8551    ) -> Self {
8552        self.retention_unit = v.into();
8553        self
8554    }
8555
8556    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
8557    pub fn set_retained_backups<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
8558        mut self,
8559        v: T,
8560    ) -> Self {
8561        self.retained_backups = v.into();
8562        self
8563    }
8564}
8565
8566impl wkt::message::Message for BackupRetentionSettings {
8567    fn typename() -> &'static str {
8568        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
8569    }
8570}
8571
8572/// Defines additional types related to [BackupRetentionSettings].
8573pub mod backup_retention_settings {
8574    #[allow(unused_imports)]
8575    use super::*;
8576
8577    /// The units that retained_backups specifies, we only support COUNT.
8578    ///
8579    /// # Working with unknown values
8580    ///
8581    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8582    /// additional enum variants at any time. Adding new variants is not considered
8583    /// a breaking change. Applications should write their code in anticipation of:
8584    ///
8585    /// - New values appearing in future releases of the client library, **and**
8586    /// - New values received dynamically, without application changes.
8587    ///
8588    /// Please consult the [Working with enums] section in the user guide for some
8589    /// guidelines.
8590    ///
8591    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8592    #[derive(Clone, Debug, PartialEq)]
8593    #[non_exhaustive]
8594    pub enum RetentionUnit {
8595        /// Backup retention unit is unspecified, will be treated as COUNT.
8596        Unspecified,
8597        /// Retention will be by count, eg. "retain the most recent 7 backups".
8598        Count,
8599        /// If set, the enum was initialized with an unknown value.
8600        ///
8601        /// Applications can examine the value using [RetentionUnit::value] or
8602        /// [RetentionUnit::name].
8603        UnknownValue(retention_unit::UnknownValue),
8604    }
8605
8606    #[doc(hidden)]
8607    pub mod retention_unit {
8608        #[allow(unused_imports)]
8609        use super::*;
8610        #[derive(Clone, Debug, PartialEq)]
8611        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8612    }
8613
8614    impl RetentionUnit {
8615        /// Gets the enum value.
8616        ///
8617        /// Returns `None` if the enum contains an unknown value deserialized from
8618        /// the string representation of enums.
8619        pub fn value(&self) -> std::option::Option<i32> {
8620            match self {
8621                Self::Unspecified => std::option::Option::Some(0),
8622                Self::Count => std::option::Option::Some(1),
8623                Self::UnknownValue(u) => u.0.value(),
8624            }
8625        }
8626
8627        /// Gets the enum value as a string.
8628        ///
8629        /// Returns `None` if the enum contains an unknown value deserialized from
8630        /// the integer representation of enums.
8631        pub fn name(&self) -> std::option::Option<&str> {
8632            match self {
8633                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
8634                Self::Count => std::option::Option::Some("COUNT"),
8635                Self::UnknownValue(u) => u.0.name(),
8636            }
8637        }
8638    }
8639
8640    impl std::default::Default for RetentionUnit {
8641        fn default() -> Self {
8642            use std::convert::From;
8643            Self::from(0)
8644        }
8645    }
8646
8647    impl std::fmt::Display for RetentionUnit {
8648        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8649            wkt::internal::display_enum(f, self.name(), self.value())
8650        }
8651    }
8652
8653    impl std::convert::From<i32> for RetentionUnit {
8654        fn from(value: i32) -> Self {
8655            match value {
8656                0 => Self::Unspecified,
8657                1 => Self::Count,
8658                _ => Self::UnknownValue(retention_unit::UnknownValue(
8659                    wkt::internal::UnknownEnumValue::Integer(value),
8660                )),
8661            }
8662        }
8663    }
8664
8665    impl std::convert::From<&str> for RetentionUnit {
8666        fn from(value: &str) -> Self {
8667            use std::string::ToString;
8668            match value {
8669                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
8670                "COUNT" => Self::Count,
8671                _ => Self::UnknownValue(retention_unit::UnknownValue(
8672                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8673                )),
8674            }
8675        }
8676    }
8677
8678    impl serde::ser::Serialize for RetentionUnit {
8679        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8680        where
8681            S: serde::Serializer,
8682        {
8683            match self {
8684                Self::Unspecified => serializer.serialize_i32(0),
8685                Self::Count => serializer.serialize_i32(1),
8686                Self::UnknownValue(u) => u.0.serialize(serializer),
8687            }
8688        }
8689    }
8690
8691    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
8692        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8693        where
8694            D: serde::Deserializer<'de>,
8695        {
8696            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
8697                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
8698            ))
8699        }
8700    }
8701}
8702
8703/// Database instance backup configuration.
8704#[serde_with::serde_as]
8705#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8706#[serde(default, rename_all = "camelCase")]
8707#[non_exhaustive]
8708pub struct BackupConfiguration {
8709    /// Start time for the daily backup configuration in UTC timezone in the 24
8710    /// hour format - `HH:MM`.
8711    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8712    pub start_time: std::string::String,
8713
8714    /// Whether this configuration is enabled.
8715    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8716    pub enabled: std::option::Option<wkt::BoolValue>,
8717
8718    /// This is always `sql#backupConfiguration`.
8719    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8720    pub kind: std::string::String,
8721
8722    /// (MySQL only) Whether binary log is enabled. If backup configuration is
8723    /// disabled, binarylog must be disabled as well.
8724    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8725    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
8726
8727    /// Reserved for future use.
8728    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8729    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
8730
8731    /// Location of the backup
8732    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8733    pub location: std::string::String,
8734
8735    /// Whether point in time recovery is enabled.
8736    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8737    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
8738
8739    /// Backup retention settings.
8740    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8741    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
8742
8743    /// The number of days of transaction logs we retain for point in time
8744    /// restore, from 1-7.
8745    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8746    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
8747
8748    /// Output only. This value contains the storage location of transactional logs
8749    /// used to perform point-in-time recovery (PITR) for the database.
8750    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8751    pub transactional_log_storage_state:
8752        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
8753
8754    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8755    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8756}
8757
8758impl BackupConfiguration {
8759    pub fn new() -> Self {
8760        std::default::Default::default()
8761    }
8762
8763    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
8764    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8765        self.start_time = v.into();
8766        self
8767    }
8768
8769    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
8770    pub fn set_enabled<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
8771        mut self,
8772        v: T,
8773    ) -> Self {
8774        self.enabled = v.into();
8775        self
8776    }
8777
8778    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
8779    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8780        self.kind = v.into();
8781        self
8782    }
8783
8784    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
8785    pub fn set_binary_log_enabled<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
8786        mut self,
8787        v: T,
8788    ) -> Self {
8789        self.binary_log_enabled = v.into();
8790        self
8791    }
8792
8793    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
8794    pub fn set_replication_log_archiving_enabled<
8795        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
8796    >(
8797        mut self,
8798        v: T,
8799    ) -> Self {
8800        self.replication_log_archiving_enabled = v.into();
8801        self
8802    }
8803
8804    /// Sets the value of [location][crate::model::BackupConfiguration::location].
8805    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8806        self.location = v.into();
8807        self
8808    }
8809
8810    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
8811    pub fn set_point_in_time_recovery_enabled<
8812        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
8813    >(
8814        mut self,
8815        v: T,
8816    ) -> Self {
8817        self.point_in_time_recovery_enabled = v.into();
8818        self
8819    }
8820
8821    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
8822    pub fn set_backup_retention_settings<
8823        T: std::convert::Into<std::option::Option<crate::model::BackupRetentionSettings>>,
8824    >(
8825        mut self,
8826        v: T,
8827    ) -> Self {
8828        self.backup_retention_settings = v.into();
8829        self
8830    }
8831
8832    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
8833    pub fn set_transaction_log_retention_days<
8834        T: std::convert::Into<std::option::Option<wkt::Int32Value>>,
8835    >(
8836        mut self,
8837        v: T,
8838    ) -> Self {
8839        self.transaction_log_retention_days = v.into();
8840        self
8841    }
8842
8843    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
8844    pub fn set_transactional_log_storage_state<
8845        T: std::convert::Into<
8846                std::option::Option<
8847                    crate::model::backup_configuration::TransactionalLogStorageState,
8848                >,
8849            >,
8850    >(
8851        mut self,
8852        v: T,
8853    ) -> Self {
8854        self.transactional_log_storage_state = v.into();
8855        self
8856    }
8857}
8858
8859impl wkt::message::Message for BackupConfiguration {
8860    fn typename() -> &'static str {
8861        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
8862    }
8863}
8864
8865/// Defines additional types related to [BackupConfiguration].
8866pub mod backup_configuration {
8867    #[allow(unused_imports)]
8868    use super::*;
8869
8870    /// This value contains the storage location of the transactional logs
8871    /// used to perform point-in-time recovery (PITR) for the database.
8872    ///
8873    /// # Working with unknown values
8874    ///
8875    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8876    /// additional enum variants at any time. Adding new variants is not considered
8877    /// a breaking change. Applications should write their code in anticipation of:
8878    ///
8879    /// - New values appearing in future releases of the client library, **and**
8880    /// - New values received dynamically, without application changes.
8881    ///
8882    /// Please consult the [Working with enums] section in the user guide for some
8883    /// guidelines.
8884    ///
8885    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8886    #[derive(Clone, Debug, PartialEq)]
8887    #[non_exhaustive]
8888    pub enum TransactionalLogStorageState {
8889        /// Unspecified.
8890        Unspecified,
8891        /// The transaction logs used for PITR for the instance are stored
8892        /// on a data disk.
8893        Disk,
8894        /// The transaction logs used for PITR for the instance are switching from
8895        /// being stored on a data disk to being stored in Cloud Storage.
8896        /// Only applicable to MySQL.
8897        SwitchingToCloudStorage,
8898        /// The transaction logs used for PITR for the instance are now stored
8899        /// in Cloud Storage. Previously, they were stored on a data disk.
8900        /// Only applicable to MySQL.
8901        SwitchedToCloudStorage,
8902        /// The transaction logs used for PITR for the instance are stored in
8903        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
8904        CloudStorage,
8905        /// If set, the enum was initialized with an unknown value.
8906        ///
8907        /// Applications can examine the value using [TransactionalLogStorageState::value] or
8908        /// [TransactionalLogStorageState::name].
8909        UnknownValue(transactional_log_storage_state::UnknownValue),
8910    }
8911
8912    #[doc(hidden)]
8913    pub mod transactional_log_storage_state {
8914        #[allow(unused_imports)]
8915        use super::*;
8916        #[derive(Clone, Debug, PartialEq)]
8917        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8918    }
8919
8920    impl TransactionalLogStorageState {
8921        /// Gets the enum value.
8922        ///
8923        /// Returns `None` if the enum contains an unknown value deserialized from
8924        /// the string representation of enums.
8925        pub fn value(&self) -> std::option::Option<i32> {
8926            match self {
8927                Self::Unspecified => std::option::Option::Some(0),
8928                Self::Disk => std::option::Option::Some(1),
8929                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
8930                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
8931                Self::CloudStorage => std::option::Option::Some(4),
8932                Self::UnknownValue(u) => u.0.value(),
8933            }
8934        }
8935
8936        /// Gets the enum value as a string.
8937        ///
8938        /// Returns `None` if the enum contains an unknown value deserialized from
8939        /// the integer representation of enums.
8940        pub fn name(&self) -> std::option::Option<&str> {
8941            match self {
8942                Self::Unspecified => {
8943                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
8944                }
8945                Self::Disk => std::option::Option::Some("DISK"),
8946                Self::SwitchingToCloudStorage => {
8947                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
8948                }
8949                Self::SwitchedToCloudStorage => {
8950                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
8951                }
8952                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
8953                Self::UnknownValue(u) => u.0.name(),
8954            }
8955        }
8956    }
8957
8958    impl std::default::Default for TransactionalLogStorageState {
8959        fn default() -> Self {
8960            use std::convert::From;
8961            Self::from(0)
8962        }
8963    }
8964
8965    impl std::fmt::Display for TransactionalLogStorageState {
8966        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8967            wkt::internal::display_enum(f, self.name(), self.value())
8968        }
8969    }
8970
8971    impl std::convert::From<i32> for TransactionalLogStorageState {
8972        fn from(value: i32) -> Self {
8973            match value {
8974                0 => Self::Unspecified,
8975                1 => Self::Disk,
8976                2 => Self::SwitchingToCloudStorage,
8977                3 => Self::SwitchedToCloudStorage,
8978                4 => Self::CloudStorage,
8979                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
8980                    wkt::internal::UnknownEnumValue::Integer(value),
8981                )),
8982            }
8983        }
8984    }
8985
8986    impl std::convert::From<&str> for TransactionalLogStorageState {
8987        fn from(value: &str) -> Self {
8988            use std::string::ToString;
8989            match value {
8990                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
8991                "DISK" => Self::Disk,
8992                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
8993                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
8994                "CLOUD_STORAGE" => Self::CloudStorage,
8995                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
8996                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8997                )),
8998            }
8999        }
9000    }
9001
9002    impl serde::ser::Serialize for TransactionalLogStorageState {
9003        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9004        where
9005            S: serde::Serializer,
9006        {
9007            match self {
9008                Self::Unspecified => serializer.serialize_i32(0),
9009                Self::Disk => serializer.serialize_i32(1),
9010                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
9011                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
9012                Self::CloudStorage => serializer.serialize_i32(4),
9013                Self::UnknownValue(u) => u.0.serialize(serializer),
9014            }
9015        }
9016    }
9017
9018    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
9019        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9020        where
9021            D: serde::Deserializer<'de>,
9022        {
9023            deserializer.deserialize_any(
9024                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
9025                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
9026                ),
9027            )
9028        }
9029    }
9030}
9031
9032/// Perform disk shrink context.
9033#[serde_with::serde_as]
9034#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9035#[serde(default, rename_all = "camelCase")]
9036#[non_exhaustive]
9037pub struct PerformDiskShrinkContext {
9038    /// The target disk shrink size in GigaBytes.
9039    #[serde(skip_serializing_if = "wkt::internal::is_default")]
9040    #[serde_as(as = "serde_with::DisplayFromStr")]
9041    pub target_size_gb: i64,
9042
9043    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9044    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9045}
9046
9047impl PerformDiskShrinkContext {
9048    pub fn new() -> Self {
9049        std::default::Default::default()
9050    }
9051
9052    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
9053    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9054        self.target_size_gb = v.into();
9055        self
9056    }
9057}
9058
9059impl wkt::message::Message for PerformDiskShrinkContext {
9060    fn typename() -> &'static str {
9061        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
9062    }
9063}
9064
9065/// Backup context.
9066#[serde_with::serde_as]
9067#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9068#[serde(default, rename_all = "camelCase")]
9069#[non_exhaustive]
9070pub struct BackupContext {
9071    /// The identifier of the backup.
9072    #[serde(skip_serializing_if = "wkt::internal::is_default")]
9073    #[serde_as(as = "serde_with::DisplayFromStr")]
9074    pub backup_id: i64,
9075
9076    /// This is always `sql#backupContext`.
9077    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9078    pub kind: std::string::String,
9079
9080    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9081    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9082}
9083
9084impl BackupContext {
9085    pub fn new() -> Self {
9086        std::default::Default::default()
9087    }
9088
9089    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
9090    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9091        self.backup_id = v.into();
9092        self
9093    }
9094
9095    /// Sets the value of [kind][crate::model::BackupContext::kind].
9096    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9097        self.kind = v.into();
9098        self
9099    }
9100}
9101
9102impl wkt::message::Message for BackupContext {
9103    fn typename() -> &'static str {
9104        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
9105    }
9106}
9107
9108/// Represents a SQL database on the Cloud SQL instance.
9109#[serde_with::serde_as]
9110#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9111#[serde(default, rename_all = "camelCase")]
9112#[non_exhaustive]
9113pub struct Database {
9114    /// This is always `sql#database`.
9115    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9116    pub kind: std::string::String,
9117
9118    /// The Cloud SQL charset value.
9119    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9120    pub charset: std::string::String,
9121
9122    /// The Cloud SQL collation value.
9123    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9124    pub collation: std::string::String,
9125
9126    /// This field is deprecated and will be removed from a future version of the
9127    /// API.
9128    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9129    pub etag: std::string::String,
9130
9131    /// The name of the database in the Cloud SQL instance. This does not include
9132    /// the project ID or instance name.
9133    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9134    pub name: std::string::String,
9135
9136    /// The name of the Cloud SQL instance. This does not include the project ID.
9137    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9138    pub instance: std::string::String,
9139
9140    /// The URI of this resource.
9141    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9142    pub self_link: std::string::String,
9143
9144    /// The project ID of the project containing the Cloud SQL database. The Google
9145    /// apps domain is prefixed if applicable.
9146    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9147    pub project: std::string::String,
9148
9149    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
9150    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
9151
9152    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9153    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9154}
9155
9156impl Database {
9157    pub fn new() -> Self {
9158        std::default::Default::default()
9159    }
9160
9161    /// Sets the value of [kind][crate::model::Database::kind].
9162    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9163        self.kind = v.into();
9164        self
9165    }
9166
9167    /// Sets the value of [charset][crate::model::Database::charset].
9168    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9169        self.charset = v.into();
9170        self
9171    }
9172
9173    /// Sets the value of [collation][crate::model::Database::collation].
9174    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9175        self.collation = v.into();
9176        self
9177    }
9178
9179    /// Sets the value of [etag][crate::model::Database::etag].
9180    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9181        self.etag = v.into();
9182        self
9183    }
9184
9185    /// Sets the value of [name][crate::model::Database::name].
9186    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9187        self.name = v.into();
9188        self
9189    }
9190
9191    /// Sets the value of [instance][crate::model::Database::instance].
9192    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9193        self.instance = v.into();
9194        self
9195    }
9196
9197    /// Sets the value of [self_link][crate::model::Database::self_link].
9198    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9199        self.self_link = v.into();
9200        self
9201    }
9202
9203    /// Sets the value of [project][crate::model::Database::project].
9204    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9205        self.project = v.into();
9206        self
9207    }
9208
9209    /// Sets the value of [database_details][crate::model::Database::database_details].
9210    ///
9211    /// Note that all the setters affecting `database_details` are mutually
9212    /// exclusive.
9213    pub fn set_database_details<
9214        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
9215    >(
9216        mut self,
9217        v: T,
9218    ) -> Self {
9219        self.database_details = v.into();
9220        self
9221    }
9222
9223    /// The value of [database_details][crate::model::Database::database_details]
9224    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
9225    /// holds a different branch.
9226    pub fn sqlserver_database_details(
9227        &self,
9228    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
9229        #[allow(unreachable_patterns)]
9230        self.database_details.as_ref().and_then(|v| match v {
9231            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
9232                std::option::Option::Some(v)
9233            }
9234            _ => std::option::Option::None,
9235        })
9236    }
9237
9238    /// Sets the value of [database_details][crate::model::Database::database_details]
9239    /// to hold a `SqlserverDatabaseDetails`.
9240    ///
9241    /// Note that all the setters affecting `database_details` are
9242    /// mutually exclusive.
9243    pub fn set_sqlserver_database_details<
9244        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
9245    >(
9246        mut self,
9247        v: T,
9248    ) -> Self {
9249        self.database_details = std::option::Option::Some(
9250            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
9251        );
9252        self
9253    }
9254}
9255
9256impl wkt::message::Message for Database {
9257    fn typename() -> &'static str {
9258        "type.googleapis.com/google.cloud.sql.v1.Database"
9259    }
9260}
9261
9262/// Defines additional types related to [Database].
9263pub mod database {
9264    #[allow(unused_imports)]
9265    use super::*;
9266
9267    #[serde_with::serde_as]
9268    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9269    #[serde(rename_all = "camelCase")]
9270    #[non_exhaustive]
9271    pub enum DatabaseDetails {
9272        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
9273    }
9274}
9275
9276/// Represents a Sql Server database on the Cloud SQL instance.
9277#[serde_with::serde_as]
9278#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9279#[serde(default, rename_all = "camelCase")]
9280#[non_exhaustive]
9281pub struct SqlServerDatabaseDetails {
9282    /// The version of SQL Server with which the database is to be made compatible
9283    #[serde(skip_serializing_if = "wkt::internal::is_default")]
9284    pub compatibility_level: i32,
9285
9286    /// The recovery model of a SQL Server database
9287    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9288    pub recovery_model: std::string::String,
9289
9290    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9291    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9292}
9293
9294impl SqlServerDatabaseDetails {
9295    pub fn new() -> Self {
9296        std::default::Default::default()
9297    }
9298
9299    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
9300    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9301        self.compatibility_level = v.into();
9302        self
9303    }
9304
9305    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
9306    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9307        self.recovery_model = v.into();
9308        self
9309    }
9310}
9311
9312impl wkt::message::Message for SqlServerDatabaseDetails {
9313    fn typename() -> &'static str {
9314        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
9315    }
9316}
9317
9318/// Database flags for Cloud SQL instances.
9319#[serde_with::serde_as]
9320#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9321#[serde(default, rename_all = "camelCase")]
9322#[non_exhaustive]
9323pub struct DatabaseFlags {
9324    /// The name of the flag. These flags are passed at instance startup, so
9325    /// include both server options and system variables. Flags are
9326    /// specified with underscores, not hyphens. For more information, see
9327    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
9328    /// in the Cloud SQL documentation.
9329    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9330    pub name: std::string::String,
9331
9332    /// The value of the flag. Boolean flags are set to `on` for true
9333    /// and `off` for false. This field must be omitted if the flag
9334    /// doesn't take a value.
9335    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9336    pub value: std::string::String,
9337
9338    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9339    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9340}
9341
9342impl DatabaseFlags {
9343    pub fn new() -> Self {
9344        std::default::Default::default()
9345    }
9346
9347    /// Sets the value of [name][crate::model::DatabaseFlags::name].
9348    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9349        self.name = v.into();
9350        self
9351    }
9352
9353    /// Sets the value of [value][crate::model::DatabaseFlags::value].
9354    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9355        self.value = v.into();
9356        self
9357    }
9358}
9359
9360impl wkt::message::Message for DatabaseFlags {
9361    fn typename() -> &'static str {
9362        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
9363    }
9364}
9365
9366/// MySQL-specific external server sync settings.
9367#[serde_with::serde_as]
9368#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9369#[serde(default, rename_all = "camelCase")]
9370#[non_exhaustive]
9371pub struct MySqlSyncConfig {
9372    /// Flags to use for the initial dump.
9373    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9374    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
9375
9376    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9377    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9378}
9379
9380impl MySqlSyncConfig {
9381    pub fn new() -> Self {
9382        std::default::Default::default()
9383    }
9384
9385    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
9386    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
9387    where
9388        T: std::iter::IntoIterator<Item = V>,
9389        V: std::convert::Into<crate::model::SyncFlags>,
9390    {
9391        use std::iter::Iterator;
9392        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
9393        self
9394    }
9395}
9396
9397impl wkt::message::Message for MySqlSyncConfig {
9398    fn typename() -> &'static str {
9399        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
9400    }
9401}
9402
9403/// Initial sync flags for certain Cloud SQL APIs.
9404/// Currently used for the MySQL external server initial dump.
9405#[serde_with::serde_as]
9406#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9407#[serde(default, rename_all = "camelCase")]
9408#[non_exhaustive]
9409pub struct SyncFlags {
9410    /// The name of the flag.
9411    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9412    pub name: std::string::String,
9413
9414    /// The value of the flag. This field must be omitted if the flag
9415    /// doesn't take a value.
9416    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9417    pub value: std::string::String,
9418
9419    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9420    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9421}
9422
9423impl SyncFlags {
9424    pub fn new() -> Self {
9425        std::default::Default::default()
9426    }
9427
9428    /// Sets the value of [name][crate::model::SyncFlags::name].
9429    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9430        self.name = v.into();
9431        self
9432    }
9433
9434    /// Sets the value of [value][crate::model::SyncFlags::value].
9435    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9436        self.value = v.into();
9437        self
9438    }
9439}
9440
9441impl wkt::message::Message for SyncFlags {
9442    fn typename() -> &'static str {
9443        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
9444    }
9445}
9446
9447/// Reference to another Cloud SQL instance.
9448#[serde_with::serde_as]
9449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9450#[serde(default, rename_all = "camelCase")]
9451#[non_exhaustive]
9452pub struct InstanceReference {
9453    /// The name of the Cloud SQL instance being referenced.
9454    /// This does not include the project ID.
9455    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9456    pub name: std::string::String,
9457
9458    /// The region of the Cloud SQL instance being referenced.
9459    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9460    pub region: std::string::String,
9461
9462    /// The project ID of the Cloud SQL instance being referenced.
9463    /// The default is the same project ID as the instance references it.
9464    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9465    pub project: std::string::String,
9466
9467    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9468    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9469}
9470
9471impl InstanceReference {
9472    pub fn new() -> Self {
9473        std::default::Default::default()
9474    }
9475
9476    /// Sets the value of [name][crate::model::InstanceReference::name].
9477    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9478        self.name = v.into();
9479        self
9480    }
9481
9482    /// Sets the value of [region][crate::model::InstanceReference::region].
9483    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9484        self.region = v.into();
9485        self
9486    }
9487
9488    /// Sets the value of [project][crate::model::InstanceReference::project].
9489    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9490        self.project = v.into();
9491        self
9492    }
9493}
9494
9495impl wkt::message::Message for InstanceReference {
9496    fn typename() -> &'static str {
9497        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
9498    }
9499}
9500
9501/// Read-replica configuration for connecting to the on-premises primary
9502/// instance.
9503#[serde_with::serde_as]
9504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9505#[serde(default, rename_all = "camelCase")]
9506#[non_exhaustive]
9507pub struct DemoteMasterConfiguration {
9508    /// This is always `sql#demoteMasterConfiguration`.
9509    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9510    pub kind: std::string::String,
9511
9512    /// MySQL specific configuration when replicating from a MySQL on-premises
9513    /// primary instance. Replication configuration information such as the
9514    /// username, password, certificates, and keys are not stored in the instance
9515    /// metadata. The configuration information is used only to set up the
9516    /// replication connection and is stored by MySQL in a file named
9517    /// `master.info` in the data directory.
9518    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9519    pub mysql_replica_configuration:
9520        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9521
9522    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9523    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9524}
9525
9526impl DemoteMasterConfiguration {
9527    pub fn new() -> Self {
9528        std::default::Default::default()
9529    }
9530
9531    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
9532    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9533        self.kind = v.into();
9534        self
9535    }
9536
9537    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
9538    pub fn set_mysql_replica_configuration<
9539        T: std::convert::Into<
9540                std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9541            >,
9542    >(
9543        mut self,
9544        v: T,
9545    ) -> Self {
9546        self.mysql_replica_configuration = v.into();
9547        self
9548    }
9549}
9550
9551impl wkt::message::Message for DemoteMasterConfiguration {
9552    fn typename() -> &'static str {
9553        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
9554    }
9555}
9556
9557/// Read-replica configuration specific to MySQL databases.
9558#[serde_with::serde_as]
9559#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9560#[serde(default, rename_all = "camelCase")]
9561#[non_exhaustive]
9562pub struct DemoteMasterMySqlReplicaConfiguration {
9563    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
9564    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9565    pub kind: std::string::String,
9566
9567    /// The username for the replication connection.
9568    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9569    pub username: std::string::String,
9570
9571    /// The password for the replication connection.
9572    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9573    pub password: std::string::String,
9574
9575    /// PEM representation of the replica's private key. The corresponsing public
9576    /// key is encoded in the client's certificate. The format of the replica's
9577    /// private key can be either PKCS #1 or PKCS #8.
9578    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9579    pub client_key: std::string::String,
9580
9581    /// PEM representation of the replica's x509 certificate.
9582    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9583    pub client_certificate: std::string::String,
9584
9585    /// PEM representation of the trusted CA's x509 certificate.
9586    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9587    pub ca_certificate: std::string::String,
9588
9589    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9590    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9591}
9592
9593impl DemoteMasterMySqlReplicaConfiguration {
9594    pub fn new() -> Self {
9595        std::default::Default::default()
9596    }
9597
9598    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
9599    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9600        self.kind = v.into();
9601        self
9602    }
9603
9604    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
9605    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9606        self.username = v.into();
9607        self
9608    }
9609
9610    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
9611    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9612        self.password = v.into();
9613        self
9614    }
9615
9616    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
9617    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9618        self.client_key = v.into();
9619        self
9620    }
9621
9622    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
9623    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
9624        mut self,
9625        v: T,
9626    ) -> Self {
9627        self.client_certificate = v.into();
9628        self
9629    }
9630
9631    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
9632    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9633        self.ca_certificate = v.into();
9634        self
9635    }
9636}
9637
9638impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
9639    fn typename() -> &'static str {
9640        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
9641    }
9642}
9643
9644/// Database instance export context.
9645#[serde_with::serde_as]
9646#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9647#[serde(default, rename_all = "camelCase")]
9648#[non_exhaustive]
9649pub struct ExportContext {
9650    /// The path to the file in Google Cloud Storage where the export will be
9651    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
9652    /// already exists, the request succeeds, but the operation fails. If
9653    /// `fileType` is `SQL` and the filename ends with .gz,
9654    /// the contents are compressed.
9655    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9656    pub uri: std::string::String,
9657
9658    /// Databases to be exported. <br /> `MySQL instances:` If
9659    /// `fileType` is `SQL` and no database is specified, all
9660    /// databases are exported, except for the `mysql` system database.
9661    /// If `fileType` is `CSV`, you can specify one database,
9662    /// either by using this property or by using the
9663    /// `csvExportOptions.selectQuery` property, which takes precedence
9664    /// over this property. <br /> `PostgreSQL instances:` You must specify
9665    /// one database to be exported. If `fileType` is `CSV`,
9666    /// this database must match the one specified in the
9667    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
9668    /// instances:` You must specify one database to be exported, and the
9669    /// `fileType` must be `BAK`.
9670    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9671    pub databases: std::vec::Vec<std::string::String>,
9672
9673    /// This is always `sql#exportContext`.
9674    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9675    pub kind: std::string::String,
9676
9677    /// Options for exporting data as SQL statements.
9678    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9679    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
9680
9681    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
9682    /// instances only.
9683    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9684    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
9685
9686    /// The file type for the specified uri.
9687    pub file_type: crate::model::SqlFileType,
9688
9689    /// Option for export offload.
9690    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9691    pub offload: std::option::Option<wkt::BoolValue>,
9692
9693    /// Options for exporting data as BAK files.
9694    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9695    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
9696
9697    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9699}
9700
9701impl ExportContext {
9702    pub fn new() -> Self {
9703        std::default::Default::default()
9704    }
9705
9706    /// Sets the value of [uri][crate::model::ExportContext::uri].
9707    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9708        self.uri = v.into();
9709        self
9710    }
9711
9712    /// Sets the value of [databases][crate::model::ExportContext::databases].
9713    pub fn set_databases<T, V>(mut self, v: T) -> Self
9714    where
9715        T: std::iter::IntoIterator<Item = V>,
9716        V: std::convert::Into<std::string::String>,
9717    {
9718        use std::iter::Iterator;
9719        self.databases = v.into_iter().map(|i| i.into()).collect();
9720        self
9721    }
9722
9723    /// Sets the value of [kind][crate::model::ExportContext::kind].
9724    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9725        self.kind = v.into();
9726        self
9727    }
9728
9729    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
9730    pub fn set_sql_export_options<
9731        T: std::convert::Into<std::option::Option<crate::model::export_context::SqlExportOptions>>,
9732    >(
9733        mut self,
9734        v: T,
9735    ) -> Self {
9736        self.sql_export_options = v.into();
9737        self
9738    }
9739
9740    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
9741    pub fn set_csv_export_options<
9742        T: std::convert::Into<std::option::Option<crate::model::export_context::SqlCsvExportOptions>>,
9743    >(
9744        mut self,
9745        v: T,
9746    ) -> Self {
9747        self.csv_export_options = v.into();
9748        self
9749    }
9750
9751    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
9752    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
9753        self.file_type = v.into();
9754        self
9755    }
9756
9757    /// Sets the value of [offload][crate::model::ExportContext::offload].
9758    pub fn set_offload<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
9759        mut self,
9760        v: T,
9761    ) -> Self {
9762        self.offload = v.into();
9763        self
9764    }
9765
9766    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
9767    pub fn set_bak_export_options<
9768        T: std::convert::Into<std::option::Option<crate::model::export_context::SqlBakExportOptions>>,
9769    >(
9770        mut self,
9771        v: T,
9772    ) -> Self {
9773        self.bak_export_options = v.into();
9774        self
9775    }
9776}
9777
9778impl wkt::message::Message for ExportContext {
9779    fn typename() -> &'static str {
9780        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
9781    }
9782}
9783
9784/// Defines additional types related to [ExportContext].
9785pub mod export_context {
9786    #[allow(unused_imports)]
9787    use super::*;
9788
9789    #[serde_with::serde_as]
9790    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9791    #[serde(default, rename_all = "camelCase")]
9792    #[non_exhaustive]
9793    pub struct SqlCsvExportOptions {
9794        /// The select query used to extract the data.
9795        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9796        pub select_query: std::string::String,
9797
9798        /// Specifies the character that should appear before a data character that
9799        /// needs to be escaped.
9800        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9801        pub escape_character: std::string::String,
9802
9803        /// Specifies the quoting character to be used when a data value is quoted.
9804        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9805        pub quote_character: std::string::String,
9806
9807        /// Specifies the character that separates columns within each row (line) of
9808        /// the file.
9809        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9810        pub fields_terminated_by: std::string::String,
9811
9812        /// This is used to separate lines. If a line does not contain all fields,
9813        /// the rest of the columns are set to their default values.
9814        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9815        pub lines_terminated_by: std::string::String,
9816
9817        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9818        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9819    }
9820
9821    impl SqlCsvExportOptions {
9822        pub fn new() -> Self {
9823            std::default::Default::default()
9824        }
9825
9826        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
9827        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9828            mut self,
9829            v: T,
9830        ) -> Self {
9831            self.select_query = v.into();
9832            self
9833        }
9834
9835        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
9836        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
9837            mut self,
9838            v: T,
9839        ) -> Self {
9840            self.escape_character = v.into();
9841            self
9842        }
9843
9844        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
9845        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
9846            mut self,
9847            v: T,
9848        ) -> Self {
9849            self.quote_character = v.into();
9850            self
9851        }
9852
9853        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
9854        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
9855            mut self,
9856            v: T,
9857        ) -> Self {
9858            self.fields_terminated_by = v.into();
9859            self
9860        }
9861
9862        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
9863        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
9864            mut self,
9865            v: T,
9866        ) -> Self {
9867            self.lines_terminated_by = v.into();
9868            self
9869        }
9870    }
9871
9872    impl wkt::message::Message for SqlCsvExportOptions {
9873        fn typename() -> &'static str {
9874            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
9875        }
9876    }
9877
9878    #[serde_with::serde_as]
9879    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9880    #[serde(default, rename_all = "camelCase")]
9881    #[non_exhaustive]
9882    pub struct SqlExportOptions {
9883        /// Tables to export, or that were exported, from the specified database. If
9884        /// you specify tables, specify one and only one database. For PostgreSQL
9885        /// instances, you can specify only one table.
9886        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9887        pub tables: std::vec::Vec<std::string::String>,
9888
9889        /// Export only schemas.
9890        #[serde(skip_serializing_if = "std::option::Option::is_none")]
9891        pub schema_only: std::option::Option<wkt::BoolValue>,
9892
9893        #[serde(skip_serializing_if = "std::option::Option::is_none")]
9894        pub mysql_export_options: std::option::Option<
9895            crate::model::export_context::sql_export_options::MysqlExportOptions,
9896        >,
9897
9898        /// Optional. The number of threads to use for parallel export.
9899        #[serde(skip_serializing_if = "std::option::Option::is_none")]
9900        pub threads: std::option::Option<wkt::Int32Value>,
9901
9902        /// Optional. Whether or not the export should be parallel.
9903        #[serde(skip_serializing_if = "std::option::Option::is_none")]
9904        pub parallel: std::option::Option<wkt::BoolValue>,
9905
9906        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
9907        #[serde(skip_serializing_if = "std::option::Option::is_none")]
9908        pub postgres_export_options: std::option::Option<
9909            crate::model::export_context::sql_export_options::PostgresExportOptions,
9910        >,
9911
9912        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9913        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9914    }
9915
9916    impl SqlExportOptions {
9917        pub fn new() -> Self {
9918            std::default::Default::default()
9919        }
9920
9921        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
9922        pub fn set_tables<T, V>(mut self, v: T) -> Self
9923        where
9924            T: std::iter::IntoIterator<Item = V>,
9925            V: std::convert::Into<std::string::String>,
9926        {
9927            use std::iter::Iterator;
9928            self.tables = v.into_iter().map(|i| i.into()).collect();
9929            self
9930        }
9931
9932        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
9933        pub fn set_schema_only<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
9934            mut self,
9935            v: T,
9936        ) -> Self {
9937            self.schema_only = v.into();
9938            self
9939        }
9940
9941        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
9942        pub fn set_mysql_export_options<
9943            T: std::convert::Into<
9944                    std::option::Option<
9945                        crate::model::export_context::sql_export_options::MysqlExportOptions,
9946                    >,
9947                >,
9948        >(
9949            mut self,
9950            v: T,
9951        ) -> Self {
9952            self.mysql_export_options = v.into();
9953            self
9954        }
9955
9956        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
9957        pub fn set_threads<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
9958            mut self,
9959            v: T,
9960        ) -> Self {
9961            self.threads = v.into();
9962            self
9963        }
9964
9965        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
9966        pub fn set_parallel<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
9967            mut self,
9968            v: T,
9969        ) -> Self {
9970            self.parallel = v.into();
9971            self
9972        }
9973
9974        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
9975        pub fn set_postgres_export_options<
9976            T: std::convert::Into<
9977                    std::option::Option<
9978                        crate::model::export_context::sql_export_options::PostgresExportOptions,
9979                    >,
9980                >,
9981        >(
9982            mut self,
9983            v: T,
9984        ) -> Self {
9985            self.postgres_export_options = v.into();
9986            self
9987        }
9988    }
9989
9990    impl wkt::message::Message for SqlExportOptions {
9991        fn typename() -> &'static str {
9992            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
9993        }
9994    }
9995
9996    /// Defines additional types related to [SqlExportOptions].
9997    pub mod sql_export_options {
9998        #[allow(unused_imports)]
9999        use super::*;
10000
10001        /// Options for exporting from MySQL.
10002        #[serde_with::serde_as]
10003        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10004        #[serde(default, rename_all = "camelCase")]
10005        #[non_exhaustive]
10006        pub struct MysqlExportOptions {
10007            /// Option to include SQL statement required to set up replication. If set
10008            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
10009            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
10010            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
10011            /// has no effect. If set to any value other than `1`, --set-gtid-purged
10012            /// is set to OFF.
10013            #[serde(skip_serializing_if = "std::option::Option::is_none")]
10014            pub master_data: std::option::Option<wkt::Int32Value>,
10015
10016            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10017            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10018        }
10019
10020        impl MysqlExportOptions {
10021            pub fn new() -> Self {
10022                std::default::Default::default()
10023            }
10024
10025            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
10026            pub fn set_master_data<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
10027                mut self,
10028                v: T,
10029            ) -> Self {
10030                self.master_data = v.into();
10031                self
10032            }
10033        }
10034
10035        impl wkt::message::Message for MysqlExportOptions {
10036            fn typename() -> &'static str {
10037                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
10038            }
10039        }
10040
10041        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
10042        #[serde_with::serde_as]
10043        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10044        #[serde(default, rename_all = "camelCase")]
10045        #[non_exhaustive]
10046        pub struct PostgresExportOptions {
10047            /// Optional. Use this option to include DROP \<object\> SQL statements.
10048            /// These statements are used to delete database objects before running the
10049            /// import operation.
10050            #[serde(skip_serializing_if = "std::option::Option::is_none")]
10051            pub clean: std::option::Option<wkt::BoolValue>,
10052
10053            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
10054            /// statement produced by clean.
10055            #[serde(skip_serializing_if = "std::option::Option::is_none")]
10056            pub if_exists: std::option::Option<wkt::BoolValue>,
10057
10058            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10059            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060        }
10061
10062        impl PostgresExportOptions {
10063            pub fn new() -> Self {
10064                std::default::Default::default()
10065            }
10066
10067            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
10068            pub fn set_clean<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10069                mut self,
10070                v: T,
10071            ) -> Self {
10072                self.clean = v.into();
10073                self
10074            }
10075
10076            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
10077            pub fn set_if_exists<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10078                mut self,
10079                v: T,
10080            ) -> Self {
10081                self.if_exists = v.into();
10082                self
10083            }
10084        }
10085
10086        impl wkt::message::Message for PostgresExportOptions {
10087            fn typename() -> &'static str {
10088                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
10089            }
10090        }
10091    }
10092
10093    /// Options for exporting BAK files (SQL Server-only)
10094    #[serde_with::serde_as]
10095    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10096    #[serde(default, rename_all = "camelCase")]
10097    #[non_exhaustive]
10098    pub struct SqlBakExportOptions {
10099        /// Whether or not the export should be striped.
10100        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10101        pub striped: std::option::Option<wkt::BoolValue>,
10102
10103        /// Option for specifying how many stripes to use for the export.
10104        /// If blank, and the value of the striped field is true,
10105        /// the number of stripes is automatically chosen.
10106        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10107        pub stripe_count: std::option::Option<wkt::Int32Value>,
10108
10109        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
10110        pub bak_type: crate::model::BakType,
10111
10112        /// Deprecated: copy_only is deprecated. Use differential_base instead
10113        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10114        #[deprecated]
10115        pub copy_only: std::option::Option<wkt::BoolValue>,
10116
10117        /// Whether or not the backup can be used as a differential base
10118        /// copy_only backup can not be served as differential base
10119        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10120        pub differential_base: std::option::Option<wkt::BoolValue>,
10121
10122        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10123        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10124    }
10125
10126    impl SqlBakExportOptions {
10127        pub fn new() -> Self {
10128            std::default::Default::default()
10129        }
10130
10131        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
10132        pub fn set_striped<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10133            mut self,
10134            v: T,
10135        ) -> Self {
10136            self.striped = v.into();
10137            self
10138        }
10139
10140        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
10141        pub fn set_stripe_count<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
10142            mut self,
10143            v: T,
10144        ) -> Self {
10145            self.stripe_count = v.into();
10146            self
10147        }
10148
10149        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
10150        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10151            self.bak_type = v.into();
10152            self
10153        }
10154
10155        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
10156        #[deprecated]
10157        pub fn set_copy_only<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10158            mut self,
10159            v: T,
10160        ) -> Self {
10161            self.copy_only = v.into();
10162            self
10163        }
10164
10165        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
10166        pub fn set_differential_base<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10167            mut self,
10168            v: T,
10169        ) -> Self {
10170            self.differential_base = v.into();
10171            self
10172        }
10173    }
10174
10175    impl wkt::message::Message for SqlBakExportOptions {
10176        fn typename() -> &'static str {
10177            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
10178        }
10179    }
10180}
10181
10182/// Database instance import context.
10183#[serde_with::serde_as]
10184#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10185#[serde(default, rename_all = "camelCase")]
10186#[non_exhaustive]
10187pub struct ImportContext {
10188    /// Path to the import file in Cloud Storage, in the form
10189    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
10190    /// when `fileType` is `SQL`. The instance must have
10191    /// write permissions to the bucket and read access to the file.
10192    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10193    pub uri: std::string::String,
10194
10195    /// The target database for the import. If `fileType` is `SQL`, this field
10196    /// is required only if the import file does not specify a database, and is
10197    /// overridden by any database specification in the import file. If
10198    /// `fileType` is `CSV`, one database must be specified.
10199    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10200    pub database: std::string::String,
10201
10202    /// This is always `sql#importContext`.
10203    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10204    pub kind: std::string::String,
10205
10206    /// The file type for the specified uri.\`SQL`: The file
10207    /// contains SQL statements. \`CSV`: The file contains CSV data.
10208    pub file_type: crate::model::SqlFileType,
10209
10210    /// Options for importing data as CSV.
10211    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10212    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
10213
10214    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
10215    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10216    pub import_user: std::string::String,
10217
10218    /// Import parameters specific to SQL Server .BAK files
10219    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10220    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
10221
10222    /// Optional. Options for importing data from SQL statements.
10223    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10224    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
10225
10226    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10227    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10228}
10229
10230impl ImportContext {
10231    pub fn new() -> Self {
10232        std::default::Default::default()
10233    }
10234
10235    /// Sets the value of [uri][crate::model::ImportContext::uri].
10236    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10237        self.uri = v.into();
10238        self
10239    }
10240
10241    /// Sets the value of [database][crate::model::ImportContext::database].
10242    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10243        self.database = v.into();
10244        self
10245    }
10246
10247    /// Sets the value of [kind][crate::model::ImportContext::kind].
10248    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10249        self.kind = v.into();
10250        self
10251    }
10252
10253    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
10254    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
10255        self.file_type = v.into();
10256        self
10257    }
10258
10259    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
10260    pub fn set_csv_import_options<
10261        T: std::convert::Into<std::option::Option<crate::model::import_context::SqlCsvImportOptions>>,
10262    >(
10263        mut self,
10264        v: T,
10265    ) -> Self {
10266        self.csv_import_options = v.into();
10267        self
10268    }
10269
10270    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
10271    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10272        self.import_user = v.into();
10273        self
10274    }
10275
10276    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
10277    pub fn set_bak_import_options<
10278        T: std::convert::Into<std::option::Option<crate::model::import_context::SqlBakImportOptions>>,
10279    >(
10280        mut self,
10281        v: T,
10282    ) -> Self {
10283        self.bak_import_options = v.into();
10284        self
10285    }
10286
10287    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
10288    pub fn set_sql_import_options<
10289        T: std::convert::Into<std::option::Option<crate::model::import_context::SqlImportOptions>>,
10290    >(
10291        mut self,
10292        v: T,
10293    ) -> Self {
10294        self.sql_import_options = v.into();
10295        self
10296    }
10297}
10298
10299impl wkt::message::Message for ImportContext {
10300    fn typename() -> &'static str {
10301        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
10302    }
10303}
10304
10305/// Defines additional types related to [ImportContext].
10306pub mod import_context {
10307    #[allow(unused_imports)]
10308    use super::*;
10309
10310    #[serde_with::serde_as]
10311    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10312    #[serde(default, rename_all = "camelCase")]
10313    #[non_exhaustive]
10314    pub struct SqlImportOptions {
10315        /// Optional. The number of threads to use for parallel import.
10316        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10317        pub threads: std::option::Option<wkt::Int32Value>,
10318
10319        /// Optional. Whether or not the import should be parallel.
10320        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10321        pub parallel: std::option::Option<wkt::BoolValue>,
10322
10323        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
10324        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10325        pub postgres_import_options: std::option::Option<
10326            crate::model::import_context::sql_import_options::PostgresImportOptions,
10327        >,
10328
10329        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10330        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10331    }
10332
10333    impl SqlImportOptions {
10334        pub fn new() -> Self {
10335            std::default::Default::default()
10336        }
10337
10338        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
10339        pub fn set_threads<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
10340            mut self,
10341            v: T,
10342        ) -> Self {
10343            self.threads = v.into();
10344            self
10345        }
10346
10347        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
10348        pub fn set_parallel<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10349            mut self,
10350            v: T,
10351        ) -> Self {
10352            self.parallel = v.into();
10353            self
10354        }
10355
10356        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
10357        pub fn set_postgres_import_options<
10358            T: std::convert::Into<
10359                    std::option::Option<
10360                        crate::model::import_context::sql_import_options::PostgresImportOptions,
10361                    >,
10362                >,
10363        >(
10364            mut self,
10365            v: T,
10366        ) -> Self {
10367            self.postgres_import_options = v.into();
10368            self
10369        }
10370    }
10371
10372    impl wkt::message::Message for SqlImportOptions {
10373        fn typename() -> &'static str {
10374            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
10375        }
10376    }
10377
10378    /// Defines additional types related to [SqlImportOptions].
10379    pub mod sql_import_options {
10380        #[allow(unused_imports)]
10381        use super::*;
10382
10383        #[serde_with::serde_as]
10384        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10385        #[serde(default, rename_all = "camelCase")]
10386        #[non_exhaustive]
10387        pub struct PostgresImportOptions {
10388            /// Optional. The --clean flag for the pg_restore utility. This flag
10389            /// applies only if you enabled Cloud SQL to import files in parallel.
10390            #[serde(skip_serializing_if = "std::option::Option::is_none")]
10391            pub clean: std::option::Option<wkt::BoolValue>,
10392
10393            /// Optional. The --if-exists flag for the pg_restore utility. This flag
10394            /// applies only if you enabled Cloud SQL to import files in parallel.
10395            #[serde(skip_serializing_if = "std::option::Option::is_none")]
10396            pub if_exists: std::option::Option<wkt::BoolValue>,
10397
10398            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10399            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10400        }
10401
10402        impl PostgresImportOptions {
10403            pub fn new() -> Self {
10404                std::default::Default::default()
10405            }
10406
10407            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
10408            pub fn set_clean<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10409                mut self,
10410                v: T,
10411            ) -> Self {
10412                self.clean = v.into();
10413                self
10414            }
10415
10416            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
10417            pub fn set_if_exists<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10418                mut self,
10419                v: T,
10420            ) -> Self {
10421                self.if_exists = v.into();
10422                self
10423            }
10424        }
10425
10426        impl wkt::message::Message for PostgresImportOptions {
10427            fn typename() -> &'static str {
10428                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
10429            }
10430        }
10431    }
10432
10433    #[serde_with::serde_as]
10434    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10435    #[serde(default, rename_all = "camelCase")]
10436    #[non_exhaustive]
10437    pub struct SqlCsvImportOptions {
10438        /// The table to which CSV data is imported.
10439        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10440        pub table: std::string::String,
10441
10442        /// The columns to which CSV data is imported. If not specified, all columns
10443        /// of the database table are loaded with CSV data.
10444        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10445        pub columns: std::vec::Vec<std::string::String>,
10446
10447        /// Specifies the character that should appear before a data character that
10448        /// needs to be escaped.
10449        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10450        pub escape_character: std::string::String,
10451
10452        /// Specifies the quoting character to be used when a data value is quoted.
10453        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10454        pub quote_character: std::string::String,
10455
10456        /// Specifies the character that separates columns within each row (line) of
10457        /// the file.
10458        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10459        pub fields_terminated_by: std::string::String,
10460
10461        /// This is used to separate lines. If a line does not contain all fields,
10462        /// the rest of the columns are set to their default values.
10463        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10464        pub lines_terminated_by: std::string::String,
10465
10466        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10467        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10468    }
10469
10470    impl SqlCsvImportOptions {
10471        pub fn new() -> Self {
10472            std::default::Default::default()
10473        }
10474
10475        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
10476        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10477            self.table = v.into();
10478            self
10479        }
10480
10481        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
10482        pub fn set_columns<T, V>(mut self, v: T) -> Self
10483        where
10484            T: std::iter::IntoIterator<Item = V>,
10485            V: std::convert::Into<std::string::String>,
10486        {
10487            use std::iter::Iterator;
10488            self.columns = v.into_iter().map(|i| i.into()).collect();
10489            self
10490        }
10491
10492        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
10493        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
10494            mut self,
10495            v: T,
10496        ) -> Self {
10497            self.escape_character = v.into();
10498            self
10499        }
10500
10501        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
10502        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
10503            mut self,
10504            v: T,
10505        ) -> Self {
10506            self.quote_character = v.into();
10507            self
10508        }
10509
10510        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
10511        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
10512            mut self,
10513            v: T,
10514        ) -> Self {
10515            self.fields_terminated_by = v.into();
10516            self
10517        }
10518
10519        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
10520        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
10521            mut self,
10522            v: T,
10523        ) -> Self {
10524            self.lines_terminated_by = v.into();
10525            self
10526        }
10527    }
10528
10529    impl wkt::message::Message for SqlCsvImportOptions {
10530        fn typename() -> &'static str {
10531            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
10532        }
10533    }
10534
10535    #[serde_with::serde_as]
10536    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10537    #[serde(default, rename_all = "camelCase")]
10538    #[non_exhaustive]
10539    pub struct SqlBakImportOptions {
10540        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10541        pub encryption_options: std::option::Option<
10542            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10543        >,
10544
10545        /// Whether or not the backup set being restored is striped.
10546        /// Applies only to Cloud SQL for SQL Server.
10547        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10548        pub striped: std::option::Option<wkt::BoolValue>,
10549
10550        /// Whether or not the backup importing will restore database
10551        /// with NORECOVERY option
10552        /// Applies only to Cloud SQL for SQL Server.
10553        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10554        pub no_recovery: std::option::Option<wkt::BoolValue>,
10555
10556        /// Whether or not the backup importing request will just bring database
10557        /// online without downloading Bak content only one of "no_recovery" and
10558        /// "recovery_only" can be true otherwise error will return. Applies only to
10559        /// Cloud SQL for SQL Server.
10560        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10561        pub recovery_only: std::option::Option<wkt::BoolValue>,
10562
10563        /// Type of the bak content, FULL or DIFF
10564        pub bak_type: crate::model::BakType,
10565
10566        /// Optional. The timestamp when the import should stop. This timestamp is in
10567        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
10568        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
10569        /// keyword and applies to Cloud SQL for SQL Server only.
10570        #[serde(skip_serializing_if = "std::option::Option::is_none")]
10571        pub stop_at: std::option::Option<wkt::Timestamp>,
10572
10573        /// Optional. The marked transaction where the import should stop. This field
10574        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
10575        /// Server only.
10576        #[serde(skip_serializing_if = "std::string::String::is_empty")]
10577        pub stop_at_mark: std::string::String,
10578
10579        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10580        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10581    }
10582
10583    impl SqlBakImportOptions {
10584        pub fn new() -> Self {
10585            std::default::Default::default()
10586        }
10587
10588        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
10589        pub fn set_encryption_options<
10590            T: std::convert::Into<
10591                    std::option::Option<
10592                        crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10593                    >,
10594                >,
10595        >(
10596            mut self,
10597            v: T,
10598        ) -> Self {
10599            self.encryption_options = v.into();
10600            self
10601        }
10602
10603        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
10604        pub fn set_striped<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10605            mut self,
10606            v: T,
10607        ) -> Self {
10608            self.striped = v.into();
10609            self
10610        }
10611
10612        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
10613        pub fn set_no_recovery<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10614            mut self,
10615            v: T,
10616        ) -> Self {
10617            self.no_recovery = v.into();
10618            self
10619        }
10620
10621        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
10622        pub fn set_recovery_only<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10623            mut self,
10624            v: T,
10625        ) -> Self {
10626            self.recovery_only = v.into();
10627            self
10628        }
10629
10630        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
10631        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10632            self.bak_type = v.into();
10633            self
10634        }
10635
10636        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
10637        pub fn set_stop_at<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10638            mut self,
10639            v: T,
10640        ) -> Self {
10641            self.stop_at = v.into();
10642            self
10643        }
10644
10645        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
10646        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
10647            mut self,
10648            v: T,
10649        ) -> Self {
10650            self.stop_at_mark = v.into();
10651            self
10652        }
10653    }
10654
10655    impl wkt::message::Message for SqlBakImportOptions {
10656        fn typename() -> &'static str {
10657            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
10658        }
10659    }
10660
10661    /// Defines additional types related to [SqlBakImportOptions].
10662    pub mod sql_bak_import_options {
10663        #[allow(unused_imports)]
10664        use super::*;
10665
10666        #[serde_with::serde_as]
10667        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10668        #[serde(default, rename_all = "camelCase")]
10669        #[non_exhaustive]
10670        pub struct EncryptionOptions {
10671            /// Path to the Certificate (.cer) in Cloud Storage, in the form
10672            /// `gs://bucketName/fileName`. The instance must have
10673            /// write permissions to the bucket and read access to the file.
10674            #[serde(skip_serializing_if = "std::string::String::is_empty")]
10675            pub cert_path: std::string::String,
10676
10677            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
10678            /// form `gs://bucketName/fileName`. The instance must have
10679            /// write permissions to the bucket and read access to the file.
10680            #[serde(skip_serializing_if = "std::string::String::is_empty")]
10681            pub pvk_path: std::string::String,
10682
10683            /// Password that encrypts the private key
10684            #[serde(skip_serializing_if = "std::string::String::is_empty")]
10685            pub pvk_password: std::string::String,
10686
10687            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10688            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10689        }
10690
10691        impl EncryptionOptions {
10692            pub fn new() -> Self {
10693                std::default::Default::default()
10694            }
10695
10696            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
10697            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
10698                mut self,
10699                v: T,
10700            ) -> Self {
10701                self.cert_path = v.into();
10702                self
10703            }
10704
10705            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
10706            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
10707                mut self,
10708                v: T,
10709            ) -> Self {
10710                self.pvk_path = v.into();
10711                self
10712            }
10713
10714            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
10715            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
10716                mut self,
10717                v: T,
10718            ) -> Self {
10719                self.pvk_password = v.into();
10720                self
10721            }
10722        }
10723
10724        impl wkt::message::Message for EncryptionOptions {
10725            fn typename() -> &'static str {
10726                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
10727            }
10728        }
10729    }
10730}
10731
10732/// IP Management configuration.
10733#[serde_with::serde_as]
10734#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10735#[serde(default, rename_all = "camelCase")]
10736#[non_exhaustive]
10737pub struct IpConfiguration {
10738    /// Whether the instance is assigned a public IP address or not.
10739    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10740    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
10741
10742    /// The resource link for the VPC network from which the Cloud SQL instance is
10743    /// accessible for private IP. For example,
10744    /// `/projects/myProject/global/networks/default`. This setting can
10745    /// be updated, but it cannot be removed after it is set.
10746    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10747    pub private_network: std::string::String,
10748
10749    /// Use `ssl_mode` instead.
10750    ///
10751    /// Whether SSL/TLS connections over IP are enforced.
10752    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
10753    /// For SSL/TLS connections, the client certificate won't be verified. If
10754    /// set to true, then only allow connections encrypted with SSL/TLS and with
10755    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
10756    /// the requirement for valid client certificates, then use the `ssl_mode` flag
10757    /// instead of the `require_ssl` flag.
10758    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10759    pub require_ssl: std::option::Option<wkt::BoolValue>,
10760
10761    /// The list of external networks that are allowed to connect to the instance
10762    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
10763    /// example: `157.197.200.0/24`).
10764    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10765    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
10766
10767    /// The name of the allocated ip range for the private ip Cloud SQL instance.
10768    /// For example: "google-managed-services-default". If set, the instance ip
10769    /// will be created in the allocated range. The range name must comply with
10770    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
10771    /// must be 1-63 characters long and match the regular expression
10772    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
10773    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10774    pub allocated_ip_range: std::string::String,
10775
10776    /// Controls connectivity to private IP instances from Google services,
10777    /// such as BigQuery.
10778    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10779    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
10780
10781    /// Specify how SSL/TLS is enforced in database connections. If you must use
10782    /// the `require_ssl` flag for backward compatibility, then only the following
10783    /// value pairs are valid:
10784    ///
10785    /// For PostgreSQL and MySQL:
10786    ///
10787    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
10788    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
10789    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
10790    ///
10791    /// For SQL Server:
10792    ///
10793    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
10794    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
10795    ///
10796    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
10797    ///
10798    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
10799    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
10800    /// connections, while `require_ssl=false` means accept both non-SSL
10801    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
10802    /// `ssl_mode` and accepts only SSL connections.
10803    pub ssl_mode: crate::model::ip_configuration::SslMode,
10804
10805    /// PSC settings for this instance.
10806    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10807    pub psc_config: std::option::Option<crate::model::PscConfig>,
10808
10809    /// Specify what type of CA is used for the server certificate.
10810    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10811    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
10812
10813    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10814    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10815}
10816
10817impl IpConfiguration {
10818    pub fn new() -> Self {
10819        std::default::Default::default()
10820    }
10821
10822    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
10823    pub fn set_ipv4_enabled<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10824        mut self,
10825        v: T,
10826    ) -> Self {
10827        self.ipv4_enabled = v.into();
10828        self
10829    }
10830
10831    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
10832    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10833        self.private_network = v.into();
10834        self
10835    }
10836
10837    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
10838    pub fn set_require_ssl<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
10839        mut self,
10840        v: T,
10841    ) -> Self {
10842        self.require_ssl = v.into();
10843        self
10844    }
10845
10846    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
10847    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
10848    where
10849        T: std::iter::IntoIterator<Item = V>,
10850        V: std::convert::Into<crate::model::AclEntry>,
10851    {
10852        use std::iter::Iterator;
10853        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
10854        self
10855    }
10856
10857    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
10858    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10859        mut self,
10860        v: T,
10861    ) -> Self {
10862        self.allocated_ip_range = v.into();
10863        self
10864    }
10865
10866    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
10867    pub fn set_enable_private_path_for_google_cloud_services<
10868        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
10869    >(
10870        mut self,
10871        v: T,
10872    ) -> Self {
10873        self.enable_private_path_for_google_cloud_services = v.into();
10874        self
10875    }
10876
10877    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
10878    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
10879        mut self,
10880        v: T,
10881    ) -> Self {
10882        self.ssl_mode = v.into();
10883        self
10884    }
10885
10886    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
10887    pub fn set_psc_config<T: std::convert::Into<std::option::Option<crate::model::PscConfig>>>(
10888        mut self,
10889        v: T,
10890    ) -> Self {
10891        self.psc_config = v.into();
10892        self
10893    }
10894
10895    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
10896    pub fn set_server_ca_mode<
10897        T: std::convert::Into<std::option::Option<crate::model::ip_configuration::CaMode>>,
10898    >(
10899        mut self,
10900        v: T,
10901    ) -> Self {
10902        self.server_ca_mode = v.into();
10903        self
10904    }
10905}
10906
10907impl wkt::message::Message for IpConfiguration {
10908    fn typename() -> &'static str {
10909        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
10910    }
10911}
10912
10913/// Defines additional types related to [IpConfiguration].
10914pub mod ip_configuration {
10915    #[allow(unused_imports)]
10916    use super::*;
10917
10918    /// The SSL options for database connections.
10919    ///
10920    /// # Working with unknown values
10921    ///
10922    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10923    /// additional enum variants at any time. Adding new variants is not considered
10924    /// a breaking change. Applications should write their code in anticipation of:
10925    ///
10926    /// - New values appearing in future releases of the client library, **and**
10927    /// - New values received dynamically, without application changes.
10928    ///
10929    /// Please consult the [Working with enums] section in the user guide for some
10930    /// guidelines.
10931    ///
10932    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10933    #[derive(Clone, Debug, PartialEq)]
10934    #[non_exhaustive]
10935    pub enum SslMode {
10936        /// The SSL mode is unknown.
10937        Unspecified,
10938        /// Allow non-SSL/non-TLS and SSL/TLS connections.
10939        /// For SSL connections to MySQL and PostgreSQL, the client certificate
10940        /// isn't verified.
10941        ///
10942        /// When this value is used, the legacy `require_ssl` flag must be false or
10943        /// cleared to avoid a conflict between the values of the two flags.
10944        AllowUnencryptedAndEncrypted,
10945        /// Only allow connections encrypted with SSL/TLS.
10946        /// For SSL connections to MySQL and PostgreSQL, the client certificate
10947        /// isn't verified.
10948        ///
10949        /// When this value is used, the legacy `require_ssl` flag must be false or
10950        /// cleared to avoid a conflict between the values of the two flags.
10951        EncryptedOnly,
10952        /// Only allow connections encrypted with SSL/TLS and with valid
10953        /// client certificates.
10954        ///
10955        /// When this value is used, the legacy `require_ssl` flag must be true or
10956        /// cleared to avoid the conflict between values of two flags.
10957        /// PostgreSQL clients or users that connect using IAM database
10958        /// authentication must use either the
10959        /// [Cloud SQL Auth
10960        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
10961        /// [Cloud SQL
10962        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
10963        /// to enforce client identity verification.
10964        ///
10965        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
10966        TrustedClientCertificateRequired,
10967        /// If set, the enum was initialized with an unknown value.
10968        ///
10969        /// Applications can examine the value using [SslMode::value] or
10970        /// [SslMode::name].
10971        UnknownValue(ssl_mode::UnknownValue),
10972    }
10973
10974    #[doc(hidden)]
10975    pub mod ssl_mode {
10976        #[allow(unused_imports)]
10977        use super::*;
10978        #[derive(Clone, Debug, PartialEq)]
10979        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10980    }
10981
10982    impl SslMode {
10983        /// Gets the enum value.
10984        ///
10985        /// Returns `None` if the enum contains an unknown value deserialized from
10986        /// the string representation of enums.
10987        pub fn value(&self) -> std::option::Option<i32> {
10988            match self {
10989                Self::Unspecified => std::option::Option::Some(0),
10990                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
10991                Self::EncryptedOnly => std::option::Option::Some(2),
10992                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
10993                Self::UnknownValue(u) => u.0.value(),
10994            }
10995        }
10996
10997        /// Gets the enum value as a string.
10998        ///
10999        /// Returns `None` if the enum contains an unknown value deserialized from
11000        /// the integer representation of enums.
11001        pub fn name(&self) -> std::option::Option<&str> {
11002            match self {
11003                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
11004                Self::AllowUnencryptedAndEncrypted => {
11005                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
11006                }
11007                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
11008                Self::TrustedClientCertificateRequired => {
11009                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
11010                }
11011                Self::UnknownValue(u) => u.0.name(),
11012            }
11013        }
11014    }
11015
11016    impl std::default::Default for SslMode {
11017        fn default() -> Self {
11018            use std::convert::From;
11019            Self::from(0)
11020        }
11021    }
11022
11023    impl std::fmt::Display for SslMode {
11024        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11025            wkt::internal::display_enum(f, self.name(), self.value())
11026        }
11027    }
11028
11029    impl std::convert::From<i32> for SslMode {
11030        fn from(value: i32) -> Self {
11031            match value {
11032                0 => Self::Unspecified,
11033                1 => Self::AllowUnencryptedAndEncrypted,
11034                2 => Self::EncryptedOnly,
11035                3 => Self::TrustedClientCertificateRequired,
11036                _ => Self::UnknownValue(ssl_mode::UnknownValue(
11037                    wkt::internal::UnknownEnumValue::Integer(value),
11038                )),
11039            }
11040        }
11041    }
11042
11043    impl std::convert::From<&str> for SslMode {
11044        fn from(value: &str) -> Self {
11045            use std::string::ToString;
11046            match value {
11047                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
11048                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
11049                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
11050                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
11051                _ => Self::UnknownValue(ssl_mode::UnknownValue(
11052                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11053                )),
11054            }
11055        }
11056    }
11057
11058    impl serde::ser::Serialize for SslMode {
11059        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11060        where
11061            S: serde::Serializer,
11062        {
11063            match self {
11064                Self::Unspecified => serializer.serialize_i32(0),
11065                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
11066                Self::EncryptedOnly => serializer.serialize_i32(2),
11067                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
11068                Self::UnknownValue(u) => u.0.serialize(serializer),
11069            }
11070        }
11071    }
11072
11073    impl<'de> serde::de::Deserialize<'de> for SslMode {
11074        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11075        where
11076            D: serde::Deserializer<'de>,
11077        {
11078            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
11079                ".google.cloud.sql.v1.IpConfiguration.SslMode",
11080            ))
11081        }
11082    }
11083
11084    /// Various Certificate Authority (CA) modes for certificate signing.
11085    ///
11086    /// # Working with unknown values
11087    ///
11088    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11089    /// additional enum variants at any time. Adding new variants is not considered
11090    /// a breaking change. Applications should write their code in anticipation of:
11091    ///
11092    /// - New values appearing in future releases of the client library, **and**
11093    /// - New values received dynamically, without application changes.
11094    ///
11095    /// Please consult the [Working with enums] section in the user guide for some
11096    /// guidelines.
11097    ///
11098    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11099    #[derive(Clone, Debug, PartialEq)]
11100    #[non_exhaustive]
11101    pub enum CaMode {
11102        /// CA mode is unknown.
11103        Unspecified,
11104        /// Google-managed self-signed internal CA.
11105        GoogleManagedInternalCa,
11106        /// Google-managed regional CA part of root CA hierarchy hosted on Google
11107        /// Cloud's Certificate Authority Service (CAS).
11108        GoogleManagedCasCa,
11109        /// If set, the enum was initialized with an unknown value.
11110        ///
11111        /// Applications can examine the value using [CaMode::value] or
11112        /// [CaMode::name].
11113        UnknownValue(ca_mode::UnknownValue),
11114    }
11115
11116    #[doc(hidden)]
11117    pub mod ca_mode {
11118        #[allow(unused_imports)]
11119        use super::*;
11120        #[derive(Clone, Debug, PartialEq)]
11121        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11122    }
11123
11124    impl CaMode {
11125        /// Gets the enum value.
11126        ///
11127        /// Returns `None` if the enum contains an unknown value deserialized from
11128        /// the string representation of enums.
11129        pub fn value(&self) -> std::option::Option<i32> {
11130            match self {
11131                Self::Unspecified => std::option::Option::Some(0),
11132                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
11133                Self::GoogleManagedCasCa => std::option::Option::Some(2),
11134                Self::UnknownValue(u) => u.0.value(),
11135            }
11136        }
11137
11138        /// Gets the enum value as a string.
11139        ///
11140        /// Returns `None` if the enum contains an unknown value deserialized from
11141        /// the integer representation of enums.
11142        pub fn name(&self) -> std::option::Option<&str> {
11143            match self {
11144                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
11145                Self::GoogleManagedInternalCa => {
11146                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
11147                }
11148                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
11149                Self::UnknownValue(u) => u.0.name(),
11150            }
11151        }
11152    }
11153
11154    impl std::default::Default for CaMode {
11155        fn default() -> Self {
11156            use std::convert::From;
11157            Self::from(0)
11158        }
11159    }
11160
11161    impl std::fmt::Display for CaMode {
11162        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11163            wkt::internal::display_enum(f, self.name(), self.value())
11164        }
11165    }
11166
11167    impl std::convert::From<i32> for CaMode {
11168        fn from(value: i32) -> Self {
11169            match value {
11170                0 => Self::Unspecified,
11171                1 => Self::GoogleManagedInternalCa,
11172                2 => Self::GoogleManagedCasCa,
11173                _ => Self::UnknownValue(ca_mode::UnknownValue(
11174                    wkt::internal::UnknownEnumValue::Integer(value),
11175                )),
11176            }
11177        }
11178    }
11179
11180    impl std::convert::From<&str> for CaMode {
11181        fn from(value: &str) -> Self {
11182            use std::string::ToString;
11183            match value {
11184                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
11185                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
11186                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
11187                _ => Self::UnknownValue(ca_mode::UnknownValue(
11188                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11189                )),
11190            }
11191        }
11192    }
11193
11194    impl serde::ser::Serialize for CaMode {
11195        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11196        where
11197            S: serde::Serializer,
11198        {
11199            match self {
11200                Self::Unspecified => serializer.serialize_i32(0),
11201                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
11202                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
11203                Self::UnknownValue(u) => u.0.serialize(serializer),
11204            }
11205        }
11206    }
11207
11208    impl<'de> serde::de::Deserialize<'de> for CaMode {
11209        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11210        where
11211            D: serde::Deserializer<'de>,
11212        {
11213            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
11214                ".google.cloud.sql.v1.IpConfiguration.CaMode",
11215            ))
11216        }
11217    }
11218}
11219
11220/// PSC settings for a Cloud SQL instance.
11221#[serde_with::serde_as]
11222#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11223#[serde(default, rename_all = "camelCase")]
11224#[non_exhaustive]
11225pub struct PscConfig {
11226    /// Whether PSC connectivity is enabled for this instance.
11227    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11228    pub psc_enabled: std::option::Option<bool>,
11229
11230    /// Optional. The list of consumer projects that are allow-listed for PSC
11231    /// connections to this instance. This instance can be connected to with PSC
11232    /// from any network in these projects.
11233    ///
11234    /// Each consumer project in this list may be represented by a project number
11235    /// (numeric) or by a project id (alphanumeric).
11236    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11237    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
11238
11239    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11240    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11241}
11242
11243impl PscConfig {
11244    pub fn new() -> Self {
11245        std::default::Default::default()
11246    }
11247
11248    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
11249    pub fn set_psc_enabled<T: std::convert::Into<std::option::Option<bool>>>(
11250        mut self,
11251        v: T,
11252    ) -> Self {
11253        self.psc_enabled = v.into();
11254        self
11255    }
11256
11257    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
11258    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
11259    where
11260        T: std::iter::IntoIterator<Item = V>,
11261        V: std::convert::Into<std::string::String>,
11262    {
11263        use std::iter::Iterator;
11264        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
11265        self
11266    }
11267}
11268
11269impl wkt::message::Message for PscConfig {
11270    fn typename() -> &'static str {
11271        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
11272    }
11273}
11274
11275/// Preferred location. This specifies where a Cloud SQL instance is located.
11276/// Note that if the preferred location is not available, the instance will be
11277/// located as close as possible within the region. Only one location may be
11278/// specified.
11279#[serde_with::serde_as]
11280#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11281#[serde(default, rename_all = "camelCase")]
11282#[non_exhaustive]
11283pub struct LocationPreference {
11284    /// The App Engine application to follow, it must be in the same region as the
11285    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
11286    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11287    #[deprecated]
11288    pub follow_gae_application: std::string::String,
11289
11290    /// The preferred Compute Engine zone (for example: us-central1-a,
11291    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
11292    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11293    pub zone: std::string::String,
11294
11295    /// The preferred Compute Engine zone for the secondary/failover
11296    /// (for example: us-central1-a, us-central1-b, etc.).
11297    /// To disable this field, set it to 'no_secondary_zone'.
11298    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11299    pub secondary_zone: std::string::String,
11300
11301    /// This is always `sql#locationPreference`.
11302    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11303    pub kind: std::string::String,
11304
11305    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11306    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11307}
11308
11309impl LocationPreference {
11310    pub fn new() -> Self {
11311        std::default::Default::default()
11312    }
11313
11314    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
11315    #[deprecated]
11316    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
11317        mut self,
11318        v: T,
11319    ) -> Self {
11320        self.follow_gae_application = v.into();
11321        self
11322    }
11323
11324    /// Sets the value of [zone][crate::model::LocationPreference::zone].
11325    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11326        self.zone = v.into();
11327        self
11328    }
11329
11330    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
11331    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11332        self.secondary_zone = v.into();
11333        self
11334    }
11335
11336    /// Sets the value of [kind][crate::model::LocationPreference::kind].
11337    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11338        self.kind = v.into();
11339        self
11340    }
11341}
11342
11343impl wkt::message::Message for LocationPreference {
11344    fn typename() -> &'static str {
11345        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
11346    }
11347}
11348
11349/// Maintenance window. This specifies when a Cloud SQL instance is
11350/// restarted for system maintenance purposes.
11351#[serde_with::serde_as]
11352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11353#[serde(default, rename_all = "camelCase")]
11354#[non_exhaustive]
11355pub struct MaintenanceWindow {
11356    /// Hour of day - 0 to 23. Specify in the UTC time zone.
11357    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11358    pub hour: std::option::Option<wkt::Int32Value>,
11359
11360    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
11361    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
11362    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
11363    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11364    pub day: std::option::Option<wkt::Int32Value>,
11365
11366    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
11367    /// For more information, see [About maintenance on Cloud SQL
11368    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
11369    pub update_track: crate::model::SqlUpdateTrack,
11370
11371    /// This is always `sql#maintenanceWindow`.
11372    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11373    pub kind: std::string::String,
11374
11375    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11376    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11377}
11378
11379impl MaintenanceWindow {
11380    pub fn new() -> Self {
11381        std::default::Default::default()
11382    }
11383
11384    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
11385    pub fn set_hour<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
11386        mut self,
11387        v: T,
11388    ) -> Self {
11389        self.hour = v.into();
11390        self
11391    }
11392
11393    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
11394    pub fn set_day<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
11395        mut self,
11396        v: T,
11397    ) -> Self {
11398        self.day = v.into();
11399        self
11400    }
11401
11402    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
11403    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
11404        mut self,
11405        v: T,
11406    ) -> Self {
11407        self.update_track = v.into();
11408        self
11409    }
11410
11411    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
11412    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11413        self.kind = v.into();
11414        self
11415    }
11416}
11417
11418impl wkt::message::Message for MaintenanceWindow {
11419    fn typename() -> &'static str {
11420        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
11421    }
11422}
11423
11424/// Deny maintenance Periods. This specifies a date range during when all CSA
11425/// rollout will be denied.
11426#[serde_with::serde_as]
11427#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11428#[serde(default, rename_all = "camelCase")]
11429#[non_exhaustive]
11430pub struct DenyMaintenancePeriod {
11431    /// "deny maintenance period" start date. If the year of the start date is
11432    /// empty, the year of the end date also must be empty. In this case, it means
11433    /// the deny maintenance period recurs every year. The date is in format
11434    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
11435    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11436    pub start_date: std::string::String,
11437
11438    /// "deny maintenance period" end date. If the year of the end date is empty,
11439    /// the year of the start date also must be empty. In this case, it means the
11440    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
11441    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
11442    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11443    pub end_date: std::string::String,
11444
11445    /// Time in UTC when the "deny maintenance period" starts on start_date and
11446    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
11447    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11448    pub time: std::string::String,
11449
11450    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11451    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11452}
11453
11454impl DenyMaintenancePeriod {
11455    pub fn new() -> Self {
11456        std::default::Default::default()
11457    }
11458
11459    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
11460    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11461        self.start_date = v.into();
11462        self
11463    }
11464
11465    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
11466    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11467        self.end_date = v.into();
11468        self
11469    }
11470
11471    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
11472    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11473        self.time = v.into();
11474        self
11475    }
11476}
11477
11478impl wkt::message::Message for DenyMaintenancePeriod {
11479    fn typename() -> &'static str {
11480        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
11481    }
11482}
11483
11484/// Insights configuration. This specifies when Cloud SQL Insights feature is
11485/// enabled and optional configuration.
11486#[serde_with::serde_as]
11487#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11488#[serde(default, rename_all = "camelCase")]
11489#[non_exhaustive]
11490pub struct InsightsConfig {
11491    /// Whether Query Insights feature is enabled.
11492    #[serde(skip_serializing_if = "wkt::internal::is_default")]
11493    pub query_insights_enabled: bool,
11494
11495    /// Whether Query Insights will record client address when enabled.
11496    #[serde(skip_serializing_if = "wkt::internal::is_default")]
11497    pub record_client_address: bool,
11498
11499    /// Whether Query Insights will record application tags from query when
11500    /// enabled.
11501    #[serde(skip_serializing_if = "wkt::internal::is_default")]
11502    pub record_application_tags: bool,
11503
11504    /// Maximum query length stored in bytes. Default value: 1024 bytes.
11505    /// Range: 256-4500 bytes. Query length more than this field value will be
11506    /// truncated to this value. When unset, query length will be the default
11507    /// value. Changing query length will restart the database.
11508    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11509    pub query_string_length: std::option::Option<wkt::Int32Value>,
11510
11511    /// Number of query execution plans captured by Insights per minute
11512    /// for all queries combined. Default is 5.
11513    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11514    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
11515
11516    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11517    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11518}
11519
11520impl InsightsConfig {
11521    pub fn new() -> Self {
11522        std::default::Default::default()
11523    }
11524
11525    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
11526    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11527        self.query_insights_enabled = v.into();
11528        self
11529    }
11530
11531    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
11532    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11533        self.record_client_address = v.into();
11534        self
11535    }
11536
11537    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
11538    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11539        self.record_application_tags = v.into();
11540        self
11541    }
11542
11543    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
11544    pub fn set_query_string_length<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
11545        mut self,
11546        v: T,
11547    ) -> Self {
11548        self.query_string_length = v.into();
11549        self
11550    }
11551
11552    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
11553    pub fn set_query_plans_per_minute<
11554        T: std::convert::Into<std::option::Option<wkt::Int32Value>>,
11555    >(
11556        mut self,
11557        v: T,
11558    ) -> Self {
11559        self.query_plans_per_minute = v.into();
11560        self
11561    }
11562}
11563
11564impl wkt::message::Message for InsightsConfig {
11565    fn typename() -> &'static str {
11566        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
11567    }
11568}
11569
11570/// Read-replica configuration specific to MySQL databases.
11571#[serde_with::serde_as]
11572#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11573#[serde(default, rename_all = "camelCase")]
11574#[non_exhaustive]
11575pub struct MySqlReplicaConfiguration {
11576    /// Path to a SQL dump file in Google Cloud Storage from which the replica
11577    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
11578    /// Compressed gzip files (.gz) are also supported.
11579    /// Dumps have the binlog co-ordinates from which replication
11580    /// begins. This can be accomplished by setting --master-data to 1 when using
11581    /// mysqldump.
11582    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11583    pub dump_file_path: std::string::String,
11584
11585    /// The username for the replication connection.
11586    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11587    pub username: std::string::String,
11588
11589    /// The password for the replication connection.
11590    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11591    pub password: std::string::String,
11592
11593    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
11594    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11595    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
11596
11597    /// Interval in milliseconds between replication heartbeats.
11598    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11599    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
11600    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
11601
11602    /// PEM representation of the trusted CA's x509 certificate.
11603    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11604    pub ca_certificate: std::string::String,
11605
11606    /// PEM representation of the replica's x509 certificate.
11607    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11608    pub client_certificate: std::string::String,
11609
11610    /// PEM representation of the replica's private key. The corresponsing public
11611    /// key is encoded in the client's certificate.
11612    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11613    pub client_key: std::string::String,
11614
11615    /// A list of permissible ciphers to use for SSL encryption.
11616    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11617    pub ssl_cipher: std::string::String,
11618
11619    /// Whether or not to check the primary instance's Common Name value in the
11620    /// certificate that it sends during the SSL handshake.
11621    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11622    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
11623
11624    /// This is always `sql#mysqlReplicaConfiguration`.
11625    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11626    pub kind: std::string::String,
11627
11628    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11629    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11630}
11631
11632impl MySqlReplicaConfiguration {
11633    pub fn new() -> Self {
11634        std::default::Default::default()
11635    }
11636
11637    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
11638    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639        self.dump_file_path = v.into();
11640        self
11641    }
11642
11643    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
11644    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11645        self.username = v.into();
11646        self
11647    }
11648
11649    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
11650    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11651        self.password = v.into();
11652        self
11653    }
11654
11655    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
11656    pub fn set_connect_retry_interval<
11657        T: std::convert::Into<std::option::Option<wkt::Int32Value>>,
11658    >(
11659        mut self,
11660        v: T,
11661    ) -> Self {
11662        self.connect_retry_interval = v.into();
11663        self
11664    }
11665
11666    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
11667    pub fn set_master_heartbeat_period<
11668        T: std::convert::Into<std::option::Option<wkt::Int64Value>>,
11669    >(
11670        mut self,
11671        v: T,
11672    ) -> Self {
11673        self.master_heartbeat_period = v.into();
11674        self
11675    }
11676
11677    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
11678    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11679        self.ca_certificate = v.into();
11680        self
11681    }
11682
11683    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
11684    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
11685        mut self,
11686        v: T,
11687    ) -> Self {
11688        self.client_certificate = v.into();
11689        self
11690    }
11691
11692    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
11693    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11694        self.client_key = v.into();
11695        self
11696    }
11697
11698    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
11699    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11700        self.ssl_cipher = v.into();
11701        self
11702    }
11703
11704    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
11705    pub fn set_verify_server_certificate<
11706        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
11707    >(
11708        mut self,
11709        v: T,
11710    ) -> Self {
11711        self.verify_server_certificate = v.into();
11712        self
11713    }
11714
11715    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
11716    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11717        self.kind = v.into();
11718        self
11719    }
11720}
11721
11722impl wkt::message::Message for MySqlReplicaConfiguration {
11723    fn typename() -> &'static str {
11724        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
11725    }
11726}
11727
11728/// Disk encryption configuration for an instance.
11729#[serde_with::serde_as]
11730#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11731#[serde(default, rename_all = "camelCase")]
11732#[non_exhaustive]
11733pub struct DiskEncryptionConfiguration {
11734    /// Resource name of KMS key for disk encryption
11735    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11736    pub kms_key_name: std::string::String,
11737
11738    /// This is always `sql#diskEncryptionConfiguration`.
11739    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11740    pub kind: std::string::String,
11741
11742    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11743    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11744}
11745
11746impl DiskEncryptionConfiguration {
11747    pub fn new() -> Self {
11748        std::default::Default::default()
11749    }
11750
11751    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
11752    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11753        self.kms_key_name = v.into();
11754        self
11755    }
11756
11757    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
11758    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11759        self.kind = v.into();
11760        self
11761    }
11762}
11763
11764impl wkt::message::Message for DiskEncryptionConfiguration {
11765    fn typename() -> &'static str {
11766        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
11767    }
11768}
11769
11770/// Disk encryption status for an instance.
11771#[serde_with::serde_as]
11772#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11773#[serde(default, rename_all = "camelCase")]
11774#[non_exhaustive]
11775pub struct DiskEncryptionStatus {
11776    /// KMS key version used to encrypt the Cloud SQL instance resource
11777    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11778    pub kms_key_version_name: std::string::String,
11779
11780    /// This is always `sql#diskEncryptionStatus`.
11781    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11782    pub kind: std::string::String,
11783
11784    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11785    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11786}
11787
11788impl DiskEncryptionStatus {
11789    pub fn new() -> Self {
11790        std::default::Default::default()
11791    }
11792
11793    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
11794    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
11795        mut self,
11796        v: T,
11797    ) -> Self {
11798        self.kms_key_version_name = v.into();
11799        self
11800    }
11801
11802    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
11803    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11804        self.kind = v.into();
11805        self
11806    }
11807}
11808
11809impl wkt::message::Message for DiskEncryptionStatus {
11810    fn typename() -> &'static str {
11811        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
11812    }
11813}
11814
11815/// Database instance IP mapping
11816#[serde_with::serde_as]
11817#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11818#[serde(default, rename_all = "camelCase")]
11819#[non_exhaustive]
11820pub struct IpMapping {
11821    /// The type of this IP address. A `PRIMARY` address is a public address that
11822    /// can accept incoming connections. A `PRIVATE` address is a private address
11823    /// that can accept incoming connections. An `OUTGOING` address is the source
11824    /// address of connections originating from the instance, if supported.
11825    #[serde(rename = "type")]
11826    pub r#type: crate::model::SqlIpAddressType,
11827
11828    /// The IP address assigned.
11829    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11830    pub ip_address: std::string::String,
11831
11832    /// The due time for this IP to be retired in
11833    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
11834    /// `2012-11-15T16:19:00.094Z`. This field is only available when
11835    /// the IP is scheduled to be retired.
11836    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11837    pub time_to_retire: std::option::Option<wkt::Timestamp>,
11838
11839    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11840    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11841}
11842
11843impl IpMapping {
11844    pub fn new() -> Self {
11845        std::default::Default::default()
11846    }
11847
11848    /// Sets the value of [r#type][crate::model::IpMapping::type].
11849    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
11850        self.r#type = v.into();
11851        self
11852    }
11853
11854    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
11855    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11856        self.ip_address = v.into();
11857        self
11858    }
11859
11860    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
11861    pub fn set_time_to_retire<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11862        mut self,
11863        v: T,
11864    ) -> Self {
11865        self.time_to_retire = v.into();
11866        self
11867    }
11868}
11869
11870impl wkt::message::Message for IpMapping {
11871    fn typename() -> &'static str {
11872        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
11873    }
11874}
11875
11876/// An Operation resource.&nbsp;For successful operations that return an
11877/// Operation resource, only the fields relevant to the operation are populated
11878/// in the resource.
11879#[serde_with::serde_as]
11880#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11881#[serde(default, rename_all = "camelCase")]
11882#[non_exhaustive]
11883pub struct Operation {
11884    /// This is always `sql#operation`.
11885    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11886    pub kind: std::string::String,
11887
11888    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11889    pub target_link: std::string::String,
11890
11891    /// The status of an operation.
11892    pub status: crate::model::operation::SqlOperationStatus,
11893
11894    /// The email address of the user who initiated this operation.
11895    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11896    pub user: std::string::String,
11897
11898    /// The time this operation was enqueued in UTC timezone in [RFC
11899    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
11900    /// `2012-11-15T16:19:00.094Z`.
11901    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11902    pub insert_time: std::option::Option<wkt::Timestamp>,
11903
11904    /// The time this operation actually started in UTC timezone in [RFC
11905    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
11906    /// `2012-11-15T16:19:00.094Z`.
11907    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11908    pub start_time: std::option::Option<wkt::Timestamp>,
11909
11910    /// The time this operation finished in UTC timezone in [RFC
11911    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
11912    /// `2012-11-15T16:19:00.094Z`.
11913    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11914    pub end_time: std::option::Option<wkt::Timestamp>,
11915
11916    /// If errors occurred during processing of this operation, this field will be
11917    /// populated.
11918    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11919    pub error: std::option::Option<crate::model::OperationErrors>,
11920
11921    /// An Admin API warning message.
11922    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11923    pub api_warning: std::option::Option<crate::model::ApiWarning>,
11924
11925    /// The type of the operation. Valid values are:
11926    ///
11927    /// * `CREATE`
11928    /// * `DELETE`
11929    /// * `UPDATE`
11930    /// * `RESTART`
11931    /// * `IMPORT`
11932    /// * `EXPORT`
11933    /// * `BACKUP_VOLUME`
11934    /// * `RESTORE_VOLUME`
11935    /// * `CREATE_USER`
11936    /// * `DELETE_USER`
11937    /// * `CREATE_DATABASE`
11938    /// * `DELETE_DATABASE`
11939    pub operation_type: crate::model::operation::SqlOperationType,
11940
11941    /// The context for import operation, if applicable.
11942    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11943    pub import_context: std::option::Option<crate::model::ImportContext>,
11944
11945    /// The context for export operation, if applicable.
11946    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11947    pub export_context: std::option::Option<crate::model::ExportContext>,
11948
11949    /// The context for backup operation, if applicable.
11950    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11951    pub backup_context: std::option::Option<crate::model::BackupContext>,
11952
11953    /// An identifier that uniquely identifies the operation. You can use this
11954    /// identifier to retrieve the Operations resource that has information about
11955    /// the operation.
11956    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11957    pub name: std::string::String,
11958
11959    /// Name of the database instance related to this operation.
11960    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11961    pub target_id: std::string::String,
11962
11963    /// The URI of this resource.
11964    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11965    pub self_link: std::string::String,
11966
11967    /// The project ID of the target instance related to this operation.
11968    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11969    pub target_project: std::string::String,
11970
11971    /// The context for acquire SSRS lease operation, if applicable.
11972    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11973    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
11974
11975    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11976    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11977}
11978
11979impl Operation {
11980    pub fn new() -> Self {
11981        std::default::Default::default()
11982    }
11983
11984    /// Sets the value of [kind][crate::model::Operation::kind].
11985    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11986        self.kind = v.into();
11987        self
11988    }
11989
11990    /// Sets the value of [target_link][crate::model::Operation::target_link].
11991    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11992        self.target_link = v.into();
11993        self
11994    }
11995
11996    /// Sets the value of [status][crate::model::Operation::status].
11997    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
11998        mut self,
11999        v: T,
12000    ) -> Self {
12001        self.status = v.into();
12002        self
12003    }
12004
12005    /// Sets the value of [user][crate::model::Operation::user].
12006    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12007        self.user = v.into();
12008        self
12009    }
12010
12011    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
12012    pub fn set_insert_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12013        mut self,
12014        v: T,
12015    ) -> Self {
12016        self.insert_time = v.into();
12017        self
12018    }
12019
12020    /// Sets the value of [start_time][crate::model::Operation::start_time].
12021    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12022        mut self,
12023        v: T,
12024    ) -> Self {
12025        self.start_time = v.into();
12026        self
12027    }
12028
12029    /// Sets the value of [end_time][crate::model::Operation::end_time].
12030    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12031        mut self,
12032        v: T,
12033    ) -> Self {
12034        self.end_time = v.into();
12035        self
12036    }
12037
12038    /// Sets the value of [error][crate::model::Operation::error].
12039    pub fn set_error<T: std::convert::Into<std::option::Option<crate::model::OperationErrors>>>(
12040        mut self,
12041        v: T,
12042    ) -> Self {
12043        self.error = v.into();
12044        self
12045    }
12046
12047    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
12048    pub fn set_api_warning<T: std::convert::Into<std::option::Option<crate::model::ApiWarning>>>(
12049        mut self,
12050        v: T,
12051    ) -> Self {
12052        self.api_warning = v.into();
12053        self
12054    }
12055
12056    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
12057    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
12058        mut self,
12059        v: T,
12060    ) -> Self {
12061        self.operation_type = v.into();
12062        self
12063    }
12064
12065    /// Sets the value of [import_context][crate::model::Operation::import_context].
12066    pub fn set_import_context<
12067        T: std::convert::Into<std::option::Option<crate::model::ImportContext>>,
12068    >(
12069        mut self,
12070        v: T,
12071    ) -> Self {
12072        self.import_context = v.into();
12073        self
12074    }
12075
12076    /// Sets the value of [export_context][crate::model::Operation::export_context].
12077    pub fn set_export_context<
12078        T: std::convert::Into<std::option::Option<crate::model::ExportContext>>,
12079    >(
12080        mut self,
12081        v: T,
12082    ) -> Self {
12083        self.export_context = v.into();
12084        self
12085    }
12086
12087    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
12088    pub fn set_backup_context<
12089        T: std::convert::Into<std::option::Option<crate::model::BackupContext>>,
12090    >(
12091        mut self,
12092        v: T,
12093    ) -> Self {
12094        self.backup_context = v.into();
12095        self
12096    }
12097
12098    /// Sets the value of [name][crate::model::Operation::name].
12099    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12100        self.name = v.into();
12101        self
12102    }
12103
12104    /// Sets the value of [target_id][crate::model::Operation::target_id].
12105    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12106        self.target_id = v.into();
12107        self
12108    }
12109
12110    /// Sets the value of [self_link][crate::model::Operation::self_link].
12111    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12112        self.self_link = v.into();
12113        self
12114    }
12115
12116    /// Sets the value of [target_project][crate::model::Operation::target_project].
12117    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12118        self.target_project = v.into();
12119        self
12120    }
12121
12122    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
12123    pub fn set_acquire_ssrs_lease_context<
12124        T: std::convert::Into<std::option::Option<crate::model::AcquireSsrsLeaseContext>>,
12125    >(
12126        mut self,
12127        v: T,
12128    ) -> Self {
12129        self.acquire_ssrs_lease_context = v.into();
12130        self
12131    }
12132}
12133
12134impl wkt::message::Message for Operation {
12135    fn typename() -> &'static str {
12136        "type.googleapis.com/google.cloud.sql.v1.Operation"
12137    }
12138}
12139
12140/// Defines additional types related to [Operation].
12141pub mod operation {
12142    #[allow(unused_imports)]
12143    use super::*;
12144
12145    /// The type of Cloud SQL operation.
12146    ///
12147    /// # Working with unknown values
12148    ///
12149    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12150    /// additional enum variants at any time. Adding new variants is not considered
12151    /// a breaking change. Applications should write their code in anticipation of:
12152    ///
12153    /// - New values appearing in future releases of the client library, **and**
12154    /// - New values received dynamically, without application changes.
12155    ///
12156    /// Please consult the [Working with enums] section in the user guide for some
12157    /// guidelines.
12158    ///
12159    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12160    #[derive(Clone, Debug, PartialEq)]
12161    #[non_exhaustive]
12162    pub enum SqlOperationType {
12163        /// Unknown operation type.
12164        Unspecified,
12165        /// Imports data into a Cloud SQL instance.
12166        Import,
12167        /// Exports data from a Cloud SQL instance to a Cloud Storage
12168        /// bucket.
12169        Export,
12170        /// Creates a new Cloud SQL instance.
12171        Create,
12172        /// Updates the settings of a Cloud SQL instance.
12173        Update,
12174        /// Deletes a Cloud SQL instance.
12175        Delete,
12176        /// Restarts the Cloud SQL instance.
12177        Restart,
12178        #[deprecated]
12179        Backup,
12180        #[deprecated]
12181        Snapshot,
12182        /// Performs instance backup.
12183        BackupVolume,
12184        /// Deletes an instance backup.
12185        DeleteVolume,
12186        /// Restores an instance backup.
12187        RestoreVolume,
12188        /// Injects a privileged user in mysql for MOB instances.
12189        InjectUser,
12190        /// Clones a Cloud SQL instance.
12191        Clone,
12192        /// Stops replication on a Cloud SQL read replica instance.
12193        StopReplica,
12194        /// Starts replication on a Cloud SQL read replica instance.
12195        StartReplica,
12196        /// Promotes a Cloud SQL replica instance.
12197        PromoteReplica,
12198        /// Creates a Cloud SQL replica instance.
12199        CreateReplica,
12200        /// Creates a new user in a Cloud SQL instance.
12201        CreateUser,
12202        /// Deletes a user from a Cloud SQL instance.
12203        DeleteUser,
12204        /// Updates an existing user in a Cloud SQL instance.
12205        UpdateUser,
12206        /// Creates a database in the Cloud SQL instance.
12207        CreateDatabase,
12208        /// Deletes a database in the Cloud SQL instance.
12209        DeleteDatabase,
12210        /// Updates a database in the Cloud SQL instance.
12211        UpdateDatabase,
12212        /// Performs failover of an HA-enabled Cloud SQL
12213        /// failover replica.
12214        Failover,
12215        /// Deletes the backup taken by a backup run.
12216        DeleteBackup,
12217        RecreateReplica,
12218        /// Truncates a general or slow log table in MySQL.
12219        TruncateLog,
12220        /// Demotes the stand-alone instance to be a Cloud SQL
12221        /// read replica for an external database server.
12222        DemoteMaster,
12223        /// Indicates that the instance is currently in maintenance. Maintenance
12224        /// typically causes the instance to be unavailable for 1-3 minutes.
12225        Maintenance,
12226        /// This field is deprecated, and will be removed in future version of API.
12227        #[deprecated]
12228        EnablePrivateIp,
12229        #[deprecated]
12230        DeferMaintenance,
12231        /// Creates clone instance.
12232        #[deprecated]
12233        CreateClone,
12234        /// Reschedule maintenance to another time.
12235        RescheduleMaintenance,
12236        /// Starts external sync of a Cloud SQL EM replica to an external primary
12237        /// instance.
12238        StartExternalSync,
12239        /// Recovers logs from an instance's old data disk.
12240        LogCleanup,
12241        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
12242        /// recovery.
12243        AutoRestart,
12244        /// Re-encrypts CMEK instances with latest key version.
12245        Reencrypt,
12246        /// Switches the roles of the primary and replica pair. The target instance
12247        /// should be the replica.
12248        Switchover,
12249        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
12250        AcquireSsrsLease,
12251        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
12252        ReleaseSsrsLease,
12253        /// Reconfigures old primary after a promote replica operation. Effect of a
12254        /// promote operation to the old primary is executed in this operation,
12255        /// asynchronously from the promote replica operation executed to the
12256        /// replica.
12257        ReconfigureOldPrimary,
12258        /// Indicates that the instance, its read replicas, and its cascading
12259        /// replicas are in maintenance. Maintenance typically gets initiated on
12260        /// groups of replicas first, followed by the primary instance. For each
12261        /// instance, maintenance typically causes the instance to be unavailable for
12262        /// 1-3 minutes.
12263        ClusterMaintenance,
12264        /// Indicates that the instance (and any of its replicas) are currently in
12265        /// maintenance. This is initiated as a self-service request by using SSM.
12266        /// Maintenance typically causes the instance to be unavailable for 1-3
12267        /// minutes.
12268        SelfServiceMaintenance,
12269        /// Switches a primary instance to a replica. This operation runs as part of
12270        /// a switchover operation to the original primary instance.
12271        SwitchoverToReplica,
12272        /// Updates the major version of a Cloud SQL instance.
12273        MajorVersionUpgrade,
12274        /// If set, the enum was initialized with an unknown value.
12275        ///
12276        /// Applications can examine the value using [SqlOperationType::value] or
12277        /// [SqlOperationType::name].
12278        UnknownValue(sql_operation_type::UnknownValue),
12279    }
12280
12281    #[doc(hidden)]
12282    pub mod sql_operation_type {
12283        #[allow(unused_imports)]
12284        use super::*;
12285        #[derive(Clone, Debug, PartialEq)]
12286        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12287    }
12288
12289    impl SqlOperationType {
12290        /// Gets the enum value.
12291        ///
12292        /// Returns `None` if the enum contains an unknown value deserialized from
12293        /// the string representation of enums.
12294        pub fn value(&self) -> std::option::Option<i32> {
12295            match self {
12296                Self::Unspecified => std::option::Option::Some(0),
12297                Self::Import => std::option::Option::Some(1),
12298                Self::Export => std::option::Option::Some(2),
12299                Self::Create => std::option::Option::Some(3),
12300                Self::Update => std::option::Option::Some(4),
12301                Self::Delete => std::option::Option::Some(5),
12302                Self::Restart => std::option::Option::Some(6),
12303                Self::Backup => std::option::Option::Some(7),
12304                Self::Snapshot => std::option::Option::Some(8),
12305                Self::BackupVolume => std::option::Option::Some(9),
12306                Self::DeleteVolume => std::option::Option::Some(10),
12307                Self::RestoreVolume => std::option::Option::Some(11),
12308                Self::InjectUser => std::option::Option::Some(12),
12309                Self::Clone => std::option::Option::Some(14),
12310                Self::StopReplica => std::option::Option::Some(15),
12311                Self::StartReplica => std::option::Option::Some(16),
12312                Self::PromoteReplica => std::option::Option::Some(17),
12313                Self::CreateReplica => std::option::Option::Some(18),
12314                Self::CreateUser => std::option::Option::Some(19),
12315                Self::DeleteUser => std::option::Option::Some(20),
12316                Self::UpdateUser => std::option::Option::Some(21),
12317                Self::CreateDatabase => std::option::Option::Some(22),
12318                Self::DeleteDatabase => std::option::Option::Some(23),
12319                Self::UpdateDatabase => std::option::Option::Some(24),
12320                Self::Failover => std::option::Option::Some(25),
12321                Self::DeleteBackup => std::option::Option::Some(26),
12322                Self::RecreateReplica => std::option::Option::Some(27),
12323                Self::TruncateLog => std::option::Option::Some(28),
12324                Self::DemoteMaster => std::option::Option::Some(29),
12325                Self::Maintenance => std::option::Option::Some(30),
12326                Self::EnablePrivateIp => std::option::Option::Some(31),
12327                Self::DeferMaintenance => std::option::Option::Some(32),
12328                Self::CreateClone => std::option::Option::Some(33),
12329                Self::RescheduleMaintenance => std::option::Option::Some(34),
12330                Self::StartExternalSync => std::option::Option::Some(35),
12331                Self::LogCleanup => std::option::Option::Some(36),
12332                Self::AutoRestart => std::option::Option::Some(37),
12333                Self::Reencrypt => std::option::Option::Some(38),
12334                Self::Switchover => std::option::Option::Some(39),
12335                Self::AcquireSsrsLease => std::option::Option::Some(42),
12336                Self::ReleaseSsrsLease => std::option::Option::Some(43),
12337                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
12338                Self::ClusterMaintenance => std::option::Option::Some(45),
12339                Self::SelfServiceMaintenance => std::option::Option::Some(46),
12340                Self::SwitchoverToReplica => std::option::Option::Some(47),
12341                Self::MajorVersionUpgrade => std::option::Option::Some(48),
12342                Self::UnknownValue(u) => u.0.value(),
12343            }
12344        }
12345
12346        /// Gets the enum value as a string.
12347        ///
12348        /// Returns `None` if the enum contains an unknown value deserialized from
12349        /// the integer representation of enums.
12350        pub fn name(&self) -> std::option::Option<&str> {
12351            match self {
12352                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
12353                Self::Import => std::option::Option::Some("IMPORT"),
12354                Self::Export => std::option::Option::Some("EXPORT"),
12355                Self::Create => std::option::Option::Some("CREATE"),
12356                Self::Update => std::option::Option::Some("UPDATE"),
12357                Self::Delete => std::option::Option::Some("DELETE"),
12358                Self::Restart => std::option::Option::Some("RESTART"),
12359                Self::Backup => std::option::Option::Some("BACKUP"),
12360                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
12361                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
12362                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
12363                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
12364                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
12365                Self::Clone => std::option::Option::Some("CLONE"),
12366                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
12367                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
12368                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
12369                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
12370                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
12371                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
12372                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
12373                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
12374                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
12375                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
12376                Self::Failover => std::option::Option::Some("FAILOVER"),
12377                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
12378                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
12379                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
12380                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
12381                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12382                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
12383                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
12384                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
12385                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
12386                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
12387                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
12388                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
12389                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
12390                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
12391                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
12392                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
12393                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
12394                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
12395                Self::SelfServiceMaintenance => {
12396                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
12397                }
12398                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
12399                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
12400                Self::UnknownValue(u) => u.0.name(),
12401            }
12402        }
12403    }
12404
12405    impl std::default::Default for SqlOperationType {
12406        fn default() -> Self {
12407            use std::convert::From;
12408            Self::from(0)
12409        }
12410    }
12411
12412    impl std::fmt::Display for SqlOperationType {
12413        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12414            wkt::internal::display_enum(f, self.name(), self.value())
12415        }
12416    }
12417
12418    impl std::convert::From<i32> for SqlOperationType {
12419        fn from(value: i32) -> Self {
12420            match value {
12421                0 => Self::Unspecified,
12422                1 => Self::Import,
12423                2 => Self::Export,
12424                3 => Self::Create,
12425                4 => Self::Update,
12426                5 => Self::Delete,
12427                6 => Self::Restart,
12428                7 => Self::Backup,
12429                8 => Self::Snapshot,
12430                9 => Self::BackupVolume,
12431                10 => Self::DeleteVolume,
12432                11 => Self::RestoreVolume,
12433                12 => Self::InjectUser,
12434                14 => Self::Clone,
12435                15 => Self::StopReplica,
12436                16 => Self::StartReplica,
12437                17 => Self::PromoteReplica,
12438                18 => Self::CreateReplica,
12439                19 => Self::CreateUser,
12440                20 => Self::DeleteUser,
12441                21 => Self::UpdateUser,
12442                22 => Self::CreateDatabase,
12443                23 => Self::DeleteDatabase,
12444                24 => Self::UpdateDatabase,
12445                25 => Self::Failover,
12446                26 => Self::DeleteBackup,
12447                27 => Self::RecreateReplica,
12448                28 => Self::TruncateLog,
12449                29 => Self::DemoteMaster,
12450                30 => Self::Maintenance,
12451                31 => Self::EnablePrivateIp,
12452                32 => Self::DeferMaintenance,
12453                33 => Self::CreateClone,
12454                34 => Self::RescheduleMaintenance,
12455                35 => Self::StartExternalSync,
12456                36 => Self::LogCleanup,
12457                37 => Self::AutoRestart,
12458                38 => Self::Reencrypt,
12459                39 => Self::Switchover,
12460                42 => Self::AcquireSsrsLease,
12461                43 => Self::ReleaseSsrsLease,
12462                44 => Self::ReconfigureOldPrimary,
12463                45 => Self::ClusterMaintenance,
12464                46 => Self::SelfServiceMaintenance,
12465                47 => Self::SwitchoverToReplica,
12466                48 => Self::MajorVersionUpgrade,
12467                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12468                    wkt::internal::UnknownEnumValue::Integer(value),
12469                )),
12470            }
12471        }
12472    }
12473
12474    impl std::convert::From<&str> for SqlOperationType {
12475        fn from(value: &str) -> Self {
12476            use std::string::ToString;
12477            match value {
12478                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
12479                "IMPORT" => Self::Import,
12480                "EXPORT" => Self::Export,
12481                "CREATE" => Self::Create,
12482                "UPDATE" => Self::Update,
12483                "DELETE" => Self::Delete,
12484                "RESTART" => Self::Restart,
12485                "BACKUP" => Self::Backup,
12486                "SNAPSHOT" => Self::Snapshot,
12487                "BACKUP_VOLUME" => Self::BackupVolume,
12488                "DELETE_VOLUME" => Self::DeleteVolume,
12489                "RESTORE_VOLUME" => Self::RestoreVolume,
12490                "INJECT_USER" => Self::InjectUser,
12491                "CLONE" => Self::Clone,
12492                "STOP_REPLICA" => Self::StopReplica,
12493                "START_REPLICA" => Self::StartReplica,
12494                "PROMOTE_REPLICA" => Self::PromoteReplica,
12495                "CREATE_REPLICA" => Self::CreateReplica,
12496                "CREATE_USER" => Self::CreateUser,
12497                "DELETE_USER" => Self::DeleteUser,
12498                "UPDATE_USER" => Self::UpdateUser,
12499                "CREATE_DATABASE" => Self::CreateDatabase,
12500                "DELETE_DATABASE" => Self::DeleteDatabase,
12501                "UPDATE_DATABASE" => Self::UpdateDatabase,
12502                "FAILOVER" => Self::Failover,
12503                "DELETE_BACKUP" => Self::DeleteBackup,
12504                "RECREATE_REPLICA" => Self::RecreateReplica,
12505                "TRUNCATE_LOG" => Self::TruncateLog,
12506                "DEMOTE_MASTER" => Self::DemoteMaster,
12507                "MAINTENANCE" => Self::Maintenance,
12508                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
12509                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
12510                "CREATE_CLONE" => Self::CreateClone,
12511                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
12512                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
12513                "LOG_CLEANUP" => Self::LogCleanup,
12514                "AUTO_RESTART" => Self::AutoRestart,
12515                "REENCRYPT" => Self::Reencrypt,
12516                "SWITCHOVER" => Self::Switchover,
12517                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
12518                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
12519                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
12520                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
12521                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
12522                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
12523                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
12524                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12525                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12526                )),
12527            }
12528        }
12529    }
12530
12531    impl serde::ser::Serialize for SqlOperationType {
12532        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12533        where
12534            S: serde::Serializer,
12535        {
12536            match self {
12537                Self::Unspecified => serializer.serialize_i32(0),
12538                Self::Import => serializer.serialize_i32(1),
12539                Self::Export => serializer.serialize_i32(2),
12540                Self::Create => serializer.serialize_i32(3),
12541                Self::Update => serializer.serialize_i32(4),
12542                Self::Delete => serializer.serialize_i32(5),
12543                Self::Restart => serializer.serialize_i32(6),
12544                Self::Backup => serializer.serialize_i32(7),
12545                Self::Snapshot => serializer.serialize_i32(8),
12546                Self::BackupVolume => serializer.serialize_i32(9),
12547                Self::DeleteVolume => serializer.serialize_i32(10),
12548                Self::RestoreVolume => serializer.serialize_i32(11),
12549                Self::InjectUser => serializer.serialize_i32(12),
12550                Self::Clone => serializer.serialize_i32(14),
12551                Self::StopReplica => serializer.serialize_i32(15),
12552                Self::StartReplica => serializer.serialize_i32(16),
12553                Self::PromoteReplica => serializer.serialize_i32(17),
12554                Self::CreateReplica => serializer.serialize_i32(18),
12555                Self::CreateUser => serializer.serialize_i32(19),
12556                Self::DeleteUser => serializer.serialize_i32(20),
12557                Self::UpdateUser => serializer.serialize_i32(21),
12558                Self::CreateDatabase => serializer.serialize_i32(22),
12559                Self::DeleteDatabase => serializer.serialize_i32(23),
12560                Self::UpdateDatabase => serializer.serialize_i32(24),
12561                Self::Failover => serializer.serialize_i32(25),
12562                Self::DeleteBackup => serializer.serialize_i32(26),
12563                Self::RecreateReplica => serializer.serialize_i32(27),
12564                Self::TruncateLog => serializer.serialize_i32(28),
12565                Self::DemoteMaster => serializer.serialize_i32(29),
12566                Self::Maintenance => serializer.serialize_i32(30),
12567                Self::EnablePrivateIp => serializer.serialize_i32(31),
12568                Self::DeferMaintenance => serializer.serialize_i32(32),
12569                Self::CreateClone => serializer.serialize_i32(33),
12570                Self::RescheduleMaintenance => serializer.serialize_i32(34),
12571                Self::StartExternalSync => serializer.serialize_i32(35),
12572                Self::LogCleanup => serializer.serialize_i32(36),
12573                Self::AutoRestart => serializer.serialize_i32(37),
12574                Self::Reencrypt => serializer.serialize_i32(38),
12575                Self::Switchover => serializer.serialize_i32(39),
12576                Self::AcquireSsrsLease => serializer.serialize_i32(42),
12577                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
12578                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
12579                Self::ClusterMaintenance => serializer.serialize_i32(45),
12580                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
12581                Self::SwitchoverToReplica => serializer.serialize_i32(47),
12582                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
12583                Self::UnknownValue(u) => u.0.serialize(serializer),
12584            }
12585        }
12586    }
12587
12588    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
12589        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12590        where
12591            D: serde::Deserializer<'de>,
12592        {
12593            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
12594                ".google.cloud.sql.v1.Operation.SqlOperationType",
12595            ))
12596        }
12597    }
12598
12599    /// The status of an operation.
12600    ///
12601    /// # Working with unknown values
12602    ///
12603    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12604    /// additional enum variants at any time. Adding new variants is not considered
12605    /// a breaking change. Applications should write their code in anticipation of:
12606    ///
12607    /// - New values appearing in future releases of the client library, **and**
12608    /// - New values received dynamically, without application changes.
12609    ///
12610    /// Please consult the [Working with enums] section in the user guide for some
12611    /// guidelines.
12612    ///
12613    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12614    #[derive(Clone, Debug, PartialEq)]
12615    #[non_exhaustive]
12616    pub enum SqlOperationStatus {
12617        /// The state of the operation is unknown.
12618        Unspecified,
12619        /// The operation has been queued, but has not started yet.
12620        Pending,
12621        /// The operation is running.
12622        Running,
12623        /// The operation completed.
12624        Done,
12625        /// If set, the enum was initialized with an unknown value.
12626        ///
12627        /// Applications can examine the value using [SqlOperationStatus::value] or
12628        /// [SqlOperationStatus::name].
12629        UnknownValue(sql_operation_status::UnknownValue),
12630    }
12631
12632    #[doc(hidden)]
12633    pub mod sql_operation_status {
12634        #[allow(unused_imports)]
12635        use super::*;
12636        #[derive(Clone, Debug, PartialEq)]
12637        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12638    }
12639
12640    impl SqlOperationStatus {
12641        /// Gets the enum value.
12642        ///
12643        /// Returns `None` if the enum contains an unknown value deserialized from
12644        /// the string representation of enums.
12645        pub fn value(&self) -> std::option::Option<i32> {
12646            match self {
12647                Self::Unspecified => std::option::Option::Some(0),
12648                Self::Pending => std::option::Option::Some(1),
12649                Self::Running => std::option::Option::Some(2),
12650                Self::Done => std::option::Option::Some(3),
12651                Self::UnknownValue(u) => u.0.value(),
12652            }
12653        }
12654
12655        /// Gets the enum value as a string.
12656        ///
12657        /// Returns `None` if the enum contains an unknown value deserialized from
12658        /// the integer representation of enums.
12659        pub fn name(&self) -> std::option::Option<&str> {
12660            match self {
12661                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
12662                Self::Pending => std::option::Option::Some("PENDING"),
12663                Self::Running => std::option::Option::Some("RUNNING"),
12664                Self::Done => std::option::Option::Some("DONE"),
12665                Self::UnknownValue(u) => u.0.name(),
12666            }
12667        }
12668    }
12669
12670    impl std::default::Default for SqlOperationStatus {
12671        fn default() -> Self {
12672            use std::convert::From;
12673            Self::from(0)
12674        }
12675    }
12676
12677    impl std::fmt::Display for SqlOperationStatus {
12678        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12679            wkt::internal::display_enum(f, self.name(), self.value())
12680        }
12681    }
12682
12683    impl std::convert::From<i32> for SqlOperationStatus {
12684        fn from(value: i32) -> Self {
12685            match value {
12686                0 => Self::Unspecified,
12687                1 => Self::Pending,
12688                2 => Self::Running,
12689                3 => Self::Done,
12690                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
12691                    wkt::internal::UnknownEnumValue::Integer(value),
12692                )),
12693            }
12694        }
12695    }
12696
12697    impl std::convert::From<&str> for SqlOperationStatus {
12698        fn from(value: &str) -> Self {
12699            use std::string::ToString;
12700            match value {
12701                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
12702                "PENDING" => Self::Pending,
12703                "RUNNING" => Self::Running,
12704                "DONE" => Self::Done,
12705                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
12706                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12707                )),
12708            }
12709        }
12710    }
12711
12712    impl serde::ser::Serialize for SqlOperationStatus {
12713        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12714        where
12715            S: serde::Serializer,
12716        {
12717            match self {
12718                Self::Unspecified => serializer.serialize_i32(0),
12719                Self::Pending => serializer.serialize_i32(1),
12720                Self::Running => serializer.serialize_i32(2),
12721                Self::Done => serializer.serialize_i32(3),
12722                Self::UnknownValue(u) => u.0.serialize(serializer),
12723            }
12724        }
12725    }
12726
12727    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
12728        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12729        where
12730            D: serde::Deserializer<'de>,
12731        {
12732            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
12733                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
12734            ))
12735        }
12736    }
12737}
12738
12739/// Database instance operation error.
12740#[serde_with::serde_as]
12741#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12742#[serde(default, rename_all = "camelCase")]
12743#[non_exhaustive]
12744pub struct OperationError {
12745    /// This is always `sql#operationError`.
12746    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12747    pub kind: std::string::String,
12748
12749    /// Identifies the specific error that occurred.
12750    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12751    pub code: std::string::String,
12752
12753    /// Additional information about the error encountered.
12754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12755    pub message: std::string::String,
12756
12757    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12758    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12759}
12760
12761impl OperationError {
12762    pub fn new() -> Self {
12763        std::default::Default::default()
12764    }
12765
12766    /// Sets the value of [kind][crate::model::OperationError::kind].
12767    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12768        self.kind = v.into();
12769        self
12770    }
12771
12772    /// Sets the value of [code][crate::model::OperationError::code].
12773    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12774        self.code = v.into();
12775        self
12776    }
12777
12778    /// Sets the value of [message][crate::model::OperationError::message].
12779    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12780        self.message = v.into();
12781        self
12782    }
12783}
12784
12785impl wkt::message::Message for OperationError {
12786    fn typename() -> &'static str {
12787        "type.googleapis.com/google.cloud.sql.v1.OperationError"
12788    }
12789}
12790
12791/// Database instance operation errors list wrapper.
12792#[serde_with::serde_as]
12793#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12794#[serde(default, rename_all = "camelCase")]
12795#[non_exhaustive]
12796pub struct OperationErrors {
12797    /// This is always `sql#operationErrors`.
12798    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12799    pub kind: std::string::String,
12800
12801    /// The list of errors encountered while processing this operation.
12802    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
12803    pub errors: std::vec::Vec<crate::model::OperationError>,
12804
12805    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12806    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12807}
12808
12809impl OperationErrors {
12810    pub fn new() -> Self {
12811        std::default::Default::default()
12812    }
12813
12814    /// Sets the value of [kind][crate::model::OperationErrors::kind].
12815    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12816        self.kind = v.into();
12817        self
12818    }
12819
12820    /// Sets the value of [errors][crate::model::OperationErrors::errors].
12821    pub fn set_errors<T, V>(mut self, v: T) -> Self
12822    where
12823        T: std::iter::IntoIterator<Item = V>,
12824        V: std::convert::Into<crate::model::OperationError>,
12825    {
12826        use std::iter::Iterator;
12827        self.errors = v.into_iter().map(|i| i.into()).collect();
12828        self
12829    }
12830}
12831
12832impl wkt::message::Message for OperationErrors {
12833    fn typename() -> &'static str {
12834        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
12835    }
12836}
12837
12838/// Database instance local user password validation policy
12839#[serde_with::serde_as]
12840#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12841#[serde(default, rename_all = "camelCase")]
12842#[non_exhaustive]
12843pub struct PasswordValidationPolicy {
12844    /// Minimum number of characters allowed.
12845    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12846    pub min_length: std::option::Option<wkt::Int32Value>,
12847
12848    /// The complexity of the password.
12849    pub complexity: crate::model::password_validation_policy::Complexity,
12850
12851    /// Number of previous passwords that cannot be reused.
12852    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12853    pub reuse_interval: std::option::Option<wkt::Int32Value>,
12854
12855    /// Disallow username as a part of the password.
12856    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12857    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
12858
12859    /// Minimum interval after which the password can be changed. This flag is only
12860    /// supported for PostgreSQL.
12861    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12862    pub password_change_interval: std::option::Option<wkt::Duration>,
12863
12864    /// Whether the password policy is enabled or not.
12865    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12866    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
12867
12868    /// This field is deprecated and will be removed in a future version of the
12869    /// API.
12870    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12871    #[deprecated]
12872    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
12873
12874    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12875    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12876}
12877
12878impl PasswordValidationPolicy {
12879    pub fn new() -> Self {
12880        std::default::Default::default()
12881    }
12882
12883    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
12884    pub fn set_min_length<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
12885        mut self,
12886        v: T,
12887    ) -> Self {
12888        self.min_length = v.into();
12889        self
12890    }
12891
12892    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
12893    pub fn set_complexity<
12894        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
12895    >(
12896        mut self,
12897        v: T,
12898    ) -> Self {
12899        self.complexity = v.into();
12900        self
12901    }
12902
12903    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
12904    pub fn set_reuse_interval<T: std::convert::Into<std::option::Option<wkt::Int32Value>>>(
12905        mut self,
12906        v: T,
12907    ) -> Self {
12908        self.reuse_interval = v.into();
12909        self
12910    }
12911
12912    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
12913    pub fn set_disallow_username_substring<
12914        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
12915    >(
12916        mut self,
12917        v: T,
12918    ) -> Self {
12919        self.disallow_username_substring = v.into();
12920        self
12921    }
12922
12923    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
12924    pub fn set_password_change_interval<
12925        T: std::convert::Into<std::option::Option<wkt::Duration>>,
12926    >(
12927        mut self,
12928        v: T,
12929    ) -> Self {
12930        self.password_change_interval = v.into();
12931        self
12932    }
12933
12934    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
12935    pub fn set_enable_password_policy<
12936        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
12937    >(
12938        mut self,
12939        v: T,
12940    ) -> Self {
12941        self.enable_password_policy = v.into();
12942        self
12943    }
12944
12945    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
12946    #[deprecated]
12947    pub fn set_disallow_compromised_credentials<
12948        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
12949    >(
12950        mut self,
12951        v: T,
12952    ) -> Self {
12953        self.disallow_compromised_credentials = v.into();
12954        self
12955    }
12956}
12957
12958impl wkt::message::Message for PasswordValidationPolicy {
12959    fn typename() -> &'static str {
12960        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
12961    }
12962}
12963
12964/// Defines additional types related to [PasswordValidationPolicy].
12965pub mod password_validation_policy {
12966    #[allow(unused_imports)]
12967    use super::*;
12968
12969    /// The complexity choices of the password.
12970    ///
12971    /// # Working with unknown values
12972    ///
12973    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12974    /// additional enum variants at any time. Adding new variants is not considered
12975    /// a breaking change. Applications should write their code in anticipation of:
12976    ///
12977    /// - New values appearing in future releases of the client library, **and**
12978    /// - New values received dynamically, without application changes.
12979    ///
12980    /// Please consult the [Working with enums] section in the user guide for some
12981    /// guidelines.
12982    ///
12983    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12984    #[derive(Clone, Debug, PartialEq)]
12985    #[non_exhaustive]
12986    pub enum Complexity {
12987        /// Complexity check is not specified.
12988        Unspecified,
12989        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
12990        /// characters.
12991        Default,
12992        /// If set, the enum was initialized with an unknown value.
12993        ///
12994        /// Applications can examine the value using [Complexity::value] or
12995        /// [Complexity::name].
12996        UnknownValue(complexity::UnknownValue),
12997    }
12998
12999    #[doc(hidden)]
13000    pub mod complexity {
13001        #[allow(unused_imports)]
13002        use super::*;
13003        #[derive(Clone, Debug, PartialEq)]
13004        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13005    }
13006
13007    impl Complexity {
13008        /// Gets the enum value.
13009        ///
13010        /// Returns `None` if the enum contains an unknown value deserialized from
13011        /// the string representation of enums.
13012        pub fn value(&self) -> std::option::Option<i32> {
13013            match self {
13014                Self::Unspecified => std::option::Option::Some(0),
13015                Self::Default => std::option::Option::Some(1),
13016                Self::UnknownValue(u) => u.0.value(),
13017            }
13018        }
13019
13020        /// Gets the enum value as a string.
13021        ///
13022        /// Returns `None` if the enum contains an unknown value deserialized from
13023        /// the integer representation of enums.
13024        pub fn name(&self) -> std::option::Option<&str> {
13025            match self {
13026                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
13027                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
13028                Self::UnknownValue(u) => u.0.name(),
13029            }
13030        }
13031    }
13032
13033    impl std::default::Default for Complexity {
13034        fn default() -> Self {
13035            use std::convert::From;
13036            Self::from(0)
13037        }
13038    }
13039
13040    impl std::fmt::Display for Complexity {
13041        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13042            wkt::internal::display_enum(f, self.name(), self.value())
13043        }
13044    }
13045
13046    impl std::convert::From<i32> for Complexity {
13047        fn from(value: i32) -> Self {
13048            match value {
13049                0 => Self::Unspecified,
13050                1 => Self::Default,
13051                _ => Self::UnknownValue(complexity::UnknownValue(
13052                    wkt::internal::UnknownEnumValue::Integer(value),
13053                )),
13054            }
13055        }
13056    }
13057
13058    impl std::convert::From<&str> for Complexity {
13059        fn from(value: &str) -> Self {
13060            use std::string::ToString;
13061            match value {
13062                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
13063                "COMPLEXITY_DEFAULT" => Self::Default,
13064                _ => Self::UnknownValue(complexity::UnknownValue(
13065                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13066                )),
13067            }
13068        }
13069    }
13070
13071    impl serde::ser::Serialize for Complexity {
13072        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13073        where
13074            S: serde::Serializer,
13075        {
13076            match self {
13077                Self::Unspecified => serializer.serialize_i32(0),
13078                Self::Default => serializer.serialize_i32(1),
13079                Self::UnknownValue(u) => u.0.serialize(serializer),
13080            }
13081        }
13082    }
13083
13084    impl<'de> serde::de::Deserialize<'de> for Complexity {
13085        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13086        where
13087            D: serde::Deserializer<'de>,
13088        {
13089            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
13090                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
13091            ))
13092        }
13093    }
13094}
13095
13096/// Data cache configurations.
13097#[serde_with::serde_as]
13098#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13099#[serde(default, rename_all = "camelCase")]
13100#[non_exhaustive]
13101pub struct DataCacheConfig {
13102    /// Whether data cache is enabled for the instance.
13103    #[serde(skip_serializing_if = "wkt::internal::is_default")]
13104    pub data_cache_enabled: bool,
13105
13106    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13107    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13108}
13109
13110impl DataCacheConfig {
13111    pub fn new() -> Self {
13112        std::default::Default::default()
13113    }
13114
13115    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
13116    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13117        self.data_cache_enabled = v.into();
13118        self
13119    }
13120}
13121
13122impl wkt::message::Message for DataCacheConfig {
13123    fn typename() -> &'static str {
13124        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
13125    }
13126}
13127
13128/// Database instance settings.
13129#[serde_with::serde_as]
13130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13131#[serde(default, rename_all = "camelCase")]
13132#[non_exhaustive]
13133pub struct Settings {
13134    /// The version of instance settings. This is a required field for update
13135    /// method to make sure concurrent updates are handled properly. During update,
13136    /// use the most recent settingsVersion value for this instance and do not try
13137    /// to update this value.
13138    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13139    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
13140    pub settings_version: std::option::Option<wkt::Int64Value>,
13141
13142    /// The App Engine app IDs that can access this instance.
13143    /// (Deprecated) Applied to First Generation instances only.
13144    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13145    #[deprecated]
13146    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
13147
13148    /// The tier (or machine type) for this instance, for example
13149    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
13150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13151    pub tier: std::string::String,
13152
13153    /// This is always `sql#settings`.
13154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13155    pub kind: std::string::String,
13156
13157    /// User-provided labels, represented as a dictionary where each label is a
13158    /// single key value pair.
13159    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13160    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
13161
13162    /// Availability type. Potential values:
13163    ///
13164    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
13165    ///   zone affect data accessibility.
13166    /// * `REGIONAL`: The instance can serve data from more than one zone in a
13167    ///   region (it is highly available)./
13168    ///
13169    /// For more information, see [Overview of the High Availability
13170    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
13171    pub availability_type: crate::model::SqlAvailabilityType,
13172
13173    /// The pricing plan for this instance. This can be either `PER_USE` or
13174    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
13175    pub pricing_plan: crate::model::SqlPricingPlan,
13176
13177    /// The type of replication this instance uses. This can be either
13178    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
13179    /// applicable to First Generation instances.
13180    #[deprecated]
13181    pub replication_type: crate::model::SqlReplicationType,
13182
13183    /// The maximum size to which storage capacity can be automatically increased.
13184    /// The default value is 0, which specifies that there is no limit.
13185    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13186    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
13187    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
13188
13189    /// The activation policy specifies when the instance is activated; it is
13190    /// applicable only when the instance state is RUNNABLE. Valid values:
13191    ///
13192    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
13193    ///   connection requests.
13194    /// * `NEVER`: The instance is off; it is not activated, even if a
13195    ///   connection request arrives.
13196    pub activation_policy: crate::model::settings::SqlActivationPolicy,
13197
13198    /// The settings for IP Management. This allows to enable or disable the
13199    /// instance IP and manage which external networks can connect to the instance.
13200    /// The IPv4 address cannot be disabled for Second Generation instances.
13201    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13202    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
13203
13204    /// Configuration to increase storage size automatically. The default value is
13205    /// true.
13206    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13207    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
13208
13209    /// The location preference settings. This allows the instance to be located as
13210    /// near as possible to either an App Engine app or Compute Engine zone for
13211    /// better performance. App Engine co-location was only applicable to First
13212    /// Generation instances.
13213    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13214    pub location_preference: std::option::Option<crate::model::LocationPreference>,
13215
13216    /// The database flags passed to the instance at startup.
13217    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13218    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
13219
13220    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
13221    /// First Generation instances.
13222    pub data_disk_type: crate::model::SqlDataDiskType,
13223
13224    /// The maintenance window for this instance. This specifies when the instance
13225    /// can be restarted for maintenance purposes.
13226    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13227    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
13228
13229    /// The daily backup configuration for the instance.
13230    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13231    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
13232
13233    /// Configuration specific to read replica instances. Indicates whether
13234    /// replication is enabled or not. WARNING: Changing this restarts the
13235    /// instance.
13236    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13237    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
13238
13239    /// Configuration specific to read replica instances. Indicates whether
13240    /// database flags for crash-safe replication are enabled. This property was
13241    /// only applicable to First Generation instances.
13242    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13243    #[deprecated]
13244    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
13245
13246    /// The size of data disk, in GB. The data disk size minimum is 10GB.
13247    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13248    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
13249    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
13250
13251    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
13252    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13253    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
13254
13255    /// The name of server Instance collation.
13256    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13257    pub collation: std::string::String,
13258
13259    /// Deny maintenance periods
13260    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13261    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
13262
13263    /// Insights configuration, for now relevant only for Postgres.
13264    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13265    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
13266
13267    /// The local user password validation policy of the instance.
13268    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13269    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
13270
13271    /// SQL Server specific audit configuration.
13272    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13273    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
13274
13275    /// Optional. The edition of the instance.
13276    pub edition: crate::model::settings::Edition,
13277
13278    /// Specifies if connections must use Cloud SQL connectors.
13279    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
13280    /// can be connected without Cloud SQL
13281    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
13282    /// Connectors).
13283    ///
13284    /// Note that using REQUIRED disables all existing authorized networks. If
13285    /// this field is not specified when creating a new instance, NOT_REQUIRED is
13286    /// used. If this field is not specified when patching or updating an existing
13287    /// instance, it is left unchanged in the instance.
13288    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
13289
13290    /// Configuration to protect against accidental instance deletion.
13291    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13292    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
13293
13294    /// Server timezone, relevant only for Cloud SQL for SQL Server.
13295    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13296    pub time_zone: std::string::String,
13297
13298    /// Specifies advanced machine configuration for the instances relevant only
13299    /// for SQL Server.
13300    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13301    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
13302
13303    /// Configuration for data cache.
13304    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13305    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
13306
13307    /// Optional. When this parameter is set to true, Cloud SQL instances can
13308    /// connect to Vertex AI to pass requests for real-time predictions and
13309    /// insights to the AI. The default value is false. This applies only to Cloud
13310    /// SQL for PostgreSQL instances.
13311    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13312    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
13313
13314    /// Optional. By default, Cloud SQL instances have schema extraction disabled
13315    /// for Dataplex. When this parameter is set to true, schema extraction for
13316    /// Dataplex on Cloud SQL instances is activated.
13317    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13318    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
13319
13320    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13321    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13322}
13323
13324impl Settings {
13325    pub fn new() -> Self {
13326        std::default::Default::default()
13327    }
13328
13329    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
13330    pub fn set_settings_version<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
13331        mut self,
13332        v: T,
13333    ) -> Self {
13334        self.settings_version = v.into();
13335        self
13336    }
13337
13338    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
13339    #[deprecated]
13340    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
13341    where
13342        T: std::iter::IntoIterator<Item = V>,
13343        V: std::convert::Into<std::string::String>,
13344    {
13345        use std::iter::Iterator;
13346        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
13347        self
13348    }
13349
13350    /// Sets the value of [tier][crate::model::Settings::tier].
13351    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13352        self.tier = v.into();
13353        self
13354    }
13355
13356    /// Sets the value of [kind][crate::model::Settings::kind].
13357    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13358        self.kind = v.into();
13359        self
13360    }
13361
13362    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
13363    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
13364    where
13365        T: std::iter::IntoIterator<Item = (K, V)>,
13366        K: std::convert::Into<std::string::String>,
13367        V: std::convert::Into<std::string::String>,
13368    {
13369        use std::iter::Iterator;
13370        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13371        self
13372    }
13373
13374    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
13375    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
13376        mut self,
13377        v: T,
13378    ) -> Self {
13379        self.availability_type = v.into();
13380        self
13381    }
13382
13383    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
13384    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
13385        mut self,
13386        v: T,
13387    ) -> Self {
13388        self.pricing_plan = v.into();
13389        self
13390    }
13391
13392    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
13393    #[deprecated]
13394    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
13395        mut self,
13396        v: T,
13397    ) -> Self {
13398        self.replication_type = v.into();
13399        self
13400    }
13401
13402    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
13403    pub fn set_storage_auto_resize_limit<
13404        T: std::convert::Into<std::option::Option<wkt::Int64Value>>,
13405    >(
13406        mut self,
13407        v: T,
13408    ) -> Self {
13409        self.storage_auto_resize_limit = v.into();
13410        self
13411    }
13412
13413    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
13414    pub fn set_activation_policy<
13415        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
13416    >(
13417        mut self,
13418        v: T,
13419    ) -> Self {
13420        self.activation_policy = v.into();
13421        self
13422    }
13423
13424    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
13425    pub fn set_ip_configuration<
13426        T: std::convert::Into<std::option::Option<crate::model::IpConfiguration>>,
13427    >(
13428        mut self,
13429        v: T,
13430    ) -> Self {
13431        self.ip_configuration = v.into();
13432        self
13433    }
13434
13435    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
13436    pub fn set_storage_auto_resize<T: std::convert::Into<std::option::Option<wkt::BoolValue>>>(
13437        mut self,
13438        v: T,
13439    ) -> Self {
13440        self.storage_auto_resize = v.into();
13441        self
13442    }
13443
13444    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
13445    pub fn set_location_preference<
13446        T: std::convert::Into<std::option::Option<crate::model::LocationPreference>>,
13447    >(
13448        mut self,
13449        v: T,
13450    ) -> Self {
13451        self.location_preference = v.into();
13452        self
13453    }
13454
13455    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
13456    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
13457    where
13458        T: std::iter::IntoIterator<Item = V>,
13459        V: std::convert::Into<crate::model::DatabaseFlags>,
13460    {
13461        use std::iter::Iterator;
13462        self.database_flags = v.into_iter().map(|i| i.into()).collect();
13463        self
13464    }
13465
13466    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
13467    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
13468        mut self,
13469        v: T,
13470    ) -> Self {
13471        self.data_disk_type = v.into();
13472        self
13473    }
13474
13475    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
13476    pub fn set_maintenance_window<
13477        T: std::convert::Into<std::option::Option<crate::model::MaintenanceWindow>>,
13478    >(
13479        mut self,
13480        v: T,
13481    ) -> Self {
13482        self.maintenance_window = v.into();
13483        self
13484    }
13485
13486    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
13487    pub fn set_backup_configuration<
13488        T: std::convert::Into<std::option::Option<crate::model::BackupConfiguration>>,
13489    >(
13490        mut self,
13491        v: T,
13492    ) -> Self {
13493        self.backup_configuration = v.into();
13494        self
13495    }
13496
13497    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
13498    pub fn set_database_replication_enabled<
13499        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
13500    >(
13501        mut self,
13502        v: T,
13503    ) -> Self {
13504        self.database_replication_enabled = v.into();
13505        self
13506    }
13507
13508    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
13509    #[deprecated]
13510    pub fn set_crash_safe_replication_enabled<
13511        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
13512    >(
13513        mut self,
13514        v: T,
13515    ) -> Self {
13516        self.crash_safe_replication_enabled = v.into();
13517        self
13518    }
13519
13520    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
13521    pub fn set_data_disk_size_gb<T: std::convert::Into<std::option::Option<wkt::Int64Value>>>(
13522        mut self,
13523        v: T,
13524    ) -> Self {
13525        self.data_disk_size_gb = v.into();
13526        self
13527    }
13528
13529    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
13530    pub fn set_active_directory_config<
13531        T: std::convert::Into<std::option::Option<crate::model::SqlActiveDirectoryConfig>>,
13532    >(
13533        mut self,
13534        v: T,
13535    ) -> Self {
13536        self.active_directory_config = v.into();
13537        self
13538    }
13539
13540    /// Sets the value of [collation][crate::model::Settings::collation].
13541    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13542        self.collation = v.into();
13543        self
13544    }
13545
13546    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
13547    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
13548    where
13549        T: std::iter::IntoIterator<Item = V>,
13550        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
13551    {
13552        use std::iter::Iterator;
13553        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
13554        self
13555    }
13556
13557    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
13558    pub fn set_insights_config<
13559        T: std::convert::Into<std::option::Option<crate::model::InsightsConfig>>,
13560    >(
13561        mut self,
13562        v: T,
13563    ) -> Self {
13564        self.insights_config = v.into();
13565        self
13566    }
13567
13568    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
13569    pub fn set_password_validation_policy<
13570        T: std::convert::Into<std::option::Option<crate::model::PasswordValidationPolicy>>,
13571    >(
13572        mut self,
13573        v: T,
13574    ) -> Self {
13575        self.password_validation_policy = v.into();
13576        self
13577    }
13578
13579    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
13580    pub fn set_sql_server_audit_config<
13581        T: std::convert::Into<std::option::Option<crate::model::SqlServerAuditConfig>>,
13582    >(
13583        mut self,
13584        v: T,
13585    ) -> Self {
13586        self.sql_server_audit_config = v.into();
13587        self
13588    }
13589
13590    /// Sets the value of [edition][crate::model::Settings::edition].
13591    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
13592        mut self,
13593        v: T,
13594    ) -> Self {
13595        self.edition = v.into();
13596        self
13597    }
13598
13599    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
13600    pub fn set_connector_enforcement<
13601        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
13602    >(
13603        mut self,
13604        v: T,
13605    ) -> Self {
13606        self.connector_enforcement = v.into();
13607        self
13608    }
13609
13610    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
13611    pub fn set_deletion_protection_enabled<
13612        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
13613    >(
13614        mut self,
13615        v: T,
13616    ) -> Self {
13617        self.deletion_protection_enabled = v.into();
13618        self
13619    }
13620
13621    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
13622    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13623        self.time_zone = v.into();
13624        self
13625    }
13626
13627    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
13628    pub fn set_advanced_machine_features<
13629        T: std::convert::Into<std::option::Option<crate::model::AdvancedMachineFeatures>>,
13630    >(
13631        mut self,
13632        v: T,
13633    ) -> Self {
13634        self.advanced_machine_features = v.into();
13635        self
13636    }
13637
13638    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
13639    pub fn set_data_cache_config<
13640        T: std::convert::Into<std::option::Option<crate::model::DataCacheConfig>>,
13641    >(
13642        mut self,
13643        v: T,
13644    ) -> Self {
13645        self.data_cache_config = v.into();
13646        self
13647    }
13648
13649    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
13650    pub fn set_enable_google_ml_integration<
13651        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
13652    >(
13653        mut self,
13654        v: T,
13655    ) -> Self {
13656        self.enable_google_ml_integration = v.into();
13657        self
13658    }
13659
13660    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
13661    pub fn set_enable_dataplex_integration<
13662        T: std::convert::Into<std::option::Option<wkt::BoolValue>>,
13663    >(
13664        mut self,
13665        v: T,
13666    ) -> Self {
13667        self.enable_dataplex_integration = v.into();
13668        self
13669    }
13670}
13671
13672impl wkt::message::Message for Settings {
13673    fn typename() -> &'static str {
13674        "type.googleapis.com/google.cloud.sql.v1.Settings"
13675    }
13676}
13677
13678/// Defines additional types related to [Settings].
13679pub mod settings {
13680    #[allow(unused_imports)]
13681    use super::*;
13682
13683    /// Specifies when the instance is activated.
13684    ///
13685    /// # Working with unknown values
13686    ///
13687    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13688    /// additional enum variants at any time. Adding new variants is not considered
13689    /// a breaking change. Applications should write their code in anticipation of:
13690    ///
13691    /// - New values appearing in future releases of the client library, **and**
13692    /// - New values received dynamically, without application changes.
13693    ///
13694    /// Please consult the [Working with enums] section in the user guide for some
13695    /// guidelines.
13696    ///
13697    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13698    #[derive(Clone, Debug, PartialEq)]
13699    #[non_exhaustive]
13700    pub enum SqlActivationPolicy {
13701        /// Unknown activation plan.
13702        Unspecified,
13703        /// The instance is always up and running.
13704        Always,
13705        /// The instance never starts.
13706        Never,
13707        /// The instance starts upon receiving requests.
13708        #[deprecated]
13709        OnDemand,
13710        /// If set, the enum was initialized with an unknown value.
13711        ///
13712        /// Applications can examine the value using [SqlActivationPolicy::value] or
13713        /// [SqlActivationPolicy::name].
13714        UnknownValue(sql_activation_policy::UnknownValue),
13715    }
13716
13717    #[doc(hidden)]
13718    pub mod sql_activation_policy {
13719        #[allow(unused_imports)]
13720        use super::*;
13721        #[derive(Clone, Debug, PartialEq)]
13722        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13723    }
13724
13725    impl SqlActivationPolicy {
13726        /// Gets the enum value.
13727        ///
13728        /// Returns `None` if the enum contains an unknown value deserialized from
13729        /// the string representation of enums.
13730        pub fn value(&self) -> std::option::Option<i32> {
13731            match self {
13732                Self::Unspecified => std::option::Option::Some(0),
13733                Self::Always => std::option::Option::Some(1),
13734                Self::Never => std::option::Option::Some(2),
13735                Self::OnDemand => std::option::Option::Some(3),
13736                Self::UnknownValue(u) => u.0.value(),
13737            }
13738        }
13739
13740        /// Gets the enum value as a string.
13741        ///
13742        /// Returns `None` if the enum contains an unknown value deserialized from
13743        /// the integer representation of enums.
13744        pub fn name(&self) -> std::option::Option<&str> {
13745            match self {
13746                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
13747                Self::Always => std::option::Option::Some("ALWAYS"),
13748                Self::Never => std::option::Option::Some("NEVER"),
13749                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
13750                Self::UnknownValue(u) => u.0.name(),
13751            }
13752        }
13753    }
13754
13755    impl std::default::Default for SqlActivationPolicy {
13756        fn default() -> Self {
13757            use std::convert::From;
13758            Self::from(0)
13759        }
13760    }
13761
13762    impl std::fmt::Display for SqlActivationPolicy {
13763        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13764            wkt::internal::display_enum(f, self.name(), self.value())
13765        }
13766    }
13767
13768    impl std::convert::From<i32> for SqlActivationPolicy {
13769        fn from(value: i32) -> Self {
13770            match value {
13771                0 => Self::Unspecified,
13772                1 => Self::Always,
13773                2 => Self::Never,
13774                3 => Self::OnDemand,
13775                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
13776                    wkt::internal::UnknownEnumValue::Integer(value),
13777                )),
13778            }
13779        }
13780    }
13781
13782    impl std::convert::From<&str> for SqlActivationPolicy {
13783        fn from(value: &str) -> Self {
13784            use std::string::ToString;
13785            match value {
13786                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
13787                "ALWAYS" => Self::Always,
13788                "NEVER" => Self::Never,
13789                "ON_DEMAND" => Self::OnDemand,
13790                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
13791                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13792                )),
13793            }
13794        }
13795    }
13796
13797    impl serde::ser::Serialize for SqlActivationPolicy {
13798        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13799        where
13800            S: serde::Serializer,
13801        {
13802            match self {
13803                Self::Unspecified => serializer.serialize_i32(0),
13804                Self::Always => serializer.serialize_i32(1),
13805                Self::Never => serializer.serialize_i32(2),
13806                Self::OnDemand => serializer.serialize_i32(3),
13807                Self::UnknownValue(u) => u.0.serialize(serializer),
13808            }
13809        }
13810    }
13811
13812    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
13813        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13814        where
13815            D: serde::Deserializer<'de>,
13816        {
13817            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
13818                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
13819            ))
13820        }
13821    }
13822
13823    /// The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
13824    ///
13825    /// # Working with unknown values
13826    ///
13827    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13828    /// additional enum variants at any time. Adding new variants is not considered
13829    /// a breaking change. Applications should write their code in anticipation of:
13830    ///
13831    /// - New values appearing in future releases of the client library, **and**
13832    /// - New values received dynamically, without application changes.
13833    ///
13834    /// Please consult the [Working with enums] section in the user guide for some
13835    /// guidelines.
13836    ///
13837    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13838    #[derive(Clone, Debug, PartialEq)]
13839    #[non_exhaustive]
13840    pub enum Edition {
13841        /// The instance did not specify the edition.
13842        Unspecified,
13843        /// The instance is an enterprise edition.
13844        Enterprise,
13845        /// The instance is an Enterprise Plus edition.
13846        EnterprisePlus,
13847        /// If set, the enum was initialized with an unknown value.
13848        ///
13849        /// Applications can examine the value using [Edition::value] or
13850        /// [Edition::name].
13851        UnknownValue(edition::UnknownValue),
13852    }
13853
13854    #[doc(hidden)]
13855    pub mod edition {
13856        #[allow(unused_imports)]
13857        use super::*;
13858        #[derive(Clone, Debug, PartialEq)]
13859        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13860    }
13861
13862    impl Edition {
13863        /// Gets the enum value.
13864        ///
13865        /// Returns `None` if the enum contains an unknown value deserialized from
13866        /// the string representation of enums.
13867        pub fn value(&self) -> std::option::Option<i32> {
13868            match self {
13869                Self::Unspecified => std::option::Option::Some(0),
13870                Self::Enterprise => std::option::Option::Some(2),
13871                Self::EnterprisePlus => std::option::Option::Some(3),
13872                Self::UnknownValue(u) => u.0.value(),
13873            }
13874        }
13875
13876        /// Gets the enum value as a string.
13877        ///
13878        /// Returns `None` if the enum contains an unknown value deserialized from
13879        /// the integer representation of enums.
13880        pub fn name(&self) -> std::option::Option<&str> {
13881            match self {
13882                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
13883                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
13884                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
13885                Self::UnknownValue(u) => u.0.name(),
13886            }
13887        }
13888    }
13889
13890    impl std::default::Default for Edition {
13891        fn default() -> Self {
13892            use std::convert::From;
13893            Self::from(0)
13894        }
13895    }
13896
13897    impl std::fmt::Display for Edition {
13898        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13899            wkt::internal::display_enum(f, self.name(), self.value())
13900        }
13901    }
13902
13903    impl std::convert::From<i32> for Edition {
13904        fn from(value: i32) -> Self {
13905            match value {
13906                0 => Self::Unspecified,
13907                2 => Self::Enterprise,
13908                3 => Self::EnterprisePlus,
13909                _ => Self::UnknownValue(edition::UnknownValue(
13910                    wkt::internal::UnknownEnumValue::Integer(value),
13911                )),
13912            }
13913        }
13914    }
13915
13916    impl std::convert::From<&str> for Edition {
13917        fn from(value: &str) -> Self {
13918            use std::string::ToString;
13919            match value {
13920                "EDITION_UNSPECIFIED" => Self::Unspecified,
13921                "ENTERPRISE" => Self::Enterprise,
13922                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
13923                _ => Self::UnknownValue(edition::UnknownValue(
13924                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13925                )),
13926            }
13927        }
13928    }
13929
13930    impl serde::ser::Serialize for Edition {
13931        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13932        where
13933            S: serde::Serializer,
13934        {
13935            match self {
13936                Self::Unspecified => serializer.serialize_i32(0),
13937                Self::Enterprise => serializer.serialize_i32(2),
13938                Self::EnterprisePlus => serializer.serialize_i32(3),
13939                Self::UnknownValue(u) => u.0.serialize(serializer),
13940            }
13941        }
13942    }
13943
13944    impl<'de> serde::de::Deserialize<'de> for Edition {
13945        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13946        where
13947            D: serde::Deserializer<'de>,
13948        {
13949            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
13950                ".google.cloud.sql.v1.Settings.Edition",
13951            ))
13952        }
13953    }
13954
13955    /// The options for enforcing Cloud SQL connectors in the instance.
13956    ///
13957    /// # Working with unknown values
13958    ///
13959    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13960    /// additional enum variants at any time. Adding new variants is not considered
13961    /// a breaking change. Applications should write their code in anticipation of:
13962    ///
13963    /// - New values appearing in future releases of the client library, **and**
13964    /// - New values received dynamically, without application changes.
13965    ///
13966    /// Please consult the [Working with enums] section in the user guide for some
13967    /// guidelines.
13968    ///
13969    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13970    #[derive(Clone, Debug, PartialEq)]
13971    #[non_exhaustive]
13972    pub enum ConnectorEnforcement {
13973        /// The requirement for Cloud SQL connectors is unknown.
13974        Unspecified,
13975        /// Do not require Cloud SQL connectors.
13976        NotRequired,
13977        /// Require all connections to use Cloud SQL connectors, including the
13978        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
13979        /// Note: This disables all existing authorized networks.
13980        Required,
13981        /// If set, the enum was initialized with an unknown value.
13982        ///
13983        /// Applications can examine the value using [ConnectorEnforcement::value] or
13984        /// [ConnectorEnforcement::name].
13985        UnknownValue(connector_enforcement::UnknownValue),
13986    }
13987
13988    #[doc(hidden)]
13989    pub mod connector_enforcement {
13990        #[allow(unused_imports)]
13991        use super::*;
13992        #[derive(Clone, Debug, PartialEq)]
13993        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13994    }
13995
13996    impl ConnectorEnforcement {
13997        /// Gets the enum value.
13998        ///
13999        /// Returns `None` if the enum contains an unknown value deserialized from
14000        /// the string representation of enums.
14001        pub fn value(&self) -> std::option::Option<i32> {
14002            match self {
14003                Self::Unspecified => std::option::Option::Some(0),
14004                Self::NotRequired => std::option::Option::Some(1),
14005                Self::Required => std::option::Option::Some(2),
14006                Self::UnknownValue(u) => u.0.value(),
14007            }
14008        }
14009
14010        /// Gets the enum value as a string.
14011        ///
14012        /// Returns `None` if the enum contains an unknown value deserialized from
14013        /// the integer representation of enums.
14014        pub fn name(&self) -> std::option::Option<&str> {
14015            match self {
14016                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
14017                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
14018                Self::Required => std::option::Option::Some("REQUIRED"),
14019                Self::UnknownValue(u) => u.0.name(),
14020            }
14021        }
14022    }
14023
14024    impl std::default::Default for ConnectorEnforcement {
14025        fn default() -> Self {
14026            use std::convert::From;
14027            Self::from(0)
14028        }
14029    }
14030
14031    impl std::fmt::Display for ConnectorEnforcement {
14032        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14033            wkt::internal::display_enum(f, self.name(), self.value())
14034        }
14035    }
14036
14037    impl std::convert::From<i32> for ConnectorEnforcement {
14038        fn from(value: i32) -> Self {
14039            match value {
14040                0 => Self::Unspecified,
14041                1 => Self::NotRequired,
14042                2 => Self::Required,
14043                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14044                    wkt::internal::UnknownEnumValue::Integer(value),
14045                )),
14046            }
14047        }
14048    }
14049
14050    impl std::convert::From<&str> for ConnectorEnforcement {
14051        fn from(value: &str) -> Self {
14052            use std::string::ToString;
14053            match value {
14054                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
14055                "NOT_REQUIRED" => Self::NotRequired,
14056                "REQUIRED" => Self::Required,
14057                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14058                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14059                )),
14060            }
14061        }
14062    }
14063
14064    impl serde::ser::Serialize for ConnectorEnforcement {
14065        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14066        where
14067            S: serde::Serializer,
14068        {
14069            match self {
14070                Self::Unspecified => serializer.serialize_i32(0),
14071                Self::NotRequired => serializer.serialize_i32(1),
14072                Self::Required => serializer.serialize_i32(2),
14073                Self::UnknownValue(u) => u.0.serialize(serializer),
14074            }
14075        }
14076    }
14077
14078    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
14079        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14080        where
14081            D: serde::Deserializer<'de>,
14082        {
14083            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
14084                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
14085            ))
14086        }
14087    }
14088}
14089
14090/// Specifies options for controlling advanced machine features.
14091#[serde_with::serde_as]
14092#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14093#[serde(default, rename_all = "camelCase")]
14094#[non_exhaustive]
14095pub struct AdvancedMachineFeatures {
14096    /// The number of threads per physical core.
14097    #[serde(skip_serializing_if = "wkt::internal::is_default")]
14098    pub threads_per_core: i32,
14099
14100    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14101    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14102}
14103
14104impl AdvancedMachineFeatures {
14105    pub fn new() -> Self {
14106        std::default::Default::default()
14107    }
14108
14109    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
14110    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14111        self.threads_per_core = v.into();
14112        self
14113    }
14114}
14115
14116impl wkt::message::Message for AdvancedMachineFeatures {
14117    fn typename() -> &'static str {
14118        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
14119    }
14120}
14121
14122/// SslCerts Resource
14123#[serde_with::serde_as]
14124#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14125#[serde(default, rename_all = "camelCase")]
14126#[non_exhaustive]
14127pub struct SslCert {
14128    /// This is always `sql#sslCert`.
14129    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14130    pub kind: std::string::String,
14131
14132    /// Serial number, as extracted from the certificate.
14133    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14134    pub cert_serial_number: std::string::String,
14135
14136    /// PEM representation.
14137    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14138    pub cert: std::string::String,
14139
14140    /// The time when the certificate was created in [RFC
14141    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
14142    /// `2012-11-15T16:19:00.094Z`
14143    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14144    pub create_time: std::option::Option<wkt::Timestamp>,
14145
14146    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
14147    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14148    pub common_name: std::string::String,
14149
14150    /// The time when the certificate expires in [RFC
14151    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
14152    /// `2012-11-15T16:19:00.094Z`.
14153    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14154    pub expiration_time: std::option::Option<wkt::Timestamp>,
14155
14156    /// Sha1 Fingerprint.
14157    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14158    pub sha1_fingerprint: std::string::String,
14159
14160    /// Name of the database instance.
14161    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14162    pub instance: std::string::String,
14163
14164    /// The URI of this resource.
14165    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14166    pub self_link: std::string::String,
14167
14168    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14169    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14170}
14171
14172impl SslCert {
14173    pub fn new() -> Self {
14174        std::default::Default::default()
14175    }
14176
14177    /// Sets the value of [kind][crate::model::SslCert::kind].
14178    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14179        self.kind = v.into();
14180        self
14181    }
14182
14183    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
14184    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
14185        mut self,
14186        v: T,
14187    ) -> Self {
14188        self.cert_serial_number = v.into();
14189        self
14190    }
14191
14192    /// Sets the value of [cert][crate::model::SslCert::cert].
14193    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14194        self.cert = v.into();
14195        self
14196    }
14197
14198    /// Sets the value of [create_time][crate::model::SslCert::create_time].
14199    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14200        mut self,
14201        v: T,
14202    ) -> Self {
14203        self.create_time = v.into();
14204        self
14205    }
14206
14207    /// Sets the value of [common_name][crate::model::SslCert::common_name].
14208    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14209        self.common_name = v.into();
14210        self
14211    }
14212
14213    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
14214    pub fn set_expiration_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14215        mut self,
14216        v: T,
14217    ) -> Self {
14218        self.expiration_time = v.into();
14219        self
14220    }
14221
14222    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
14223    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
14224        mut self,
14225        v: T,
14226    ) -> Self {
14227        self.sha1_fingerprint = v.into();
14228        self
14229    }
14230
14231    /// Sets the value of [instance][crate::model::SslCert::instance].
14232    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14233        self.instance = v.into();
14234        self
14235    }
14236
14237    /// Sets the value of [self_link][crate::model::SslCert::self_link].
14238    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14239        self.self_link = v.into();
14240        self
14241    }
14242}
14243
14244impl wkt::message::Message for SslCert {
14245    fn typename() -> &'static str {
14246        "type.googleapis.com/google.cloud.sql.v1.SslCert"
14247    }
14248}
14249
14250/// SslCertDetail.
14251#[serde_with::serde_as]
14252#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14253#[serde(default, rename_all = "camelCase")]
14254#[non_exhaustive]
14255pub struct SslCertDetail {
14256    /// The public information about the cert.
14257    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14258    pub cert_info: std::option::Option<crate::model::SslCert>,
14259
14260    /// The private key for the client cert, in pem format.  Keep private in order
14261    /// to protect your security.
14262    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14263    pub cert_private_key: std::string::String,
14264
14265    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14266    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14267}
14268
14269impl SslCertDetail {
14270    pub fn new() -> Self {
14271        std::default::Default::default()
14272    }
14273
14274    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
14275    pub fn set_cert_info<T: std::convert::Into<std::option::Option<crate::model::SslCert>>>(
14276        mut self,
14277        v: T,
14278    ) -> Self {
14279        self.cert_info = v.into();
14280        self
14281    }
14282
14283    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
14284    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
14285        mut self,
14286        v: T,
14287    ) -> Self {
14288        self.cert_private_key = v.into();
14289        self
14290    }
14291}
14292
14293impl wkt::message::Message for SslCertDetail {
14294    fn typename() -> &'static str {
14295        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
14296    }
14297}
14298
14299/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
14300#[serde_with::serde_as]
14301#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14302#[serde(default, rename_all = "camelCase")]
14303#[non_exhaustive]
14304pub struct SqlActiveDirectoryConfig {
14305    /// This is always sql#activeDirectoryConfig.
14306    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14307    pub kind: std::string::String,
14308
14309    /// The name of the domain (e.g., mydomain.com).
14310    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14311    pub domain: std::string::String,
14312
14313    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14314    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14315}
14316
14317impl SqlActiveDirectoryConfig {
14318    pub fn new() -> Self {
14319        std::default::Default::default()
14320    }
14321
14322    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
14323    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14324        self.kind = v.into();
14325        self
14326    }
14327
14328    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
14329    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14330        self.domain = v.into();
14331        self
14332    }
14333}
14334
14335impl wkt::message::Message for SqlActiveDirectoryConfig {
14336    fn typename() -> &'static str {
14337        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
14338    }
14339}
14340
14341/// SQL Server specific audit configuration.
14342#[serde_with::serde_as]
14343#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14344#[serde(default, rename_all = "camelCase")]
14345#[non_exhaustive]
14346pub struct SqlServerAuditConfig {
14347    /// This is always sql#sqlServerAuditConfig
14348    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14349    pub kind: std::string::String,
14350
14351    /// The name of the destination bucket (e.g., gs://mybucket).
14352    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14353    pub bucket: std::string::String,
14354
14355    /// How long to keep generated audit files.
14356    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14357    pub retention_interval: std::option::Option<wkt::Duration>,
14358
14359    /// How often to upload generated audit files.
14360    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14361    pub upload_interval: std::option::Option<wkt::Duration>,
14362
14363    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14364    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14365}
14366
14367impl SqlServerAuditConfig {
14368    pub fn new() -> Self {
14369        std::default::Default::default()
14370    }
14371
14372    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
14373    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14374        self.kind = v.into();
14375        self
14376    }
14377
14378    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
14379    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14380        self.bucket = v.into();
14381        self
14382    }
14383
14384    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
14385    pub fn set_retention_interval<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
14386        mut self,
14387        v: T,
14388    ) -> Self {
14389        self.retention_interval = v.into();
14390        self
14391    }
14392
14393    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
14394    pub fn set_upload_interval<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
14395        mut self,
14396        v: T,
14397    ) -> Self {
14398        self.upload_interval = v.into();
14399        self
14400    }
14401}
14402
14403impl wkt::message::Message for SqlServerAuditConfig {
14404    fn typename() -> &'static str {
14405        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
14406    }
14407}
14408
14409/// Acquire SSRS lease context.
14410#[serde_with::serde_as]
14411#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14412#[serde(default, rename_all = "camelCase")]
14413#[non_exhaustive]
14414pub struct AcquireSsrsLeaseContext {
14415    /// The username to be used as the setup login to connect to the database
14416    /// server for SSRS setup.
14417    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14418    pub setup_login: std::option::Option<std::string::String>,
14419
14420    /// The username to be used as the service login to connect to the report
14421    /// database for SSRS setup.
14422    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14423    pub service_login: std::option::Option<std::string::String>,
14424
14425    /// The report database to be used for SSRS setup.
14426    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14427    pub report_database: std::option::Option<std::string::String>,
14428
14429    /// Lease duration needed for SSRS setup.
14430    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14431    pub duration: std::option::Option<wkt::Duration>,
14432
14433    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14434    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14435}
14436
14437impl AcquireSsrsLeaseContext {
14438    pub fn new() -> Self {
14439        std::default::Default::default()
14440    }
14441
14442    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
14443    pub fn set_setup_login<T: std::convert::Into<std::option::Option<std::string::String>>>(
14444        mut self,
14445        v: T,
14446    ) -> Self {
14447        self.setup_login = v.into();
14448        self
14449    }
14450
14451    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
14452    pub fn set_service_login<T: std::convert::Into<std::option::Option<std::string::String>>>(
14453        mut self,
14454        v: T,
14455    ) -> Self {
14456        self.service_login = v.into();
14457        self
14458    }
14459
14460    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
14461    pub fn set_report_database<T: std::convert::Into<std::option::Option<std::string::String>>>(
14462        mut self,
14463        v: T,
14464    ) -> Self {
14465        self.report_database = v.into();
14466        self
14467    }
14468
14469    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
14470    pub fn set_duration<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
14471        mut self,
14472        v: T,
14473    ) -> Self {
14474        self.duration = v.into();
14475        self
14476    }
14477}
14478
14479impl wkt::message::Message for AcquireSsrsLeaseContext {
14480    fn typename() -> &'static str {
14481        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
14482    }
14483}
14484
14485#[serde_with::serde_as]
14486#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14487#[serde(default, rename_all = "camelCase")]
14488#[non_exhaustive]
14489pub struct SqlSslCertsDeleteRequest {
14490    /// Cloud SQL instance ID. This does not include the project ID.
14491    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14492    pub instance: std::string::String,
14493
14494    /// Project ID of the project that contains the instance.
14495    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14496    pub project: std::string::String,
14497
14498    /// Sha1 FingerPrint.
14499    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14500    pub sha1_fingerprint: std::string::String,
14501
14502    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14503    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14504}
14505
14506impl SqlSslCertsDeleteRequest {
14507    pub fn new() -> Self {
14508        std::default::Default::default()
14509    }
14510
14511    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
14512    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14513        self.instance = v.into();
14514        self
14515    }
14516
14517    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
14518    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14519        self.project = v.into();
14520        self
14521    }
14522
14523    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
14524    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
14525        mut self,
14526        v: T,
14527    ) -> Self {
14528        self.sha1_fingerprint = v.into();
14529        self
14530    }
14531}
14532
14533impl wkt::message::Message for SqlSslCertsDeleteRequest {
14534    fn typename() -> &'static str {
14535        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
14536    }
14537}
14538
14539#[serde_with::serde_as]
14540#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14541#[serde(default, rename_all = "camelCase")]
14542#[non_exhaustive]
14543pub struct SqlSslCertsGetRequest {
14544    /// Cloud SQL instance ID. This does not include the project ID.
14545    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14546    pub instance: std::string::String,
14547
14548    /// Project ID of the project that contains the instance.
14549    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14550    pub project: std::string::String,
14551
14552    /// Sha1 FingerPrint.
14553    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14554    pub sha1_fingerprint: std::string::String,
14555
14556    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14557    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14558}
14559
14560impl SqlSslCertsGetRequest {
14561    pub fn new() -> Self {
14562        std::default::Default::default()
14563    }
14564
14565    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
14566    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14567        self.instance = v.into();
14568        self
14569    }
14570
14571    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
14572    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14573        self.project = v.into();
14574        self
14575    }
14576
14577    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
14578    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
14579        mut self,
14580        v: T,
14581    ) -> Self {
14582        self.sha1_fingerprint = v.into();
14583        self
14584    }
14585}
14586
14587impl wkt::message::Message for SqlSslCertsGetRequest {
14588    fn typename() -> &'static str {
14589        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
14590    }
14591}
14592
14593#[serde_with::serde_as]
14594#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14595#[serde(default, rename_all = "camelCase")]
14596#[non_exhaustive]
14597pub struct SqlSslCertsInsertRequest {
14598    /// Cloud SQL instance ID. This does not include the project ID.
14599    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14600    pub instance: std::string::String,
14601
14602    /// Project ID of the project that contains the instance.
14603    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14604    pub project: std::string::String,
14605
14606    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14607    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
14608
14609    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14610    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14611}
14612
14613impl SqlSslCertsInsertRequest {
14614    pub fn new() -> Self {
14615        std::default::Default::default()
14616    }
14617
14618    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
14619    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14620        self.instance = v.into();
14621        self
14622    }
14623
14624    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
14625    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14626        self.project = v.into();
14627        self
14628    }
14629
14630    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
14631    pub fn set_body<
14632        T: std::convert::Into<std::option::Option<crate::model::SslCertsInsertRequest>>,
14633    >(
14634        mut self,
14635        v: T,
14636    ) -> Self {
14637        self.body = v.into();
14638        self
14639    }
14640}
14641
14642impl wkt::message::Message for SqlSslCertsInsertRequest {
14643    fn typename() -> &'static str {
14644        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
14645    }
14646}
14647
14648#[serde_with::serde_as]
14649#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14650#[serde(default, rename_all = "camelCase")]
14651#[non_exhaustive]
14652pub struct SqlSslCertsListRequest {
14653    /// Cloud SQL instance ID. This does not include the project ID.
14654    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14655    pub instance: std::string::String,
14656
14657    /// Project ID of the project that contains the instance.
14658    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14659    pub project: std::string::String,
14660
14661    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14662    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14663}
14664
14665impl SqlSslCertsListRequest {
14666    pub fn new() -> Self {
14667        std::default::Default::default()
14668    }
14669
14670    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
14671    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14672        self.instance = v.into();
14673        self
14674    }
14675
14676    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
14677    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14678        self.project = v.into();
14679        self
14680    }
14681}
14682
14683impl wkt::message::Message for SqlSslCertsListRequest {
14684    fn typename() -> &'static str {
14685        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
14686    }
14687}
14688
14689/// SslCerts insert request.
14690#[serde_with::serde_as]
14691#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14692#[serde(default, rename_all = "camelCase")]
14693#[non_exhaustive]
14694pub struct SslCertsInsertRequest {
14695    /// User supplied name.  Must be a distinct name from the other certificates
14696    /// for this instance.
14697    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14698    pub common_name: std::string::String,
14699
14700    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14701    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14702}
14703
14704impl SslCertsInsertRequest {
14705    pub fn new() -> Self {
14706        std::default::Default::default()
14707    }
14708
14709    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
14710    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14711        self.common_name = v.into();
14712        self
14713    }
14714}
14715
14716impl wkt::message::Message for SslCertsInsertRequest {
14717    fn typename() -> &'static str {
14718        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
14719    }
14720}
14721
14722/// SslCert insert response.
14723#[serde_with::serde_as]
14724#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14725#[serde(default, rename_all = "camelCase")]
14726#[non_exhaustive]
14727pub struct SslCertsInsertResponse {
14728    /// This is always `sql#sslCertsInsert`.
14729    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14730    pub kind: std::string::String,
14731
14732    /// The operation to track the ssl certs insert request.
14733    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14734    pub operation: std::option::Option<crate::model::Operation>,
14735
14736    /// The server Certificate Authority's certificate.  If this is missing you can
14737    /// force a new one to be generated by calling resetSslConfig method on
14738    /// instances resource.
14739    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14740    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
14741
14742    /// The new client certificate and private key.
14743    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14744    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
14745
14746    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14747    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14748}
14749
14750impl SslCertsInsertResponse {
14751    pub fn new() -> Self {
14752        std::default::Default::default()
14753    }
14754
14755    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
14756    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14757        self.kind = v.into();
14758        self
14759    }
14760
14761    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
14762    pub fn set_operation<T: std::convert::Into<std::option::Option<crate::model::Operation>>>(
14763        mut self,
14764        v: T,
14765    ) -> Self {
14766        self.operation = v.into();
14767        self
14768    }
14769
14770    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
14771    pub fn set_server_ca_cert<T: std::convert::Into<std::option::Option<crate::model::SslCert>>>(
14772        mut self,
14773        v: T,
14774    ) -> Self {
14775        self.server_ca_cert = v.into();
14776        self
14777    }
14778
14779    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
14780    pub fn set_client_cert<
14781        T: std::convert::Into<std::option::Option<crate::model::SslCertDetail>>,
14782    >(
14783        mut self,
14784        v: T,
14785    ) -> Self {
14786        self.client_cert = v.into();
14787        self
14788    }
14789}
14790
14791impl wkt::message::Message for SslCertsInsertResponse {
14792    fn typename() -> &'static str {
14793        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
14794    }
14795}
14796
14797/// SslCerts list response.
14798#[serde_with::serde_as]
14799#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14800#[serde(default, rename_all = "camelCase")]
14801#[non_exhaustive]
14802pub struct SslCertsListResponse {
14803    /// This is always `sql#sslCertsList`.
14804    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14805    pub kind: std::string::String,
14806
14807    /// List of client certificates for the instance.
14808    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14809    pub items: std::vec::Vec<crate::model::SslCert>,
14810
14811    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14812    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14813}
14814
14815impl SslCertsListResponse {
14816    pub fn new() -> Self {
14817        std::default::Default::default()
14818    }
14819
14820    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
14821    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14822        self.kind = v.into();
14823        self
14824    }
14825
14826    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
14827    pub fn set_items<T, V>(mut self, v: T) -> Self
14828    where
14829        T: std::iter::IntoIterator<Item = V>,
14830        V: std::convert::Into<crate::model::SslCert>,
14831    {
14832        use std::iter::Iterator;
14833        self.items = v.into_iter().map(|i| i.into()).collect();
14834        self
14835    }
14836}
14837
14838impl wkt::message::Message for SslCertsListResponse {
14839    fn typename() -> &'static str {
14840        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
14841    }
14842}
14843
14844/// Tiers list request.
14845#[serde_with::serde_as]
14846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14847#[serde(default, rename_all = "camelCase")]
14848#[non_exhaustive]
14849pub struct SqlTiersListRequest {
14850    /// Project ID of the project for which to list tiers.
14851    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14852    pub project: std::string::String,
14853
14854    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14855    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14856}
14857
14858impl SqlTiersListRequest {
14859    pub fn new() -> Self {
14860        std::default::Default::default()
14861    }
14862
14863    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
14864    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14865        self.project = v.into();
14866        self
14867    }
14868}
14869
14870impl wkt::message::Message for SqlTiersListRequest {
14871    fn typename() -> &'static str {
14872        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
14873    }
14874}
14875
14876/// Tiers list response.
14877#[serde_with::serde_as]
14878#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14879#[serde(default, rename_all = "camelCase")]
14880#[non_exhaustive]
14881pub struct TiersListResponse {
14882    /// This is always `sql#tiersList`.
14883    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14884    pub kind: std::string::String,
14885
14886    /// List of tiers.
14887    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14888    pub items: std::vec::Vec<crate::model::Tier>,
14889
14890    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14891    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14892}
14893
14894impl TiersListResponse {
14895    pub fn new() -> Self {
14896        std::default::Default::default()
14897    }
14898
14899    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
14900    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14901        self.kind = v.into();
14902        self
14903    }
14904
14905    /// Sets the value of [items][crate::model::TiersListResponse::items].
14906    pub fn set_items<T, V>(mut self, v: T) -> Self
14907    where
14908        T: std::iter::IntoIterator<Item = V>,
14909        V: std::convert::Into<crate::model::Tier>,
14910    {
14911        use std::iter::Iterator;
14912        self.items = v.into_iter().map(|i| i.into()).collect();
14913        self
14914    }
14915}
14916
14917impl wkt::message::Message for TiersListResponse {
14918    fn typename() -> &'static str {
14919        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
14920    }
14921}
14922
14923/// A Google Cloud SQL service tier resource.
14924#[serde_with::serde_as]
14925#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14926#[serde(default, rename_all = "camelCase")]
14927#[non_exhaustive]
14928pub struct Tier {
14929    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
14930    /// related information, see [Pricing](/sql/pricing).
14931    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14932    pub tier: std::string::String,
14933
14934    /// The maximum RAM usage of this tier in bytes.
14935    #[serde(rename = "RAM")]
14936    #[serde(skip_serializing_if = "wkt::internal::is_default")]
14937    #[serde_as(as = "serde_with::DisplayFromStr")]
14938    pub ram: i64,
14939
14940    /// This is always `sql#tier`.
14941    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14942    pub kind: std::string::String,
14943
14944    /// The maximum disk size of this tier in bytes.
14945    #[serde(rename = "DiskQuota")]
14946    #[serde(skip_serializing_if = "wkt::internal::is_default")]
14947    #[serde_as(as = "serde_with::DisplayFromStr")]
14948    pub disk_quota: i64,
14949
14950    /// The applicable regions for this tier.
14951    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14952    pub region: std::vec::Vec<std::string::String>,
14953
14954    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14955    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14956}
14957
14958impl Tier {
14959    pub fn new() -> Self {
14960        std::default::Default::default()
14961    }
14962
14963    /// Sets the value of [tier][crate::model::Tier::tier].
14964    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14965        self.tier = v.into();
14966        self
14967    }
14968
14969    /// Sets the value of [ram][crate::model::Tier::ram].
14970    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14971        self.ram = v.into();
14972        self
14973    }
14974
14975    /// Sets the value of [kind][crate::model::Tier::kind].
14976    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14977        self.kind = v.into();
14978        self
14979    }
14980
14981    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
14982    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14983        self.disk_quota = v.into();
14984        self
14985    }
14986
14987    /// Sets the value of [region][crate::model::Tier::region].
14988    pub fn set_region<T, V>(mut self, v: T) -> Self
14989    where
14990        T: std::iter::IntoIterator<Item = V>,
14991        V: std::convert::Into<std::string::String>,
14992    {
14993        use std::iter::Iterator;
14994        self.region = v.into_iter().map(|i| i.into()).collect();
14995        self
14996    }
14997}
14998
14999impl wkt::message::Message for Tier {
15000    fn typename() -> &'static str {
15001        "type.googleapis.com/google.cloud.sql.v1.Tier"
15002    }
15003}
15004
15005#[serde_with::serde_as]
15006#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15007#[serde(default, rename_all = "camelCase")]
15008#[non_exhaustive]
15009pub struct SqlUsersDeleteRequest {
15010    /// Host of the user in the instance.
15011    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15012    pub host: std::string::String,
15013
15014    /// Database instance ID. This does not include the project ID.
15015    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15016    pub instance: std::string::String,
15017
15018    /// Name of the user in the instance.
15019    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15020    pub name: std::string::String,
15021
15022    /// Project ID of the project that contains the instance.
15023    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15024    pub project: std::string::String,
15025
15026    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15027    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15028}
15029
15030impl SqlUsersDeleteRequest {
15031    pub fn new() -> Self {
15032        std::default::Default::default()
15033    }
15034
15035    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
15036    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15037        self.host = v.into();
15038        self
15039    }
15040
15041    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
15042    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15043        self.instance = v.into();
15044        self
15045    }
15046
15047    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
15048    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15049        self.name = v.into();
15050        self
15051    }
15052
15053    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
15054    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15055        self.project = v.into();
15056        self
15057    }
15058}
15059
15060impl wkt::message::Message for SqlUsersDeleteRequest {
15061    fn typename() -> &'static str {
15062        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
15063    }
15064}
15065
15066/// Request message for Users Get RPC
15067#[serde_with::serde_as]
15068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15069#[serde(default, rename_all = "camelCase")]
15070#[non_exhaustive]
15071pub struct SqlUsersGetRequest {
15072    /// Database instance ID. This does not include the project ID.
15073    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15074    pub instance: std::string::String,
15075
15076    /// User of the instance.
15077    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15078    pub name: std::string::String,
15079
15080    /// Project ID of the project that contains the instance.
15081    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15082    pub project: std::string::String,
15083
15084    /// Host of a user of the instance.
15085    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15086    pub host: std::string::String,
15087
15088    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15089    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15090}
15091
15092impl SqlUsersGetRequest {
15093    pub fn new() -> Self {
15094        std::default::Default::default()
15095    }
15096
15097    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
15098    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15099        self.instance = v.into();
15100        self
15101    }
15102
15103    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
15104    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15105        self.name = v.into();
15106        self
15107    }
15108
15109    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
15110    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15111        self.project = v.into();
15112        self
15113    }
15114
15115    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
15116    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15117        self.host = v.into();
15118        self
15119    }
15120}
15121
15122impl wkt::message::Message for SqlUsersGetRequest {
15123    fn typename() -> &'static str {
15124        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
15125    }
15126}
15127
15128#[serde_with::serde_as]
15129#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15130#[serde(default, rename_all = "camelCase")]
15131#[non_exhaustive]
15132pub struct SqlUsersInsertRequest {
15133    /// Database instance ID. This does not include the project ID.
15134    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15135    pub instance: std::string::String,
15136
15137    /// Project ID of the project that contains the instance.
15138    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15139    pub project: std::string::String,
15140
15141    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15142    pub body: std::option::Option<crate::model::User>,
15143
15144    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15145    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15146}
15147
15148impl SqlUsersInsertRequest {
15149    pub fn new() -> Self {
15150        std::default::Default::default()
15151    }
15152
15153    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
15154    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15155        self.instance = v.into();
15156        self
15157    }
15158
15159    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
15160    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15161        self.project = v.into();
15162        self
15163    }
15164
15165    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
15166    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::User>>>(
15167        mut self,
15168        v: T,
15169    ) -> Self {
15170        self.body = v.into();
15171        self
15172    }
15173}
15174
15175impl wkt::message::Message for SqlUsersInsertRequest {
15176    fn typename() -> &'static str {
15177        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
15178    }
15179}
15180
15181#[serde_with::serde_as]
15182#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15183#[serde(default, rename_all = "camelCase")]
15184#[non_exhaustive]
15185pub struct SqlUsersListRequest {
15186    /// Database instance ID. This does not include the project ID.
15187    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15188    pub instance: std::string::String,
15189
15190    /// Project ID of the project that contains the instance.
15191    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15192    pub project: std::string::String,
15193
15194    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15195    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15196}
15197
15198impl SqlUsersListRequest {
15199    pub fn new() -> Self {
15200        std::default::Default::default()
15201    }
15202
15203    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
15204    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15205        self.instance = v.into();
15206        self
15207    }
15208
15209    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
15210    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15211        self.project = v.into();
15212        self
15213    }
15214}
15215
15216impl wkt::message::Message for SqlUsersListRequest {
15217    fn typename() -> &'static str {
15218        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
15219    }
15220}
15221
15222#[serde_with::serde_as]
15223#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15224#[serde(default, rename_all = "camelCase")]
15225#[non_exhaustive]
15226pub struct SqlUsersUpdateRequest {
15227    /// Optional. Host of the user in the instance.
15228    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15229    pub host: std::string::String,
15230
15231    /// Database instance ID. This does not include the project ID.
15232    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15233    pub instance: std::string::String,
15234
15235    /// Name of the user in the instance.
15236    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15237    pub name: std::string::String,
15238
15239    /// Project ID of the project that contains the instance.
15240    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15241    pub project: std::string::String,
15242
15243    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15244    pub body: std::option::Option<crate::model::User>,
15245
15246    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15247    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15248}
15249
15250impl SqlUsersUpdateRequest {
15251    pub fn new() -> Self {
15252        std::default::Default::default()
15253    }
15254
15255    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
15256    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15257        self.host = v.into();
15258        self
15259    }
15260
15261    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
15262    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15263        self.instance = v.into();
15264        self
15265    }
15266
15267    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
15268    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15269        self.name = v.into();
15270        self
15271    }
15272
15273    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
15274    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15275        self.project = v.into();
15276        self
15277    }
15278
15279    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
15280    pub fn set_body<T: std::convert::Into<std::option::Option<crate::model::User>>>(
15281        mut self,
15282        v: T,
15283    ) -> Self {
15284        self.body = v.into();
15285        self
15286    }
15287}
15288
15289impl wkt::message::Message for SqlUsersUpdateRequest {
15290    fn typename() -> &'static str {
15291        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
15292    }
15293}
15294
15295/// User level password validation policy.
15296#[serde_with::serde_as]
15297#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15298#[serde(default, rename_all = "camelCase")]
15299#[non_exhaustive]
15300pub struct UserPasswordValidationPolicy {
15301    /// Number of failed login attempts allowed before user get locked.
15302    #[serde(skip_serializing_if = "wkt::internal::is_default")]
15303    pub allowed_failed_attempts: i32,
15304
15305    /// Expiration duration after password is updated.
15306    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15307    pub password_expiration_duration: std::option::Option<wkt::Duration>,
15308
15309    /// If true, failed login attempts check will be enabled.
15310    #[serde(skip_serializing_if = "wkt::internal::is_default")]
15311    pub enable_failed_attempts_check: bool,
15312
15313    /// Output only. Read-only password status.
15314    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15315    pub status: std::option::Option<crate::model::PasswordStatus>,
15316
15317    /// If true, the user must specify the current password before changing the
15318    /// password. This flag is supported only for MySQL.
15319    #[serde(skip_serializing_if = "wkt::internal::is_default")]
15320    pub enable_password_verification: bool,
15321
15322    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15323    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15324}
15325
15326impl UserPasswordValidationPolicy {
15327    pub fn new() -> Self {
15328        std::default::Default::default()
15329    }
15330
15331    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
15332    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15333        self.allowed_failed_attempts = v.into();
15334        self
15335    }
15336
15337    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
15338    pub fn set_password_expiration_duration<
15339        T: std::convert::Into<std::option::Option<wkt::Duration>>,
15340    >(
15341        mut self,
15342        v: T,
15343    ) -> Self {
15344        self.password_expiration_duration = v.into();
15345        self
15346    }
15347
15348    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
15349    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15350        self.enable_failed_attempts_check = v.into();
15351        self
15352    }
15353
15354    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
15355    pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::PasswordStatus>>>(
15356        mut self,
15357        v: T,
15358    ) -> Self {
15359        self.status = v.into();
15360        self
15361    }
15362
15363    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
15364    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15365        self.enable_password_verification = v.into();
15366        self
15367    }
15368}
15369
15370impl wkt::message::Message for UserPasswordValidationPolicy {
15371    fn typename() -> &'static str {
15372        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
15373    }
15374}
15375
15376/// Read-only password status.
15377#[serde_with::serde_as]
15378#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15379#[serde(default, rename_all = "camelCase")]
15380#[non_exhaustive]
15381pub struct PasswordStatus {
15382    /// If true, user does not have login privileges.
15383    #[serde(skip_serializing_if = "wkt::internal::is_default")]
15384    pub locked: bool,
15385
15386    /// The expiration time of the current password.
15387    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15388    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
15389
15390    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15391    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15392}
15393
15394impl PasswordStatus {
15395    pub fn new() -> Self {
15396        std::default::Default::default()
15397    }
15398
15399    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
15400    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15401        self.locked = v.into();
15402        self
15403    }
15404
15405    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
15406    pub fn set_password_expiration_time<
15407        T: std::convert::Into<std::option::Option<wkt::Timestamp>>,
15408    >(
15409        mut self,
15410        v: T,
15411    ) -> Self {
15412        self.password_expiration_time = v.into();
15413        self
15414    }
15415}
15416
15417impl wkt::message::Message for PasswordStatus {
15418    fn typename() -> &'static str {
15419        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
15420    }
15421}
15422
15423/// A Cloud SQL user resource.
15424#[serde_with::serde_as]
15425#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15426#[serde(default, rename_all = "camelCase")]
15427#[non_exhaustive]
15428pub struct User {
15429    /// This is always `sql#user`.
15430    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15431    pub kind: std::string::String,
15432
15433    /// The password for the user.
15434    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15435    pub password: std::string::String,
15436
15437    /// This field is deprecated and will be removed from a future version of the
15438    /// API.
15439    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15440    pub etag: std::string::String,
15441
15442    /// The name of the user in the Cloud SQL instance. Can be omitted for
15443    /// `update` because it is already specified in the URL.
15444    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15445    pub name: std::string::String,
15446
15447    /// Optional. The host from which the user can connect. For `insert`
15448    /// operations, host defaults to an empty string. For `update`
15449    /// operations, host is specified as part of the request URL. The host name
15450    /// cannot be updated after insertion.  For a MySQL instance, it's required;
15451    /// for a PostgreSQL or SQL Server instance, it's optional.
15452    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15453    pub host: std::string::String,
15454
15455    /// The name of the Cloud SQL instance. This does not include the project ID.
15456    /// Can be omitted for `update` because it is already specified on the
15457    /// URL.
15458    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15459    pub instance: std::string::String,
15460
15461    /// The project ID of the project containing the Cloud SQL database. The Google
15462    /// apps domain is prefixed if applicable. Can be omitted for `update` because
15463    /// it is already specified on the URL.
15464    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15465    pub project: std::string::String,
15466
15467    /// The user type. It determines the method to authenticate the user during
15468    /// login. The default is the database's built-in user type.
15469    #[serde(rename = "type")]
15470    pub r#type: crate::model::user::SqlUserType,
15471
15472    /// User level password validation policy.
15473    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15474    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
15475
15476    /// Dual password status for the user.
15477    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15478    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
15479
15480    /// User details for specific database type
15481    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15482    pub user_details: std::option::Option<crate::model::user::UserDetails>,
15483
15484    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15485    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15486}
15487
15488impl User {
15489    pub fn new() -> Self {
15490        std::default::Default::default()
15491    }
15492
15493    /// Sets the value of [kind][crate::model::User::kind].
15494    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15495        self.kind = v.into();
15496        self
15497    }
15498
15499    /// Sets the value of [password][crate::model::User::password].
15500    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15501        self.password = v.into();
15502        self
15503    }
15504
15505    /// Sets the value of [etag][crate::model::User::etag].
15506    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15507        self.etag = v.into();
15508        self
15509    }
15510
15511    /// Sets the value of [name][crate::model::User::name].
15512    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15513        self.name = v.into();
15514        self
15515    }
15516
15517    /// Sets the value of [host][crate::model::User::host].
15518    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15519        self.host = v.into();
15520        self
15521    }
15522
15523    /// Sets the value of [instance][crate::model::User::instance].
15524    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15525        self.instance = v.into();
15526        self
15527    }
15528
15529    /// Sets the value of [project][crate::model::User::project].
15530    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15531        self.project = v.into();
15532        self
15533    }
15534
15535    /// Sets the value of [r#type][crate::model::User::type].
15536    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
15537        mut self,
15538        v: T,
15539    ) -> Self {
15540        self.r#type = v.into();
15541        self
15542    }
15543
15544    /// Sets the value of [password_policy][crate::model::User::password_policy].
15545    pub fn set_password_policy<
15546        T: std::convert::Into<std::option::Option<crate::model::UserPasswordValidationPolicy>>,
15547    >(
15548        mut self,
15549        v: T,
15550    ) -> Self {
15551        self.password_policy = v.into();
15552        self
15553    }
15554
15555    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
15556    pub fn set_dual_password_type<
15557        T: std::convert::Into<std::option::Option<crate::model::user::DualPasswordType>>,
15558    >(
15559        mut self,
15560        v: T,
15561    ) -> Self {
15562        self.dual_password_type = v.into();
15563        self
15564    }
15565
15566    /// Sets the value of [user_details][crate::model::User::user_details].
15567    ///
15568    /// Note that all the setters affecting `user_details` are mutually
15569    /// exclusive.
15570    pub fn set_user_details<
15571        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
15572    >(
15573        mut self,
15574        v: T,
15575    ) -> Self {
15576        self.user_details = v.into();
15577        self
15578    }
15579
15580    /// The value of [user_details][crate::model::User::user_details]
15581    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
15582    /// holds a different branch.
15583    pub fn sqlserver_user_details(
15584        &self,
15585    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
15586        #[allow(unreachable_patterns)]
15587        self.user_details.as_ref().and_then(|v| match v {
15588            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
15589                std::option::Option::Some(v)
15590            }
15591            _ => std::option::Option::None,
15592        })
15593    }
15594
15595    /// Sets the value of [user_details][crate::model::User::user_details]
15596    /// to hold a `SqlserverUserDetails`.
15597    ///
15598    /// Note that all the setters affecting `user_details` are
15599    /// mutually exclusive.
15600    pub fn set_sqlserver_user_details<
15601        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
15602    >(
15603        mut self,
15604        v: T,
15605    ) -> Self {
15606        self.user_details = std::option::Option::Some(
15607            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
15608        );
15609        self
15610    }
15611}
15612
15613impl wkt::message::Message for User {
15614    fn typename() -> &'static str {
15615        "type.googleapis.com/google.cloud.sql.v1.User"
15616    }
15617}
15618
15619/// Defines additional types related to [User].
15620pub mod user {
15621    #[allow(unused_imports)]
15622    use super::*;
15623
15624    /// The user type.
15625    ///
15626    /// # Working with unknown values
15627    ///
15628    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15629    /// additional enum variants at any time. Adding new variants is not considered
15630    /// a breaking change. Applications should write their code in anticipation of:
15631    ///
15632    /// - New values appearing in future releases of the client library, **and**
15633    /// - New values received dynamically, without application changes.
15634    ///
15635    /// Please consult the [Working with enums] section in the user guide for some
15636    /// guidelines.
15637    ///
15638    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15639    #[derive(Clone, Debug, PartialEq)]
15640    #[non_exhaustive]
15641    pub enum SqlUserType {
15642        /// The database's built-in user type.
15643        BuiltIn,
15644        /// Cloud IAM user.
15645        CloudIamUser,
15646        /// Cloud IAM service account.
15647        CloudIamServiceAccount,
15648        /// Cloud IAM group non-login user.
15649        CloudIamGroup,
15650        /// Cloud IAM group login user.
15651        CloudIamGroupUser,
15652        /// Cloud IAM group login service account.
15653        CloudIamGroupServiceAccount,
15654        /// If set, the enum was initialized with an unknown value.
15655        ///
15656        /// Applications can examine the value using [SqlUserType::value] or
15657        /// [SqlUserType::name].
15658        UnknownValue(sql_user_type::UnknownValue),
15659    }
15660
15661    #[doc(hidden)]
15662    pub mod sql_user_type {
15663        #[allow(unused_imports)]
15664        use super::*;
15665        #[derive(Clone, Debug, PartialEq)]
15666        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15667    }
15668
15669    impl SqlUserType {
15670        /// Gets the enum value.
15671        ///
15672        /// Returns `None` if the enum contains an unknown value deserialized from
15673        /// the string representation of enums.
15674        pub fn value(&self) -> std::option::Option<i32> {
15675            match self {
15676                Self::BuiltIn => std::option::Option::Some(0),
15677                Self::CloudIamUser => std::option::Option::Some(1),
15678                Self::CloudIamServiceAccount => std::option::Option::Some(2),
15679                Self::CloudIamGroup => std::option::Option::Some(3),
15680                Self::CloudIamGroupUser => std::option::Option::Some(4),
15681                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
15682                Self::UnknownValue(u) => u.0.value(),
15683            }
15684        }
15685
15686        /// Gets the enum value as a string.
15687        ///
15688        /// Returns `None` if the enum contains an unknown value deserialized from
15689        /// the integer representation of enums.
15690        pub fn name(&self) -> std::option::Option<&str> {
15691            match self {
15692                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
15693                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
15694                Self::CloudIamServiceAccount => {
15695                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
15696                }
15697                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
15698                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
15699                Self::CloudIamGroupServiceAccount => {
15700                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
15701                }
15702                Self::UnknownValue(u) => u.0.name(),
15703            }
15704        }
15705    }
15706
15707    impl std::default::Default for SqlUserType {
15708        fn default() -> Self {
15709            use std::convert::From;
15710            Self::from(0)
15711        }
15712    }
15713
15714    impl std::fmt::Display for SqlUserType {
15715        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15716            wkt::internal::display_enum(f, self.name(), self.value())
15717        }
15718    }
15719
15720    impl std::convert::From<i32> for SqlUserType {
15721        fn from(value: i32) -> Self {
15722            match value {
15723                0 => Self::BuiltIn,
15724                1 => Self::CloudIamUser,
15725                2 => Self::CloudIamServiceAccount,
15726                3 => Self::CloudIamGroup,
15727                4 => Self::CloudIamGroupUser,
15728                5 => Self::CloudIamGroupServiceAccount,
15729                _ => Self::UnknownValue(sql_user_type::UnknownValue(
15730                    wkt::internal::UnknownEnumValue::Integer(value),
15731                )),
15732            }
15733        }
15734    }
15735
15736    impl std::convert::From<&str> for SqlUserType {
15737        fn from(value: &str) -> Self {
15738            use std::string::ToString;
15739            match value {
15740                "BUILT_IN" => Self::BuiltIn,
15741                "CLOUD_IAM_USER" => Self::CloudIamUser,
15742                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
15743                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
15744                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
15745                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
15746                _ => Self::UnknownValue(sql_user_type::UnknownValue(
15747                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15748                )),
15749            }
15750        }
15751    }
15752
15753    impl serde::ser::Serialize for SqlUserType {
15754        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15755        where
15756            S: serde::Serializer,
15757        {
15758            match self {
15759                Self::BuiltIn => serializer.serialize_i32(0),
15760                Self::CloudIamUser => serializer.serialize_i32(1),
15761                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
15762                Self::CloudIamGroup => serializer.serialize_i32(3),
15763                Self::CloudIamGroupUser => serializer.serialize_i32(4),
15764                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
15765                Self::UnknownValue(u) => u.0.serialize(serializer),
15766            }
15767        }
15768    }
15769
15770    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
15771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15772        where
15773            D: serde::Deserializer<'de>,
15774        {
15775            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
15776                ".google.cloud.sql.v1.User.SqlUserType",
15777            ))
15778        }
15779    }
15780
15781    /// The type of retained password.
15782    ///
15783    /// # Working with unknown values
15784    ///
15785    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15786    /// additional enum variants at any time. Adding new variants is not considered
15787    /// a breaking change. Applications should write their code in anticipation of:
15788    ///
15789    /// - New values appearing in future releases of the client library, **and**
15790    /// - New values received dynamically, without application changes.
15791    ///
15792    /// Please consult the [Working with enums] section in the user guide for some
15793    /// guidelines.
15794    ///
15795    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15796    #[derive(Clone, Debug, PartialEq)]
15797    #[non_exhaustive]
15798    pub enum DualPasswordType {
15799        /// The default value.
15800        Unspecified,
15801        /// Do not update the user's dual password status.
15802        NoModifyDualPassword,
15803        /// No dual password usable for connecting using this user.
15804        NoDualPassword,
15805        /// Dual password usable for connecting using this user.
15806        DualPassword,
15807        /// If set, the enum was initialized with an unknown value.
15808        ///
15809        /// Applications can examine the value using [DualPasswordType::value] or
15810        /// [DualPasswordType::name].
15811        UnknownValue(dual_password_type::UnknownValue),
15812    }
15813
15814    #[doc(hidden)]
15815    pub mod dual_password_type {
15816        #[allow(unused_imports)]
15817        use super::*;
15818        #[derive(Clone, Debug, PartialEq)]
15819        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15820    }
15821
15822    impl DualPasswordType {
15823        /// Gets the enum value.
15824        ///
15825        /// Returns `None` if the enum contains an unknown value deserialized from
15826        /// the string representation of enums.
15827        pub fn value(&self) -> std::option::Option<i32> {
15828            match self {
15829                Self::Unspecified => std::option::Option::Some(0),
15830                Self::NoModifyDualPassword => std::option::Option::Some(1),
15831                Self::NoDualPassword => std::option::Option::Some(2),
15832                Self::DualPassword => std::option::Option::Some(3),
15833                Self::UnknownValue(u) => u.0.value(),
15834            }
15835        }
15836
15837        /// Gets the enum value as a string.
15838        ///
15839        /// Returns `None` if the enum contains an unknown value deserialized from
15840        /// the integer representation of enums.
15841        pub fn name(&self) -> std::option::Option<&str> {
15842            match self {
15843                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
15844                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
15845                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
15846                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
15847                Self::UnknownValue(u) => u.0.name(),
15848            }
15849        }
15850    }
15851
15852    impl std::default::Default for DualPasswordType {
15853        fn default() -> Self {
15854            use std::convert::From;
15855            Self::from(0)
15856        }
15857    }
15858
15859    impl std::fmt::Display for DualPasswordType {
15860        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15861            wkt::internal::display_enum(f, self.name(), self.value())
15862        }
15863    }
15864
15865    impl std::convert::From<i32> for DualPasswordType {
15866        fn from(value: i32) -> Self {
15867            match value {
15868                0 => Self::Unspecified,
15869                1 => Self::NoModifyDualPassword,
15870                2 => Self::NoDualPassword,
15871                3 => Self::DualPassword,
15872                _ => Self::UnknownValue(dual_password_type::UnknownValue(
15873                    wkt::internal::UnknownEnumValue::Integer(value),
15874                )),
15875            }
15876        }
15877    }
15878
15879    impl std::convert::From<&str> for DualPasswordType {
15880        fn from(value: &str) -> Self {
15881            use std::string::ToString;
15882            match value {
15883                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
15884                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
15885                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
15886                "DUAL_PASSWORD" => Self::DualPassword,
15887                _ => Self::UnknownValue(dual_password_type::UnknownValue(
15888                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15889                )),
15890            }
15891        }
15892    }
15893
15894    impl serde::ser::Serialize for DualPasswordType {
15895        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15896        where
15897            S: serde::Serializer,
15898        {
15899            match self {
15900                Self::Unspecified => serializer.serialize_i32(0),
15901                Self::NoModifyDualPassword => serializer.serialize_i32(1),
15902                Self::NoDualPassword => serializer.serialize_i32(2),
15903                Self::DualPassword => serializer.serialize_i32(3),
15904                Self::UnknownValue(u) => u.0.serialize(serializer),
15905            }
15906        }
15907    }
15908
15909    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
15910        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15911        where
15912            D: serde::Deserializer<'de>,
15913        {
15914            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
15915                ".google.cloud.sql.v1.User.DualPasswordType",
15916            ))
15917        }
15918    }
15919
15920    /// User details for specific database type
15921    #[serde_with::serde_as]
15922    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15923    #[serde(rename_all = "camelCase")]
15924    #[non_exhaustive]
15925    pub enum UserDetails {
15926        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
15927    }
15928}
15929
15930/// Represents a Sql Server user on the Cloud SQL instance.
15931#[serde_with::serde_as]
15932#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15933#[serde(default, rename_all = "camelCase")]
15934#[non_exhaustive]
15935pub struct SqlServerUserDetails {
15936    /// If the user has been disabled
15937    #[serde(skip_serializing_if = "wkt::internal::is_default")]
15938    pub disabled: bool,
15939
15940    /// The server roles for this user
15941    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15942    pub server_roles: std::vec::Vec<std::string::String>,
15943
15944    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15945    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15946}
15947
15948impl SqlServerUserDetails {
15949    pub fn new() -> Self {
15950        std::default::Default::default()
15951    }
15952
15953    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
15954    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15955        self.disabled = v.into();
15956        self
15957    }
15958
15959    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
15960    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
15961    where
15962        T: std::iter::IntoIterator<Item = V>,
15963        V: std::convert::Into<std::string::String>,
15964    {
15965        use std::iter::Iterator;
15966        self.server_roles = v.into_iter().map(|i| i.into()).collect();
15967        self
15968    }
15969}
15970
15971impl wkt::message::Message for SqlServerUserDetails {
15972    fn typename() -> &'static str {
15973        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
15974    }
15975}
15976
15977/// User list response.
15978#[serde_with::serde_as]
15979#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15980#[serde(default, rename_all = "camelCase")]
15981#[non_exhaustive]
15982pub struct UsersListResponse {
15983    /// This is always `sql#usersList`.
15984    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15985    pub kind: std::string::String,
15986
15987    /// List of user resources in the instance.
15988    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15989    pub items: std::vec::Vec<crate::model::User>,
15990
15991    /// Unused.
15992    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15993    #[deprecated]
15994    pub next_page_token: std::string::String,
15995
15996    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15997    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15998}
15999
16000impl UsersListResponse {
16001    pub fn new() -> Self {
16002        std::default::Default::default()
16003    }
16004
16005    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
16006    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16007        self.kind = v.into();
16008        self
16009    }
16010
16011    /// Sets the value of [items][crate::model::UsersListResponse::items].
16012    pub fn set_items<T, V>(mut self, v: T) -> Self
16013    where
16014        T: std::iter::IntoIterator<Item = V>,
16015        V: std::convert::Into<crate::model::User>,
16016    {
16017        use std::iter::Iterator;
16018        self.items = v.into_iter().map(|i| i.into()).collect();
16019        self
16020    }
16021
16022    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
16023    #[deprecated]
16024    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16025        self.next_page_token = v.into();
16026        self
16027    }
16028}
16029
16030impl wkt::message::Message for UsersListResponse {
16031    fn typename() -> &'static str {
16032        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
16033    }
16034}
16035
16036/// The status of a backup run.
16037///
16038/// # Working with unknown values
16039///
16040/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16041/// additional enum variants at any time. Adding new variants is not considered
16042/// a breaking change. Applications should write their code in anticipation of:
16043///
16044/// - New values appearing in future releases of the client library, **and**
16045/// - New values received dynamically, without application changes.
16046///
16047/// Please consult the [Working with enums] section in the user guide for some
16048/// guidelines.
16049///
16050/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16051#[derive(Clone, Debug, PartialEq)]
16052#[non_exhaustive]
16053pub enum SqlBackupRunStatus {
16054    /// The status of the run is unknown.
16055    Unspecified,
16056    /// The backup operation was enqueued.
16057    Enqueued,
16058    /// The backup is overdue across a given backup window. Indicates a
16059    /// problem. Example: Long-running operation in progress during
16060    /// the whole window.
16061    Overdue,
16062    /// The backup is in progress.
16063    Running,
16064    /// The backup failed.
16065    Failed,
16066    /// The backup was successful.
16067    Successful,
16068    /// The backup was skipped (without problems) for a given backup
16069    /// window. Example: Instance was idle.
16070    Skipped,
16071    /// The backup is about to be deleted.
16072    DeletionPending,
16073    /// The backup deletion failed.
16074    DeletionFailed,
16075    /// The backup has been deleted.
16076    Deleted,
16077    /// If set, the enum was initialized with an unknown value.
16078    ///
16079    /// Applications can examine the value using [SqlBackupRunStatus::value] or
16080    /// [SqlBackupRunStatus::name].
16081    UnknownValue(sql_backup_run_status::UnknownValue),
16082}
16083
16084#[doc(hidden)]
16085pub mod sql_backup_run_status {
16086    #[allow(unused_imports)]
16087    use super::*;
16088    #[derive(Clone, Debug, PartialEq)]
16089    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16090}
16091
16092impl SqlBackupRunStatus {
16093    /// Gets the enum value.
16094    ///
16095    /// Returns `None` if the enum contains an unknown value deserialized from
16096    /// the string representation of enums.
16097    pub fn value(&self) -> std::option::Option<i32> {
16098        match self {
16099            Self::Unspecified => std::option::Option::Some(0),
16100            Self::Enqueued => std::option::Option::Some(1),
16101            Self::Overdue => std::option::Option::Some(2),
16102            Self::Running => std::option::Option::Some(3),
16103            Self::Failed => std::option::Option::Some(4),
16104            Self::Successful => std::option::Option::Some(5),
16105            Self::Skipped => std::option::Option::Some(6),
16106            Self::DeletionPending => std::option::Option::Some(7),
16107            Self::DeletionFailed => std::option::Option::Some(8),
16108            Self::Deleted => std::option::Option::Some(9),
16109            Self::UnknownValue(u) => u.0.value(),
16110        }
16111    }
16112
16113    /// Gets the enum value as a string.
16114    ///
16115    /// Returns `None` if the enum contains an unknown value deserialized from
16116    /// the integer representation of enums.
16117    pub fn name(&self) -> std::option::Option<&str> {
16118        match self {
16119            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
16120            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
16121            Self::Overdue => std::option::Option::Some("OVERDUE"),
16122            Self::Running => std::option::Option::Some("RUNNING"),
16123            Self::Failed => std::option::Option::Some("FAILED"),
16124            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
16125            Self::Skipped => std::option::Option::Some("SKIPPED"),
16126            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
16127            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
16128            Self::Deleted => std::option::Option::Some("DELETED"),
16129            Self::UnknownValue(u) => u.0.name(),
16130        }
16131    }
16132}
16133
16134impl std::default::Default for SqlBackupRunStatus {
16135    fn default() -> Self {
16136        use std::convert::From;
16137        Self::from(0)
16138    }
16139}
16140
16141impl std::fmt::Display for SqlBackupRunStatus {
16142    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16143        wkt::internal::display_enum(f, self.name(), self.value())
16144    }
16145}
16146
16147impl std::convert::From<i32> for SqlBackupRunStatus {
16148    fn from(value: i32) -> Self {
16149        match value {
16150            0 => Self::Unspecified,
16151            1 => Self::Enqueued,
16152            2 => Self::Overdue,
16153            3 => Self::Running,
16154            4 => Self::Failed,
16155            5 => Self::Successful,
16156            6 => Self::Skipped,
16157            7 => Self::DeletionPending,
16158            8 => Self::DeletionFailed,
16159            9 => Self::Deleted,
16160            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16161                wkt::internal::UnknownEnumValue::Integer(value),
16162            )),
16163        }
16164    }
16165}
16166
16167impl std::convert::From<&str> for SqlBackupRunStatus {
16168    fn from(value: &str) -> Self {
16169        use std::string::ToString;
16170        match value {
16171            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
16172            "ENQUEUED" => Self::Enqueued,
16173            "OVERDUE" => Self::Overdue,
16174            "RUNNING" => Self::Running,
16175            "FAILED" => Self::Failed,
16176            "SUCCESSFUL" => Self::Successful,
16177            "SKIPPED" => Self::Skipped,
16178            "DELETION_PENDING" => Self::DeletionPending,
16179            "DELETION_FAILED" => Self::DeletionFailed,
16180            "DELETED" => Self::Deleted,
16181            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16182                wkt::internal::UnknownEnumValue::String(value.to_string()),
16183            )),
16184        }
16185    }
16186}
16187
16188impl serde::ser::Serialize for SqlBackupRunStatus {
16189    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16190    where
16191        S: serde::Serializer,
16192    {
16193        match self {
16194            Self::Unspecified => serializer.serialize_i32(0),
16195            Self::Enqueued => serializer.serialize_i32(1),
16196            Self::Overdue => serializer.serialize_i32(2),
16197            Self::Running => serializer.serialize_i32(3),
16198            Self::Failed => serializer.serialize_i32(4),
16199            Self::Successful => serializer.serialize_i32(5),
16200            Self::Skipped => serializer.serialize_i32(6),
16201            Self::DeletionPending => serializer.serialize_i32(7),
16202            Self::DeletionFailed => serializer.serialize_i32(8),
16203            Self::Deleted => serializer.serialize_i32(9),
16204            Self::UnknownValue(u) => u.0.serialize(serializer),
16205        }
16206    }
16207}
16208
16209impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
16210    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16211    where
16212        D: serde::Deserializer<'de>,
16213    {
16214        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
16215            ".google.cloud.sql.v1.SqlBackupRunStatus",
16216        ))
16217    }
16218}
16219
16220/// Defines the supported backup kinds.
16221///
16222/// # Working with unknown values
16223///
16224/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16225/// additional enum variants at any time. Adding new variants is not considered
16226/// a breaking change. Applications should write their code in anticipation of:
16227///
16228/// - New values appearing in future releases of the client library, **and**
16229/// - New values received dynamically, without application changes.
16230///
16231/// Please consult the [Working with enums] section in the user guide for some
16232/// guidelines.
16233///
16234/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16235#[derive(Clone, Debug, PartialEq)]
16236#[non_exhaustive]
16237pub enum SqlBackupKind {
16238    /// This is an unknown BackupKind.
16239    Unspecified,
16240    /// The snapshot based backups
16241    Snapshot,
16242    /// Physical backups
16243    Physical,
16244    /// If set, the enum was initialized with an unknown value.
16245    ///
16246    /// Applications can examine the value using [SqlBackupKind::value] or
16247    /// [SqlBackupKind::name].
16248    UnknownValue(sql_backup_kind::UnknownValue),
16249}
16250
16251#[doc(hidden)]
16252pub mod sql_backup_kind {
16253    #[allow(unused_imports)]
16254    use super::*;
16255    #[derive(Clone, Debug, PartialEq)]
16256    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16257}
16258
16259impl SqlBackupKind {
16260    /// Gets the enum value.
16261    ///
16262    /// Returns `None` if the enum contains an unknown value deserialized from
16263    /// the string representation of enums.
16264    pub fn value(&self) -> std::option::Option<i32> {
16265        match self {
16266            Self::Unspecified => std::option::Option::Some(0),
16267            Self::Snapshot => std::option::Option::Some(1),
16268            Self::Physical => std::option::Option::Some(2),
16269            Self::UnknownValue(u) => u.0.value(),
16270        }
16271    }
16272
16273    /// Gets the enum value as a string.
16274    ///
16275    /// Returns `None` if the enum contains an unknown value deserialized from
16276    /// the integer representation of enums.
16277    pub fn name(&self) -> std::option::Option<&str> {
16278        match self {
16279            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
16280            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
16281            Self::Physical => std::option::Option::Some("PHYSICAL"),
16282            Self::UnknownValue(u) => u.0.name(),
16283        }
16284    }
16285}
16286
16287impl std::default::Default for SqlBackupKind {
16288    fn default() -> Self {
16289        use std::convert::From;
16290        Self::from(0)
16291    }
16292}
16293
16294impl std::fmt::Display for SqlBackupKind {
16295    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16296        wkt::internal::display_enum(f, self.name(), self.value())
16297    }
16298}
16299
16300impl std::convert::From<i32> for SqlBackupKind {
16301    fn from(value: i32) -> Self {
16302        match value {
16303            0 => Self::Unspecified,
16304            1 => Self::Snapshot,
16305            2 => Self::Physical,
16306            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16307                wkt::internal::UnknownEnumValue::Integer(value),
16308            )),
16309        }
16310    }
16311}
16312
16313impl std::convert::From<&str> for SqlBackupKind {
16314    fn from(value: &str) -> Self {
16315        use std::string::ToString;
16316        match value {
16317            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
16318            "SNAPSHOT" => Self::Snapshot,
16319            "PHYSICAL" => Self::Physical,
16320            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16321                wkt::internal::UnknownEnumValue::String(value.to_string()),
16322            )),
16323        }
16324    }
16325}
16326
16327impl serde::ser::Serialize for SqlBackupKind {
16328    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16329    where
16330        S: serde::Serializer,
16331    {
16332        match self {
16333            Self::Unspecified => serializer.serialize_i32(0),
16334            Self::Snapshot => serializer.serialize_i32(1),
16335            Self::Physical => serializer.serialize_i32(2),
16336            Self::UnknownValue(u) => u.0.serialize(serializer),
16337        }
16338    }
16339}
16340
16341impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
16342    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16343    where
16344        D: serde::Deserializer<'de>,
16345    {
16346        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
16347            ".google.cloud.sql.v1.SqlBackupKind",
16348        ))
16349    }
16350}
16351
16352/// Type of backup (i.e. automated, on demand, etc).
16353///
16354/// # Working with unknown values
16355///
16356/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16357/// additional enum variants at any time. Adding new variants is not considered
16358/// a breaking change. Applications should write their code in anticipation of:
16359///
16360/// - New values appearing in future releases of the client library, **and**
16361/// - New values received dynamically, without application changes.
16362///
16363/// Please consult the [Working with enums] section in the user guide for some
16364/// guidelines.
16365///
16366/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16367#[derive(Clone, Debug, PartialEq)]
16368#[non_exhaustive]
16369pub enum SqlBackupRunType {
16370    /// This is an unknown BackupRun type.
16371    Unspecified,
16372    /// The backup schedule automatically triggers a backup.
16373    Automated,
16374    /// The user manually triggers a backup.
16375    OnDemand,
16376    /// If set, the enum was initialized with an unknown value.
16377    ///
16378    /// Applications can examine the value using [SqlBackupRunType::value] or
16379    /// [SqlBackupRunType::name].
16380    UnknownValue(sql_backup_run_type::UnknownValue),
16381}
16382
16383#[doc(hidden)]
16384pub mod sql_backup_run_type {
16385    #[allow(unused_imports)]
16386    use super::*;
16387    #[derive(Clone, Debug, PartialEq)]
16388    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16389}
16390
16391impl SqlBackupRunType {
16392    /// Gets the enum value.
16393    ///
16394    /// Returns `None` if the enum contains an unknown value deserialized from
16395    /// the string representation of enums.
16396    pub fn value(&self) -> std::option::Option<i32> {
16397        match self {
16398            Self::Unspecified => std::option::Option::Some(0),
16399            Self::Automated => std::option::Option::Some(1),
16400            Self::OnDemand => std::option::Option::Some(2),
16401            Self::UnknownValue(u) => u.0.value(),
16402        }
16403    }
16404
16405    /// Gets the enum value as a string.
16406    ///
16407    /// Returns `None` if the enum contains an unknown value deserialized from
16408    /// the integer representation of enums.
16409    pub fn name(&self) -> std::option::Option<&str> {
16410        match self {
16411            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
16412            Self::Automated => std::option::Option::Some("AUTOMATED"),
16413            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
16414            Self::UnknownValue(u) => u.0.name(),
16415        }
16416    }
16417}
16418
16419impl std::default::Default for SqlBackupRunType {
16420    fn default() -> Self {
16421        use std::convert::From;
16422        Self::from(0)
16423    }
16424}
16425
16426impl std::fmt::Display for SqlBackupRunType {
16427    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16428        wkt::internal::display_enum(f, self.name(), self.value())
16429    }
16430}
16431
16432impl std::convert::From<i32> for SqlBackupRunType {
16433    fn from(value: i32) -> Self {
16434        match value {
16435            0 => Self::Unspecified,
16436            1 => Self::Automated,
16437            2 => Self::OnDemand,
16438            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16439                wkt::internal::UnknownEnumValue::Integer(value),
16440            )),
16441        }
16442    }
16443}
16444
16445impl std::convert::From<&str> for SqlBackupRunType {
16446    fn from(value: &str) -> Self {
16447        use std::string::ToString;
16448        match value {
16449            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
16450            "AUTOMATED" => Self::Automated,
16451            "ON_DEMAND" => Self::OnDemand,
16452            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16453                wkt::internal::UnknownEnumValue::String(value.to_string()),
16454            )),
16455        }
16456    }
16457}
16458
16459impl serde::ser::Serialize for SqlBackupRunType {
16460    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16461    where
16462        S: serde::Serializer,
16463    {
16464        match self {
16465            Self::Unspecified => serializer.serialize_i32(0),
16466            Self::Automated => serializer.serialize_i32(1),
16467            Self::OnDemand => serializer.serialize_i32(2),
16468            Self::UnknownValue(u) => u.0.serialize(serializer),
16469        }
16470    }
16471}
16472
16473impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
16474    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16475    where
16476        D: serde::Deserializer<'de>,
16477    {
16478        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
16479            ".google.cloud.sql.v1.SqlBackupRunType",
16480        ))
16481    }
16482}
16483
16484///
16485/// # Working with unknown values
16486///
16487/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16488/// additional enum variants at any time. Adding new variants is not considered
16489/// a breaking change. Applications should write their code in anticipation of:
16490///
16491/// - New values appearing in future releases of the client library, **and**
16492/// - New values received dynamically, without application changes.
16493///
16494/// Please consult the [Working with enums] section in the user guide for some
16495/// guidelines.
16496///
16497/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16498#[derive(Clone, Debug, PartialEq)]
16499#[non_exhaustive]
16500pub enum SqlFlagType {
16501    /// This is an unknown flag type.
16502    Unspecified,
16503    /// Boolean type flag.
16504    Boolean,
16505    /// String type flag.
16506    String,
16507    /// Integer type flag.
16508    Integer,
16509    /// Flag type used for a server startup option.
16510    None,
16511    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
16512    /// with the format [-12:59, 13:00].
16513    MysqlTimezoneOffset,
16514    /// Float type flag.
16515    Float,
16516    /// Comma-separated list of the strings in a SqlFlagType enum.
16517    RepeatedString,
16518    /// If set, the enum was initialized with an unknown value.
16519    ///
16520    /// Applications can examine the value using [SqlFlagType::value] or
16521    /// [SqlFlagType::name].
16522    UnknownValue(sql_flag_type::UnknownValue),
16523}
16524
16525#[doc(hidden)]
16526pub mod sql_flag_type {
16527    #[allow(unused_imports)]
16528    use super::*;
16529    #[derive(Clone, Debug, PartialEq)]
16530    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16531}
16532
16533impl SqlFlagType {
16534    /// Gets the enum value.
16535    ///
16536    /// Returns `None` if the enum contains an unknown value deserialized from
16537    /// the string representation of enums.
16538    pub fn value(&self) -> std::option::Option<i32> {
16539        match self {
16540            Self::Unspecified => std::option::Option::Some(0),
16541            Self::Boolean => std::option::Option::Some(1),
16542            Self::String => std::option::Option::Some(2),
16543            Self::Integer => std::option::Option::Some(3),
16544            Self::None => std::option::Option::Some(4),
16545            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
16546            Self::Float => std::option::Option::Some(6),
16547            Self::RepeatedString => std::option::Option::Some(7),
16548            Self::UnknownValue(u) => u.0.value(),
16549        }
16550    }
16551
16552    /// Gets the enum value as a string.
16553    ///
16554    /// Returns `None` if the enum contains an unknown value deserialized from
16555    /// the integer representation of enums.
16556    pub fn name(&self) -> std::option::Option<&str> {
16557        match self {
16558            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
16559            Self::Boolean => std::option::Option::Some("BOOLEAN"),
16560            Self::String => std::option::Option::Some("STRING"),
16561            Self::Integer => std::option::Option::Some("INTEGER"),
16562            Self::None => std::option::Option::Some("NONE"),
16563            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
16564            Self::Float => std::option::Option::Some("FLOAT"),
16565            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
16566            Self::UnknownValue(u) => u.0.name(),
16567        }
16568    }
16569}
16570
16571impl std::default::Default for SqlFlagType {
16572    fn default() -> Self {
16573        use std::convert::From;
16574        Self::from(0)
16575    }
16576}
16577
16578impl std::fmt::Display for SqlFlagType {
16579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16580        wkt::internal::display_enum(f, self.name(), self.value())
16581    }
16582}
16583
16584impl std::convert::From<i32> for SqlFlagType {
16585    fn from(value: i32) -> Self {
16586        match value {
16587            0 => Self::Unspecified,
16588            1 => Self::Boolean,
16589            2 => Self::String,
16590            3 => Self::Integer,
16591            4 => Self::None,
16592            5 => Self::MysqlTimezoneOffset,
16593            6 => Self::Float,
16594            7 => Self::RepeatedString,
16595            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
16596                wkt::internal::UnknownEnumValue::Integer(value),
16597            )),
16598        }
16599    }
16600}
16601
16602impl std::convert::From<&str> for SqlFlagType {
16603    fn from(value: &str) -> Self {
16604        use std::string::ToString;
16605        match value {
16606            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
16607            "BOOLEAN" => Self::Boolean,
16608            "STRING" => Self::String,
16609            "INTEGER" => Self::Integer,
16610            "NONE" => Self::None,
16611            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
16612            "FLOAT" => Self::Float,
16613            "REPEATED_STRING" => Self::RepeatedString,
16614            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
16615                wkt::internal::UnknownEnumValue::String(value.to_string()),
16616            )),
16617        }
16618    }
16619}
16620
16621impl serde::ser::Serialize for SqlFlagType {
16622    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16623    where
16624        S: serde::Serializer,
16625    {
16626        match self {
16627            Self::Unspecified => serializer.serialize_i32(0),
16628            Self::Boolean => serializer.serialize_i32(1),
16629            Self::String => serializer.serialize_i32(2),
16630            Self::Integer => serializer.serialize_i32(3),
16631            Self::None => serializer.serialize_i32(4),
16632            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
16633            Self::Float => serializer.serialize_i32(6),
16634            Self::RepeatedString => serializer.serialize_i32(7),
16635            Self::UnknownValue(u) => u.0.serialize(serializer),
16636        }
16637    }
16638}
16639
16640impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
16641    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16642    where
16643        D: serde::Deserializer<'de>,
16644    {
16645        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
16646            ".google.cloud.sql.v1.SqlFlagType",
16647        ))
16648    }
16649}
16650
16651/// External Sync parallel level.
16652///
16653/// # Working with unknown values
16654///
16655/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16656/// additional enum variants at any time. Adding new variants is not considered
16657/// a breaking change. Applications should write their code in anticipation of:
16658///
16659/// - New values appearing in future releases of the client library, **and**
16660/// - New values received dynamically, without application changes.
16661///
16662/// Please consult the [Working with enums] section in the user guide for some
16663/// guidelines.
16664///
16665/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16666#[derive(Clone, Debug, PartialEq)]
16667#[non_exhaustive]
16668pub enum ExternalSyncParallelLevel {
16669    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
16670    Unspecified,
16671    /// Minimal parallel level.
16672    Min,
16673    /// Optimal parallel level.
16674    Optimal,
16675    /// Maximum parallel level.
16676    Max,
16677    /// If set, the enum was initialized with an unknown value.
16678    ///
16679    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
16680    /// [ExternalSyncParallelLevel::name].
16681    UnknownValue(external_sync_parallel_level::UnknownValue),
16682}
16683
16684#[doc(hidden)]
16685pub mod external_sync_parallel_level {
16686    #[allow(unused_imports)]
16687    use super::*;
16688    #[derive(Clone, Debug, PartialEq)]
16689    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16690}
16691
16692impl ExternalSyncParallelLevel {
16693    /// Gets the enum value.
16694    ///
16695    /// Returns `None` if the enum contains an unknown value deserialized from
16696    /// the string representation of enums.
16697    pub fn value(&self) -> std::option::Option<i32> {
16698        match self {
16699            Self::Unspecified => std::option::Option::Some(0),
16700            Self::Min => std::option::Option::Some(1),
16701            Self::Optimal => std::option::Option::Some(2),
16702            Self::Max => std::option::Option::Some(3),
16703            Self::UnknownValue(u) => u.0.value(),
16704        }
16705    }
16706
16707    /// Gets the enum value as a string.
16708    ///
16709    /// Returns `None` if the enum contains an unknown value deserialized from
16710    /// the integer representation of enums.
16711    pub fn name(&self) -> std::option::Option<&str> {
16712        match self {
16713            Self::Unspecified => {
16714                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
16715            }
16716            Self::Min => std::option::Option::Some("MIN"),
16717            Self::Optimal => std::option::Option::Some("OPTIMAL"),
16718            Self::Max => std::option::Option::Some("MAX"),
16719            Self::UnknownValue(u) => u.0.name(),
16720        }
16721    }
16722}
16723
16724impl std::default::Default for ExternalSyncParallelLevel {
16725    fn default() -> Self {
16726        use std::convert::From;
16727        Self::from(0)
16728    }
16729}
16730
16731impl std::fmt::Display for ExternalSyncParallelLevel {
16732    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16733        wkt::internal::display_enum(f, self.name(), self.value())
16734    }
16735}
16736
16737impl std::convert::From<i32> for ExternalSyncParallelLevel {
16738    fn from(value: i32) -> Self {
16739        match value {
16740            0 => Self::Unspecified,
16741            1 => Self::Min,
16742            2 => Self::Optimal,
16743            3 => Self::Max,
16744            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
16745                wkt::internal::UnknownEnumValue::Integer(value),
16746            )),
16747        }
16748    }
16749}
16750
16751impl std::convert::From<&str> for ExternalSyncParallelLevel {
16752    fn from(value: &str) -> Self {
16753        use std::string::ToString;
16754        match value {
16755            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
16756            "MIN" => Self::Min,
16757            "OPTIMAL" => Self::Optimal,
16758            "MAX" => Self::Max,
16759            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
16760                wkt::internal::UnknownEnumValue::String(value.to_string()),
16761            )),
16762        }
16763    }
16764}
16765
16766impl serde::ser::Serialize for ExternalSyncParallelLevel {
16767    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16768    where
16769        S: serde::Serializer,
16770    {
16771        match self {
16772            Self::Unspecified => serializer.serialize_i32(0),
16773            Self::Min => serializer.serialize_i32(1),
16774            Self::Optimal => serializer.serialize_i32(2),
16775            Self::Max => serializer.serialize_i32(3),
16776            Self::UnknownValue(u) => u.0.serialize(serializer),
16777        }
16778    }
16779}
16780
16781impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
16782    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16783    where
16784        D: serde::Deserializer<'de>,
16785    {
16786        deserializer.deserialize_any(
16787            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
16788                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
16789            ),
16790        )
16791    }
16792}
16793
16794///
16795/// # Working with unknown values
16796///
16797/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16798/// additional enum variants at any time. Adding new variants is not considered
16799/// a breaking change. Applications should write their code in anticipation of:
16800///
16801/// - New values appearing in future releases of the client library, **and**
16802/// - New values received dynamically, without application changes.
16803///
16804/// Please consult the [Working with enums] section in the user guide for some
16805/// guidelines.
16806///
16807/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16808#[derive(Clone, Debug, PartialEq)]
16809#[non_exhaustive]
16810pub enum SqlInstanceType {
16811    /// This is an unknown Cloud SQL instance type.
16812    Unspecified,
16813    /// A regular Cloud SQL instance that is not replicating from a primary
16814    /// instance.
16815    CloudSqlInstance,
16816    /// An instance running on the customer's premises that is not managed by
16817    /// Cloud SQL.
16818    OnPremisesInstance,
16819    /// A Cloud SQL instance acting as a read-replica.
16820    ReadReplicaInstance,
16821    /// If set, the enum was initialized with an unknown value.
16822    ///
16823    /// Applications can examine the value using [SqlInstanceType::value] or
16824    /// [SqlInstanceType::name].
16825    UnknownValue(sql_instance_type::UnknownValue),
16826}
16827
16828#[doc(hidden)]
16829pub mod sql_instance_type {
16830    #[allow(unused_imports)]
16831    use super::*;
16832    #[derive(Clone, Debug, PartialEq)]
16833    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16834}
16835
16836impl SqlInstanceType {
16837    /// Gets the enum value.
16838    ///
16839    /// Returns `None` if the enum contains an unknown value deserialized from
16840    /// the string representation of enums.
16841    pub fn value(&self) -> std::option::Option<i32> {
16842        match self {
16843            Self::Unspecified => std::option::Option::Some(0),
16844            Self::CloudSqlInstance => std::option::Option::Some(1),
16845            Self::OnPremisesInstance => std::option::Option::Some(2),
16846            Self::ReadReplicaInstance => std::option::Option::Some(3),
16847            Self::UnknownValue(u) => u.0.value(),
16848        }
16849    }
16850
16851    /// Gets the enum value as a string.
16852    ///
16853    /// Returns `None` if the enum contains an unknown value deserialized from
16854    /// the integer representation of enums.
16855    pub fn name(&self) -> std::option::Option<&str> {
16856        match self {
16857            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
16858            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
16859            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
16860            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
16861            Self::UnknownValue(u) => u.0.name(),
16862        }
16863    }
16864}
16865
16866impl std::default::Default for SqlInstanceType {
16867    fn default() -> Self {
16868        use std::convert::From;
16869        Self::from(0)
16870    }
16871}
16872
16873impl std::fmt::Display for SqlInstanceType {
16874    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16875        wkt::internal::display_enum(f, self.name(), self.value())
16876    }
16877}
16878
16879impl std::convert::From<i32> for SqlInstanceType {
16880    fn from(value: i32) -> Self {
16881        match value {
16882            0 => Self::Unspecified,
16883            1 => Self::CloudSqlInstance,
16884            2 => Self::OnPremisesInstance,
16885            3 => Self::ReadReplicaInstance,
16886            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
16887                wkt::internal::UnknownEnumValue::Integer(value),
16888            )),
16889        }
16890    }
16891}
16892
16893impl std::convert::From<&str> for SqlInstanceType {
16894    fn from(value: &str) -> Self {
16895        use std::string::ToString;
16896        match value {
16897            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
16898            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
16899            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
16900            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
16901            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
16902                wkt::internal::UnknownEnumValue::String(value.to_string()),
16903            )),
16904        }
16905    }
16906}
16907
16908impl serde::ser::Serialize for SqlInstanceType {
16909    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16910    where
16911        S: serde::Serializer,
16912    {
16913        match self {
16914            Self::Unspecified => serializer.serialize_i32(0),
16915            Self::CloudSqlInstance => serializer.serialize_i32(1),
16916            Self::OnPremisesInstance => serializer.serialize_i32(2),
16917            Self::ReadReplicaInstance => serializer.serialize_i32(3),
16918            Self::UnknownValue(u) => u.0.serialize(serializer),
16919        }
16920    }
16921}
16922
16923impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
16924    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16925    where
16926        D: serde::Deserializer<'de>,
16927    {
16928        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
16929            ".google.cloud.sql.v1.SqlInstanceType",
16930        ))
16931    }
16932}
16933
16934/// The suspension reason of the database instance if the state is SUSPENDED.
16935///
16936/// # Working with unknown values
16937///
16938/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16939/// additional enum variants at any time. Adding new variants is not considered
16940/// a breaking change. Applications should write their code in anticipation of:
16941///
16942/// - New values appearing in future releases of the client library, **and**
16943/// - New values received dynamically, without application changes.
16944///
16945/// Please consult the [Working with enums] section in the user guide for some
16946/// guidelines.
16947///
16948/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16949#[derive(Clone, Debug, PartialEq)]
16950#[non_exhaustive]
16951pub enum SqlSuspensionReason {
16952    /// This is an unknown suspension reason.
16953    Unspecified,
16954    /// The instance is suspended due to billing issues (for example:, GCP account
16955    /// issue)
16956    BillingIssue,
16957    /// The instance is suspended due to illegal content (for example:, child
16958    /// pornography, copyrighted material, etc.).
16959    LegalIssue,
16960    /// The instance is causing operational issues (for example:, causing the
16961    /// database to crash).
16962    OperationalIssue,
16963    /// The KMS key used by the instance is either revoked or denied access to
16964    KmsKeyIssue,
16965    /// If set, the enum was initialized with an unknown value.
16966    ///
16967    /// Applications can examine the value using [SqlSuspensionReason::value] or
16968    /// [SqlSuspensionReason::name].
16969    UnknownValue(sql_suspension_reason::UnknownValue),
16970}
16971
16972#[doc(hidden)]
16973pub mod sql_suspension_reason {
16974    #[allow(unused_imports)]
16975    use super::*;
16976    #[derive(Clone, Debug, PartialEq)]
16977    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16978}
16979
16980impl SqlSuspensionReason {
16981    /// Gets the enum value.
16982    ///
16983    /// Returns `None` if the enum contains an unknown value deserialized from
16984    /// the string representation of enums.
16985    pub fn value(&self) -> std::option::Option<i32> {
16986        match self {
16987            Self::Unspecified => std::option::Option::Some(0),
16988            Self::BillingIssue => std::option::Option::Some(2),
16989            Self::LegalIssue => std::option::Option::Some(3),
16990            Self::OperationalIssue => std::option::Option::Some(4),
16991            Self::KmsKeyIssue => std::option::Option::Some(5),
16992            Self::UnknownValue(u) => u.0.value(),
16993        }
16994    }
16995
16996    /// Gets the enum value as a string.
16997    ///
16998    /// Returns `None` if the enum contains an unknown value deserialized from
16999    /// the integer representation of enums.
17000    pub fn name(&self) -> std::option::Option<&str> {
17001        match self {
17002            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
17003            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
17004            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
17005            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
17006            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
17007            Self::UnknownValue(u) => u.0.name(),
17008        }
17009    }
17010}
17011
17012impl std::default::Default for SqlSuspensionReason {
17013    fn default() -> Self {
17014        use std::convert::From;
17015        Self::from(0)
17016    }
17017}
17018
17019impl std::fmt::Display for SqlSuspensionReason {
17020    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17021        wkt::internal::display_enum(f, self.name(), self.value())
17022    }
17023}
17024
17025impl std::convert::From<i32> for SqlSuspensionReason {
17026    fn from(value: i32) -> Self {
17027        match value {
17028            0 => Self::Unspecified,
17029            2 => Self::BillingIssue,
17030            3 => Self::LegalIssue,
17031            4 => Self::OperationalIssue,
17032            5 => Self::KmsKeyIssue,
17033            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17034                wkt::internal::UnknownEnumValue::Integer(value),
17035            )),
17036        }
17037    }
17038}
17039
17040impl std::convert::From<&str> for SqlSuspensionReason {
17041    fn from(value: &str) -> Self {
17042        use std::string::ToString;
17043        match value {
17044            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
17045            "BILLING_ISSUE" => Self::BillingIssue,
17046            "LEGAL_ISSUE" => Self::LegalIssue,
17047            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
17048            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
17049            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17050                wkt::internal::UnknownEnumValue::String(value.to_string()),
17051            )),
17052        }
17053    }
17054}
17055
17056impl serde::ser::Serialize for SqlSuspensionReason {
17057    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17058    where
17059        S: serde::Serializer,
17060    {
17061        match self {
17062            Self::Unspecified => serializer.serialize_i32(0),
17063            Self::BillingIssue => serializer.serialize_i32(2),
17064            Self::LegalIssue => serializer.serialize_i32(3),
17065            Self::OperationalIssue => serializer.serialize_i32(4),
17066            Self::KmsKeyIssue => serializer.serialize_i32(5),
17067            Self::UnknownValue(u) => u.0.serialize(serializer),
17068        }
17069    }
17070}
17071
17072impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
17073    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17074    where
17075        D: serde::Deserializer<'de>,
17076    {
17077        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
17078            ".google.cloud.sql.v1.SqlSuspensionReason",
17079        ))
17080    }
17081}
17082
17083///
17084/// # Working with unknown values
17085///
17086/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17087/// additional enum variants at any time. Adding new variants is not considered
17088/// a breaking change. Applications should write their code in anticipation of:
17089///
17090/// - New values appearing in future releases of the client library, **and**
17091/// - New values received dynamically, without application changes.
17092///
17093/// Please consult the [Working with enums] section in the user guide for some
17094/// guidelines.
17095///
17096/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17097#[derive(Clone, Debug, PartialEq)]
17098#[non_exhaustive]
17099pub enum SqlFileType {
17100    /// Unknown file type.
17101    Unspecified,
17102    /// File containing SQL statements.
17103    Sql,
17104    /// File in CSV format.
17105    Csv,
17106    Bak,
17107    /// If set, the enum was initialized with an unknown value.
17108    ///
17109    /// Applications can examine the value using [SqlFileType::value] or
17110    /// [SqlFileType::name].
17111    UnknownValue(sql_file_type::UnknownValue),
17112}
17113
17114#[doc(hidden)]
17115pub mod sql_file_type {
17116    #[allow(unused_imports)]
17117    use super::*;
17118    #[derive(Clone, Debug, PartialEq)]
17119    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17120}
17121
17122impl SqlFileType {
17123    /// Gets the enum value.
17124    ///
17125    /// Returns `None` if the enum contains an unknown value deserialized from
17126    /// the string representation of enums.
17127    pub fn value(&self) -> std::option::Option<i32> {
17128        match self {
17129            Self::Unspecified => std::option::Option::Some(0),
17130            Self::Sql => std::option::Option::Some(1),
17131            Self::Csv => std::option::Option::Some(2),
17132            Self::Bak => std::option::Option::Some(4),
17133            Self::UnknownValue(u) => u.0.value(),
17134        }
17135    }
17136
17137    /// Gets the enum value as a string.
17138    ///
17139    /// Returns `None` if the enum contains an unknown value deserialized from
17140    /// the integer representation of enums.
17141    pub fn name(&self) -> std::option::Option<&str> {
17142        match self {
17143            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
17144            Self::Sql => std::option::Option::Some("SQL"),
17145            Self::Csv => std::option::Option::Some("CSV"),
17146            Self::Bak => std::option::Option::Some("BAK"),
17147            Self::UnknownValue(u) => u.0.name(),
17148        }
17149    }
17150}
17151
17152impl std::default::Default for SqlFileType {
17153    fn default() -> Self {
17154        use std::convert::From;
17155        Self::from(0)
17156    }
17157}
17158
17159impl std::fmt::Display for SqlFileType {
17160    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17161        wkt::internal::display_enum(f, self.name(), self.value())
17162    }
17163}
17164
17165impl std::convert::From<i32> for SqlFileType {
17166    fn from(value: i32) -> Self {
17167        match value {
17168            0 => Self::Unspecified,
17169            1 => Self::Sql,
17170            2 => Self::Csv,
17171            4 => Self::Bak,
17172            _ => Self::UnknownValue(sql_file_type::UnknownValue(
17173                wkt::internal::UnknownEnumValue::Integer(value),
17174            )),
17175        }
17176    }
17177}
17178
17179impl std::convert::From<&str> for SqlFileType {
17180    fn from(value: &str) -> Self {
17181        use std::string::ToString;
17182        match value {
17183            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
17184            "SQL" => Self::Sql,
17185            "CSV" => Self::Csv,
17186            "BAK" => Self::Bak,
17187            _ => Self::UnknownValue(sql_file_type::UnknownValue(
17188                wkt::internal::UnknownEnumValue::String(value.to_string()),
17189            )),
17190        }
17191    }
17192}
17193
17194impl serde::ser::Serialize for SqlFileType {
17195    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17196    where
17197        S: serde::Serializer,
17198    {
17199        match self {
17200            Self::Unspecified => serializer.serialize_i32(0),
17201            Self::Sql => serializer.serialize_i32(1),
17202            Self::Csv => serializer.serialize_i32(2),
17203            Self::Bak => serializer.serialize_i32(4),
17204            Self::UnknownValue(u) => u.0.serialize(serializer),
17205        }
17206    }
17207}
17208
17209impl<'de> serde::de::Deserialize<'de> for SqlFileType {
17210    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17211    where
17212        D: serde::Deserializer<'de>,
17213    {
17214        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
17215            ".google.cloud.sql.v1.SqlFileType",
17216        ))
17217    }
17218}
17219
17220///
17221/// # Working with unknown values
17222///
17223/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17224/// additional enum variants at any time. Adding new variants is not considered
17225/// a breaking change. Applications should write their code in anticipation of:
17226///
17227/// - New values appearing in future releases of the client library, **and**
17228/// - New values received dynamically, without application changes.
17229///
17230/// Please consult the [Working with enums] section in the user guide for some
17231/// guidelines.
17232///
17233/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17234#[derive(Clone, Debug, PartialEq)]
17235#[non_exhaustive]
17236pub enum BakType {
17237    /// Default type.
17238    Unspecified,
17239    /// Full backup.
17240    Full,
17241    /// Differential backup.
17242    Diff,
17243    /// Transaction Log backup
17244    Tlog,
17245    /// If set, the enum was initialized with an unknown value.
17246    ///
17247    /// Applications can examine the value using [BakType::value] or
17248    /// [BakType::name].
17249    UnknownValue(bak_type::UnknownValue),
17250}
17251
17252#[doc(hidden)]
17253pub mod bak_type {
17254    #[allow(unused_imports)]
17255    use super::*;
17256    #[derive(Clone, Debug, PartialEq)]
17257    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17258}
17259
17260impl BakType {
17261    /// Gets the enum value.
17262    ///
17263    /// Returns `None` if the enum contains an unknown value deserialized from
17264    /// the string representation of enums.
17265    pub fn value(&self) -> std::option::Option<i32> {
17266        match self {
17267            Self::Unspecified => std::option::Option::Some(0),
17268            Self::Full => std::option::Option::Some(1),
17269            Self::Diff => std::option::Option::Some(2),
17270            Self::Tlog => std::option::Option::Some(3),
17271            Self::UnknownValue(u) => u.0.value(),
17272        }
17273    }
17274
17275    /// Gets the enum value as a string.
17276    ///
17277    /// Returns `None` if the enum contains an unknown value deserialized from
17278    /// the integer representation of enums.
17279    pub fn name(&self) -> std::option::Option<&str> {
17280        match self {
17281            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
17282            Self::Full => std::option::Option::Some("FULL"),
17283            Self::Diff => std::option::Option::Some("DIFF"),
17284            Self::Tlog => std::option::Option::Some("TLOG"),
17285            Self::UnknownValue(u) => u.0.name(),
17286        }
17287    }
17288}
17289
17290impl std::default::Default for BakType {
17291    fn default() -> Self {
17292        use std::convert::From;
17293        Self::from(0)
17294    }
17295}
17296
17297impl std::fmt::Display for BakType {
17298    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17299        wkt::internal::display_enum(f, self.name(), self.value())
17300    }
17301}
17302
17303impl std::convert::From<i32> for BakType {
17304    fn from(value: i32) -> Self {
17305        match value {
17306            0 => Self::Unspecified,
17307            1 => Self::Full,
17308            2 => Self::Diff,
17309            3 => Self::Tlog,
17310            _ => Self::UnknownValue(bak_type::UnknownValue(
17311                wkt::internal::UnknownEnumValue::Integer(value),
17312            )),
17313        }
17314    }
17315}
17316
17317impl std::convert::From<&str> for BakType {
17318    fn from(value: &str) -> Self {
17319        use std::string::ToString;
17320        match value {
17321            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
17322            "FULL" => Self::Full,
17323            "DIFF" => Self::Diff,
17324            "TLOG" => Self::Tlog,
17325            _ => Self::UnknownValue(bak_type::UnknownValue(
17326                wkt::internal::UnknownEnumValue::String(value.to_string()),
17327            )),
17328        }
17329    }
17330}
17331
17332impl serde::ser::Serialize for BakType {
17333    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17334    where
17335        S: serde::Serializer,
17336    {
17337        match self {
17338            Self::Unspecified => serializer.serialize_i32(0),
17339            Self::Full => serializer.serialize_i32(1),
17340            Self::Diff => serializer.serialize_i32(2),
17341            Self::Tlog => serializer.serialize_i32(3),
17342            Self::UnknownValue(u) => u.0.serialize(serializer),
17343        }
17344    }
17345}
17346
17347impl<'de> serde::de::Deserialize<'de> for BakType {
17348    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17349    where
17350        D: serde::Deserializer<'de>,
17351    {
17352        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
17353            ".google.cloud.sql.v1.BakType",
17354        ))
17355    }
17356}
17357
17358///
17359/// # Working with unknown values
17360///
17361/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17362/// additional enum variants at any time. Adding new variants is not considered
17363/// a breaking change. Applications should write their code in anticipation of:
17364///
17365/// - New values appearing in future releases of the client library, **and**
17366/// - New values received dynamically, without application changes.
17367///
17368/// Please consult the [Working with enums] section in the user guide for some
17369/// guidelines.
17370///
17371/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17372#[derive(Clone, Debug, PartialEq)]
17373#[non_exhaustive]
17374pub enum SqlBackendType {
17375    /// This is an unknown backend type for instance.
17376    Unspecified,
17377    /// V1 speckle instance.
17378    #[deprecated]
17379    FirstGen,
17380    /// V2 speckle instance.
17381    SecondGen,
17382    /// On premises instance.
17383    External,
17384    /// If set, the enum was initialized with an unknown value.
17385    ///
17386    /// Applications can examine the value using [SqlBackendType::value] or
17387    /// [SqlBackendType::name].
17388    UnknownValue(sql_backend_type::UnknownValue),
17389}
17390
17391#[doc(hidden)]
17392pub mod sql_backend_type {
17393    #[allow(unused_imports)]
17394    use super::*;
17395    #[derive(Clone, Debug, PartialEq)]
17396    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17397}
17398
17399impl SqlBackendType {
17400    /// Gets the enum value.
17401    ///
17402    /// Returns `None` if the enum contains an unknown value deserialized from
17403    /// the string representation of enums.
17404    pub fn value(&self) -> std::option::Option<i32> {
17405        match self {
17406            Self::Unspecified => std::option::Option::Some(0),
17407            Self::FirstGen => std::option::Option::Some(1),
17408            Self::SecondGen => std::option::Option::Some(2),
17409            Self::External => std::option::Option::Some(3),
17410            Self::UnknownValue(u) => u.0.value(),
17411        }
17412    }
17413
17414    /// Gets the enum value as a string.
17415    ///
17416    /// Returns `None` if the enum contains an unknown value deserialized from
17417    /// the integer representation of enums.
17418    pub fn name(&self) -> std::option::Option<&str> {
17419        match self {
17420            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
17421            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
17422            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
17423            Self::External => std::option::Option::Some("EXTERNAL"),
17424            Self::UnknownValue(u) => u.0.name(),
17425        }
17426    }
17427}
17428
17429impl std::default::Default for SqlBackendType {
17430    fn default() -> Self {
17431        use std::convert::From;
17432        Self::from(0)
17433    }
17434}
17435
17436impl std::fmt::Display for SqlBackendType {
17437    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17438        wkt::internal::display_enum(f, self.name(), self.value())
17439    }
17440}
17441
17442impl std::convert::From<i32> for SqlBackendType {
17443    fn from(value: i32) -> Self {
17444        match value {
17445            0 => Self::Unspecified,
17446            1 => Self::FirstGen,
17447            2 => Self::SecondGen,
17448            3 => Self::External,
17449            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
17450                wkt::internal::UnknownEnumValue::Integer(value),
17451            )),
17452        }
17453    }
17454}
17455
17456impl std::convert::From<&str> for SqlBackendType {
17457    fn from(value: &str) -> Self {
17458        use std::string::ToString;
17459        match value {
17460            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
17461            "FIRST_GEN" => Self::FirstGen,
17462            "SECOND_GEN" => Self::SecondGen,
17463            "EXTERNAL" => Self::External,
17464            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
17465                wkt::internal::UnknownEnumValue::String(value.to_string()),
17466            )),
17467        }
17468    }
17469}
17470
17471impl serde::ser::Serialize for SqlBackendType {
17472    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17473    where
17474        S: serde::Serializer,
17475    {
17476        match self {
17477            Self::Unspecified => serializer.serialize_i32(0),
17478            Self::FirstGen => serializer.serialize_i32(1),
17479            Self::SecondGen => serializer.serialize_i32(2),
17480            Self::External => serializer.serialize_i32(3),
17481            Self::UnknownValue(u) => u.0.serialize(serializer),
17482        }
17483    }
17484}
17485
17486impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
17487    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17488    where
17489        D: serde::Deserializer<'de>,
17490    {
17491        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
17492            ".google.cloud.sql.v1.SqlBackendType",
17493        ))
17494    }
17495}
17496
17497///
17498/// # Working with unknown values
17499///
17500/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17501/// additional enum variants at any time. Adding new variants is not considered
17502/// a breaking change. Applications should write their code in anticipation of:
17503///
17504/// - New values appearing in future releases of the client library, **and**
17505/// - New values received dynamically, without application changes.
17506///
17507/// Please consult the [Working with enums] section in the user guide for some
17508/// guidelines.
17509///
17510/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17511#[derive(Clone, Debug, PartialEq)]
17512#[non_exhaustive]
17513pub enum SqlIpAddressType {
17514    /// This is an unknown IP address type.
17515    Unspecified,
17516    /// IP address the customer is supposed to connect to. Usually this is the
17517    /// load balancer's IP address
17518    Primary,
17519    /// Source IP address of the connection a read replica establishes to its
17520    /// external primary instance. This IP address can be allowlisted by the
17521    /// customer in case it has a firewall that filters incoming connection to its
17522    /// on premises primary instance.
17523    Outgoing,
17524    /// Private IP used when using private IPs and network peering.
17525    Private,
17526    /// V1 IP of a migrated instance. We want the user to
17527    /// decommission this IP as soon as the migration is complete.
17528    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
17529    Migrated1StGen,
17530    /// If set, the enum was initialized with an unknown value.
17531    ///
17532    /// Applications can examine the value using [SqlIpAddressType::value] or
17533    /// [SqlIpAddressType::name].
17534    UnknownValue(sql_ip_address_type::UnknownValue),
17535}
17536
17537#[doc(hidden)]
17538pub mod sql_ip_address_type {
17539    #[allow(unused_imports)]
17540    use super::*;
17541    #[derive(Clone, Debug, PartialEq)]
17542    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17543}
17544
17545impl SqlIpAddressType {
17546    /// Gets the enum value.
17547    ///
17548    /// Returns `None` if the enum contains an unknown value deserialized from
17549    /// the string representation of enums.
17550    pub fn value(&self) -> std::option::Option<i32> {
17551        match self {
17552            Self::Unspecified => std::option::Option::Some(0),
17553            Self::Primary => std::option::Option::Some(1),
17554            Self::Outgoing => std::option::Option::Some(2),
17555            Self::Private => std::option::Option::Some(3),
17556            Self::Migrated1StGen => std::option::Option::Some(4),
17557            Self::UnknownValue(u) => u.0.value(),
17558        }
17559    }
17560
17561    /// Gets the enum value as a string.
17562    ///
17563    /// Returns `None` if the enum contains an unknown value deserialized from
17564    /// the integer representation of enums.
17565    pub fn name(&self) -> std::option::Option<&str> {
17566        match self {
17567            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
17568            Self::Primary => std::option::Option::Some("PRIMARY"),
17569            Self::Outgoing => std::option::Option::Some("OUTGOING"),
17570            Self::Private => std::option::Option::Some("PRIVATE"),
17571            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
17572            Self::UnknownValue(u) => u.0.name(),
17573        }
17574    }
17575}
17576
17577impl std::default::Default for SqlIpAddressType {
17578    fn default() -> Self {
17579        use std::convert::From;
17580        Self::from(0)
17581    }
17582}
17583
17584impl std::fmt::Display for SqlIpAddressType {
17585    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17586        wkt::internal::display_enum(f, self.name(), self.value())
17587    }
17588}
17589
17590impl std::convert::From<i32> for SqlIpAddressType {
17591    fn from(value: i32) -> Self {
17592        match value {
17593            0 => Self::Unspecified,
17594            1 => Self::Primary,
17595            2 => Self::Outgoing,
17596            3 => Self::Private,
17597            4 => Self::Migrated1StGen,
17598            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
17599                wkt::internal::UnknownEnumValue::Integer(value),
17600            )),
17601        }
17602    }
17603}
17604
17605impl std::convert::From<&str> for SqlIpAddressType {
17606    fn from(value: &str) -> Self {
17607        use std::string::ToString;
17608        match value {
17609            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
17610            "PRIMARY" => Self::Primary,
17611            "OUTGOING" => Self::Outgoing,
17612            "PRIVATE" => Self::Private,
17613            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
17614            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
17615                wkt::internal::UnknownEnumValue::String(value.to_string()),
17616            )),
17617        }
17618    }
17619}
17620
17621impl serde::ser::Serialize for SqlIpAddressType {
17622    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17623    where
17624        S: serde::Serializer,
17625    {
17626        match self {
17627            Self::Unspecified => serializer.serialize_i32(0),
17628            Self::Primary => serializer.serialize_i32(1),
17629            Self::Outgoing => serializer.serialize_i32(2),
17630            Self::Private => serializer.serialize_i32(3),
17631            Self::Migrated1StGen => serializer.serialize_i32(4),
17632            Self::UnknownValue(u) => u.0.serialize(serializer),
17633        }
17634    }
17635}
17636
17637impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
17638    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17639    where
17640        D: serde::Deserializer<'de>,
17641    {
17642        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
17643            ".google.cloud.sql.v1.SqlIpAddressType",
17644        ))
17645    }
17646}
17647
17648/// The database engine type and version.
17649///
17650/// # Working with unknown values
17651///
17652/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17653/// additional enum variants at any time. Adding new variants is not considered
17654/// a breaking change. Applications should write their code in anticipation of:
17655///
17656/// - New values appearing in future releases of the client library, **and**
17657/// - New values received dynamically, without application changes.
17658///
17659/// Please consult the [Working with enums] section in the user guide for some
17660/// guidelines.
17661///
17662/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17663#[derive(Clone, Debug, PartialEq)]
17664#[non_exhaustive]
17665pub enum SqlDatabaseVersion {
17666    /// This is an unknown database version.
17667    Unspecified,
17668    /// The database version is MySQL 5.1.
17669    #[deprecated]
17670    Mysql51,
17671    /// The database version is MySQL 5.5.
17672    #[deprecated]
17673    Mysql55,
17674    /// The database version is MySQL 5.6.
17675    Mysql56,
17676    /// The database version is MySQL 5.7.
17677    Mysql57,
17678    /// The database version is SQL Server 2017 Standard.
17679    Sqlserver2017Standard,
17680    /// The database version is SQL Server 2017 Enterprise.
17681    Sqlserver2017Enterprise,
17682    /// The database version is SQL Server 2017 Express.
17683    Sqlserver2017Express,
17684    /// The database version is SQL Server 2017 Web.
17685    Sqlserver2017Web,
17686    /// The database version is PostgreSQL 9.6.
17687    Postgres96,
17688    /// The database version is PostgreSQL 10.
17689    Postgres10,
17690    /// The database version is PostgreSQL 11.
17691    Postgres11,
17692    /// The database version is PostgreSQL 12.
17693    Postgres12,
17694    /// The database version is PostgreSQL 13.
17695    Postgres13,
17696    /// The database version is PostgreSQL 14.
17697    Postgres14,
17698    /// The database version is PostgreSQL 15.
17699    Postgres15,
17700    /// The database version is PostgreSQL 16.
17701    Postgres16,
17702    /// The database version is MySQL 8.
17703    Mysql80,
17704    /// The database major version is MySQL 8.0 and the minor version is 18.
17705    Mysql8018,
17706    /// The database major version is MySQL 8.0 and the minor version is 26.
17707    Mysql8026,
17708    /// The database major version is MySQL 8.0 and the minor version is 27.
17709    Mysql8027,
17710    /// The database major version is MySQL 8.0 and the minor version is 28.
17711    Mysql8028,
17712    /// The database major version is MySQL 8.0 and the minor version is 29.
17713    #[deprecated]
17714    Mysql8029,
17715    /// The database major version is MySQL 8.0 and the minor version is 30.
17716    Mysql8030,
17717    /// The database major version is MySQL 8.0 and the minor version is 31.
17718    Mysql8031,
17719    /// The database major version is MySQL 8.0 and the minor version is 32.
17720    Mysql8032,
17721    /// The database major version is MySQL 8.0 and the minor version is 33.
17722    Mysql8033,
17723    /// The database major version is MySQL 8.0 and the minor version is 34.
17724    Mysql8034,
17725    /// The database major version is MySQL 8.0 and the minor version is 35.
17726    Mysql8035,
17727    /// The database major version is MySQL 8.0 and the minor version is 36.
17728    Mysql8036,
17729    /// The database major version is MySQL 8.0 and the minor version is 37.
17730    Mysql8037,
17731    /// The database major version is MySQL 8.0 and the minor version is 38.
17732    Mysql8038,
17733    /// The database major version is MySQL 8.0 and the minor version is 39.
17734    Mysql8039,
17735    /// The database major version is MySQL 8.0 and the minor version is 40.
17736    Mysql8040,
17737    /// The database version is MySQL 8.4.
17738    Mysql84,
17739    /// The database version is MySQL 8.4 and the patch version is 0.
17740    Mysql840,
17741    /// The database version is SQL Server 2019 Standard.
17742    Sqlserver2019Standard,
17743    /// The database version is SQL Server 2019 Enterprise.
17744    Sqlserver2019Enterprise,
17745    /// The database version is SQL Server 2019 Express.
17746    Sqlserver2019Express,
17747    /// The database version is SQL Server 2019 Web.
17748    Sqlserver2019Web,
17749    /// The database version is SQL Server 2022 Standard.
17750    Sqlserver2022Standard,
17751    /// The database version is SQL Server 2022 Enterprise.
17752    Sqlserver2022Enterprise,
17753    /// The database version is SQL Server 2022 Express.
17754    Sqlserver2022Express,
17755    /// The database version is SQL Server 2022 Web.
17756    Sqlserver2022Web,
17757    /// If set, the enum was initialized with an unknown value.
17758    ///
17759    /// Applications can examine the value using [SqlDatabaseVersion::value] or
17760    /// [SqlDatabaseVersion::name].
17761    UnknownValue(sql_database_version::UnknownValue),
17762}
17763
17764#[doc(hidden)]
17765pub mod sql_database_version {
17766    #[allow(unused_imports)]
17767    use super::*;
17768    #[derive(Clone, Debug, PartialEq)]
17769    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17770}
17771
17772impl SqlDatabaseVersion {
17773    /// Gets the enum value.
17774    ///
17775    /// Returns `None` if the enum contains an unknown value deserialized from
17776    /// the string representation of enums.
17777    pub fn value(&self) -> std::option::Option<i32> {
17778        match self {
17779            Self::Unspecified => std::option::Option::Some(0),
17780            Self::Mysql51 => std::option::Option::Some(2),
17781            Self::Mysql55 => std::option::Option::Some(3),
17782            Self::Mysql56 => std::option::Option::Some(5),
17783            Self::Mysql57 => std::option::Option::Some(6),
17784            Self::Sqlserver2017Standard => std::option::Option::Some(11),
17785            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
17786            Self::Sqlserver2017Express => std::option::Option::Some(15),
17787            Self::Sqlserver2017Web => std::option::Option::Some(16),
17788            Self::Postgres96 => std::option::Option::Some(9),
17789            Self::Postgres10 => std::option::Option::Some(18),
17790            Self::Postgres11 => std::option::Option::Some(10),
17791            Self::Postgres12 => std::option::Option::Some(19),
17792            Self::Postgres13 => std::option::Option::Some(23),
17793            Self::Postgres14 => std::option::Option::Some(110),
17794            Self::Postgres15 => std::option::Option::Some(172),
17795            Self::Postgres16 => std::option::Option::Some(272),
17796            Self::Mysql80 => std::option::Option::Some(20),
17797            Self::Mysql8018 => std::option::Option::Some(41),
17798            Self::Mysql8026 => std::option::Option::Some(85),
17799            Self::Mysql8027 => std::option::Option::Some(111),
17800            Self::Mysql8028 => std::option::Option::Some(132),
17801            Self::Mysql8029 => std::option::Option::Some(148),
17802            Self::Mysql8030 => std::option::Option::Some(174),
17803            Self::Mysql8031 => std::option::Option::Some(197),
17804            Self::Mysql8032 => std::option::Option::Some(213),
17805            Self::Mysql8033 => std::option::Option::Some(238),
17806            Self::Mysql8034 => std::option::Option::Some(239),
17807            Self::Mysql8035 => std::option::Option::Some(240),
17808            Self::Mysql8036 => std::option::Option::Some(241),
17809            Self::Mysql8037 => std::option::Option::Some(355),
17810            Self::Mysql8038 => std::option::Option::Some(356),
17811            Self::Mysql8039 => std::option::Option::Some(357),
17812            Self::Mysql8040 => std::option::Option::Some(358),
17813            Self::Mysql84 => std::option::Option::Some(398),
17814            Self::Mysql840 => std::option::Option::Some(399),
17815            Self::Sqlserver2019Standard => std::option::Option::Some(26),
17816            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
17817            Self::Sqlserver2019Express => std::option::Option::Some(28),
17818            Self::Sqlserver2019Web => std::option::Option::Some(29),
17819            Self::Sqlserver2022Standard => std::option::Option::Some(199),
17820            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
17821            Self::Sqlserver2022Express => std::option::Option::Some(201),
17822            Self::Sqlserver2022Web => std::option::Option::Some(202),
17823            Self::UnknownValue(u) => u.0.value(),
17824        }
17825    }
17826
17827    /// Gets the enum value as a string.
17828    ///
17829    /// Returns `None` if the enum contains an unknown value deserialized from
17830    /// the integer representation of enums.
17831    pub fn name(&self) -> std::option::Option<&str> {
17832        match self {
17833            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
17834            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
17835            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
17836            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
17837            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
17838            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
17839            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
17840            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
17841            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
17842            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
17843            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
17844            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
17845            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
17846            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
17847            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
17848            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
17849            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
17850            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
17851            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
17852            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
17853            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
17854            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
17855            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
17856            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
17857            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
17858            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
17859            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
17860            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
17861            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
17862            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
17863            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
17864            Self::Mysql8038 => std::option::Option::Some("MYSQL_8_0_38"),
17865            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
17866            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
17867            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
17868            Self::Mysql840 => std::option::Option::Some("MYSQL_8_4_0"),
17869            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
17870            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
17871            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
17872            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
17873            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
17874            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
17875            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
17876            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
17877            Self::UnknownValue(u) => u.0.name(),
17878        }
17879    }
17880}
17881
17882impl std::default::Default for SqlDatabaseVersion {
17883    fn default() -> Self {
17884        use std::convert::From;
17885        Self::from(0)
17886    }
17887}
17888
17889impl std::fmt::Display for SqlDatabaseVersion {
17890    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17891        wkt::internal::display_enum(f, self.name(), self.value())
17892    }
17893}
17894
17895impl std::convert::From<i32> for SqlDatabaseVersion {
17896    fn from(value: i32) -> Self {
17897        match value {
17898            0 => Self::Unspecified,
17899            2 => Self::Mysql51,
17900            3 => Self::Mysql55,
17901            5 => Self::Mysql56,
17902            6 => Self::Mysql57,
17903            9 => Self::Postgres96,
17904            10 => Self::Postgres11,
17905            11 => Self::Sqlserver2017Standard,
17906            14 => Self::Sqlserver2017Enterprise,
17907            15 => Self::Sqlserver2017Express,
17908            16 => Self::Sqlserver2017Web,
17909            18 => Self::Postgres10,
17910            19 => Self::Postgres12,
17911            20 => Self::Mysql80,
17912            23 => Self::Postgres13,
17913            26 => Self::Sqlserver2019Standard,
17914            27 => Self::Sqlserver2019Enterprise,
17915            28 => Self::Sqlserver2019Express,
17916            29 => Self::Sqlserver2019Web,
17917            41 => Self::Mysql8018,
17918            85 => Self::Mysql8026,
17919            110 => Self::Postgres14,
17920            111 => Self::Mysql8027,
17921            132 => Self::Mysql8028,
17922            148 => Self::Mysql8029,
17923            172 => Self::Postgres15,
17924            174 => Self::Mysql8030,
17925            197 => Self::Mysql8031,
17926            199 => Self::Sqlserver2022Standard,
17927            200 => Self::Sqlserver2022Enterprise,
17928            201 => Self::Sqlserver2022Express,
17929            202 => Self::Sqlserver2022Web,
17930            213 => Self::Mysql8032,
17931            238 => Self::Mysql8033,
17932            239 => Self::Mysql8034,
17933            240 => Self::Mysql8035,
17934            241 => Self::Mysql8036,
17935            272 => Self::Postgres16,
17936            355 => Self::Mysql8037,
17937            356 => Self::Mysql8038,
17938            357 => Self::Mysql8039,
17939            358 => Self::Mysql8040,
17940            398 => Self::Mysql84,
17941            399 => Self::Mysql840,
17942            _ => Self::UnknownValue(sql_database_version::UnknownValue(
17943                wkt::internal::UnknownEnumValue::Integer(value),
17944            )),
17945        }
17946    }
17947}
17948
17949impl std::convert::From<&str> for SqlDatabaseVersion {
17950    fn from(value: &str) -> Self {
17951        use std::string::ToString;
17952        match value {
17953            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
17954            "MYSQL_5_1" => Self::Mysql51,
17955            "MYSQL_5_5" => Self::Mysql55,
17956            "MYSQL_5_6" => Self::Mysql56,
17957            "MYSQL_5_7" => Self::Mysql57,
17958            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
17959            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
17960            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
17961            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
17962            "POSTGRES_9_6" => Self::Postgres96,
17963            "POSTGRES_10" => Self::Postgres10,
17964            "POSTGRES_11" => Self::Postgres11,
17965            "POSTGRES_12" => Self::Postgres12,
17966            "POSTGRES_13" => Self::Postgres13,
17967            "POSTGRES_14" => Self::Postgres14,
17968            "POSTGRES_15" => Self::Postgres15,
17969            "POSTGRES_16" => Self::Postgres16,
17970            "MYSQL_8_0" => Self::Mysql80,
17971            "MYSQL_8_0_18" => Self::Mysql8018,
17972            "MYSQL_8_0_26" => Self::Mysql8026,
17973            "MYSQL_8_0_27" => Self::Mysql8027,
17974            "MYSQL_8_0_28" => Self::Mysql8028,
17975            "MYSQL_8_0_29" => Self::Mysql8029,
17976            "MYSQL_8_0_30" => Self::Mysql8030,
17977            "MYSQL_8_0_31" => Self::Mysql8031,
17978            "MYSQL_8_0_32" => Self::Mysql8032,
17979            "MYSQL_8_0_33" => Self::Mysql8033,
17980            "MYSQL_8_0_34" => Self::Mysql8034,
17981            "MYSQL_8_0_35" => Self::Mysql8035,
17982            "MYSQL_8_0_36" => Self::Mysql8036,
17983            "MYSQL_8_0_37" => Self::Mysql8037,
17984            "MYSQL_8_0_38" => Self::Mysql8038,
17985            "MYSQL_8_0_39" => Self::Mysql8039,
17986            "MYSQL_8_0_40" => Self::Mysql8040,
17987            "MYSQL_8_4" => Self::Mysql84,
17988            "MYSQL_8_4_0" => Self::Mysql840,
17989            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
17990            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
17991            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
17992            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
17993            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
17994            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
17995            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
17996            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
17997            _ => Self::UnknownValue(sql_database_version::UnknownValue(
17998                wkt::internal::UnknownEnumValue::String(value.to_string()),
17999            )),
18000        }
18001    }
18002}
18003
18004impl serde::ser::Serialize for SqlDatabaseVersion {
18005    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18006    where
18007        S: serde::Serializer,
18008    {
18009        match self {
18010            Self::Unspecified => serializer.serialize_i32(0),
18011            Self::Mysql51 => serializer.serialize_i32(2),
18012            Self::Mysql55 => serializer.serialize_i32(3),
18013            Self::Mysql56 => serializer.serialize_i32(5),
18014            Self::Mysql57 => serializer.serialize_i32(6),
18015            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
18016            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
18017            Self::Sqlserver2017Express => serializer.serialize_i32(15),
18018            Self::Sqlserver2017Web => serializer.serialize_i32(16),
18019            Self::Postgres96 => serializer.serialize_i32(9),
18020            Self::Postgres10 => serializer.serialize_i32(18),
18021            Self::Postgres11 => serializer.serialize_i32(10),
18022            Self::Postgres12 => serializer.serialize_i32(19),
18023            Self::Postgres13 => serializer.serialize_i32(23),
18024            Self::Postgres14 => serializer.serialize_i32(110),
18025            Self::Postgres15 => serializer.serialize_i32(172),
18026            Self::Postgres16 => serializer.serialize_i32(272),
18027            Self::Mysql80 => serializer.serialize_i32(20),
18028            Self::Mysql8018 => serializer.serialize_i32(41),
18029            Self::Mysql8026 => serializer.serialize_i32(85),
18030            Self::Mysql8027 => serializer.serialize_i32(111),
18031            Self::Mysql8028 => serializer.serialize_i32(132),
18032            Self::Mysql8029 => serializer.serialize_i32(148),
18033            Self::Mysql8030 => serializer.serialize_i32(174),
18034            Self::Mysql8031 => serializer.serialize_i32(197),
18035            Self::Mysql8032 => serializer.serialize_i32(213),
18036            Self::Mysql8033 => serializer.serialize_i32(238),
18037            Self::Mysql8034 => serializer.serialize_i32(239),
18038            Self::Mysql8035 => serializer.serialize_i32(240),
18039            Self::Mysql8036 => serializer.serialize_i32(241),
18040            Self::Mysql8037 => serializer.serialize_i32(355),
18041            Self::Mysql8038 => serializer.serialize_i32(356),
18042            Self::Mysql8039 => serializer.serialize_i32(357),
18043            Self::Mysql8040 => serializer.serialize_i32(358),
18044            Self::Mysql84 => serializer.serialize_i32(398),
18045            Self::Mysql840 => serializer.serialize_i32(399),
18046            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
18047            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
18048            Self::Sqlserver2019Express => serializer.serialize_i32(28),
18049            Self::Sqlserver2019Web => serializer.serialize_i32(29),
18050            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
18051            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
18052            Self::Sqlserver2022Express => serializer.serialize_i32(201),
18053            Self::Sqlserver2022Web => serializer.serialize_i32(202),
18054            Self::UnknownValue(u) => u.0.serialize(serializer),
18055        }
18056    }
18057}
18058
18059impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
18060    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18061    where
18062        D: serde::Deserializer<'de>,
18063    {
18064        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
18065            ".google.cloud.sql.v1.SqlDatabaseVersion",
18066        ))
18067    }
18068}
18069
18070/// The pricing plan for this instance.
18071///
18072/// # Working with unknown values
18073///
18074/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18075/// additional enum variants at any time. Adding new variants is not considered
18076/// a breaking change. Applications should write their code in anticipation of:
18077///
18078/// - New values appearing in future releases of the client library, **and**
18079/// - New values received dynamically, without application changes.
18080///
18081/// Please consult the [Working with enums] section in the user guide for some
18082/// guidelines.
18083///
18084/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18085#[derive(Clone, Debug, PartialEq)]
18086#[non_exhaustive]
18087pub enum SqlPricingPlan {
18088    /// This is an unknown pricing plan for this instance.
18089    Unspecified,
18090    /// The instance is billed at a monthly flat rate.
18091    Package,
18092    /// The instance is billed per usage.
18093    PerUse,
18094    /// If set, the enum was initialized with an unknown value.
18095    ///
18096    /// Applications can examine the value using [SqlPricingPlan::value] or
18097    /// [SqlPricingPlan::name].
18098    UnknownValue(sql_pricing_plan::UnknownValue),
18099}
18100
18101#[doc(hidden)]
18102pub mod sql_pricing_plan {
18103    #[allow(unused_imports)]
18104    use super::*;
18105    #[derive(Clone, Debug, PartialEq)]
18106    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18107}
18108
18109impl SqlPricingPlan {
18110    /// Gets the enum value.
18111    ///
18112    /// Returns `None` if the enum contains an unknown value deserialized from
18113    /// the string representation of enums.
18114    pub fn value(&self) -> std::option::Option<i32> {
18115        match self {
18116            Self::Unspecified => std::option::Option::Some(0),
18117            Self::Package => std::option::Option::Some(1),
18118            Self::PerUse => std::option::Option::Some(2),
18119            Self::UnknownValue(u) => u.0.value(),
18120        }
18121    }
18122
18123    /// Gets the enum value as a string.
18124    ///
18125    /// Returns `None` if the enum contains an unknown value deserialized from
18126    /// the integer representation of enums.
18127    pub fn name(&self) -> std::option::Option<&str> {
18128        match self {
18129            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
18130            Self::Package => std::option::Option::Some("PACKAGE"),
18131            Self::PerUse => std::option::Option::Some("PER_USE"),
18132            Self::UnknownValue(u) => u.0.name(),
18133        }
18134    }
18135}
18136
18137impl std::default::Default for SqlPricingPlan {
18138    fn default() -> Self {
18139        use std::convert::From;
18140        Self::from(0)
18141    }
18142}
18143
18144impl std::fmt::Display for SqlPricingPlan {
18145    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18146        wkt::internal::display_enum(f, self.name(), self.value())
18147    }
18148}
18149
18150impl std::convert::From<i32> for SqlPricingPlan {
18151    fn from(value: i32) -> Self {
18152        match value {
18153            0 => Self::Unspecified,
18154            1 => Self::Package,
18155            2 => Self::PerUse,
18156            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18157                wkt::internal::UnknownEnumValue::Integer(value),
18158            )),
18159        }
18160    }
18161}
18162
18163impl std::convert::From<&str> for SqlPricingPlan {
18164    fn from(value: &str) -> Self {
18165        use std::string::ToString;
18166        match value {
18167            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
18168            "PACKAGE" => Self::Package,
18169            "PER_USE" => Self::PerUse,
18170            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18171                wkt::internal::UnknownEnumValue::String(value.to_string()),
18172            )),
18173        }
18174    }
18175}
18176
18177impl serde::ser::Serialize for SqlPricingPlan {
18178    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18179    where
18180        S: serde::Serializer,
18181    {
18182        match self {
18183            Self::Unspecified => serializer.serialize_i32(0),
18184            Self::Package => serializer.serialize_i32(1),
18185            Self::PerUse => serializer.serialize_i32(2),
18186            Self::UnknownValue(u) => u.0.serialize(serializer),
18187        }
18188    }
18189}
18190
18191impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
18192    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18193    where
18194        D: serde::Deserializer<'de>,
18195    {
18196        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
18197            ".google.cloud.sql.v1.SqlPricingPlan",
18198        ))
18199    }
18200}
18201
18202///
18203/// # Working with unknown values
18204///
18205/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18206/// additional enum variants at any time. Adding new variants is not considered
18207/// a breaking change. Applications should write their code in anticipation of:
18208///
18209/// - New values appearing in future releases of the client library, **and**
18210/// - New values received dynamically, without application changes.
18211///
18212/// Please consult the [Working with enums] section in the user guide for some
18213/// guidelines.
18214///
18215/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18216#[derive(Clone, Debug, PartialEq)]
18217#[non_exhaustive]
18218pub enum SqlReplicationType {
18219    /// This is an unknown replication type for a Cloud SQL instance.
18220    Unspecified,
18221    /// The synchronous replication mode for First Generation instances. It is the
18222    /// default value.
18223    Synchronous,
18224    /// The asynchronous replication mode for First Generation instances. It
18225    /// provides a slight performance gain, but if an outage occurs while this
18226    /// option is set to asynchronous, you can lose up to a few seconds of updates
18227    /// to your data.
18228    Asynchronous,
18229    /// If set, the enum was initialized with an unknown value.
18230    ///
18231    /// Applications can examine the value using [SqlReplicationType::value] or
18232    /// [SqlReplicationType::name].
18233    UnknownValue(sql_replication_type::UnknownValue),
18234}
18235
18236#[doc(hidden)]
18237pub mod sql_replication_type {
18238    #[allow(unused_imports)]
18239    use super::*;
18240    #[derive(Clone, Debug, PartialEq)]
18241    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18242}
18243
18244impl SqlReplicationType {
18245    /// Gets the enum value.
18246    ///
18247    /// Returns `None` if the enum contains an unknown value deserialized from
18248    /// the string representation of enums.
18249    pub fn value(&self) -> std::option::Option<i32> {
18250        match self {
18251            Self::Unspecified => std::option::Option::Some(0),
18252            Self::Synchronous => std::option::Option::Some(1),
18253            Self::Asynchronous => std::option::Option::Some(2),
18254            Self::UnknownValue(u) => u.0.value(),
18255        }
18256    }
18257
18258    /// Gets the enum value as a string.
18259    ///
18260    /// Returns `None` if the enum contains an unknown value deserialized from
18261    /// the integer representation of enums.
18262    pub fn name(&self) -> std::option::Option<&str> {
18263        match self {
18264            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
18265            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
18266            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
18267            Self::UnknownValue(u) => u.0.name(),
18268        }
18269    }
18270}
18271
18272impl std::default::Default for SqlReplicationType {
18273    fn default() -> Self {
18274        use std::convert::From;
18275        Self::from(0)
18276    }
18277}
18278
18279impl std::fmt::Display for SqlReplicationType {
18280    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18281        wkt::internal::display_enum(f, self.name(), self.value())
18282    }
18283}
18284
18285impl std::convert::From<i32> for SqlReplicationType {
18286    fn from(value: i32) -> Self {
18287        match value {
18288            0 => Self::Unspecified,
18289            1 => Self::Synchronous,
18290            2 => Self::Asynchronous,
18291            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18292                wkt::internal::UnknownEnumValue::Integer(value),
18293            )),
18294        }
18295    }
18296}
18297
18298impl std::convert::From<&str> for SqlReplicationType {
18299    fn from(value: &str) -> Self {
18300        use std::string::ToString;
18301        match value {
18302            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
18303            "SYNCHRONOUS" => Self::Synchronous,
18304            "ASYNCHRONOUS" => Self::Asynchronous,
18305            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18306                wkt::internal::UnknownEnumValue::String(value.to_string()),
18307            )),
18308        }
18309    }
18310}
18311
18312impl serde::ser::Serialize for SqlReplicationType {
18313    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18314    where
18315        S: serde::Serializer,
18316    {
18317        match self {
18318            Self::Unspecified => serializer.serialize_i32(0),
18319            Self::Synchronous => serializer.serialize_i32(1),
18320            Self::Asynchronous => serializer.serialize_i32(2),
18321            Self::UnknownValue(u) => u.0.serialize(serializer),
18322        }
18323    }
18324}
18325
18326impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
18327    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18328    where
18329        D: serde::Deserializer<'de>,
18330    {
18331        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
18332            ".google.cloud.sql.v1.SqlReplicationType",
18333        ))
18334    }
18335}
18336
18337/// The type of disk that is used for a v2 instance to use.
18338///
18339/// # Working with unknown values
18340///
18341/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18342/// additional enum variants at any time. Adding new variants is not considered
18343/// a breaking change. Applications should write their code in anticipation of:
18344///
18345/// - New values appearing in future releases of the client library, **and**
18346/// - New values received dynamically, without application changes.
18347///
18348/// Please consult the [Working with enums] section in the user guide for some
18349/// guidelines.
18350///
18351/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18352#[derive(Clone, Debug, PartialEq)]
18353#[non_exhaustive]
18354pub enum SqlDataDiskType {
18355    /// This is an unknown data disk type.
18356    Unspecified,
18357    /// An SSD data disk.
18358    PdSsd,
18359    /// An HDD data disk.
18360    PdHdd,
18361    /// This field is deprecated and will be removed from a future version of the
18362    /// API.
18363    #[deprecated]
18364    ObsoleteLocalSsd,
18365    /// If set, the enum was initialized with an unknown value.
18366    ///
18367    /// Applications can examine the value using [SqlDataDiskType::value] or
18368    /// [SqlDataDiskType::name].
18369    UnknownValue(sql_data_disk_type::UnknownValue),
18370}
18371
18372#[doc(hidden)]
18373pub mod sql_data_disk_type {
18374    #[allow(unused_imports)]
18375    use super::*;
18376    #[derive(Clone, Debug, PartialEq)]
18377    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18378}
18379
18380impl SqlDataDiskType {
18381    /// Gets the enum value.
18382    ///
18383    /// Returns `None` if the enum contains an unknown value deserialized from
18384    /// the string representation of enums.
18385    pub fn value(&self) -> std::option::Option<i32> {
18386        match self {
18387            Self::Unspecified => std::option::Option::Some(0),
18388            Self::PdSsd => std::option::Option::Some(1),
18389            Self::PdHdd => std::option::Option::Some(2),
18390            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
18391            Self::UnknownValue(u) => u.0.value(),
18392        }
18393    }
18394
18395    /// Gets the enum value as a string.
18396    ///
18397    /// Returns `None` if the enum contains an unknown value deserialized from
18398    /// the integer representation of enums.
18399    pub fn name(&self) -> std::option::Option<&str> {
18400        match self {
18401            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
18402            Self::PdSsd => std::option::Option::Some("PD_SSD"),
18403            Self::PdHdd => std::option::Option::Some("PD_HDD"),
18404            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
18405            Self::UnknownValue(u) => u.0.name(),
18406        }
18407    }
18408}
18409
18410impl std::default::Default for SqlDataDiskType {
18411    fn default() -> Self {
18412        use std::convert::From;
18413        Self::from(0)
18414    }
18415}
18416
18417impl std::fmt::Display for SqlDataDiskType {
18418    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18419        wkt::internal::display_enum(f, self.name(), self.value())
18420    }
18421}
18422
18423impl std::convert::From<i32> for SqlDataDiskType {
18424    fn from(value: i32) -> Self {
18425        match value {
18426            0 => Self::Unspecified,
18427            1 => Self::PdSsd,
18428            2 => Self::PdHdd,
18429            3 => Self::ObsoleteLocalSsd,
18430            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18431                wkt::internal::UnknownEnumValue::Integer(value),
18432            )),
18433        }
18434    }
18435}
18436
18437impl std::convert::From<&str> for SqlDataDiskType {
18438    fn from(value: &str) -> Self {
18439        use std::string::ToString;
18440        match value {
18441            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
18442            "PD_SSD" => Self::PdSsd,
18443            "PD_HDD" => Self::PdHdd,
18444            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
18445            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18446                wkt::internal::UnknownEnumValue::String(value.to_string()),
18447            )),
18448        }
18449    }
18450}
18451
18452impl serde::ser::Serialize for SqlDataDiskType {
18453    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18454    where
18455        S: serde::Serializer,
18456    {
18457        match self {
18458            Self::Unspecified => serializer.serialize_i32(0),
18459            Self::PdSsd => serializer.serialize_i32(1),
18460            Self::PdHdd => serializer.serialize_i32(2),
18461            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
18462            Self::UnknownValue(u) => u.0.serialize(serializer),
18463        }
18464    }
18465}
18466
18467impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
18468    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18469    where
18470        D: serde::Deserializer<'de>,
18471    {
18472        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
18473            ".google.cloud.sql.v1.SqlDataDiskType",
18474        ))
18475    }
18476}
18477
18478/// The availability type of the given Cloud SQL instance.
18479///
18480/// # Working with unknown values
18481///
18482/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18483/// additional enum variants at any time. Adding new variants is not considered
18484/// a breaking change. Applications should write their code in anticipation of:
18485///
18486/// - New values appearing in future releases of the client library, **and**
18487/// - New values received dynamically, without application changes.
18488///
18489/// Please consult the [Working with enums] section in the user guide for some
18490/// guidelines.
18491///
18492/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18493#[derive(Clone, Debug, PartialEq)]
18494#[non_exhaustive]
18495pub enum SqlAvailabilityType {
18496    /// This is an unknown Availability type.
18497    Unspecified,
18498    /// Zonal available instance.
18499    Zonal,
18500    /// Regional available instance.
18501    Regional,
18502    /// If set, the enum was initialized with an unknown value.
18503    ///
18504    /// Applications can examine the value using [SqlAvailabilityType::value] or
18505    /// [SqlAvailabilityType::name].
18506    UnknownValue(sql_availability_type::UnknownValue),
18507}
18508
18509#[doc(hidden)]
18510pub mod sql_availability_type {
18511    #[allow(unused_imports)]
18512    use super::*;
18513    #[derive(Clone, Debug, PartialEq)]
18514    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18515}
18516
18517impl SqlAvailabilityType {
18518    /// Gets the enum value.
18519    ///
18520    /// Returns `None` if the enum contains an unknown value deserialized from
18521    /// the string representation of enums.
18522    pub fn value(&self) -> std::option::Option<i32> {
18523        match self {
18524            Self::Unspecified => std::option::Option::Some(0),
18525            Self::Zonal => std::option::Option::Some(1),
18526            Self::Regional => std::option::Option::Some(2),
18527            Self::UnknownValue(u) => u.0.value(),
18528        }
18529    }
18530
18531    /// Gets the enum value as a string.
18532    ///
18533    /// Returns `None` if the enum contains an unknown value deserialized from
18534    /// the integer representation of enums.
18535    pub fn name(&self) -> std::option::Option<&str> {
18536        match self {
18537            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
18538            Self::Zonal => std::option::Option::Some("ZONAL"),
18539            Self::Regional => std::option::Option::Some("REGIONAL"),
18540            Self::UnknownValue(u) => u.0.name(),
18541        }
18542    }
18543}
18544
18545impl std::default::Default for SqlAvailabilityType {
18546    fn default() -> Self {
18547        use std::convert::From;
18548        Self::from(0)
18549    }
18550}
18551
18552impl std::fmt::Display for SqlAvailabilityType {
18553    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18554        wkt::internal::display_enum(f, self.name(), self.value())
18555    }
18556}
18557
18558impl std::convert::From<i32> for SqlAvailabilityType {
18559    fn from(value: i32) -> Self {
18560        match value {
18561            0 => Self::Unspecified,
18562            1 => Self::Zonal,
18563            2 => Self::Regional,
18564            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
18565                wkt::internal::UnknownEnumValue::Integer(value),
18566            )),
18567        }
18568    }
18569}
18570
18571impl std::convert::From<&str> for SqlAvailabilityType {
18572    fn from(value: &str) -> Self {
18573        use std::string::ToString;
18574        match value {
18575            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
18576            "ZONAL" => Self::Zonal,
18577            "REGIONAL" => Self::Regional,
18578            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
18579                wkt::internal::UnknownEnumValue::String(value.to_string()),
18580            )),
18581        }
18582    }
18583}
18584
18585impl serde::ser::Serialize for SqlAvailabilityType {
18586    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18587    where
18588        S: serde::Serializer,
18589    {
18590        match self {
18591            Self::Unspecified => serializer.serialize_i32(0),
18592            Self::Zonal => serializer.serialize_i32(1),
18593            Self::Regional => serializer.serialize_i32(2),
18594            Self::UnknownValue(u) => u.0.serialize(serializer),
18595        }
18596    }
18597}
18598
18599impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
18600    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18601    where
18602        D: serde::Deserializer<'de>,
18603    {
18604        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
18605            ".google.cloud.sql.v1.SqlAvailabilityType",
18606        ))
18607    }
18608}
18609
18610///
18611/// # Working with unknown values
18612///
18613/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18614/// additional enum variants at any time. Adding new variants is not considered
18615/// a breaking change. Applications should write their code in anticipation of:
18616///
18617/// - New values appearing in future releases of the client library, **and**
18618/// - New values received dynamically, without application changes.
18619///
18620/// Please consult the [Working with enums] section in the user guide for some
18621/// guidelines.
18622///
18623/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18624#[derive(Clone, Debug, PartialEq)]
18625#[non_exhaustive]
18626pub enum SqlUpdateTrack {
18627    /// This is an unknown maintenance timing preference.
18628    Unspecified,
18629    /// For an instance with a scheduled maintenance window, this maintenance
18630    /// timing indicates that the maintenance update is scheduled 7 to 14 days
18631    /// after the notification is sent out. Also referred to as `Week 1` (Console)
18632    /// and `preview` (gcloud CLI).
18633    Canary,
18634    /// For an instance with a scheduled maintenance window, this maintenance
18635    /// timing indicates that the maintenance update is scheduled 15 to 21 days
18636    /// after the notification is sent out. Also referred to as `Week 2` (Console)
18637    /// and `production` (gcloud CLI).
18638    Stable,
18639    /// For instance with a scheduled maintenance window, this maintenance
18640    /// timing indicates that the maintenance update is scheduled 35 to 42 days
18641    /// after the notification is sent out.
18642    Week5,
18643    /// If set, the enum was initialized with an unknown value.
18644    ///
18645    /// Applications can examine the value using [SqlUpdateTrack::value] or
18646    /// [SqlUpdateTrack::name].
18647    UnknownValue(sql_update_track::UnknownValue),
18648}
18649
18650#[doc(hidden)]
18651pub mod sql_update_track {
18652    #[allow(unused_imports)]
18653    use super::*;
18654    #[derive(Clone, Debug, PartialEq)]
18655    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18656}
18657
18658impl SqlUpdateTrack {
18659    /// Gets the enum value.
18660    ///
18661    /// Returns `None` if the enum contains an unknown value deserialized from
18662    /// the string representation of enums.
18663    pub fn value(&self) -> std::option::Option<i32> {
18664        match self {
18665            Self::Unspecified => std::option::Option::Some(0),
18666            Self::Canary => std::option::Option::Some(1),
18667            Self::Stable => std::option::Option::Some(2),
18668            Self::Week5 => std::option::Option::Some(3),
18669            Self::UnknownValue(u) => u.0.value(),
18670        }
18671    }
18672
18673    /// Gets the enum value as a string.
18674    ///
18675    /// Returns `None` if the enum contains an unknown value deserialized from
18676    /// the integer representation of enums.
18677    pub fn name(&self) -> std::option::Option<&str> {
18678        match self {
18679            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
18680            Self::Canary => std::option::Option::Some("canary"),
18681            Self::Stable => std::option::Option::Some("stable"),
18682            Self::Week5 => std::option::Option::Some("week5"),
18683            Self::UnknownValue(u) => u.0.name(),
18684        }
18685    }
18686}
18687
18688impl std::default::Default for SqlUpdateTrack {
18689    fn default() -> Self {
18690        use std::convert::From;
18691        Self::from(0)
18692    }
18693}
18694
18695impl std::fmt::Display for SqlUpdateTrack {
18696    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18697        wkt::internal::display_enum(f, self.name(), self.value())
18698    }
18699}
18700
18701impl std::convert::From<i32> for SqlUpdateTrack {
18702    fn from(value: i32) -> Self {
18703        match value {
18704            0 => Self::Unspecified,
18705            1 => Self::Canary,
18706            2 => Self::Stable,
18707            3 => Self::Week5,
18708            _ => Self::UnknownValue(sql_update_track::UnknownValue(
18709                wkt::internal::UnknownEnumValue::Integer(value),
18710            )),
18711        }
18712    }
18713}
18714
18715impl std::convert::From<&str> for SqlUpdateTrack {
18716    fn from(value: &str) -> Self {
18717        use std::string::ToString;
18718        match value {
18719            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
18720            "canary" => Self::Canary,
18721            "stable" => Self::Stable,
18722            "week5" => Self::Week5,
18723            _ => Self::UnknownValue(sql_update_track::UnknownValue(
18724                wkt::internal::UnknownEnumValue::String(value.to_string()),
18725            )),
18726        }
18727    }
18728}
18729
18730impl serde::ser::Serialize for SqlUpdateTrack {
18731    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18732    where
18733        S: serde::Serializer,
18734    {
18735        match self {
18736            Self::Unspecified => serializer.serialize_i32(0),
18737            Self::Canary => serializer.serialize_i32(1),
18738            Self::Stable => serializer.serialize_i32(2),
18739            Self::Week5 => serializer.serialize_i32(3),
18740            Self::UnknownValue(u) => u.0.serialize(serializer),
18741        }
18742    }
18743}
18744
18745impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
18746    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18747    where
18748        D: serde::Deserializer<'de>,
18749    {
18750        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
18751            ".google.cloud.sql.v1.SqlUpdateTrack",
18752        ))
18753    }
18754}