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 NodeInfo {
45 pub id: std::string::String,
47
48 pub zone: std::string::String,
50
51 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
52}
53
54impl NodeInfo {
55 pub fn new() -> Self {
56 std::default::Default::default()
57 }
58
59 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
61 self.id = v.into();
62 self
63 }
64
65 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
67 self.zone = v.into();
68 self
69 }
70}
71
72impl wkt::message::Message for NodeInfo {
73 fn typename() -> &'static str {
74 "type.googleapis.com/google.cloud.redis.v1.NodeInfo"
75 }
76}
77
78#[derive(Clone, Default, PartialEq)]
80#[non_exhaustive]
81pub struct Instance {
82 pub name: std::string::String,
97
98 pub display_name: std::string::String,
100
101 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
103
104 pub location_id: std::string::String,
110
111 pub alternative_location_id: std::string::String,
117
118 pub redis_version: std::string::String,
127
128 pub reserved_ip_range: std::string::String,
137
138 pub secondary_ip_range: std::string::String,
144
145 pub host: std::string::String,
148
149 pub port: i32,
151
152 pub current_location_id: std::string::String,
156
157 pub create_time: std::option::Option<wkt::Timestamp>,
159
160 pub state: crate::model::instance::State,
162
163 pub status_message: std::string::String,
166
167 pub redis_configs: std::collections::HashMap<std::string::String, std::string::String>,
188
189 pub tier: crate::model::instance::Tier,
191
192 pub memory_size_gb: i32,
194
195 pub authorized_network: std::string::String,
200
201 pub persistence_iam_identity: std::string::String,
207
208 pub connect_mode: crate::model::instance::ConnectMode,
211
212 pub auth_enabled: bool,
216
217 pub server_ca_certs: std::vec::Vec<crate::model::TlsCertificate>,
219
220 pub transit_encryption_mode: crate::model::instance::TransitEncryptionMode,
223
224 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
227
228 pub maintenance_schedule: std::option::Option<crate::model::MaintenanceSchedule>,
231
232 pub replica_count: i32,
238
239 pub nodes: std::vec::Vec<crate::model::NodeInfo>,
241
242 pub read_endpoint: std::string::String,
247
248 pub read_endpoint_port: i32,
251
252 pub read_replicas_mode: crate::model::instance::ReadReplicasMode,
255
256 pub customer_managed_key: std::string::String,
259
260 pub persistence_config: std::option::Option<crate::model::PersistenceConfig>,
262
263 pub suspension_reasons: std::vec::Vec<crate::model::instance::SuspensionReason>,
265
266 pub maintenance_version: std::string::String,
269
270 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
273
274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
275}
276
277impl Instance {
278 pub fn new() -> Self {
279 std::default::Default::default()
280 }
281
282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
284 self.name = v.into();
285 self
286 }
287
288 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
290 self.display_name = v.into();
291 self
292 }
293
294 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
296 where
297 T: std::iter::IntoIterator<Item = (K, V)>,
298 K: std::convert::Into<std::string::String>,
299 V: std::convert::Into<std::string::String>,
300 {
301 use std::iter::Iterator;
302 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
303 self
304 }
305
306 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
308 self.location_id = v.into();
309 self
310 }
311
312 pub fn set_alternative_location_id<T: std::convert::Into<std::string::String>>(
314 mut self,
315 v: T,
316 ) -> Self {
317 self.alternative_location_id = v.into();
318 self
319 }
320
321 pub fn set_redis_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
323 self.redis_version = v.into();
324 self
325 }
326
327 pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
329 mut self,
330 v: T,
331 ) -> Self {
332 self.reserved_ip_range = v.into();
333 self
334 }
335
336 pub fn set_secondary_ip_range<T: std::convert::Into<std::string::String>>(
338 mut self,
339 v: T,
340 ) -> Self {
341 self.secondary_ip_range = v.into();
342 self
343 }
344
345 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
347 self.host = v.into();
348 self
349 }
350
351 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
353 self.port = v.into();
354 self
355 }
356
357 pub fn set_current_location_id<T: std::convert::Into<std::string::String>>(
359 mut self,
360 v: T,
361 ) -> Self {
362 self.current_location_id = v.into();
363 self
364 }
365
366 pub fn set_create_time<T>(mut self, v: T) -> Self
368 where
369 T: std::convert::Into<wkt::Timestamp>,
370 {
371 self.create_time = std::option::Option::Some(v.into());
372 self
373 }
374
375 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
377 where
378 T: std::convert::Into<wkt::Timestamp>,
379 {
380 self.create_time = v.map(|x| x.into());
381 self
382 }
383
384 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
386 self.state = v.into();
387 self
388 }
389
390 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
392 self.status_message = v.into();
393 self
394 }
395
396 pub fn set_redis_configs<T, K, V>(mut self, v: T) -> Self
398 where
399 T: std::iter::IntoIterator<Item = (K, V)>,
400 K: std::convert::Into<std::string::String>,
401 V: std::convert::Into<std::string::String>,
402 {
403 use std::iter::Iterator;
404 self.redis_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
405 self
406 }
407
408 pub fn set_tier<T: std::convert::Into<crate::model::instance::Tier>>(mut self, v: T) -> Self {
410 self.tier = v.into();
411 self
412 }
413
414 pub fn set_memory_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
416 self.memory_size_gb = v.into();
417 self
418 }
419
420 pub fn set_authorized_network<T: std::convert::Into<std::string::String>>(
422 mut self,
423 v: T,
424 ) -> Self {
425 self.authorized_network = v.into();
426 self
427 }
428
429 pub fn set_persistence_iam_identity<T: std::convert::Into<std::string::String>>(
431 mut self,
432 v: T,
433 ) -> Self {
434 self.persistence_iam_identity = v.into();
435 self
436 }
437
438 pub fn set_connect_mode<T: std::convert::Into<crate::model::instance::ConnectMode>>(
440 mut self,
441 v: T,
442 ) -> Self {
443 self.connect_mode = v.into();
444 self
445 }
446
447 pub fn set_auth_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
449 self.auth_enabled = v.into();
450 self
451 }
452
453 pub fn set_server_ca_certs<T, V>(mut self, v: T) -> Self
455 where
456 T: std::iter::IntoIterator<Item = V>,
457 V: std::convert::Into<crate::model::TlsCertificate>,
458 {
459 use std::iter::Iterator;
460 self.server_ca_certs = v.into_iter().map(|i| i.into()).collect();
461 self
462 }
463
464 pub fn set_transit_encryption_mode<
466 T: std::convert::Into<crate::model::instance::TransitEncryptionMode>,
467 >(
468 mut self,
469 v: T,
470 ) -> Self {
471 self.transit_encryption_mode = v.into();
472 self
473 }
474
475 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
477 where
478 T: std::convert::Into<crate::model::MaintenancePolicy>,
479 {
480 self.maintenance_policy = std::option::Option::Some(v.into());
481 self
482 }
483
484 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
486 where
487 T: std::convert::Into<crate::model::MaintenancePolicy>,
488 {
489 self.maintenance_policy = v.map(|x| x.into());
490 self
491 }
492
493 pub fn set_maintenance_schedule<T>(mut self, v: T) -> Self
495 where
496 T: std::convert::Into<crate::model::MaintenanceSchedule>,
497 {
498 self.maintenance_schedule = std::option::Option::Some(v.into());
499 self
500 }
501
502 pub fn set_or_clear_maintenance_schedule<T>(mut self, v: std::option::Option<T>) -> Self
504 where
505 T: std::convert::Into<crate::model::MaintenanceSchedule>,
506 {
507 self.maintenance_schedule = v.map(|x| x.into());
508 self
509 }
510
511 pub fn set_replica_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
513 self.replica_count = v.into();
514 self
515 }
516
517 pub fn set_nodes<T, V>(mut self, v: T) -> Self
519 where
520 T: std::iter::IntoIterator<Item = V>,
521 V: std::convert::Into<crate::model::NodeInfo>,
522 {
523 use std::iter::Iterator;
524 self.nodes = v.into_iter().map(|i| i.into()).collect();
525 self
526 }
527
528 pub fn set_read_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
530 self.read_endpoint = v.into();
531 self
532 }
533
534 pub fn set_read_endpoint_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
536 self.read_endpoint_port = v.into();
537 self
538 }
539
540 pub fn set_read_replicas_mode<
542 T: std::convert::Into<crate::model::instance::ReadReplicasMode>,
543 >(
544 mut self,
545 v: T,
546 ) -> Self {
547 self.read_replicas_mode = v.into();
548 self
549 }
550
551 pub fn set_customer_managed_key<T: std::convert::Into<std::string::String>>(
553 mut self,
554 v: T,
555 ) -> Self {
556 self.customer_managed_key = v.into();
557 self
558 }
559
560 pub fn set_persistence_config<T>(mut self, v: T) -> Self
562 where
563 T: std::convert::Into<crate::model::PersistenceConfig>,
564 {
565 self.persistence_config = std::option::Option::Some(v.into());
566 self
567 }
568
569 pub fn set_or_clear_persistence_config<T>(mut self, v: std::option::Option<T>) -> Self
571 where
572 T: std::convert::Into<crate::model::PersistenceConfig>,
573 {
574 self.persistence_config = v.map(|x| x.into());
575 self
576 }
577
578 pub fn set_suspension_reasons<T, V>(mut self, v: T) -> Self
580 where
581 T: std::iter::IntoIterator<Item = V>,
582 V: std::convert::Into<crate::model::instance::SuspensionReason>,
583 {
584 use std::iter::Iterator;
585 self.suspension_reasons = v.into_iter().map(|i| i.into()).collect();
586 self
587 }
588
589 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
591 mut self,
592 v: T,
593 ) -> Self {
594 self.maintenance_version = v.into();
595 self
596 }
597
598 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
600 where
601 T: std::iter::IntoIterator<Item = V>,
602 V: std::convert::Into<std::string::String>,
603 {
604 use std::iter::Iterator;
605 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
606 self
607 }
608}
609
610impl wkt::message::Message for Instance {
611 fn typename() -> &'static str {
612 "type.googleapis.com/google.cloud.redis.v1.Instance"
613 }
614}
615
616pub mod instance {
618 #[allow(unused_imports)]
619 use super::*;
620
621 #[derive(Clone, Debug, PartialEq)]
637 #[non_exhaustive]
638 pub enum State {
639 Unspecified,
641 Creating,
643 Ready,
645 Updating,
649 Deleting,
651 Repairing,
653 Maintenance,
655 Importing,
657 FailingOver,
659 UnknownValue(state::UnknownValue),
664 }
665
666 #[doc(hidden)]
667 pub mod state {
668 #[allow(unused_imports)]
669 use super::*;
670 #[derive(Clone, Debug, PartialEq)]
671 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
672 }
673
674 impl State {
675 pub fn value(&self) -> std::option::Option<i32> {
680 match self {
681 Self::Unspecified => std::option::Option::Some(0),
682 Self::Creating => std::option::Option::Some(1),
683 Self::Ready => std::option::Option::Some(2),
684 Self::Updating => std::option::Option::Some(3),
685 Self::Deleting => std::option::Option::Some(4),
686 Self::Repairing => std::option::Option::Some(5),
687 Self::Maintenance => std::option::Option::Some(6),
688 Self::Importing => std::option::Option::Some(8),
689 Self::FailingOver => std::option::Option::Some(9),
690 Self::UnknownValue(u) => u.0.value(),
691 }
692 }
693
694 pub fn name(&self) -> std::option::Option<&str> {
699 match self {
700 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
701 Self::Creating => std::option::Option::Some("CREATING"),
702 Self::Ready => std::option::Option::Some("READY"),
703 Self::Updating => std::option::Option::Some("UPDATING"),
704 Self::Deleting => std::option::Option::Some("DELETING"),
705 Self::Repairing => std::option::Option::Some("REPAIRING"),
706 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
707 Self::Importing => std::option::Option::Some("IMPORTING"),
708 Self::FailingOver => std::option::Option::Some("FAILING_OVER"),
709 Self::UnknownValue(u) => u.0.name(),
710 }
711 }
712 }
713
714 impl std::default::Default for State {
715 fn default() -> Self {
716 use std::convert::From;
717 Self::from(0)
718 }
719 }
720
721 impl std::fmt::Display for State {
722 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
723 wkt::internal::display_enum(f, self.name(), self.value())
724 }
725 }
726
727 impl std::convert::From<i32> for State {
728 fn from(value: i32) -> Self {
729 match value {
730 0 => Self::Unspecified,
731 1 => Self::Creating,
732 2 => Self::Ready,
733 3 => Self::Updating,
734 4 => Self::Deleting,
735 5 => Self::Repairing,
736 6 => Self::Maintenance,
737 8 => Self::Importing,
738 9 => Self::FailingOver,
739 _ => Self::UnknownValue(state::UnknownValue(
740 wkt::internal::UnknownEnumValue::Integer(value),
741 )),
742 }
743 }
744 }
745
746 impl std::convert::From<&str> for State {
747 fn from(value: &str) -> Self {
748 use std::string::ToString;
749 match value {
750 "STATE_UNSPECIFIED" => Self::Unspecified,
751 "CREATING" => Self::Creating,
752 "READY" => Self::Ready,
753 "UPDATING" => Self::Updating,
754 "DELETING" => Self::Deleting,
755 "REPAIRING" => Self::Repairing,
756 "MAINTENANCE" => Self::Maintenance,
757 "IMPORTING" => Self::Importing,
758 "FAILING_OVER" => Self::FailingOver,
759 _ => Self::UnknownValue(state::UnknownValue(
760 wkt::internal::UnknownEnumValue::String(value.to_string()),
761 )),
762 }
763 }
764 }
765
766 impl serde::ser::Serialize for State {
767 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
768 where
769 S: serde::Serializer,
770 {
771 match self {
772 Self::Unspecified => serializer.serialize_i32(0),
773 Self::Creating => serializer.serialize_i32(1),
774 Self::Ready => serializer.serialize_i32(2),
775 Self::Updating => serializer.serialize_i32(3),
776 Self::Deleting => serializer.serialize_i32(4),
777 Self::Repairing => serializer.serialize_i32(5),
778 Self::Maintenance => serializer.serialize_i32(6),
779 Self::Importing => serializer.serialize_i32(8),
780 Self::FailingOver => serializer.serialize_i32(9),
781 Self::UnknownValue(u) => u.0.serialize(serializer),
782 }
783 }
784 }
785
786 impl<'de> serde::de::Deserialize<'de> for State {
787 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
788 where
789 D: serde::Deserializer<'de>,
790 {
791 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
792 ".google.cloud.redis.v1.Instance.State",
793 ))
794 }
795 }
796
797 #[derive(Clone, Debug, PartialEq)]
813 #[non_exhaustive]
814 pub enum Tier {
815 Unspecified,
817 Basic,
819 StandardHa,
821 UnknownValue(tier::UnknownValue),
826 }
827
828 #[doc(hidden)]
829 pub mod tier {
830 #[allow(unused_imports)]
831 use super::*;
832 #[derive(Clone, Debug, PartialEq)]
833 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
834 }
835
836 impl Tier {
837 pub fn value(&self) -> std::option::Option<i32> {
842 match self {
843 Self::Unspecified => std::option::Option::Some(0),
844 Self::Basic => std::option::Option::Some(1),
845 Self::StandardHa => std::option::Option::Some(3),
846 Self::UnknownValue(u) => u.0.value(),
847 }
848 }
849
850 pub fn name(&self) -> std::option::Option<&str> {
855 match self {
856 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
857 Self::Basic => std::option::Option::Some("BASIC"),
858 Self::StandardHa => std::option::Option::Some("STANDARD_HA"),
859 Self::UnknownValue(u) => u.0.name(),
860 }
861 }
862 }
863
864 impl std::default::Default for Tier {
865 fn default() -> Self {
866 use std::convert::From;
867 Self::from(0)
868 }
869 }
870
871 impl std::fmt::Display for Tier {
872 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
873 wkt::internal::display_enum(f, self.name(), self.value())
874 }
875 }
876
877 impl std::convert::From<i32> for Tier {
878 fn from(value: i32) -> Self {
879 match value {
880 0 => Self::Unspecified,
881 1 => Self::Basic,
882 3 => Self::StandardHa,
883 _ => Self::UnknownValue(tier::UnknownValue(
884 wkt::internal::UnknownEnumValue::Integer(value),
885 )),
886 }
887 }
888 }
889
890 impl std::convert::From<&str> for Tier {
891 fn from(value: &str) -> Self {
892 use std::string::ToString;
893 match value {
894 "TIER_UNSPECIFIED" => Self::Unspecified,
895 "BASIC" => Self::Basic,
896 "STANDARD_HA" => Self::StandardHa,
897 _ => Self::UnknownValue(tier::UnknownValue(
898 wkt::internal::UnknownEnumValue::String(value.to_string()),
899 )),
900 }
901 }
902 }
903
904 impl serde::ser::Serialize for Tier {
905 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
906 where
907 S: serde::Serializer,
908 {
909 match self {
910 Self::Unspecified => serializer.serialize_i32(0),
911 Self::Basic => serializer.serialize_i32(1),
912 Self::StandardHa => serializer.serialize_i32(3),
913 Self::UnknownValue(u) => u.0.serialize(serializer),
914 }
915 }
916 }
917
918 impl<'de> serde::de::Deserialize<'de> for Tier {
919 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
920 where
921 D: serde::Deserializer<'de>,
922 {
923 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
924 ".google.cloud.redis.v1.Instance.Tier",
925 ))
926 }
927 }
928
929 #[derive(Clone, Debug, PartialEq)]
945 #[non_exhaustive]
946 pub enum ConnectMode {
947 Unspecified,
949 DirectPeering,
951 PrivateServiceAccess,
955 UnknownValue(connect_mode::UnknownValue),
960 }
961
962 #[doc(hidden)]
963 pub mod connect_mode {
964 #[allow(unused_imports)]
965 use super::*;
966 #[derive(Clone, Debug, PartialEq)]
967 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
968 }
969
970 impl ConnectMode {
971 pub fn value(&self) -> std::option::Option<i32> {
976 match self {
977 Self::Unspecified => std::option::Option::Some(0),
978 Self::DirectPeering => std::option::Option::Some(1),
979 Self::PrivateServiceAccess => std::option::Option::Some(2),
980 Self::UnknownValue(u) => u.0.value(),
981 }
982 }
983
984 pub fn name(&self) -> std::option::Option<&str> {
989 match self {
990 Self::Unspecified => std::option::Option::Some("CONNECT_MODE_UNSPECIFIED"),
991 Self::DirectPeering => std::option::Option::Some("DIRECT_PEERING"),
992 Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
993 Self::UnknownValue(u) => u.0.name(),
994 }
995 }
996 }
997
998 impl std::default::Default for ConnectMode {
999 fn default() -> Self {
1000 use std::convert::From;
1001 Self::from(0)
1002 }
1003 }
1004
1005 impl std::fmt::Display for ConnectMode {
1006 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1007 wkt::internal::display_enum(f, self.name(), self.value())
1008 }
1009 }
1010
1011 impl std::convert::From<i32> for ConnectMode {
1012 fn from(value: i32) -> Self {
1013 match value {
1014 0 => Self::Unspecified,
1015 1 => Self::DirectPeering,
1016 2 => Self::PrivateServiceAccess,
1017 _ => Self::UnknownValue(connect_mode::UnknownValue(
1018 wkt::internal::UnknownEnumValue::Integer(value),
1019 )),
1020 }
1021 }
1022 }
1023
1024 impl std::convert::From<&str> for ConnectMode {
1025 fn from(value: &str) -> Self {
1026 use std::string::ToString;
1027 match value {
1028 "CONNECT_MODE_UNSPECIFIED" => Self::Unspecified,
1029 "DIRECT_PEERING" => Self::DirectPeering,
1030 "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
1031 _ => Self::UnknownValue(connect_mode::UnknownValue(
1032 wkt::internal::UnknownEnumValue::String(value.to_string()),
1033 )),
1034 }
1035 }
1036 }
1037
1038 impl serde::ser::Serialize for ConnectMode {
1039 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1040 where
1041 S: serde::Serializer,
1042 {
1043 match self {
1044 Self::Unspecified => serializer.serialize_i32(0),
1045 Self::DirectPeering => serializer.serialize_i32(1),
1046 Self::PrivateServiceAccess => serializer.serialize_i32(2),
1047 Self::UnknownValue(u) => u.0.serialize(serializer),
1048 }
1049 }
1050 }
1051
1052 impl<'de> serde::de::Deserialize<'de> for ConnectMode {
1053 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1054 where
1055 D: serde::Deserializer<'de>,
1056 {
1057 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectMode>::new(
1058 ".google.cloud.redis.v1.Instance.ConnectMode",
1059 ))
1060 }
1061 }
1062
1063 #[derive(Clone, Debug, PartialEq)]
1079 #[non_exhaustive]
1080 pub enum TransitEncryptionMode {
1081 Unspecified,
1083 ServerAuthentication,
1085 Disabled,
1087 UnknownValue(transit_encryption_mode::UnknownValue),
1092 }
1093
1094 #[doc(hidden)]
1095 pub mod transit_encryption_mode {
1096 #[allow(unused_imports)]
1097 use super::*;
1098 #[derive(Clone, Debug, PartialEq)]
1099 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1100 }
1101
1102 impl TransitEncryptionMode {
1103 pub fn value(&self) -> std::option::Option<i32> {
1108 match self {
1109 Self::Unspecified => std::option::Option::Some(0),
1110 Self::ServerAuthentication => std::option::Option::Some(1),
1111 Self::Disabled => std::option::Option::Some(2),
1112 Self::UnknownValue(u) => u.0.value(),
1113 }
1114 }
1115
1116 pub fn name(&self) -> std::option::Option<&str> {
1121 match self {
1122 Self::Unspecified => {
1123 std::option::Option::Some("TRANSIT_ENCRYPTION_MODE_UNSPECIFIED")
1124 }
1125 Self::ServerAuthentication => std::option::Option::Some("SERVER_AUTHENTICATION"),
1126 Self::Disabled => std::option::Option::Some("DISABLED"),
1127 Self::UnknownValue(u) => u.0.name(),
1128 }
1129 }
1130 }
1131
1132 impl std::default::Default for TransitEncryptionMode {
1133 fn default() -> Self {
1134 use std::convert::From;
1135 Self::from(0)
1136 }
1137 }
1138
1139 impl std::fmt::Display for TransitEncryptionMode {
1140 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1141 wkt::internal::display_enum(f, self.name(), self.value())
1142 }
1143 }
1144
1145 impl std::convert::From<i32> for TransitEncryptionMode {
1146 fn from(value: i32) -> Self {
1147 match value {
1148 0 => Self::Unspecified,
1149 1 => Self::ServerAuthentication,
1150 2 => Self::Disabled,
1151 _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
1152 wkt::internal::UnknownEnumValue::Integer(value),
1153 )),
1154 }
1155 }
1156 }
1157
1158 impl std::convert::From<&str> for TransitEncryptionMode {
1159 fn from(value: &str) -> Self {
1160 use std::string::ToString;
1161 match value {
1162 "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" => Self::Unspecified,
1163 "SERVER_AUTHENTICATION" => Self::ServerAuthentication,
1164 "DISABLED" => Self::Disabled,
1165 _ => Self::UnknownValue(transit_encryption_mode::UnknownValue(
1166 wkt::internal::UnknownEnumValue::String(value.to_string()),
1167 )),
1168 }
1169 }
1170 }
1171
1172 impl serde::ser::Serialize for TransitEncryptionMode {
1173 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1174 where
1175 S: serde::Serializer,
1176 {
1177 match self {
1178 Self::Unspecified => serializer.serialize_i32(0),
1179 Self::ServerAuthentication => serializer.serialize_i32(1),
1180 Self::Disabled => serializer.serialize_i32(2),
1181 Self::UnknownValue(u) => u.0.serialize(serializer),
1182 }
1183 }
1184 }
1185
1186 impl<'de> serde::de::Deserialize<'de> for TransitEncryptionMode {
1187 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1188 where
1189 D: serde::Deserializer<'de>,
1190 {
1191 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransitEncryptionMode>::new(
1192 ".google.cloud.redis.v1.Instance.TransitEncryptionMode",
1193 ))
1194 }
1195 }
1196
1197 #[derive(Clone, Debug, PartialEq)]
1213 #[non_exhaustive]
1214 pub enum ReadReplicasMode {
1215 Unspecified,
1218 ReadReplicasDisabled,
1221 ReadReplicasEnabled,
1224 UnknownValue(read_replicas_mode::UnknownValue),
1229 }
1230
1231 #[doc(hidden)]
1232 pub mod read_replicas_mode {
1233 #[allow(unused_imports)]
1234 use super::*;
1235 #[derive(Clone, Debug, PartialEq)]
1236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1237 }
1238
1239 impl ReadReplicasMode {
1240 pub fn value(&self) -> std::option::Option<i32> {
1245 match self {
1246 Self::Unspecified => std::option::Option::Some(0),
1247 Self::ReadReplicasDisabled => std::option::Option::Some(1),
1248 Self::ReadReplicasEnabled => std::option::Option::Some(2),
1249 Self::UnknownValue(u) => u.0.value(),
1250 }
1251 }
1252
1253 pub fn name(&self) -> std::option::Option<&str> {
1258 match self {
1259 Self::Unspecified => std::option::Option::Some("READ_REPLICAS_MODE_UNSPECIFIED"),
1260 Self::ReadReplicasDisabled => std::option::Option::Some("READ_REPLICAS_DISABLED"),
1261 Self::ReadReplicasEnabled => std::option::Option::Some("READ_REPLICAS_ENABLED"),
1262 Self::UnknownValue(u) => u.0.name(),
1263 }
1264 }
1265 }
1266
1267 impl std::default::Default for ReadReplicasMode {
1268 fn default() -> Self {
1269 use std::convert::From;
1270 Self::from(0)
1271 }
1272 }
1273
1274 impl std::fmt::Display for ReadReplicasMode {
1275 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1276 wkt::internal::display_enum(f, self.name(), self.value())
1277 }
1278 }
1279
1280 impl std::convert::From<i32> for ReadReplicasMode {
1281 fn from(value: i32) -> Self {
1282 match value {
1283 0 => Self::Unspecified,
1284 1 => Self::ReadReplicasDisabled,
1285 2 => Self::ReadReplicasEnabled,
1286 _ => Self::UnknownValue(read_replicas_mode::UnknownValue(
1287 wkt::internal::UnknownEnumValue::Integer(value),
1288 )),
1289 }
1290 }
1291 }
1292
1293 impl std::convert::From<&str> for ReadReplicasMode {
1294 fn from(value: &str) -> Self {
1295 use std::string::ToString;
1296 match value {
1297 "READ_REPLICAS_MODE_UNSPECIFIED" => Self::Unspecified,
1298 "READ_REPLICAS_DISABLED" => Self::ReadReplicasDisabled,
1299 "READ_REPLICAS_ENABLED" => Self::ReadReplicasEnabled,
1300 _ => Self::UnknownValue(read_replicas_mode::UnknownValue(
1301 wkt::internal::UnknownEnumValue::String(value.to_string()),
1302 )),
1303 }
1304 }
1305 }
1306
1307 impl serde::ser::Serialize for ReadReplicasMode {
1308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1309 where
1310 S: serde::Serializer,
1311 {
1312 match self {
1313 Self::Unspecified => serializer.serialize_i32(0),
1314 Self::ReadReplicasDisabled => serializer.serialize_i32(1),
1315 Self::ReadReplicasEnabled => serializer.serialize_i32(2),
1316 Self::UnknownValue(u) => u.0.serialize(serializer),
1317 }
1318 }
1319 }
1320
1321 impl<'de> serde::de::Deserialize<'de> for ReadReplicasMode {
1322 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1323 where
1324 D: serde::Deserializer<'de>,
1325 {
1326 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReadReplicasMode>::new(
1327 ".google.cloud.redis.v1.Instance.ReadReplicasMode",
1328 ))
1329 }
1330 }
1331
1332 #[derive(Clone, Debug, PartialEq)]
1348 #[non_exhaustive]
1349 pub enum SuspensionReason {
1350 Unspecified,
1352 CustomerManagedKeyIssue,
1354 UnknownValue(suspension_reason::UnknownValue),
1359 }
1360
1361 #[doc(hidden)]
1362 pub mod suspension_reason {
1363 #[allow(unused_imports)]
1364 use super::*;
1365 #[derive(Clone, Debug, PartialEq)]
1366 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1367 }
1368
1369 impl SuspensionReason {
1370 pub fn value(&self) -> std::option::Option<i32> {
1375 match self {
1376 Self::Unspecified => std::option::Option::Some(0),
1377 Self::CustomerManagedKeyIssue => std::option::Option::Some(1),
1378 Self::UnknownValue(u) => u.0.value(),
1379 }
1380 }
1381
1382 pub fn name(&self) -> std::option::Option<&str> {
1387 match self {
1388 Self::Unspecified => std::option::Option::Some("SUSPENSION_REASON_UNSPECIFIED"),
1389 Self::CustomerManagedKeyIssue => {
1390 std::option::Option::Some("CUSTOMER_MANAGED_KEY_ISSUE")
1391 }
1392 Self::UnknownValue(u) => u.0.name(),
1393 }
1394 }
1395 }
1396
1397 impl std::default::Default for SuspensionReason {
1398 fn default() -> Self {
1399 use std::convert::From;
1400 Self::from(0)
1401 }
1402 }
1403
1404 impl std::fmt::Display for SuspensionReason {
1405 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1406 wkt::internal::display_enum(f, self.name(), self.value())
1407 }
1408 }
1409
1410 impl std::convert::From<i32> for SuspensionReason {
1411 fn from(value: i32) -> Self {
1412 match value {
1413 0 => Self::Unspecified,
1414 1 => Self::CustomerManagedKeyIssue,
1415 _ => Self::UnknownValue(suspension_reason::UnknownValue(
1416 wkt::internal::UnknownEnumValue::Integer(value),
1417 )),
1418 }
1419 }
1420 }
1421
1422 impl std::convert::From<&str> for SuspensionReason {
1423 fn from(value: &str) -> Self {
1424 use std::string::ToString;
1425 match value {
1426 "SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
1427 "CUSTOMER_MANAGED_KEY_ISSUE" => Self::CustomerManagedKeyIssue,
1428 _ => Self::UnknownValue(suspension_reason::UnknownValue(
1429 wkt::internal::UnknownEnumValue::String(value.to_string()),
1430 )),
1431 }
1432 }
1433 }
1434
1435 impl serde::ser::Serialize for SuspensionReason {
1436 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1437 where
1438 S: serde::Serializer,
1439 {
1440 match self {
1441 Self::Unspecified => serializer.serialize_i32(0),
1442 Self::CustomerManagedKeyIssue => serializer.serialize_i32(1),
1443 Self::UnknownValue(u) => u.0.serialize(serializer),
1444 }
1445 }
1446 }
1447
1448 impl<'de> serde::de::Deserialize<'de> for SuspensionReason {
1449 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1450 where
1451 D: serde::Deserializer<'de>,
1452 {
1453 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SuspensionReason>::new(
1454 ".google.cloud.redis.v1.Instance.SuspensionReason",
1455 ))
1456 }
1457 }
1458}
1459
1460#[derive(Clone, Default, PartialEq)]
1462#[non_exhaustive]
1463pub struct PersistenceConfig {
1464 pub persistence_mode: crate::model::persistence_config::PersistenceMode,
1467
1468 pub rdb_snapshot_period: crate::model::persistence_config::SnapshotPeriod,
1475
1476 pub rdb_next_snapshot_time: std::option::Option<wkt::Timestamp>,
1478
1479 pub rdb_snapshot_start_time: std::option::Option<wkt::Timestamp>,
1483
1484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1485}
1486
1487impl PersistenceConfig {
1488 pub fn new() -> Self {
1489 std::default::Default::default()
1490 }
1491
1492 pub fn set_persistence_mode<
1494 T: std::convert::Into<crate::model::persistence_config::PersistenceMode>,
1495 >(
1496 mut self,
1497 v: T,
1498 ) -> Self {
1499 self.persistence_mode = v.into();
1500 self
1501 }
1502
1503 pub fn set_rdb_snapshot_period<
1505 T: std::convert::Into<crate::model::persistence_config::SnapshotPeriod>,
1506 >(
1507 mut self,
1508 v: T,
1509 ) -> Self {
1510 self.rdb_snapshot_period = v.into();
1511 self
1512 }
1513
1514 pub fn set_rdb_next_snapshot_time<T>(mut self, v: T) -> Self
1516 where
1517 T: std::convert::Into<wkt::Timestamp>,
1518 {
1519 self.rdb_next_snapshot_time = std::option::Option::Some(v.into());
1520 self
1521 }
1522
1523 pub fn set_or_clear_rdb_next_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
1525 where
1526 T: std::convert::Into<wkt::Timestamp>,
1527 {
1528 self.rdb_next_snapshot_time = v.map(|x| x.into());
1529 self
1530 }
1531
1532 pub fn set_rdb_snapshot_start_time<T>(mut self, v: T) -> Self
1534 where
1535 T: std::convert::Into<wkt::Timestamp>,
1536 {
1537 self.rdb_snapshot_start_time = std::option::Option::Some(v.into());
1538 self
1539 }
1540
1541 pub fn set_or_clear_rdb_snapshot_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1543 where
1544 T: std::convert::Into<wkt::Timestamp>,
1545 {
1546 self.rdb_snapshot_start_time = v.map(|x| x.into());
1547 self
1548 }
1549}
1550
1551impl wkt::message::Message for PersistenceConfig {
1552 fn typename() -> &'static str {
1553 "type.googleapis.com/google.cloud.redis.v1.PersistenceConfig"
1554 }
1555}
1556
1557pub mod persistence_config {
1559 #[allow(unused_imports)]
1560 use super::*;
1561
1562 #[derive(Clone, Debug, PartialEq)]
1578 #[non_exhaustive]
1579 pub enum PersistenceMode {
1580 Unspecified,
1582 Disabled,
1585 Rdb,
1587 UnknownValue(persistence_mode::UnknownValue),
1592 }
1593
1594 #[doc(hidden)]
1595 pub mod persistence_mode {
1596 #[allow(unused_imports)]
1597 use super::*;
1598 #[derive(Clone, Debug, PartialEq)]
1599 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1600 }
1601
1602 impl PersistenceMode {
1603 pub fn value(&self) -> std::option::Option<i32> {
1608 match self {
1609 Self::Unspecified => std::option::Option::Some(0),
1610 Self::Disabled => std::option::Option::Some(1),
1611 Self::Rdb => std::option::Option::Some(2),
1612 Self::UnknownValue(u) => u.0.value(),
1613 }
1614 }
1615
1616 pub fn name(&self) -> std::option::Option<&str> {
1621 match self {
1622 Self::Unspecified => std::option::Option::Some("PERSISTENCE_MODE_UNSPECIFIED"),
1623 Self::Disabled => std::option::Option::Some("DISABLED"),
1624 Self::Rdb => std::option::Option::Some("RDB"),
1625 Self::UnknownValue(u) => u.0.name(),
1626 }
1627 }
1628 }
1629
1630 impl std::default::Default for PersistenceMode {
1631 fn default() -> Self {
1632 use std::convert::From;
1633 Self::from(0)
1634 }
1635 }
1636
1637 impl std::fmt::Display for PersistenceMode {
1638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1639 wkt::internal::display_enum(f, self.name(), self.value())
1640 }
1641 }
1642
1643 impl std::convert::From<i32> for PersistenceMode {
1644 fn from(value: i32) -> Self {
1645 match value {
1646 0 => Self::Unspecified,
1647 1 => Self::Disabled,
1648 2 => Self::Rdb,
1649 _ => Self::UnknownValue(persistence_mode::UnknownValue(
1650 wkt::internal::UnknownEnumValue::Integer(value),
1651 )),
1652 }
1653 }
1654 }
1655
1656 impl std::convert::From<&str> for PersistenceMode {
1657 fn from(value: &str) -> Self {
1658 use std::string::ToString;
1659 match value {
1660 "PERSISTENCE_MODE_UNSPECIFIED" => Self::Unspecified,
1661 "DISABLED" => Self::Disabled,
1662 "RDB" => Self::Rdb,
1663 _ => Self::UnknownValue(persistence_mode::UnknownValue(
1664 wkt::internal::UnknownEnumValue::String(value.to_string()),
1665 )),
1666 }
1667 }
1668 }
1669
1670 impl serde::ser::Serialize for PersistenceMode {
1671 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1672 where
1673 S: serde::Serializer,
1674 {
1675 match self {
1676 Self::Unspecified => serializer.serialize_i32(0),
1677 Self::Disabled => serializer.serialize_i32(1),
1678 Self::Rdb => serializer.serialize_i32(2),
1679 Self::UnknownValue(u) => u.0.serialize(serializer),
1680 }
1681 }
1682 }
1683
1684 impl<'de> serde::de::Deserialize<'de> for PersistenceMode {
1685 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1686 where
1687 D: serde::Deserializer<'de>,
1688 {
1689 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PersistenceMode>::new(
1690 ".google.cloud.redis.v1.PersistenceConfig.PersistenceMode",
1691 ))
1692 }
1693 }
1694
1695 #[derive(Clone, Debug, PartialEq)]
1711 #[non_exhaustive]
1712 pub enum SnapshotPeriod {
1713 Unspecified,
1715 OneHour,
1717 SixHours,
1719 TwelveHours,
1721 TwentyFourHours,
1723 UnknownValue(snapshot_period::UnknownValue),
1728 }
1729
1730 #[doc(hidden)]
1731 pub mod snapshot_period {
1732 #[allow(unused_imports)]
1733 use super::*;
1734 #[derive(Clone, Debug, PartialEq)]
1735 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1736 }
1737
1738 impl SnapshotPeriod {
1739 pub fn value(&self) -> std::option::Option<i32> {
1744 match self {
1745 Self::Unspecified => std::option::Option::Some(0),
1746 Self::OneHour => std::option::Option::Some(3),
1747 Self::SixHours => std::option::Option::Some(4),
1748 Self::TwelveHours => std::option::Option::Some(5),
1749 Self::TwentyFourHours => std::option::Option::Some(6),
1750 Self::UnknownValue(u) => u.0.value(),
1751 }
1752 }
1753
1754 pub fn name(&self) -> std::option::Option<&str> {
1759 match self {
1760 Self::Unspecified => std::option::Option::Some("SNAPSHOT_PERIOD_UNSPECIFIED"),
1761 Self::OneHour => std::option::Option::Some("ONE_HOUR"),
1762 Self::SixHours => std::option::Option::Some("SIX_HOURS"),
1763 Self::TwelveHours => std::option::Option::Some("TWELVE_HOURS"),
1764 Self::TwentyFourHours => std::option::Option::Some("TWENTY_FOUR_HOURS"),
1765 Self::UnknownValue(u) => u.0.name(),
1766 }
1767 }
1768 }
1769
1770 impl std::default::Default for SnapshotPeriod {
1771 fn default() -> Self {
1772 use std::convert::From;
1773 Self::from(0)
1774 }
1775 }
1776
1777 impl std::fmt::Display for SnapshotPeriod {
1778 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1779 wkt::internal::display_enum(f, self.name(), self.value())
1780 }
1781 }
1782
1783 impl std::convert::From<i32> for SnapshotPeriod {
1784 fn from(value: i32) -> Self {
1785 match value {
1786 0 => Self::Unspecified,
1787 3 => Self::OneHour,
1788 4 => Self::SixHours,
1789 5 => Self::TwelveHours,
1790 6 => Self::TwentyFourHours,
1791 _ => Self::UnknownValue(snapshot_period::UnknownValue(
1792 wkt::internal::UnknownEnumValue::Integer(value),
1793 )),
1794 }
1795 }
1796 }
1797
1798 impl std::convert::From<&str> for SnapshotPeriod {
1799 fn from(value: &str) -> Self {
1800 use std::string::ToString;
1801 match value {
1802 "SNAPSHOT_PERIOD_UNSPECIFIED" => Self::Unspecified,
1803 "ONE_HOUR" => Self::OneHour,
1804 "SIX_HOURS" => Self::SixHours,
1805 "TWELVE_HOURS" => Self::TwelveHours,
1806 "TWENTY_FOUR_HOURS" => Self::TwentyFourHours,
1807 _ => Self::UnknownValue(snapshot_period::UnknownValue(
1808 wkt::internal::UnknownEnumValue::String(value.to_string()),
1809 )),
1810 }
1811 }
1812 }
1813
1814 impl serde::ser::Serialize for SnapshotPeriod {
1815 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1816 where
1817 S: serde::Serializer,
1818 {
1819 match self {
1820 Self::Unspecified => serializer.serialize_i32(0),
1821 Self::OneHour => serializer.serialize_i32(3),
1822 Self::SixHours => serializer.serialize_i32(4),
1823 Self::TwelveHours => serializer.serialize_i32(5),
1824 Self::TwentyFourHours => serializer.serialize_i32(6),
1825 Self::UnknownValue(u) => u.0.serialize(serializer),
1826 }
1827 }
1828 }
1829
1830 impl<'de> serde::de::Deserialize<'de> for SnapshotPeriod {
1831 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1832 where
1833 D: serde::Deserializer<'de>,
1834 {
1835 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SnapshotPeriod>::new(
1836 ".google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod",
1837 ))
1838 }
1839 }
1840}
1841
1842#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct RescheduleMaintenanceRequest {
1849 pub name: std::string::String,
1853
1854 pub reschedule_type: crate::model::reschedule_maintenance_request::RescheduleType,
1857
1858 pub schedule_time: std::option::Option<wkt::Timestamp>,
1862
1863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1864}
1865
1866impl RescheduleMaintenanceRequest {
1867 pub fn new() -> Self {
1868 std::default::Default::default()
1869 }
1870
1871 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1873 self.name = v.into();
1874 self
1875 }
1876
1877 pub fn set_reschedule_type<
1879 T: std::convert::Into<crate::model::reschedule_maintenance_request::RescheduleType>,
1880 >(
1881 mut self,
1882 v: T,
1883 ) -> Self {
1884 self.reschedule_type = v.into();
1885 self
1886 }
1887
1888 pub fn set_schedule_time<T>(mut self, v: T) -> Self
1890 where
1891 T: std::convert::Into<wkt::Timestamp>,
1892 {
1893 self.schedule_time = std::option::Option::Some(v.into());
1894 self
1895 }
1896
1897 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
1899 where
1900 T: std::convert::Into<wkt::Timestamp>,
1901 {
1902 self.schedule_time = v.map(|x| x.into());
1903 self
1904 }
1905}
1906
1907impl wkt::message::Message for RescheduleMaintenanceRequest {
1908 fn typename() -> &'static str {
1909 "type.googleapis.com/google.cloud.redis.v1.RescheduleMaintenanceRequest"
1910 }
1911}
1912
1913pub mod reschedule_maintenance_request {
1915 #[allow(unused_imports)]
1916 use super::*;
1917
1918 #[derive(Clone, Debug, PartialEq)]
1934 #[non_exhaustive]
1935 pub enum RescheduleType {
1936 Unspecified,
1938 Immediate,
1940 NextAvailableWindow,
1943 SpecificTime,
1945 UnknownValue(reschedule_type::UnknownValue),
1950 }
1951
1952 #[doc(hidden)]
1953 pub mod reschedule_type {
1954 #[allow(unused_imports)]
1955 use super::*;
1956 #[derive(Clone, Debug, PartialEq)]
1957 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1958 }
1959
1960 impl RescheduleType {
1961 pub fn value(&self) -> std::option::Option<i32> {
1966 match self {
1967 Self::Unspecified => std::option::Option::Some(0),
1968 Self::Immediate => std::option::Option::Some(1),
1969 Self::NextAvailableWindow => std::option::Option::Some(2),
1970 Self::SpecificTime => std::option::Option::Some(3),
1971 Self::UnknownValue(u) => u.0.value(),
1972 }
1973 }
1974
1975 pub fn name(&self) -> std::option::Option<&str> {
1980 match self {
1981 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
1982 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
1983 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
1984 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
1985 Self::UnknownValue(u) => u.0.name(),
1986 }
1987 }
1988 }
1989
1990 impl std::default::Default for RescheduleType {
1991 fn default() -> Self {
1992 use std::convert::From;
1993 Self::from(0)
1994 }
1995 }
1996
1997 impl std::fmt::Display for RescheduleType {
1998 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1999 wkt::internal::display_enum(f, self.name(), self.value())
2000 }
2001 }
2002
2003 impl std::convert::From<i32> for RescheduleType {
2004 fn from(value: i32) -> Self {
2005 match value {
2006 0 => Self::Unspecified,
2007 1 => Self::Immediate,
2008 2 => Self::NextAvailableWindow,
2009 3 => Self::SpecificTime,
2010 _ => Self::UnknownValue(reschedule_type::UnknownValue(
2011 wkt::internal::UnknownEnumValue::Integer(value),
2012 )),
2013 }
2014 }
2015 }
2016
2017 impl std::convert::From<&str> for RescheduleType {
2018 fn from(value: &str) -> Self {
2019 use std::string::ToString;
2020 match value {
2021 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
2022 "IMMEDIATE" => Self::Immediate,
2023 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
2024 "SPECIFIC_TIME" => Self::SpecificTime,
2025 _ => Self::UnknownValue(reschedule_type::UnknownValue(
2026 wkt::internal::UnknownEnumValue::String(value.to_string()),
2027 )),
2028 }
2029 }
2030 }
2031
2032 impl serde::ser::Serialize for RescheduleType {
2033 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2034 where
2035 S: serde::Serializer,
2036 {
2037 match self {
2038 Self::Unspecified => serializer.serialize_i32(0),
2039 Self::Immediate => serializer.serialize_i32(1),
2040 Self::NextAvailableWindow => serializer.serialize_i32(2),
2041 Self::SpecificTime => serializer.serialize_i32(3),
2042 Self::UnknownValue(u) => u.0.serialize(serializer),
2043 }
2044 }
2045 }
2046
2047 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
2048 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2049 where
2050 D: serde::Deserializer<'de>,
2051 {
2052 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
2053 ".google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType",
2054 ))
2055 }
2056 }
2057}
2058
2059#[derive(Clone, Default, PartialEq)]
2061#[non_exhaustive]
2062pub struct MaintenancePolicy {
2063 pub create_time: std::option::Option<wkt::Timestamp>,
2065
2066 pub update_time: std::option::Option<wkt::Timestamp>,
2068
2069 pub description: std::string::String,
2072
2073 pub weekly_maintenance_window: std::vec::Vec<crate::model::WeeklyMaintenanceWindow>,
2077
2078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2079}
2080
2081impl MaintenancePolicy {
2082 pub fn new() -> Self {
2083 std::default::Default::default()
2084 }
2085
2086 pub fn set_create_time<T>(mut self, v: T) -> Self
2088 where
2089 T: std::convert::Into<wkt::Timestamp>,
2090 {
2091 self.create_time = std::option::Option::Some(v.into());
2092 self
2093 }
2094
2095 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2097 where
2098 T: std::convert::Into<wkt::Timestamp>,
2099 {
2100 self.create_time = v.map(|x| x.into());
2101 self
2102 }
2103
2104 pub fn set_update_time<T>(mut self, v: T) -> Self
2106 where
2107 T: std::convert::Into<wkt::Timestamp>,
2108 {
2109 self.update_time = std::option::Option::Some(v.into());
2110 self
2111 }
2112
2113 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2115 where
2116 T: std::convert::Into<wkt::Timestamp>,
2117 {
2118 self.update_time = v.map(|x| x.into());
2119 self
2120 }
2121
2122 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.description = v.into();
2125 self
2126 }
2127
2128 pub fn set_weekly_maintenance_window<T, V>(mut self, v: T) -> Self
2130 where
2131 T: std::iter::IntoIterator<Item = V>,
2132 V: std::convert::Into<crate::model::WeeklyMaintenanceWindow>,
2133 {
2134 use std::iter::Iterator;
2135 self.weekly_maintenance_window = v.into_iter().map(|i| i.into()).collect();
2136 self
2137 }
2138}
2139
2140impl wkt::message::Message for MaintenancePolicy {
2141 fn typename() -> &'static str {
2142 "type.googleapis.com/google.cloud.redis.v1.MaintenancePolicy"
2143 }
2144}
2145
2146#[derive(Clone, Default, PartialEq)]
2149#[non_exhaustive]
2150pub struct WeeklyMaintenanceWindow {
2151 pub day: gtype::model::DayOfWeek,
2153
2154 pub start_time: std::option::Option<gtype::model::TimeOfDay>,
2156
2157 pub duration: std::option::Option<wkt::Duration>,
2160
2161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2162}
2163
2164impl WeeklyMaintenanceWindow {
2165 pub fn new() -> Self {
2166 std::default::Default::default()
2167 }
2168
2169 pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
2171 self.day = v.into();
2172 self
2173 }
2174
2175 pub fn set_start_time<T>(mut self, v: T) -> Self
2177 where
2178 T: std::convert::Into<gtype::model::TimeOfDay>,
2179 {
2180 self.start_time = std::option::Option::Some(v.into());
2181 self
2182 }
2183
2184 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<gtype::model::TimeOfDay>,
2188 {
2189 self.start_time = v.map(|x| x.into());
2190 self
2191 }
2192
2193 pub fn set_duration<T>(mut self, v: T) -> Self
2195 where
2196 T: std::convert::Into<wkt::Duration>,
2197 {
2198 self.duration = std::option::Option::Some(v.into());
2199 self
2200 }
2201
2202 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2204 where
2205 T: std::convert::Into<wkt::Duration>,
2206 {
2207 self.duration = v.map(|x| x.into());
2208 self
2209 }
2210}
2211
2212impl wkt::message::Message for WeeklyMaintenanceWindow {
2213 fn typename() -> &'static str {
2214 "type.googleapis.com/google.cloud.redis.v1.WeeklyMaintenanceWindow"
2215 }
2216}
2217
2218#[derive(Clone, Default, PartialEq)]
2221#[non_exhaustive]
2222pub struct MaintenanceSchedule {
2223 pub start_time: std::option::Option<wkt::Timestamp>,
2226
2227 pub end_time: std::option::Option<wkt::Timestamp>,
2230
2231 #[deprecated]
2233 pub can_reschedule: bool,
2234
2235 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
2238
2239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2240}
2241
2242impl MaintenanceSchedule {
2243 pub fn new() -> Self {
2244 std::default::Default::default()
2245 }
2246
2247 pub fn set_start_time<T>(mut self, v: T) -> Self
2249 where
2250 T: std::convert::Into<wkt::Timestamp>,
2251 {
2252 self.start_time = std::option::Option::Some(v.into());
2253 self
2254 }
2255
2256 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2258 where
2259 T: std::convert::Into<wkt::Timestamp>,
2260 {
2261 self.start_time = v.map(|x| x.into());
2262 self
2263 }
2264
2265 pub fn set_end_time<T>(mut self, v: T) -> Self
2267 where
2268 T: std::convert::Into<wkt::Timestamp>,
2269 {
2270 self.end_time = std::option::Option::Some(v.into());
2271 self
2272 }
2273
2274 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2276 where
2277 T: std::convert::Into<wkt::Timestamp>,
2278 {
2279 self.end_time = v.map(|x| x.into());
2280 self
2281 }
2282
2283 #[deprecated]
2285 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2286 self.can_reschedule = v.into();
2287 self
2288 }
2289
2290 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
2292 where
2293 T: std::convert::Into<wkt::Timestamp>,
2294 {
2295 self.schedule_deadline_time = std::option::Option::Some(v.into());
2296 self
2297 }
2298
2299 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
2301 where
2302 T: std::convert::Into<wkt::Timestamp>,
2303 {
2304 self.schedule_deadline_time = v.map(|x| x.into());
2305 self
2306 }
2307}
2308
2309impl wkt::message::Message for MaintenanceSchedule {
2310 fn typename() -> &'static str {
2311 "type.googleapis.com/google.cloud.redis.v1.MaintenanceSchedule"
2312 }
2313}
2314
2315#[derive(Clone, Default, PartialEq)]
2319#[non_exhaustive]
2320pub struct ListInstancesRequest {
2321 pub parent: std::string::String,
2325
2326 pub page_size: i32,
2336
2337 pub page_token: std::string::String,
2343
2344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2345}
2346
2347impl ListInstancesRequest {
2348 pub fn new() -> Self {
2349 std::default::Default::default()
2350 }
2351
2352 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2354 self.parent = v.into();
2355 self
2356 }
2357
2358 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2360 self.page_size = v.into();
2361 self
2362 }
2363
2364 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2366 self.page_token = v.into();
2367 self
2368 }
2369}
2370
2371impl wkt::message::Message for ListInstancesRequest {
2372 fn typename() -> &'static str {
2373 "type.googleapis.com/google.cloud.redis.v1.ListInstancesRequest"
2374 }
2375}
2376
2377#[derive(Clone, Default, PartialEq)]
2381#[non_exhaustive]
2382pub struct ListInstancesResponse {
2383 pub instances: std::vec::Vec<crate::model::Instance>,
2395
2396 pub next_page_token: std::string::String,
2399
2400 pub unreachable: std::vec::Vec<std::string::String>,
2402
2403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2404}
2405
2406impl ListInstancesResponse {
2407 pub fn new() -> Self {
2408 std::default::Default::default()
2409 }
2410
2411 pub fn set_instances<T, V>(mut self, v: T) -> Self
2413 where
2414 T: std::iter::IntoIterator<Item = V>,
2415 V: std::convert::Into<crate::model::Instance>,
2416 {
2417 use std::iter::Iterator;
2418 self.instances = v.into_iter().map(|i| i.into()).collect();
2419 self
2420 }
2421
2422 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.next_page_token = v.into();
2425 self
2426 }
2427
2428 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2430 where
2431 T: std::iter::IntoIterator<Item = V>,
2432 V: std::convert::Into<std::string::String>,
2433 {
2434 use std::iter::Iterator;
2435 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2436 self
2437 }
2438}
2439
2440impl wkt::message::Message for ListInstancesResponse {
2441 fn typename() -> &'static str {
2442 "type.googleapis.com/google.cloud.redis.v1.ListInstancesResponse"
2443 }
2444}
2445
2446#[doc(hidden)]
2447impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
2448 type PageItem = crate::model::Instance;
2449
2450 fn items(self) -> std::vec::Vec<Self::PageItem> {
2451 self.instances
2452 }
2453
2454 fn next_page_token(&self) -> std::string::String {
2455 use std::clone::Clone;
2456 self.next_page_token.clone()
2457 }
2458}
2459
2460#[derive(Clone, Default, PartialEq)]
2464#[non_exhaustive]
2465pub struct GetInstanceRequest {
2466 pub name: std::string::String,
2470
2471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2472}
2473
2474impl GetInstanceRequest {
2475 pub fn new() -> Self {
2476 std::default::Default::default()
2477 }
2478
2479 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2481 self.name = v.into();
2482 self
2483 }
2484}
2485
2486impl wkt::message::Message for GetInstanceRequest {
2487 fn typename() -> &'static str {
2488 "type.googleapis.com/google.cloud.redis.v1.GetInstanceRequest"
2489 }
2490}
2491
2492#[derive(Clone, Default, PartialEq)]
2497#[non_exhaustive]
2498pub struct GetInstanceAuthStringRequest {
2499 pub name: std::string::String,
2503
2504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2505}
2506
2507impl GetInstanceAuthStringRequest {
2508 pub fn new() -> Self {
2509 std::default::Default::default()
2510 }
2511
2512 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2514 self.name = v.into();
2515 self
2516 }
2517}
2518
2519impl wkt::message::Message for GetInstanceAuthStringRequest {
2520 fn typename() -> &'static str {
2521 "type.googleapis.com/google.cloud.redis.v1.GetInstanceAuthStringRequest"
2522 }
2523}
2524
2525#[derive(Clone, Default, PartialEq)]
2527#[non_exhaustive]
2528pub struct InstanceAuthString {
2529 pub auth_string: std::string::String,
2531
2532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2533}
2534
2535impl InstanceAuthString {
2536 pub fn new() -> Self {
2537 std::default::Default::default()
2538 }
2539
2540 pub fn set_auth_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2542 self.auth_string = v.into();
2543 self
2544 }
2545}
2546
2547impl wkt::message::Message for InstanceAuthString {
2548 fn typename() -> &'static str {
2549 "type.googleapis.com/google.cloud.redis.v1.InstanceAuthString"
2550 }
2551}
2552
2553#[derive(Clone, Default, PartialEq)]
2558#[non_exhaustive]
2559pub struct CreateInstanceRequest {
2560 pub parent: std::string::String,
2564
2565 pub instance_id: std::string::String,
2574
2575 pub instance: std::option::Option<crate::model::Instance>,
2577
2578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2579}
2580
2581impl CreateInstanceRequest {
2582 pub fn new() -> Self {
2583 std::default::Default::default()
2584 }
2585
2586 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2588 self.parent = v.into();
2589 self
2590 }
2591
2592 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2594 self.instance_id = v.into();
2595 self
2596 }
2597
2598 pub fn set_instance<T>(mut self, v: T) -> Self
2600 where
2601 T: std::convert::Into<crate::model::Instance>,
2602 {
2603 self.instance = std::option::Option::Some(v.into());
2604 self
2605 }
2606
2607 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2609 where
2610 T: std::convert::Into<crate::model::Instance>,
2611 {
2612 self.instance = v.map(|x| x.into());
2613 self
2614 }
2615}
2616
2617impl wkt::message::Message for CreateInstanceRequest {
2618 fn typename() -> &'static str {
2619 "type.googleapis.com/google.cloud.redis.v1.CreateInstanceRequest"
2620 }
2621}
2622
2623#[derive(Clone, Default, PartialEq)]
2628#[non_exhaustive]
2629pub struct UpdateInstanceRequest {
2630 pub update_mask: std::option::Option<wkt::FieldMask>,
2642
2643 pub instance: std::option::Option<crate::model::Instance>,
2646
2647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2648}
2649
2650impl UpdateInstanceRequest {
2651 pub fn new() -> Self {
2652 std::default::Default::default()
2653 }
2654
2655 pub fn set_update_mask<T>(mut self, v: T) -> Self
2657 where
2658 T: std::convert::Into<wkt::FieldMask>,
2659 {
2660 self.update_mask = std::option::Option::Some(v.into());
2661 self
2662 }
2663
2664 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2666 where
2667 T: std::convert::Into<wkt::FieldMask>,
2668 {
2669 self.update_mask = v.map(|x| x.into());
2670 self
2671 }
2672
2673 pub fn set_instance<T>(mut self, v: T) -> Self
2675 where
2676 T: std::convert::Into<crate::model::Instance>,
2677 {
2678 self.instance = std::option::Option::Some(v.into());
2679 self
2680 }
2681
2682 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2684 where
2685 T: std::convert::Into<crate::model::Instance>,
2686 {
2687 self.instance = v.map(|x| x.into());
2688 self
2689 }
2690}
2691
2692impl wkt::message::Message for UpdateInstanceRequest {
2693 fn typename() -> &'static str {
2694 "type.googleapis.com/google.cloud.redis.v1.UpdateInstanceRequest"
2695 }
2696}
2697
2698#[derive(Clone, Default, PartialEq)]
2703#[non_exhaustive]
2704pub struct UpgradeInstanceRequest {
2705 pub name: std::string::String,
2709
2710 pub redis_version: std::string::String,
2712
2713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2714}
2715
2716impl UpgradeInstanceRequest {
2717 pub fn new() -> Self {
2718 std::default::Default::default()
2719 }
2720
2721 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2723 self.name = v.into();
2724 self
2725 }
2726
2727 pub fn set_redis_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729 self.redis_version = v.into();
2730 self
2731 }
2732}
2733
2734impl wkt::message::Message for UpgradeInstanceRequest {
2735 fn typename() -> &'static str {
2736 "type.googleapis.com/google.cloud.redis.v1.UpgradeInstanceRequest"
2737 }
2738}
2739
2740#[derive(Clone, Default, PartialEq)]
2745#[non_exhaustive]
2746pub struct DeleteInstanceRequest {
2747 pub name: std::string::String,
2751
2752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753}
2754
2755impl DeleteInstanceRequest {
2756 pub fn new() -> Self {
2757 std::default::Default::default()
2758 }
2759
2760 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762 self.name = v.into();
2763 self
2764 }
2765}
2766
2767impl wkt::message::Message for DeleteInstanceRequest {
2768 fn typename() -> &'static str {
2769 "type.googleapis.com/google.cloud.redis.v1.DeleteInstanceRequest"
2770 }
2771}
2772
2773#[derive(Clone, Default, PartialEq)]
2775#[non_exhaustive]
2776pub struct GcsSource {
2777 pub uri: std::string::String,
2779
2780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2781}
2782
2783impl GcsSource {
2784 pub fn new() -> Self {
2785 std::default::Default::default()
2786 }
2787
2788 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2790 self.uri = v.into();
2791 self
2792 }
2793}
2794
2795impl wkt::message::Message for GcsSource {
2796 fn typename() -> &'static str {
2797 "type.googleapis.com/google.cloud.redis.v1.GcsSource"
2798 }
2799}
2800
2801#[derive(Clone, Default, PartialEq)]
2803#[non_exhaustive]
2804pub struct InputConfig {
2805 pub source: std::option::Option<crate::model::input_config::Source>,
2807
2808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2809}
2810
2811impl InputConfig {
2812 pub fn new() -> Self {
2813 std::default::Default::default()
2814 }
2815
2816 pub fn set_source<
2821 T: std::convert::Into<std::option::Option<crate::model::input_config::Source>>,
2822 >(
2823 mut self,
2824 v: T,
2825 ) -> Self {
2826 self.source = v.into();
2827 self
2828 }
2829
2830 pub fn gcs_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsSource>> {
2834 #[allow(unreachable_patterns)]
2835 self.source.as_ref().and_then(|v| match v {
2836 crate::model::input_config::Source::GcsSource(v) => std::option::Option::Some(v),
2837 _ => std::option::Option::None,
2838 })
2839 }
2840
2841 pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSource>>>(
2847 mut self,
2848 v: T,
2849 ) -> Self {
2850 self.source =
2851 std::option::Option::Some(crate::model::input_config::Source::GcsSource(v.into()));
2852 self
2853 }
2854}
2855
2856impl wkt::message::Message for InputConfig {
2857 fn typename() -> &'static str {
2858 "type.googleapis.com/google.cloud.redis.v1.InputConfig"
2859 }
2860}
2861
2862pub mod input_config {
2864 #[allow(unused_imports)]
2865 use super::*;
2866
2867 #[derive(Clone, Debug, PartialEq)]
2869 #[non_exhaustive]
2870 pub enum Source {
2871 GcsSource(std::boxed::Box<crate::model::GcsSource>),
2873 }
2874}
2875
2876#[derive(Clone, Default, PartialEq)]
2880#[non_exhaustive]
2881pub struct ImportInstanceRequest {
2882 pub name: std::string::String,
2886
2887 pub input_config: std::option::Option<crate::model::InputConfig>,
2889
2890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2891}
2892
2893impl ImportInstanceRequest {
2894 pub fn new() -> Self {
2895 std::default::Default::default()
2896 }
2897
2898 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2900 self.name = v.into();
2901 self
2902 }
2903
2904 pub fn set_input_config<T>(mut self, v: T) -> Self
2906 where
2907 T: std::convert::Into<crate::model::InputConfig>,
2908 {
2909 self.input_config = std::option::Option::Some(v.into());
2910 self
2911 }
2912
2913 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
2915 where
2916 T: std::convert::Into<crate::model::InputConfig>,
2917 {
2918 self.input_config = v.map(|x| x.into());
2919 self
2920 }
2921}
2922
2923impl wkt::message::Message for ImportInstanceRequest {
2924 fn typename() -> &'static str {
2925 "type.googleapis.com/google.cloud.redis.v1.ImportInstanceRequest"
2926 }
2927}
2928
2929#[derive(Clone, Default, PartialEq)]
2931#[non_exhaustive]
2932pub struct GcsDestination {
2933 pub uri: std::string::String,
2936
2937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2938}
2939
2940impl GcsDestination {
2941 pub fn new() -> Self {
2942 std::default::Default::default()
2943 }
2944
2945 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2947 self.uri = v.into();
2948 self
2949 }
2950}
2951
2952impl wkt::message::Message for GcsDestination {
2953 fn typename() -> &'static str {
2954 "type.googleapis.com/google.cloud.redis.v1.GcsDestination"
2955 }
2956}
2957
2958#[derive(Clone, Default, PartialEq)]
2960#[non_exhaustive]
2961pub struct OutputConfig {
2962 pub destination: std::option::Option<crate::model::output_config::Destination>,
2964
2965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2966}
2967
2968impl OutputConfig {
2969 pub fn new() -> Self {
2970 std::default::Default::default()
2971 }
2972
2973 pub fn set_destination<
2978 T: std::convert::Into<std::option::Option<crate::model::output_config::Destination>>,
2979 >(
2980 mut self,
2981 v: T,
2982 ) -> Self {
2983 self.destination = v.into();
2984 self
2985 }
2986
2987 pub fn gcs_destination(
2991 &self,
2992 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestination>> {
2993 #[allow(unreachable_patterns)]
2994 self.destination.as_ref().and_then(|v| match v {
2995 crate::model::output_config::Destination::GcsDestination(v) => {
2996 std::option::Option::Some(v)
2997 }
2998 _ => std::option::Option::None,
2999 })
3000 }
3001
3002 pub fn set_gcs_destination<
3008 T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
3009 >(
3010 mut self,
3011 v: T,
3012 ) -> Self {
3013 self.destination = std::option::Option::Some(
3014 crate::model::output_config::Destination::GcsDestination(v.into()),
3015 );
3016 self
3017 }
3018}
3019
3020impl wkt::message::Message for OutputConfig {
3021 fn typename() -> &'static str {
3022 "type.googleapis.com/google.cloud.redis.v1.OutputConfig"
3023 }
3024}
3025
3026pub mod output_config {
3028 #[allow(unused_imports)]
3029 use super::*;
3030
3031 #[derive(Clone, Debug, PartialEq)]
3033 #[non_exhaustive]
3034 pub enum Destination {
3035 GcsDestination(std::boxed::Box<crate::model::GcsDestination>),
3037 }
3038}
3039
3040#[derive(Clone, Default, PartialEq)]
3044#[non_exhaustive]
3045pub struct ExportInstanceRequest {
3046 pub name: std::string::String,
3050
3051 pub output_config: std::option::Option<crate::model::OutputConfig>,
3053
3054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3055}
3056
3057impl ExportInstanceRequest {
3058 pub fn new() -> Self {
3059 std::default::Default::default()
3060 }
3061
3062 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.name = v.into();
3065 self
3066 }
3067
3068 pub fn set_output_config<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<crate::model::OutputConfig>,
3072 {
3073 self.output_config = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3079 where
3080 T: std::convert::Into<crate::model::OutputConfig>,
3081 {
3082 self.output_config = v.map(|x| x.into());
3083 self
3084 }
3085}
3086
3087impl wkt::message::Message for ExportInstanceRequest {
3088 fn typename() -> &'static str {
3089 "type.googleapis.com/google.cloud.redis.v1.ExportInstanceRequest"
3090 }
3091}
3092
3093#[derive(Clone, Default, PartialEq)]
3097#[non_exhaustive]
3098pub struct FailoverInstanceRequest {
3099 pub name: std::string::String,
3103
3104 pub data_protection_mode: crate::model::failover_instance_request::DataProtectionMode,
3107
3108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3109}
3110
3111impl FailoverInstanceRequest {
3112 pub fn new() -> Self {
3113 std::default::Default::default()
3114 }
3115
3116 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.name = v.into();
3119 self
3120 }
3121
3122 pub fn set_data_protection_mode<
3124 T: std::convert::Into<crate::model::failover_instance_request::DataProtectionMode>,
3125 >(
3126 mut self,
3127 v: T,
3128 ) -> Self {
3129 self.data_protection_mode = v.into();
3130 self
3131 }
3132}
3133
3134impl wkt::message::Message for FailoverInstanceRequest {
3135 fn typename() -> &'static str {
3136 "type.googleapis.com/google.cloud.redis.v1.FailoverInstanceRequest"
3137 }
3138}
3139
3140pub mod failover_instance_request {
3142 #[allow(unused_imports)]
3143 use super::*;
3144
3145 #[derive(Clone, Debug, PartialEq)]
3161 #[non_exhaustive]
3162 pub enum DataProtectionMode {
3163 Unspecified,
3166 LimitedDataLoss,
3171 ForceDataLoss,
3173 UnknownValue(data_protection_mode::UnknownValue),
3178 }
3179
3180 #[doc(hidden)]
3181 pub mod data_protection_mode {
3182 #[allow(unused_imports)]
3183 use super::*;
3184 #[derive(Clone, Debug, PartialEq)]
3185 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3186 }
3187
3188 impl DataProtectionMode {
3189 pub fn value(&self) -> std::option::Option<i32> {
3194 match self {
3195 Self::Unspecified => std::option::Option::Some(0),
3196 Self::LimitedDataLoss => std::option::Option::Some(1),
3197 Self::ForceDataLoss => std::option::Option::Some(2),
3198 Self::UnknownValue(u) => u.0.value(),
3199 }
3200 }
3201
3202 pub fn name(&self) -> std::option::Option<&str> {
3207 match self {
3208 Self::Unspecified => std::option::Option::Some("DATA_PROTECTION_MODE_UNSPECIFIED"),
3209 Self::LimitedDataLoss => std::option::Option::Some("LIMITED_DATA_LOSS"),
3210 Self::ForceDataLoss => std::option::Option::Some("FORCE_DATA_LOSS"),
3211 Self::UnknownValue(u) => u.0.name(),
3212 }
3213 }
3214 }
3215
3216 impl std::default::Default for DataProtectionMode {
3217 fn default() -> Self {
3218 use std::convert::From;
3219 Self::from(0)
3220 }
3221 }
3222
3223 impl std::fmt::Display for DataProtectionMode {
3224 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3225 wkt::internal::display_enum(f, self.name(), self.value())
3226 }
3227 }
3228
3229 impl std::convert::From<i32> for DataProtectionMode {
3230 fn from(value: i32) -> Self {
3231 match value {
3232 0 => Self::Unspecified,
3233 1 => Self::LimitedDataLoss,
3234 2 => Self::ForceDataLoss,
3235 _ => Self::UnknownValue(data_protection_mode::UnknownValue(
3236 wkt::internal::UnknownEnumValue::Integer(value),
3237 )),
3238 }
3239 }
3240 }
3241
3242 impl std::convert::From<&str> for DataProtectionMode {
3243 fn from(value: &str) -> Self {
3244 use std::string::ToString;
3245 match value {
3246 "DATA_PROTECTION_MODE_UNSPECIFIED" => Self::Unspecified,
3247 "LIMITED_DATA_LOSS" => Self::LimitedDataLoss,
3248 "FORCE_DATA_LOSS" => Self::ForceDataLoss,
3249 _ => Self::UnknownValue(data_protection_mode::UnknownValue(
3250 wkt::internal::UnknownEnumValue::String(value.to_string()),
3251 )),
3252 }
3253 }
3254 }
3255
3256 impl serde::ser::Serialize for DataProtectionMode {
3257 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3258 where
3259 S: serde::Serializer,
3260 {
3261 match self {
3262 Self::Unspecified => serializer.serialize_i32(0),
3263 Self::LimitedDataLoss => serializer.serialize_i32(1),
3264 Self::ForceDataLoss => serializer.serialize_i32(2),
3265 Self::UnknownValue(u) => u.0.serialize(serializer),
3266 }
3267 }
3268 }
3269
3270 impl<'de> serde::de::Deserialize<'de> for DataProtectionMode {
3271 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3272 where
3273 D: serde::Deserializer<'de>,
3274 {
3275 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataProtectionMode>::new(
3276 ".google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode",
3277 ))
3278 }
3279 }
3280}
3281
3282#[derive(Clone, Default, PartialEq)]
3284#[non_exhaustive]
3285pub struct OperationMetadata {
3286 pub create_time: std::option::Option<wkt::Timestamp>,
3288
3289 pub end_time: std::option::Option<wkt::Timestamp>,
3291
3292 pub target: std::string::String,
3294
3295 pub verb: std::string::String,
3297
3298 pub status_detail: std::string::String,
3300
3301 pub cancel_requested: bool,
3303
3304 pub api_version: std::string::String,
3306
3307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3308}
3309
3310impl OperationMetadata {
3311 pub fn new() -> Self {
3312 std::default::Default::default()
3313 }
3314
3315 pub fn set_create_time<T>(mut self, v: T) -> Self
3317 where
3318 T: std::convert::Into<wkt::Timestamp>,
3319 {
3320 self.create_time = std::option::Option::Some(v.into());
3321 self
3322 }
3323
3324 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3326 where
3327 T: std::convert::Into<wkt::Timestamp>,
3328 {
3329 self.create_time = v.map(|x| x.into());
3330 self
3331 }
3332
3333 pub fn set_end_time<T>(mut self, v: T) -> Self
3335 where
3336 T: std::convert::Into<wkt::Timestamp>,
3337 {
3338 self.end_time = std::option::Option::Some(v.into());
3339 self
3340 }
3341
3342 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3344 where
3345 T: std::convert::Into<wkt::Timestamp>,
3346 {
3347 self.end_time = v.map(|x| x.into());
3348 self
3349 }
3350
3351 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3353 self.target = v.into();
3354 self
3355 }
3356
3357 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.verb = v.into();
3360 self
3361 }
3362
3363 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3365 self.status_detail = v.into();
3366 self
3367 }
3368
3369 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3371 self.cancel_requested = v.into();
3372 self
3373 }
3374
3375 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3377 self.api_version = v.into();
3378 self
3379 }
3380}
3381
3382impl wkt::message::Message for OperationMetadata {
3383 fn typename() -> &'static str {
3384 "type.googleapis.com/google.cloud.redis.v1.OperationMetadata"
3385 }
3386}
3387
3388#[derive(Clone, Default, PartialEq)]
3393#[non_exhaustive]
3394pub struct LocationMetadata {
3395 pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
3400
3401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3402}
3403
3404impl LocationMetadata {
3405 pub fn new() -> Self {
3406 std::default::Default::default()
3407 }
3408
3409 pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
3411 where
3412 T: std::iter::IntoIterator<Item = (K, V)>,
3413 K: std::convert::Into<std::string::String>,
3414 V: std::convert::Into<crate::model::ZoneMetadata>,
3415 {
3416 use std::iter::Iterator;
3417 self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3418 self
3419 }
3420}
3421
3422impl wkt::message::Message for LocationMetadata {
3423 fn typename() -> &'static str {
3424 "type.googleapis.com/google.cloud.redis.v1.LocationMetadata"
3425 }
3426}
3427
3428#[derive(Clone, Default, PartialEq)]
3431#[non_exhaustive]
3432pub struct ZoneMetadata {
3433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3434}
3435
3436impl ZoneMetadata {
3437 pub fn new() -> Self {
3438 std::default::Default::default()
3439 }
3440}
3441
3442impl wkt::message::Message for ZoneMetadata {
3443 fn typename() -> &'static str {
3444 "type.googleapis.com/google.cloud.redis.v1.ZoneMetadata"
3445 }
3446}
3447
3448#[derive(Clone, Default, PartialEq)]
3450#[non_exhaustive]
3451pub struct TlsCertificate {
3452 pub serial_number: std::string::String,
3454
3455 pub cert: std::string::String,
3457
3458 pub create_time: std::option::Option<wkt::Timestamp>,
3462
3463 pub expire_time: std::option::Option<wkt::Timestamp>,
3467
3468 pub sha1_fingerprint: std::string::String,
3470
3471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3472}
3473
3474impl TlsCertificate {
3475 pub fn new() -> Self {
3476 std::default::Default::default()
3477 }
3478
3479 pub fn set_serial_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3481 self.serial_number = v.into();
3482 self
3483 }
3484
3485 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3487 self.cert = v.into();
3488 self
3489 }
3490
3491 pub fn set_create_time<T>(mut self, v: T) -> Self
3493 where
3494 T: std::convert::Into<wkt::Timestamp>,
3495 {
3496 self.create_time = std::option::Option::Some(v.into());
3497 self
3498 }
3499
3500 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3502 where
3503 T: std::convert::Into<wkt::Timestamp>,
3504 {
3505 self.create_time = v.map(|x| x.into());
3506 self
3507 }
3508
3509 pub fn set_expire_time<T>(mut self, v: T) -> Self
3511 where
3512 T: std::convert::Into<wkt::Timestamp>,
3513 {
3514 self.expire_time = std::option::Option::Some(v.into());
3515 self
3516 }
3517
3518 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3520 where
3521 T: std::convert::Into<wkt::Timestamp>,
3522 {
3523 self.expire_time = v.map(|x| x.into());
3524 self
3525 }
3526
3527 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
3529 mut self,
3530 v: T,
3531 ) -> Self {
3532 self.sha1_fingerprint = v.into();
3533 self
3534 }
3535}
3536
3537impl wkt::message::Message for TlsCertificate {
3538 fn typename() -> &'static str {
3539 "type.googleapis.com/google.cloud.redis.v1.TlsCertificate"
3540 }
3541}