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 Instance {
45 pub name: std::string::String,
56
57 pub display_name: std::string::String,
60
61 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
65
66 pub authorized_network: std::string::String,
71
72 pub zones: std::vec::Vec<std::string::String>,
77
78 pub node_count: i32,
80
81 pub node_config: std::option::Option<crate::model::instance::NodeConfig>,
83
84 pub memcache_version: crate::model::MemcacheVersion,
90
91 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
94
95 pub memcache_nodes: std::vec::Vec<crate::model::instance::Node>,
100
101 pub create_time: std::option::Option<wkt::Timestamp>,
103
104 pub update_time: std::option::Option<wkt::Timestamp>,
106
107 pub state: crate::model::instance::State,
109
110 pub memcache_full_version: std::string::String,
115
116 pub instance_messages: std::vec::Vec<crate::model::instance::InstanceMessage>,
118
119 pub discovery_endpoint: std::string::String,
121
122 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
126
127 pub maintenance_schedule: std::option::Option<crate::model::MaintenanceSchedule>,
129
130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
131}
132
133impl Instance {
134 pub fn new() -> Self {
135 std::default::Default::default()
136 }
137
138 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140 self.name = v.into();
141 self
142 }
143
144 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146 self.display_name = v.into();
147 self
148 }
149
150 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
152 where
153 T: std::iter::IntoIterator<Item = (K, V)>,
154 K: std::convert::Into<std::string::String>,
155 V: std::convert::Into<std::string::String>,
156 {
157 use std::iter::Iterator;
158 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
159 self
160 }
161
162 pub fn set_authorized_network<T: std::convert::Into<std::string::String>>(
164 mut self,
165 v: T,
166 ) -> Self {
167 self.authorized_network = v.into();
168 self
169 }
170
171 pub fn set_zones<T, V>(mut self, v: T) -> Self
173 where
174 T: std::iter::IntoIterator<Item = V>,
175 V: std::convert::Into<std::string::String>,
176 {
177 use std::iter::Iterator;
178 self.zones = v.into_iter().map(|i| i.into()).collect();
179 self
180 }
181
182 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
184 self.node_count = v.into();
185 self
186 }
187
188 pub fn set_node_config<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<crate::model::instance::NodeConfig>,
192 {
193 self.node_config = std::option::Option::Some(v.into());
194 self
195 }
196
197 pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
199 where
200 T: std::convert::Into<crate::model::instance::NodeConfig>,
201 {
202 self.node_config = v.map(|x| x.into());
203 self
204 }
205
206 pub fn set_memcache_version<T: std::convert::Into<crate::model::MemcacheVersion>>(
208 mut self,
209 v: T,
210 ) -> Self {
211 self.memcache_version = v.into();
212 self
213 }
214
215 pub fn set_parameters<T>(mut self, v: T) -> Self
217 where
218 T: std::convert::Into<crate::model::MemcacheParameters>,
219 {
220 self.parameters = std::option::Option::Some(v.into());
221 self
222 }
223
224 pub fn set_or_clear_parameters<T>(mut self, v: std::option::Option<T>) -> Self
226 where
227 T: std::convert::Into<crate::model::MemcacheParameters>,
228 {
229 self.parameters = v.map(|x| x.into());
230 self
231 }
232
233 pub fn set_memcache_nodes<T, V>(mut self, v: T) -> Self
235 where
236 T: std::iter::IntoIterator<Item = V>,
237 V: std::convert::Into<crate::model::instance::Node>,
238 {
239 use std::iter::Iterator;
240 self.memcache_nodes = v.into_iter().map(|i| i.into()).collect();
241 self
242 }
243
244 pub fn set_create_time<T>(mut self, v: T) -> Self
246 where
247 T: std::convert::Into<wkt::Timestamp>,
248 {
249 self.create_time = std::option::Option::Some(v.into());
250 self
251 }
252
253 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
255 where
256 T: std::convert::Into<wkt::Timestamp>,
257 {
258 self.create_time = v.map(|x| x.into());
259 self
260 }
261
262 pub fn set_update_time<T>(mut self, v: T) -> Self
264 where
265 T: std::convert::Into<wkt::Timestamp>,
266 {
267 self.update_time = std::option::Option::Some(v.into());
268 self
269 }
270
271 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
273 where
274 T: std::convert::Into<wkt::Timestamp>,
275 {
276 self.update_time = v.map(|x| x.into());
277 self
278 }
279
280 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
282 self.state = v.into();
283 self
284 }
285
286 pub fn set_memcache_full_version<T: std::convert::Into<std::string::String>>(
288 mut self,
289 v: T,
290 ) -> Self {
291 self.memcache_full_version = v.into();
292 self
293 }
294
295 pub fn set_instance_messages<T, V>(mut self, v: T) -> Self
297 where
298 T: std::iter::IntoIterator<Item = V>,
299 V: std::convert::Into<crate::model::instance::InstanceMessage>,
300 {
301 use std::iter::Iterator;
302 self.instance_messages = v.into_iter().map(|i| i.into()).collect();
303 self
304 }
305
306 pub fn set_discovery_endpoint<T: std::convert::Into<std::string::String>>(
308 mut self,
309 v: T,
310 ) -> Self {
311 self.discovery_endpoint = v.into();
312 self
313 }
314
315 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
317 where
318 T: std::convert::Into<crate::model::MaintenancePolicy>,
319 {
320 self.maintenance_policy = std::option::Option::Some(v.into());
321 self
322 }
323
324 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
326 where
327 T: std::convert::Into<crate::model::MaintenancePolicy>,
328 {
329 self.maintenance_policy = v.map(|x| x.into());
330 self
331 }
332
333 pub fn set_maintenance_schedule<T>(mut self, v: T) -> Self
335 where
336 T: std::convert::Into<crate::model::MaintenanceSchedule>,
337 {
338 self.maintenance_schedule = std::option::Option::Some(v.into());
339 self
340 }
341
342 pub fn set_or_clear_maintenance_schedule<T>(mut self, v: std::option::Option<T>) -> Self
344 where
345 T: std::convert::Into<crate::model::MaintenanceSchedule>,
346 {
347 self.maintenance_schedule = v.map(|x| x.into());
348 self
349 }
350}
351
352impl wkt::message::Message for Instance {
353 fn typename() -> &'static str {
354 "type.googleapis.com/google.cloud.memcache.v1.Instance"
355 }
356}
357
358pub mod instance {
360 #[allow(unused_imports)]
361 use super::*;
362
363 #[derive(Clone, Default, PartialEq)]
365 #[non_exhaustive]
366 pub struct NodeConfig {
367 pub cpu_count: i32,
369
370 pub memory_size_mb: i32,
372
373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
374 }
375
376 impl NodeConfig {
377 pub fn new() -> Self {
378 std::default::Default::default()
379 }
380
381 pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
383 self.cpu_count = v.into();
384 self
385 }
386
387 pub fn set_memory_size_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
389 self.memory_size_mb = v.into();
390 self
391 }
392 }
393
394 impl wkt::message::Message for NodeConfig {
395 fn typename() -> &'static str {
396 "type.googleapis.com/google.cloud.memcache.v1.Instance.NodeConfig"
397 }
398 }
399
400 #[derive(Clone, Default, PartialEq)]
401 #[non_exhaustive]
402 pub struct Node {
403 pub node_id: std::string::String,
406
407 pub zone: std::string::String,
409
410 pub state: crate::model::instance::node::State,
412
413 pub host: std::string::String,
416
417 pub port: i32,
419
420 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
422
423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
424 }
425
426 impl Node {
427 pub fn new() -> Self {
428 std::default::Default::default()
429 }
430
431 pub fn set_node_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.node_id = v.into();
434 self
435 }
436
437 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
439 self.zone = v.into();
440 self
441 }
442
443 pub fn set_state<T: std::convert::Into<crate::model::instance::node::State>>(
445 mut self,
446 v: T,
447 ) -> Self {
448 self.state = v.into();
449 self
450 }
451
452 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454 self.host = v.into();
455 self
456 }
457
458 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
460 self.port = v.into();
461 self
462 }
463
464 pub fn set_parameters<T>(mut self, v: T) -> Self
466 where
467 T: std::convert::Into<crate::model::MemcacheParameters>,
468 {
469 self.parameters = std::option::Option::Some(v.into());
470 self
471 }
472
473 pub fn set_or_clear_parameters<T>(mut self, v: std::option::Option<T>) -> Self
475 where
476 T: std::convert::Into<crate::model::MemcacheParameters>,
477 {
478 self.parameters = v.map(|x| x.into());
479 self
480 }
481 }
482
483 impl wkt::message::Message for Node {
484 fn typename() -> &'static str {
485 "type.googleapis.com/google.cloud.memcache.v1.Instance.Node"
486 }
487 }
488
489 pub mod node {
491 #[allow(unused_imports)]
492 use super::*;
493
494 #[derive(Clone, Debug, PartialEq)]
510 #[non_exhaustive]
511 pub enum State {
512 Unspecified,
514 Creating,
516 Ready,
518 Deleting,
520 Updating,
522 UnknownValue(state::UnknownValue),
527 }
528
529 #[doc(hidden)]
530 pub mod state {
531 #[allow(unused_imports)]
532 use super::*;
533 #[derive(Clone, Debug, PartialEq)]
534 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
535 }
536
537 impl State {
538 pub fn value(&self) -> std::option::Option<i32> {
543 match self {
544 Self::Unspecified => std::option::Option::Some(0),
545 Self::Creating => std::option::Option::Some(1),
546 Self::Ready => std::option::Option::Some(2),
547 Self::Deleting => std::option::Option::Some(3),
548 Self::Updating => std::option::Option::Some(4),
549 Self::UnknownValue(u) => u.0.value(),
550 }
551 }
552
553 pub fn name(&self) -> std::option::Option<&str> {
558 match self {
559 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
560 Self::Creating => std::option::Option::Some("CREATING"),
561 Self::Ready => std::option::Option::Some("READY"),
562 Self::Deleting => std::option::Option::Some("DELETING"),
563 Self::Updating => std::option::Option::Some("UPDATING"),
564 Self::UnknownValue(u) => u.0.name(),
565 }
566 }
567 }
568
569 impl std::default::Default for State {
570 fn default() -> Self {
571 use std::convert::From;
572 Self::from(0)
573 }
574 }
575
576 impl std::fmt::Display for State {
577 fn fmt(
578 &self,
579 f: &mut std::fmt::Formatter<'_>,
580 ) -> std::result::Result<(), std::fmt::Error> {
581 wkt::internal::display_enum(f, self.name(), self.value())
582 }
583 }
584
585 impl std::convert::From<i32> for State {
586 fn from(value: i32) -> Self {
587 match value {
588 0 => Self::Unspecified,
589 1 => Self::Creating,
590 2 => Self::Ready,
591 3 => Self::Deleting,
592 4 => Self::Updating,
593 _ => Self::UnknownValue(state::UnknownValue(
594 wkt::internal::UnknownEnumValue::Integer(value),
595 )),
596 }
597 }
598 }
599
600 impl std::convert::From<&str> for State {
601 fn from(value: &str) -> Self {
602 use std::string::ToString;
603 match value {
604 "STATE_UNSPECIFIED" => Self::Unspecified,
605 "CREATING" => Self::Creating,
606 "READY" => Self::Ready,
607 "DELETING" => Self::Deleting,
608 "UPDATING" => Self::Updating,
609 _ => Self::UnknownValue(state::UnknownValue(
610 wkt::internal::UnknownEnumValue::String(value.to_string()),
611 )),
612 }
613 }
614 }
615
616 impl serde::ser::Serialize for State {
617 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
618 where
619 S: serde::Serializer,
620 {
621 match self {
622 Self::Unspecified => serializer.serialize_i32(0),
623 Self::Creating => serializer.serialize_i32(1),
624 Self::Ready => serializer.serialize_i32(2),
625 Self::Deleting => serializer.serialize_i32(3),
626 Self::Updating => serializer.serialize_i32(4),
627 Self::UnknownValue(u) => u.0.serialize(serializer),
628 }
629 }
630 }
631
632 impl<'de> serde::de::Deserialize<'de> for State {
633 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
634 where
635 D: serde::Deserializer<'de>,
636 {
637 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
638 ".google.cloud.memcache.v1.Instance.Node.State",
639 ))
640 }
641 }
642 }
643
644 #[derive(Clone, Default, PartialEq)]
645 #[non_exhaustive]
646 pub struct InstanceMessage {
647 pub code: crate::model::instance::instance_message::Code,
649
650 pub message: std::string::String,
652
653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
654 }
655
656 impl InstanceMessage {
657 pub fn new() -> Self {
658 std::default::Default::default()
659 }
660
661 pub fn set_code<T: std::convert::Into<crate::model::instance::instance_message::Code>>(
663 mut self,
664 v: T,
665 ) -> Self {
666 self.code = v.into();
667 self
668 }
669
670 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672 self.message = v.into();
673 self
674 }
675 }
676
677 impl wkt::message::Message for InstanceMessage {
678 fn typename() -> &'static str {
679 "type.googleapis.com/google.cloud.memcache.v1.Instance.InstanceMessage"
680 }
681 }
682
683 pub mod instance_message {
685 #[allow(unused_imports)]
686 use super::*;
687
688 #[derive(Clone, Debug, PartialEq)]
703 #[non_exhaustive]
704 pub enum Code {
705 Unspecified,
707 ZoneDistributionUnbalanced,
709 UnknownValue(code::UnknownValue),
714 }
715
716 #[doc(hidden)]
717 pub mod code {
718 #[allow(unused_imports)]
719 use super::*;
720 #[derive(Clone, Debug, PartialEq)]
721 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
722 }
723
724 impl Code {
725 pub fn value(&self) -> std::option::Option<i32> {
730 match self {
731 Self::Unspecified => std::option::Option::Some(0),
732 Self::ZoneDistributionUnbalanced => std::option::Option::Some(1),
733 Self::UnknownValue(u) => u.0.value(),
734 }
735 }
736
737 pub fn name(&self) -> std::option::Option<&str> {
742 match self {
743 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
744 Self::ZoneDistributionUnbalanced => {
745 std::option::Option::Some("ZONE_DISTRIBUTION_UNBALANCED")
746 }
747 Self::UnknownValue(u) => u.0.name(),
748 }
749 }
750 }
751
752 impl std::default::Default for Code {
753 fn default() -> Self {
754 use std::convert::From;
755 Self::from(0)
756 }
757 }
758
759 impl std::fmt::Display for Code {
760 fn fmt(
761 &self,
762 f: &mut std::fmt::Formatter<'_>,
763 ) -> std::result::Result<(), std::fmt::Error> {
764 wkt::internal::display_enum(f, self.name(), self.value())
765 }
766 }
767
768 impl std::convert::From<i32> for Code {
769 fn from(value: i32) -> Self {
770 match value {
771 0 => Self::Unspecified,
772 1 => Self::ZoneDistributionUnbalanced,
773 _ => Self::UnknownValue(code::UnknownValue(
774 wkt::internal::UnknownEnumValue::Integer(value),
775 )),
776 }
777 }
778 }
779
780 impl std::convert::From<&str> for Code {
781 fn from(value: &str) -> Self {
782 use std::string::ToString;
783 match value {
784 "CODE_UNSPECIFIED" => Self::Unspecified,
785 "ZONE_DISTRIBUTION_UNBALANCED" => Self::ZoneDistributionUnbalanced,
786 _ => Self::UnknownValue(code::UnknownValue(
787 wkt::internal::UnknownEnumValue::String(value.to_string()),
788 )),
789 }
790 }
791 }
792
793 impl serde::ser::Serialize for Code {
794 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
795 where
796 S: serde::Serializer,
797 {
798 match self {
799 Self::Unspecified => serializer.serialize_i32(0),
800 Self::ZoneDistributionUnbalanced => serializer.serialize_i32(1),
801 Self::UnknownValue(u) => u.0.serialize(serializer),
802 }
803 }
804 }
805
806 impl<'de> serde::de::Deserialize<'de> for Code {
807 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
808 where
809 D: serde::Deserializer<'de>,
810 {
811 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
812 ".google.cloud.memcache.v1.Instance.InstanceMessage.Code",
813 ))
814 }
815 }
816 }
817
818 #[derive(Clone, Debug, PartialEq)]
834 #[non_exhaustive]
835 pub enum State {
836 Unspecified,
838 Creating,
840 Ready,
842 Updating,
845 Deleting,
847 PerformingMaintenance,
849 UnknownValue(state::UnknownValue),
854 }
855
856 #[doc(hidden)]
857 pub mod state {
858 #[allow(unused_imports)]
859 use super::*;
860 #[derive(Clone, Debug, PartialEq)]
861 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
862 }
863
864 impl State {
865 pub fn value(&self) -> std::option::Option<i32> {
870 match self {
871 Self::Unspecified => std::option::Option::Some(0),
872 Self::Creating => std::option::Option::Some(1),
873 Self::Ready => std::option::Option::Some(2),
874 Self::Updating => std::option::Option::Some(3),
875 Self::Deleting => std::option::Option::Some(4),
876 Self::PerformingMaintenance => std::option::Option::Some(5),
877 Self::UnknownValue(u) => u.0.value(),
878 }
879 }
880
881 pub fn name(&self) -> std::option::Option<&str> {
886 match self {
887 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
888 Self::Creating => std::option::Option::Some("CREATING"),
889 Self::Ready => std::option::Option::Some("READY"),
890 Self::Updating => std::option::Option::Some("UPDATING"),
891 Self::Deleting => std::option::Option::Some("DELETING"),
892 Self::PerformingMaintenance => std::option::Option::Some("PERFORMING_MAINTENANCE"),
893 Self::UnknownValue(u) => u.0.name(),
894 }
895 }
896 }
897
898 impl std::default::Default for State {
899 fn default() -> Self {
900 use std::convert::From;
901 Self::from(0)
902 }
903 }
904
905 impl std::fmt::Display for State {
906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
907 wkt::internal::display_enum(f, self.name(), self.value())
908 }
909 }
910
911 impl std::convert::From<i32> for State {
912 fn from(value: i32) -> Self {
913 match value {
914 0 => Self::Unspecified,
915 1 => Self::Creating,
916 2 => Self::Ready,
917 3 => Self::Updating,
918 4 => Self::Deleting,
919 5 => Self::PerformingMaintenance,
920 _ => Self::UnknownValue(state::UnknownValue(
921 wkt::internal::UnknownEnumValue::Integer(value),
922 )),
923 }
924 }
925 }
926
927 impl std::convert::From<&str> for State {
928 fn from(value: &str) -> Self {
929 use std::string::ToString;
930 match value {
931 "STATE_UNSPECIFIED" => Self::Unspecified,
932 "CREATING" => Self::Creating,
933 "READY" => Self::Ready,
934 "UPDATING" => Self::Updating,
935 "DELETING" => Self::Deleting,
936 "PERFORMING_MAINTENANCE" => Self::PerformingMaintenance,
937 _ => Self::UnknownValue(state::UnknownValue(
938 wkt::internal::UnknownEnumValue::String(value.to_string()),
939 )),
940 }
941 }
942 }
943
944 impl serde::ser::Serialize for State {
945 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
946 where
947 S: serde::Serializer,
948 {
949 match self {
950 Self::Unspecified => serializer.serialize_i32(0),
951 Self::Creating => serializer.serialize_i32(1),
952 Self::Ready => serializer.serialize_i32(2),
953 Self::Updating => serializer.serialize_i32(3),
954 Self::Deleting => serializer.serialize_i32(4),
955 Self::PerformingMaintenance => serializer.serialize_i32(5),
956 Self::UnknownValue(u) => u.0.serialize(serializer),
957 }
958 }
959 }
960
961 impl<'de> serde::de::Deserialize<'de> for State {
962 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
963 where
964 D: serde::Deserializer<'de>,
965 {
966 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
967 ".google.cloud.memcache.v1.Instance.State",
968 ))
969 }
970 }
971}
972
973#[derive(Clone, Default, PartialEq)]
975#[non_exhaustive]
976pub struct MaintenancePolicy {
977 pub create_time: std::option::Option<wkt::Timestamp>,
979
980 pub update_time: std::option::Option<wkt::Timestamp>,
982
983 pub description: std::string::String,
986
987 pub weekly_maintenance_window: std::vec::Vec<crate::model::WeeklyMaintenanceWindow>,
991
992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
993}
994
995impl MaintenancePolicy {
996 pub fn new() -> Self {
997 std::default::Default::default()
998 }
999
1000 pub fn set_create_time<T>(mut self, v: T) -> Self
1002 where
1003 T: std::convert::Into<wkt::Timestamp>,
1004 {
1005 self.create_time = std::option::Option::Some(v.into());
1006 self
1007 }
1008
1009 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1011 where
1012 T: std::convert::Into<wkt::Timestamp>,
1013 {
1014 self.create_time = v.map(|x| x.into());
1015 self
1016 }
1017
1018 pub fn set_update_time<T>(mut self, v: T) -> Self
1020 where
1021 T: std::convert::Into<wkt::Timestamp>,
1022 {
1023 self.update_time = std::option::Option::Some(v.into());
1024 self
1025 }
1026
1027 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1029 where
1030 T: std::convert::Into<wkt::Timestamp>,
1031 {
1032 self.update_time = v.map(|x| x.into());
1033 self
1034 }
1035
1036 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.description = v.into();
1039 self
1040 }
1041
1042 pub fn set_weekly_maintenance_window<T, V>(mut self, v: T) -> Self
1044 where
1045 T: std::iter::IntoIterator<Item = V>,
1046 V: std::convert::Into<crate::model::WeeklyMaintenanceWindow>,
1047 {
1048 use std::iter::Iterator;
1049 self.weekly_maintenance_window = v.into_iter().map(|i| i.into()).collect();
1050 self
1051 }
1052}
1053
1054impl wkt::message::Message for MaintenancePolicy {
1055 fn typename() -> &'static str {
1056 "type.googleapis.com/google.cloud.memcache.v1.MaintenancePolicy"
1057 }
1058}
1059
1060#[derive(Clone, Default, PartialEq)]
1062#[non_exhaustive]
1063pub struct WeeklyMaintenanceWindow {
1064 pub day: gtype::model::DayOfWeek,
1066
1067 pub start_time: std::option::Option<gtype::model::TimeOfDay>,
1069
1070 pub duration: std::option::Option<wkt::Duration>,
1072
1073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1074}
1075
1076impl WeeklyMaintenanceWindow {
1077 pub fn new() -> Self {
1078 std::default::Default::default()
1079 }
1080
1081 pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
1083 self.day = v.into();
1084 self
1085 }
1086
1087 pub fn set_start_time<T>(mut self, v: T) -> Self
1089 where
1090 T: std::convert::Into<gtype::model::TimeOfDay>,
1091 {
1092 self.start_time = std::option::Option::Some(v.into());
1093 self
1094 }
1095
1096 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1098 where
1099 T: std::convert::Into<gtype::model::TimeOfDay>,
1100 {
1101 self.start_time = v.map(|x| x.into());
1102 self
1103 }
1104
1105 pub fn set_duration<T>(mut self, v: T) -> Self
1107 where
1108 T: std::convert::Into<wkt::Duration>,
1109 {
1110 self.duration = std::option::Option::Some(v.into());
1111 self
1112 }
1113
1114 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
1116 where
1117 T: std::convert::Into<wkt::Duration>,
1118 {
1119 self.duration = v.map(|x| x.into());
1120 self
1121 }
1122}
1123
1124impl wkt::message::Message for WeeklyMaintenanceWindow {
1125 fn typename() -> &'static str {
1126 "type.googleapis.com/google.cloud.memcache.v1.WeeklyMaintenanceWindow"
1127 }
1128}
1129
1130#[derive(Clone, Default, PartialEq)]
1132#[non_exhaustive]
1133pub struct MaintenanceSchedule {
1134 pub start_time: std::option::Option<wkt::Timestamp>,
1136
1137 pub end_time: std::option::Option<wkt::Timestamp>,
1139
1140 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
1143
1144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1145}
1146
1147impl MaintenanceSchedule {
1148 pub fn new() -> Self {
1149 std::default::Default::default()
1150 }
1151
1152 pub fn set_start_time<T>(mut self, v: T) -> Self
1154 where
1155 T: std::convert::Into<wkt::Timestamp>,
1156 {
1157 self.start_time = std::option::Option::Some(v.into());
1158 self
1159 }
1160
1161 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1163 where
1164 T: std::convert::Into<wkt::Timestamp>,
1165 {
1166 self.start_time = v.map(|x| x.into());
1167 self
1168 }
1169
1170 pub fn set_end_time<T>(mut self, v: T) -> Self
1172 where
1173 T: std::convert::Into<wkt::Timestamp>,
1174 {
1175 self.end_time = std::option::Option::Some(v.into());
1176 self
1177 }
1178
1179 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1181 where
1182 T: std::convert::Into<wkt::Timestamp>,
1183 {
1184 self.end_time = v.map(|x| x.into());
1185 self
1186 }
1187
1188 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
1190 where
1191 T: std::convert::Into<wkt::Timestamp>,
1192 {
1193 self.schedule_deadline_time = std::option::Option::Some(v.into());
1194 self
1195 }
1196
1197 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
1199 where
1200 T: std::convert::Into<wkt::Timestamp>,
1201 {
1202 self.schedule_deadline_time = v.map(|x| x.into());
1203 self
1204 }
1205}
1206
1207impl wkt::message::Message for MaintenanceSchedule {
1208 fn typename() -> &'static str {
1209 "type.googleapis.com/google.cloud.memcache.v1.MaintenanceSchedule"
1210 }
1211}
1212
1213#[derive(Clone, Default, PartialEq)]
1217#[non_exhaustive]
1218pub struct RescheduleMaintenanceRequest {
1219 pub instance: std::string::String,
1223
1224 pub reschedule_type: crate::model::reschedule_maintenance_request::RescheduleType,
1226
1227 pub schedule_time: std::option::Option<wkt::Timestamp>,
1231
1232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1233}
1234
1235impl RescheduleMaintenanceRequest {
1236 pub fn new() -> Self {
1237 std::default::Default::default()
1238 }
1239
1240 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1242 self.instance = v.into();
1243 self
1244 }
1245
1246 pub fn set_reschedule_type<
1248 T: std::convert::Into<crate::model::reschedule_maintenance_request::RescheduleType>,
1249 >(
1250 mut self,
1251 v: T,
1252 ) -> Self {
1253 self.reschedule_type = v.into();
1254 self
1255 }
1256
1257 pub fn set_schedule_time<T>(mut self, v: T) -> Self
1259 where
1260 T: std::convert::Into<wkt::Timestamp>,
1261 {
1262 self.schedule_time = std::option::Option::Some(v.into());
1263 self
1264 }
1265
1266 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
1268 where
1269 T: std::convert::Into<wkt::Timestamp>,
1270 {
1271 self.schedule_time = v.map(|x| x.into());
1272 self
1273 }
1274}
1275
1276impl wkt::message::Message for RescheduleMaintenanceRequest {
1277 fn typename() -> &'static str {
1278 "type.googleapis.com/google.cloud.memcache.v1.RescheduleMaintenanceRequest"
1279 }
1280}
1281
1282pub mod reschedule_maintenance_request {
1284 #[allow(unused_imports)]
1285 use super::*;
1286
1287 #[derive(Clone, Debug, PartialEq)]
1303 #[non_exhaustive]
1304 pub enum RescheduleType {
1305 Unspecified,
1307 Immediate,
1309 NextAvailableWindow,
1312 SpecificTime,
1314 UnknownValue(reschedule_type::UnknownValue),
1319 }
1320
1321 #[doc(hidden)]
1322 pub mod reschedule_type {
1323 #[allow(unused_imports)]
1324 use super::*;
1325 #[derive(Clone, Debug, PartialEq)]
1326 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1327 }
1328
1329 impl RescheduleType {
1330 pub fn value(&self) -> std::option::Option<i32> {
1335 match self {
1336 Self::Unspecified => std::option::Option::Some(0),
1337 Self::Immediate => std::option::Option::Some(1),
1338 Self::NextAvailableWindow => std::option::Option::Some(2),
1339 Self::SpecificTime => std::option::Option::Some(3),
1340 Self::UnknownValue(u) => u.0.value(),
1341 }
1342 }
1343
1344 pub fn name(&self) -> std::option::Option<&str> {
1349 match self {
1350 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
1351 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
1352 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
1353 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
1354 Self::UnknownValue(u) => u.0.name(),
1355 }
1356 }
1357 }
1358
1359 impl std::default::Default for RescheduleType {
1360 fn default() -> Self {
1361 use std::convert::From;
1362 Self::from(0)
1363 }
1364 }
1365
1366 impl std::fmt::Display for RescheduleType {
1367 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1368 wkt::internal::display_enum(f, self.name(), self.value())
1369 }
1370 }
1371
1372 impl std::convert::From<i32> for RescheduleType {
1373 fn from(value: i32) -> Self {
1374 match value {
1375 0 => Self::Unspecified,
1376 1 => Self::Immediate,
1377 2 => Self::NextAvailableWindow,
1378 3 => Self::SpecificTime,
1379 _ => Self::UnknownValue(reschedule_type::UnknownValue(
1380 wkt::internal::UnknownEnumValue::Integer(value),
1381 )),
1382 }
1383 }
1384 }
1385
1386 impl std::convert::From<&str> for RescheduleType {
1387 fn from(value: &str) -> Self {
1388 use std::string::ToString;
1389 match value {
1390 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
1391 "IMMEDIATE" => Self::Immediate,
1392 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
1393 "SPECIFIC_TIME" => Self::SpecificTime,
1394 _ => Self::UnknownValue(reschedule_type::UnknownValue(
1395 wkt::internal::UnknownEnumValue::String(value.to_string()),
1396 )),
1397 }
1398 }
1399 }
1400
1401 impl serde::ser::Serialize for RescheduleType {
1402 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1403 where
1404 S: serde::Serializer,
1405 {
1406 match self {
1407 Self::Unspecified => serializer.serialize_i32(0),
1408 Self::Immediate => serializer.serialize_i32(1),
1409 Self::NextAvailableWindow => serializer.serialize_i32(2),
1410 Self::SpecificTime => serializer.serialize_i32(3),
1411 Self::UnknownValue(u) => u.0.serialize(serializer),
1412 }
1413 }
1414 }
1415
1416 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
1417 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1418 where
1419 D: serde::Deserializer<'de>,
1420 {
1421 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
1422 ".google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType",
1423 ))
1424 }
1425 }
1426}
1427
1428#[derive(Clone, Default, PartialEq)]
1432#[non_exhaustive]
1433pub struct ListInstancesRequest {
1434 pub parent: std::string::String,
1438
1439 pub page_size: i32,
1449
1450 pub page_token: std::string::String,
1452
1453 pub filter: std::string::String,
1456
1457 pub order_by: std::string::String,
1459
1460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1461}
1462
1463impl ListInstancesRequest {
1464 pub fn new() -> Self {
1465 std::default::Default::default()
1466 }
1467
1468 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.parent = v.into();
1471 self
1472 }
1473
1474 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1476 self.page_size = v.into();
1477 self
1478 }
1479
1480 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1482 self.page_token = v.into();
1483 self
1484 }
1485
1486 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.filter = v.into();
1489 self
1490 }
1491
1492 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1494 self.order_by = v.into();
1495 self
1496 }
1497}
1498
1499impl wkt::message::Message for ListInstancesRequest {
1500 fn typename() -> &'static str {
1501 "type.googleapis.com/google.cloud.memcache.v1.ListInstancesRequest"
1502 }
1503}
1504
1505#[derive(Clone, Default, PartialEq)]
1509#[non_exhaustive]
1510pub struct ListInstancesResponse {
1511 pub instances: std::vec::Vec<crate::model::Instance>,
1517
1518 pub next_page_token: std::string::String,
1521
1522 pub unreachable: std::vec::Vec<std::string::String>,
1524
1525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1526}
1527
1528impl ListInstancesResponse {
1529 pub fn new() -> Self {
1530 std::default::Default::default()
1531 }
1532
1533 pub fn set_instances<T, V>(mut self, v: T) -> Self
1535 where
1536 T: std::iter::IntoIterator<Item = V>,
1537 V: std::convert::Into<crate::model::Instance>,
1538 {
1539 use std::iter::Iterator;
1540 self.instances = v.into_iter().map(|i| i.into()).collect();
1541 self
1542 }
1543
1544 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.next_page_token = v.into();
1547 self
1548 }
1549
1550 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1552 where
1553 T: std::iter::IntoIterator<Item = V>,
1554 V: std::convert::Into<std::string::String>,
1555 {
1556 use std::iter::Iterator;
1557 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1558 self
1559 }
1560}
1561
1562impl wkt::message::Message for ListInstancesResponse {
1563 fn typename() -> &'static str {
1564 "type.googleapis.com/google.cloud.memcache.v1.ListInstancesResponse"
1565 }
1566}
1567
1568#[doc(hidden)]
1569impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
1570 type PageItem = crate::model::Instance;
1571
1572 fn items(self) -> std::vec::Vec<Self::PageItem> {
1573 self.instances
1574 }
1575
1576 fn next_page_token(&self) -> std::string::String {
1577 use std::clone::Clone;
1578 self.next_page_token.clone()
1579 }
1580}
1581
1582#[derive(Clone, Default, PartialEq)]
1586#[non_exhaustive]
1587pub struct GetInstanceRequest {
1588 pub name: std::string::String,
1592
1593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1594}
1595
1596impl GetInstanceRequest {
1597 pub fn new() -> Self {
1598 std::default::Default::default()
1599 }
1600
1601 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1603 self.name = v.into();
1604 self
1605 }
1606}
1607
1608impl wkt::message::Message for GetInstanceRequest {
1609 fn typename() -> &'static str {
1610 "type.googleapis.com/google.cloud.memcache.v1.GetInstanceRequest"
1611 }
1612}
1613
1614#[derive(Clone, Default, PartialEq)]
1618#[non_exhaustive]
1619pub struct CreateInstanceRequest {
1620 pub parent: std::string::String,
1624
1625 pub instance_id: std::string::String,
1636
1637 pub instance: std::option::Option<crate::model::Instance>,
1639
1640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1641}
1642
1643impl CreateInstanceRequest {
1644 pub fn new() -> Self {
1645 std::default::Default::default()
1646 }
1647
1648 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.parent = v.into();
1651 self
1652 }
1653
1654 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.instance_id = v.into();
1657 self
1658 }
1659
1660 pub fn set_instance<T>(mut self, v: T) -> Self
1662 where
1663 T: std::convert::Into<crate::model::Instance>,
1664 {
1665 self.instance = std::option::Option::Some(v.into());
1666 self
1667 }
1668
1669 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1671 where
1672 T: std::convert::Into<crate::model::Instance>,
1673 {
1674 self.instance = v.map(|x| x.into());
1675 self
1676 }
1677}
1678
1679impl wkt::message::Message for CreateInstanceRequest {
1680 fn typename() -> &'static str {
1681 "type.googleapis.com/google.cloud.memcache.v1.CreateInstanceRequest"
1682 }
1683}
1684
1685#[derive(Clone, Default, PartialEq)]
1689#[non_exhaustive]
1690pub struct UpdateInstanceRequest {
1691 pub update_mask: std::option::Option<wkt::FieldMask>,
1695
1696 pub instance: std::option::Option<crate::model::Instance>,
1699
1700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1701}
1702
1703impl UpdateInstanceRequest {
1704 pub fn new() -> Self {
1705 std::default::Default::default()
1706 }
1707
1708 pub fn set_update_mask<T>(mut self, v: T) -> Self
1710 where
1711 T: std::convert::Into<wkt::FieldMask>,
1712 {
1713 self.update_mask = std::option::Option::Some(v.into());
1714 self
1715 }
1716
1717 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1719 where
1720 T: std::convert::Into<wkt::FieldMask>,
1721 {
1722 self.update_mask = v.map(|x| x.into());
1723 self
1724 }
1725
1726 pub fn set_instance<T>(mut self, v: T) -> Self
1728 where
1729 T: std::convert::Into<crate::model::Instance>,
1730 {
1731 self.instance = std::option::Option::Some(v.into());
1732 self
1733 }
1734
1735 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1737 where
1738 T: std::convert::Into<crate::model::Instance>,
1739 {
1740 self.instance = v.map(|x| x.into());
1741 self
1742 }
1743}
1744
1745impl wkt::message::Message for UpdateInstanceRequest {
1746 fn typename() -> &'static str {
1747 "type.googleapis.com/google.cloud.memcache.v1.UpdateInstanceRequest"
1748 }
1749}
1750
1751#[derive(Clone, Default, PartialEq)]
1755#[non_exhaustive]
1756pub struct DeleteInstanceRequest {
1757 pub name: std::string::String,
1761
1762 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1763}
1764
1765impl DeleteInstanceRequest {
1766 pub fn new() -> Self {
1767 std::default::Default::default()
1768 }
1769
1770 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1772 self.name = v.into();
1773 self
1774 }
1775}
1776
1777impl wkt::message::Message for DeleteInstanceRequest {
1778 fn typename() -> &'static str {
1779 "type.googleapis.com/google.cloud.memcache.v1.DeleteInstanceRequest"
1780 }
1781}
1782
1783#[derive(Clone, Default, PartialEq)]
1787#[non_exhaustive]
1788pub struct ApplyParametersRequest {
1789 pub name: std::string::String,
1792
1793 pub node_ids: std::vec::Vec<std::string::String>,
1795
1796 pub apply_all: bool,
1800
1801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1802}
1803
1804impl ApplyParametersRequest {
1805 pub fn new() -> Self {
1806 std::default::Default::default()
1807 }
1808
1809 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.name = v.into();
1812 self
1813 }
1814
1815 pub fn set_node_ids<T, V>(mut self, v: T) -> Self
1817 where
1818 T: std::iter::IntoIterator<Item = V>,
1819 V: std::convert::Into<std::string::String>,
1820 {
1821 use std::iter::Iterator;
1822 self.node_ids = v.into_iter().map(|i| i.into()).collect();
1823 self
1824 }
1825
1826 pub fn set_apply_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1828 self.apply_all = v.into();
1829 self
1830 }
1831}
1832
1833impl wkt::message::Message for ApplyParametersRequest {
1834 fn typename() -> &'static str {
1835 "type.googleapis.com/google.cloud.memcache.v1.ApplyParametersRequest"
1836 }
1837}
1838
1839#[derive(Clone, Default, PartialEq)]
1843#[non_exhaustive]
1844pub struct UpdateParametersRequest {
1845 pub name: std::string::String,
1848
1849 pub update_mask: std::option::Option<wkt::FieldMask>,
1851
1852 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
1854
1855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1856}
1857
1858impl UpdateParametersRequest {
1859 pub fn new() -> Self {
1860 std::default::Default::default()
1861 }
1862
1863 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1865 self.name = v.into();
1866 self
1867 }
1868
1869 pub fn set_update_mask<T>(mut self, v: T) -> Self
1871 where
1872 T: std::convert::Into<wkt::FieldMask>,
1873 {
1874 self.update_mask = std::option::Option::Some(v.into());
1875 self
1876 }
1877
1878 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1880 where
1881 T: std::convert::Into<wkt::FieldMask>,
1882 {
1883 self.update_mask = v.map(|x| x.into());
1884 self
1885 }
1886
1887 pub fn set_parameters<T>(mut self, v: T) -> Self
1889 where
1890 T: std::convert::Into<crate::model::MemcacheParameters>,
1891 {
1892 self.parameters = std::option::Option::Some(v.into());
1893 self
1894 }
1895
1896 pub fn set_or_clear_parameters<T>(mut self, v: std::option::Option<T>) -> Self
1898 where
1899 T: std::convert::Into<crate::model::MemcacheParameters>,
1900 {
1901 self.parameters = v.map(|x| x.into());
1902 self
1903 }
1904}
1905
1906impl wkt::message::Message for UpdateParametersRequest {
1907 fn typename() -> &'static str {
1908 "type.googleapis.com/google.cloud.memcache.v1.UpdateParametersRequest"
1909 }
1910}
1911
1912#[derive(Clone, Default, PartialEq)]
1913#[non_exhaustive]
1914pub struct MemcacheParameters {
1915 pub id: std::string::String,
1921
1922 pub params: std::collections::HashMap<std::string::String, std::string::String>,
1924
1925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1926}
1927
1928impl MemcacheParameters {
1929 pub fn new() -> Self {
1930 std::default::Default::default()
1931 }
1932
1933 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.id = v.into();
1936 self
1937 }
1938
1939 pub fn set_params<T, K, V>(mut self, v: T) -> Self
1941 where
1942 T: std::iter::IntoIterator<Item = (K, V)>,
1943 K: std::convert::Into<std::string::String>,
1944 V: std::convert::Into<std::string::String>,
1945 {
1946 use std::iter::Iterator;
1947 self.params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1948 self
1949 }
1950}
1951
1952impl wkt::message::Message for MemcacheParameters {
1953 fn typename() -> &'static str {
1954 "type.googleapis.com/google.cloud.memcache.v1.MemcacheParameters"
1955 }
1956}
1957
1958#[derive(Clone, Default, PartialEq)]
1960#[non_exhaustive]
1961pub struct OperationMetadata {
1962 pub create_time: std::option::Option<wkt::Timestamp>,
1964
1965 pub end_time: std::option::Option<wkt::Timestamp>,
1967
1968 pub target: std::string::String,
1970
1971 pub verb: std::string::String,
1973
1974 pub status_detail: std::string::String,
1976
1977 pub cancel_requested: bool,
1984
1985 pub api_version: std::string::String,
1987
1988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1989}
1990
1991impl OperationMetadata {
1992 pub fn new() -> Self {
1993 std::default::Default::default()
1994 }
1995
1996 pub fn set_create_time<T>(mut self, v: T) -> Self
1998 where
1999 T: std::convert::Into<wkt::Timestamp>,
2000 {
2001 self.create_time = std::option::Option::Some(v.into());
2002 self
2003 }
2004
2005 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2007 where
2008 T: std::convert::Into<wkt::Timestamp>,
2009 {
2010 self.create_time = v.map(|x| x.into());
2011 self
2012 }
2013
2014 pub fn set_end_time<T>(mut self, v: T) -> Self
2016 where
2017 T: std::convert::Into<wkt::Timestamp>,
2018 {
2019 self.end_time = std::option::Option::Some(v.into());
2020 self
2021 }
2022
2023 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2025 where
2026 T: std::convert::Into<wkt::Timestamp>,
2027 {
2028 self.end_time = v.map(|x| x.into());
2029 self
2030 }
2031
2032 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2034 self.target = v.into();
2035 self
2036 }
2037
2038 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.verb = v.into();
2041 self
2042 }
2043
2044 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2046 self.status_detail = v.into();
2047 self
2048 }
2049
2050 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2052 self.cancel_requested = v.into();
2053 self
2054 }
2055
2056 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2058 self.api_version = v.into();
2059 self
2060 }
2061}
2062
2063impl wkt::message::Message for OperationMetadata {
2064 fn typename() -> &'static str {
2065 "type.googleapis.com/google.cloud.memcache.v1.OperationMetadata"
2066 }
2067}
2068
2069#[derive(Clone, Default, PartialEq)]
2073#[non_exhaustive]
2074pub struct LocationMetadata {
2075 pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
2079
2080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2081}
2082
2083impl LocationMetadata {
2084 pub fn new() -> Self {
2085 std::default::Default::default()
2086 }
2087
2088 pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
2090 where
2091 T: std::iter::IntoIterator<Item = (K, V)>,
2092 K: std::convert::Into<std::string::String>,
2093 V: std::convert::Into<crate::model::ZoneMetadata>,
2094 {
2095 use std::iter::Iterator;
2096 self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2097 self
2098 }
2099}
2100
2101impl wkt::message::Message for LocationMetadata {
2102 fn typename() -> &'static str {
2103 "type.googleapis.com/google.cloud.memcache.v1.LocationMetadata"
2104 }
2105}
2106
2107#[derive(Clone, Default, PartialEq)]
2108#[non_exhaustive]
2109pub struct ZoneMetadata {
2110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2111}
2112
2113impl ZoneMetadata {
2114 pub fn new() -> Self {
2115 std::default::Default::default()
2116 }
2117}
2118
2119impl wkt::message::Message for ZoneMetadata {
2120 fn typename() -> &'static str {
2121 "type.googleapis.com/google.cloud.memcache.v1.ZoneMetadata"
2122 }
2123}
2124
2125#[derive(Clone, Debug, PartialEq)]
2141#[non_exhaustive]
2142pub enum MemcacheVersion {
2143 Unspecified,
2144 Memcache15,
2146 UnknownValue(memcache_version::UnknownValue),
2151}
2152
2153#[doc(hidden)]
2154pub mod memcache_version {
2155 #[allow(unused_imports)]
2156 use super::*;
2157 #[derive(Clone, Debug, PartialEq)]
2158 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2159}
2160
2161impl MemcacheVersion {
2162 pub fn value(&self) -> std::option::Option<i32> {
2167 match self {
2168 Self::Unspecified => std::option::Option::Some(0),
2169 Self::Memcache15 => std::option::Option::Some(1),
2170 Self::UnknownValue(u) => u.0.value(),
2171 }
2172 }
2173
2174 pub fn name(&self) -> std::option::Option<&str> {
2179 match self {
2180 Self::Unspecified => std::option::Option::Some("MEMCACHE_VERSION_UNSPECIFIED"),
2181 Self::Memcache15 => std::option::Option::Some("MEMCACHE_1_5"),
2182 Self::UnknownValue(u) => u.0.name(),
2183 }
2184 }
2185}
2186
2187impl std::default::Default for MemcacheVersion {
2188 fn default() -> Self {
2189 use std::convert::From;
2190 Self::from(0)
2191 }
2192}
2193
2194impl std::fmt::Display for MemcacheVersion {
2195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2196 wkt::internal::display_enum(f, self.name(), self.value())
2197 }
2198}
2199
2200impl std::convert::From<i32> for MemcacheVersion {
2201 fn from(value: i32) -> Self {
2202 match value {
2203 0 => Self::Unspecified,
2204 1 => Self::Memcache15,
2205 _ => Self::UnknownValue(memcache_version::UnknownValue(
2206 wkt::internal::UnknownEnumValue::Integer(value),
2207 )),
2208 }
2209 }
2210}
2211
2212impl std::convert::From<&str> for MemcacheVersion {
2213 fn from(value: &str) -> Self {
2214 use std::string::ToString;
2215 match value {
2216 "MEMCACHE_VERSION_UNSPECIFIED" => Self::Unspecified,
2217 "MEMCACHE_1_5" => Self::Memcache15,
2218 _ => Self::UnknownValue(memcache_version::UnknownValue(
2219 wkt::internal::UnknownEnumValue::String(value.to_string()),
2220 )),
2221 }
2222 }
2223}
2224
2225impl serde::ser::Serialize for MemcacheVersion {
2226 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2227 where
2228 S: serde::Serializer,
2229 {
2230 match self {
2231 Self::Unspecified => serializer.serialize_i32(0),
2232 Self::Memcache15 => serializer.serialize_i32(1),
2233 Self::UnknownValue(u) => u.0.serialize(serializer),
2234 }
2235 }
2236}
2237
2238impl<'de> serde::de::Deserialize<'de> for MemcacheVersion {
2239 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2240 where
2241 D: serde::Deserializer<'de>,
2242 {
2243 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MemcacheVersion>::new(
2244 ".google.cloud.memcache.v1.MemcacheVersion",
2245 ))
2246 }
2247}