1#![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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
43 #[serde_as(as = "serde_with::DisplayFromStr")]
44 pub id: i64,
45
46 #[serde(skip_serializing_if = "std::string::String::is_empty")]
48 pub instance: std::string::String,
49
50 #[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 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
65 self.id = v.into();
66 self
67 }
68
69 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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
96 #[serde_as(as = "serde_with::DisplayFromStr")]
97 pub id: i64,
98
99 #[serde(skip_serializing_if = "std::string::String::is_empty")]
101 pub instance: std::string::String,
102
103 #[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 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
118 self.id = v.into();
119 self
120 }
121
122 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
149 pub instance: std::string::String,
150
151 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
204 pub instance: std::string::String,
205
206 #[serde(skip_serializing_if = "wkt::internal::is_default")]
208 pub max_results: i32,
209
210 #[serde(skip_serializing_if = "std::string::String::is_empty")]
213 pub page_token: std::string::String,
214
215 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
267 pub kind: std::string::String,
268
269 pub status: crate::model::SqlBackupRunStatus,
271
272 #[serde(skip_serializing_if = "std::option::Option::is_none")]
276 pub enqueued_time: std::option::Option<wkt::Timestamp>,
277
278 #[serde(skip_serializing_if = "wkt::internal::is_default")]
281 #[serde_as(as = "serde_with::DisplayFromStr")]
282 pub id: i64,
283
284 #[serde(skip_serializing_if = "std::option::Option::is_none")]
288 pub start_time: std::option::Option<wkt::Timestamp>,
289
290 #[serde(skip_serializing_if = "std::option::Option::is_none")]
294 pub end_time: std::option::Option<wkt::Timestamp>,
295
296 #[serde(skip_serializing_if = "std::option::Option::is_none")]
299 pub error: std::option::Option<crate::model::OperationError>,
300
301 #[serde(rename = "type")]
305 pub r#type: crate::model::SqlBackupRunType,
306
307 #[serde(skip_serializing_if = "std::string::String::is_empty")]
309 pub description: std::string::String,
310
311 #[serde(skip_serializing_if = "std::option::Option::is_none")]
315 pub window_start_time: std::option::Option<wkt::Timestamp>,
316
317 #[serde(skip_serializing_if = "std::string::String::is_empty")]
319 pub instance: std::string::String,
320
321 #[serde(skip_serializing_if = "std::string::String::is_empty")]
323 pub self_link: std::string::String,
324
325 #[serde(skip_serializing_if = "std::string::String::is_empty")]
327 pub location: std::string::String,
328
329 #[serde(skip_serializing_if = "std::option::Option::is_none")]
331 pub disk_encryption_configuration:
332 std::option::Option<crate::model::DiskEncryptionConfiguration>,
333
334 #[serde(skip_serializing_if = "std::option::Option::is_none")]
336 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
337
338 pub backup_kind: crate::model::SqlBackupKind,
340
341 #[serde(skip_serializing_if = "std::string::String::is_empty")]
344 pub time_zone: std::string::String,
345
346 #[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 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 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 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 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
386 self.id = v.into();
387 self
388 }
389
390 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 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 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 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 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 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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
517 pub kind: std::string::String,
518
519 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
521 pub items: std::vec::Vec<crate::model::BackupRun>,
522
523 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
589 pub instance: std::string::String,
590
591 #[serde(skip_serializing_if = "std::string::String::is_empty")]
593 pub project: std::string::String,
594
595 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
645 pub kind: std::string::String,
646
647 #[serde(skip_serializing_if = "std::option::Option::is_none")]
649 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
650
651 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
653 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
654
655 #[serde(skip_serializing_if = "std::string::String::is_empty")]
658 pub region: std::string::String,
659
660 pub database_version: crate::model::SqlDatabaseVersion,
672
673 pub backend_type: crate::model::SqlBackendType,
678
679 #[serde(skip_serializing_if = "wkt::internal::is_default")]
681 pub psc_enabled: bool,
682
683 #[serde(skip_serializing_if = "std::string::String::is_empty")]
685 pub dns_name: std::string::String,
686
687 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 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 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 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 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 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 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 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 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 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
777pub mod connect_settings {
779 #[allow(unused_imports)]
780 use super::*;
781
782 #[derive(Clone, Debug, PartialEq)]
798 #[non_exhaustive]
799 pub enum CaMode {
800 Unspecified,
802 GoogleManagedInternalCa,
804 GoogleManagedCasCa,
807 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
926 pub instance: std::string::String,
927
928 #[serde(skip_serializing_if = "std::string::String::is_empty")]
930 pub project: std::string::String,
931
932 #[serde(rename = "public_key")]
934 #[serde(skip_serializing_if = "std::string::String::is_empty")]
935 pub public_key: std::string::String,
936
937 #[serde(rename = "access_token")]
939 #[serde(skip_serializing_if = "std::string::String::is_empty")]
940 pub access_token: std::string::String,
941
942 #[serde(skip_serializing_if = "std::option::Option::is_none")]
945 pub read_time: std::option::Option<wkt::Timestamp>,
946
947 #[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 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 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 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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1052 pub database: std::string::String,
1053
1054 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1056 pub instance: std::string::String,
1057
1058 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1104 pub database: std::string::String,
1105
1106 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1108 pub instance: std::string::String,
1109
1110 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1156 pub instance: std::string::String,
1157
1158 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1210 pub instance: std::string::String,
1211
1212 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1252 pub database: std::string::String,
1253
1254 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1256 pub instance: std::string::String,
1257
1258 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1316 pub kind: std::string::String,
1317
1318 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399 pub kind: std::string::String,
1400
1401 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1447 pub name: std::string::String,
1448
1449 #[serde(rename = "type")]
1453 pub r#type: crate::model::SqlFlagType,
1454
1455 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1466 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
1467
1468 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1470 pub allowed_string_values: std::vec::Vec<std::string::String>,
1471
1472 #[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 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1485 pub requires_restart: std::option::Option<wkt::BoolValue>,
1486
1487 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1489 pub kind: std::string::String,
1490
1491 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1493 pub in_beta: std::option::Option<wkt::BoolValue>,
1494
1495 #[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 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 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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1612 pub instance: std::string::String,
1613
1614 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1655 pub instance: std::string::String,
1656
1657 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1711 pub instance: std::string::String,
1712
1713 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1753 pub instance: std::string::String,
1754
1755 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1809 pub instance: std::string::String,
1810
1811 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1813 pub project: std::string::String,
1814
1815 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1866 pub instance: std::string::String,
1867
1868 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1922 pub instance: std::string::String,
1923
1924 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1978 pub instance: std::string::String,
1979
1980 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2020 pub instance: std::string::String,
2021
2022 #[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 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 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 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#[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 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2129 pub filter: std::string::String,
2130
2131 #[serde(skip_serializing_if = "wkt::internal::is_default")]
2136 pub max_results: u32,
2137
2138 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2141 pub page_token: std::string::String,
2142
2143 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2195 pub instance: std::string::String,
2196
2197 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2237 pub instance: std::string::String,
2238
2239 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2291 pub instance: std::string::String,
2292
2293 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2295 pub project: std::string::String,
2296
2297 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2349 pub instance: std::string::String,
2350
2351 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2353 pub project: std::string::String,
2354
2355 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2406 pub instance: std::string::String,
2407
2408 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2448 pub instance: std::string::String,
2449
2450 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2490 pub instance: std::string::String,
2491
2492 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2546 pub instance: std::string::String,
2547
2548 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2602 pub instance: std::string::String,
2603
2604 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2644 pub instance: std::string::String,
2645
2646 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2686 pub instance: std::string::String,
2687
2688 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2742 pub instance: std::string::String,
2743
2744 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2746 pub project: std::string::String,
2747
2748 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2799 pub instance: std::string::String,
2800
2801 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2853 pub instance: std::string::String,
2854
2855 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2911 pub instance: std::string::String,
2912
2913 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2915 pub project: std::string::String,
2916
2917 #[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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3005 pub backup_limit: std::option::Option<i32>,
3006
3007 #[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 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 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
3049pub mod backup_reencryption_config {
3051 #[allow(unused_imports)]
3052 use super::*;
3053
3054 #[derive(Clone, Debug, PartialEq)]
3070 #[non_exhaustive]
3071 pub enum BackupType {
3072 Unspecified,
3074 Automated,
3076 OnDemand,
3078 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3195 pub instance: std::string::String,
3196
3197 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3237 pub instance: std::string::String,
3238
3239 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3241 pub project: std::string::String,
3242
3243 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3245 pub verify_connection_only: bool,
3246
3247 pub sync_mode:
3249 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3250
3251 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3253 pub verify_replication_only: bool,
3254
3255 pub migration_type:
3259 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3260
3261 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 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 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 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 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 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 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 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 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 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 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
3397pub mod sql_instances_verify_external_sync_settings_request {
3399 #[allow(unused_imports)]
3400 use super::*;
3401
3402 #[derive(Clone, Debug, PartialEq)]
3417 #[non_exhaustive]
3418 pub enum ExternalSyncMode {
3419 Unspecified,
3421 Online,
3424 Offline,
3427 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 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 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 #[derive(Clone, Debug, PartialEq)]
3551 #[non_exhaustive]
3552 pub enum MigrationType {
3553 Unspecified,
3555 Logical,
3557 Physical,
3559 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 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 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 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3674 }
3675}
3676
3677#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3685 pub instance: std::string::String,
3686
3687 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3689 pub project: std::string::String,
3690
3691 pub sync_mode:
3693 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3694
3695 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3697 pub skip_verification: bool,
3698
3699 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3702
3703 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 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 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 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 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 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 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 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 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 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
3834pub 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 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3846 }
3847}
3848
3849#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3857 pub instance: std::string::String,
3858
3859 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3899 pub instance: std::string::String,
3900
3901 #[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 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 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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[serde(rename = "public_key")]
4141 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4142 pub public_key: std::string::String,
4143
4144 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4222 pub kind: std::string::String,
4223
4224 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4226 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
4227
4228 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4230 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
4231
4232 #[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 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 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 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 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#[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 #[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 #[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 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 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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4513 pub kind: std::string::String,
4514
4515 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4517 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4518
4519 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4575 pub kind: std::string::String,
4576
4577 #[serde(skip_serializing_if = "wkt::internal::is_default")]
4579 #[serde_as(as = "serde_with::DisplayFromStr")]
4580 pub minimal_target_size_gb: i64,
4581
4582 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4628 pub instance: std::string::String,
4629
4630 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4670 pub kind: std::string::String,
4671
4672 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4715 pub kind: std::string::String,
4716
4717 #[serde(skip_serializing_if = "wkt::internal::is_default")]
4719 #[serde_as(as = "serde_with::DisplayFromStr")]
4720 pub pitr_timestamp_ms: i64,
4721
4722 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4724 pub destination_instance_name: std::string::String,
4725
4726 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4730 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
4731
4732 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4735 pub point_in_time: std::option::Option<wkt::Timestamp>,
4736
4737 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4745 pub allocated_ip_range: std::string::String,
4746
4747 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4750 pub database_names: std::vec::Vec<std::string::String>,
4751
4752 #[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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4852 pub bin_log_file_name: std::string::String,
4853
4854 #[serde(skip_serializing_if = "wkt::internal::is_default")]
4856 #[serde_as(as = "serde_with::DisplayFromStr")]
4857 pub bin_log_position: i64,
4858
4859 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4908 pub kind: std::string::String,
4909
4910 pub state: crate::model::database_instance::SqlInstanceState,
4912
4913 pub database_version: crate::model::SqlDatabaseVersion,
4916
4917 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4919 pub settings: std::option::Option<crate::model::Settings>,
4920
4921 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4924 pub etag: std::string::String,
4925
4926 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4928 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
4929
4930 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4933 pub master_instance_name: std::string::String,
4934
4935 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4937 pub replica_names: std::vec::Vec<std::string::String>,
4938
4939 #[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 #[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4958 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
4959
4960 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4962 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
4963
4964 pub instance_type: crate::model::SqlInstanceType,
4966
4967 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4970 pub project: std::string::String,
4971
4972 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4976 #[deprecated]
4977 pub ipv6_address: std::string::String,
4978
4979 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4982 pub service_account_email_address: std::string::String,
4983
4984 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4986 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
4987
4988 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4990 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
4991
4992 pub backend_type: crate::model::SqlBackendType,
4999
5000 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5002 pub self_link: std::string::String,
5003
5004 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5006 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
5007
5008 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5010 pub connection_name: std::string::String,
5011
5012 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5014 pub name: std::string::String,
5015
5016 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5025 pub region: std::string::String,
5026
5027 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5032 pub gce_zone: std::string::String,
5033
5034 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5039 pub secondary_gce_zone: std::string::String,
5040
5041 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5043 pub disk_encryption_configuration:
5044 std::option::Option<crate::model::DiskEncryptionConfiguration>,
5045
5046 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5048 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
5049
5050 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5053 pub root_password: std::string::String,
5054
5055 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5057 pub scheduled_maintenance:
5058 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
5059
5060 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5064 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
5065
5066 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5069 pub database_installed_version: std::string::String,
5070
5071 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5086 pub create_time: std::option::Option<wkt::Timestamp>,
5087
5088 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5090 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
5091
5092 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5094 pub maintenance_version: std::string::String,
5095
5096 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5106 pub psc_service_attachment_link: std::option::Option<std::string::String>,
5107
5108 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5110 pub dns_name: std::option::Option<std::string::String>,
5111
5112 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5114 #[deprecated]
5115 pub primary_dns_name: std::option::Option<std::string::String>,
5116
5117 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5119 pub write_endpoint: std::option::Option<std::string::String>,
5120
5121 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5126 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
5127
5128 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5130 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
5131
5132 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5136 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
5137
5138 #[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 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 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 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 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 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 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 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 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 #[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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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
5589pub 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5603 pub name: std::string::String,
5604
5605 #[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 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 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 #[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 #[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
5658 pub can_reschedule: bool,
5659
5660 #[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 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 #[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 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 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 #[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 #[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 #[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 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 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 pub mod sql_out_of_disk_report {
5784 #[allow(unused_imports)]
5785 use super::*;
5786
5787 #[derive(Clone, Debug, PartialEq)]
5803 #[non_exhaustive]
5804 pub enum SqlOutOfDiskState {
5805 Unspecified,
5807 Normal,
5809 SoftShutdown,
5812 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 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 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 #[derive(Clone, Debug, PartialEq)]
5942 #[non_exhaustive]
5943 pub enum SqlInstanceState {
5944 Unspecified,
5946 Runnable,
5948 Suspended,
5950 PendingDelete,
5952 PendingCreate,
5954 Maintenance,
5956 Failed,
5959 #[deprecated]
5961 OnlineMaintenance,
5962 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 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 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 #[derive(Clone, Debug, PartialEq)]
6111 #[non_exhaustive]
6112 pub enum SqlNetworkArchitecture {
6113 Unspecified,
6114 NewNetworkArchitecture,
6116 OldNetworkArchitecture,
6118 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6241 pub entitled: std::option::Option<bool>,
6242
6243 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6245 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
6246
6247 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6249 pub oom_session_cancel_enabled: std::option::Option<bool>,
6250
6251 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6253 pub active_query_enabled: std::option::Option<bool>,
6254
6255 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6257 pub index_advisor_enabled: std::option::Option<bool>,
6258
6259 #[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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6347 pub psa_write_endpoint: std::string::String,
6348
6349 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6356 pub failover_dr_replica_name: std::string::String,
6357
6358 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6411 pub major_version: std::option::Option<std::string::String>,
6412
6413 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6416 pub name: std::option::Option<std::string::String>,
6417
6418 #[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 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 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 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#[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 #[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 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
6508pub 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 pub reschedule_type:
6520 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6521
6522 #[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 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 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 #[derive(Clone, Debug, PartialEq)]
6582 #[non_exhaustive]
6583 pub enum RescheduleType {
6584 Unspecified,
6585 Immediate,
6587 NextAvailableWindow,
6590 SpecificTime,
6592 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6714 pub kind: std::string::String,
6715
6716 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6724 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
6725
6726 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6729 pub master_instance_name: std::string::String,
6730
6731 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6734 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
6735
6736 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6808 pub kind: std::string::String,
6809
6810 #[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 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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
6855 #[serde_as(as = "serde_with::DisplayFromStr")]
6856 pub settings_version: i64,
6857
6858 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6899 pub kind: std::string::String,
6900
6901 #[serde(skip_serializing_if = "wkt::internal::is_default")]
6903 #[serde_as(as = "serde_with::DisplayFromStr")]
6904 pub backup_run_id: i64,
6905
6906 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6908 pub instance_id: std::string::String,
6909
6910 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6962 pub kind: std::string::String,
6963
6964 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7005 pub kind: std::string::String,
7006
7007 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7049 pub kind: std::string::String,
7050
7051 #[serde(rename = "type")]
7053 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7054
7055 #[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 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 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 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
7100pub mod sql_external_sync_setting_error {
7102 #[allow(unused_imports)]
7103 use super::*;
7104
7105 #[derive(Clone, Debug, PartialEq)]
7120 #[non_exhaustive]
7121 pub enum SqlExternalSyncSettingErrorType {
7122 Unspecified,
7123 ConnectionFailure,
7124 BinlogNotEnabled,
7125 IncompatibleDatabaseVersion,
7126 ReplicaAlreadySetup,
7127 InsufficientPrivilege,
7129 UnsupportedMigrationType,
7131 NoPglogicalInstalled,
7133 PglogicalNodeAlreadyExists,
7135 InvalidWalLevel,
7137 InvalidSharedPreloadLibrary,
7140 InsufficientMaxReplicationSlots,
7142 InsufficientMaxWalSenders,
7144 InsufficientMaxWorkerProcesses,
7146 UnsupportedExtensions,
7149 InvalidRdsLogicalReplication,
7151 InvalidLoggingSetup,
7153 InvalidDbParam,
7155 UnsupportedGtidMode,
7157 SqlserverAgentNotRunning,
7159 UnsupportedTableDefinition,
7162 UnsupportedDefiner,
7164 SqlserverServernameMismatch,
7166 PrimaryAlreadySetup,
7168 UnsupportedBinlogFormat,
7170 BinlogRetentionSetting,
7172 UnsupportedStorageEngine,
7174 LimitedSupportTables,
7177 ExistingDataInReplica,
7179 MissingOptionalPrivileges,
7181 RiskyBackupAdminPrivilege,
7184 InsufficientGcsPermissions,
7186 InvalidFileInfo,
7189 UnsupportedDatabaseSettings,
7191 MysqlParallelImportInsufficientPrivilege,
7194 LocalInfileOff,
7196 TurnOnPitrAfterPromote,
7199 IncompatibleDatabaseMinorVersion,
7201 SourceMaxSubscriptions,
7204 UnableToVerifyDefiners,
7206 SubscriptionCalculationStatus,
7209 PgSubscriptionCount,
7212 PgSyncParallelLevel,
7214 InsufficientDiskSize,
7217 InsufficientMachineTier,
7221 UnsupportedExtensionsNotMigrated,
7224 ExtensionsNotMigrated,
7227 PgCronFlagEnabledInReplica,
7230 ExtensionsNotEnabledInReplica,
7235 UnsupportedColumns,
7238 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7654 pub host_port: std::string::String,
7655
7656 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7658 pub kind: std::string::String,
7659
7660 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7662 pub username: std::string::String,
7663
7664 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7666 pub password: std::string::String,
7667
7668 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7670 pub ca_certificate: std::string::String,
7671
7672 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7674 pub client_certificate: std::string::String,
7675
7676 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7679 pub client_key: std::string::String,
7680
7681 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7683 pub dump_file_path: std::string::String,
7684
7685 #[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 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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7775 pub kind: std::string::String,
7776
7777 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7784 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
7785
7786 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7792 pub failover_target: std::option::Option<wkt::BoolValue>,
7793
7794 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7862 pub instance: std::string::String,
7863
7864 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7867 pub project: std::string::String,
7868
7869 #[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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7955 pub instance: std::string::String,
7956
7957 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8029 pub operation: std::string::String,
8030
8031 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8071 pub instance: std::string::String,
8072
8073 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8075 pub max_results: u32,
8076
8077 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8080 pub page_token: std::string::String,
8081
8082 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8134 pub kind: std::string::String,
8135
8136 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8138 pub items: std::vec::Vec<crate::model::Operation>,
8139
8140 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8206 pub operation: std::string::String,
8207
8208 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8248 pub value: std::string::String,
8249
8250 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8254 pub expiration_time: std::option::Option<wkt::Timestamp>,
8255
8256 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8258 pub name: std::string::String,
8259
8260 #[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 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 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 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 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#[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 pub code: crate::model::api_warning::SqlApiWarningCode,
8315
8316 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8318 pub message: std::string::String,
8319
8320 #[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 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 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 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
8361pub mod api_warning {
8363 #[allow(unused_imports)]
8364 use super::*;
8365
8366 #[derive(Clone, Debug, PartialEq)]
8381 #[non_exhaustive]
8382 pub enum SqlApiWarningCode {
8383 Unspecified,
8385 RegionUnreachable,
8388 MaxResultsExceedsLimit,
8391 CompromisedCredentials,
8394 InternalStateFailure,
8397 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 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 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#[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 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
8529
8530 #[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 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 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
8572pub mod backup_retention_settings {
8574 #[allow(unused_imports)]
8575 use super::*;
8576
8577 #[derive(Clone, Debug, PartialEq)]
8593 #[non_exhaustive]
8594 pub enum RetentionUnit {
8595 Unspecified,
8597 Count,
8599 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8712 pub start_time: std::string::String,
8713
8714 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8716 pub enabled: std::option::Option<wkt::BoolValue>,
8717
8718 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8720 pub kind: std::string::String,
8721
8722 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8725 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
8726
8727 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8729 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
8730
8731 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8733 pub location: std::string::String,
8734
8735 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8737 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
8738
8739 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8741 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
8742
8743 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8746 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
8747
8748 #[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 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 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 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 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 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 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 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 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 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 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
8865pub mod backup_configuration {
8867 #[allow(unused_imports)]
8868 use super::*;
8869
8870 #[derive(Clone, Debug, PartialEq)]
8887 #[non_exhaustive]
8888 pub enum TransactionalLogStorageState {
8889 Unspecified,
8891 Disk,
8894 SwitchingToCloudStorage,
8898 SwitchedToCloudStorage,
8902 CloudStorage,
8905 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
9073 #[serde_as(as = "serde_with::DisplayFromStr")]
9074 pub backup_id: i64,
9075
9076 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9116 pub kind: std::string::String,
9117
9118 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9120 pub charset: std::string::String,
9121
9122 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9124 pub collation: std::string::String,
9125
9126 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9129 pub etag: std::string::String,
9130
9131 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9134 pub name: std::string::String,
9135
9136 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9138 pub instance: std::string::String,
9139
9140 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9142 pub self_link: std::string::String,
9143
9144 #[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 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 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 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 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 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 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 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 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 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 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 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
9262pub 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
9284 pub compatibility_level: i32,
9285
9286 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9330 pub name: std::string::String,
9331
9332 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9412 pub name: std::string::String,
9413
9414 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9456 pub name: std::string::String,
9457
9458 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9460 pub region: std::string::String,
9461
9462 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9510 pub kind: std::string::String,
9511
9512 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9565 pub kind: std::string::String,
9566
9567 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9569 pub username: std::string::String,
9570
9571 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9573 pub password: std::string::String,
9574
9575 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9579 pub client_key: std::string::String,
9580
9581 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9583 pub client_certificate: std::string::String,
9584
9585 #[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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9656 pub uri: std::string::String,
9657
9658 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9671 pub databases: std::vec::Vec<std::string::String>,
9672
9673 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9675 pub kind: std::string::String,
9676
9677 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9679 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
9680
9681 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9684 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
9685
9686 pub file_type: crate::model::SqlFileType,
9688
9689 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9691 pub offload: std::option::Option<wkt::BoolValue>,
9692
9693 #[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 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 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 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 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 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 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 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 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
9784pub 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9796 pub select_query: std::string::String,
9797
9798 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9801 pub escape_character: std::string::String,
9802
9803 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9805 pub quote_character: std::string::String,
9806
9807 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9810 pub fields_terminated_by: std::string::String,
9811
9812 #[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 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 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 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 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 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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9887 pub tables: std::vec::Vec<std::string::String>,
9888
9889 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9900 pub threads: std::option::Option<wkt::Int32Value>,
9901
9902 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9904 pub parallel: std::option::Option<wkt::BoolValue>,
9905
9906 #[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 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 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 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 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 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 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 pub mod sql_export_options {
9998 #[allow(unused_imports)]
9999 use super::*;
10000
10001 #[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 #[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 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 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10051 pub clean: std::option::Option<wkt::BoolValue>,
10052
10053 #[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 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 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 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10101 pub striped: std::option::Option<wkt::BoolValue>,
10102
10103 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10107 pub stripe_count: std::option::Option<wkt::Int32Value>,
10108
10109 pub bak_type: crate::model::BakType,
10111
10112 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10114 #[deprecated]
10115 pub copy_only: std::option::Option<wkt::BoolValue>,
10116
10117 #[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 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 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 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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10193 pub uri: std::string::String,
10194
10195 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10200 pub database: std::string::String,
10201
10202 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10204 pub kind: std::string::String,
10205
10206 pub file_type: crate::model::SqlFileType,
10209
10210 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10212 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
10213
10214 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10216 pub import_user: std::string::String,
10217
10218 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10220 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
10221
10222 #[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 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 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 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 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 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 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 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 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
10305pub 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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10317 pub threads: std::option::Option<wkt::Int32Value>,
10318
10319 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10321 pub parallel: std::option::Option<wkt::BoolValue>,
10322
10323 #[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 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 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 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 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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10391 pub clean: std::option::Option<wkt::BoolValue>,
10392
10393 #[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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10440 pub table: std::string::String,
10441
10442 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10445 pub columns: std::vec::Vec<std::string::String>,
10446
10447 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10450 pub escape_character: std::string::String,
10451
10452 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10454 pub quote_character: std::string::String,
10455
10456 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10459 pub fields_terminated_by: std::string::String,
10460
10461 #[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 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 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 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 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 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 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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10548 pub striped: std::option::Option<wkt::BoolValue>,
10549
10550 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10554 pub no_recovery: std::option::Option<wkt::BoolValue>,
10555
10556 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10561 pub recovery_only: std::option::Option<wkt::BoolValue>,
10562
10563 pub bak_type: crate::model::BakType,
10565
10566 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10571 pub stop_at: std::option::Option<wkt::Timestamp>,
10572
10573 #[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 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 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 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 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 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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10675 pub cert_path: std::string::String,
10676
10677 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10681 pub pvk_path: std::string::String,
10682
10683 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10740 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
10741
10742 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10747 pub private_network: std::string::String,
10748
10749 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10759 pub require_ssl: std::option::Option<wkt::BoolValue>,
10760
10761 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10765 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
10766
10767 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10774 pub allocated_ip_range: std::string::String,
10775
10776 #[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 pub ssl_mode: crate::model::ip_configuration::SslMode,
10804
10805 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10807 pub psc_config: std::option::Option<crate::model::PscConfig>,
10808
10809 #[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 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 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 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 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 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 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 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 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 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
10913pub mod ip_configuration {
10915 #[allow(unused_imports)]
10916 use super::*;
10917
10918 #[derive(Clone, Debug, PartialEq)]
10934 #[non_exhaustive]
10935 pub enum SslMode {
10936 Unspecified,
10938 AllowUnencryptedAndEncrypted,
10945 EncryptedOnly,
10952 TrustedClientCertificateRequired,
10967 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 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 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 #[derive(Clone, Debug, PartialEq)]
11100 #[non_exhaustive]
11101 pub enum CaMode {
11102 Unspecified,
11104 GoogleManagedInternalCa,
11106 GoogleManagedCasCa,
11109 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11228 pub psc_enabled: std::option::Option<bool>,
11229
11230 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11287 #[deprecated]
11288 pub follow_gae_application: std::string::String,
11289
11290 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11293 pub zone: std::string::String,
11294
11295 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11299 pub secondary_zone: std::string::String,
11300
11301 #[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 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11358 pub hour: std::option::Option<wkt::Int32Value>,
11359
11360 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11364 pub day: std::option::Option<wkt::Int32Value>,
11365
11366 pub update_track: crate::model::SqlUpdateTrack,
11370
11371 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11436 pub start_date: std::string::String,
11437
11438 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11443 pub end_date: std::string::String,
11444
11445 #[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 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 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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
11493 pub query_insights_enabled: bool,
11494
11495 #[serde(skip_serializing_if = "wkt::internal::is_default")]
11497 pub record_client_address: bool,
11498
11499 #[serde(skip_serializing_if = "wkt::internal::is_default")]
11502 pub record_application_tags: bool,
11503
11504 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11509 pub query_string_length: std::option::Option<wkt::Int32Value>,
11510
11511 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11583 pub dump_file_path: std::string::String,
11584
11585 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11587 pub username: std::string::String,
11588
11589 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11591 pub password: std::string::String,
11592
11593 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11595 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
11596
11597 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11604 pub ca_certificate: std::string::String,
11605
11606 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11608 pub client_certificate: std::string::String,
11609
11610 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11613 pub client_key: std::string::String,
11614
11615 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11617 pub ssl_cipher: std::string::String,
11618
11619 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11622 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
11623
11624 #[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 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 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 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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11736 pub kms_key_name: std::string::String,
11737
11738 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11778 pub kms_key_version_name: std::string::String,
11779
11780 #[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 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 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#[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 #[serde(rename = "type")]
11826 pub r#type: crate::model::SqlIpAddressType,
11827
11828 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11830 pub ip_address: std::string::String,
11831
11832 #[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 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 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 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#[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 #[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 pub status: crate::model::operation::SqlOperationStatus,
11893
11894 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11896 pub user: std::string::String,
11897
11898 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11902 pub insert_time: std::option::Option<wkt::Timestamp>,
11903
11904 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11908 pub start_time: std::option::Option<wkt::Timestamp>,
11909
11910 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11914 pub end_time: std::option::Option<wkt::Timestamp>,
11915
11916 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11919 pub error: std::option::Option<crate::model::OperationErrors>,
11920
11921 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11923 pub api_warning: std::option::Option<crate::model::ApiWarning>,
11924
11925 pub operation_type: crate::model::operation::SqlOperationType,
11940
11941 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11943 pub import_context: std::option::Option<crate::model::ImportContext>,
11944
11945 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11947 pub export_context: std::option::Option<crate::model::ExportContext>,
11948
11949 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11951 pub backup_context: std::option::Option<crate::model::BackupContext>,
11952
11953 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11957 pub name: std::string::String,
11958
11959 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11961 pub target_id: std::string::String,
11962
11963 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11965 pub self_link: std::string::String,
11966
11967 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11969 pub target_project: std::string::String,
11970
11971 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
12140pub mod operation {
12142 #[allow(unused_imports)]
12143 use super::*;
12144
12145 #[derive(Clone, Debug, PartialEq)]
12161 #[non_exhaustive]
12162 pub enum SqlOperationType {
12163 Unspecified,
12165 Import,
12167 Export,
12170 Create,
12172 Update,
12174 Delete,
12176 Restart,
12178 #[deprecated]
12179 Backup,
12180 #[deprecated]
12181 Snapshot,
12182 BackupVolume,
12184 DeleteVolume,
12186 RestoreVolume,
12188 InjectUser,
12190 Clone,
12192 StopReplica,
12194 StartReplica,
12196 PromoteReplica,
12198 CreateReplica,
12200 CreateUser,
12202 DeleteUser,
12204 UpdateUser,
12206 CreateDatabase,
12208 DeleteDatabase,
12210 UpdateDatabase,
12212 Failover,
12215 DeleteBackup,
12217 RecreateReplica,
12218 TruncateLog,
12220 DemoteMaster,
12223 Maintenance,
12226 #[deprecated]
12228 EnablePrivateIp,
12229 #[deprecated]
12230 DeferMaintenance,
12231 #[deprecated]
12233 CreateClone,
12234 RescheduleMaintenance,
12236 StartExternalSync,
12239 LogCleanup,
12241 AutoRestart,
12244 Reencrypt,
12246 Switchover,
12249 AcquireSsrsLease,
12251 ReleaseSsrsLease,
12253 ReconfigureOldPrimary,
12258 ClusterMaintenance,
12264 SelfServiceMaintenance,
12269 SwitchoverToReplica,
12272 MajorVersionUpgrade,
12274 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 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 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 #[derive(Clone, Debug, PartialEq)]
12615 #[non_exhaustive]
12616 pub enum SqlOperationStatus {
12617 Unspecified,
12619 Pending,
12621 Running,
12623 Done,
12625 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12747 pub kind: std::string::String,
12748
12749 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12751 pub code: std::string::String,
12752
12753 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12799 pub kind: std::string::String,
12800
12801 #[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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12846 pub min_length: std::option::Option<wkt::Int32Value>,
12847
12848 pub complexity: crate::model::password_validation_policy::Complexity,
12850
12851 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12853 pub reuse_interval: std::option::Option<wkt::Int32Value>,
12854
12855 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12857 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
12858
12859 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12862 pub password_change_interval: std::option::Option<wkt::Duration>,
12863
12864 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12866 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
12867
12868 #[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 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 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 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 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 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 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 #[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
12964pub mod password_validation_policy {
12966 #[allow(unused_imports)]
12967 use super::*;
12968
12969 #[derive(Clone, Debug, PartialEq)]
12985 #[non_exhaustive]
12986 pub enum Complexity {
12987 Unspecified,
12989 Default,
12992 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 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 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#[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 #[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 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#[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 #[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13145 #[deprecated]
13146 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
13147
13148 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13151 pub tier: std::string::String,
13152
13153 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13155 pub kind: std::string::String,
13156
13157 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13160 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
13161
13162 pub availability_type: crate::model::SqlAvailabilityType,
13172
13173 pub pricing_plan: crate::model::SqlPricingPlan,
13176
13177 #[deprecated]
13181 pub replication_type: crate::model::SqlReplicationType,
13182
13183 #[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 pub activation_policy: crate::model::settings::SqlActivationPolicy,
13197
13198 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13202 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
13203
13204 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13207 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
13208
13209 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13214 pub location_preference: std::option::Option<crate::model::LocationPreference>,
13215
13216 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13218 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
13219
13220 pub data_disk_type: crate::model::SqlDataDiskType,
13223
13224 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13227 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
13228
13229 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13231 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
13232
13233 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13237 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
13238
13239 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13243 #[deprecated]
13244 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
13245
13246 #[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13253 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
13254
13255 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13257 pub collation: std::string::String,
13258
13259 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13261 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
13262
13263 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13265 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
13266
13267 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13269 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
13270
13271 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13273 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
13274
13275 pub edition: crate::model::settings::Edition,
13277
13278 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
13289
13290 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13292 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
13293
13294 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13296 pub time_zone: std::string::String,
13297
13298 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13301 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
13302
13303 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13305 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
13306
13307 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13312 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
13313
13314 #[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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
13678pub mod settings {
13680 #[allow(unused_imports)]
13681 use super::*;
13682
13683 #[derive(Clone, Debug, PartialEq)]
13699 #[non_exhaustive]
13700 pub enum SqlActivationPolicy {
13701 Unspecified,
13703 Always,
13705 Never,
13707 #[deprecated]
13709 OnDemand,
13710 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 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 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 #[derive(Clone, Debug, PartialEq)]
13839 #[non_exhaustive]
13840 pub enum Edition {
13841 Unspecified,
13843 Enterprise,
13845 EnterprisePlus,
13847 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 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 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 #[derive(Clone, Debug, PartialEq)]
13971 #[non_exhaustive]
13972 pub enum ConnectorEnforcement {
13973 Unspecified,
13975 NotRequired,
13977 Required,
13981 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14130 pub kind: std::string::String,
14131
14132 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14134 pub cert_serial_number: std::string::String,
14135
14136 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14138 pub cert: std::string::String,
14139
14140 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14144 pub create_time: std::option::Option<wkt::Timestamp>,
14145
14146 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14148 pub common_name: std::string::String,
14149
14150 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14154 pub expiration_time: std::option::Option<wkt::Timestamp>,
14155
14156 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14158 pub sha1_fingerprint: std::string::String,
14159
14160 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14162 pub instance: std::string::String,
14163
14164 #[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 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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14258 pub cert_info: std::option::Option<crate::model::SslCert>,
14259
14260 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14307 pub kind: std::string::String,
14308
14309 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14349 pub kind: std::string::String,
14350
14351 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14353 pub bucket: std::string::String,
14354
14355 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14357 pub retention_interval: std::option::Option<wkt::Duration>,
14358
14359 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14418 pub setup_login: std::option::Option<std::string::String>,
14419
14420 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14423 pub service_login: std::option::Option<std::string::String>,
14424
14425 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14427 pub report_database: std::option::Option<std::string::String>,
14428
14429 #[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 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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14492 pub instance: std::string::String,
14493
14494 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14496 pub project: std::string::String,
14497
14498 #[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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14546 pub instance: std::string::String,
14547
14548 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14550 pub project: std::string::String,
14551
14552 #[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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14600 pub instance: std::string::String,
14601
14602 #[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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14655 pub instance: std::string::String,
14656
14657 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14730 pub kind: std::string::String,
14731
14732 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14734 pub operation: std::option::Option<crate::model::Operation>,
14735
14736 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14740 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
14741
14742 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14805 pub kind: std::string::String,
14806
14807 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14884 pub kind: std::string::String,
14885
14886 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14932 pub tier: std::string::String,
14933
14934 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14942 pub kind: std::string::String,
14943
14944 #[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 #[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 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 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14971 self.ram = v.into();
14972 self
14973 }
14974
14975 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15012 pub host: std::string::String,
15013
15014 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15016 pub instance: std::string::String,
15017
15018 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15020 pub name: std::string::String,
15021
15022 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15074 pub instance: std::string::String,
15075
15076 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15078 pub name: std::string::String,
15079
15080 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15082 pub project: std::string::String,
15083
15084 #[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 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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15135 pub instance: std::string::String,
15136
15137 #[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 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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15188 pub instance: std::string::String,
15189
15190 #[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 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 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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15229 pub host: std::string::String,
15230
15231 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15233 pub instance: std::string::String,
15234
15235 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15237 pub name: std::string::String,
15238
15239 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
15303 pub allowed_failed_attempts: i32,
15304
15305 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15307 pub password_expiration_duration: std::option::Option<wkt::Duration>,
15308
15309 #[serde(skip_serializing_if = "wkt::internal::is_default")]
15311 pub enable_failed_attempts_check: bool,
15312
15313 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15315 pub status: std::option::Option<crate::model::PasswordStatus>,
15316
15317 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
15384 pub locked: bool,
15385
15386 #[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 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15401 self.locked = v.into();
15402 self
15403 }
15404
15405 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15431 pub kind: std::string::String,
15432
15433 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15435 pub password: std::string::String,
15436
15437 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15440 pub etag: std::string::String,
15441
15442 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15445 pub name: std::string::String,
15446
15447 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15453 pub host: std::string::String,
15454
15455 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15459 pub instance: std::string::String,
15460
15461 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15465 pub project: std::string::String,
15466
15467 #[serde(rename = "type")]
15470 pub r#type: crate::model::user::SqlUserType,
15471
15472 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15474 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
15475
15476 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15478 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
15479
15480 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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
15619pub mod user {
15621 #[allow(unused_imports)]
15622 use super::*;
15623
15624 #[derive(Clone, Debug, PartialEq)]
15640 #[non_exhaustive]
15641 pub enum SqlUserType {
15642 BuiltIn,
15644 CloudIamUser,
15646 CloudIamServiceAccount,
15648 CloudIamGroup,
15650 CloudIamGroupUser,
15652 CloudIamGroupServiceAccount,
15654 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 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 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 #[derive(Clone, Debug, PartialEq)]
15797 #[non_exhaustive]
15798 pub enum DualPasswordType {
15799 Unspecified,
15801 NoModifyDualPassword,
15803 NoDualPassword,
15805 DualPassword,
15807 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 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 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 #[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#[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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
15938 pub disabled: bool,
15939
15940 #[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 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15955 self.disabled = v.into();
15956 self
15957 }
15958
15959 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15985 pub kind: std::string::String,
15986
15987 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15989 pub items: std::vec::Vec<crate::model::User>,
15990
15991 #[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 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 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 #[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#[derive(Clone, Debug, PartialEq)]
16052#[non_exhaustive]
16053pub enum SqlBackupRunStatus {
16054 Unspecified,
16056 Enqueued,
16058 Overdue,
16062 Running,
16064 Failed,
16066 Successful,
16068 Skipped,
16071 DeletionPending,
16073 DeletionFailed,
16075 Deleted,
16077 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 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 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#[derive(Clone, Debug, PartialEq)]
16236#[non_exhaustive]
16237pub enum SqlBackupKind {
16238 Unspecified,
16240 Snapshot,
16242 Physical,
16244 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 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 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#[derive(Clone, Debug, PartialEq)]
16368#[non_exhaustive]
16369pub enum SqlBackupRunType {
16370 Unspecified,
16372 Automated,
16374 OnDemand,
16376 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 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 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#[derive(Clone, Debug, PartialEq)]
16499#[non_exhaustive]
16500pub enum SqlFlagType {
16501 Unspecified,
16503 Boolean,
16505 String,
16507 Integer,
16509 None,
16511 MysqlTimezoneOffset,
16514 Float,
16516 RepeatedString,
16518 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 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 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#[derive(Clone, Debug, PartialEq)]
16667#[non_exhaustive]
16668pub enum ExternalSyncParallelLevel {
16669 Unspecified,
16671 Min,
16673 Optimal,
16675 Max,
16677 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 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 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#[derive(Clone, Debug, PartialEq)]
16809#[non_exhaustive]
16810pub enum SqlInstanceType {
16811 Unspecified,
16813 CloudSqlInstance,
16816 OnPremisesInstance,
16819 ReadReplicaInstance,
16821 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 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 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#[derive(Clone, Debug, PartialEq)]
16950#[non_exhaustive]
16951pub enum SqlSuspensionReason {
16952 Unspecified,
16954 BillingIssue,
16957 LegalIssue,
16960 OperationalIssue,
16963 KmsKeyIssue,
16965 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 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 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#[derive(Clone, Debug, PartialEq)]
17098#[non_exhaustive]
17099pub enum SqlFileType {
17100 Unspecified,
17102 Sql,
17104 Csv,
17106 Bak,
17107 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 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 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#[derive(Clone, Debug, PartialEq)]
17235#[non_exhaustive]
17236pub enum BakType {
17237 Unspecified,
17239 Full,
17241 Diff,
17243 Tlog,
17245 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 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 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#[derive(Clone, Debug, PartialEq)]
17373#[non_exhaustive]
17374pub enum SqlBackendType {
17375 Unspecified,
17377 #[deprecated]
17379 FirstGen,
17380 SecondGen,
17382 External,
17384 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 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 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#[derive(Clone, Debug, PartialEq)]
17512#[non_exhaustive]
17513pub enum SqlIpAddressType {
17514 Unspecified,
17516 Primary,
17519 Outgoing,
17524 Private,
17526 Migrated1StGen,
17530 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 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 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#[derive(Clone, Debug, PartialEq)]
17664#[non_exhaustive]
17665pub enum SqlDatabaseVersion {
17666 Unspecified,
17668 #[deprecated]
17670 Mysql51,
17671 #[deprecated]
17673 Mysql55,
17674 Mysql56,
17676 Mysql57,
17678 Sqlserver2017Standard,
17680 Sqlserver2017Enterprise,
17682 Sqlserver2017Express,
17684 Sqlserver2017Web,
17686 Postgres96,
17688 Postgres10,
17690 Postgres11,
17692 Postgres12,
17694 Postgres13,
17696 Postgres14,
17698 Postgres15,
17700 Postgres16,
17702 Mysql80,
17704 Mysql8018,
17706 Mysql8026,
17708 Mysql8027,
17710 Mysql8028,
17712 #[deprecated]
17714 Mysql8029,
17715 Mysql8030,
17717 Mysql8031,
17719 Mysql8032,
17721 Mysql8033,
17723 Mysql8034,
17725 Mysql8035,
17727 Mysql8036,
17729 Mysql8037,
17731 Mysql8038,
17733 Mysql8039,
17735 Mysql8040,
17737 Mysql84,
17739 Mysql840,
17741 Sqlserver2019Standard,
17743 Sqlserver2019Enterprise,
17745 Sqlserver2019Express,
17747 Sqlserver2019Web,
17749 Sqlserver2022Standard,
17751 Sqlserver2022Enterprise,
17753 Sqlserver2022Express,
17755 Sqlserver2022Web,
17757 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 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 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#[derive(Clone, Debug, PartialEq)]
18086#[non_exhaustive]
18087pub enum SqlPricingPlan {
18088 Unspecified,
18090 Package,
18092 PerUse,
18094 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 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 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#[derive(Clone, Debug, PartialEq)]
18217#[non_exhaustive]
18218pub enum SqlReplicationType {
18219 Unspecified,
18221 Synchronous,
18224 Asynchronous,
18229 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 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 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#[derive(Clone, Debug, PartialEq)]
18353#[non_exhaustive]
18354pub enum SqlDataDiskType {
18355 Unspecified,
18357 PdSsd,
18359 PdHdd,
18361 #[deprecated]
18364 ObsoleteLocalSsd,
18365 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 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 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#[derive(Clone, Debug, PartialEq)]
18494#[non_exhaustive]
18495pub enum SqlAvailabilityType {
18496 Unspecified,
18498 Zonal,
18500 Regional,
18502 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 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 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#[derive(Clone, Debug, PartialEq)]
18625#[non_exhaustive]
18626pub enum SqlUpdateTrack {
18627 Unspecified,
18629 Canary,
18634 Stable,
18639 Week5,
18643 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 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 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}