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
37#[serde_with::serde_as]
39#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
40#[serde(default, rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct Instance {
43 #[serde(skip_serializing_if = "std::string::String::is_empty")]
54 pub name: std::string::String,
55
56 #[serde(skip_serializing_if = "std::string::String::is_empty")]
59 pub display_name: std::string::String,
60
61 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
65 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
66
67 #[serde(skip_serializing_if = "std::string::String::is_empty")]
72 pub authorized_network: std::string::String,
73
74 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
79 pub zones: std::vec::Vec<std::string::String>,
80
81 pub node_count: i32,
83
84 #[serde(skip_serializing_if = "std::option::Option::is_none")]
86 pub node_config: std::option::Option<crate::model::instance::NodeConfig>,
87
88 pub memcache_version: crate::model::MemcacheVersion,
94
95 #[serde(skip_serializing_if = "std::option::Option::is_none")]
98 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
99
100 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
105 pub memcache_nodes: std::vec::Vec<crate::model::instance::Node>,
106
107 #[serde(skip_serializing_if = "std::option::Option::is_none")]
109 pub create_time: std::option::Option<wkt::Timestamp>,
110
111 #[serde(skip_serializing_if = "std::option::Option::is_none")]
113 pub update_time: std::option::Option<wkt::Timestamp>,
114
115 pub state: crate::model::instance::State,
117
118 #[serde(skip_serializing_if = "std::string::String::is_empty")]
123 pub memcache_full_version: std::string::String,
124
125 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
127 pub instance_messages: std::vec::Vec<crate::model::instance::InstanceMessage>,
128
129 #[serde(skip_serializing_if = "std::string::String::is_empty")]
131 pub discovery_endpoint: std::string::String,
132
133 #[serde(skip_serializing_if = "std::option::Option::is_none")]
137 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
138
139 #[serde(skip_serializing_if = "std::option::Option::is_none")]
141 pub maintenance_schedule: std::option::Option<crate::model::MaintenanceSchedule>,
142
143 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
144 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
145}
146
147impl Instance {
148 pub fn new() -> Self {
149 std::default::Default::default()
150 }
151
152 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
154 self.name = v.into();
155 self
156 }
157
158 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
160 self.display_name = v.into();
161 self
162 }
163
164 pub fn set_authorized_network<T: std::convert::Into<std::string::String>>(
166 mut self,
167 v: T,
168 ) -> Self {
169 self.authorized_network = v.into();
170 self
171 }
172
173 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
175 self.node_count = v.into();
176 self
177 }
178
179 pub fn set_node_config<
181 T: std::convert::Into<std::option::Option<crate::model::instance::NodeConfig>>,
182 >(
183 mut self,
184 v: T,
185 ) -> Self {
186 self.node_config = v.into();
187 self
188 }
189
190 pub fn set_memcache_version<T: std::convert::Into<crate::model::MemcacheVersion>>(
192 mut self,
193 v: T,
194 ) -> Self {
195 self.memcache_version = v.into();
196 self
197 }
198
199 pub fn set_parameters<
201 T: std::convert::Into<std::option::Option<crate::model::MemcacheParameters>>,
202 >(
203 mut self,
204 v: T,
205 ) -> Self {
206 self.parameters = v.into();
207 self
208 }
209
210 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
212 mut self,
213 v: T,
214 ) -> Self {
215 self.create_time = v.into();
216 self
217 }
218
219 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
221 mut self,
222 v: T,
223 ) -> Self {
224 self.update_time = v.into();
225 self
226 }
227
228 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
230 self.state = v.into();
231 self
232 }
233
234 pub fn set_memcache_full_version<T: std::convert::Into<std::string::String>>(
236 mut self,
237 v: T,
238 ) -> Self {
239 self.memcache_full_version = v.into();
240 self
241 }
242
243 pub fn set_discovery_endpoint<T: std::convert::Into<std::string::String>>(
245 mut self,
246 v: T,
247 ) -> Self {
248 self.discovery_endpoint = v.into();
249 self
250 }
251
252 pub fn set_maintenance_policy<
254 T: std::convert::Into<std::option::Option<crate::model::MaintenancePolicy>>,
255 >(
256 mut self,
257 v: T,
258 ) -> Self {
259 self.maintenance_policy = v.into();
260 self
261 }
262
263 pub fn set_maintenance_schedule<
265 T: std::convert::Into<std::option::Option<crate::model::MaintenanceSchedule>>,
266 >(
267 mut self,
268 v: T,
269 ) -> Self {
270 self.maintenance_schedule = v.into();
271 self
272 }
273
274 pub fn set_zones<T, V>(mut self, v: T) -> Self
276 where
277 T: std::iter::IntoIterator<Item = V>,
278 V: std::convert::Into<std::string::String>,
279 {
280 use std::iter::Iterator;
281 self.zones = v.into_iter().map(|i| i.into()).collect();
282 self
283 }
284
285 pub fn set_memcache_nodes<T, V>(mut self, v: T) -> Self
287 where
288 T: std::iter::IntoIterator<Item = V>,
289 V: std::convert::Into<crate::model::instance::Node>,
290 {
291 use std::iter::Iterator;
292 self.memcache_nodes = v.into_iter().map(|i| i.into()).collect();
293 self
294 }
295
296 pub fn set_instance_messages<T, V>(mut self, v: T) -> Self
298 where
299 T: std::iter::IntoIterator<Item = V>,
300 V: std::convert::Into<crate::model::instance::InstanceMessage>,
301 {
302 use std::iter::Iterator;
303 self.instance_messages = v.into_iter().map(|i| i.into()).collect();
304 self
305 }
306
307 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
309 where
310 T: std::iter::IntoIterator<Item = (K, V)>,
311 K: std::convert::Into<std::string::String>,
312 V: std::convert::Into<std::string::String>,
313 {
314 use std::iter::Iterator;
315 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
316 self
317 }
318}
319
320impl wkt::message::Message for Instance {
321 fn typename() -> &'static str {
322 "type.googleapis.com/google.cloud.memcache.v1.Instance"
323 }
324}
325
326pub mod instance {
328 #[allow(unused_imports)]
329 use super::*;
330
331 #[serde_with::serde_as]
333 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
334 #[serde(default, rename_all = "camelCase")]
335 #[non_exhaustive]
336 pub struct NodeConfig {
337 pub cpu_count: i32,
339
340 pub memory_size_mb: i32,
342
343 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
344 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
345 }
346
347 impl NodeConfig {
348 pub fn new() -> Self {
349 std::default::Default::default()
350 }
351
352 pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
354 self.cpu_count = v.into();
355 self
356 }
357
358 pub fn set_memory_size_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
360 self.memory_size_mb = v.into();
361 self
362 }
363 }
364
365 impl wkt::message::Message for NodeConfig {
366 fn typename() -> &'static str {
367 "type.googleapis.com/google.cloud.memcache.v1.Instance.NodeConfig"
368 }
369 }
370
371 #[serde_with::serde_as]
372 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
373 #[serde(default, rename_all = "camelCase")]
374 #[non_exhaustive]
375 pub struct Node {
376 #[serde(skip_serializing_if = "std::string::String::is_empty")]
379 pub node_id: std::string::String,
380
381 #[serde(skip_serializing_if = "std::string::String::is_empty")]
383 pub zone: std::string::String,
384
385 pub state: crate::model::instance::node::State,
387
388 #[serde(skip_serializing_if = "std::string::String::is_empty")]
391 pub host: std::string::String,
392
393 pub port: i32,
395
396 #[serde(skip_serializing_if = "std::option::Option::is_none")]
398 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
399
400 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
401 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
402 }
403
404 impl Node {
405 pub fn new() -> Self {
406 std::default::Default::default()
407 }
408
409 pub fn set_node_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
411 self.node_id = v.into();
412 self
413 }
414
415 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
417 self.zone = v.into();
418 self
419 }
420
421 pub fn set_state<T: std::convert::Into<crate::model::instance::node::State>>(
423 mut self,
424 v: T,
425 ) -> Self {
426 self.state = v.into();
427 self
428 }
429
430 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
432 self.host = v.into();
433 self
434 }
435
436 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
438 self.port = v.into();
439 self
440 }
441
442 pub fn set_parameters<
444 T: std::convert::Into<std::option::Option<crate::model::MemcacheParameters>>,
445 >(
446 mut self,
447 v: T,
448 ) -> Self {
449 self.parameters = v.into();
450 self
451 }
452 }
453
454 impl wkt::message::Message for Node {
455 fn typename() -> &'static str {
456 "type.googleapis.com/google.cloud.memcache.v1.Instance.Node"
457 }
458 }
459
460 pub mod node {
462 #[allow(unused_imports)]
463 use super::*;
464
465 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
467 pub struct State(i32);
468
469 impl State {
470 pub const STATE_UNSPECIFIED: State = State::new(0);
472
473 pub const CREATING: State = State::new(1);
475
476 pub const READY: State = State::new(2);
478
479 pub const DELETING: State = State::new(3);
481
482 pub const UPDATING: State = State::new(4);
484
485 pub(crate) const fn new(value: i32) -> Self {
487 Self(value)
488 }
489
490 pub fn value(&self) -> i32 {
492 self.0
493 }
494
495 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
497 match self.0 {
498 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
499 1 => std::borrow::Cow::Borrowed("CREATING"),
500 2 => std::borrow::Cow::Borrowed("READY"),
501 3 => std::borrow::Cow::Borrowed("DELETING"),
502 4 => std::borrow::Cow::Borrowed("UPDATING"),
503 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
504 }
505 }
506
507 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
509 match name {
510 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
511 "CREATING" => std::option::Option::Some(Self::CREATING),
512 "READY" => std::option::Option::Some(Self::READY),
513 "DELETING" => std::option::Option::Some(Self::DELETING),
514 "UPDATING" => std::option::Option::Some(Self::UPDATING),
515 _ => std::option::Option::None,
516 }
517 }
518 }
519
520 impl std::convert::From<i32> for State {
521 fn from(value: i32) -> Self {
522 Self::new(value)
523 }
524 }
525
526 impl std::default::Default for State {
527 fn default() -> Self {
528 Self::new(0)
529 }
530 }
531 }
532
533 #[serde_with::serde_as]
534 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
535 #[serde(default, rename_all = "camelCase")]
536 #[non_exhaustive]
537 pub struct InstanceMessage {
538 pub code: crate::model::instance::instance_message::Code,
540
541 #[serde(skip_serializing_if = "std::string::String::is_empty")]
543 pub message: std::string::String,
544
545 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
546 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
547 }
548
549 impl InstanceMessage {
550 pub fn new() -> Self {
551 std::default::Default::default()
552 }
553
554 pub fn set_code<T: std::convert::Into<crate::model::instance::instance_message::Code>>(
556 mut self,
557 v: T,
558 ) -> Self {
559 self.code = v.into();
560 self
561 }
562
563 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
565 self.message = v.into();
566 self
567 }
568 }
569
570 impl wkt::message::Message for InstanceMessage {
571 fn typename() -> &'static str {
572 "type.googleapis.com/google.cloud.memcache.v1.Instance.InstanceMessage"
573 }
574 }
575
576 pub mod instance_message {
578 #[allow(unused_imports)]
579 use super::*;
580
581 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
582 pub struct Code(i32);
583
584 impl Code {
585 pub const CODE_UNSPECIFIED: Code = Code::new(0);
587
588 pub const ZONE_DISTRIBUTION_UNBALANCED: Code = Code::new(1);
590
591 pub(crate) const fn new(value: i32) -> Self {
593 Self(value)
594 }
595
596 pub fn value(&self) -> i32 {
598 self.0
599 }
600
601 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
603 match self.0 {
604 0 => std::borrow::Cow::Borrowed("CODE_UNSPECIFIED"),
605 1 => std::borrow::Cow::Borrowed("ZONE_DISTRIBUTION_UNBALANCED"),
606 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
607 }
608 }
609
610 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
612 match name {
613 "CODE_UNSPECIFIED" => std::option::Option::Some(Self::CODE_UNSPECIFIED),
614 "ZONE_DISTRIBUTION_UNBALANCED" => {
615 std::option::Option::Some(Self::ZONE_DISTRIBUTION_UNBALANCED)
616 }
617 _ => std::option::Option::None,
618 }
619 }
620 }
621
622 impl std::convert::From<i32> for Code {
623 fn from(value: i32) -> Self {
624 Self::new(value)
625 }
626 }
627
628 impl std::default::Default for Code {
629 fn default() -> Self {
630 Self::new(0)
631 }
632 }
633 }
634
635 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
637 pub struct State(i32);
638
639 impl State {
640 pub const STATE_UNSPECIFIED: State = State::new(0);
642
643 pub const CREATING: State = State::new(1);
645
646 pub const READY: State = State::new(2);
648
649 pub const UPDATING: State = State::new(3);
652
653 pub const DELETING: State = State::new(4);
655
656 pub const PERFORMING_MAINTENANCE: State = State::new(5);
658
659 pub(crate) const fn new(value: i32) -> Self {
661 Self(value)
662 }
663
664 pub fn value(&self) -> i32 {
666 self.0
667 }
668
669 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
671 match self.0 {
672 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
673 1 => std::borrow::Cow::Borrowed("CREATING"),
674 2 => std::borrow::Cow::Borrowed("READY"),
675 3 => std::borrow::Cow::Borrowed("UPDATING"),
676 4 => std::borrow::Cow::Borrowed("DELETING"),
677 5 => std::borrow::Cow::Borrowed("PERFORMING_MAINTENANCE"),
678 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
679 }
680 }
681
682 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
684 match name {
685 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
686 "CREATING" => std::option::Option::Some(Self::CREATING),
687 "READY" => std::option::Option::Some(Self::READY),
688 "UPDATING" => std::option::Option::Some(Self::UPDATING),
689 "DELETING" => std::option::Option::Some(Self::DELETING),
690 "PERFORMING_MAINTENANCE" => std::option::Option::Some(Self::PERFORMING_MAINTENANCE),
691 _ => std::option::Option::None,
692 }
693 }
694 }
695
696 impl std::convert::From<i32> for State {
697 fn from(value: i32) -> Self {
698 Self::new(value)
699 }
700 }
701
702 impl std::default::Default for State {
703 fn default() -> Self {
704 Self::new(0)
705 }
706 }
707}
708
709#[serde_with::serde_as]
711#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
712#[serde(default, rename_all = "camelCase")]
713#[non_exhaustive]
714pub struct MaintenancePolicy {
715 #[serde(skip_serializing_if = "std::option::Option::is_none")]
717 pub create_time: std::option::Option<wkt::Timestamp>,
718
719 #[serde(skip_serializing_if = "std::option::Option::is_none")]
721 pub update_time: std::option::Option<wkt::Timestamp>,
722
723 #[serde(skip_serializing_if = "std::string::String::is_empty")]
726 pub description: std::string::String,
727
728 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
732 pub weekly_maintenance_window: std::vec::Vec<crate::model::WeeklyMaintenanceWindow>,
733
734 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
735 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
736}
737
738impl MaintenancePolicy {
739 pub fn new() -> Self {
740 std::default::Default::default()
741 }
742
743 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
745 mut self,
746 v: T,
747 ) -> Self {
748 self.create_time = v.into();
749 self
750 }
751
752 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
754 mut self,
755 v: T,
756 ) -> Self {
757 self.update_time = v.into();
758 self
759 }
760
761 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763 self.description = v.into();
764 self
765 }
766
767 pub fn set_weekly_maintenance_window<T, V>(mut self, v: T) -> Self
769 where
770 T: std::iter::IntoIterator<Item = V>,
771 V: std::convert::Into<crate::model::WeeklyMaintenanceWindow>,
772 {
773 use std::iter::Iterator;
774 self.weekly_maintenance_window = v.into_iter().map(|i| i.into()).collect();
775 self
776 }
777}
778
779impl wkt::message::Message for MaintenancePolicy {
780 fn typename() -> &'static str {
781 "type.googleapis.com/google.cloud.memcache.v1.MaintenancePolicy"
782 }
783}
784
785#[serde_with::serde_as]
787#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
788#[serde(default, rename_all = "camelCase")]
789#[non_exhaustive]
790pub struct WeeklyMaintenanceWindow {
791 pub day: gtype::model::DayOfWeek,
793
794 #[serde(skip_serializing_if = "std::option::Option::is_none")]
796 pub start_time: std::option::Option<gtype::model::TimeOfDay>,
797
798 #[serde(skip_serializing_if = "std::option::Option::is_none")]
800 pub duration: std::option::Option<wkt::Duration>,
801
802 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
803 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
804}
805
806impl WeeklyMaintenanceWindow {
807 pub fn new() -> Self {
808 std::default::Default::default()
809 }
810
811 pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
813 self.day = v.into();
814 self
815 }
816
817 pub fn set_start_time<T: std::convert::Into<std::option::Option<gtype::model::TimeOfDay>>>(
819 mut self,
820 v: T,
821 ) -> Self {
822 self.start_time = v.into();
823 self
824 }
825
826 pub fn set_duration<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
828 mut self,
829 v: T,
830 ) -> Self {
831 self.duration = v.into();
832 self
833 }
834}
835
836impl wkt::message::Message for WeeklyMaintenanceWindow {
837 fn typename() -> &'static str {
838 "type.googleapis.com/google.cloud.memcache.v1.WeeklyMaintenanceWindow"
839 }
840}
841
842#[serde_with::serde_as]
844#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
845#[serde(default, rename_all = "camelCase")]
846#[non_exhaustive]
847pub struct MaintenanceSchedule {
848 #[serde(skip_serializing_if = "std::option::Option::is_none")]
850 pub start_time: std::option::Option<wkt::Timestamp>,
851
852 #[serde(skip_serializing_if = "std::option::Option::is_none")]
854 pub end_time: std::option::Option<wkt::Timestamp>,
855
856 #[serde(skip_serializing_if = "std::option::Option::is_none")]
859 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
860
861 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
862 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
863}
864
865impl MaintenanceSchedule {
866 pub fn new() -> Self {
867 std::default::Default::default()
868 }
869
870 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
872 mut self,
873 v: T,
874 ) -> Self {
875 self.start_time = v.into();
876 self
877 }
878
879 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
881 mut self,
882 v: T,
883 ) -> Self {
884 self.end_time = v.into();
885 self
886 }
887
888 pub fn set_schedule_deadline_time<
890 T: std::convert::Into<std::option::Option<wkt::Timestamp>>,
891 >(
892 mut self,
893 v: T,
894 ) -> Self {
895 self.schedule_deadline_time = v.into();
896 self
897 }
898}
899
900impl wkt::message::Message for MaintenanceSchedule {
901 fn typename() -> &'static str {
902 "type.googleapis.com/google.cloud.memcache.v1.MaintenanceSchedule"
903 }
904}
905
906#[serde_with::serde_as]
910#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
911#[serde(default, rename_all = "camelCase")]
912#[non_exhaustive]
913pub struct RescheduleMaintenanceRequest {
914 #[serde(skip_serializing_if = "std::string::String::is_empty")]
918 pub instance: std::string::String,
919
920 pub reschedule_type: crate::model::reschedule_maintenance_request::RescheduleType,
922
923 #[serde(skip_serializing_if = "std::option::Option::is_none")]
927 pub schedule_time: std::option::Option<wkt::Timestamp>,
928
929 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
930 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
931}
932
933impl RescheduleMaintenanceRequest {
934 pub fn new() -> Self {
935 std::default::Default::default()
936 }
937
938 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
940 self.instance = v.into();
941 self
942 }
943
944 pub fn set_reschedule_type<
946 T: std::convert::Into<crate::model::reschedule_maintenance_request::RescheduleType>,
947 >(
948 mut self,
949 v: T,
950 ) -> Self {
951 self.reschedule_type = v.into();
952 self
953 }
954
955 pub fn set_schedule_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
957 mut self,
958 v: T,
959 ) -> Self {
960 self.schedule_time = v.into();
961 self
962 }
963}
964
965impl wkt::message::Message for RescheduleMaintenanceRequest {
966 fn typename() -> &'static str {
967 "type.googleapis.com/google.cloud.memcache.v1.RescheduleMaintenanceRequest"
968 }
969}
970
971pub mod reschedule_maintenance_request {
973 #[allow(unused_imports)]
974 use super::*;
975
976 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
978 pub struct RescheduleType(i32);
979
980 impl RescheduleType {
981 pub const RESCHEDULE_TYPE_UNSPECIFIED: RescheduleType = RescheduleType::new(0);
983
984 pub const IMMEDIATE: RescheduleType = RescheduleType::new(1);
986
987 pub const NEXT_AVAILABLE_WINDOW: RescheduleType = RescheduleType::new(2);
990
991 pub const SPECIFIC_TIME: RescheduleType = RescheduleType::new(3);
993
994 pub(crate) const fn new(value: i32) -> Self {
996 Self(value)
997 }
998
999 pub fn value(&self) -> i32 {
1001 self.0
1002 }
1003
1004 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1006 match self.0 {
1007 0 => std::borrow::Cow::Borrowed("RESCHEDULE_TYPE_UNSPECIFIED"),
1008 1 => std::borrow::Cow::Borrowed("IMMEDIATE"),
1009 2 => std::borrow::Cow::Borrowed("NEXT_AVAILABLE_WINDOW"),
1010 3 => std::borrow::Cow::Borrowed("SPECIFIC_TIME"),
1011 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1012 }
1013 }
1014
1015 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1017 match name {
1018 "RESCHEDULE_TYPE_UNSPECIFIED" => {
1019 std::option::Option::Some(Self::RESCHEDULE_TYPE_UNSPECIFIED)
1020 }
1021 "IMMEDIATE" => std::option::Option::Some(Self::IMMEDIATE),
1022 "NEXT_AVAILABLE_WINDOW" => std::option::Option::Some(Self::NEXT_AVAILABLE_WINDOW),
1023 "SPECIFIC_TIME" => std::option::Option::Some(Self::SPECIFIC_TIME),
1024 _ => std::option::Option::None,
1025 }
1026 }
1027 }
1028
1029 impl std::convert::From<i32> for RescheduleType {
1030 fn from(value: i32) -> Self {
1031 Self::new(value)
1032 }
1033 }
1034
1035 impl std::default::Default for RescheduleType {
1036 fn default() -> Self {
1037 Self::new(0)
1038 }
1039 }
1040}
1041
1042#[serde_with::serde_as]
1046#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1047#[serde(default, rename_all = "camelCase")]
1048#[non_exhaustive]
1049pub struct ListInstancesRequest {
1050 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1054 pub parent: std::string::String,
1055
1056 pub page_size: i32,
1066
1067 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1069 pub page_token: std::string::String,
1070
1071 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1074 pub filter: std::string::String,
1075
1076 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1078 pub order_by: std::string::String,
1079
1080 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1081 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1082}
1083
1084impl ListInstancesRequest {
1085 pub fn new() -> Self {
1086 std::default::Default::default()
1087 }
1088
1089 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1091 self.parent = v.into();
1092 self
1093 }
1094
1095 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1097 self.page_size = v.into();
1098 self
1099 }
1100
1101 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.page_token = v.into();
1104 self
1105 }
1106
1107 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1109 self.filter = v.into();
1110 self
1111 }
1112
1113 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.order_by = v.into();
1116 self
1117 }
1118}
1119
1120impl wkt::message::Message for ListInstancesRequest {
1121 fn typename() -> &'static str {
1122 "type.googleapis.com/google.cloud.memcache.v1.ListInstancesRequest"
1123 }
1124}
1125
1126#[serde_with::serde_as]
1130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1131#[serde(default, rename_all = "camelCase")]
1132#[non_exhaustive]
1133pub struct ListInstancesResponse {
1134 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1140 pub instances: std::vec::Vec<crate::model::Instance>,
1141
1142 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1145 pub next_page_token: std::string::String,
1146
1147 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1149 pub unreachable: std::vec::Vec<std::string::String>,
1150
1151 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1152 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1153}
1154
1155impl ListInstancesResponse {
1156 pub fn new() -> Self {
1157 std::default::Default::default()
1158 }
1159
1160 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1162 self.next_page_token = v.into();
1163 self
1164 }
1165
1166 pub fn set_instances<T, V>(mut self, v: T) -> Self
1168 where
1169 T: std::iter::IntoIterator<Item = V>,
1170 V: std::convert::Into<crate::model::Instance>,
1171 {
1172 use std::iter::Iterator;
1173 self.instances = v.into_iter().map(|i| i.into()).collect();
1174 self
1175 }
1176
1177 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1179 where
1180 T: std::iter::IntoIterator<Item = V>,
1181 V: std::convert::Into<std::string::String>,
1182 {
1183 use std::iter::Iterator;
1184 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1185 self
1186 }
1187}
1188
1189impl wkt::message::Message for ListInstancesResponse {
1190 fn typename() -> &'static str {
1191 "type.googleapis.com/google.cloud.memcache.v1.ListInstancesResponse"
1192 }
1193}
1194
1195#[doc(hidden)]
1196impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
1197 type PageItem = crate::model::Instance;
1198
1199 fn items(self) -> std::vec::Vec<Self::PageItem> {
1200 self.instances
1201 }
1202
1203 fn next_page_token(&self) -> std::string::String {
1204 use std::clone::Clone;
1205 self.next_page_token.clone()
1206 }
1207}
1208
1209#[serde_with::serde_as]
1213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1214#[serde(default, rename_all = "camelCase")]
1215#[non_exhaustive]
1216pub struct GetInstanceRequest {
1217 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1221 pub name: std::string::String,
1222
1223 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1224 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1225}
1226
1227impl GetInstanceRequest {
1228 pub fn new() -> Self {
1229 std::default::Default::default()
1230 }
1231
1232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1234 self.name = v.into();
1235 self
1236 }
1237}
1238
1239impl wkt::message::Message for GetInstanceRequest {
1240 fn typename() -> &'static str {
1241 "type.googleapis.com/google.cloud.memcache.v1.GetInstanceRequest"
1242 }
1243}
1244
1245#[serde_with::serde_as]
1249#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1250#[serde(default, rename_all = "camelCase")]
1251#[non_exhaustive]
1252pub struct CreateInstanceRequest {
1253 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1257 pub parent: std::string::String,
1258
1259 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1270 pub instance_id: std::string::String,
1271
1272 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1274 pub instance: std::option::Option<crate::model::Instance>,
1275
1276 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1277 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1278}
1279
1280impl CreateInstanceRequest {
1281 pub fn new() -> Self {
1282 std::default::Default::default()
1283 }
1284
1285 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.parent = v.into();
1288 self
1289 }
1290
1291 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1293 self.instance_id = v.into();
1294 self
1295 }
1296
1297 pub fn set_instance<T: std::convert::Into<std::option::Option<crate::model::Instance>>>(
1299 mut self,
1300 v: T,
1301 ) -> Self {
1302 self.instance = v.into();
1303 self
1304 }
1305}
1306
1307impl wkt::message::Message for CreateInstanceRequest {
1308 fn typename() -> &'static str {
1309 "type.googleapis.com/google.cloud.memcache.v1.CreateInstanceRequest"
1310 }
1311}
1312
1313#[serde_with::serde_as]
1317#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1318#[serde(default, rename_all = "camelCase")]
1319#[non_exhaustive]
1320pub struct UpdateInstanceRequest {
1321 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1325 pub update_mask: std::option::Option<wkt::FieldMask>,
1326
1327 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1330 pub instance: std::option::Option<crate::model::Instance>,
1331
1332 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1333 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1334}
1335
1336impl UpdateInstanceRequest {
1337 pub fn new() -> Self {
1338 std::default::Default::default()
1339 }
1340
1341 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1343 mut self,
1344 v: T,
1345 ) -> Self {
1346 self.update_mask = v.into();
1347 self
1348 }
1349
1350 pub fn set_instance<T: std::convert::Into<std::option::Option<crate::model::Instance>>>(
1352 mut self,
1353 v: T,
1354 ) -> Self {
1355 self.instance = v.into();
1356 self
1357 }
1358}
1359
1360impl wkt::message::Message for UpdateInstanceRequest {
1361 fn typename() -> &'static str {
1362 "type.googleapis.com/google.cloud.memcache.v1.UpdateInstanceRequest"
1363 }
1364}
1365
1366#[serde_with::serde_as]
1370#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1371#[serde(default, rename_all = "camelCase")]
1372#[non_exhaustive]
1373pub struct DeleteInstanceRequest {
1374 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1378 pub name: std::string::String,
1379
1380 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1381 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1382}
1383
1384impl DeleteInstanceRequest {
1385 pub fn new() -> Self {
1386 std::default::Default::default()
1387 }
1388
1389 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1391 self.name = v.into();
1392 self
1393 }
1394}
1395
1396impl wkt::message::Message for DeleteInstanceRequest {
1397 fn typename() -> &'static str {
1398 "type.googleapis.com/google.cloud.memcache.v1.DeleteInstanceRequest"
1399 }
1400}
1401
1402#[serde_with::serde_as]
1406#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1407#[serde(default, rename_all = "camelCase")]
1408#[non_exhaustive]
1409pub struct ApplyParametersRequest {
1410 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1413 pub name: std::string::String,
1414
1415 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1417 pub node_ids: std::vec::Vec<std::string::String>,
1418
1419 pub apply_all: bool,
1423
1424 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1425 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl ApplyParametersRequest {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1435 self.name = v.into();
1436 self
1437 }
1438
1439 pub fn set_apply_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1441 self.apply_all = v.into();
1442 self
1443 }
1444
1445 pub fn set_node_ids<T, V>(mut self, v: T) -> Self
1447 where
1448 T: std::iter::IntoIterator<Item = V>,
1449 V: std::convert::Into<std::string::String>,
1450 {
1451 use std::iter::Iterator;
1452 self.node_ids = v.into_iter().map(|i| i.into()).collect();
1453 self
1454 }
1455}
1456
1457impl wkt::message::Message for ApplyParametersRequest {
1458 fn typename() -> &'static str {
1459 "type.googleapis.com/google.cloud.memcache.v1.ApplyParametersRequest"
1460 }
1461}
1462
1463#[serde_with::serde_as]
1467#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1468#[serde(default, rename_all = "camelCase")]
1469#[non_exhaustive]
1470pub struct UpdateParametersRequest {
1471 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1474 pub name: std::string::String,
1475
1476 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1478 pub update_mask: std::option::Option<wkt::FieldMask>,
1479
1480 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1482 pub parameters: std::option::Option<crate::model::MemcacheParameters>,
1483
1484 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1485 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1486}
1487
1488impl UpdateParametersRequest {
1489 pub fn new() -> Self {
1490 std::default::Default::default()
1491 }
1492
1493 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1495 self.name = v.into();
1496 self
1497 }
1498
1499 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1501 mut self,
1502 v: T,
1503 ) -> Self {
1504 self.update_mask = v.into();
1505 self
1506 }
1507
1508 pub fn set_parameters<
1510 T: std::convert::Into<std::option::Option<crate::model::MemcacheParameters>>,
1511 >(
1512 mut self,
1513 v: T,
1514 ) -> Self {
1515 self.parameters = v.into();
1516 self
1517 }
1518}
1519
1520impl wkt::message::Message for UpdateParametersRequest {
1521 fn typename() -> &'static str {
1522 "type.googleapis.com/google.cloud.memcache.v1.UpdateParametersRequest"
1523 }
1524}
1525
1526#[serde_with::serde_as]
1527#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1528#[serde(default, rename_all = "camelCase")]
1529#[non_exhaustive]
1530pub struct MemcacheParameters {
1531 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1537 pub id: std::string::String,
1538
1539 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1541 pub params: std::collections::HashMap<std::string::String, std::string::String>,
1542
1543 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1544 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1545}
1546
1547impl MemcacheParameters {
1548 pub fn new() -> Self {
1549 std::default::Default::default()
1550 }
1551
1552 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1554 self.id = v.into();
1555 self
1556 }
1557
1558 pub fn set_params<T, K, V>(mut self, v: T) -> Self
1560 where
1561 T: std::iter::IntoIterator<Item = (K, V)>,
1562 K: std::convert::Into<std::string::String>,
1563 V: std::convert::Into<std::string::String>,
1564 {
1565 use std::iter::Iterator;
1566 self.params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1567 self
1568 }
1569}
1570
1571impl wkt::message::Message for MemcacheParameters {
1572 fn typename() -> &'static str {
1573 "type.googleapis.com/google.cloud.memcache.v1.MemcacheParameters"
1574 }
1575}
1576
1577#[serde_with::serde_as]
1579#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1580#[serde(default, rename_all = "camelCase")]
1581#[non_exhaustive]
1582pub struct OperationMetadata {
1583 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1585 pub create_time: std::option::Option<wkt::Timestamp>,
1586
1587 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1589 pub end_time: std::option::Option<wkt::Timestamp>,
1590
1591 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1593 pub target: std::string::String,
1594
1595 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1597 pub verb: std::string::String,
1598
1599 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1601 pub status_detail: std::string::String,
1602
1603 pub cancel_requested: bool,
1610
1611 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1613 pub api_version: std::string::String,
1614
1615 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1616 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1617}
1618
1619impl OperationMetadata {
1620 pub fn new() -> Self {
1621 std::default::Default::default()
1622 }
1623
1624 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1626 mut self,
1627 v: T,
1628 ) -> Self {
1629 self.create_time = v.into();
1630 self
1631 }
1632
1633 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1635 mut self,
1636 v: T,
1637 ) -> Self {
1638 self.end_time = v.into();
1639 self
1640 }
1641
1642 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1644 self.target = v.into();
1645 self
1646 }
1647
1648 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.verb = v.into();
1651 self
1652 }
1653
1654 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.status_detail = v.into();
1657 self
1658 }
1659
1660 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1662 self.cancel_requested = v.into();
1663 self
1664 }
1665
1666 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1668 self.api_version = v.into();
1669 self
1670 }
1671}
1672
1673impl wkt::message::Message for OperationMetadata {
1674 fn typename() -> &'static str {
1675 "type.googleapis.com/google.cloud.memcache.v1.OperationMetadata"
1676 }
1677}
1678
1679#[serde_with::serde_as]
1683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1684#[serde(default, rename_all = "camelCase")]
1685#[non_exhaustive]
1686pub struct LocationMetadata {
1687 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1691 pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
1692
1693 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1694 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1695}
1696
1697impl LocationMetadata {
1698 pub fn new() -> Self {
1699 std::default::Default::default()
1700 }
1701
1702 pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
1704 where
1705 T: std::iter::IntoIterator<Item = (K, V)>,
1706 K: std::convert::Into<std::string::String>,
1707 V: std::convert::Into<crate::model::ZoneMetadata>,
1708 {
1709 use std::iter::Iterator;
1710 self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1711 self
1712 }
1713}
1714
1715impl wkt::message::Message for LocationMetadata {
1716 fn typename() -> &'static str {
1717 "type.googleapis.com/google.cloud.memcache.v1.LocationMetadata"
1718 }
1719}
1720
1721#[serde_with::serde_as]
1722#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1723#[serde(default, rename_all = "camelCase")]
1724#[non_exhaustive]
1725pub struct ZoneMetadata {
1726 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1727 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1728}
1729
1730impl ZoneMetadata {
1731 pub fn new() -> Self {
1732 std::default::Default::default()
1733 }
1734}
1735
1736impl wkt::message::Message for ZoneMetadata {
1737 fn typename() -> &'static str {
1738 "type.googleapis.com/google.cloud.memcache.v1.ZoneMetadata"
1739 }
1740}
1741
1742#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1744pub struct MemcacheVersion(i32);
1745
1746impl MemcacheVersion {
1747 pub const MEMCACHE_VERSION_UNSPECIFIED: MemcacheVersion = MemcacheVersion::new(0);
1748
1749 pub const MEMCACHE_1_5: MemcacheVersion = MemcacheVersion::new(1);
1751
1752 pub(crate) const fn new(value: i32) -> Self {
1754 Self(value)
1755 }
1756
1757 pub fn value(&self) -> i32 {
1759 self.0
1760 }
1761
1762 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1764 match self.0 {
1765 0 => std::borrow::Cow::Borrowed("MEMCACHE_VERSION_UNSPECIFIED"),
1766 1 => std::borrow::Cow::Borrowed("MEMCACHE_1_5"),
1767 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1768 }
1769 }
1770
1771 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1773 match name {
1774 "MEMCACHE_VERSION_UNSPECIFIED" => {
1775 std::option::Option::Some(Self::MEMCACHE_VERSION_UNSPECIFIED)
1776 }
1777 "MEMCACHE_1_5" => std::option::Option::Some(Self::MEMCACHE_1_5),
1778 _ => std::option::Option::None,
1779 }
1780 }
1781}
1782
1783impl std::convert::From<i32> for MemcacheVersion {
1784 fn from(value: i32) -> Self {
1785 Self::new(value)
1786 }
1787}
1788
1789impl std::default::Default for MemcacheVersion {
1790 fn default() -> Self {
1791 Self::new(0)
1792 }
1793}