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
33mod debug;
34mod deserialize;
35mod serialize;
36
37#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct SqlBackupRunsDeleteRequest {
41 pub id: i64,
45
46 pub instance: std::string::String,
48
49 pub project: std::string::String,
51
52 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl SqlBackupRunsDeleteRequest {
56 pub fn new() -> Self {
57 std::default::Default::default()
58 }
59
60 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
62 self.id = v.into();
63 self
64 }
65
66 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
68 self.instance = v.into();
69 self
70 }
71
72 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74 self.project = v.into();
75 self
76 }
77}
78
79impl wkt::message::Message for SqlBackupRunsDeleteRequest {
80 fn typename() -> &'static str {
81 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
82 }
83}
84
85#[derive(Clone, Default, PartialEq)]
87#[non_exhaustive]
88pub struct SqlBackupRunsGetRequest {
89 pub id: i64,
91
92 pub instance: std::string::String,
94
95 pub project: std::string::String,
97
98 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
99}
100
101impl SqlBackupRunsGetRequest {
102 pub fn new() -> Self {
103 std::default::Default::default()
104 }
105
106 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
108 self.id = v.into();
109 self
110 }
111
112 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114 self.instance = v.into();
115 self
116 }
117
118 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.project = v.into();
121 self
122 }
123}
124
125impl wkt::message::Message for SqlBackupRunsGetRequest {
126 fn typename() -> &'static str {
127 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
128 }
129}
130
131#[derive(Clone, Default, PartialEq)]
133#[non_exhaustive]
134pub struct SqlBackupRunsInsertRequest {
135 pub instance: std::string::String,
137
138 pub project: std::string::String,
140
141 pub body: std::option::Option<crate::model::BackupRun>,
142
143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
144}
145
146impl SqlBackupRunsInsertRequest {
147 pub fn new() -> Self {
148 std::default::Default::default()
149 }
150
151 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153 self.instance = v.into();
154 self
155 }
156
157 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
159 self.project = v.into();
160 self
161 }
162
163 pub fn set_body<T>(mut self, v: T) -> Self
165 where
166 T: std::convert::Into<crate::model::BackupRun>,
167 {
168 self.body = std::option::Option::Some(v.into());
169 self
170 }
171
172 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
174 where
175 T: std::convert::Into<crate::model::BackupRun>,
176 {
177 self.body = v.map(|x| x.into());
178 self
179 }
180}
181
182impl wkt::message::Message for SqlBackupRunsInsertRequest {
183 fn typename() -> &'static str {
184 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
185 }
186}
187
188#[derive(Clone, Default, PartialEq)]
190#[non_exhaustive]
191pub struct SqlBackupRunsListRequest {
192 pub instance: std::string::String,
195
196 pub max_results: i32,
198
199 pub page_token: std::string::String,
202
203 pub project: std::string::String,
205
206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
207}
208
209impl SqlBackupRunsListRequest {
210 pub fn new() -> Self {
211 std::default::Default::default()
212 }
213
214 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
216 self.instance = v.into();
217 self
218 }
219
220 pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
222 self.max_results = v.into();
223 self
224 }
225
226 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
228 self.page_token = v.into();
229 self
230 }
231
232 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
234 self.project = v.into();
235 self
236 }
237}
238
239impl wkt::message::Message for SqlBackupRunsListRequest {
240 fn typename() -> &'static str {
241 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
242 }
243}
244
245#[derive(Clone, Default, PartialEq)]
247#[non_exhaustive]
248pub struct BackupRun {
249 pub kind: std::string::String,
251
252 pub status: crate::model::SqlBackupRunStatus,
254
255 pub enqueued_time: std::option::Option<wkt::Timestamp>,
259
260 pub id: i64,
263
264 pub start_time: std::option::Option<wkt::Timestamp>,
268
269 pub end_time: std::option::Option<wkt::Timestamp>,
273
274 pub error: std::option::Option<crate::model::OperationError>,
277
278 pub r#type: crate::model::SqlBackupRunType,
282
283 pub description: std::string::String,
285
286 pub window_start_time: std::option::Option<wkt::Timestamp>,
290
291 pub instance: std::string::String,
293
294 pub self_link: std::string::String,
296
297 pub location: std::string::String,
299
300 pub disk_encryption_configuration:
302 std::option::Option<crate::model::DiskEncryptionConfiguration>,
303
304 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
306
307 pub backup_kind: crate::model::SqlBackupKind,
309
310 pub time_zone: std::string::String,
313
314 pub max_chargeable_bytes: std::option::Option<i64>,
316
317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
318}
319
320impl BackupRun {
321 pub fn new() -> Self {
322 std::default::Default::default()
323 }
324
325 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
327 self.kind = v.into();
328 self
329 }
330
331 pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
333 mut self,
334 v: T,
335 ) -> Self {
336 self.status = v.into();
337 self
338 }
339
340 pub fn set_enqueued_time<T>(mut self, v: T) -> Self
342 where
343 T: std::convert::Into<wkt::Timestamp>,
344 {
345 self.enqueued_time = std::option::Option::Some(v.into());
346 self
347 }
348
349 pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
351 where
352 T: std::convert::Into<wkt::Timestamp>,
353 {
354 self.enqueued_time = v.map(|x| x.into());
355 self
356 }
357
358 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
360 self.id = v.into();
361 self
362 }
363
364 pub fn set_start_time<T>(mut self, v: T) -> Self
366 where
367 T: std::convert::Into<wkt::Timestamp>,
368 {
369 self.start_time = std::option::Option::Some(v.into());
370 self
371 }
372
373 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
375 where
376 T: std::convert::Into<wkt::Timestamp>,
377 {
378 self.start_time = v.map(|x| x.into());
379 self
380 }
381
382 pub fn set_end_time<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<wkt::Timestamp>,
386 {
387 self.end_time = std::option::Option::Some(v.into());
388 self
389 }
390
391 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
393 where
394 T: std::convert::Into<wkt::Timestamp>,
395 {
396 self.end_time = v.map(|x| x.into());
397 self
398 }
399
400 pub fn set_error<T>(mut self, v: T) -> Self
402 where
403 T: std::convert::Into<crate::model::OperationError>,
404 {
405 self.error = std::option::Option::Some(v.into());
406 self
407 }
408
409 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
411 where
412 T: std::convert::Into<crate::model::OperationError>,
413 {
414 self.error = v.map(|x| x.into());
415 self
416 }
417
418 pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
420 self.r#type = v.into();
421 self
422 }
423
424 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
426 self.description = v.into();
427 self
428 }
429
430 pub fn set_window_start_time<T>(mut self, v: T) -> Self
432 where
433 T: std::convert::Into<wkt::Timestamp>,
434 {
435 self.window_start_time = std::option::Option::Some(v.into());
436 self
437 }
438
439 pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
441 where
442 T: std::convert::Into<wkt::Timestamp>,
443 {
444 self.window_start_time = v.map(|x| x.into());
445 self
446 }
447
448 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
450 self.instance = v.into();
451 self
452 }
453
454 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
456 self.self_link = v.into();
457 self
458 }
459
460 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
462 self.location = v.into();
463 self
464 }
465
466 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
468 where
469 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
470 {
471 self.disk_encryption_configuration = std::option::Option::Some(v.into());
472 self
473 }
474
475 pub fn set_or_clear_disk_encryption_configuration<T>(
477 mut self,
478 v: std::option::Option<T>,
479 ) -> Self
480 where
481 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
482 {
483 self.disk_encryption_configuration = v.map(|x| x.into());
484 self
485 }
486
487 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
489 where
490 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
491 {
492 self.disk_encryption_status = std::option::Option::Some(v.into());
493 self
494 }
495
496 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
498 where
499 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
500 {
501 self.disk_encryption_status = v.map(|x| x.into());
502 self
503 }
504
505 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
507 mut self,
508 v: T,
509 ) -> Self {
510 self.backup_kind = v.into();
511 self
512 }
513
514 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
516 self.time_zone = v.into();
517 self
518 }
519
520 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
522 where
523 T: std::convert::Into<i64>,
524 {
525 self.max_chargeable_bytes = std::option::Option::Some(v.into());
526 self
527 }
528
529 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
531 where
532 T: std::convert::Into<i64>,
533 {
534 self.max_chargeable_bytes = v.map(|x| x.into());
535 self
536 }
537}
538
539impl wkt::message::Message for BackupRun {
540 fn typename() -> &'static str {
541 "type.googleapis.com/google.cloud.sql.v1.BackupRun"
542 }
543}
544
545#[derive(Clone, Default, PartialEq)]
547#[non_exhaustive]
548pub struct BackupRunsListResponse {
549 pub kind: std::string::String,
551
552 pub items: std::vec::Vec<crate::model::BackupRun>,
554
555 pub next_page_token: std::string::String,
558
559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl BackupRunsListResponse {
563 pub fn new() -> Self {
564 std::default::Default::default()
565 }
566
567 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
569 self.kind = v.into();
570 self
571 }
572
573 pub fn set_items<T, V>(mut self, v: T) -> Self
575 where
576 T: std::iter::IntoIterator<Item = V>,
577 V: std::convert::Into<crate::model::BackupRun>,
578 {
579 use std::iter::Iterator;
580 self.items = v.into_iter().map(|i| i.into()).collect();
581 self
582 }
583
584 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
586 self.next_page_token = v.into();
587 self
588 }
589}
590
591impl wkt::message::Message for BackupRunsListResponse {
592 fn typename() -> &'static str {
593 "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
594 }
595}
596
597#[doc(hidden)]
598impl gax::paginator::internal::PageableResponse for BackupRunsListResponse {
599 type PageItem = crate::model::BackupRun;
600
601 fn items(self) -> std::vec::Vec<Self::PageItem> {
602 self.items
603 }
604
605 fn next_page_token(&self) -> std::string::String {
606 use std::clone::Clone;
607 self.next_page_token.clone()
608 }
609}
610
611#[derive(Clone, Default, PartialEq)]
613#[non_exhaustive]
614pub struct GetConnectSettingsRequest {
615 pub instance: std::string::String,
617
618 pub project: std::string::String,
620
621 pub read_time: std::option::Option<wkt::Timestamp>,
624
625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
626}
627
628impl GetConnectSettingsRequest {
629 pub fn new() -> Self {
630 std::default::Default::default()
631 }
632
633 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
635 self.instance = v.into();
636 self
637 }
638
639 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
641 self.project = v.into();
642 self
643 }
644
645 pub fn set_read_time<T>(mut self, v: T) -> Self
647 where
648 T: std::convert::Into<wkt::Timestamp>,
649 {
650 self.read_time = std::option::Option::Some(v.into());
651 self
652 }
653
654 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
656 where
657 T: std::convert::Into<wkt::Timestamp>,
658 {
659 self.read_time = v.map(|x| x.into());
660 self
661 }
662}
663
664impl wkt::message::Message for GetConnectSettingsRequest {
665 fn typename() -> &'static str {
666 "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
667 }
668}
669
670#[derive(Clone, Default, PartialEq)]
672#[non_exhaustive]
673pub struct ConnectSettings {
674 pub kind: std::string::String,
676
677 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
679
680 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
682
683 pub region: std::string::String,
686
687 pub database_version: crate::model::SqlDatabaseVersion,
699
700 pub backend_type: crate::model::SqlBackendType,
705
706 pub psc_enabled: bool,
708
709 pub dns_name: std::string::String,
711
712 pub server_ca_mode: crate::model::connect_settings::CaMode,
714
715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
716}
717
718impl ConnectSettings {
719 pub fn new() -> Self {
720 std::default::Default::default()
721 }
722
723 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
725 self.kind = v.into();
726 self
727 }
728
729 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
731 where
732 T: std::convert::Into<crate::model::SslCert>,
733 {
734 self.server_ca_cert = std::option::Option::Some(v.into());
735 self
736 }
737
738 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
740 where
741 T: std::convert::Into<crate::model::SslCert>,
742 {
743 self.server_ca_cert = v.map(|x| x.into());
744 self
745 }
746
747 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
749 where
750 T: std::iter::IntoIterator<Item = V>,
751 V: std::convert::Into<crate::model::IpMapping>,
752 {
753 use std::iter::Iterator;
754 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
755 self
756 }
757
758 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
760 self.region = v.into();
761 self
762 }
763
764 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
766 mut self,
767 v: T,
768 ) -> Self {
769 self.database_version = v.into();
770 self
771 }
772
773 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
775 mut self,
776 v: T,
777 ) -> Self {
778 self.backend_type = v.into();
779 self
780 }
781
782 pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
784 self.psc_enabled = v.into();
785 self
786 }
787
788 pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790 self.dns_name = v.into();
791 self
792 }
793
794 pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
796 mut self,
797 v: T,
798 ) -> Self {
799 self.server_ca_mode = v.into();
800 self
801 }
802}
803
804impl wkt::message::Message for ConnectSettings {
805 fn typename() -> &'static str {
806 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
807 }
808}
809
810pub mod connect_settings {
812 #[allow(unused_imports)]
813 use super::*;
814
815 #[derive(Clone, Debug, PartialEq)]
831 #[non_exhaustive]
832 pub enum CaMode {
833 Unspecified,
835 GoogleManagedInternalCa,
837 GoogleManagedCasCa,
840 UnknownValue(ca_mode::UnknownValue),
845 }
846
847 #[doc(hidden)]
848 pub mod ca_mode {
849 #[allow(unused_imports)]
850 use super::*;
851 #[derive(Clone, Debug, PartialEq)]
852 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
853 }
854
855 impl CaMode {
856 pub fn value(&self) -> std::option::Option<i32> {
861 match self {
862 Self::Unspecified => std::option::Option::Some(0),
863 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
864 Self::GoogleManagedCasCa => std::option::Option::Some(2),
865 Self::UnknownValue(u) => u.0.value(),
866 }
867 }
868
869 pub fn name(&self) -> std::option::Option<&str> {
874 match self {
875 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
876 Self::GoogleManagedInternalCa => {
877 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
878 }
879 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
880 Self::UnknownValue(u) => u.0.name(),
881 }
882 }
883 }
884
885 impl std::default::Default for CaMode {
886 fn default() -> Self {
887 use std::convert::From;
888 Self::from(0)
889 }
890 }
891
892 impl std::fmt::Display for CaMode {
893 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
894 wkt::internal::display_enum(f, self.name(), self.value())
895 }
896 }
897
898 impl std::convert::From<i32> for CaMode {
899 fn from(value: i32) -> Self {
900 match value {
901 0 => Self::Unspecified,
902 1 => Self::GoogleManagedInternalCa,
903 2 => Self::GoogleManagedCasCa,
904 _ => Self::UnknownValue(ca_mode::UnknownValue(
905 wkt::internal::UnknownEnumValue::Integer(value),
906 )),
907 }
908 }
909 }
910
911 impl std::convert::From<&str> for CaMode {
912 fn from(value: &str) -> Self {
913 use std::string::ToString;
914 match value {
915 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
916 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
917 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
918 _ => Self::UnknownValue(ca_mode::UnknownValue(
919 wkt::internal::UnknownEnumValue::String(value.to_string()),
920 )),
921 }
922 }
923 }
924
925 impl serde::ser::Serialize for CaMode {
926 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
927 where
928 S: serde::Serializer,
929 {
930 match self {
931 Self::Unspecified => serializer.serialize_i32(0),
932 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
933 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
934 Self::UnknownValue(u) => u.0.serialize(serializer),
935 }
936 }
937 }
938
939 impl<'de> serde::de::Deserialize<'de> for CaMode {
940 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
941 where
942 D: serde::Deserializer<'de>,
943 {
944 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
945 ".google.cloud.sql.v1.ConnectSettings.CaMode",
946 ))
947 }
948 }
949}
950
951#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct GenerateEphemeralCertRequest {
955 pub instance: std::string::String,
957
958 pub project: std::string::String,
960
961 pub public_key: std::string::String,
963
964 pub access_token: std::string::String,
966
967 pub read_time: std::option::Option<wkt::Timestamp>,
970
971 pub valid_duration: std::option::Option<wkt::Duration>,
973
974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
975}
976
977impl GenerateEphemeralCertRequest {
978 pub fn new() -> Self {
979 std::default::Default::default()
980 }
981
982 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
984 self.instance = v.into();
985 self
986 }
987
988 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
990 self.project = v.into();
991 self
992 }
993
994 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
996 self.public_key = v.into();
997 self
998 }
999
1000 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.access_token = v.into();
1003 self
1004 }
1005
1006 pub fn set_read_time<T>(mut self, v: T) -> Self
1008 where
1009 T: std::convert::Into<wkt::Timestamp>,
1010 {
1011 self.read_time = std::option::Option::Some(v.into());
1012 self
1013 }
1014
1015 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1017 where
1018 T: std::convert::Into<wkt::Timestamp>,
1019 {
1020 self.read_time = v.map(|x| x.into());
1021 self
1022 }
1023
1024 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1026 where
1027 T: std::convert::Into<wkt::Duration>,
1028 {
1029 self.valid_duration = std::option::Option::Some(v.into());
1030 self
1031 }
1032
1033 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1035 where
1036 T: std::convert::Into<wkt::Duration>,
1037 {
1038 self.valid_duration = v.map(|x| x.into());
1039 self
1040 }
1041}
1042
1043impl wkt::message::Message for GenerateEphemeralCertRequest {
1044 fn typename() -> &'static str {
1045 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
1046 }
1047}
1048
1049#[derive(Clone, Default, PartialEq)]
1051#[non_exhaustive]
1052pub struct GenerateEphemeralCertResponse {
1053 pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
1055
1056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1057}
1058
1059impl GenerateEphemeralCertResponse {
1060 pub fn new() -> Self {
1061 std::default::Default::default()
1062 }
1063
1064 pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
1066 where
1067 T: std::convert::Into<crate::model::SslCert>,
1068 {
1069 self.ephemeral_cert = std::option::Option::Some(v.into());
1070 self
1071 }
1072
1073 pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
1075 where
1076 T: std::convert::Into<crate::model::SslCert>,
1077 {
1078 self.ephemeral_cert = v.map(|x| x.into());
1079 self
1080 }
1081}
1082
1083impl wkt::message::Message for GenerateEphemeralCertResponse {
1084 fn typename() -> &'static str {
1085 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
1086 }
1087}
1088
1089#[derive(Clone, Default, PartialEq)]
1091#[non_exhaustive]
1092pub struct SqlDatabasesDeleteRequest {
1093 pub database: std::string::String,
1095
1096 pub instance: std::string::String,
1098
1099 pub project: std::string::String,
1101
1102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1103}
1104
1105impl SqlDatabasesDeleteRequest {
1106 pub fn new() -> Self {
1107 std::default::Default::default()
1108 }
1109
1110 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.database = v.into();
1113 self
1114 }
1115
1116 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118 self.instance = v.into();
1119 self
1120 }
1121
1122 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.project = v.into();
1125 self
1126 }
1127}
1128
1129impl wkt::message::Message for SqlDatabasesDeleteRequest {
1130 fn typename() -> &'static str {
1131 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
1132 }
1133}
1134
1135#[derive(Clone, Default, PartialEq)]
1137#[non_exhaustive]
1138pub struct SqlDatabasesGetRequest {
1139 pub database: std::string::String,
1141
1142 pub instance: std::string::String,
1144
1145 pub project: std::string::String,
1147
1148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1149}
1150
1151impl SqlDatabasesGetRequest {
1152 pub fn new() -> Self {
1153 std::default::Default::default()
1154 }
1155
1156 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1158 self.database = v.into();
1159 self
1160 }
1161
1162 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.instance = v.into();
1165 self
1166 }
1167
1168 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1170 self.project = v.into();
1171 self
1172 }
1173}
1174
1175impl wkt::message::Message for SqlDatabasesGetRequest {
1176 fn typename() -> &'static str {
1177 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
1178 }
1179}
1180
1181#[derive(Clone, Default, PartialEq)]
1183#[non_exhaustive]
1184pub struct SqlDatabasesInsertRequest {
1185 pub instance: std::string::String,
1187
1188 pub project: std::string::String,
1190
1191 pub body: std::option::Option<crate::model::Database>,
1192
1193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1194}
1195
1196impl SqlDatabasesInsertRequest {
1197 pub fn new() -> Self {
1198 std::default::Default::default()
1199 }
1200
1201 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1203 self.instance = v.into();
1204 self
1205 }
1206
1207 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.project = v.into();
1210 self
1211 }
1212
1213 pub fn set_body<T>(mut self, v: T) -> Self
1215 where
1216 T: std::convert::Into<crate::model::Database>,
1217 {
1218 self.body = std::option::Option::Some(v.into());
1219 self
1220 }
1221
1222 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1224 where
1225 T: std::convert::Into<crate::model::Database>,
1226 {
1227 self.body = v.map(|x| x.into());
1228 self
1229 }
1230}
1231
1232impl wkt::message::Message for SqlDatabasesInsertRequest {
1233 fn typename() -> &'static str {
1234 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
1235 }
1236}
1237
1238#[derive(Clone, Default, PartialEq)]
1240#[non_exhaustive]
1241pub struct SqlDatabasesListRequest {
1242 pub instance: std::string::String,
1244
1245 pub project: std::string::String,
1247
1248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1249}
1250
1251impl SqlDatabasesListRequest {
1252 pub fn new() -> Self {
1253 std::default::Default::default()
1254 }
1255
1256 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1258 self.instance = v.into();
1259 self
1260 }
1261
1262 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1264 self.project = v.into();
1265 self
1266 }
1267}
1268
1269impl wkt::message::Message for SqlDatabasesListRequest {
1270 fn typename() -> &'static str {
1271 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
1272 }
1273}
1274
1275#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct SqlDatabasesUpdateRequest {
1279 pub database: std::string::String,
1281
1282 pub instance: std::string::String,
1284
1285 pub project: std::string::String,
1287
1288 pub body: std::option::Option<crate::model::Database>,
1289
1290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1291}
1292
1293impl SqlDatabasesUpdateRequest {
1294 pub fn new() -> Self {
1295 std::default::Default::default()
1296 }
1297
1298 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.database = v.into();
1301 self
1302 }
1303
1304 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.instance = v.into();
1307 self
1308 }
1309
1310 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1312 self.project = v.into();
1313 self
1314 }
1315
1316 pub fn set_body<T>(mut self, v: T) -> Self
1318 where
1319 T: std::convert::Into<crate::model::Database>,
1320 {
1321 self.body = std::option::Option::Some(v.into());
1322 self
1323 }
1324
1325 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1327 where
1328 T: std::convert::Into<crate::model::Database>,
1329 {
1330 self.body = v.map(|x| x.into());
1331 self
1332 }
1333}
1334
1335impl wkt::message::Message for SqlDatabasesUpdateRequest {
1336 fn typename() -> &'static str {
1337 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
1338 }
1339}
1340
1341#[derive(Clone, Default, PartialEq)]
1343#[non_exhaustive]
1344pub struct DatabasesListResponse {
1345 pub kind: std::string::String,
1347
1348 pub items: std::vec::Vec<crate::model::Database>,
1350
1351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1352}
1353
1354impl DatabasesListResponse {
1355 pub fn new() -> Self {
1356 std::default::Default::default()
1357 }
1358
1359 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1361 self.kind = v.into();
1362 self
1363 }
1364
1365 pub fn set_items<T, V>(mut self, v: T) -> Self
1367 where
1368 T: std::iter::IntoIterator<Item = V>,
1369 V: std::convert::Into<crate::model::Database>,
1370 {
1371 use std::iter::Iterator;
1372 self.items = v.into_iter().map(|i| i.into()).collect();
1373 self
1374 }
1375}
1376
1377impl wkt::message::Message for DatabasesListResponse {
1378 fn typename() -> &'static str {
1379 "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
1380 }
1381}
1382
1383#[derive(Clone, Default, PartialEq)]
1385#[non_exhaustive]
1386pub struct SqlFlagsListRequest {
1387 pub database_version: std::string::String,
1390
1391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1392}
1393
1394impl SqlFlagsListRequest {
1395 pub fn new() -> Self {
1396 std::default::Default::default()
1397 }
1398
1399 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
1401 mut self,
1402 v: T,
1403 ) -> Self {
1404 self.database_version = v.into();
1405 self
1406 }
1407}
1408
1409impl wkt::message::Message for SqlFlagsListRequest {
1410 fn typename() -> &'static str {
1411 "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
1412 }
1413}
1414
1415#[derive(Clone, Default, PartialEq)]
1417#[non_exhaustive]
1418pub struct FlagsListResponse {
1419 pub kind: std::string::String,
1421
1422 pub items: std::vec::Vec<crate::model::Flag>,
1424
1425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl FlagsListResponse {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1435 self.kind = v.into();
1436 self
1437 }
1438
1439 pub fn set_items<T, V>(mut self, v: T) -> Self
1441 where
1442 T: std::iter::IntoIterator<Item = V>,
1443 V: std::convert::Into<crate::model::Flag>,
1444 {
1445 use std::iter::Iterator;
1446 self.items = v.into_iter().map(|i| i.into()).collect();
1447 self
1448 }
1449}
1450
1451impl wkt::message::Message for FlagsListResponse {
1452 fn typename() -> &'static str {
1453 "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
1454 }
1455}
1456
1457#[derive(Clone, Default, PartialEq)]
1459#[non_exhaustive]
1460pub struct Flag {
1461 pub name: std::string::String,
1464
1465 pub r#type: crate::model::SqlFlagType,
1469
1470 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
1481
1482 pub allowed_string_values: std::vec::Vec<std::string::String>,
1484
1485 pub min_value: std::option::Option<wkt::Int64Value>,
1487
1488 pub max_value: std::option::Option<wkt::Int64Value>,
1490
1491 pub requires_restart: std::option::Option<wkt::BoolValue>,
1494
1495 pub kind: std::string::String,
1497
1498 pub in_beta: std::option::Option<wkt::BoolValue>,
1500
1501 pub allowed_int_values: std::vec::Vec<i64>,
1504
1505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1506}
1507
1508impl Flag {
1509 pub fn new() -> Self {
1510 std::default::Default::default()
1511 }
1512
1513 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.name = v.into();
1516 self
1517 }
1518
1519 pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
1521 self.r#type = v.into();
1522 self
1523 }
1524
1525 pub fn set_applies_to<T, V>(mut self, v: T) -> Self
1527 where
1528 T: std::iter::IntoIterator<Item = V>,
1529 V: std::convert::Into<crate::model::SqlDatabaseVersion>,
1530 {
1531 use std::iter::Iterator;
1532 self.applies_to = v.into_iter().map(|i| i.into()).collect();
1533 self
1534 }
1535
1536 pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
1538 where
1539 T: std::iter::IntoIterator<Item = V>,
1540 V: std::convert::Into<std::string::String>,
1541 {
1542 use std::iter::Iterator;
1543 self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
1544 self
1545 }
1546
1547 pub fn set_min_value<T>(mut self, v: T) -> Self
1549 where
1550 T: std::convert::Into<wkt::Int64Value>,
1551 {
1552 self.min_value = std::option::Option::Some(v.into());
1553 self
1554 }
1555
1556 pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
1558 where
1559 T: std::convert::Into<wkt::Int64Value>,
1560 {
1561 self.min_value = v.map(|x| x.into());
1562 self
1563 }
1564
1565 pub fn set_max_value<T>(mut self, v: T) -> Self
1567 where
1568 T: std::convert::Into<wkt::Int64Value>,
1569 {
1570 self.max_value = std::option::Option::Some(v.into());
1571 self
1572 }
1573
1574 pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
1576 where
1577 T: std::convert::Into<wkt::Int64Value>,
1578 {
1579 self.max_value = v.map(|x| x.into());
1580 self
1581 }
1582
1583 pub fn set_requires_restart<T>(mut self, v: T) -> Self
1585 where
1586 T: std::convert::Into<wkt::BoolValue>,
1587 {
1588 self.requires_restart = std::option::Option::Some(v.into());
1589 self
1590 }
1591
1592 pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
1594 where
1595 T: std::convert::Into<wkt::BoolValue>,
1596 {
1597 self.requires_restart = v.map(|x| x.into());
1598 self
1599 }
1600
1601 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1603 self.kind = v.into();
1604 self
1605 }
1606
1607 pub fn set_in_beta<T>(mut self, v: T) -> Self
1609 where
1610 T: std::convert::Into<wkt::BoolValue>,
1611 {
1612 self.in_beta = std::option::Option::Some(v.into());
1613 self
1614 }
1615
1616 pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
1618 where
1619 T: std::convert::Into<wkt::BoolValue>,
1620 {
1621 self.in_beta = v.map(|x| x.into());
1622 self
1623 }
1624
1625 pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
1627 where
1628 T: std::iter::IntoIterator<Item = V>,
1629 V: std::convert::Into<i64>,
1630 {
1631 use std::iter::Iterator;
1632 self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
1633 self
1634 }
1635}
1636
1637impl wkt::message::Message for Flag {
1638 fn typename() -> &'static str {
1639 "type.googleapis.com/google.cloud.sql.v1.Flag"
1640 }
1641}
1642
1643#[derive(Clone, Default, PartialEq)]
1645#[non_exhaustive]
1646pub struct SqlInstancesAddServerCaRequest {
1647 pub instance: std::string::String,
1649
1650 pub project: std::string::String,
1652
1653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1654}
1655
1656impl SqlInstancesAddServerCaRequest {
1657 pub fn new() -> Self {
1658 std::default::Default::default()
1659 }
1660
1661 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.instance = v.into();
1664 self
1665 }
1666
1667 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.project = v.into();
1670 self
1671 }
1672}
1673
1674impl wkt::message::Message for SqlInstancesAddServerCaRequest {
1675 fn typename() -> &'static str {
1676 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
1677 }
1678}
1679
1680#[derive(Clone, Default, PartialEq)]
1682#[non_exhaustive]
1683pub struct SqlInstancesCloneRequest {
1684 pub instance: std::string::String,
1687
1688 pub project: std::string::String,
1690
1691 pub body: std::option::Option<crate::model::InstancesCloneRequest>,
1692
1693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1694}
1695
1696impl SqlInstancesCloneRequest {
1697 pub fn new() -> Self {
1698 std::default::Default::default()
1699 }
1700
1701 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.instance = v.into();
1704 self
1705 }
1706
1707 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1709 self.project = v.into();
1710 self
1711 }
1712
1713 pub fn set_body<T>(mut self, v: T) -> Self
1715 where
1716 T: std::convert::Into<crate::model::InstancesCloneRequest>,
1717 {
1718 self.body = std::option::Option::Some(v.into());
1719 self
1720 }
1721
1722 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1724 where
1725 T: std::convert::Into<crate::model::InstancesCloneRequest>,
1726 {
1727 self.body = v.map(|x| x.into());
1728 self
1729 }
1730}
1731
1732impl wkt::message::Message for SqlInstancesCloneRequest {
1733 fn typename() -> &'static str {
1734 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
1735 }
1736}
1737
1738#[derive(Clone, Default, PartialEq)]
1740#[non_exhaustive]
1741pub struct SqlInstancesDeleteRequest {
1742 pub instance: std::string::String,
1744
1745 pub project: std::string::String,
1747
1748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1749}
1750
1751impl SqlInstancesDeleteRequest {
1752 pub fn new() -> Self {
1753 std::default::Default::default()
1754 }
1755
1756 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758 self.instance = v.into();
1759 self
1760 }
1761
1762 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.project = v.into();
1765 self
1766 }
1767}
1768
1769impl wkt::message::Message for SqlInstancesDeleteRequest {
1770 fn typename() -> &'static str {
1771 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
1772 }
1773}
1774
1775#[derive(Clone, Default, PartialEq)]
1777#[non_exhaustive]
1778pub struct SqlInstancesDemoteMasterRequest {
1779 pub instance: std::string::String,
1781
1782 pub project: std::string::String,
1784
1785 pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
1786
1787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1788}
1789
1790impl SqlInstancesDemoteMasterRequest {
1791 pub fn new() -> Self {
1792 std::default::Default::default()
1793 }
1794
1795 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.instance = v.into();
1798 self
1799 }
1800
1801 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1803 self.project = v.into();
1804 self
1805 }
1806
1807 pub fn set_body<T>(mut self, v: T) -> Self
1809 where
1810 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1811 {
1812 self.body = std::option::Option::Some(v.into());
1813 self
1814 }
1815
1816 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1818 where
1819 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1820 {
1821 self.body = v.map(|x| x.into());
1822 self
1823 }
1824}
1825
1826impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
1827 fn typename() -> &'static str {
1828 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
1829 }
1830}
1831
1832#[derive(Clone, Default, PartialEq)]
1834#[non_exhaustive]
1835pub struct SqlInstancesDemoteRequest {
1836 pub instance: std::string::String,
1838
1839 pub project: std::string::String,
1841
1842 pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
1844
1845 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1846}
1847
1848impl SqlInstancesDemoteRequest {
1849 pub fn new() -> Self {
1850 std::default::Default::default()
1851 }
1852
1853 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1855 self.instance = v.into();
1856 self
1857 }
1858
1859 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1861 self.project = v.into();
1862 self
1863 }
1864
1865 pub fn set_body<T>(mut self, v: T) -> Self
1867 where
1868 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1869 {
1870 self.body = std::option::Option::Some(v.into());
1871 self
1872 }
1873
1874 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1876 where
1877 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1878 {
1879 self.body = v.map(|x| x.into());
1880 self
1881 }
1882}
1883
1884impl wkt::message::Message for SqlInstancesDemoteRequest {
1885 fn typename() -> &'static str {
1886 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
1887 }
1888}
1889
1890#[derive(Clone, Default, PartialEq)]
1892#[non_exhaustive]
1893pub struct SqlInstancesExportRequest {
1894 pub instance: std::string::String,
1896
1897 pub project: std::string::String,
1899
1900 pub body: std::option::Option<crate::model::InstancesExportRequest>,
1901
1902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1903}
1904
1905impl SqlInstancesExportRequest {
1906 pub fn new() -> Self {
1907 std::default::Default::default()
1908 }
1909
1910 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1912 self.instance = v.into();
1913 self
1914 }
1915
1916 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1918 self.project = v.into();
1919 self
1920 }
1921
1922 pub fn set_body<T>(mut self, v: T) -> Self
1924 where
1925 T: std::convert::Into<crate::model::InstancesExportRequest>,
1926 {
1927 self.body = std::option::Option::Some(v.into());
1928 self
1929 }
1930
1931 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1933 where
1934 T: std::convert::Into<crate::model::InstancesExportRequest>,
1935 {
1936 self.body = v.map(|x| x.into());
1937 self
1938 }
1939}
1940
1941impl wkt::message::Message for SqlInstancesExportRequest {
1942 fn typename() -> &'static str {
1943 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
1944 }
1945}
1946
1947#[derive(Clone, Default, PartialEq)]
1949#[non_exhaustive]
1950pub struct SqlInstancesFailoverRequest {
1951 pub instance: std::string::String,
1953
1954 pub project: std::string::String,
1956
1957 pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
1958
1959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl SqlInstancesFailoverRequest {
1963 pub fn new() -> Self {
1964 std::default::Default::default()
1965 }
1966
1967 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1969 self.instance = v.into();
1970 self
1971 }
1972
1973 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1975 self.project = v.into();
1976 self
1977 }
1978
1979 pub fn set_body<T>(mut self, v: T) -> Self
1981 where
1982 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1983 {
1984 self.body = std::option::Option::Some(v.into());
1985 self
1986 }
1987
1988 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1990 where
1991 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1992 {
1993 self.body = v.map(|x| x.into());
1994 self
1995 }
1996}
1997
1998impl wkt::message::Message for SqlInstancesFailoverRequest {
1999 fn typename() -> &'static str {
2000 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
2001 }
2002}
2003
2004#[derive(Clone, Default, PartialEq)]
2006#[non_exhaustive]
2007pub struct SqlInstancesGetRequest {
2008 pub instance: std::string::String,
2010
2011 pub project: std::string::String,
2013
2014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2015}
2016
2017impl SqlInstancesGetRequest {
2018 pub fn new() -> Self {
2019 std::default::Default::default()
2020 }
2021
2022 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2024 self.instance = v.into();
2025 self
2026 }
2027
2028 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.project = v.into();
2031 self
2032 }
2033}
2034
2035impl wkt::message::Message for SqlInstancesGetRequest {
2036 fn typename() -> &'static str {
2037 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
2038 }
2039}
2040
2041#[derive(Clone, Default, PartialEq)]
2043#[non_exhaustive]
2044pub struct SqlInstancesImportRequest {
2045 pub instance: std::string::String,
2047
2048 pub project: std::string::String,
2050
2051 pub body: std::option::Option<crate::model::InstancesImportRequest>,
2052
2053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2054}
2055
2056impl SqlInstancesImportRequest {
2057 pub fn new() -> Self {
2058 std::default::Default::default()
2059 }
2060
2061 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.instance = v.into();
2064 self
2065 }
2066
2067 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069 self.project = v.into();
2070 self
2071 }
2072
2073 pub fn set_body<T>(mut self, v: T) -> Self
2075 where
2076 T: std::convert::Into<crate::model::InstancesImportRequest>,
2077 {
2078 self.body = std::option::Option::Some(v.into());
2079 self
2080 }
2081
2082 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2084 where
2085 T: std::convert::Into<crate::model::InstancesImportRequest>,
2086 {
2087 self.body = v.map(|x| x.into());
2088 self
2089 }
2090}
2091
2092impl wkt::message::Message for SqlInstancesImportRequest {
2093 fn typename() -> &'static str {
2094 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
2095 }
2096}
2097
2098#[derive(Clone, Default, PartialEq)]
2100#[non_exhaustive]
2101pub struct SqlInstancesInsertRequest {
2102 pub project: std::string::String,
2105
2106 pub body: std::option::Option<crate::model::DatabaseInstance>,
2107
2108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2109}
2110
2111impl SqlInstancesInsertRequest {
2112 pub fn new() -> Self {
2113 std::default::Default::default()
2114 }
2115
2116 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2118 self.project = v.into();
2119 self
2120 }
2121
2122 pub fn set_body<T>(mut self, v: T) -> Self
2124 where
2125 T: std::convert::Into<crate::model::DatabaseInstance>,
2126 {
2127 self.body = std::option::Option::Some(v.into());
2128 self
2129 }
2130
2131 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2133 where
2134 T: std::convert::Into<crate::model::DatabaseInstance>,
2135 {
2136 self.body = v.map(|x| x.into());
2137 self
2138 }
2139}
2140
2141impl wkt::message::Message for SqlInstancesInsertRequest {
2142 fn typename() -> &'static str {
2143 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
2144 }
2145}
2146
2147#[derive(Clone, Default, PartialEq)]
2149#[non_exhaustive]
2150pub struct SqlInstancesListRequest {
2151 pub filter: std::string::String,
2161
2162 pub max_results: u32,
2167
2168 pub page_token: std::string::String,
2171
2172 pub project: std::string::String,
2174
2175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2176}
2177
2178impl SqlInstancesListRequest {
2179 pub fn new() -> Self {
2180 std::default::Default::default()
2181 }
2182
2183 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2185 self.filter = v.into();
2186 self
2187 }
2188
2189 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
2191 self.max_results = v.into();
2192 self
2193 }
2194
2195 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2197 self.page_token = v.into();
2198 self
2199 }
2200
2201 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2203 self.project = v.into();
2204 self
2205 }
2206}
2207
2208impl wkt::message::Message for SqlInstancesListRequest {
2209 fn typename() -> &'static str {
2210 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
2211 }
2212}
2213
2214#[derive(Clone, Default, PartialEq)]
2216#[non_exhaustive]
2217pub struct SqlInstancesListServerCasRequest {
2218 pub instance: std::string::String,
2220
2221 pub project: std::string::String,
2223
2224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2225}
2226
2227impl SqlInstancesListServerCasRequest {
2228 pub fn new() -> Self {
2229 std::default::Default::default()
2230 }
2231
2232 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2234 self.instance = v.into();
2235 self
2236 }
2237
2238 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2240 self.project = v.into();
2241 self
2242 }
2243}
2244
2245impl wkt::message::Message for SqlInstancesListServerCasRequest {
2246 fn typename() -> &'static str {
2247 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
2248 }
2249}
2250
2251#[derive(Clone, Default, PartialEq)]
2253#[non_exhaustive]
2254pub struct SqlInstancesPatchRequest {
2255 pub instance: std::string::String,
2257
2258 pub project: std::string::String,
2260
2261 pub body: std::option::Option<crate::model::DatabaseInstance>,
2262
2263 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2264}
2265
2266impl SqlInstancesPatchRequest {
2267 pub fn new() -> Self {
2268 std::default::Default::default()
2269 }
2270
2271 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273 self.instance = v.into();
2274 self
2275 }
2276
2277 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2279 self.project = v.into();
2280 self
2281 }
2282
2283 pub fn set_body<T>(mut self, v: T) -> Self
2285 where
2286 T: std::convert::Into<crate::model::DatabaseInstance>,
2287 {
2288 self.body = std::option::Option::Some(v.into());
2289 self
2290 }
2291
2292 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2294 where
2295 T: std::convert::Into<crate::model::DatabaseInstance>,
2296 {
2297 self.body = v.map(|x| x.into());
2298 self
2299 }
2300}
2301
2302impl wkt::message::Message for SqlInstancesPatchRequest {
2303 fn typename() -> &'static str {
2304 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
2305 }
2306}
2307
2308#[derive(Clone, Default, PartialEq)]
2310#[non_exhaustive]
2311pub struct SqlInstancesPromoteReplicaRequest {
2312 pub instance: std::string::String,
2314
2315 pub project: std::string::String,
2317
2318 pub failover: bool,
2326
2327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2328}
2329
2330impl SqlInstancesPromoteReplicaRequest {
2331 pub fn new() -> Self {
2332 std::default::Default::default()
2333 }
2334
2335 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337 self.instance = v.into();
2338 self
2339 }
2340
2341 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2343 self.project = v.into();
2344 self
2345 }
2346
2347 pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2349 self.failover = v.into();
2350 self
2351 }
2352}
2353
2354impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
2355 fn typename() -> &'static str {
2356 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
2357 }
2358}
2359
2360#[derive(Clone, Default, PartialEq)]
2362#[non_exhaustive]
2363pub struct SqlInstancesSwitchoverRequest {
2364 pub instance: std::string::String,
2366
2367 pub project: std::string::String,
2369
2370 pub db_timeout: std::option::Option<wkt::Duration>,
2374
2375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2376}
2377
2378impl SqlInstancesSwitchoverRequest {
2379 pub fn new() -> Self {
2380 std::default::Default::default()
2381 }
2382
2383 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2385 self.instance = v.into();
2386 self
2387 }
2388
2389 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.project = v.into();
2392 self
2393 }
2394
2395 pub fn set_db_timeout<T>(mut self, v: T) -> Self
2397 where
2398 T: std::convert::Into<wkt::Duration>,
2399 {
2400 self.db_timeout = std::option::Option::Some(v.into());
2401 self
2402 }
2403
2404 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2406 where
2407 T: std::convert::Into<wkt::Duration>,
2408 {
2409 self.db_timeout = v.map(|x| x.into());
2410 self
2411 }
2412}
2413
2414impl wkt::message::Message for SqlInstancesSwitchoverRequest {
2415 fn typename() -> &'static str {
2416 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
2417 }
2418}
2419
2420#[derive(Clone, Default, PartialEq)]
2422#[non_exhaustive]
2423pub struct SqlInstancesResetSslConfigRequest {
2424 pub instance: std::string::String,
2426
2427 pub project: std::string::String,
2429
2430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2431}
2432
2433impl SqlInstancesResetSslConfigRequest {
2434 pub fn new() -> Self {
2435 std::default::Default::default()
2436 }
2437
2438 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2440 self.instance = v.into();
2441 self
2442 }
2443
2444 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.project = v.into();
2447 self
2448 }
2449}
2450
2451impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
2452 fn typename() -> &'static str {
2453 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
2454 }
2455}
2456
2457#[derive(Clone, Default, PartialEq)]
2459#[non_exhaustive]
2460pub struct SqlInstancesRestartRequest {
2461 pub instance: std::string::String,
2463
2464 pub project: std::string::String,
2466
2467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2468}
2469
2470impl SqlInstancesRestartRequest {
2471 pub fn new() -> Self {
2472 std::default::Default::default()
2473 }
2474
2475 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477 self.instance = v.into();
2478 self
2479 }
2480
2481 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2483 self.project = v.into();
2484 self
2485 }
2486}
2487
2488impl wkt::message::Message for SqlInstancesRestartRequest {
2489 fn typename() -> &'static str {
2490 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
2491 }
2492}
2493
2494#[derive(Clone, Default, PartialEq)]
2496#[non_exhaustive]
2497pub struct SqlInstancesRestoreBackupRequest {
2498 pub instance: std::string::String,
2500
2501 pub project: std::string::String,
2503
2504 pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
2505
2506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2507}
2508
2509impl SqlInstancesRestoreBackupRequest {
2510 pub fn new() -> Self {
2511 std::default::Default::default()
2512 }
2513
2514 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2516 self.instance = v.into();
2517 self
2518 }
2519
2520 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2522 self.project = v.into();
2523 self
2524 }
2525
2526 pub fn set_body<T>(mut self, v: T) -> Self
2528 where
2529 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2530 {
2531 self.body = std::option::Option::Some(v.into());
2532 self
2533 }
2534
2535 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2537 where
2538 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2539 {
2540 self.body = v.map(|x| x.into());
2541 self
2542 }
2543}
2544
2545impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
2546 fn typename() -> &'static str {
2547 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
2548 }
2549}
2550
2551#[derive(Clone, Default, PartialEq)]
2553#[non_exhaustive]
2554pub struct SqlInstancesRotateServerCaRequest {
2555 pub instance: std::string::String,
2557
2558 pub project: std::string::String,
2560
2561 pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
2562
2563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl SqlInstancesRotateServerCaRequest {
2567 pub fn new() -> Self {
2568 std::default::Default::default()
2569 }
2570
2571 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.instance = v.into();
2574 self
2575 }
2576
2577 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2579 self.project = v.into();
2580 self
2581 }
2582
2583 pub fn set_body<T>(mut self, v: T) -> Self
2585 where
2586 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
2587 {
2588 self.body = std::option::Option::Some(v.into());
2589 self
2590 }
2591
2592 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2594 where
2595 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
2596 {
2597 self.body = v.map(|x| x.into());
2598 self
2599 }
2600}
2601
2602impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
2603 fn typename() -> &'static str {
2604 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
2605 }
2606}
2607
2608#[derive(Clone, Default, PartialEq)]
2610#[non_exhaustive]
2611pub struct SqlInstancesStartReplicaRequest {
2612 pub instance: std::string::String,
2614
2615 pub project: std::string::String,
2617
2618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2619}
2620
2621impl SqlInstancesStartReplicaRequest {
2622 pub fn new() -> Self {
2623 std::default::Default::default()
2624 }
2625
2626 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2628 self.instance = v.into();
2629 self
2630 }
2631
2632 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.project = v.into();
2635 self
2636 }
2637}
2638
2639impl wkt::message::Message for SqlInstancesStartReplicaRequest {
2640 fn typename() -> &'static str {
2641 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
2642 }
2643}
2644
2645#[derive(Clone, Default, PartialEq)]
2647#[non_exhaustive]
2648pub struct SqlInstancesStopReplicaRequest {
2649 pub instance: std::string::String,
2651
2652 pub project: std::string::String,
2654
2655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2656}
2657
2658impl SqlInstancesStopReplicaRequest {
2659 pub fn new() -> Self {
2660 std::default::Default::default()
2661 }
2662
2663 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2665 self.instance = v.into();
2666 self
2667 }
2668
2669 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2671 self.project = v.into();
2672 self
2673 }
2674}
2675
2676impl wkt::message::Message for SqlInstancesStopReplicaRequest {
2677 fn typename() -> &'static str {
2678 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
2679 }
2680}
2681
2682#[derive(Clone, Default, PartialEq)]
2684#[non_exhaustive]
2685pub struct SqlInstancesTruncateLogRequest {
2686 pub instance: std::string::String,
2688
2689 pub project: std::string::String,
2691
2692 pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
2693
2694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2695}
2696
2697impl SqlInstancesTruncateLogRequest {
2698 pub fn new() -> Self {
2699 std::default::Default::default()
2700 }
2701
2702 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2704 self.instance = v.into();
2705 self
2706 }
2707
2708 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2710 self.project = v.into();
2711 self
2712 }
2713
2714 pub fn set_body<T>(mut self, v: T) -> Self
2716 where
2717 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
2718 {
2719 self.body = std::option::Option::Some(v.into());
2720 self
2721 }
2722
2723 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2725 where
2726 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
2727 {
2728 self.body = v.map(|x| x.into());
2729 self
2730 }
2731}
2732
2733impl wkt::message::Message for SqlInstancesTruncateLogRequest {
2734 fn typename() -> &'static str {
2735 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
2736 }
2737}
2738
2739#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct SqlInstancesPerformDiskShrinkRequest {
2743 pub instance: std::string::String,
2745
2746 pub project: std::string::String,
2748
2749 pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
2751
2752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753}
2754
2755impl SqlInstancesPerformDiskShrinkRequest {
2756 pub fn new() -> Self {
2757 std::default::Default::default()
2758 }
2759
2760 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762 self.instance = v.into();
2763 self
2764 }
2765
2766 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2768 self.project = v.into();
2769 self
2770 }
2771
2772 pub fn set_body<T>(mut self, v: T) -> Self
2774 where
2775 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
2776 {
2777 self.body = std::option::Option::Some(v.into());
2778 self
2779 }
2780
2781 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2783 where
2784 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
2785 {
2786 self.body = v.map(|x| x.into());
2787 self
2788 }
2789}
2790
2791impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
2792 fn typename() -> &'static str {
2793 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
2794 }
2795}
2796
2797#[derive(Clone, Default, PartialEq)]
2799#[non_exhaustive]
2800pub struct SqlInstancesUpdateRequest {
2801 pub instance: std::string::String,
2803
2804 pub project: std::string::String,
2806
2807 pub body: std::option::Option<crate::model::DatabaseInstance>,
2808
2809 pub(crate) _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>(mut self, v: T) -> Self
2831 where
2832 T: std::convert::Into<crate::model::DatabaseInstance>,
2833 {
2834 self.body = std::option::Option::Some(v.into());
2835 self
2836 }
2837
2838 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2840 where
2841 T: std::convert::Into<crate::model::DatabaseInstance>,
2842 {
2843 self.body = v.map(|x| x.into());
2844 self
2845 }
2846}
2847
2848impl wkt::message::Message for SqlInstancesUpdateRequest {
2849 fn typename() -> &'static str {
2850 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
2851 }
2852}
2853
2854#[derive(Clone, Default, PartialEq)]
2856#[non_exhaustive]
2857pub struct SqlInstancesRescheduleMaintenanceRequest {
2858 pub instance: std::string::String,
2860
2861 pub project: std::string::String,
2863
2864 pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2865
2866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2867}
2868
2869impl SqlInstancesRescheduleMaintenanceRequest {
2870 pub fn new() -> Self {
2871 std::default::Default::default()
2872 }
2873
2874 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2876 self.instance = v.into();
2877 self
2878 }
2879
2880 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2882 self.project = v.into();
2883 self
2884 }
2885
2886 pub fn set_body<T>(mut self, v: T) -> Self
2888 where
2889 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2890 {
2891 self.body = std::option::Option::Some(v.into());
2892 self
2893 }
2894
2895 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2897 where
2898 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
2899 {
2900 self.body = v.map(|x| x.into());
2901 self
2902 }
2903}
2904
2905impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
2906 fn typename() -> &'static str {
2907 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
2908 }
2909}
2910
2911#[derive(Clone, Default, PartialEq)]
2913#[non_exhaustive]
2914pub struct SqlInstancesReencryptRequest {
2915 pub instance: std::string::String,
2917
2918 pub project: std::string::String,
2920
2921 pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
2923
2924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2925}
2926
2927impl SqlInstancesReencryptRequest {
2928 pub fn new() -> Self {
2929 std::default::Default::default()
2930 }
2931
2932 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2934 self.instance = v.into();
2935 self
2936 }
2937
2938 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2940 self.project = v.into();
2941 self
2942 }
2943
2944 pub fn set_body<T>(mut self, v: T) -> Self
2946 where
2947 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2948 {
2949 self.body = std::option::Option::Some(v.into());
2950 self
2951 }
2952
2953 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2955 where
2956 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2957 {
2958 self.body = v.map(|x| x.into());
2959 self
2960 }
2961}
2962
2963impl wkt::message::Message for SqlInstancesReencryptRequest {
2964 fn typename() -> &'static str {
2965 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
2966 }
2967}
2968
2969#[derive(Clone, Default, PartialEq)]
2971#[non_exhaustive]
2972pub struct InstancesReencryptRequest {
2973 pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
2975
2976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2977}
2978
2979impl InstancesReencryptRequest {
2980 pub fn new() -> Self {
2981 std::default::Default::default()
2982 }
2983
2984 pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
2986 where
2987 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
2988 {
2989 self.backup_reencryption_config = std::option::Option::Some(v.into());
2990 self
2991 }
2992
2993 pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
2995 where
2996 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
2997 {
2998 self.backup_reencryption_config = v.map(|x| x.into());
2999 self
3000 }
3001}
3002
3003impl wkt::message::Message for InstancesReencryptRequest {
3004 fn typename() -> &'static str {
3005 "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
3006 }
3007}
3008
3009#[derive(Clone, Default, PartialEq)]
3011#[non_exhaustive]
3012pub struct BackupReencryptionConfig {
3013 pub backup_limit: std::option::Option<i32>,
3015
3016 pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
3018
3019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3020}
3021
3022impl BackupReencryptionConfig {
3023 pub fn new() -> Self {
3024 std::default::Default::default()
3025 }
3026
3027 pub fn set_backup_limit<T>(mut self, v: T) -> Self
3029 where
3030 T: std::convert::Into<i32>,
3031 {
3032 self.backup_limit = std::option::Option::Some(v.into());
3033 self
3034 }
3035
3036 pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
3038 where
3039 T: std::convert::Into<i32>,
3040 {
3041 self.backup_limit = v.map(|x| x.into());
3042 self
3043 }
3044
3045 pub fn set_backup_type<T>(mut self, v: T) -> Self
3047 where
3048 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
3049 {
3050 self.backup_type = std::option::Option::Some(v.into());
3051 self
3052 }
3053
3054 pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
3056 where
3057 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
3058 {
3059 self.backup_type = v.map(|x| x.into());
3060 self
3061 }
3062}
3063
3064impl wkt::message::Message for BackupReencryptionConfig {
3065 fn typename() -> &'static str {
3066 "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
3067 }
3068}
3069
3070pub mod backup_reencryption_config {
3072 #[allow(unused_imports)]
3073 use super::*;
3074
3075 #[derive(Clone, Debug, PartialEq)]
3091 #[non_exhaustive]
3092 pub enum BackupType {
3093 Unspecified,
3095 Automated,
3097 OnDemand,
3099 UnknownValue(backup_type::UnknownValue),
3104 }
3105
3106 #[doc(hidden)]
3107 pub mod backup_type {
3108 #[allow(unused_imports)]
3109 use super::*;
3110 #[derive(Clone, Debug, PartialEq)]
3111 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3112 }
3113
3114 impl BackupType {
3115 pub fn value(&self) -> std::option::Option<i32> {
3120 match self {
3121 Self::Unspecified => std::option::Option::Some(0),
3122 Self::Automated => std::option::Option::Some(1),
3123 Self::OnDemand => std::option::Option::Some(2),
3124 Self::UnknownValue(u) => u.0.value(),
3125 }
3126 }
3127
3128 pub fn name(&self) -> std::option::Option<&str> {
3133 match self {
3134 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
3135 Self::Automated => std::option::Option::Some("AUTOMATED"),
3136 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
3137 Self::UnknownValue(u) => u.0.name(),
3138 }
3139 }
3140 }
3141
3142 impl std::default::Default for BackupType {
3143 fn default() -> Self {
3144 use std::convert::From;
3145 Self::from(0)
3146 }
3147 }
3148
3149 impl std::fmt::Display for BackupType {
3150 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3151 wkt::internal::display_enum(f, self.name(), self.value())
3152 }
3153 }
3154
3155 impl std::convert::From<i32> for BackupType {
3156 fn from(value: i32) -> Self {
3157 match value {
3158 0 => Self::Unspecified,
3159 1 => Self::Automated,
3160 2 => Self::OnDemand,
3161 _ => Self::UnknownValue(backup_type::UnknownValue(
3162 wkt::internal::UnknownEnumValue::Integer(value),
3163 )),
3164 }
3165 }
3166 }
3167
3168 impl std::convert::From<&str> for BackupType {
3169 fn from(value: &str) -> Self {
3170 use std::string::ToString;
3171 match value {
3172 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
3173 "AUTOMATED" => Self::Automated,
3174 "ON_DEMAND" => Self::OnDemand,
3175 _ => Self::UnknownValue(backup_type::UnknownValue(
3176 wkt::internal::UnknownEnumValue::String(value.to_string()),
3177 )),
3178 }
3179 }
3180 }
3181
3182 impl serde::ser::Serialize for BackupType {
3183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3184 where
3185 S: serde::Serializer,
3186 {
3187 match self {
3188 Self::Unspecified => serializer.serialize_i32(0),
3189 Self::Automated => serializer.serialize_i32(1),
3190 Self::OnDemand => serializer.serialize_i32(2),
3191 Self::UnknownValue(u) => u.0.serialize(serializer),
3192 }
3193 }
3194 }
3195
3196 impl<'de> serde::de::Deserialize<'de> for BackupType {
3197 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3198 where
3199 D: serde::Deserializer<'de>,
3200 {
3201 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
3202 ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
3203 ))
3204 }
3205 }
3206}
3207
3208#[derive(Clone, Default, PartialEq)]
3210#[non_exhaustive]
3211pub struct SqlInstancesGetDiskShrinkConfigRequest {
3212 pub instance: std::string::String,
3214
3215 pub project: std::string::String,
3217
3218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3219}
3220
3221impl SqlInstancesGetDiskShrinkConfigRequest {
3222 pub fn new() -> Self {
3223 std::default::Default::default()
3224 }
3225
3226 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3228 self.instance = v.into();
3229 self
3230 }
3231
3232 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3234 self.project = v.into();
3235 self
3236 }
3237}
3238
3239impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
3240 fn typename() -> &'static str {
3241 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
3242 }
3243}
3244
3245#[derive(Clone, Default, PartialEq)]
3247#[non_exhaustive]
3248pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
3249 pub instance: std::string::String,
3251
3252 pub project: std::string::String,
3254
3255 pub verify_connection_only: bool,
3257
3258 pub sync_mode:
3260 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3261
3262 pub verify_replication_only: bool,
3264
3265 pub migration_type:
3269 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3270
3271 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3274
3275 pub sync_config: std::option::Option<
3276 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3277 >,
3278
3279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3280}
3281
3282impl SqlInstancesVerifyExternalSyncSettingsRequest {
3283 pub fn new() -> Self {
3284 std::default::Default::default()
3285 }
3286
3287 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3289 self.instance = v.into();
3290 self
3291 }
3292
3293 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3295 self.project = v.into();
3296 self
3297 }
3298
3299 pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3301 self.verify_connection_only = v.into();
3302 self
3303 }
3304
3305 pub fn set_sync_mode<
3307 T: std::convert::Into<
3308 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3309 >,
3310 >(
3311 mut self,
3312 v: T,
3313 ) -> Self {
3314 self.sync_mode = v.into();
3315 self
3316 }
3317
3318 pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3320 self.verify_replication_only = v.into();
3321 self
3322 }
3323
3324 pub fn set_migration_type<
3326 T: std::convert::Into<
3327 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3328 >,
3329 >(
3330 mut self,
3331 v: T,
3332 ) -> Self {
3333 self.migration_type = v.into();
3334 self
3335 }
3336
3337 pub fn set_sync_parallel_level<
3339 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3340 >(
3341 mut self,
3342 v: T,
3343 ) -> Self {
3344 self.sync_parallel_level = v.into();
3345 self
3346 }
3347
3348 pub fn set_sync_config<
3353 T: std::convert::Into<
3354 std::option::Option<
3355 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3356 >,
3357 >,
3358 >(
3359 mut self,
3360 v: T,
3361 ) -> Self {
3362 self.sync_config = v.into();
3363 self
3364 }
3365
3366 pub fn mysql_sync_config(
3370 &self,
3371 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3372 #[allow(unreachable_patterns)]
3373 self.sync_config.as_ref().and_then(|v| match v {
3374 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3375 _ => std::option::Option::None,
3376 })
3377 }
3378
3379 pub fn set_mysql_sync_config<
3385 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3386 >(
3387 mut self,
3388 v: T,
3389 ) -> Self {
3390 self.sync_config = std::option::Option::Some(
3391 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
3392 v.into()
3393 )
3394 );
3395 self
3396 }
3397}
3398
3399impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
3400 fn typename() -> &'static str {
3401 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
3402 }
3403}
3404
3405pub mod sql_instances_verify_external_sync_settings_request {
3407 #[allow(unused_imports)]
3408 use super::*;
3409
3410 #[derive(Clone, Debug, PartialEq)]
3425 #[non_exhaustive]
3426 pub enum ExternalSyncMode {
3427 Unspecified,
3429 Online,
3432 Offline,
3435 UnknownValue(external_sync_mode::UnknownValue),
3440 }
3441
3442 #[doc(hidden)]
3443 pub mod external_sync_mode {
3444 #[allow(unused_imports)]
3445 use super::*;
3446 #[derive(Clone, Debug, PartialEq)]
3447 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3448 }
3449
3450 impl ExternalSyncMode {
3451 pub fn value(&self) -> std::option::Option<i32> {
3456 match self {
3457 Self::Unspecified => std::option::Option::Some(0),
3458 Self::Online => std::option::Option::Some(1),
3459 Self::Offline => std::option::Option::Some(2),
3460 Self::UnknownValue(u) => u.0.value(),
3461 }
3462 }
3463
3464 pub fn name(&self) -> std::option::Option<&str> {
3469 match self {
3470 Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
3471 Self::Online => std::option::Option::Some("ONLINE"),
3472 Self::Offline => std::option::Option::Some("OFFLINE"),
3473 Self::UnknownValue(u) => u.0.name(),
3474 }
3475 }
3476 }
3477
3478 impl std::default::Default for ExternalSyncMode {
3479 fn default() -> Self {
3480 use std::convert::From;
3481 Self::from(0)
3482 }
3483 }
3484
3485 impl std::fmt::Display for ExternalSyncMode {
3486 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3487 wkt::internal::display_enum(f, self.name(), self.value())
3488 }
3489 }
3490
3491 impl std::convert::From<i32> for ExternalSyncMode {
3492 fn from(value: i32) -> Self {
3493 match value {
3494 0 => Self::Unspecified,
3495 1 => Self::Online,
3496 2 => Self::Offline,
3497 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3498 wkt::internal::UnknownEnumValue::Integer(value),
3499 )),
3500 }
3501 }
3502 }
3503
3504 impl std::convert::From<&str> for ExternalSyncMode {
3505 fn from(value: &str) -> Self {
3506 use std::string::ToString;
3507 match value {
3508 "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
3509 "ONLINE" => Self::Online,
3510 "OFFLINE" => Self::Offline,
3511 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
3512 wkt::internal::UnknownEnumValue::String(value.to_string()),
3513 )),
3514 }
3515 }
3516 }
3517
3518 impl serde::ser::Serialize for ExternalSyncMode {
3519 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3520 where
3521 S: serde::Serializer,
3522 {
3523 match self {
3524 Self::Unspecified => serializer.serialize_i32(0),
3525 Self::Online => serializer.serialize_i32(1),
3526 Self::Offline => serializer.serialize_i32(2),
3527 Self::UnknownValue(u) => u.0.serialize(serializer),
3528 }
3529 }
3530 }
3531
3532 impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
3533 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3534 where
3535 D: serde::Deserializer<'de>,
3536 {
3537 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
3538 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
3539 }
3540 }
3541
3542 #[derive(Clone, Debug, PartialEq)]
3559 #[non_exhaustive]
3560 pub enum MigrationType {
3561 Unspecified,
3563 Logical,
3565 Physical,
3567 UnknownValue(migration_type::UnknownValue),
3572 }
3573
3574 #[doc(hidden)]
3575 pub mod migration_type {
3576 #[allow(unused_imports)]
3577 use super::*;
3578 #[derive(Clone, Debug, PartialEq)]
3579 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3580 }
3581
3582 impl MigrationType {
3583 pub fn value(&self) -> std::option::Option<i32> {
3588 match self {
3589 Self::Unspecified => std::option::Option::Some(0),
3590 Self::Logical => std::option::Option::Some(1),
3591 Self::Physical => std::option::Option::Some(2),
3592 Self::UnknownValue(u) => u.0.value(),
3593 }
3594 }
3595
3596 pub fn name(&self) -> std::option::Option<&str> {
3601 match self {
3602 Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
3603 Self::Logical => std::option::Option::Some("LOGICAL"),
3604 Self::Physical => std::option::Option::Some("PHYSICAL"),
3605 Self::UnknownValue(u) => u.0.name(),
3606 }
3607 }
3608 }
3609
3610 impl std::default::Default for MigrationType {
3611 fn default() -> Self {
3612 use std::convert::From;
3613 Self::from(0)
3614 }
3615 }
3616
3617 impl std::fmt::Display for MigrationType {
3618 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3619 wkt::internal::display_enum(f, self.name(), self.value())
3620 }
3621 }
3622
3623 impl std::convert::From<i32> for MigrationType {
3624 fn from(value: i32) -> Self {
3625 match value {
3626 0 => Self::Unspecified,
3627 1 => Self::Logical,
3628 2 => Self::Physical,
3629 _ => Self::UnknownValue(migration_type::UnknownValue(
3630 wkt::internal::UnknownEnumValue::Integer(value),
3631 )),
3632 }
3633 }
3634 }
3635
3636 impl std::convert::From<&str> for MigrationType {
3637 fn from(value: &str) -> Self {
3638 use std::string::ToString;
3639 match value {
3640 "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
3641 "LOGICAL" => Self::Logical,
3642 "PHYSICAL" => Self::Physical,
3643 _ => Self::UnknownValue(migration_type::UnknownValue(
3644 wkt::internal::UnknownEnumValue::String(value.to_string()),
3645 )),
3646 }
3647 }
3648 }
3649
3650 impl serde::ser::Serialize for MigrationType {
3651 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3652 where
3653 S: serde::Serializer,
3654 {
3655 match self {
3656 Self::Unspecified => serializer.serialize_i32(0),
3657 Self::Logical => serializer.serialize_i32(1),
3658 Self::Physical => serializer.serialize_i32(2),
3659 Self::UnknownValue(u) => u.0.serialize(serializer),
3660 }
3661 }
3662 }
3663
3664 impl<'de> serde::de::Deserialize<'de> for MigrationType {
3665 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3666 where
3667 D: serde::Deserializer<'de>,
3668 {
3669 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
3670 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
3671 ))
3672 }
3673 }
3674
3675 #[derive(Clone, Debug, PartialEq)]
3676 #[non_exhaustive]
3677 pub enum SyncConfig {
3678 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3680 }
3681}
3682
3683#[derive(Clone, Default, PartialEq)]
3685#[non_exhaustive]
3686pub struct SqlInstancesStartExternalSyncRequest {
3687 pub instance: std::string::String,
3689
3690 pub project: std::string::String,
3692
3693 pub sync_mode:
3695 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3696
3697 pub skip_verification: bool,
3699
3700 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
3703
3704 pub migration_type:
3708 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3709
3710 pub sync_config:
3711 std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
3712
3713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3714}
3715
3716impl SqlInstancesStartExternalSyncRequest {
3717 pub fn new() -> Self {
3718 std::default::Default::default()
3719 }
3720
3721 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3723 self.instance = v.into();
3724 self
3725 }
3726
3727 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3729 self.project = v.into();
3730 self
3731 }
3732
3733 pub fn set_sync_mode<
3735 T: std::convert::Into<
3736 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3737 >,
3738 >(
3739 mut self,
3740 v: T,
3741 ) -> Self {
3742 self.sync_mode = v.into();
3743 self
3744 }
3745
3746 pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3748 self.skip_verification = v.into();
3749 self
3750 }
3751
3752 pub fn set_sync_parallel_level<
3754 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
3755 >(
3756 mut self,
3757 v: T,
3758 ) -> Self {
3759 self.sync_parallel_level = v.into();
3760 self
3761 }
3762
3763 pub fn set_migration_type<
3765 T: std::convert::Into<
3766 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
3767 >,
3768 >(
3769 mut self,
3770 v: T,
3771 ) -> Self {
3772 self.migration_type = v.into();
3773 self
3774 }
3775
3776 pub fn set_sync_config<
3781 T: std::convert::Into<
3782 std::option::Option<
3783 crate::model::sql_instances_start_external_sync_request::SyncConfig,
3784 >,
3785 >,
3786 >(
3787 mut self,
3788 v: T,
3789 ) -> Self {
3790 self.sync_config = v.into();
3791 self
3792 }
3793
3794 pub fn mysql_sync_config(
3798 &self,
3799 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
3800 #[allow(unreachable_patterns)]
3801 self.sync_config.as_ref().and_then(|v| match v {
3802 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
3803 _ => std::option::Option::None,
3804 })
3805 }
3806
3807 pub fn set_mysql_sync_config<
3813 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3814 >(
3815 mut self,
3816 v: T,
3817 ) -> Self {
3818 self.sync_config = std::option::Option::Some(
3819 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
3820 v.into(),
3821 ),
3822 );
3823 self
3824 }
3825}
3826
3827impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
3828 fn typename() -> &'static str {
3829 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
3830 }
3831}
3832
3833pub mod sql_instances_start_external_sync_request {
3835 #[allow(unused_imports)]
3836 use super::*;
3837
3838 #[derive(Clone, Debug, PartialEq)]
3839 #[non_exhaustive]
3840 pub enum SyncConfig {
3841 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
3843 }
3844}
3845
3846#[derive(Clone, Default, PartialEq)]
3848#[non_exhaustive]
3849pub struct SqlInstancesResetReplicaSizeRequest {
3850 pub instance: std::string::String,
3852
3853 pub project: std::string::String,
3855
3856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3857}
3858
3859impl SqlInstancesResetReplicaSizeRequest {
3860 pub fn new() -> Self {
3861 std::default::Default::default()
3862 }
3863
3864 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3866 self.instance = v.into();
3867 self
3868 }
3869
3870 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3872 self.project = v.into();
3873 self
3874 }
3875}
3876
3877impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
3878 fn typename() -> &'static str {
3879 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
3880 }
3881}
3882
3883#[derive(Clone, Default, PartialEq)]
3885#[non_exhaustive]
3886pub struct SqlInstancesCreateEphemeralCertRequest {
3887 pub instance: std::string::String,
3889
3890 pub project: std::string::String,
3892
3893 pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
3894
3895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3896}
3897
3898impl SqlInstancesCreateEphemeralCertRequest {
3899 pub fn new() -> Self {
3900 std::default::Default::default()
3901 }
3902
3903 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905 self.instance = v.into();
3906 self
3907 }
3908
3909 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911 self.project = v.into();
3912 self
3913 }
3914
3915 pub fn set_body<T>(mut self, v: T) -> Self
3917 where
3918 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3919 {
3920 self.body = std::option::Option::Some(v.into());
3921 self
3922 }
3923
3924 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3926 where
3927 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3928 {
3929 self.body = v.map(|x| x.into());
3930 self
3931 }
3932}
3933
3934impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
3935 fn typename() -> &'static str {
3936 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
3937 }
3938}
3939
3940#[derive(Clone, Default, PartialEq)]
3942#[non_exhaustive]
3943pub struct InstancesCloneRequest {
3944 pub clone_context: std::option::Option<crate::model::CloneContext>,
3946
3947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3948}
3949
3950impl InstancesCloneRequest {
3951 pub fn new() -> Self {
3952 std::default::Default::default()
3953 }
3954
3955 pub fn set_clone_context<T>(mut self, v: T) -> Self
3957 where
3958 T: std::convert::Into<crate::model::CloneContext>,
3959 {
3960 self.clone_context = std::option::Option::Some(v.into());
3961 self
3962 }
3963
3964 pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
3966 where
3967 T: std::convert::Into<crate::model::CloneContext>,
3968 {
3969 self.clone_context = v.map(|x| x.into());
3970 self
3971 }
3972}
3973
3974impl wkt::message::Message for InstancesCloneRequest {
3975 fn typename() -> &'static str {
3976 "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
3977 }
3978}
3979
3980#[derive(Clone, Default, PartialEq)]
3982#[non_exhaustive]
3983pub struct InstancesDemoteMasterRequest {
3984 pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
3986
3987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3988}
3989
3990impl InstancesDemoteMasterRequest {
3991 pub fn new() -> Self {
3992 std::default::Default::default()
3993 }
3994
3995 pub fn set_demote_master_context<T>(mut self, v: T) -> Self
3997 where
3998 T: std::convert::Into<crate::model::DemoteMasterContext>,
3999 {
4000 self.demote_master_context = std::option::Option::Some(v.into());
4001 self
4002 }
4003
4004 pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
4006 where
4007 T: std::convert::Into<crate::model::DemoteMasterContext>,
4008 {
4009 self.demote_master_context = v.map(|x| x.into());
4010 self
4011 }
4012}
4013
4014impl wkt::message::Message for InstancesDemoteMasterRequest {
4015 fn typename() -> &'static str {
4016 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
4017 }
4018}
4019
4020#[derive(Clone, Default, PartialEq)]
4023#[non_exhaustive]
4024pub struct InstancesDemoteRequest {
4025 pub demote_context: std::option::Option<crate::model::DemoteContext>,
4027
4028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029}
4030
4031impl InstancesDemoteRequest {
4032 pub fn new() -> Self {
4033 std::default::Default::default()
4034 }
4035
4036 pub fn set_demote_context<T>(mut self, v: T) -> Self
4038 where
4039 T: std::convert::Into<crate::model::DemoteContext>,
4040 {
4041 self.demote_context = std::option::Option::Some(v.into());
4042 self
4043 }
4044
4045 pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
4047 where
4048 T: std::convert::Into<crate::model::DemoteContext>,
4049 {
4050 self.demote_context = v.map(|x| x.into());
4051 self
4052 }
4053}
4054
4055impl wkt::message::Message for InstancesDemoteRequest {
4056 fn typename() -> &'static str {
4057 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
4058 }
4059}
4060
4061#[derive(Clone, Default, PartialEq)]
4063#[non_exhaustive]
4064pub struct InstancesExportRequest {
4065 pub export_context: std::option::Option<crate::model::ExportContext>,
4067
4068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4069}
4070
4071impl InstancesExportRequest {
4072 pub fn new() -> Self {
4073 std::default::Default::default()
4074 }
4075
4076 pub fn set_export_context<T>(mut self, v: T) -> Self
4078 where
4079 T: std::convert::Into<crate::model::ExportContext>,
4080 {
4081 self.export_context = std::option::Option::Some(v.into());
4082 self
4083 }
4084
4085 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
4087 where
4088 T: std::convert::Into<crate::model::ExportContext>,
4089 {
4090 self.export_context = v.map(|x| x.into());
4091 self
4092 }
4093}
4094
4095impl wkt::message::Message for InstancesExportRequest {
4096 fn typename() -> &'static str {
4097 "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
4098 }
4099}
4100
4101#[derive(Clone, Default, PartialEq)]
4103#[non_exhaustive]
4104pub struct InstancesFailoverRequest {
4105 pub failover_context: std::option::Option<crate::model::FailoverContext>,
4107
4108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4109}
4110
4111impl InstancesFailoverRequest {
4112 pub fn new() -> Self {
4113 std::default::Default::default()
4114 }
4115
4116 pub fn set_failover_context<T>(mut self, v: T) -> Self
4118 where
4119 T: std::convert::Into<crate::model::FailoverContext>,
4120 {
4121 self.failover_context = std::option::Option::Some(v.into());
4122 self
4123 }
4124
4125 pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
4127 where
4128 T: std::convert::Into<crate::model::FailoverContext>,
4129 {
4130 self.failover_context = v.map(|x| x.into());
4131 self
4132 }
4133}
4134
4135impl wkt::message::Message for InstancesFailoverRequest {
4136 fn typename() -> &'static str {
4137 "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
4138 }
4139}
4140
4141#[derive(Clone, Default, PartialEq)]
4143#[non_exhaustive]
4144pub struct SslCertsCreateEphemeralRequest {
4145 pub public_key: std::string::String,
4147
4148 pub access_token: std::string::String,
4150
4151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4152}
4153
4154impl SslCertsCreateEphemeralRequest {
4155 pub fn new() -> Self {
4156 std::default::Default::default()
4157 }
4158
4159 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4161 self.public_key = v.into();
4162 self
4163 }
4164
4165 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4167 self.access_token = v.into();
4168 self
4169 }
4170}
4171
4172impl wkt::message::Message for SslCertsCreateEphemeralRequest {
4173 fn typename() -> &'static str {
4174 "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
4175 }
4176}
4177
4178#[derive(Clone, Default, PartialEq)]
4180#[non_exhaustive]
4181pub struct InstancesImportRequest {
4182 pub import_context: std::option::Option<crate::model::ImportContext>,
4184
4185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4186}
4187
4188impl InstancesImportRequest {
4189 pub fn new() -> Self {
4190 std::default::Default::default()
4191 }
4192
4193 pub fn set_import_context<T>(mut self, v: T) -> Self
4195 where
4196 T: std::convert::Into<crate::model::ImportContext>,
4197 {
4198 self.import_context = std::option::Option::Some(v.into());
4199 self
4200 }
4201
4202 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
4204 where
4205 T: std::convert::Into<crate::model::ImportContext>,
4206 {
4207 self.import_context = v.map(|x| x.into());
4208 self
4209 }
4210}
4211
4212impl wkt::message::Message for InstancesImportRequest {
4213 fn typename() -> &'static str {
4214 "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
4215 }
4216}
4217
4218#[derive(Clone, Default, PartialEq)]
4220#[non_exhaustive]
4221pub struct InstancesListResponse {
4222 pub kind: std::string::String,
4224
4225 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
4227
4228 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
4230
4231 pub next_page_token: std::string::String,
4234
4235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4236}
4237
4238impl InstancesListResponse {
4239 pub fn new() -> Self {
4240 std::default::Default::default()
4241 }
4242
4243 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4245 self.kind = v.into();
4246 self
4247 }
4248
4249 pub fn set_warnings<T, V>(mut self, v: T) -> Self
4251 where
4252 T: std::iter::IntoIterator<Item = V>,
4253 V: std::convert::Into<crate::model::ApiWarning>,
4254 {
4255 use std::iter::Iterator;
4256 self.warnings = v.into_iter().map(|i| i.into()).collect();
4257 self
4258 }
4259
4260 pub fn set_items<T, V>(mut self, v: T) -> Self
4262 where
4263 T: std::iter::IntoIterator<Item = V>,
4264 V: std::convert::Into<crate::model::DatabaseInstance>,
4265 {
4266 use std::iter::Iterator;
4267 self.items = v.into_iter().map(|i| i.into()).collect();
4268 self
4269 }
4270
4271 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4273 self.next_page_token = v.into();
4274 self
4275 }
4276}
4277
4278impl wkt::message::Message for InstancesListResponse {
4279 fn typename() -> &'static str {
4280 "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
4281 }
4282}
4283
4284#[doc(hidden)]
4285impl gax::paginator::internal::PageableResponse for InstancesListResponse {
4286 type PageItem = crate::model::DatabaseInstance;
4287
4288 fn items(self) -> std::vec::Vec<Self::PageItem> {
4289 self.items
4290 }
4291
4292 fn next_page_token(&self) -> std::string::String {
4293 use std::clone::Clone;
4294 self.next_page_token.clone()
4295 }
4296}
4297
4298#[derive(Clone, Default, PartialEq)]
4300#[non_exhaustive]
4301pub struct InstancesListServerCasResponse {
4302 pub certs: std::vec::Vec<crate::model::SslCert>,
4304
4305 pub active_version: std::string::String,
4306
4307 pub kind: std::string::String,
4309
4310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4311}
4312
4313impl InstancesListServerCasResponse {
4314 pub fn new() -> Self {
4315 std::default::Default::default()
4316 }
4317
4318 pub fn set_certs<T, V>(mut self, v: T) -> Self
4320 where
4321 T: std::iter::IntoIterator<Item = V>,
4322 V: std::convert::Into<crate::model::SslCert>,
4323 {
4324 use std::iter::Iterator;
4325 self.certs = v.into_iter().map(|i| i.into()).collect();
4326 self
4327 }
4328
4329 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4331 self.active_version = v.into();
4332 self
4333 }
4334
4335 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4337 self.kind = v.into();
4338 self
4339 }
4340}
4341
4342impl wkt::message::Message for InstancesListServerCasResponse {
4343 fn typename() -> &'static str {
4344 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
4345 }
4346}
4347
4348#[derive(Clone, Default, PartialEq)]
4350#[non_exhaustive]
4351pub struct InstancesRestoreBackupRequest {
4352 pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
4354
4355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4356}
4357
4358impl InstancesRestoreBackupRequest {
4359 pub fn new() -> Self {
4360 std::default::Default::default()
4361 }
4362
4363 pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
4365 where
4366 T: std::convert::Into<crate::model::RestoreBackupContext>,
4367 {
4368 self.restore_backup_context = std::option::Option::Some(v.into());
4369 self
4370 }
4371
4372 pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
4374 where
4375 T: std::convert::Into<crate::model::RestoreBackupContext>,
4376 {
4377 self.restore_backup_context = v.map(|x| x.into());
4378 self
4379 }
4380}
4381
4382impl wkt::message::Message for InstancesRestoreBackupRequest {
4383 fn typename() -> &'static str {
4384 "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
4385 }
4386}
4387
4388#[derive(Clone, Default, PartialEq)]
4390#[non_exhaustive]
4391pub struct InstancesRotateServerCaRequest {
4392 pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
4394
4395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4396}
4397
4398impl InstancesRotateServerCaRequest {
4399 pub fn new() -> Self {
4400 std::default::Default::default()
4401 }
4402
4403 pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
4405 where
4406 T: std::convert::Into<crate::model::RotateServerCaContext>,
4407 {
4408 self.rotate_server_ca_context = std::option::Option::Some(v.into());
4409 self
4410 }
4411
4412 pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
4414 where
4415 T: std::convert::Into<crate::model::RotateServerCaContext>,
4416 {
4417 self.rotate_server_ca_context = v.map(|x| x.into());
4418 self
4419 }
4420}
4421
4422impl wkt::message::Message for InstancesRotateServerCaRequest {
4423 fn typename() -> &'static str {
4424 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
4425 }
4426}
4427
4428#[derive(Clone, Default, PartialEq)]
4430#[non_exhaustive]
4431pub struct InstancesTruncateLogRequest {
4432 pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
4434
4435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436}
4437
4438impl InstancesTruncateLogRequest {
4439 pub fn new() -> Self {
4440 std::default::Default::default()
4441 }
4442
4443 pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
4445 where
4446 T: std::convert::Into<crate::model::TruncateLogContext>,
4447 {
4448 self.truncate_log_context = std::option::Option::Some(v.into());
4449 self
4450 }
4451
4452 pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
4454 where
4455 T: std::convert::Into<crate::model::TruncateLogContext>,
4456 {
4457 self.truncate_log_context = v.map(|x| x.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#[derive(Clone, Default, PartialEq)]
4470#[non_exhaustive]
4471pub struct InstancesAcquireSsrsLeaseRequest {
4472 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
4474
4475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4476}
4477
4478impl InstancesAcquireSsrsLeaseRequest {
4479 pub fn new() -> Self {
4480 std::default::Default::default()
4481 }
4482
4483 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
4485 where
4486 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
4487 {
4488 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
4489 self
4490 }
4491
4492 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
4494 where
4495 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
4496 {
4497 self.acquire_ssrs_lease_context = v.map(|x| x.into());
4498 self
4499 }
4500}
4501
4502impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
4503 fn typename() -> &'static str {
4504 "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
4505 }
4506}
4507
4508#[derive(Clone, Default, PartialEq)]
4510#[non_exhaustive]
4511pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
4512 pub kind: std::string::String,
4514
4515 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4517
4518 pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
4520
4521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4522}
4523
4524impl SqlInstancesVerifyExternalSyncSettingsResponse {
4525 pub fn new() -> Self {
4526 std::default::Default::default()
4527 }
4528
4529 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4531 self.kind = v.into();
4532 self
4533 }
4534
4535 pub fn set_errors<T, V>(mut self, v: T) -> Self
4537 where
4538 T: std::iter::IntoIterator<Item = V>,
4539 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4540 {
4541 use std::iter::Iterator;
4542 self.errors = v.into_iter().map(|i| i.into()).collect();
4543 self
4544 }
4545
4546 pub fn set_warnings<T, V>(mut self, v: T) -> Self
4548 where
4549 T: std::iter::IntoIterator<Item = V>,
4550 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
4551 {
4552 use std::iter::Iterator;
4553 self.warnings = v.into_iter().map(|i| i.into()).collect();
4554 self
4555 }
4556}
4557
4558impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
4559 fn typename() -> &'static str {
4560 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
4561 }
4562}
4563
4564#[derive(Clone, Default, PartialEq)]
4566#[non_exhaustive]
4567pub struct SqlInstancesGetDiskShrinkConfigResponse {
4568 pub kind: std::string::String,
4570
4571 pub minimal_target_size_gb: i64,
4573
4574 pub message: std::string::String,
4576
4577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4578}
4579
4580impl SqlInstancesGetDiskShrinkConfigResponse {
4581 pub fn new() -> Self {
4582 std::default::Default::default()
4583 }
4584
4585 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4587 self.kind = v.into();
4588 self
4589 }
4590
4591 pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4593 self.minimal_target_size_gb = v.into();
4594 self
4595 }
4596
4597 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4599 self.message = v.into();
4600 self
4601 }
4602}
4603
4604impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
4605 fn typename() -> &'static str {
4606 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
4607 }
4608}
4609
4610#[derive(Clone, Default, PartialEq)]
4612#[non_exhaustive]
4613pub struct SqlInstancesGetLatestRecoveryTimeRequest {
4614 pub instance: std::string::String,
4616
4617 pub project: std::string::String,
4619
4620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4621}
4622
4623impl SqlInstancesGetLatestRecoveryTimeRequest {
4624 pub fn new() -> Self {
4625 std::default::Default::default()
4626 }
4627
4628 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4630 self.instance = v.into();
4631 self
4632 }
4633
4634 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4636 self.project = v.into();
4637 self
4638 }
4639}
4640
4641impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
4642 fn typename() -> &'static str {
4643 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
4644 }
4645}
4646
4647#[derive(Clone, Default, PartialEq)]
4649#[non_exhaustive]
4650pub struct SqlInstancesGetLatestRecoveryTimeResponse {
4651 pub kind: std::string::String,
4653
4654 pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
4656
4657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4658}
4659
4660impl SqlInstancesGetLatestRecoveryTimeResponse {
4661 pub fn new() -> Self {
4662 std::default::Default::default()
4663 }
4664
4665 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4667 self.kind = v.into();
4668 self
4669 }
4670
4671 pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
4673 where
4674 T: std::convert::Into<wkt::Timestamp>,
4675 {
4676 self.latest_recovery_time = std::option::Option::Some(v.into());
4677 self
4678 }
4679
4680 pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
4682 where
4683 T: std::convert::Into<wkt::Timestamp>,
4684 {
4685 self.latest_recovery_time = v.map(|x| x.into());
4686 self
4687 }
4688}
4689
4690impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
4691 fn typename() -> &'static str {
4692 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
4693 }
4694}
4695
4696#[derive(Clone, Default, PartialEq)]
4698#[non_exhaustive]
4699pub struct CloneContext {
4700 pub kind: std::string::String,
4702
4703 pub pitr_timestamp_ms: i64,
4705
4706 pub destination_instance_name: std::string::String,
4708
4709 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
4713
4714 pub point_in_time: std::option::Option<wkt::Timestamp>,
4717
4718 pub allocated_ip_range: std::string::String,
4726
4727 pub database_names: std::vec::Vec<std::string::String>,
4730
4731 pub preferred_zone: std::option::Option<std::string::String>,
4735
4736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl CloneContext {
4740 pub fn new() -> Self {
4741 std::default::Default::default()
4742 }
4743
4744 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4746 self.kind = v.into();
4747 self
4748 }
4749
4750 pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4752 self.pitr_timestamp_ms = v.into();
4753 self
4754 }
4755
4756 pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
4758 mut self,
4759 v: T,
4760 ) -> Self {
4761 self.destination_instance_name = v.into();
4762 self
4763 }
4764
4765 pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
4767 where
4768 T: std::convert::Into<crate::model::BinLogCoordinates>,
4769 {
4770 self.bin_log_coordinates = std::option::Option::Some(v.into());
4771 self
4772 }
4773
4774 pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
4776 where
4777 T: std::convert::Into<crate::model::BinLogCoordinates>,
4778 {
4779 self.bin_log_coordinates = v.map(|x| x.into());
4780 self
4781 }
4782
4783 pub fn set_point_in_time<T>(mut self, v: T) -> Self
4785 where
4786 T: std::convert::Into<wkt::Timestamp>,
4787 {
4788 self.point_in_time = std::option::Option::Some(v.into());
4789 self
4790 }
4791
4792 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
4794 where
4795 T: std::convert::Into<wkt::Timestamp>,
4796 {
4797 self.point_in_time = v.map(|x| x.into());
4798 self
4799 }
4800
4801 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
4803 mut self,
4804 v: T,
4805 ) -> Self {
4806 self.allocated_ip_range = v.into();
4807 self
4808 }
4809
4810 pub fn set_database_names<T, V>(mut self, v: T) -> Self
4812 where
4813 T: std::iter::IntoIterator<Item = V>,
4814 V: std::convert::Into<std::string::String>,
4815 {
4816 use std::iter::Iterator;
4817 self.database_names = v.into_iter().map(|i| i.into()).collect();
4818 self
4819 }
4820
4821 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
4823 where
4824 T: std::convert::Into<std::string::String>,
4825 {
4826 self.preferred_zone = std::option::Option::Some(v.into());
4827 self
4828 }
4829
4830 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
4832 where
4833 T: std::convert::Into<std::string::String>,
4834 {
4835 self.preferred_zone = v.map(|x| x.into());
4836 self
4837 }
4838}
4839
4840impl wkt::message::Message for CloneContext {
4841 fn typename() -> &'static str {
4842 "type.googleapis.com/google.cloud.sql.v1.CloneContext"
4843 }
4844}
4845
4846#[derive(Clone, Default, PartialEq)]
4848#[non_exhaustive]
4849pub struct BinLogCoordinates {
4850 pub bin_log_file_name: std::string::String,
4852
4853 pub bin_log_position: i64,
4855
4856 pub kind: std::string::String,
4858
4859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4860}
4861
4862impl BinLogCoordinates {
4863 pub fn new() -> Self {
4864 std::default::Default::default()
4865 }
4866
4867 pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
4869 mut self,
4870 v: T,
4871 ) -> Self {
4872 self.bin_log_file_name = v.into();
4873 self
4874 }
4875
4876 pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4878 self.bin_log_position = v.into();
4879 self
4880 }
4881
4882 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4884 self.kind = v.into();
4885 self
4886 }
4887}
4888
4889impl wkt::message::Message for BinLogCoordinates {
4890 fn typename() -> &'static str {
4891 "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
4892 }
4893}
4894
4895#[derive(Clone, Default, PartialEq)]
4897#[non_exhaustive]
4898pub struct DatabaseInstance {
4899 pub kind: std::string::String,
4901
4902 pub state: crate::model::database_instance::SqlInstanceState,
4904
4905 pub database_version: crate::model::SqlDatabaseVersion,
4908
4909 pub settings: std::option::Option<crate::model::Settings>,
4911
4912 pub etag: std::string::String,
4915
4916 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
4918
4919 pub master_instance_name: std::string::String,
4922
4923 pub replica_names: std::vec::Vec<std::string::String>,
4925
4926 #[deprecated]
4928 pub max_disk_size: std::option::Option<wkt::Int64Value>,
4929
4930 #[deprecated]
4937 pub current_disk_size: std::option::Option<wkt::Int64Value>,
4938
4939 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
4941
4942 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
4944
4945 pub instance_type: crate::model::SqlInstanceType,
4947
4948 pub project: std::string::String,
4951
4952 #[deprecated]
4956 pub ipv6_address: std::string::String,
4957
4958 pub service_account_email_address: std::string::String,
4961
4962 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
4964
4965 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
4967
4968 pub backend_type: crate::model::SqlBackendType,
4975
4976 pub self_link: std::string::String,
4978
4979 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
4981
4982 pub connection_name: std::string::String,
4984
4985 pub name: std::string::String,
4987
4988 pub region: std::string::String,
4997
4998 pub gce_zone: std::string::String,
5003
5004 pub secondary_gce_zone: std::string::String,
5009
5010 pub disk_encryption_configuration:
5012 std::option::Option<crate::model::DiskEncryptionConfiguration>,
5013
5014 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
5016
5017 pub root_password: std::string::String,
5020
5021 pub scheduled_maintenance:
5023 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
5024
5025 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
5029
5030 pub database_installed_version: std::string::String,
5033
5034 pub out_of_disk_report:
5042 std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
5043
5044 pub create_time: std::option::Option<wkt::Timestamp>,
5048
5049 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
5051
5052 pub maintenance_version: std::string::String,
5054
5055 pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
5057
5058 pub sql_network_architecture:
5059 std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
5060
5061 pub psc_service_attachment_link: std::option::Option<std::string::String>,
5063
5064 pub dns_name: std::option::Option<std::string::String>,
5066
5067 #[deprecated]
5069 pub primary_dns_name: std::option::Option<std::string::String>,
5070
5071 pub write_endpoint: std::option::Option<std::string::String>,
5073
5074 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
5079
5080 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
5082
5083 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
5087
5088 pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
5091
5092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5093}
5094
5095impl DatabaseInstance {
5096 pub fn new() -> Self {
5097 std::default::Default::default()
5098 }
5099
5100 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5102 self.kind = v.into();
5103 self
5104 }
5105
5106 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
5108 mut self,
5109 v: T,
5110 ) -> Self {
5111 self.state = v.into();
5112 self
5113 }
5114
5115 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
5117 mut self,
5118 v: T,
5119 ) -> Self {
5120 self.database_version = v.into();
5121 self
5122 }
5123
5124 pub fn set_settings<T>(mut self, v: T) -> Self
5126 where
5127 T: std::convert::Into<crate::model::Settings>,
5128 {
5129 self.settings = std::option::Option::Some(v.into());
5130 self
5131 }
5132
5133 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
5135 where
5136 T: std::convert::Into<crate::model::Settings>,
5137 {
5138 self.settings = v.map(|x| x.into());
5139 self
5140 }
5141
5142 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5144 self.etag = v.into();
5145 self
5146 }
5147
5148 pub fn set_failover_replica<T>(mut self, v: T) -> Self
5150 where
5151 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
5152 {
5153 self.failover_replica = std::option::Option::Some(v.into());
5154 self
5155 }
5156
5157 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
5159 where
5160 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
5161 {
5162 self.failover_replica = v.map(|x| x.into());
5163 self
5164 }
5165
5166 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
5168 mut self,
5169 v: T,
5170 ) -> Self {
5171 self.master_instance_name = v.into();
5172 self
5173 }
5174
5175 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
5177 where
5178 T: std::iter::IntoIterator<Item = V>,
5179 V: std::convert::Into<std::string::String>,
5180 {
5181 use std::iter::Iterator;
5182 self.replica_names = v.into_iter().map(|i| i.into()).collect();
5183 self
5184 }
5185
5186 #[deprecated]
5188 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
5189 where
5190 T: std::convert::Into<wkt::Int64Value>,
5191 {
5192 self.max_disk_size = std::option::Option::Some(v.into());
5193 self
5194 }
5195
5196 #[deprecated]
5198 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
5199 where
5200 T: std::convert::Into<wkt::Int64Value>,
5201 {
5202 self.max_disk_size = v.map(|x| x.into());
5203 self
5204 }
5205
5206 #[deprecated]
5208 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
5209 where
5210 T: std::convert::Into<wkt::Int64Value>,
5211 {
5212 self.current_disk_size = std::option::Option::Some(v.into());
5213 self
5214 }
5215
5216 #[deprecated]
5218 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
5219 where
5220 T: std::convert::Into<wkt::Int64Value>,
5221 {
5222 self.current_disk_size = v.map(|x| x.into());
5223 self
5224 }
5225
5226 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
5228 where
5229 T: std::iter::IntoIterator<Item = V>,
5230 V: std::convert::Into<crate::model::IpMapping>,
5231 {
5232 use std::iter::Iterator;
5233 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
5234 self
5235 }
5236
5237 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
5239 where
5240 T: std::convert::Into<crate::model::SslCert>,
5241 {
5242 self.server_ca_cert = std::option::Option::Some(v.into());
5243 self
5244 }
5245
5246 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
5248 where
5249 T: std::convert::Into<crate::model::SslCert>,
5250 {
5251 self.server_ca_cert = v.map(|x| x.into());
5252 self
5253 }
5254
5255 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
5257 mut self,
5258 v: T,
5259 ) -> Self {
5260 self.instance_type = v.into();
5261 self
5262 }
5263
5264 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5266 self.project = v.into();
5267 self
5268 }
5269
5270 #[deprecated]
5272 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5273 self.ipv6_address = v.into();
5274 self
5275 }
5276
5277 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
5279 mut self,
5280 v: T,
5281 ) -> Self {
5282 self.service_account_email_address = v.into();
5283 self
5284 }
5285
5286 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
5288 where
5289 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
5290 {
5291 self.on_premises_configuration = std::option::Option::Some(v.into());
5292 self
5293 }
5294
5295 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
5297 where
5298 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
5299 {
5300 self.on_premises_configuration = v.map(|x| x.into());
5301 self
5302 }
5303
5304 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
5306 where
5307 T: std::convert::Into<crate::model::ReplicaConfiguration>,
5308 {
5309 self.replica_configuration = std::option::Option::Some(v.into());
5310 self
5311 }
5312
5313 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
5315 where
5316 T: std::convert::Into<crate::model::ReplicaConfiguration>,
5317 {
5318 self.replica_configuration = v.map(|x| x.into());
5319 self
5320 }
5321
5322 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
5324 mut self,
5325 v: T,
5326 ) -> Self {
5327 self.backend_type = v.into();
5328 self
5329 }
5330
5331 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5333 self.self_link = v.into();
5334 self
5335 }
5336
5337 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
5339 where
5340 T: std::iter::IntoIterator<Item = V>,
5341 V: std::convert::Into<crate::model::SqlSuspensionReason>,
5342 {
5343 use std::iter::Iterator;
5344 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
5345 self
5346 }
5347
5348 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5350 self.connection_name = v.into();
5351 self
5352 }
5353
5354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5356 self.name = v.into();
5357 self
5358 }
5359
5360 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5362 self.region = v.into();
5363 self
5364 }
5365
5366 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5368 self.gce_zone = v.into();
5369 self
5370 }
5371
5372 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
5374 mut self,
5375 v: T,
5376 ) -> Self {
5377 self.secondary_gce_zone = v.into();
5378 self
5379 }
5380
5381 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
5383 where
5384 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
5385 {
5386 self.disk_encryption_configuration = std::option::Option::Some(v.into());
5387 self
5388 }
5389
5390 pub fn set_or_clear_disk_encryption_configuration<T>(
5392 mut self,
5393 v: std::option::Option<T>,
5394 ) -> Self
5395 where
5396 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
5397 {
5398 self.disk_encryption_configuration = v.map(|x| x.into());
5399 self
5400 }
5401
5402 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
5404 where
5405 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
5406 {
5407 self.disk_encryption_status = std::option::Option::Some(v.into());
5408 self
5409 }
5410
5411 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
5413 where
5414 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
5415 {
5416 self.disk_encryption_status = v.map(|x| x.into());
5417 self
5418 }
5419
5420 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5422 self.root_password = v.into();
5423 self
5424 }
5425
5426 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
5428 where
5429 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
5430 {
5431 self.scheduled_maintenance = std::option::Option::Some(v.into());
5432 self
5433 }
5434
5435 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
5437 where
5438 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
5439 {
5440 self.scheduled_maintenance = v.map(|x| x.into());
5441 self
5442 }
5443
5444 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5446 where
5447 T: std::convert::Into<wkt::BoolValue>,
5448 {
5449 self.satisfies_pzs = std::option::Option::Some(v.into());
5450 self
5451 }
5452
5453 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5455 where
5456 T: std::convert::Into<wkt::BoolValue>,
5457 {
5458 self.satisfies_pzs = v.map(|x| x.into());
5459 self
5460 }
5461
5462 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
5464 mut self,
5465 v: T,
5466 ) -> Self {
5467 self.database_installed_version = v.into();
5468 self
5469 }
5470
5471 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
5473 where
5474 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
5475 {
5476 self.out_of_disk_report = std::option::Option::Some(v.into());
5477 self
5478 }
5479
5480 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
5482 where
5483 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
5484 {
5485 self.out_of_disk_report = v.map(|x| x.into());
5486 self
5487 }
5488
5489 pub fn set_create_time<T>(mut self, v: T) -> Self
5491 where
5492 T: std::convert::Into<wkt::Timestamp>,
5493 {
5494 self.create_time = std::option::Option::Some(v.into());
5495 self
5496 }
5497
5498 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5500 where
5501 T: std::convert::Into<wkt::Timestamp>,
5502 {
5503 self.create_time = v.map(|x| x.into());
5504 self
5505 }
5506
5507 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
5509 where
5510 T: std::iter::IntoIterator<Item = V>,
5511 V: std::convert::Into<std::string::String>,
5512 {
5513 use std::iter::Iterator;
5514 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
5515 self
5516 }
5517
5518 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
5520 mut self,
5521 v: T,
5522 ) -> Self {
5523 self.maintenance_version = v.into();
5524 self
5525 }
5526
5527 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
5529 where
5530 T: std::iter::IntoIterator<Item = V>,
5531 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
5532 {
5533 use std::iter::Iterator;
5534 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
5535 self
5536 }
5537
5538 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
5540 where
5541 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
5542 {
5543 self.sql_network_architecture = std::option::Option::Some(v.into());
5544 self
5545 }
5546
5547 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
5549 where
5550 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
5551 {
5552 self.sql_network_architecture = v.map(|x| x.into());
5553 self
5554 }
5555
5556 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
5558 where
5559 T: std::convert::Into<std::string::String>,
5560 {
5561 self.psc_service_attachment_link = std::option::Option::Some(v.into());
5562 self
5563 }
5564
5565 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
5567 where
5568 T: std::convert::Into<std::string::String>,
5569 {
5570 self.psc_service_attachment_link = v.map(|x| x.into());
5571 self
5572 }
5573
5574 pub fn set_dns_name<T>(mut self, v: T) -> Self
5576 where
5577 T: std::convert::Into<std::string::String>,
5578 {
5579 self.dns_name = std::option::Option::Some(v.into());
5580 self
5581 }
5582
5583 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
5585 where
5586 T: std::convert::Into<std::string::String>,
5587 {
5588 self.dns_name = v.map(|x| x.into());
5589 self
5590 }
5591
5592 #[deprecated]
5594 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
5595 where
5596 T: std::convert::Into<std::string::String>,
5597 {
5598 self.primary_dns_name = std::option::Option::Some(v.into());
5599 self
5600 }
5601
5602 #[deprecated]
5604 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
5605 where
5606 T: std::convert::Into<std::string::String>,
5607 {
5608 self.primary_dns_name = v.map(|x| x.into());
5609 self
5610 }
5611
5612 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
5614 where
5615 T: std::convert::Into<std::string::String>,
5616 {
5617 self.write_endpoint = std::option::Option::Some(v.into());
5618 self
5619 }
5620
5621 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5623 where
5624 T: std::convert::Into<std::string::String>,
5625 {
5626 self.write_endpoint = v.map(|x| x.into());
5627 self
5628 }
5629
5630 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
5632 where
5633 T: std::convert::Into<crate::model::ReplicationCluster>,
5634 {
5635 self.replication_cluster = std::option::Option::Some(v.into());
5636 self
5637 }
5638
5639 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
5641 where
5642 T: std::convert::Into<crate::model::ReplicationCluster>,
5643 {
5644 self.replication_cluster = v.map(|x| x.into());
5645 self
5646 }
5647
5648 pub fn set_gemini_config<T>(mut self, v: T) -> Self
5650 where
5651 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
5652 {
5653 self.gemini_config = std::option::Option::Some(v.into());
5654 self
5655 }
5656
5657 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
5659 where
5660 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
5661 {
5662 self.gemini_config = v.map(|x| x.into());
5663 self
5664 }
5665
5666 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5668 where
5669 T: std::convert::Into<wkt::BoolValue>,
5670 {
5671 self.satisfies_pzi = std::option::Option::Some(v.into());
5672 self
5673 }
5674
5675 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5677 where
5678 T: std::convert::Into<wkt::BoolValue>,
5679 {
5680 self.satisfies_pzi = v.map(|x| x.into());
5681 self
5682 }
5683
5684 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
5686 where
5687 T: std::convert::Into<wkt::BoolValue>,
5688 {
5689 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
5690 self
5691 }
5692
5693 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
5695 mut self,
5696 v: std::option::Option<T>,
5697 ) -> Self
5698 where
5699 T: std::convert::Into<wkt::BoolValue>,
5700 {
5701 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
5702 self
5703 }
5704}
5705
5706impl wkt::message::Message for DatabaseInstance {
5707 fn typename() -> &'static str {
5708 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
5709 }
5710}
5711
5712pub mod database_instance {
5714 #[allow(unused_imports)]
5715 use super::*;
5716
5717 #[derive(Clone, Default, PartialEq)]
5718 #[non_exhaustive]
5719 pub struct SqlFailoverReplica {
5720 pub name: std::string::String,
5724
5725 pub available: std::option::Option<wkt::BoolValue>,
5729
5730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5731 }
5732
5733 impl SqlFailoverReplica {
5734 pub fn new() -> Self {
5735 std::default::Default::default()
5736 }
5737
5738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5740 self.name = v.into();
5741 self
5742 }
5743
5744 pub fn set_available<T>(mut self, v: T) -> Self
5746 where
5747 T: std::convert::Into<wkt::BoolValue>,
5748 {
5749 self.available = std::option::Option::Some(v.into());
5750 self
5751 }
5752
5753 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
5755 where
5756 T: std::convert::Into<wkt::BoolValue>,
5757 {
5758 self.available = v.map(|x| x.into());
5759 self
5760 }
5761 }
5762
5763 impl wkt::message::Message for SqlFailoverReplica {
5764 fn typename() -> &'static str {
5765 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
5766 }
5767 }
5768
5769 #[derive(Clone, Default, PartialEq)]
5771 #[non_exhaustive]
5772 pub struct SqlScheduledMaintenance {
5773 pub start_time: std::option::Option<wkt::Timestamp>,
5775
5776 #[deprecated]
5777 pub can_defer: bool,
5778
5779 pub can_reschedule: bool,
5781
5782 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
5784
5785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5786 }
5787
5788 impl SqlScheduledMaintenance {
5789 pub fn new() -> Self {
5790 std::default::Default::default()
5791 }
5792
5793 pub fn set_start_time<T>(mut self, v: T) -> Self
5795 where
5796 T: std::convert::Into<wkt::Timestamp>,
5797 {
5798 self.start_time = std::option::Option::Some(v.into());
5799 self
5800 }
5801
5802 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5804 where
5805 T: std::convert::Into<wkt::Timestamp>,
5806 {
5807 self.start_time = v.map(|x| x.into());
5808 self
5809 }
5810
5811 #[deprecated]
5813 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5814 self.can_defer = v.into();
5815 self
5816 }
5817
5818 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5820 self.can_reschedule = v.into();
5821 self
5822 }
5823
5824 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
5826 where
5827 T: std::convert::Into<wkt::Timestamp>,
5828 {
5829 self.schedule_deadline_time = std::option::Option::Some(v.into());
5830 self
5831 }
5832
5833 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
5835 where
5836 T: std::convert::Into<wkt::Timestamp>,
5837 {
5838 self.schedule_deadline_time = v.map(|x| x.into());
5839 self
5840 }
5841 }
5842
5843 impl wkt::message::Message for SqlScheduledMaintenance {
5844 fn typename() -> &'static str {
5845 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
5846 }
5847 }
5848
5849 #[derive(Clone, Default, PartialEq)]
5851 #[non_exhaustive]
5852 pub struct SqlOutOfDiskReport {
5853 pub sql_out_of_disk_state: std::option::Option<
5861 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5862 >,
5863
5864 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
5871
5872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5873 }
5874
5875 impl SqlOutOfDiskReport {
5876 pub fn new() -> Self {
5877 std::default::Default::default()
5878 }
5879
5880 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
5882 where
5883 T: std::convert::Into<
5884 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5885 >,
5886 {
5887 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
5888 self
5889 }
5890
5891 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
5893 where
5894 T: std::convert::Into<
5895 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
5896 >,
5897 {
5898 self.sql_out_of_disk_state = v.map(|x| x.into());
5899 self
5900 }
5901
5902 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
5904 where
5905 T: std::convert::Into<i32>,
5906 {
5907 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
5908 self
5909 }
5910
5911 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
5913 mut self,
5914 v: std::option::Option<T>,
5915 ) -> Self
5916 where
5917 T: std::convert::Into<i32>,
5918 {
5919 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
5920 self
5921 }
5922 }
5923
5924 impl wkt::message::Message for SqlOutOfDiskReport {
5925 fn typename() -> &'static str {
5926 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
5927 }
5928 }
5929
5930 pub mod sql_out_of_disk_report {
5932 #[allow(unused_imports)]
5933 use super::*;
5934
5935 #[derive(Clone, Debug, PartialEq)]
5951 #[non_exhaustive]
5952 pub enum SqlOutOfDiskState {
5953 Unspecified,
5955 Normal,
5957 SoftShutdown,
5960 UnknownValue(sql_out_of_disk_state::UnknownValue),
5965 }
5966
5967 #[doc(hidden)]
5968 pub mod sql_out_of_disk_state {
5969 #[allow(unused_imports)]
5970 use super::*;
5971 #[derive(Clone, Debug, PartialEq)]
5972 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5973 }
5974
5975 impl SqlOutOfDiskState {
5976 pub fn value(&self) -> std::option::Option<i32> {
5981 match self {
5982 Self::Unspecified => std::option::Option::Some(0),
5983 Self::Normal => std::option::Option::Some(1),
5984 Self::SoftShutdown => std::option::Option::Some(2),
5985 Self::UnknownValue(u) => u.0.value(),
5986 }
5987 }
5988
5989 pub fn name(&self) -> std::option::Option<&str> {
5994 match self {
5995 Self::Unspecified => {
5996 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
5997 }
5998 Self::Normal => std::option::Option::Some("NORMAL"),
5999 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
6000 Self::UnknownValue(u) => u.0.name(),
6001 }
6002 }
6003 }
6004
6005 impl std::default::Default for SqlOutOfDiskState {
6006 fn default() -> Self {
6007 use std::convert::From;
6008 Self::from(0)
6009 }
6010 }
6011
6012 impl std::fmt::Display for SqlOutOfDiskState {
6013 fn fmt(
6014 &self,
6015 f: &mut std::fmt::Formatter<'_>,
6016 ) -> std::result::Result<(), std::fmt::Error> {
6017 wkt::internal::display_enum(f, self.name(), self.value())
6018 }
6019 }
6020
6021 impl std::convert::From<i32> for SqlOutOfDiskState {
6022 fn from(value: i32) -> Self {
6023 match value {
6024 0 => Self::Unspecified,
6025 1 => Self::Normal,
6026 2 => Self::SoftShutdown,
6027 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
6028 wkt::internal::UnknownEnumValue::Integer(value),
6029 )),
6030 }
6031 }
6032 }
6033
6034 impl std::convert::From<&str> for SqlOutOfDiskState {
6035 fn from(value: &str) -> Self {
6036 use std::string::ToString;
6037 match value {
6038 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
6039 "NORMAL" => Self::Normal,
6040 "SOFT_SHUTDOWN" => Self::SoftShutdown,
6041 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
6042 wkt::internal::UnknownEnumValue::String(value.to_string()),
6043 )),
6044 }
6045 }
6046 }
6047
6048 impl serde::ser::Serialize for SqlOutOfDiskState {
6049 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6050 where
6051 S: serde::Serializer,
6052 {
6053 match self {
6054 Self::Unspecified => serializer.serialize_i32(0),
6055 Self::Normal => serializer.serialize_i32(1),
6056 Self::SoftShutdown => serializer.serialize_i32(2),
6057 Self::UnknownValue(u) => u.0.serialize(serializer),
6058 }
6059 }
6060 }
6061
6062 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
6063 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6064 where
6065 D: serde::Deserializer<'de>,
6066 {
6067 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
6068 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
6069 ))
6070 }
6071 }
6072 }
6073
6074 #[derive(Clone, Debug, PartialEq)]
6090 #[non_exhaustive]
6091 pub enum SqlInstanceState {
6092 Unspecified,
6094 Runnable,
6096 Suspended,
6098 PendingDelete,
6100 PendingCreate,
6102 Maintenance,
6104 Failed,
6107 #[deprecated]
6109 OnlineMaintenance,
6110 UnknownValue(sql_instance_state::UnknownValue),
6115 }
6116
6117 #[doc(hidden)]
6118 pub mod sql_instance_state {
6119 #[allow(unused_imports)]
6120 use super::*;
6121 #[derive(Clone, Debug, PartialEq)]
6122 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6123 }
6124
6125 impl SqlInstanceState {
6126 pub fn value(&self) -> std::option::Option<i32> {
6131 match self {
6132 Self::Unspecified => std::option::Option::Some(0),
6133 Self::Runnable => std::option::Option::Some(1),
6134 Self::Suspended => std::option::Option::Some(2),
6135 Self::PendingDelete => std::option::Option::Some(3),
6136 Self::PendingCreate => std::option::Option::Some(4),
6137 Self::Maintenance => std::option::Option::Some(5),
6138 Self::Failed => std::option::Option::Some(6),
6139 Self::OnlineMaintenance => std::option::Option::Some(7),
6140 Self::UnknownValue(u) => u.0.value(),
6141 }
6142 }
6143
6144 pub fn name(&self) -> std::option::Option<&str> {
6149 match self {
6150 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
6151 Self::Runnable => std::option::Option::Some("RUNNABLE"),
6152 Self::Suspended => std::option::Option::Some("SUSPENDED"),
6153 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
6154 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
6155 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
6156 Self::Failed => std::option::Option::Some("FAILED"),
6157 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
6158 Self::UnknownValue(u) => u.0.name(),
6159 }
6160 }
6161 }
6162
6163 impl std::default::Default for SqlInstanceState {
6164 fn default() -> Self {
6165 use std::convert::From;
6166 Self::from(0)
6167 }
6168 }
6169
6170 impl std::fmt::Display for SqlInstanceState {
6171 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6172 wkt::internal::display_enum(f, self.name(), self.value())
6173 }
6174 }
6175
6176 impl std::convert::From<i32> for SqlInstanceState {
6177 fn from(value: i32) -> Self {
6178 match value {
6179 0 => Self::Unspecified,
6180 1 => Self::Runnable,
6181 2 => Self::Suspended,
6182 3 => Self::PendingDelete,
6183 4 => Self::PendingCreate,
6184 5 => Self::Maintenance,
6185 6 => Self::Failed,
6186 7 => Self::OnlineMaintenance,
6187 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6188 wkt::internal::UnknownEnumValue::Integer(value),
6189 )),
6190 }
6191 }
6192 }
6193
6194 impl std::convert::From<&str> for SqlInstanceState {
6195 fn from(value: &str) -> Self {
6196 use std::string::ToString;
6197 match value {
6198 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
6199 "RUNNABLE" => Self::Runnable,
6200 "SUSPENDED" => Self::Suspended,
6201 "PENDING_DELETE" => Self::PendingDelete,
6202 "PENDING_CREATE" => Self::PendingCreate,
6203 "MAINTENANCE" => Self::Maintenance,
6204 "FAILED" => Self::Failed,
6205 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
6206 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
6207 wkt::internal::UnknownEnumValue::String(value.to_string()),
6208 )),
6209 }
6210 }
6211 }
6212
6213 impl serde::ser::Serialize for SqlInstanceState {
6214 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6215 where
6216 S: serde::Serializer,
6217 {
6218 match self {
6219 Self::Unspecified => serializer.serialize_i32(0),
6220 Self::Runnable => serializer.serialize_i32(1),
6221 Self::Suspended => serializer.serialize_i32(2),
6222 Self::PendingDelete => serializer.serialize_i32(3),
6223 Self::PendingCreate => serializer.serialize_i32(4),
6224 Self::Maintenance => serializer.serialize_i32(5),
6225 Self::Failed => serializer.serialize_i32(6),
6226 Self::OnlineMaintenance => serializer.serialize_i32(7),
6227 Self::UnknownValue(u) => u.0.serialize(serializer),
6228 }
6229 }
6230 }
6231
6232 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
6233 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6234 where
6235 D: serde::Deserializer<'de>,
6236 {
6237 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
6238 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
6239 ))
6240 }
6241 }
6242
6243 #[derive(Clone, Debug, PartialEq)]
6259 #[non_exhaustive]
6260 pub enum SqlNetworkArchitecture {
6261 Unspecified,
6262 NewNetworkArchitecture,
6264 OldNetworkArchitecture,
6266 UnknownValue(sql_network_architecture::UnknownValue),
6271 }
6272
6273 #[doc(hidden)]
6274 pub mod sql_network_architecture {
6275 #[allow(unused_imports)]
6276 use super::*;
6277 #[derive(Clone, Debug, PartialEq)]
6278 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6279 }
6280
6281 impl SqlNetworkArchitecture {
6282 pub fn value(&self) -> std::option::Option<i32> {
6287 match self {
6288 Self::Unspecified => std::option::Option::Some(0),
6289 Self::NewNetworkArchitecture => std::option::Option::Some(1),
6290 Self::OldNetworkArchitecture => std::option::Option::Some(2),
6291 Self::UnknownValue(u) => u.0.value(),
6292 }
6293 }
6294
6295 pub fn name(&self) -> std::option::Option<&str> {
6300 match self {
6301 Self::Unspecified => {
6302 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
6303 }
6304 Self::NewNetworkArchitecture => {
6305 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
6306 }
6307 Self::OldNetworkArchitecture => {
6308 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
6309 }
6310 Self::UnknownValue(u) => u.0.name(),
6311 }
6312 }
6313 }
6314
6315 impl std::default::Default for SqlNetworkArchitecture {
6316 fn default() -> Self {
6317 use std::convert::From;
6318 Self::from(0)
6319 }
6320 }
6321
6322 impl std::fmt::Display for SqlNetworkArchitecture {
6323 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6324 wkt::internal::display_enum(f, self.name(), self.value())
6325 }
6326 }
6327
6328 impl std::convert::From<i32> for SqlNetworkArchitecture {
6329 fn from(value: i32) -> Self {
6330 match value {
6331 0 => Self::Unspecified,
6332 1 => Self::NewNetworkArchitecture,
6333 2 => Self::OldNetworkArchitecture,
6334 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6335 wkt::internal::UnknownEnumValue::Integer(value),
6336 )),
6337 }
6338 }
6339 }
6340
6341 impl std::convert::From<&str> for SqlNetworkArchitecture {
6342 fn from(value: &str) -> Self {
6343 use std::string::ToString;
6344 match value {
6345 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
6346 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
6347 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
6348 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
6349 wkt::internal::UnknownEnumValue::String(value.to_string()),
6350 )),
6351 }
6352 }
6353 }
6354
6355 impl serde::ser::Serialize for SqlNetworkArchitecture {
6356 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6357 where
6358 S: serde::Serializer,
6359 {
6360 match self {
6361 Self::Unspecified => serializer.serialize_i32(0),
6362 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
6363 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
6364 Self::UnknownValue(u) => u.0.serialize(serializer),
6365 }
6366 }
6367 }
6368
6369 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
6370 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6371 where
6372 D: serde::Deserializer<'de>,
6373 {
6374 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
6375 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
6376 ))
6377 }
6378 }
6379}
6380
6381#[derive(Clone, Default, PartialEq)]
6383#[non_exhaustive]
6384pub struct GeminiInstanceConfig {
6385 pub entitled: std::option::Option<bool>,
6387
6388 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
6390
6391 pub oom_session_cancel_enabled: std::option::Option<bool>,
6393
6394 pub active_query_enabled: std::option::Option<bool>,
6396
6397 pub index_advisor_enabled: std::option::Option<bool>,
6399
6400 pub flag_recommender_enabled: std::option::Option<bool>,
6402
6403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6404}
6405
6406impl GeminiInstanceConfig {
6407 pub fn new() -> Self {
6408 std::default::Default::default()
6409 }
6410
6411 pub fn set_entitled<T>(mut self, v: T) -> Self
6413 where
6414 T: std::convert::Into<bool>,
6415 {
6416 self.entitled = std::option::Option::Some(v.into());
6417 self
6418 }
6419
6420 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
6422 where
6423 T: std::convert::Into<bool>,
6424 {
6425 self.entitled = v.map(|x| x.into());
6426 self
6427 }
6428
6429 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
6431 where
6432 T: std::convert::Into<bool>,
6433 {
6434 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
6435 self
6436 }
6437
6438 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6440 where
6441 T: std::convert::Into<bool>,
6442 {
6443 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
6444 self
6445 }
6446
6447 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
6449 where
6450 T: std::convert::Into<bool>,
6451 {
6452 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
6453 self
6454 }
6455
6456 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6458 where
6459 T: std::convert::Into<bool>,
6460 {
6461 self.oom_session_cancel_enabled = v.map(|x| x.into());
6462 self
6463 }
6464
6465 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
6467 where
6468 T: std::convert::Into<bool>,
6469 {
6470 self.active_query_enabled = std::option::Option::Some(v.into());
6471 self
6472 }
6473
6474 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6476 where
6477 T: std::convert::Into<bool>,
6478 {
6479 self.active_query_enabled = v.map(|x| x.into());
6480 self
6481 }
6482
6483 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
6485 where
6486 T: std::convert::Into<bool>,
6487 {
6488 self.index_advisor_enabled = std::option::Option::Some(v.into());
6489 self
6490 }
6491
6492 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6494 where
6495 T: std::convert::Into<bool>,
6496 {
6497 self.index_advisor_enabled = v.map(|x| x.into());
6498 self
6499 }
6500
6501 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
6503 where
6504 T: std::convert::Into<bool>,
6505 {
6506 self.flag_recommender_enabled = std::option::Option::Some(v.into());
6507 self
6508 }
6509
6510 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
6512 where
6513 T: std::convert::Into<bool>,
6514 {
6515 self.flag_recommender_enabled = v.map(|x| x.into());
6516 self
6517 }
6518}
6519
6520impl wkt::message::Message for GeminiInstanceConfig {
6521 fn typename() -> &'static str {
6522 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
6523 }
6524}
6525
6526#[derive(Clone, Default, PartialEq)]
6531#[non_exhaustive]
6532pub struct ReplicationCluster {
6533 pub psa_write_endpoint: std::string::String,
6541
6542 pub failover_dr_replica_name: std::string::String,
6549
6550 pub dr_replica: bool,
6553
6554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555}
6556
6557impl ReplicationCluster {
6558 pub fn new() -> Self {
6559 std::default::Default::default()
6560 }
6561
6562 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
6564 mut self,
6565 v: T,
6566 ) -> Self {
6567 self.psa_write_endpoint = v.into();
6568 self
6569 }
6570
6571 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
6573 mut self,
6574 v: T,
6575 ) -> Self {
6576 self.failover_dr_replica_name = v.into();
6577 self
6578 }
6579
6580 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6582 self.dr_replica = v.into();
6583 self
6584 }
6585}
6586
6587impl wkt::message::Message for ReplicationCluster {
6588 fn typename() -> &'static str {
6589 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
6590 }
6591}
6592
6593#[derive(Clone, Default, PartialEq)]
6595#[non_exhaustive]
6596pub struct AvailableDatabaseVersion {
6597 pub major_version: std::option::Option<std::string::String>,
6599
6600 pub name: std::option::Option<std::string::String>,
6603
6604 pub display_name: std::option::Option<std::string::String>,
6606
6607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6608}
6609
6610impl AvailableDatabaseVersion {
6611 pub fn new() -> Self {
6612 std::default::Default::default()
6613 }
6614
6615 pub fn set_major_version<T>(mut self, v: T) -> Self
6617 where
6618 T: std::convert::Into<std::string::String>,
6619 {
6620 self.major_version = std::option::Option::Some(v.into());
6621 self
6622 }
6623
6624 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
6626 where
6627 T: std::convert::Into<std::string::String>,
6628 {
6629 self.major_version = v.map(|x| x.into());
6630 self
6631 }
6632
6633 pub fn set_name<T>(mut self, v: T) -> Self
6635 where
6636 T: std::convert::Into<std::string::String>,
6637 {
6638 self.name = std::option::Option::Some(v.into());
6639 self
6640 }
6641
6642 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
6644 where
6645 T: std::convert::Into<std::string::String>,
6646 {
6647 self.name = v.map(|x| x.into());
6648 self
6649 }
6650
6651 pub fn set_display_name<T>(mut self, v: T) -> Self
6653 where
6654 T: std::convert::Into<std::string::String>,
6655 {
6656 self.display_name = std::option::Option::Some(v.into());
6657 self
6658 }
6659
6660 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
6662 where
6663 T: std::convert::Into<std::string::String>,
6664 {
6665 self.display_name = v.map(|x| x.into());
6666 self
6667 }
6668}
6669
6670impl wkt::message::Message for AvailableDatabaseVersion {
6671 fn typename() -> &'static str {
6672 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
6673 }
6674}
6675
6676#[derive(Clone, Default, PartialEq)]
6678#[non_exhaustive]
6679pub struct SqlInstancesRescheduleMaintenanceRequestBody {
6680 pub reschedule: std::option::Option<
6682 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6683 >,
6684
6685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6686}
6687
6688impl SqlInstancesRescheduleMaintenanceRequestBody {
6689 pub fn new() -> Self {
6690 std::default::Default::default()
6691 }
6692
6693 pub fn set_reschedule<T>(mut self, v: T) -> Self
6695 where
6696 T: std::convert::Into<
6697 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6698 >,
6699 {
6700 self.reschedule = std::option::Option::Some(v.into());
6701 self
6702 }
6703
6704 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
6706 where
6707 T: std::convert::Into<
6708 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
6709 >,
6710 {
6711 self.reschedule = v.map(|x| x.into());
6712 self
6713 }
6714}
6715
6716impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
6717 fn typename() -> &'static str {
6718 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
6719 }
6720}
6721
6722pub mod sql_instances_reschedule_maintenance_request_body {
6724 #[allow(unused_imports)]
6725 use super::*;
6726
6727 #[derive(Clone, Default, PartialEq)]
6728 #[non_exhaustive]
6729 pub struct Reschedule {
6730 pub reschedule_type:
6732 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6733
6734 pub schedule_time: std::option::Option<wkt::Timestamp>,
6739
6740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6741 }
6742
6743 impl Reschedule {
6744 pub fn new() -> Self {
6745 std::default::Default::default()
6746 }
6747
6748 pub fn set_reschedule_type<
6750 T: std::convert::Into<
6751 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
6752 >,
6753 >(
6754 mut self,
6755 v: T,
6756 ) -> Self {
6757 self.reschedule_type = v.into();
6758 self
6759 }
6760
6761 pub fn set_schedule_time<T>(mut self, v: T) -> Self
6763 where
6764 T: std::convert::Into<wkt::Timestamp>,
6765 {
6766 self.schedule_time = std::option::Option::Some(v.into());
6767 self
6768 }
6769
6770 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
6772 where
6773 T: std::convert::Into<wkt::Timestamp>,
6774 {
6775 self.schedule_time = v.map(|x| x.into());
6776 self
6777 }
6778 }
6779
6780 impl wkt::message::Message for Reschedule {
6781 fn typename() -> &'static str {
6782 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
6783 }
6784 }
6785
6786 #[derive(Clone, Debug, PartialEq)]
6801 #[non_exhaustive]
6802 pub enum RescheduleType {
6803 Unspecified,
6804 Immediate,
6806 NextAvailableWindow,
6809 SpecificTime,
6811 UnknownValue(reschedule_type::UnknownValue),
6816 }
6817
6818 #[doc(hidden)]
6819 pub mod reschedule_type {
6820 #[allow(unused_imports)]
6821 use super::*;
6822 #[derive(Clone, Debug, PartialEq)]
6823 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6824 }
6825
6826 impl RescheduleType {
6827 pub fn value(&self) -> std::option::Option<i32> {
6832 match self {
6833 Self::Unspecified => std::option::Option::Some(0),
6834 Self::Immediate => std::option::Option::Some(1),
6835 Self::NextAvailableWindow => std::option::Option::Some(2),
6836 Self::SpecificTime => std::option::Option::Some(3),
6837 Self::UnknownValue(u) => u.0.value(),
6838 }
6839 }
6840
6841 pub fn name(&self) -> std::option::Option<&str> {
6846 match self {
6847 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
6848 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
6849 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
6850 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
6851 Self::UnknownValue(u) => u.0.name(),
6852 }
6853 }
6854 }
6855
6856 impl std::default::Default for RescheduleType {
6857 fn default() -> Self {
6858 use std::convert::From;
6859 Self::from(0)
6860 }
6861 }
6862
6863 impl std::fmt::Display for RescheduleType {
6864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6865 wkt::internal::display_enum(f, self.name(), self.value())
6866 }
6867 }
6868
6869 impl std::convert::From<i32> for RescheduleType {
6870 fn from(value: i32) -> Self {
6871 match value {
6872 0 => Self::Unspecified,
6873 1 => Self::Immediate,
6874 2 => Self::NextAvailableWindow,
6875 3 => Self::SpecificTime,
6876 _ => Self::UnknownValue(reschedule_type::UnknownValue(
6877 wkt::internal::UnknownEnumValue::Integer(value),
6878 )),
6879 }
6880 }
6881 }
6882
6883 impl std::convert::From<&str> for RescheduleType {
6884 fn from(value: &str) -> Self {
6885 use std::string::ToString;
6886 match value {
6887 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
6888 "IMMEDIATE" => Self::Immediate,
6889 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
6890 "SPECIFIC_TIME" => Self::SpecificTime,
6891 _ => Self::UnknownValue(reschedule_type::UnknownValue(
6892 wkt::internal::UnknownEnumValue::String(value.to_string()),
6893 )),
6894 }
6895 }
6896 }
6897
6898 impl serde::ser::Serialize for RescheduleType {
6899 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6900 where
6901 S: serde::Serializer,
6902 {
6903 match self {
6904 Self::Unspecified => serializer.serialize_i32(0),
6905 Self::Immediate => serializer.serialize_i32(1),
6906 Self::NextAvailableWindow => serializer.serialize_i32(2),
6907 Self::SpecificTime => serializer.serialize_i32(3),
6908 Self::UnknownValue(u) => u.0.serialize(serializer),
6909 }
6910 }
6911 }
6912
6913 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
6914 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6915 where
6916 D: serde::Deserializer<'de>,
6917 {
6918 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
6919 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
6920 ))
6921 }
6922 }
6923}
6924
6925#[derive(Clone, Default, PartialEq)]
6927#[non_exhaustive]
6928pub struct DemoteMasterContext {
6929 pub kind: std::string::String,
6931
6932 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
6940
6941 pub master_instance_name: std::string::String,
6944
6945 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
6948
6949 pub skip_replication_setup: bool,
6951
6952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6953}
6954
6955impl DemoteMasterContext {
6956 pub fn new() -> Self {
6957 std::default::Default::default()
6958 }
6959
6960 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6962 self.kind = v.into();
6963 self
6964 }
6965
6966 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
6968 where
6969 T: std::convert::Into<wkt::BoolValue>,
6970 {
6971 self.verify_gtid_consistency = std::option::Option::Some(v.into());
6972 self
6973 }
6974
6975 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
6977 where
6978 T: std::convert::Into<wkt::BoolValue>,
6979 {
6980 self.verify_gtid_consistency = v.map(|x| x.into());
6981 self
6982 }
6983
6984 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
6986 mut self,
6987 v: T,
6988 ) -> Self {
6989 self.master_instance_name = v.into();
6990 self
6991 }
6992
6993 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
6995 where
6996 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
6997 {
6998 self.replica_configuration = std::option::Option::Some(v.into());
6999 self
7000 }
7001
7002 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
7004 where
7005 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
7006 {
7007 self.replica_configuration = v.map(|x| x.into());
7008 self
7009 }
7010
7011 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7013 self.skip_replication_setup = v.into();
7014 self
7015 }
7016}
7017
7018impl wkt::message::Message for DemoteMasterContext {
7019 fn typename() -> &'static str {
7020 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
7021 }
7022}
7023
7024#[derive(Clone, Default, PartialEq)]
7027#[non_exhaustive]
7028pub struct DemoteContext {
7029 pub kind: std::string::String,
7031
7032 pub source_representative_instance_name: std::string::String,
7035
7036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7037}
7038
7039impl DemoteContext {
7040 pub fn new() -> Self {
7041 std::default::Default::default()
7042 }
7043
7044 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7046 self.kind = v.into();
7047 self
7048 }
7049
7050 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
7052 mut self,
7053 v: T,
7054 ) -> Self {
7055 self.source_representative_instance_name = v.into();
7056 self
7057 }
7058}
7059
7060impl wkt::message::Message for DemoteContext {
7061 fn typename() -> &'static str {
7062 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
7063 }
7064}
7065
7066#[derive(Clone, Default, PartialEq)]
7068#[non_exhaustive]
7069pub struct FailoverContext {
7070 pub settings_version: i64,
7073
7074 pub kind: std::string::String,
7076
7077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7078}
7079
7080impl FailoverContext {
7081 pub fn new() -> Self {
7082 std::default::Default::default()
7083 }
7084
7085 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7087 self.settings_version = v.into();
7088 self
7089 }
7090
7091 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7093 self.kind = v.into();
7094 self
7095 }
7096}
7097
7098impl wkt::message::Message for FailoverContext {
7099 fn typename() -> &'static str {
7100 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
7101 }
7102}
7103
7104#[derive(Clone, Default, PartialEq)]
7107#[non_exhaustive]
7108pub struct RestoreBackupContext {
7109 pub kind: std::string::String,
7111
7112 pub backup_run_id: i64,
7114
7115 pub instance_id: std::string::String,
7117
7118 pub project: std::string::String,
7120
7121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7122}
7123
7124impl RestoreBackupContext {
7125 pub fn new() -> Self {
7126 std::default::Default::default()
7127 }
7128
7129 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7131 self.kind = v.into();
7132 self
7133 }
7134
7135 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7137 self.backup_run_id = v.into();
7138 self
7139 }
7140
7141 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7143 self.instance_id = v.into();
7144 self
7145 }
7146
7147 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7149 self.project = v.into();
7150 self
7151 }
7152}
7153
7154impl wkt::message::Message for RestoreBackupContext {
7155 fn typename() -> &'static str {
7156 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
7157 }
7158}
7159
7160#[derive(Clone, Default, PartialEq)]
7162#[non_exhaustive]
7163pub struct RotateServerCaContext {
7164 pub kind: std::string::String,
7166
7167 pub next_version: std::string::String,
7170
7171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7172}
7173
7174impl RotateServerCaContext {
7175 pub fn new() -> Self {
7176 std::default::Default::default()
7177 }
7178
7179 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7181 self.kind = v.into();
7182 self
7183 }
7184
7185 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7187 self.next_version = v.into();
7188 self
7189 }
7190}
7191
7192impl wkt::message::Message for RotateServerCaContext {
7193 fn typename() -> &'static str {
7194 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
7195 }
7196}
7197
7198#[derive(Clone, Default, PartialEq)]
7200#[non_exhaustive]
7201pub struct TruncateLogContext {
7202 pub kind: std::string::String,
7204
7205 pub log_type: std::string::String,
7208
7209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7210}
7211
7212impl TruncateLogContext {
7213 pub fn new() -> Self {
7214 std::default::Default::default()
7215 }
7216
7217 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7219 self.kind = v.into();
7220 self
7221 }
7222
7223 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7225 self.log_type = v.into();
7226 self
7227 }
7228}
7229
7230impl wkt::message::Message for TruncateLogContext {
7231 fn typename() -> &'static str {
7232 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
7233 }
7234}
7235
7236#[derive(Clone, Default, PartialEq)]
7238#[non_exhaustive]
7239pub struct SqlExternalSyncSettingError {
7240 pub kind: std::string::String,
7243
7244 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7246
7247 pub detail: std::string::String,
7249
7250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7251}
7252
7253impl SqlExternalSyncSettingError {
7254 pub fn new() -> Self {
7255 std::default::Default::default()
7256 }
7257
7258 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7260 self.kind = v.into();
7261 self
7262 }
7263
7264 pub fn set_type<
7266 T: std::convert::Into<
7267 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
7268 >,
7269 >(
7270 mut self,
7271 v: T,
7272 ) -> Self {
7273 self.r#type = v.into();
7274 self
7275 }
7276
7277 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7279 self.detail = v.into();
7280 self
7281 }
7282}
7283
7284impl wkt::message::Message for SqlExternalSyncSettingError {
7285 fn typename() -> &'static str {
7286 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
7287 }
7288}
7289
7290pub mod sql_external_sync_setting_error {
7292 #[allow(unused_imports)]
7293 use super::*;
7294
7295 #[derive(Clone, Debug, PartialEq)]
7310 #[non_exhaustive]
7311 pub enum SqlExternalSyncSettingErrorType {
7312 Unspecified,
7313 ConnectionFailure,
7314 BinlogNotEnabled,
7315 IncompatibleDatabaseVersion,
7316 ReplicaAlreadySetup,
7317 InsufficientPrivilege,
7319 UnsupportedMigrationType,
7321 NoPglogicalInstalled,
7323 PglogicalNodeAlreadyExists,
7325 InvalidWalLevel,
7327 InvalidSharedPreloadLibrary,
7330 InsufficientMaxReplicationSlots,
7332 InsufficientMaxWalSenders,
7334 InsufficientMaxWorkerProcesses,
7336 UnsupportedExtensions,
7339 InvalidRdsLogicalReplication,
7341 InvalidLoggingSetup,
7343 InvalidDbParam,
7345 UnsupportedGtidMode,
7347 SqlserverAgentNotRunning,
7349 UnsupportedTableDefinition,
7352 UnsupportedDefiner,
7354 SqlserverServernameMismatch,
7356 PrimaryAlreadySetup,
7358 UnsupportedBinlogFormat,
7360 BinlogRetentionSetting,
7362 UnsupportedStorageEngine,
7364 LimitedSupportTables,
7367 ExistingDataInReplica,
7369 MissingOptionalPrivileges,
7371 RiskyBackupAdminPrivilege,
7374 InsufficientGcsPermissions,
7376 InvalidFileInfo,
7379 UnsupportedDatabaseSettings,
7381 MysqlParallelImportInsufficientPrivilege,
7384 LocalInfileOff,
7386 TurnOnPitrAfterPromote,
7389 IncompatibleDatabaseMinorVersion,
7391 SourceMaxSubscriptions,
7394 UnableToVerifyDefiners,
7396 SubscriptionCalculationStatus,
7399 PgSubscriptionCount,
7402 PgSyncParallelLevel,
7404 InsufficientDiskSize,
7407 InsufficientMachineTier,
7411 UnsupportedExtensionsNotMigrated,
7414 ExtensionsNotMigrated,
7417 PgCronFlagEnabledInReplica,
7420 ExtensionsNotEnabledInReplica,
7425 UnsupportedColumns,
7428 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
7433 }
7434
7435 #[doc(hidden)]
7436 pub mod sql_external_sync_setting_error_type {
7437 #[allow(unused_imports)]
7438 use super::*;
7439 #[derive(Clone, Debug, PartialEq)]
7440 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7441 }
7442
7443 impl SqlExternalSyncSettingErrorType {
7444 pub fn value(&self) -> std::option::Option<i32> {
7449 match self {
7450 Self::Unspecified => std::option::Option::Some(0),
7451 Self::ConnectionFailure => std::option::Option::Some(1),
7452 Self::BinlogNotEnabled => std::option::Option::Some(2),
7453 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
7454 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
7455 Self::InsufficientPrivilege => std::option::Option::Some(5),
7456 Self::UnsupportedMigrationType => std::option::Option::Some(6),
7457 Self::NoPglogicalInstalled => std::option::Option::Some(7),
7458 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
7459 Self::InvalidWalLevel => std::option::Option::Some(9),
7460 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
7461 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
7462 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
7463 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
7464 Self::UnsupportedExtensions => std::option::Option::Some(14),
7465 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
7466 Self::InvalidLoggingSetup => std::option::Option::Some(16),
7467 Self::InvalidDbParam => std::option::Option::Some(17),
7468 Self::UnsupportedGtidMode => std::option::Option::Some(18),
7469 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
7470 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
7471 Self::UnsupportedDefiner => std::option::Option::Some(21),
7472 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
7473 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
7474 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
7475 Self::BinlogRetentionSetting => std::option::Option::Some(25),
7476 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
7477 Self::LimitedSupportTables => std::option::Option::Some(27),
7478 Self::ExistingDataInReplica => std::option::Option::Some(28),
7479 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
7480 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
7481 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
7482 Self::InvalidFileInfo => std::option::Option::Some(32),
7483 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
7484 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
7485 Self::LocalInfileOff => std::option::Option::Some(35),
7486 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
7487 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
7488 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
7489 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
7490 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
7491 Self::PgSubscriptionCount => std::option::Option::Some(41),
7492 Self::PgSyncParallelLevel => std::option::Option::Some(42),
7493 Self::InsufficientDiskSize => std::option::Option::Some(43),
7494 Self::InsufficientMachineTier => std::option::Option::Some(44),
7495 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
7496 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
7497 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
7498 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
7499 Self::UnsupportedColumns => std::option::Option::Some(49),
7500 Self::UnknownValue(u) => u.0.value(),
7501 }
7502 }
7503
7504 pub fn name(&self) -> std::option::Option<&str> {
7509 match self {
7510 Self::Unspecified => {
7511 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
7512 }
7513 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
7514 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
7515 Self::IncompatibleDatabaseVersion => {
7516 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
7517 }
7518 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
7519 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
7520 Self::UnsupportedMigrationType => {
7521 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
7522 }
7523 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
7524 Self::PglogicalNodeAlreadyExists => {
7525 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
7526 }
7527 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
7528 Self::InvalidSharedPreloadLibrary => {
7529 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
7530 }
7531 Self::InsufficientMaxReplicationSlots => {
7532 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
7533 }
7534 Self::InsufficientMaxWalSenders => {
7535 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
7536 }
7537 Self::InsufficientMaxWorkerProcesses => {
7538 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
7539 }
7540 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
7541 Self::InvalidRdsLogicalReplication => {
7542 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
7543 }
7544 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
7545 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
7546 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
7547 Self::SqlserverAgentNotRunning => {
7548 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
7549 }
7550 Self::UnsupportedTableDefinition => {
7551 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
7552 }
7553 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
7554 Self::SqlserverServernameMismatch => {
7555 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
7556 }
7557 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
7558 Self::UnsupportedBinlogFormat => {
7559 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
7560 }
7561 Self::BinlogRetentionSetting => {
7562 std::option::Option::Some("BINLOG_RETENTION_SETTING")
7563 }
7564 Self::UnsupportedStorageEngine => {
7565 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
7566 }
7567 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
7568 Self::ExistingDataInReplica => {
7569 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
7570 }
7571 Self::MissingOptionalPrivileges => {
7572 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
7573 }
7574 Self::RiskyBackupAdminPrivilege => {
7575 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
7576 }
7577 Self::InsufficientGcsPermissions => {
7578 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
7579 }
7580 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
7581 Self::UnsupportedDatabaseSettings => {
7582 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
7583 }
7584 Self::MysqlParallelImportInsufficientPrivilege => {
7585 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
7586 }
7587 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
7588 Self::TurnOnPitrAfterPromote => {
7589 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
7590 }
7591 Self::IncompatibleDatabaseMinorVersion => {
7592 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
7593 }
7594 Self::SourceMaxSubscriptions => {
7595 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
7596 }
7597 Self::UnableToVerifyDefiners => {
7598 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
7599 }
7600 Self::SubscriptionCalculationStatus => {
7601 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
7602 }
7603 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
7604 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
7605 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
7606 Self::InsufficientMachineTier => {
7607 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
7608 }
7609 Self::UnsupportedExtensionsNotMigrated => {
7610 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
7611 }
7612 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
7613 Self::PgCronFlagEnabledInReplica => {
7614 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
7615 }
7616 Self::ExtensionsNotEnabledInReplica => {
7617 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
7618 }
7619 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
7620 Self::UnknownValue(u) => u.0.name(),
7621 }
7622 }
7623 }
7624
7625 impl std::default::Default for SqlExternalSyncSettingErrorType {
7626 fn default() -> Self {
7627 use std::convert::From;
7628 Self::from(0)
7629 }
7630 }
7631
7632 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
7633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7634 wkt::internal::display_enum(f, self.name(), self.value())
7635 }
7636 }
7637
7638 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
7639 fn from(value: i32) -> Self {
7640 match value {
7641 0 => Self::Unspecified,
7642 1 => Self::ConnectionFailure,
7643 2 => Self::BinlogNotEnabled,
7644 3 => Self::IncompatibleDatabaseVersion,
7645 4 => Self::ReplicaAlreadySetup,
7646 5 => Self::InsufficientPrivilege,
7647 6 => Self::UnsupportedMigrationType,
7648 7 => Self::NoPglogicalInstalled,
7649 8 => Self::PglogicalNodeAlreadyExists,
7650 9 => Self::InvalidWalLevel,
7651 10 => Self::InvalidSharedPreloadLibrary,
7652 11 => Self::InsufficientMaxReplicationSlots,
7653 12 => Self::InsufficientMaxWalSenders,
7654 13 => Self::InsufficientMaxWorkerProcesses,
7655 14 => Self::UnsupportedExtensions,
7656 15 => Self::InvalidRdsLogicalReplication,
7657 16 => Self::InvalidLoggingSetup,
7658 17 => Self::InvalidDbParam,
7659 18 => Self::UnsupportedGtidMode,
7660 19 => Self::SqlserverAgentNotRunning,
7661 20 => Self::UnsupportedTableDefinition,
7662 21 => Self::UnsupportedDefiner,
7663 22 => Self::SqlserverServernameMismatch,
7664 23 => Self::PrimaryAlreadySetup,
7665 24 => Self::UnsupportedBinlogFormat,
7666 25 => Self::BinlogRetentionSetting,
7667 26 => Self::UnsupportedStorageEngine,
7668 27 => Self::LimitedSupportTables,
7669 28 => Self::ExistingDataInReplica,
7670 29 => Self::MissingOptionalPrivileges,
7671 30 => Self::RiskyBackupAdminPrivilege,
7672 31 => Self::InsufficientGcsPermissions,
7673 32 => Self::InvalidFileInfo,
7674 33 => Self::UnsupportedDatabaseSettings,
7675 34 => Self::MysqlParallelImportInsufficientPrivilege,
7676 35 => Self::LocalInfileOff,
7677 36 => Self::TurnOnPitrAfterPromote,
7678 37 => Self::IncompatibleDatabaseMinorVersion,
7679 38 => Self::SourceMaxSubscriptions,
7680 39 => Self::UnableToVerifyDefiners,
7681 40 => Self::SubscriptionCalculationStatus,
7682 41 => Self::PgSubscriptionCount,
7683 42 => Self::PgSyncParallelLevel,
7684 43 => Self::InsufficientDiskSize,
7685 44 => Self::InsufficientMachineTier,
7686 45 => Self::UnsupportedExtensionsNotMigrated,
7687 46 => Self::ExtensionsNotMigrated,
7688 47 => Self::PgCronFlagEnabledInReplica,
7689 48 => Self::ExtensionsNotEnabledInReplica,
7690 49 => Self::UnsupportedColumns,
7691 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7692 wkt::internal::UnknownEnumValue::Integer(value),
7693 )),
7694 }
7695 }
7696 }
7697
7698 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
7699 fn from(value: &str) -> Self {
7700 use std::string::ToString;
7701 match value {
7702 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
7703 "CONNECTION_FAILURE" => Self::ConnectionFailure,
7704 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
7705 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
7706 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
7707 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
7708 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
7709 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
7710 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
7711 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
7712 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
7713 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
7714 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
7715 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
7716 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
7717 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
7718 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
7719 "INVALID_DB_PARAM" => Self::InvalidDbParam,
7720 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
7721 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
7722 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
7723 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
7724 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
7725 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
7726 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
7727 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
7728 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
7729 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
7730 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
7731 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
7732 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
7733 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
7734 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
7735 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
7736 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
7737 Self::MysqlParallelImportInsufficientPrivilege
7738 }
7739 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
7740 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
7741 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
7742 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
7743 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
7744 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
7745 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
7746 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
7747 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
7748 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
7749 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
7750 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
7751 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
7752 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
7753 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
7754 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
7755 wkt::internal::UnknownEnumValue::String(value.to_string()),
7756 )),
7757 }
7758 }
7759 }
7760
7761 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
7762 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7763 where
7764 S: serde::Serializer,
7765 {
7766 match self {
7767 Self::Unspecified => serializer.serialize_i32(0),
7768 Self::ConnectionFailure => serializer.serialize_i32(1),
7769 Self::BinlogNotEnabled => serializer.serialize_i32(2),
7770 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
7771 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
7772 Self::InsufficientPrivilege => serializer.serialize_i32(5),
7773 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
7774 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
7775 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
7776 Self::InvalidWalLevel => serializer.serialize_i32(9),
7777 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
7778 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
7779 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
7780 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
7781 Self::UnsupportedExtensions => serializer.serialize_i32(14),
7782 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
7783 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
7784 Self::InvalidDbParam => serializer.serialize_i32(17),
7785 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
7786 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
7787 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
7788 Self::UnsupportedDefiner => serializer.serialize_i32(21),
7789 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
7790 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
7791 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
7792 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
7793 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
7794 Self::LimitedSupportTables => serializer.serialize_i32(27),
7795 Self::ExistingDataInReplica => serializer.serialize_i32(28),
7796 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
7797 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
7798 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
7799 Self::InvalidFileInfo => serializer.serialize_i32(32),
7800 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
7801 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
7802 Self::LocalInfileOff => serializer.serialize_i32(35),
7803 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
7804 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
7805 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
7806 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
7807 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
7808 Self::PgSubscriptionCount => serializer.serialize_i32(41),
7809 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
7810 Self::InsufficientDiskSize => serializer.serialize_i32(43),
7811 Self::InsufficientMachineTier => serializer.serialize_i32(44),
7812 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
7813 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
7814 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
7815 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
7816 Self::UnsupportedColumns => serializer.serialize_i32(49),
7817 Self::UnknownValue(u) => u.0.serialize(serializer),
7818 }
7819 }
7820 }
7821
7822 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
7823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7824 where
7825 D: serde::Deserializer<'de>,
7826 {
7827 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
7828 SqlExternalSyncSettingErrorType,
7829 >::new(
7830 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
7831 ))
7832 }
7833 }
7834}
7835
7836#[derive(Clone, Default, PartialEq)]
7838#[non_exhaustive]
7839pub struct OnPremisesConfiguration {
7840 pub host_port: std::string::String,
7842
7843 pub kind: std::string::String,
7845
7846 pub username: std::string::String,
7848
7849 pub password: std::string::String,
7851
7852 pub ca_certificate: std::string::String,
7854
7855 pub client_certificate: std::string::String,
7857
7858 pub client_key: std::string::String,
7861
7862 pub dump_file_path: std::string::String,
7864
7865 pub source_instance: std::option::Option<crate::model::InstanceReference>,
7867
7868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7869}
7870
7871impl OnPremisesConfiguration {
7872 pub fn new() -> Self {
7873 std::default::Default::default()
7874 }
7875
7876 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7878 self.host_port = v.into();
7879 self
7880 }
7881
7882 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7884 self.kind = v.into();
7885 self
7886 }
7887
7888 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7890 self.username = v.into();
7891 self
7892 }
7893
7894 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7896 self.password = v.into();
7897 self
7898 }
7899
7900 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7902 self.ca_certificate = v.into();
7903 self
7904 }
7905
7906 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7908 mut self,
7909 v: T,
7910 ) -> Self {
7911 self.client_certificate = v.into();
7912 self
7913 }
7914
7915 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7917 self.client_key = v.into();
7918 self
7919 }
7920
7921 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7923 self.dump_file_path = v.into();
7924 self
7925 }
7926
7927 pub fn set_source_instance<T>(mut self, v: T) -> Self
7929 where
7930 T: std::convert::Into<crate::model::InstanceReference>,
7931 {
7932 self.source_instance = std::option::Option::Some(v.into());
7933 self
7934 }
7935
7936 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
7938 where
7939 T: std::convert::Into<crate::model::InstanceReference>,
7940 {
7941 self.source_instance = v.map(|x| x.into());
7942 self
7943 }
7944}
7945
7946impl wkt::message::Message for OnPremisesConfiguration {
7947 fn typename() -> &'static str {
7948 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
7949 }
7950}
7951
7952#[derive(Clone, Default, PartialEq)]
7954#[non_exhaustive]
7955pub struct ReplicaConfiguration {
7956 pub kind: std::string::String,
7958
7959 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
7966
7967 pub failover_target: std::option::Option<wkt::BoolValue>,
7973
7974 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
7978
7979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7980}
7981
7982impl ReplicaConfiguration {
7983 pub fn new() -> Self {
7984 std::default::Default::default()
7985 }
7986
7987 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7989 self.kind = v.into();
7990 self
7991 }
7992
7993 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
7995 where
7996 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
7997 {
7998 self.mysql_replica_configuration = std::option::Option::Some(v.into());
7999 self
8000 }
8001
8002 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
8004 where
8005 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
8006 {
8007 self.mysql_replica_configuration = v.map(|x| x.into());
8008 self
8009 }
8010
8011 pub fn set_failover_target<T>(mut self, v: T) -> Self
8013 where
8014 T: std::convert::Into<wkt::BoolValue>,
8015 {
8016 self.failover_target = std::option::Option::Some(v.into());
8017 self
8018 }
8019
8020 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
8022 where
8023 T: std::convert::Into<wkt::BoolValue>,
8024 {
8025 self.failover_target = v.map(|x| x.into());
8026 self
8027 }
8028
8029 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
8031 where
8032 T: std::convert::Into<wkt::BoolValue>,
8033 {
8034 self.cascadable_replica = std::option::Option::Some(v.into());
8035 self
8036 }
8037
8038 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
8040 where
8041 T: std::convert::Into<wkt::BoolValue>,
8042 {
8043 self.cascadable_replica = v.map(|x| x.into());
8044 self
8045 }
8046}
8047
8048impl wkt::message::Message for ReplicaConfiguration {
8049 fn typename() -> &'static str {
8050 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
8051 }
8052}
8053
8054#[derive(Clone, Default, PartialEq)]
8056#[non_exhaustive]
8057pub struct SqlInstancesAcquireSsrsLeaseRequest {
8058 pub instance: std::string::String,
8063
8064 pub project: std::string::String,
8067
8068 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
8070
8071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8072}
8073
8074impl SqlInstancesAcquireSsrsLeaseRequest {
8075 pub fn new() -> Self {
8076 std::default::Default::default()
8077 }
8078
8079 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8081 self.instance = v.into();
8082 self
8083 }
8084
8085 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8087 self.project = v.into();
8088 self
8089 }
8090
8091 pub fn set_body<T>(mut self, v: T) -> Self
8093 where
8094 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
8095 {
8096 self.body = std::option::Option::Some(v.into());
8097 self
8098 }
8099
8100 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8102 where
8103 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
8104 {
8105 self.body = v.map(|x| x.into());
8106 self
8107 }
8108}
8109
8110impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
8111 fn typename() -> &'static str {
8112 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
8113 }
8114}
8115
8116#[derive(Clone, Default, PartialEq)]
8118#[non_exhaustive]
8119pub struct SqlInstancesAcquireSsrsLeaseResponse {
8120 pub operation_id: std::string::String,
8122
8123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8124}
8125
8126impl SqlInstancesAcquireSsrsLeaseResponse {
8127 pub fn new() -> Self {
8128 std::default::Default::default()
8129 }
8130
8131 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8133 self.operation_id = v.into();
8134 self
8135 }
8136}
8137
8138impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
8139 fn typename() -> &'static str {
8140 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
8141 }
8142}
8143
8144#[derive(Clone, Default, PartialEq)]
8146#[non_exhaustive]
8147pub struct SqlInstancesReleaseSsrsLeaseRequest {
8148 pub instance: std::string::String,
8153
8154 pub project: std::string::String,
8156
8157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8158}
8159
8160impl SqlInstancesReleaseSsrsLeaseRequest {
8161 pub fn new() -> Self {
8162 std::default::Default::default()
8163 }
8164
8165 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8167 self.instance = v.into();
8168 self
8169 }
8170
8171 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8173 self.project = v.into();
8174 self
8175 }
8176}
8177
8178impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
8179 fn typename() -> &'static str {
8180 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
8181 }
8182}
8183
8184#[derive(Clone, Default, PartialEq)]
8186#[non_exhaustive]
8187pub struct SqlInstancesReleaseSsrsLeaseResponse {
8188 pub operation_id: std::string::String,
8190
8191 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8192}
8193
8194impl SqlInstancesReleaseSsrsLeaseResponse {
8195 pub fn new() -> Self {
8196 std::default::Default::default()
8197 }
8198
8199 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8201 self.operation_id = v.into();
8202 self
8203 }
8204}
8205
8206impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
8207 fn typename() -> &'static str {
8208 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
8209 }
8210}
8211
8212#[derive(Clone, Default, PartialEq)]
8214#[non_exhaustive]
8215pub struct SqlOperationsGetRequest {
8216 pub operation: std::string::String,
8218
8219 pub project: std::string::String,
8221
8222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8223}
8224
8225impl SqlOperationsGetRequest {
8226 pub fn new() -> Self {
8227 std::default::Default::default()
8228 }
8229
8230 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8232 self.operation = v.into();
8233 self
8234 }
8235
8236 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8238 self.project = v.into();
8239 self
8240 }
8241}
8242
8243impl wkt::message::Message for SqlOperationsGetRequest {
8244 fn typename() -> &'static str {
8245 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
8246 }
8247}
8248
8249#[derive(Clone, Default, PartialEq)]
8251#[non_exhaustive]
8252pub struct SqlOperationsListRequest {
8253 pub instance: std::string::String,
8255
8256 pub max_results: u32,
8258
8259 pub page_token: std::string::String,
8262
8263 pub project: std::string::String,
8265
8266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8267}
8268
8269impl SqlOperationsListRequest {
8270 pub fn new() -> Self {
8271 std::default::Default::default()
8272 }
8273
8274 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8276 self.instance = v.into();
8277 self
8278 }
8279
8280 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
8282 self.max_results = v.into();
8283 self
8284 }
8285
8286 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8288 self.page_token = v.into();
8289 self
8290 }
8291
8292 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8294 self.project = v.into();
8295 self
8296 }
8297}
8298
8299impl wkt::message::Message for SqlOperationsListRequest {
8300 fn typename() -> &'static str {
8301 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
8302 }
8303}
8304
8305#[derive(Clone, Default, PartialEq)]
8307#[non_exhaustive]
8308pub struct OperationsListResponse {
8309 pub kind: std::string::String,
8311
8312 pub items: std::vec::Vec<crate::model::Operation>,
8314
8315 pub next_page_token: std::string::String,
8318
8319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8320}
8321
8322impl OperationsListResponse {
8323 pub fn new() -> Self {
8324 std::default::Default::default()
8325 }
8326
8327 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8329 self.kind = v.into();
8330 self
8331 }
8332
8333 pub fn set_items<T, V>(mut self, v: T) -> Self
8335 where
8336 T: std::iter::IntoIterator<Item = V>,
8337 V: std::convert::Into<crate::model::Operation>,
8338 {
8339 use std::iter::Iterator;
8340 self.items = v.into_iter().map(|i| i.into()).collect();
8341 self
8342 }
8343
8344 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8346 self.next_page_token = v.into();
8347 self
8348 }
8349}
8350
8351impl wkt::message::Message for OperationsListResponse {
8352 fn typename() -> &'static str {
8353 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
8354 }
8355}
8356
8357#[doc(hidden)]
8358impl gax::paginator::internal::PageableResponse for OperationsListResponse {
8359 type PageItem = crate::model::Operation;
8360
8361 fn items(self) -> std::vec::Vec<Self::PageItem> {
8362 self.items
8363 }
8364
8365 fn next_page_token(&self) -> std::string::String {
8366 use std::clone::Clone;
8367 self.next_page_token.clone()
8368 }
8369}
8370
8371#[derive(Clone, Default, PartialEq)]
8373#[non_exhaustive]
8374pub struct SqlOperationsCancelRequest {
8375 pub operation: std::string::String,
8377
8378 pub project: std::string::String,
8380
8381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl SqlOperationsCancelRequest {
8385 pub fn new() -> Self {
8386 std::default::Default::default()
8387 }
8388
8389 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8391 self.operation = v.into();
8392 self
8393 }
8394
8395 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8397 self.project = v.into();
8398 self
8399 }
8400}
8401
8402impl wkt::message::Message for SqlOperationsCancelRequest {
8403 fn typename() -> &'static str {
8404 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
8405 }
8406}
8407
8408#[derive(Clone, Default, PartialEq)]
8410#[non_exhaustive]
8411pub struct AclEntry {
8412 pub value: std::string::String,
8414
8415 pub expiration_time: std::option::Option<wkt::Timestamp>,
8419
8420 pub name: std::string::String,
8422
8423 pub kind: std::string::String,
8425
8426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8427}
8428
8429impl AclEntry {
8430 pub fn new() -> Self {
8431 std::default::Default::default()
8432 }
8433
8434 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8436 self.value = v.into();
8437 self
8438 }
8439
8440 pub fn set_expiration_time<T>(mut self, v: T) -> Self
8442 where
8443 T: std::convert::Into<wkt::Timestamp>,
8444 {
8445 self.expiration_time = std::option::Option::Some(v.into());
8446 self
8447 }
8448
8449 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
8451 where
8452 T: std::convert::Into<wkt::Timestamp>,
8453 {
8454 self.expiration_time = v.map(|x| x.into());
8455 self
8456 }
8457
8458 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8460 self.name = v.into();
8461 self
8462 }
8463
8464 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8466 self.kind = v.into();
8467 self
8468 }
8469}
8470
8471impl wkt::message::Message for AclEntry {
8472 fn typename() -> &'static str {
8473 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
8474 }
8475}
8476
8477#[derive(Clone, Default, PartialEq)]
8479#[non_exhaustive]
8480pub struct ApiWarning {
8481 pub code: crate::model::api_warning::SqlApiWarningCode,
8483
8484 pub message: std::string::String,
8486
8487 pub region: std::string::String,
8489
8490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8491}
8492
8493impl ApiWarning {
8494 pub fn new() -> Self {
8495 std::default::Default::default()
8496 }
8497
8498 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
8500 mut self,
8501 v: T,
8502 ) -> Self {
8503 self.code = v.into();
8504 self
8505 }
8506
8507 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8509 self.message = v.into();
8510 self
8511 }
8512
8513 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8515 self.region = v.into();
8516 self
8517 }
8518}
8519
8520impl wkt::message::Message for ApiWarning {
8521 fn typename() -> &'static str {
8522 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
8523 }
8524}
8525
8526pub mod api_warning {
8528 #[allow(unused_imports)]
8529 use super::*;
8530
8531 #[derive(Clone, Debug, PartialEq)]
8546 #[non_exhaustive]
8547 pub enum SqlApiWarningCode {
8548 Unspecified,
8550 RegionUnreachable,
8553 MaxResultsExceedsLimit,
8556 CompromisedCredentials,
8559 InternalStateFailure,
8562 UnknownValue(sql_api_warning_code::UnknownValue),
8567 }
8568
8569 #[doc(hidden)]
8570 pub mod sql_api_warning_code {
8571 #[allow(unused_imports)]
8572 use super::*;
8573 #[derive(Clone, Debug, PartialEq)]
8574 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8575 }
8576
8577 impl SqlApiWarningCode {
8578 pub fn value(&self) -> std::option::Option<i32> {
8583 match self {
8584 Self::Unspecified => std::option::Option::Some(0),
8585 Self::RegionUnreachable => std::option::Option::Some(1),
8586 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
8587 Self::CompromisedCredentials => std::option::Option::Some(3),
8588 Self::InternalStateFailure => std::option::Option::Some(4),
8589 Self::UnknownValue(u) => u.0.value(),
8590 }
8591 }
8592
8593 pub fn name(&self) -> std::option::Option<&str> {
8598 match self {
8599 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
8600 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
8601 Self::MaxResultsExceedsLimit => {
8602 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
8603 }
8604 Self::CompromisedCredentials => {
8605 std::option::Option::Some("COMPROMISED_CREDENTIALS")
8606 }
8607 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
8608 Self::UnknownValue(u) => u.0.name(),
8609 }
8610 }
8611 }
8612
8613 impl std::default::Default for SqlApiWarningCode {
8614 fn default() -> Self {
8615 use std::convert::From;
8616 Self::from(0)
8617 }
8618 }
8619
8620 impl std::fmt::Display for SqlApiWarningCode {
8621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8622 wkt::internal::display_enum(f, self.name(), self.value())
8623 }
8624 }
8625
8626 impl std::convert::From<i32> for SqlApiWarningCode {
8627 fn from(value: i32) -> Self {
8628 match value {
8629 0 => Self::Unspecified,
8630 1 => Self::RegionUnreachable,
8631 2 => Self::MaxResultsExceedsLimit,
8632 3 => Self::CompromisedCredentials,
8633 4 => Self::InternalStateFailure,
8634 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8635 wkt::internal::UnknownEnumValue::Integer(value),
8636 )),
8637 }
8638 }
8639 }
8640
8641 impl std::convert::From<&str> for SqlApiWarningCode {
8642 fn from(value: &str) -> Self {
8643 use std::string::ToString;
8644 match value {
8645 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
8646 "REGION_UNREACHABLE" => Self::RegionUnreachable,
8647 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
8648 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
8649 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
8650 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
8651 wkt::internal::UnknownEnumValue::String(value.to_string()),
8652 )),
8653 }
8654 }
8655 }
8656
8657 impl serde::ser::Serialize for SqlApiWarningCode {
8658 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8659 where
8660 S: serde::Serializer,
8661 {
8662 match self {
8663 Self::Unspecified => serializer.serialize_i32(0),
8664 Self::RegionUnreachable => serializer.serialize_i32(1),
8665 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
8666 Self::CompromisedCredentials => serializer.serialize_i32(3),
8667 Self::InternalStateFailure => serializer.serialize_i32(4),
8668 Self::UnknownValue(u) => u.0.serialize(serializer),
8669 }
8670 }
8671 }
8672
8673 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
8674 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8675 where
8676 D: serde::Deserializer<'de>,
8677 {
8678 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
8679 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
8680 ))
8681 }
8682 }
8683}
8684
8685#[derive(Clone, Default, PartialEq)]
8688#[non_exhaustive]
8689pub struct BackupRetentionSettings {
8690 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
8692
8693 pub retained_backups: std::option::Option<wkt::Int32Value>,
8697
8698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8699}
8700
8701impl BackupRetentionSettings {
8702 pub fn new() -> Self {
8703 std::default::Default::default()
8704 }
8705
8706 pub fn set_retention_unit<
8708 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
8709 >(
8710 mut self,
8711 v: T,
8712 ) -> Self {
8713 self.retention_unit = v.into();
8714 self
8715 }
8716
8717 pub fn set_retained_backups<T>(mut self, v: T) -> Self
8719 where
8720 T: std::convert::Into<wkt::Int32Value>,
8721 {
8722 self.retained_backups = std::option::Option::Some(v.into());
8723 self
8724 }
8725
8726 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
8728 where
8729 T: std::convert::Into<wkt::Int32Value>,
8730 {
8731 self.retained_backups = v.map(|x| x.into());
8732 self
8733 }
8734}
8735
8736impl wkt::message::Message for BackupRetentionSettings {
8737 fn typename() -> &'static str {
8738 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
8739 }
8740}
8741
8742pub mod backup_retention_settings {
8744 #[allow(unused_imports)]
8745 use super::*;
8746
8747 #[derive(Clone, Debug, PartialEq)]
8763 #[non_exhaustive]
8764 pub enum RetentionUnit {
8765 Unspecified,
8767 Count,
8769 UnknownValue(retention_unit::UnknownValue),
8774 }
8775
8776 #[doc(hidden)]
8777 pub mod retention_unit {
8778 #[allow(unused_imports)]
8779 use super::*;
8780 #[derive(Clone, Debug, PartialEq)]
8781 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8782 }
8783
8784 impl RetentionUnit {
8785 pub fn value(&self) -> std::option::Option<i32> {
8790 match self {
8791 Self::Unspecified => std::option::Option::Some(0),
8792 Self::Count => std::option::Option::Some(1),
8793 Self::UnknownValue(u) => u.0.value(),
8794 }
8795 }
8796
8797 pub fn name(&self) -> std::option::Option<&str> {
8802 match self {
8803 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
8804 Self::Count => std::option::Option::Some("COUNT"),
8805 Self::UnknownValue(u) => u.0.name(),
8806 }
8807 }
8808 }
8809
8810 impl std::default::Default for RetentionUnit {
8811 fn default() -> Self {
8812 use std::convert::From;
8813 Self::from(0)
8814 }
8815 }
8816
8817 impl std::fmt::Display for RetentionUnit {
8818 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8819 wkt::internal::display_enum(f, self.name(), self.value())
8820 }
8821 }
8822
8823 impl std::convert::From<i32> for RetentionUnit {
8824 fn from(value: i32) -> Self {
8825 match value {
8826 0 => Self::Unspecified,
8827 1 => Self::Count,
8828 _ => Self::UnknownValue(retention_unit::UnknownValue(
8829 wkt::internal::UnknownEnumValue::Integer(value),
8830 )),
8831 }
8832 }
8833 }
8834
8835 impl std::convert::From<&str> for RetentionUnit {
8836 fn from(value: &str) -> Self {
8837 use std::string::ToString;
8838 match value {
8839 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
8840 "COUNT" => Self::Count,
8841 _ => Self::UnknownValue(retention_unit::UnknownValue(
8842 wkt::internal::UnknownEnumValue::String(value.to_string()),
8843 )),
8844 }
8845 }
8846 }
8847
8848 impl serde::ser::Serialize for RetentionUnit {
8849 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8850 where
8851 S: serde::Serializer,
8852 {
8853 match self {
8854 Self::Unspecified => serializer.serialize_i32(0),
8855 Self::Count => serializer.serialize_i32(1),
8856 Self::UnknownValue(u) => u.0.serialize(serializer),
8857 }
8858 }
8859 }
8860
8861 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
8862 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8863 where
8864 D: serde::Deserializer<'de>,
8865 {
8866 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
8867 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
8868 ))
8869 }
8870 }
8871}
8872
8873#[derive(Clone, Default, PartialEq)]
8875#[non_exhaustive]
8876pub struct BackupConfiguration {
8877 pub start_time: std::string::String,
8880
8881 pub enabled: std::option::Option<wkt::BoolValue>,
8883
8884 pub kind: std::string::String,
8886
8887 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
8890
8891 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
8893
8894 pub location: std::string::String,
8896
8897 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
8899
8900 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
8902
8903 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
8906
8907 pub transactional_log_storage_state:
8910 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
8911
8912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8913}
8914
8915impl BackupConfiguration {
8916 pub fn new() -> Self {
8917 std::default::Default::default()
8918 }
8919
8920 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8922 self.start_time = v.into();
8923 self
8924 }
8925
8926 pub fn set_enabled<T>(mut self, v: T) -> Self
8928 where
8929 T: std::convert::Into<wkt::BoolValue>,
8930 {
8931 self.enabled = std::option::Option::Some(v.into());
8932 self
8933 }
8934
8935 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8937 where
8938 T: std::convert::Into<wkt::BoolValue>,
8939 {
8940 self.enabled = v.map(|x| x.into());
8941 self
8942 }
8943
8944 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8946 self.kind = v.into();
8947 self
8948 }
8949
8950 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
8952 where
8953 T: std::convert::Into<wkt::BoolValue>,
8954 {
8955 self.binary_log_enabled = std::option::Option::Some(v.into());
8956 self
8957 }
8958
8959 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8961 where
8962 T: std::convert::Into<wkt::BoolValue>,
8963 {
8964 self.binary_log_enabled = v.map(|x| x.into());
8965 self
8966 }
8967
8968 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
8970 where
8971 T: std::convert::Into<wkt::BoolValue>,
8972 {
8973 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
8974 self
8975 }
8976
8977 pub fn set_or_clear_replication_log_archiving_enabled<T>(
8979 mut self,
8980 v: std::option::Option<T>,
8981 ) -> Self
8982 where
8983 T: std::convert::Into<wkt::BoolValue>,
8984 {
8985 self.replication_log_archiving_enabled = v.map(|x| x.into());
8986 self
8987 }
8988
8989 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8991 self.location = v.into();
8992 self
8993 }
8994
8995 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
8997 where
8998 T: std::convert::Into<wkt::BoolValue>,
8999 {
9000 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
9001 self
9002 }
9003
9004 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
9006 mut self,
9007 v: std::option::Option<T>,
9008 ) -> Self
9009 where
9010 T: std::convert::Into<wkt::BoolValue>,
9011 {
9012 self.point_in_time_recovery_enabled = v.map(|x| x.into());
9013 self
9014 }
9015
9016 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
9018 where
9019 T: std::convert::Into<crate::model::BackupRetentionSettings>,
9020 {
9021 self.backup_retention_settings = std::option::Option::Some(v.into());
9022 self
9023 }
9024
9025 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
9027 where
9028 T: std::convert::Into<crate::model::BackupRetentionSettings>,
9029 {
9030 self.backup_retention_settings = v.map(|x| x.into());
9031 self
9032 }
9033
9034 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
9036 where
9037 T: std::convert::Into<wkt::Int32Value>,
9038 {
9039 self.transaction_log_retention_days = std::option::Option::Some(v.into());
9040 self
9041 }
9042
9043 pub fn set_or_clear_transaction_log_retention_days<T>(
9045 mut self,
9046 v: std::option::Option<T>,
9047 ) -> Self
9048 where
9049 T: std::convert::Into<wkt::Int32Value>,
9050 {
9051 self.transaction_log_retention_days = v.map(|x| x.into());
9052 self
9053 }
9054
9055 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
9057 where
9058 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
9059 {
9060 self.transactional_log_storage_state = std::option::Option::Some(v.into());
9061 self
9062 }
9063
9064 pub fn set_or_clear_transactional_log_storage_state<T>(
9066 mut self,
9067 v: std::option::Option<T>,
9068 ) -> Self
9069 where
9070 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
9071 {
9072 self.transactional_log_storage_state = v.map(|x| x.into());
9073 self
9074 }
9075}
9076
9077impl wkt::message::Message for BackupConfiguration {
9078 fn typename() -> &'static str {
9079 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
9080 }
9081}
9082
9083pub mod backup_configuration {
9085 #[allow(unused_imports)]
9086 use super::*;
9087
9088 #[derive(Clone, Debug, PartialEq)]
9105 #[non_exhaustive]
9106 pub enum TransactionalLogStorageState {
9107 Unspecified,
9109 Disk,
9112 SwitchingToCloudStorage,
9116 SwitchedToCloudStorage,
9120 CloudStorage,
9123 UnknownValue(transactional_log_storage_state::UnknownValue),
9128 }
9129
9130 #[doc(hidden)]
9131 pub mod transactional_log_storage_state {
9132 #[allow(unused_imports)]
9133 use super::*;
9134 #[derive(Clone, Debug, PartialEq)]
9135 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9136 }
9137
9138 impl TransactionalLogStorageState {
9139 pub fn value(&self) -> std::option::Option<i32> {
9144 match self {
9145 Self::Unspecified => std::option::Option::Some(0),
9146 Self::Disk => std::option::Option::Some(1),
9147 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
9148 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
9149 Self::CloudStorage => std::option::Option::Some(4),
9150 Self::UnknownValue(u) => u.0.value(),
9151 }
9152 }
9153
9154 pub fn name(&self) -> std::option::Option<&str> {
9159 match self {
9160 Self::Unspecified => {
9161 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
9162 }
9163 Self::Disk => std::option::Option::Some("DISK"),
9164 Self::SwitchingToCloudStorage => {
9165 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
9166 }
9167 Self::SwitchedToCloudStorage => {
9168 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
9169 }
9170 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
9171 Self::UnknownValue(u) => u.0.name(),
9172 }
9173 }
9174 }
9175
9176 impl std::default::Default for TransactionalLogStorageState {
9177 fn default() -> Self {
9178 use std::convert::From;
9179 Self::from(0)
9180 }
9181 }
9182
9183 impl std::fmt::Display for TransactionalLogStorageState {
9184 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9185 wkt::internal::display_enum(f, self.name(), self.value())
9186 }
9187 }
9188
9189 impl std::convert::From<i32> for TransactionalLogStorageState {
9190 fn from(value: i32) -> Self {
9191 match value {
9192 0 => Self::Unspecified,
9193 1 => Self::Disk,
9194 2 => Self::SwitchingToCloudStorage,
9195 3 => Self::SwitchedToCloudStorage,
9196 4 => Self::CloudStorage,
9197 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
9198 wkt::internal::UnknownEnumValue::Integer(value),
9199 )),
9200 }
9201 }
9202 }
9203
9204 impl std::convert::From<&str> for TransactionalLogStorageState {
9205 fn from(value: &str) -> Self {
9206 use std::string::ToString;
9207 match value {
9208 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
9209 "DISK" => Self::Disk,
9210 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
9211 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
9212 "CLOUD_STORAGE" => Self::CloudStorage,
9213 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
9214 wkt::internal::UnknownEnumValue::String(value.to_string()),
9215 )),
9216 }
9217 }
9218 }
9219
9220 impl serde::ser::Serialize for TransactionalLogStorageState {
9221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9222 where
9223 S: serde::Serializer,
9224 {
9225 match self {
9226 Self::Unspecified => serializer.serialize_i32(0),
9227 Self::Disk => serializer.serialize_i32(1),
9228 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
9229 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
9230 Self::CloudStorage => serializer.serialize_i32(4),
9231 Self::UnknownValue(u) => u.0.serialize(serializer),
9232 }
9233 }
9234 }
9235
9236 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
9237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9238 where
9239 D: serde::Deserializer<'de>,
9240 {
9241 deserializer.deserialize_any(
9242 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
9243 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
9244 ),
9245 )
9246 }
9247 }
9248}
9249
9250#[derive(Clone, Default, PartialEq)]
9252#[non_exhaustive]
9253pub struct PerformDiskShrinkContext {
9254 pub target_size_gb: i64,
9256
9257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9258}
9259
9260impl PerformDiskShrinkContext {
9261 pub fn new() -> Self {
9262 std::default::Default::default()
9263 }
9264
9265 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9267 self.target_size_gb = v.into();
9268 self
9269 }
9270}
9271
9272impl wkt::message::Message for PerformDiskShrinkContext {
9273 fn typename() -> &'static str {
9274 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
9275 }
9276}
9277
9278#[derive(Clone, Default, PartialEq)]
9280#[non_exhaustive]
9281pub struct BackupContext {
9282 pub backup_id: i64,
9284
9285 pub kind: std::string::String,
9287
9288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9289}
9290
9291impl BackupContext {
9292 pub fn new() -> Self {
9293 std::default::Default::default()
9294 }
9295
9296 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9298 self.backup_id = v.into();
9299 self
9300 }
9301
9302 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9304 self.kind = v.into();
9305 self
9306 }
9307}
9308
9309impl wkt::message::Message for BackupContext {
9310 fn typename() -> &'static str {
9311 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
9312 }
9313}
9314
9315#[derive(Clone, Default, PartialEq)]
9317#[non_exhaustive]
9318pub struct Database {
9319 pub kind: std::string::String,
9321
9322 pub charset: std::string::String,
9324
9325 pub collation: std::string::String,
9327
9328 pub etag: std::string::String,
9331
9332 pub name: std::string::String,
9335
9336 pub instance: std::string::String,
9338
9339 pub self_link: std::string::String,
9341
9342 pub project: std::string::String,
9345
9346 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
9347
9348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9349}
9350
9351impl Database {
9352 pub fn new() -> Self {
9353 std::default::Default::default()
9354 }
9355
9356 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9358 self.kind = v.into();
9359 self
9360 }
9361
9362 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9364 self.charset = v.into();
9365 self
9366 }
9367
9368 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9370 self.collation = v.into();
9371 self
9372 }
9373
9374 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9376 self.etag = v.into();
9377 self
9378 }
9379
9380 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9382 self.name = v.into();
9383 self
9384 }
9385
9386 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9388 self.instance = v.into();
9389 self
9390 }
9391
9392 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9394 self.self_link = v.into();
9395 self
9396 }
9397
9398 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9400 self.project = v.into();
9401 self
9402 }
9403
9404 pub fn set_database_details<
9409 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
9410 >(
9411 mut self,
9412 v: T,
9413 ) -> Self {
9414 self.database_details = v.into();
9415 self
9416 }
9417
9418 pub fn sqlserver_database_details(
9422 &self,
9423 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
9424 #[allow(unreachable_patterns)]
9425 self.database_details.as_ref().and_then(|v| match v {
9426 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
9427 std::option::Option::Some(v)
9428 }
9429 _ => std::option::Option::None,
9430 })
9431 }
9432
9433 pub fn set_sqlserver_database_details<
9439 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
9440 >(
9441 mut self,
9442 v: T,
9443 ) -> Self {
9444 self.database_details = std::option::Option::Some(
9445 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
9446 );
9447 self
9448 }
9449}
9450
9451impl wkt::message::Message for Database {
9452 fn typename() -> &'static str {
9453 "type.googleapis.com/google.cloud.sql.v1.Database"
9454 }
9455}
9456
9457pub mod database {
9459 #[allow(unused_imports)]
9460 use super::*;
9461
9462 #[derive(Clone, Debug, PartialEq)]
9463 #[non_exhaustive]
9464 pub enum DatabaseDetails {
9465 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
9466 }
9467}
9468
9469#[derive(Clone, Default, PartialEq)]
9471#[non_exhaustive]
9472pub struct SqlServerDatabaseDetails {
9473 pub compatibility_level: i32,
9475
9476 pub recovery_model: std::string::String,
9478
9479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9480}
9481
9482impl SqlServerDatabaseDetails {
9483 pub fn new() -> Self {
9484 std::default::Default::default()
9485 }
9486
9487 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9489 self.compatibility_level = v.into();
9490 self
9491 }
9492
9493 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9495 self.recovery_model = v.into();
9496 self
9497 }
9498}
9499
9500impl wkt::message::Message for SqlServerDatabaseDetails {
9501 fn typename() -> &'static str {
9502 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
9503 }
9504}
9505
9506#[derive(Clone, Default, PartialEq)]
9508#[non_exhaustive]
9509pub struct DatabaseFlags {
9510 pub name: std::string::String,
9516
9517 pub value: std::string::String,
9521
9522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9523}
9524
9525impl DatabaseFlags {
9526 pub fn new() -> Self {
9527 std::default::Default::default()
9528 }
9529
9530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9532 self.name = v.into();
9533 self
9534 }
9535
9536 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9538 self.value = v.into();
9539 self
9540 }
9541}
9542
9543impl wkt::message::Message for DatabaseFlags {
9544 fn typename() -> &'static str {
9545 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
9546 }
9547}
9548
9549#[derive(Clone, Default, PartialEq)]
9551#[non_exhaustive]
9552pub struct MySqlSyncConfig {
9553 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
9555
9556 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9557}
9558
9559impl MySqlSyncConfig {
9560 pub fn new() -> Self {
9561 std::default::Default::default()
9562 }
9563
9564 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
9566 where
9567 T: std::iter::IntoIterator<Item = V>,
9568 V: std::convert::Into<crate::model::SyncFlags>,
9569 {
9570 use std::iter::Iterator;
9571 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
9572 self
9573 }
9574}
9575
9576impl wkt::message::Message for MySqlSyncConfig {
9577 fn typename() -> &'static str {
9578 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
9579 }
9580}
9581
9582#[derive(Clone, Default, PartialEq)]
9585#[non_exhaustive]
9586pub struct SyncFlags {
9587 pub name: std::string::String,
9589
9590 pub value: std::string::String,
9593
9594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9595}
9596
9597impl SyncFlags {
9598 pub fn new() -> Self {
9599 std::default::Default::default()
9600 }
9601
9602 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9604 self.name = v.into();
9605 self
9606 }
9607
9608 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9610 self.value = v.into();
9611 self
9612 }
9613}
9614
9615impl wkt::message::Message for SyncFlags {
9616 fn typename() -> &'static str {
9617 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
9618 }
9619}
9620
9621#[derive(Clone, Default, PartialEq)]
9623#[non_exhaustive]
9624pub struct InstanceReference {
9625 pub name: std::string::String,
9628
9629 pub region: std::string::String,
9631
9632 pub project: std::string::String,
9635
9636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9637}
9638
9639impl InstanceReference {
9640 pub fn new() -> Self {
9641 std::default::Default::default()
9642 }
9643
9644 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9646 self.name = v.into();
9647 self
9648 }
9649
9650 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9652 self.region = v.into();
9653 self
9654 }
9655
9656 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9658 self.project = v.into();
9659 self
9660 }
9661}
9662
9663impl wkt::message::Message for InstanceReference {
9664 fn typename() -> &'static str {
9665 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
9666 }
9667}
9668
9669#[derive(Clone, Default, PartialEq)]
9672#[non_exhaustive]
9673pub struct DemoteMasterConfiguration {
9674 pub kind: std::string::String,
9676
9677 pub mysql_replica_configuration:
9684 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9685
9686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9687}
9688
9689impl DemoteMasterConfiguration {
9690 pub fn new() -> Self {
9691 std::default::Default::default()
9692 }
9693
9694 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9696 self.kind = v.into();
9697 self
9698 }
9699
9700 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
9702 where
9703 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9704 {
9705 self.mysql_replica_configuration = std::option::Option::Some(v.into());
9706 self
9707 }
9708
9709 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
9711 where
9712 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
9713 {
9714 self.mysql_replica_configuration = v.map(|x| x.into());
9715 self
9716 }
9717}
9718
9719impl wkt::message::Message for DemoteMasterConfiguration {
9720 fn typename() -> &'static str {
9721 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
9722 }
9723}
9724
9725#[derive(Clone, Default, PartialEq)]
9727#[non_exhaustive]
9728pub struct DemoteMasterMySqlReplicaConfiguration {
9729 pub kind: std::string::String,
9731
9732 pub username: std::string::String,
9734
9735 pub password: std::string::String,
9737
9738 pub client_key: std::string::String,
9742
9743 pub client_certificate: std::string::String,
9745
9746 pub ca_certificate: std::string::String,
9748
9749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9750}
9751
9752impl DemoteMasterMySqlReplicaConfiguration {
9753 pub fn new() -> Self {
9754 std::default::Default::default()
9755 }
9756
9757 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9759 self.kind = v.into();
9760 self
9761 }
9762
9763 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9765 self.username = v.into();
9766 self
9767 }
9768
9769 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9771 self.password = v.into();
9772 self
9773 }
9774
9775 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9777 self.client_key = v.into();
9778 self
9779 }
9780
9781 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
9783 mut self,
9784 v: T,
9785 ) -> Self {
9786 self.client_certificate = v.into();
9787 self
9788 }
9789
9790 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9792 self.ca_certificate = v.into();
9793 self
9794 }
9795}
9796
9797impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
9798 fn typename() -> &'static str {
9799 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
9800 }
9801}
9802
9803#[derive(Clone, Default, PartialEq)]
9805#[non_exhaustive]
9806pub struct ExportContext {
9807 pub uri: std::string::String,
9813
9814 pub databases: std::vec::Vec<std::string::String>,
9827
9828 pub kind: std::string::String,
9830
9831 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
9833
9834 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
9837
9838 pub file_type: crate::model::SqlFileType,
9840
9841 pub offload: std::option::Option<wkt::BoolValue>,
9843
9844 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
9846
9847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9848}
9849
9850impl ExportContext {
9851 pub fn new() -> Self {
9852 std::default::Default::default()
9853 }
9854
9855 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9857 self.uri = v.into();
9858 self
9859 }
9860
9861 pub fn set_databases<T, V>(mut self, v: T) -> Self
9863 where
9864 T: std::iter::IntoIterator<Item = V>,
9865 V: std::convert::Into<std::string::String>,
9866 {
9867 use std::iter::Iterator;
9868 self.databases = v.into_iter().map(|i| i.into()).collect();
9869 self
9870 }
9871
9872 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9874 self.kind = v.into();
9875 self
9876 }
9877
9878 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
9880 where
9881 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
9882 {
9883 self.sql_export_options = std::option::Option::Some(v.into());
9884 self
9885 }
9886
9887 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9889 where
9890 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
9891 {
9892 self.sql_export_options = v.map(|x| x.into());
9893 self
9894 }
9895
9896 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
9898 where
9899 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
9900 {
9901 self.csv_export_options = std::option::Option::Some(v.into());
9902 self
9903 }
9904
9905 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9907 where
9908 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
9909 {
9910 self.csv_export_options = v.map(|x| x.into());
9911 self
9912 }
9913
9914 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
9916 self.file_type = v.into();
9917 self
9918 }
9919
9920 pub fn set_offload<T>(mut self, v: T) -> Self
9922 where
9923 T: std::convert::Into<wkt::BoolValue>,
9924 {
9925 self.offload = std::option::Option::Some(v.into());
9926 self
9927 }
9928
9929 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
9931 where
9932 T: std::convert::Into<wkt::BoolValue>,
9933 {
9934 self.offload = v.map(|x| x.into());
9935 self
9936 }
9937
9938 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
9940 where
9941 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
9942 {
9943 self.bak_export_options = std::option::Option::Some(v.into());
9944 self
9945 }
9946
9947 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
9949 where
9950 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
9951 {
9952 self.bak_export_options = v.map(|x| x.into());
9953 self
9954 }
9955}
9956
9957impl wkt::message::Message for ExportContext {
9958 fn typename() -> &'static str {
9959 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
9960 }
9961}
9962
9963pub mod export_context {
9965 #[allow(unused_imports)]
9966 use super::*;
9967
9968 #[derive(Clone, Default, PartialEq)]
9969 #[non_exhaustive]
9970 pub struct SqlCsvExportOptions {
9971 pub select_query: std::string::String,
9973
9974 pub escape_character: std::string::String,
9977
9978 pub quote_character: std::string::String,
9980
9981 pub fields_terminated_by: std::string::String,
9984
9985 pub lines_terminated_by: std::string::String,
9988
9989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9990 }
9991
9992 impl SqlCsvExportOptions {
9993 pub fn new() -> Self {
9994 std::default::Default::default()
9995 }
9996
9997 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9999 mut self,
10000 v: T,
10001 ) -> Self {
10002 self.select_query = v.into();
10003 self
10004 }
10005
10006 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
10008 mut self,
10009 v: T,
10010 ) -> Self {
10011 self.escape_character = v.into();
10012 self
10013 }
10014
10015 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
10017 mut self,
10018 v: T,
10019 ) -> Self {
10020 self.quote_character = v.into();
10021 self
10022 }
10023
10024 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
10026 mut self,
10027 v: T,
10028 ) -> Self {
10029 self.fields_terminated_by = v.into();
10030 self
10031 }
10032
10033 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
10035 mut self,
10036 v: T,
10037 ) -> Self {
10038 self.lines_terminated_by = v.into();
10039 self
10040 }
10041 }
10042
10043 impl wkt::message::Message for SqlCsvExportOptions {
10044 fn typename() -> &'static str {
10045 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
10046 }
10047 }
10048
10049 #[derive(Clone, Default, PartialEq)]
10050 #[non_exhaustive]
10051 pub struct SqlExportOptions {
10052 pub tables: std::vec::Vec<std::string::String>,
10056
10057 pub schema_only: std::option::Option<wkt::BoolValue>,
10059
10060 pub mysql_export_options: std::option::Option<
10061 crate::model::export_context::sql_export_options::MysqlExportOptions,
10062 >,
10063
10064 pub threads: std::option::Option<wkt::Int32Value>,
10066
10067 pub parallel: std::option::Option<wkt::BoolValue>,
10069
10070 pub postgres_export_options: std::option::Option<
10072 crate::model::export_context::sql_export_options::PostgresExportOptions,
10073 >,
10074
10075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10076 }
10077
10078 impl SqlExportOptions {
10079 pub fn new() -> Self {
10080 std::default::Default::default()
10081 }
10082
10083 pub fn set_tables<T, V>(mut self, v: T) -> Self
10085 where
10086 T: std::iter::IntoIterator<Item = V>,
10087 V: std::convert::Into<std::string::String>,
10088 {
10089 use std::iter::Iterator;
10090 self.tables = v.into_iter().map(|i| i.into()).collect();
10091 self
10092 }
10093
10094 pub fn set_schema_only<T>(mut self, v: T) -> Self
10096 where
10097 T: std::convert::Into<wkt::BoolValue>,
10098 {
10099 self.schema_only = std::option::Option::Some(v.into());
10100 self
10101 }
10102
10103 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
10105 where
10106 T: std::convert::Into<wkt::BoolValue>,
10107 {
10108 self.schema_only = v.map(|x| x.into());
10109 self
10110 }
10111
10112 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
10114 where
10115 T: std::convert::Into<
10116 crate::model::export_context::sql_export_options::MysqlExportOptions,
10117 >,
10118 {
10119 self.mysql_export_options = std::option::Option::Some(v.into());
10120 self
10121 }
10122
10123 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
10125 where
10126 T: std::convert::Into<
10127 crate::model::export_context::sql_export_options::MysqlExportOptions,
10128 >,
10129 {
10130 self.mysql_export_options = v.map(|x| x.into());
10131 self
10132 }
10133
10134 pub fn set_threads<T>(mut self, v: T) -> Self
10136 where
10137 T: std::convert::Into<wkt::Int32Value>,
10138 {
10139 self.threads = std::option::Option::Some(v.into());
10140 self
10141 }
10142
10143 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
10145 where
10146 T: std::convert::Into<wkt::Int32Value>,
10147 {
10148 self.threads = v.map(|x| x.into());
10149 self
10150 }
10151
10152 pub fn set_parallel<T>(mut self, v: T) -> Self
10154 where
10155 T: std::convert::Into<wkt::BoolValue>,
10156 {
10157 self.parallel = std::option::Option::Some(v.into());
10158 self
10159 }
10160
10161 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
10163 where
10164 T: std::convert::Into<wkt::BoolValue>,
10165 {
10166 self.parallel = v.map(|x| x.into());
10167 self
10168 }
10169
10170 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
10172 where
10173 T: std::convert::Into<
10174 crate::model::export_context::sql_export_options::PostgresExportOptions,
10175 >,
10176 {
10177 self.postgres_export_options = std::option::Option::Some(v.into());
10178 self
10179 }
10180
10181 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
10183 where
10184 T: std::convert::Into<
10185 crate::model::export_context::sql_export_options::PostgresExportOptions,
10186 >,
10187 {
10188 self.postgres_export_options = v.map(|x| x.into());
10189 self
10190 }
10191 }
10192
10193 impl wkt::message::Message for SqlExportOptions {
10194 fn typename() -> &'static str {
10195 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
10196 }
10197 }
10198
10199 pub mod sql_export_options {
10201 #[allow(unused_imports)]
10202 use super::*;
10203
10204 #[derive(Clone, Default, PartialEq)]
10206 #[non_exhaustive]
10207 pub struct MysqlExportOptions {
10208 pub master_data: std::option::Option<wkt::Int32Value>,
10215
10216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10217 }
10218
10219 impl MysqlExportOptions {
10220 pub fn new() -> Self {
10221 std::default::Default::default()
10222 }
10223
10224 pub fn set_master_data<T>(mut self, v: T) -> Self
10226 where
10227 T: std::convert::Into<wkt::Int32Value>,
10228 {
10229 self.master_data = std::option::Option::Some(v.into());
10230 self
10231 }
10232
10233 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
10235 where
10236 T: std::convert::Into<wkt::Int32Value>,
10237 {
10238 self.master_data = v.map(|x| x.into());
10239 self
10240 }
10241 }
10242
10243 impl wkt::message::Message for MysqlExportOptions {
10244 fn typename() -> &'static str {
10245 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
10246 }
10247 }
10248
10249 #[derive(Clone, Default, PartialEq)]
10251 #[non_exhaustive]
10252 pub struct PostgresExportOptions {
10253 pub clean: std::option::Option<wkt::BoolValue>,
10257
10258 pub if_exists: std::option::Option<wkt::BoolValue>,
10261
10262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10263 }
10264
10265 impl PostgresExportOptions {
10266 pub fn new() -> Self {
10267 std::default::Default::default()
10268 }
10269
10270 pub fn set_clean<T>(mut self, v: T) -> Self
10272 where
10273 T: std::convert::Into<wkt::BoolValue>,
10274 {
10275 self.clean = std::option::Option::Some(v.into());
10276 self
10277 }
10278
10279 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
10281 where
10282 T: std::convert::Into<wkt::BoolValue>,
10283 {
10284 self.clean = v.map(|x| x.into());
10285 self
10286 }
10287
10288 pub fn set_if_exists<T>(mut self, v: T) -> Self
10290 where
10291 T: std::convert::Into<wkt::BoolValue>,
10292 {
10293 self.if_exists = std::option::Option::Some(v.into());
10294 self
10295 }
10296
10297 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
10299 where
10300 T: std::convert::Into<wkt::BoolValue>,
10301 {
10302 self.if_exists = v.map(|x| x.into());
10303 self
10304 }
10305 }
10306
10307 impl wkt::message::Message for PostgresExportOptions {
10308 fn typename() -> &'static str {
10309 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
10310 }
10311 }
10312 }
10313
10314 #[derive(Clone, Default, PartialEq)]
10316 #[non_exhaustive]
10317 pub struct SqlBakExportOptions {
10318 pub striped: std::option::Option<wkt::BoolValue>,
10320
10321 pub stripe_count: std::option::Option<wkt::Int32Value>,
10325
10326 pub bak_type: crate::model::BakType,
10328
10329 #[deprecated]
10331 pub copy_only: std::option::Option<wkt::BoolValue>,
10332
10333 pub differential_base: std::option::Option<wkt::BoolValue>,
10336
10337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10338 }
10339
10340 impl SqlBakExportOptions {
10341 pub fn new() -> Self {
10342 std::default::Default::default()
10343 }
10344
10345 pub fn set_striped<T>(mut self, v: T) -> Self
10347 where
10348 T: std::convert::Into<wkt::BoolValue>,
10349 {
10350 self.striped = std::option::Option::Some(v.into());
10351 self
10352 }
10353
10354 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
10356 where
10357 T: std::convert::Into<wkt::BoolValue>,
10358 {
10359 self.striped = v.map(|x| x.into());
10360 self
10361 }
10362
10363 pub fn set_stripe_count<T>(mut self, v: T) -> Self
10365 where
10366 T: std::convert::Into<wkt::Int32Value>,
10367 {
10368 self.stripe_count = std::option::Option::Some(v.into());
10369 self
10370 }
10371
10372 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
10374 where
10375 T: std::convert::Into<wkt::Int32Value>,
10376 {
10377 self.stripe_count = v.map(|x| x.into());
10378 self
10379 }
10380
10381 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10383 self.bak_type = v.into();
10384 self
10385 }
10386
10387 #[deprecated]
10389 pub fn set_copy_only<T>(mut self, v: T) -> Self
10390 where
10391 T: std::convert::Into<wkt::BoolValue>,
10392 {
10393 self.copy_only = std::option::Option::Some(v.into());
10394 self
10395 }
10396
10397 #[deprecated]
10399 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
10400 where
10401 T: std::convert::Into<wkt::BoolValue>,
10402 {
10403 self.copy_only = v.map(|x| x.into());
10404 self
10405 }
10406
10407 pub fn set_differential_base<T>(mut self, v: T) -> Self
10409 where
10410 T: std::convert::Into<wkt::BoolValue>,
10411 {
10412 self.differential_base = std::option::Option::Some(v.into());
10413 self
10414 }
10415
10416 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
10418 where
10419 T: std::convert::Into<wkt::BoolValue>,
10420 {
10421 self.differential_base = v.map(|x| x.into());
10422 self
10423 }
10424 }
10425
10426 impl wkt::message::Message for SqlBakExportOptions {
10427 fn typename() -> &'static str {
10428 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
10429 }
10430 }
10431}
10432
10433#[derive(Clone, Default, PartialEq)]
10435#[non_exhaustive]
10436pub struct ImportContext {
10437 pub uri: std::string::String,
10442
10443 pub database: std::string::String,
10448
10449 pub kind: std::string::String,
10451
10452 pub file_type: crate::model::SqlFileType,
10455
10456 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
10458
10459 pub import_user: std::string::String,
10461
10462 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
10464
10465 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
10467
10468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10469}
10470
10471impl ImportContext {
10472 pub fn new() -> Self {
10473 std::default::Default::default()
10474 }
10475
10476 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10478 self.uri = v.into();
10479 self
10480 }
10481
10482 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10484 self.database = v.into();
10485 self
10486 }
10487
10488 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10490 self.kind = v.into();
10491 self
10492 }
10493
10494 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
10496 self.file_type = v.into();
10497 self
10498 }
10499
10500 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
10502 where
10503 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
10504 {
10505 self.csv_import_options = std::option::Option::Some(v.into());
10506 self
10507 }
10508
10509 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10511 where
10512 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
10513 {
10514 self.csv_import_options = v.map(|x| x.into());
10515 self
10516 }
10517
10518 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10520 self.import_user = v.into();
10521 self
10522 }
10523
10524 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
10526 where
10527 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
10528 {
10529 self.bak_import_options = std::option::Option::Some(v.into());
10530 self
10531 }
10532
10533 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10535 where
10536 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
10537 {
10538 self.bak_import_options = v.map(|x| x.into());
10539 self
10540 }
10541
10542 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
10544 where
10545 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
10546 {
10547 self.sql_import_options = std::option::Option::Some(v.into());
10548 self
10549 }
10550
10551 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10553 where
10554 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
10555 {
10556 self.sql_import_options = v.map(|x| x.into());
10557 self
10558 }
10559}
10560
10561impl wkt::message::Message for ImportContext {
10562 fn typename() -> &'static str {
10563 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
10564 }
10565}
10566
10567pub mod import_context {
10569 #[allow(unused_imports)]
10570 use super::*;
10571
10572 #[derive(Clone, Default, PartialEq)]
10573 #[non_exhaustive]
10574 pub struct SqlImportOptions {
10575 pub threads: std::option::Option<wkt::Int32Value>,
10577
10578 pub parallel: std::option::Option<wkt::BoolValue>,
10580
10581 pub postgres_import_options: std::option::Option<
10583 crate::model::import_context::sql_import_options::PostgresImportOptions,
10584 >,
10585
10586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10587 }
10588
10589 impl SqlImportOptions {
10590 pub fn new() -> Self {
10591 std::default::Default::default()
10592 }
10593
10594 pub fn set_threads<T>(mut self, v: T) -> Self
10596 where
10597 T: std::convert::Into<wkt::Int32Value>,
10598 {
10599 self.threads = std::option::Option::Some(v.into());
10600 self
10601 }
10602
10603 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
10605 where
10606 T: std::convert::Into<wkt::Int32Value>,
10607 {
10608 self.threads = v.map(|x| x.into());
10609 self
10610 }
10611
10612 pub fn set_parallel<T>(mut self, v: T) -> Self
10614 where
10615 T: std::convert::Into<wkt::BoolValue>,
10616 {
10617 self.parallel = std::option::Option::Some(v.into());
10618 self
10619 }
10620
10621 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
10623 where
10624 T: std::convert::Into<wkt::BoolValue>,
10625 {
10626 self.parallel = v.map(|x| x.into());
10627 self
10628 }
10629
10630 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
10632 where
10633 T: std::convert::Into<
10634 crate::model::import_context::sql_import_options::PostgresImportOptions,
10635 >,
10636 {
10637 self.postgres_import_options = std::option::Option::Some(v.into());
10638 self
10639 }
10640
10641 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
10643 where
10644 T: std::convert::Into<
10645 crate::model::import_context::sql_import_options::PostgresImportOptions,
10646 >,
10647 {
10648 self.postgres_import_options = v.map(|x| x.into());
10649 self
10650 }
10651 }
10652
10653 impl wkt::message::Message for SqlImportOptions {
10654 fn typename() -> &'static str {
10655 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
10656 }
10657 }
10658
10659 pub mod sql_import_options {
10661 #[allow(unused_imports)]
10662 use super::*;
10663
10664 #[derive(Clone, Default, PartialEq)]
10665 #[non_exhaustive]
10666 pub struct PostgresImportOptions {
10667 pub clean: std::option::Option<wkt::BoolValue>,
10670
10671 pub if_exists: std::option::Option<wkt::BoolValue>,
10674
10675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10676 }
10677
10678 impl PostgresImportOptions {
10679 pub fn new() -> Self {
10680 std::default::Default::default()
10681 }
10682
10683 pub fn set_clean<T>(mut self, v: T) -> Self
10685 where
10686 T: std::convert::Into<wkt::BoolValue>,
10687 {
10688 self.clean = std::option::Option::Some(v.into());
10689 self
10690 }
10691
10692 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
10694 where
10695 T: std::convert::Into<wkt::BoolValue>,
10696 {
10697 self.clean = v.map(|x| x.into());
10698 self
10699 }
10700
10701 pub fn set_if_exists<T>(mut self, v: T) -> Self
10703 where
10704 T: std::convert::Into<wkt::BoolValue>,
10705 {
10706 self.if_exists = std::option::Option::Some(v.into());
10707 self
10708 }
10709
10710 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
10712 where
10713 T: std::convert::Into<wkt::BoolValue>,
10714 {
10715 self.if_exists = v.map(|x| x.into());
10716 self
10717 }
10718 }
10719
10720 impl wkt::message::Message for PostgresImportOptions {
10721 fn typename() -> &'static str {
10722 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
10723 }
10724 }
10725 }
10726
10727 #[derive(Clone, Default, PartialEq)]
10728 #[non_exhaustive]
10729 pub struct SqlCsvImportOptions {
10730 pub table: std::string::String,
10732
10733 pub columns: std::vec::Vec<std::string::String>,
10736
10737 pub escape_character: std::string::String,
10740
10741 pub quote_character: std::string::String,
10743
10744 pub fields_terminated_by: std::string::String,
10747
10748 pub lines_terminated_by: std::string::String,
10751
10752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10753 }
10754
10755 impl SqlCsvImportOptions {
10756 pub fn new() -> Self {
10757 std::default::Default::default()
10758 }
10759
10760 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10762 self.table = v.into();
10763 self
10764 }
10765
10766 pub fn set_columns<T, V>(mut self, v: T) -> Self
10768 where
10769 T: std::iter::IntoIterator<Item = V>,
10770 V: std::convert::Into<std::string::String>,
10771 {
10772 use std::iter::Iterator;
10773 self.columns = v.into_iter().map(|i| i.into()).collect();
10774 self
10775 }
10776
10777 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
10779 mut self,
10780 v: T,
10781 ) -> Self {
10782 self.escape_character = v.into();
10783 self
10784 }
10785
10786 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
10788 mut self,
10789 v: T,
10790 ) -> Self {
10791 self.quote_character = v.into();
10792 self
10793 }
10794
10795 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
10797 mut self,
10798 v: T,
10799 ) -> Self {
10800 self.fields_terminated_by = v.into();
10801 self
10802 }
10803
10804 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
10806 mut self,
10807 v: T,
10808 ) -> Self {
10809 self.lines_terminated_by = v.into();
10810 self
10811 }
10812 }
10813
10814 impl wkt::message::Message for SqlCsvImportOptions {
10815 fn typename() -> &'static str {
10816 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
10817 }
10818 }
10819
10820 #[derive(Clone, Default, PartialEq)]
10821 #[non_exhaustive]
10822 pub struct SqlBakImportOptions {
10823 pub encryption_options: std::option::Option<
10824 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10825 >,
10826
10827 pub striped: std::option::Option<wkt::BoolValue>,
10830
10831 pub no_recovery: std::option::Option<wkt::BoolValue>,
10835
10836 pub recovery_only: std::option::Option<wkt::BoolValue>,
10841
10842 pub bak_type: crate::model::BakType,
10844
10845 pub stop_at: std::option::Option<wkt::Timestamp>,
10850
10851 pub stop_at_mark: std::string::String,
10855
10856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10857 }
10858
10859 impl SqlBakImportOptions {
10860 pub fn new() -> Self {
10861 std::default::Default::default()
10862 }
10863
10864 pub fn set_encryption_options<T>(mut self, v: T) -> Self
10866 where
10867 T: std::convert::Into<
10868 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10869 >,
10870 {
10871 self.encryption_options = std::option::Option::Some(v.into());
10872 self
10873 }
10874
10875 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
10877 where
10878 T: std::convert::Into<
10879 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
10880 >,
10881 {
10882 self.encryption_options = v.map(|x| x.into());
10883 self
10884 }
10885
10886 pub fn set_striped<T>(mut self, v: T) -> Self
10888 where
10889 T: std::convert::Into<wkt::BoolValue>,
10890 {
10891 self.striped = std::option::Option::Some(v.into());
10892 self
10893 }
10894
10895 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
10897 where
10898 T: std::convert::Into<wkt::BoolValue>,
10899 {
10900 self.striped = v.map(|x| x.into());
10901 self
10902 }
10903
10904 pub fn set_no_recovery<T>(mut self, v: T) -> Self
10906 where
10907 T: std::convert::Into<wkt::BoolValue>,
10908 {
10909 self.no_recovery = std::option::Option::Some(v.into());
10910 self
10911 }
10912
10913 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
10915 where
10916 T: std::convert::Into<wkt::BoolValue>,
10917 {
10918 self.no_recovery = v.map(|x| x.into());
10919 self
10920 }
10921
10922 pub fn set_recovery_only<T>(mut self, v: T) -> Self
10924 where
10925 T: std::convert::Into<wkt::BoolValue>,
10926 {
10927 self.recovery_only = std::option::Option::Some(v.into());
10928 self
10929 }
10930
10931 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
10933 where
10934 T: std::convert::Into<wkt::BoolValue>,
10935 {
10936 self.recovery_only = v.map(|x| x.into());
10937 self
10938 }
10939
10940 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
10942 self.bak_type = v.into();
10943 self
10944 }
10945
10946 pub fn set_stop_at<T>(mut self, v: T) -> Self
10948 where
10949 T: std::convert::Into<wkt::Timestamp>,
10950 {
10951 self.stop_at = std::option::Option::Some(v.into());
10952 self
10953 }
10954
10955 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
10957 where
10958 T: std::convert::Into<wkt::Timestamp>,
10959 {
10960 self.stop_at = v.map(|x| x.into());
10961 self
10962 }
10963
10964 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
10966 mut self,
10967 v: T,
10968 ) -> Self {
10969 self.stop_at_mark = v.into();
10970 self
10971 }
10972 }
10973
10974 impl wkt::message::Message for SqlBakImportOptions {
10975 fn typename() -> &'static str {
10976 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
10977 }
10978 }
10979
10980 pub mod sql_bak_import_options {
10982 #[allow(unused_imports)]
10983 use super::*;
10984
10985 #[derive(Clone, Default, PartialEq)]
10986 #[non_exhaustive]
10987 pub struct EncryptionOptions {
10988 pub cert_path: std::string::String,
10992
10993 pub pvk_path: std::string::String,
10997
10998 pub pvk_password: std::string::String,
11000
11001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11002 }
11003
11004 impl EncryptionOptions {
11005 pub fn new() -> Self {
11006 std::default::Default::default()
11007 }
11008
11009 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
11011 mut self,
11012 v: T,
11013 ) -> Self {
11014 self.cert_path = v.into();
11015 self
11016 }
11017
11018 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
11020 mut self,
11021 v: T,
11022 ) -> Self {
11023 self.pvk_path = v.into();
11024 self
11025 }
11026
11027 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
11029 mut self,
11030 v: T,
11031 ) -> Self {
11032 self.pvk_password = v.into();
11033 self
11034 }
11035 }
11036
11037 impl wkt::message::Message for EncryptionOptions {
11038 fn typename() -> &'static str {
11039 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
11040 }
11041 }
11042 }
11043}
11044
11045#[derive(Clone, Default, PartialEq)]
11047#[non_exhaustive]
11048pub struct IpConfiguration {
11049 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
11051
11052 pub private_network: std::string::String,
11057
11058 pub require_ssl: std::option::Option<wkt::BoolValue>,
11068
11069 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
11073
11074 pub allocated_ip_range: std::string::String,
11081
11082 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
11085
11086 pub ssl_mode: crate::model::ip_configuration::SslMode,
11109
11110 pub psc_config: std::option::Option<crate::model::PscConfig>,
11112
11113 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
11115
11116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11117}
11118
11119impl IpConfiguration {
11120 pub fn new() -> Self {
11121 std::default::Default::default()
11122 }
11123
11124 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
11126 where
11127 T: std::convert::Into<wkt::BoolValue>,
11128 {
11129 self.ipv4_enabled = std::option::Option::Some(v.into());
11130 self
11131 }
11132
11133 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
11135 where
11136 T: std::convert::Into<wkt::BoolValue>,
11137 {
11138 self.ipv4_enabled = v.map(|x| x.into());
11139 self
11140 }
11141
11142 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11144 self.private_network = v.into();
11145 self
11146 }
11147
11148 pub fn set_require_ssl<T>(mut self, v: T) -> Self
11150 where
11151 T: std::convert::Into<wkt::BoolValue>,
11152 {
11153 self.require_ssl = std::option::Option::Some(v.into());
11154 self
11155 }
11156
11157 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
11159 where
11160 T: std::convert::Into<wkt::BoolValue>,
11161 {
11162 self.require_ssl = v.map(|x| x.into());
11163 self
11164 }
11165
11166 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
11168 where
11169 T: std::iter::IntoIterator<Item = V>,
11170 V: std::convert::Into<crate::model::AclEntry>,
11171 {
11172 use std::iter::Iterator;
11173 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
11174 self
11175 }
11176
11177 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
11179 mut self,
11180 v: T,
11181 ) -> Self {
11182 self.allocated_ip_range = v.into();
11183 self
11184 }
11185
11186 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
11188 where
11189 T: std::convert::Into<wkt::BoolValue>,
11190 {
11191 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
11192 self
11193 }
11194
11195 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
11197 mut self,
11198 v: std::option::Option<T>,
11199 ) -> Self
11200 where
11201 T: std::convert::Into<wkt::BoolValue>,
11202 {
11203 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
11204 self
11205 }
11206
11207 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
11209 mut self,
11210 v: T,
11211 ) -> Self {
11212 self.ssl_mode = v.into();
11213 self
11214 }
11215
11216 pub fn set_psc_config<T>(mut self, v: T) -> Self
11218 where
11219 T: std::convert::Into<crate::model::PscConfig>,
11220 {
11221 self.psc_config = std::option::Option::Some(v.into());
11222 self
11223 }
11224
11225 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
11227 where
11228 T: std::convert::Into<crate::model::PscConfig>,
11229 {
11230 self.psc_config = v.map(|x| x.into());
11231 self
11232 }
11233
11234 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
11236 where
11237 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
11238 {
11239 self.server_ca_mode = std::option::Option::Some(v.into());
11240 self
11241 }
11242
11243 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
11245 where
11246 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
11247 {
11248 self.server_ca_mode = v.map(|x| x.into());
11249 self
11250 }
11251}
11252
11253impl wkt::message::Message for IpConfiguration {
11254 fn typename() -> &'static str {
11255 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
11256 }
11257}
11258
11259pub mod ip_configuration {
11261 #[allow(unused_imports)]
11262 use super::*;
11263
11264 #[derive(Clone, Debug, PartialEq)]
11280 #[non_exhaustive]
11281 pub enum SslMode {
11282 Unspecified,
11284 AllowUnencryptedAndEncrypted,
11291 EncryptedOnly,
11298 TrustedClientCertificateRequired,
11313 UnknownValue(ssl_mode::UnknownValue),
11318 }
11319
11320 #[doc(hidden)]
11321 pub mod ssl_mode {
11322 #[allow(unused_imports)]
11323 use super::*;
11324 #[derive(Clone, Debug, PartialEq)]
11325 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11326 }
11327
11328 impl SslMode {
11329 pub fn value(&self) -> std::option::Option<i32> {
11334 match self {
11335 Self::Unspecified => std::option::Option::Some(0),
11336 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
11337 Self::EncryptedOnly => std::option::Option::Some(2),
11338 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
11339 Self::UnknownValue(u) => u.0.value(),
11340 }
11341 }
11342
11343 pub fn name(&self) -> std::option::Option<&str> {
11348 match self {
11349 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
11350 Self::AllowUnencryptedAndEncrypted => {
11351 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
11352 }
11353 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
11354 Self::TrustedClientCertificateRequired => {
11355 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
11356 }
11357 Self::UnknownValue(u) => u.0.name(),
11358 }
11359 }
11360 }
11361
11362 impl std::default::Default for SslMode {
11363 fn default() -> Self {
11364 use std::convert::From;
11365 Self::from(0)
11366 }
11367 }
11368
11369 impl std::fmt::Display for SslMode {
11370 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11371 wkt::internal::display_enum(f, self.name(), self.value())
11372 }
11373 }
11374
11375 impl std::convert::From<i32> for SslMode {
11376 fn from(value: i32) -> Self {
11377 match value {
11378 0 => Self::Unspecified,
11379 1 => Self::AllowUnencryptedAndEncrypted,
11380 2 => Self::EncryptedOnly,
11381 3 => Self::TrustedClientCertificateRequired,
11382 _ => Self::UnknownValue(ssl_mode::UnknownValue(
11383 wkt::internal::UnknownEnumValue::Integer(value),
11384 )),
11385 }
11386 }
11387 }
11388
11389 impl std::convert::From<&str> for SslMode {
11390 fn from(value: &str) -> Self {
11391 use std::string::ToString;
11392 match value {
11393 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
11394 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
11395 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
11396 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
11397 _ => Self::UnknownValue(ssl_mode::UnknownValue(
11398 wkt::internal::UnknownEnumValue::String(value.to_string()),
11399 )),
11400 }
11401 }
11402 }
11403
11404 impl serde::ser::Serialize for SslMode {
11405 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11406 where
11407 S: serde::Serializer,
11408 {
11409 match self {
11410 Self::Unspecified => serializer.serialize_i32(0),
11411 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
11412 Self::EncryptedOnly => serializer.serialize_i32(2),
11413 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
11414 Self::UnknownValue(u) => u.0.serialize(serializer),
11415 }
11416 }
11417 }
11418
11419 impl<'de> serde::de::Deserialize<'de> for SslMode {
11420 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11421 where
11422 D: serde::Deserializer<'de>,
11423 {
11424 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
11425 ".google.cloud.sql.v1.IpConfiguration.SslMode",
11426 ))
11427 }
11428 }
11429
11430 #[derive(Clone, Debug, PartialEq)]
11446 #[non_exhaustive]
11447 pub enum CaMode {
11448 Unspecified,
11450 GoogleManagedInternalCa,
11452 GoogleManagedCasCa,
11455 UnknownValue(ca_mode::UnknownValue),
11460 }
11461
11462 #[doc(hidden)]
11463 pub mod ca_mode {
11464 #[allow(unused_imports)]
11465 use super::*;
11466 #[derive(Clone, Debug, PartialEq)]
11467 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11468 }
11469
11470 impl CaMode {
11471 pub fn value(&self) -> std::option::Option<i32> {
11476 match self {
11477 Self::Unspecified => std::option::Option::Some(0),
11478 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
11479 Self::GoogleManagedCasCa => std::option::Option::Some(2),
11480 Self::UnknownValue(u) => u.0.value(),
11481 }
11482 }
11483
11484 pub fn name(&self) -> std::option::Option<&str> {
11489 match self {
11490 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
11491 Self::GoogleManagedInternalCa => {
11492 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
11493 }
11494 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
11495 Self::UnknownValue(u) => u.0.name(),
11496 }
11497 }
11498 }
11499
11500 impl std::default::Default for CaMode {
11501 fn default() -> Self {
11502 use std::convert::From;
11503 Self::from(0)
11504 }
11505 }
11506
11507 impl std::fmt::Display for CaMode {
11508 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11509 wkt::internal::display_enum(f, self.name(), self.value())
11510 }
11511 }
11512
11513 impl std::convert::From<i32> for CaMode {
11514 fn from(value: i32) -> Self {
11515 match value {
11516 0 => Self::Unspecified,
11517 1 => Self::GoogleManagedInternalCa,
11518 2 => Self::GoogleManagedCasCa,
11519 _ => Self::UnknownValue(ca_mode::UnknownValue(
11520 wkt::internal::UnknownEnumValue::Integer(value),
11521 )),
11522 }
11523 }
11524 }
11525
11526 impl std::convert::From<&str> for CaMode {
11527 fn from(value: &str) -> Self {
11528 use std::string::ToString;
11529 match value {
11530 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
11531 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
11532 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
11533 _ => Self::UnknownValue(ca_mode::UnknownValue(
11534 wkt::internal::UnknownEnumValue::String(value.to_string()),
11535 )),
11536 }
11537 }
11538 }
11539
11540 impl serde::ser::Serialize for CaMode {
11541 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11542 where
11543 S: serde::Serializer,
11544 {
11545 match self {
11546 Self::Unspecified => serializer.serialize_i32(0),
11547 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
11548 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
11549 Self::UnknownValue(u) => u.0.serialize(serializer),
11550 }
11551 }
11552 }
11553
11554 impl<'de> serde::de::Deserialize<'de> for CaMode {
11555 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11556 where
11557 D: serde::Deserializer<'de>,
11558 {
11559 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
11560 ".google.cloud.sql.v1.IpConfiguration.CaMode",
11561 ))
11562 }
11563 }
11564}
11565
11566#[derive(Clone, Default, PartialEq)]
11568#[non_exhaustive]
11569pub struct PscConfig {
11570 pub psc_enabled: std::option::Option<bool>,
11572
11573 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
11580
11581 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11582}
11583
11584impl PscConfig {
11585 pub fn new() -> Self {
11586 std::default::Default::default()
11587 }
11588
11589 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
11591 where
11592 T: std::convert::Into<bool>,
11593 {
11594 self.psc_enabled = std::option::Option::Some(v.into());
11595 self
11596 }
11597
11598 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
11600 where
11601 T: std::convert::Into<bool>,
11602 {
11603 self.psc_enabled = v.map(|x| x.into());
11604 self
11605 }
11606
11607 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
11609 where
11610 T: std::iter::IntoIterator<Item = V>,
11611 V: std::convert::Into<std::string::String>,
11612 {
11613 use std::iter::Iterator;
11614 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
11615 self
11616 }
11617}
11618
11619impl wkt::message::Message for PscConfig {
11620 fn typename() -> &'static str {
11621 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
11622 }
11623}
11624
11625#[derive(Clone, Default, PartialEq)]
11630#[non_exhaustive]
11631pub struct LocationPreference {
11632 #[deprecated]
11635 pub follow_gae_application: std::string::String,
11636
11637 pub zone: std::string::String,
11640
11641 pub secondary_zone: std::string::String,
11645
11646 pub kind: std::string::String,
11648
11649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11650}
11651
11652impl LocationPreference {
11653 pub fn new() -> Self {
11654 std::default::Default::default()
11655 }
11656
11657 #[deprecated]
11659 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
11660 mut self,
11661 v: T,
11662 ) -> Self {
11663 self.follow_gae_application = v.into();
11664 self
11665 }
11666
11667 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11669 self.zone = v.into();
11670 self
11671 }
11672
11673 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11675 self.secondary_zone = v.into();
11676 self
11677 }
11678
11679 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11681 self.kind = v.into();
11682 self
11683 }
11684}
11685
11686impl wkt::message::Message for LocationPreference {
11687 fn typename() -> &'static str {
11688 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
11689 }
11690}
11691
11692#[derive(Clone, Default, PartialEq)]
11695#[non_exhaustive]
11696pub struct MaintenanceWindow {
11697 pub hour: std::option::Option<wkt::Int32Value>,
11699
11700 pub day: std::option::Option<wkt::Int32Value>,
11704
11705 pub update_track: crate::model::SqlUpdateTrack,
11709
11710 pub kind: std::string::String,
11712
11713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11714}
11715
11716impl MaintenanceWindow {
11717 pub fn new() -> Self {
11718 std::default::Default::default()
11719 }
11720
11721 pub fn set_hour<T>(mut self, v: T) -> Self
11723 where
11724 T: std::convert::Into<wkt::Int32Value>,
11725 {
11726 self.hour = std::option::Option::Some(v.into());
11727 self
11728 }
11729
11730 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
11732 where
11733 T: std::convert::Into<wkt::Int32Value>,
11734 {
11735 self.hour = v.map(|x| x.into());
11736 self
11737 }
11738
11739 pub fn set_day<T>(mut self, v: T) -> Self
11741 where
11742 T: std::convert::Into<wkt::Int32Value>,
11743 {
11744 self.day = std::option::Option::Some(v.into());
11745 self
11746 }
11747
11748 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
11750 where
11751 T: std::convert::Into<wkt::Int32Value>,
11752 {
11753 self.day = v.map(|x| x.into());
11754 self
11755 }
11756
11757 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
11759 mut self,
11760 v: T,
11761 ) -> Self {
11762 self.update_track = v.into();
11763 self
11764 }
11765
11766 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11768 self.kind = v.into();
11769 self
11770 }
11771}
11772
11773impl wkt::message::Message for MaintenanceWindow {
11774 fn typename() -> &'static str {
11775 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
11776 }
11777}
11778
11779#[derive(Clone, Default, PartialEq)]
11782#[non_exhaustive]
11783pub struct DenyMaintenancePeriod {
11784 pub start_date: std::string::String,
11789
11790 pub end_date: std::string::String,
11795
11796 pub time: std::string::String,
11799
11800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11801}
11802
11803impl DenyMaintenancePeriod {
11804 pub fn new() -> Self {
11805 std::default::Default::default()
11806 }
11807
11808 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11810 self.start_date = v.into();
11811 self
11812 }
11813
11814 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11816 self.end_date = v.into();
11817 self
11818 }
11819
11820 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11822 self.time = v.into();
11823 self
11824 }
11825}
11826
11827impl wkt::message::Message for DenyMaintenancePeriod {
11828 fn typename() -> &'static str {
11829 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
11830 }
11831}
11832
11833#[derive(Clone, Default, PartialEq)]
11836#[non_exhaustive]
11837pub struct InsightsConfig {
11838 pub query_insights_enabled: bool,
11840
11841 pub record_client_address: bool,
11843
11844 pub record_application_tags: bool,
11847
11848 pub query_string_length: std::option::Option<wkt::Int32Value>,
11853
11854 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
11857
11858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11859}
11860
11861impl InsightsConfig {
11862 pub fn new() -> Self {
11863 std::default::Default::default()
11864 }
11865
11866 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11868 self.query_insights_enabled = v.into();
11869 self
11870 }
11871
11872 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11874 self.record_client_address = v.into();
11875 self
11876 }
11877
11878 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11880 self.record_application_tags = v.into();
11881 self
11882 }
11883
11884 pub fn set_query_string_length<T>(mut self, v: T) -> Self
11886 where
11887 T: std::convert::Into<wkt::Int32Value>,
11888 {
11889 self.query_string_length = std::option::Option::Some(v.into());
11890 self
11891 }
11892
11893 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
11895 where
11896 T: std::convert::Into<wkt::Int32Value>,
11897 {
11898 self.query_string_length = v.map(|x| x.into());
11899 self
11900 }
11901
11902 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
11904 where
11905 T: std::convert::Into<wkt::Int32Value>,
11906 {
11907 self.query_plans_per_minute = std::option::Option::Some(v.into());
11908 self
11909 }
11910
11911 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
11913 where
11914 T: std::convert::Into<wkt::Int32Value>,
11915 {
11916 self.query_plans_per_minute = v.map(|x| x.into());
11917 self
11918 }
11919}
11920
11921impl wkt::message::Message for InsightsConfig {
11922 fn typename() -> &'static str {
11923 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
11924 }
11925}
11926
11927#[derive(Clone, Default, PartialEq)]
11929#[non_exhaustive]
11930pub struct MySqlReplicaConfiguration {
11931 pub dump_file_path: std::string::String,
11938
11939 pub username: std::string::String,
11941
11942 pub password: std::string::String,
11944
11945 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
11947
11948 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
11950
11951 pub ca_certificate: std::string::String,
11953
11954 pub client_certificate: std::string::String,
11956
11957 pub client_key: std::string::String,
11960
11961 pub ssl_cipher: std::string::String,
11963
11964 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
11967
11968 pub kind: std::string::String,
11970
11971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11972}
11973
11974impl MySqlReplicaConfiguration {
11975 pub fn new() -> Self {
11976 std::default::Default::default()
11977 }
11978
11979 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11981 self.dump_file_path = v.into();
11982 self
11983 }
11984
11985 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11987 self.username = v.into();
11988 self
11989 }
11990
11991 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11993 self.password = v.into();
11994 self
11995 }
11996
11997 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
11999 where
12000 T: std::convert::Into<wkt::Int32Value>,
12001 {
12002 self.connect_retry_interval = std::option::Option::Some(v.into());
12003 self
12004 }
12005
12006 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
12008 where
12009 T: std::convert::Into<wkt::Int32Value>,
12010 {
12011 self.connect_retry_interval = v.map(|x| x.into());
12012 self
12013 }
12014
12015 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
12017 where
12018 T: std::convert::Into<wkt::Int64Value>,
12019 {
12020 self.master_heartbeat_period = std::option::Option::Some(v.into());
12021 self
12022 }
12023
12024 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
12026 where
12027 T: std::convert::Into<wkt::Int64Value>,
12028 {
12029 self.master_heartbeat_period = v.map(|x| x.into());
12030 self
12031 }
12032
12033 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12035 self.ca_certificate = v.into();
12036 self
12037 }
12038
12039 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
12041 mut self,
12042 v: T,
12043 ) -> Self {
12044 self.client_certificate = v.into();
12045 self
12046 }
12047
12048 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12050 self.client_key = v.into();
12051 self
12052 }
12053
12054 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12056 self.ssl_cipher = v.into();
12057 self
12058 }
12059
12060 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
12062 where
12063 T: std::convert::Into<wkt::BoolValue>,
12064 {
12065 self.verify_server_certificate = std::option::Option::Some(v.into());
12066 self
12067 }
12068
12069 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
12071 where
12072 T: std::convert::Into<wkt::BoolValue>,
12073 {
12074 self.verify_server_certificate = v.map(|x| x.into());
12075 self
12076 }
12077
12078 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12080 self.kind = v.into();
12081 self
12082 }
12083}
12084
12085impl wkt::message::Message for MySqlReplicaConfiguration {
12086 fn typename() -> &'static str {
12087 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
12088 }
12089}
12090
12091#[derive(Clone, Default, PartialEq)]
12093#[non_exhaustive]
12094pub struct DiskEncryptionConfiguration {
12095 pub kms_key_name: std::string::String,
12097
12098 pub kind: std::string::String,
12100
12101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12102}
12103
12104impl DiskEncryptionConfiguration {
12105 pub fn new() -> Self {
12106 std::default::Default::default()
12107 }
12108
12109 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12111 self.kms_key_name = v.into();
12112 self
12113 }
12114
12115 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12117 self.kind = v.into();
12118 self
12119 }
12120}
12121
12122impl wkt::message::Message for DiskEncryptionConfiguration {
12123 fn typename() -> &'static str {
12124 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
12125 }
12126}
12127
12128#[derive(Clone, Default, PartialEq)]
12130#[non_exhaustive]
12131pub struct DiskEncryptionStatus {
12132 pub kms_key_version_name: std::string::String,
12134
12135 pub kind: std::string::String,
12137
12138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12139}
12140
12141impl DiskEncryptionStatus {
12142 pub fn new() -> Self {
12143 std::default::Default::default()
12144 }
12145
12146 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
12148 mut self,
12149 v: T,
12150 ) -> Self {
12151 self.kms_key_version_name = v.into();
12152 self
12153 }
12154
12155 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12157 self.kind = v.into();
12158 self
12159 }
12160}
12161
12162impl wkt::message::Message for DiskEncryptionStatus {
12163 fn typename() -> &'static str {
12164 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
12165 }
12166}
12167
12168#[derive(Clone, Default, PartialEq)]
12170#[non_exhaustive]
12171pub struct IpMapping {
12172 pub r#type: crate::model::SqlIpAddressType,
12177
12178 pub ip_address: std::string::String,
12180
12181 pub time_to_retire: std::option::Option<wkt::Timestamp>,
12186
12187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12188}
12189
12190impl IpMapping {
12191 pub fn new() -> Self {
12192 std::default::Default::default()
12193 }
12194
12195 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
12197 self.r#type = v.into();
12198 self
12199 }
12200
12201 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12203 self.ip_address = v.into();
12204 self
12205 }
12206
12207 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
12209 where
12210 T: std::convert::Into<wkt::Timestamp>,
12211 {
12212 self.time_to_retire = std::option::Option::Some(v.into());
12213 self
12214 }
12215
12216 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
12218 where
12219 T: std::convert::Into<wkt::Timestamp>,
12220 {
12221 self.time_to_retire = v.map(|x| x.into());
12222 self
12223 }
12224}
12225
12226impl wkt::message::Message for IpMapping {
12227 fn typename() -> &'static str {
12228 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
12229 }
12230}
12231
12232#[derive(Clone, Default, PartialEq)]
12236#[non_exhaustive]
12237pub struct Operation {
12238 pub kind: std::string::String,
12240
12241 pub target_link: std::string::String,
12242
12243 pub status: crate::model::operation::SqlOperationStatus,
12245
12246 pub user: std::string::String,
12248
12249 pub insert_time: std::option::Option<wkt::Timestamp>,
12253
12254 pub start_time: std::option::Option<wkt::Timestamp>,
12258
12259 pub end_time: std::option::Option<wkt::Timestamp>,
12263
12264 pub error: std::option::Option<crate::model::OperationErrors>,
12267
12268 pub api_warning: std::option::Option<crate::model::ApiWarning>,
12270
12271 pub operation_type: crate::model::operation::SqlOperationType,
12286
12287 pub import_context: std::option::Option<crate::model::ImportContext>,
12289
12290 pub export_context: std::option::Option<crate::model::ExportContext>,
12292
12293 pub backup_context: std::option::Option<crate::model::BackupContext>,
12295
12296 pub name: std::string::String,
12300
12301 pub target_id: std::string::String,
12303
12304 pub self_link: std::string::String,
12306
12307 pub target_project: std::string::String,
12309
12310 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
12312
12313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12314}
12315
12316impl Operation {
12317 pub fn new() -> Self {
12318 std::default::Default::default()
12319 }
12320
12321 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12323 self.kind = v.into();
12324 self
12325 }
12326
12327 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12329 self.target_link = v.into();
12330 self
12331 }
12332
12333 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
12335 mut self,
12336 v: T,
12337 ) -> Self {
12338 self.status = v.into();
12339 self
12340 }
12341
12342 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12344 self.user = v.into();
12345 self
12346 }
12347
12348 pub fn set_insert_time<T>(mut self, v: T) -> Self
12350 where
12351 T: std::convert::Into<wkt::Timestamp>,
12352 {
12353 self.insert_time = std::option::Option::Some(v.into());
12354 self
12355 }
12356
12357 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
12359 where
12360 T: std::convert::Into<wkt::Timestamp>,
12361 {
12362 self.insert_time = v.map(|x| x.into());
12363 self
12364 }
12365
12366 pub fn set_start_time<T>(mut self, v: T) -> Self
12368 where
12369 T: std::convert::Into<wkt::Timestamp>,
12370 {
12371 self.start_time = std::option::Option::Some(v.into());
12372 self
12373 }
12374
12375 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12377 where
12378 T: std::convert::Into<wkt::Timestamp>,
12379 {
12380 self.start_time = v.map(|x| x.into());
12381 self
12382 }
12383
12384 pub fn set_end_time<T>(mut self, v: T) -> Self
12386 where
12387 T: std::convert::Into<wkt::Timestamp>,
12388 {
12389 self.end_time = std::option::Option::Some(v.into());
12390 self
12391 }
12392
12393 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12395 where
12396 T: std::convert::Into<wkt::Timestamp>,
12397 {
12398 self.end_time = v.map(|x| x.into());
12399 self
12400 }
12401
12402 pub fn set_error<T>(mut self, v: T) -> Self
12404 where
12405 T: std::convert::Into<crate::model::OperationErrors>,
12406 {
12407 self.error = std::option::Option::Some(v.into());
12408 self
12409 }
12410
12411 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12413 where
12414 T: std::convert::Into<crate::model::OperationErrors>,
12415 {
12416 self.error = v.map(|x| x.into());
12417 self
12418 }
12419
12420 pub fn set_api_warning<T>(mut self, v: T) -> Self
12422 where
12423 T: std::convert::Into<crate::model::ApiWarning>,
12424 {
12425 self.api_warning = std::option::Option::Some(v.into());
12426 self
12427 }
12428
12429 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
12431 where
12432 T: std::convert::Into<crate::model::ApiWarning>,
12433 {
12434 self.api_warning = v.map(|x| x.into());
12435 self
12436 }
12437
12438 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
12440 mut self,
12441 v: T,
12442 ) -> Self {
12443 self.operation_type = v.into();
12444 self
12445 }
12446
12447 pub fn set_import_context<T>(mut self, v: T) -> Self
12449 where
12450 T: std::convert::Into<crate::model::ImportContext>,
12451 {
12452 self.import_context = std::option::Option::Some(v.into());
12453 self
12454 }
12455
12456 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
12458 where
12459 T: std::convert::Into<crate::model::ImportContext>,
12460 {
12461 self.import_context = v.map(|x| x.into());
12462 self
12463 }
12464
12465 pub fn set_export_context<T>(mut self, v: T) -> Self
12467 where
12468 T: std::convert::Into<crate::model::ExportContext>,
12469 {
12470 self.export_context = std::option::Option::Some(v.into());
12471 self
12472 }
12473
12474 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
12476 where
12477 T: std::convert::Into<crate::model::ExportContext>,
12478 {
12479 self.export_context = v.map(|x| x.into());
12480 self
12481 }
12482
12483 pub fn set_backup_context<T>(mut self, v: T) -> Self
12485 where
12486 T: std::convert::Into<crate::model::BackupContext>,
12487 {
12488 self.backup_context = std::option::Option::Some(v.into());
12489 self
12490 }
12491
12492 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
12494 where
12495 T: std::convert::Into<crate::model::BackupContext>,
12496 {
12497 self.backup_context = v.map(|x| x.into());
12498 self
12499 }
12500
12501 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12503 self.name = v.into();
12504 self
12505 }
12506
12507 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12509 self.target_id = v.into();
12510 self
12511 }
12512
12513 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12515 self.self_link = v.into();
12516 self
12517 }
12518
12519 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12521 self.target_project = v.into();
12522 self
12523 }
12524
12525 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
12527 where
12528 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
12529 {
12530 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
12531 self
12532 }
12533
12534 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
12536 where
12537 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
12538 {
12539 self.acquire_ssrs_lease_context = v.map(|x| x.into());
12540 self
12541 }
12542}
12543
12544impl wkt::message::Message for Operation {
12545 fn typename() -> &'static str {
12546 "type.googleapis.com/google.cloud.sql.v1.Operation"
12547 }
12548}
12549
12550pub mod operation {
12552 #[allow(unused_imports)]
12553 use super::*;
12554
12555 #[derive(Clone, Debug, PartialEq)]
12571 #[non_exhaustive]
12572 pub enum SqlOperationType {
12573 Unspecified,
12575 Import,
12577 Export,
12580 Create,
12582 Update,
12584 Delete,
12586 Restart,
12588 #[deprecated]
12589 Backup,
12590 #[deprecated]
12591 Snapshot,
12592 BackupVolume,
12594 DeleteVolume,
12596 RestoreVolume,
12598 InjectUser,
12600 Clone,
12602 StopReplica,
12604 StartReplica,
12606 PromoteReplica,
12608 CreateReplica,
12610 CreateUser,
12612 DeleteUser,
12614 UpdateUser,
12616 CreateDatabase,
12618 DeleteDatabase,
12620 UpdateDatabase,
12622 Failover,
12625 DeleteBackup,
12627 RecreateReplica,
12628 TruncateLog,
12630 DemoteMaster,
12633 Maintenance,
12636 #[deprecated]
12638 EnablePrivateIp,
12639 #[deprecated]
12640 DeferMaintenance,
12641 #[deprecated]
12643 CreateClone,
12644 RescheduleMaintenance,
12646 StartExternalSync,
12649 LogCleanup,
12651 AutoRestart,
12654 Reencrypt,
12656 Switchover,
12659 AcquireSsrsLease,
12661 ReleaseSsrsLease,
12663 ReconfigureOldPrimary,
12668 ClusterMaintenance,
12674 SelfServiceMaintenance,
12679 SwitchoverToReplica,
12682 MajorVersionUpgrade,
12684 UnknownValue(sql_operation_type::UnknownValue),
12689 }
12690
12691 #[doc(hidden)]
12692 pub mod sql_operation_type {
12693 #[allow(unused_imports)]
12694 use super::*;
12695 #[derive(Clone, Debug, PartialEq)]
12696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12697 }
12698
12699 impl SqlOperationType {
12700 pub fn value(&self) -> std::option::Option<i32> {
12705 match self {
12706 Self::Unspecified => std::option::Option::Some(0),
12707 Self::Import => std::option::Option::Some(1),
12708 Self::Export => std::option::Option::Some(2),
12709 Self::Create => std::option::Option::Some(3),
12710 Self::Update => std::option::Option::Some(4),
12711 Self::Delete => std::option::Option::Some(5),
12712 Self::Restart => std::option::Option::Some(6),
12713 Self::Backup => std::option::Option::Some(7),
12714 Self::Snapshot => std::option::Option::Some(8),
12715 Self::BackupVolume => std::option::Option::Some(9),
12716 Self::DeleteVolume => std::option::Option::Some(10),
12717 Self::RestoreVolume => std::option::Option::Some(11),
12718 Self::InjectUser => std::option::Option::Some(12),
12719 Self::Clone => std::option::Option::Some(14),
12720 Self::StopReplica => std::option::Option::Some(15),
12721 Self::StartReplica => std::option::Option::Some(16),
12722 Self::PromoteReplica => std::option::Option::Some(17),
12723 Self::CreateReplica => std::option::Option::Some(18),
12724 Self::CreateUser => std::option::Option::Some(19),
12725 Self::DeleteUser => std::option::Option::Some(20),
12726 Self::UpdateUser => std::option::Option::Some(21),
12727 Self::CreateDatabase => std::option::Option::Some(22),
12728 Self::DeleteDatabase => std::option::Option::Some(23),
12729 Self::UpdateDatabase => std::option::Option::Some(24),
12730 Self::Failover => std::option::Option::Some(25),
12731 Self::DeleteBackup => std::option::Option::Some(26),
12732 Self::RecreateReplica => std::option::Option::Some(27),
12733 Self::TruncateLog => std::option::Option::Some(28),
12734 Self::DemoteMaster => std::option::Option::Some(29),
12735 Self::Maintenance => std::option::Option::Some(30),
12736 Self::EnablePrivateIp => std::option::Option::Some(31),
12737 Self::DeferMaintenance => std::option::Option::Some(32),
12738 Self::CreateClone => std::option::Option::Some(33),
12739 Self::RescheduleMaintenance => std::option::Option::Some(34),
12740 Self::StartExternalSync => std::option::Option::Some(35),
12741 Self::LogCleanup => std::option::Option::Some(36),
12742 Self::AutoRestart => std::option::Option::Some(37),
12743 Self::Reencrypt => std::option::Option::Some(38),
12744 Self::Switchover => std::option::Option::Some(39),
12745 Self::AcquireSsrsLease => std::option::Option::Some(42),
12746 Self::ReleaseSsrsLease => std::option::Option::Some(43),
12747 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
12748 Self::ClusterMaintenance => std::option::Option::Some(45),
12749 Self::SelfServiceMaintenance => std::option::Option::Some(46),
12750 Self::SwitchoverToReplica => std::option::Option::Some(47),
12751 Self::MajorVersionUpgrade => std::option::Option::Some(48),
12752 Self::UnknownValue(u) => u.0.value(),
12753 }
12754 }
12755
12756 pub fn name(&self) -> std::option::Option<&str> {
12761 match self {
12762 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
12763 Self::Import => std::option::Option::Some("IMPORT"),
12764 Self::Export => std::option::Option::Some("EXPORT"),
12765 Self::Create => std::option::Option::Some("CREATE"),
12766 Self::Update => std::option::Option::Some("UPDATE"),
12767 Self::Delete => std::option::Option::Some("DELETE"),
12768 Self::Restart => std::option::Option::Some("RESTART"),
12769 Self::Backup => std::option::Option::Some("BACKUP"),
12770 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
12771 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
12772 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
12773 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
12774 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
12775 Self::Clone => std::option::Option::Some("CLONE"),
12776 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
12777 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
12778 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
12779 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
12780 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
12781 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
12782 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
12783 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
12784 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
12785 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
12786 Self::Failover => std::option::Option::Some("FAILOVER"),
12787 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
12788 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
12789 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
12790 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
12791 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12792 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
12793 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
12794 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
12795 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
12796 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
12797 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
12798 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
12799 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
12800 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
12801 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
12802 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
12803 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
12804 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
12805 Self::SelfServiceMaintenance => {
12806 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
12807 }
12808 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
12809 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
12810 Self::UnknownValue(u) => u.0.name(),
12811 }
12812 }
12813 }
12814
12815 impl std::default::Default for SqlOperationType {
12816 fn default() -> Self {
12817 use std::convert::From;
12818 Self::from(0)
12819 }
12820 }
12821
12822 impl std::fmt::Display for SqlOperationType {
12823 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12824 wkt::internal::display_enum(f, self.name(), self.value())
12825 }
12826 }
12827
12828 impl std::convert::From<i32> for SqlOperationType {
12829 fn from(value: i32) -> Self {
12830 match value {
12831 0 => Self::Unspecified,
12832 1 => Self::Import,
12833 2 => Self::Export,
12834 3 => Self::Create,
12835 4 => Self::Update,
12836 5 => Self::Delete,
12837 6 => Self::Restart,
12838 7 => Self::Backup,
12839 8 => Self::Snapshot,
12840 9 => Self::BackupVolume,
12841 10 => Self::DeleteVolume,
12842 11 => Self::RestoreVolume,
12843 12 => Self::InjectUser,
12844 14 => Self::Clone,
12845 15 => Self::StopReplica,
12846 16 => Self::StartReplica,
12847 17 => Self::PromoteReplica,
12848 18 => Self::CreateReplica,
12849 19 => Self::CreateUser,
12850 20 => Self::DeleteUser,
12851 21 => Self::UpdateUser,
12852 22 => Self::CreateDatabase,
12853 23 => Self::DeleteDatabase,
12854 24 => Self::UpdateDatabase,
12855 25 => Self::Failover,
12856 26 => Self::DeleteBackup,
12857 27 => Self::RecreateReplica,
12858 28 => Self::TruncateLog,
12859 29 => Self::DemoteMaster,
12860 30 => Self::Maintenance,
12861 31 => Self::EnablePrivateIp,
12862 32 => Self::DeferMaintenance,
12863 33 => Self::CreateClone,
12864 34 => Self::RescheduleMaintenance,
12865 35 => Self::StartExternalSync,
12866 36 => Self::LogCleanup,
12867 37 => Self::AutoRestart,
12868 38 => Self::Reencrypt,
12869 39 => Self::Switchover,
12870 42 => Self::AcquireSsrsLease,
12871 43 => Self::ReleaseSsrsLease,
12872 44 => Self::ReconfigureOldPrimary,
12873 45 => Self::ClusterMaintenance,
12874 46 => Self::SelfServiceMaintenance,
12875 47 => Self::SwitchoverToReplica,
12876 48 => Self::MajorVersionUpgrade,
12877 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12878 wkt::internal::UnknownEnumValue::Integer(value),
12879 )),
12880 }
12881 }
12882 }
12883
12884 impl std::convert::From<&str> for SqlOperationType {
12885 fn from(value: &str) -> Self {
12886 use std::string::ToString;
12887 match value {
12888 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
12889 "IMPORT" => Self::Import,
12890 "EXPORT" => Self::Export,
12891 "CREATE" => Self::Create,
12892 "UPDATE" => Self::Update,
12893 "DELETE" => Self::Delete,
12894 "RESTART" => Self::Restart,
12895 "BACKUP" => Self::Backup,
12896 "SNAPSHOT" => Self::Snapshot,
12897 "BACKUP_VOLUME" => Self::BackupVolume,
12898 "DELETE_VOLUME" => Self::DeleteVolume,
12899 "RESTORE_VOLUME" => Self::RestoreVolume,
12900 "INJECT_USER" => Self::InjectUser,
12901 "CLONE" => Self::Clone,
12902 "STOP_REPLICA" => Self::StopReplica,
12903 "START_REPLICA" => Self::StartReplica,
12904 "PROMOTE_REPLICA" => Self::PromoteReplica,
12905 "CREATE_REPLICA" => Self::CreateReplica,
12906 "CREATE_USER" => Self::CreateUser,
12907 "DELETE_USER" => Self::DeleteUser,
12908 "UPDATE_USER" => Self::UpdateUser,
12909 "CREATE_DATABASE" => Self::CreateDatabase,
12910 "DELETE_DATABASE" => Self::DeleteDatabase,
12911 "UPDATE_DATABASE" => Self::UpdateDatabase,
12912 "FAILOVER" => Self::Failover,
12913 "DELETE_BACKUP" => Self::DeleteBackup,
12914 "RECREATE_REPLICA" => Self::RecreateReplica,
12915 "TRUNCATE_LOG" => Self::TruncateLog,
12916 "DEMOTE_MASTER" => Self::DemoteMaster,
12917 "MAINTENANCE" => Self::Maintenance,
12918 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
12919 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
12920 "CREATE_CLONE" => Self::CreateClone,
12921 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
12922 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
12923 "LOG_CLEANUP" => Self::LogCleanup,
12924 "AUTO_RESTART" => Self::AutoRestart,
12925 "REENCRYPT" => Self::Reencrypt,
12926 "SWITCHOVER" => Self::Switchover,
12927 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
12928 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
12929 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
12930 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
12931 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
12932 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
12933 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
12934 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
12935 wkt::internal::UnknownEnumValue::String(value.to_string()),
12936 )),
12937 }
12938 }
12939 }
12940
12941 impl serde::ser::Serialize for SqlOperationType {
12942 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12943 where
12944 S: serde::Serializer,
12945 {
12946 match self {
12947 Self::Unspecified => serializer.serialize_i32(0),
12948 Self::Import => serializer.serialize_i32(1),
12949 Self::Export => serializer.serialize_i32(2),
12950 Self::Create => serializer.serialize_i32(3),
12951 Self::Update => serializer.serialize_i32(4),
12952 Self::Delete => serializer.serialize_i32(5),
12953 Self::Restart => serializer.serialize_i32(6),
12954 Self::Backup => serializer.serialize_i32(7),
12955 Self::Snapshot => serializer.serialize_i32(8),
12956 Self::BackupVolume => serializer.serialize_i32(9),
12957 Self::DeleteVolume => serializer.serialize_i32(10),
12958 Self::RestoreVolume => serializer.serialize_i32(11),
12959 Self::InjectUser => serializer.serialize_i32(12),
12960 Self::Clone => serializer.serialize_i32(14),
12961 Self::StopReplica => serializer.serialize_i32(15),
12962 Self::StartReplica => serializer.serialize_i32(16),
12963 Self::PromoteReplica => serializer.serialize_i32(17),
12964 Self::CreateReplica => serializer.serialize_i32(18),
12965 Self::CreateUser => serializer.serialize_i32(19),
12966 Self::DeleteUser => serializer.serialize_i32(20),
12967 Self::UpdateUser => serializer.serialize_i32(21),
12968 Self::CreateDatabase => serializer.serialize_i32(22),
12969 Self::DeleteDatabase => serializer.serialize_i32(23),
12970 Self::UpdateDatabase => serializer.serialize_i32(24),
12971 Self::Failover => serializer.serialize_i32(25),
12972 Self::DeleteBackup => serializer.serialize_i32(26),
12973 Self::RecreateReplica => serializer.serialize_i32(27),
12974 Self::TruncateLog => serializer.serialize_i32(28),
12975 Self::DemoteMaster => serializer.serialize_i32(29),
12976 Self::Maintenance => serializer.serialize_i32(30),
12977 Self::EnablePrivateIp => serializer.serialize_i32(31),
12978 Self::DeferMaintenance => serializer.serialize_i32(32),
12979 Self::CreateClone => serializer.serialize_i32(33),
12980 Self::RescheduleMaintenance => serializer.serialize_i32(34),
12981 Self::StartExternalSync => serializer.serialize_i32(35),
12982 Self::LogCleanup => serializer.serialize_i32(36),
12983 Self::AutoRestart => serializer.serialize_i32(37),
12984 Self::Reencrypt => serializer.serialize_i32(38),
12985 Self::Switchover => serializer.serialize_i32(39),
12986 Self::AcquireSsrsLease => serializer.serialize_i32(42),
12987 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
12988 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
12989 Self::ClusterMaintenance => serializer.serialize_i32(45),
12990 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
12991 Self::SwitchoverToReplica => serializer.serialize_i32(47),
12992 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
12993 Self::UnknownValue(u) => u.0.serialize(serializer),
12994 }
12995 }
12996 }
12997
12998 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
12999 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13000 where
13001 D: serde::Deserializer<'de>,
13002 {
13003 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
13004 ".google.cloud.sql.v1.Operation.SqlOperationType",
13005 ))
13006 }
13007 }
13008
13009 #[derive(Clone, Debug, PartialEq)]
13025 #[non_exhaustive]
13026 pub enum SqlOperationStatus {
13027 Unspecified,
13029 Pending,
13031 Running,
13033 Done,
13035 UnknownValue(sql_operation_status::UnknownValue),
13040 }
13041
13042 #[doc(hidden)]
13043 pub mod sql_operation_status {
13044 #[allow(unused_imports)]
13045 use super::*;
13046 #[derive(Clone, Debug, PartialEq)]
13047 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13048 }
13049
13050 impl SqlOperationStatus {
13051 pub fn value(&self) -> std::option::Option<i32> {
13056 match self {
13057 Self::Unspecified => std::option::Option::Some(0),
13058 Self::Pending => std::option::Option::Some(1),
13059 Self::Running => std::option::Option::Some(2),
13060 Self::Done => std::option::Option::Some(3),
13061 Self::UnknownValue(u) => u.0.value(),
13062 }
13063 }
13064
13065 pub fn name(&self) -> std::option::Option<&str> {
13070 match self {
13071 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
13072 Self::Pending => std::option::Option::Some("PENDING"),
13073 Self::Running => std::option::Option::Some("RUNNING"),
13074 Self::Done => std::option::Option::Some("DONE"),
13075 Self::UnknownValue(u) => u.0.name(),
13076 }
13077 }
13078 }
13079
13080 impl std::default::Default for SqlOperationStatus {
13081 fn default() -> Self {
13082 use std::convert::From;
13083 Self::from(0)
13084 }
13085 }
13086
13087 impl std::fmt::Display for SqlOperationStatus {
13088 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13089 wkt::internal::display_enum(f, self.name(), self.value())
13090 }
13091 }
13092
13093 impl std::convert::From<i32> for SqlOperationStatus {
13094 fn from(value: i32) -> Self {
13095 match value {
13096 0 => Self::Unspecified,
13097 1 => Self::Pending,
13098 2 => Self::Running,
13099 3 => Self::Done,
13100 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
13101 wkt::internal::UnknownEnumValue::Integer(value),
13102 )),
13103 }
13104 }
13105 }
13106
13107 impl std::convert::From<&str> for SqlOperationStatus {
13108 fn from(value: &str) -> Self {
13109 use std::string::ToString;
13110 match value {
13111 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
13112 "PENDING" => Self::Pending,
13113 "RUNNING" => Self::Running,
13114 "DONE" => Self::Done,
13115 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
13116 wkt::internal::UnknownEnumValue::String(value.to_string()),
13117 )),
13118 }
13119 }
13120 }
13121
13122 impl serde::ser::Serialize for SqlOperationStatus {
13123 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13124 where
13125 S: serde::Serializer,
13126 {
13127 match self {
13128 Self::Unspecified => serializer.serialize_i32(0),
13129 Self::Pending => serializer.serialize_i32(1),
13130 Self::Running => serializer.serialize_i32(2),
13131 Self::Done => serializer.serialize_i32(3),
13132 Self::UnknownValue(u) => u.0.serialize(serializer),
13133 }
13134 }
13135 }
13136
13137 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
13138 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13139 where
13140 D: serde::Deserializer<'de>,
13141 {
13142 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
13143 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
13144 ))
13145 }
13146 }
13147}
13148
13149#[derive(Clone, Default, PartialEq)]
13151#[non_exhaustive]
13152pub struct OperationError {
13153 pub kind: std::string::String,
13155
13156 pub code: std::string::String,
13158
13159 pub message: std::string::String,
13161
13162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13163}
13164
13165impl OperationError {
13166 pub fn new() -> Self {
13167 std::default::Default::default()
13168 }
13169
13170 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13172 self.kind = v.into();
13173 self
13174 }
13175
13176 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13178 self.code = v.into();
13179 self
13180 }
13181
13182 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13184 self.message = v.into();
13185 self
13186 }
13187}
13188
13189impl wkt::message::Message for OperationError {
13190 fn typename() -> &'static str {
13191 "type.googleapis.com/google.cloud.sql.v1.OperationError"
13192 }
13193}
13194
13195#[derive(Clone, Default, PartialEq)]
13197#[non_exhaustive]
13198pub struct OperationErrors {
13199 pub kind: std::string::String,
13201
13202 pub errors: std::vec::Vec<crate::model::OperationError>,
13204
13205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13206}
13207
13208impl OperationErrors {
13209 pub fn new() -> Self {
13210 std::default::Default::default()
13211 }
13212
13213 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13215 self.kind = v.into();
13216 self
13217 }
13218
13219 pub fn set_errors<T, V>(mut self, v: T) -> Self
13221 where
13222 T: std::iter::IntoIterator<Item = V>,
13223 V: std::convert::Into<crate::model::OperationError>,
13224 {
13225 use std::iter::Iterator;
13226 self.errors = v.into_iter().map(|i| i.into()).collect();
13227 self
13228 }
13229}
13230
13231impl wkt::message::Message for OperationErrors {
13232 fn typename() -> &'static str {
13233 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
13234 }
13235}
13236
13237#[derive(Clone, Default, PartialEq)]
13239#[non_exhaustive]
13240pub struct PasswordValidationPolicy {
13241 pub min_length: std::option::Option<wkt::Int32Value>,
13243
13244 pub complexity: crate::model::password_validation_policy::Complexity,
13246
13247 pub reuse_interval: std::option::Option<wkt::Int32Value>,
13249
13250 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
13252
13253 pub password_change_interval: std::option::Option<wkt::Duration>,
13256
13257 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
13259
13260 #[deprecated]
13263 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
13264
13265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13266}
13267
13268impl PasswordValidationPolicy {
13269 pub fn new() -> Self {
13270 std::default::Default::default()
13271 }
13272
13273 pub fn set_min_length<T>(mut self, v: T) -> Self
13275 where
13276 T: std::convert::Into<wkt::Int32Value>,
13277 {
13278 self.min_length = std::option::Option::Some(v.into());
13279 self
13280 }
13281
13282 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
13284 where
13285 T: std::convert::Into<wkt::Int32Value>,
13286 {
13287 self.min_length = v.map(|x| x.into());
13288 self
13289 }
13290
13291 pub fn set_complexity<
13293 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
13294 >(
13295 mut self,
13296 v: T,
13297 ) -> Self {
13298 self.complexity = v.into();
13299 self
13300 }
13301
13302 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
13304 where
13305 T: std::convert::Into<wkt::Int32Value>,
13306 {
13307 self.reuse_interval = std::option::Option::Some(v.into());
13308 self
13309 }
13310
13311 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
13313 where
13314 T: std::convert::Into<wkt::Int32Value>,
13315 {
13316 self.reuse_interval = v.map(|x| x.into());
13317 self
13318 }
13319
13320 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
13322 where
13323 T: std::convert::Into<wkt::BoolValue>,
13324 {
13325 self.disallow_username_substring = std::option::Option::Some(v.into());
13326 self
13327 }
13328
13329 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
13331 where
13332 T: std::convert::Into<wkt::BoolValue>,
13333 {
13334 self.disallow_username_substring = v.map(|x| x.into());
13335 self
13336 }
13337
13338 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
13340 where
13341 T: std::convert::Into<wkt::Duration>,
13342 {
13343 self.password_change_interval = std::option::Option::Some(v.into());
13344 self
13345 }
13346
13347 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
13349 where
13350 T: std::convert::Into<wkt::Duration>,
13351 {
13352 self.password_change_interval = v.map(|x| x.into());
13353 self
13354 }
13355
13356 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
13358 where
13359 T: std::convert::Into<wkt::BoolValue>,
13360 {
13361 self.enable_password_policy = std::option::Option::Some(v.into());
13362 self
13363 }
13364
13365 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
13367 where
13368 T: std::convert::Into<wkt::BoolValue>,
13369 {
13370 self.enable_password_policy = v.map(|x| x.into());
13371 self
13372 }
13373
13374 #[deprecated]
13376 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
13377 where
13378 T: std::convert::Into<wkt::BoolValue>,
13379 {
13380 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
13381 self
13382 }
13383
13384 #[deprecated]
13386 pub fn set_or_clear_disallow_compromised_credentials<T>(
13387 mut self,
13388 v: std::option::Option<T>,
13389 ) -> Self
13390 where
13391 T: std::convert::Into<wkt::BoolValue>,
13392 {
13393 self.disallow_compromised_credentials = v.map(|x| x.into());
13394 self
13395 }
13396}
13397
13398impl wkt::message::Message for PasswordValidationPolicy {
13399 fn typename() -> &'static str {
13400 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
13401 }
13402}
13403
13404pub mod password_validation_policy {
13406 #[allow(unused_imports)]
13407 use super::*;
13408
13409 #[derive(Clone, Debug, PartialEq)]
13425 #[non_exhaustive]
13426 pub enum Complexity {
13427 Unspecified,
13429 Default,
13432 UnknownValue(complexity::UnknownValue),
13437 }
13438
13439 #[doc(hidden)]
13440 pub mod complexity {
13441 #[allow(unused_imports)]
13442 use super::*;
13443 #[derive(Clone, Debug, PartialEq)]
13444 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13445 }
13446
13447 impl Complexity {
13448 pub fn value(&self) -> std::option::Option<i32> {
13453 match self {
13454 Self::Unspecified => std::option::Option::Some(0),
13455 Self::Default => std::option::Option::Some(1),
13456 Self::UnknownValue(u) => u.0.value(),
13457 }
13458 }
13459
13460 pub fn name(&self) -> std::option::Option<&str> {
13465 match self {
13466 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
13467 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
13468 Self::UnknownValue(u) => u.0.name(),
13469 }
13470 }
13471 }
13472
13473 impl std::default::Default for Complexity {
13474 fn default() -> Self {
13475 use std::convert::From;
13476 Self::from(0)
13477 }
13478 }
13479
13480 impl std::fmt::Display for Complexity {
13481 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13482 wkt::internal::display_enum(f, self.name(), self.value())
13483 }
13484 }
13485
13486 impl std::convert::From<i32> for Complexity {
13487 fn from(value: i32) -> Self {
13488 match value {
13489 0 => Self::Unspecified,
13490 1 => Self::Default,
13491 _ => Self::UnknownValue(complexity::UnknownValue(
13492 wkt::internal::UnknownEnumValue::Integer(value),
13493 )),
13494 }
13495 }
13496 }
13497
13498 impl std::convert::From<&str> for Complexity {
13499 fn from(value: &str) -> Self {
13500 use std::string::ToString;
13501 match value {
13502 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
13503 "COMPLEXITY_DEFAULT" => Self::Default,
13504 _ => Self::UnknownValue(complexity::UnknownValue(
13505 wkt::internal::UnknownEnumValue::String(value.to_string()),
13506 )),
13507 }
13508 }
13509 }
13510
13511 impl serde::ser::Serialize for Complexity {
13512 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13513 where
13514 S: serde::Serializer,
13515 {
13516 match self {
13517 Self::Unspecified => serializer.serialize_i32(0),
13518 Self::Default => serializer.serialize_i32(1),
13519 Self::UnknownValue(u) => u.0.serialize(serializer),
13520 }
13521 }
13522 }
13523
13524 impl<'de> serde::de::Deserialize<'de> for Complexity {
13525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13526 where
13527 D: serde::Deserializer<'de>,
13528 {
13529 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
13530 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
13531 ))
13532 }
13533 }
13534}
13535
13536#[derive(Clone, Default, PartialEq)]
13538#[non_exhaustive]
13539pub struct DataCacheConfig {
13540 pub data_cache_enabled: bool,
13542
13543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13544}
13545
13546impl DataCacheConfig {
13547 pub fn new() -> Self {
13548 std::default::Default::default()
13549 }
13550
13551 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13553 self.data_cache_enabled = v.into();
13554 self
13555 }
13556}
13557
13558impl wkt::message::Message for DataCacheConfig {
13559 fn typename() -> &'static str {
13560 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
13561 }
13562}
13563
13564#[derive(Clone, Default, PartialEq)]
13566#[non_exhaustive]
13567pub struct Settings {
13568 pub settings_version: std::option::Option<wkt::Int64Value>,
13573
13574 #[deprecated]
13577 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
13578
13579 pub tier: std::string::String,
13582
13583 pub kind: std::string::String,
13585
13586 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
13589
13590 pub availability_type: crate::model::SqlAvailabilityType,
13600
13601 pub pricing_plan: crate::model::SqlPricingPlan,
13604
13605 #[deprecated]
13609 pub replication_type: crate::model::SqlReplicationType,
13610
13611 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
13614
13615 pub activation_policy: crate::model::settings::SqlActivationPolicy,
13623
13624 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
13628
13629 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
13632
13633 pub location_preference: std::option::Option<crate::model::LocationPreference>,
13638
13639 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
13641
13642 pub data_disk_type: crate::model::SqlDataDiskType,
13645
13646 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
13649
13650 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
13652
13653 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
13657
13658 #[deprecated]
13662 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
13663
13664 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
13666
13667 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
13669
13670 pub collation: std::string::String,
13672
13673 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
13675
13676 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
13678
13679 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
13681
13682 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
13684
13685 pub edition: crate::model::settings::Edition,
13687
13688 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
13699
13700 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
13702
13703 pub time_zone: std::string::String,
13705
13706 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
13709
13710 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
13712
13713 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
13718
13719 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
13723
13724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13725}
13726
13727impl Settings {
13728 pub fn new() -> Self {
13729 std::default::Default::default()
13730 }
13731
13732 pub fn set_settings_version<T>(mut self, v: T) -> Self
13734 where
13735 T: std::convert::Into<wkt::Int64Value>,
13736 {
13737 self.settings_version = std::option::Option::Some(v.into());
13738 self
13739 }
13740
13741 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
13743 where
13744 T: std::convert::Into<wkt::Int64Value>,
13745 {
13746 self.settings_version = v.map(|x| x.into());
13747 self
13748 }
13749
13750 #[deprecated]
13752 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
13753 where
13754 T: std::iter::IntoIterator<Item = V>,
13755 V: std::convert::Into<std::string::String>,
13756 {
13757 use std::iter::Iterator;
13758 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
13759 self
13760 }
13761
13762 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13764 self.tier = v.into();
13765 self
13766 }
13767
13768 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13770 self.kind = v.into();
13771 self
13772 }
13773
13774 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
13776 where
13777 T: std::iter::IntoIterator<Item = (K, V)>,
13778 K: std::convert::Into<std::string::String>,
13779 V: std::convert::Into<std::string::String>,
13780 {
13781 use std::iter::Iterator;
13782 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13783 self
13784 }
13785
13786 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
13788 mut self,
13789 v: T,
13790 ) -> Self {
13791 self.availability_type = v.into();
13792 self
13793 }
13794
13795 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
13797 mut self,
13798 v: T,
13799 ) -> Self {
13800 self.pricing_plan = v.into();
13801 self
13802 }
13803
13804 #[deprecated]
13806 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
13807 mut self,
13808 v: T,
13809 ) -> Self {
13810 self.replication_type = v.into();
13811 self
13812 }
13813
13814 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
13816 where
13817 T: std::convert::Into<wkt::Int64Value>,
13818 {
13819 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
13820 self
13821 }
13822
13823 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
13825 where
13826 T: std::convert::Into<wkt::Int64Value>,
13827 {
13828 self.storage_auto_resize_limit = v.map(|x| x.into());
13829 self
13830 }
13831
13832 pub fn set_activation_policy<
13834 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
13835 >(
13836 mut self,
13837 v: T,
13838 ) -> Self {
13839 self.activation_policy = v.into();
13840 self
13841 }
13842
13843 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
13845 where
13846 T: std::convert::Into<crate::model::IpConfiguration>,
13847 {
13848 self.ip_configuration = std::option::Option::Some(v.into());
13849 self
13850 }
13851
13852 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13854 where
13855 T: std::convert::Into<crate::model::IpConfiguration>,
13856 {
13857 self.ip_configuration = v.map(|x| x.into());
13858 self
13859 }
13860
13861 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
13863 where
13864 T: std::convert::Into<wkt::BoolValue>,
13865 {
13866 self.storage_auto_resize = std::option::Option::Some(v.into());
13867 self
13868 }
13869
13870 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
13872 where
13873 T: std::convert::Into<wkt::BoolValue>,
13874 {
13875 self.storage_auto_resize = v.map(|x| x.into());
13876 self
13877 }
13878
13879 pub fn set_location_preference<T>(mut self, v: T) -> Self
13881 where
13882 T: std::convert::Into<crate::model::LocationPreference>,
13883 {
13884 self.location_preference = std::option::Option::Some(v.into());
13885 self
13886 }
13887
13888 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
13890 where
13891 T: std::convert::Into<crate::model::LocationPreference>,
13892 {
13893 self.location_preference = v.map(|x| x.into());
13894 self
13895 }
13896
13897 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
13899 where
13900 T: std::iter::IntoIterator<Item = V>,
13901 V: std::convert::Into<crate::model::DatabaseFlags>,
13902 {
13903 use std::iter::Iterator;
13904 self.database_flags = v.into_iter().map(|i| i.into()).collect();
13905 self
13906 }
13907
13908 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
13910 mut self,
13911 v: T,
13912 ) -> Self {
13913 self.data_disk_type = v.into();
13914 self
13915 }
13916
13917 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
13919 where
13920 T: std::convert::Into<crate::model::MaintenanceWindow>,
13921 {
13922 self.maintenance_window = std::option::Option::Some(v.into());
13923 self
13924 }
13925
13926 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
13928 where
13929 T: std::convert::Into<crate::model::MaintenanceWindow>,
13930 {
13931 self.maintenance_window = v.map(|x| x.into());
13932 self
13933 }
13934
13935 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
13937 where
13938 T: std::convert::Into<crate::model::BackupConfiguration>,
13939 {
13940 self.backup_configuration = std::option::Option::Some(v.into());
13941 self
13942 }
13943
13944 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13946 where
13947 T: std::convert::Into<crate::model::BackupConfiguration>,
13948 {
13949 self.backup_configuration = v.map(|x| x.into());
13950 self
13951 }
13952
13953 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
13955 where
13956 T: std::convert::Into<wkt::BoolValue>,
13957 {
13958 self.database_replication_enabled = std::option::Option::Some(v.into());
13959 self
13960 }
13961
13962 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13964 where
13965 T: std::convert::Into<wkt::BoolValue>,
13966 {
13967 self.database_replication_enabled = v.map(|x| x.into());
13968 self
13969 }
13970
13971 #[deprecated]
13973 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
13974 where
13975 T: std::convert::Into<wkt::BoolValue>,
13976 {
13977 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
13978 self
13979 }
13980
13981 #[deprecated]
13983 pub fn set_or_clear_crash_safe_replication_enabled<T>(
13984 mut self,
13985 v: std::option::Option<T>,
13986 ) -> Self
13987 where
13988 T: std::convert::Into<wkt::BoolValue>,
13989 {
13990 self.crash_safe_replication_enabled = v.map(|x| x.into());
13991 self
13992 }
13993
13994 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
13996 where
13997 T: std::convert::Into<wkt::Int64Value>,
13998 {
13999 self.data_disk_size_gb = std::option::Option::Some(v.into());
14000 self
14001 }
14002
14003 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
14005 where
14006 T: std::convert::Into<wkt::Int64Value>,
14007 {
14008 self.data_disk_size_gb = v.map(|x| x.into());
14009 self
14010 }
14011
14012 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
14014 where
14015 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
14016 {
14017 self.active_directory_config = std::option::Option::Some(v.into());
14018 self
14019 }
14020
14021 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
14023 where
14024 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
14025 {
14026 self.active_directory_config = v.map(|x| x.into());
14027 self
14028 }
14029
14030 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14032 self.collation = v.into();
14033 self
14034 }
14035
14036 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
14038 where
14039 T: std::iter::IntoIterator<Item = V>,
14040 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
14041 {
14042 use std::iter::Iterator;
14043 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
14044 self
14045 }
14046
14047 pub fn set_insights_config<T>(mut self, v: T) -> Self
14049 where
14050 T: std::convert::Into<crate::model::InsightsConfig>,
14051 {
14052 self.insights_config = std::option::Option::Some(v.into());
14053 self
14054 }
14055
14056 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
14058 where
14059 T: std::convert::Into<crate::model::InsightsConfig>,
14060 {
14061 self.insights_config = v.map(|x| x.into());
14062 self
14063 }
14064
14065 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
14067 where
14068 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
14069 {
14070 self.password_validation_policy = std::option::Option::Some(v.into());
14071 self
14072 }
14073
14074 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
14076 where
14077 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
14078 {
14079 self.password_validation_policy = v.map(|x| x.into());
14080 self
14081 }
14082
14083 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
14085 where
14086 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
14087 {
14088 self.sql_server_audit_config = std::option::Option::Some(v.into());
14089 self
14090 }
14091
14092 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
14094 where
14095 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
14096 {
14097 self.sql_server_audit_config = v.map(|x| x.into());
14098 self
14099 }
14100
14101 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
14103 mut self,
14104 v: T,
14105 ) -> Self {
14106 self.edition = v.into();
14107 self
14108 }
14109
14110 pub fn set_connector_enforcement<
14112 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
14113 >(
14114 mut self,
14115 v: T,
14116 ) -> Self {
14117 self.connector_enforcement = v.into();
14118 self
14119 }
14120
14121 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
14123 where
14124 T: std::convert::Into<wkt::BoolValue>,
14125 {
14126 self.deletion_protection_enabled = std::option::Option::Some(v.into());
14127 self
14128 }
14129
14130 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14132 where
14133 T: std::convert::Into<wkt::BoolValue>,
14134 {
14135 self.deletion_protection_enabled = v.map(|x| x.into());
14136 self
14137 }
14138
14139 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14141 self.time_zone = v.into();
14142 self
14143 }
14144
14145 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
14147 where
14148 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
14149 {
14150 self.advanced_machine_features = std::option::Option::Some(v.into());
14151 self
14152 }
14153
14154 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
14156 where
14157 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
14158 {
14159 self.advanced_machine_features = v.map(|x| x.into());
14160 self
14161 }
14162
14163 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
14165 where
14166 T: std::convert::Into<crate::model::DataCacheConfig>,
14167 {
14168 self.data_cache_config = std::option::Option::Some(v.into());
14169 self
14170 }
14171
14172 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
14174 where
14175 T: std::convert::Into<crate::model::DataCacheConfig>,
14176 {
14177 self.data_cache_config = v.map(|x| x.into());
14178 self
14179 }
14180
14181 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
14183 where
14184 T: std::convert::Into<wkt::BoolValue>,
14185 {
14186 self.enable_google_ml_integration = std::option::Option::Some(v.into());
14187 self
14188 }
14189
14190 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
14192 where
14193 T: std::convert::Into<wkt::BoolValue>,
14194 {
14195 self.enable_google_ml_integration = v.map(|x| x.into());
14196 self
14197 }
14198
14199 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
14201 where
14202 T: std::convert::Into<wkt::BoolValue>,
14203 {
14204 self.enable_dataplex_integration = std::option::Option::Some(v.into());
14205 self
14206 }
14207
14208 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
14210 where
14211 T: std::convert::Into<wkt::BoolValue>,
14212 {
14213 self.enable_dataplex_integration = v.map(|x| x.into());
14214 self
14215 }
14216}
14217
14218impl wkt::message::Message for Settings {
14219 fn typename() -> &'static str {
14220 "type.googleapis.com/google.cloud.sql.v1.Settings"
14221 }
14222}
14223
14224pub mod settings {
14226 #[allow(unused_imports)]
14227 use super::*;
14228
14229 #[derive(Clone, Debug, PartialEq)]
14245 #[non_exhaustive]
14246 pub enum SqlActivationPolicy {
14247 Unspecified,
14249 Always,
14251 Never,
14253 #[deprecated]
14255 OnDemand,
14256 UnknownValue(sql_activation_policy::UnknownValue),
14261 }
14262
14263 #[doc(hidden)]
14264 pub mod sql_activation_policy {
14265 #[allow(unused_imports)]
14266 use super::*;
14267 #[derive(Clone, Debug, PartialEq)]
14268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14269 }
14270
14271 impl SqlActivationPolicy {
14272 pub fn value(&self) -> std::option::Option<i32> {
14277 match self {
14278 Self::Unspecified => std::option::Option::Some(0),
14279 Self::Always => std::option::Option::Some(1),
14280 Self::Never => std::option::Option::Some(2),
14281 Self::OnDemand => std::option::Option::Some(3),
14282 Self::UnknownValue(u) => u.0.value(),
14283 }
14284 }
14285
14286 pub fn name(&self) -> std::option::Option<&str> {
14291 match self {
14292 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
14293 Self::Always => std::option::Option::Some("ALWAYS"),
14294 Self::Never => std::option::Option::Some("NEVER"),
14295 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
14296 Self::UnknownValue(u) => u.0.name(),
14297 }
14298 }
14299 }
14300
14301 impl std::default::Default for SqlActivationPolicy {
14302 fn default() -> Self {
14303 use std::convert::From;
14304 Self::from(0)
14305 }
14306 }
14307
14308 impl std::fmt::Display for SqlActivationPolicy {
14309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14310 wkt::internal::display_enum(f, self.name(), self.value())
14311 }
14312 }
14313
14314 impl std::convert::From<i32> for SqlActivationPolicy {
14315 fn from(value: i32) -> Self {
14316 match value {
14317 0 => Self::Unspecified,
14318 1 => Self::Always,
14319 2 => Self::Never,
14320 3 => Self::OnDemand,
14321 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
14322 wkt::internal::UnknownEnumValue::Integer(value),
14323 )),
14324 }
14325 }
14326 }
14327
14328 impl std::convert::From<&str> for SqlActivationPolicy {
14329 fn from(value: &str) -> Self {
14330 use std::string::ToString;
14331 match value {
14332 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
14333 "ALWAYS" => Self::Always,
14334 "NEVER" => Self::Never,
14335 "ON_DEMAND" => Self::OnDemand,
14336 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
14337 wkt::internal::UnknownEnumValue::String(value.to_string()),
14338 )),
14339 }
14340 }
14341 }
14342
14343 impl serde::ser::Serialize for SqlActivationPolicy {
14344 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14345 where
14346 S: serde::Serializer,
14347 {
14348 match self {
14349 Self::Unspecified => serializer.serialize_i32(0),
14350 Self::Always => serializer.serialize_i32(1),
14351 Self::Never => serializer.serialize_i32(2),
14352 Self::OnDemand => serializer.serialize_i32(3),
14353 Self::UnknownValue(u) => u.0.serialize(serializer),
14354 }
14355 }
14356 }
14357
14358 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
14359 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14360 where
14361 D: serde::Deserializer<'de>,
14362 {
14363 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
14364 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
14365 ))
14366 }
14367 }
14368
14369 #[derive(Clone, Debug, PartialEq)]
14385 #[non_exhaustive]
14386 pub enum Edition {
14387 Unspecified,
14389 Enterprise,
14391 EnterprisePlus,
14393 UnknownValue(edition::UnknownValue),
14398 }
14399
14400 #[doc(hidden)]
14401 pub mod edition {
14402 #[allow(unused_imports)]
14403 use super::*;
14404 #[derive(Clone, Debug, PartialEq)]
14405 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14406 }
14407
14408 impl Edition {
14409 pub fn value(&self) -> std::option::Option<i32> {
14414 match self {
14415 Self::Unspecified => std::option::Option::Some(0),
14416 Self::Enterprise => std::option::Option::Some(2),
14417 Self::EnterprisePlus => std::option::Option::Some(3),
14418 Self::UnknownValue(u) => u.0.value(),
14419 }
14420 }
14421
14422 pub fn name(&self) -> std::option::Option<&str> {
14427 match self {
14428 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
14429 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
14430 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
14431 Self::UnknownValue(u) => u.0.name(),
14432 }
14433 }
14434 }
14435
14436 impl std::default::Default for Edition {
14437 fn default() -> Self {
14438 use std::convert::From;
14439 Self::from(0)
14440 }
14441 }
14442
14443 impl std::fmt::Display for Edition {
14444 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14445 wkt::internal::display_enum(f, self.name(), self.value())
14446 }
14447 }
14448
14449 impl std::convert::From<i32> for Edition {
14450 fn from(value: i32) -> Self {
14451 match value {
14452 0 => Self::Unspecified,
14453 2 => Self::Enterprise,
14454 3 => Self::EnterprisePlus,
14455 _ => Self::UnknownValue(edition::UnknownValue(
14456 wkt::internal::UnknownEnumValue::Integer(value),
14457 )),
14458 }
14459 }
14460 }
14461
14462 impl std::convert::From<&str> for Edition {
14463 fn from(value: &str) -> Self {
14464 use std::string::ToString;
14465 match value {
14466 "EDITION_UNSPECIFIED" => Self::Unspecified,
14467 "ENTERPRISE" => Self::Enterprise,
14468 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
14469 _ => Self::UnknownValue(edition::UnknownValue(
14470 wkt::internal::UnknownEnumValue::String(value.to_string()),
14471 )),
14472 }
14473 }
14474 }
14475
14476 impl serde::ser::Serialize for Edition {
14477 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14478 where
14479 S: serde::Serializer,
14480 {
14481 match self {
14482 Self::Unspecified => serializer.serialize_i32(0),
14483 Self::Enterprise => serializer.serialize_i32(2),
14484 Self::EnterprisePlus => serializer.serialize_i32(3),
14485 Self::UnknownValue(u) => u.0.serialize(serializer),
14486 }
14487 }
14488 }
14489
14490 impl<'de> serde::de::Deserialize<'de> for Edition {
14491 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14492 where
14493 D: serde::Deserializer<'de>,
14494 {
14495 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
14496 ".google.cloud.sql.v1.Settings.Edition",
14497 ))
14498 }
14499 }
14500
14501 #[derive(Clone, Debug, PartialEq)]
14517 #[non_exhaustive]
14518 pub enum ConnectorEnforcement {
14519 Unspecified,
14521 NotRequired,
14523 Required,
14527 UnknownValue(connector_enforcement::UnknownValue),
14532 }
14533
14534 #[doc(hidden)]
14535 pub mod connector_enforcement {
14536 #[allow(unused_imports)]
14537 use super::*;
14538 #[derive(Clone, Debug, PartialEq)]
14539 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14540 }
14541
14542 impl ConnectorEnforcement {
14543 pub fn value(&self) -> std::option::Option<i32> {
14548 match self {
14549 Self::Unspecified => std::option::Option::Some(0),
14550 Self::NotRequired => std::option::Option::Some(1),
14551 Self::Required => std::option::Option::Some(2),
14552 Self::UnknownValue(u) => u.0.value(),
14553 }
14554 }
14555
14556 pub fn name(&self) -> std::option::Option<&str> {
14561 match self {
14562 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
14563 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
14564 Self::Required => std::option::Option::Some("REQUIRED"),
14565 Self::UnknownValue(u) => u.0.name(),
14566 }
14567 }
14568 }
14569
14570 impl std::default::Default for ConnectorEnforcement {
14571 fn default() -> Self {
14572 use std::convert::From;
14573 Self::from(0)
14574 }
14575 }
14576
14577 impl std::fmt::Display for ConnectorEnforcement {
14578 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14579 wkt::internal::display_enum(f, self.name(), self.value())
14580 }
14581 }
14582
14583 impl std::convert::From<i32> for ConnectorEnforcement {
14584 fn from(value: i32) -> Self {
14585 match value {
14586 0 => Self::Unspecified,
14587 1 => Self::NotRequired,
14588 2 => Self::Required,
14589 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14590 wkt::internal::UnknownEnumValue::Integer(value),
14591 )),
14592 }
14593 }
14594 }
14595
14596 impl std::convert::From<&str> for ConnectorEnforcement {
14597 fn from(value: &str) -> Self {
14598 use std::string::ToString;
14599 match value {
14600 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
14601 "NOT_REQUIRED" => Self::NotRequired,
14602 "REQUIRED" => Self::Required,
14603 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
14604 wkt::internal::UnknownEnumValue::String(value.to_string()),
14605 )),
14606 }
14607 }
14608 }
14609
14610 impl serde::ser::Serialize for ConnectorEnforcement {
14611 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14612 where
14613 S: serde::Serializer,
14614 {
14615 match self {
14616 Self::Unspecified => serializer.serialize_i32(0),
14617 Self::NotRequired => serializer.serialize_i32(1),
14618 Self::Required => serializer.serialize_i32(2),
14619 Self::UnknownValue(u) => u.0.serialize(serializer),
14620 }
14621 }
14622 }
14623
14624 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
14625 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14626 where
14627 D: serde::Deserializer<'de>,
14628 {
14629 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
14630 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
14631 ))
14632 }
14633 }
14634}
14635
14636#[derive(Clone, Default, PartialEq)]
14638#[non_exhaustive]
14639pub struct AdvancedMachineFeatures {
14640 pub threads_per_core: i32,
14642
14643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14644}
14645
14646impl AdvancedMachineFeatures {
14647 pub fn new() -> Self {
14648 std::default::Default::default()
14649 }
14650
14651 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14653 self.threads_per_core = v.into();
14654 self
14655 }
14656}
14657
14658impl wkt::message::Message for AdvancedMachineFeatures {
14659 fn typename() -> &'static str {
14660 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
14661 }
14662}
14663
14664#[derive(Clone, Default, PartialEq)]
14666#[non_exhaustive]
14667pub struct SslCert {
14668 pub kind: std::string::String,
14670
14671 pub cert_serial_number: std::string::String,
14673
14674 pub cert: std::string::String,
14676
14677 pub create_time: std::option::Option<wkt::Timestamp>,
14681
14682 pub common_name: std::string::String,
14684
14685 pub expiration_time: std::option::Option<wkt::Timestamp>,
14689
14690 pub sha1_fingerprint: std::string::String,
14692
14693 pub instance: std::string::String,
14695
14696 pub self_link: std::string::String,
14698
14699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14700}
14701
14702impl SslCert {
14703 pub fn new() -> Self {
14704 std::default::Default::default()
14705 }
14706
14707 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14709 self.kind = v.into();
14710 self
14711 }
14712
14713 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
14715 mut self,
14716 v: T,
14717 ) -> Self {
14718 self.cert_serial_number = v.into();
14719 self
14720 }
14721
14722 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14724 self.cert = v.into();
14725 self
14726 }
14727
14728 pub fn set_create_time<T>(mut self, v: T) -> Self
14730 where
14731 T: std::convert::Into<wkt::Timestamp>,
14732 {
14733 self.create_time = std::option::Option::Some(v.into());
14734 self
14735 }
14736
14737 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14739 where
14740 T: std::convert::Into<wkt::Timestamp>,
14741 {
14742 self.create_time = v.map(|x| x.into());
14743 self
14744 }
14745
14746 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14748 self.common_name = v.into();
14749 self
14750 }
14751
14752 pub fn set_expiration_time<T>(mut self, v: T) -> Self
14754 where
14755 T: std::convert::Into<wkt::Timestamp>,
14756 {
14757 self.expiration_time = std::option::Option::Some(v.into());
14758 self
14759 }
14760
14761 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
14763 where
14764 T: std::convert::Into<wkt::Timestamp>,
14765 {
14766 self.expiration_time = v.map(|x| x.into());
14767 self
14768 }
14769
14770 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
14772 mut self,
14773 v: T,
14774 ) -> Self {
14775 self.sha1_fingerprint = v.into();
14776 self
14777 }
14778
14779 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14781 self.instance = v.into();
14782 self
14783 }
14784
14785 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14787 self.self_link = v.into();
14788 self
14789 }
14790}
14791
14792impl wkt::message::Message for SslCert {
14793 fn typename() -> &'static str {
14794 "type.googleapis.com/google.cloud.sql.v1.SslCert"
14795 }
14796}
14797
14798#[derive(Clone, Default, PartialEq)]
14800#[non_exhaustive]
14801pub struct SslCertDetail {
14802 pub cert_info: std::option::Option<crate::model::SslCert>,
14804
14805 pub cert_private_key: std::string::String,
14808
14809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14810}
14811
14812impl SslCertDetail {
14813 pub fn new() -> Self {
14814 std::default::Default::default()
14815 }
14816
14817 pub fn set_cert_info<T>(mut self, v: T) -> Self
14819 where
14820 T: std::convert::Into<crate::model::SslCert>,
14821 {
14822 self.cert_info = std::option::Option::Some(v.into());
14823 self
14824 }
14825
14826 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
14828 where
14829 T: std::convert::Into<crate::model::SslCert>,
14830 {
14831 self.cert_info = v.map(|x| x.into());
14832 self
14833 }
14834
14835 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
14837 mut self,
14838 v: T,
14839 ) -> Self {
14840 self.cert_private_key = v.into();
14841 self
14842 }
14843}
14844
14845impl wkt::message::Message for SslCertDetail {
14846 fn typename() -> &'static str {
14847 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
14848 }
14849}
14850
14851#[derive(Clone, Default, PartialEq)]
14853#[non_exhaustive]
14854pub struct SqlActiveDirectoryConfig {
14855 pub kind: std::string::String,
14857
14858 pub domain: std::string::String,
14860
14861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14862}
14863
14864impl SqlActiveDirectoryConfig {
14865 pub fn new() -> Self {
14866 std::default::Default::default()
14867 }
14868
14869 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14871 self.kind = v.into();
14872 self
14873 }
14874
14875 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14877 self.domain = v.into();
14878 self
14879 }
14880}
14881
14882impl wkt::message::Message for SqlActiveDirectoryConfig {
14883 fn typename() -> &'static str {
14884 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
14885 }
14886}
14887
14888#[derive(Clone, Default, PartialEq)]
14890#[non_exhaustive]
14891pub struct SqlServerAuditConfig {
14892 pub kind: std::string::String,
14894
14895 pub bucket: std::string::String,
14897
14898 pub retention_interval: std::option::Option<wkt::Duration>,
14900
14901 pub upload_interval: std::option::Option<wkt::Duration>,
14903
14904 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14905}
14906
14907impl SqlServerAuditConfig {
14908 pub fn new() -> Self {
14909 std::default::Default::default()
14910 }
14911
14912 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14914 self.kind = v.into();
14915 self
14916 }
14917
14918 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14920 self.bucket = v.into();
14921 self
14922 }
14923
14924 pub fn set_retention_interval<T>(mut self, v: T) -> Self
14926 where
14927 T: std::convert::Into<wkt::Duration>,
14928 {
14929 self.retention_interval = std::option::Option::Some(v.into());
14930 self
14931 }
14932
14933 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
14935 where
14936 T: std::convert::Into<wkt::Duration>,
14937 {
14938 self.retention_interval = v.map(|x| x.into());
14939 self
14940 }
14941
14942 pub fn set_upload_interval<T>(mut self, v: T) -> Self
14944 where
14945 T: std::convert::Into<wkt::Duration>,
14946 {
14947 self.upload_interval = std::option::Option::Some(v.into());
14948 self
14949 }
14950
14951 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
14953 where
14954 T: std::convert::Into<wkt::Duration>,
14955 {
14956 self.upload_interval = v.map(|x| x.into());
14957 self
14958 }
14959}
14960
14961impl wkt::message::Message for SqlServerAuditConfig {
14962 fn typename() -> &'static str {
14963 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
14964 }
14965}
14966
14967#[derive(Clone, Default, PartialEq)]
14969#[non_exhaustive]
14970pub struct AcquireSsrsLeaseContext {
14971 pub setup_login: std::option::Option<std::string::String>,
14974
14975 pub service_login: std::option::Option<std::string::String>,
14978
14979 pub report_database: std::option::Option<std::string::String>,
14981
14982 pub duration: std::option::Option<wkt::Duration>,
14984
14985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14986}
14987
14988impl AcquireSsrsLeaseContext {
14989 pub fn new() -> Self {
14990 std::default::Default::default()
14991 }
14992
14993 pub fn set_setup_login<T>(mut self, v: T) -> Self
14995 where
14996 T: std::convert::Into<std::string::String>,
14997 {
14998 self.setup_login = std::option::Option::Some(v.into());
14999 self
15000 }
15001
15002 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
15004 where
15005 T: std::convert::Into<std::string::String>,
15006 {
15007 self.setup_login = v.map(|x| x.into());
15008 self
15009 }
15010
15011 pub fn set_service_login<T>(mut self, v: T) -> Self
15013 where
15014 T: std::convert::Into<std::string::String>,
15015 {
15016 self.service_login = std::option::Option::Some(v.into());
15017 self
15018 }
15019
15020 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
15022 where
15023 T: std::convert::Into<std::string::String>,
15024 {
15025 self.service_login = v.map(|x| x.into());
15026 self
15027 }
15028
15029 pub fn set_report_database<T>(mut self, v: T) -> Self
15031 where
15032 T: std::convert::Into<std::string::String>,
15033 {
15034 self.report_database = std::option::Option::Some(v.into());
15035 self
15036 }
15037
15038 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
15040 where
15041 T: std::convert::Into<std::string::String>,
15042 {
15043 self.report_database = v.map(|x| x.into());
15044 self
15045 }
15046
15047 pub fn set_duration<T>(mut self, v: T) -> Self
15049 where
15050 T: std::convert::Into<wkt::Duration>,
15051 {
15052 self.duration = std::option::Option::Some(v.into());
15053 self
15054 }
15055
15056 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
15058 where
15059 T: std::convert::Into<wkt::Duration>,
15060 {
15061 self.duration = v.map(|x| x.into());
15062 self
15063 }
15064}
15065
15066impl wkt::message::Message for AcquireSsrsLeaseContext {
15067 fn typename() -> &'static str {
15068 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
15069 }
15070}
15071
15072#[derive(Clone, Default, PartialEq)]
15073#[non_exhaustive]
15074pub struct SqlSslCertsDeleteRequest {
15075 pub instance: std::string::String,
15077
15078 pub project: std::string::String,
15080
15081 pub sha1_fingerprint: std::string::String,
15083
15084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15085}
15086
15087impl SqlSslCertsDeleteRequest {
15088 pub fn new() -> Self {
15089 std::default::Default::default()
15090 }
15091
15092 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15094 self.instance = v.into();
15095 self
15096 }
15097
15098 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15100 self.project = v.into();
15101 self
15102 }
15103
15104 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
15106 mut self,
15107 v: T,
15108 ) -> Self {
15109 self.sha1_fingerprint = v.into();
15110 self
15111 }
15112}
15113
15114impl wkt::message::Message for SqlSslCertsDeleteRequest {
15115 fn typename() -> &'static str {
15116 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
15117 }
15118}
15119
15120#[derive(Clone, Default, PartialEq)]
15121#[non_exhaustive]
15122pub struct SqlSslCertsGetRequest {
15123 pub instance: std::string::String,
15125
15126 pub project: std::string::String,
15128
15129 pub sha1_fingerprint: std::string::String,
15131
15132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15133}
15134
15135impl SqlSslCertsGetRequest {
15136 pub fn new() -> Self {
15137 std::default::Default::default()
15138 }
15139
15140 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15142 self.instance = v.into();
15143 self
15144 }
15145
15146 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15148 self.project = v.into();
15149 self
15150 }
15151
15152 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
15154 mut self,
15155 v: T,
15156 ) -> Self {
15157 self.sha1_fingerprint = v.into();
15158 self
15159 }
15160}
15161
15162impl wkt::message::Message for SqlSslCertsGetRequest {
15163 fn typename() -> &'static str {
15164 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
15165 }
15166}
15167
15168#[derive(Clone, Default, PartialEq)]
15169#[non_exhaustive]
15170pub struct SqlSslCertsInsertRequest {
15171 pub instance: std::string::String,
15173
15174 pub project: std::string::String,
15176
15177 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
15178
15179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15180}
15181
15182impl SqlSslCertsInsertRequest {
15183 pub fn new() -> Self {
15184 std::default::Default::default()
15185 }
15186
15187 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15189 self.instance = v.into();
15190 self
15191 }
15192
15193 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15195 self.project = v.into();
15196 self
15197 }
15198
15199 pub fn set_body<T>(mut self, v: T) -> Self
15201 where
15202 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
15203 {
15204 self.body = std::option::Option::Some(v.into());
15205 self
15206 }
15207
15208 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15210 where
15211 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
15212 {
15213 self.body = v.map(|x| x.into());
15214 self
15215 }
15216}
15217
15218impl wkt::message::Message for SqlSslCertsInsertRequest {
15219 fn typename() -> &'static str {
15220 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
15221 }
15222}
15223
15224#[derive(Clone, Default, PartialEq)]
15225#[non_exhaustive]
15226pub struct SqlSslCertsListRequest {
15227 pub instance: std::string::String,
15229
15230 pub project: std::string::String,
15232
15233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15234}
15235
15236impl SqlSslCertsListRequest {
15237 pub fn new() -> Self {
15238 std::default::Default::default()
15239 }
15240
15241 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15243 self.instance = v.into();
15244 self
15245 }
15246
15247 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15249 self.project = v.into();
15250 self
15251 }
15252}
15253
15254impl wkt::message::Message for SqlSslCertsListRequest {
15255 fn typename() -> &'static str {
15256 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
15257 }
15258}
15259
15260#[derive(Clone, Default, PartialEq)]
15262#[non_exhaustive]
15263pub struct SslCertsInsertRequest {
15264 pub common_name: std::string::String,
15267
15268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15269}
15270
15271impl SslCertsInsertRequest {
15272 pub fn new() -> Self {
15273 std::default::Default::default()
15274 }
15275
15276 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15278 self.common_name = v.into();
15279 self
15280 }
15281}
15282
15283impl wkt::message::Message for SslCertsInsertRequest {
15284 fn typename() -> &'static str {
15285 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
15286 }
15287}
15288
15289#[derive(Clone, Default, PartialEq)]
15291#[non_exhaustive]
15292pub struct SslCertsInsertResponse {
15293 pub kind: std::string::String,
15295
15296 pub operation: std::option::Option<crate::model::Operation>,
15298
15299 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
15303
15304 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
15306
15307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15308}
15309
15310impl SslCertsInsertResponse {
15311 pub fn new() -> Self {
15312 std::default::Default::default()
15313 }
15314
15315 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15317 self.kind = v.into();
15318 self
15319 }
15320
15321 pub fn set_operation<T>(mut self, v: T) -> Self
15323 where
15324 T: std::convert::Into<crate::model::Operation>,
15325 {
15326 self.operation = std::option::Option::Some(v.into());
15327 self
15328 }
15329
15330 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
15332 where
15333 T: std::convert::Into<crate::model::Operation>,
15334 {
15335 self.operation = v.map(|x| x.into());
15336 self
15337 }
15338
15339 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
15341 where
15342 T: std::convert::Into<crate::model::SslCert>,
15343 {
15344 self.server_ca_cert = std::option::Option::Some(v.into());
15345 self
15346 }
15347
15348 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
15350 where
15351 T: std::convert::Into<crate::model::SslCert>,
15352 {
15353 self.server_ca_cert = v.map(|x| x.into());
15354 self
15355 }
15356
15357 pub fn set_client_cert<T>(mut self, v: T) -> Self
15359 where
15360 T: std::convert::Into<crate::model::SslCertDetail>,
15361 {
15362 self.client_cert = std::option::Option::Some(v.into());
15363 self
15364 }
15365
15366 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
15368 where
15369 T: std::convert::Into<crate::model::SslCertDetail>,
15370 {
15371 self.client_cert = v.map(|x| x.into());
15372 self
15373 }
15374}
15375
15376impl wkt::message::Message for SslCertsInsertResponse {
15377 fn typename() -> &'static str {
15378 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
15379 }
15380}
15381
15382#[derive(Clone, Default, PartialEq)]
15384#[non_exhaustive]
15385pub struct SslCertsListResponse {
15386 pub kind: std::string::String,
15388
15389 pub items: std::vec::Vec<crate::model::SslCert>,
15391
15392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15393}
15394
15395impl SslCertsListResponse {
15396 pub fn new() -> Self {
15397 std::default::Default::default()
15398 }
15399
15400 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15402 self.kind = v.into();
15403 self
15404 }
15405
15406 pub fn set_items<T, V>(mut self, v: T) -> Self
15408 where
15409 T: std::iter::IntoIterator<Item = V>,
15410 V: std::convert::Into<crate::model::SslCert>,
15411 {
15412 use std::iter::Iterator;
15413 self.items = v.into_iter().map(|i| i.into()).collect();
15414 self
15415 }
15416}
15417
15418impl wkt::message::Message for SslCertsListResponse {
15419 fn typename() -> &'static str {
15420 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
15421 }
15422}
15423
15424#[derive(Clone, Default, PartialEq)]
15426#[non_exhaustive]
15427pub struct SqlTiersListRequest {
15428 pub project: std::string::String,
15430
15431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15432}
15433
15434impl SqlTiersListRequest {
15435 pub fn new() -> Self {
15436 std::default::Default::default()
15437 }
15438
15439 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15441 self.project = v.into();
15442 self
15443 }
15444}
15445
15446impl wkt::message::Message for SqlTiersListRequest {
15447 fn typename() -> &'static str {
15448 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
15449 }
15450}
15451
15452#[derive(Clone, Default, PartialEq)]
15454#[non_exhaustive]
15455pub struct TiersListResponse {
15456 pub kind: std::string::String,
15458
15459 pub items: std::vec::Vec<crate::model::Tier>,
15461
15462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15463}
15464
15465impl TiersListResponse {
15466 pub fn new() -> Self {
15467 std::default::Default::default()
15468 }
15469
15470 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15472 self.kind = v.into();
15473 self
15474 }
15475
15476 pub fn set_items<T, V>(mut self, v: T) -> Self
15478 where
15479 T: std::iter::IntoIterator<Item = V>,
15480 V: std::convert::Into<crate::model::Tier>,
15481 {
15482 use std::iter::Iterator;
15483 self.items = v.into_iter().map(|i| i.into()).collect();
15484 self
15485 }
15486}
15487
15488impl wkt::message::Message for TiersListResponse {
15489 fn typename() -> &'static str {
15490 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
15491 }
15492}
15493
15494#[derive(Clone, Default, PartialEq)]
15496#[non_exhaustive]
15497pub struct Tier {
15498 pub tier: std::string::String,
15501
15502 pub ram: i64,
15504
15505 pub kind: std::string::String,
15507
15508 pub disk_quota: i64,
15510
15511 pub region: std::vec::Vec<std::string::String>,
15513
15514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15515}
15516
15517impl Tier {
15518 pub fn new() -> Self {
15519 std::default::Default::default()
15520 }
15521
15522 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15524 self.tier = v.into();
15525 self
15526 }
15527
15528 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15530 self.ram = v.into();
15531 self
15532 }
15533
15534 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15536 self.kind = v.into();
15537 self
15538 }
15539
15540 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15542 self.disk_quota = v.into();
15543 self
15544 }
15545
15546 pub fn set_region<T, V>(mut self, v: T) -> Self
15548 where
15549 T: std::iter::IntoIterator<Item = V>,
15550 V: std::convert::Into<std::string::String>,
15551 {
15552 use std::iter::Iterator;
15553 self.region = v.into_iter().map(|i| i.into()).collect();
15554 self
15555 }
15556}
15557
15558impl wkt::message::Message for Tier {
15559 fn typename() -> &'static str {
15560 "type.googleapis.com/google.cloud.sql.v1.Tier"
15561 }
15562}
15563
15564#[derive(Clone, Default, PartialEq)]
15565#[non_exhaustive]
15566pub struct SqlUsersDeleteRequest {
15567 pub host: std::string::String,
15569
15570 pub instance: std::string::String,
15572
15573 pub name: std::string::String,
15575
15576 pub project: std::string::String,
15578
15579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15580}
15581
15582impl SqlUsersDeleteRequest {
15583 pub fn new() -> Self {
15584 std::default::Default::default()
15585 }
15586
15587 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15589 self.host = v.into();
15590 self
15591 }
15592
15593 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15595 self.instance = v.into();
15596 self
15597 }
15598
15599 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15601 self.name = v.into();
15602 self
15603 }
15604
15605 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15607 self.project = v.into();
15608 self
15609 }
15610}
15611
15612impl wkt::message::Message for SqlUsersDeleteRequest {
15613 fn typename() -> &'static str {
15614 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
15615 }
15616}
15617
15618#[derive(Clone, Default, PartialEq)]
15620#[non_exhaustive]
15621pub struct SqlUsersGetRequest {
15622 pub instance: std::string::String,
15624
15625 pub name: std::string::String,
15627
15628 pub project: std::string::String,
15630
15631 pub host: std::string::String,
15633
15634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15635}
15636
15637impl SqlUsersGetRequest {
15638 pub fn new() -> Self {
15639 std::default::Default::default()
15640 }
15641
15642 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15644 self.instance = v.into();
15645 self
15646 }
15647
15648 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15650 self.name = v.into();
15651 self
15652 }
15653
15654 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15656 self.project = v.into();
15657 self
15658 }
15659
15660 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15662 self.host = v.into();
15663 self
15664 }
15665}
15666
15667impl wkt::message::Message for SqlUsersGetRequest {
15668 fn typename() -> &'static str {
15669 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
15670 }
15671}
15672
15673#[derive(Clone, Default, PartialEq)]
15674#[non_exhaustive]
15675pub struct SqlUsersInsertRequest {
15676 pub instance: std::string::String,
15678
15679 pub project: std::string::String,
15681
15682 pub body: std::option::Option<crate::model::User>,
15683
15684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15685}
15686
15687impl SqlUsersInsertRequest {
15688 pub fn new() -> Self {
15689 std::default::Default::default()
15690 }
15691
15692 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15694 self.instance = v.into();
15695 self
15696 }
15697
15698 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15700 self.project = v.into();
15701 self
15702 }
15703
15704 pub fn set_body<T>(mut self, v: T) -> Self
15706 where
15707 T: std::convert::Into<crate::model::User>,
15708 {
15709 self.body = std::option::Option::Some(v.into());
15710 self
15711 }
15712
15713 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15715 where
15716 T: std::convert::Into<crate::model::User>,
15717 {
15718 self.body = v.map(|x| x.into());
15719 self
15720 }
15721}
15722
15723impl wkt::message::Message for SqlUsersInsertRequest {
15724 fn typename() -> &'static str {
15725 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
15726 }
15727}
15728
15729#[derive(Clone, Default, PartialEq)]
15730#[non_exhaustive]
15731pub struct SqlUsersListRequest {
15732 pub instance: std::string::String,
15734
15735 pub project: std::string::String,
15737
15738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15739}
15740
15741impl SqlUsersListRequest {
15742 pub fn new() -> Self {
15743 std::default::Default::default()
15744 }
15745
15746 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15748 self.instance = v.into();
15749 self
15750 }
15751
15752 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15754 self.project = v.into();
15755 self
15756 }
15757}
15758
15759impl wkt::message::Message for SqlUsersListRequest {
15760 fn typename() -> &'static str {
15761 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
15762 }
15763}
15764
15765#[derive(Clone, Default, PartialEq)]
15766#[non_exhaustive]
15767pub struct SqlUsersUpdateRequest {
15768 pub host: std::string::String,
15770
15771 pub instance: std::string::String,
15773
15774 pub name: std::string::String,
15776
15777 pub project: std::string::String,
15779
15780 pub body: std::option::Option<crate::model::User>,
15781
15782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15783}
15784
15785impl SqlUsersUpdateRequest {
15786 pub fn new() -> Self {
15787 std::default::Default::default()
15788 }
15789
15790 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15792 self.host = v.into();
15793 self
15794 }
15795
15796 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15798 self.instance = v.into();
15799 self
15800 }
15801
15802 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15804 self.name = v.into();
15805 self
15806 }
15807
15808 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15810 self.project = v.into();
15811 self
15812 }
15813
15814 pub fn set_body<T>(mut self, v: T) -> Self
15816 where
15817 T: std::convert::Into<crate::model::User>,
15818 {
15819 self.body = std::option::Option::Some(v.into());
15820 self
15821 }
15822
15823 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15825 where
15826 T: std::convert::Into<crate::model::User>,
15827 {
15828 self.body = v.map(|x| x.into());
15829 self
15830 }
15831}
15832
15833impl wkt::message::Message for SqlUsersUpdateRequest {
15834 fn typename() -> &'static str {
15835 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
15836 }
15837}
15838
15839#[derive(Clone, Default, PartialEq)]
15841#[non_exhaustive]
15842pub struct UserPasswordValidationPolicy {
15843 pub allowed_failed_attempts: i32,
15845
15846 pub password_expiration_duration: std::option::Option<wkt::Duration>,
15848
15849 pub enable_failed_attempts_check: bool,
15851
15852 pub status: std::option::Option<crate::model::PasswordStatus>,
15854
15855 pub enable_password_verification: bool,
15858
15859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15860}
15861
15862impl UserPasswordValidationPolicy {
15863 pub fn new() -> Self {
15864 std::default::Default::default()
15865 }
15866
15867 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15869 self.allowed_failed_attempts = v.into();
15870 self
15871 }
15872
15873 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
15875 where
15876 T: std::convert::Into<wkt::Duration>,
15877 {
15878 self.password_expiration_duration = std::option::Option::Some(v.into());
15879 self
15880 }
15881
15882 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
15884 where
15885 T: std::convert::Into<wkt::Duration>,
15886 {
15887 self.password_expiration_duration = v.map(|x| x.into());
15888 self
15889 }
15890
15891 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15893 self.enable_failed_attempts_check = v.into();
15894 self
15895 }
15896
15897 pub fn set_status<T>(mut self, v: T) -> Self
15899 where
15900 T: std::convert::Into<crate::model::PasswordStatus>,
15901 {
15902 self.status = std::option::Option::Some(v.into());
15903 self
15904 }
15905
15906 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
15908 where
15909 T: std::convert::Into<crate::model::PasswordStatus>,
15910 {
15911 self.status = v.map(|x| x.into());
15912 self
15913 }
15914
15915 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15917 self.enable_password_verification = v.into();
15918 self
15919 }
15920}
15921
15922impl wkt::message::Message for UserPasswordValidationPolicy {
15923 fn typename() -> &'static str {
15924 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
15925 }
15926}
15927
15928#[derive(Clone, Default, PartialEq)]
15930#[non_exhaustive]
15931pub struct PasswordStatus {
15932 pub locked: bool,
15934
15935 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
15937
15938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15939}
15940
15941impl PasswordStatus {
15942 pub fn new() -> Self {
15943 std::default::Default::default()
15944 }
15945
15946 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15948 self.locked = v.into();
15949 self
15950 }
15951
15952 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
15954 where
15955 T: std::convert::Into<wkt::Timestamp>,
15956 {
15957 self.password_expiration_time = std::option::Option::Some(v.into());
15958 self
15959 }
15960
15961 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
15963 where
15964 T: std::convert::Into<wkt::Timestamp>,
15965 {
15966 self.password_expiration_time = v.map(|x| x.into());
15967 self
15968 }
15969}
15970
15971impl wkt::message::Message for PasswordStatus {
15972 fn typename() -> &'static str {
15973 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
15974 }
15975}
15976
15977#[derive(Clone, Default, PartialEq)]
15979#[non_exhaustive]
15980pub struct User {
15981 pub kind: std::string::String,
15983
15984 pub password: std::string::String,
15986
15987 pub etag: std::string::String,
15990
15991 pub name: std::string::String,
15994
15995 pub host: std::string::String,
16001
16002 pub instance: std::string::String,
16006
16007 pub project: std::string::String,
16011
16012 pub r#type: crate::model::user::SqlUserType,
16015
16016 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
16018
16019 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
16021
16022 pub user_details: std::option::Option<crate::model::user::UserDetails>,
16024
16025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16026}
16027
16028impl User {
16029 pub fn new() -> Self {
16030 std::default::Default::default()
16031 }
16032
16033 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16035 self.kind = v.into();
16036 self
16037 }
16038
16039 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16041 self.password = v.into();
16042 self
16043 }
16044
16045 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16047 self.etag = v.into();
16048 self
16049 }
16050
16051 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16053 self.name = v.into();
16054 self
16055 }
16056
16057 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16059 self.host = v.into();
16060 self
16061 }
16062
16063 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16065 self.instance = v.into();
16066 self
16067 }
16068
16069 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16071 self.project = v.into();
16072 self
16073 }
16074
16075 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
16077 mut self,
16078 v: T,
16079 ) -> Self {
16080 self.r#type = v.into();
16081 self
16082 }
16083
16084 pub fn set_password_policy<T>(mut self, v: T) -> Self
16086 where
16087 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
16088 {
16089 self.password_policy = std::option::Option::Some(v.into());
16090 self
16091 }
16092
16093 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
16095 where
16096 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
16097 {
16098 self.password_policy = v.map(|x| x.into());
16099 self
16100 }
16101
16102 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
16104 where
16105 T: std::convert::Into<crate::model::user::DualPasswordType>,
16106 {
16107 self.dual_password_type = std::option::Option::Some(v.into());
16108 self
16109 }
16110
16111 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
16113 where
16114 T: std::convert::Into<crate::model::user::DualPasswordType>,
16115 {
16116 self.dual_password_type = v.map(|x| x.into());
16117 self
16118 }
16119
16120 pub fn set_user_details<
16125 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
16126 >(
16127 mut self,
16128 v: T,
16129 ) -> Self {
16130 self.user_details = v.into();
16131 self
16132 }
16133
16134 pub fn sqlserver_user_details(
16138 &self,
16139 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
16140 #[allow(unreachable_patterns)]
16141 self.user_details.as_ref().and_then(|v| match v {
16142 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
16143 std::option::Option::Some(v)
16144 }
16145 _ => std::option::Option::None,
16146 })
16147 }
16148
16149 pub fn set_sqlserver_user_details<
16155 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
16156 >(
16157 mut self,
16158 v: T,
16159 ) -> Self {
16160 self.user_details = std::option::Option::Some(
16161 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
16162 );
16163 self
16164 }
16165}
16166
16167impl wkt::message::Message for User {
16168 fn typename() -> &'static str {
16169 "type.googleapis.com/google.cloud.sql.v1.User"
16170 }
16171}
16172
16173pub mod user {
16175 #[allow(unused_imports)]
16176 use super::*;
16177
16178 #[derive(Clone, Debug, PartialEq)]
16194 #[non_exhaustive]
16195 pub enum SqlUserType {
16196 BuiltIn,
16198 CloudIamUser,
16200 CloudIamServiceAccount,
16202 CloudIamGroup,
16204 CloudIamGroupUser,
16206 CloudIamGroupServiceAccount,
16208 UnknownValue(sql_user_type::UnknownValue),
16213 }
16214
16215 #[doc(hidden)]
16216 pub mod sql_user_type {
16217 #[allow(unused_imports)]
16218 use super::*;
16219 #[derive(Clone, Debug, PartialEq)]
16220 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16221 }
16222
16223 impl SqlUserType {
16224 pub fn value(&self) -> std::option::Option<i32> {
16229 match self {
16230 Self::BuiltIn => std::option::Option::Some(0),
16231 Self::CloudIamUser => std::option::Option::Some(1),
16232 Self::CloudIamServiceAccount => std::option::Option::Some(2),
16233 Self::CloudIamGroup => std::option::Option::Some(3),
16234 Self::CloudIamGroupUser => std::option::Option::Some(4),
16235 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
16236 Self::UnknownValue(u) => u.0.value(),
16237 }
16238 }
16239
16240 pub fn name(&self) -> std::option::Option<&str> {
16245 match self {
16246 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
16247 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
16248 Self::CloudIamServiceAccount => {
16249 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
16250 }
16251 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
16252 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
16253 Self::CloudIamGroupServiceAccount => {
16254 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
16255 }
16256 Self::UnknownValue(u) => u.0.name(),
16257 }
16258 }
16259 }
16260
16261 impl std::default::Default for SqlUserType {
16262 fn default() -> Self {
16263 use std::convert::From;
16264 Self::from(0)
16265 }
16266 }
16267
16268 impl std::fmt::Display for SqlUserType {
16269 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16270 wkt::internal::display_enum(f, self.name(), self.value())
16271 }
16272 }
16273
16274 impl std::convert::From<i32> for SqlUserType {
16275 fn from(value: i32) -> Self {
16276 match value {
16277 0 => Self::BuiltIn,
16278 1 => Self::CloudIamUser,
16279 2 => Self::CloudIamServiceAccount,
16280 3 => Self::CloudIamGroup,
16281 4 => Self::CloudIamGroupUser,
16282 5 => Self::CloudIamGroupServiceAccount,
16283 _ => Self::UnknownValue(sql_user_type::UnknownValue(
16284 wkt::internal::UnknownEnumValue::Integer(value),
16285 )),
16286 }
16287 }
16288 }
16289
16290 impl std::convert::From<&str> for SqlUserType {
16291 fn from(value: &str) -> Self {
16292 use std::string::ToString;
16293 match value {
16294 "BUILT_IN" => Self::BuiltIn,
16295 "CLOUD_IAM_USER" => Self::CloudIamUser,
16296 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
16297 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
16298 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
16299 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
16300 _ => Self::UnknownValue(sql_user_type::UnknownValue(
16301 wkt::internal::UnknownEnumValue::String(value.to_string()),
16302 )),
16303 }
16304 }
16305 }
16306
16307 impl serde::ser::Serialize for SqlUserType {
16308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16309 where
16310 S: serde::Serializer,
16311 {
16312 match self {
16313 Self::BuiltIn => serializer.serialize_i32(0),
16314 Self::CloudIamUser => serializer.serialize_i32(1),
16315 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
16316 Self::CloudIamGroup => serializer.serialize_i32(3),
16317 Self::CloudIamGroupUser => serializer.serialize_i32(4),
16318 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
16319 Self::UnknownValue(u) => u.0.serialize(serializer),
16320 }
16321 }
16322 }
16323
16324 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
16325 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16326 where
16327 D: serde::Deserializer<'de>,
16328 {
16329 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
16330 ".google.cloud.sql.v1.User.SqlUserType",
16331 ))
16332 }
16333 }
16334
16335 #[derive(Clone, Debug, PartialEq)]
16351 #[non_exhaustive]
16352 pub enum DualPasswordType {
16353 Unspecified,
16355 NoModifyDualPassword,
16357 NoDualPassword,
16359 DualPassword,
16361 UnknownValue(dual_password_type::UnknownValue),
16366 }
16367
16368 #[doc(hidden)]
16369 pub mod dual_password_type {
16370 #[allow(unused_imports)]
16371 use super::*;
16372 #[derive(Clone, Debug, PartialEq)]
16373 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16374 }
16375
16376 impl DualPasswordType {
16377 pub fn value(&self) -> std::option::Option<i32> {
16382 match self {
16383 Self::Unspecified => std::option::Option::Some(0),
16384 Self::NoModifyDualPassword => std::option::Option::Some(1),
16385 Self::NoDualPassword => std::option::Option::Some(2),
16386 Self::DualPassword => std::option::Option::Some(3),
16387 Self::UnknownValue(u) => u.0.value(),
16388 }
16389 }
16390
16391 pub fn name(&self) -> std::option::Option<&str> {
16396 match self {
16397 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
16398 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
16399 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
16400 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
16401 Self::UnknownValue(u) => u.0.name(),
16402 }
16403 }
16404 }
16405
16406 impl std::default::Default for DualPasswordType {
16407 fn default() -> Self {
16408 use std::convert::From;
16409 Self::from(0)
16410 }
16411 }
16412
16413 impl std::fmt::Display for DualPasswordType {
16414 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16415 wkt::internal::display_enum(f, self.name(), self.value())
16416 }
16417 }
16418
16419 impl std::convert::From<i32> for DualPasswordType {
16420 fn from(value: i32) -> Self {
16421 match value {
16422 0 => Self::Unspecified,
16423 1 => Self::NoModifyDualPassword,
16424 2 => Self::NoDualPassword,
16425 3 => Self::DualPassword,
16426 _ => Self::UnknownValue(dual_password_type::UnknownValue(
16427 wkt::internal::UnknownEnumValue::Integer(value),
16428 )),
16429 }
16430 }
16431 }
16432
16433 impl std::convert::From<&str> for DualPasswordType {
16434 fn from(value: &str) -> Self {
16435 use std::string::ToString;
16436 match value {
16437 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
16438 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
16439 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
16440 "DUAL_PASSWORD" => Self::DualPassword,
16441 _ => Self::UnknownValue(dual_password_type::UnknownValue(
16442 wkt::internal::UnknownEnumValue::String(value.to_string()),
16443 )),
16444 }
16445 }
16446 }
16447
16448 impl serde::ser::Serialize for DualPasswordType {
16449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16450 where
16451 S: serde::Serializer,
16452 {
16453 match self {
16454 Self::Unspecified => serializer.serialize_i32(0),
16455 Self::NoModifyDualPassword => serializer.serialize_i32(1),
16456 Self::NoDualPassword => serializer.serialize_i32(2),
16457 Self::DualPassword => serializer.serialize_i32(3),
16458 Self::UnknownValue(u) => u.0.serialize(serializer),
16459 }
16460 }
16461 }
16462
16463 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
16464 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16465 where
16466 D: serde::Deserializer<'de>,
16467 {
16468 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
16469 ".google.cloud.sql.v1.User.DualPasswordType",
16470 ))
16471 }
16472 }
16473
16474 #[derive(Clone, Debug, PartialEq)]
16476 #[non_exhaustive]
16477 pub enum UserDetails {
16478 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
16479 }
16480}
16481
16482#[derive(Clone, Default, PartialEq)]
16484#[non_exhaustive]
16485pub struct SqlServerUserDetails {
16486 pub disabled: bool,
16488
16489 pub server_roles: std::vec::Vec<std::string::String>,
16491
16492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16493}
16494
16495impl SqlServerUserDetails {
16496 pub fn new() -> Self {
16497 std::default::Default::default()
16498 }
16499
16500 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16502 self.disabled = v.into();
16503 self
16504 }
16505
16506 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
16508 where
16509 T: std::iter::IntoIterator<Item = V>,
16510 V: std::convert::Into<std::string::String>,
16511 {
16512 use std::iter::Iterator;
16513 self.server_roles = v.into_iter().map(|i| i.into()).collect();
16514 self
16515 }
16516}
16517
16518impl wkt::message::Message for SqlServerUserDetails {
16519 fn typename() -> &'static str {
16520 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
16521 }
16522}
16523
16524#[derive(Clone, Default, PartialEq)]
16526#[non_exhaustive]
16527pub struct UsersListResponse {
16528 pub kind: std::string::String,
16530
16531 pub items: std::vec::Vec<crate::model::User>,
16533
16534 #[deprecated]
16536 pub next_page_token: std::string::String,
16537
16538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16539}
16540
16541impl UsersListResponse {
16542 pub fn new() -> Self {
16543 std::default::Default::default()
16544 }
16545
16546 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16548 self.kind = v.into();
16549 self
16550 }
16551
16552 pub fn set_items<T, V>(mut self, v: T) -> Self
16554 where
16555 T: std::iter::IntoIterator<Item = V>,
16556 V: std::convert::Into<crate::model::User>,
16557 {
16558 use std::iter::Iterator;
16559 self.items = v.into_iter().map(|i| i.into()).collect();
16560 self
16561 }
16562
16563 #[deprecated]
16565 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16566 self.next_page_token = v.into();
16567 self
16568 }
16569}
16570
16571impl wkt::message::Message for UsersListResponse {
16572 fn typename() -> &'static str {
16573 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
16574 }
16575}
16576
16577#[derive(Clone, Debug, PartialEq)]
16593#[non_exhaustive]
16594pub enum SqlBackupRunStatus {
16595 Unspecified,
16597 Enqueued,
16599 Overdue,
16603 Running,
16605 Failed,
16607 Successful,
16609 Skipped,
16612 DeletionPending,
16614 DeletionFailed,
16616 Deleted,
16618 UnknownValue(sql_backup_run_status::UnknownValue),
16623}
16624
16625#[doc(hidden)]
16626pub mod sql_backup_run_status {
16627 #[allow(unused_imports)]
16628 use super::*;
16629 #[derive(Clone, Debug, PartialEq)]
16630 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16631}
16632
16633impl SqlBackupRunStatus {
16634 pub fn value(&self) -> std::option::Option<i32> {
16639 match self {
16640 Self::Unspecified => std::option::Option::Some(0),
16641 Self::Enqueued => std::option::Option::Some(1),
16642 Self::Overdue => std::option::Option::Some(2),
16643 Self::Running => std::option::Option::Some(3),
16644 Self::Failed => std::option::Option::Some(4),
16645 Self::Successful => std::option::Option::Some(5),
16646 Self::Skipped => std::option::Option::Some(6),
16647 Self::DeletionPending => std::option::Option::Some(7),
16648 Self::DeletionFailed => std::option::Option::Some(8),
16649 Self::Deleted => std::option::Option::Some(9),
16650 Self::UnknownValue(u) => u.0.value(),
16651 }
16652 }
16653
16654 pub fn name(&self) -> std::option::Option<&str> {
16659 match self {
16660 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
16661 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
16662 Self::Overdue => std::option::Option::Some("OVERDUE"),
16663 Self::Running => std::option::Option::Some("RUNNING"),
16664 Self::Failed => std::option::Option::Some("FAILED"),
16665 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
16666 Self::Skipped => std::option::Option::Some("SKIPPED"),
16667 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
16668 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
16669 Self::Deleted => std::option::Option::Some("DELETED"),
16670 Self::UnknownValue(u) => u.0.name(),
16671 }
16672 }
16673}
16674
16675impl std::default::Default for SqlBackupRunStatus {
16676 fn default() -> Self {
16677 use std::convert::From;
16678 Self::from(0)
16679 }
16680}
16681
16682impl std::fmt::Display for SqlBackupRunStatus {
16683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16684 wkt::internal::display_enum(f, self.name(), self.value())
16685 }
16686}
16687
16688impl std::convert::From<i32> for SqlBackupRunStatus {
16689 fn from(value: i32) -> Self {
16690 match value {
16691 0 => Self::Unspecified,
16692 1 => Self::Enqueued,
16693 2 => Self::Overdue,
16694 3 => Self::Running,
16695 4 => Self::Failed,
16696 5 => Self::Successful,
16697 6 => Self::Skipped,
16698 7 => Self::DeletionPending,
16699 8 => Self::DeletionFailed,
16700 9 => Self::Deleted,
16701 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16702 wkt::internal::UnknownEnumValue::Integer(value),
16703 )),
16704 }
16705 }
16706}
16707
16708impl std::convert::From<&str> for SqlBackupRunStatus {
16709 fn from(value: &str) -> Self {
16710 use std::string::ToString;
16711 match value {
16712 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
16713 "ENQUEUED" => Self::Enqueued,
16714 "OVERDUE" => Self::Overdue,
16715 "RUNNING" => Self::Running,
16716 "FAILED" => Self::Failed,
16717 "SUCCESSFUL" => Self::Successful,
16718 "SKIPPED" => Self::Skipped,
16719 "DELETION_PENDING" => Self::DeletionPending,
16720 "DELETION_FAILED" => Self::DeletionFailed,
16721 "DELETED" => Self::Deleted,
16722 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
16723 wkt::internal::UnknownEnumValue::String(value.to_string()),
16724 )),
16725 }
16726 }
16727}
16728
16729impl serde::ser::Serialize for SqlBackupRunStatus {
16730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16731 where
16732 S: serde::Serializer,
16733 {
16734 match self {
16735 Self::Unspecified => serializer.serialize_i32(0),
16736 Self::Enqueued => serializer.serialize_i32(1),
16737 Self::Overdue => serializer.serialize_i32(2),
16738 Self::Running => serializer.serialize_i32(3),
16739 Self::Failed => serializer.serialize_i32(4),
16740 Self::Successful => serializer.serialize_i32(5),
16741 Self::Skipped => serializer.serialize_i32(6),
16742 Self::DeletionPending => serializer.serialize_i32(7),
16743 Self::DeletionFailed => serializer.serialize_i32(8),
16744 Self::Deleted => serializer.serialize_i32(9),
16745 Self::UnknownValue(u) => u.0.serialize(serializer),
16746 }
16747 }
16748}
16749
16750impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
16751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16752 where
16753 D: serde::Deserializer<'de>,
16754 {
16755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
16756 ".google.cloud.sql.v1.SqlBackupRunStatus",
16757 ))
16758 }
16759}
16760
16761#[derive(Clone, Debug, PartialEq)]
16777#[non_exhaustive]
16778pub enum SqlBackupKind {
16779 Unspecified,
16781 Snapshot,
16783 Physical,
16785 UnknownValue(sql_backup_kind::UnknownValue),
16790}
16791
16792#[doc(hidden)]
16793pub mod sql_backup_kind {
16794 #[allow(unused_imports)]
16795 use super::*;
16796 #[derive(Clone, Debug, PartialEq)]
16797 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16798}
16799
16800impl SqlBackupKind {
16801 pub fn value(&self) -> std::option::Option<i32> {
16806 match self {
16807 Self::Unspecified => std::option::Option::Some(0),
16808 Self::Snapshot => std::option::Option::Some(1),
16809 Self::Physical => std::option::Option::Some(2),
16810 Self::UnknownValue(u) => u.0.value(),
16811 }
16812 }
16813
16814 pub fn name(&self) -> std::option::Option<&str> {
16819 match self {
16820 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
16821 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
16822 Self::Physical => std::option::Option::Some("PHYSICAL"),
16823 Self::UnknownValue(u) => u.0.name(),
16824 }
16825 }
16826}
16827
16828impl std::default::Default for SqlBackupKind {
16829 fn default() -> Self {
16830 use std::convert::From;
16831 Self::from(0)
16832 }
16833}
16834
16835impl std::fmt::Display for SqlBackupKind {
16836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16837 wkt::internal::display_enum(f, self.name(), self.value())
16838 }
16839}
16840
16841impl std::convert::From<i32> for SqlBackupKind {
16842 fn from(value: i32) -> Self {
16843 match value {
16844 0 => Self::Unspecified,
16845 1 => Self::Snapshot,
16846 2 => Self::Physical,
16847 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16848 wkt::internal::UnknownEnumValue::Integer(value),
16849 )),
16850 }
16851 }
16852}
16853
16854impl std::convert::From<&str> for SqlBackupKind {
16855 fn from(value: &str) -> Self {
16856 use std::string::ToString;
16857 match value {
16858 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
16859 "SNAPSHOT" => Self::Snapshot,
16860 "PHYSICAL" => Self::Physical,
16861 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
16862 wkt::internal::UnknownEnumValue::String(value.to_string()),
16863 )),
16864 }
16865 }
16866}
16867
16868impl serde::ser::Serialize for SqlBackupKind {
16869 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16870 where
16871 S: serde::Serializer,
16872 {
16873 match self {
16874 Self::Unspecified => serializer.serialize_i32(0),
16875 Self::Snapshot => serializer.serialize_i32(1),
16876 Self::Physical => serializer.serialize_i32(2),
16877 Self::UnknownValue(u) => u.0.serialize(serializer),
16878 }
16879 }
16880}
16881
16882impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
16883 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16884 where
16885 D: serde::Deserializer<'de>,
16886 {
16887 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
16888 ".google.cloud.sql.v1.SqlBackupKind",
16889 ))
16890 }
16891}
16892
16893#[derive(Clone, Debug, PartialEq)]
16909#[non_exhaustive]
16910pub enum SqlBackupRunType {
16911 Unspecified,
16913 Automated,
16915 OnDemand,
16917 UnknownValue(sql_backup_run_type::UnknownValue),
16922}
16923
16924#[doc(hidden)]
16925pub mod sql_backup_run_type {
16926 #[allow(unused_imports)]
16927 use super::*;
16928 #[derive(Clone, Debug, PartialEq)]
16929 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16930}
16931
16932impl SqlBackupRunType {
16933 pub fn value(&self) -> std::option::Option<i32> {
16938 match self {
16939 Self::Unspecified => std::option::Option::Some(0),
16940 Self::Automated => std::option::Option::Some(1),
16941 Self::OnDemand => std::option::Option::Some(2),
16942 Self::UnknownValue(u) => u.0.value(),
16943 }
16944 }
16945
16946 pub fn name(&self) -> std::option::Option<&str> {
16951 match self {
16952 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
16953 Self::Automated => std::option::Option::Some("AUTOMATED"),
16954 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
16955 Self::UnknownValue(u) => u.0.name(),
16956 }
16957 }
16958}
16959
16960impl std::default::Default for SqlBackupRunType {
16961 fn default() -> Self {
16962 use std::convert::From;
16963 Self::from(0)
16964 }
16965}
16966
16967impl std::fmt::Display for SqlBackupRunType {
16968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16969 wkt::internal::display_enum(f, self.name(), self.value())
16970 }
16971}
16972
16973impl std::convert::From<i32> for SqlBackupRunType {
16974 fn from(value: i32) -> Self {
16975 match value {
16976 0 => Self::Unspecified,
16977 1 => Self::Automated,
16978 2 => Self::OnDemand,
16979 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16980 wkt::internal::UnknownEnumValue::Integer(value),
16981 )),
16982 }
16983 }
16984}
16985
16986impl std::convert::From<&str> for SqlBackupRunType {
16987 fn from(value: &str) -> Self {
16988 use std::string::ToString;
16989 match value {
16990 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
16991 "AUTOMATED" => Self::Automated,
16992 "ON_DEMAND" => Self::OnDemand,
16993 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
16994 wkt::internal::UnknownEnumValue::String(value.to_string()),
16995 )),
16996 }
16997 }
16998}
16999
17000impl serde::ser::Serialize for SqlBackupRunType {
17001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17002 where
17003 S: serde::Serializer,
17004 {
17005 match self {
17006 Self::Unspecified => serializer.serialize_i32(0),
17007 Self::Automated => serializer.serialize_i32(1),
17008 Self::OnDemand => serializer.serialize_i32(2),
17009 Self::UnknownValue(u) => u.0.serialize(serializer),
17010 }
17011 }
17012}
17013
17014impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
17015 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17016 where
17017 D: serde::Deserializer<'de>,
17018 {
17019 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
17020 ".google.cloud.sql.v1.SqlBackupRunType",
17021 ))
17022 }
17023}
17024
17025#[derive(Clone, Debug, PartialEq)]
17040#[non_exhaustive]
17041pub enum SqlFlagType {
17042 Unspecified,
17044 Boolean,
17046 String,
17048 Integer,
17050 None,
17052 MysqlTimezoneOffset,
17055 Float,
17057 RepeatedString,
17059 UnknownValue(sql_flag_type::UnknownValue),
17064}
17065
17066#[doc(hidden)]
17067pub mod sql_flag_type {
17068 #[allow(unused_imports)]
17069 use super::*;
17070 #[derive(Clone, Debug, PartialEq)]
17071 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17072}
17073
17074impl SqlFlagType {
17075 pub fn value(&self) -> std::option::Option<i32> {
17080 match self {
17081 Self::Unspecified => std::option::Option::Some(0),
17082 Self::Boolean => std::option::Option::Some(1),
17083 Self::String => std::option::Option::Some(2),
17084 Self::Integer => std::option::Option::Some(3),
17085 Self::None => std::option::Option::Some(4),
17086 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
17087 Self::Float => std::option::Option::Some(6),
17088 Self::RepeatedString => std::option::Option::Some(7),
17089 Self::UnknownValue(u) => u.0.value(),
17090 }
17091 }
17092
17093 pub fn name(&self) -> std::option::Option<&str> {
17098 match self {
17099 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
17100 Self::Boolean => std::option::Option::Some("BOOLEAN"),
17101 Self::String => std::option::Option::Some("STRING"),
17102 Self::Integer => std::option::Option::Some("INTEGER"),
17103 Self::None => std::option::Option::Some("NONE"),
17104 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
17105 Self::Float => std::option::Option::Some("FLOAT"),
17106 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
17107 Self::UnknownValue(u) => u.0.name(),
17108 }
17109 }
17110}
17111
17112impl std::default::Default for SqlFlagType {
17113 fn default() -> Self {
17114 use std::convert::From;
17115 Self::from(0)
17116 }
17117}
17118
17119impl std::fmt::Display for SqlFlagType {
17120 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17121 wkt::internal::display_enum(f, self.name(), self.value())
17122 }
17123}
17124
17125impl std::convert::From<i32> for SqlFlagType {
17126 fn from(value: i32) -> Self {
17127 match value {
17128 0 => Self::Unspecified,
17129 1 => Self::Boolean,
17130 2 => Self::String,
17131 3 => Self::Integer,
17132 4 => Self::None,
17133 5 => Self::MysqlTimezoneOffset,
17134 6 => Self::Float,
17135 7 => Self::RepeatedString,
17136 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
17137 wkt::internal::UnknownEnumValue::Integer(value),
17138 )),
17139 }
17140 }
17141}
17142
17143impl std::convert::From<&str> for SqlFlagType {
17144 fn from(value: &str) -> Self {
17145 use std::string::ToString;
17146 match value {
17147 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
17148 "BOOLEAN" => Self::Boolean,
17149 "STRING" => Self::String,
17150 "INTEGER" => Self::Integer,
17151 "NONE" => Self::None,
17152 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
17153 "FLOAT" => Self::Float,
17154 "REPEATED_STRING" => Self::RepeatedString,
17155 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
17156 wkt::internal::UnknownEnumValue::String(value.to_string()),
17157 )),
17158 }
17159 }
17160}
17161
17162impl serde::ser::Serialize for SqlFlagType {
17163 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17164 where
17165 S: serde::Serializer,
17166 {
17167 match self {
17168 Self::Unspecified => serializer.serialize_i32(0),
17169 Self::Boolean => serializer.serialize_i32(1),
17170 Self::String => serializer.serialize_i32(2),
17171 Self::Integer => serializer.serialize_i32(3),
17172 Self::None => serializer.serialize_i32(4),
17173 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
17174 Self::Float => serializer.serialize_i32(6),
17175 Self::RepeatedString => serializer.serialize_i32(7),
17176 Self::UnknownValue(u) => u.0.serialize(serializer),
17177 }
17178 }
17179}
17180
17181impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
17182 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17183 where
17184 D: serde::Deserializer<'de>,
17185 {
17186 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
17187 ".google.cloud.sql.v1.SqlFlagType",
17188 ))
17189 }
17190}
17191
17192#[derive(Clone, Debug, PartialEq)]
17208#[non_exhaustive]
17209pub enum ExternalSyncParallelLevel {
17210 Unspecified,
17212 Min,
17214 Optimal,
17216 Max,
17218 UnknownValue(external_sync_parallel_level::UnknownValue),
17223}
17224
17225#[doc(hidden)]
17226pub mod external_sync_parallel_level {
17227 #[allow(unused_imports)]
17228 use super::*;
17229 #[derive(Clone, Debug, PartialEq)]
17230 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17231}
17232
17233impl ExternalSyncParallelLevel {
17234 pub fn value(&self) -> std::option::Option<i32> {
17239 match self {
17240 Self::Unspecified => std::option::Option::Some(0),
17241 Self::Min => std::option::Option::Some(1),
17242 Self::Optimal => std::option::Option::Some(2),
17243 Self::Max => std::option::Option::Some(3),
17244 Self::UnknownValue(u) => u.0.value(),
17245 }
17246 }
17247
17248 pub fn name(&self) -> std::option::Option<&str> {
17253 match self {
17254 Self::Unspecified => {
17255 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
17256 }
17257 Self::Min => std::option::Option::Some("MIN"),
17258 Self::Optimal => std::option::Option::Some("OPTIMAL"),
17259 Self::Max => std::option::Option::Some("MAX"),
17260 Self::UnknownValue(u) => u.0.name(),
17261 }
17262 }
17263}
17264
17265impl std::default::Default for ExternalSyncParallelLevel {
17266 fn default() -> Self {
17267 use std::convert::From;
17268 Self::from(0)
17269 }
17270}
17271
17272impl std::fmt::Display for ExternalSyncParallelLevel {
17273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17274 wkt::internal::display_enum(f, self.name(), self.value())
17275 }
17276}
17277
17278impl std::convert::From<i32> for ExternalSyncParallelLevel {
17279 fn from(value: i32) -> Self {
17280 match value {
17281 0 => Self::Unspecified,
17282 1 => Self::Min,
17283 2 => Self::Optimal,
17284 3 => Self::Max,
17285 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
17286 wkt::internal::UnknownEnumValue::Integer(value),
17287 )),
17288 }
17289 }
17290}
17291
17292impl std::convert::From<&str> for ExternalSyncParallelLevel {
17293 fn from(value: &str) -> Self {
17294 use std::string::ToString;
17295 match value {
17296 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
17297 "MIN" => Self::Min,
17298 "OPTIMAL" => Self::Optimal,
17299 "MAX" => Self::Max,
17300 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
17301 wkt::internal::UnknownEnumValue::String(value.to_string()),
17302 )),
17303 }
17304 }
17305}
17306
17307impl serde::ser::Serialize for ExternalSyncParallelLevel {
17308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17309 where
17310 S: serde::Serializer,
17311 {
17312 match self {
17313 Self::Unspecified => serializer.serialize_i32(0),
17314 Self::Min => serializer.serialize_i32(1),
17315 Self::Optimal => serializer.serialize_i32(2),
17316 Self::Max => serializer.serialize_i32(3),
17317 Self::UnknownValue(u) => u.0.serialize(serializer),
17318 }
17319 }
17320}
17321
17322impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
17323 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17324 where
17325 D: serde::Deserializer<'de>,
17326 {
17327 deserializer.deserialize_any(
17328 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
17329 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
17330 ),
17331 )
17332 }
17333}
17334
17335#[derive(Clone, Debug, PartialEq)]
17350#[non_exhaustive]
17351pub enum SqlInstanceType {
17352 Unspecified,
17354 CloudSqlInstance,
17357 OnPremisesInstance,
17360 ReadReplicaInstance,
17362 UnknownValue(sql_instance_type::UnknownValue),
17367}
17368
17369#[doc(hidden)]
17370pub mod sql_instance_type {
17371 #[allow(unused_imports)]
17372 use super::*;
17373 #[derive(Clone, Debug, PartialEq)]
17374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17375}
17376
17377impl SqlInstanceType {
17378 pub fn value(&self) -> std::option::Option<i32> {
17383 match self {
17384 Self::Unspecified => std::option::Option::Some(0),
17385 Self::CloudSqlInstance => std::option::Option::Some(1),
17386 Self::OnPremisesInstance => std::option::Option::Some(2),
17387 Self::ReadReplicaInstance => std::option::Option::Some(3),
17388 Self::UnknownValue(u) => u.0.value(),
17389 }
17390 }
17391
17392 pub fn name(&self) -> std::option::Option<&str> {
17397 match self {
17398 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
17399 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
17400 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
17401 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
17402 Self::UnknownValue(u) => u.0.name(),
17403 }
17404 }
17405}
17406
17407impl std::default::Default for SqlInstanceType {
17408 fn default() -> Self {
17409 use std::convert::From;
17410 Self::from(0)
17411 }
17412}
17413
17414impl std::fmt::Display for SqlInstanceType {
17415 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17416 wkt::internal::display_enum(f, self.name(), self.value())
17417 }
17418}
17419
17420impl std::convert::From<i32> for SqlInstanceType {
17421 fn from(value: i32) -> Self {
17422 match value {
17423 0 => Self::Unspecified,
17424 1 => Self::CloudSqlInstance,
17425 2 => Self::OnPremisesInstance,
17426 3 => Self::ReadReplicaInstance,
17427 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
17428 wkt::internal::UnknownEnumValue::Integer(value),
17429 )),
17430 }
17431 }
17432}
17433
17434impl std::convert::From<&str> for SqlInstanceType {
17435 fn from(value: &str) -> Self {
17436 use std::string::ToString;
17437 match value {
17438 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
17439 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
17440 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
17441 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
17442 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
17443 wkt::internal::UnknownEnumValue::String(value.to_string()),
17444 )),
17445 }
17446 }
17447}
17448
17449impl serde::ser::Serialize for SqlInstanceType {
17450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17451 where
17452 S: serde::Serializer,
17453 {
17454 match self {
17455 Self::Unspecified => serializer.serialize_i32(0),
17456 Self::CloudSqlInstance => serializer.serialize_i32(1),
17457 Self::OnPremisesInstance => serializer.serialize_i32(2),
17458 Self::ReadReplicaInstance => serializer.serialize_i32(3),
17459 Self::UnknownValue(u) => u.0.serialize(serializer),
17460 }
17461 }
17462}
17463
17464impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
17465 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17466 where
17467 D: serde::Deserializer<'de>,
17468 {
17469 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
17470 ".google.cloud.sql.v1.SqlInstanceType",
17471 ))
17472 }
17473}
17474
17475#[derive(Clone, Debug, PartialEq)]
17491#[non_exhaustive]
17492pub enum SqlSuspensionReason {
17493 Unspecified,
17495 BillingIssue,
17498 LegalIssue,
17501 OperationalIssue,
17504 KmsKeyIssue,
17506 UnknownValue(sql_suspension_reason::UnknownValue),
17511}
17512
17513#[doc(hidden)]
17514pub mod sql_suspension_reason {
17515 #[allow(unused_imports)]
17516 use super::*;
17517 #[derive(Clone, Debug, PartialEq)]
17518 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17519}
17520
17521impl SqlSuspensionReason {
17522 pub fn value(&self) -> std::option::Option<i32> {
17527 match self {
17528 Self::Unspecified => std::option::Option::Some(0),
17529 Self::BillingIssue => std::option::Option::Some(2),
17530 Self::LegalIssue => std::option::Option::Some(3),
17531 Self::OperationalIssue => std::option::Option::Some(4),
17532 Self::KmsKeyIssue => std::option::Option::Some(5),
17533 Self::UnknownValue(u) => u.0.value(),
17534 }
17535 }
17536
17537 pub fn name(&self) -> std::option::Option<&str> {
17542 match self {
17543 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
17544 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
17545 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
17546 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
17547 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
17548 Self::UnknownValue(u) => u.0.name(),
17549 }
17550 }
17551}
17552
17553impl std::default::Default for SqlSuspensionReason {
17554 fn default() -> Self {
17555 use std::convert::From;
17556 Self::from(0)
17557 }
17558}
17559
17560impl std::fmt::Display for SqlSuspensionReason {
17561 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17562 wkt::internal::display_enum(f, self.name(), self.value())
17563 }
17564}
17565
17566impl std::convert::From<i32> for SqlSuspensionReason {
17567 fn from(value: i32) -> Self {
17568 match value {
17569 0 => Self::Unspecified,
17570 2 => Self::BillingIssue,
17571 3 => Self::LegalIssue,
17572 4 => Self::OperationalIssue,
17573 5 => Self::KmsKeyIssue,
17574 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17575 wkt::internal::UnknownEnumValue::Integer(value),
17576 )),
17577 }
17578 }
17579}
17580
17581impl std::convert::From<&str> for SqlSuspensionReason {
17582 fn from(value: &str) -> Self {
17583 use std::string::ToString;
17584 match value {
17585 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
17586 "BILLING_ISSUE" => Self::BillingIssue,
17587 "LEGAL_ISSUE" => Self::LegalIssue,
17588 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
17589 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
17590 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
17591 wkt::internal::UnknownEnumValue::String(value.to_string()),
17592 )),
17593 }
17594 }
17595}
17596
17597impl serde::ser::Serialize for SqlSuspensionReason {
17598 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17599 where
17600 S: serde::Serializer,
17601 {
17602 match self {
17603 Self::Unspecified => serializer.serialize_i32(0),
17604 Self::BillingIssue => serializer.serialize_i32(2),
17605 Self::LegalIssue => serializer.serialize_i32(3),
17606 Self::OperationalIssue => serializer.serialize_i32(4),
17607 Self::KmsKeyIssue => serializer.serialize_i32(5),
17608 Self::UnknownValue(u) => u.0.serialize(serializer),
17609 }
17610 }
17611}
17612
17613impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
17614 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17615 where
17616 D: serde::Deserializer<'de>,
17617 {
17618 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
17619 ".google.cloud.sql.v1.SqlSuspensionReason",
17620 ))
17621 }
17622}
17623
17624#[derive(Clone, Debug, PartialEq)]
17639#[non_exhaustive]
17640pub enum SqlFileType {
17641 Unspecified,
17643 Sql,
17645 Csv,
17647 Bak,
17648 UnknownValue(sql_file_type::UnknownValue),
17653}
17654
17655#[doc(hidden)]
17656pub mod sql_file_type {
17657 #[allow(unused_imports)]
17658 use super::*;
17659 #[derive(Clone, Debug, PartialEq)]
17660 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17661}
17662
17663impl SqlFileType {
17664 pub fn value(&self) -> std::option::Option<i32> {
17669 match self {
17670 Self::Unspecified => std::option::Option::Some(0),
17671 Self::Sql => std::option::Option::Some(1),
17672 Self::Csv => std::option::Option::Some(2),
17673 Self::Bak => std::option::Option::Some(4),
17674 Self::UnknownValue(u) => u.0.value(),
17675 }
17676 }
17677
17678 pub fn name(&self) -> std::option::Option<&str> {
17683 match self {
17684 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
17685 Self::Sql => std::option::Option::Some("SQL"),
17686 Self::Csv => std::option::Option::Some("CSV"),
17687 Self::Bak => std::option::Option::Some("BAK"),
17688 Self::UnknownValue(u) => u.0.name(),
17689 }
17690 }
17691}
17692
17693impl std::default::Default for SqlFileType {
17694 fn default() -> Self {
17695 use std::convert::From;
17696 Self::from(0)
17697 }
17698}
17699
17700impl std::fmt::Display for SqlFileType {
17701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17702 wkt::internal::display_enum(f, self.name(), self.value())
17703 }
17704}
17705
17706impl std::convert::From<i32> for SqlFileType {
17707 fn from(value: i32) -> Self {
17708 match value {
17709 0 => Self::Unspecified,
17710 1 => Self::Sql,
17711 2 => Self::Csv,
17712 4 => Self::Bak,
17713 _ => Self::UnknownValue(sql_file_type::UnknownValue(
17714 wkt::internal::UnknownEnumValue::Integer(value),
17715 )),
17716 }
17717 }
17718}
17719
17720impl std::convert::From<&str> for SqlFileType {
17721 fn from(value: &str) -> Self {
17722 use std::string::ToString;
17723 match value {
17724 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
17725 "SQL" => Self::Sql,
17726 "CSV" => Self::Csv,
17727 "BAK" => Self::Bak,
17728 _ => Self::UnknownValue(sql_file_type::UnknownValue(
17729 wkt::internal::UnknownEnumValue::String(value.to_string()),
17730 )),
17731 }
17732 }
17733}
17734
17735impl serde::ser::Serialize for SqlFileType {
17736 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17737 where
17738 S: serde::Serializer,
17739 {
17740 match self {
17741 Self::Unspecified => serializer.serialize_i32(0),
17742 Self::Sql => serializer.serialize_i32(1),
17743 Self::Csv => serializer.serialize_i32(2),
17744 Self::Bak => serializer.serialize_i32(4),
17745 Self::UnknownValue(u) => u.0.serialize(serializer),
17746 }
17747 }
17748}
17749
17750impl<'de> serde::de::Deserialize<'de> for SqlFileType {
17751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17752 where
17753 D: serde::Deserializer<'de>,
17754 {
17755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
17756 ".google.cloud.sql.v1.SqlFileType",
17757 ))
17758 }
17759}
17760
17761#[derive(Clone, Debug, PartialEq)]
17776#[non_exhaustive]
17777pub enum BakType {
17778 Unspecified,
17780 Full,
17782 Diff,
17784 Tlog,
17786 UnknownValue(bak_type::UnknownValue),
17791}
17792
17793#[doc(hidden)]
17794pub mod bak_type {
17795 #[allow(unused_imports)]
17796 use super::*;
17797 #[derive(Clone, Debug, PartialEq)]
17798 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17799}
17800
17801impl BakType {
17802 pub fn value(&self) -> std::option::Option<i32> {
17807 match self {
17808 Self::Unspecified => std::option::Option::Some(0),
17809 Self::Full => std::option::Option::Some(1),
17810 Self::Diff => std::option::Option::Some(2),
17811 Self::Tlog => std::option::Option::Some(3),
17812 Self::UnknownValue(u) => u.0.value(),
17813 }
17814 }
17815
17816 pub fn name(&self) -> std::option::Option<&str> {
17821 match self {
17822 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
17823 Self::Full => std::option::Option::Some("FULL"),
17824 Self::Diff => std::option::Option::Some("DIFF"),
17825 Self::Tlog => std::option::Option::Some("TLOG"),
17826 Self::UnknownValue(u) => u.0.name(),
17827 }
17828 }
17829}
17830
17831impl std::default::Default for BakType {
17832 fn default() -> Self {
17833 use std::convert::From;
17834 Self::from(0)
17835 }
17836}
17837
17838impl std::fmt::Display for BakType {
17839 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17840 wkt::internal::display_enum(f, self.name(), self.value())
17841 }
17842}
17843
17844impl std::convert::From<i32> for BakType {
17845 fn from(value: i32) -> Self {
17846 match value {
17847 0 => Self::Unspecified,
17848 1 => Self::Full,
17849 2 => Self::Diff,
17850 3 => Self::Tlog,
17851 _ => Self::UnknownValue(bak_type::UnknownValue(
17852 wkt::internal::UnknownEnumValue::Integer(value),
17853 )),
17854 }
17855 }
17856}
17857
17858impl std::convert::From<&str> for BakType {
17859 fn from(value: &str) -> Self {
17860 use std::string::ToString;
17861 match value {
17862 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
17863 "FULL" => Self::Full,
17864 "DIFF" => Self::Diff,
17865 "TLOG" => Self::Tlog,
17866 _ => Self::UnknownValue(bak_type::UnknownValue(
17867 wkt::internal::UnknownEnumValue::String(value.to_string()),
17868 )),
17869 }
17870 }
17871}
17872
17873impl serde::ser::Serialize for BakType {
17874 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17875 where
17876 S: serde::Serializer,
17877 {
17878 match self {
17879 Self::Unspecified => serializer.serialize_i32(0),
17880 Self::Full => serializer.serialize_i32(1),
17881 Self::Diff => serializer.serialize_i32(2),
17882 Self::Tlog => serializer.serialize_i32(3),
17883 Self::UnknownValue(u) => u.0.serialize(serializer),
17884 }
17885 }
17886}
17887
17888impl<'de> serde::de::Deserialize<'de> for BakType {
17889 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17890 where
17891 D: serde::Deserializer<'de>,
17892 {
17893 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
17894 ".google.cloud.sql.v1.BakType",
17895 ))
17896 }
17897}
17898
17899#[derive(Clone, Debug, PartialEq)]
17914#[non_exhaustive]
17915pub enum SqlBackendType {
17916 Unspecified,
17918 #[deprecated]
17920 FirstGen,
17921 SecondGen,
17923 External,
17925 UnknownValue(sql_backend_type::UnknownValue),
17930}
17931
17932#[doc(hidden)]
17933pub mod sql_backend_type {
17934 #[allow(unused_imports)]
17935 use super::*;
17936 #[derive(Clone, Debug, PartialEq)]
17937 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17938}
17939
17940impl SqlBackendType {
17941 pub fn value(&self) -> std::option::Option<i32> {
17946 match self {
17947 Self::Unspecified => std::option::Option::Some(0),
17948 Self::FirstGen => std::option::Option::Some(1),
17949 Self::SecondGen => std::option::Option::Some(2),
17950 Self::External => std::option::Option::Some(3),
17951 Self::UnknownValue(u) => u.0.value(),
17952 }
17953 }
17954
17955 pub fn name(&self) -> std::option::Option<&str> {
17960 match self {
17961 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
17962 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
17963 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
17964 Self::External => std::option::Option::Some("EXTERNAL"),
17965 Self::UnknownValue(u) => u.0.name(),
17966 }
17967 }
17968}
17969
17970impl std::default::Default for SqlBackendType {
17971 fn default() -> Self {
17972 use std::convert::From;
17973 Self::from(0)
17974 }
17975}
17976
17977impl std::fmt::Display for SqlBackendType {
17978 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17979 wkt::internal::display_enum(f, self.name(), self.value())
17980 }
17981}
17982
17983impl std::convert::From<i32> for SqlBackendType {
17984 fn from(value: i32) -> Self {
17985 match value {
17986 0 => Self::Unspecified,
17987 1 => Self::FirstGen,
17988 2 => Self::SecondGen,
17989 3 => Self::External,
17990 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
17991 wkt::internal::UnknownEnumValue::Integer(value),
17992 )),
17993 }
17994 }
17995}
17996
17997impl std::convert::From<&str> for SqlBackendType {
17998 fn from(value: &str) -> Self {
17999 use std::string::ToString;
18000 match value {
18001 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
18002 "FIRST_GEN" => Self::FirstGen,
18003 "SECOND_GEN" => Self::SecondGen,
18004 "EXTERNAL" => Self::External,
18005 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
18006 wkt::internal::UnknownEnumValue::String(value.to_string()),
18007 )),
18008 }
18009 }
18010}
18011
18012impl serde::ser::Serialize for SqlBackendType {
18013 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18014 where
18015 S: serde::Serializer,
18016 {
18017 match self {
18018 Self::Unspecified => serializer.serialize_i32(0),
18019 Self::FirstGen => serializer.serialize_i32(1),
18020 Self::SecondGen => serializer.serialize_i32(2),
18021 Self::External => serializer.serialize_i32(3),
18022 Self::UnknownValue(u) => u.0.serialize(serializer),
18023 }
18024 }
18025}
18026
18027impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
18028 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18029 where
18030 D: serde::Deserializer<'de>,
18031 {
18032 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
18033 ".google.cloud.sql.v1.SqlBackendType",
18034 ))
18035 }
18036}
18037
18038#[derive(Clone, Debug, PartialEq)]
18053#[non_exhaustive]
18054pub enum SqlIpAddressType {
18055 Unspecified,
18057 Primary,
18060 Outgoing,
18065 Private,
18067 Migrated1StGen,
18071 UnknownValue(sql_ip_address_type::UnknownValue),
18076}
18077
18078#[doc(hidden)]
18079pub mod sql_ip_address_type {
18080 #[allow(unused_imports)]
18081 use super::*;
18082 #[derive(Clone, Debug, PartialEq)]
18083 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18084}
18085
18086impl SqlIpAddressType {
18087 pub fn value(&self) -> std::option::Option<i32> {
18092 match self {
18093 Self::Unspecified => std::option::Option::Some(0),
18094 Self::Primary => std::option::Option::Some(1),
18095 Self::Outgoing => std::option::Option::Some(2),
18096 Self::Private => std::option::Option::Some(3),
18097 Self::Migrated1StGen => std::option::Option::Some(4),
18098 Self::UnknownValue(u) => u.0.value(),
18099 }
18100 }
18101
18102 pub fn name(&self) -> std::option::Option<&str> {
18107 match self {
18108 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
18109 Self::Primary => std::option::Option::Some("PRIMARY"),
18110 Self::Outgoing => std::option::Option::Some("OUTGOING"),
18111 Self::Private => std::option::Option::Some("PRIVATE"),
18112 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
18113 Self::UnknownValue(u) => u.0.name(),
18114 }
18115 }
18116}
18117
18118impl std::default::Default for SqlIpAddressType {
18119 fn default() -> Self {
18120 use std::convert::From;
18121 Self::from(0)
18122 }
18123}
18124
18125impl std::fmt::Display for SqlIpAddressType {
18126 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18127 wkt::internal::display_enum(f, self.name(), self.value())
18128 }
18129}
18130
18131impl std::convert::From<i32> for SqlIpAddressType {
18132 fn from(value: i32) -> Self {
18133 match value {
18134 0 => Self::Unspecified,
18135 1 => Self::Primary,
18136 2 => Self::Outgoing,
18137 3 => Self::Private,
18138 4 => Self::Migrated1StGen,
18139 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
18140 wkt::internal::UnknownEnumValue::Integer(value),
18141 )),
18142 }
18143 }
18144}
18145
18146impl std::convert::From<&str> for SqlIpAddressType {
18147 fn from(value: &str) -> Self {
18148 use std::string::ToString;
18149 match value {
18150 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
18151 "PRIMARY" => Self::Primary,
18152 "OUTGOING" => Self::Outgoing,
18153 "PRIVATE" => Self::Private,
18154 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
18155 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
18156 wkt::internal::UnknownEnumValue::String(value.to_string()),
18157 )),
18158 }
18159 }
18160}
18161
18162impl serde::ser::Serialize for SqlIpAddressType {
18163 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18164 where
18165 S: serde::Serializer,
18166 {
18167 match self {
18168 Self::Unspecified => serializer.serialize_i32(0),
18169 Self::Primary => serializer.serialize_i32(1),
18170 Self::Outgoing => serializer.serialize_i32(2),
18171 Self::Private => serializer.serialize_i32(3),
18172 Self::Migrated1StGen => serializer.serialize_i32(4),
18173 Self::UnknownValue(u) => u.0.serialize(serializer),
18174 }
18175 }
18176}
18177
18178impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
18179 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18180 where
18181 D: serde::Deserializer<'de>,
18182 {
18183 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
18184 ".google.cloud.sql.v1.SqlIpAddressType",
18185 ))
18186 }
18187}
18188
18189#[derive(Clone, Debug, PartialEq)]
18205#[non_exhaustive]
18206pub enum SqlDatabaseVersion {
18207 Unspecified,
18209 #[deprecated]
18211 Mysql51,
18212 #[deprecated]
18214 Mysql55,
18215 Mysql56,
18217 Mysql57,
18219 Sqlserver2017Standard,
18221 Sqlserver2017Enterprise,
18223 Sqlserver2017Express,
18225 Sqlserver2017Web,
18227 Postgres96,
18229 Postgres10,
18231 Postgres11,
18233 Postgres12,
18235 Postgres13,
18237 Postgres14,
18239 Postgres15,
18241 Postgres16,
18243 Mysql80,
18245 Mysql8018,
18247 Mysql8026,
18249 Mysql8027,
18251 Mysql8028,
18253 #[deprecated]
18255 Mysql8029,
18256 Mysql8030,
18258 Mysql8031,
18260 Mysql8032,
18262 Mysql8033,
18264 Mysql8034,
18266 Mysql8035,
18268 Mysql8036,
18270 Mysql8037,
18272 Mysql8038,
18274 Mysql8039,
18276 Mysql8040,
18278 Mysql84,
18280 Mysql840,
18282 Sqlserver2019Standard,
18284 Sqlserver2019Enterprise,
18286 Sqlserver2019Express,
18288 Sqlserver2019Web,
18290 Sqlserver2022Standard,
18292 Sqlserver2022Enterprise,
18294 Sqlserver2022Express,
18296 Sqlserver2022Web,
18298 UnknownValue(sql_database_version::UnknownValue),
18303}
18304
18305#[doc(hidden)]
18306pub mod sql_database_version {
18307 #[allow(unused_imports)]
18308 use super::*;
18309 #[derive(Clone, Debug, PartialEq)]
18310 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18311}
18312
18313impl SqlDatabaseVersion {
18314 pub fn value(&self) -> std::option::Option<i32> {
18319 match self {
18320 Self::Unspecified => std::option::Option::Some(0),
18321 Self::Mysql51 => std::option::Option::Some(2),
18322 Self::Mysql55 => std::option::Option::Some(3),
18323 Self::Mysql56 => std::option::Option::Some(5),
18324 Self::Mysql57 => std::option::Option::Some(6),
18325 Self::Sqlserver2017Standard => std::option::Option::Some(11),
18326 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
18327 Self::Sqlserver2017Express => std::option::Option::Some(15),
18328 Self::Sqlserver2017Web => std::option::Option::Some(16),
18329 Self::Postgres96 => std::option::Option::Some(9),
18330 Self::Postgres10 => std::option::Option::Some(18),
18331 Self::Postgres11 => std::option::Option::Some(10),
18332 Self::Postgres12 => std::option::Option::Some(19),
18333 Self::Postgres13 => std::option::Option::Some(23),
18334 Self::Postgres14 => std::option::Option::Some(110),
18335 Self::Postgres15 => std::option::Option::Some(172),
18336 Self::Postgres16 => std::option::Option::Some(272),
18337 Self::Mysql80 => std::option::Option::Some(20),
18338 Self::Mysql8018 => std::option::Option::Some(41),
18339 Self::Mysql8026 => std::option::Option::Some(85),
18340 Self::Mysql8027 => std::option::Option::Some(111),
18341 Self::Mysql8028 => std::option::Option::Some(132),
18342 Self::Mysql8029 => std::option::Option::Some(148),
18343 Self::Mysql8030 => std::option::Option::Some(174),
18344 Self::Mysql8031 => std::option::Option::Some(197),
18345 Self::Mysql8032 => std::option::Option::Some(213),
18346 Self::Mysql8033 => std::option::Option::Some(238),
18347 Self::Mysql8034 => std::option::Option::Some(239),
18348 Self::Mysql8035 => std::option::Option::Some(240),
18349 Self::Mysql8036 => std::option::Option::Some(241),
18350 Self::Mysql8037 => std::option::Option::Some(355),
18351 Self::Mysql8038 => std::option::Option::Some(356),
18352 Self::Mysql8039 => std::option::Option::Some(357),
18353 Self::Mysql8040 => std::option::Option::Some(358),
18354 Self::Mysql84 => std::option::Option::Some(398),
18355 Self::Mysql840 => std::option::Option::Some(399),
18356 Self::Sqlserver2019Standard => std::option::Option::Some(26),
18357 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
18358 Self::Sqlserver2019Express => std::option::Option::Some(28),
18359 Self::Sqlserver2019Web => std::option::Option::Some(29),
18360 Self::Sqlserver2022Standard => std::option::Option::Some(199),
18361 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
18362 Self::Sqlserver2022Express => std::option::Option::Some(201),
18363 Self::Sqlserver2022Web => std::option::Option::Some(202),
18364 Self::UnknownValue(u) => u.0.value(),
18365 }
18366 }
18367
18368 pub fn name(&self) -> std::option::Option<&str> {
18373 match self {
18374 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
18375 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
18376 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
18377 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
18378 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
18379 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
18380 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
18381 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
18382 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
18383 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
18384 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
18385 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
18386 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
18387 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
18388 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
18389 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
18390 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
18391 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
18392 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
18393 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
18394 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
18395 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
18396 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
18397 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
18398 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
18399 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
18400 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
18401 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
18402 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
18403 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
18404 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
18405 Self::Mysql8038 => std::option::Option::Some("MYSQL_8_0_38"),
18406 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
18407 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
18408 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
18409 Self::Mysql840 => std::option::Option::Some("MYSQL_8_4_0"),
18410 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
18411 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
18412 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
18413 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
18414 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
18415 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
18416 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
18417 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
18418 Self::UnknownValue(u) => u.0.name(),
18419 }
18420 }
18421}
18422
18423impl std::default::Default for SqlDatabaseVersion {
18424 fn default() -> Self {
18425 use std::convert::From;
18426 Self::from(0)
18427 }
18428}
18429
18430impl std::fmt::Display for SqlDatabaseVersion {
18431 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18432 wkt::internal::display_enum(f, self.name(), self.value())
18433 }
18434}
18435
18436impl std::convert::From<i32> for SqlDatabaseVersion {
18437 fn from(value: i32) -> Self {
18438 match value {
18439 0 => Self::Unspecified,
18440 2 => Self::Mysql51,
18441 3 => Self::Mysql55,
18442 5 => Self::Mysql56,
18443 6 => Self::Mysql57,
18444 9 => Self::Postgres96,
18445 10 => Self::Postgres11,
18446 11 => Self::Sqlserver2017Standard,
18447 14 => Self::Sqlserver2017Enterprise,
18448 15 => Self::Sqlserver2017Express,
18449 16 => Self::Sqlserver2017Web,
18450 18 => Self::Postgres10,
18451 19 => Self::Postgres12,
18452 20 => Self::Mysql80,
18453 23 => Self::Postgres13,
18454 26 => Self::Sqlserver2019Standard,
18455 27 => Self::Sqlserver2019Enterprise,
18456 28 => Self::Sqlserver2019Express,
18457 29 => Self::Sqlserver2019Web,
18458 41 => Self::Mysql8018,
18459 85 => Self::Mysql8026,
18460 110 => Self::Postgres14,
18461 111 => Self::Mysql8027,
18462 132 => Self::Mysql8028,
18463 148 => Self::Mysql8029,
18464 172 => Self::Postgres15,
18465 174 => Self::Mysql8030,
18466 197 => Self::Mysql8031,
18467 199 => Self::Sqlserver2022Standard,
18468 200 => Self::Sqlserver2022Enterprise,
18469 201 => Self::Sqlserver2022Express,
18470 202 => Self::Sqlserver2022Web,
18471 213 => Self::Mysql8032,
18472 238 => Self::Mysql8033,
18473 239 => Self::Mysql8034,
18474 240 => Self::Mysql8035,
18475 241 => Self::Mysql8036,
18476 272 => Self::Postgres16,
18477 355 => Self::Mysql8037,
18478 356 => Self::Mysql8038,
18479 357 => Self::Mysql8039,
18480 358 => Self::Mysql8040,
18481 398 => Self::Mysql84,
18482 399 => Self::Mysql840,
18483 _ => Self::UnknownValue(sql_database_version::UnknownValue(
18484 wkt::internal::UnknownEnumValue::Integer(value),
18485 )),
18486 }
18487 }
18488}
18489
18490impl std::convert::From<&str> for SqlDatabaseVersion {
18491 fn from(value: &str) -> Self {
18492 use std::string::ToString;
18493 match value {
18494 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
18495 "MYSQL_5_1" => Self::Mysql51,
18496 "MYSQL_5_5" => Self::Mysql55,
18497 "MYSQL_5_6" => Self::Mysql56,
18498 "MYSQL_5_7" => Self::Mysql57,
18499 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
18500 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
18501 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
18502 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
18503 "POSTGRES_9_6" => Self::Postgres96,
18504 "POSTGRES_10" => Self::Postgres10,
18505 "POSTGRES_11" => Self::Postgres11,
18506 "POSTGRES_12" => Self::Postgres12,
18507 "POSTGRES_13" => Self::Postgres13,
18508 "POSTGRES_14" => Self::Postgres14,
18509 "POSTGRES_15" => Self::Postgres15,
18510 "POSTGRES_16" => Self::Postgres16,
18511 "MYSQL_8_0" => Self::Mysql80,
18512 "MYSQL_8_0_18" => Self::Mysql8018,
18513 "MYSQL_8_0_26" => Self::Mysql8026,
18514 "MYSQL_8_0_27" => Self::Mysql8027,
18515 "MYSQL_8_0_28" => Self::Mysql8028,
18516 "MYSQL_8_0_29" => Self::Mysql8029,
18517 "MYSQL_8_0_30" => Self::Mysql8030,
18518 "MYSQL_8_0_31" => Self::Mysql8031,
18519 "MYSQL_8_0_32" => Self::Mysql8032,
18520 "MYSQL_8_0_33" => Self::Mysql8033,
18521 "MYSQL_8_0_34" => Self::Mysql8034,
18522 "MYSQL_8_0_35" => Self::Mysql8035,
18523 "MYSQL_8_0_36" => Self::Mysql8036,
18524 "MYSQL_8_0_37" => Self::Mysql8037,
18525 "MYSQL_8_0_38" => Self::Mysql8038,
18526 "MYSQL_8_0_39" => Self::Mysql8039,
18527 "MYSQL_8_0_40" => Self::Mysql8040,
18528 "MYSQL_8_4" => Self::Mysql84,
18529 "MYSQL_8_4_0" => Self::Mysql840,
18530 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
18531 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
18532 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
18533 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
18534 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
18535 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
18536 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
18537 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
18538 _ => Self::UnknownValue(sql_database_version::UnknownValue(
18539 wkt::internal::UnknownEnumValue::String(value.to_string()),
18540 )),
18541 }
18542 }
18543}
18544
18545impl serde::ser::Serialize for SqlDatabaseVersion {
18546 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18547 where
18548 S: serde::Serializer,
18549 {
18550 match self {
18551 Self::Unspecified => serializer.serialize_i32(0),
18552 Self::Mysql51 => serializer.serialize_i32(2),
18553 Self::Mysql55 => serializer.serialize_i32(3),
18554 Self::Mysql56 => serializer.serialize_i32(5),
18555 Self::Mysql57 => serializer.serialize_i32(6),
18556 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
18557 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
18558 Self::Sqlserver2017Express => serializer.serialize_i32(15),
18559 Self::Sqlserver2017Web => serializer.serialize_i32(16),
18560 Self::Postgres96 => serializer.serialize_i32(9),
18561 Self::Postgres10 => serializer.serialize_i32(18),
18562 Self::Postgres11 => serializer.serialize_i32(10),
18563 Self::Postgres12 => serializer.serialize_i32(19),
18564 Self::Postgres13 => serializer.serialize_i32(23),
18565 Self::Postgres14 => serializer.serialize_i32(110),
18566 Self::Postgres15 => serializer.serialize_i32(172),
18567 Self::Postgres16 => serializer.serialize_i32(272),
18568 Self::Mysql80 => serializer.serialize_i32(20),
18569 Self::Mysql8018 => serializer.serialize_i32(41),
18570 Self::Mysql8026 => serializer.serialize_i32(85),
18571 Self::Mysql8027 => serializer.serialize_i32(111),
18572 Self::Mysql8028 => serializer.serialize_i32(132),
18573 Self::Mysql8029 => serializer.serialize_i32(148),
18574 Self::Mysql8030 => serializer.serialize_i32(174),
18575 Self::Mysql8031 => serializer.serialize_i32(197),
18576 Self::Mysql8032 => serializer.serialize_i32(213),
18577 Self::Mysql8033 => serializer.serialize_i32(238),
18578 Self::Mysql8034 => serializer.serialize_i32(239),
18579 Self::Mysql8035 => serializer.serialize_i32(240),
18580 Self::Mysql8036 => serializer.serialize_i32(241),
18581 Self::Mysql8037 => serializer.serialize_i32(355),
18582 Self::Mysql8038 => serializer.serialize_i32(356),
18583 Self::Mysql8039 => serializer.serialize_i32(357),
18584 Self::Mysql8040 => serializer.serialize_i32(358),
18585 Self::Mysql84 => serializer.serialize_i32(398),
18586 Self::Mysql840 => serializer.serialize_i32(399),
18587 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
18588 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
18589 Self::Sqlserver2019Express => serializer.serialize_i32(28),
18590 Self::Sqlserver2019Web => serializer.serialize_i32(29),
18591 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
18592 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
18593 Self::Sqlserver2022Express => serializer.serialize_i32(201),
18594 Self::Sqlserver2022Web => serializer.serialize_i32(202),
18595 Self::UnknownValue(u) => u.0.serialize(serializer),
18596 }
18597 }
18598}
18599
18600impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
18601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18602 where
18603 D: serde::Deserializer<'de>,
18604 {
18605 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
18606 ".google.cloud.sql.v1.SqlDatabaseVersion",
18607 ))
18608 }
18609}
18610
18611#[derive(Clone, Debug, PartialEq)]
18627#[non_exhaustive]
18628pub enum SqlPricingPlan {
18629 Unspecified,
18631 Package,
18633 PerUse,
18635 UnknownValue(sql_pricing_plan::UnknownValue),
18640}
18641
18642#[doc(hidden)]
18643pub mod sql_pricing_plan {
18644 #[allow(unused_imports)]
18645 use super::*;
18646 #[derive(Clone, Debug, PartialEq)]
18647 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18648}
18649
18650impl SqlPricingPlan {
18651 pub fn value(&self) -> std::option::Option<i32> {
18656 match self {
18657 Self::Unspecified => std::option::Option::Some(0),
18658 Self::Package => std::option::Option::Some(1),
18659 Self::PerUse => std::option::Option::Some(2),
18660 Self::UnknownValue(u) => u.0.value(),
18661 }
18662 }
18663
18664 pub fn name(&self) -> std::option::Option<&str> {
18669 match self {
18670 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
18671 Self::Package => std::option::Option::Some("PACKAGE"),
18672 Self::PerUse => std::option::Option::Some("PER_USE"),
18673 Self::UnknownValue(u) => u.0.name(),
18674 }
18675 }
18676}
18677
18678impl std::default::Default for SqlPricingPlan {
18679 fn default() -> Self {
18680 use std::convert::From;
18681 Self::from(0)
18682 }
18683}
18684
18685impl std::fmt::Display for SqlPricingPlan {
18686 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18687 wkt::internal::display_enum(f, self.name(), self.value())
18688 }
18689}
18690
18691impl std::convert::From<i32> for SqlPricingPlan {
18692 fn from(value: i32) -> Self {
18693 match value {
18694 0 => Self::Unspecified,
18695 1 => Self::Package,
18696 2 => Self::PerUse,
18697 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18698 wkt::internal::UnknownEnumValue::Integer(value),
18699 )),
18700 }
18701 }
18702}
18703
18704impl std::convert::From<&str> for SqlPricingPlan {
18705 fn from(value: &str) -> Self {
18706 use std::string::ToString;
18707 match value {
18708 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
18709 "PACKAGE" => Self::Package,
18710 "PER_USE" => Self::PerUse,
18711 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
18712 wkt::internal::UnknownEnumValue::String(value.to_string()),
18713 )),
18714 }
18715 }
18716}
18717
18718impl serde::ser::Serialize for SqlPricingPlan {
18719 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18720 where
18721 S: serde::Serializer,
18722 {
18723 match self {
18724 Self::Unspecified => serializer.serialize_i32(0),
18725 Self::Package => serializer.serialize_i32(1),
18726 Self::PerUse => serializer.serialize_i32(2),
18727 Self::UnknownValue(u) => u.0.serialize(serializer),
18728 }
18729 }
18730}
18731
18732impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
18733 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18734 where
18735 D: serde::Deserializer<'de>,
18736 {
18737 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
18738 ".google.cloud.sql.v1.SqlPricingPlan",
18739 ))
18740 }
18741}
18742
18743#[derive(Clone, Debug, PartialEq)]
18758#[non_exhaustive]
18759pub enum SqlReplicationType {
18760 Unspecified,
18762 Synchronous,
18765 Asynchronous,
18770 UnknownValue(sql_replication_type::UnknownValue),
18775}
18776
18777#[doc(hidden)]
18778pub mod sql_replication_type {
18779 #[allow(unused_imports)]
18780 use super::*;
18781 #[derive(Clone, Debug, PartialEq)]
18782 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18783}
18784
18785impl SqlReplicationType {
18786 pub fn value(&self) -> std::option::Option<i32> {
18791 match self {
18792 Self::Unspecified => std::option::Option::Some(0),
18793 Self::Synchronous => std::option::Option::Some(1),
18794 Self::Asynchronous => std::option::Option::Some(2),
18795 Self::UnknownValue(u) => u.0.value(),
18796 }
18797 }
18798
18799 pub fn name(&self) -> std::option::Option<&str> {
18804 match self {
18805 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
18806 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
18807 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
18808 Self::UnknownValue(u) => u.0.name(),
18809 }
18810 }
18811}
18812
18813impl std::default::Default for SqlReplicationType {
18814 fn default() -> Self {
18815 use std::convert::From;
18816 Self::from(0)
18817 }
18818}
18819
18820impl std::fmt::Display for SqlReplicationType {
18821 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18822 wkt::internal::display_enum(f, self.name(), self.value())
18823 }
18824}
18825
18826impl std::convert::From<i32> for SqlReplicationType {
18827 fn from(value: i32) -> Self {
18828 match value {
18829 0 => Self::Unspecified,
18830 1 => Self::Synchronous,
18831 2 => Self::Asynchronous,
18832 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18833 wkt::internal::UnknownEnumValue::Integer(value),
18834 )),
18835 }
18836 }
18837}
18838
18839impl std::convert::From<&str> for SqlReplicationType {
18840 fn from(value: &str) -> Self {
18841 use std::string::ToString;
18842 match value {
18843 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
18844 "SYNCHRONOUS" => Self::Synchronous,
18845 "ASYNCHRONOUS" => Self::Asynchronous,
18846 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
18847 wkt::internal::UnknownEnumValue::String(value.to_string()),
18848 )),
18849 }
18850 }
18851}
18852
18853impl serde::ser::Serialize for SqlReplicationType {
18854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18855 where
18856 S: serde::Serializer,
18857 {
18858 match self {
18859 Self::Unspecified => serializer.serialize_i32(0),
18860 Self::Synchronous => serializer.serialize_i32(1),
18861 Self::Asynchronous => serializer.serialize_i32(2),
18862 Self::UnknownValue(u) => u.0.serialize(serializer),
18863 }
18864 }
18865}
18866
18867impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
18868 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18869 where
18870 D: serde::Deserializer<'de>,
18871 {
18872 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
18873 ".google.cloud.sql.v1.SqlReplicationType",
18874 ))
18875 }
18876}
18877
18878#[derive(Clone, Debug, PartialEq)]
18894#[non_exhaustive]
18895pub enum SqlDataDiskType {
18896 Unspecified,
18898 PdSsd,
18900 PdHdd,
18902 #[deprecated]
18905 ObsoleteLocalSsd,
18906 UnknownValue(sql_data_disk_type::UnknownValue),
18911}
18912
18913#[doc(hidden)]
18914pub mod sql_data_disk_type {
18915 #[allow(unused_imports)]
18916 use super::*;
18917 #[derive(Clone, Debug, PartialEq)]
18918 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18919}
18920
18921impl SqlDataDiskType {
18922 pub fn value(&self) -> std::option::Option<i32> {
18927 match self {
18928 Self::Unspecified => std::option::Option::Some(0),
18929 Self::PdSsd => std::option::Option::Some(1),
18930 Self::PdHdd => std::option::Option::Some(2),
18931 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
18932 Self::UnknownValue(u) => u.0.value(),
18933 }
18934 }
18935
18936 pub fn name(&self) -> std::option::Option<&str> {
18941 match self {
18942 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
18943 Self::PdSsd => std::option::Option::Some("PD_SSD"),
18944 Self::PdHdd => std::option::Option::Some("PD_HDD"),
18945 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
18946 Self::UnknownValue(u) => u.0.name(),
18947 }
18948 }
18949}
18950
18951impl std::default::Default for SqlDataDiskType {
18952 fn default() -> Self {
18953 use std::convert::From;
18954 Self::from(0)
18955 }
18956}
18957
18958impl std::fmt::Display for SqlDataDiskType {
18959 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18960 wkt::internal::display_enum(f, self.name(), self.value())
18961 }
18962}
18963
18964impl std::convert::From<i32> for SqlDataDiskType {
18965 fn from(value: i32) -> Self {
18966 match value {
18967 0 => Self::Unspecified,
18968 1 => Self::PdSsd,
18969 2 => Self::PdHdd,
18970 3 => Self::ObsoleteLocalSsd,
18971 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18972 wkt::internal::UnknownEnumValue::Integer(value),
18973 )),
18974 }
18975 }
18976}
18977
18978impl std::convert::From<&str> for SqlDataDiskType {
18979 fn from(value: &str) -> Self {
18980 use std::string::ToString;
18981 match value {
18982 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
18983 "PD_SSD" => Self::PdSsd,
18984 "PD_HDD" => Self::PdHdd,
18985 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
18986 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
18987 wkt::internal::UnknownEnumValue::String(value.to_string()),
18988 )),
18989 }
18990 }
18991}
18992
18993impl serde::ser::Serialize for SqlDataDiskType {
18994 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18995 where
18996 S: serde::Serializer,
18997 {
18998 match self {
18999 Self::Unspecified => serializer.serialize_i32(0),
19000 Self::PdSsd => serializer.serialize_i32(1),
19001 Self::PdHdd => serializer.serialize_i32(2),
19002 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
19003 Self::UnknownValue(u) => u.0.serialize(serializer),
19004 }
19005 }
19006}
19007
19008impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
19009 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19010 where
19011 D: serde::Deserializer<'de>,
19012 {
19013 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
19014 ".google.cloud.sql.v1.SqlDataDiskType",
19015 ))
19016 }
19017}
19018
19019#[derive(Clone, Debug, PartialEq)]
19035#[non_exhaustive]
19036pub enum SqlAvailabilityType {
19037 Unspecified,
19039 Zonal,
19041 Regional,
19043 UnknownValue(sql_availability_type::UnknownValue),
19048}
19049
19050#[doc(hidden)]
19051pub mod sql_availability_type {
19052 #[allow(unused_imports)]
19053 use super::*;
19054 #[derive(Clone, Debug, PartialEq)]
19055 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19056}
19057
19058impl SqlAvailabilityType {
19059 pub fn value(&self) -> std::option::Option<i32> {
19064 match self {
19065 Self::Unspecified => std::option::Option::Some(0),
19066 Self::Zonal => std::option::Option::Some(1),
19067 Self::Regional => std::option::Option::Some(2),
19068 Self::UnknownValue(u) => u.0.value(),
19069 }
19070 }
19071
19072 pub fn name(&self) -> std::option::Option<&str> {
19077 match self {
19078 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
19079 Self::Zonal => std::option::Option::Some("ZONAL"),
19080 Self::Regional => std::option::Option::Some("REGIONAL"),
19081 Self::UnknownValue(u) => u.0.name(),
19082 }
19083 }
19084}
19085
19086impl std::default::Default for SqlAvailabilityType {
19087 fn default() -> Self {
19088 use std::convert::From;
19089 Self::from(0)
19090 }
19091}
19092
19093impl std::fmt::Display for SqlAvailabilityType {
19094 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19095 wkt::internal::display_enum(f, self.name(), self.value())
19096 }
19097}
19098
19099impl std::convert::From<i32> for SqlAvailabilityType {
19100 fn from(value: i32) -> Self {
19101 match value {
19102 0 => Self::Unspecified,
19103 1 => Self::Zonal,
19104 2 => Self::Regional,
19105 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
19106 wkt::internal::UnknownEnumValue::Integer(value),
19107 )),
19108 }
19109 }
19110}
19111
19112impl std::convert::From<&str> for SqlAvailabilityType {
19113 fn from(value: &str) -> Self {
19114 use std::string::ToString;
19115 match value {
19116 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
19117 "ZONAL" => Self::Zonal,
19118 "REGIONAL" => Self::Regional,
19119 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
19120 wkt::internal::UnknownEnumValue::String(value.to_string()),
19121 )),
19122 }
19123 }
19124}
19125
19126impl serde::ser::Serialize for SqlAvailabilityType {
19127 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19128 where
19129 S: serde::Serializer,
19130 {
19131 match self {
19132 Self::Unspecified => serializer.serialize_i32(0),
19133 Self::Zonal => serializer.serialize_i32(1),
19134 Self::Regional => serializer.serialize_i32(2),
19135 Self::UnknownValue(u) => u.0.serialize(serializer),
19136 }
19137 }
19138}
19139
19140impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
19141 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19142 where
19143 D: serde::Deserializer<'de>,
19144 {
19145 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
19146 ".google.cloud.sql.v1.SqlAvailabilityType",
19147 ))
19148 }
19149}
19150
19151#[derive(Clone, Debug, PartialEq)]
19166#[non_exhaustive]
19167pub enum SqlUpdateTrack {
19168 Unspecified,
19170 Canary,
19175 Stable,
19180 Week5,
19184 UnknownValue(sql_update_track::UnknownValue),
19189}
19190
19191#[doc(hidden)]
19192pub mod sql_update_track {
19193 #[allow(unused_imports)]
19194 use super::*;
19195 #[derive(Clone, Debug, PartialEq)]
19196 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19197}
19198
19199impl SqlUpdateTrack {
19200 pub fn value(&self) -> std::option::Option<i32> {
19205 match self {
19206 Self::Unspecified => std::option::Option::Some(0),
19207 Self::Canary => std::option::Option::Some(1),
19208 Self::Stable => std::option::Option::Some(2),
19209 Self::Week5 => std::option::Option::Some(3),
19210 Self::UnknownValue(u) => u.0.value(),
19211 }
19212 }
19213
19214 pub fn name(&self) -> std::option::Option<&str> {
19219 match self {
19220 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
19221 Self::Canary => std::option::Option::Some("canary"),
19222 Self::Stable => std::option::Option::Some("stable"),
19223 Self::Week5 => std::option::Option::Some("week5"),
19224 Self::UnknownValue(u) => u.0.name(),
19225 }
19226 }
19227}
19228
19229impl std::default::Default for SqlUpdateTrack {
19230 fn default() -> Self {
19231 use std::convert::From;
19232 Self::from(0)
19233 }
19234}
19235
19236impl std::fmt::Display for SqlUpdateTrack {
19237 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19238 wkt::internal::display_enum(f, self.name(), self.value())
19239 }
19240}
19241
19242impl std::convert::From<i32> for SqlUpdateTrack {
19243 fn from(value: i32) -> Self {
19244 match value {
19245 0 => Self::Unspecified,
19246 1 => Self::Canary,
19247 2 => Self::Stable,
19248 3 => Self::Week5,
19249 _ => Self::UnknownValue(sql_update_track::UnknownValue(
19250 wkt::internal::UnknownEnumValue::Integer(value),
19251 )),
19252 }
19253 }
19254}
19255
19256impl std::convert::From<&str> for SqlUpdateTrack {
19257 fn from(value: &str) -> Self {
19258 use std::string::ToString;
19259 match value {
19260 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
19261 "canary" => Self::Canary,
19262 "stable" => Self::Stable,
19263 "week5" => Self::Week5,
19264 _ => Self::UnknownValue(sql_update_track::UnknownValue(
19265 wkt::internal::UnknownEnumValue::String(value.to_string()),
19266 )),
19267 }
19268 }
19269}
19270
19271impl serde::ser::Serialize for SqlUpdateTrack {
19272 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19273 where
19274 S: serde::Serializer,
19275 {
19276 match self {
19277 Self::Unspecified => serializer.serialize_i32(0),
19278 Self::Canary => serializer.serialize_i32(1),
19279 Self::Stable => serializer.serialize_i32(2),
19280 Self::Week5 => serializer.serialize_i32(3),
19281 Self::UnknownValue(u) => u.0.serialize(serializer),
19282 }
19283 }
19284}
19285
19286impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
19287 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19288 where
19289 D: serde::Deserializer<'de>,
19290 {
19291 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
19292 ".google.cloud.sql.v1.SqlUpdateTrack",
19293 ))
19294 }
19295}