google_cloud_edgecontainer_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![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/// A Google Distributed Cloud Edge Kubernetes cluster.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Cluster {
45    /// Required. The resource name of the cluster.
46    pub name: std::string::String,
47
48    /// Output only. The time when the cluster was created.
49    pub create_time: std::option::Option<wkt::Timestamp>,
50
51    /// Output only. The time when the cluster was last updated.
52    pub update_time: std::option::Option<wkt::Timestamp>,
53
54    /// Labels associated with this resource.
55    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
56
57    /// Required. Fleet configuration.
58    pub fleet: std::option::Option<crate::model::Fleet>,
59
60    /// Required. Cluster-wide networking configuration.
61    pub networking: std::option::Option<crate::model::ClusterNetworking>,
62
63    /// Required. Immutable. RBAC policy that will be applied and managed by GEC.
64    pub authorization: std::option::Option<crate::model::Authorization>,
65
66    /// Optional. The default maximum number of pods per node used if a maximum
67    /// value is not specified explicitly for a node pool in this cluster. If
68    /// unspecified, the Kubernetes default value will be used.
69    pub default_max_pods_per_node: i32,
70
71    /// Output only. The IP address of the Kubernetes API server.
72    pub endpoint: std::string::String,
73
74    /// Output only. The port number of the Kubernetes API server.
75    pub port: i32,
76
77    /// Output only. The PEM-encoded public certificate of the cluster's CA.
78    pub cluster_ca_certificate: std::string::String,
79
80    /// Optional. Cluster-wide maintenance policy configuration.
81    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
82
83    /// Output only. The control plane release version
84    pub control_plane_version: std::string::String,
85
86    /// Output only. The lowest release version among all worker nodes. This field
87    /// can be empty if the cluster does not have any worker nodes.
88    pub node_version: std::string::String,
89
90    /// Optional. The configuration of the cluster control plane.
91    pub control_plane: std::option::Option<crate::model::cluster::ControlPlane>,
92
93    /// Optional. The configuration of the system add-ons.
94    pub system_addons_config: std::option::Option<crate::model::cluster::SystemAddonsConfig>,
95
96    /// Optional. IPv4 address pools for cluster data plane external load
97    /// balancing.
98    pub external_load_balancer_ipv4_address_pools: std::vec::Vec<std::string::String>,
99
100    /// Optional. Remote control plane disk encryption options. This field is only
101    /// used when enabling CMEK support.
102    pub control_plane_encryption:
103        std::option::Option<crate::model::cluster::ControlPlaneEncryption>,
104
105    /// Output only. The current status of the cluster.
106    pub status: crate::model::cluster::Status,
107
108    /// Output only. All the maintenance events scheduled for the cluster,
109    /// including the ones ongoing, planned for the future and done in the past (up
110    /// to 90 days).
111    pub maintenance_events: std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
112
113    /// Optional. The target cluster version. For example: "1.5.0".
114    pub target_version: std::string::String,
115
116    /// Optional. The release channel a cluster is subscribed to.
117    pub release_channel: crate::model::cluster::ReleaseChannel,
118
119    /// Optional. Configuration of the cluster survivability, e.g., for the case
120    /// when network connectivity is lost. Note: This only applies to local control
121    /// plane clusters.
122    pub survivability_config: std::option::Option<crate::model::cluster::SurvivabilityConfig>,
123
124    /// Optional. IPv6 address pools for cluster data plane external load
125    /// balancing.
126    pub external_load_balancer_ipv6_address_pools: std::vec::Vec<std::string::String>,
127
128    /// Output only. The current connection state of the cluster.
129    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    /// Sets the value of [name][crate::model::Cluster::name].
140    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    /// Sets the value of [create_time][crate::model::Cluster::create_time].
146    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    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
155    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    /// Sets the value of [update_time][crate::model::Cluster::update_time].
164    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    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
173    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    /// Sets the value of [labels][crate::model::Cluster::labels].
182    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    /// Sets the value of [fleet][crate::model::Cluster::fleet].
194    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    /// Sets or clears the value of [fleet][crate::model::Cluster::fleet].
203    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    /// Sets the value of [networking][crate::model::Cluster::networking].
212    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    /// Sets or clears the value of [networking][crate::model::Cluster::networking].
221    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    /// Sets the value of [authorization][crate::model::Cluster::authorization].
230    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    /// Sets or clears the value of [authorization][crate::model::Cluster::authorization].
239    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    /// Sets the value of [default_max_pods_per_node][crate::model::Cluster::default_max_pods_per_node].
248    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    /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
254    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    /// Sets the value of [port][crate::model::Cluster::port].
260    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
261        self.port = v.into();
262        self
263    }
264
265    /// Sets the value of [cluster_ca_certificate][crate::model::Cluster::cluster_ca_certificate].
266    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    /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
275    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    /// Sets or clears the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
284    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    /// Sets the value of [control_plane_version][crate::model::Cluster::control_plane_version].
293    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    /// Sets the value of [node_version][crate::model::Cluster::node_version].
302    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    /// Sets the value of [control_plane][crate::model::Cluster::control_plane].
308    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    /// Sets or clears the value of [control_plane][crate::model::Cluster::control_plane].
317    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    /// Sets the value of [system_addons_config][crate::model::Cluster::system_addons_config].
326    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    /// Sets or clears the value of [system_addons_config][crate::model::Cluster::system_addons_config].
335    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    /// Sets the value of [external_load_balancer_ipv4_address_pools][crate::model::Cluster::external_load_balancer_ipv4_address_pools].
344    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    /// Sets the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
355    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    /// Sets or clears the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
364    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    /// Sets the value of [status][crate::model::Cluster::status].
373    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    /// Sets the value of [maintenance_events][crate::model::Cluster::maintenance_events].
382    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    /// Sets the value of [target_version][crate::model::Cluster::target_version].
393    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    /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
399    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    /// Sets the value of [survivability_config][crate::model::Cluster::survivability_config].
408    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    /// Sets or clears the value of [survivability_config][crate::model::Cluster::survivability_config].
417    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    /// Sets the value of [external_load_balancer_ipv6_address_pools][crate::model::Cluster::external_load_balancer_ipv6_address_pools].
426    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    /// Sets the value of [connection_state][crate::model::Cluster::connection_state].
437    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    /// Sets or clears the value of [connection_state][crate::model::Cluster::connection_state].
446    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
461/// Defines additional types related to [Cluster].
462pub mod cluster {
463    #[allow(unused_imports)]
464    use super::*;
465
466    /// Configuration of the cluster control plane.
467    #[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        /// Sets the value of [config][crate::model::cluster::ControlPlane::config].
481        ///
482        /// Note that all the setters affecting `config` are mutually
483        /// exclusive.
484        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        /// The value of [config][crate::model::cluster::ControlPlane::config]
495        /// if it holds a `Remote`, `None` if the field is not set or
496        /// holds a different branch.
497        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        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
511        /// to hold a `Remote`.
512        ///
513        /// Note that all the setters affecting `config` are
514        /// mutually exclusive.
515        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        /// The value of [config][crate::model::cluster::ControlPlane::config]
528        /// if it holds a `Local`, `None` if the field is not set or
529        /// holds a different branch.
530        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        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
544        /// to hold a `Local`.
545        ///
546        /// Note that all the setters affecting `config` are
547        /// mutually exclusive.
548        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    /// Defines additional types related to [ControlPlane].
568    pub mod control_plane {
569        #[allow(unused_imports)]
570        use super::*;
571
572        /// Configuration specific to clusters with a control plane hosted remotely.
573        #[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        /// Configuration specific to clusters with a control plane hosted locally.
592        ///
593        /// Warning: Local control plane clusters must be created in their own
594        /// project. Local control plane clusters cannot coexist in the same
595        /// project with any other type of clusters, including non-GDCE clusters.
596        /// Mixing local control plane GDCE clusters with any other type of
597        /// clusters in the same project can result in data loss.
598        #[derive(Clone, Default, PartialEq)]
599        #[non_exhaustive]
600        pub struct Local {
601            /// Name of the Google Distributed Cloud Edge zones where this node pool
602            /// will be created. For example: `us-central1-edge-customer-a`.
603            pub node_location: std::string::String,
604
605            /// The number of nodes to serve as replicas of the Control Plane.
606            pub node_count: i32,
607
608            /// Only machines matching this filter will be allowed to host control
609            /// plane nodes. The filtering language accepts strings like "name=\<name\>",
610            /// and is documented here: [AIP-160](https://google.aip.dev/160).
611            pub machine_filter: std::string::String,
612
613            /// Policy configuration about how user applications are deployed.
614            pub shared_deployment_policy:
615                crate::model::cluster::control_plane::SharedDeploymentPolicy,
616
617            /// Optional. Name for the storage schema of control plane nodes.
618            ///
619            /// Warning: Configurable node local storage schema feature is an
620            /// experimental feature, and is not recommended for general use
621            /// in production clusters/nodepools.
622            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            /// Sets the value of [node_location][crate::model::cluster::control_plane::Local::node_location].
633            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            /// Sets the value of [node_count][crate::model::cluster::control_plane::Local::node_count].
642            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            /// Sets the value of [machine_filter][crate::model::cluster::control_plane::Local::machine_filter].
648            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            /// Sets the value of [shared_deployment_policy][crate::model::cluster::control_plane::Local::shared_deployment_policy].
657            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            /// Sets the value of [control_plane_node_storage_schema][crate::model::cluster::control_plane::Local::control_plane_node_storage_schema].
668            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        /// Represents the policy configuration about how user applications are
686        /// deployed.
687        ///
688        /// # Working with unknown values
689        ///
690        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
691        /// additional enum variants at any time. Adding new variants is not considered
692        /// a breaking change. Applications should write their code in anticipation of:
693        ///
694        /// - New values appearing in future releases of the client library, **and**
695        /// - New values received dynamically, without application changes.
696        ///
697        /// Please consult the [Working with enums] section in the user guide for some
698        /// guidelines.
699        ///
700        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
701        #[derive(Clone, Debug, PartialEq)]
702        #[non_exhaustive]
703        pub enum SharedDeploymentPolicy {
704            /// Unspecified.
705            Unspecified,
706            /// User applications can be deployed both on control plane and worker
707            /// nodes.
708            Allowed,
709            /// User applications can not be deployed on control plane nodes and can
710            /// only be deployed on worker nodes.
711            Disallowed,
712            /// If set, the enum was initialized with an unknown value.
713            ///
714            /// Applications can examine the value using [SharedDeploymentPolicy::value] or
715            /// [SharedDeploymentPolicy::name].
716            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            /// Gets the enum value.
729            ///
730            /// Returns `None` if the enum contains an unknown value deserialized from
731            /// the string representation of enums.
732            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            /// Gets the enum value as a string.
742            ///
743            /// Returns `None` if the enum contains an unknown value deserialized from
744            /// the integer representation of enums.
745            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 control plane configuration.
828            Remote(std::boxed::Box<crate::model::cluster::control_plane::Remote>),
829            /// Local control plane configuration.
830            ///
831            /// Warning: Local control plane clusters must be created in their own
832            /// project. Local control plane clusters cannot coexist in the same
833            /// project with any other type of clusters, including non-GDCE clusters.
834            /// Mixing local control plane GDCE clusters with any other type of
835            /// clusters in the same project can result in data loss.
836            Local(std::boxed::Box<crate::model::cluster::control_plane::Local>),
837        }
838    }
839
840    /// Config that customers are allowed to define for GDCE system add-ons.
841    #[derive(Clone, Default, PartialEq)]
842    #[non_exhaustive]
843    pub struct SystemAddonsConfig {
844        /// Optional. Config for Ingress.
845        pub ingress: std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
846
847        /// Optional. Config for VM Service.
848        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        /// Sets the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
860        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        /// Sets or clears the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
869        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        /// Sets the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
878        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        /// Sets or clears the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
887        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    /// Defines additional types related to [SystemAddonsConfig].
903    pub mod system_addons_config {
904        #[allow(unused_imports)]
905        use super::*;
906
907        /// Config for the Ingress add-on which allows customers to create an Ingress
908        /// object to manage external access to the servers in a cluster. The add-on
909        /// consists of istiod and istio-ingress.
910        #[derive(Clone, Default, PartialEq)]
911        #[non_exhaustive]
912        pub struct Ingress {
913            /// Optional. Whether Ingress is disabled.
914            pub disabled: bool,
915
916            /// Optional. Ingress VIP.
917            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            /// Sets the value of [disabled][crate::model::cluster::system_addons_config::Ingress::disabled].
928            pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
929                self.disabled = v.into();
930                self
931            }
932
933            /// Sets the value of [ipv4_vip][crate::model::cluster::system_addons_config::Ingress::ipv4_vip].
934            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        /// VMServiceConfig defines the configuration for GDCE VM Service.
950        #[derive(Clone, Default, PartialEq)]
951        #[non_exhaustive]
952        pub struct VMServiceConfig {
953            /// Optional. Whether VMM is enabled.
954            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            /// Sets the value of [vmm_enabled][crate::model::cluster::system_addons_config::VMServiceConfig::vmm_enabled].
965            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    /// Configuration for Customer-managed KMS key support for control plane nodes.
979    #[derive(Clone, Default, PartialEq)]
980    #[non_exhaustive]
981    pub struct ControlPlaneEncryption {
982        /// Optional. The Cloud KMS CryptoKey e.g.
983        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
984        /// to use for protecting control plane disks. If not specified, a
985        /// Google-managed key will be used instead.
986        pub kms_key: std::string::String,
987
988        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
989        /// protecting control plane disks. Only applicable if kms_key is set.
990        pub kms_key_active_version: std::string::String,
991
992        /// Output only. Availability of the Cloud KMS CryptoKey. If not
993        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
994        /// local data. This can be caused by a lack of permissions to use the key,
995        /// or if the key is disabled or deleted.
996        pub kms_key_state: crate::model::KmsKeyState,
997
998        /// Output only. Error status returned by Cloud KMS when using this key. This
999        /// field may be populated only if `kms_key_state` is not
1000        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
1001        /// error status reported by Cloud KMS.
1002        pub kms_status: std::option::Option<rpc::model::Status>,
1003
1004        /// Output only. The current resource state associated with the cmek.
1005        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        /// Sets the value of [kms_key][crate::model::cluster::ControlPlaneEncryption::kms_key].
1016        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        /// Sets the value of [kms_key_active_version][crate::model::cluster::ControlPlaneEncryption::kms_key_active_version].
1022        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        /// Sets the value of [kms_key_state][crate::model::cluster::ControlPlaneEncryption::kms_key_state].
1031        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        /// Sets the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
1040        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        /// Sets or clears the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
1049        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        /// Sets the value of [resource_state][crate::model::cluster::ControlPlaneEncryption::resource_state].
1058        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    /// A Maintenance Event is an operation that could cause temporary disruptions
1074    /// to the cluster workloads, including Google-driven or user-initiated cluster
1075    /// upgrades, user-initiated cluster configuration changes that require
1076    /// restarting nodes, etc.
1077    #[derive(Clone, Default, PartialEq)]
1078    #[non_exhaustive]
1079    pub struct MaintenanceEvent {
1080        /// Output only. UUID of the maintenance event.
1081        pub uuid: std::string::String,
1082
1083        /// Output only. The target version of the cluster.
1084        pub target_version: std::string::String,
1085
1086        /// Output only. The operation for running the maintenance event. Specified
1087        /// in the format projects/*/locations/*/operations/*. If the maintenance
1088        /// event is split into multiple operations (e.g. due to maintenance
1089        /// windows), the latest one is recorded.
1090        pub operation: std::string::String,
1091
1092        /// Output only. The type of the maintenance event.
1093        pub r#type: crate::model::cluster::maintenance_event::Type,
1094
1095        /// Output only. The schedule of the maintenance event.
1096        pub schedule: crate::model::cluster::maintenance_event::Schedule,
1097
1098        /// Output only. The state of the maintenance event.
1099        pub state: crate::model::cluster::maintenance_event::State,
1100
1101        /// Output only. The time when the maintenance event request was created.
1102        pub create_time: std::option::Option<wkt::Timestamp>,
1103
1104        /// Output only. The time when the maintenance event started.
1105        pub start_time: std::option::Option<wkt::Timestamp>,
1106
1107        /// Output only. The time when the maintenance event ended, either
1108        /// successfully or not. If the maintenance event is split into multiple
1109        /// maintenance windows, end_time is only updated when the whole flow ends.
1110        pub end_time: std::option::Option<wkt::Timestamp>,
1111
1112        /// Output only. The time when the maintenance event message was updated.
1113        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        /// Sets the value of [uuid][crate::model::cluster::MaintenanceEvent::uuid].
1124        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        /// Sets the value of [target_version][crate::model::cluster::MaintenanceEvent::target_version].
1130        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        /// Sets the value of [operation][crate::model::cluster::MaintenanceEvent::operation].
1139        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        /// Sets the value of [r#type][crate::model::cluster::MaintenanceEvent::type].
1145        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        /// Sets the value of [schedule][crate::model::cluster::MaintenanceEvent::schedule].
1154        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        /// Sets the value of [state][crate::model::cluster::MaintenanceEvent::state].
1165        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        /// Sets the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
1174        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        /// Sets or clears the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
1183        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        /// Sets the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
1192        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        /// Sets or clears the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
1201        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        /// Sets the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
1210        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        /// Sets or clears the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
1219        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        /// Sets the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
1228        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        /// Sets or clears the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
1237        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    /// Defines additional types related to [MaintenanceEvent].
1253    pub mod maintenance_event {
1254        #[allow(unused_imports)]
1255        use super::*;
1256
1257        /// Indicates the maintenance event type.
1258        ///
1259        /// # Working with unknown values
1260        ///
1261        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1262        /// additional enum variants at any time. Adding new variants is not considered
1263        /// a breaking change. Applications should write their code in anticipation of:
1264        ///
1265        /// - New values appearing in future releases of the client library, **and**
1266        /// - New values received dynamically, without application changes.
1267        ///
1268        /// Please consult the [Working with enums] section in the user guide for some
1269        /// guidelines.
1270        ///
1271        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1272        #[derive(Clone, Debug, PartialEq)]
1273        #[non_exhaustive]
1274        pub enum Type {
1275            /// Unspecified.
1276            Unspecified,
1277            /// Upgrade initiated by users.
1278            UserInitiatedUpgrade,
1279            /// Upgrade driven by Google.
1280            GoogleDrivenUpgrade,
1281            /// If set, the enum was initialized with an unknown value.
1282            ///
1283            /// Applications can examine the value using [Type::value] or
1284            /// [Type::name].
1285            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            /// Gets the enum value.
1298            ///
1299            /// Returns `None` if the enum contains an unknown value deserialized from
1300            /// the string representation of enums.
1301            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            /// Gets the enum value as a string.
1311            ///
1312            /// Returns `None` if the enum contains an unknown value deserialized from
1313            /// the integer representation of enums.
1314            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        /// Indicates when the maintenance event should be performed.
1395        ///
1396        /// # Working with unknown values
1397        ///
1398        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1399        /// additional enum variants at any time. Adding new variants is not considered
1400        /// a breaking change. Applications should write their code in anticipation of:
1401        ///
1402        /// - New values appearing in future releases of the client library, **and**
1403        /// - New values received dynamically, without application changes.
1404        ///
1405        /// Please consult the [Working with enums] section in the user guide for some
1406        /// guidelines.
1407        ///
1408        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1409        #[derive(Clone, Debug, PartialEq)]
1410        #[non_exhaustive]
1411        pub enum Schedule {
1412            /// Unspecified.
1413            Unspecified,
1414            /// Immediately after receiving the request.
1415            Immediately,
1416            /// If set, the enum was initialized with an unknown value.
1417            ///
1418            /// Applications can examine the value using [Schedule::value] or
1419            /// [Schedule::name].
1420            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            /// Gets the enum value.
1433            ///
1434            /// Returns `None` if the enum contains an unknown value deserialized from
1435            /// the string representation of enums.
1436            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            /// Gets the enum value as a string.
1445            ///
1446            /// Returns `None` if the enum contains an unknown value deserialized from
1447            /// the integer representation of enums.
1448            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        /// Indicates the maintenance event state.
1523        ///
1524        /// # Working with unknown values
1525        ///
1526        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1527        /// additional enum variants at any time. Adding new variants is not considered
1528        /// a breaking change. Applications should write their code in anticipation of:
1529        ///
1530        /// - New values appearing in future releases of the client library, **and**
1531        /// - New values received dynamically, without application changes.
1532        ///
1533        /// Please consult the [Working with enums] section in the user guide for some
1534        /// guidelines.
1535        ///
1536        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1537        #[derive(Clone, Debug, PartialEq)]
1538        #[non_exhaustive]
1539        pub enum State {
1540            /// Unspecified.
1541            Unspecified,
1542            /// The maintenance event is ongoing. The cluster might be unusable.
1543            Reconciling,
1544            /// The maintenance event succeeded.
1545            Succeeded,
1546            /// The maintenance event failed.
1547            Failed,
1548            /// If set, the enum was initialized with an unknown value.
1549            ///
1550            /// Applications can examine the value using [State::value] or
1551            /// [State::name].
1552            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            /// Gets the enum value.
1565            ///
1566            /// Returns `None` if the enum contains an unknown value deserialized from
1567            /// the string representation of enums.
1568            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            /// Gets the enum value as a string.
1579            ///
1580            /// Returns `None` if the enum contains an unknown value deserialized from
1581            /// the integer representation of enums.
1582            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    /// Configuration of the cluster survivability, e.g., for the case when network
1666    /// connectivity is lost.
1667    #[derive(Clone, Default, PartialEq)]
1668    #[non_exhaustive]
1669    pub struct SurvivabilityConfig {
1670        /// Optional. Time period that allows the cluster nodes to be rebooted and
1671        /// become functional without network connectivity to Google. The default 0
1672        /// means not allowed. The maximum is 7 days.
1673        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        /// Sets the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
1684        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        /// Sets or clears the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
1693        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    /// ConnectionState holds the current connection state from the cluster to
1709    /// Google.
1710    #[derive(Clone, Default, PartialEq)]
1711    #[non_exhaustive]
1712    pub struct ConnectionState {
1713        /// Output only. The current connection state.
1714        pub state: crate::model::cluster::connection_state::State,
1715
1716        /// Output only. The time when the connection state was last changed.
1717        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        /// Sets the value of [state][crate::model::cluster::ConnectionState::state].
1728        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        /// Sets the value of [update_time][crate::model::cluster::ConnectionState::update_time].
1737        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        /// Sets or clears the value of [update_time][crate::model::cluster::ConnectionState::update_time].
1746        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    /// Defines additional types related to [ConnectionState].
1762    pub mod connection_state {
1763        #[allow(unused_imports)]
1764        use super::*;
1765
1766        /// The connection state.
1767        ///
1768        /// # Working with unknown values
1769        ///
1770        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1771        /// additional enum variants at any time. Adding new variants is not considered
1772        /// a breaking change. Applications should write their code in anticipation of:
1773        ///
1774        /// - New values appearing in future releases of the client library, **and**
1775        /// - New values received dynamically, without application changes.
1776        ///
1777        /// Please consult the [Working with enums] section in the user guide for some
1778        /// guidelines.
1779        ///
1780        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1781        #[derive(Clone, Debug, PartialEq)]
1782        #[non_exhaustive]
1783        pub enum State {
1784            /// Unknown connection state.
1785            Unspecified,
1786            /// This cluster is currently disconnected from Google.
1787            Disconnected,
1788            /// This cluster is currently connected to Google.
1789            Connected,
1790            /// This cluster is currently connected to Google, but may have recently
1791            /// reconnected after a disconnection. It is still syncing back.
1792            ConnectedAndSyncing,
1793            /// If set, the enum was initialized with an unknown value.
1794            ///
1795            /// Applications can examine the value using [State::value] or
1796            /// [State::name].
1797            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            /// Gets the enum value.
1810            ///
1811            /// Returns `None` if the enum contains an unknown value deserialized from
1812            /// the string representation of enums.
1813            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            /// Gets the enum value as a string.
1824            ///
1825            /// Returns `None` if the enum contains an unknown value deserialized from
1826            /// the integer representation of enums.
1827            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    /// Indicates the status of the cluster.
1911    ///
1912    /// # Working with unknown values
1913    ///
1914    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1915    /// additional enum variants at any time. Adding new variants is not considered
1916    /// a breaking change. Applications should write their code in anticipation of:
1917    ///
1918    /// - New values appearing in future releases of the client library, **and**
1919    /// - New values received dynamically, without application changes.
1920    ///
1921    /// Please consult the [Working with enums] section in the user guide for some
1922    /// guidelines.
1923    ///
1924    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1925    #[derive(Clone, Debug, PartialEq)]
1926    #[non_exhaustive]
1927    pub enum Status {
1928        /// Status unknown.
1929        Unspecified,
1930        /// The cluster is being created.
1931        Provisioning,
1932        /// The cluster is created and fully usable.
1933        Running,
1934        /// The cluster is being deleted.
1935        Deleting,
1936        /// The status indicates that some errors occurred while reconciling/deleting
1937        /// the cluster.
1938        Error,
1939        /// The cluster is undergoing some work such as version upgrades, etc.
1940        Reconciling,
1941        /// If set, the enum was initialized with an unknown value.
1942        ///
1943        /// Applications can examine the value using [Status::value] or
1944        /// [Status::name].
1945        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        /// Gets the enum value.
1958        ///
1959        /// Returns `None` if the enum contains an unknown value deserialized from
1960        /// the string representation of enums.
1961        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        /// Gets the enum value as a string.
1974        ///
1975        /// Returns `None` if the enum contains an unknown value deserialized from
1976        /// the integer representation of enums.
1977        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    /// The release channel a cluster is subscribed to.
2065    ///
2066    /// # Working with unknown values
2067    ///
2068    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2069    /// additional enum variants at any time. Adding new variants is not considered
2070    /// a breaking change. Applications should write their code in anticipation of:
2071    ///
2072    /// - New values appearing in future releases of the client library, **and**
2073    /// - New values received dynamically, without application changes.
2074    ///
2075    /// Please consult the [Working with enums] section in the user guide for some
2076    /// guidelines.
2077    ///
2078    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2079    #[derive(Clone, Debug, PartialEq)]
2080    #[non_exhaustive]
2081    pub enum ReleaseChannel {
2082        /// Unspecified release channel. This will default to the REGULAR channel.
2083        Unspecified,
2084        /// No release channel.
2085        None,
2086        /// Regular release channel.
2087        Regular,
2088        /// If set, the enum was initialized with an unknown value.
2089        ///
2090        /// Applications can examine the value using [ReleaseChannel::value] or
2091        /// [ReleaseChannel::name].
2092        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        /// Gets the enum value.
2105        ///
2106        /// Returns `None` if the enum contains an unknown value deserialized from
2107        /// the string representation of enums.
2108        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        /// Gets the enum value as a string.
2118        ///
2119        /// Returns `None` if the enum contains an unknown value deserialized from
2120        /// the integer representation of enums.
2121        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/// Cluster-wide networking configuration.
2198#[derive(Clone, Default, PartialEq)]
2199#[non_exhaustive]
2200pub struct ClusterNetworking {
2201    /// Required. All pods in the cluster are assigned an RFC1918 IPv4 address from
2202    /// these blocks. Only a single block is supported. This field cannot be
2203    /// changed after creation.
2204    pub cluster_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
2205
2206    /// Required. All services in the cluster are assigned an RFC1918 IPv4 address
2207    /// from these blocks. Only a single block is supported. This field cannot be
2208    /// changed after creation.
2209    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    /// Sets the value of [cluster_ipv4_cidr_blocks][crate::model::ClusterNetworking::cluster_ipv4_cidr_blocks].
2220    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    /// Sets the value of [services_ipv4_cidr_blocks][crate::model::ClusterNetworking::services_ipv4_cidr_blocks].
2231    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/// Fleet related configuration.
2249///
2250/// Fleets are a Google Cloud concept for logically organizing clusters,
2251/// letting you use and manage multi-cluster capabilities and apply
2252/// consistent policies across your systems.
2253#[derive(Clone, Default, PartialEq)]
2254#[non_exhaustive]
2255pub struct Fleet {
2256    /// Required. The name of the Fleet host project where this cluster will be
2257    /// registered.
2258    ///
2259    /// Project names are formatted as
2260    /// `projects/<project-number>`.
2261    pub project: std::string::String,
2262
2263    /// Output only. The name of the managed Hub Membership resource associated to
2264    /// this cluster.
2265    ///
2266    /// Membership names are formatted as
2267    /// `projects/<project-number>/locations/global/membership/<cluster-id>`.
2268    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    /// Sets the value of [project][crate::model::Fleet::project].
2279    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    /// Sets the value of [membership][crate::model::Fleet::membership].
2285    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/// A user principal for an RBAC policy.
2298#[derive(Clone, Default, PartialEq)]
2299#[non_exhaustive]
2300pub struct ClusterUser {
2301    /// Required. An active Google username.
2302    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    /// Sets the value of [username][crate::model::ClusterUser::username].
2313    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/// RBAC policy that will be applied and managed by GEC.
2326#[derive(Clone, Default, PartialEq)]
2327#[non_exhaustive]
2328pub struct Authorization {
2329    /// Required. User that will be granted the cluster-admin role on the cluster,
2330    /// providing full access to the cluster. Currently, this is a singular field,
2331    /// but will be expanded to allow multiple admins in the future.
2332    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    /// Sets the value of [admin_users][crate::model::Authorization::admin_users].
2343    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    /// Sets or clears the value of [admin_users][crate::model::Authorization::admin_users].
2352    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/// A set of Kubernetes nodes in a cluster with common configuration and
2368/// specification.
2369#[derive(Clone, Default, PartialEq)]
2370#[non_exhaustive]
2371pub struct NodePool {
2372    /// Required. The resource name of the node pool.
2373    pub name: std::string::String,
2374
2375    /// Output only. The time when the node pool was created.
2376    pub create_time: std::option::Option<wkt::Timestamp>,
2377
2378    /// Output only. The time when the node pool was last updated.
2379    pub update_time: std::option::Option<wkt::Timestamp>,
2380
2381    /// Labels associated with this resource.
2382    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2383
2384    /// Name of the Google Distributed Cloud Edge zone where this node pool will be
2385    /// created. For example: `us-central1-edge-customer-a`.
2386    pub node_location: std::string::String,
2387
2388    /// Required. The number of nodes in the pool.
2389    pub node_count: i32,
2390
2391    /// Only machines matching this filter will be allowed to join the node pool.
2392    /// The filtering language accepts strings like "name=\<name\>", and is
2393    /// documented in more detail in [AIP-160](https://google.aip.dev/160).
2394    pub machine_filter: std::string::String,
2395
2396    /// Optional. Local disk encryption options. This field is only used when
2397    /// enabling CMEK support.
2398    pub local_disk_encryption: std::option::Option<crate::model::node_pool::LocalDiskEncryption>,
2399
2400    /// Output only. The lowest release version among all worker nodes.
2401    pub node_version: std::string::String,
2402
2403    /// Optional. Configuration for each node in the NodePool
2404    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    /// Sets the value of [name][crate::model::NodePool::name].
2415    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    /// Sets the value of [create_time][crate::model::NodePool::create_time].
2421    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    /// Sets or clears the value of [create_time][crate::model::NodePool::create_time].
2430    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    /// Sets the value of [update_time][crate::model::NodePool::update_time].
2439    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    /// Sets or clears the value of [update_time][crate::model::NodePool::update_time].
2448    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    /// Sets the value of [labels][crate::model::NodePool::labels].
2457    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    /// Sets the value of [node_location][crate::model::NodePool::node_location].
2469    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    /// Sets the value of [node_count][crate::model::NodePool::node_count].
2475    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    /// Sets the value of [machine_filter][crate::model::NodePool::machine_filter].
2481    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    /// Sets the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
2487    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    /// Sets or clears the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
2496    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    /// Sets the value of [node_version][crate::model::NodePool::node_version].
2505    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    /// Sets the value of [node_config][crate::model::NodePool::node_config].
2511    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    /// Sets or clears the value of [node_config][crate::model::NodePool::node_config].
2520    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
2535/// Defines additional types related to [NodePool].
2536pub mod node_pool {
2537    #[allow(unused_imports)]
2538    use super::*;
2539
2540    /// Configuration for CMEK support for edge machine local disk encryption.
2541    #[derive(Clone, Default, PartialEq)]
2542    #[non_exhaustive]
2543    pub struct LocalDiskEncryption {
2544        /// Optional. The Cloud KMS CryptoKey e.g.
2545        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
2546        /// to use for protecting node local disks. If not specified, a
2547        /// Google-managed key will be used instead.
2548        pub kms_key: std::string::String,
2549
2550        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
2551        /// protecting node local disks. Only applicable if kms_key is set.
2552        pub kms_key_active_version: std::string::String,
2553
2554        /// Output only. Availability of the Cloud KMS CryptoKey. If not
2555        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
2556        /// local data. This can be caused by a lack of permissions to use the key,
2557        /// or if the key is disabled or deleted.
2558        pub kms_key_state: crate::model::KmsKeyState,
2559
2560        /// Output only. Error status returned by Cloud KMS when using this key. This
2561        /// field may be populated only if `kms_key_state` is not
2562        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
2563        /// error status reported by Cloud KMS.
2564        pub kms_status: std::option::Option<rpc::model::Status>,
2565
2566        /// Output only. The current resource state associated with the cmek.
2567        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        /// Sets the value of [kms_key][crate::model::node_pool::LocalDiskEncryption::kms_key].
2578        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        /// Sets the value of [kms_key_active_version][crate::model::node_pool::LocalDiskEncryption::kms_key_active_version].
2584        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        /// Sets the value of [kms_key_state][crate::model::node_pool::LocalDiskEncryption::kms_key_state].
2593        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        /// Sets the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
2602        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        /// Sets or clears the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
2611        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        /// Sets the value of [resource_state][crate::model::node_pool::LocalDiskEncryption::resource_state].
2620        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    /// Configuration for each node in the NodePool
2636    #[derive(Clone, Default, PartialEq)]
2637    #[non_exhaustive]
2638    pub struct NodeConfig {
2639        /// Optional. The Kubernetes node labels
2640        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2641
2642        /// Optional. Name for the storage schema of worker nodes.
2643        ///
2644        /// Warning: Configurable node local storage schema feature is an
2645        /// experimental feature, and is not recommended for general use
2646        /// in production clusters/nodepools.
2647        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        /// Sets the value of [labels][crate::model::node_pool::NodeConfig::labels].
2658        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        /// Sets the value of [node_storage_schema][crate::model::node_pool::NodeConfig::node_storage_schema].
2670        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/// A Google Distributed Cloud Edge machine capable of acting as a Kubernetes
2687/// node.
2688#[derive(Clone, Default, PartialEq)]
2689#[non_exhaustive]
2690pub struct Machine {
2691    /// Required. The resource name of the machine.
2692    pub name: std::string::String,
2693
2694    /// Output only. The time when the node pool was created.
2695    pub create_time: std::option::Option<wkt::Timestamp>,
2696
2697    /// Output only. The time when the node pool was last updated.
2698    pub update_time: std::option::Option<wkt::Timestamp>,
2699
2700    /// Labels associated with this resource.
2701    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2702
2703    /// Canonical resource name of the node that this machine is responsible for
2704    /// hosting e.g.
2705    /// projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node},
2706    /// Or empty if the machine is not assigned to assume the role of a node.
2707    ///
2708    /// For control plane nodes hosted on edge machines, this will return
2709    /// the following format:
2710    /// "projects/{project}/locations/{location}/clusters/{cluster_id}/controlPlaneNodes/{node}".
2711    pub hosted_node: std::string::String,
2712
2713    /// The Google Distributed Cloud Edge zone of this machine.
2714    pub zone: std::string::String,
2715
2716    /// Output only. The software version of the machine.
2717    pub version: std::string::String,
2718
2719    /// Output only. Whether the machine is disabled. If disabled, the machine is
2720    /// unable to enter service.
2721    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    /// Sets the value of [name][crate::model::Machine::name].
2732    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    /// Sets the value of [create_time][crate::model::Machine::create_time].
2738    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    /// Sets or clears the value of [create_time][crate::model::Machine::create_time].
2747    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    /// Sets the value of [update_time][crate::model::Machine::update_time].
2756    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    /// Sets or clears the value of [update_time][crate::model::Machine::update_time].
2765    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    /// Sets the value of [labels][crate::model::Machine::labels].
2774    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    /// Sets the value of [hosted_node][crate::model::Machine::hosted_node].
2786    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    /// Sets the value of [zone][crate::model::Machine::zone].
2792    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    /// Sets the value of [version][crate::model::Machine::version].
2798    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    /// Sets the value of [disabled][crate::model::Machine::disabled].
2804    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/// A VPN connection .
2817#[derive(Clone, Default, PartialEq)]
2818#[non_exhaustive]
2819pub struct VpnConnection {
2820    /// Required. The resource name of VPN connection
2821    pub name: std::string::String,
2822
2823    /// Output only. The time when the VPN connection was created.
2824    pub create_time: std::option::Option<wkt::Timestamp>,
2825
2826    /// Output only. The time when the VPN connection was last updated.
2827    pub update_time: std::option::Option<wkt::Timestamp>,
2828
2829    /// Labels associated with this resource.
2830    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2831
2832    /// NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the
2833    /// customer needs to configure NAT such that only one external IP maps to the
2834    /// GMEC Anthos cluster. This is empty if NAT is not used.
2835    pub nat_gateway_ip: std::string::String,
2836
2837    /// Dynamic routing mode of the VPC network, `regional` or `global`.
2838    #[deprecated]
2839    pub bgp_routing_mode: crate::model::vpn_connection::BgpRoutingMode,
2840
2841    /// The canonical Cluster name to connect to. It is in the form of
2842    /// projects/{project}/locations/{location}/clusters/{cluster}.
2843    pub cluster: std::string::String,
2844
2845    /// The network ID of VPC to connect to.
2846    pub vpc: std::string::String,
2847
2848    /// Optional. Project detail of the VPC network. Required if VPC is in a
2849    /// different project than the cluster project.
2850    pub vpc_project: std::option::Option<crate::model::vpn_connection::VpcProject>,
2851
2852    /// Whether this VPN connection has HA enabled on cluster side. If enabled,
2853    /// when creating VPN connection we will attempt to use 2 ANG floating IPs.
2854    pub enable_high_availability: bool,
2855
2856    /// Optional. The VPN connection Cloud Router name.
2857    pub router: std::string::String,
2858
2859    /// Output only. The created connection details.
2860    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    /// Sets the value of [name][crate::model::VpnConnection::name].
2871    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    /// Sets the value of [create_time][crate::model::VpnConnection::create_time].
2877    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    /// Sets or clears the value of [create_time][crate::model::VpnConnection::create_time].
2886    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    /// Sets the value of [update_time][crate::model::VpnConnection::update_time].
2895    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    /// Sets or clears the value of [update_time][crate::model::VpnConnection::update_time].
2904    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    /// Sets the value of [labels][crate::model::VpnConnection::labels].
2913    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    /// Sets the value of [nat_gateway_ip][crate::model::VpnConnection::nat_gateway_ip].
2925    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    /// Sets the value of [bgp_routing_mode][crate::model::VpnConnection::bgp_routing_mode].
2931    #[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    /// Sets the value of [cluster][crate::model::VpnConnection::cluster].
2943    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    /// Sets the value of [vpc][crate::model::VpnConnection::vpc].
2949    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    /// Sets the value of [vpc_project][crate::model::VpnConnection::vpc_project].
2955    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    /// Sets or clears the value of [vpc_project][crate::model::VpnConnection::vpc_project].
2964    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    /// Sets the value of [enable_high_availability][crate::model::VpnConnection::enable_high_availability].
2973    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    /// Sets the value of [router][crate::model::VpnConnection::router].
2979    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    /// Sets the value of [details][crate::model::VpnConnection::details].
2985    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    /// Sets or clears the value of [details][crate::model::VpnConnection::details].
2994    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
3009/// Defines additional types related to [VpnConnection].
3010pub mod vpn_connection {
3011    #[allow(unused_imports)]
3012    use super::*;
3013
3014    /// Project detail of the VPC network.
3015    #[derive(Clone, Default, PartialEq)]
3016    #[non_exhaustive]
3017    pub struct VpcProject {
3018        /// The project of the VPC to connect to. If not specified, it is the same as
3019        /// the cluster project.
3020        pub project_id: std::string::String,
3021
3022        /// Optional. Deprecated: do not use.
3023        #[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        /// Sets the value of [project_id][crate::model::vpn_connection::VpcProject::project_id].
3035        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        /// Sets the value of [service_account][crate::model::vpn_connection::VpcProject::service_account].
3041        #[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    /// The created connection details.
3058    #[derive(Clone, Default, PartialEq)]
3059    #[non_exhaustive]
3060    pub struct Details {
3061        /// The state of this connection.
3062        pub state: crate::model::vpn_connection::details::State,
3063
3064        /// The error message. This is only populated when state=ERROR.
3065        pub error: std::string::String,
3066
3067        /// The Cloud Router info.
3068        pub cloud_router: std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
3069
3070        /// Each connection has multiple Cloud VPN gateways.
3071        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        /// Sets the value of [state][crate::model::vpn_connection::Details::state].
3082        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        /// Sets the value of [error][crate::model::vpn_connection::Details::error].
3091        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        /// Sets the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
3097        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        /// Sets or clears the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
3106        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        /// Sets the value of [cloud_vpns][crate::model::vpn_connection::Details::cloud_vpns].
3115        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    /// Defines additional types related to [Details].
3133    pub mod details {
3134        #[allow(unused_imports)]
3135        use super::*;
3136
3137        /// The Cloud Router info.
3138        #[derive(Clone, Default, PartialEq)]
3139        #[non_exhaustive]
3140        pub struct CloudRouter {
3141            /// The associated Cloud Router name.
3142            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            /// Sets the value of [name][crate::model::vpn_connection::details::CloudRouter::name].
3153            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        /// The Cloud VPN info.
3166        #[derive(Clone, Default, PartialEq)]
3167        #[non_exhaustive]
3168        pub struct CloudVpn {
3169            /// The created Cloud VPN gateway name.
3170            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            /// Sets the value of [gateway][crate::model::vpn_connection::details::CloudVpn::gateway].
3181            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        /// The current connection state.
3194        ///
3195        /// # Working with unknown values
3196        ///
3197        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3198        /// additional enum variants at any time. Adding new variants is not considered
3199        /// a breaking change. Applications should write their code in anticipation of:
3200        ///
3201        /// - New values appearing in future releases of the client library, **and**
3202        /// - New values received dynamically, without application changes.
3203        ///
3204        /// Please consult the [Working with enums] section in the user guide for some
3205        /// guidelines.
3206        ///
3207        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3208        #[derive(Clone, Debug, PartialEq)]
3209        #[non_exhaustive]
3210        pub enum State {
3211            /// Unknown.
3212            Unspecified,
3213            /// Connected.
3214            Connected,
3215            /// Still connecting.
3216            Connecting,
3217            /// Error occurred.
3218            Error,
3219            /// If set, the enum was initialized with an unknown value.
3220            ///
3221            /// Applications can examine the value using [State::value] or
3222            /// [State::name].
3223            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            /// Gets the enum value.
3236            ///
3237            /// Returns `None` if the enum contains an unknown value deserialized from
3238            /// the string representation of enums.
3239            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            /// Gets the enum value as a string.
3250            ///
3251            /// Returns `None` if the enum contains an unknown value deserialized from
3252            /// the integer representation of enums.
3253            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    /// Routing mode.
3337    ///
3338    /// # Working with unknown values
3339    ///
3340    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3341    /// additional enum variants at any time. Adding new variants is not considered
3342    /// a breaking change. Applications should write their code in anticipation of:
3343    ///
3344    /// - New values appearing in future releases of the client library, **and**
3345    /// - New values received dynamically, without application changes.
3346    ///
3347    /// Please consult the [Working with enums] section in the user guide for some
3348    /// guidelines.
3349    ///
3350    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3351    #[derive(Clone, Debug, PartialEq)]
3352    #[non_exhaustive]
3353    pub enum BgpRoutingMode {
3354        /// Unknown.
3355        Unspecified,
3356        /// Regional mode.
3357        Regional,
3358        /// Global mode.
3359        Global,
3360        /// If set, the enum was initialized with an unknown value.
3361        ///
3362        /// Applications can examine the value using [BgpRoutingMode::value] or
3363        /// [BgpRoutingMode::name].
3364        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        /// Gets the enum value.
3377        ///
3378        /// Returns `None` if the enum contains an unknown value deserialized from
3379        /// the string representation of enums.
3380        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        /// Gets the enum value as a string.
3390        ///
3391        /// Returns `None` if the enum contains an unknown value deserialized from
3392        /// the integer representation of enums.
3393        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/// Metadata for a given
3470/// [google.cloud.location.Location][google.cloud.location.Location].
3471///
3472/// [google.cloud.location.Location]: location::model::Location
3473#[derive(Clone, Default, PartialEq)]
3474#[non_exhaustive]
3475pub struct LocationMetadata {
3476    /// The set of available Google Distributed Cloud Edge zones in the location.
3477    /// The map is keyed by the lowercase ID of each zone.
3478    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    /// Sets the value of [available_zones][crate::model::LocationMetadata::available_zones].
3489    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/// A Google Distributed Cloud Edge zone where edge machines are located.
3508#[derive(Clone, Default, PartialEq)]
3509#[non_exhaustive]
3510pub struct ZoneMetadata {
3511    /// Quota for resources in this zone.
3512    pub quota: std::vec::Vec<crate::model::Quota>,
3513
3514    /// The map keyed by rack name and has value of RackType.
3515    pub rack_types:
3516        std::collections::HashMap<std::string::String, crate::model::zone_metadata::RackType>,
3517
3518    /// Config data for the zone.
3519    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    /// Sets the value of [quota][crate::model::ZoneMetadata::quota].
3530    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    /// Sets the value of [rack_types][crate::model::ZoneMetadata::rack_types].
3541    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    /// Sets the value of [config_data][crate::model::ZoneMetadata::config_data].
3553    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    /// Sets or clears the value of [config_data][crate::model::ZoneMetadata::config_data].
3562    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
3577/// Defines additional types related to [ZoneMetadata].
3578pub mod zone_metadata {
3579    #[allow(unused_imports)]
3580    use super::*;
3581
3582    /// Type of the rack.
3583    ///
3584    /// # Working with unknown values
3585    ///
3586    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3587    /// additional enum variants at any time. Adding new variants is not considered
3588    /// a breaking change. Applications should write their code in anticipation of:
3589    ///
3590    /// - New values appearing in future releases of the client library, **and**
3591    /// - New values received dynamically, without application changes.
3592    ///
3593    /// Please consult the [Working with enums] section in the user guide for some
3594    /// guidelines.
3595    ///
3596    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3597    #[derive(Clone, Debug, PartialEq)]
3598    #[non_exhaustive]
3599    pub enum RackType {
3600        /// Unspecified rack type, single rack also belongs to this type.
3601        Unspecified,
3602        /// Base rack type, a pair of two modified Config-1 racks containing
3603        /// Aggregation switches.
3604        Base,
3605        /// Expansion rack type, also known as standalone racks,
3606        /// added by customers on demand.
3607        Expansion,
3608        /// If set, the enum was initialized with an unknown value.
3609        ///
3610        /// Applications can examine the value using [RackType::value] or
3611        /// [RackType::name].
3612        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        /// Gets the enum value.
3625        ///
3626        /// Returns `None` if the enum contains an unknown value deserialized from
3627        /// the string representation of enums.
3628        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        /// Gets the enum value as a string.
3638        ///
3639        /// Returns `None` if the enum contains an unknown value deserialized from
3640        /// the integer representation of enums.
3641        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/// Config data holds all the config related data for the zone.
3718#[derive(Clone, Default, PartialEq)]
3719#[non_exhaustive]
3720pub struct ConfigData {
3721    /// list of available v4 ip pools for external loadbalancer
3722    pub available_external_lb_pools_ipv4: std::vec::Vec<std::string::String>,
3723
3724    /// list of available v6 ip pools for external loadbalancer
3725    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    /// Sets the value of [available_external_lb_pools_ipv4][crate::model::ConfigData::available_external_lb_pools_ipv4].
3736    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    /// Sets the value of [available_external_lb_pools_ipv6][crate::model::ConfigData::available_external_lb_pools_ipv6].
3747    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/// Represents quota for Edge Container resources.
3765#[derive(Clone, Default, PartialEq)]
3766#[non_exhaustive]
3767pub struct Quota {
3768    /// Name of the quota metric.
3769    pub metric: std::string::String,
3770
3771    /// Quota limit for this metric.
3772    pub limit: f64,
3773
3774    /// Current usage of this metric.
3775    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    /// Sets the value of [metric][crate::model::Quota::metric].
3786    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    /// Sets the value of [limit][crate::model::Quota::limit].
3792    pub fn set_limit<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3793        self.limit = v.into();
3794        self
3795    }
3796
3797    /// Sets the value of [usage][crate::model::Quota::usage].
3798    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/// Maintenance policy configuration.
3811#[derive(Clone, Default, PartialEq)]
3812#[non_exhaustive]
3813pub struct MaintenancePolicy {
3814    /// Specifies the maintenance window in which maintenance may be performed.
3815    pub window: std::option::Option<crate::model::MaintenanceWindow>,
3816
3817    /// Optional. Exclusions to automatic maintenance. Non-emergency maintenance
3818    /// should not occur in these windows. Each exclusion has a unique name and may
3819    /// be active or expired. The max number of maintenance exclusions allowed at a
3820    /// given time is 3.
3821    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    /// Sets the value of [window][crate::model::MaintenancePolicy::window].
3832    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    /// Sets or clears the value of [window][crate::model::MaintenancePolicy::window].
3841    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    /// Sets the value of [maintenance_exclusions][crate::model::MaintenancePolicy::maintenance_exclusions].
3850    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/// Maintenance window configuration
3868#[derive(Clone, Default, PartialEq)]
3869#[non_exhaustive]
3870pub struct MaintenanceWindow {
3871    /// Configuration of a recurring maintenance window.
3872    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    /// Sets the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
3883    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    /// Sets or clears the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
3892    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/// Represents an arbitrary window of time that recurs.
3908#[derive(Clone, Default, PartialEq)]
3909#[non_exhaustive]
3910pub struct RecurringTimeWindow {
3911    /// The window of the first recurrence.
3912    pub window: std::option::Option<crate::model::TimeWindow>,
3913
3914    /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
3915    /// this window recurs. They go on for the span of time between the start and
3916    /// end time.
3917    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    /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
3928    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    /// Sets or clears the value of [window][crate::model::RecurringTimeWindow::window].
3937    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    /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
3946    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/// Represents a maintenance exclusion window.
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct MaintenanceExclusionWindow {
3962    /// Optional. The time window.
3963    pub window: std::option::Option<crate::model::TimeWindow>,
3964
3965    /// Optional. A unique (per cluster) id for the window.
3966    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    /// Sets the value of [window][crate::model::MaintenanceExclusionWindow::window].
3977    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    /// Sets or clears the value of [window][crate::model::MaintenanceExclusionWindow::window].
3986    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    /// Sets the value of [id][crate::model::MaintenanceExclusionWindow::id].
3995    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/// Represents an arbitrary window of time.
4008#[derive(Clone, Default, PartialEq)]
4009#[non_exhaustive]
4010pub struct TimeWindow {
4011    /// The time that the window first starts.
4012    pub start_time: std::option::Option<wkt::Timestamp>,
4013
4014    /// The time that the window ends. The end time must take place after the
4015    /// start time.
4016    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    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
4027    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    /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
4036    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    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
4045    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    /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
4054    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/// Server configuration for supported versions and release channels.
4070#[derive(Clone, Default, PartialEq)]
4071#[non_exhaustive]
4072pub struct ServerConfig {
4073    /// Output only. Mapping from release channel to channel config.
4074    pub channels: std::collections::HashMap<std::string::String, crate::model::ChannelConfig>,
4075
4076    /// Output only. Supported versions, e.g.: ["1.4.0", "1.5.0"].
4077    pub versions: std::vec::Vec<crate::model::Version>,
4078
4079    /// Output only. Default version, e.g.: "1.4.0".
4080    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    /// Sets the value of [channels][crate::model::ServerConfig::channels].
4091    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    /// Sets the value of [versions][crate::model::ServerConfig::versions].
4103    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    /// Sets the value of [default_version][crate::model::ServerConfig::default_version].
4114    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/// Configuration for a release channel.
4127#[derive(Clone, Default, PartialEq)]
4128#[non_exhaustive]
4129pub struct ChannelConfig {
4130    /// Output only. Default version for this release channel, e.g.: "1.4.0".
4131    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    /// Sets the value of [default_version][crate::model::ChannelConfig::default_version].
4142    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/// Version of a cluster.
4155#[derive(Clone, Default, PartialEq)]
4156#[non_exhaustive]
4157pub struct Version {
4158    /// Output only. Name of the version, e.g.: "1.4.0".
4159    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    /// Sets the value of [name][crate::model::Version::name].
4170    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/// Long-running operation metadata for Edge Container API methods.
4183#[derive(Clone, Default, PartialEq)]
4184#[non_exhaustive]
4185pub struct OperationMetadata {
4186    /// The time the operation was created.
4187    pub create_time: std::option::Option<wkt::Timestamp>,
4188
4189    /// The time the operation finished running.
4190    pub end_time: std::option::Option<wkt::Timestamp>,
4191
4192    /// Server-defined resource path for the target of the operation.
4193    pub target: std::string::String,
4194
4195    /// The verb executed by the operation.
4196    pub verb: std::string::String,
4197
4198    /// Human-readable status of the operation, if any.
4199    pub status_message: std::string::String,
4200
4201    /// Identifies whether the user has requested cancellation of the operation.
4202    /// Operations that have successfully been cancelled have [Operation.error][]
4203    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4204    /// corresponding to `Code.CANCELLED`.
4205    ///
4206    /// [google.rpc.Status.code]: rpc::model::Status::code
4207    pub requested_cancellation: bool,
4208
4209    /// API version used to start the operation.
4210    pub api_version: std::string::String,
4211
4212    /// Warnings that do not block the operation, but still hold relevant
4213    /// information for the end user to receive.
4214    pub warnings: std::vec::Vec<std::string::String>,
4215
4216    /// Machine-readable status of the operation, if any.
4217    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    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4228    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    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4237    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    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4246    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    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4255    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    /// Sets the value of [target][crate::model::OperationMetadata::target].
4264    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    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4270    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    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4276    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    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4282    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    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4288    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    /// Sets the value of [warnings][crate::model::OperationMetadata::warnings].
4294    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    /// Sets the value of [status_reason][crate::model::OperationMetadata::status_reason].
4305    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
4322/// Defines additional types related to [OperationMetadata].
4323pub mod operation_metadata {
4324    #[allow(unused_imports)]
4325    use super::*;
4326
4327    /// Indicates the reason for the status of the operation.
4328    ///
4329    /// # Working with unknown values
4330    ///
4331    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4332    /// additional enum variants at any time. Adding new variants is not considered
4333    /// a breaking change. Applications should write their code in anticipation of:
4334    ///
4335    /// - New values appearing in future releases of the client library, **and**
4336    /// - New values received dynamically, without application changes.
4337    ///
4338    /// Please consult the [Working with enums] section in the user guide for some
4339    /// guidelines.
4340    ///
4341    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4342    #[derive(Clone, Debug, PartialEq)]
4343    #[non_exhaustive]
4344    pub enum StatusReason {
4345        /// Reason unknown.
4346        Unspecified,
4347        /// The cluster upgrade is currently paused.
4348        UpgradePaused,
4349        /// If set, the enum was initialized with an unknown value.
4350        ///
4351        /// Applications can examine the value using [StatusReason::value] or
4352        /// [StatusReason::name].
4353        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        /// Gets the enum value.
4366        ///
4367        /// Returns `None` if the enum contains an unknown value deserialized from
4368        /// the string representation of enums.
4369        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        /// Gets the enum value as a string.
4378        ///
4379        /// Returns `None` if the enum contains an unknown value deserialized from
4380        /// the integer representation of enums.
4381        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/// Lists clusters in a location.
4454#[derive(Clone, Default, PartialEq)]
4455#[non_exhaustive]
4456pub struct ListClustersRequest {
4457    /// Required. The parent location, which owns this collection of clusters.
4458    pub parent: std::string::String,
4459
4460    /// The maximum number of resources to list.
4461    pub page_size: i32,
4462
4463    /// A page token received from previous list request.
4464    /// A page token received from previous list request.
4465    pub page_token: std::string::String,
4466
4467    /// Only resources matching this filter will be listed.
4468    pub filter: std::string::String,
4469
4470    /// Specifies the order in which resources will be listed.
4471    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    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
4482    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    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
4488    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    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
4494    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    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
4500    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    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
4506    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/// List of clusters in a location.
4519#[derive(Clone, Default, PartialEq)]
4520#[non_exhaustive]
4521pub struct ListClustersResponse {
4522    /// Clusters in the location.
4523    pub clusters: std::vec::Vec<crate::model::Cluster>,
4524
4525    /// A token to retrieve next page of results.
4526    pub next_page_token: std::string::String,
4527
4528    /// Locations that could not be reached.
4529    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    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
4540    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    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
4551    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    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
4557    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/// Gets a cluster.
4589#[derive(Clone, Default, PartialEq)]
4590#[non_exhaustive]
4591pub struct GetClusterRequest {
4592    /// Required. The resource name of the cluster.
4593    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    /// Sets the value of [name][crate::model::GetClusterRequest::name].
4604    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/// Creates a cluster.
4617#[derive(Clone, Default, PartialEq)]
4618#[non_exhaustive]
4619pub struct CreateClusterRequest {
4620    /// Required. The parent location where this cluster will be created.
4621    pub parent: std::string::String,
4622
4623    /// Required. A client-specified unique identifier for the cluster.
4624    pub cluster_id: std::string::String,
4625
4626    /// Required. The cluster to create.
4627    pub cluster: std::option::Option<crate::model::Cluster>,
4628
4629    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4630    /// random UUID is recommended. This request is only idempotent if
4631    /// `request_id` is provided.
4632    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    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
4643    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    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
4649    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    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
4655    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    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
4664    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    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
4673    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/// Updates a cluster.
4686#[derive(Clone, Default, PartialEq)]
4687#[non_exhaustive]
4688pub struct UpdateClusterRequest {
4689    /// Field mask is used to specify the fields to be overwritten in the
4690    /// Cluster resource by the update.
4691    /// The fields specified in the update_mask are relative to the resource, not
4692    /// the full request. A field will be overwritten if it is in the mask. If the
4693    /// user does not provide a mask then all fields will be overwritten.
4694    pub update_mask: std::option::Option<wkt::FieldMask>,
4695
4696    /// The updated cluster.
4697    pub cluster: std::option::Option<crate::model::Cluster>,
4698
4699    /// A unique identifier for this request. Restricted to 36 ASCII characters.
4700    /// A random UUID is recommended.
4701    /// This request is only idempotent if `request_id` is provided.
4702    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    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
4713    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    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
4722    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    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
4731    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    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
4740    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    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
4749    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/// Upgrades a cluster.
4762#[derive(Clone, Default, PartialEq)]
4763#[non_exhaustive]
4764pub struct UpgradeClusterRequest {
4765    /// Required. The resource name of the cluster.
4766    pub name: std::string::String,
4767
4768    /// Required. The version the cluster is going to be upgraded to.
4769    pub target_version: std::string::String,
4770
4771    /// The schedule for the upgrade.
4772    pub schedule: crate::model::upgrade_cluster_request::Schedule,
4773
4774    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4775    /// random UUID is recommended. This request is only idempotent if
4776    /// `request_id` is provided.
4777    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    /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
4788    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    /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
4794    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    /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
4800    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    /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
4809    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
4821/// Defines additional types related to [UpgradeClusterRequest].
4822pub mod upgrade_cluster_request {
4823    #[allow(unused_imports)]
4824    use super::*;
4825
4826    /// Represents the schedule about when the cluster is going to be upgraded.
4827    ///
4828    /// # Working with unknown values
4829    ///
4830    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4831    /// additional enum variants at any time. Adding new variants is not considered
4832    /// a breaking change. Applications should write their code in anticipation of:
4833    ///
4834    /// - New values appearing in future releases of the client library, **and**
4835    /// - New values received dynamically, without application changes.
4836    ///
4837    /// Please consult the [Working with enums] section in the user guide for some
4838    /// guidelines.
4839    ///
4840    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4841    #[derive(Clone, Debug, PartialEq)]
4842    #[non_exhaustive]
4843    pub enum Schedule {
4844        /// Unspecified. The default is to upgrade the cluster immediately which is
4845        /// the only option today.
4846        Unspecified,
4847        /// The cluster is going to be upgraded immediately after receiving the
4848        /// request.
4849        Immediately,
4850        /// If set, the enum was initialized with an unknown value.
4851        ///
4852        /// Applications can examine the value using [Schedule::value] or
4853        /// [Schedule::name].
4854        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        /// Gets the enum value.
4867        ///
4868        /// Returns `None` if the enum contains an unknown value deserialized from
4869        /// the string representation of enums.
4870        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        /// Gets the enum value as a string.
4879        ///
4880        /// Returns `None` if the enum contains an unknown value deserialized from
4881        /// the integer representation of enums.
4882        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/// Deletes a cluster.
4955#[derive(Clone, Default, PartialEq)]
4956#[non_exhaustive]
4957pub struct DeleteClusterRequest {
4958    /// Required. The resource name of the cluster.
4959    pub name: std::string::String,
4960
4961    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4962    /// random UUID is recommended. This request is only idempotent if
4963    /// `request_id` is provided.
4964    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    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
4975    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    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
4981    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/// Generates an access token for a cluster.
4994#[derive(Clone, Default, PartialEq)]
4995#[non_exhaustive]
4996pub struct GenerateAccessTokenRequest {
4997    /// Required. The resource name of the cluster.
4998    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    /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
5009    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/// An access token for a cluster.
5022#[derive(Clone, Default, PartialEq)]
5023#[non_exhaustive]
5024pub struct GenerateAccessTokenResponse {
5025    /// Output only. Access token to authenticate to k8s api-server.
5026    pub access_token: std::string::String,
5027
5028    /// Output only. Timestamp at which the token will expire.
5029    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    /// Sets the value of [access_token][crate::model::GenerateAccessTokenResponse::access_token].
5040    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    /// Sets the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
5046    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    /// Sets or clears the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
5055    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/// Generates an offline credential(offline) for a cluster.
5071#[derive(Clone, Default, PartialEq)]
5072#[non_exhaustive]
5073pub struct GenerateOfflineCredentialRequest {
5074    /// Required. The resource name of the cluster.
5075    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    /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
5086    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/// An offline credential for a cluster.
5099#[derive(Clone, Default, PartialEq)]
5100#[non_exhaustive]
5101pub struct GenerateOfflineCredentialResponse {
5102    /// Output only. Client certificate to authenticate to k8s api-server.
5103    pub client_certificate: std::string::String,
5104
5105    /// Output only. Client private key to authenticate to k8s api-server.
5106    pub client_key: std::string::String,
5107
5108    /// Output only. Client's identity.
5109    pub user_id: std::string::String,
5110
5111    /// Output only. Timestamp at which this credential will expire.
5112    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    /// Sets the value of [client_certificate][crate::model::GenerateOfflineCredentialResponse::client_certificate].
5123    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    /// Sets the value of [client_key][crate::model::GenerateOfflineCredentialResponse::client_key].
5132    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    /// Sets the value of [user_id][crate::model::GenerateOfflineCredentialResponse::user_id].
5138    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    /// Sets the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
5144    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    /// Sets or clears the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
5153    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/// Lists node pools in a cluster.
5169#[derive(Clone, Default, PartialEq)]
5170#[non_exhaustive]
5171pub struct ListNodePoolsRequest {
5172    /// Required. The parent cluster, which owns this collection of node pools.
5173    pub parent: std::string::String,
5174
5175    /// The maximum number of resources to list.
5176    pub page_size: i32,
5177
5178    /// A page token received from previous list request.
5179    pub page_token: std::string::String,
5180
5181    /// Only resources matching this filter will be listed.
5182    pub filter: std::string::String,
5183
5184    /// Specifies the order in which resources will be listed.
5185    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    /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
5196    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    /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
5202    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    /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
5208    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    /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
5214    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    /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
5220    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/// List of node pools in a cluster.
5233#[derive(Clone, Default, PartialEq)]
5234#[non_exhaustive]
5235pub struct ListNodePoolsResponse {
5236    /// Node pools in the cluster.
5237    pub node_pools: std::vec::Vec<crate::model::NodePool>,
5238
5239    /// A token to retrieve next page of results.
5240    pub next_page_token: std::string::String,
5241
5242    /// Locations that could not be reached.
5243    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    /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
5254    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    /// Sets the value of [next_page_token][crate::model::ListNodePoolsResponse::next_page_token].
5265    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    /// Sets the value of [unreachable][crate::model::ListNodePoolsResponse::unreachable].
5271    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/// Gets a node pool.
5303#[derive(Clone, Default, PartialEq)]
5304#[non_exhaustive]
5305pub struct GetNodePoolRequest {
5306    /// Required. The resource name of the node pool.
5307    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    /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
5318    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/// Creates a node pool.
5331#[derive(Clone, Default, PartialEq)]
5332#[non_exhaustive]
5333pub struct CreateNodePoolRequest {
5334    /// Required. The parent cluster where this node pool will be created.
5335    pub parent: std::string::String,
5336
5337    /// Required. A client-specified unique identifier for the node pool.
5338    pub node_pool_id: std::string::String,
5339
5340    /// Required. The node pool to create.
5341    pub node_pool: std::option::Option<crate::model::NodePool>,
5342
5343    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5344    /// random UUID is recommended. This request is only idempotent if
5345    /// `request_id` is provided.
5346    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    /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
5357    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    /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
5363    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    /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
5369    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    /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
5378    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    /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
5387    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/// Updates a node pool.
5400#[derive(Clone, Default, PartialEq)]
5401#[non_exhaustive]
5402pub struct UpdateNodePoolRequest {
5403    /// Field mask is used to specify the fields to be overwritten in the
5404    /// NodePool resource by the update.
5405    /// The fields specified in the update_mask are relative to the resource, not
5406    /// the full request. A field will be overwritten if it is in the mask. If the
5407    /// user does not provide a mask then all fields will be overwritten.
5408    pub update_mask: std::option::Option<wkt::FieldMask>,
5409
5410    /// The updated node pool.
5411    pub node_pool: std::option::Option<crate::model::NodePool>,
5412
5413    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5414    /// random UUID is recommended. This request is only idempotent if
5415    /// `request_id` is provided.
5416    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    /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
5427    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    /// Sets or clears the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
5436    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    /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
5445    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    /// Sets or clears the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
5454    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    /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
5463    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/// Deletes a node pool.
5476#[derive(Clone, Default, PartialEq)]
5477#[non_exhaustive]
5478pub struct DeleteNodePoolRequest {
5479    /// Required. The resource name of the node pool.
5480    pub name: std::string::String,
5481
5482    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5483    /// random UUID is recommended. This request is only idempotent if
5484    /// `request_id` is provided.
5485    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    /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
5496    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    /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
5502    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/// Lists machines in a site.
5515#[derive(Clone, Default, PartialEq)]
5516#[non_exhaustive]
5517pub struct ListMachinesRequest {
5518    /// Required. The parent site, which owns this collection of machines.
5519    pub parent: std::string::String,
5520
5521    /// The maximum number of resources to list.
5522    pub page_size: i32,
5523
5524    /// A page token received from previous list request.
5525    pub page_token: std::string::String,
5526
5527    /// Only resources matching this filter will be listed.
5528    pub filter: std::string::String,
5529
5530    /// Specifies the order in which resources will be listed.
5531    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    /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
5542    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    /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
5548    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    /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
5554    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    /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
5560    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    /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
5566    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/// List of machines in a site.
5579#[derive(Clone, Default, PartialEq)]
5580#[non_exhaustive]
5581pub struct ListMachinesResponse {
5582    /// Machines in the site.
5583    pub machines: std::vec::Vec<crate::model::Machine>,
5584
5585    /// A token to retrieve next page of results.
5586    pub next_page_token: std::string::String,
5587
5588    /// Locations that could not be reached.
5589    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    /// Sets the value of [machines][crate::model::ListMachinesResponse::machines].
5600    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    /// Sets the value of [next_page_token][crate::model::ListMachinesResponse::next_page_token].
5611    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    /// Sets the value of [unreachable][crate::model::ListMachinesResponse::unreachable].
5617    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/// Gets a machine.
5649#[derive(Clone, Default, PartialEq)]
5650#[non_exhaustive]
5651pub struct GetMachineRequest {
5652    /// Required. The resource name of the machine.
5653    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    /// Sets the value of [name][crate::model::GetMachineRequest::name].
5664    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/// Lists VPN connections.
5677#[derive(Clone, Default, PartialEq)]
5678#[non_exhaustive]
5679pub struct ListVpnConnectionsRequest {
5680    /// Required. The parent location, which owns this collection of VPN
5681    /// connections.
5682    pub parent: std::string::String,
5683
5684    /// The maximum number of resources to list.
5685    pub page_size: i32,
5686
5687    /// A page token received from previous list request.
5688    pub page_token: std::string::String,
5689
5690    /// Only resources matching this filter will be listed.
5691    pub filter: std::string::String,
5692
5693    /// Specifies the order in which resources will be listed.
5694    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    /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
5705    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    /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
5711    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    /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
5717    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    /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
5723    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    /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
5729    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/// List of VPN connections in a location.
5742#[derive(Clone, Default, PartialEq)]
5743#[non_exhaustive]
5744pub struct ListVpnConnectionsResponse {
5745    /// VpnConnections in the location.
5746    pub vpn_connections: std::vec::Vec<crate::model::VpnConnection>,
5747
5748    /// A token to retrieve next page of results.
5749    pub next_page_token: std::string::String,
5750
5751    /// Locations that could not be reached.
5752    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    /// Sets the value of [vpn_connections][crate::model::ListVpnConnectionsResponse::vpn_connections].
5763    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    /// Sets the value of [next_page_token][crate::model::ListVpnConnectionsResponse::next_page_token].
5774    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    /// Sets the value of [unreachable][crate::model::ListVpnConnectionsResponse::unreachable].
5780    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/// Gets a VPN connection.
5812#[derive(Clone, Default, PartialEq)]
5813#[non_exhaustive]
5814pub struct GetVpnConnectionRequest {
5815    /// Required. The resource name of the vpn connection.
5816    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    /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
5827    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/// Creates a VPN connection.
5840#[derive(Clone, Default, PartialEq)]
5841#[non_exhaustive]
5842pub struct CreateVpnConnectionRequest {
5843    /// Required. The parent location where this vpn connection will be created.
5844    pub parent: std::string::String,
5845
5846    /// Required. The VPN connection identifier.
5847    pub vpn_connection_id: std::string::String,
5848
5849    /// Required. The VPN connection to create.
5850    pub vpn_connection: std::option::Option<crate::model::VpnConnection>,
5851
5852    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5853    /// random UUID is recommended. This request is only idempotent if
5854    /// `request_id` is provided.
5855    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    /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
5866    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    /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
5872    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    /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
5881    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    /// Sets or clears the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
5890    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    /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
5899    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/// Deletes a vpn connection.
5912#[derive(Clone, Default, PartialEq)]
5913#[non_exhaustive]
5914pub struct DeleteVpnConnectionRequest {
5915    /// Required. The resource name of the vpn connection.
5916    pub name: std::string::String,
5917
5918    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5919    /// random UUID is recommended. This request is only idempotent if
5920    /// `request_id` is provided.
5921    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    /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
5932    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    /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
5938    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/// Gets the server config.
5951#[derive(Clone, Default, PartialEq)]
5952#[non_exhaustive]
5953pub struct GetServerConfigRequest {
5954    /// Required. The name (project and location) of the server config to get,
5955    /// specified in the format `projects/*/locations/*`.
5956    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    /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
5967    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/// Represents the accessibility state of a customer-managed KMS key used for
5980/// CMEK integration.
5981///
5982/// # Working with unknown values
5983///
5984/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5985/// additional enum variants at any time. Adding new variants is not considered
5986/// a breaking change. Applications should write their code in anticipation of:
5987///
5988/// - New values appearing in future releases of the client library, **and**
5989/// - New values received dynamically, without application changes.
5990///
5991/// Please consult the [Working with enums] section in the user guide for some
5992/// guidelines.
5993///
5994/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5995#[derive(Clone, Debug, PartialEq)]
5996#[non_exhaustive]
5997pub enum KmsKeyState {
5998    /// Unspecified.
5999    Unspecified,
6000    /// The key is available for use, and dependent resources should be accessible.
6001    KeyAvailable,
6002    /// The key is unavailable for an unspecified reason. Dependent resources may
6003    /// be inaccessible.
6004    KeyUnavailable,
6005    /// If set, the enum was initialized with an unknown value.
6006    ///
6007    /// Applications can examine the value using [KmsKeyState::value] or
6008    /// [KmsKeyState::name].
6009    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    /// Gets the enum value.
6022    ///
6023    /// Returns `None` if the enum contains an unknown value deserialized from
6024    /// the string representation of enums.
6025    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    /// Gets the enum value as a string.
6035    ///
6036    /// Returns `None` if the enum contains an unknown value deserialized from
6037    /// the integer representation of enums.
6038    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/// Represents if the resource is in lock down state or pending.
6114///
6115/// # Working with unknown values
6116///
6117/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6118/// additional enum variants at any time. Adding new variants is not considered
6119/// a breaking change. Applications should write their code in anticipation of:
6120///
6121/// - New values appearing in future releases of the client library, **and**
6122/// - New values received dynamically, without application changes.
6123///
6124/// Please consult the [Working with enums] section in the user guide for some
6125/// guidelines.
6126///
6127/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6128#[derive(Clone, Debug, PartialEq)]
6129#[non_exhaustive]
6130pub enum ResourceState {
6131    /// Default value.
6132    Unspecified,
6133    /// The resource is in LOCK DOWN state.
6134    LockDown,
6135    /// The resource is pending lock down.
6136    LockDownPending,
6137    /// If set, the enum was initialized with an unknown value.
6138    ///
6139    /// Applications can examine the value using [ResourceState::value] or
6140    /// [ResourceState::name].
6141    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    /// Gets the enum value.
6154    ///
6155    /// Returns `None` if the enum contains an unknown value deserialized from
6156    /// the string representation of enums.
6157    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    /// Gets the enum value as a string.
6167    ///
6168    /// Returns `None` if the enum contains an unknown value deserialized from
6169    /// the integer representation of enums.
6170    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}