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 gtype;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct CreateClusterRequest {
45 pub parent: std::string::String,
49
50 pub cluster_id: std::string::String,
59
60 pub cluster: std::option::Option<crate::model::Cluster>,
62
63 pub request_id: std::string::String,
65
66 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
67}
68
69impl CreateClusterRequest {
70 pub fn new() -> Self {
71 std::default::Default::default()
72 }
73
74 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76 self.parent = v.into();
77 self
78 }
79
80 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82 self.cluster_id = v.into();
83 self
84 }
85
86 pub fn set_cluster<T>(mut self, v: T) -> Self
88 where
89 T: std::convert::Into<crate::model::Cluster>,
90 {
91 self.cluster = std::option::Option::Some(v.into());
92 self
93 }
94
95 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
97 where
98 T: std::convert::Into<crate::model::Cluster>,
99 {
100 self.cluster = v.map(|x| x.into());
101 self
102 }
103
104 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
106 self.request_id = v.into();
107 self
108 }
109}
110
111impl wkt::message::Message for CreateClusterRequest {
112 fn typename() -> &'static str {
113 "type.googleapis.com/google.cloud.redis.cluster.v1.CreateClusterRequest"
114 }
115}
116
117#[derive(Clone, Default, PartialEq)]
119#[non_exhaustive]
120pub struct ListClustersRequest {
121 pub parent: std::string::String,
125
126 pub page_size: i32,
136
137 pub page_token: std::string::String,
140
141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
142}
143
144impl ListClustersRequest {
145 pub fn new() -> Self {
146 std::default::Default::default()
147 }
148
149 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
151 self.parent = v.into();
152 self
153 }
154
155 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
157 self.page_size = v.into();
158 self
159 }
160
161 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
163 self.page_token = v.into();
164 self
165 }
166}
167
168impl wkt::message::Message for ListClustersRequest {
169 fn typename() -> &'static str {
170 "type.googleapis.com/google.cloud.redis.cluster.v1.ListClustersRequest"
171 }
172}
173
174#[derive(Clone, Default, PartialEq)]
176#[non_exhaustive]
177pub struct ListClustersResponse {
178 pub clusters: std::vec::Vec<crate::model::Cluster>,
190
191 pub next_page_token: std::string::String,
194
195 pub unreachable: std::vec::Vec<std::string::String>,
197
198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
199}
200
201impl ListClustersResponse {
202 pub fn new() -> Self {
203 std::default::Default::default()
204 }
205
206 pub fn set_clusters<T, V>(mut self, v: T) -> Self
208 where
209 T: std::iter::IntoIterator<Item = V>,
210 V: std::convert::Into<crate::model::Cluster>,
211 {
212 use std::iter::Iterator;
213 self.clusters = v.into_iter().map(|i| i.into()).collect();
214 self
215 }
216
217 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219 self.next_page_token = v.into();
220 self
221 }
222
223 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
225 where
226 T: std::iter::IntoIterator<Item = V>,
227 V: std::convert::Into<std::string::String>,
228 {
229 use std::iter::Iterator;
230 self.unreachable = v.into_iter().map(|i| i.into()).collect();
231 self
232 }
233}
234
235impl wkt::message::Message for ListClustersResponse {
236 fn typename() -> &'static str {
237 "type.googleapis.com/google.cloud.redis.cluster.v1.ListClustersResponse"
238 }
239}
240
241#[doc(hidden)]
242impl gax::paginator::internal::PageableResponse for ListClustersResponse {
243 type PageItem = crate::model::Cluster;
244
245 fn items(self) -> std::vec::Vec<Self::PageItem> {
246 self.clusters
247 }
248
249 fn next_page_token(&self) -> std::string::String {
250 use std::clone::Clone;
251 self.next_page_token.clone()
252 }
253}
254
255#[derive(Clone, Default, PartialEq)]
257#[non_exhaustive]
258pub struct UpdateClusterRequest {
259 pub update_mask: std::option::Option<wkt::FieldMask>,
268
269 pub cluster: std::option::Option<crate::model::Cluster>,
272
273 pub request_id: std::string::String,
275
276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
277}
278
279impl UpdateClusterRequest {
280 pub fn new() -> Self {
281 std::default::Default::default()
282 }
283
284 pub fn set_update_mask<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<wkt::FieldMask>,
288 {
289 self.update_mask = std::option::Option::Some(v.into());
290 self
291 }
292
293 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
295 where
296 T: std::convert::Into<wkt::FieldMask>,
297 {
298 self.update_mask = v.map(|x| x.into());
299 self
300 }
301
302 pub fn set_cluster<T>(mut self, v: T) -> Self
304 where
305 T: std::convert::Into<crate::model::Cluster>,
306 {
307 self.cluster = std::option::Option::Some(v.into());
308 self
309 }
310
311 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
313 where
314 T: std::convert::Into<crate::model::Cluster>,
315 {
316 self.cluster = v.map(|x| x.into());
317 self
318 }
319
320 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
322 self.request_id = v.into();
323 self
324 }
325}
326
327impl wkt::message::Message for UpdateClusterRequest {
328 fn typename() -> &'static str {
329 "type.googleapis.com/google.cloud.redis.cluster.v1.UpdateClusterRequest"
330 }
331}
332
333#[derive(Clone, Default, PartialEq)]
335#[non_exhaustive]
336pub struct GetClusterRequest {
337 pub name: std::string::String,
341
342 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
343}
344
345impl GetClusterRequest {
346 pub fn new() -> Self {
347 std::default::Default::default()
348 }
349
350 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
352 self.name = v.into();
353 self
354 }
355}
356
357impl wkt::message::Message for GetClusterRequest {
358 fn typename() -> &'static str {
359 "type.googleapis.com/google.cloud.redis.cluster.v1.GetClusterRequest"
360 }
361}
362
363#[derive(Clone, Default, PartialEq)]
365#[non_exhaustive]
366pub struct DeleteClusterRequest {
367 pub name: std::string::String,
371
372 pub request_id: std::string::String,
374
375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
376}
377
378impl DeleteClusterRequest {
379 pub fn new() -> Self {
380 std::default::Default::default()
381 }
382
383 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
385 self.name = v.into();
386 self
387 }
388
389 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
391 self.request_id = v.into();
392 self
393 }
394}
395
396impl wkt::message::Message for DeleteClusterRequest {
397 fn typename() -> &'static str {
398 "type.googleapis.com/google.cloud.redis.cluster.v1.DeleteClusterRequest"
399 }
400}
401
402#[derive(Clone, Default, PartialEq)]
405#[non_exhaustive]
406pub struct GetClusterCertificateAuthorityRequest {
407 pub name: std::string::String,
411
412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
413}
414
415impl GetClusterCertificateAuthorityRequest {
416 pub fn new() -> Self {
417 std::default::Default::default()
418 }
419
420 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
422 self.name = v.into();
423 self
424 }
425}
426
427impl wkt::message::Message for GetClusterCertificateAuthorityRequest {
428 fn typename() -> &'static str {
429 "type.googleapis.com/google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest"
430 }
431}
432
433#[derive(Clone, Default, PartialEq)]
435#[non_exhaustive]
436pub struct ListBackupCollectionsRequest {
437 pub parent: std::string::String,
442
443 pub page_size: i32,
453
454 pub page_token: std::string::String,
457
458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
459}
460
461impl ListBackupCollectionsRequest {
462 pub fn new() -> Self {
463 std::default::Default::default()
464 }
465
466 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
468 self.parent = v.into();
469 self
470 }
471
472 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
474 self.page_size = v.into();
475 self
476 }
477
478 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
480 self.page_token = v.into();
481 self
482 }
483}
484
485impl wkt::message::Message for ListBackupCollectionsRequest {
486 fn typename() -> &'static str {
487 "type.googleapis.com/google.cloud.redis.cluster.v1.ListBackupCollectionsRequest"
488 }
489}
490
491#[derive(Clone, Default, PartialEq)]
493#[non_exhaustive]
494pub struct ListBackupCollectionsResponse {
495 pub backup_collections: std::vec::Vec<crate::model::BackupCollection>,
506
507 pub next_page_token: std::string::String,
510
511 pub unreachable: std::vec::Vec<std::string::String>,
513
514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
515}
516
517impl ListBackupCollectionsResponse {
518 pub fn new() -> Self {
519 std::default::Default::default()
520 }
521
522 pub fn set_backup_collections<T, V>(mut self, v: T) -> Self
524 where
525 T: std::iter::IntoIterator<Item = V>,
526 V: std::convert::Into<crate::model::BackupCollection>,
527 {
528 use std::iter::Iterator;
529 self.backup_collections = v.into_iter().map(|i| i.into()).collect();
530 self
531 }
532
533 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
535 self.next_page_token = v.into();
536 self
537 }
538
539 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
541 where
542 T: std::iter::IntoIterator<Item = V>,
543 V: std::convert::Into<std::string::String>,
544 {
545 use std::iter::Iterator;
546 self.unreachable = v.into_iter().map(|i| i.into()).collect();
547 self
548 }
549}
550
551impl wkt::message::Message for ListBackupCollectionsResponse {
552 fn typename() -> &'static str {
553 "type.googleapis.com/google.cloud.redis.cluster.v1.ListBackupCollectionsResponse"
554 }
555}
556
557#[doc(hidden)]
558impl gax::paginator::internal::PageableResponse for ListBackupCollectionsResponse {
559 type PageItem = crate::model::BackupCollection;
560
561 fn items(self) -> std::vec::Vec<Self::PageItem> {
562 self.backup_collections
563 }
564
565 fn next_page_token(&self) -> std::string::String {
566 use std::clone::Clone;
567 self.next_page_token.clone()
568 }
569}
570
571#[derive(Clone, Default, PartialEq)]
573#[non_exhaustive]
574pub struct GetBackupCollectionRequest {
575 pub name: std::string::String,
579
580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
581}
582
583impl GetBackupCollectionRequest {
584 pub fn new() -> Self {
585 std::default::Default::default()
586 }
587
588 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
590 self.name = v.into();
591 self
592 }
593}
594
595impl wkt::message::Message for GetBackupCollectionRequest {
596 fn typename() -> &'static str {
597 "type.googleapis.com/google.cloud.redis.cluster.v1.GetBackupCollectionRequest"
598 }
599}
600
601#[derive(Clone, Default, PartialEq)]
603#[non_exhaustive]
604pub struct ListBackupsRequest {
605 pub parent: std::string::String,
608
609 pub page_size: i32,
619
620 pub page_token: std::string::String,
623
624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
625}
626
627impl ListBackupsRequest {
628 pub fn new() -> Self {
629 std::default::Default::default()
630 }
631
632 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
634 self.parent = v.into();
635 self
636 }
637
638 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
640 self.page_size = v.into();
641 self
642 }
643
644 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
646 self.page_token = v.into();
647 self
648 }
649}
650
651impl wkt::message::Message for ListBackupsRequest {
652 fn typename() -> &'static str {
653 "type.googleapis.com/google.cloud.redis.cluster.v1.ListBackupsRequest"
654 }
655}
656
657#[derive(Clone, Default, PartialEq)]
659#[non_exhaustive]
660pub struct ListBackupsResponse {
661 pub backups: std::vec::Vec<crate::model::Backup>,
663
664 pub next_page_token: std::string::String,
667
668 pub unreachable: std::vec::Vec<std::string::String>,
670
671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
672}
673
674impl ListBackupsResponse {
675 pub fn new() -> Self {
676 std::default::Default::default()
677 }
678
679 pub fn set_backups<T, V>(mut self, v: T) -> Self
681 where
682 T: std::iter::IntoIterator<Item = V>,
683 V: std::convert::Into<crate::model::Backup>,
684 {
685 use std::iter::Iterator;
686 self.backups = v.into_iter().map(|i| i.into()).collect();
687 self
688 }
689
690 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
692 self.next_page_token = v.into();
693 self
694 }
695
696 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
698 where
699 T: std::iter::IntoIterator<Item = V>,
700 V: std::convert::Into<std::string::String>,
701 {
702 use std::iter::Iterator;
703 self.unreachable = v.into_iter().map(|i| i.into()).collect();
704 self
705 }
706}
707
708impl wkt::message::Message for ListBackupsResponse {
709 fn typename() -> &'static str {
710 "type.googleapis.com/google.cloud.redis.cluster.v1.ListBackupsResponse"
711 }
712}
713
714#[doc(hidden)]
715impl gax::paginator::internal::PageableResponse for ListBackupsResponse {
716 type PageItem = crate::model::Backup;
717
718 fn items(self) -> std::vec::Vec<Self::PageItem> {
719 self.backups
720 }
721
722 fn next_page_token(&self) -> std::string::String {
723 use std::clone::Clone;
724 self.next_page_token.clone()
725 }
726}
727
728#[derive(Clone, Default, PartialEq)]
730#[non_exhaustive]
731pub struct GetBackupRequest {
732 pub name: std::string::String,
735
736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
737}
738
739impl GetBackupRequest {
740 pub fn new() -> Self {
741 std::default::Default::default()
742 }
743
744 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
746 self.name = v.into();
747 self
748 }
749}
750
751impl wkt::message::Message for GetBackupRequest {
752 fn typename() -> &'static str {
753 "type.googleapis.com/google.cloud.redis.cluster.v1.GetBackupRequest"
754 }
755}
756
757#[derive(Clone, Default, PartialEq)]
759#[non_exhaustive]
760pub struct DeleteBackupRequest {
761 pub name: std::string::String,
764
765 pub request_id: std::string::String,
767
768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
769}
770
771impl DeleteBackupRequest {
772 pub fn new() -> Self {
773 std::default::Default::default()
774 }
775
776 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
778 self.name = v.into();
779 self
780 }
781
782 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
784 self.request_id = v.into();
785 self
786 }
787}
788
789impl wkt::message::Message for DeleteBackupRequest {
790 fn typename() -> &'static str {
791 "type.googleapis.com/google.cloud.redis.cluster.v1.DeleteBackupRequest"
792 }
793}
794
795#[derive(Clone, Default, PartialEq)]
797#[non_exhaustive]
798pub struct ExportBackupRequest {
799 pub name: std::string::String,
802
803 pub destination: std::option::Option<crate::model::export_backup_request::Destination>,
805
806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
807}
808
809impl ExportBackupRequest {
810 pub fn new() -> Self {
811 std::default::Default::default()
812 }
813
814 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
816 self.name = v.into();
817 self
818 }
819
820 pub fn set_destination<
825 T: std::convert::Into<std::option::Option<crate::model::export_backup_request::Destination>>,
826 >(
827 mut self,
828 v: T,
829 ) -> Self {
830 self.destination = v.into();
831 self
832 }
833
834 pub fn gcs_bucket(&self) -> std::option::Option<&std::string::String> {
838 #[allow(unreachable_patterns)]
839 self.destination.as_ref().and_then(|v| match v {
840 crate::model::export_backup_request::Destination::GcsBucket(v) => {
841 std::option::Option::Some(v)
842 }
843 _ => std::option::Option::None,
844 })
845 }
846
847 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
853 self.destination = std::option::Option::Some(
854 crate::model::export_backup_request::Destination::GcsBucket(v.into()),
855 );
856 self
857 }
858}
859
860impl wkt::message::Message for ExportBackupRequest {
861 fn typename() -> &'static str {
862 "type.googleapis.com/google.cloud.redis.cluster.v1.ExportBackupRequest"
863 }
864}
865
866pub mod export_backup_request {
868 #[allow(unused_imports)]
869 use super::*;
870
871 #[derive(Clone, Debug, PartialEq)]
873 #[non_exhaustive]
874 pub enum Destination {
875 GcsBucket(std::string::String),
877 }
878}
879
880#[derive(Clone, Default, PartialEq)]
882#[non_exhaustive]
883pub struct BackupClusterRequest {
884 pub name: std::string::String,
888
889 pub ttl: std::option::Option<wkt::Duration>,
892
893 pub backup_id: std::option::Option<std::string::String>,
896
897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
898}
899
900impl BackupClusterRequest {
901 pub fn new() -> Self {
902 std::default::Default::default()
903 }
904
905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
907 self.name = v.into();
908 self
909 }
910
911 pub fn set_ttl<T>(mut self, v: T) -> Self
913 where
914 T: std::convert::Into<wkt::Duration>,
915 {
916 self.ttl = std::option::Option::Some(v.into());
917 self
918 }
919
920 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
922 where
923 T: std::convert::Into<wkt::Duration>,
924 {
925 self.ttl = v.map(|x| x.into());
926 self
927 }
928
929 pub fn set_backup_id<T>(mut self, v: T) -> Self
931 where
932 T: std::convert::Into<std::string::String>,
933 {
934 self.backup_id = std::option::Option::Some(v.into());
935 self
936 }
937
938 pub fn set_or_clear_backup_id<T>(mut self, v: std::option::Option<T>) -> Self
940 where
941 T: std::convert::Into<std::string::String>,
942 {
943 self.backup_id = v.map(|x| x.into());
944 self
945 }
946}
947
948impl wkt::message::Message for BackupClusterRequest {
949 fn typename() -> &'static str {
950 "type.googleapis.com/google.cloud.redis.cluster.v1.BackupClusterRequest"
951 }
952}
953
954#[derive(Clone, Default, PartialEq)]
956#[non_exhaustive]
957pub struct Cluster {
958 pub name: std::string::String,
962
963 pub create_time: std::option::Option<wkt::Timestamp>,
965
966 pub state: crate::model::cluster::State,
969
970 pub uid: std::string::String,
972
973 pub replica_count: std::option::Option<i32>,
975
976 pub authorization_mode: crate::model::AuthorizationMode,
979
980 pub transit_encryption_mode: crate::model::TransitEncryptionMode,
983
984 pub size_gb: std::option::Option<i32>,
987
988 pub shard_count: std::option::Option<i32>,
990
991 pub psc_configs: std::vec::Vec<crate::model::PscConfig>,
995
996 pub discovery_endpoints: std::vec::Vec<crate::model::DiscoveryEndpoint>,
999
1000 pub psc_connections: std::vec::Vec<crate::model::PscConnection>,
1003
1004 pub state_info: std::option::Option<crate::model::cluster::StateInfo>,
1006
1007 pub node_type: crate::model::NodeType,
1010
1011 pub persistence_config: std::option::Option<crate::model::ClusterPersistenceConfig>,
1013
1014 pub redis_configs: std::collections::HashMap<std::string::String, std::string::String>,
1016
1017 pub precise_size_gb: std::option::Option<f64>,
1020
1021 pub zone_distribution_config: std::option::Option<crate::model::ZoneDistributionConfig>,
1024
1025 pub cross_cluster_replication_config:
1027 std::option::Option<crate::model::CrossClusterReplicationConfig>,
1028
1029 pub deletion_protection_enabled: std::option::Option<bool>,
1031
1032 pub maintenance_policy: std::option::Option<crate::model::ClusterMaintenancePolicy>,
1035
1036 pub maintenance_schedule: std::option::Option<crate::model::ClusterMaintenanceSchedule>,
1039
1040 pub psc_service_attachments: std::vec::Vec<crate::model::PscServiceAttachment>,
1042
1043 pub cluster_endpoints: std::vec::Vec<crate::model::ClusterEndpoint>,
1045
1046 pub backup_collection: std::option::Option<std::string::String>,
1049
1050 pub kms_key: std::option::Option<std::string::String>,
1052
1053 pub automated_backup_config: std::option::Option<crate::model::AutomatedBackupConfig>,
1055
1056 pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
1058
1059 pub import_sources: std::option::Option<crate::model::cluster::ImportSources>,
1061
1062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063}
1064
1065impl Cluster {
1066 pub fn new() -> Self {
1067 std::default::Default::default()
1068 }
1069
1070 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.name = v.into();
1073 self
1074 }
1075
1076 pub fn set_create_time<T>(mut self, v: T) -> Self
1078 where
1079 T: std::convert::Into<wkt::Timestamp>,
1080 {
1081 self.create_time = std::option::Option::Some(v.into());
1082 self
1083 }
1084
1085 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1087 where
1088 T: std::convert::Into<wkt::Timestamp>,
1089 {
1090 self.create_time = v.map(|x| x.into());
1091 self
1092 }
1093
1094 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
1096 self.state = v.into();
1097 self
1098 }
1099
1100 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.uid = v.into();
1103 self
1104 }
1105
1106 pub fn set_replica_count<T>(mut self, v: T) -> Self
1108 where
1109 T: std::convert::Into<i32>,
1110 {
1111 self.replica_count = std::option::Option::Some(v.into());
1112 self
1113 }
1114
1115 pub fn set_or_clear_replica_count<T>(mut self, v: std::option::Option<T>) -> Self
1117 where
1118 T: std::convert::Into<i32>,
1119 {
1120 self.replica_count = v.map(|x| x.into());
1121 self
1122 }
1123
1124 pub fn set_authorization_mode<T: std::convert::Into<crate::model::AuthorizationMode>>(
1126 mut self,
1127 v: T,
1128 ) -> Self {
1129 self.authorization_mode = v.into();
1130 self
1131 }
1132
1133 pub fn set_transit_encryption_mode<
1135 T: std::convert::Into<crate::model::TransitEncryptionMode>,
1136 >(
1137 mut self,
1138 v: T,
1139 ) -> Self {
1140 self.transit_encryption_mode = v.into();
1141 self
1142 }
1143
1144 pub fn set_size_gb<T>(mut self, v: T) -> Self
1146 where
1147 T: std::convert::Into<i32>,
1148 {
1149 self.size_gb = std::option::Option::Some(v.into());
1150 self
1151 }
1152
1153 pub fn set_or_clear_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
1155 where
1156 T: std::convert::Into<i32>,
1157 {
1158 self.size_gb = v.map(|x| x.into());
1159 self
1160 }
1161
1162 pub fn set_shard_count<T>(mut self, v: T) -> Self
1164 where
1165 T: std::convert::Into<i32>,
1166 {
1167 self.shard_count = std::option::Option::Some(v.into());
1168 self
1169 }
1170
1171 pub fn set_or_clear_shard_count<T>(mut self, v: std::option::Option<T>) -> Self
1173 where
1174 T: std::convert::Into<i32>,
1175 {
1176 self.shard_count = v.map(|x| x.into());
1177 self
1178 }
1179
1180 pub fn set_psc_configs<T, V>(mut self, v: T) -> Self
1182 where
1183 T: std::iter::IntoIterator<Item = V>,
1184 V: std::convert::Into<crate::model::PscConfig>,
1185 {
1186 use std::iter::Iterator;
1187 self.psc_configs = v.into_iter().map(|i| i.into()).collect();
1188 self
1189 }
1190
1191 pub fn set_discovery_endpoints<T, V>(mut self, v: T) -> Self
1193 where
1194 T: std::iter::IntoIterator<Item = V>,
1195 V: std::convert::Into<crate::model::DiscoveryEndpoint>,
1196 {
1197 use std::iter::Iterator;
1198 self.discovery_endpoints = v.into_iter().map(|i| i.into()).collect();
1199 self
1200 }
1201
1202 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1204 where
1205 T: std::iter::IntoIterator<Item = V>,
1206 V: std::convert::Into<crate::model::PscConnection>,
1207 {
1208 use std::iter::Iterator;
1209 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1210 self
1211 }
1212
1213 pub fn set_state_info<T>(mut self, v: T) -> Self
1215 where
1216 T: std::convert::Into<crate::model::cluster::StateInfo>,
1217 {
1218 self.state_info = std::option::Option::Some(v.into());
1219 self
1220 }
1221
1222 pub fn set_or_clear_state_info<T>(mut self, v: std::option::Option<T>) -> Self
1224 where
1225 T: std::convert::Into<crate::model::cluster::StateInfo>,
1226 {
1227 self.state_info = v.map(|x| x.into());
1228 self
1229 }
1230
1231 pub fn set_node_type<T: std::convert::Into<crate::model::NodeType>>(mut self, v: T) -> Self {
1233 self.node_type = v.into();
1234 self
1235 }
1236
1237 pub fn set_persistence_config<T>(mut self, v: T) -> Self
1239 where
1240 T: std::convert::Into<crate::model::ClusterPersistenceConfig>,
1241 {
1242 self.persistence_config = std::option::Option::Some(v.into());
1243 self
1244 }
1245
1246 pub fn set_or_clear_persistence_config<T>(mut self, v: std::option::Option<T>) -> Self
1248 where
1249 T: std::convert::Into<crate::model::ClusterPersistenceConfig>,
1250 {
1251 self.persistence_config = v.map(|x| x.into());
1252 self
1253 }
1254
1255 pub fn set_redis_configs<T, K, V>(mut self, v: T) -> Self
1257 where
1258 T: std::iter::IntoIterator<Item = (K, V)>,
1259 K: std::convert::Into<std::string::String>,
1260 V: std::convert::Into<std::string::String>,
1261 {
1262 use std::iter::Iterator;
1263 self.redis_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1264 self
1265 }
1266
1267 pub fn set_precise_size_gb<T>(mut self, v: T) -> Self
1269 where
1270 T: std::convert::Into<f64>,
1271 {
1272 self.precise_size_gb = std::option::Option::Some(v.into());
1273 self
1274 }
1275
1276 pub fn set_or_clear_precise_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
1278 where
1279 T: std::convert::Into<f64>,
1280 {
1281 self.precise_size_gb = v.map(|x| x.into());
1282 self
1283 }
1284
1285 pub fn set_zone_distribution_config<T>(mut self, v: T) -> Self
1287 where
1288 T: std::convert::Into<crate::model::ZoneDistributionConfig>,
1289 {
1290 self.zone_distribution_config = std::option::Option::Some(v.into());
1291 self
1292 }
1293
1294 pub fn set_or_clear_zone_distribution_config<T>(mut self, v: std::option::Option<T>) -> Self
1296 where
1297 T: std::convert::Into<crate::model::ZoneDistributionConfig>,
1298 {
1299 self.zone_distribution_config = v.map(|x| x.into());
1300 self
1301 }
1302
1303 pub fn set_cross_cluster_replication_config<T>(mut self, v: T) -> Self
1305 where
1306 T: std::convert::Into<crate::model::CrossClusterReplicationConfig>,
1307 {
1308 self.cross_cluster_replication_config = std::option::Option::Some(v.into());
1309 self
1310 }
1311
1312 pub fn set_or_clear_cross_cluster_replication_config<T>(
1314 mut self,
1315 v: std::option::Option<T>,
1316 ) -> Self
1317 where
1318 T: std::convert::Into<crate::model::CrossClusterReplicationConfig>,
1319 {
1320 self.cross_cluster_replication_config = v.map(|x| x.into());
1321 self
1322 }
1323
1324 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
1326 where
1327 T: std::convert::Into<bool>,
1328 {
1329 self.deletion_protection_enabled = std::option::Option::Some(v.into());
1330 self
1331 }
1332
1333 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
1335 where
1336 T: std::convert::Into<bool>,
1337 {
1338 self.deletion_protection_enabled = v.map(|x| x.into());
1339 self
1340 }
1341
1342 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
1344 where
1345 T: std::convert::Into<crate::model::ClusterMaintenancePolicy>,
1346 {
1347 self.maintenance_policy = std::option::Option::Some(v.into());
1348 self
1349 }
1350
1351 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
1353 where
1354 T: std::convert::Into<crate::model::ClusterMaintenancePolicy>,
1355 {
1356 self.maintenance_policy = v.map(|x| x.into());
1357 self
1358 }
1359
1360 pub fn set_maintenance_schedule<T>(mut self, v: T) -> Self
1362 where
1363 T: std::convert::Into<crate::model::ClusterMaintenanceSchedule>,
1364 {
1365 self.maintenance_schedule = std::option::Option::Some(v.into());
1366 self
1367 }
1368
1369 pub fn set_or_clear_maintenance_schedule<T>(mut self, v: std::option::Option<T>) -> Self
1371 where
1372 T: std::convert::Into<crate::model::ClusterMaintenanceSchedule>,
1373 {
1374 self.maintenance_schedule = v.map(|x| x.into());
1375 self
1376 }
1377
1378 pub fn set_psc_service_attachments<T, V>(mut self, v: T) -> Self
1380 where
1381 T: std::iter::IntoIterator<Item = V>,
1382 V: std::convert::Into<crate::model::PscServiceAttachment>,
1383 {
1384 use std::iter::Iterator;
1385 self.psc_service_attachments = v.into_iter().map(|i| i.into()).collect();
1386 self
1387 }
1388
1389 pub fn set_cluster_endpoints<T, V>(mut self, v: T) -> Self
1391 where
1392 T: std::iter::IntoIterator<Item = V>,
1393 V: std::convert::Into<crate::model::ClusterEndpoint>,
1394 {
1395 use std::iter::Iterator;
1396 self.cluster_endpoints = v.into_iter().map(|i| i.into()).collect();
1397 self
1398 }
1399
1400 pub fn set_backup_collection<T>(mut self, v: T) -> Self
1402 where
1403 T: std::convert::Into<std::string::String>,
1404 {
1405 self.backup_collection = std::option::Option::Some(v.into());
1406 self
1407 }
1408
1409 pub fn set_or_clear_backup_collection<T>(mut self, v: std::option::Option<T>) -> Self
1411 where
1412 T: std::convert::Into<std::string::String>,
1413 {
1414 self.backup_collection = v.map(|x| x.into());
1415 self
1416 }
1417
1418 pub fn set_kms_key<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<std::string::String>,
1422 {
1423 self.kms_key = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_kms_key<T>(mut self, v: std::option::Option<T>) -> Self
1429 where
1430 T: std::convert::Into<std::string::String>,
1431 {
1432 self.kms_key = v.map(|x| x.into());
1433 self
1434 }
1435
1436 pub fn set_automated_backup_config<T>(mut self, v: T) -> Self
1438 where
1439 T: std::convert::Into<crate::model::AutomatedBackupConfig>,
1440 {
1441 self.automated_backup_config = std::option::Option::Some(v.into());
1442 self
1443 }
1444
1445 pub fn set_or_clear_automated_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
1447 where
1448 T: std::convert::Into<crate::model::AutomatedBackupConfig>,
1449 {
1450 self.automated_backup_config = v.map(|x| x.into());
1451 self
1452 }
1453
1454 pub fn set_encryption_info<T>(mut self, v: T) -> Self
1456 where
1457 T: std::convert::Into<crate::model::EncryptionInfo>,
1458 {
1459 self.encryption_info = std::option::Option::Some(v.into());
1460 self
1461 }
1462
1463 pub fn set_or_clear_encryption_info<T>(mut self, v: std::option::Option<T>) -> Self
1465 where
1466 T: std::convert::Into<crate::model::EncryptionInfo>,
1467 {
1468 self.encryption_info = v.map(|x| x.into());
1469 self
1470 }
1471
1472 pub fn set_import_sources<
1477 T: std::convert::Into<std::option::Option<crate::model::cluster::ImportSources>>,
1478 >(
1479 mut self,
1480 v: T,
1481 ) -> Self {
1482 self.import_sources = v.into();
1483 self
1484 }
1485
1486 pub fn gcs_source(
1490 &self,
1491 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::GcsBackupSource>> {
1492 #[allow(unreachable_patterns)]
1493 self.import_sources.as_ref().and_then(|v| match v {
1494 crate::model::cluster::ImportSources::GcsSource(v) => std::option::Option::Some(v),
1495 _ => std::option::Option::None,
1496 })
1497 }
1498
1499 pub fn set_gcs_source<
1505 T: std::convert::Into<std::boxed::Box<crate::model::cluster::GcsBackupSource>>,
1506 >(
1507 mut self,
1508 v: T,
1509 ) -> Self {
1510 self.import_sources =
1511 std::option::Option::Some(crate::model::cluster::ImportSources::GcsSource(v.into()));
1512 self
1513 }
1514
1515 pub fn managed_backup_source(
1519 &self,
1520 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::ManagedBackupSource>> {
1521 #[allow(unreachable_patterns)]
1522 self.import_sources.as_ref().and_then(|v| match v {
1523 crate::model::cluster::ImportSources::ManagedBackupSource(v) => {
1524 std::option::Option::Some(v)
1525 }
1526 _ => std::option::Option::None,
1527 })
1528 }
1529
1530 pub fn set_managed_backup_source<
1536 T: std::convert::Into<std::boxed::Box<crate::model::cluster::ManagedBackupSource>>,
1537 >(
1538 mut self,
1539 v: T,
1540 ) -> Self {
1541 self.import_sources = std::option::Option::Some(
1542 crate::model::cluster::ImportSources::ManagedBackupSource(v.into()),
1543 );
1544 self
1545 }
1546}
1547
1548impl wkt::message::Message for Cluster {
1549 fn typename() -> &'static str {
1550 "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster"
1551 }
1552}
1553
1554pub mod cluster {
1556 #[allow(unused_imports)]
1557 use super::*;
1558
1559 #[derive(Clone, Default, PartialEq)]
1561 #[non_exhaustive]
1562 pub struct StateInfo {
1563 pub info: std::option::Option<crate::model::cluster::state_info::Info>,
1564
1565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1566 }
1567
1568 impl StateInfo {
1569 pub fn new() -> Self {
1570 std::default::Default::default()
1571 }
1572
1573 pub fn set_info<
1578 T: std::convert::Into<std::option::Option<crate::model::cluster::state_info::Info>>,
1579 >(
1580 mut self,
1581 v: T,
1582 ) -> Self {
1583 self.info = v.into();
1584 self
1585 }
1586
1587 pub fn update_info(
1591 &self,
1592 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::state_info::UpdateInfo>>
1593 {
1594 #[allow(unreachable_patterns)]
1595 self.info.as_ref().and_then(|v| match v {
1596 crate::model::cluster::state_info::Info::UpdateInfo(v) => {
1597 std::option::Option::Some(v)
1598 }
1599 _ => std::option::Option::None,
1600 })
1601 }
1602
1603 pub fn set_update_info<
1609 T: std::convert::Into<std::boxed::Box<crate::model::cluster::state_info::UpdateInfo>>,
1610 >(
1611 mut self,
1612 v: T,
1613 ) -> Self {
1614 self.info = std::option::Option::Some(
1615 crate::model::cluster::state_info::Info::UpdateInfo(v.into()),
1616 );
1617 self
1618 }
1619 }
1620
1621 impl wkt::message::Message for StateInfo {
1622 fn typename() -> &'static str {
1623 "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster.StateInfo"
1624 }
1625 }
1626
1627 pub mod state_info {
1629 #[allow(unused_imports)]
1630 use super::*;
1631
1632 #[derive(Clone, Default, PartialEq)]
1634 #[non_exhaustive]
1635 pub struct UpdateInfo {
1636 pub target_shard_count: std::option::Option<i32>,
1638
1639 pub target_replica_count: std::option::Option<i32>,
1641
1642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1643 }
1644
1645 impl UpdateInfo {
1646 pub fn new() -> Self {
1647 std::default::Default::default()
1648 }
1649
1650 pub fn set_target_shard_count<T>(mut self, v: T) -> Self
1652 where
1653 T: std::convert::Into<i32>,
1654 {
1655 self.target_shard_count = std::option::Option::Some(v.into());
1656 self
1657 }
1658
1659 pub fn set_or_clear_target_shard_count<T>(mut self, v: std::option::Option<T>) -> Self
1661 where
1662 T: std::convert::Into<i32>,
1663 {
1664 self.target_shard_count = v.map(|x| x.into());
1665 self
1666 }
1667
1668 pub fn set_target_replica_count<T>(mut self, v: T) -> Self
1670 where
1671 T: std::convert::Into<i32>,
1672 {
1673 self.target_replica_count = std::option::Option::Some(v.into());
1674 self
1675 }
1676
1677 pub fn set_or_clear_target_replica_count<T>(mut self, v: std::option::Option<T>) -> Self
1679 where
1680 T: std::convert::Into<i32>,
1681 {
1682 self.target_replica_count = v.map(|x| x.into());
1683 self
1684 }
1685 }
1686
1687 impl wkt::message::Message for UpdateInfo {
1688 fn typename() -> &'static str {
1689 "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo"
1690 }
1691 }
1692
1693 #[derive(Clone, Debug, PartialEq)]
1694 #[non_exhaustive]
1695 pub enum Info {
1696 UpdateInfo(std::boxed::Box<crate::model::cluster::state_info::UpdateInfo>),
1698 }
1699 }
1700
1701 #[derive(Clone, Default, PartialEq)]
1704 #[non_exhaustive]
1705 pub struct GcsBackupSource {
1706 pub uris: std::vec::Vec<std::string::String>,
1709
1710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1711 }
1712
1713 impl GcsBackupSource {
1714 pub fn new() -> Self {
1715 std::default::Default::default()
1716 }
1717
1718 pub fn set_uris<T, V>(mut self, v: T) -> Self
1720 where
1721 T: std::iter::IntoIterator<Item = V>,
1722 V: std::convert::Into<std::string::String>,
1723 {
1724 use std::iter::Iterator;
1725 self.uris = v.into_iter().map(|i| i.into()).collect();
1726 self
1727 }
1728 }
1729
1730 impl wkt::message::Message for GcsBackupSource {
1731 fn typename() -> &'static str {
1732 "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster.GcsBackupSource"
1733 }
1734 }
1735
1736 #[derive(Clone, Default, PartialEq)]
1738 #[non_exhaustive]
1739 pub struct ManagedBackupSource {
1740 pub backup: std::string::String,
1747
1748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1749 }
1750
1751 impl ManagedBackupSource {
1752 pub fn new() -> Self {
1753 std::default::Default::default()
1754 }
1755
1756 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758 self.backup = v.into();
1759 self
1760 }
1761 }
1762
1763 impl wkt::message::Message for ManagedBackupSource {
1764 fn typename() -> &'static str {
1765 "type.googleapis.com/google.cloud.redis.cluster.v1.Cluster.ManagedBackupSource"
1766 }
1767 }
1768
1769 #[derive(Clone, Debug, PartialEq)]
1785 #[non_exhaustive]
1786 pub enum State {
1787 Unspecified,
1789 Creating,
1791 Active,
1793 Updating,
1795 Deleting,
1797 UnknownValue(state::UnknownValue),
1802 }
1803
1804 #[doc(hidden)]
1805 pub mod state {
1806 #[allow(unused_imports)]
1807 use super::*;
1808 #[derive(Clone, Debug, PartialEq)]
1809 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1810 }
1811
1812 impl State {
1813 pub fn value(&self) -> std::option::Option<i32> {
1818 match self {
1819 Self::Unspecified => std::option::Option::Some(0),
1820 Self::Creating => std::option::Option::Some(1),
1821 Self::Active => std::option::Option::Some(2),
1822 Self::Updating => std::option::Option::Some(3),
1823 Self::Deleting => std::option::Option::Some(4),
1824 Self::UnknownValue(u) => u.0.value(),
1825 }
1826 }
1827
1828 pub fn name(&self) -> std::option::Option<&str> {
1833 match self {
1834 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1835 Self::Creating => std::option::Option::Some("CREATING"),
1836 Self::Active => std::option::Option::Some("ACTIVE"),
1837 Self::Updating => std::option::Option::Some("UPDATING"),
1838 Self::Deleting => std::option::Option::Some("DELETING"),
1839 Self::UnknownValue(u) => u.0.name(),
1840 }
1841 }
1842 }
1843
1844 impl std::default::Default for State {
1845 fn default() -> Self {
1846 use std::convert::From;
1847 Self::from(0)
1848 }
1849 }
1850
1851 impl std::fmt::Display for State {
1852 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1853 wkt::internal::display_enum(f, self.name(), self.value())
1854 }
1855 }
1856
1857 impl std::convert::From<i32> for State {
1858 fn from(value: i32) -> Self {
1859 match value {
1860 0 => Self::Unspecified,
1861 1 => Self::Creating,
1862 2 => Self::Active,
1863 3 => Self::Updating,
1864 4 => Self::Deleting,
1865 _ => Self::UnknownValue(state::UnknownValue(
1866 wkt::internal::UnknownEnumValue::Integer(value),
1867 )),
1868 }
1869 }
1870 }
1871
1872 impl std::convert::From<&str> for State {
1873 fn from(value: &str) -> Self {
1874 use std::string::ToString;
1875 match value {
1876 "STATE_UNSPECIFIED" => Self::Unspecified,
1877 "CREATING" => Self::Creating,
1878 "ACTIVE" => Self::Active,
1879 "UPDATING" => Self::Updating,
1880 "DELETING" => Self::Deleting,
1881 _ => Self::UnknownValue(state::UnknownValue(
1882 wkt::internal::UnknownEnumValue::String(value.to_string()),
1883 )),
1884 }
1885 }
1886 }
1887
1888 impl serde::ser::Serialize for State {
1889 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1890 where
1891 S: serde::Serializer,
1892 {
1893 match self {
1894 Self::Unspecified => serializer.serialize_i32(0),
1895 Self::Creating => serializer.serialize_i32(1),
1896 Self::Active => serializer.serialize_i32(2),
1897 Self::Updating => serializer.serialize_i32(3),
1898 Self::Deleting => serializer.serialize_i32(4),
1899 Self::UnknownValue(u) => u.0.serialize(serializer),
1900 }
1901 }
1902 }
1903
1904 impl<'de> serde::de::Deserialize<'de> for State {
1905 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1906 where
1907 D: serde::Deserializer<'de>,
1908 {
1909 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1910 ".google.cloud.redis.cluster.v1.Cluster.State",
1911 ))
1912 }
1913 }
1914
1915 #[derive(Clone, Debug, PartialEq)]
1917 #[non_exhaustive]
1918 pub enum ImportSources {
1919 GcsSource(std::boxed::Box<crate::model::cluster::GcsBackupSource>),
1924 ManagedBackupSource(std::boxed::Box<crate::model::cluster::ManagedBackupSource>),
1926 }
1927}
1928
1929#[derive(Clone, Default, PartialEq)]
1931#[non_exhaustive]
1932pub struct AutomatedBackupConfig {
1933 pub automated_backup_mode: crate::model::automated_backup_config::AutomatedBackupMode,
1936
1937 pub retention: std::option::Option<wkt::Duration>,
1941
1942 pub schedule: std::option::Option<crate::model::automated_backup_config::Schedule>,
1944
1945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1946}
1947
1948impl AutomatedBackupConfig {
1949 pub fn new() -> Self {
1950 std::default::Default::default()
1951 }
1952
1953 pub fn set_automated_backup_mode<
1955 T: std::convert::Into<crate::model::automated_backup_config::AutomatedBackupMode>,
1956 >(
1957 mut self,
1958 v: T,
1959 ) -> Self {
1960 self.automated_backup_mode = v.into();
1961 self
1962 }
1963
1964 pub fn set_retention<T>(mut self, v: T) -> Self
1966 where
1967 T: std::convert::Into<wkt::Duration>,
1968 {
1969 self.retention = std::option::Option::Some(v.into());
1970 self
1971 }
1972
1973 pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
1975 where
1976 T: std::convert::Into<wkt::Duration>,
1977 {
1978 self.retention = v.map(|x| x.into());
1979 self
1980 }
1981
1982 pub fn set_schedule<
1987 T: std::convert::Into<std::option::Option<crate::model::automated_backup_config::Schedule>>,
1988 >(
1989 mut self,
1990 v: T,
1991 ) -> Self {
1992 self.schedule = v.into();
1993 self
1994 }
1995
1996 pub fn fixed_frequency_schedule(
2000 &self,
2001 ) -> std::option::Option<
2002 &std::boxed::Box<crate::model::automated_backup_config::FixedFrequencySchedule>,
2003 > {
2004 #[allow(unreachable_patterns)]
2005 self.schedule.as_ref().and_then(|v| match v {
2006 crate::model::automated_backup_config::Schedule::FixedFrequencySchedule(v) => {
2007 std::option::Option::Some(v)
2008 }
2009 _ => std::option::Option::None,
2010 })
2011 }
2012
2013 pub fn set_fixed_frequency_schedule<
2019 T: std::convert::Into<
2020 std::boxed::Box<crate::model::automated_backup_config::FixedFrequencySchedule>,
2021 >,
2022 >(
2023 mut self,
2024 v: T,
2025 ) -> Self {
2026 self.schedule = std::option::Option::Some(
2027 crate::model::automated_backup_config::Schedule::FixedFrequencySchedule(v.into()),
2028 );
2029 self
2030 }
2031}
2032
2033impl wkt::message::Message for AutomatedBackupConfig {
2034 fn typename() -> &'static str {
2035 "type.googleapis.com/google.cloud.redis.cluster.v1.AutomatedBackupConfig"
2036 }
2037}
2038
2039pub mod automated_backup_config {
2041 #[allow(unused_imports)]
2042 use super::*;
2043
2044 #[derive(Clone, Default, PartialEq)]
2047 #[non_exhaustive]
2048 pub struct FixedFrequencySchedule {
2049 pub start_time: std::option::Option<gtype::model::TimeOfDay>,
2052
2053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2054 }
2055
2056 impl FixedFrequencySchedule {
2057 pub fn new() -> Self {
2058 std::default::Default::default()
2059 }
2060
2061 pub fn set_start_time<T>(mut self, v: T) -> Self
2063 where
2064 T: std::convert::Into<gtype::model::TimeOfDay>,
2065 {
2066 self.start_time = std::option::Option::Some(v.into());
2067 self
2068 }
2069
2070 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2072 where
2073 T: std::convert::Into<gtype::model::TimeOfDay>,
2074 {
2075 self.start_time = v.map(|x| x.into());
2076 self
2077 }
2078 }
2079
2080 impl wkt::message::Message for FixedFrequencySchedule {
2081 fn typename() -> &'static str {
2082 "type.googleapis.com/google.cloud.redis.cluster.v1.AutomatedBackupConfig.FixedFrequencySchedule"
2083 }
2084 }
2085
2086 #[derive(Clone, Debug, PartialEq)]
2102 #[non_exhaustive]
2103 pub enum AutomatedBackupMode {
2104 Unspecified,
2106 Disabled,
2108 Enabled,
2110 UnknownValue(automated_backup_mode::UnknownValue),
2115 }
2116
2117 #[doc(hidden)]
2118 pub mod automated_backup_mode {
2119 #[allow(unused_imports)]
2120 use super::*;
2121 #[derive(Clone, Debug, PartialEq)]
2122 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2123 }
2124
2125 impl AutomatedBackupMode {
2126 pub fn value(&self) -> std::option::Option<i32> {
2131 match self {
2132 Self::Unspecified => std::option::Option::Some(0),
2133 Self::Disabled => std::option::Option::Some(1),
2134 Self::Enabled => std::option::Option::Some(2),
2135 Self::UnknownValue(u) => u.0.value(),
2136 }
2137 }
2138
2139 pub fn name(&self) -> std::option::Option<&str> {
2144 match self {
2145 Self::Unspecified => std::option::Option::Some("AUTOMATED_BACKUP_MODE_UNSPECIFIED"),
2146 Self::Disabled => std::option::Option::Some("DISABLED"),
2147 Self::Enabled => std::option::Option::Some("ENABLED"),
2148 Self::UnknownValue(u) => u.0.name(),
2149 }
2150 }
2151 }
2152
2153 impl std::default::Default for AutomatedBackupMode {
2154 fn default() -> Self {
2155 use std::convert::From;
2156 Self::from(0)
2157 }
2158 }
2159
2160 impl std::fmt::Display for AutomatedBackupMode {
2161 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2162 wkt::internal::display_enum(f, self.name(), self.value())
2163 }
2164 }
2165
2166 impl std::convert::From<i32> for AutomatedBackupMode {
2167 fn from(value: i32) -> Self {
2168 match value {
2169 0 => Self::Unspecified,
2170 1 => Self::Disabled,
2171 2 => Self::Enabled,
2172 _ => Self::UnknownValue(automated_backup_mode::UnknownValue(
2173 wkt::internal::UnknownEnumValue::Integer(value),
2174 )),
2175 }
2176 }
2177 }
2178
2179 impl std::convert::From<&str> for AutomatedBackupMode {
2180 fn from(value: &str) -> Self {
2181 use std::string::ToString;
2182 match value {
2183 "AUTOMATED_BACKUP_MODE_UNSPECIFIED" => Self::Unspecified,
2184 "DISABLED" => Self::Disabled,
2185 "ENABLED" => Self::Enabled,
2186 _ => Self::UnknownValue(automated_backup_mode::UnknownValue(
2187 wkt::internal::UnknownEnumValue::String(value.to_string()),
2188 )),
2189 }
2190 }
2191 }
2192
2193 impl serde::ser::Serialize for AutomatedBackupMode {
2194 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2195 where
2196 S: serde::Serializer,
2197 {
2198 match self {
2199 Self::Unspecified => serializer.serialize_i32(0),
2200 Self::Disabled => serializer.serialize_i32(1),
2201 Self::Enabled => serializer.serialize_i32(2),
2202 Self::UnknownValue(u) => u.0.serialize(serializer),
2203 }
2204 }
2205 }
2206
2207 impl<'de> serde::de::Deserialize<'de> for AutomatedBackupMode {
2208 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2209 where
2210 D: serde::Deserializer<'de>,
2211 {
2212 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutomatedBackupMode>::new(
2213 ".google.cloud.redis.cluster.v1.AutomatedBackupConfig.AutomatedBackupMode",
2214 ))
2215 }
2216 }
2217
2218 #[derive(Clone, Debug, PartialEq)]
2220 #[non_exhaustive]
2221 pub enum Schedule {
2222 FixedFrequencySchedule(
2224 std::boxed::Box<crate::model::automated_backup_config::FixedFrequencySchedule>,
2225 ),
2226 }
2227}
2228
2229#[derive(Clone, Default, PartialEq)]
2231#[non_exhaustive]
2232pub struct BackupCollection {
2233 pub name: std::string::String,
2235
2236 pub cluster_uid: std::string::String,
2238
2239 pub cluster: std::string::String,
2243
2244 pub kms_key: std::string::String,
2247
2248 pub uid: std::string::String,
2250
2251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2252}
2253
2254impl BackupCollection {
2255 pub fn new() -> Self {
2256 std::default::Default::default()
2257 }
2258
2259 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2261 self.name = v.into();
2262 self
2263 }
2264
2265 pub fn set_cluster_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2267 self.cluster_uid = v.into();
2268 self
2269 }
2270
2271 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273 self.cluster = v.into();
2274 self
2275 }
2276
2277 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2279 self.kms_key = v.into();
2280 self
2281 }
2282
2283 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2285 self.uid = v.into();
2286 self
2287 }
2288}
2289
2290impl wkt::message::Message for BackupCollection {
2291 fn typename() -> &'static str {
2292 "type.googleapis.com/google.cloud.redis.cluster.v1.BackupCollection"
2293 }
2294}
2295
2296#[derive(Clone, Default, PartialEq)]
2298#[non_exhaustive]
2299pub struct Backup {
2300 pub name: std::string::String,
2305
2306 pub create_time: std::option::Option<wkt::Timestamp>,
2308
2309 pub cluster: std::string::String,
2311
2312 pub cluster_uid: std::string::String,
2314
2315 pub total_size_bytes: i64,
2317
2318 pub expire_time: std::option::Option<wkt::Timestamp>,
2320
2321 pub engine_version: std::string::String,
2323
2324 pub backup_files: std::vec::Vec<crate::model::BackupFile>,
2326
2327 pub node_type: crate::model::NodeType,
2329
2330 pub replica_count: i32,
2332
2333 pub shard_count: i32,
2335
2336 pub backup_type: crate::model::backup::BackupType,
2338
2339 pub state: crate::model::backup::State,
2341
2342 pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
2344
2345 pub uid: std::string::String,
2347
2348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2349}
2350
2351impl Backup {
2352 pub fn new() -> Self {
2353 std::default::Default::default()
2354 }
2355
2356 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2358 self.name = v.into();
2359 self
2360 }
2361
2362 pub fn set_create_time<T>(mut self, v: T) -> Self
2364 where
2365 T: std::convert::Into<wkt::Timestamp>,
2366 {
2367 self.create_time = std::option::Option::Some(v.into());
2368 self
2369 }
2370
2371 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2373 where
2374 T: std::convert::Into<wkt::Timestamp>,
2375 {
2376 self.create_time = v.map(|x| x.into());
2377 self
2378 }
2379
2380 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2382 self.cluster = v.into();
2383 self
2384 }
2385
2386 pub fn set_cluster_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2388 self.cluster_uid = v.into();
2389 self
2390 }
2391
2392 pub fn set_total_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2394 self.total_size_bytes = v.into();
2395 self
2396 }
2397
2398 pub fn set_expire_time<T>(mut self, v: T) -> Self
2400 where
2401 T: std::convert::Into<wkt::Timestamp>,
2402 {
2403 self.expire_time = std::option::Option::Some(v.into());
2404 self
2405 }
2406
2407 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
2409 where
2410 T: std::convert::Into<wkt::Timestamp>,
2411 {
2412 self.expire_time = v.map(|x| x.into());
2413 self
2414 }
2415
2416 pub fn set_engine_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.engine_version = v.into();
2419 self
2420 }
2421
2422 pub fn set_backup_files<T, V>(mut self, v: T) -> Self
2424 where
2425 T: std::iter::IntoIterator<Item = V>,
2426 V: std::convert::Into<crate::model::BackupFile>,
2427 {
2428 use std::iter::Iterator;
2429 self.backup_files = v.into_iter().map(|i| i.into()).collect();
2430 self
2431 }
2432
2433 pub fn set_node_type<T: std::convert::Into<crate::model::NodeType>>(mut self, v: T) -> Self {
2435 self.node_type = v.into();
2436 self
2437 }
2438
2439 pub fn set_replica_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2441 self.replica_count = v.into();
2442 self
2443 }
2444
2445 pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2447 self.shard_count = v.into();
2448 self
2449 }
2450
2451 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::BackupType>>(
2453 mut self,
2454 v: T,
2455 ) -> Self {
2456 self.backup_type = v.into();
2457 self
2458 }
2459
2460 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
2462 self.state = v.into();
2463 self
2464 }
2465
2466 pub fn set_encryption_info<T>(mut self, v: T) -> Self
2468 where
2469 T: std::convert::Into<crate::model::EncryptionInfo>,
2470 {
2471 self.encryption_info = std::option::Option::Some(v.into());
2472 self
2473 }
2474
2475 pub fn set_or_clear_encryption_info<T>(mut self, v: std::option::Option<T>) -> Self
2477 where
2478 T: std::convert::Into<crate::model::EncryptionInfo>,
2479 {
2480 self.encryption_info = v.map(|x| x.into());
2481 self
2482 }
2483
2484 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2486 self.uid = v.into();
2487 self
2488 }
2489}
2490
2491impl wkt::message::Message for Backup {
2492 fn typename() -> &'static str {
2493 "type.googleapis.com/google.cloud.redis.cluster.v1.Backup"
2494 }
2495}
2496
2497pub mod backup {
2499 #[allow(unused_imports)]
2500 use super::*;
2501
2502 #[derive(Clone, Debug, PartialEq)]
2518 #[non_exhaustive]
2519 pub enum BackupType {
2520 Unspecified,
2522 OnDemand,
2524 Automated,
2526 UnknownValue(backup_type::UnknownValue),
2531 }
2532
2533 #[doc(hidden)]
2534 pub mod backup_type {
2535 #[allow(unused_imports)]
2536 use super::*;
2537 #[derive(Clone, Debug, PartialEq)]
2538 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2539 }
2540
2541 impl BackupType {
2542 pub fn value(&self) -> std::option::Option<i32> {
2547 match self {
2548 Self::Unspecified => std::option::Option::Some(0),
2549 Self::OnDemand => std::option::Option::Some(1),
2550 Self::Automated => std::option::Option::Some(2),
2551 Self::UnknownValue(u) => u.0.value(),
2552 }
2553 }
2554
2555 pub fn name(&self) -> std::option::Option<&str> {
2560 match self {
2561 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
2562 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2563 Self::Automated => std::option::Option::Some("AUTOMATED"),
2564 Self::UnknownValue(u) => u.0.name(),
2565 }
2566 }
2567 }
2568
2569 impl std::default::Default for BackupType {
2570 fn default() -> Self {
2571 use std::convert::From;
2572 Self::from(0)
2573 }
2574 }
2575
2576 impl std::fmt::Display for BackupType {
2577 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2578 wkt::internal::display_enum(f, self.name(), self.value())
2579 }
2580 }
2581
2582 impl std::convert::From<i32> for BackupType {
2583 fn from(value: i32) -> Self {
2584 match value {
2585 0 => Self::Unspecified,
2586 1 => Self::OnDemand,
2587 2 => Self::Automated,
2588 _ => Self::UnknownValue(backup_type::UnknownValue(
2589 wkt::internal::UnknownEnumValue::Integer(value),
2590 )),
2591 }
2592 }
2593 }
2594
2595 impl std::convert::From<&str> for BackupType {
2596 fn from(value: &str) -> Self {
2597 use std::string::ToString;
2598 match value {
2599 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2600 "ON_DEMAND" => Self::OnDemand,
2601 "AUTOMATED" => Self::Automated,
2602 _ => Self::UnknownValue(backup_type::UnknownValue(
2603 wkt::internal::UnknownEnumValue::String(value.to_string()),
2604 )),
2605 }
2606 }
2607 }
2608
2609 impl serde::ser::Serialize for BackupType {
2610 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2611 where
2612 S: serde::Serializer,
2613 {
2614 match self {
2615 Self::Unspecified => serializer.serialize_i32(0),
2616 Self::OnDemand => serializer.serialize_i32(1),
2617 Self::Automated => serializer.serialize_i32(2),
2618 Self::UnknownValue(u) => u.0.serialize(serializer),
2619 }
2620 }
2621 }
2622
2623 impl<'de> serde::de::Deserialize<'de> for BackupType {
2624 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2625 where
2626 D: serde::Deserializer<'de>,
2627 {
2628 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
2629 ".google.cloud.redis.cluster.v1.Backup.BackupType",
2630 ))
2631 }
2632 }
2633
2634 #[derive(Clone, Debug, PartialEq)]
2650 #[non_exhaustive]
2651 pub enum State {
2652 Unspecified,
2654 Creating,
2656 Active,
2658 Deleting,
2660 Suspended,
2663 UnknownValue(state::UnknownValue),
2668 }
2669
2670 #[doc(hidden)]
2671 pub mod state {
2672 #[allow(unused_imports)]
2673 use super::*;
2674 #[derive(Clone, Debug, PartialEq)]
2675 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2676 }
2677
2678 impl State {
2679 pub fn value(&self) -> std::option::Option<i32> {
2684 match self {
2685 Self::Unspecified => std::option::Option::Some(0),
2686 Self::Creating => std::option::Option::Some(1),
2687 Self::Active => std::option::Option::Some(2),
2688 Self::Deleting => std::option::Option::Some(3),
2689 Self::Suspended => std::option::Option::Some(4),
2690 Self::UnknownValue(u) => u.0.value(),
2691 }
2692 }
2693
2694 pub fn name(&self) -> std::option::Option<&str> {
2699 match self {
2700 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2701 Self::Creating => std::option::Option::Some("CREATING"),
2702 Self::Active => std::option::Option::Some("ACTIVE"),
2703 Self::Deleting => std::option::Option::Some("DELETING"),
2704 Self::Suspended => std::option::Option::Some("SUSPENDED"),
2705 Self::UnknownValue(u) => u.0.name(),
2706 }
2707 }
2708 }
2709
2710 impl std::default::Default for State {
2711 fn default() -> Self {
2712 use std::convert::From;
2713 Self::from(0)
2714 }
2715 }
2716
2717 impl std::fmt::Display for State {
2718 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2719 wkt::internal::display_enum(f, self.name(), self.value())
2720 }
2721 }
2722
2723 impl std::convert::From<i32> for State {
2724 fn from(value: i32) -> Self {
2725 match value {
2726 0 => Self::Unspecified,
2727 1 => Self::Creating,
2728 2 => Self::Active,
2729 3 => Self::Deleting,
2730 4 => Self::Suspended,
2731 _ => Self::UnknownValue(state::UnknownValue(
2732 wkt::internal::UnknownEnumValue::Integer(value),
2733 )),
2734 }
2735 }
2736 }
2737
2738 impl std::convert::From<&str> for State {
2739 fn from(value: &str) -> Self {
2740 use std::string::ToString;
2741 match value {
2742 "STATE_UNSPECIFIED" => Self::Unspecified,
2743 "CREATING" => Self::Creating,
2744 "ACTIVE" => Self::Active,
2745 "DELETING" => Self::Deleting,
2746 "SUSPENDED" => Self::Suspended,
2747 _ => Self::UnknownValue(state::UnknownValue(
2748 wkt::internal::UnknownEnumValue::String(value.to_string()),
2749 )),
2750 }
2751 }
2752 }
2753
2754 impl serde::ser::Serialize for State {
2755 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2756 where
2757 S: serde::Serializer,
2758 {
2759 match self {
2760 Self::Unspecified => serializer.serialize_i32(0),
2761 Self::Creating => serializer.serialize_i32(1),
2762 Self::Active => serializer.serialize_i32(2),
2763 Self::Deleting => serializer.serialize_i32(3),
2764 Self::Suspended => serializer.serialize_i32(4),
2765 Self::UnknownValue(u) => u.0.serialize(serializer),
2766 }
2767 }
2768 }
2769
2770 impl<'de> serde::de::Deserialize<'de> for State {
2771 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2772 where
2773 D: serde::Deserializer<'de>,
2774 {
2775 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2776 ".google.cloud.redis.cluster.v1.Backup.State",
2777 ))
2778 }
2779 }
2780}
2781
2782#[derive(Clone, Default, PartialEq)]
2784#[non_exhaustive]
2785pub struct BackupFile {
2786 pub file_name: std::string::String,
2788
2789 pub size_bytes: i64,
2791
2792 pub create_time: std::option::Option<wkt::Timestamp>,
2794
2795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2796}
2797
2798impl BackupFile {
2799 pub fn new() -> Self {
2800 std::default::Default::default()
2801 }
2802
2803 pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2805 self.file_name = v.into();
2806 self
2807 }
2808
2809 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2811 self.size_bytes = v.into();
2812 self
2813 }
2814
2815 pub fn set_create_time<T>(mut self, v: T) -> Self
2817 where
2818 T: std::convert::Into<wkt::Timestamp>,
2819 {
2820 self.create_time = std::option::Option::Some(v.into());
2821 self
2822 }
2823
2824 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2826 where
2827 T: std::convert::Into<wkt::Timestamp>,
2828 {
2829 self.create_time = v.map(|x| x.into());
2830 self
2831 }
2832}
2833
2834impl wkt::message::Message for BackupFile {
2835 fn typename() -> &'static str {
2836 "type.googleapis.com/google.cloud.redis.cluster.v1.BackupFile"
2837 }
2838}
2839
2840#[derive(Clone, Default, PartialEq)]
2843#[non_exhaustive]
2844pub struct PscServiceAttachment {
2845 pub service_attachment: std::string::String,
2848
2849 pub connection_type: crate::model::ConnectionType,
2851
2852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2853}
2854
2855impl PscServiceAttachment {
2856 pub fn new() -> Self {
2857 std::default::Default::default()
2858 }
2859
2860 pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
2862 mut self,
2863 v: T,
2864 ) -> Self {
2865 self.service_attachment = v.into();
2866 self
2867 }
2868
2869 pub fn set_connection_type<T: std::convert::Into<crate::model::ConnectionType>>(
2871 mut self,
2872 v: T,
2873 ) -> Self {
2874 self.connection_type = v.into();
2875 self
2876 }
2877}
2878
2879impl wkt::message::Message for PscServiceAttachment {
2880 fn typename() -> &'static str {
2881 "type.googleapis.com/google.cloud.redis.cluster.v1.PscServiceAttachment"
2882 }
2883}
2884
2885#[derive(Clone, Default, PartialEq)]
2887#[non_exhaustive]
2888pub struct CrossClusterReplicationConfig {
2889 pub cluster_role: crate::model::cross_cluster_replication_config::ClusterRole,
2891
2892 pub primary_cluster:
2897 std::option::Option<crate::model::cross_cluster_replication_config::RemoteCluster>,
2898
2899 pub secondary_clusters:
2903 std::vec::Vec<crate::model::cross_cluster_replication_config::RemoteCluster>,
2904
2905 pub update_time: std::option::Option<wkt::Timestamp>,
2907
2908 pub membership: std::option::Option<crate::model::cross_cluster_replication_config::Membership>,
2919
2920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2921}
2922
2923impl CrossClusterReplicationConfig {
2924 pub fn new() -> Self {
2925 std::default::Default::default()
2926 }
2927
2928 pub fn set_cluster_role<
2930 T: std::convert::Into<crate::model::cross_cluster_replication_config::ClusterRole>,
2931 >(
2932 mut self,
2933 v: T,
2934 ) -> Self {
2935 self.cluster_role = v.into();
2936 self
2937 }
2938
2939 pub fn set_primary_cluster<T>(mut self, v: T) -> Self
2941 where
2942 T: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
2943 {
2944 self.primary_cluster = std::option::Option::Some(v.into());
2945 self
2946 }
2947
2948 pub fn set_or_clear_primary_cluster<T>(mut self, v: std::option::Option<T>) -> Self
2950 where
2951 T: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
2952 {
2953 self.primary_cluster = v.map(|x| x.into());
2954 self
2955 }
2956
2957 pub fn set_secondary_clusters<T, V>(mut self, v: T) -> Self
2959 where
2960 T: std::iter::IntoIterator<Item = V>,
2961 V: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
2962 {
2963 use std::iter::Iterator;
2964 self.secondary_clusters = v.into_iter().map(|i| i.into()).collect();
2965 self
2966 }
2967
2968 pub fn set_update_time<T>(mut self, v: T) -> Self
2970 where
2971 T: std::convert::Into<wkt::Timestamp>,
2972 {
2973 self.update_time = std::option::Option::Some(v.into());
2974 self
2975 }
2976
2977 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2979 where
2980 T: std::convert::Into<wkt::Timestamp>,
2981 {
2982 self.update_time = v.map(|x| x.into());
2983 self
2984 }
2985
2986 pub fn set_membership<T>(mut self, v: T) -> Self
2988 where
2989 T: std::convert::Into<crate::model::cross_cluster_replication_config::Membership>,
2990 {
2991 self.membership = std::option::Option::Some(v.into());
2992 self
2993 }
2994
2995 pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
2997 where
2998 T: std::convert::Into<crate::model::cross_cluster_replication_config::Membership>,
2999 {
3000 self.membership = v.map(|x| x.into());
3001 self
3002 }
3003}
3004
3005impl wkt::message::Message for CrossClusterReplicationConfig {
3006 fn typename() -> &'static str {
3007 "type.googleapis.com/google.cloud.redis.cluster.v1.CrossClusterReplicationConfig"
3008 }
3009}
3010
3011pub mod cross_cluster_replication_config {
3013 #[allow(unused_imports)]
3014 use super::*;
3015
3016 #[derive(Clone, Default, PartialEq)]
3019 #[non_exhaustive]
3020 pub struct RemoteCluster {
3021 pub cluster: std::string::String,
3024
3025 pub uid: std::string::String,
3027
3028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3029 }
3030
3031 impl RemoteCluster {
3032 pub fn new() -> Self {
3033 std::default::Default::default()
3034 }
3035
3036 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3038 self.cluster = v.into();
3039 self
3040 }
3041
3042 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.uid = v.into();
3045 self
3046 }
3047 }
3048
3049 impl wkt::message::Message for RemoteCluster {
3050 fn typename() -> &'static str {
3051 "type.googleapis.com/google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster"
3052 }
3053 }
3054
3055 #[derive(Clone, Default, PartialEq)]
3058 #[non_exhaustive]
3059 pub struct Membership {
3060 pub primary_cluster:
3063 std::option::Option<crate::model::cross_cluster_replication_config::RemoteCluster>,
3064
3065 pub secondary_clusters:
3068 std::vec::Vec<crate::model::cross_cluster_replication_config::RemoteCluster>,
3069
3070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3071 }
3072
3073 impl Membership {
3074 pub fn new() -> Self {
3075 std::default::Default::default()
3076 }
3077
3078 pub fn set_primary_cluster<T>(mut self, v: T) -> Self
3080 where
3081 T: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
3082 {
3083 self.primary_cluster = std::option::Option::Some(v.into());
3084 self
3085 }
3086
3087 pub fn set_or_clear_primary_cluster<T>(mut self, v: std::option::Option<T>) -> Self
3089 where
3090 T: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
3091 {
3092 self.primary_cluster = v.map(|x| x.into());
3093 self
3094 }
3095
3096 pub fn set_secondary_clusters<T, V>(mut self, v: T) -> Self
3098 where
3099 T: std::iter::IntoIterator<Item = V>,
3100 V: std::convert::Into<crate::model::cross_cluster_replication_config::RemoteCluster>,
3101 {
3102 use std::iter::Iterator;
3103 self.secondary_clusters = v.into_iter().map(|i| i.into()).collect();
3104 self
3105 }
3106 }
3107
3108 impl wkt::message::Message for Membership {
3109 fn typename() -> &'static str {
3110 "type.googleapis.com/google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.Membership"
3111 }
3112 }
3113
3114 #[derive(Clone, Debug, PartialEq)]
3130 #[non_exhaustive]
3131 pub enum ClusterRole {
3132 Unspecified,
3135 None,
3138 Primary,
3141 Secondary,
3144 UnknownValue(cluster_role::UnknownValue),
3149 }
3150
3151 #[doc(hidden)]
3152 pub mod cluster_role {
3153 #[allow(unused_imports)]
3154 use super::*;
3155 #[derive(Clone, Debug, PartialEq)]
3156 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3157 }
3158
3159 impl ClusterRole {
3160 pub fn value(&self) -> std::option::Option<i32> {
3165 match self {
3166 Self::Unspecified => std::option::Option::Some(0),
3167 Self::None => std::option::Option::Some(1),
3168 Self::Primary => std::option::Option::Some(2),
3169 Self::Secondary => std::option::Option::Some(3),
3170 Self::UnknownValue(u) => u.0.value(),
3171 }
3172 }
3173
3174 pub fn name(&self) -> std::option::Option<&str> {
3179 match self {
3180 Self::Unspecified => std::option::Option::Some("CLUSTER_ROLE_UNSPECIFIED"),
3181 Self::None => std::option::Option::Some("NONE"),
3182 Self::Primary => std::option::Option::Some("PRIMARY"),
3183 Self::Secondary => std::option::Option::Some("SECONDARY"),
3184 Self::UnknownValue(u) => u.0.name(),
3185 }
3186 }
3187 }
3188
3189 impl std::default::Default for ClusterRole {
3190 fn default() -> Self {
3191 use std::convert::From;
3192 Self::from(0)
3193 }
3194 }
3195
3196 impl std::fmt::Display for ClusterRole {
3197 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3198 wkt::internal::display_enum(f, self.name(), self.value())
3199 }
3200 }
3201
3202 impl std::convert::From<i32> for ClusterRole {
3203 fn from(value: i32) -> Self {
3204 match value {
3205 0 => Self::Unspecified,
3206 1 => Self::None,
3207 2 => Self::Primary,
3208 3 => Self::Secondary,
3209 _ => Self::UnknownValue(cluster_role::UnknownValue(
3210 wkt::internal::UnknownEnumValue::Integer(value),
3211 )),
3212 }
3213 }
3214 }
3215
3216 impl std::convert::From<&str> for ClusterRole {
3217 fn from(value: &str) -> Self {
3218 use std::string::ToString;
3219 match value {
3220 "CLUSTER_ROLE_UNSPECIFIED" => Self::Unspecified,
3221 "NONE" => Self::None,
3222 "PRIMARY" => Self::Primary,
3223 "SECONDARY" => Self::Secondary,
3224 _ => Self::UnknownValue(cluster_role::UnknownValue(
3225 wkt::internal::UnknownEnumValue::String(value.to_string()),
3226 )),
3227 }
3228 }
3229 }
3230
3231 impl serde::ser::Serialize for ClusterRole {
3232 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3233 where
3234 S: serde::Serializer,
3235 {
3236 match self {
3237 Self::Unspecified => serializer.serialize_i32(0),
3238 Self::None => serializer.serialize_i32(1),
3239 Self::Primary => serializer.serialize_i32(2),
3240 Self::Secondary => serializer.serialize_i32(3),
3241 Self::UnknownValue(u) => u.0.serialize(serializer),
3242 }
3243 }
3244 }
3245
3246 impl<'de> serde::de::Deserialize<'de> for ClusterRole {
3247 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3248 where
3249 D: serde::Deserializer<'de>,
3250 {
3251 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterRole>::new(
3252 ".google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.ClusterRole",
3253 ))
3254 }
3255 }
3256}
3257
3258#[derive(Clone, Default, PartialEq)]
3260#[non_exhaustive]
3261pub struct ClusterMaintenancePolicy {
3262 pub create_time: std::option::Option<wkt::Timestamp>,
3265
3266 pub update_time: std::option::Option<wkt::Timestamp>,
3269
3270 pub weekly_maintenance_window: std::vec::Vec<crate::model::ClusterWeeklyMaintenanceWindow>,
3274
3275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3276}
3277
3278impl ClusterMaintenancePolicy {
3279 pub fn new() -> Self {
3280 std::default::Default::default()
3281 }
3282
3283 pub fn set_create_time<T>(mut self, v: T) -> Self
3285 where
3286 T: std::convert::Into<wkt::Timestamp>,
3287 {
3288 self.create_time = std::option::Option::Some(v.into());
3289 self
3290 }
3291
3292 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3294 where
3295 T: std::convert::Into<wkt::Timestamp>,
3296 {
3297 self.create_time = v.map(|x| x.into());
3298 self
3299 }
3300
3301 pub fn set_update_time<T>(mut self, v: T) -> Self
3303 where
3304 T: std::convert::Into<wkt::Timestamp>,
3305 {
3306 self.update_time = std::option::Option::Some(v.into());
3307 self
3308 }
3309
3310 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3312 where
3313 T: std::convert::Into<wkt::Timestamp>,
3314 {
3315 self.update_time = v.map(|x| x.into());
3316 self
3317 }
3318
3319 pub fn set_weekly_maintenance_window<T, V>(mut self, v: T) -> Self
3321 where
3322 T: std::iter::IntoIterator<Item = V>,
3323 V: std::convert::Into<crate::model::ClusterWeeklyMaintenanceWindow>,
3324 {
3325 use std::iter::Iterator;
3326 self.weekly_maintenance_window = v.into_iter().map(|i| i.into()).collect();
3327 self
3328 }
3329}
3330
3331impl wkt::message::Message for ClusterMaintenancePolicy {
3332 fn typename() -> &'static str {
3333 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterMaintenancePolicy"
3334 }
3335}
3336
3337#[derive(Clone, Default, PartialEq)]
3339#[non_exhaustive]
3340pub struct ClusterWeeklyMaintenanceWindow {
3341 pub day: gtype::model::DayOfWeek,
3343
3344 pub start_time: std::option::Option<gtype::model::TimeOfDay>,
3346
3347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3348}
3349
3350impl ClusterWeeklyMaintenanceWindow {
3351 pub fn new() -> Self {
3352 std::default::Default::default()
3353 }
3354
3355 pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
3357 self.day = v.into();
3358 self
3359 }
3360
3361 pub fn set_start_time<T>(mut self, v: T) -> Self
3363 where
3364 T: std::convert::Into<gtype::model::TimeOfDay>,
3365 {
3366 self.start_time = std::option::Option::Some(v.into());
3367 self
3368 }
3369
3370 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3372 where
3373 T: std::convert::Into<gtype::model::TimeOfDay>,
3374 {
3375 self.start_time = v.map(|x| x.into());
3376 self
3377 }
3378}
3379
3380impl wkt::message::Message for ClusterWeeklyMaintenanceWindow {
3381 fn typename() -> &'static str {
3382 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterWeeklyMaintenanceWindow"
3383 }
3384}
3385
3386#[derive(Clone, Default, PartialEq)]
3388#[non_exhaustive]
3389pub struct ClusterMaintenanceSchedule {
3390 pub start_time: std::option::Option<wkt::Timestamp>,
3393
3394 pub end_time: std::option::Option<wkt::Timestamp>,
3397
3398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3399}
3400
3401impl ClusterMaintenanceSchedule {
3402 pub fn new() -> Self {
3403 std::default::Default::default()
3404 }
3405
3406 pub fn set_start_time<T>(mut self, v: T) -> Self
3408 where
3409 T: std::convert::Into<wkt::Timestamp>,
3410 {
3411 self.start_time = std::option::Option::Some(v.into());
3412 self
3413 }
3414
3415 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3417 where
3418 T: std::convert::Into<wkt::Timestamp>,
3419 {
3420 self.start_time = v.map(|x| x.into());
3421 self
3422 }
3423
3424 pub fn set_end_time<T>(mut self, v: T) -> Self
3426 where
3427 T: std::convert::Into<wkt::Timestamp>,
3428 {
3429 self.end_time = std::option::Option::Some(v.into());
3430 self
3431 }
3432
3433 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3435 where
3436 T: std::convert::Into<wkt::Timestamp>,
3437 {
3438 self.end_time = v.map(|x| x.into());
3439 self
3440 }
3441}
3442
3443impl wkt::message::Message for ClusterMaintenanceSchedule {
3444 fn typename() -> &'static str {
3445 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterMaintenanceSchedule"
3446 }
3447}
3448
3449#[derive(Clone, Default, PartialEq)]
3450#[non_exhaustive]
3451pub struct PscConfig {
3452 pub network: std::string::String,
3456
3457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3458}
3459
3460impl PscConfig {
3461 pub fn new() -> Self {
3462 std::default::Default::default()
3463 }
3464
3465 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3467 self.network = v.into();
3468 self
3469 }
3470}
3471
3472impl wkt::message::Message for PscConfig {
3473 fn typename() -> &'static str {
3474 "type.googleapis.com/google.cloud.redis.cluster.v1.PscConfig"
3475 }
3476}
3477
3478#[derive(Clone, Default, PartialEq)]
3480#[non_exhaustive]
3481pub struct DiscoveryEndpoint {
3482 pub address: std::string::String,
3485
3486 pub port: i32,
3488
3489 pub psc_config: std::option::Option<crate::model::PscConfig>,
3492
3493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3494}
3495
3496impl DiscoveryEndpoint {
3497 pub fn new() -> Self {
3498 std::default::Default::default()
3499 }
3500
3501 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3503 self.address = v.into();
3504 self
3505 }
3506
3507 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3509 self.port = v.into();
3510 self
3511 }
3512
3513 pub fn set_psc_config<T>(mut self, v: T) -> Self
3515 where
3516 T: std::convert::Into<crate::model::PscConfig>,
3517 {
3518 self.psc_config = std::option::Option::Some(v.into());
3519 self
3520 }
3521
3522 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
3524 where
3525 T: std::convert::Into<crate::model::PscConfig>,
3526 {
3527 self.psc_config = v.map(|x| x.into());
3528 self
3529 }
3530}
3531
3532impl wkt::message::Message for DiscoveryEndpoint {
3533 fn typename() -> &'static str {
3534 "type.googleapis.com/google.cloud.redis.cluster.v1.DiscoveryEndpoint"
3535 }
3536}
3537
3538#[derive(Clone, Default, PartialEq)]
3540#[non_exhaustive]
3541pub struct PscConnection {
3542 pub psc_connection_id: std::string::String,
3545
3546 pub address: std::string::String,
3549
3550 pub forwarding_rule: std::string::String,
3554
3555 pub project_id: std::string::String,
3558
3559 pub network: std::string::String,
3562
3563 pub service_attachment: std::string::String,
3567
3568 pub psc_connection_status: crate::model::PscConnectionStatus,
3573
3574 pub connection_type: crate::model::ConnectionType,
3576
3577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3578}
3579
3580impl PscConnection {
3581 pub fn new() -> Self {
3582 std::default::Default::default()
3583 }
3584
3585 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
3587 mut self,
3588 v: T,
3589 ) -> Self {
3590 self.psc_connection_id = v.into();
3591 self
3592 }
3593
3594 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3596 self.address = v.into();
3597 self
3598 }
3599
3600 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602 self.forwarding_rule = v.into();
3603 self
3604 }
3605
3606 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3608 self.project_id = v.into();
3609 self
3610 }
3611
3612 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3614 self.network = v.into();
3615 self
3616 }
3617
3618 pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
3620 mut self,
3621 v: T,
3622 ) -> Self {
3623 self.service_attachment = v.into();
3624 self
3625 }
3626
3627 pub fn set_psc_connection_status<T: std::convert::Into<crate::model::PscConnectionStatus>>(
3629 mut self,
3630 v: T,
3631 ) -> Self {
3632 self.psc_connection_status = v.into();
3633 self
3634 }
3635
3636 pub fn set_connection_type<T: std::convert::Into<crate::model::ConnectionType>>(
3638 mut self,
3639 v: T,
3640 ) -> Self {
3641 self.connection_type = v.into();
3642 self
3643 }
3644}
3645
3646impl wkt::message::Message for PscConnection {
3647 fn typename() -> &'static str {
3648 "type.googleapis.com/google.cloud.redis.cluster.v1.PscConnection"
3649 }
3650}
3651
3652#[derive(Clone, Default, PartialEq)]
3656#[non_exhaustive]
3657pub struct ClusterEndpoint {
3658 pub connections: std::vec::Vec<crate::model::ConnectionDetail>,
3661
3662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3663}
3664
3665impl ClusterEndpoint {
3666 pub fn new() -> Self {
3667 std::default::Default::default()
3668 }
3669
3670 pub fn set_connections<T, V>(mut self, v: T) -> Self
3672 where
3673 T: std::iter::IntoIterator<Item = V>,
3674 V: std::convert::Into<crate::model::ConnectionDetail>,
3675 {
3676 use std::iter::Iterator;
3677 self.connections = v.into_iter().map(|i| i.into()).collect();
3678 self
3679 }
3680}
3681
3682impl wkt::message::Message for ClusterEndpoint {
3683 fn typename() -> &'static str {
3684 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterEndpoint"
3685 }
3686}
3687
3688#[derive(Clone, Default, PartialEq)]
3690#[non_exhaustive]
3691pub struct ConnectionDetail {
3692 pub connection: std::option::Option<crate::model::connection_detail::Connection>,
3697
3698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3699}
3700
3701impl ConnectionDetail {
3702 pub fn new() -> Self {
3703 std::default::Default::default()
3704 }
3705
3706 pub fn set_connection<
3711 T: std::convert::Into<std::option::Option<crate::model::connection_detail::Connection>>,
3712 >(
3713 mut self,
3714 v: T,
3715 ) -> Self {
3716 self.connection = v.into();
3717 self
3718 }
3719
3720 pub fn psc_auto_connection(
3724 &self,
3725 ) -> std::option::Option<&std::boxed::Box<crate::model::PscAutoConnection>> {
3726 #[allow(unreachable_patterns)]
3727 self.connection.as_ref().and_then(|v| match v {
3728 crate::model::connection_detail::Connection::PscAutoConnection(v) => {
3729 std::option::Option::Some(v)
3730 }
3731 _ => std::option::Option::None,
3732 })
3733 }
3734
3735 pub fn set_psc_auto_connection<
3741 T: std::convert::Into<std::boxed::Box<crate::model::PscAutoConnection>>,
3742 >(
3743 mut self,
3744 v: T,
3745 ) -> Self {
3746 self.connection = std::option::Option::Some(
3747 crate::model::connection_detail::Connection::PscAutoConnection(v.into()),
3748 );
3749 self
3750 }
3751
3752 pub fn psc_connection(
3756 &self,
3757 ) -> std::option::Option<&std::boxed::Box<crate::model::PscConnection>> {
3758 #[allow(unreachable_patterns)]
3759 self.connection.as_ref().and_then(|v| match v {
3760 crate::model::connection_detail::Connection::PscConnection(v) => {
3761 std::option::Option::Some(v)
3762 }
3763 _ => std::option::Option::None,
3764 })
3765 }
3766
3767 pub fn set_psc_connection<
3773 T: std::convert::Into<std::boxed::Box<crate::model::PscConnection>>,
3774 >(
3775 mut self,
3776 v: T,
3777 ) -> Self {
3778 self.connection = std::option::Option::Some(
3779 crate::model::connection_detail::Connection::PscConnection(v.into()),
3780 );
3781 self
3782 }
3783}
3784
3785impl wkt::message::Message for ConnectionDetail {
3786 fn typename() -> &'static str {
3787 "type.googleapis.com/google.cloud.redis.cluster.v1.ConnectionDetail"
3788 }
3789}
3790
3791pub mod connection_detail {
3793 #[allow(unused_imports)]
3794 use super::*;
3795
3796 #[derive(Clone, Debug, PartialEq)]
3801 #[non_exhaustive]
3802 pub enum Connection {
3803 PscAutoConnection(std::boxed::Box<crate::model::PscAutoConnection>),
3806 PscConnection(std::boxed::Box<crate::model::PscConnection>),
3809 }
3810}
3811
3812#[derive(Clone, Default, PartialEq)]
3815#[non_exhaustive]
3816pub struct PscAutoConnection {
3817 pub psc_connection_id: std::string::String,
3820
3821 pub address: std::string::String,
3824
3825 pub forwarding_rule: std::string::String,
3829
3830 pub project_id: std::string::String,
3833
3834 pub network: std::string::String,
3837
3838 pub service_attachment: std::string::String,
3842
3843 pub psc_connection_status: crate::model::PscConnectionStatus,
3847
3848 pub connection_type: crate::model::ConnectionType,
3850
3851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3852}
3853
3854impl PscAutoConnection {
3855 pub fn new() -> Self {
3856 std::default::Default::default()
3857 }
3858
3859 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
3861 mut self,
3862 v: T,
3863 ) -> Self {
3864 self.psc_connection_id = v.into();
3865 self
3866 }
3867
3868 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3870 self.address = v.into();
3871 self
3872 }
3873
3874 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3876 self.forwarding_rule = v.into();
3877 self
3878 }
3879
3880 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3882 self.project_id = v.into();
3883 self
3884 }
3885
3886 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.network = v.into();
3889 self
3890 }
3891
3892 pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
3894 mut self,
3895 v: T,
3896 ) -> Self {
3897 self.service_attachment = v.into();
3898 self
3899 }
3900
3901 pub fn set_psc_connection_status<T: std::convert::Into<crate::model::PscConnectionStatus>>(
3903 mut self,
3904 v: T,
3905 ) -> Self {
3906 self.psc_connection_status = v.into();
3907 self
3908 }
3909
3910 pub fn set_connection_type<T: std::convert::Into<crate::model::ConnectionType>>(
3912 mut self,
3913 v: T,
3914 ) -> Self {
3915 self.connection_type = v.into();
3916 self
3917 }
3918}
3919
3920impl wkt::message::Message for PscAutoConnection {
3921 fn typename() -> &'static str {
3922 "type.googleapis.com/google.cloud.redis.cluster.v1.PscAutoConnection"
3923 }
3924}
3925
3926#[derive(Clone, Default, PartialEq)]
3928#[non_exhaustive]
3929pub struct OperationMetadata {
3930 pub create_time: std::option::Option<wkt::Timestamp>,
3932
3933 pub end_time: std::option::Option<wkt::Timestamp>,
3935
3936 pub target: std::string::String,
3938
3939 pub verb: std::string::String,
3941
3942 pub status_message: std::string::String,
3944
3945 pub requested_cancellation: bool,
3953
3954 pub api_version: std::string::String,
3956
3957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3958}
3959
3960impl OperationMetadata {
3961 pub fn new() -> Self {
3962 std::default::Default::default()
3963 }
3964
3965 pub fn set_create_time<T>(mut self, v: T) -> Self
3967 where
3968 T: std::convert::Into<wkt::Timestamp>,
3969 {
3970 self.create_time = std::option::Option::Some(v.into());
3971 self
3972 }
3973
3974 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3976 where
3977 T: std::convert::Into<wkt::Timestamp>,
3978 {
3979 self.create_time = v.map(|x| x.into());
3980 self
3981 }
3982
3983 pub fn set_end_time<T>(mut self, v: T) -> Self
3985 where
3986 T: std::convert::Into<wkt::Timestamp>,
3987 {
3988 self.end_time = std::option::Option::Some(v.into());
3989 self
3990 }
3991
3992 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3994 where
3995 T: std::convert::Into<wkt::Timestamp>,
3996 {
3997 self.end_time = v.map(|x| x.into());
3998 self
3999 }
4000
4001 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4003 self.target = v.into();
4004 self
4005 }
4006
4007 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4009 self.verb = v.into();
4010 self
4011 }
4012
4013 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4015 self.status_message = v.into();
4016 self
4017 }
4018
4019 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4021 self.requested_cancellation = v.into();
4022 self
4023 }
4024
4025 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4027 self.api_version = v.into();
4028 self
4029 }
4030}
4031
4032impl wkt::message::Message for OperationMetadata {
4033 fn typename() -> &'static str {
4034 "type.googleapis.com/google.cloud.redis.cluster.v1.OperationMetadata"
4035 }
4036}
4037
4038#[derive(Clone, Default, PartialEq)]
4040#[non_exhaustive]
4041pub struct CertificateAuthority {
4042 pub name: std::string::String,
4046
4047 pub server_ca: std::option::Option<crate::model::certificate_authority::ServerCa>,
4049
4050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4051}
4052
4053impl CertificateAuthority {
4054 pub fn new() -> Self {
4055 std::default::Default::default()
4056 }
4057
4058 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4060 self.name = v.into();
4061 self
4062 }
4063
4064 pub fn set_server_ca<
4069 T: std::convert::Into<std::option::Option<crate::model::certificate_authority::ServerCa>>,
4070 >(
4071 mut self,
4072 v: T,
4073 ) -> Self {
4074 self.server_ca = v.into();
4075 self
4076 }
4077
4078 pub fn managed_server_ca(
4082 &self,
4083 ) -> std::option::Option<
4084 &std::boxed::Box<crate::model::certificate_authority::ManagedCertificateAuthority>,
4085 > {
4086 #[allow(unreachable_patterns)]
4087 self.server_ca.as_ref().and_then(|v| match v {
4088 crate::model::certificate_authority::ServerCa::ManagedServerCa(v) => {
4089 std::option::Option::Some(v)
4090 }
4091 _ => std::option::Option::None,
4092 })
4093 }
4094
4095 pub fn set_managed_server_ca<
4101 T: std::convert::Into<
4102 std::boxed::Box<crate::model::certificate_authority::ManagedCertificateAuthority>,
4103 >,
4104 >(
4105 mut self,
4106 v: T,
4107 ) -> Self {
4108 self.server_ca = std::option::Option::Some(
4109 crate::model::certificate_authority::ServerCa::ManagedServerCa(v.into()),
4110 );
4111 self
4112 }
4113}
4114
4115impl wkt::message::Message for CertificateAuthority {
4116 fn typename() -> &'static str {
4117 "type.googleapis.com/google.cloud.redis.cluster.v1.CertificateAuthority"
4118 }
4119}
4120
4121pub mod certificate_authority {
4123 #[allow(unused_imports)]
4124 use super::*;
4125
4126 #[derive(Clone, Default, PartialEq)]
4127 #[non_exhaustive]
4128 pub struct ManagedCertificateAuthority {
4129 pub ca_certs: std::vec::Vec<
4132 crate::model::certificate_authority::managed_certificate_authority::CertChain,
4133 >,
4134
4135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4136 }
4137
4138 impl ManagedCertificateAuthority {
4139 pub fn new() -> Self {
4140 std::default::Default::default()
4141 }
4142
4143 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
4145 where
4146 T: std::iter::IntoIterator<Item = V>,
4147 V: std::convert::Into<
4148 crate::model::certificate_authority::managed_certificate_authority::CertChain,
4149 >,
4150 {
4151 use std::iter::Iterator;
4152 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
4153 self
4154 }
4155 }
4156
4157 impl wkt::message::Message for ManagedCertificateAuthority {
4158 fn typename() -> &'static str {
4159 "type.googleapis.com/google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority"
4160 }
4161 }
4162
4163 pub mod managed_certificate_authority {
4165 #[allow(unused_imports)]
4166 use super::*;
4167
4168 #[derive(Clone, Default, PartialEq)]
4169 #[non_exhaustive]
4170 pub struct CertChain {
4171 pub certificates: std::vec::Vec<std::string::String>,
4173
4174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4175 }
4176
4177 impl CertChain {
4178 pub fn new() -> Self {
4179 std::default::Default::default()
4180 }
4181
4182 pub fn set_certificates<T, V>(mut self, v: T) -> Self
4184 where
4185 T: std::iter::IntoIterator<Item = V>,
4186 V: std::convert::Into<std::string::String>,
4187 {
4188 use std::iter::Iterator;
4189 self.certificates = v.into_iter().map(|i| i.into()).collect();
4190 self
4191 }
4192 }
4193
4194 impl wkt::message::Message for CertChain {
4195 fn typename() -> &'static str {
4196 "type.googleapis.com/google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain"
4197 }
4198 }
4199 }
4200
4201 #[derive(Clone, Debug, PartialEq)]
4203 #[non_exhaustive]
4204 pub enum ServerCa {
4205 ManagedServerCa(
4206 std::boxed::Box<crate::model::certificate_authority::ManagedCertificateAuthority>,
4207 ),
4208 }
4209}
4210
4211#[derive(Clone, Default, PartialEq)]
4213#[non_exhaustive]
4214pub struct ClusterPersistenceConfig {
4215 pub mode: crate::model::cluster_persistence_config::PersistenceMode,
4217
4218 pub rdb_config: std::option::Option<crate::model::cluster_persistence_config::RDBConfig>,
4220
4221 pub aof_config: std::option::Option<crate::model::cluster_persistence_config::AOFConfig>,
4223
4224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4225}
4226
4227impl ClusterPersistenceConfig {
4228 pub fn new() -> Self {
4229 std::default::Default::default()
4230 }
4231
4232 pub fn set_mode<
4234 T: std::convert::Into<crate::model::cluster_persistence_config::PersistenceMode>,
4235 >(
4236 mut self,
4237 v: T,
4238 ) -> Self {
4239 self.mode = v.into();
4240 self
4241 }
4242
4243 pub fn set_rdb_config<T>(mut self, v: T) -> Self
4245 where
4246 T: std::convert::Into<crate::model::cluster_persistence_config::RDBConfig>,
4247 {
4248 self.rdb_config = std::option::Option::Some(v.into());
4249 self
4250 }
4251
4252 pub fn set_or_clear_rdb_config<T>(mut self, v: std::option::Option<T>) -> Self
4254 where
4255 T: std::convert::Into<crate::model::cluster_persistence_config::RDBConfig>,
4256 {
4257 self.rdb_config = v.map(|x| x.into());
4258 self
4259 }
4260
4261 pub fn set_aof_config<T>(mut self, v: T) -> Self
4263 where
4264 T: std::convert::Into<crate::model::cluster_persistence_config::AOFConfig>,
4265 {
4266 self.aof_config = std::option::Option::Some(v.into());
4267 self
4268 }
4269
4270 pub fn set_or_clear_aof_config<T>(mut self, v: std::option::Option<T>) -> Self
4272 where
4273 T: std::convert::Into<crate::model::cluster_persistence_config::AOFConfig>,
4274 {
4275 self.aof_config = v.map(|x| x.into());
4276 self
4277 }
4278}
4279
4280impl wkt::message::Message for ClusterPersistenceConfig {
4281 fn typename() -> &'static str {
4282 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterPersistenceConfig"
4283 }
4284}
4285
4286pub mod cluster_persistence_config {
4288 #[allow(unused_imports)]
4289 use super::*;
4290
4291 #[derive(Clone, Default, PartialEq)]
4293 #[non_exhaustive]
4294 pub struct RDBConfig {
4295 pub rdb_snapshot_period:
4297 crate::model::cluster_persistence_config::rdb_config::SnapshotPeriod,
4298
4299 pub rdb_snapshot_start_time: std::option::Option<wkt::Timestamp>,
4303
4304 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4305 }
4306
4307 impl RDBConfig {
4308 pub fn new() -> Self {
4309 std::default::Default::default()
4310 }
4311
4312 pub fn set_rdb_snapshot_period<
4314 T: std::convert::Into<
4315 crate::model::cluster_persistence_config::rdb_config::SnapshotPeriod,
4316 >,
4317 >(
4318 mut self,
4319 v: T,
4320 ) -> Self {
4321 self.rdb_snapshot_period = v.into();
4322 self
4323 }
4324
4325 pub fn set_rdb_snapshot_start_time<T>(mut self, v: T) -> Self
4327 where
4328 T: std::convert::Into<wkt::Timestamp>,
4329 {
4330 self.rdb_snapshot_start_time = std::option::Option::Some(v.into());
4331 self
4332 }
4333
4334 pub fn set_or_clear_rdb_snapshot_start_time<T>(mut self, v: std::option::Option<T>) -> Self
4336 where
4337 T: std::convert::Into<wkt::Timestamp>,
4338 {
4339 self.rdb_snapshot_start_time = v.map(|x| x.into());
4340 self
4341 }
4342 }
4343
4344 impl wkt::message::Message for RDBConfig {
4345 fn typename() -> &'static str {
4346 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig"
4347 }
4348 }
4349
4350 pub mod rdb_config {
4352 #[allow(unused_imports)]
4353 use super::*;
4354
4355 #[derive(Clone, Debug, PartialEq)]
4371 #[non_exhaustive]
4372 pub enum SnapshotPeriod {
4373 Unspecified,
4375 OneHour,
4377 SixHours,
4379 TwelveHours,
4381 TwentyFourHours,
4383 UnknownValue(snapshot_period::UnknownValue),
4388 }
4389
4390 #[doc(hidden)]
4391 pub mod snapshot_period {
4392 #[allow(unused_imports)]
4393 use super::*;
4394 #[derive(Clone, Debug, PartialEq)]
4395 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4396 }
4397
4398 impl SnapshotPeriod {
4399 pub fn value(&self) -> std::option::Option<i32> {
4404 match self {
4405 Self::Unspecified => std::option::Option::Some(0),
4406 Self::OneHour => std::option::Option::Some(1),
4407 Self::SixHours => std::option::Option::Some(2),
4408 Self::TwelveHours => std::option::Option::Some(3),
4409 Self::TwentyFourHours => std::option::Option::Some(4),
4410 Self::UnknownValue(u) => u.0.value(),
4411 }
4412 }
4413
4414 pub fn name(&self) -> std::option::Option<&str> {
4419 match self {
4420 Self::Unspecified => std::option::Option::Some("SNAPSHOT_PERIOD_UNSPECIFIED"),
4421 Self::OneHour => std::option::Option::Some("ONE_HOUR"),
4422 Self::SixHours => std::option::Option::Some("SIX_HOURS"),
4423 Self::TwelveHours => std::option::Option::Some("TWELVE_HOURS"),
4424 Self::TwentyFourHours => std::option::Option::Some("TWENTY_FOUR_HOURS"),
4425 Self::UnknownValue(u) => u.0.name(),
4426 }
4427 }
4428 }
4429
4430 impl std::default::Default for SnapshotPeriod {
4431 fn default() -> Self {
4432 use std::convert::From;
4433 Self::from(0)
4434 }
4435 }
4436
4437 impl std::fmt::Display for SnapshotPeriod {
4438 fn fmt(
4439 &self,
4440 f: &mut std::fmt::Formatter<'_>,
4441 ) -> std::result::Result<(), std::fmt::Error> {
4442 wkt::internal::display_enum(f, self.name(), self.value())
4443 }
4444 }
4445
4446 impl std::convert::From<i32> for SnapshotPeriod {
4447 fn from(value: i32) -> Self {
4448 match value {
4449 0 => Self::Unspecified,
4450 1 => Self::OneHour,
4451 2 => Self::SixHours,
4452 3 => Self::TwelveHours,
4453 4 => Self::TwentyFourHours,
4454 _ => Self::UnknownValue(snapshot_period::UnknownValue(
4455 wkt::internal::UnknownEnumValue::Integer(value),
4456 )),
4457 }
4458 }
4459 }
4460
4461 impl std::convert::From<&str> for SnapshotPeriod {
4462 fn from(value: &str) -> Self {
4463 use std::string::ToString;
4464 match value {
4465 "SNAPSHOT_PERIOD_UNSPECIFIED" => Self::Unspecified,
4466 "ONE_HOUR" => Self::OneHour,
4467 "SIX_HOURS" => Self::SixHours,
4468 "TWELVE_HOURS" => Self::TwelveHours,
4469 "TWENTY_FOUR_HOURS" => Self::TwentyFourHours,
4470 _ => Self::UnknownValue(snapshot_period::UnknownValue(
4471 wkt::internal::UnknownEnumValue::String(value.to_string()),
4472 )),
4473 }
4474 }
4475 }
4476
4477 impl serde::ser::Serialize for SnapshotPeriod {
4478 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4479 where
4480 S: serde::Serializer,
4481 {
4482 match self {
4483 Self::Unspecified => serializer.serialize_i32(0),
4484 Self::OneHour => serializer.serialize_i32(1),
4485 Self::SixHours => serializer.serialize_i32(2),
4486 Self::TwelveHours => serializer.serialize_i32(3),
4487 Self::TwentyFourHours => serializer.serialize_i32(4),
4488 Self::UnknownValue(u) => u.0.serialize(serializer),
4489 }
4490 }
4491 }
4492
4493 impl<'de> serde::de::Deserialize<'de> for SnapshotPeriod {
4494 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4495 where
4496 D: serde::Deserializer<'de>,
4497 {
4498 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SnapshotPeriod>::new(
4499 ".google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod"))
4500 }
4501 }
4502 }
4503
4504 #[derive(Clone, Default, PartialEq)]
4506 #[non_exhaustive]
4507 pub struct AOFConfig {
4508 pub append_fsync: crate::model::cluster_persistence_config::aof_config::AppendFsync,
4510
4511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4512 }
4513
4514 impl AOFConfig {
4515 pub fn new() -> Self {
4516 std::default::Default::default()
4517 }
4518
4519 pub fn set_append_fsync<
4521 T: std::convert::Into<crate::model::cluster_persistence_config::aof_config::AppendFsync>,
4522 >(
4523 mut self,
4524 v: T,
4525 ) -> Self {
4526 self.append_fsync = v.into();
4527 self
4528 }
4529 }
4530
4531 impl wkt::message::Message for AOFConfig {
4532 fn typename() -> &'static str {
4533 "type.googleapis.com/google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig"
4534 }
4535 }
4536
4537 pub mod aof_config {
4539 #[allow(unused_imports)]
4540 use super::*;
4541
4542 #[derive(Clone, Debug, PartialEq)]
4558 #[non_exhaustive]
4559 pub enum AppendFsync {
4560 Unspecified,
4562 No,
4565 Everysec,
4568 Always,
4571 UnknownValue(append_fsync::UnknownValue),
4576 }
4577
4578 #[doc(hidden)]
4579 pub mod append_fsync {
4580 #[allow(unused_imports)]
4581 use super::*;
4582 #[derive(Clone, Debug, PartialEq)]
4583 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4584 }
4585
4586 impl AppendFsync {
4587 pub fn value(&self) -> std::option::Option<i32> {
4592 match self {
4593 Self::Unspecified => std::option::Option::Some(0),
4594 Self::No => std::option::Option::Some(1),
4595 Self::Everysec => std::option::Option::Some(2),
4596 Self::Always => std::option::Option::Some(3),
4597 Self::UnknownValue(u) => u.0.value(),
4598 }
4599 }
4600
4601 pub fn name(&self) -> std::option::Option<&str> {
4606 match self {
4607 Self::Unspecified => std::option::Option::Some("APPEND_FSYNC_UNSPECIFIED"),
4608 Self::No => std::option::Option::Some("NO"),
4609 Self::Everysec => std::option::Option::Some("EVERYSEC"),
4610 Self::Always => std::option::Option::Some("ALWAYS"),
4611 Self::UnknownValue(u) => u.0.name(),
4612 }
4613 }
4614 }
4615
4616 impl std::default::Default for AppendFsync {
4617 fn default() -> Self {
4618 use std::convert::From;
4619 Self::from(0)
4620 }
4621 }
4622
4623 impl std::fmt::Display for AppendFsync {
4624 fn fmt(
4625 &self,
4626 f: &mut std::fmt::Formatter<'_>,
4627 ) -> std::result::Result<(), std::fmt::Error> {
4628 wkt::internal::display_enum(f, self.name(), self.value())
4629 }
4630 }
4631
4632 impl std::convert::From<i32> for AppendFsync {
4633 fn from(value: i32) -> Self {
4634 match value {
4635 0 => Self::Unspecified,
4636 1 => Self::No,
4637 2 => Self::Everysec,
4638 3 => Self::Always,
4639 _ => Self::UnknownValue(append_fsync::UnknownValue(
4640 wkt::internal::UnknownEnumValue::Integer(value),
4641 )),
4642 }
4643 }
4644 }
4645
4646 impl std::convert::From<&str> for AppendFsync {
4647 fn from(value: &str) -> Self {
4648 use std::string::ToString;
4649 match value {
4650 "APPEND_FSYNC_UNSPECIFIED" => Self::Unspecified,
4651 "NO" => Self::No,
4652 "EVERYSEC" => Self::Everysec,
4653 "ALWAYS" => Self::Always,
4654 _ => Self::UnknownValue(append_fsync::UnknownValue(
4655 wkt::internal::UnknownEnumValue::String(value.to_string()),
4656 )),
4657 }
4658 }
4659 }
4660
4661 impl serde::ser::Serialize for AppendFsync {
4662 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4663 where
4664 S: serde::Serializer,
4665 {
4666 match self {
4667 Self::Unspecified => serializer.serialize_i32(0),
4668 Self::No => serializer.serialize_i32(1),
4669 Self::Everysec => serializer.serialize_i32(2),
4670 Self::Always => serializer.serialize_i32(3),
4671 Self::UnknownValue(u) => u.0.serialize(serializer),
4672 }
4673 }
4674 }
4675
4676 impl<'de> serde::de::Deserialize<'de> for AppendFsync {
4677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4678 where
4679 D: serde::Deserializer<'de>,
4680 {
4681 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AppendFsync>::new(
4682 ".google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync",
4683 ))
4684 }
4685 }
4686 }
4687
4688 #[derive(Clone, Debug, PartialEq)]
4704 #[non_exhaustive]
4705 pub enum PersistenceMode {
4706 Unspecified,
4708 Disabled,
4710 Rdb,
4712 Aof,
4714 UnknownValue(persistence_mode::UnknownValue),
4719 }
4720
4721 #[doc(hidden)]
4722 pub mod persistence_mode {
4723 #[allow(unused_imports)]
4724 use super::*;
4725 #[derive(Clone, Debug, PartialEq)]
4726 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4727 }
4728
4729 impl PersistenceMode {
4730 pub fn value(&self) -> std::option::Option<i32> {
4735 match self {
4736 Self::Unspecified => std::option::Option::Some(0),
4737 Self::Disabled => std::option::Option::Some(1),
4738 Self::Rdb => std::option::Option::Some(2),
4739 Self::Aof => std::option::Option::Some(3),
4740 Self::UnknownValue(u) => u.0.value(),
4741 }
4742 }
4743
4744 pub fn name(&self) -> std::option::Option<&str> {
4749 match self {
4750 Self::Unspecified => std::option::Option::Some("PERSISTENCE_MODE_UNSPECIFIED"),
4751 Self::Disabled => std::option::Option::Some("DISABLED"),
4752 Self::Rdb => std::option::Option::Some("RDB"),
4753 Self::Aof => std::option::Option::Some("AOF"),
4754 Self::UnknownValue(u) => u.0.name(),
4755 }
4756 }
4757 }
4758
4759 impl std::default::Default for PersistenceMode {
4760 fn default() -> Self {
4761 use std::convert::From;
4762 Self::from(0)
4763 }
4764 }
4765
4766 impl std::fmt::Display for PersistenceMode {
4767 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4768 wkt::internal::display_enum(f, self.name(), self.value())
4769 }
4770 }
4771
4772 impl std::convert::From<i32> for PersistenceMode {
4773 fn from(value: i32) -> Self {
4774 match value {
4775 0 => Self::Unspecified,
4776 1 => Self::Disabled,
4777 2 => Self::Rdb,
4778 3 => Self::Aof,
4779 _ => Self::UnknownValue(persistence_mode::UnknownValue(
4780 wkt::internal::UnknownEnumValue::Integer(value),
4781 )),
4782 }
4783 }
4784 }
4785
4786 impl std::convert::From<&str> for PersistenceMode {
4787 fn from(value: &str) -> Self {
4788 use std::string::ToString;
4789 match value {
4790 "PERSISTENCE_MODE_UNSPECIFIED" => Self::Unspecified,
4791 "DISABLED" => Self::Disabled,
4792 "RDB" => Self::Rdb,
4793 "AOF" => Self::Aof,
4794 _ => Self::UnknownValue(persistence_mode::UnknownValue(
4795 wkt::internal::UnknownEnumValue::String(value.to_string()),
4796 )),
4797 }
4798 }
4799 }
4800
4801 impl serde::ser::Serialize for PersistenceMode {
4802 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4803 where
4804 S: serde::Serializer,
4805 {
4806 match self {
4807 Self::Unspecified => serializer.serialize_i32(0),
4808 Self::Disabled => serializer.serialize_i32(1),
4809 Self::Rdb => serializer.serialize_i32(2),
4810 Self::Aof => serializer.serialize_i32(3),
4811 Self::UnknownValue(u) => u.0.serialize(serializer),
4812 }
4813 }
4814 }
4815
4816 impl<'de> serde::de::Deserialize<'de> for PersistenceMode {
4817 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4818 where
4819 D: serde::Deserializer<'de>,
4820 {
4821 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PersistenceMode>::new(
4822 ".google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode",
4823 ))
4824 }
4825 }
4826}
4827
4828#[derive(Clone, Default, PartialEq)]
4830#[non_exhaustive]
4831pub struct ZoneDistributionConfig {
4832 pub mode: crate::model::zone_distribution_config::ZoneDistributionMode,
4835
4836 pub zone: std::string::String,
4840
4841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4842}
4843
4844impl ZoneDistributionConfig {
4845 pub fn new() -> Self {
4846 std::default::Default::default()
4847 }
4848
4849 pub fn set_mode<
4851 T: std::convert::Into<crate::model::zone_distribution_config::ZoneDistributionMode>,
4852 >(
4853 mut self,
4854 v: T,
4855 ) -> Self {
4856 self.mode = v.into();
4857 self
4858 }
4859
4860 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4862 self.zone = v.into();
4863 self
4864 }
4865}
4866
4867impl wkt::message::Message for ZoneDistributionConfig {
4868 fn typename() -> &'static str {
4869 "type.googleapis.com/google.cloud.redis.cluster.v1.ZoneDistributionConfig"
4870 }
4871}
4872
4873pub mod zone_distribution_config {
4875 #[allow(unused_imports)]
4876 use super::*;
4877
4878 #[derive(Clone, Debug, PartialEq)]
4894 #[non_exhaustive]
4895 pub enum ZoneDistributionMode {
4896 Unspecified,
4898 MultiZone,
4901 SingleZone,
4904 UnknownValue(zone_distribution_mode::UnknownValue),
4909 }
4910
4911 #[doc(hidden)]
4912 pub mod zone_distribution_mode {
4913 #[allow(unused_imports)]
4914 use super::*;
4915 #[derive(Clone, Debug, PartialEq)]
4916 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4917 }
4918
4919 impl ZoneDistributionMode {
4920 pub fn value(&self) -> std::option::Option<i32> {
4925 match self {
4926 Self::Unspecified => std::option::Option::Some(0),
4927 Self::MultiZone => std::option::Option::Some(1),
4928 Self::SingleZone => std::option::Option::Some(2),
4929 Self::UnknownValue(u) => u.0.value(),
4930 }
4931 }
4932
4933 pub fn name(&self) -> std::option::Option<&str> {
4938 match self {
4939 Self::Unspecified => {
4940 std::option::Option::Some("ZONE_DISTRIBUTION_MODE_UNSPECIFIED")
4941 }
4942 Self::MultiZone => std::option::Option::Some("MULTI_ZONE"),
4943 Self::SingleZone => std::option::Option::Some("SINGLE_ZONE"),
4944 Self::UnknownValue(u) => u.0.name(),
4945 }
4946 }
4947 }
4948
4949 impl std::default::Default for ZoneDistributionMode {
4950 fn default() -> Self {
4951 use std::convert::From;
4952 Self::from(0)
4953 }
4954 }
4955
4956 impl std::fmt::Display for ZoneDistributionMode {
4957 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4958 wkt::internal::display_enum(f, self.name(), self.value())
4959 }
4960 }
4961
4962 impl std::convert::From<i32> for ZoneDistributionMode {
4963 fn from(value: i32) -> Self {
4964 match value {
4965 0 => Self::Unspecified,
4966 1 => Self::MultiZone,
4967 2 => Self::SingleZone,
4968 _ => Self::UnknownValue(zone_distribution_mode::UnknownValue(
4969 wkt::internal::UnknownEnumValue::Integer(value),
4970 )),
4971 }
4972 }
4973 }
4974
4975 impl std::convert::From<&str> for ZoneDistributionMode {
4976 fn from(value: &str) -> Self {
4977 use std::string::ToString;
4978 match value {
4979 "ZONE_DISTRIBUTION_MODE_UNSPECIFIED" => Self::Unspecified,
4980 "MULTI_ZONE" => Self::MultiZone,
4981 "SINGLE_ZONE" => Self::SingleZone,
4982 _ => Self::UnknownValue(zone_distribution_mode::UnknownValue(
4983 wkt::internal::UnknownEnumValue::String(value.to_string()),
4984 )),
4985 }
4986 }
4987 }
4988
4989 impl serde::ser::Serialize for ZoneDistributionMode {
4990 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4991 where
4992 S: serde::Serializer,
4993 {
4994 match self {
4995 Self::Unspecified => serializer.serialize_i32(0),
4996 Self::MultiZone => serializer.serialize_i32(1),
4997 Self::SingleZone => serializer.serialize_i32(2),
4998 Self::UnknownValue(u) => u.0.serialize(serializer),
4999 }
5000 }
5001 }
5002
5003 impl<'de> serde::de::Deserialize<'de> for ZoneDistributionMode {
5004 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5005 where
5006 D: serde::Deserializer<'de>,
5007 {
5008 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ZoneDistributionMode>::new(
5009 ".google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode",
5010 ))
5011 }
5012 }
5013}
5014
5015#[derive(Clone, Default, PartialEq)]
5017#[non_exhaustive]
5018pub struct RescheduleClusterMaintenanceRequest {
5019 pub name: std::string::String,
5023
5024 pub reschedule_type: crate::model::reschedule_cluster_maintenance_request::RescheduleType,
5027
5028 pub schedule_time: std::option::Option<wkt::Timestamp>,
5032
5033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5034}
5035
5036impl RescheduleClusterMaintenanceRequest {
5037 pub fn new() -> Self {
5038 std::default::Default::default()
5039 }
5040
5041 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5043 self.name = v.into();
5044 self
5045 }
5046
5047 pub fn set_reschedule_type<
5049 T: std::convert::Into<crate::model::reschedule_cluster_maintenance_request::RescheduleType>,
5050 >(
5051 mut self,
5052 v: T,
5053 ) -> Self {
5054 self.reschedule_type = v.into();
5055 self
5056 }
5057
5058 pub fn set_schedule_time<T>(mut self, v: T) -> Self
5060 where
5061 T: std::convert::Into<wkt::Timestamp>,
5062 {
5063 self.schedule_time = std::option::Option::Some(v.into());
5064 self
5065 }
5066
5067 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
5069 where
5070 T: std::convert::Into<wkt::Timestamp>,
5071 {
5072 self.schedule_time = v.map(|x| x.into());
5073 self
5074 }
5075}
5076
5077impl wkt::message::Message for RescheduleClusterMaintenanceRequest {
5078 fn typename() -> &'static str {
5079 "type.googleapis.com/google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest"
5080 }
5081}
5082
5083pub mod reschedule_cluster_maintenance_request {
5085 #[allow(unused_imports)]
5086 use super::*;
5087
5088 #[derive(Clone, Debug, PartialEq)]
5104 #[non_exhaustive]
5105 pub enum RescheduleType {
5106 Unspecified,
5108 Immediate,
5110 SpecificTime,
5112 UnknownValue(reschedule_type::UnknownValue),
5117 }
5118
5119 #[doc(hidden)]
5120 pub mod reschedule_type {
5121 #[allow(unused_imports)]
5122 use super::*;
5123 #[derive(Clone, Debug, PartialEq)]
5124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5125 }
5126
5127 impl RescheduleType {
5128 pub fn value(&self) -> std::option::Option<i32> {
5133 match self {
5134 Self::Unspecified => std::option::Option::Some(0),
5135 Self::Immediate => std::option::Option::Some(1),
5136 Self::SpecificTime => std::option::Option::Some(3),
5137 Self::UnknownValue(u) => u.0.value(),
5138 }
5139 }
5140
5141 pub fn name(&self) -> std::option::Option<&str> {
5146 match self {
5147 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
5148 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
5149 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
5150 Self::UnknownValue(u) => u.0.name(),
5151 }
5152 }
5153 }
5154
5155 impl std::default::Default for RescheduleType {
5156 fn default() -> Self {
5157 use std::convert::From;
5158 Self::from(0)
5159 }
5160 }
5161
5162 impl std::fmt::Display for RescheduleType {
5163 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5164 wkt::internal::display_enum(f, self.name(), self.value())
5165 }
5166 }
5167
5168 impl std::convert::From<i32> for RescheduleType {
5169 fn from(value: i32) -> Self {
5170 match value {
5171 0 => Self::Unspecified,
5172 1 => Self::Immediate,
5173 3 => Self::SpecificTime,
5174 _ => Self::UnknownValue(reschedule_type::UnknownValue(
5175 wkt::internal::UnknownEnumValue::Integer(value),
5176 )),
5177 }
5178 }
5179 }
5180
5181 impl std::convert::From<&str> for RescheduleType {
5182 fn from(value: &str) -> Self {
5183 use std::string::ToString;
5184 match value {
5185 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
5186 "IMMEDIATE" => Self::Immediate,
5187 "SPECIFIC_TIME" => Self::SpecificTime,
5188 _ => Self::UnknownValue(reschedule_type::UnknownValue(
5189 wkt::internal::UnknownEnumValue::String(value.to_string()),
5190 )),
5191 }
5192 }
5193 }
5194
5195 impl serde::ser::Serialize for RescheduleType {
5196 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5197 where
5198 S: serde::Serializer,
5199 {
5200 match self {
5201 Self::Unspecified => serializer.serialize_i32(0),
5202 Self::Immediate => serializer.serialize_i32(1),
5203 Self::SpecificTime => serializer.serialize_i32(3),
5204 Self::UnknownValue(u) => u.0.serialize(serializer),
5205 }
5206 }
5207 }
5208
5209 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
5210 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5211 where
5212 D: serde::Deserializer<'de>,
5213 {
5214 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
5215 ".google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest.RescheduleType",
5216 ))
5217 }
5218 }
5219}
5220
5221#[derive(Clone, Default, PartialEq)]
5223#[non_exhaustive]
5224pub struct EncryptionInfo {
5225 pub encryption_type: crate::model::encryption_info::Type,
5227
5228 pub kms_key_versions: std::vec::Vec<std::string::String>,
5231
5232 pub kms_key_primary_state: crate::model::encryption_info::KmsKeyState,
5235
5236 pub last_update_time: std::option::Option<wkt::Timestamp>,
5238
5239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5240}
5241
5242impl EncryptionInfo {
5243 pub fn new() -> Self {
5244 std::default::Default::default()
5245 }
5246
5247 pub fn set_encryption_type<T: std::convert::Into<crate::model::encryption_info::Type>>(
5249 mut self,
5250 v: T,
5251 ) -> Self {
5252 self.encryption_type = v.into();
5253 self
5254 }
5255
5256 pub fn set_kms_key_versions<T, V>(mut self, v: T) -> Self
5258 where
5259 T: std::iter::IntoIterator<Item = V>,
5260 V: std::convert::Into<std::string::String>,
5261 {
5262 use std::iter::Iterator;
5263 self.kms_key_versions = v.into_iter().map(|i| i.into()).collect();
5264 self
5265 }
5266
5267 pub fn set_kms_key_primary_state<
5269 T: std::convert::Into<crate::model::encryption_info::KmsKeyState>,
5270 >(
5271 mut self,
5272 v: T,
5273 ) -> Self {
5274 self.kms_key_primary_state = v.into();
5275 self
5276 }
5277
5278 pub fn set_last_update_time<T>(mut self, v: T) -> Self
5280 where
5281 T: std::convert::Into<wkt::Timestamp>,
5282 {
5283 self.last_update_time = std::option::Option::Some(v.into());
5284 self
5285 }
5286
5287 pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5289 where
5290 T: std::convert::Into<wkt::Timestamp>,
5291 {
5292 self.last_update_time = v.map(|x| x.into());
5293 self
5294 }
5295}
5296
5297impl wkt::message::Message for EncryptionInfo {
5298 fn typename() -> &'static str {
5299 "type.googleapis.com/google.cloud.redis.cluster.v1.EncryptionInfo"
5300 }
5301}
5302
5303pub mod encryption_info {
5305 #[allow(unused_imports)]
5306 use super::*;
5307
5308 #[derive(Clone, Debug, PartialEq)]
5324 #[non_exhaustive]
5325 pub enum Type {
5326 Unspecified,
5328 GoogleDefaultEncryption,
5331 CustomerManagedEncryption,
5334 UnknownValue(r#type::UnknownValue),
5339 }
5340
5341 #[doc(hidden)]
5342 pub mod r#type {
5343 #[allow(unused_imports)]
5344 use super::*;
5345 #[derive(Clone, Debug, PartialEq)]
5346 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5347 }
5348
5349 impl Type {
5350 pub fn value(&self) -> std::option::Option<i32> {
5355 match self {
5356 Self::Unspecified => std::option::Option::Some(0),
5357 Self::GoogleDefaultEncryption => std::option::Option::Some(1),
5358 Self::CustomerManagedEncryption => std::option::Option::Some(2),
5359 Self::UnknownValue(u) => u.0.value(),
5360 }
5361 }
5362
5363 pub fn name(&self) -> std::option::Option<&str> {
5368 match self {
5369 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5370 Self::GoogleDefaultEncryption => {
5371 std::option::Option::Some("GOOGLE_DEFAULT_ENCRYPTION")
5372 }
5373 Self::CustomerManagedEncryption => {
5374 std::option::Option::Some("CUSTOMER_MANAGED_ENCRYPTION")
5375 }
5376 Self::UnknownValue(u) => u.0.name(),
5377 }
5378 }
5379 }
5380
5381 impl std::default::Default for Type {
5382 fn default() -> Self {
5383 use std::convert::From;
5384 Self::from(0)
5385 }
5386 }
5387
5388 impl std::fmt::Display for Type {
5389 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5390 wkt::internal::display_enum(f, self.name(), self.value())
5391 }
5392 }
5393
5394 impl std::convert::From<i32> for Type {
5395 fn from(value: i32) -> Self {
5396 match value {
5397 0 => Self::Unspecified,
5398 1 => Self::GoogleDefaultEncryption,
5399 2 => Self::CustomerManagedEncryption,
5400 _ => Self::UnknownValue(r#type::UnknownValue(
5401 wkt::internal::UnknownEnumValue::Integer(value),
5402 )),
5403 }
5404 }
5405 }
5406
5407 impl std::convert::From<&str> for Type {
5408 fn from(value: &str) -> Self {
5409 use std::string::ToString;
5410 match value {
5411 "TYPE_UNSPECIFIED" => Self::Unspecified,
5412 "GOOGLE_DEFAULT_ENCRYPTION" => Self::GoogleDefaultEncryption,
5413 "CUSTOMER_MANAGED_ENCRYPTION" => Self::CustomerManagedEncryption,
5414 _ => Self::UnknownValue(r#type::UnknownValue(
5415 wkt::internal::UnknownEnumValue::String(value.to_string()),
5416 )),
5417 }
5418 }
5419 }
5420
5421 impl serde::ser::Serialize for Type {
5422 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5423 where
5424 S: serde::Serializer,
5425 {
5426 match self {
5427 Self::Unspecified => serializer.serialize_i32(0),
5428 Self::GoogleDefaultEncryption => serializer.serialize_i32(1),
5429 Self::CustomerManagedEncryption => serializer.serialize_i32(2),
5430 Self::UnknownValue(u) => u.0.serialize(serializer),
5431 }
5432 }
5433 }
5434
5435 impl<'de> serde::de::Deserialize<'de> for Type {
5436 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5437 where
5438 D: serde::Deserializer<'de>,
5439 {
5440 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5441 ".google.cloud.redis.cluster.v1.EncryptionInfo.Type",
5442 ))
5443 }
5444 }
5445
5446 #[derive(Clone, Debug, PartialEq)]
5463 #[non_exhaustive]
5464 pub enum KmsKeyState {
5465 Unspecified,
5467 Enabled,
5469 PermissionDenied,
5471 Disabled,
5473 Destroyed,
5475 DestroyScheduled,
5477 EkmKeyUnreachableDetected,
5479 BillingDisabled,
5481 UnknownFailure,
5483 UnknownValue(kms_key_state::UnknownValue),
5488 }
5489
5490 #[doc(hidden)]
5491 pub mod kms_key_state {
5492 #[allow(unused_imports)]
5493 use super::*;
5494 #[derive(Clone, Debug, PartialEq)]
5495 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5496 }
5497
5498 impl KmsKeyState {
5499 pub fn value(&self) -> std::option::Option<i32> {
5504 match self {
5505 Self::Unspecified => std::option::Option::Some(0),
5506 Self::Enabled => std::option::Option::Some(1),
5507 Self::PermissionDenied => std::option::Option::Some(2),
5508 Self::Disabled => std::option::Option::Some(3),
5509 Self::Destroyed => std::option::Option::Some(4),
5510 Self::DestroyScheduled => std::option::Option::Some(5),
5511 Self::EkmKeyUnreachableDetected => std::option::Option::Some(6),
5512 Self::BillingDisabled => std::option::Option::Some(7),
5513 Self::UnknownFailure => std::option::Option::Some(8),
5514 Self::UnknownValue(u) => u.0.value(),
5515 }
5516 }
5517
5518 pub fn name(&self) -> std::option::Option<&str> {
5523 match self {
5524 Self::Unspecified => std::option::Option::Some("KMS_KEY_STATE_UNSPECIFIED"),
5525 Self::Enabled => std::option::Option::Some("ENABLED"),
5526 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
5527 Self::Disabled => std::option::Option::Some("DISABLED"),
5528 Self::Destroyed => std::option::Option::Some("DESTROYED"),
5529 Self::DestroyScheduled => std::option::Option::Some("DESTROY_SCHEDULED"),
5530 Self::EkmKeyUnreachableDetected => {
5531 std::option::Option::Some("EKM_KEY_UNREACHABLE_DETECTED")
5532 }
5533 Self::BillingDisabled => std::option::Option::Some("BILLING_DISABLED"),
5534 Self::UnknownFailure => std::option::Option::Some("UNKNOWN_FAILURE"),
5535 Self::UnknownValue(u) => u.0.name(),
5536 }
5537 }
5538 }
5539
5540 impl std::default::Default for KmsKeyState {
5541 fn default() -> Self {
5542 use std::convert::From;
5543 Self::from(0)
5544 }
5545 }
5546
5547 impl std::fmt::Display for KmsKeyState {
5548 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5549 wkt::internal::display_enum(f, self.name(), self.value())
5550 }
5551 }
5552
5553 impl std::convert::From<i32> for KmsKeyState {
5554 fn from(value: i32) -> Self {
5555 match value {
5556 0 => Self::Unspecified,
5557 1 => Self::Enabled,
5558 2 => Self::PermissionDenied,
5559 3 => Self::Disabled,
5560 4 => Self::Destroyed,
5561 5 => Self::DestroyScheduled,
5562 6 => Self::EkmKeyUnreachableDetected,
5563 7 => Self::BillingDisabled,
5564 8 => Self::UnknownFailure,
5565 _ => Self::UnknownValue(kms_key_state::UnknownValue(
5566 wkt::internal::UnknownEnumValue::Integer(value),
5567 )),
5568 }
5569 }
5570 }
5571
5572 impl std::convert::From<&str> for KmsKeyState {
5573 fn from(value: &str) -> Self {
5574 use std::string::ToString;
5575 match value {
5576 "KMS_KEY_STATE_UNSPECIFIED" => Self::Unspecified,
5577 "ENABLED" => Self::Enabled,
5578 "PERMISSION_DENIED" => Self::PermissionDenied,
5579 "DISABLED" => Self::Disabled,
5580 "DESTROYED" => Self::Destroyed,
5581 "DESTROY_SCHEDULED" => Self::DestroyScheduled,
5582 "EKM_KEY_UNREACHABLE_DETECTED" => Self::EkmKeyUnreachableDetected,
5583 "BILLING_DISABLED" => Self::BillingDisabled,
5584 "UNKNOWN_FAILURE" => Self::UnknownFailure,
5585 _ => Self::UnknownValue(kms_key_state::UnknownValue(
5586 wkt::internal::UnknownEnumValue::String(value.to_string()),
5587 )),
5588 }
5589 }
5590 }
5591
5592 impl serde::ser::Serialize for KmsKeyState {
5593 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5594 where
5595 S: serde::Serializer,
5596 {
5597 match self {
5598 Self::Unspecified => serializer.serialize_i32(0),
5599 Self::Enabled => serializer.serialize_i32(1),
5600 Self::PermissionDenied => serializer.serialize_i32(2),
5601 Self::Disabled => serializer.serialize_i32(3),
5602 Self::Destroyed => serializer.serialize_i32(4),
5603 Self::DestroyScheduled => serializer.serialize_i32(5),
5604 Self::EkmKeyUnreachableDetected => serializer.serialize_i32(6),
5605 Self::BillingDisabled => serializer.serialize_i32(7),
5606 Self::UnknownFailure => serializer.serialize_i32(8),
5607 Self::UnknownValue(u) => u.0.serialize(serializer),
5608 }
5609 }
5610 }
5611
5612 impl<'de> serde::de::Deserialize<'de> for KmsKeyState {
5613 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5614 where
5615 D: serde::Deserializer<'de>,
5616 {
5617 deserializer.deserialize_any(wkt::internal::EnumVisitor::<KmsKeyState>::new(
5618 ".google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyState",
5619 ))
5620 }
5621 }
5622}
5623
5624#[derive(Clone, Debug, PartialEq)]
5640#[non_exhaustive]
5641pub enum PscConnectionStatus {
5642 Unspecified,
5644 Active,
5646 NotFound,
5648 UnknownValue(psc_connection_status::UnknownValue),
5653}
5654
5655#[doc(hidden)]
5656pub mod psc_connection_status {
5657 #[allow(unused_imports)]
5658 use super::*;
5659 #[derive(Clone, Debug, PartialEq)]
5660 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5661}
5662
5663impl PscConnectionStatus {
5664 pub fn value(&self) -> std::option::Option<i32> {
5669 match self {
5670 Self::Unspecified => std::option::Option::Some(0),
5671 Self::Active => std::option::Option::Some(1),
5672 Self::NotFound => std::option::Option::Some(2),
5673 Self::UnknownValue(u) => u.0.value(),
5674 }
5675 }
5676
5677 pub fn name(&self) -> std::option::Option<&str> {
5682 match self {
5683 Self::Unspecified => std::option::Option::Some("PSC_CONNECTION_STATUS_UNSPECIFIED"),
5684 Self::Active => std::option::Option::Some("PSC_CONNECTION_STATUS_ACTIVE"),
5685 Self::NotFound => std::option::Option::Some("PSC_CONNECTION_STATUS_NOT_FOUND"),
5686 Self::UnknownValue(u) => u.0.name(),
5687 }
5688 }
5689}
5690
5691impl std::default::Default for PscConnectionStatus {
5692 fn default() -> Self {
5693 use std::convert::From;
5694 Self::from(0)
5695 }
5696}
5697
5698impl std::fmt::Display for PscConnectionStatus {
5699 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5700 wkt::internal::display_enum(f, self.name(), self.value())
5701 }
5702}
5703
5704impl std::convert::From<i32> for PscConnectionStatus {
5705 fn from(value: i32) -> Self {
5706 match value {
5707 0 => Self::Unspecified,
5708 1 => Self::Active,
5709 2 => Self::NotFound,
5710 _ => Self::UnknownValue(psc_connection_status::UnknownValue(
5711 wkt::internal::UnknownEnumValue::Integer(value),
5712 )),
5713 }
5714 }
5715}
5716
5717impl std::convert::From<&str> for PscConnectionStatus {
5718 fn from(value: &str) -> Self {
5719 use std::string::ToString;
5720 match value {
5721 "PSC_CONNECTION_STATUS_UNSPECIFIED" => Self::Unspecified,
5722 "PSC_CONNECTION_STATUS_ACTIVE" => Self::Active,
5723 "PSC_CONNECTION_STATUS_NOT_FOUND" => Self::NotFound,
5724 _ => Self::UnknownValue(psc_connection_status::UnknownValue(
5725 wkt::internal::UnknownEnumValue::String(value.to_string()),
5726 )),
5727 }
5728 }
5729}
5730
5731impl serde::ser::Serialize for PscConnectionStatus {
5732 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5733 where
5734 S: serde::Serializer,
5735 {
5736 match self {
5737 Self::Unspecified => serializer.serialize_i32(0),
5738 Self::Active => serializer.serialize_i32(1),
5739 Self::NotFound => serializer.serialize_i32(2),
5740 Self::UnknownValue(u) => u.0.serialize(serializer),
5741 }
5742 }
5743}
5744
5745impl<'de> serde::de::Deserialize<'de> for PscConnectionStatus {
5746 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5747 where
5748 D: serde::Deserializer<'de>,
5749 {
5750 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PscConnectionStatus>::new(
5751 ".google.cloud.redis.cluster.v1.PscConnectionStatus",
5752 ))
5753 }
5754}
5755
5756#[derive(Clone, Debug, PartialEq)]
5772#[non_exhaustive]
5773pub enum AuthorizationMode {
5774 AuthModeUnspecified,
5776 AuthModeIamAuth,
5778 AuthModeDisabled,
5780 UnknownValue(authorization_mode::UnknownValue),
5785}
5786
5787#[doc(hidden)]
5788pub mod authorization_mode {
5789 #[allow(unused_imports)]
5790 use super::*;
5791 #[derive(Clone, Debug, PartialEq)]
5792 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5793}
5794
5795impl AuthorizationMode {
5796 pub fn value(&self) -> std::option::Option<i32> {
5801 match self {
5802 Self::AuthModeUnspecified => std::option::Option::Some(0),
5803 Self::AuthModeIamAuth => std::option::Option::Some(1),
5804 Self::AuthModeDisabled => std::option::Option::Some(2),
5805 Self::UnknownValue(u) => u.0.value(),
5806 }
5807 }
5808
5809 pub fn name(&self) -> std::option::Option<&str> {
5814 match self {
5815 Self::AuthModeUnspecified => std::option::Option::Some("AUTH_MODE_UNSPECIFIED"),
5816 Self::AuthModeIamAuth => std::option::Option::Some("AUTH_MODE_IAM_AUTH"),
5817 Self::AuthModeDisabled => std::option::Option::Some("AUTH_MODE_DISABLED"),
5818 Self::UnknownValue(u) => u.0.name(),
5819 }
5820 }
5821}
5822
5823impl std::default::Default for AuthorizationMode {
5824 fn default() -> Self {
5825 use std::convert::From;
5826 Self::from(0)
5827 }
5828}
5829
5830impl std::fmt::Display for AuthorizationMode {
5831 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5832 wkt::internal::display_enum(f, self.name(), self.value())
5833 }
5834}
5835
5836impl std::convert::From<i32> for AuthorizationMode {
5837 fn from(value: i32) -> Self {
5838 match value {
5839 0 => Self::AuthModeUnspecified,
5840 1 => Self::AuthModeIamAuth,
5841 2 => Self::AuthModeDisabled,
5842 _ => Self::UnknownValue(authorization_mode::UnknownValue(
5843 wkt::internal::UnknownEnumValue::Integer(value),
5844 )),
5845 }
5846 }
5847}
5848
5849impl std::convert::From<&str> for AuthorizationMode {
5850 fn from(value: &str) -> Self {
5851 use std::string::ToString;
5852 match value {
5853 "AUTH_MODE_UNSPECIFIED" => Self::AuthModeUnspecified,
5854 "AUTH_MODE_IAM_AUTH" => Self::AuthModeIamAuth,
5855 "AUTH_MODE_DISABLED" => Self::AuthModeDisabled,
5856 _ => Self::UnknownValue(authorization_mode::UnknownValue(
5857 wkt::internal::UnknownEnumValue::String(value.to_string()),
5858 )),
5859 }
5860 }
5861}
5862
5863impl serde::ser::Serialize for AuthorizationMode {
5864 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5865 where
5866 S: serde::Serializer,
5867 {
5868 match self {
5869 Self::AuthModeUnspecified => serializer.serialize_i32(0),
5870 Self::AuthModeIamAuth => serializer.serialize_i32(1),
5871 Self::AuthModeDisabled => serializer.serialize_i32(2),
5872 Self::UnknownValue(u) => u.0.serialize(serializer),
5873 }
5874 }
5875}
5876
5877impl<'de> serde::de::Deserialize<'de> for AuthorizationMode {
5878 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5879 where
5880 D: serde::Deserializer<'de>,
5881 {
5882 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthorizationMode>::new(
5883 ".google.cloud.redis.cluster.v1.AuthorizationMode",
5884 ))
5885 }
5886}
5887
5888#[derive(Clone, Debug, PartialEq)]
5904#[non_exhaustive]
5905pub enum NodeType {
5906 Unspecified,
5908 RedisSharedCoreNano,
5910 RedisHighmemMedium,
5912 RedisHighmemXlarge,
5914 RedisStandardSmall,
5916 UnknownValue(node_type::UnknownValue),
5921}
5922
5923#[doc(hidden)]
5924pub mod node_type {
5925 #[allow(unused_imports)]
5926 use super::*;
5927 #[derive(Clone, Debug, PartialEq)]
5928 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5929}
5930
5931impl NodeType {
5932 pub fn value(&self) -> std::option::Option<i32> {
5937 match self {
5938 Self::Unspecified => std::option::Option::Some(0),
5939 Self::RedisSharedCoreNano => std::option::Option::Some(1),
5940 Self::RedisHighmemMedium => std::option::Option::Some(2),
5941 Self::RedisHighmemXlarge => std::option::Option::Some(3),
5942 Self::RedisStandardSmall => std::option::Option::Some(4),
5943 Self::UnknownValue(u) => u.0.value(),
5944 }
5945 }
5946
5947 pub fn name(&self) -> std::option::Option<&str> {
5952 match self {
5953 Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
5954 Self::RedisSharedCoreNano => std::option::Option::Some("REDIS_SHARED_CORE_NANO"),
5955 Self::RedisHighmemMedium => std::option::Option::Some("REDIS_HIGHMEM_MEDIUM"),
5956 Self::RedisHighmemXlarge => std::option::Option::Some("REDIS_HIGHMEM_XLARGE"),
5957 Self::RedisStandardSmall => std::option::Option::Some("REDIS_STANDARD_SMALL"),
5958 Self::UnknownValue(u) => u.0.name(),
5959 }
5960 }
5961}
5962
5963impl std::default::Default for NodeType {
5964 fn default() -> Self {
5965 use std::convert::From;
5966 Self::from(0)
5967 }
5968}
5969
5970impl std::fmt::Display for NodeType {
5971 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5972 wkt::internal::display_enum(f, self.name(), self.value())
5973 }
5974}
5975
5976impl std::convert::From<i32> for NodeType {
5977 fn from(value: i32) -> Self {
5978 match value {
5979 0 => Self::Unspecified,
5980 1 => Self::RedisSharedCoreNano,
5981 2 => Self::RedisHighmemMedium,
5982 3 => Self::RedisHighmemXlarge,
5983 4 => Self::RedisStandardSmall,
5984 _ => Self::UnknownValue(node_type::UnknownValue(
5985 wkt::internal::UnknownEnumValue::Integer(value),
5986 )),
5987 }
5988 }
5989}
5990
5991impl std::convert::From<&str> for NodeType {
5992 fn from(value: &str) -> Self {
5993 use std::string::ToString;
5994 match value {
5995 "NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
5996 "REDIS_SHARED_CORE_NANO" => Self::RedisSharedCoreNano,
5997 "REDIS_HIGHMEM_MEDIUM" => Self::RedisHighmemMedium,
5998 "REDIS_HIGHMEM_XLARGE" => Self::RedisHighmemXlarge,
5999 "REDIS_STANDARD_SMALL" => Self::RedisStandardSmall,
6000 _ => Self::UnknownValue(node_type::UnknownValue(
6001 wkt::internal::UnknownEnumValue::String(value.to_string()),
6002 )),
6003 }
6004 }
6005}
6006
6007impl serde::ser::Serialize for NodeType {
6008 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6009 where
6010 S: serde::Serializer,
6011 {
6012 match self {
6013 Self::Unspecified => serializer.serialize_i32(0),
6014 Self::RedisSharedCoreNano => serializer.serialize_i32(1),
6015 Self::RedisHighmemMedium => serializer.serialize_i32(2),
6016 Self::RedisHighmemXlarge => serializer.serialize_i32(3),
6017 Self::RedisStandardSmall => serializer.serialize_i32(4),
6018 Self::UnknownValue(u) => u.0.serialize(serializer),
6019 }
6020 }
6021}
6022
6023impl<'de> serde::de::Deserialize<'de> for NodeType {
6024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6025 where
6026 D: serde::Deserializer<'de>,
6027 {
6028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
6029 ".google.cloud.redis.cluster.v1.NodeType",
6030 ))
6031 }
6032}
6033
6034#[derive(Clone, Debug, PartialEq)]
6050#[non_exhaustive]
6051pub enum TransitEncryptionMode {
6052 Unspecified,
6054 Disabled,
6056 ServerAuthentication,
6058 UnknownValue(transit_encryption_mode::UnknownValue),
6063}
6064
6065#[doc(hidden)]
6066pub mod transit_encryption_mode {
6067 #[allow(unused_imports)]
6068 use super::*;
6069 #[derive(Clone, Debug, PartialEq)]
6070 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6071}
6072
6073impl TransitEncryptionMode {
6074 pub fn value(&self) -> std::option::Option<i32> {
6079 match self {
6080 Self::Unspecified => std::option::Option::Some(0),
6081 Self::Disabled => std::option::Option::Some(1),
6082 Self::ServerAuthentication => std::option::Option::Some(2),
6083 Self::UnknownValue(u) => u.0.value(),
6084 }
6085 }
6086
6087 pub fn name(&self) -> std::option::Option<&str> {
6092 match self {
6093 Self::Unspecified => std::option::Option::Some("TRANSIT_ENCRYPTION_MODE_UNSPECIFIED"),
6094 Self::Disabled => std::option::Option::Some("TRANSIT_ENCRYPTION_MODE_DISABLED"),
6095 Self::ServerAuthentication => {
6096 std::option::Option::Some("TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION")
6097 }
6098 Self::UnknownValue(u) => u.0.name(),
6099 }
6100 }
6101}
6102
6103impl std::default::Default for TransitEncryptionMode {
6104 fn default() -> Self {
6105 use std::convert::From;
6106 Self::from(0)
6107 }
6108}
6109
6110impl std::fmt::Display for TransitEncryptionMode {
6111 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6112 wkt::internal::display_enum(f, self.name(), self.value())
6113 }
6114}
6115
6116impl std::convert::From<i32> for TransitEncryptionMode {
6117 fn from(value: i32) -> Self {
6118 match value {
6119 0 => Self::Unspecified,
6120 1 => Self::Disabled,
6121 2 => Self::ServerAuthentication,
6122 _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
6123 wkt::internal::UnknownEnumValue::Integer(value),
6124 )),
6125 }
6126 }
6127}
6128
6129impl std::convert::From<&str> for TransitEncryptionMode {
6130 fn from(value: &str) -> Self {
6131 use std::string::ToString;
6132 match value {
6133 "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" => Self::Unspecified,
6134 "TRANSIT_ENCRYPTION_MODE_DISABLED" => Self::Disabled,
6135 "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION" => Self::ServerAuthentication,
6136 _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
6137 wkt::internal::UnknownEnumValue::String(value.to_string()),
6138 )),
6139 }
6140 }
6141}
6142
6143impl serde::ser::Serialize for TransitEncryptionMode {
6144 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6145 where
6146 S: serde::Serializer,
6147 {
6148 match self {
6149 Self::Unspecified => serializer.serialize_i32(0),
6150 Self::Disabled => serializer.serialize_i32(1),
6151 Self::ServerAuthentication => serializer.serialize_i32(2),
6152 Self::UnknownValue(u) => u.0.serialize(serializer),
6153 }
6154 }
6155}
6156
6157impl<'de> serde::de::Deserialize<'de> for TransitEncryptionMode {
6158 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6159 where
6160 D: serde::Deserializer<'de>,
6161 {
6162 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransitEncryptionMode>::new(
6163 ".google.cloud.redis.cluster.v1.TransitEncryptionMode",
6164 ))
6165 }
6166}
6167
6168#[derive(Clone, Debug, PartialEq)]
6184#[non_exhaustive]
6185pub enum ConnectionType {
6186 Unspecified,
6188 Discovery,
6190 Primary,
6192 Reader,
6194 UnknownValue(connection_type::UnknownValue),
6199}
6200
6201#[doc(hidden)]
6202pub mod connection_type {
6203 #[allow(unused_imports)]
6204 use super::*;
6205 #[derive(Clone, Debug, PartialEq)]
6206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6207}
6208
6209impl ConnectionType {
6210 pub fn value(&self) -> std::option::Option<i32> {
6215 match self {
6216 Self::Unspecified => std::option::Option::Some(0),
6217 Self::Discovery => std::option::Option::Some(1),
6218 Self::Primary => std::option::Option::Some(2),
6219 Self::Reader => std::option::Option::Some(3),
6220 Self::UnknownValue(u) => u.0.value(),
6221 }
6222 }
6223
6224 pub fn name(&self) -> std::option::Option<&str> {
6229 match self {
6230 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
6231 Self::Discovery => std::option::Option::Some("CONNECTION_TYPE_DISCOVERY"),
6232 Self::Primary => std::option::Option::Some("CONNECTION_TYPE_PRIMARY"),
6233 Self::Reader => std::option::Option::Some("CONNECTION_TYPE_READER"),
6234 Self::UnknownValue(u) => u.0.name(),
6235 }
6236 }
6237}
6238
6239impl std::default::Default for ConnectionType {
6240 fn default() -> Self {
6241 use std::convert::From;
6242 Self::from(0)
6243 }
6244}
6245
6246impl std::fmt::Display for ConnectionType {
6247 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6248 wkt::internal::display_enum(f, self.name(), self.value())
6249 }
6250}
6251
6252impl std::convert::From<i32> for ConnectionType {
6253 fn from(value: i32) -> Self {
6254 match value {
6255 0 => Self::Unspecified,
6256 1 => Self::Discovery,
6257 2 => Self::Primary,
6258 3 => Self::Reader,
6259 _ => Self::UnknownValue(connection_type::UnknownValue(
6260 wkt::internal::UnknownEnumValue::Integer(value),
6261 )),
6262 }
6263 }
6264}
6265
6266impl std::convert::From<&str> for ConnectionType {
6267 fn from(value: &str) -> Self {
6268 use std::string::ToString;
6269 match value {
6270 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
6271 "CONNECTION_TYPE_DISCOVERY" => Self::Discovery,
6272 "CONNECTION_TYPE_PRIMARY" => Self::Primary,
6273 "CONNECTION_TYPE_READER" => Self::Reader,
6274 _ => Self::UnknownValue(connection_type::UnknownValue(
6275 wkt::internal::UnknownEnumValue::String(value.to_string()),
6276 )),
6277 }
6278 }
6279}
6280
6281impl serde::ser::Serialize for ConnectionType {
6282 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6283 where
6284 S: serde::Serializer,
6285 {
6286 match self {
6287 Self::Unspecified => serializer.serialize_i32(0),
6288 Self::Discovery => serializer.serialize_i32(1),
6289 Self::Primary => serializer.serialize_i32(2),
6290 Self::Reader => serializer.serialize_i32(3),
6291 Self::UnknownValue(u) => u.0.serialize(serializer),
6292 }
6293 }
6294}
6295
6296impl<'de> serde::de::Deserialize<'de> for ConnectionType {
6297 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6298 where
6299 D: serde::Deserializer<'de>,
6300 {
6301 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
6302 ".google.cloud.redis.cluster.v1.ConnectionType",
6303 ))
6304 }
6305}