1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
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 Cluster {
45 pub name: std::string::String,
47
48 pub create_time: std::option::Option<wkt::Timestamp>,
50
51 pub update_time: std::option::Option<wkt::Timestamp>,
53
54 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
56
57 pub fleet: std::option::Option<crate::model::Fleet>,
59
60 pub networking: std::option::Option<crate::model::ClusterNetworking>,
62
63 pub authorization: std::option::Option<crate::model::Authorization>,
65
66 pub default_max_pods_per_node: i32,
70
71 pub endpoint: std::string::String,
73
74 pub port: i32,
76
77 pub cluster_ca_certificate: std::string::String,
79
80 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
82
83 pub control_plane_version: std::string::String,
85
86 pub node_version: std::string::String,
89
90 pub control_plane: std::option::Option<crate::model::cluster::ControlPlane>,
92
93 pub system_addons_config: std::option::Option<crate::model::cluster::SystemAddonsConfig>,
95
96 pub external_load_balancer_ipv4_address_pools: std::vec::Vec<std::string::String>,
99
100 pub control_plane_encryption:
103 std::option::Option<crate::model::cluster::ControlPlaneEncryption>,
104
105 pub status: crate::model::cluster::Status,
107
108 pub maintenance_events: std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
112
113 pub target_version: std::string::String,
115
116 pub release_channel: crate::model::cluster::ReleaseChannel,
118
119 pub survivability_config: std::option::Option<crate::model::cluster::SurvivabilityConfig>,
123
124 pub external_load_balancer_ipv6_address_pools: std::vec::Vec<std::string::String>,
127
128 pub connection_state: std::option::Option<crate::model::cluster::ConnectionState>,
130
131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
132}
133
134impl Cluster {
135 pub fn new() -> Self {
136 std::default::Default::default()
137 }
138
139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
141 self.name = v.into();
142 self
143 }
144
145 pub fn set_create_time<T>(mut self, v: T) -> Self
147 where
148 T: std::convert::Into<wkt::Timestamp>,
149 {
150 self.create_time = std::option::Option::Some(v.into());
151 self
152 }
153
154 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
156 where
157 T: std::convert::Into<wkt::Timestamp>,
158 {
159 self.create_time = v.map(|x| x.into());
160 self
161 }
162
163 pub fn set_update_time<T>(mut self, v: T) -> Self
165 where
166 T: std::convert::Into<wkt::Timestamp>,
167 {
168 self.update_time = std::option::Option::Some(v.into());
169 self
170 }
171
172 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
174 where
175 T: std::convert::Into<wkt::Timestamp>,
176 {
177 self.update_time = v.map(|x| x.into());
178 self
179 }
180
181 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
183 where
184 T: std::iter::IntoIterator<Item = (K, V)>,
185 K: std::convert::Into<std::string::String>,
186 V: std::convert::Into<std::string::String>,
187 {
188 use std::iter::Iterator;
189 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
190 self
191 }
192
193 pub fn set_fleet<T>(mut self, v: T) -> Self
195 where
196 T: std::convert::Into<crate::model::Fleet>,
197 {
198 self.fleet = std::option::Option::Some(v.into());
199 self
200 }
201
202 pub fn set_or_clear_fleet<T>(mut self, v: std::option::Option<T>) -> Self
204 where
205 T: std::convert::Into<crate::model::Fleet>,
206 {
207 self.fleet = v.map(|x| x.into());
208 self
209 }
210
211 pub fn set_networking<T>(mut self, v: T) -> Self
213 where
214 T: std::convert::Into<crate::model::ClusterNetworking>,
215 {
216 self.networking = std::option::Option::Some(v.into());
217 self
218 }
219
220 pub fn set_or_clear_networking<T>(mut self, v: std::option::Option<T>) -> Self
222 where
223 T: std::convert::Into<crate::model::ClusterNetworking>,
224 {
225 self.networking = v.map(|x| x.into());
226 self
227 }
228
229 pub fn set_authorization<T>(mut self, v: T) -> Self
231 where
232 T: std::convert::Into<crate::model::Authorization>,
233 {
234 self.authorization = std::option::Option::Some(v.into());
235 self
236 }
237
238 pub fn set_or_clear_authorization<T>(mut self, v: std::option::Option<T>) -> Self
240 where
241 T: std::convert::Into<crate::model::Authorization>,
242 {
243 self.authorization = v.map(|x| x.into());
244 self
245 }
246
247 pub fn set_default_max_pods_per_node<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
249 self.default_max_pods_per_node = v.into();
250 self
251 }
252
253 pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
255 self.endpoint = v.into();
256 self
257 }
258
259 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
261 self.port = v.into();
262 self
263 }
264
265 pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
267 mut self,
268 v: T,
269 ) -> Self {
270 self.cluster_ca_certificate = v.into();
271 self
272 }
273
274 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
276 where
277 T: std::convert::Into<crate::model::MaintenancePolicy>,
278 {
279 self.maintenance_policy = std::option::Option::Some(v.into());
280 self
281 }
282
283 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
285 where
286 T: std::convert::Into<crate::model::MaintenancePolicy>,
287 {
288 self.maintenance_policy = v.map(|x| x.into());
289 self
290 }
291
292 pub fn set_control_plane_version<T: std::convert::Into<std::string::String>>(
294 mut self,
295 v: T,
296 ) -> Self {
297 self.control_plane_version = v.into();
298 self
299 }
300
301 pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
303 self.node_version = v.into();
304 self
305 }
306
307 pub fn set_control_plane<T>(mut self, v: T) -> Self
309 where
310 T: std::convert::Into<crate::model::cluster::ControlPlane>,
311 {
312 self.control_plane = std::option::Option::Some(v.into());
313 self
314 }
315
316 pub fn set_or_clear_control_plane<T>(mut self, v: std::option::Option<T>) -> Self
318 where
319 T: std::convert::Into<crate::model::cluster::ControlPlane>,
320 {
321 self.control_plane = v.map(|x| x.into());
322 self
323 }
324
325 pub fn set_system_addons_config<T>(mut self, v: T) -> Self
327 where
328 T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
329 {
330 self.system_addons_config = std::option::Option::Some(v.into());
331 self
332 }
333
334 pub fn set_or_clear_system_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
336 where
337 T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
338 {
339 self.system_addons_config = v.map(|x| x.into());
340 self
341 }
342
343 pub fn set_external_load_balancer_ipv4_address_pools<T, V>(mut self, v: T) -> Self
345 where
346 T: std::iter::IntoIterator<Item = V>,
347 V: std::convert::Into<std::string::String>,
348 {
349 use std::iter::Iterator;
350 self.external_load_balancer_ipv4_address_pools = v.into_iter().map(|i| i.into()).collect();
351 self
352 }
353
354 pub fn set_control_plane_encryption<T>(mut self, v: T) -> Self
356 where
357 T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
358 {
359 self.control_plane_encryption = std::option::Option::Some(v.into());
360 self
361 }
362
363 pub fn set_or_clear_control_plane_encryption<T>(mut self, v: std::option::Option<T>) -> Self
365 where
366 T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
367 {
368 self.control_plane_encryption = v.map(|x| x.into());
369 self
370 }
371
372 pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
374 mut self,
375 v: T,
376 ) -> Self {
377 self.status = v.into();
378 self
379 }
380
381 pub fn set_maintenance_events<T, V>(mut self, v: T) -> Self
383 where
384 T: std::iter::IntoIterator<Item = V>,
385 V: std::convert::Into<crate::model::cluster::MaintenanceEvent>,
386 {
387 use std::iter::Iterator;
388 self.maintenance_events = v.into_iter().map(|i| i.into()).collect();
389 self
390 }
391
392 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
394 self.target_version = v.into();
395 self
396 }
397
398 pub fn set_release_channel<T: std::convert::Into<crate::model::cluster::ReleaseChannel>>(
400 mut self,
401 v: T,
402 ) -> Self {
403 self.release_channel = v.into();
404 self
405 }
406
407 pub fn set_survivability_config<T>(mut self, v: T) -> Self
409 where
410 T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
411 {
412 self.survivability_config = std::option::Option::Some(v.into());
413 self
414 }
415
416 pub fn set_or_clear_survivability_config<T>(mut self, v: std::option::Option<T>) -> Self
418 where
419 T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
420 {
421 self.survivability_config = v.map(|x| x.into());
422 self
423 }
424
425 pub fn set_external_load_balancer_ipv6_address_pools<T, V>(mut self, v: T) -> Self
427 where
428 T: std::iter::IntoIterator<Item = V>,
429 V: std::convert::Into<std::string::String>,
430 {
431 use std::iter::Iterator;
432 self.external_load_balancer_ipv6_address_pools = v.into_iter().map(|i| i.into()).collect();
433 self
434 }
435
436 pub fn set_connection_state<T>(mut self, v: T) -> Self
438 where
439 T: std::convert::Into<crate::model::cluster::ConnectionState>,
440 {
441 self.connection_state = std::option::Option::Some(v.into());
442 self
443 }
444
445 pub fn set_or_clear_connection_state<T>(mut self, v: std::option::Option<T>) -> Self
447 where
448 T: std::convert::Into<crate::model::cluster::ConnectionState>,
449 {
450 self.connection_state = v.map(|x| x.into());
451 self
452 }
453}
454
455impl wkt::message::Message for Cluster {
456 fn typename() -> &'static str {
457 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster"
458 }
459}
460
461pub mod cluster {
463 #[allow(unused_imports)]
464 use super::*;
465
466 #[derive(Clone, Default, PartialEq)]
468 #[non_exhaustive]
469 pub struct ControlPlane {
470 pub config: std::option::Option<crate::model::cluster::control_plane::Config>,
471
472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
473 }
474
475 impl ControlPlane {
476 pub fn new() -> Self {
477 std::default::Default::default()
478 }
479
480 pub fn set_config<
485 T: std::convert::Into<std::option::Option<crate::model::cluster::control_plane::Config>>,
486 >(
487 mut self,
488 v: T,
489 ) -> Self {
490 self.config = v.into();
491 self
492 }
493
494 pub fn remote(
498 &self,
499 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Remote>>
500 {
501 #[allow(unreachable_patterns)]
502 self.config.as_ref().and_then(|v| match v {
503 crate::model::cluster::control_plane::Config::Remote(v) => {
504 std::option::Option::Some(v)
505 }
506 _ => std::option::Option::None,
507 })
508 }
509
510 pub fn set_remote<
516 T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Remote>>,
517 >(
518 mut self,
519 v: T,
520 ) -> Self {
521 self.config = std::option::Option::Some(
522 crate::model::cluster::control_plane::Config::Remote(v.into()),
523 );
524 self
525 }
526
527 pub fn local(
531 &self,
532 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Local>>
533 {
534 #[allow(unreachable_patterns)]
535 self.config.as_ref().and_then(|v| match v {
536 crate::model::cluster::control_plane::Config::Local(v) => {
537 std::option::Option::Some(v)
538 }
539 _ => std::option::Option::None,
540 })
541 }
542
543 pub fn set_local<
549 T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Local>>,
550 >(
551 mut self,
552 v: T,
553 ) -> Self {
554 self.config = std::option::Option::Some(
555 crate::model::cluster::control_plane::Config::Local(v.into()),
556 );
557 self
558 }
559 }
560
561 impl wkt::message::Message for ControlPlane {
562 fn typename() -> &'static str {
563 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane"
564 }
565 }
566
567 pub mod control_plane {
569 #[allow(unused_imports)]
570 use super::*;
571
572 #[derive(Clone, Default, PartialEq)]
574 #[non_exhaustive]
575 pub struct Remote {
576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
577 }
578
579 impl Remote {
580 pub fn new() -> Self {
581 std::default::Default::default()
582 }
583 }
584
585 impl wkt::message::Message for Remote {
586 fn typename() -> &'static str {
587 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Remote"
588 }
589 }
590
591 #[derive(Clone, Default, PartialEq)]
599 #[non_exhaustive]
600 pub struct Local {
601 pub node_location: std::string::String,
604
605 pub node_count: i32,
607
608 pub machine_filter: std::string::String,
612
613 pub shared_deployment_policy:
615 crate::model::cluster::control_plane::SharedDeploymentPolicy,
616
617 pub control_plane_node_storage_schema: std::string::String,
623
624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
625 }
626
627 impl Local {
628 pub fn new() -> Self {
629 std::default::Default::default()
630 }
631
632 pub fn set_node_location<T: std::convert::Into<std::string::String>>(
634 mut self,
635 v: T,
636 ) -> Self {
637 self.node_location = v.into();
638 self
639 }
640
641 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
643 self.node_count = v.into();
644 self
645 }
646
647 pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(
649 mut self,
650 v: T,
651 ) -> Self {
652 self.machine_filter = v.into();
653 self
654 }
655
656 pub fn set_shared_deployment_policy<
658 T: std::convert::Into<crate::model::cluster::control_plane::SharedDeploymentPolicy>,
659 >(
660 mut self,
661 v: T,
662 ) -> Self {
663 self.shared_deployment_policy = v.into();
664 self
665 }
666
667 pub fn set_control_plane_node_storage_schema<
669 T: std::convert::Into<std::string::String>,
670 >(
671 mut self,
672 v: T,
673 ) -> Self {
674 self.control_plane_node_storage_schema = v.into();
675 self
676 }
677 }
678
679 impl wkt::message::Message for Local {
680 fn typename() -> &'static str {
681 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Local"
682 }
683 }
684
685 #[derive(Clone, Debug, PartialEq)]
702 #[non_exhaustive]
703 pub enum SharedDeploymentPolicy {
704 Unspecified,
706 Allowed,
709 Disallowed,
712 UnknownValue(shared_deployment_policy::UnknownValue),
717 }
718
719 #[doc(hidden)]
720 pub mod shared_deployment_policy {
721 #[allow(unused_imports)]
722 use super::*;
723 #[derive(Clone, Debug, PartialEq)]
724 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
725 }
726
727 impl SharedDeploymentPolicy {
728 pub fn value(&self) -> std::option::Option<i32> {
733 match self {
734 Self::Unspecified => std::option::Option::Some(0),
735 Self::Allowed => std::option::Option::Some(1),
736 Self::Disallowed => std::option::Option::Some(2),
737 Self::UnknownValue(u) => u.0.value(),
738 }
739 }
740
741 pub fn name(&self) -> std::option::Option<&str> {
746 match self {
747 Self::Unspecified => {
748 std::option::Option::Some("SHARED_DEPLOYMENT_POLICY_UNSPECIFIED")
749 }
750 Self::Allowed => std::option::Option::Some("ALLOWED"),
751 Self::Disallowed => std::option::Option::Some("DISALLOWED"),
752 Self::UnknownValue(u) => u.0.name(),
753 }
754 }
755 }
756
757 impl std::default::Default for SharedDeploymentPolicy {
758 fn default() -> Self {
759 use std::convert::From;
760 Self::from(0)
761 }
762 }
763
764 impl std::fmt::Display for SharedDeploymentPolicy {
765 fn fmt(
766 &self,
767 f: &mut std::fmt::Formatter<'_>,
768 ) -> std::result::Result<(), std::fmt::Error> {
769 wkt::internal::display_enum(f, self.name(), self.value())
770 }
771 }
772
773 impl std::convert::From<i32> for SharedDeploymentPolicy {
774 fn from(value: i32) -> Self {
775 match value {
776 0 => Self::Unspecified,
777 1 => Self::Allowed,
778 2 => Self::Disallowed,
779 _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
780 wkt::internal::UnknownEnumValue::Integer(value),
781 )),
782 }
783 }
784 }
785
786 impl std::convert::From<&str> for SharedDeploymentPolicy {
787 fn from(value: &str) -> Self {
788 use std::string::ToString;
789 match value {
790 "SHARED_DEPLOYMENT_POLICY_UNSPECIFIED" => Self::Unspecified,
791 "ALLOWED" => Self::Allowed,
792 "DISALLOWED" => Self::Disallowed,
793 _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
794 wkt::internal::UnknownEnumValue::String(value.to_string()),
795 )),
796 }
797 }
798 }
799
800 impl serde::ser::Serialize for SharedDeploymentPolicy {
801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
802 where
803 S: serde::Serializer,
804 {
805 match self {
806 Self::Unspecified => serializer.serialize_i32(0),
807 Self::Allowed => serializer.serialize_i32(1),
808 Self::Disallowed => serializer.serialize_i32(2),
809 Self::UnknownValue(u) => u.0.serialize(serializer),
810 }
811 }
812 }
813
814 impl<'de> serde::de::Deserialize<'de> for SharedDeploymentPolicy {
815 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
816 where
817 D: serde::Deserializer<'de>,
818 {
819 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedDeploymentPolicy>::new(
820 ".google.cloud.edgecontainer.v1.Cluster.ControlPlane.SharedDeploymentPolicy"))
821 }
822 }
823
824 #[derive(Clone, Debug, PartialEq)]
825 #[non_exhaustive]
826 pub enum Config {
827 Remote(std::boxed::Box<crate::model::cluster::control_plane::Remote>),
829 Local(std::boxed::Box<crate::model::cluster::control_plane::Local>),
837 }
838 }
839
840 #[derive(Clone, Default, PartialEq)]
842 #[non_exhaustive]
843 pub struct SystemAddonsConfig {
844 pub ingress: std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
846
847 pub vm_service_config:
849 std::option::Option<crate::model::cluster::system_addons_config::VMServiceConfig>,
850
851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
852 }
853
854 impl SystemAddonsConfig {
855 pub fn new() -> Self {
856 std::default::Default::default()
857 }
858
859 pub fn set_ingress<T>(mut self, v: T) -> Self
861 where
862 T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
863 {
864 self.ingress = std::option::Option::Some(v.into());
865 self
866 }
867
868 pub fn set_or_clear_ingress<T>(mut self, v: std::option::Option<T>) -> Self
870 where
871 T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
872 {
873 self.ingress = v.map(|x| x.into());
874 self
875 }
876
877 pub fn set_vm_service_config<T>(mut self, v: T) -> Self
879 where
880 T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
881 {
882 self.vm_service_config = std::option::Option::Some(v.into());
883 self
884 }
885
886 pub fn set_or_clear_vm_service_config<T>(mut self, v: std::option::Option<T>) -> Self
888 where
889 T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
890 {
891 self.vm_service_config = v.map(|x| x.into());
892 self
893 }
894 }
895
896 impl wkt::message::Message for SystemAddonsConfig {
897 fn typename() -> &'static str {
898 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig"
899 }
900 }
901
902 pub mod system_addons_config {
904 #[allow(unused_imports)]
905 use super::*;
906
907 #[derive(Clone, Default, PartialEq)]
911 #[non_exhaustive]
912 pub struct Ingress {
913 pub disabled: bool,
915
916 pub ipv4_vip: std::string::String,
918
919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
920 }
921
922 impl Ingress {
923 pub fn new() -> Self {
924 std::default::Default::default()
925 }
926
927 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
929 self.disabled = v.into();
930 self
931 }
932
933 pub fn set_ipv4_vip<T: std::convert::Into<std::string::String>>(
935 mut self,
936 v: T,
937 ) -> Self {
938 self.ipv4_vip = v.into();
939 self
940 }
941 }
942
943 impl wkt::message::Message for Ingress {
944 fn typename() -> &'static str {
945 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.Ingress"
946 }
947 }
948
949 #[derive(Clone, Default, PartialEq)]
951 #[non_exhaustive]
952 pub struct VMServiceConfig {
953 pub vmm_enabled: bool,
955
956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
957 }
958
959 impl VMServiceConfig {
960 pub fn new() -> Self {
961 std::default::Default::default()
962 }
963
964 pub fn set_vmm_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
966 self.vmm_enabled = v.into();
967 self
968 }
969 }
970
971 impl wkt::message::Message for VMServiceConfig {
972 fn typename() -> &'static str {
973 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.VMServiceConfig"
974 }
975 }
976 }
977
978 #[derive(Clone, Default, PartialEq)]
980 #[non_exhaustive]
981 pub struct ControlPlaneEncryption {
982 pub kms_key: std::string::String,
987
988 pub kms_key_active_version: std::string::String,
991
992 pub kms_key_state: crate::model::KmsKeyState,
997
998 pub kms_status: std::option::Option<rpc::model::Status>,
1003
1004 pub resource_state: crate::model::ResourceState,
1006
1007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1008 }
1009
1010 impl ControlPlaneEncryption {
1011 pub fn new() -> Self {
1012 std::default::Default::default()
1013 }
1014
1015 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.kms_key = v.into();
1018 self
1019 }
1020
1021 pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
1023 mut self,
1024 v: T,
1025 ) -> Self {
1026 self.kms_key_active_version = v.into();
1027 self
1028 }
1029
1030 pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
1032 mut self,
1033 v: T,
1034 ) -> Self {
1035 self.kms_key_state = v.into();
1036 self
1037 }
1038
1039 pub fn set_kms_status<T>(mut self, v: T) -> Self
1041 where
1042 T: std::convert::Into<rpc::model::Status>,
1043 {
1044 self.kms_status = std::option::Option::Some(v.into());
1045 self
1046 }
1047
1048 pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
1050 where
1051 T: std::convert::Into<rpc::model::Status>,
1052 {
1053 self.kms_status = v.map(|x| x.into());
1054 self
1055 }
1056
1057 pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
1059 mut self,
1060 v: T,
1061 ) -> Self {
1062 self.resource_state = v.into();
1063 self
1064 }
1065 }
1066
1067 impl wkt::message::Message for ControlPlaneEncryption {
1068 fn typename() -> &'static str {
1069 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlaneEncryption"
1070 }
1071 }
1072
1073 #[derive(Clone, Default, PartialEq)]
1078 #[non_exhaustive]
1079 pub struct MaintenanceEvent {
1080 pub uuid: std::string::String,
1082
1083 pub target_version: std::string::String,
1085
1086 pub operation: std::string::String,
1091
1092 pub r#type: crate::model::cluster::maintenance_event::Type,
1094
1095 pub schedule: crate::model::cluster::maintenance_event::Schedule,
1097
1098 pub state: crate::model::cluster::maintenance_event::State,
1100
1101 pub create_time: std::option::Option<wkt::Timestamp>,
1103
1104 pub start_time: std::option::Option<wkt::Timestamp>,
1106
1107 pub end_time: std::option::Option<wkt::Timestamp>,
1111
1112 pub update_time: std::option::Option<wkt::Timestamp>,
1114
1115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1116 }
1117
1118 impl MaintenanceEvent {
1119 pub fn new() -> Self {
1120 std::default::Default::default()
1121 }
1122
1123 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1125 self.uuid = v.into();
1126 self
1127 }
1128
1129 pub fn set_target_version<T: std::convert::Into<std::string::String>>(
1131 mut self,
1132 v: T,
1133 ) -> Self {
1134 self.target_version = v.into();
1135 self
1136 }
1137
1138 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1140 self.operation = v.into();
1141 self
1142 }
1143
1144 pub fn set_type<T: std::convert::Into<crate::model::cluster::maintenance_event::Type>>(
1146 mut self,
1147 v: T,
1148 ) -> Self {
1149 self.r#type = v.into();
1150 self
1151 }
1152
1153 pub fn set_schedule<
1155 T: std::convert::Into<crate::model::cluster::maintenance_event::Schedule>,
1156 >(
1157 mut self,
1158 v: T,
1159 ) -> Self {
1160 self.schedule = v.into();
1161 self
1162 }
1163
1164 pub fn set_state<T: std::convert::Into<crate::model::cluster::maintenance_event::State>>(
1166 mut self,
1167 v: T,
1168 ) -> Self {
1169 self.state = v.into();
1170 self
1171 }
1172
1173 pub fn set_create_time<T>(mut self, v: T) -> Self
1175 where
1176 T: std::convert::Into<wkt::Timestamp>,
1177 {
1178 self.create_time = std::option::Option::Some(v.into());
1179 self
1180 }
1181
1182 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1184 where
1185 T: std::convert::Into<wkt::Timestamp>,
1186 {
1187 self.create_time = v.map(|x| x.into());
1188 self
1189 }
1190
1191 pub fn set_start_time<T>(mut self, v: T) -> Self
1193 where
1194 T: std::convert::Into<wkt::Timestamp>,
1195 {
1196 self.start_time = std::option::Option::Some(v.into());
1197 self
1198 }
1199
1200 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1202 where
1203 T: std::convert::Into<wkt::Timestamp>,
1204 {
1205 self.start_time = v.map(|x| x.into());
1206 self
1207 }
1208
1209 pub fn set_end_time<T>(mut self, v: T) -> Self
1211 where
1212 T: std::convert::Into<wkt::Timestamp>,
1213 {
1214 self.end_time = std::option::Option::Some(v.into());
1215 self
1216 }
1217
1218 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1220 where
1221 T: std::convert::Into<wkt::Timestamp>,
1222 {
1223 self.end_time = v.map(|x| x.into());
1224 self
1225 }
1226
1227 pub fn set_update_time<T>(mut self, v: T) -> Self
1229 where
1230 T: std::convert::Into<wkt::Timestamp>,
1231 {
1232 self.update_time = std::option::Option::Some(v.into());
1233 self
1234 }
1235
1236 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1238 where
1239 T: std::convert::Into<wkt::Timestamp>,
1240 {
1241 self.update_time = v.map(|x| x.into());
1242 self
1243 }
1244 }
1245
1246 impl wkt::message::Message for MaintenanceEvent {
1247 fn typename() -> &'static str {
1248 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent"
1249 }
1250 }
1251
1252 pub mod maintenance_event {
1254 #[allow(unused_imports)]
1255 use super::*;
1256
1257 #[derive(Clone, Debug, PartialEq)]
1273 #[non_exhaustive]
1274 pub enum Type {
1275 Unspecified,
1277 UserInitiatedUpgrade,
1279 GoogleDrivenUpgrade,
1281 UnknownValue(r#type::UnknownValue),
1286 }
1287
1288 #[doc(hidden)]
1289 pub mod r#type {
1290 #[allow(unused_imports)]
1291 use super::*;
1292 #[derive(Clone, Debug, PartialEq)]
1293 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1294 }
1295
1296 impl Type {
1297 pub fn value(&self) -> std::option::Option<i32> {
1302 match self {
1303 Self::Unspecified => std::option::Option::Some(0),
1304 Self::UserInitiatedUpgrade => std::option::Option::Some(1),
1305 Self::GoogleDrivenUpgrade => std::option::Option::Some(2),
1306 Self::UnknownValue(u) => u.0.value(),
1307 }
1308 }
1309
1310 pub fn name(&self) -> std::option::Option<&str> {
1315 match self {
1316 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1317 Self::UserInitiatedUpgrade => {
1318 std::option::Option::Some("USER_INITIATED_UPGRADE")
1319 }
1320 Self::GoogleDrivenUpgrade => std::option::Option::Some("GOOGLE_DRIVEN_UPGRADE"),
1321 Self::UnknownValue(u) => u.0.name(),
1322 }
1323 }
1324 }
1325
1326 impl std::default::Default for Type {
1327 fn default() -> Self {
1328 use std::convert::From;
1329 Self::from(0)
1330 }
1331 }
1332
1333 impl std::fmt::Display for Type {
1334 fn fmt(
1335 &self,
1336 f: &mut std::fmt::Formatter<'_>,
1337 ) -> std::result::Result<(), std::fmt::Error> {
1338 wkt::internal::display_enum(f, self.name(), self.value())
1339 }
1340 }
1341
1342 impl std::convert::From<i32> for Type {
1343 fn from(value: i32) -> Self {
1344 match value {
1345 0 => Self::Unspecified,
1346 1 => Self::UserInitiatedUpgrade,
1347 2 => Self::GoogleDrivenUpgrade,
1348 _ => Self::UnknownValue(r#type::UnknownValue(
1349 wkt::internal::UnknownEnumValue::Integer(value),
1350 )),
1351 }
1352 }
1353 }
1354
1355 impl std::convert::From<&str> for Type {
1356 fn from(value: &str) -> Self {
1357 use std::string::ToString;
1358 match value {
1359 "TYPE_UNSPECIFIED" => Self::Unspecified,
1360 "USER_INITIATED_UPGRADE" => Self::UserInitiatedUpgrade,
1361 "GOOGLE_DRIVEN_UPGRADE" => Self::GoogleDrivenUpgrade,
1362 _ => Self::UnknownValue(r#type::UnknownValue(
1363 wkt::internal::UnknownEnumValue::String(value.to_string()),
1364 )),
1365 }
1366 }
1367 }
1368
1369 impl serde::ser::Serialize for Type {
1370 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1371 where
1372 S: serde::Serializer,
1373 {
1374 match self {
1375 Self::Unspecified => serializer.serialize_i32(0),
1376 Self::UserInitiatedUpgrade => serializer.serialize_i32(1),
1377 Self::GoogleDrivenUpgrade => serializer.serialize_i32(2),
1378 Self::UnknownValue(u) => u.0.serialize(serializer),
1379 }
1380 }
1381 }
1382
1383 impl<'de> serde::de::Deserialize<'de> for Type {
1384 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1385 where
1386 D: serde::Deserializer<'de>,
1387 {
1388 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1389 ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Type",
1390 ))
1391 }
1392 }
1393
1394 #[derive(Clone, Debug, PartialEq)]
1410 #[non_exhaustive]
1411 pub enum Schedule {
1412 Unspecified,
1414 Immediately,
1416 UnknownValue(schedule::UnknownValue),
1421 }
1422
1423 #[doc(hidden)]
1424 pub mod schedule {
1425 #[allow(unused_imports)]
1426 use super::*;
1427 #[derive(Clone, Debug, PartialEq)]
1428 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1429 }
1430
1431 impl Schedule {
1432 pub fn value(&self) -> std::option::Option<i32> {
1437 match self {
1438 Self::Unspecified => std::option::Option::Some(0),
1439 Self::Immediately => std::option::Option::Some(1),
1440 Self::UnknownValue(u) => u.0.value(),
1441 }
1442 }
1443
1444 pub fn name(&self) -> std::option::Option<&str> {
1449 match self {
1450 Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
1451 Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
1452 Self::UnknownValue(u) => u.0.name(),
1453 }
1454 }
1455 }
1456
1457 impl std::default::Default for Schedule {
1458 fn default() -> Self {
1459 use std::convert::From;
1460 Self::from(0)
1461 }
1462 }
1463
1464 impl std::fmt::Display for Schedule {
1465 fn fmt(
1466 &self,
1467 f: &mut std::fmt::Formatter<'_>,
1468 ) -> std::result::Result<(), std::fmt::Error> {
1469 wkt::internal::display_enum(f, self.name(), self.value())
1470 }
1471 }
1472
1473 impl std::convert::From<i32> for Schedule {
1474 fn from(value: i32) -> Self {
1475 match value {
1476 0 => Self::Unspecified,
1477 1 => Self::Immediately,
1478 _ => Self::UnknownValue(schedule::UnknownValue(
1479 wkt::internal::UnknownEnumValue::Integer(value),
1480 )),
1481 }
1482 }
1483 }
1484
1485 impl std::convert::From<&str> for Schedule {
1486 fn from(value: &str) -> Self {
1487 use std::string::ToString;
1488 match value {
1489 "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
1490 "IMMEDIATELY" => Self::Immediately,
1491 _ => Self::UnknownValue(schedule::UnknownValue(
1492 wkt::internal::UnknownEnumValue::String(value.to_string()),
1493 )),
1494 }
1495 }
1496 }
1497
1498 impl serde::ser::Serialize for Schedule {
1499 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1500 where
1501 S: serde::Serializer,
1502 {
1503 match self {
1504 Self::Unspecified => serializer.serialize_i32(0),
1505 Self::Immediately => serializer.serialize_i32(1),
1506 Self::UnknownValue(u) => u.0.serialize(serializer),
1507 }
1508 }
1509 }
1510
1511 impl<'de> serde::de::Deserialize<'de> for Schedule {
1512 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1513 where
1514 D: serde::Deserializer<'de>,
1515 {
1516 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
1517 ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Schedule",
1518 ))
1519 }
1520 }
1521
1522 #[derive(Clone, Debug, PartialEq)]
1538 #[non_exhaustive]
1539 pub enum State {
1540 Unspecified,
1542 Reconciling,
1544 Succeeded,
1546 Failed,
1548 UnknownValue(state::UnknownValue),
1553 }
1554
1555 #[doc(hidden)]
1556 pub mod state {
1557 #[allow(unused_imports)]
1558 use super::*;
1559 #[derive(Clone, Debug, PartialEq)]
1560 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1561 }
1562
1563 impl State {
1564 pub fn value(&self) -> std::option::Option<i32> {
1569 match self {
1570 Self::Unspecified => std::option::Option::Some(0),
1571 Self::Reconciling => std::option::Option::Some(1),
1572 Self::Succeeded => std::option::Option::Some(2),
1573 Self::Failed => std::option::Option::Some(3),
1574 Self::UnknownValue(u) => u.0.value(),
1575 }
1576 }
1577
1578 pub fn name(&self) -> std::option::Option<&str> {
1583 match self {
1584 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1585 Self::Reconciling => std::option::Option::Some("RECONCILING"),
1586 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1587 Self::Failed => std::option::Option::Some("FAILED"),
1588 Self::UnknownValue(u) => u.0.name(),
1589 }
1590 }
1591 }
1592
1593 impl std::default::Default for State {
1594 fn default() -> Self {
1595 use std::convert::From;
1596 Self::from(0)
1597 }
1598 }
1599
1600 impl std::fmt::Display for State {
1601 fn fmt(
1602 &self,
1603 f: &mut std::fmt::Formatter<'_>,
1604 ) -> std::result::Result<(), std::fmt::Error> {
1605 wkt::internal::display_enum(f, self.name(), self.value())
1606 }
1607 }
1608
1609 impl std::convert::From<i32> for State {
1610 fn from(value: i32) -> Self {
1611 match value {
1612 0 => Self::Unspecified,
1613 1 => Self::Reconciling,
1614 2 => Self::Succeeded,
1615 3 => Self::Failed,
1616 _ => Self::UnknownValue(state::UnknownValue(
1617 wkt::internal::UnknownEnumValue::Integer(value),
1618 )),
1619 }
1620 }
1621 }
1622
1623 impl std::convert::From<&str> for State {
1624 fn from(value: &str) -> Self {
1625 use std::string::ToString;
1626 match value {
1627 "STATE_UNSPECIFIED" => Self::Unspecified,
1628 "RECONCILING" => Self::Reconciling,
1629 "SUCCEEDED" => Self::Succeeded,
1630 "FAILED" => Self::Failed,
1631 _ => Self::UnknownValue(state::UnknownValue(
1632 wkt::internal::UnknownEnumValue::String(value.to_string()),
1633 )),
1634 }
1635 }
1636 }
1637
1638 impl serde::ser::Serialize for State {
1639 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1640 where
1641 S: serde::Serializer,
1642 {
1643 match self {
1644 Self::Unspecified => serializer.serialize_i32(0),
1645 Self::Reconciling => serializer.serialize_i32(1),
1646 Self::Succeeded => serializer.serialize_i32(2),
1647 Self::Failed => serializer.serialize_i32(3),
1648 Self::UnknownValue(u) => u.0.serialize(serializer),
1649 }
1650 }
1651 }
1652
1653 impl<'de> serde::de::Deserialize<'de> for State {
1654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1655 where
1656 D: serde::Deserializer<'de>,
1657 {
1658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1659 ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.State",
1660 ))
1661 }
1662 }
1663 }
1664
1665 #[derive(Clone, Default, PartialEq)]
1668 #[non_exhaustive]
1669 pub struct SurvivabilityConfig {
1670 pub offline_reboot_ttl: std::option::Option<wkt::Duration>,
1674
1675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1676 }
1677
1678 impl SurvivabilityConfig {
1679 pub fn new() -> Self {
1680 std::default::Default::default()
1681 }
1682
1683 pub fn set_offline_reboot_ttl<T>(mut self, v: T) -> Self
1685 where
1686 T: std::convert::Into<wkt::Duration>,
1687 {
1688 self.offline_reboot_ttl = std::option::Option::Some(v.into());
1689 self
1690 }
1691
1692 pub fn set_or_clear_offline_reboot_ttl<T>(mut self, v: std::option::Option<T>) -> Self
1694 where
1695 T: std::convert::Into<wkt::Duration>,
1696 {
1697 self.offline_reboot_ttl = v.map(|x| x.into());
1698 self
1699 }
1700 }
1701
1702 impl wkt::message::Message for SurvivabilityConfig {
1703 fn typename() -> &'static str {
1704 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SurvivabilityConfig"
1705 }
1706 }
1707
1708 #[derive(Clone, Default, PartialEq)]
1711 #[non_exhaustive]
1712 pub struct ConnectionState {
1713 pub state: crate::model::cluster::connection_state::State,
1715
1716 pub update_time: std::option::Option<wkt::Timestamp>,
1718
1719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1720 }
1721
1722 impl ConnectionState {
1723 pub fn new() -> Self {
1724 std::default::Default::default()
1725 }
1726
1727 pub fn set_state<T: std::convert::Into<crate::model::cluster::connection_state::State>>(
1729 mut self,
1730 v: T,
1731 ) -> Self {
1732 self.state = v.into();
1733 self
1734 }
1735
1736 pub fn set_update_time<T>(mut self, v: T) -> Self
1738 where
1739 T: std::convert::Into<wkt::Timestamp>,
1740 {
1741 self.update_time = std::option::Option::Some(v.into());
1742 self
1743 }
1744
1745 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1747 where
1748 T: std::convert::Into<wkt::Timestamp>,
1749 {
1750 self.update_time = v.map(|x| x.into());
1751 self
1752 }
1753 }
1754
1755 impl wkt::message::Message for ConnectionState {
1756 fn typename() -> &'static str {
1757 "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ConnectionState"
1758 }
1759 }
1760
1761 pub mod connection_state {
1763 #[allow(unused_imports)]
1764 use super::*;
1765
1766 #[derive(Clone, Debug, PartialEq)]
1782 #[non_exhaustive]
1783 pub enum State {
1784 Unspecified,
1786 Disconnected,
1788 Connected,
1790 ConnectedAndSyncing,
1793 UnknownValue(state::UnknownValue),
1798 }
1799
1800 #[doc(hidden)]
1801 pub mod state {
1802 #[allow(unused_imports)]
1803 use super::*;
1804 #[derive(Clone, Debug, PartialEq)]
1805 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1806 }
1807
1808 impl State {
1809 pub fn value(&self) -> std::option::Option<i32> {
1814 match self {
1815 Self::Unspecified => std::option::Option::Some(0),
1816 Self::Disconnected => std::option::Option::Some(1),
1817 Self::Connected => std::option::Option::Some(2),
1818 Self::ConnectedAndSyncing => std::option::Option::Some(3),
1819 Self::UnknownValue(u) => u.0.value(),
1820 }
1821 }
1822
1823 pub fn name(&self) -> std::option::Option<&str> {
1828 match self {
1829 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1830 Self::Disconnected => std::option::Option::Some("DISCONNECTED"),
1831 Self::Connected => std::option::Option::Some("CONNECTED"),
1832 Self::ConnectedAndSyncing => std::option::Option::Some("CONNECTED_AND_SYNCING"),
1833 Self::UnknownValue(u) => u.0.name(),
1834 }
1835 }
1836 }
1837
1838 impl std::default::Default for State {
1839 fn default() -> Self {
1840 use std::convert::From;
1841 Self::from(0)
1842 }
1843 }
1844
1845 impl std::fmt::Display for State {
1846 fn fmt(
1847 &self,
1848 f: &mut std::fmt::Formatter<'_>,
1849 ) -> std::result::Result<(), std::fmt::Error> {
1850 wkt::internal::display_enum(f, self.name(), self.value())
1851 }
1852 }
1853
1854 impl std::convert::From<i32> for State {
1855 fn from(value: i32) -> Self {
1856 match value {
1857 0 => Self::Unspecified,
1858 1 => Self::Disconnected,
1859 2 => Self::Connected,
1860 3 => Self::ConnectedAndSyncing,
1861 _ => Self::UnknownValue(state::UnknownValue(
1862 wkt::internal::UnknownEnumValue::Integer(value),
1863 )),
1864 }
1865 }
1866 }
1867
1868 impl std::convert::From<&str> for State {
1869 fn from(value: &str) -> Self {
1870 use std::string::ToString;
1871 match value {
1872 "STATE_UNSPECIFIED" => Self::Unspecified,
1873 "DISCONNECTED" => Self::Disconnected,
1874 "CONNECTED" => Self::Connected,
1875 "CONNECTED_AND_SYNCING" => Self::ConnectedAndSyncing,
1876 _ => Self::UnknownValue(state::UnknownValue(
1877 wkt::internal::UnknownEnumValue::String(value.to_string()),
1878 )),
1879 }
1880 }
1881 }
1882
1883 impl serde::ser::Serialize for State {
1884 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1885 where
1886 S: serde::Serializer,
1887 {
1888 match self {
1889 Self::Unspecified => serializer.serialize_i32(0),
1890 Self::Disconnected => serializer.serialize_i32(1),
1891 Self::Connected => serializer.serialize_i32(2),
1892 Self::ConnectedAndSyncing => serializer.serialize_i32(3),
1893 Self::UnknownValue(u) => u.0.serialize(serializer),
1894 }
1895 }
1896 }
1897
1898 impl<'de> serde::de::Deserialize<'de> for State {
1899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1900 where
1901 D: serde::Deserializer<'de>,
1902 {
1903 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1904 ".google.cloud.edgecontainer.v1.Cluster.ConnectionState.State",
1905 ))
1906 }
1907 }
1908 }
1909
1910 #[derive(Clone, Debug, PartialEq)]
1926 #[non_exhaustive]
1927 pub enum Status {
1928 Unspecified,
1930 Provisioning,
1932 Running,
1934 Deleting,
1936 Error,
1939 Reconciling,
1941 UnknownValue(status::UnknownValue),
1946 }
1947
1948 #[doc(hidden)]
1949 pub mod status {
1950 #[allow(unused_imports)]
1951 use super::*;
1952 #[derive(Clone, Debug, PartialEq)]
1953 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1954 }
1955
1956 impl Status {
1957 pub fn value(&self) -> std::option::Option<i32> {
1962 match self {
1963 Self::Unspecified => std::option::Option::Some(0),
1964 Self::Provisioning => std::option::Option::Some(1),
1965 Self::Running => std::option::Option::Some(2),
1966 Self::Deleting => std::option::Option::Some(3),
1967 Self::Error => std::option::Option::Some(4),
1968 Self::Reconciling => std::option::Option::Some(5),
1969 Self::UnknownValue(u) => u.0.value(),
1970 }
1971 }
1972
1973 pub fn name(&self) -> std::option::Option<&str> {
1978 match self {
1979 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
1980 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
1981 Self::Running => std::option::Option::Some("RUNNING"),
1982 Self::Deleting => std::option::Option::Some("DELETING"),
1983 Self::Error => std::option::Option::Some("ERROR"),
1984 Self::Reconciling => std::option::Option::Some("RECONCILING"),
1985 Self::UnknownValue(u) => u.0.name(),
1986 }
1987 }
1988 }
1989
1990 impl std::default::Default for Status {
1991 fn default() -> Self {
1992 use std::convert::From;
1993 Self::from(0)
1994 }
1995 }
1996
1997 impl std::fmt::Display for Status {
1998 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1999 wkt::internal::display_enum(f, self.name(), self.value())
2000 }
2001 }
2002
2003 impl std::convert::From<i32> for Status {
2004 fn from(value: i32) -> Self {
2005 match value {
2006 0 => Self::Unspecified,
2007 1 => Self::Provisioning,
2008 2 => Self::Running,
2009 3 => Self::Deleting,
2010 4 => Self::Error,
2011 5 => Self::Reconciling,
2012 _ => Self::UnknownValue(status::UnknownValue(
2013 wkt::internal::UnknownEnumValue::Integer(value),
2014 )),
2015 }
2016 }
2017 }
2018
2019 impl std::convert::From<&str> for Status {
2020 fn from(value: &str) -> Self {
2021 use std::string::ToString;
2022 match value {
2023 "STATUS_UNSPECIFIED" => Self::Unspecified,
2024 "PROVISIONING" => Self::Provisioning,
2025 "RUNNING" => Self::Running,
2026 "DELETING" => Self::Deleting,
2027 "ERROR" => Self::Error,
2028 "RECONCILING" => Self::Reconciling,
2029 _ => Self::UnknownValue(status::UnknownValue(
2030 wkt::internal::UnknownEnumValue::String(value.to_string()),
2031 )),
2032 }
2033 }
2034 }
2035
2036 impl serde::ser::Serialize for Status {
2037 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2038 where
2039 S: serde::Serializer,
2040 {
2041 match self {
2042 Self::Unspecified => serializer.serialize_i32(0),
2043 Self::Provisioning => serializer.serialize_i32(1),
2044 Self::Running => serializer.serialize_i32(2),
2045 Self::Deleting => serializer.serialize_i32(3),
2046 Self::Error => serializer.serialize_i32(4),
2047 Self::Reconciling => serializer.serialize_i32(5),
2048 Self::UnknownValue(u) => u.0.serialize(serializer),
2049 }
2050 }
2051 }
2052
2053 impl<'de> serde::de::Deserialize<'de> for Status {
2054 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2055 where
2056 D: serde::Deserializer<'de>,
2057 {
2058 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
2059 ".google.cloud.edgecontainer.v1.Cluster.Status",
2060 ))
2061 }
2062 }
2063
2064 #[derive(Clone, Debug, PartialEq)]
2080 #[non_exhaustive]
2081 pub enum ReleaseChannel {
2082 Unspecified,
2084 None,
2086 Regular,
2088 UnknownValue(release_channel::UnknownValue),
2093 }
2094
2095 #[doc(hidden)]
2096 pub mod release_channel {
2097 #[allow(unused_imports)]
2098 use super::*;
2099 #[derive(Clone, Debug, PartialEq)]
2100 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2101 }
2102
2103 impl ReleaseChannel {
2104 pub fn value(&self) -> std::option::Option<i32> {
2109 match self {
2110 Self::Unspecified => std::option::Option::Some(0),
2111 Self::None => std::option::Option::Some(1),
2112 Self::Regular => std::option::Option::Some(2),
2113 Self::UnknownValue(u) => u.0.value(),
2114 }
2115 }
2116
2117 pub fn name(&self) -> std::option::Option<&str> {
2122 match self {
2123 Self::Unspecified => std::option::Option::Some("RELEASE_CHANNEL_UNSPECIFIED"),
2124 Self::None => std::option::Option::Some("NONE"),
2125 Self::Regular => std::option::Option::Some("REGULAR"),
2126 Self::UnknownValue(u) => u.0.name(),
2127 }
2128 }
2129 }
2130
2131 impl std::default::Default for ReleaseChannel {
2132 fn default() -> Self {
2133 use std::convert::From;
2134 Self::from(0)
2135 }
2136 }
2137
2138 impl std::fmt::Display for ReleaseChannel {
2139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2140 wkt::internal::display_enum(f, self.name(), self.value())
2141 }
2142 }
2143
2144 impl std::convert::From<i32> for ReleaseChannel {
2145 fn from(value: i32) -> Self {
2146 match value {
2147 0 => Self::Unspecified,
2148 1 => Self::None,
2149 2 => Self::Regular,
2150 _ => Self::UnknownValue(release_channel::UnknownValue(
2151 wkt::internal::UnknownEnumValue::Integer(value),
2152 )),
2153 }
2154 }
2155 }
2156
2157 impl std::convert::From<&str> for ReleaseChannel {
2158 fn from(value: &str) -> Self {
2159 use std::string::ToString;
2160 match value {
2161 "RELEASE_CHANNEL_UNSPECIFIED" => Self::Unspecified,
2162 "NONE" => Self::None,
2163 "REGULAR" => Self::Regular,
2164 _ => Self::UnknownValue(release_channel::UnknownValue(
2165 wkt::internal::UnknownEnumValue::String(value.to_string()),
2166 )),
2167 }
2168 }
2169 }
2170
2171 impl serde::ser::Serialize for ReleaseChannel {
2172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2173 where
2174 S: serde::Serializer,
2175 {
2176 match self {
2177 Self::Unspecified => serializer.serialize_i32(0),
2178 Self::None => serializer.serialize_i32(1),
2179 Self::Regular => serializer.serialize_i32(2),
2180 Self::UnknownValue(u) => u.0.serialize(serializer),
2181 }
2182 }
2183 }
2184
2185 impl<'de> serde::de::Deserialize<'de> for ReleaseChannel {
2186 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2187 where
2188 D: serde::Deserializer<'de>,
2189 {
2190 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReleaseChannel>::new(
2191 ".google.cloud.edgecontainer.v1.Cluster.ReleaseChannel",
2192 ))
2193 }
2194 }
2195}
2196
2197#[derive(Clone, Default, PartialEq)]
2199#[non_exhaustive]
2200pub struct ClusterNetworking {
2201 pub cluster_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
2205
2206 pub services_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
2210
2211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2212}
2213
2214impl ClusterNetworking {
2215 pub fn new() -> Self {
2216 std::default::Default::default()
2217 }
2218
2219 pub fn set_cluster_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
2221 where
2222 T: std::iter::IntoIterator<Item = V>,
2223 V: std::convert::Into<std::string::String>,
2224 {
2225 use std::iter::Iterator;
2226 self.cluster_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
2227 self
2228 }
2229
2230 pub fn set_services_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
2232 where
2233 T: std::iter::IntoIterator<Item = V>,
2234 V: std::convert::Into<std::string::String>,
2235 {
2236 use std::iter::Iterator;
2237 self.services_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
2238 self
2239 }
2240}
2241
2242impl wkt::message::Message for ClusterNetworking {
2243 fn typename() -> &'static str {
2244 "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterNetworking"
2245 }
2246}
2247
2248#[derive(Clone, Default, PartialEq)]
2254#[non_exhaustive]
2255pub struct Fleet {
2256 pub project: std::string::String,
2262
2263 pub membership: std::string::String,
2269
2270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2271}
2272
2273impl Fleet {
2274 pub fn new() -> Self {
2275 std::default::Default::default()
2276 }
2277
2278 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.project = v.into();
2281 self
2282 }
2283
2284 pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2286 self.membership = v.into();
2287 self
2288 }
2289}
2290
2291impl wkt::message::Message for Fleet {
2292 fn typename() -> &'static str {
2293 "type.googleapis.com/google.cloud.edgecontainer.v1.Fleet"
2294 }
2295}
2296
2297#[derive(Clone, Default, PartialEq)]
2299#[non_exhaustive]
2300pub struct ClusterUser {
2301 pub username: std::string::String,
2303
2304 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2305}
2306
2307impl ClusterUser {
2308 pub fn new() -> Self {
2309 std::default::Default::default()
2310 }
2311
2312 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2314 self.username = v.into();
2315 self
2316 }
2317}
2318
2319impl wkt::message::Message for ClusterUser {
2320 fn typename() -> &'static str {
2321 "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterUser"
2322 }
2323}
2324
2325#[derive(Clone, Default, PartialEq)]
2327#[non_exhaustive]
2328pub struct Authorization {
2329 pub admin_users: std::option::Option<crate::model::ClusterUser>,
2333
2334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2335}
2336
2337impl Authorization {
2338 pub fn new() -> Self {
2339 std::default::Default::default()
2340 }
2341
2342 pub fn set_admin_users<T>(mut self, v: T) -> Self
2344 where
2345 T: std::convert::Into<crate::model::ClusterUser>,
2346 {
2347 self.admin_users = std::option::Option::Some(v.into());
2348 self
2349 }
2350
2351 pub fn set_or_clear_admin_users<T>(mut self, v: std::option::Option<T>) -> Self
2353 where
2354 T: std::convert::Into<crate::model::ClusterUser>,
2355 {
2356 self.admin_users = v.map(|x| x.into());
2357 self
2358 }
2359}
2360
2361impl wkt::message::Message for Authorization {
2362 fn typename() -> &'static str {
2363 "type.googleapis.com/google.cloud.edgecontainer.v1.Authorization"
2364 }
2365}
2366
2367#[derive(Clone, Default, PartialEq)]
2370#[non_exhaustive]
2371pub struct NodePool {
2372 pub name: std::string::String,
2374
2375 pub create_time: std::option::Option<wkt::Timestamp>,
2377
2378 pub update_time: std::option::Option<wkt::Timestamp>,
2380
2381 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2383
2384 pub node_location: std::string::String,
2387
2388 pub node_count: i32,
2390
2391 pub machine_filter: std::string::String,
2395
2396 pub local_disk_encryption: std::option::Option<crate::model::node_pool::LocalDiskEncryption>,
2399
2400 pub node_version: std::string::String,
2402
2403 pub node_config: std::option::Option<crate::model::node_pool::NodeConfig>,
2405
2406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2407}
2408
2409impl NodePool {
2410 pub fn new() -> Self {
2411 std::default::Default::default()
2412 }
2413
2414 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.name = v.into();
2417 self
2418 }
2419
2420 pub fn set_create_time<T>(mut self, v: T) -> Self
2422 where
2423 T: std::convert::Into<wkt::Timestamp>,
2424 {
2425 self.create_time = std::option::Option::Some(v.into());
2426 self
2427 }
2428
2429 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2431 where
2432 T: std::convert::Into<wkt::Timestamp>,
2433 {
2434 self.create_time = v.map(|x| x.into());
2435 self
2436 }
2437
2438 pub fn set_update_time<T>(mut self, v: T) -> Self
2440 where
2441 T: std::convert::Into<wkt::Timestamp>,
2442 {
2443 self.update_time = std::option::Option::Some(v.into());
2444 self
2445 }
2446
2447 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2449 where
2450 T: std::convert::Into<wkt::Timestamp>,
2451 {
2452 self.update_time = v.map(|x| x.into());
2453 self
2454 }
2455
2456 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2458 where
2459 T: std::iter::IntoIterator<Item = (K, V)>,
2460 K: std::convert::Into<std::string::String>,
2461 V: std::convert::Into<std::string::String>,
2462 {
2463 use std::iter::Iterator;
2464 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2465 self
2466 }
2467
2468 pub fn set_node_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.node_location = v.into();
2471 self
2472 }
2473
2474 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2476 self.node_count = v.into();
2477 self
2478 }
2479
2480 pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2482 self.machine_filter = v.into();
2483 self
2484 }
2485
2486 pub fn set_local_disk_encryption<T>(mut self, v: T) -> Self
2488 where
2489 T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
2490 {
2491 self.local_disk_encryption = std::option::Option::Some(v.into());
2492 self
2493 }
2494
2495 pub fn set_or_clear_local_disk_encryption<T>(mut self, v: std::option::Option<T>) -> Self
2497 where
2498 T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
2499 {
2500 self.local_disk_encryption = v.map(|x| x.into());
2501 self
2502 }
2503
2504 pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.node_version = v.into();
2507 self
2508 }
2509
2510 pub fn set_node_config<T>(mut self, v: T) -> Self
2512 where
2513 T: std::convert::Into<crate::model::node_pool::NodeConfig>,
2514 {
2515 self.node_config = std::option::Option::Some(v.into());
2516 self
2517 }
2518
2519 pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
2521 where
2522 T: std::convert::Into<crate::model::node_pool::NodeConfig>,
2523 {
2524 self.node_config = v.map(|x| x.into());
2525 self
2526 }
2527}
2528
2529impl wkt::message::Message for NodePool {
2530 fn typename() -> &'static str {
2531 "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool"
2532 }
2533}
2534
2535pub mod node_pool {
2537 #[allow(unused_imports)]
2538 use super::*;
2539
2540 #[derive(Clone, Default, PartialEq)]
2542 #[non_exhaustive]
2543 pub struct LocalDiskEncryption {
2544 pub kms_key: std::string::String,
2549
2550 pub kms_key_active_version: std::string::String,
2553
2554 pub kms_key_state: crate::model::KmsKeyState,
2559
2560 pub kms_status: std::option::Option<rpc::model::Status>,
2565
2566 pub resource_state: crate::model::ResourceState,
2568
2569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2570 }
2571
2572 impl LocalDiskEncryption {
2573 pub fn new() -> Self {
2574 std::default::Default::default()
2575 }
2576
2577 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2579 self.kms_key = v.into();
2580 self
2581 }
2582
2583 pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
2585 mut self,
2586 v: T,
2587 ) -> Self {
2588 self.kms_key_active_version = v.into();
2589 self
2590 }
2591
2592 pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
2594 mut self,
2595 v: T,
2596 ) -> Self {
2597 self.kms_key_state = v.into();
2598 self
2599 }
2600
2601 pub fn set_kms_status<T>(mut self, v: T) -> Self
2603 where
2604 T: std::convert::Into<rpc::model::Status>,
2605 {
2606 self.kms_status = std::option::Option::Some(v.into());
2607 self
2608 }
2609
2610 pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
2612 where
2613 T: std::convert::Into<rpc::model::Status>,
2614 {
2615 self.kms_status = v.map(|x| x.into());
2616 self
2617 }
2618
2619 pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
2621 mut self,
2622 v: T,
2623 ) -> Self {
2624 self.resource_state = v.into();
2625 self
2626 }
2627 }
2628
2629 impl wkt::message::Message for LocalDiskEncryption {
2630 fn typename() -> &'static str {
2631 "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption"
2632 }
2633 }
2634
2635 #[derive(Clone, Default, PartialEq)]
2637 #[non_exhaustive]
2638 pub struct NodeConfig {
2639 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2641
2642 pub node_storage_schema: std::string::String,
2648
2649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2650 }
2651
2652 impl NodeConfig {
2653 pub fn new() -> Self {
2654 std::default::Default::default()
2655 }
2656
2657 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2659 where
2660 T: std::iter::IntoIterator<Item = (K, V)>,
2661 K: std::convert::Into<std::string::String>,
2662 V: std::convert::Into<std::string::String>,
2663 {
2664 use std::iter::Iterator;
2665 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2666 self
2667 }
2668
2669 pub fn set_node_storage_schema<T: std::convert::Into<std::string::String>>(
2671 mut self,
2672 v: T,
2673 ) -> Self {
2674 self.node_storage_schema = v.into();
2675 self
2676 }
2677 }
2678
2679 impl wkt::message::Message for NodeConfig {
2680 fn typename() -> &'static str {
2681 "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.NodeConfig"
2682 }
2683 }
2684}
2685
2686#[derive(Clone, Default, PartialEq)]
2689#[non_exhaustive]
2690pub struct Machine {
2691 pub name: std::string::String,
2693
2694 pub create_time: std::option::Option<wkt::Timestamp>,
2696
2697 pub update_time: std::option::Option<wkt::Timestamp>,
2699
2700 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2702
2703 pub hosted_node: std::string::String,
2712
2713 pub zone: std::string::String,
2715
2716 pub version: std::string::String,
2718
2719 pub disabled: bool,
2722
2723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2724}
2725
2726impl Machine {
2727 pub fn new() -> Self {
2728 std::default::Default::default()
2729 }
2730
2731 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2733 self.name = v.into();
2734 self
2735 }
2736
2737 pub fn set_create_time<T>(mut self, v: T) -> Self
2739 where
2740 T: std::convert::Into<wkt::Timestamp>,
2741 {
2742 self.create_time = std::option::Option::Some(v.into());
2743 self
2744 }
2745
2746 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2748 where
2749 T: std::convert::Into<wkt::Timestamp>,
2750 {
2751 self.create_time = v.map(|x| x.into());
2752 self
2753 }
2754
2755 pub fn set_update_time<T>(mut self, v: T) -> Self
2757 where
2758 T: std::convert::Into<wkt::Timestamp>,
2759 {
2760 self.update_time = std::option::Option::Some(v.into());
2761 self
2762 }
2763
2764 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2766 where
2767 T: std::convert::Into<wkt::Timestamp>,
2768 {
2769 self.update_time = v.map(|x| x.into());
2770 self
2771 }
2772
2773 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2775 where
2776 T: std::iter::IntoIterator<Item = (K, V)>,
2777 K: std::convert::Into<std::string::String>,
2778 V: std::convert::Into<std::string::String>,
2779 {
2780 use std::iter::Iterator;
2781 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2782 self
2783 }
2784
2785 pub fn set_hosted_node<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787 self.hosted_node = v.into();
2788 self
2789 }
2790
2791 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2793 self.zone = v.into();
2794 self
2795 }
2796
2797 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2799 self.version = v.into();
2800 self
2801 }
2802
2803 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2805 self.disabled = v.into();
2806 self
2807 }
2808}
2809
2810impl wkt::message::Message for Machine {
2811 fn typename() -> &'static str {
2812 "type.googleapis.com/google.cloud.edgecontainer.v1.Machine"
2813 }
2814}
2815
2816#[derive(Clone, Default, PartialEq)]
2818#[non_exhaustive]
2819pub struct VpnConnection {
2820 pub name: std::string::String,
2822
2823 pub create_time: std::option::Option<wkt::Timestamp>,
2825
2826 pub update_time: std::option::Option<wkt::Timestamp>,
2828
2829 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2831
2832 pub nat_gateway_ip: std::string::String,
2836
2837 #[deprecated]
2839 pub bgp_routing_mode: crate::model::vpn_connection::BgpRoutingMode,
2840
2841 pub cluster: std::string::String,
2844
2845 pub vpc: std::string::String,
2847
2848 pub vpc_project: std::option::Option<crate::model::vpn_connection::VpcProject>,
2851
2852 pub enable_high_availability: bool,
2855
2856 pub router: std::string::String,
2858
2859 pub details: std::option::Option<crate::model::vpn_connection::Details>,
2861
2862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2863}
2864
2865impl VpnConnection {
2866 pub fn new() -> Self {
2867 std::default::Default::default()
2868 }
2869
2870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.name = v.into();
2873 self
2874 }
2875
2876 pub fn set_create_time<T>(mut self, v: T) -> Self
2878 where
2879 T: std::convert::Into<wkt::Timestamp>,
2880 {
2881 self.create_time = std::option::Option::Some(v.into());
2882 self
2883 }
2884
2885 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2887 where
2888 T: std::convert::Into<wkt::Timestamp>,
2889 {
2890 self.create_time = v.map(|x| x.into());
2891 self
2892 }
2893
2894 pub fn set_update_time<T>(mut self, v: T) -> Self
2896 where
2897 T: std::convert::Into<wkt::Timestamp>,
2898 {
2899 self.update_time = std::option::Option::Some(v.into());
2900 self
2901 }
2902
2903 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2905 where
2906 T: std::convert::Into<wkt::Timestamp>,
2907 {
2908 self.update_time = v.map(|x| x.into());
2909 self
2910 }
2911
2912 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2914 where
2915 T: std::iter::IntoIterator<Item = (K, V)>,
2916 K: std::convert::Into<std::string::String>,
2917 V: std::convert::Into<std::string::String>,
2918 {
2919 use std::iter::Iterator;
2920 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2921 self
2922 }
2923
2924 pub fn set_nat_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2926 self.nat_gateway_ip = v.into();
2927 self
2928 }
2929
2930 #[deprecated]
2932 pub fn set_bgp_routing_mode<
2933 T: std::convert::Into<crate::model::vpn_connection::BgpRoutingMode>,
2934 >(
2935 mut self,
2936 v: T,
2937 ) -> Self {
2938 self.bgp_routing_mode = v.into();
2939 self
2940 }
2941
2942 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2944 self.cluster = v.into();
2945 self
2946 }
2947
2948 pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2950 self.vpc = v.into();
2951 self
2952 }
2953
2954 pub fn set_vpc_project<T>(mut self, v: T) -> Self
2956 where
2957 T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
2958 {
2959 self.vpc_project = std::option::Option::Some(v.into());
2960 self
2961 }
2962
2963 pub fn set_or_clear_vpc_project<T>(mut self, v: std::option::Option<T>) -> Self
2965 where
2966 T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
2967 {
2968 self.vpc_project = v.map(|x| x.into());
2969 self
2970 }
2971
2972 pub fn set_enable_high_availability<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2974 self.enable_high_availability = v.into();
2975 self
2976 }
2977
2978 pub fn set_router<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2980 self.router = v.into();
2981 self
2982 }
2983
2984 pub fn set_details<T>(mut self, v: T) -> Self
2986 where
2987 T: std::convert::Into<crate::model::vpn_connection::Details>,
2988 {
2989 self.details = std::option::Option::Some(v.into());
2990 self
2991 }
2992
2993 pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
2995 where
2996 T: std::convert::Into<crate::model::vpn_connection::Details>,
2997 {
2998 self.details = v.map(|x| x.into());
2999 self
3000 }
3001}
3002
3003impl wkt::message::Message for VpnConnection {
3004 fn typename() -> &'static str {
3005 "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection"
3006 }
3007}
3008
3009pub mod vpn_connection {
3011 #[allow(unused_imports)]
3012 use super::*;
3013
3014 #[derive(Clone, Default, PartialEq)]
3016 #[non_exhaustive]
3017 pub struct VpcProject {
3018 pub project_id: std::string::String,
3021
3022 #[deprecated]
3024 pub service_account: std::string::String,
3025
3026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3027 }
3028
3029 impl VpcProject {
3030 pub fn new() -> Self {
3031 std::default::Default::default()
3032 }
3033
3034 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3036 self.project_id = v.into();
3037 self
3038 }
3039
3040 #[deprecated]
3042 pub fn set_service_account<T: std::convert::Into<std::string::String>>(
3043 mut self,
3044 v: T,
3045 ) -> Self {
3046 self.service_account = v.into();
3047 self
3048 }
3049 }
3050
3051 impl wkt::message::Message for VpcProject {
3052 fn typename() -> &'static str {
3053 "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.VpcProject"
3054 }
3055 }
3056
3057 #[derive(Clone, Default, PartialEq)]
3059 #[non_exhaustive]
3060 pub struct Details {
3061 pub state: crate::model::vpn_connection::details::State,
3063
3064 pub error: std::string::String,
3066
3067 pub cloud_router: std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
3069
3070 pub cloud_vpns: std::vec::Vec<crate::model::vpn_connection::details::CloudVpn>,
3072
3073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3074 }
3075
3076 impl Details {
3077 pub fn new() -> Self {
3078 std::default::Default::default()
3079 }
3080
3081 pub fn set_state<T: std::convert::Into<crate::model::vpn_connection::details::State>>(
3083 mut self,
3084 v: T,
3085 ) -> Self {
3086 self.state = v.into();
3087 self
3088 }
3089
3090 pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3092 self.error = v.into();
3093 self
3094 }
3095
3096 pub fn set_cloud_router<T>(mut self, v: T) -> Self
3098 where
3099 T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
3100 {
3101 self.cloud_router = std::option::Option::Some(v.into());
3102 self
3103 }
3104
3105 pub fn set_or_clear_cloud_router<T>(mut self, v: std::option::Option<T>) -> Self
3107 where
3108 T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
3109 {
3110 self.cloud_router = v.map(|x| x.into());
3111 self
3112 }
3113
3114 pub fn set_cloud_vpns<T, V>(mut self, v: T) -> Self
3116 where
3117 T: std::iter::IntoIterator<Item = V>,
3118 V: std::convert::Into<crate::model::vpn_connection::details::CloudVpn>,
3119 {
3120 use std::iter::Iterator;
3121 self.cloud_vpns = v.into_iter().map(|i| i.into()).collect();
3122 self
3123 }
3124 }
3125
3126 impl wkt::message::Message for Details {
3127 fn typename() -> &'static str {
3128 "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details"
3129 }
3130 }
3131
3132 pub mod details {
3134 #[allow(unused_imports)]
3135 use super::*;
3136
3137 #[derive(Clone, Default, PartialEq)]
3139 #[non_exhaustive]
3140 pub struct CloudRouter {
3141 pub name: std::string::String,
3143
3144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3145 }
3146
3147 impl CloudRouter {
3148 pub fn new() -> Self {
3149 std::default::Default::default()
3150 }
3151
3152 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3154 self.name = v.into();
3155 self
3156 }
3157 }
3158
3159 impl wkt::message::Message for CloudRouter {
3160 fn typename() -> &'static str {
3161 "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter"
3162 }
3163 }
3164
3165 #[derive(Clone, Default, PartialEq)]
3167 #[non_exhaustive]
3168 pub struct CloudVpn {
3169 pub gateway: std::string::String,
3171
3172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3173 }
3174
3175 impl CloudVpn {
3176 pub fn new() -> Self {
3177 std::default::Default::default()
3178 }
3179
3180 pub fn set_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3182 self.gateway = v.into();
3183 self
3184 }
3185 }
3186
3187 impl wkt::message::Message for CloudVpn {
3188 fn typename() -> &'static str {
3189 "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn"
3190 }
3191 }
3192
3193 #[derive(Clone, Debug, PartialEq)]
3209 #[non_exhaustive]
3210 pub enum State {
3211 Unspecified,
3213 Connected,
3215 Connecting,
3217 Error,
3219 UnknownValue(state::UnknownValue),
3224 }
3225
3226 #[doc(hidden)]
3227 pub mod state {
3228 #[allow(unused_imports)]
3229 use super::*;
3230 #[derive(Clone, Debug, PartialEq)]
3231 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3232 }
3233
3234 impl State {
3235 pub fn value(&self) -> std::option::Option<i32> {
3240 match self {
3241 Self::Unspecified => std::option::Option::Some(0),
3242 Self::Connected => std::option::Option::Some(1),
3243 Self::Connecting => std::option::Option::Some(2),
3244 Self::Error => std::option::Option::Some(3),
3245 Self::UnknownValue(u) => u.0.value(),
3246 }
3247 }
3248
3249 pub fn name(&self) -> std::option::Option<&str> {
3254 match self {
3255 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3256 Self::Connected => std::option::Option::Some("STATE_CONNECTED"),
3257 Self::Connecting => std::option::Option::Some("STATE_CONNECTING"),
3258 Self::Error => std::option::Option::Some("STATE_ERROR"),
3259 Self::UnknownValue(u) => u.0.name(),
3260 }
3261 }
3262 }
3263
3264 impl std::default::Default for State {
3265 fn default() -> Self {
3266 use std::convert::From;
3267 Self::from(0)
3268 }
3269 }
3270
3271 impl std::fmt::Display for State {
3272 fn fmt(
3273 &self,
3274 f: &mut std::fmt::Formatter<'_>,
3275 ) -> std::result::Result<(), std::fmt::Error> {
3276 wkt::internal::display_enum(f, self.name(), self.value())
3277 }
3278 }
3279
3280 impl std::convert::From<i32> for State {
3281 fn from(value: i32) -> Self {
3282 match value {
3283 0 => Self::Unspecified,
3284 1 => Self::Connected,
3285 2 => Self::Connecting,
3286 3 => Self::Error,
3287 _ => Self::UnknownValue(state::UnknownValue(
3288 wkt::internal::UnknownEnumValue::Integer(value),
3289 )),
3290 }
3291 }
3292 }
3293
3294 impl std::convert::From<&str> for State {
3295 fn from(value: &str) -> Self {
3296 use std::string::ToString;
3297 match value {
3298 "STATE_UNSPECIFIED" => Self::Unspecified,
3299 "STATE_CONNECTED" => Self::Connected,
3300 "STATE_CONNECTING" => Self::Connecting,
3301 "STATE_ERROR" => Self::Error,
3302 _ => Self::UnknownValue(state::UnknownValue(
3303 wkt::internal::UnknownEnumValue::String(value.to_string()),
3304 )),
3305 }
3306 }
3307 }
3308
3309 impl serde::ser::Serialize for State {
3310 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3311 where
3312 S: serde::Serializer,
3313 {
3314 match self {
3315 Self::Unspecified => serializer.serialize_i32(0),
3316 Self::Connected => serializer.serialize_i32(1),
3317 Self::Connecting => serializer.serialize_i32(2),
3318 Self::Error => serializer.serialize_i32(3),
3319 Self::UnknownValue(u) => u.0.serialize(serializer),
3320 }
3321 }
3322 }
3323
3324 impl<'de> serde::de::Deserialize<'de> for State {
3325 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3326 where
3327 D: serde::Deserializer<'de>,
3328 {
3329 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3330 ".google.cloud.edgecontainer.v1.VpnConnection.Details.State",
3331 ))
3332 }
3333 }
3334 }
3335
3336 #[derive(Clone, Debug, PartialEq)]
3352 #[non_exhaustive]
3353 pub enum BgpRoutingMode {
3354 Unspecified,
3356 Regional,
3358 Global,
3360 UnknownValue(bgp_routing_mode::UnknownValue),
3365 }
3366
3367 #[doc(hidden)]
3368 pub mod bgp_routing_mode {
3369 #[allow(unused_imports)]
3370 use super::*;
3371 #[derive(Clone, Debug, PartialEq)]
3372 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3373 }
3374
3375 impl BgpRoutingMode {
3376 pub fn value(&self) -> std::option::Option<i32> {
3381 match self {
3382 Self::Unspecified => std::option::Option::Some(0),
3383 Self::Regional => std::option::Option::Some(1),
3384 Self::Global => std::option::Option::Some(2),
3385 Self::UnknownValue(u) => u.0.value(),
3386 }
3387 }
3388
3389 pub fn name(&self) -> std::option::Option<&str> {
3394 match self {
3395 Self::Unspecified => std::option::Option::Some("BGP_ROUTING_MODE_UNSPECIFIED"),
3396 Self::Regional => std::option::Option::Some("REGIONAL"),
3397 Self::Global => std::option::Option::Some("GLOBAL"),
3398 Self::UnknownValue(u) => u.0.name(),
3399 }
3400 }
3401 }
3402
3403 impl std::default::Default for BgpRoutingMode {
3404 fn default() -> Self {
3405 use std::convert::From;
3406 Self::from(0)
3407 }
3408 }
3409
3410 impl std::fmt::Display for BgpRoutingMode {
3411 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3412 wkt::internal::display_enum(f, self.name(), self.value())
3413 }
3414 }
3415
3416 impl std::convert::From<i32> for BgpRoutingMode {
3417 fn from(value: i32) -> Self {
3418 match value {
3419 0 => Self::Unspecified,
3420 1 => Self::Regional,
3421 2 => Self::Global,
3422 _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
3423 wkt::internal::UnknownEnumValue::Integer(value),
3424 )),
3425 }
3426 }
3427 }
3428
3429 impl std::convert::From<&str> for BgpRoutingMode {
3430 fn from(value: &str) -> Self {
3431 use std::string::ToString;
3432 match value {
3433 "BGP_ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
3434 "REGIONAL" => Self::Regional,
3435 "GLOBAL" => Self::Global,
3436 _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
3437 wkt::internal::UnknownEnumValue::String(value.to_string()),
3438 )),
3439 }
3440 }
3441 }
3442
3443 impl serde::ser::Serialize for BgpRoutingMode {
3444 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3445 where
3446 S: serde::Serializer,
3447 {
3448 match self {
3449 Self::Unspecified => serializer.serialize_i32(0),
3450 Self::Regional => serializer.serialize_i32(1),
3451 Self::Global => serializer.serialize_i32(2),
3452 Self::UnknownValue(u) => u.0.serialize(serializer),
3453 }
3454 }
3455 }
3456
3457 impl<'de> serde::de::Deserialize<'de> for BgpRoutingMode {
3458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3459 where
3460 D: serde::Deserializer<'de>,
3461 {
3462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BgpRoutingMode>::new(
3463 ".google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode",
3464 ))
3465 }
3466 }
3467}
3468
3469#[derive(Clone, Default, PartialEq)]
3474#[non_exhaustive]
3475pub struct LocationMetadata {
3476 pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
3479
3480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3481}
3482
3483impl LocationMetadata {
3484 pub fn new() -> Self {
3485 std::default::Default::default()
3486 }
3487
3488 pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
3490 where
3491 T: std::iter::IntoIterator<Item = (K, V)>,
3492 K: std::convert::Into<std::string::String>,
3493 V: std::convert::Into<crate::model::ZoneMetadata>,
3494 {
3495 use std::iter::Iterator;
3496 self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3497 self
3498 }
3499}
3500
3501impl wkt::message::Message for LocationMetadata {
3502 fn typename() -> &'static str {
3503 "type.googleapis.com/google.cloud.edgecontainer.v1.LocationMetadata"
3504 }
3505}
3506
3507#[derive(Clone, Default, PartialEq)]
3509#[non_exhaustive]
3510pub struct ZoneMetadata {
3511 pub quota: std::vec::Vec<crate::model::Quota>,
3513
3514 pub rack_types:
3516 std::collections::HashMap<std::string::String, crate::model::zone_metadata::RackType>,
3517
3518 pub config_data: std::option::Option<crate::model::ConfigData>,
3520
3521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3522}
3523
3524impl ZoneMetadata {
3525 pub fn new() -> Self {
3526 std::default::Default::default()
3527 }
3528
3529 pub fn set_quota<T, V>(mut self, v: T) -> Self
3531 where
3532 T: std::iter::IntoIterator<Item = V>,
3533 V: std::convert::Into<crate::model::Quota>,
3534 {
3535 use std::iter::Iterator;
3536 self.quota = v.into_iter().map(|i| i.into()).collect();
3537 self
3538 }
3539
3540 pub fn set_rack_types<T, K, V>(mut self, v: T) -> Self
3542 where
3543 T: std::iter::IntoIterator<Item = (K, V)>,
3544 K: std::convert::Into<std::string::String>,
3545 V: std::convert::Into<crate::model::zone_metadata::RackType>,
3546 {
3547 use std::iter::Iterator;
3548 self.rack_types = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3549 self
3550 }
3551
3552 pub fn set_config_data<T>(mut self, v: T) -> Self
3554 where
3555 T: std::convert::Into<crate::model::ConfigData>,
3556 {
3557 self.config_data = std::option::Option::Some(v.into());
3558 self
3559 }
3560
3561 pub fn set_or_clear_config_data<T>(mut self, v: std::option::Option<T>) -> Self
3563 where
3564 T: std::convert::Into<crate::model::ConfigData>,
3565 {
3566 self.config_data = v.map(|x| x.into());
3567 self
3568 }
3569}
3570
3571impl wkt::message::Message for ZoneMetadata {
3572 fn typename() -> &'static str {
3573 "type.googleapis.com/google.cloud.edgecontainer.v1.ZoneMetadata"
3574 }
3575}
3576
3577pub mod zone_metadata {
3579 #[allow(unused_imports)]
3580 use super::*;
3581
3582 #[derive(Clone, Debug, PartialEq)]
3598 #[non_exhaustive]
3599 pub enum RackType {
3600 Unspecified,
3602 Base,
3605 Expansion,
3608 UnknownValue(rack_type::UnknownValue),
3613 }
3614
3615 #[doc(hidden)]
3616 pub mod rack_type {
3617 #[allow(unused_imports)]
3618 use super::*;
3619 #[derive(Clone, Debug, PartialEq)]
3620 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3621 }
3622
3623 impl RackType {
3624 pub fn value(&self) -> std::option::Option<i32> {
3629 match self {
3630 Self::Unspecified => std::option::Option::Some(0),
3631 Self::Base => std::option::Option::Some(1),
3632 Self::Expansion => std::option::Option::Some(2),
3633 Self::UnknownValue(u) => u.0.value(),
3634 }
3635 }
3636
3637 pub fn name(&self) -> std::option::Option<&str> {
3642 match self {
3643 Self::Unspecified => std::option::Option::Some("RACK_TYPE_UNSPECIFIED"),
3644 Self::Base => std::option::Option::Some("BASE"),
3645 Self::Expansion => std::option::Option::Some("EXPANSION"),
3646 Self::UnknownValue(u) => u.0.name(),
3647 }
3648 }
3649 }
3650
3651 impl std::default::Default for RackType {
3652 fn default() -> Self {
3653 use std::convert::From;
3654 Self::from(0)
3655 }
3656 }
3657
3658 impl std::fmt::Display for RackType {
3659 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3660 wkt::internal::display_enum(f, self.name(), self.value())
3661 }
3662 }
3663
3664 impl std::convert::From<i32> for RackType {
3665 fn from(value: i32) -> Self {
3666 match value {
3667 0 => Self::Unspecified,
3668 1 => Self::Base,
3669 2 => Self::Expansion,
3670 _ => Self::UnknownValue(rack_type::UnknownValue(
3671 wkt::internal::UnknownEnumValue::Integer(value),
3672 )),
3673 }
3674 }
3675 }
3676
3677 impl std::convert::From<&str> for RackType {
3678 fn from(value: &str) -> Self {
3679 use std::string::ToString;
3680 match value {
3681 "RACK_TYPE_UNSPECIFIED" => Self::Unspecified,
3682 "BASE" => Self::Base,
3683 "EXPANSION" => Self::Expansion,
3684 _ => Self::UnknownValue(rack_type::UnknownValue(
3685 wkt::internal::UnknownEnumValue::String(value.to_string()),
3686 )),
3687 }
3688 }
3689 }
3690
3691 impl serde::ser::Serialize for RackType {
3692 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3693 where
3694 S: serde::Serializer,
3695 {
3696 match self {
3697 Self::Unspecified => serializer.serialize_i32(0),
3698 Self::Base => serializer.serialize_i32(1),
3699 Self::Expansion => serializer.serialize_i32(2),
3700 Self::UnknownValue(u) => u.0.serialize(serializer),
3701 }
3702 }
3703 }
3704
3705 impl<'de> serde::de::Deserialize<'de> for RackType {
3706 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3707 where
3708 D: serde::Deserializer<'de>,
3709 {
3710 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RackType>::new(
3711 ".google.cloud.edgecontainer.v1.ZoneMetadata.RackType",
3712 ))
3713 }
3714 }
3715}
3716
3717#[derive(Clone, Default, PartialEq)]
3719#[non_exhaustive]
3720pub struct ConfigData {
3721 pub available_external_lb_pools_ipv4: std::vec::Vec<std::string::String>,
3723
3724 pub available_external_lb_pools_ipv6: std::vec::Vec<std::string::String>,
3726
3727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3728}
3729
3730impl ConfigData {
3731 pub fn new() -> Self {
3732 std::default::Default::default()
3733 }
3734
3735 pub fn set_available_external_lb_pools_ipv4<T, V>(mut self, v: T) -> Self
3737 where
3738 T: std::iter::IntoIterator<Item = V>,
3739 V: std::convert::Into<std::string::String>,
3740 {
3741 use std::iter::Iterator;
3742 self.available_external_lb_pools_ipv4 = v.into_iter().map(|i| i.into()).collect();
3743 self
3744 }
3745
3746 pub fn set_available_external_lb_pools_ipv6<T, V>(mut self, v: T) -> Self
3748 where
3749 T: std::iter::IntoIterator<Item = V>,
3750 V: std::convert::Into<std::string::String>,
3751 {
3752 use std::iter::Iterator;
3753 self.available_external_lb_pools_ipv6 = v.into_iter().map(|i| i.into()).collect();
3754 self
3755 }
3756}
3757
3758impl wkt::message::Message for ConfigData {
3759 fn typename() -> &'static str {
3760 "type.googleapis.com/google.cloud.edgecontainer.v1.ConfigData"
3761 }
3762}
3763
3764#[derive(Clone, Default, PartialEq)]
3766#[non_exhaustive]
3767pub struct Quota {
3768 pub metric: std::string::String,
3770
3771 pub limit: f64,
3773
3774 pub usage: f64,
3776
3777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3778}
3779
3780impl Quota {
3781 pub fn new() -> Self {
3782 std::default::Default::default()
3783 }
3784
3785 pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3787 self.metric = v.into();
3788 self
3789 }
3790
3791 pub fn set_limit<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3793 self.limit = v.into();
3794 self
3795 }
3796
3797 pub fn set_usage<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3799 self.usage = v.into();
3800 self
3801 }
3802}
3803
3804impl wkt::message::Message for Quota {
3805 fn typename() -> &'static str {
3806 "type.googleapis.com/google.cloud.edgecontainer.v1.Quota"
3807 }
3808}
3809
3810#[derive(Clone, Default, PartialEq)]
3812#[non_exhaustive]
3813pub struct MaintenancePolicy {
3814 pub window: std::option::Option<crate::model::MaintenanceWindow>,
3816
3817 pub maintenance_exclusions: std::vec::Vec<crate::model::MaintenanceExclusionWindow>,
3822
3823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3824}
3825
3826impl MaintenancePolicy {
3827 pub fn new() -> Self {
3828 std::default::Default::default()
3829 }
3830
3831 pub fn set_window<T>(mut self, v: T) -> Self
3833 where
3834 T: std::convert::Into<crate::model::MaintenanceWindow>,
3835 {
3836 self.window = std::option::Option::Some(v.into());
3837 self
3838 }
3839
3840 pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
3842 where
3843 T: std::convert::Into<crate::model::MaintenanceWindow>,
3844 {
3845 self.window = v.map(|x| x.into());
3846 self
3847 }
3848
3849 pub fn set_maintenance_exclusions<T, V>(mut self, v: T) -> Self
3851 where
3852 T: std::iter::IntoIterator<Item = V>,
3853 V: std::convert::Into<crate::model::MaintenanceExclusionWindow>,
3854 {
3855 use std::iter::Iterator;
3856 self.maintenance_exclusions = v.into_iter().map(|i| i.into()).collect();
3857 self
3858 }
3859}
3860
3861impl wkt::message::Message for MaintenancePolicy {
3862 fn typename() -> &'static str {
3863 "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenancePolicy"
3864 }
3865}
3866
3867#[derive(Clone, Default, PartialEq)]
3869#[non_exhaustive]
3870pub struct MaintenanceWindow {
3871 pub recurring_window: std::option::Option<crate::model::RecurringTimeWindow>,
3873
3874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3875}
3876
3877impl MaintenanceWindow {
3878 pub fn new() -> Self {
3879 std::default::Default::default()
3880 }
3881
3882 pub fn set_recurring_window<T>(mut self, v: T) -> Self
3884 where
3885 T: std::convert::Into<crate::model::RecurringTimeWindow>,
3886 {
3887 self.recurring_window = std::option::Option::Some(v.into());
3888 self
3889 }
3890
3891 pub fn set_or_clear_recurring_window<T>(mut self, v: std::option::Option<T>) -> Self
3893 where
3894 T: std::convert::Into<crate::model::RecurringTimeWindow>,
3895 {
3896 self.recurring_window = v.map(|x| x.into());
3897 self
3898 }
3899}
3900
3901impl wkt::message::Message for MaintenanceWindow {
3902 fn typename() -> &'static str {
3903 "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceWindow"
3904 }
3905}
3906
3907#[derive(Clone, Default, PartialEq)]
3909#[non_exhaustive]
3910pub struct RecurringTimeWindow {
3911 pub window: std::option::Option<crate::model::TimeWindow>,
3913
3914 pub recurrence: std::string::String,
3918
3919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3920}
3921
3922impl RecurringTimeWindow {
3923 pub fn new() -> Self {
3924 std::default::Default::default()
3925 }
3926
3927 pub fn set_window<T>(mut self, v: T) -> Self
3929 where
3930 T: std::convert::Into<crate::model::TimeWindow>,
3931 {
3932 self.window = std::option::Option::Some(v.into());
3933 self
3934 }
3935
3936 pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
3938 where
3939 T: std::convert::Into<crate::model::TimeWindow>,
3940 {
3941 self.window = v.map(|x| x.into());
3942 self
3943 }
3944
3945 pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3947 self.recurrence = v.into();
3948 self
3949 }
3950}
3951
3952impl wkt::message::Message for RecurringTimeWindow {
3953 fn typename() -> &'static str {
3954 "type.googleapis.com/google.cloud.edgecontainer.v1.RecurringTimeWindow"
3955 }
3956}
3957
3958#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct MaintenanceExclusionWindow {
3962 pub window: std::option::Option<crate::model::TimeWindow>,
3964
3965 pub id: std::string::String,
3967
3968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3969}
3970
3971impl MaintenanceExclusionWindow {
3972 pub fn new() -> Self {
3973 std::default::Default::default()
3974 }
3975
3976 pub fn set_window<T>(mut self, v: T) -> Self
3978 where
3979 T: std::convert::Into<crate::model::TimeWindow>,
3980 {
3981 self.window = std::option::Option::Some(v.into());
3982 self
3983 }
3984
3985 pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
3987 where
3988 T: std::convert::Into<crate::model::TimeWindow>,
3989 {
3990 self.window = v.map(|x| x.into());
3991 self
3992 }
3993
3994 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.id = v.into();
3997 self
3998 }
3999}
4000
4001impl wkt::message::Message for MaintenanceExclusionWindow {
4002 fn typename() -> &'static str {
4003 "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceExclusionWindow"
4004 }
4005}
4006
4007#[derive(Clone, Default, PartialEq)]
4009#[non_exhaustive]
4010pub struct TimeWindow {
4011 pub start_time: std::option::Option<wkt::Timestamp>,
4013
4014 pub end_time: std::option::Option<wkt::Timestamp>,
4017
4018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4019}
4020
4021impl TimeWindow {
4022 pub fn new() -> Self {
4023 std::default::Default::default()
4024 }
4025
4026 pub fn set_start_time<T>(mut self, v: T) -> Self
4028 where
4029 T: std::convert::Into<wkt::Timestamp>,
4030 {
4031 self.start_time = std::option::Option::Some(v.into());
4032 self
4033 }
4034
4035 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
4037 where
4038 T: std::convert::Into<wkt::Timestamp>,
4039 {
4040 self.start_time = v.map(|x| x.into());
4041 self
4042 }
4043
4044 pub fn set_end_time<T>(mut self, v: T) -> Self
4046 where
4047 T: std::convert::Into<wkt::Timestamp>,
4048 {
4049 self.end_time = std::option::Option::Some(v.into());
4050 self
4051 }
4052
4053 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4055 where
4056 T: std::convert::Into<wkt::Timestamp>,
4057 {
4058 self.end_time = v.map(|x| x.into());
4059 self
4060 }
4061}
4062
4063impl wkt::message::Message for TimeWindow {
4064 fn typename() -> &'static str {
4065 "type.googleapis.com/google.cloud.edgecontainer.v1.TimeWindow"
4066 }
4067}
4068
4069#[derive(Clone, Default, PartialEq)]
4071#[non_exhaustive]
4072pub struct ServerConfig {
4073 pub channels: std::collections::HashMap<std::string::String, crate::model::ChannelConfig>,
4075
4076 pub versions: std::vec::Vec<crate::model::Version>,
4078
4079 pub default_version: std::string::String,
4081
4082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4083}
4084
4085impl ServerConfig {
4086 pub fn new() -> Self {
4087 std::default::Default::default()
4088 }
4089
4090 pub fn set_channels<T, K, V>(mut self, v: T) -> Self
4092 where
4093 T: std::iter::IntoIterator<Item = (K, V)>,
4094 K: std::convert::Into<std::string::String>,
4095 V: std::convert::Into<crate::model::ChannelConfig>,
4096 {
4097 use std::iter::Iterator;
4098 self.channels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4099 self
4100 }
4101
4102 pub fn set_versions<T, V>(mut self, v: T) -> Self
4104 where
4105 T: std::iter::IntoIterator<Item = V>,
4106 V: std::convert::Into<crate::model::Version>,
4107 {
4108 use std::iter::Iterator;
4109 self.versions = v.into_iter().map(|i| i.into()).collect();
4110 self
4111 }
4112
4113 pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4115 self.default_version = v.into();
4116 self
4117 }
4118}
4119
4120impl wkt::message::Message for ServerConfig {
4121 fn typename() -> &'static str {
4122 "type.googleapis.com/google.cloud.edgecontainer.v1.ServerConfig"
4123 }
4124}
4125
4126#[derive(Clone, Default, PartialEq)]
4128#[non_exhaustive]
4129pub struct ChannelConfig {
4130 pub default_version: std::string::String,
4132
4133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4134}
4135
4136impl ChannelConfig {
4137 pub fn new() -> Self {
4138 std::default::Default::default()
4139 }
4140
4141 pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4143 self.default_version = v.into();
4144 self
4145 }
4146}
4147
4148impl wkt::message::Message for ChannelConfig {
4149 fn typename() -> &'static str {
4150 "type.googleapis.com/google.cloud.edgecontainer.v1.ChannelConfig"
4151 }
4152}
4153
4154#[derive(Clone, Default, PartialEq)]
4156#[non_exhaustive]
4157pub struct Version {
4158 pub name: std::string::String,
4160
4161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4162}
4163
4164impl Version {
4165 pub fn new() -> Self {
4166 std::default::Default::default()
4167 }
4168
4169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4171 self.name = v.into();
4172 self
4173 }
4174}
4175
4176impl wkt::message::Message for Version {
4177 fn typename() -> &'static str {
4178 "type.googleapis.com/google.cloud.edgecontainer.v1.Version"
4179 }
4180}
4181
4182#[derive(Clone, Default, PartialEq)]
4184#[non_exhaustive]
4185pub struct OperationMetadata {
4186 pub create_time: std::option::Option<wkt::Timestamp>,
4188
4189 pub end_time: std::option::Option<wkt::Timestamp>,
4191
4192 pub target: std::string::String,
4194
4195 pub verb: std::string::String,
4197
4198 pub status_message: std::string::String,
4200
4201 pub requested_cancellation: bool,
4208
4209 pub api_version: std::string::String,
4211
4212 pub warnings: std::vec::Vec<std::string::String>,
4215
4216 pub status_reason: crate::model::operation_metadata::StatusReason,
4218
4219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4220}
4221
4222impl OperationMetadata {
4223 pub fn new() -> Self {
4224 std::default::Default::default()
4225 }
4226
4227 pub fn set_create_time<T>(mut self, v: T) -> Self
4229 where
4230 T: std::convert::Into<wkt::Timestamp>,
4231 {
4232 self.create_time = std::option::Option::Some(v.into());
4233 self
4234 }
4235
4236 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4238 where
4239 T: std::convert::Into<wkt::Timestamp>,
4240 {
4241 self.create_time = v.map(|x| x.into());
4242 self
4243 }
4244
4245 pub fn set_end_time<T>(mut self, v: T) -> Self
4247 where
4248 T: std::convert::Into<wkt::Timestamp>,
4249 {
4250 self.end_time = std::option::Option::Some(v.into());
4251 self
4252 }
4253
4254 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4256 where
4257 T: std::convert::Into<wkt::Timestamp>,
4258 {
4259 self.end_time = v.map(|x| x.into());
4260 self
4261 }
4262
4263 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4265 self.target = v.into();
4266 self
4267 }
4268
4269 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4271 self.verb = v.into();
4272 self
4273 }
4274
4275 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.status_message = v.into();
4278 self
4279 }
4280
4281 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4283 self.requested_cancellation = v.into();
4284 self
4285 }
4286
4287 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289 self.api_version = v.into();
4290 self
4291 }
4292
4293 pub fn set_warnings<T, V>(mut self, v: T) -> Self
4295 where
4296 T: std::iter::IntoIterator<Item = V>,
4297 V: std::convert::Into<std::string::String>,
4298 {
4299 use std::iter::Iterator;
4300 self.warnings = v.into_iter().map(|i| i.into()).collect();
4301 self
4302 }
4303
4304 pub fn set_status_reason<
4306 T: std::convert::Into<crate::model::operation_metadata::StatusReason>,
4307 >(
4308 mut self,
4309 v: T,
4310 ) -> Self {
4311 self.status_reason = v.into();
4312 self
4313 }
4314}
4315
4316impl wkt::message::Message for OperationMetadata {
4317 fn typename() -> &'static str {
4318 "type.googleapis.com/google.cloud.edgecontainer.v1.OperationMetadata"
4319 }
4320}
4321
4322pub mod operation_metadata {
4324 #[allow(unused_imports)]
4325 use super::*;
4326
4327 #[derive(Clone, Debug, PartialEq)]
4343 #[non_exhaustive]
4344 pub enum StatusReason {
4345 Unspecified,
4347 UpgradePaused,
4349 UnknownValue(status_reason::UnknownValue),
4354 }
4355
4356 #[doc(hidden)]
4357 pub mod status_reason {
4358 #[allow(unused_imports)]
4359 use super::*;
4360 #[derive(Clone, Debug, PartialEq)]
4361 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4362 }
4363
4364 impl StatusReason {
4365 pub fn value(&self) -> std::option::Option<i32> {
4370 match self {
4371 Self::Unspecified => std::option::Option::Some(0),
4372 Self::UpgradePaused => std::option::Option::Some(1),
4373 Self::UnknownValue(u) => u.0.value(),
4374 }
4375 }
4376
4377 pub fn name(&self) -> std::option::Option<&str> {
4382 match self {
4383 Self::Unspecified => std::option::Option::Some("STATUS_REASON_UNSPECIFIED"),
4384 Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
4385 Self::UnknownValue(u) => u.0.name(),
4386 }
4387 }
4388 }
4389
4390 impl std::default::Default for StatusReason {
4391 fn default() -> Self {
4392 use std::convert::From;
4393 Self::from(0)
4394 }
4395 }
4396
4397 impl std::fmt::Display for StatusReason {
4398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4399 wkt::internal::display_enum(f, self.name(), self.value())
4400 }
4401 }
4402
4403 impl std::convert::From<i32> for StatusReason {
4404 fn from(value: i32) -> Self {
4405 match value {
4406 0 => Self::Unspecified,
4407 1 => Self::UpgradePaused,
4408 _ => Self::UnknownValue(status_reason::UnknownValue(
4409 wkt::internal::UnknownEnumValue::Integer(value),
4410 )),
4411 }
4412 }
4413 }
4414
4415 impl std::convert::From<&str> for StatusReason {
4416 fn from(value: &str) -> Self {
4417 use std::string::ToString;
4418 match value {
4419 "STATUS_REASON_UNSPECIFIED" => Self::Unspecified,
4420 "UPGRADE_PAUSED" => Self::UpgradePaused,
4421 _ => Self::UnknownValue(status_reason::UnknownValue(
4422 wkt::internal::UnknownEnumValue::String(value.to_string()),
4423 )),
4424 }
4425 }
4426 }
4427
4428 impl serde::ser::Serialize for StatusReason {
4429 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4430 where
4431 S: serde::Serializer,
4432 {
4433 match self {
4434 Self::Unspecified => serializer.serialize_i32(0),
4435 Self::UpgradePaused => serializer.serialize_i32(1),
4436 Self::UnknownValue(u) => u.0.serialize(serializer),
4437 }
4438 }
4439 }
4440
4441 impl<'de> serde::de::Deserialize<'de> for StatusReason {
4442 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4443 where
4444 D: serde::Deserializer<'de>,
4445 {
4446 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StatusReason>::new(
4447 ".google.cloud.edgecontainer.v1.OperationMetadata.StatusReason",
4448 ))
4449 }
4450 }
4451}
4452
4453#[derive(Clone, Default, PartialEq)]
4455#[non_exhaustive]
4456pub struct ListClustersRequest {
4457 pub parent: std::string::String,
4459
4460 pub page_size: i32,
4462
4463 pub page_token: std::string::String,
4466
4467 pub filter: std::string::String,
4469
4470 pub order_by: std::string::String,
4472
4473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4474}
4475
4476impl ListClustersRequest {
4477 pub fn new() -> Self {
4478 std::default::Default::default()
4479 }
4480
4481 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4483 self.parent = v.into();
4484 self
4485 }
4486
4487 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4489 self.page_size = v.into();
4490 self
4491 }
4492
4493 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.page_token = v.into();
4496 self
4497 }
4498
4499 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4501 self.filter = v.into();
4502 self
4503 }
4504
4505 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.order_by = v.into();
4508 self
4509 }
4510}
4511
4512impl wkt::message::Message for ListClustersRequest {
4513 fn typename() -> &'static str {
4514 "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersRequest"
4515 }
4516}
4517
4518#[derive(Clone, Default, PartialEq)]
4520#[non_exhaustive]
4521pub struct ListClustersResponse {
4522 pub clusters: std::vec::Vec<crate::model::Cluster>,
4524
4525 pub next_page_token: std::string::String,
4527
4528 pub unreachable: std::vec::Vec<std::string::String>,
4530
4531 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4532}
4533
4534impl ListClustersResponse {
4535 pub fn new() -> Self {
4536 std::default::Default::default()
4537 }
4538
4539 pub fn set_clusters<T, V>(mut self, v: T) -> Self
4541 where
4542 T: std::iter::IntoIterator<Item = V>,
4543 V: std::convert::Into<crate::model::Cluster>,
4544 {
4545 use std::iter::Iterator;
4546 self.clusters = v.into_iter().map(|i| i.into()).collect();
4547 self
4548 }
4549
4550 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4552 self.next_page_token = v.into();
4553 self
4554 }
4555
4556 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4558 where
4559 T: std::iter::IntoIterator<Item = V>,
4560 V: std::convert::Into<std::string::String>,
4561 {
4562 use std::iter::Iterator;
4563 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4564 self
4565 }
4566}
4567
4568impl wkt::message::Message for ListClustersResponse {
4569 fn typename() -> &'static str {
4570 "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersResponse"
4571 }
4572}
4573
4574#[doc(hidden)]
4575impl gax::paginator::internal::PageableResponse for ListClustersResponse {
4576 type PageItem = crate::model::Cluster;
4577
4578 fn items(self) -> std::vec::Vec<Self::PageItem> {
4579 self.clusters
4580 }
4581
4582 fn next_page_token(&self) -> std::string::String {
4583 use std::clone::Clone;
4584 self.next_page_token.clone()
4585 }
4586}
4587
4588#[derive(Clone, Default, PartialEq)]
4590#[non_exhaustive]
4591pub struct GetClusterRequest {
4592 pub name: std::string::String,
4594
4595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4596}
4597
4598impl GetClusterRequest {
4599 pub fn new() -> Self {
4600 std::default::Default::default()
4601 }
4602
4603 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4605 self.name = v.into();
4606 self
4607 }
4608}
4609
4610impl wkt::message::Message for GetClusterRequest {
4611 fn typename() -> &'static str {
4612 "type.googleapis.com/google.cloud.edgecontainer.v1.GetClusterRequest"
4613 }
4614}
4615
4616#[derive(Clone, Default, PartialEq)]
4618#[non_exhaustive]
4619pub struct CreateClusterRequest {
4620 pub parent: std::string::String,
4622
4623 pub cluster_id: std::string::String,
4625
4626 pub cluster: std::option::Option<crate::model::Cluster>,
4628
4629 pub request_id: std::string::String,
4633
4634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4635}
4636
4637impl CreateClusterRequest {
4638 pub fn new() -> Self {
4639 std::default::Default::default()
4640 }
4641
4642 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4644 self.parent = v.into();
4645 self
4646 }
4647
4648 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4650 self.cluster_id = v.into();
4651 self
4652 }
4653
4654 pub fn set_cluster<T>(mut self, v: T) -> Self
4656 where
4657 T: std::convert::Into<crate::model::Cluster>,
4658 {
4659 self.cluster = std::option::Option::Some(v.into());
4660 self
4661 }
4662
4663 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
4665 where
4666 T: std::convert::Into<crate::model::Cluster>,
4667 {
4668 self.cluster = v.map(|x| x.into());
4669 self
4670 }
4671
4672 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4674 self.request_id = v.into();
4675 self
4676 }
4677}
4678
4679impl wkt::message::Message for CreateClusterRequest {
4680 fn typename() -> &'static str {
4681 "type.googleapis.com/google.cloud.edgecontainer.v1.CreateClusterRequest"
4682 }
4683}
4684
4685#[derive(Clone, Default, PartialEq)]
4687#[non_exhaustive]
4688pub struct UpdateClusterRequest {
4689 pub update_mask: std::option::Option<wkt::FieldMask>,
4695
4696 pub cluster: std::option::Option<crate::model::Cluster>,
4698
4699 pub request_id: std::string::String,
4703
4704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4705}
4706
4707impl UpdateClusterRequest {
4708 pub fn new() -> Self {
4709 std::default::Default::default()
4710 }
4711
4712 pub fn set_update_mask<T>(mut self, v: T) -> Self
4714 where
4715 T: std::convert::Into<wkt::FieldMask>,
4716 {
4717 self.update_mask = std::option::Option::Some(v.into());
4718 self
4719 }
4720
4721 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4723 where
4724 T: std::convert::Into<wkt::FieldMask>,
4725 {
4726 self.update_mask = v.map(|x| x.into());
4727 self
4728 }
4729
4730 pub fn set_cluster<T>(mut self, v: T) -> Self
4732 where
4733 T: std::convert::Into<crate::model::Cluster>,
4734 {
4735 self.cluster = std::option::Option::Some(v.into());
4736 self
4737 }
4738
4739 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
4741 where
4742 T: std::convert::Into<crate::model::Cluster>,
4743 {
4744 self.cluster = v.map(|x| x.into());
4745 self
4746 }
4747
4748 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4750 self.request_id = v.into();
4751 self
4752 }
4753}
4754
4755impl wkt::message::Message for UpdateClusterRequest {
4756 fn typename() -> &'static str {
4757 "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateClusterRequest"
4758 }
4759}
4760
4761#[derive(Clone, Default, PartialEq)]
4763#[non_exhaustive]
4764pub struct UpgradeClusterRequest {
4765 pub name: std::string::String,
4767
4768 pub target_version: std::string::String,
4770
4771 pub schedule: crate::model::upgrade_cluster_request::Schedule,
4773
4774 pub request_id: std::string::String,
4778
4779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4780}
4781
4782impl UpgradeClusterRequest {
4783 pub fn new() -> Self {
4784 std::default::Default::default()
4785 }
4786
4787 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4789 self.name = v.into();
4790 self
4791 }
4792
4793 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4795 self.target_version = v.into();
4796 self
4797 }
4798
4799 pub fn set_schedule<T: std::convert::Into<crate::model::upgrade_cluster_request::Schedule>>(
4801 mut self,
4802 v: T,
4803 ) -> Self {
4804 self.schedule = v.into();
4805 self
4806 }
4807
4808 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.request_id = v.into();
4811 self
4812 }
4813}
4814
4815impl wkt::message::Message for UpgradeClusterRequest {
4816 fn typename() -> &'static str {
4817 "type.googleapis.com/google.cloud.edgecontainer.v1.UpgradeClusterRequest"
4818 }
4819}
4820
4821pub mod upgrade_cluster_request {
4823 #[allow(unused_imports)]
4824 use super::*;
4825
4826 #[derive(Clone, Debug, PartialEq)]
4842 #[non_exhaustive]
4843 pub enum Schedule {
4844 Unspecified,
4847 Immediately,
4850 UnknownValue(schedule::UnknownValue),
4855 }
4856
4857 #[doc(hidden)]
4858 pub mod schedule {
4859 #[allow(unused_imports)]
4860 use super::*;
4861 #[derive(Clone, Debug, PartialEq)]
4862 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4863 }
4864
4865 impl Schedule {
4866 pub fn value(&self) -> std::option::Option<i32> {
4871 match self {
4872 Self::Unspecified => std::option::Option::Some(0),
4873 Self::Immediately => std::option::Option::Some(1),
4874 Self::UnknownValue(u) => u.0.value(),
4875 }
4876 }
4877
4878 pub fn name(&self) -> std::option::Option<&str> {
4883 match self {
4884 Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
4885 Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
4886 Self::UnknownValue(u) => u.0.name(),
4887 }
4888 }
4889 }
4890
4891 impl std::default::Default for Schedule {
4892 fn default() -> Self {
4893 use std::convert::From;
4894 Self::from(0)
4895 }
4896 }
4897
4898 impl std::fmt::Display for Schedule {
4899 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4900 wkt::internal::display_enum(f, self.name(), self.value())
4901 }
4902 }
4903
4904 impl std::convert::From<i32> for Schedule {
4905 fn from(value: i32) -> Self {
4906 match value {
4907 0 => Self::Unspecified,
4908 1 => Self::Immediately,
4909 _ => Self::UnknownValue(schedule::UnknownValue(
4910 wkt::internal::UnknownEnumValue::Integer(value),
4911 )),
4912 }
4913 }
4914 }
4915
4916 impl std::convert::From<&str> for Schedule {
4917 fn from(value: &str) -> Self {
4918 use std::string::ToString;
4919 match value {
4920 "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
4921 "IMMEDIATELY" => Self::Immediately,
4922 _ => Self::UnknownValue(schedule::UnknownValue(
4923 wkt::internal::UnknownEnumValue::String(value.to_string()),
4924 )),
4925 }
4926 }
4927 }
4928
4929 impl serde::ser::Serialize for Schedule {
4930 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4931 where
4932 S: serde::Serializer,
4933 {
4934 match self {
4935 Self::Unspecified => serializer.serialize_i32(0),
4936 Self::Immediately => serializer.serialize_i32(1),
4937 Self::UnknownValue(u) => u.0.serialize(serializer),
4938 }
4939 }
4940 }
4941
4942 impl<'de> serde::de::Deserialize<'de> for Schedule {
4943 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4944 where
4945 D: serde::Deserializer<'de>,
4946 {
4947 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
4948 ".google.cloud.edgecontainer.v1.UpgradeClusterRequest.Schedule",
4949 ))
4950 }
4951 }
4952}
4953
4954#[derive(Clone, Default, PartialEq)]
4956#[non_exhaustive]
4957pub struct DeleteClusterRequest {
4958 pub name: std::string::String,
4960
4961 pub request_id: std::string::String,
4965
4966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4967}
4968
4969impl DeleteClusterRequest {
4970 pub fn new() -> Self {
4971 std::default::Default::default()
4972 }
4973
4974 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4976 self.name = v.into();
4977 self
4978 }
4979
4980 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4982 self.request_id = v.into();
4983 self
4984 }
4985}
4986
4987impl wkt::message::Message for DeleteClusterRequest {
4988 fn typename() -> &'static str {
4989 "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteClusterRequest"
4990 }
4991}
4992
4993#[derive(Clone, Default, PartialEq)]
4995#[non_exhaustive]
4996pub struct GenerateAccessTokenRequest {
4997 pub cluster: std::string::String,
4999
5000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5001}
5002
5003impl GenerateAccessTokenRequest {
5004 pub fn new() -> Self {
5005 std::default::Default::default()
5006 }
5007
5008 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.cluster = v.into();
5011 self
5012 }
5013}
5014
5015impl wkt::message::Message for GenerateAccessTokenRequest {
5016 fn typename() -> &'static str {
5017 "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenRequest"
5018 }
5019}
5020
5021#[derive(Clone, Default, PartialEq)]
5023#[non_exhaustive]
5024pub struct GenerateAccessTokenResponse {
5025 pub access_token: std::string::String,
5027
5028 pub expire_time: std::option::Option<wkt::Timestamp>,
5030
5031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5032}
5033
5034impl GenerateAccessTokenResponse {
5035 pub fn new() -> Self {
5036 std::default::Default::default()
5037 }
5038
5039 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5041 self.access_token = v.into();
5042 self
5043 }
5044
5045 pub fn set_expire_time<T>(mut self, v: T) -> Self
5047 where
5048 T: std::convert::Into<wkt::Timestamp>,
5049 {
5050 self.expire_time = std::option::Option::Some(v.into());
5051 self
5052 }
5053
5054 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5056 where
5057 T: std::convert::Into<wkt::Timestamp>,
5058 {
5059 self.expire_time = v.map(|x| x.into());
5060 self
5061 }
5062}
5063
5064impl wkt::message::Message for GenerateAccessTokenResponse {
5065 fn typename() -> &'static str {
5066 "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenResponse"
5067 }
5068}
5069
5070#[derive(Clone, Default, PartialEq)]
5072#[non_exhaustive]
5073pub struct GenerateOfflineCredentialRequest {
5074 pub cluster: std::string::String,
5076
5077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5078}
5079
5080impl GenerateOfflineCredentialRequest {
5081 pub fn new() -> Self {
5082 std::default::Default::default()
5083 }
5084
5085 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5087 self.cluster = v.into();
5088 self
5089 }
5090}
5091
5092impl wkt::message::Message for GenerateOfflineCredentialRequest {
5093 fn typename() -> &'static str {
5094 "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialRequest"
5095 }
5096}
5097
5098#[derive(Clone, Default, PartialEq)]
5100#[non_exhaustive]
5101pub struct GenerateOfflineCredentialResponse {
5102 pub client_certificate: std::string::String,
5104
5105 pub client_key: std::string::String,
5107
5108 pub user_id: std::string::String,
5110
5111 pub expire_time: std::option::Option<wkt::Timestamp>,
5113
5114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5115}
5116
5117impl GenerateOfflineCredentialResponse {
5118 pub fn new() -> Self {
5119 std::default::Default::default()
5120 }
5121
5122 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
5124 mut self,
5125 v: T,
5126 ) -> Self {
5127 self.client_certificate = v.into();
5128 self
5129 }
5130
5131 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5133 self.client_key = v.into();
5134 self
5135 }
5136
5137 pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5139 self.user_id = v.into();
5140 self
5141 }
5142
5143 pub fn set_expire_time<T>(mut self, v: T) -> Self
5145 where
5146 T: std::convert::Into<wkt::Timestamp>,
5147 {
5148 self.expire_time = std::option::Option::Some(v.into());
5149 self
5150 }
5151
5152 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5154 where
5155 T: std::convert::Into<wkt::Timestamp>,
5156 {
5157 self.expire_time = v.map(|x| x.into());
5158 self
5159 }
5160}
5161
5162impl wkt::message::Message for GenerateOfflineCredentialResponse {
5163 fn typename() -> &'static str {
5164 "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialResponse"
5165 }
5166}
5167
5168#[derive(Clone, Default, PartialEq)]
5170#[non_exhaustive]
5171pub struct ListNodePoolsRequest {
5172 pub parent: std::string::String,
5174
5175 pub page_size: i32,
5177
5178 pub page_token: std::string::String,
5180
5181 pub filter: std::string::String,
5183
5184 pub order_by: std::string::String,
5186
5187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5188}
5189
5190impl ListNodePoolsRequest {
5191 pub fn new() -> Self {
5192 std::default::Default::default()
5193 }
5194
5195 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5197 self.parent = v.into();
5198 self
5199 }
5200
5201 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5203 self.page_size = v.into();
5204 self
5205 }
5206
5207 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5209 self.page_token = v.into();
5210 self
5211 }
5212
5213 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5215 self.filter = v.into();
5216 self
5217 }
5218
5219 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5221 self.order_by = v.into();
5222 self
5223 }
5224}
5225
5226impl wkt::message::Message for ListNodePoolsRequest {
5227 fn typename() -> &'static str {
5228 "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsRequest"
5229 }
5230}
5231
5232#[derive(Clone, Default, PartialEq)]
5234#[non_exhaustive]
5235pub struct ListNodePoolsResponse {
5236 pub node_pools: std::vec::Vec<crate::model::NodePool>,
5238
5239 pub next_page_token: std::string::String,
5241
5242 pub unreachable: std::vec::Vec<std::string::String>,
5244
5245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5246}
5247
5248impl ListNodePoolsResponse {
5249 pub fn new() -> Self {
5250 std::default::Default::default()
5251 }
5252
5253 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
5255 where
5256 T: std::iter::IntoIterator<Item = V>,
5257 V: std::convert::Into<crate::model::NodePool>,
5258 {
5259 use std::iter::Iterator;
5260 self.node_pools = v.into_iter().map(|i| i.into()).collect();
5261 self
5262 }
5263
5264 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5266 self.next_page_token = v.into();
5267 self
5268 }
5269
5270 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5272 where
5273 T: std::iter::IntoIterator<Item = V>,
5274 V: std::convert::Into<std::string::String>,
5275 {
5276 use std::iter::Iterator;
5277 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5278 self
5279 }
5280}
5281
5282impl wkt::message::Message for ListNodePoolsResponse {
5283 fn typename() -> &'static str {
5284 "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsResponse"
5285 }
5286}
5287
5288#[doc(hidden)]
5289impl gax::paginator::internal::PageableResponse for ListNodePoolsResponse {
5290 type PageItem = crate::model::NodePool;
5291
5292 fn items(self) -> std::vec::Vec<Self::PageItem> {
5293 self.node_pools
5294 }
5295
5296 fn next_page_token(&self) -> std::string::String {
5297 use std::clone::Clone;
5298 self.next_page_token.clone()
5299 }
5300}
5301
5302#[derive(Clone, Default, PartialEq)]
5304#[non_exhaustive]
5305pub struct GetNodePoolRequest {
5306 pub name: std::string::String,
5308
5309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5310}
5311
5312impl GetNodePoolRequest {
5313 pub fn new() -> Self {
5314 std::default::Default::default()
5315 }
5316
5317 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5319 self.name = v.into();
5320 self
5321 }
5322}
5323
5324impl wkt::message::Message for GetNodePoolRequest {
5325 fn typename() -> &'static str {
5326 "type.googleapis.com/google.cloud.edgecontainer.v1.GetNodePoolRequest"
5327 }
5328}
5329
5330#[derive(Clone, Default, PartialEq)]
5332#[non_exhaustive]
5333pub struct CreateNodePoolRequest {
5334 pub parent: std::string::String,
5336
5337 pub node_pool_id: std::string::String,
5339
5340 pub node_pool: std::option::Option<crate::model::NodePool>,
5342
5343 pub request_id: std::string::String,
5347
5348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5349}
5350
5351impl CreateNodePoolRequest {
5352 pub fn new() -> Self {
5353 std::default::Default::default()
5354 }
5355
5356 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5358 self.parent = v.into();
5359 self
5360 }
5361
5362 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364 self.node_pool_id = v.into();
5365 self
5366 }
5367
5368 pub fn set_node_pool<T>(mut self, v: T) -> Self
5370 where
5371 T: std::convert::Into<crate::model::NodePool>,
5372 {
5373 self.node_pool = std::option::Option::Some(v.into());
5374 self
5375 }
5376
5377 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
5379 where
5380 T: std::convert::Into<crate::model::NodePool>,
5381 {
5382 self.node_pool = v.map(|x| x.into());
5383 self
5384 }
5385
5386 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.request_id = v.into();
5389 self
5390 }
5391}
5392
5393impl wkt::message::Message for CreateNodePoolRequest {
5394 fn typename() -> &'static str {
5395 "type.googleapis.com/google.cloud.edgecontainer.v1.CreateNodePoolRequest"
5396 }
5397}
5398
5399#[derive(Clone, Default, PartialEq)]
5401#[non_exhaustive]
5402pub struct UpdateNodePoolRequest {
5403 pub update_mask: std::option::Option<wkt::FieldMask>,
5409
5410 pub node_pool: std::option::Option<crate::model::NodePool>,
5412
5413 pub request_id: std::string::String,
5417
5418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5419}
5420
5421impl UpdateNodePoolRequest {
5422 pub fn new() -> Self {
5423 std::default::Default::default()
5424 }
5425
5426 pub fn set_update_mask<T>(mut self, v: T) -> Self
5428 where
5429 T: std::convert::Into<wkt::FieldMask>,
5430 {
5431 self.update_mask = std::option::Option::Some(v.into());
5432 self
5433 }
5434
5435 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5437 where
5438 T: std::convert::Into<wkt::FieldMask>,
5439 {
5440 self.update_mask = v.map(|x| x.into());
5441 self
5442 }
5443
5444 pub fn set_node_pool<T>(mut self, v: T) -> Self
5446 where
5447 T: std::convert::Into<crate::model::NodePool>,
5448 {
5449 self.node_pool = std::option::Option::Some(v.into());
5450 self
5451 }
5452
5453 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
5455 where
5456 T: std::convert::Into<crate::model::NodePool>,
5457 {
5458 self.node_pool = v.map(|x| x.into());
5459 self
5460 }
5461
5462 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5464 self.request_id = v.into();
5465 self
5466 }
5467}
5468
5469impl wkt::message::Message for UpdateNodePoolRequest {
5470 fn typename() -> &'static str {
5471 "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateNodePoolRequest"
5472 }
5473}
5474
5475#[derive(Clone, Default, PartialEq)]
5477#[non_exhaustive]
5478pub struct DeleteNodePoolRequest {
5479 pub name: std::string::String,
5481
5482 pub request_id: std::string::String,
5486
5487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5488}
5489
5490impl DeleteNodePoolRequest {
5491 pub fn new() -> Self {
5492 std::default::Default::default()
5493 }
5494
5495 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5497 self.name = v.into();
5498 self
5499 }
5500
5501 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5503 self.request_id = v.into();
5504 self
5505 }
5506}
5507
5508impl wkt::message::Message for DeleteNodePoolRequest {
5509 fn typename() -> &'static str {
5510 "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteNodePoolRequest"
5511 }
5512}
5513
5514#[derive(Clone, Default, PartialEq)]
5516#[non_exhaustive]
5517pub struct ListMachinesRequest {
5518 pub parent: std::string::String,
5520
5521 pub page_size: i32,
5523
5524 pub page_token: std::string::String,
5526
5527 pub filter: std::string::String,
5529
5530 pub order_by: std::string::String,
5532
5533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5534}
5535
5536impl ListMachinesRequest {
5537 pub fn new() -> Self {
5538 std::default::Default::default()
5539 }
5540
5541 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5543 self.parent = v.into();
5544 self
5545 }
5546
5547 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5549 self.page_size = v.into();
5550 self
5551 }
5552
5553 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5555 self.page_token = v.into();
5556 self
5557 }
5558
5559 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5561 self.filter = v.into();
5562 self
5563 }
5564
5565 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5567 self.order_by = v.into();
5568 self
5569 }
5570}
5571
5572impl wkt::message::Message for ListMachinesRequest {
5573 fn typename() -> &'static str {
5574 "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesRequest"
5575 }
5576}
5577
5578#[derive(Clone, Default, PartialEq)]
5580#[non_exhaustive]
5581pub struct ListMachinesResponse {
5582 pub machines: std::vec::Vec<crate::model::Machine>,
5584
5585 pub next_page_token: std::string::String,
5587
5588 pub unreachable: std::vec::Vec<std::string::String>,
5590
5591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5592}
5593
5594impl ListMachinesResponse {
5595 pub fn new() -> Self {
5596 std::default::Default::default()
5597 }
5598
5599 pub fn set_machines<T, V>(mut self, v: T) -> Self
5601 where
5602 T: std::iter::IntoIterator<Item = V>,
5603 V: std::convert::Into<crate::model::Machine>,
5604 {
5605 use std::iter::Iterator;
5606 self.machines = v.into_iter().map(|i| i.into()).collect();
5607 self
5608 }
5609
5610 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5612 self.next_page_token = v.into();
5613 self
5614 }
5615
5616 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5618 where
5619 T: std::iter::IntoIterator<Item = V>,
5620 V: std::convert::Into<std::string::String>,
5621 {
5622 use std::iter::Iterator;
5623 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5624 self
5625 }
5626}
5627
5628impl wkt::message::Message for ListMachinesResponse {
5629 fn typename() -> &'static str {
5630 "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesResponse"
5631 }
5632}
5633
5634#[doc(hidden)]
5635impl gax::paginator::internal::PageableResponse for ListMachinesResponse {
5636 type PageItem = crate::model::Machine;
5637
5638 fn items(self) -> std::vec::Vec<Self::PageItem> {
5639 self.machines
5640 }
5641
5642 fn next_page_token(&self) -> std::string::String {
5643 use std::clone::Clone;
5644 self.next_page_token.clone()
5645 }
5646}
5647
5648#[derive(Clone, Default, PartialEq)]
5650#[non_exhaustive]
5651pub struct GetMachineRequest {
5652 pub name: std::string::String,
5654
5655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5656}
5657
5658impl GetMachineRequest {
5659 pub fn new() -> Self {
5660 std::default::Default::default()
5661 }
5662
5663 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5665 self.name = v.into();
5666 self
5667 }
5668}
5669
5670impl wkt::message::Message for GetMachineRequest {
5671 fn typename() -> &'static str {
5672 "type.googleapis.com/google.cloud.edgecontainer.v1.GetMachineRequest"
5673 }
5674}
5675
5676#[derive(Clone, Default, PartialEq)]
5678#[non_exhaustive]
5679pub struct ListVpnConnectionsRequest {
5680 pub parent: std::string::String,
5683
5684 pub page_size: i32,
5686
5687 pub page_token: std::string::String,
5689
5690 pub filter: std::string::String,
5692
5693 pub order_by: std::string::String,
5695
5696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5697}
5698
5699impl ListVpnConnectionsRequest {
5700 pub fn new() -> Self {
5701 std::default::Default::default()
5702 }
5703
5704 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5706 self.parent = v.into();
5707 self
5708 }
5709
5710 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5712 self.page_size = v.into();
5713 self
5714 }
5715
5716 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5718 self.page_token = v.into();
5719 self
5720 }
5721
5722 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5724 self.filter = v.into();
5725 self
5726 }
5727
5728 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5730 self.order_by = v.into();
5731 self
5732 }
5733}
5734
5735impl wkt::message::Message for ListVpnConnectionsRequest {
5736 fn typename() -> &'static str {
5737 "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsRequest"
5738 }
5739}
5740
5741#[derive(Clone, Default, PartialEq)]
5743#[non_exhaustive]
5744pub struct ListVpnConnectionsResponse {
5745 pub vpn_connections: std::vec::Vec<crate::model::VpnConnection>,
5747
5748 pub next_page_token: std::string::String,
5750
5751 pub unreachable: std::vec::Vec<std::string::String>,
5753
5754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5755}
5756
5757impl ListVpnConnectionsResponse {
5758 pub fn new() -> Self {
5759 std::default::Default::default()
5760 }
5761
5762 pub fn set_vpn_connections<T, V>(mut self, v: T) -> Self
5764 where
5765 T: std::iter::IntoIterator<Item = V>,
5766 V: std::convert::Into<crate::model::VpnConnection>,
5767 {
5768 use std::iter::Iterator;
5769 self.vpn_connections = v.into_iter().map(|i| i.into()).collect();
5770 self
5771 }
5772
5773 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5775 self.next_page_token = v.into();
5776 self
5777 }
5778
5779 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5781 where
5782 T: std::iter::IntoIterator<Item = V>,
5783 V: std::convert::Into<std::string::String>,
5784 {
5785 use std::iter::Iterator;
5786 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5787 self
5788 }
5789}
5790
5791impl wkt::message::Message for ListVpnConnectionsResponse {
5792 fn typename() -> &'static str {
5793 "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsResponse"
5794 }
5795}
5796
5797#[doc(hidden)]
5798impl gax::paginator::internal::PageableResponse for ListVpnConnectionsResponse {
5799 type PageItem = crate::model::VpnConnection;
5800
5801 fn items(self) -> std::vec::Vec<Self::PageItem> {
5802 self.vpn_connections
5803 }
5804
5805 fn next_page_token(&self) -> std::string::String {
5806 use std::clone::Clone;
5807 self.next_page_token.clone()
5808 }
5809}
5810
5811#[derive(Clone, Default, PartialEq)]
5813#[non_exhaustive]
5814pub struct GetVpnConnectionRequest {
5815 pub name: std::string::String,
5817
5818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5819}
5820
5821impl GetVpnConnectionRequest {
5822 pub fn new() -> Self {
5823 std::default::Default::default()
5824 }
5825
5826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.name = v.into();
5829 self
5830 }
5831}
5832
5833impl wkt::message::Message for GetVpnConnectionRequest {
5834 fn typename() -> &'static str {
5835 "type.googleapis.com/google.cloud.edgecontainer.v1.GetVpnConnectionRequest"
5836 }
5837}
5838
5839#[derive(Clone, Default, PartialEq)]
5841#[non_exhaustive]
5842pub struct CreateVpnConnectionRequest {
5843 pub parent: std::string::String,
5845
5846 pub vpn_connection_id: std::string::String,
5848
5849 pub vpn_connection: std::option::Option<crate::model::VpnConnection>,
5851
5852 pub request_id: std::string::String,
5856
5857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5858}
5859
5860impl CreateVpnConnectionRequest {
5861 pub fn new() -> Self {
5862 std::default::Default::default()
5863 }
5864
5865 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5867 self.parent = v.into();
5868 self
5869 }
5870
5871 pub fn set_vpn_connection_id<T: std::convert::Into<std::string::String>>(
5873 mut self,
5874 v: T,
5875 ) -> Self {
5876 self.vpn_connection_id = v.into();
5877 self
5878 }
5879
5880 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
5882 where
5883 T: std::convert::Into<crate::model::VpnConnection>,
5884 {
5885 self.vpn_connection = std::option::Option::Some(v.into());
5886 self
5887 }
5888
5889 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
5891 where
5892 T: std::convert::Into<crate::model::VpnConnection>,
5893 {
5894 self.vpn_connection = v.map(|x| x.into());
5895 self
5896 }
5897
5898 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5900 self.request_id = v.into();
5901 self
5902 }
5903}
5904
5905impl wkt::message::Message for CreateVpnConnectionRequest {
5906 fn typename() -> &'static str {
5907 "type.googleapis.com/google.cloud.edgecontainer.v1.CreateVpnConnectionRequest"
5908 }
5909}
5910
5911#[derive(Clone, Default, PartialEq)]
5913#[non_exhaustive]
5914pub struct DeleteVpnConnectionRequest {
5915 pub name: std::string::String,
5917
5918 pub request_id: std::string::String,
5922
5923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5924}
5925
5926impl DeleteVpnConnectionRequest {
5927 pub fn new() -> Self {
5928 std::default::Default::default()
5929 }
5930
5931 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5933 self.name = v.into();
5934 self
5935 }
5936
5937 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5939 self.request_id = v.into();
5940 self
5941 }
5942}
5943
5944impl wkt::message::Message for DeleteVpnConnectionRequest {
5945 fn typename() -> &'static str {
5946 "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest"
5947 }
5948}
5949
5950#[derive(Clone, Default, PartialEq)]
5952#[non_exhaustive]
5953pub struct GetServerConfigRequest {
5954 pub name: std::string::String,
5957
5958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5959}
5960
5961impl GetServerConfigRequest {
5962 pub fn new() -> Self {
5963 std::default::Default::default()
5964 }
5965
5966 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5968 self.name = v.into();
5969 self
5970 }
5971}
5972
5973impl wkt::message::Message for GetServerConfigRequest {
5974 fn typename() -> &'static str {
5975 "type.googleapis.com/google.cloud.edgecontainer.v1.GetServerConfigRequest"
5976 }
5977}
5978
5979#[derive(Clone, Debug, PartialEq)]
5996#[non_exhaustive]
5997pub enum KmsKeyState {
5998 Unspecified,
6000 KeyAvailable,
6002 KeyUnavailable,
6005 UnknownValue(kms_key_state::UnknownValue),
6010}
6011
6012#[doc(hidden)]
6013pub mod kms_key_state {
6014 #[allow(unused_imports)]
6015 use super::*;
6016 #[derive(Clone, Debug, PartialEq)]
6017 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6018}
6019
6020impl KmsKeyState {
6021 pub fn value(&self) -> std::option::Option<i32> {
6026 match self {
6027 Self::Unspecified => std::option::Option::Some(0),
6028 Self::KeyAvailable => std::option::Option::Some(1),
6029 Self::KeyUnavailable => std::option::Option::Some(2),
6030 Self::UnknownValue(u) => u.0.value(),
6031 }
6032 }
6033
6034 pub fn name(&self) -> std::option::Option<&str> {
6039 match self {
6040 Self::Unspecified => std::option::Option::Some("KMS_KEY_STATE_UNSPECIFIED"),
6041 Self::KeyAvailable => std::option::Option::Some("KMS_KEY_STATE_KEY_AVAILABLE"),
6042 Self::KeyUnavailable => std::option::Option::Some("KMS_KEY_STATE_KEY_UNAVAILABLE"),
6043 Self::UnknownValue(u) => u.0.name(),
6044 }
6045 }
6046}
6047
6048impl std::default::Default for KmsKeyState {
6049 fn default() -> Self {
6050 use std::convert::From;
6051 Self::from(0)
6052 }
6053}
6054
6055impl std::fmt::Display for KmsKeyState {
6056 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6057 wkt::internal::display_enum(f, self.name(), self.value())
6058 }
6059}
6060
6061impl std::convert::From<i32> for KmsKeyState {
6062 fn from(value: i32) -> Self {
6063 match value {
6064 0 => Self::Unspecified,
6065 1 => Self::KeyAvailable,
6066 2 => Self::KeyUnavailable,
6067 _ => Self::UnknownValue(kms_key_state::UnknownValue(
6068 wkt::internal::UnknownEnumValue::Integer(value),
6069 )),
6070 }
6071 }
6072}
6073
6074impl std::convert::From<&str> for KmsKeyState {
6075 fn from(value: &str) -> Self {
6076 use std::string::ToString;
6077 match value {
6078 "KMS_KEY_STATE_UNSPECIFIED" => Self::Unspecified,
6079 "KMS_KEY_STATE_KEY_AVAILABLE" => Self::KeyAvailable,
6080 "KMS_KEY_STATE_KEY_UNAVAILABLE" => Self::KeyUnavailable,
6081 _ => Self::UnknownValue(kms_key_state::UnknownValue(
6082 wkt::internal::UnknownEnumValue::String(value.to_string()),
6083 )),
6084 }
6085 }
6086}
6087
6088impl serde::ser::Serialize for KmsKeyState {
6089 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6090 where
6091 S: serde::Serializer,
6092 {
6093 match self {
6094 Self::Unspecified => serializer.serialize_i32(0),
6095 Self::KeyAvailable => serializer.serialize_i32(1),
6096 Self::KeyUnavailable => serializer.serialize_i32(2),
6097 Self::UnknownValue(u) => u.0.serialize(serializer),
6098 }
6099 }
6100}
6101
6102impl<'de> serde::de::Deserialize<'de> for KmsKeyState {
6103 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6104 where
6105 D: serde::Deserializer<'de>,
6106 {
6107 deserializer.deserialize_any(wkt::internal::EnumVisitor::<KmsKeyState>::new(
6108 ".google.cloud.edgecontainer.v1.KmsKeyState",
6109 ))
6110 }
6111}
6112
6113#[derive(Clone, Debug, PartialEq)]
6129#[non_exhaustive]
6130pub enum ResourceState {
6131 Unspecified,
6133 LockDown,
6135 LockDownPending,
6137 UnknownValue(resource_state::UnknownValue),
6142}
6143
6144#[doc(hidden)]
6145pub mod resource_state {
6146 #[allow(unused_imports)]
6147 use super::*;
6148 #[derive(Clone, Debug, PartialEq)]
6149 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6150}
6151
6152impl ResourceState {
6153 pub fn value(&self) -> std::option::Option<i32> {
6158 match self {
6159 Self::Unspecified => std::option::Option::Some(0),
6160 Self::LockDown => std::option::Option::Some(1),
6161 Self::LockDownPending => std::option::Option::Some(2),
6162 Self::UnknownValue(u) => u.0.value(),
6163 }
6164 }
6165
6166 pub fn name(&self) -> std::option::Option<&str> {
6171 match self {
6172 Self::Unspecified => std::option::Option::Some("RESOURCE_STATE_UNSPECIFIED"),
6173 Self::LockDown => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN"),
6174 Self::LockDownPending => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN_PENDING"),
6175 Self::UnknownValue(u) => u.0.name(),
6176 }
6177 }
6178}
6179
6180impl std::default::Default for ResourceState {
6181 fn default() -> Self {
6182 use std::convert::From;
6183 Self::from(0)
6184 }
6185}
6186
6187impl std::fmt::Display for ResourceState {
6188 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6189 wkt::internal::display_enum(f, self.name(), self.value())
6190 }
6191}
6192
6193impl std::convert::From<i32> for ResourceState {
6194 fn from(value: i32) -> Self {
6195 match value {
6196 0 => Self::Unspecified,
6197 1 => Self::LockDown,
6198 2 => Self::LockDownPending,
6199 _ => Self::UnknownValue(resource_state::UnknownValue(
6200 wkt::internal::UnknownEnumValue::Integer(value),
6201 )),
6202 }
6203 }
6204}
6205
6206impl std::convert::From<&str> for ResourceState {
6207 fn from(value: &str) -> Self {
6208 use std::string::ToString;
6209 match value {
6210 "RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
6211 "RESOURCE_STATE_LOCK_DOWN" => Self::LockDown,
6212 "RESOURCE_STATE_LOCK_DOWN_PENDING" => Self::LockDownPending,
6213 _ => Self::UnknownValue(resource_state::UnknownValue(
6214 wkt::internal::UnknownEnumValue::String(value.to_string()),
6215 )),
6216 }
6217 }
6218}
6219
6220impl serde::ser::Serialize for ResourceState {
6221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6222 where
6223 S: serde::Serializer,
6224 {
6225 match self {
6226 Self::Unspecified => serializer.serialize_i32(0),
6227 Self::LockDown => serializer.serialize_i32(1),
6228 Self::LockDownPending => serializer.serialize_i32(2),
6229 Self::UnknownValue(u) => u.0.serialize(serializer),
6230 }
6231 }
6232}
6233
6234impl<'de> serde::de::Deserialize<'de> for ResourceState {
6235 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6236 where
6237 D: serde::Deserializer<'de>,
6238 {
6239 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceState>::new(
6240 ".google.cloud.edgecontainer.v1.ResourceState",
6241 ))
6242 }
6243}