Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A Google Distributed Cloud Edge Kubernetes cluster.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Cluster {
43    /// Required. The resource name of the cluster.
44    pub name: std::string::String,
45
46    /// Output only. The time when the cluster was created.
47    pub create_time: std::option::Option<wkt::Timestamp>,
48
49    /// Output only. The time when the cluster was last updated.
50    pub update_time: std::option::Option<wkt::Timestamp>,
51
52    /// Labels associated with this resource.
53    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
54
55    /// Required. Fleet configuration.
56    pub fleet: std::option::Option<crate::model::Fleet>,
57
58    /// Required. Cluster-wide networking configuration.
59    pub networking: std::option::Option<crate::model::ClusterNetworking>,
60
61    /// Required. Immutable. RBAC policy that will be applied and managed by GEC.
62    pub authorization: std::option::Option<crate::model::Authorization>,
63
64    /// Optional. The default maximum number of pods per node used if a maximum
65    /// value is not specified explicitly for a node pool in this cluster. If
66    /// unspecified, the Kubernetes default value will be used.
67    pub default_max_pods_per_node: i32,
68
69    /// Output only. The IP address of the Kubernetes API server.
70    pub endpoint: std::string::String,
71
72    /// Output only. The port number of the Kubernetes API server.
73    pub port: i32,
74
75    /// Output only. The PEM-encoded public certificate of the cluster's CA.
76    pub cluster_ca_certificate: std::string::String,
77
78    /// Optional. Cluster-wide maintenance policy configuration.
79    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
80
81    /// Output only. The control plane release version
82    pub control_plane_version: std::string::String,
83
84    /// Output only. The lowest release version among all worker nodes. This field
85    /// can be empty if the cluster does not have any worker nodes.
86    pub node_version: std::string::String,
87
88    /// Optional. The configuration of the cluster control plane.
89    pub control_plane: std::option::Option<crate::model::cluster::ControlPlane>,
90
91    /// Optional. The configuration of the system add-ons.
92    pub system_addons_config: std::option::Option<crate::model::cluster::SystemAddonsConfig>,
93
94    /// Optional. IPv4 address pools for cluster data plane external load
95    /// balancing.
96    pub external_load_balancer_ipv4_address_pools: std::vec::Vec<std::string::String>,
97
98    /// Optional. Remote control plane disk encryption options. This field is only
99    /// used when enabling CMEK support.
100    pub control_plane_encryption:
101        std::option::Option<crate::model::cluster::ControlPlaneEncryption>,
102
103    /// Output only. The current status of the cluster.
104    pub status: crate::model::cluster::Status,
105
106    /// Output only. All the maintenance events scheduled for the cluster,
107    /// including the ones ongoing, planned for the future and done in the past (up
108    /// to 90 days).
109    pub maintenance_events: std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
110
111    /// Optional. The target cluster version. For example: "1.5.0".
112    pub target_version: std::string::String,
113
114    /// Optional. The release channel a cluster is subscribed to.
115    pub release_channel: crate::model::cluster::ReleaseChannel,
116
117    /// Optional. Configuration of the cluster survivability, e.g., for the case
118    /// when network connectivity is lost. Note: This only applies to local control
119    /// plane clusters.
120    pub survivability_config: std::option::Option<crate::model::cluster::SurvivabilityConfig>,
121
122    /// Optional. IPv6 address pools for cluster data plane external load
123    /// balancing.
124    pub external_load_balancer_ipv6_address_pools: std::vec::Vec<std::string::String>,
125
126    /// Output only. The current connection state of the cluster.
127    pub connection_state: std::option::Option<crate::model::cluster::ConnectionState>,
128
129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
130}
131
132impl Cluster {
133    pub fn new() -> Self {
134        std::default::Default::default()
135    }
136
137    /// Sets the value of [name][crate::model::Cluster::name].
138    ///
139    /// # Example
140    /// ```ignore,no_run
141    /// # use google_cloud_edgecontainer_v1::model::Cluster;
142    /// let x = Cluster::new().set_name("example");
143    /// ```
144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145        self.name = v.into();
146        self
147    }
148
149    /// Sets the value of [create_time][crate::model::Cluster::create_time].
150    ///
151    /// # Example
152    /// ```ignore,no_run
153    /// # use google_cloud_edgecontainer_v1::model::Cluster;
154    /// use wkt::Timestamp;
155    /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
156    /// ```
157    pub fn set_create_time<T>(mut self, v: T) -> Self
158    where
159        T: std::convert::Into<wkt::Timestamp>,
160    {
161        self.create_time = std::option::Option::Some(v.into());
162        self
163    }
164
165    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
166    ///
167    /// # Example
168    /// ```ignore,no_run
169    /// # use google_cloud_edgecontainer_v1::model::Cluster;
170    /// use wkt::Timestamp;
171    /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
172    /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
173    /// ```
174    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
175    where
176        T: std::convert::Into<wkt::Timestamp>,
177    {
178        self.create_time = v.map(|x| x.into());
179        self
180    }
181
182    /// Sets the value of [update_time][crate::model::Cluster::update_time].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_edgecontainer_v1::model::Cluster;
187    /// use wkt::Timestamp;
188    /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
189    /// ```
190    pub fn set_update_time<T>(mut self, v: T) -> Self
191    where
192        T: std::convert::Into<wkt::Timestamp>,
193    {
194        self.update_time = std::option::Option::Some(v.into());
195        self
196    }
197
198    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
199    ///
200    /// # Example
201    /// ```ignore,no_run
202    /// # use google_cloud_edgecontainer_v1::model::Cluster;
203    /// use wkt::Timestamp;
204    /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
205    /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
206    /// ```
207    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
208    where
209        T: std::convert::Into<wkt::Timestamp>,
210    {
211        self.update_time = v.map(|x| x.into());
212        self
213    }
214
215    /// Sets the value of [labels][crate::model::Cluster::labels].
216    ///
217    /// # Example
218    /// ```ignore,no_run
219    /// # use google_cloud_edgecontainer_v1::model::Cluster;
220    /// let x = Cluster::new().set_labels([
221    ///     ("key0", "abc"),
222    ///     ("key1", "xyz"),
223    /// ]);
224    /// ```
225    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
226    where
227        T: std::iter::IntoIterator<Item = (K, V)>,
228        K: std::convert::Into<std::string::String>,
229        V: std::convert::Into<std::string::String>,
230    {
231        use std::iter::Iterator;
232        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
233        self
234    }
235
236    /// Sets the value of [fleet][crate::model::Cluster::fleet].
237    ///
238    /// # Example
239    /// ```ignore,no_run
240    /// # use google_cloud_edgecontainer_v1::model::Cluster;
241    /// use google_cloud_edgecontainer_v1::model::Fleet;
242    /// let x = Cluster::new().set_fleet(Fleet::default()/* use setters */);
243    /// ```
244    pub fn set_fleet<T>(mut self, v: T) -> Self
245    where
246        T: std::convert::Into<crate::model::Fleet>,
247    {
248        self.fleet = std::option::Option::Some(v.into());
249        self
250    }
251
252    /// Sets or clears the value of [fleet][crate::model::Cluster::fleet].
253    ///
254    /// # Example
255    /// ```ignore,no_run
256    /// # use google_cloud_edgecontainer_v1::model::Cluster;
257    /// use google_cloud_edgecontainer_v1::model::Fleet;
258    /// let x = Cluster::new().set_or_clear_fleet(Some(Fleet::default()/* use setters */));
259    /// let x = Cluster::new().set_or_clear_fleet(None::<Fleet>);
260    /// ```
261    pub fn set_or_clear_fleet<T>(mut self, v: std::option::Option<T>) -> Self
262    where
263        T: std::convert::Into<crate::model::Fleet>,
264    {
265        self.fleet = v.map(|x| x.into());
266        self
267    }
268
269    /// Sets the value of [networking][crate::model::Cluster::networking].
270    ///
271    /// # Example
272    /// ```ignore,no_run
273    /// # use google_cloud_edgecontainer_v1::model::Cluster;
274    /// use google_cloud_edgecontainer_v1::model::ClusterNetworking;
275    /// let x = Cluster::new().set_networking(ClusterNetworking::default()/* use setters */);
276    /// ```
277    pub fn set_networking<T>(mut self, v: T) -> Self
278    where
279        T: std::convert::Into<crate::model::ClusterNetworking>,
280    {
281        self.networking = std::option::Option::Some(v.into());
282        self
283    }
284
285    /// Sets or clears the value of [networking][crate::model::Cluster::networking].
286    ///
287    /// # Example
288    /// ```ignore,no_run
289    /// # use google_cloud_edgecontainer_v1::model::Cluster;
290    /// use google_cloud_edgecontainer_v1::model::ClusterNetworking;
291    /// let x = Cluster::new().set_or_clear_networking(Some(ClusterNetworking::default()/* use setters */));
292    /// let x = Cluster::new().set_or_clear_networking(None::<ClusterNetworking>);
293    /// ```
294    pub fn set_or_clear_networking<T>(mut self, v: std::option::Option<T>) -> Self
295    where
296        T: std::convert::Into<crate::model::ClusterNetworking>,
297    {
298        self.networking = v.map(|x| x.into());
299        self
300    }
301
302    /// Sets the value of [authorization][crate::model::Cluster::authorization].
303    ///
304    /// # Example
305    /// ```ignore,no_run
306    /// # use google_cloud_edgecontainer_v1::model::Cluster;
307    /// use google_cloud_edgecontainer_v1::model::Authorization;
308    /// let x = Cluster::new().set_authorization(Authorization::default()/* use setters */);
309    /// ```
310    pub fn set_authorization<T>(mut self, v: T) -> Self
311    where
312        T: std::convert::Into<crate::model::Authorization>,
313    {
314        self.authorization = std::option::Option::Some(v.into());
315        self
316    }
317
318    /// Sets or clears the value of [authorization][crate::model::Cluster::authorization].
319    ///
320    /// # Example
321    /// ```ignore,no_run
322    /// # use google_cloud_edgecontainer_v1::model::Cluster;
323    /// use google_cloud_edgecontainer_v1::model::Authorization;
324    /// let x = Cluster::new().set_or_clear_authorization(Some(Authorization::default()/* use setters */));
325    /// let x = Cluster::new().set_or_clear_authorization(None::<Authorization>);
326    /// ```
327    pub fn set_or_clear_authorization<T>(mut self, v: std::option::Option<T>) -> Self
328    where
329        T: std::convert::Into<crate::model::Authorization>,
330    {
331        self.authorization = v.map(|x| x.into());
332        self
333    }
334
335    /// Sets the value of [default_max_pods_per_node][crate::model::Cluster::default_max_pods_per_node].
336    ///
337    /// # Example
338    /// ```ignore,no_run
339    /// # use google_cloud_edgecontainer_v1::model::Cluster;
340    /// let x = Cluster::new().set_default_max_pods_per_node(42);
341    /// ```
342    pub fn set_default_max_pods_per_node<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
343        self.default_max_pods_per_node = v.into();
344        self
345    }
346
347    /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
348    ///
349    /// # Example
350    /// ```ignore,no_run
351    /// # use google_cloud_edgecontainer_v1::model::Cluster;
352    /// let x = Cluster::new().set_endpoint("example");
353    /// ```
354    pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
355        self.endpoint = v.into();
356        self
357    }
358
359    /// Sets the value of [port][crate::model::Cluster::port].
360    ///
361    /// # Example
362    /// ```ignore,no_run
363    /// # use google_cloud_edgecontainer_v1::model::Cluster;
364    /// let x = Cluster::new().set_port(42);
365    /// ```
366    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
367        self.port = v.into();
368        self
369    }
370
371    /// Sets the value of [cluster_ca_certificate][crate::model::Cluster::cluster_ca_certificate].
372    ///
373    /// # Example
374    /// ```ignore,no_run
375    /// # use google_cloud_edgecontainer_v1::model::Cluster;
376    /// let x = Cluster::new().set_cluster_ca_certificate("example");
377    /// ```
378    pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
379        mut self,
380        v: T,
381    ) -> Self {
382        self.cluster_ca_certificate = v.into();
383        self
384    }
385
386    /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
387    ///
388    /// # Example
389    /// ```ignore,no_run
390    /// # use google_cloud_edgecontainer_v1::model::Cluster;
391    /// use google_cloud_edgecontainer_v1::model::MaintenancePolicy;
392    /// let x = Cluster::new().set_maintenance_policy(MaintenancePolicy::default()/* use setters */);
393    /// ```
394    pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
395    where
396        T: std::convert::Into<crate::model::MaintenancePolicy>,
397    {
398        self.maintenance_policy = std::option::Option::Some(v.into());
399        self
400    }
401
402    /// Sets or clears the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
403    ///
404    /// # Example
405    /// ```ignore,no_run
406    /// # use google_cloud_edgecontainer_v1::model::Cluster;
407    /// use google_cloud_edgecontainer_v1::model::MaintenancePolicy;
408    /// let x = Cluster::new().set_or_clear_maintenance_policy(Some(MaintenancePolicy::default()/* use setters */));
409    /// let x = Cluster::new().set_or_clear_maintenance_policy(None::<MaintenancePolicy>);
410    /// ```
411    pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
412    where
413        T: std::convert::Into<crate::model::MaintenancePolicy>,
414    {
415        self.maintenance_policy = v.map(|x| x.into());
416        self
417    }
418
419    /// Sets the value of [control_plane_version][crate::model::Cluster::control_plane_version].
420    ///
421    /// # Example
422    /// ```ignore,no_run
423    /// # use google_cloud_edgecontainer_v1::model::Cluster;
424    /// let x = Cluster::new().set_control_plane_version("example");
425    /// ```
426    pub fn set_control_plane_version<T: std::convert::Into<std::string::String>>(
427        mut self,
428        v: T,
429    ) -> Self {
430        self.control_plane_version = v.into();
431        self
432    }
433
434    /// Sets the value of [node_version][crate::model::Cluster::node_version].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_edgecontainer_v1::model::Cluster;
439    /// let x = Cluster::new().set_node_version("example");
440    /// ```
441    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
442        self.node_version = v.into();
443        self
444    }
445
446    /// Sets the value of [control_plane][crate::model::Cluster::control_plane].
447    ///
448    /// # Example
449    /// ```ignore,no_run
450    /// # use google_cloud_edgecontainer_v1::model::Cluster;
451    /// use google_cloud_edgecontainer_v1::model::cluster::ControlPlane;
452    /// let x = Cluster::new().set_control_plane(ControlPlane::default()/* use setters */);
453    /// ```
454    pub fn set_control_plane<T>(mut self, v: T) -> Self
455    where
456        T: std::convert::Into<crate::model::cluster::ControlPlane>,
457    {
458        self.control_plane = std::option::Option::Some(v.into());
459        self
460    }
461
462    /// Sets or clears the value of [control_plane][crate::model::Cluster::control_plane].
463    ///
464    /// # Example
465    /// ```ignore,no_run
466    /// # use google_cloud_edgecontainer_v1::model::Cluster;
467    /// use google_cloud_edgecontainer_v1::model::cluster::ControlPlane;
468    /// let x = Cluster::new().set_or_clear_control_plane(Some(ControlPlane::default()/* use setters */));
469    /// let x = Cluster::new().set_or_clear_control_plane(None::<ControlPlane>);
470    /// ```
471    pub fn set_or_clear_control_plane<T>(mut self, v: std::option::Option<T>) -> Self
472    where
473        T: std::convert::Into<crate::model::cluster::ControlPlane>,
474    {
475        self.control_plane = v.map(|x| x.into());
476        self
477    }
478
479    /// Sets the value of [system_addons_config][crate::model::Cluster::system_addons_config].
480    ///
481    /// # Example
482    /// ```ignore,no_run
483    /// # use google_cloud_edgecontainer_v1::model::Cluster;
484    /// use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
485    /// let x = Cluster::new().set_system_addons_config(SystemAddonsConfig::default()/* use setters */);
486    /// ```
487    pub fn set_system_addons_config<T>(mut self, v: T) -> Self
488    where
489        T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
490    {
491        self.system_addons_config = std::option::Option::Some(v.into());
492        self
493    }
494
495    /// Sets or clears the value of [system_addons_config][crate::model::Cluster::system_addons_config].
496    ///
497    /// # Example
498    /// ```ignore,no_run
499    /// # use google_cloud_edgecontainer_v1::model::Cluster;
500    /// use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
501    /// let x = Cluster::new().set_or_clear_system_addons_config(Some(SystemAddonsConfig::default()/* use setters */));
502    /// let x = Cluster::new().set_or_clear_system_addons_config(None::<SystemAddonsConfig>);
503    /// ```
504    pub fn set_or_clear_system_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
505    where
506        T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
507    {
508        self.system_addons_config = v.map(|x| x.into());
509        self
510    }
511
512    /// Sets the value of [external_load_balancer_ipv4_address_pools][crate::model::Cluster::external_load_balancer_ipv4_address_pools].
513    ///
514    /// # Example
515    /// ```ignore,no_run
516    /// # use google_cloud_edgecontainer_v1::model::Cluster;
517    /// let x = Cluster::new().set_external_load_balancer_ipv4_address_pools(["a", "b", "c"]);
518    /// ```
519    pub fn set_external_load_balancer_ipv4_address_pools<T, V>(mut self, v: T) -> Self
520    where
521        T: std::iter::IntoIterator<Item = V>,
522        V: std::convert::Into<std::string::String>,
523    {
524        use std::iter::Iterator;
525        self.external_load_balancer_ipv4_address_pools = v.into_iter().map(|i| i.into()).collect();
526        self
527    }
528
529    /// Sets the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
530    ///
531    /// # Example
532    /// ```ignore,no_run
533    /// # use google_cloud_edgecontainer_v1::model::Cluster;
534    /// use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
535    /// let x = Cluster::new().set_control_plane_encryption(ControlPlaneEncryption::default()/* use setters */);
536    /// ```
537    pub fn set_control_plane_encryption<T>(mut self, v: T) -> Self
538    where
539        T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
540    {
541        self.control_plane_encryption = std::option::Option::Some(v.into());
542        self
543    }
544
545    /// Sets or clears the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
546    ///
547    /// # Example
548    /// ```ignore,no_run
549    /// # use google_cloud_edgecontainer_v1::model::Cluster;
550    /// use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
551    /// let x = Cluster::new().set_or_clear_control_plane_encryption(Some(ControlPlaneEncryption::default()/* use setters */));
552    /// let x = Cluster::new().set_or_clear_control_plane_encryption(None::<ControlPlaneEncryption>);
553    /// ```
554    pub fn set_or_clear_control_plane_encryption<T>(mut self, v: std::option::Option<T>) -> Self
555    where
556        T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
557    {
558        self.control_plane_encryption = v.map(|x| x.into());
559        self
560    }
561
562    /// Sets the value of [status][crate::model::Cluster::status].
563    ///
564    /// # Example
565    /// ```ignore,no_run
566    /// # use google_cloud_edgecontainer_v1::model::Cluster;
567    /// use google_cloud_edgecontainer_v1::model::cluster::Status;
568    /// let x0 = Cluster::new().set_status(Status::Provisioning);
569    /// let x1 = Cluster::new().set_status(Status::Running);
570    /// let x2 = Cluster::new().set_status(Status::Deleting);
571    /// ```
572    pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
573        mut self,
574        v: T,
575    ) -> Self {
576        self.status = v.into();
577        self
578    }
579
580    /// Sets the value of [maintenance_events][crate::model::Cluster::maintenance_events].
581    ///
582    /// # Example
583    /// ```ignore,no_run
584    /// # use google_cloud_edgecontainer_v1::model::Cluster;
585    /// use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
586    /// let x = Cluster::new()
587    ///     .set_maintenance_events([
588    ///         MaintenanceEvent::default()/* use setters */,
589    ///         MaintenanceEvent::default()/* use (different) setters */,
590    ///     ]);
591    /// ```
592    pub fn set_maintenance_events<T, V>(mut self, v: T) -> Self
593    where
594        T: std::iter::IntoIterator<Item = V>,
595        V: std::convert::Into<crate::model::cluster::MaintenanceEvent>,
596    {
597        use std::iter::Iterator;
598        self.maintenance_events = v.into_iter().map(|i| i.into()).collect();
599        self
600    }
601
602    /// Sets the value of [target_version][crate::model::Cluster::target_version].
603    ///
604    /// # Example
605    /// ```ignore,no_run
606    /// # use google_cloud_edgecontainer_v1::model::Cluster;
607    /// let x = Cluster::new().set_target_version("example");
608    /// ```
609    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
610        self.target_version = v.into();
611        self
612    }
613
614    /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
615    ///
616    /// # Example
617    /// ```ignore,no_run
618    /// # use google_cloud_edgecontainer_v1::model::Cluster;
619    /// use google_cloud_edgecontainer_v1::model::cluster::ReleaseChannel;
620    /// let x0 = Cluster::new().set_release_channel(ReleaseChannel::None);
621    /// let x1 = Cluster::new().set_release_channel(ReleaseChannel::Regular);
622    /// ```
623    pub fn set_release_channel<T: std::convert::Into<crate::model::cluster::ReleaseChannel>>(
624        mut self,
625        v: T,
626    ) -> Self {
627        self.release_channel = v.into();
628        self
629    }
630
631    /// Sets the value of [survivability_config][crate::model::Cluster::survivability_config].
632    ///
633    /// # Example
634    /// ```ignore,no_run
635    /// # use google_cloud_edgecontainer_v1::model::Cluster;
636    /// use google_cloud_edgecontainer_v1::model::cluster::SurvivabilityConfig;
637    /// let x = Cluster::new().set_survivability_config(SurvivabilityConfig::default()/* use setters */);
638    /// ```
639    pub fn set_survivability_config<T>(mut self, v: T) -> Self
640    where
641        T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
642    {
643        self.survivability_config = std::option::Option::Some(v.into());
644        self
645    }
646
647    /// Sets or clears the value of [survivability_config][crate::model::Cluster::survivability_config].
648    ///
649    /// # Example
650    /// ```ignore,no_run
651    /// # use google_cloud_edgecontainer_v1::model::Cluster;
652    /// use google_cloud_edgecontainer_v1::model::cluster::SurvivabilityConfig;
653    /// let x = Cluster::new().set_or_clear_survivability_config(Some(SurvivabilityConfig::default()/* use setters */));
654    /// let x = Cluster::new().set_or_clear_survivability_config(None::<SurvivabilityConfig>);
655    /// ```
656    pub fn set_or_clear_survivability_config<T>(mut self, v: std::option::Option<T>) -> Self
657    where
658        T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
659    {
660        self.survivability_config = v.map(|x| x.into());
661        self
662    }
663
664    /// Sets the value of [external_load_balancer_ipv6_address_pools][crate::model::Cluster::external_load_balancer_ipv6_address_pools].
665    ///
666    /// # Example
667    /// ```ignore,no_run
668    /// # use google_cloud_edgecontainer_v1::model::Cluster;
669    /// let x = Cluster::new().set_external_load_balancer_ipv6_address_pools(["a", "b", "c"]);
670    /// ```
671    pub fn set_external_load_balancer_ipv6_address_pools<T, V>(mut self, v: T) -> Self
672    where
673        T: std::iter::IntoIterator<Item = V>,
674        V: std::convert::Into<std::string::String>,
675    {
676        use std::iter::Iterator;
677        self.external_load_balancer_ipv6_address_pools = v.into_iter().map(|i| i.into()).collect();
678        self
679    }
680
681    /// Sets the value of [connection_state][crate::model::Cluster::connection_state].
682    ///
683    /// # Example
684    /// ```ignore,no_run
685    /// # use google_cloud_edgecontainer_v1::model::Cluster;
686    /// use google_cloud_edgecontainer_v1::model::cluster::ConnectionState;
687    /// let x = Cluster::new().set_connection_state(ConnectionState::default()/* use setters */);
688    /// ```
689    pub fn set_connection_state<T>(mut self, v: T) -> Self
690    where
691        T: std::convert::Into<crate::model::cluster::ConnectionState>,
692    {
693        self.connection_state = std::option::Option::Some(v.into());
694        self
695    }
696
697    /// Sets or clears the value of [connection_state][crate::model::Cluster::connection_state].
698    ///
699    /// # Example
700    /// ```ignore,no_run
701    /// # use google_cloud_edgecontainer_v1::model::Cluster;
702    /// use google_cloud_edgecontainer_v1::model::cluster::ConnectionState;
703    /// let x = Cluster::new().set_or_clear_connection_state(Some(ConnectionState::default()/* use setters */));
704    /// let x = Cluster::new().set_or_clear_connection_state(None::<ConnectionState>);
705    /// ```
706    pub fn set_or_clear_connection_state<T>(mut self, v: std::option::Option<T>) -> Self
707    where
708        T: std::convert::Into<crate::model::cluster::ConnectionState>,
709    {
710        self.connection_state = v.map(|x| x.into());
711        self
712    }
713}
714
715impl wkt::message::Message for Cluster {
716    fn typename() -> &'static str {
717        "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster"
718    }
719}
720
721/// Defines additional types related to [Cluster].
722pub mod cluster {
723    #[allow(unused_imports)]
724    use super::*;
725
726    /// Configuration of the cluster control plane.
727    #[derive(Clone, Default, PartialEq)]
728    #[non_exhaustive]
729    pub struct ControlPlane {
730        pub config: std::option::Option<crate::model::cluster::control_plane::Config>,
731
732        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
733    }
734
735    impl ControlPlane {
736        pub fn new() -> Self {
737            std::default::Default::default()
738        }
739
740        /// Sets the value of [config][crate::model::cluster::ControlPlane::config].
741        ///
742        /// Note that all the setters affecting `config` are mutually
743        /// exclusive.
744        ///
745        /// # Example
746        /// ```ignore,no_run
747        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlane;
748        /// use google_cloud_edgecontainer_v1::model::cluster::control_plane::Remote;
749        /// let x = ControlPlane::new().set_config(Some(
750        ///     google_cloud_edgecontainer_v1::model::cluster::control_plane::Config::Remote(Remote::default().into())));
751        /// ```
752        pub fn set_config<
753            T: std::convert::Into<std::option::Option<crate::model::cluster::control_plane::Config>>,
754        >(
755            mut self,
756            v: T,
757        ) -> Self {
758            self.config = v.into();
759            self
760        }
761
762        /// The value of [config][crate::model::cluster::ControlPlane::config]
763        /// if it holds a `Remote`, `None` if the field is not set or
764        /// holds a different branch.
765        pub fn remote(
766            &self,
767        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Remote>>
768        {
769            #[allow(unreachable_patterns)]
770            self.config.as_ref().and_then(|v| match v {
771                crate::model::cluster::control_plane::Config::Remote(v) => {
772                    std::option::Option::Some(v)
773                }
774                _ => std::option::Option::None,
775            })
776        }
777
778        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
779        /// to hold a `Remote`.
780        ///
781        /// Note that all the setters affecting `config` are
782        /// mutually exclusive.
783        ///
784        /// # Example
785        /// ```ignore,no_run
786        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlane;
787        /// use google_cloud_edgecontainer_v1::model::cluster::control_plane::Remote;
788        /// let x = ControlPlane::new().set_remote(Remote::default()/* use setters */);
789        /// assert!(x.remote().is_some());
790        /// assert!(x.local().is_none());
791        /// ```
792        pub fn set_remote<
793            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Remote>>,
794        >(
795            mut self,
796            v: T,
797        ) -> Self {
798            self.config = std::option::Option::Some(
799                crate::model::cluster::control_plane::Config::Remote(v.into()),
800            );
801            self
802        }
803
804        /// The value of [config][crate::model::cluster::ControlPlane::config]
805        /// if it holds a `Local`, `None` if the field is not set or
806        /// holds a different branch.
807        pub fn local(
808            &self,
809        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Local>>
810        {
811            #[allow(unreachable_patterns)]
812            self.config.as_ref().and_then(|v| match v {
813                crate::model::cluster::control_plane::Config::Local(v) => {
814                    std::option::Option::Some(v)
815                }
816                _ => std::option::Option::None,
817            })
818        }
819
820        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
821        /// to hold a `Local`.
822        ///
823        /// Note that all the setters affecting `config` are
824        /// mutually exclusive.
825        ///
826        /// # Example
827        /// ```ignore,no_run
828        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlane;
829        /// use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
830        /// let x = ControlPlane::new().set_local(Local::default()/* use setters */);
831        /// assert!(x.local().is_some());
832        /// assert!(x.remote().is_none());
833        /// ```
834        pub fn set_local<
835            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Local>>,
836        >(
837            mut self,
838            v: T,
839        ) -> Self {
840            self.config = std::option::Option::Some(
841                crate::model::cluster::control_plane::Config::Local(v.into()),
842            );
843            self
844        }
845    }
846
847    impl wkt::message::Message for ControlPlane {
848        fn typename() -> &'static str {
849            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane"
850        }
851    }
852
853    /// Defines additional types related to [ControlPlane].
854    pub mod control_plane {
855        #[allow(unused_imports)]
856        use super::*;
857
858        /// Configuration specific to clusters with a control plane hosted remotely.
859        #[derive(Clone, Default, PartialEq)]
860        #[non_exhaustive]
861        pub struct Remote {
862            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
863        }
864
865        impl Remote {
866            pub fn new() -> Self {
867                std::default::Default::default()
868            }
869        }
870
871        impl wkt::message::Message for Remote {
872            fn typename() -> &'static str {
873                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Remote"
874            }
875        }
876
877        /// Configuration specific to clusters with a control plane hosted locally.
878        ///
879        /// Warning: Local control plane clusters must be created in their own
880        /// project. Local control plane clusters cannot coexist in the same
881        /// project with any other type of clusters, including non-GDCE clusters.
882        /// Mixing local control plane GDCE clusters with any other type of
883        /// clusters in the same project can result in data loss.
884        #[derive(Clone, Default, PartialEq)]
885        #[non_exhaustive]
886        pub struct Local {
887            /// Name of the Google Distributed Cloud Edge zones where this node pool
888            /// will be created. For example: `us-central1-edge-customer-a`.
889            pub node_location: std::string::String,
890
891            /// The number of nodes to serve as replicas of the Control Plane.
892            pub node_count: i32,
893
894            /// Only machines matching this filter will be allowed to host control
895            /// plane nodes. The filtering language accepts strings like "name=\<name\>",
896            /// and is documented here: [AIP-160](https://google.aip.dev/160).
897            pub machine_filter: std::string::String,
898
899            /// Policy configuration about how user applications are deployed.
900            pub shared_deployment_policy:
901                crate::model::cluster::control_plane::SharedDeploymentPolicy,
902
903            /// Optional. Name for the storage schema of control plane nodes.
904            ///
905            /// Warning: Configurable node local storage schema feature is an
906            /// experimental feature, and is not recommended for general use
907            /// in production clusters/nodepools.
908            pub control_plane_node_storage_schema: std::string::String,
909
910            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
911        }
912
913        impl Local {
914            pub fn new() -> Self {
915                std::default::Default::default()
916            }
917
918            /// Sets the value of [node_location][crate::model::cluster::control_plane::Local::node_location].
919            ///
920            /// # Example
921            /// ```ignore,no_run
922            /// # use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
923            /// let x = Local::new().set_node_location("example");
924            /// ```
925            pub fn set_node_location<T: std::convert::Into<std::string::String>>(
926                mut self,
927                v: T,
928            ) -> Self {
929                self.node_location = v.into();
930                self
931            }
932
933            /// Sets the value of [node_count][crate::model::cluster::control_plane::Local::node_count].
934            ///
935            /// # Example
936            /// ```ignore,no_run
937            /// # use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
938            /// let x = Local::new().set_node_count(42);
939            /// ```
940            pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
941                self.node_count = v.into();
942                self
943            }
944
945            /// Sets the value of [machine_filter][crate::model::cluster::control_plane::Local::machine_filter].
946            ///
947            /// # Example
948            /// ```ignore,no_run
949            /// # use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
950            /// let x = Local::new().set_machine_filter("example");
951            /// ```
952            pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(
953                mut self,
954                v: T,
955            ) -> Self {
956                self.machine_filter = v.into();
957                self
958            }
959
960            /// Sets the value of [shared_deployment_policy][crate::model::cluster::control_plane::Local::shared_deployment_policy].
961            ///
962            /// # Example
963            /// ```ignore,no_run
964            /// # use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
965            /// use google_cloud_edgecontainer_v1::model::cluster::control_plane::SharedDeploymentPolicy;
966            /// let x0 = Local::new().set_shared_deployment_policy(SharedDeploymentPolicy::Allowed);
967            /// let x1 = Local::new().set_shared_deployment_policy(SharedDeploymentPolicy::Disallowed);
968            /// ```
969            pub fn set_shared_deployment_policy<
970                T: std::convert::Into<crate::model::cluster::control_plane::SharedDeploymentPolicy>,
971            >(
972                mut self,
973                v: T,
974            ) -> Self {
975                self.shared_deployment_policy = v.into();
976                self
977            }
978
979            /// Sets the value of [control_plane_node_storage_schema][crate::model::cluster::control_plane::Local::control_plane_node_storage_schema].
980            ///
981            /// # Example
982            /// ```ignore,no_run
983            /// # use google_cloud_edgecontainer_v1::model::cluster::control_plane::Local;
984            /// let x = Local::new().set_control_plane_node_storage_schema("example");
985            /// ```
986            pub fn set_control_plane_node_storage_schema<
987                T: std::convert::Into<std::string::String>,
988            >(
989                mut self,
990                v: T,
991            ) -> Self {
992                self.control_plane_node_storage_schema = v.into();
993                self
994            }
995        }
996
997        impl wkt::message::Message for Local {
998            fn typename() -> &'static str {
999                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Local"
1000            }
1001        }
1002
1003        /// Represents the policy configuration about how user applications are
1004        /// deployed.
1005        ///
1006        /// # Working with unknown values
1007        ///
1008        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1009        /// additional enum variants at any time. Adding new variants is not considered
1010        /// a breaking change. Applications should write their code in anticipation of:
1011        ///
1012        /// - New values appearing in future releases of the client library, **and**
1013        /// - New values received dynamically, without application changes.
1014        ///
1015        /// Please consult the [Working with enums] section in the user guide for some
1016        /// guidelines.
1017        ///
1018        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1019        #[derive(Clone, Debug, PartialEq)]
1020        #[non_exhaustive]
1021        pub enum SharedDeploymentPolicy {
1022            /// Unspecified.
1023            Unspecified,
1024            /// User applications can be deployed both on control plane and worker
1025            /// nodes.
1026            Allowed,
1027            /// User applications can not be deployed on control plane nodes and can
1028            /// only be deployed on worker nodes.
1029            Disallowed,
1030            /// If set, the enum was initialized with an unknown value.
1031            ///
1032            /// Applications can examine the value using [SharedDeploymentPolicy::value] or
1033            /// [SharedDeploymentPolicy::name].
1034            UnknownValue(shared_deployment_policy::UnknownValue),
1035        }
1036
1037        #[doc(hidden)]
1038        pub mod shared_deployment_policy {
1039            #[allow(unused_imports)]
1040            use super::*;
1041            #[derive(Clone, Debug, PartialEq)]
1042            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1043        }
1044
1045        impl SharedDeploymentPolicy {
1046            /// Gets the enum value.
1047            ///
1048            /// Returns `None` if the enum contains an unknown value deserialized from
1049            /// the string representation of enums.
1050            pub fn value(&self) -> std::option::Option<i32> {
1051                match self {
1052                    Self::Unspecified => std::option::Option::Some(0),
1053                    Self::Allowed => std::option::Option::Some(1),
1054                    Self::Disallowed => std::option::Option::Some(2),
1055                    Self::UnknownValue(u) => u.0.value(),
1056                }
1057            }
1058
1059            /// Gets the enum value as a string.
1060            ///
1061            /// Returns `None` if the enum contains an unknown value deserialized from
1062            /// the integer representation of enums.
1063            pub fn name(&self) -> std::option::Option<&str> {
1064                match self {
1065                    Self::Unspecified => {
1066                        std::option::Option::Some("SHARED_DEPLOYMENT_POLICY_UNSPECIFIED")
1067                    }
1068                    Self::Allowed => std::option::Option::Some("ALLOWED"),
1069                    Self::Disallowed => std::option::Option::Some("DISALLOWED"),
1070                    Self::UnknownValue(u) => u.0.name(),
1071                }
1072            }
1073        }
1074
1075        impl std::default::Default for SharedDeploymentPolicy {
1076            fn default() -> Self {
1077                use std::convert::From;
1078                Self::from(0)
1079            }
1080        }
1081
1082        impl std::fmt::Display for SharedDeploymentPolicy {
1083            fn fmt(
1084                &self,
1085                f: &mut std::fmt::Formatter<'_>,
1086            ) -> std::result::Result<(), std::fmt::Error> {
1087                wkt::internal::display_enum(f, self.name(), self.value())
1088            }
1089        }
1090
1091        impl std::convert::From<i32> for SharedDeploymentPolicy {
1092            fn from(value: i32) -> Self {
1093                match value {
1094                    0 => Self::Unspecified,
1095                    1 => Self::Allowed,
1096                    2 => Self::Disallowed,
1097                    _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
1098                        wkt::internal::UnknownEnumValue::Integer(value),
1099                    )),
1100                }
1101            }
1102        }
1103
1104        impl std::convert::From<&str> for SharedDeploymentPolicy {
1105            fn from(value: &str) -> Self {
1106                use std::string::ToString;
1107                match value {
1108                    "SHARED_DEPLOYMENT_POLICY_UNSPECIFIED" => Self::Unspecified,
1109                    "ALLOWED" => Self::Allowed,
1110                    "DISALLOWED" => Self::Disallowed,
1111                    _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
1112                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1113                    )),
1114                }
1115            }
1116        }
1117
1118        impl serde::ser::Serialize for SharedDeploymentPolicy {
1119            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1120            where
1121                S: serde::Serializer,
1122            {
1123                match self {
1124                    Self::Unspecified => serializer.serialize_i32(0),
1125                    Self::Allowed => serializer.serialize_i32(1),
1126                    Self::Disallowed => serializer.serialize_i32(2),
1127                    Self::UnknownValue(u) => u.0.serialize(serializer),
1128                }
1129            }
1130        }
1131
1132        impl<'de> serde::de::Deserialize<'de> for SharedDeploymentPolicy {
1133            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1134            where
1135                D: serde::Deserializer<'de>,
1136            {
1137                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedDeploymentPolicy>::new(
1138                    ".google.cloud.edgecontainer.v1.Cluster.ControlPlane.SharedDeploymentPolicy"))
1139            }
1140        }
1141
1142        #[derive(Clone, Debug, PartialEq)]
1143        #[non_exhaustive]
1144        pub enum Config {
1145            /// Remote control plane configuration.
1146            Remote(std::boxed::Box<crate::model::cluster::control_plane::Remote>),
1147            /// Local control plane configuration.
1148            ///
1149            /// Warning: Local control plane clusters must be created in their own
1150            /// project. Local control plane clusters cannot coexist in the same
1151            /// project with any other type of clusters, including non-GDCE clusters.
1152            /// Mixing local control plane GDCE clusters with any other type of
1153            /// clusters in the same project can result in data loss.
1154            Local(std::boxed::Box<crate::model::cluster::control_plane::Local>),
1155        }
1156    }
1157
1158    /// Config that customers are allowed to define for GDCE system add-ons.
1159    #[derive(Clone, Default, PartialEq)]
1160    #[non_exhaustive]
1161    pub struct SystemAddonsConfig {
1162        /// Optional. Config for Ingress.
1163        pub ingress: std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
1164
1165        /// Optional. Config for VM Service.
1166        pub vm_service_config:
1167            std::option::Option<crate::model::cluster::system_addons_config::VMServiceConfig>,
1168
1169        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1170    }
1171
1172    impl SystemAddonsConfig {
1173        pub fn new() -> Self {
1174            std::default::Default::default()
1175        }
1176
1177        /// Sets the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
1178        ///
1179        /// # Example
1180        /// ```ignore,no_run
1181        /// # use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
1182        /// use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::Ingress;
1183        /// let x = SystemAddonsConfig::new().set_ingress(Ingress::default()/* use setters */);
1184        /// ```
1185        pub fn set_ingress<T>(mut self, v: T) -> Self
1186        where
1187            T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
1188        {
1189            self.ingress = std::option::Option::Some(v.into());
1190            self
1191        }
1192
1193        /// Sets or clears the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
1194        ///
1195        /// # Example
1196        /// ```ignore,no_run
1197        /// # use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
1198        /// use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::Ingress;
1199        /// let x = SystemAddonsConfig::new().set_or_clear_ingress(Some(Ingress::default()/* use setters */));
1200        /// let x = SystemAddonsConfig::new().set_or_clear_ingress(None::<Ingress>);
1201        /// ```
1202        pub fn set_or_clear_ingress<T>(mut self, v: std::option::Option<T>) -> Self
1203        where
1204            T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
1205        {
1206            self.ingress = v.map(|x| x.into());
1207            self
1208        }
1209
1210        /// Sets the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
1211        ///
1212        /// # Example
1213        /// ```ignore,no_run
1214        /// # use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
1215        /// use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::VMServiceConfig;
1216        /// let x = SystemAddonsConfig::new().set_vm_service_config(VMServiceConfig::default()/* use setters */);
1217        /// ```
1218        pub fn set_vm_service_config<T>(mut self, v: T) -> Self
1219        where
1220            T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
1221        {
1222            self.vm_service_config = std::option::Option::Some(v.into());
1223            self
1224        }
1225
1226        /// Sets or clears the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
1227        ///
1228        /// # Example
1229        /// ```ignore,no_run
1230        /// # use google_cloud_edgecontainer_v1::model::cluster::SystemAddonsConfig;
1231        /// use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::VMServiceConfig;
1232        /// let x = SystemAddonsConfig::new().set_or_clear_vm_service_config(Some(VMServiceConfig::default()/* use setters */));
1233        /// let x = SystemAddonsConfig::new().set_or_clear_vm_service_config(None::<VMServiceConfig>);
1234        /// ```
1235        pub fn set_or_clear_vm_service_config<T>(mut self, v: std::option::Option<T>) -> Self
1236        where
1237            T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
1238        {
1239            self.vm_service_config = v.map(|x| x.into());
1240            self
1241        }
1242    }
1243
1244    impl wkt::message::Message for SystemAddonsConfig {
1245        fn typename() -> &'static str {
1246            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig"
1247        }
1248    }
1249
1250    /// Defines additional types related to [SystemAddonsConfig].
1251    pub mod system_addons_config {
1252        #[allow(unused_imports)]
1253        use super::*;
1254
1255        /// Config for the Ingress add-on which allows customers to create an Ingress
1256        /// object to manage external access to the servers in a cluster. The add-on
1257        /// consists of istiod and istio-ingress.
1258        #[derive(Clone, Default, PartialEq)]
1259        #[non_exhaustive]
1260        pub struct Ingress {
1261            /// Optional. Whether Ingress is disabled.
1262            pub disabled: bool,
1263
1264            /// Optional. Ingress VIP.
1265            pub ipv4_vip: std::string::String,
1266
1267            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1268        }
1269
1270        impl Ingress {
1271            pub fn new() -> Self {
1272                std::default::Default::default()
1273            }
1274
1275            /// Sets the value of [disabled][crate::model::cluster::system_addons_config::Ingress::disabled].
1276            ///
1277            /// # Example
1278            /// ```ignore,no_run
1279            /// # use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::Ingress;
1280            /// let x = Ingress::new().set_disabled(true);
1281            /// ```
1282            pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1283                self.disabled = v.into();
1284                self
1285            }
1286
1287            /// Sets the value of [ipv4_vip][crate::model::cluster::system_addons_config::Ingress::ipv4_vip].
1288            ///
1289            /// # Example
1290            /// ```ignore,no_run
1291            /// # use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::Ingress;
1292            /// let x = Ingress::new().set_ipv4_vip("example");
1293            /// ```
1294            pub fn set_ipv4_vip<T: std::convert::Into<std::string::String>>(
1295                mut self,
1296                v: T,
1297            ) -> Self {
1298                self.ipv4_vip = v.into();
1299                self
1300            }
1301        }
1302
1303        impl wkt::message::Message for Ingress {
1304            fn typename() -> &'static str {
1305                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.Ingress"
1306            }
1307        }
1308
1309        /// VMServiceConfig defines the configuration for GDCE VM Service.
1310        #[derive(Clone, Default, PartialEq)]
1311        #[non_exhaustive]
1312        pub struct VMServiceConfig {
1313            /// Optional. Whether VMM is enabled.
1314            pub vmm_enabled: bool,
1315
1316            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1317        }
1318
1319        impl VMServiceConfig {
1320            pub fn new() -> Self {
1321                std::default::Default::default()
1322            }
1323
1324            /// Sets the value of [vmm_enabled][crate::model::cluster::system_addons_config::VMServiceConfig::vmm_enabled].
1325            ///
1326            /// # Example
1327            /// ```ignore,no_run
1328            /// # use google_cloud_edgecontainer_v1::model::cluster::system_addons_config::VMServiceConfig;
1329            /// let x = VMServiceConfig::new().set_vmm_enabled(true);
1330            /// ```
1331            pub fn set_vmm_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1332                self.vmm_enabled = v.into();
1333                self
1334            }
1335        }
1336
1337        impl wkt::message::Message for VMServiceConfig {
1338            fn typename() -> &'static str {
1339                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.VMServiceConfig"
1340            }
1341        }
1342    }
1343
1344    /// Configuration for Customer-managed KMS key support for control plane nodes.
1345    #[derive(Clone, Default, PartialEq)]
1346    #[non_exhaustive]
1347    pub struct ControlPlaneEncryption {
1348        /// Optional. The Cloud KMS CryptoKey e.g.
1349        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
1350        /// to use for protecting control plane disks. If not specified, a
1351        /// Google-managed key will be used instead.
1352        pub kms_key: std::string::String,
1353
1354        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
1355        /// protecting control plane disks. Only applicable if kms_key is set.
1356        pub kms_key_active_version: std::string::String,
1357
1358        /// Output only. Availability of the Cloud KMS CryptoKey. If not
1359        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
1360        /// local data. This can be caused by a lack of permissions to use the key,
1361        /// or if the key is disabled or deleted.
1362        pub kms_key_state: crate::model::KmsKeyState,
1363
1364        /// Output only. Error status returned by Cloud KMS when using this key. This
1365        /// field may be populated only if `kms_key_state` is not
1366        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
1367        /// error status reported by Cloud KMS.
1368        pub kms_status: std::option::Option<google_cloud_rpc::model::Status>,
1369
1370        /// Output only. The current resource state associated with the cmek.
1371        pub resource_state: crate::model::ResourceState,
1372
1373        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1374    }
1375
1376    impl ControlPlaneEncryption {
1377        pub fn new() -> Self {
1378            std::default::Default::default()
1379        }
1380
1381        /// Sets the value of [kms_key][crate::model::cluster::ControlPlaneEncryption::kms_key].
1382        ///
1383        /// # Example
1384        /// ```ignore,no_run
1385        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1386        /// let x = ControlPlaneEncryption::new().set_kms_key("example");
1387        /// ```
1388        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1389            self.kms_key = v.into();
1390            self
1391        }
1392
1393        /// Sets the value of [kms_key_active_version][crate::model::cluster::ControlPlaneEncryption::kms_key_active_version].
1394        ///
1395        /// # Example
1396        /// ```ignore,no_run
1397        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1398        /// let x = ControlPlaneEncryption::new().set_kms_key_active_version("example");
1399        /// ```
1400        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
1401            mut self,
1402            v: T,
1403        ) -> Self {
1404            self.kms_key_active_version = v.into();
1405            self
1406        }
1407
1408        /// Sets the value of [kms_key_state][crate::model::cluster::ControlPlaneEncryption::kms_key_state].
1409        ///
1410        /// # Example
1411        /// ```ignore,no_run
1412        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1413        /// use google_cloud_edgecontainer_v1::model::KmsKeyState;
1414        /// let x0 = ControlPlaneEncryption::new().set_kms_key_state(KmsKeyState::KeyAvailable);
1415        /// let x1 = ControlPlaneEncryption::new().set_kms_key_state(KmsKeyState::KeyUnavailable);
1416        /// ```
1417        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
1418            mut self,
1419            v: T,
1420        ) -> Self {
1421            self.kms_key_state = v.into();
1422            self
1423        }
1424
1425        /// Sets the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
1426        ///
1427        /// # Example
1428        /// ```ignore,no_run
1429        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1430        /// use google_cloud_rpc::model::Status;
1431        /// let x = ControlPlaneEncryption::new().set_kms_status(Status::default()/* use setters */);
1432        /// ```
1433        pub fn set_kms_status<T>(mut self, v: T) -> Self
1434        where
1435            T: std::convert::Into<google_cloud_rpc::model::Status>,
1436        {
1437            self.kms_status = std::option::Option::Some(v.into());
1438            self
1439        }
1440
1441        /// Sets or clears the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
1442        ///
1443        /// # Example
1444        /// ```ignore,no_run
1445        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1446        /// use google_cloud_rpc::model::Status;
1447        /// let x = ControlPlaneEncryption::new().set_or_clear_kms_status(Some(Status::default()/* use setters */));
1448        /// let x = ControlPlaneEncryption::new().set_or_clear_kms_status(None::<Status>);
1449        /// ```
1450        pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
1451        where
1452            T: std::convert::Into<google_cloud_rpc::model::Status>,
1453        {
1454            self.kms_status = v.map(|x| x.into());
1455            self
1456        }
1457
1458        /// Sets the value of [resource_state][crate::model::cluster::ControlPlaneEncryption::resource_state].
1459        ///
1460        /// # Example
1461        /// ```ignore,no_run
1462        /// # use google_cloud_edgecontainer_v1::model::cluster::ControlPlaneEncryption;
1463        /// use google_cloud_edgecontainer_v1::model::ResourceState;
1464        /// let x0 = ControlPlaneEncryption::new().set_resource_state(ResourceState::LockDown);
1465        /// let x1 = ControlPlaneEncryption::new().set_resource_state(ResourceState::LockDownPending);
1466        /// ```
1467        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
1468            mut self,
1469            v: T,
1470        ) -> Self {
1471            self.resource_state = v.into();
1472            self
1473        }
1474    }
1475
1476    impl wkt::message::Message for ControlPlaneEncryption {
1477        fn typename() -> &'static str {
1478            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlaneEncryption"
1479        }
1480    }
1481
1482    /// A Maintenance Event is an operation that could cause temporary disruptions
1483    /// to the cluster workloads, including Google-driven or user-initiated cluster
1484    /// upgrades, user-initiated cluster configuration changes that require
1485    /// restarting nodes, etc.
1486    #[derive(Clone, Default, PartialEq)]
1487    #[non_exhaustive]
1488    pub struct MaintenanceEvent {
1489        /// Output only. UUID of the maintenance event.
1490        pub uuid: std::string::String,
1491
1492        /// Output only. The target version of the cluster.
1493        pub target_version: std::string::String,
1494
1495        /// Output only. The operation for running the maintenance event. Specified
1496        /// in the format projects/*/locations/*/operations/*. If the maintenance
1497        /// event is split into multiple operations (e.g. due to maintenance
1498        /// windows), the latest one is recorded.
1499        pub operation: std::string::String,
1500
1501        /// Output only. The type of the maintenance event.
1502        pub r#type: crate::model::cluster::maintenance_event::Type,
1503
1504        /// Output only. The schedule of the maintenance event.
1505        pub schedule: crate::model::cluster::maintenance_event::Schedule,
1506
1507        /// Output only. The state of the maintenance event.
1508        pub state: crate::model::cluster::maintenance_event::State,
1509
1510        /// Output only. The time when the maintenance event request was created.
1511        pub create_time: std::option::Option<wkt::Timestamp>,
1512
1513        /// Output only. The time when the maintenance event started.
1514        pub start_time: std::option::Option<wkt::Timestamp>,
1515
1516        /// Output only. The time when the maintenance event ended, either
1517        /// successfully or not. If the maintenance event is split into multiple
1518        /// maintenance windows, end_time is only updated when the whole flow ends.
1519        pub end_time: std::option::Option<wkt::Timestamp>,
1520
1521        /// Output only. The time when the maintenance event message was updated.
1522        pub update_time: std::option::Option<wkt::Timestamp>,
1523
1524        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1525    }
1526
1527    impl MaintenanceEvent {
1528        pub fn new() -> Self {
1529            std::default::Default::default()
1530        }
1531
1532        /// Sets the value of [uuid][crate::model::cluster::MaintenanceEvent::uuid].
1533        ///
1534        /// # Example
1535        /// ```ignore,no_run
1536        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1537        /// let x = MaintenanceEvent::new().set_uuid("example");
1538        /// ```
1539        pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1540            self.uuid = v.into();
1541            self
1542        }
1543
1544        /// Sets the value of [target_version][crate::model::cluster::MaintenanceEvent::target_version].
1545        ///
1546        /// # Example
1547        /// ```ignore,no_run
1548        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1549        /// let x = MaintenanceEvent::new().set_target_version("example");
1550        /// ```
1551        pub fn set_target_version<T: std::convert::Into<std::string::String>>(
1552            mut self,
1553            v: T,
1554        ) -> Self {
1555            self.target_version = v.into();
1556            self
1557        }
1558
1559        /// Sets the value of [operation][crate::model::cluster::MaintenanceEvent::operation].
1560        ///
1561        /// # Example
1562        /// ```ignore,no_run
1563        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1564        /// let x = MaintenanceEvent::new().set_operation("example");
1565        /// ```
1566        pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567            self.operation = v.into();
1568            self
1569        }
1570
1571        /// Sets the value of [r#type][crate::model::cluster::MaintenanceEvent::type].
1572        ///
1573        /// # Example
1574        /// ```ignore,no_run
1575        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1576        /// use google_cloud_edgecontainer_v1::model::cluster::maintenance_event::Type;
1577        /// let x0 = MaintenanceEvent::new().set_type(Type::UserInitiatedUpgrade);
1578        /// let x1 = MaintenanceEvent::new().set_type(Type::GoogleDrivenUpgrade);
1579        /// ```
1580        pub fn set_type<T: std::convert::Into<crate::model::cluster::maintenance_event::Type>>(
1581            mut self,
1582            v: T,
1583        ) -> Self {
1584            self.r#type = v.into();
1585            self
1586        }
1587
1588        /// Sets the value of [schedule][crate::model::cluster::MaintenanceEvent::schedule].
1589        ///
1590        /// # Example
1591        /// ```ignore,no_run
1592        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1593        /// use google_cloud_edgecontainer_v1::model::cluster::maintenance_event::Schedule;
1594        /// let x0 = MaintenanceEvent::new().set_schedule(Schedule::Immediately);
1595        /// ```
1596        pub fn set_schedule<
1597            T: std::convert::Into<crate::model::cluster::maintenance_event::Schedule>,
1598        >(
1599            mut self,
1600            v: T,
1601        ) -> Self {
1602            self.schedule = v.into();
1603            self
1604        }
1605
1606        /// Sets the value of [state][crate::model::cluster::MaintenanceEvent::state].
1607        ///
1608        /// # Example
1609        /// ```ignore,no_run
1610        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1611        /// use google_cloud_edgecontainer_v1::model::cluster::maintenance_event::State;
1612        /// let x0 = MaintenanceEvent::new().set_state(State::Reconciling);
1613        /// let x1 = MaintenanceEvent::new().set_state(State::Succeeded);
1614        /// let x2 = MaintenanceEvent::new().set_state(State::Failed);
1615        /// ```
1616        pub fn set_state<T: std::convert::Into<crate::model::cluster::maintenance_event::State>>(
1617            mut self,
1618            v: T,
1619        ) -> Self {
1620            self.state = v.into();
1621            self
1622        }
1623
1624        /// Sets the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
1625        ///
1626        /// # Example
1627        /// ```ignore,no_run
1628        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1629        /// use wkt::Timestamp;
1630        /// let x = MaintenanceEvent::new().set_create_time(Timestamp::default()/* use setters */);
1631        /// ```
1632        pub fn set_create_time<T>(mut self, v: T) -> Self
1633        where
1634            T: std::convert::Into<wkt::Timestamp>,
1635        {
1636            self.create_time = std::option::Option::Some(v.into());
1637            self
1638        }
1639
1640        /// Sets or clears the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
1641        ///
1642        /// # Example
1643        /// ```ignore,no_run
1644        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1645        /// use wkt::Timestamp;
1646        /// let x = MaintenanceEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1647        /// let x = MaintenanceEvent::new().set_or_clear_create_time(None::<Timestamp>);
1648        /// ```
1649        pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1650        where
1651            T: std::convert::Into<wkt::Timestamp>,
1652        {
1653            self.create_time = v.map(|x| x.into());
1654            self
1655        }
1656
1657        /// Sets the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
1658        ///
1659        /// # Example
1660        /// ```ignore,no_run
1661        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1662        /// use wkt::Timestamp;
1663        /// let x = MaintenanceEvent::new().set_start_time(Timestamp::default()/* use setters */);
1664        /// ```
1665        pub fn set_start_time<T>(mut self, v: T) -> Self
1666        where
1667            T: std::convert::Into<wkt::Timestamp>,
1668        {
1669            self.start_time = std::option::Option::Some(v.into());
1670            self
1671        }
1672
1673        /// Sets or clears the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
1674        ///
1675        /// # Example
1676        /// ```ignore,no_run
1677        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1678        /// use wkt::Timestamp;
1679        /// let x = MaintenanceEvent::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
1680        /// let x = MaintenanceEvent::new().set_or_clear_start_time(None::<Timestamp>);
1681        /// ```
1682        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1683        where
1684            T: std::convert::Into<wkt::Timestamp>,
1685        {
1686            self.start_time = v.map(|x| x.into());
1687            self
1688        }
1689
1690        /// Sets the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
1691        ///
1692        /// # Example
1693        /// ```ignore,no_run
1694        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1695        /// use wkt::Timestamp;
1696        /// let x = MaintenanceEvent::new().set_end_time(Timestamp::default()/* use setters */);
1697        /// ```
1698        pub fn set_end_time<T>(mut self, v: T) -> Self
1699        where
1700            T: std::convert::Into<wkt::Timestamp>,
1701        {
1702            self.end_time = std::option::Option::Some(v.into());
1703            self
1704        }
1705
1706        /// Sets or clears the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
1707        ///
1708        /// # Example
1709        /// ```ignore,no_run
1710        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1711        /// use wkt::Timestamp;
1712        /// let x = MaintenanceEvent::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1713        /// let x = MaintenanceEvent::new().set_or_clear_end_time(None::<Timestamp>);
1714        /// ```
1715        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1716        where
1717            T: std::convert::Into<wkt::Timestamp>,
1718        {
1719            self.end_time = v.map(|x| x.into());
1720            self
1721        }
1722
1723        /// Sets the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
1724        ///
1725        /// # Example
1726        /// ```ignore,no_run
1727        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1728        /// use wkt::Timestamp;
1729        /// let x = MaintenanceEvent::new().set_update_time(Timestamp::default()/* use setters */);
1730        /// ```
1731        pub fn set_update_time<T>(mut self, v: T) -> Self
1732        where
1733            T: std::convert::Into<wkt::Timestamp>,
1734        {
1735            self.update_time = std::option::Option::Some(v.into());
1736            self
1737        }
1738
1739        /// Sets or clears the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
1740        ///
1741        /// # Example
1742        /// ```ignore,no_run
1743        /// # use google_cloud_edgecontainer_v1::model::cluster::MaintenanceEvent;
1744        /// use wkt::Timestamp;
1745        /// let x = MaintenanceEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1746        /// let x = MaintenanceEvent::new().set_or_clear_update_time(None::<Timestamp>);
1747        /// ```
1748        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1749        where
1750            T: std::convert::Into<wkt::Timestamp>,
1751        {
1752            self.update_time = v.map(|x| x.into());
1753            self
1754        }
1755    }
1756
1757    impl wkt::message::Message for MaintenanceEvent {
1758        fn typename() -> &'static str {
1759            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent"
1760        }
1761    }
1762
1763    /// Defines additional types related to [MaintenanceEvent].
1764    pub mod maintenance_event {
1765        #[allow(unused_imports)]
1766        use super::*;
1767
1768        /// Indicates the maintenance event type.
1769        ///
1770        /// # Working with unknown values
1771        ///
1772        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1773        /// additional enum variants at any time. Adding new variants is not considered
1774        /// a breaking change. Applications should write their code in anticipation of:
1775        ///
1776        /// - New values appearing in future releases of the client library, **and**
1777        /// - New values received dynamically, without application changes.
1778        ///
1779        /// Please consult the [Working with enums] section in the user guide for some
1780        /// guidelines.
1781        ///
1782        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1783        #[derive(Clone, Debug, PartialEq)]
1784        #[non_exhaustive]
1785        pub enum Type {
1786            /// Unspecified.
1787            Unspecified,
1788            /// Upgrade initiated by users.
1789            UserInitiatedUpgrade,
1790            /// Upgrade driven by Google.
1791            GoogleDrivenUpgrade,
1792            /// If set, the enum was initialized with an unknown value.
1793            ///
1794            /// Applications can examine the value using [Type::value] or
1795            /// [Type::name].
1796            UnknownValue(r#type::UnknownValue),
1797        }
1798
1799        #[doc(hidden)]
1800        pub mod r#type {
1801            #[allow(unused_imports)]
1802            use super::*;
1803            #[derive(Clone, Debug, PartialEq)]
1804            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1805        }
1806
1807        impl Type {
1808            /// Gets the enum value.
1809            ///
1810            /// Returns `None` if the enum contains an unknown value deserialized from
1811            /// the string representation of enums.
1812            pub fn value(&self) -> std::option::Option<i32> {
1813                match self {
1814                    Self::Unspecified => std::option::Option::Some(0),
1815                    Self::UserInitiatedUpgrade => std::option::Option::Some(1),
1816                    Self::GoogleDrivenUpgrade => std::option::Option::Some(2),
1817                    Self::UnknownValue(u) => u.0.value(),
1818                }
1819            }
1820
1821            /// Gets the enum value as a string.
1822            ///
1823            /// Returns `None` if the enum contains an unknown value deserialized from
1824            /// the integer representation of enums.
1825            pub fn name(&self) -> std::option::Option<&str> {
1826                match self {
1827                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1828                    Self::UserInitiatedUpgrade => {
1829                        std::option::Option::Some("USER_INITIATED_UPGRADE")
1830                    }
1831                    Self::GoogleDrivenUpgrade => std::option::Option::Some("GOOGLE_DRIVEN_UPGRADE"),
1832                    Self::UnknownValue(u) => u.0.name(),
1833                }
1834            }
1835        }
1836
1837        impl std::default::Default for Type {
1838            fn default() -> Self {
1839                use std::convert::From;
1840                Self::from(0)
1841            }
1842        }
1843
1844        impl std::fmt::Display for Type {
1845            fn fmt(
1846                &self,
1847                f: &mut std::fmt::Formatter<'_>,
1848            ) -> std::result::Result<(), std::fmt::Error> {
1849                wkt::internal::display_enum(f, self.name(), self.value())
1850            }
1851        }
1852
1853        impl std::convert::From<i32> for Type {
1854            fn from(value: i32) -> Self {
1855                match value {
1856                    0 => Self::Unspecified,
1857                    1 => Self::UserInitiatedUpgrade,
1858                    2 => Self::GoogleDrivenUpgrade,
1859                    _ => Self::UnknownValue(r#type::UnknownValue(
1860                        wkt::internal::UnknownEnumValue::Integer(value),
1861                    )),
1862                }
1863            }
1864        }
1865
1866        impl std::convert::From<&str> for Type {
1867            fn from(value: &str) -> Self {
1868                use std::string::ToString;
1869                match value {
1870                    "TYPE_UNSPECIFIED" => Self::Unspecified,
1871                    "USER_INITIATED_UPGRADE" => Self::UserInitiatedUpgrade,
1872                    "GOOGLE_DRIVEN_UPGRADE" => Self::GoogleDrivenUpgrade,
1873                    _ => Self::UnknownValue(r#type::UnknownValue(
1874                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1875                    )),
1876                }
1877            }
1878        }
1879
1880        impl serde::ser::Serialize for Type {
1881            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1882            where
1883                S: serde::Serializer,
1884            {
1885                match self {
1886                    Self::Unspecified => serializer.serialize_i32(0),
1887                    Self::UserInitiatedUpgrade => serializer.serialize_i32(1),
1888                    Self::GoogleDrivenUpgrade => serializer.serialize_i32(2),
1889                    Self::UnknownValue(u) => u.0.serialize(serializer),
1890                }
1891            }
1892        }
1893
1894        impl<'de> serde::de::Deserialize<'de> for Type {
1895            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1896            where
1897                D: serde::Deserializer<'de>,
1898            {
1899                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1900                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Type",
1901                ))
1902            }
1903        }
1904
1905        /// Indicates when the maintenance event should be performed.
1906        ///
1907        /// # Working with unknown values
1908        ///
1909        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1910        /// additional enum variants at any time. Adding new variants is not considered
1911        /// a breaking change. Applications should write their code in anticipation of:
1912        ///
1913        /// - New values appearing in future releases of the client library, **and**
1914        /// - New values received dynamically, without application changes.
1915        ///
1916        /// Please consult the [Working with enums] section in the user guide for some
1917        /// guidelines.
1918        ///
1919        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1920        #[derive(Clone, Debug, PartialEq)]
1921        #[non_exhaustive]
1922        pub enum Schedule {
1923            /// Unspecified.
1924            Unspecified,
1925            /// Immediately after receiving the request.
1926            Immediately,
1927            /// If set, the enum was initialized with an unknown value.
1928            ///
1929            /// Applications can examine the value using [Schedule::value] or
1930            /// [Schedule::name].
1931            UnknownValue(schedule::UnknownValue),
1932        }
1933
1934        #[doc(hidden)]
1935        pub mod schedule {
1936            #[allow(unused_imports)]
1937            use super::*;
1938            #[derive(Clone, Debug, PartialEq)]
1939            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1940        }
1941
1942        impl Schedule {
1943            /// Gets the enum value.
1944            ///
1945            /// Returns `None` if the enum contains an unknown value deserialized from
1946            /// the string representation of enums.
1947            pub fn value(&self) -> std::option::Option<i32> {
1948                match self {
1949                    Self::Unspecified => std::option::Option::Some(0),
1950                    Self::Immediately => std::option::Option::Some(1),
1951                    Self::UnknownValue(u) => u.0.value(),
1952                }
1953            }
1954
1955            /// Gets the enum value as a string.
1956            ///
1957            /// Returns `None` if the enum contains an unknown value deserialized from
1958            /// the integer representation of enums.
1959            pub fn name(&self) -> std::option::Option<&str> {
1960                match self {
1961                    Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
1962                    Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
1963                    Self::UnknownValue(u) => u.0.name(),
1964                }
1965            }
1966        }
1967
1968        impl std::default::Default for Schedule {
1969            fn default() -> Self {
1970                use std::convert::From;
1971                Self::from(0)
1972            }
1973        }
1974
1975        impl std::fmt::Display for Schedule {
1976            fn fmt(
1977                &self,
1978                f: &mut std::fmt::Formatter<'_>,
1979            ) -> std::result::Result<(), std::fmt::Error> {
1980                wkt::internal::display_enum(f, self.name(), self.value())
1981            }
1982        }
1983
1984        impl std::convert::From<i32> for Schedule {
1985            fn from(value: i32) -> Self {
1986                match value {
1987                    0 => Self::Unspecified,
1988                    1 => Self::Immediately,
1989                    _ => Self::UnknownValue(schedule::UnknownValue(
1990                        wkt::internal::UnknownEnumValue::Integer(value),
1991                    )),
1992                }
1993            }
1994        }
1995
1996        impl std::convert::From<&str> for Schedule {
1997            fn from(value: &str) -> Self {
1998                use std::string::ToString;
1999                match value {
2000                    "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
2001                    "IMMEDIATELY" => Self::Immediately,
2002                    _ => Self::UnknownValue(schedule::UnknownValue(
2003                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2004                    )),
2005                }
2006            }
2007        }
2008
2009        impl serde::ser::Serialize for Schedule {
2010            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2011            where
2012                S: serde::Serializer,
2013            {
2014                match self {
2015                    Self::Unspecified => serializer.serialize_i32(0),
2016                    Self::Immediately => serializer.serialize_i32(1),
2017                    Self::UnknownValue(u) => u.0.serialize(serializer),
2018                }
2019            }
2020        }
2021
2022        impl<'de> serde::de::Deserialize<'de> for Schedule {
2023            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2024            where
2025                D: serde::Deserializer<'de>,
2026            {
2027                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
2028                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Schedule",
2029                ))
2030            }
2031        }
2032
2033        /// Indicates the maintenance event state.
2034        ///
2035        /// # Working with unknown values
2036        ///
2037        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2038        /// additional enum variants at any time. Adding new variants is not considered
2039        /// a breaking change. Applications should write their code in anticipation of:
2040        ///
2041        /// - New values appearing in future releases of the client library, **and**
2042        /// - New values received dynamically, without application changes.
2043        ///
2044        /// Please consult the [Working with enums] section in the user guide for some
2045        /// guidelines.
2046        ///
2047        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2048        #[derive(Clone, Debug, PartialEq)]
2049        #[non_exhaustive]
2050        pub enum State {
2051            /// Unspecified.
2052            Unspecified,
2053            /// The maintenance event is ongoing. The cluster might be unusable.
2054            Reconciling,
2055            /// The maintenance event succeeded.
2056            Succeeded,
2057            /// The maintenance event failed.
2058            Failed,
2059            /// If set, the enum was initialized with an unknown value.
2060            ///
2061            /// Applications can examine the value using [State::value] or
2062            /// [State::name].
2063            UnknownValue(state::UnknownValue),
2064        }
2065
2066        #[doc(hidden)]
2067        pub mod state {
2068            #[allow(unused_imports)]
2069            use super::*;
2070            #[derive(Clone, Debug, PartialEq)]
2071            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2072        }
2073
2074        impl State {
2075            /// Gets the enum value.
2076            ///
2077            /// Returns `None` if the enum contains an unknown value deserialized from
2078            /// the string representation of enums.
2079            pub fn value(&self) -> std::option::Option<i32> {
2080                match self {
2081                    Self::Unspecified => std::option::Option::Some(0),
2082                    Self::Reconciling => std::option::Option::Some(1),
2083                    Self::Succeeded => std::option::Option::Some(2),
2084                    Self::Failed => std::option::Option::Some(3),
2085                    Self::UnknownValue(u) => u.0.value(),
2086                }
2087            }
2088
2089            /// Gets the enum value as a string.
2090            ///
2091            /// Returns `None` if the enum contains an unknown value deserialized from
2092            /// the integer representation of enums.
2093            pub fn name(&self) -> std::option::Option<&str> {
2094                match self {
2095                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2096                    Self::Reconciling => std::option::Option::Some("RECONCILING"),
2097                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
2098                    Self::Failed => std::option::Option::Some("FAILED"),
2099                    Self::UnknownValue(u) => u.0.name(),
2100                }
2101            }
2102        }
2103
2104        impl std::default::Default for State {
2105            fn default() -> Self {
2106                use std::convert::From;
2107                Self::from(0)
2108            }
2109        }
2110
2111        impl std::fmt::Display for State {
2112            fn fmt(
2113                &self,
2114                f: &mut std::fmt::Formatter<'_>,
2115            ) -> std::result::Result<(), std::fmt::Error> {
2116                wkt::internal::display_enum(f, self.name(), self.value())
2117            }
2118        }
2119
2120        impl std::convert::From<i32> for State {
2121            fn from(value: i32) -> Self {
2122                match value {
2123                    0 => Self::Unspecified,
2124                    1 => Self::Reconciling,
2125                    2 => Self::Succeeded,
2126                    3 => Self::Failed,
2127                    _ => Self::UnknownValue(state::UnknownValue(
2128                        wkt::internal::UnknownEnumValue::Integer(value),
2129                    )),
2130                }
2131            }
2132        }
2133
2134        impl std::convert::From<&str> for State {
2135            fn from(value: &str) -> Self {
2136                use std::string::ToString;
2137                match value {
2138                    "STATE_UNSPECIFIED" => Self::Unspecified,
2139                    "RECONCILING" => Self::Reconciling,
2140                    "SUCCEEDED" => Self::Succeeded,
2141                    "FAILED" => Self::Failed,
2142                    _ => Self::UnknownValue(state::UnknownValue(
2143                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2144                    )),
2145                }
2146            }
2147        }
2148
2149        impl serde::ser::Serialize for State {
2150            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2151            where
2152                S: serde::Serializer,
2153            {
2154                match self {
2155                    Self::Unspecified => serializer.serialize_i32(0),
2156                    Self::Reconciling => serializer.serialize_i32(1),
2157                    Self::Succeeded => serializer.serialize_i32(2),
2158                    Self::Failed => serializer.serialize_i32(3),
2159                    Self::UnknownValue(u) => u.0.serialize(serializer),
2160                }
2161            }
2162        }
2163
2164        impl<'de> serde::de::Deserialize<'de> for State {
2165            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2166            where
2167                D: serde::Deserializer<'de>,
2168            {
2169                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2170                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.State",
2171                ))
2172            }
2173        }
2174    }
2175
2176    /// Configuration of the cluster survivability, e.g., for the case when network
2177    /// connectivity is lost.
2178    #[derive(Clone, Default, PartialEq)]
2179    #[non_exhaustive]
2180    pub struct SurvivabilityConfig {
2181        /// Optional. Time period that allows the cluster nodes to be rebooted and
2182        /// become functional without network connectivity to Google. The default 0
2183        /// means not allowed. The maximum is 7 days.
2184        pub offline_reboot_ttl: std::option::Option<wkt::Duration>,
2185
2186        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2187    }
2188
2189    impl SurvivabilityConfig {
2190        pub fn new() -> Self {
2191            std::default::Default::default()
2192        }
2193
2194        /// Sets the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
2195        ///
2196        /// # Example
2197        /// ```ignore,no_run
2198        /// # use google_cloud_edgecontainer_v1::model::cluster::SurvivabilityConfig;
2199        /// use wkt::Duration;
2200        /// let x = SurvivabilityConfig::new().set_offline_reboot_ttl(Duration::default()/* use setters */);
2201        /// ```
2202        pub fn set_offline_reboot_ttl<T>(mut self, v: T) -> Self
2203        where
2204            T: std::convert::Into<wkt::Duration>,
2205        {
2206            self.offline_reboot_ttl = std::option::Option::Some(v.into());
2207            self
2208        }
2209
2210        /// Sets or clears the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
2211        ///
2212        /// # Example
2213        /// ```ignore,no_run
2214        /// # use google_cloud_edgecontainer_v1::model::cluster::SurvivabilityConfig;
2215        /// use wkt::Duration;
2216        /// let x = SurvivabilityConfig::new().set_or_clear_offline_reboot_ttl(Some(Duration::default()/* use setters */));
2217        /// let x = SurvivabilityConfig::new().set_or_clear_offline_reboot_ttl(None::<Duration>);
2218        /// ```
2219        pub fn set_or_clear_offline_reboot_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2220        where
2221            T: std::convert::Into<wkt::Duration>,
2222        {
2223            self.offline_reboot_ttl = v.map(|x| x.into());
2224            self
2225        }
2226    }
2227
2228    impl wkt::message::Message for SurvivabilityConfig {
2229        fn typename() -> &'static str {
2230            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SurvivabilityConfig"
2231        }
2232    }
2233
2234    /// ConnectionState holds the current connection state from the cluster to
2235    /// Google.
2236    #[derive(Clone, Default, PartialEq)]
2237    #[non_exhaustive]
2238    pub struct ConnectionState {
2239        /// Output only. The current connection state.
2240        pub state: crate::model::cluster::connection_state::State,
2241
2242        /// Output only. The time when the connection state was last changed.
2243        pub update_time: std::option::Option<wkt::Timestamp>,
2244
2245        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2246    }
2247
2248    impl ConnectionState {
2249        pub fn new() -> Self {
2250            std::default::Default::default()
2251        }
2252
2253        /// Sets the value of [state][crate::model::cluster::ConnectionState::state].
2254        ///
2255        /// # Example
2256        /// ```ignore,no_run
2257        /// # use google_cloud_edgecontainer_v1::model::cluster::ConnectionState;
2258        /// use google_cloud_edgecontainer_v1::model::cluster::connection_state::State;
2259        /// let x0 = ConnectionState::new().set_state(State::Disconnected);
2260        /// let x1 = ConnectionState::new().set_state(State::Connected);
2261        /// let x2 = ConnectionState::new().set_state(State::ConnectedAndSyncing);
2262        /// ```
2263        pub fn set_state<T: std::convert::Into<crate::model::cluster::connection_state::State>>(
2264            mut self,
2265            v: T,
2266        ) -> Self {
2267            self.state = v.into();
2268            self
2269        }
2270
2271        /// Sets the value of [update_time][crate::model::cluster::ConnectionState::update_time].
2272        ///
2273        /// # Example
2274        /// ```ignore,no_run
2275        /// # use google_cloud_edgecontainer_v1::model::cluster::ConnectionState;
2276        /// use wkt::Timestamp;
2277        /// let x = ConnectionState::new().set_update_time(Timestamp::default()/* use setters */);
2278        /// ```
2279        pub fn set_update_time<T>(mut self, v: T) -> Self
2280        where
2281            T: std::convert::Into<wkt::Timestamp>,
2282        {
2283            self.update_time = std::option::Option::Some(v.into());
2284            self
2285        }
2286
2287        /// Sets or clears the value of [update_time][crate::model::cluster::ConnectionState::update_time].
2288        ///
2289        /// # Example
2290        /// ```ignore,no_run
2291        /// # use google_cloud_edgecontainer_v1::model::cluster::ConnectionState;
2292        /// use wkt::Timestamp;
2293        /// let x = ConnectionState::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2294        /// let x = ConnectionState::new().set_or_clear_update_time(None::<Timestamp>);
2295        /// ```
2296        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2297        where
2298            T: std::convert::Into<wkt::Timestamp>,
2299        {
2300            self.update_time = v.map(|x| x.into());
2301            self
2302        }
2303    }
2304
2305    impl wkt::message::Message for ConnectionState {
2306        fn typename() -> &'static str {
2307            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ConnectionState"
2308        }
2309    }
2310
2311    /// Defines additional types related to [ConnectionState].
2312    pub mod connection_state {
2313        #[allow(unused_imports)]
2314        use super::*;
2315
2316        /// The connection state.
2317        ///
2318        /// # Working with unknown values
2319        ///
2320        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2321        /// additional enum variants at any time. Adding new variants is not considered
2322        /// a breaking change. Applications should write their code in anticipation of:
2323        ///
2324        /// - New values appearing in future releases of the client library, **and**
2325        /// - New values received dynamically, without application changes.
2326        ///
2327        /// Please consult the [Working with enums] section in the user guide for some
2328        /// guidelines.
2329        ///
2330        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2331        #[derive(Clone, Debug, PartialEq)]
2332        #[non_exhaustive]
2333        pub enum State {
2334            /// Unknown connection state.
2335            Unspecified,
2336            /// This cluster is currently disconnected from Google.
2337            Disconnected,
2338            /// This cluster is currently connected to Google.
2339            Connected,
2340            /// This cluster is currently connected to Google, but may have recently
2341            /// reconnected after a disconnection. It is still syncing back.
2342            ConnectedAndSyncing,
2343            /// If set, the enum was initialized with an unknown value.
2344            ///
2345            /// Applications can examine the value using [State::value] or
2346            /// [State::name].
2347            UnknownValue(state::UnknownValue),
2348        }
2349
2350        #[doc(hidden)]
2351        pub mod state {
2352            #[allow(unused_imports)]
2353            use super::*;
2354            #[derive(Clone, Debug, PartialEq)]
2355            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2356        }
2357
2358        impl State {
2359            /// Gets the enum value.
2360            ///
2361            /// Returns `None` if the enum contains an unknown value deserialized from
2362            /// the string representation of enums.
2363            pub fn value(&self) -> std::option::Option<i32> {
2364                match self {
2365                    Self::Unspecified => std::option::Option::Some(0),
2366                    Self::Disconnected => std::option::Option::Some(1),
2367                    Self::Connected => std::option::Option::Some(2),
2368                    Self::ConnectedAndSyncing => std::option::Option::Some(3),
2369                    Self::UnknownValue(u) => u.0.value(),
2370                }
2371            }
2372
2373            /// Gets the enum value as a string.
2374            ///
2375            /// Returns `None` if the enum contains an unknown value deserialized from
2376            /// the integer representation of enums.
2377            pub fn name(&self) -> std::option::Option<&str> {
2378                match self {
2379                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2380                    Self::Disconnected => std::option::Option::Some("DISCONNECTED"),
2381                    Self::Connected => std::option::Option::Some("CONNECTED"),
2382                    Self::ConnectedAndSyncing => std::option::Option::Some("CONNECTED_AND_SYNCING"),
2383                    Self::UnknownValue(u) => u.0.name(),
2384                }
2385            }
2386        }
2387
2388        impl std::default::Default for State {
2389            fn default() -> Self {
2390                use std::convert::From;
2391                Self::from(0)
2392            }
2393        }
2394
2395        impl std::fmt::Display for State {
2396            fn fmt(
2397                &self,
2398                f: &mut std::fmt::Formatter<'_>,
2399            ) -> std::result::Result<(), std::fmt::Error> {
2400                wkt::internal::display_enum(f, self.name(), self.value())
2401            }
2402        }
2403
2404        impl std::convert::From<i32> for State {
2405            fn from(value: i32) -> Self {
2406                match value {
2407                    0 => Self::Unspecified,
2408                    1 => Self::Disconnected,
2409                    2 => Self::Connected,
2410                    3 => Self::ConnectedAndSyncing,
2411                    _ => Self::UnknownValue(state::UnknownValue(
2412                        wkt::internal::UnknownEnumValue::Integer(value),
2413                    )),
2414                }
2415            }
2416        }
2417
2418        impl std::convert::From<&str> for State {
2419            fn from(value: &str) -> Self {
2420                use std::string::ToString;
2421                match value {
2422                    "STATE_UNSPECIFIED" => Self::Unspecified,
2423                    "DISCONNECTED" => Self::Disconnected,
2424                    "CONNECTED" => Self::Connected,
2425                    "CONNECTED_AND_SYNCING" => Self::ConnectedAndSyncing,
2426                    _ => Self::UnknownValue(state::UnknownValue(
2427                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2428                    )),
2429                }
2430            }
2431        }
2432
2433        impl serde::ser::Serialize for State {
2434            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2435            where
2436                S: serde::Serializer,
2437            {
2438                match self {
2439                    Self::Unspecified => serializer.serialize_i32(0),
2440                    Self::Disconnected => serializer.serialize_i32(1),
2441                    Self::Connected => serializer.serialize_i32(2),
2442                    Self::ConnectedAndSyncing => serializer.serialize_i32(3),
2443                    Self::UnknownValue(u) => u.0.serialize(serializer),
2444                }
2445            }
2446        }
2447
2448        impl<'de> serde::de::Deserialize<'de> for State {
2449            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2450            where
2451                D: serde::Deserializer<'de>,
2452            {
2453                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2454                    ".google.cloud.edgecontainer.v1.Cluster.ConnectionState.State",
2455                ))
2456            }
2457        }
2458    }
2459
2460    /// Indicates the status of the cluster.
2461    ///
2462    /// # Working with unknown values
2463    ///
2464    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2465    /// additional enum variants at any time. Adding new variants is not considered
2466    /// a breaking change. Applications should write their code in anticipation of:
2467    ///
2468    /// - New values appearing in future releases of the client library, **and**
2469    /// - New values received dynamically, without application changes.
2470    ///
2471    /// Please consult the [Working with enums] section in the user guide for some
2472    /// guidelines.
2473    ///
2474    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2475    #[derive(Clone, Debug, PartialEq)]
2476    #[non_exhaustive]
2477    pub enum Status {
2478        /// Status unknown.
2479        Unspecified,
2480        /// The cluster is being created.
2481        Provisioning,
2482        /// The cluster is created and fully usable.
2483        Running,
2484        /// The cluster is being deleted.
2485        Deleting,
2486        /// The status indicates that some errors occurred while reconciling/deleting
2487        /// the cluster.
2488        Error,
2489        /// The cluster is undergoing some work such as version upgrades, etc.
2490        Reconciling,
2491        /// If set, the enum was initialized with an unknown value.
2492        ///
2493        /// Applications can examine the value using [Status::value] or
2494        /// [Status::name].
2495        UnknownValue(status::UnknownValue),
2496    }
2497
2498    #[doc(hidden)]
2499    pub mod status {
2500        #[allow(unused_imports)]
2501        use super::*;
2502        #[derive(Clone, Debug, PartialEq)]
2503        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2504    }
2505
2506    impl Status {
2507        /// Gets the enum value.
2508        ///
2509        /// Returns `None` if the enum contains an unknown value deserialized from
2510        /// the string representation of enums.
2511        pub fn value(&self) -> std::option::Option<i32> {
2512            match self {
2513                Self::Unspecified => std::option::Option::Some(0),
2514                Self::Provisioning => std::option::Option::Some(1),
2515                Self::Running => std::option::Option::Some(2),
2516                Self::Deleting => std::option::Option::Some(3),
2517                Self::Error => std::option::Option::Some(4),
2518                Self::Reconciling => std::option::Option::Some(5),
2519                Self::UnknownValue(u) => u.0.value(),
2520            }
2521        }
2522
2523        /// Gets the enum value as a string.
2524        ///
2525        /// Returns `None` if the enum contains an unknown value deserialized from
2526        /// the integer representation of enums.
2527        pub fn name(&self) -> std::option::Option<&str> {
2528            match self {
2529                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
2530                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
2531                Self::Running => std::option::Option::Some("RUNNING"),
2532                Self::Deleting => std::option::Option::Some("DELETING"),
2533                Self::Error => std::option::Option::Some("ERROR"),
2534                Self::Reconciling => std::option::Option::Some("RECONCILING"),
2535                Self::UnknownValue(u) => u.0.name(),
2536            }
2537        }
2538    }
2539
2540    impl std::default::Default for Status {
2541        fn default() -> Self {
2542            use std::convert::From;
2543            Self::from(0)
2544        }
2545    }
2546
2547    impl std::fmt::Display for Status {
2548        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2549            wkt::internal::display_enum(f, self.name(), self.value())
2550        }
2551    }
2552
2553    impl std::convert::From<i32> for Status {
2554        fn from(value: i32) -> Self {
2555            match value {
2556                0 => Self::Unspecified,
2557                1 => Self::Provisioning,
2558                2 => Self::Running,
2559                3 => Self::Deleting,
2560                4 => Self::Error,
2561                5 => Self::Reconciling,
2562                _ => Self::UnknownValue(status::UnknownValue(
2563                    wkt::internal::UnknownEnumValue::Integer(value),
2564                )),
2565            }
2566        }
2567    }
2568
2569    impl std::convert::From<&str> for Status {
2570        fn from(value: &str) -> Self {
2571            use std::string::ToString;
2572            match value {
2573                "STATUS_UNSPECIFIED" => Self::Unspecified,
2574                "PROVISIONING" => Self::Provisioning,
2575                "RUNNING" => Self::Running,
2576                "DELETING" => Self::Deleting,
2577                "ERROR" => Self::Error,
2578                "RECONCILING" => Self::Reconciling,
2579                _ => Self::UnknownValue(status::UnknownValue(
2580                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2581                )),
2582            }
2583        }
2584    }
2585
2586    impl serde::ser::Serialize for Status {
2587        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2588        where
2589            S: serde::Serializer,
2590        {
2591            match self {
2592                Self::Unspecified => serializer.serialize_i32(0),
2593                Self::Provisioning => serializer.serialize_i32(1),
2594                Self::Running => serializer.serialize_i32(2),
2595                Self::Deleting => serializer.serialize_i32(3),
2596                Self::Error => serializer.serialize_i32(4),
2597                Self::Reconciling => serializer.serialize_i32(5),
2598                Self::UnknownValue(u) => u.0.serialize(serializer),
2599            }
2600        }
2601    }
2602
2603    impl<'de> serde::de::Deserialize<'de> for Status {
2604        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2605        where
2606            D: serde::Deserializer<'de>,
2607        {
2608            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
2609                ".google.cloud.edgecontainer.v1.Cluster.Status",
2610            ))
2611        }
2612    }
2613
2614    /// The release channel a cluster is subscribed to.
2615    ///
2616    /// # Working with unknown values
2617    ///
2618    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2619    /// additional enum variants at any time. Adding new variants is not considered
2620    /// a breaking change. Applications should write their code in anticipation of:
2621    ///
2622    /// - New values appearing in future releases of the client library, **and**
2623    /// - New values received dynamically, without application changes.
2624    ///
2625    /// Please consult the [Working with enums] section in the user guide for some
2626    /// guidelines.
2627    ///
2628    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2629    #[derive(Clone, Debug, PartialEq)]
2630    #[non_exhaustive]
2631    pub enum ReleaseChannel {
2632        /// Unspecified release channel. This will default to the REGULAR channel.
2633        Unspecified,
2634        /// No release channel.
2635        None,
2636        /// Regular release channel.
2637        Regular,
2638        /// If set, the enum was initialized with an unknown value.
2639        ///
2640        /// Applications can examine the value using [ReleaseChannel::value] or
2641        /// [ReleaseChannel::name].
2642        UnknownValue(release_channel::UnknownValue),
2643    }
2644
2645    #[doc(hidden)]
2646    pub mod release_channel {
2647        #[allow(unused_imports)]
2648        use super::*;
2649        #[derive(Clone, Debug, PartialEq)]
2650        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2651    }
2652
2653    impl ReleaseChannel {
2654        /// Gets the enum value.
2655        ///
2656        /// Returns `None` if the enum contains an unknown value deserialized from
2657        /// the string representation of enums.
2658        pub fn value(&self) -> std::option::Option<i32> {
2659            match self {
2660                Self::Unspecified => std::option::Option::Some(0),
2661                Self::None => std::option::Option::Some(1),
2662                Self::Regular => std::option::Option::Some(2),
2663                Self::UnknownValue(u) => u.0.value(),
2664            }
2665        }
2666
2667        /// Gets the enum value as a string.
2668        ///
2669        /// Returns `None` if the enum contains an unknown value deserialized from
2670        /// the integer representation of enums.
2671        pub fn name(&self) -> std::option::Option<&str> {
2672            match self {
2673                Self::Unspecified => std::option::Option::Some("RELEASE_CHANNEL_UNSPECIFIED"),
2674                Self::None => std::option::Option::Some("NONE"),
2675                Self::Regular => std::option::Option::Some("REGULAR"),
2676                Self::UnknownValue(u) => u.0.name(),
2677            }
2678        }
2679    }
2680
2681    impl std::default::Default for ReleaseChannel {
2682        fn default() -> Self {
2683            use std::convert::From;
2684            Self::from(0)
2685        }
2686    }
2687
2688    impl std::fmt::Display for ReleaseChannel {
2689        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2690            wkt::internal::display_enum(f, self.name(), self.value())
2691        }
2692    }
2693
2694    impl std::convert::From<i32> for ReleaseChannel {
2695        fn from(value: i32) -> Self {
2696            match value {
2697                0 => Self::Unspecified,
2698                1 => Self::None,
2699                2 => Self::Regular,
2700                _ => Self::UnknownValue(release_channel::UnknownValue(
2701                    wkt::internal::UnknownEnumValue::Integer(value),
2702                )),
2703            }
2704        }
2705    }
2706
2707    impl std::convert::From<&str> for ReleaseChannel {
2708        fn from(value: &str) -> Self {
2709            use std::string::ToString;
2710            match value {
2711                "RELEASE_CHANNEL_UNSPECIFIED" => Self::Unspecified,
2712                "NONE" => Self::None,
2713                "REGULAR" => Self::Regular,
2714                _ => Self::UnknownValue(release_channel::UnknownValue(
2715                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2716                )),
2717            }
2718        }
2719    }
2720
2721    impl serde::ser::Serialize for ReleaseChannel {
2722        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2723        where
2724            S: serde::Serializer,
2725        {
2726            match self {
2727                Self::Unspecified => serializer.serialize_i32(0),
2728                Self::None => serializer.serialize_i32(1),
2729                Self::Regular => serializer.serialize_i32(2),
2730                Self::UnknownValue(u) => u.0.serialize(serializer),
2731            }
2732        }
2733    }
2734
2735    impl<'de> serde::de::Deserialize<'de> for ReleaseChannel {
2736        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2737        where
2738            D: serde::Deserializer<'de>,
2739        {
2740            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReleaseChannel>::new(
2741                ".google.cloud.edgecontainer.v1.Cluster.ReleaseChannel",
2742            ))
2743        }
2744    }
2745}
2746
2747/// Cluster-wide networking configuration.
2748#[derive(Clone, Default, PartialEq)]
2749#[non_exhaustive]
2750pub struct ClusterNetworking {
2751    /// Required. All pods in the cluster are assigned an RFC1918 IPv4 address from
2752    /// these blocks. Only a single block is supported. This field cannot be
2753    /// changed after creation.
2754    pub cluster_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
2755
2756    /// Required. All services in the cluster are assigned an RFC1918 IPv4 address
2757    /// from these blocks. Only a single block is supported. This field cannot be
2758    /// changed after creation.
2759    pub services_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
2760
2761    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2762}
2763
2764impl ClusterNetworking {
2765    pub fn new() -> Self {
2766        std::default::Default::default()
2767    }
2768
2769    /// Sets the value of [cluster_ipv4_cidr_blocks][crate::model::ClusterNetworking::cluster_ipv4_cidr_blocks].
2770    ///
2771    /// # Example
2772    /// ```ignore,no_run
2773    /// # use google_cloud_edgecontainer_v1::model::ClusterNetworking;
2774    /// let x = ClusterNetworking::new().set_cluster_ipv4_cidr_blocks(["a", "b", "c"]);
2775    /// ```
2776    pub fn set_cluster_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
2777    where
2778        T: std::iter::IntoIterator<Item = V>,
2779        V: std::convert::Into<std::string::String>,
2780    {
2781        use std::iter::Iterator;
2782        self.cluster_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
2783        self
2784    }
2785
2786    /// Sets the value of [services_ipv4_cidr_blocks][crate::model::ClusterNetworking::services_ipv4_cidr_blocks].
2787    ///
2788    /// # Example
2789    /// ```ignore,no_run
2790    /// # use google_cloud_edgecontainer_v1::model::ClusterNetworking;
2791    /// let x = ClusterNetworking::new().set_services_ipv4_cidr_blocks(["a", "b", "c"]);
2792    /// ```
2793    pub fn set_services_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
2794    where
2795        T: std::iter::IntoIterator<Item = V>,
2796        V: std::convert::Into<std::string::String>,
2797    {
2798        use std::iter::Iterator;
2799        self.services_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
2800        self
2801    }
2802}
2803
2804impl wkt::message::Message for ClusterNetworking {
2805    fn typename() -> &'static str {
2806        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterNetworking"
2807    }
2808}
2809
2810/// Fleet related configuration.
2811///
2812/// Fleets are a Google Cloud concept for logically organizing clusters,
2813/// letting you use and manage multi-cluster capabilities and apply
2814/// consistent policies across your systems.
2815#[derive(Clone, Default, PartialEq)]
2816#[non_exhaustive]
2817pub struct Fleet {
2818    /// Required. The name of the Fleet host project where this cluster will be
2819    /// registered.
2820    ///
2821    /// Project names are formatted as
2822    /// `projects/<project-number>`.
2823    pub project: std::string::String,
2824
2825    /// Output only. The name of the managed Hub Membership resource associated to
2826    /// this cluster.
2827    ///
2828    /// Membership names are formatted as
2829    /// `projects/<project-number>/locations/global/membership/<cluster-id>`.
2830    pub membership: std::string::String,
2831
2832    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2833}
2834
2835impl Fleet {
2836    pub fn new() -> Self {
2837        std::default::Default::default()
2838    }
2839
2840    /// Sets the value of [project][crate::model::Fleet::project].
2841    ///
2842    /// # Example
2843    /// ```ignore,no_run
2844    /// # use google_cloud_edgecontainer_v1::model::Fleet;
2845    /// let x = Fleet::new().set_project("example");
2846    /// ```
2847    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848        self.project = v.into();
2849        self
2850    }
2851
2852    /// Sets the value of [membership][crate::model::Fleet::membership].
2853    ///
2854    /// # Example
2855    /// ```ignore,no_run
2856    /// # use google_cloud_edgecontainer_v1::model::Fleet;
2857    /// let x = Fleet::new().set_membership("example");
2858    /// ```
2859    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2860        self.membership = v.into();
2861        self
2862    }
2863}
2864
2865impl wkt::message::Message for Fleet {
2866    fn typename() -> &'static str {
2867        "type.googleapis.com/google.cloud.edgecontainer.v1.Fleet"
2868    }
2869}
2870
2871/// A user principal for an RBAC policy.
2872#[derive(Clone, Default, PartialEq)]
2873#[non_exhaustive]
2874pub struct ClusterUser {
2875    /// Required. An active Google username.
2876    pub username: std::string::String,
2877
2878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2879}
2880
2881impl ClusterUser {
2882    pub fn new() -> Self {
2883        std::default::Default::default()
2884    }
2885
2886    /// Sets the value of [username][crate::model::ClusterUser::username].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_edgecontainer_v1::model::ClusterUser;
2891    /// let x = ClusterUser::new().set_username("example");
2892    /// ```
2893    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2894        self.username = v.into();
2895        self
2896    }
2897}
2898
2899impl wkt::message::Message for ClusterUser {
2900    fn typename() -> &'static str {
2901        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterUser"
2902    }
2903}
2904
2905/// RBAC policy that will be applied and managed by GEC.
2906#[derive(Clone, Default, PartialEq)]
2907#[non_exhaustive]
2908pub struct Authorization {
2909    /// Required. User that will be granted the cluster-admin role on the cluster,
2910    /// providing full access to the cluster. Currently, this is a singular field,
2911    /// but will be expanded to allow multiple admins in the future.
2912    pub admin_users: std::option::Option<crate::model::ClusterUser>,
2913
2914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2915}
2916
2917impl Authorization {
2918    pub fn new() -> Self {
2919        std::default::Default::default()
2920    }
2921
2922    /// Sets the value of [admin_users][crate::model::Authorization::admin_users].
2923    ///
2924    /// # Example
2925    /// ```ignore,no_run
2926    /// # use google_cloud_edgecontainer_v1::model::Authorization;
2927    /// use google_cloud_edgecontainer_v1::model::ClusterUser;
2928    /// let x = Authorization::new().set_admin_users(ClusterUser::default()/* use setters */);
2929    /// ```
2930    pub fn set_admin_users<T>(mut self, v: T) -> Self
2931    where
2932        T: std::convert::Into<crate::model::ClusterUser>,
2933    {
2934        self.admin_users = std::option::Option::Some(v.into());
2935        self
2936    }
2937
2938    /// Sets or clears the value of [admin_users][crate::model::Authorization::admin_users].
2939    ///
2940    /// # Example
2941    /// ```ignore,no_run
2942    /// # use google_cloud_edgecontainer_v1::model::Authorization;
2943    /// use google_cloud_edgecontainer_v1::model::ClusterUser;
2944    /// let x = Authorization::new().set_or_clear_admin_users(Some(ClusterUser::default()/* use setters */));
2945    /// let x = Authorization::new().set_or_clear_admin_users(None::<ClusterUser>);
2946    /// ```
2947    pub fn set_or_clear_admin_users<T>(mut self, v: std::option::Option<T>) -> Self
2948    where
2949        T: std::convert::Into<crate::model::ClusterUser>,
2950    {
2951        self.admin_users = v.map(|x| x.into());
2952        self
2953    }
2954}
2955
2956impl wkt::message::Message for Authorization {
2957    fn typename() -> &'static str {
2958        "type.googleapis.com/google.cloud.edgecontainer.v1.Authorization"
2959    }
2960}
2961
2962/// A set of Kubernetes nodes in a cluster with common configuration and
2963/// specification.
2964#[derive(Clone, Default, PartialEq)]
2965#[non_exhaustive]
2966pub struct NodePool {
2967    /// Required. The resource name of the node pool.
2968    pub name: std::string::String,
2969
2970    /// Output only. The time when the node pool was created.
2971    pub create_time: std::option::Option<wkt::Timestamp>,
2972
2973    /// Output only. The time when the node pool was last updated.
2974    pub update_time: std::option::Option<wkt::Timestamp>,
2975
2976    /// Labels associated with this resource.
2977    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2978
2979    /// Name of the Google Distributed Cloud Edge zone where this node pool will be
2980    /// created. For example: `us-central1-edge-customer-a`.
2981    pub node_location: std::string::String,
2982
2983    /// Required. The number of nodes in the pool.
2984    pub node_count: i32,
2985
2986    /// Only machines matching this filter will be allowed to join the node pool.
2987    /// The filtering language accepts strings like "name=\<name\>", and is
2988    /// documented in more detail in [AIP-160](https://google.aip.dev/160).
2989    pub machine_filter: std::string::String,
2990
2991    /// Optional. Local disk encryption options. This field is only used when
2992    /// enabling CMEK support.
2993    pub local_disk_encryption: std::option::Option<crate::model::node_pool::LocalDiskEncryption>,
2994
2995    /// Output only. The lowest release version among all worker nodes.
2996    pub node_version: std::string::String,
2997
2998    /// Optional. Configuration for each node in the NodePool
2999    pub node_config: std::option::Option<crate::model::node_pool::NodeConfig>,
3000
3001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3002}
3003
3004impl NodePool {
3005    pub fn new() -> Self {
3006        std::default::Default::default()
3007    }
3008
3009    /// Sets the value of [name][crate::model::NodePool::name].
3010    ///
3011    /// # Example
3012    /// ```ignore,no_run
3013    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3014    /// let x = NodePool::new().set_name("example");
3015    /// ```
3016    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3017        self.name = v.into();
3018        self
3019    }
3020
3021    /// Sets the value of [create_time][crate::model::NodePool::create_time].
3022    ///
3023    /// # Example
3024    /// ```ignore,no_run
3025    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3026    /// use wkt::Timestamp;
3027    /// let x = NodePool::new().set_create_time(Timestamp::default()/* use setters */);
3028    /// ```
3029    pub fn set_create_time<T>(mut self, v: T) -> Self
3030    where
3031        T: std::convert::Into<wkt::Timestamp>,
3032    {
3033        self.create_time = std::option::Option::Some(v.into());
3034        self
3035    }
3036
3037    /// Sets or clears the value of [create_time][crate::model::NodePool::create_time].
3038    ///
3039    /// # Example
3040    /// ```ignore,no_run
3041    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3042    /// use wkt::Timestamp;
3043    /// let x = NodePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3044    /// let x = NodePool::new().set_or_clear_create_time(None::<Timestamp>);
3045    /// ```
3046    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3047    where
3048        T: std::convert::Into<wkt::Timestamp>,
3049    {
3050        self.create_time = v.map(|x| x.into());
3051        self
3052    }
3053
3054    /// Sets the value of [update_time][crate::model::NodePool::update_time].
3055    ///
3056    /// # Example
3057    /// ```ignore,no_run
3058    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3059    /// use wkt::Timestamp;
3060    /// let x = NodePool::new().set_update_time(Timestamp::default()/* use setters */);
3061    /// ```
3062    pub fn set_update_time<T>(mut self, v: T) -> Self
3063    where
3064        T: std::convert::Into<wkt::Timestamp>,
3065    {
3066        self.update_time = std::option::Option::Some(v.into());
3067        self
3068    }
3069
3070    /// Sets or clears the value of [update_time][crate::model::NodePool::update_time].
3071    ///
3072    /// # Example
3073    /// ```ignore,no_run
3074    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3075    /// use wkt::Timestamp;
3076    /// let x = NodePool::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3077    /// let x = NodePool::new().set_or_clear_update_time(None::<Timestamp>);
3078    /// ```
3079    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3080    where
3081        T: std::convert::Into<wkt::Timestamp>,
3082    {
3083        self.update_time = v.map(|x| x.into());
3084        self
3085    }
3086
3087    /// Sets the value of [labels][crate::model::NodePool::labels].
3088    ///
3089    /// # Example
3090    /// ```ignore,no_run
3091    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3092    /// let x = NodePool::new().set_labels([
3093    ///     ("key0", "abc"),
3094    ///     ("key1", "xyz"),
3095    /// ]);
3096    /// ```
3097    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3098    where
3099        T: std::iter::IntoIterator<Item = (K, V)>,
3100        K: std::convert::Into<std::string::String>,
3101        V: std::convert::Into<std::string::String>,
3102    {
3103        use std::iter::Iterator;
3104        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3105        self
3106    }
3107
3108    /// Sets the value of [node_location][crate::model::NodePool::node_location].
3109    ///
3110    /// # Example
3111    /// ```ignore,no_run
3112    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3113    /// let x = NodePool::new().set_node_location("example");
3114    /// ```
3115    pub fn set_node_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3116        self.node_location = v.into();
3117        self
3118    }
3119
3120    /// Sets the value of [node_count][crate::model::NodePool::node_count].
3121    ///
3122    /// # Example
3123    /// ```ignore,no_run
3124    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3125    /// let x = NodePool::new().set_node_count(42);
3126    /// ```
3127    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3128        self.node_count = v.into();
3129        self
3130    }
3131
3132    /// Sets the value of [machine_filter][crate::model::NodePool::machine_filter].
3133    ///
3134    /// # Example
3135    /// ```ignore,no_run
3136    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3137    /// let x = NodePool::new().set_machine_filter("example");
3138    /// ```
3139    pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3140        self.machine_filter = v.into();
3141        self
3142    }
3143
3144    /// Sets the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
3145    ///
3146    /// # Example
3147    /// ```ignore,no_run
3148    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3149    /// use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3150    /// let x = NodePool::new().set_local_disk_encryption(LocalDiskEncryption::default()/* use setters */);
3151    /// ```
3152    pub fn set_local_disk_encryption<T>(mut self, v: T) -> Self
3153    where
3154        T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
3155    {
3156        self.local_disk_encryption = std::option::Option::Some(v.into());
3157        self
3158    }
3159
3160    /// Sets or clears the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
3161    ///
3162    /// # Example
3163    /// ```ignore,no_run
3164    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3165    /// use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3166    /// let x = NodePool::new().set_or_clear_local_disk_encryption(Some(LocalDiskEncryption::default()/* use setters */));
3167    /// let x = NodePool::new().set_or_clear_local_disk_encryption(None::<LocalDiskEncryption>);
3168    /// ```
3169    pub fn set_or_clear_local_disk_encryption<T>(mut self, v: std::option::Option<T>) -> Self
3170    where
3171        T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
3172    {
3173        self.local_disk_encryption = v.map(|x| x.into());
3174        self
3175    }
3176
3177    /// Sets the value of [node_version][crate::model::NodePool::node_version].
3178    ///
3179    /// # Example
3180    /// ```ignore,no_run
3181    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3182    /// let x = NodePool::new().set_node_version("example");
3183    /// ```
3184    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3185        self.node_version = v.into();
3186        self
3187    }
3188
3189    /// Sets the value of [node_config][crate::model::NodePool::node_config].
3190    ///
3191    /// # Example
3192    /// ```ignore,no_run
3193    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3194    /// use google_cloud_edgecontainer_v1::model::node_pool::NodeConfig;
3195    /// let x = NodePool::new().set_node_config(NodeConfig::default()/* use setters */);
3196    /// ```
3197    pub fn set_node_config<T>(mut self, v: T) -> Self
3198    where
3199        T: std::convert::Into<crate::model::node_pool::NodeConfig>,
3200    {
3201        self.node_config = std::option::Option::Some(v.into());
3202        self
3203    }
3204
3205    /// Sets or clears the value of [node_config][crate::model::NodePool::node_config].
3206    ///
3207    /// # Example
3208    /// ```ignore,no_run
3209    /// # use google_cloud_edgecontainer_v1::model::NodePool;
3210    /// use google_cloud_edgecontainer_v1::model::node_pool::NodeConfig;
3211    /// let x = NodePool::new().set_or_clear_node_config(Some(NodeConfig::default()/* use setters */));
3212    /// let x = NodePool::new().set_or_clear_node_config(None::<NodeConfig>);
3213    /// ```
3214    pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
3215    where
3216        T: std::convert::Into<crate::model::node_pool::NodeConfig>,
3217    {
3218        self.node_config = v.map(|x| x.into());
3219        self
3220    }
3221}
3222
3223impl wkt::message::Message for NodePool {
3224    fn typename() -> &'static str {
3225        "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool"
3226    }
3227}
3228
3229/// Defines additional types related to [NodePool].
3230pub mod node_pool {
3231    #[allow(unused_imports)]
3232    use super::*;
3233
3234    /// Configuration for CMEK support for edge machine local disk encryption.
3235    #[derive(Clone, Default, PartialEq)]
3236    #[non_exhaustive]
3237    pub struct LocalDiskEncryption {
3238        /// Optional. The Cloud KMS CryptoKey e.g.
3239        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
3240        /// to use for protecting node local disks. If not specified, a
3241        /// Google-managed key will be used instead.
3242        pub kms_key: std::string::String,
3243
3244        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
3245        /// protecting node local disks. Only applicable if kms_key is set.
3246        pub kms_key_active_version: std::string::String,
3247
3248        /// Output only. Availability of the Cloud KMS CryptoKey. If not
3249        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
3250        /// local data. This can be caused by a lack of permissions to use the key,
3251        /// or if the key is disabled or deleted.
3252        pub kms_key_state: crate::model::KmsKeyState,
3253
3254        /// Output only. Error status returned by Cloud KMS when using this key. This
3255        /// field may be populated only if `kms_key_state` is not
3256        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
3257        /// error status reported by Cloud KMS.
3258        pub kms_status: std::option::Option<google_cloud_rpc::model::Status>,
3259
3260        /// Output only. The current resource state associated with the cmek.
3261        pub resource_state: crate::model::ResourceState,
3262
3263        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3264    }
3265
3266    impl LocalDiskEncryption {
3267        pub fn new() -> Self {
3268            std::default::Default::default()
3269        }
3270
3271        /// Sets the value of [kms_key][crate::model::node_pool::LocalDiskEncryption::kms_key].
3272        ///
3273        /// # Example
3274        /// ```ignore,no_run
3275        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3276        /// let x = LocalDiskEncryption::new().set_kms_key("example");
3277        /// ```
3278        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3279            self.kms_key = v.into();
3280            self
3281        }
3282
3283        /// Sets the value of [kms_key_active_version][crate::model::node_pool::LocalDiskEncryption::kms_key_active_version].
3284        ///
3285        /// # Example
3286        /// ```ignore,no_run
3287        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3288        /// let x = LocalDiskEncryption::new().set_kms_key_active_version("example");
3289        /// ```
3290        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
3291            mut self,
3292            v: T,
3293        ) -> Self {
3294            self.kms_key_active_version = v.into();
3295            self
3296        }
3297
3298        /// Sets the value of [kms_key_state][crate::model::node_pool::LocalDiskEncryption::kms_key_state].
3299        ///
3300        /// # Example
3301        /// ```ignore,no_run
3302        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3303        /// use google_cloud_edgecontainer_v1::model::KmsKeyState;
3304        /// let x0 = LocalDiskEncryption::new().set_kms_key_state(KmsKeyState::KeyAvailable);
3305        /// let x1 = LocalDiskEncryption::new().set_kms_key_state(KmsKeyState::KeyUnavailable);
3306        /// ```
3307        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
3308            mut self,
3309            v: T,
3310        ) -> Self {
3311            self.kms_key_state = v.into();
3312            self
3313        }
3314
3315        /// Sets the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
3316        ///
3317        /// # Example
3318        /// ```ignore,no_run
3319        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3320        /// use google_cloud_rpc::model::Status;
3321        /// let x = LocalDiskEncryption::new().set_kms_status(Status::default()/* use setters */);
3322        /// ```
3323        pub fn set_kms_status<T>(mut self, v: T) -> Self
3324        where
3325            T: std::convert::Into<google_cloud_rpc::model::Status>,
3326        {
3327            self.kms_status = std::option::Option::Some(v.into());
3328            self
3329        }
3330
3331        /// Sets or clears the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
3332        ///
3333        /// # Example
3334        /// ```ignore,no_run
3335        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3336        /// use google_cloud_rpc::model::Status;
3337        /// let x = LocalDiskEncryption::new().set_or_clear_kms_status(Some(Status::default()/* use setters */));
3338        /// let x = LocalDiskEncryption::new().set_or_clear_kms_status(None::<Status>);
3339        /// ```
3340        pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
3341        where
3342            T: std::convert::Into<google_cloud_rpc::model::Status>,
3343        {
3344            self.kms_status = v.map(|x| x.into());
3345            self
3346        }
3347
3348        /// Sets the value of [resource_state][crate::model::node_pool::LocalDiskEncryption::resource_state].
3349        ///
3350        /// # Example
3351        /// ```ignore,no_run
3352        /// # use google_cloud_edgecontainer_v1::model::node_pool::LocalDiskEncryption;
3353        /// use google_cloud_edgecontainer_v1::model::ResourceState;
3354        /// let x0 = LocalDiskEncryption::new().set_resource_state(ResourceState::LockDown);
3355        /// let x1 = LocalDiskEncryption::new().set_resource_state(ResourceState::LockDownPending);
3356        /// ```
3357        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
3358            mut self,
3359            v: T,
3360        ) -> Self {
3361            self.resource_state = v.into();
3362            self
3363        }
3364    }
3365
3366    impl wkt::message::Message for LocalDiskEncryption {
3367        fn typename() -> &'static str {
3368            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption"
3369        }
3370    }
3371
3372    /// Configuration for each node in the NodePool
3373    #[derive(Clone, Default, PartialEq)]
3374    #[non_exhaustive]
3375    pub struct NodeConfig {
3376        /// Optional. The Kubernetes node labels
3377        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3378
3379        /// Optional. Name for the storage schema of worker nodes.
3380        ///
3381        /// Warning: Configurable node local storage schema feature is an
3382        /// experimental feature, and is not recommended for general use
3383        /// in production clusters/nodepools.
3384        pub node_storage_schema: std::string::String,
3385
3386        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3387    }
3388
3389    impl NodeConfig {
3390        pub fn new() -> Self {
3391            std::default::Default::default()
3392        }
3393
3394        /// Sets the value of [labels][crate::model::node_pool::NodeConfig::labels].
3395        ///
3396        /// # Example
3397        /// ```ignore,no_run
3398        /// # use google_cloud_edgecontainer_v1::model::node_pool::NodeConfig;
3399        /// let x = NodeConfig::new().set_labels([
3400        ///     ("key0", "abc"),
3401        ///     ("key1", "xyz"),
3402        /// ]);
3403        /// ```
3404        pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3405        where
3406            T: std::iter::IntoIterator<Item = (K, V)>,
3407            K: std::convert::Into<std::string::String>,
3408            V: std::convert::Into<std::string::String>,
3409        {
3410            use std::iter::Iterator;
3411            self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3412            self
3413        }
3414
3415        /// Sets the value of [node_storage_schema][crate::model::node_pool::NodeConfig::node_storage_schema].
3416        ///
3417        /// # Example
3418        /// ```ignore,no_run
3419        /// # use google_cloud_edgecontainer_v1::model::node_pool::NodeConfig;
3420        /// let x = NodeConfig::new().set_node_storage_schema("example");
3421        /// ```
3422        pub fn set_node_storage_schema<T: std::convert::Into<std::string::String>>(
3423            mut self,
3424            v: T,
3425        ) -> Self {
3426            self.node_storage_schema = v.into();
3427            self
3428        }
3429    }
3430
3431    impl wkt::message::Message for NodeConfig {
3432        fn typename() -> &'static str {
3433            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.NodeConfig"
3434        }
3435    }
3436}
3437
3438/// A Google Distributed Cloud Edge machine capable of acting as a Kubernetes
3439/// node.
3440#[derive(Clone, Default, PartialEq)]
3441#[non_exhaustive]
3442pub struct Machine {
3443    /// Required. The resource name of the machine.
3444    pub name: std::string::String,
3445
3446    /// Output only. The time when the node pool was created.
3447    pub create_time: std::option::Option<wkt::Timestamp>,
3448
3449    /// Output only. The time when the node pool was last updated.
3450    pub update_time: std::option::Option<wkt::Timestamp>,
3451
3452    /// Labels associated with this resource.
3453    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3454
3455    /// Canonical resource name of the node that this machine is responsible for
3456    /// hosting e.g.
3457    /// projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node},
3458    /// Or empty if the machine is not assigned to assume the role of a node.
3459    ///
3460    /// For control plane nodes hosted on edge machines, this will return
3461    /// the following format:
3462    /// "projects/{project}/locations/{location}/clusters/{cluster_id}/controlPlaneNodes/{node}".
3463    pub hosted_node: std::string::String,
3464
3465    /// The Google Distributed Cloud Edge zone of this machine.
3466    pub zone: std::string::String,
3467
3468    /// Output only. The software version of the machine.
3469    pub version: std::string::String,
3470
3471    /// Output only. Whether the machine is disabled. If disabled, the machine is
3472    /// unable to enter service.
3473    pub disabled: bool,
3474
3475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3476}
3477
3478impl Machine {
3479    pub fn new() -> Self {
3480        std::default::Default::default()
3481    }
3482
3483    /// Sets the value of [name][crate::model::Machine::name].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_edgecontainer_v1::model::Machine;
3488    /// let x = Machine::new().set_name("example");
3489    /// ```
3490    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3491        self.name = v.into();
3492        self
3493    }
3494
3495    /// Sets the value of [create_time][crate::model::Machine::create_time].
3496    ///
3497    /// # Example
3498    /// ```ignore,no_run
3499    /// # use google_cloud_edgecontainer_v1::model::Machine;
3500    /// use wkt::Timestamp;
3501    /// let x = Machine::new().set_create_time(Timestamp::default()/* use setters */);
3502    /// ```
3503    pub fn set_create_time<T>(mut self, v: T) -> Self
3504    where
3505        T: std::convert::Into<wkt::Timestamp>,
3506    {
3507        self.create_time = std::option::Option::Some(v.into());
3508        self
3509    }
3510
3511    /// Sets or clears the value of [create_time][crate::model::Machine::create_time].
3512    ///
3513    /// # Example
3514    /// ```ignore,no_run
3515    /// # use google_cloud_edgecontainer_v1::model::Machine;
3516    /// use wkt::Timestamp;
3517    /// let x = Machine::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3518    /// let x = Machine::new().set_or_clear_create_time(None::<Timestamp>);
3519    /// ```
3520    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3521    where
3522        T: std::convert::Into<wkt::Timestamp>,
3523    {
3524        self.create_time = v.map(|x| x.into());
3525        self
3526    }
3527
3528    /// Sets the value of [update_time][crate::model::Machine::update_time].
3529    ///
3530    /// # Example
3531    /// ```ignore,no_run
3532    /// # use google_cloud_edgecontainer_v1::model::Machine;
3533    /// use wkt::Timestamp;
3534    /// let x = Machine::new().set_update_time(Timestamp::default()/* use setters */);
3535    /// ```
3536    pub fn set_update_time<T>(mut self, v: T) -> Self
3537    where
3538        T: std::convert::Into<wkt::Timestamp>,
3539    {
3540        self.update_time = std::option::Option::Some(v.into());
3541        self
3542    }
3543
3544    /// Sets or clears the value of [update_time][crate::model::Machine::update_time].
3545    ///
3546    /// # Example
3547    /// ```ignore,no_run
3548    /// # use google_cloud_edgecontainer_v1::model::Machine;
3549    /// use wkt::Timestamp;
3550    /// let x = Machine::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3551    /// let x = Machine::new().set_or_clear_update_time(None::<Timestamp>);
3552    /// ```
3553    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3554    where
3555        T: std::convert::Into<wkt::Timestamp>,
3556    {
3557        self.update_time = v.map(|x| x.into());
3558        self
3559    }
3560
3561    /// Sets the value of [labels][crate::model::Machine::labels].
3562    ///
3563    /// # Example
3564    /// ```ignore,no_run
3565    /// # use google_cloud_edgecontainer_v1::model::Machine;
3566    /// let x = Machine::new().set_labels([
3567    ///     ("key0", "abc"),
3568    ///     ("key1", "xyz"),
3569    /// ]);
3570    /// ```
3571    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3572    where
3573        T: std::iter::IntoIterator<Item = (K, V)>,
3574        K: std::convert::Into<std::string::String>,
3575        V: std::convert::Into<std::string::String>,
3576    {
3577        use std::iter::Iterator;
3578        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3579        self
3580    }
3581
3582    /// Sets the value of [hosted_node][crate::model::Machine::hosted_node].
3583    ///
3584    /// # Example
3585    /// ```ignore,no_run
3586    /// # use google_cloud_edgecontainer_v1::model::Machine;
3587    /// let x = Machine::new().set_hosted_node("example");
3588    /// ```
3589    pub fn set_hosted_node<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3590        self.hosted_node = v.into();
3591        self
3592    }
3593
3594    /// Sets the value of [zone][crate::model::Machine::zone].
3595    ///
3596    /// # Example
3597    /// ```ignore,no_run
3598    /// # use google_cloud_edgecontainer_v1::model::Machine;
3599    /// let x = Machine::new().set_zone("example");
3600    /// ```
3601    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602        self.zone = v.into();
3603        self
3604    }
3605
3606    /// Sets the value of [version][crate::model::Machine::version].
3607    ///
3608    /// # Example
3609    /// ```ignore,no_run
3610    /// # use google_cloud_edgecontainer_v1::model::Machine;
3611    /// let x = Machine::new().set_version("example");
3612    /// ```
3613    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3614        self.version = v.into();
3615        self
3616    }
3617
3618    /// Sets the value of [disabled][crate::model::Machine::disabled].
3619    ///
3620    /// # Example
3621    /// ```ignore,no_run
3622    /// # use google_cloud_edgecontainer_v1::model::Machine;
3623    /// let x = Machine::new().set_disabled(true);
3624    /// ```
3625    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3626        self.disabled = v.into();
3627        self
3628    }
3629}
3630
3631impl wkt::message::Message for Machine {
3632    fn typename() -> &'static str {
3633        "type.googleapis.com/google.cloud.edgecontainer.v1.Machine"
3634    }
3635}
3636
3637/// A VPN connection .
3638#[derive(Clone, Default, PartialEq)]
3639#[non_exhaustive]
3640pub struct VpnConnection {
3641    /// Required. The resource name of VPN connection
3642    pub name: std::string::String,
3643
3644    /// Output only. The time when the VPN connection was created.
3645    pub create_time: std::option::Option<wkt::Timestamp>,
3646
3647    /// Output only. The time when the VPN connection was last updated.
3648    pub update_time: std::option::Option<wkt::Timestamp>,
3649
3650    /// Labels associated with this resource.
3651    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3652
3653    /// NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the
3654    /// customer needs to configure NAT such that only one external IP maps to the
3655    /// GMEC Anthos cluster. This is empty if NAT is not used.
3656    pub nat_gateway_ip: std::string::String,
3657
3658    /// Dynamic routing mode of the VPC network, `regional` or `global`.
3659    #[deprecated]
3660    pub bgp_routing_mode: crate::model::vpn_connection::BgpRoutingMode,
3661
3662    /// The canonical Cluster name to connect to. It is in the form of
3663    /// projects/{project}/locations/{location}/clusters/{cluster}.
3664    pub cluster: std::string::String,
3665
3666    /// The network ID of VPC to connect to.
3667    pub vpc: std::string::String,
3668
3669    /// Optional. Project detail of the VPC network. Required if VPC is in a
3670    /// different project than the cluster project.
3671    pub vpc_project: std::option::Option<crate::model::vpn_connection::VpcProject>,
3672
3673    /// Whether this VPN connection has HA enabled on cluster side. If enabled,
3674    /// when creating VPN connection we will attempt to use 2 ANG floating IPs.
3675    pub enable_high_availability: bool,
3676
3677    /// Optional. The VPN connection Cloud Router name.
3678    pub router: std::string::String,
3679
3680    /// Output only. The created connection details.
3681    pub details: std::option::Option<crate::model::vpn_connection::Details>,
3682
3683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3684}
3685
3686impl VpnConnection {
3687    pub fn new() -> Self {
3688        std::default::Default::default()
3689    }
3690
3691    /// Sets the value of [name][crate::model::VpnConnection::name].
3692    ///
3693    /// # Example
3694    /// ```ignore,no_run
3695    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3696    /// let x = VpnConnection::new().set_name("example");
3697    /// ```
3698    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3699        self.name = v.into();
3700        self
3701    }
3702
3703    /// Sets the value of [create_time][crate::model::VpnConnection::create_time].
3704    ///
3705    /// # Example
3706    /// ```ignore,no_run
3707    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3708    /// use wkt::Timestamp;
3709    /// let x = VpnConnection::new().set_create_time(Timestamp::default()/* use setters */);
3710    /// ```
3711    pub fn set_create_time<T>(mut self, v: T) -> Self
3712    where
3713        T: std::convert::Into<wkt::Timestamp>,
3714    {
3715        self.create_time = std::option::Option::Some(v.into());
3716        self
3717    }
3718
3719    /// Sets or clears the value of [create_time][crate::model::VpnConnection::create_time].
3720    ///
3721    /// # Example
3722    /// ```ignore,no_run
3723    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3724    /// use wkt::Timestamp;
3725    /// let x = VpnConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3726    /// let x = VpnConnection::new().set_or_clear_create_time(None::<Timestamp>);
3727    /// ```
3728    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3729    where
3730        T: std::convert::Into<wkt::Timestamp>,
3731    {
3732        self.create_time = v.map(|x| x.into());
3733        self
3734    }
3735
3736    /// Sets the value of [update_time][crate::model::VpnConnection::update_time].
3737    ///
3738    /// # Example
3739    /// ```ignore,no_run
3740    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3741    /// use wkt::Timestamp;
3742    /// let x = VpnConnection::new().set_update_time(Timestamp::default()/* use setters */);
3743    /// ```
3744    pub fn set_update_time<T>(mut self, v: T) -> Self
3745    where
3746        T: std::convert::Into<wkt::Timestamp>,
3747    {
3748        self.update_time = std::option::Option::Some(v.into());
3749        self
3750    }
3751
3752    /// Sets or clears the value of [update_time][crate::model::VpnConnection::update_time].
3753    ///
3754    /// # Example
3755    /// ```ignore,no_run
3756    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3757    /// use wkt::Timestamp;
3758    /// let x = VpnConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3759    /// let x = VpnConnection::new().set_or_clear_update_time(None::<Timestamp>);
3760    /// ```
3761    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3762    where
3763        T: std::convert::Into<wkt::Timestamp>,
3764    {
3765        self.update_time = v.map(|x| x.into());
3766        self
3767    }
3768
3769    /// Sets the value of [labels][crate::model::VpnConnection::labels].
3770    ///
3771    /// # Example
3772    /// ```ignore,no_run
3773    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3774    /// let x = VpnConnection::new().set_labels([
3775    ///     ("key0", "abc"),
3776    ///     ("key1", "xyz"),
3777    /// ]);
3778    /// ```
3779    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3780    where
3781        T: std::iter::IntoIterator<Item = (K, V)>,
3782        K: std::convert::Into<std::string::String>,
3783        V: std::convert::Into<std::string::String>,
3784    {
3785        use std::iter::Iterator;
3786        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3787        self
3788    }
3789
3790    /// Sets the value of [nat_gateway_ip][crate::model::VpnConnection::nat_gateway_ip].
3791    ///
3792    /// # Example
3793    /// ```ignore,no_run
3794    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3795    /// let x = VpnConnection::new().set_nat_gateway_ip("example");
3796    /// ```
3797    pub fn set_nat_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3798        self.nat_gateway_ip = v.into();
3799        self
3800    }
3801
3802    /// Sets the value of [bgp_routing_mode][crate::model::VpnConnection::bgp_routing_mode].
3803    ///
3804    /// # Example
3805    /// ```ignore,no_run
3806    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3807    /// use google_cloud_edgecontainer_v1::model::vpn_connection::BgpRoutingMode;
3808    /// let x0 = VpnConnection::new().set_bgp_routing_mode(BgpRoutingMode::Regional);
3809    /// let x1 = VpnConnection::new().set_bgp_routing_mode(BgpRoutingMode::Global);
3810    /// ```
3811    #[deprecated]
3812    pub fn set_bgp_routing_mode<
3813        T: std::convert::Into<crate::model::vpn_connection::BgpRoutingMode>,
3814    >(
3815        mut self,
3816        v: T,
3817    ) -> Self {
3818        self.bgp_routing_mode = v.into();
3819        self
3820    }
3821
3822    /// Sets the value of [cluster][crate::model::VpnConnection::cluster].
3823    ///
3824    /// # Example
3825    /// ```ignore,no_run
3826    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3827    /// let x = VpnConnection::new().set_cluster("example");
3828    /// ```
3829    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3830        self.cluster = v.into();
3831        self
3832    }
3833
3834    /// Sets the value of [vpc][crate::model::VpnConnection::vpc].
3835    ///
3836    /// # Example
3837    /// ```ignore,no_run
3838    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3839    /// let x = VpnConnection::new().set_vpc("example");
3840    /// ```
3841    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3842        self.vpc = v.into();
3843        self
3844    }
3845
3846    /// Sets the value of [vpc_project][crate::model::VpnConnection::vpc_project].
3847    ///
3848    /// # Example
3849    /// ```ignore,no_run
3850    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3851    /// use google_cloud_edgecontainer_v1::model::vpn_connection::VpcProject;
3852    /// let x = VpnConnection::new().set_vpc_project(VpcProject::default()/* use setters */);
3853    /// ```
3854    pub fn set_vpc_project<T>(mut self, v: T) -> Self
3855    where
3856        T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
3857    {
3858        self.vpc_project = std::option::Option::Some(v.into());
3859        self
3860    }
3861
3862    /// Sets or clears the value of [vpc_project][crate::model::VpnConnection::vpc_project].
3863    ///
3864    /// # Example
3865    /// ```ignore,no_run
3866    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3867    /// use google_cloud_edgecontainer_v1::model::vpn_connection::VpcProject;
3868    /// let x = VpnConnection::new().set_or_clear_vpc_project(Some(VpcProject::default()/* use setters */));
3869    /// let x = VpnConnection::new().set_or_clear_vpc_project(None::<VpcProject>);
3870    /// ```
3871    pub fn set_or_clear_vpc_project<T>(mut self, v: std::option::Option<T>) -> Self
3872    where
3873        T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
3874    {
3875        self.vpc_project = v.map(|x| x.into());
3876        self
3877    }
3878
3879    /// Sets the value of [enable_high_availability][crate::model::VpnConnection::enable_high_availability].
3880    ///
3881    /// # Example
3882    /// ```ignore,no_run
3883    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3884    /// let x = VpnConnection::new().set_enable_high_availability(true);
3885    /// ```
3886    pub fn set_enable_high_availability<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3887        self.enable_high_availability = v.into();
3888        self
3889    }
3890
3891    /// Sets the value of [router][crate::model::VpnConnection::router].
3892    ///
3893    /// # Example
3894    /// ```ignore,no_run
3895    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3896    /// let x = VpnConnection::new().set_router("example");
3897    /// ```
3898    pub fn set_router<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3899        self.router = v.into();
3900        self
3901    }
3902
3903    /// Sets the value of [details][crate::model::VpnConnection::details].
3904    ///
3905    /// # Example
3906    /// ```ignore,no_run
3907    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3908    /// use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
3909    /// let x = VpnConnection::new().set_details(Details::default()/* use setters */);
3910    /// ```
3911    pub fn set_details<T>(mut self, v: T) -> Self
3912    where
3913        T: std::convert::Into<crate::model::vpn_connection::Details>,
3914    {
3915        self.details = std::option::Option::Some(v.into());
3916        self
3917    }
3918
3919    /// Sets or clears the value of [details][crate::model::VpnConnection::details].
3920    ///
3921    /// # Example
3922    /// ```ignore,no_run
3923    /// # use google_cloud_edgecontainer_v1::model::VpnConnection;
3924    /// use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
3925    /// let x = VpnConnection::new().set_or_clear_details(Some(Details::default()/* use setters */));
3926    /// let x = VpnConnection::new().set_or_clear_details(None::<Details>);
3927    /// ```
3928    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
3929    where
3930        T: std::convert::Into<crate::model::vpn_connection::Details>,
3931    {
3932        self.details = v.map(|x| x.into());
3933        self
3934    }
3935}
3936
3937impl wkt::message::Message for VpnConnection {
3938    fn typename() -> &'static str {
3939        "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection"
3940    }
3941}
3942
3943/// Defines additional types related to [VpnConnection].
3944pub mod vpn_connection {
3945    #[allow(unused_imports)]
3946    use super::*;
3947
3948    /// Project detail of the VPC network.
3949    #[derive(Clone, Default, PartialEq)]
3950    #[non_exhaustive]
3951    pub struct VpcProject {
3952        /// The project of the VPC to connect to. If not specified, it is the same as
3953        /// the cluster project.
3954        pub project_id: std::string::String,
3955
3956        /// Optional. Deprecated: do not use.
3957        #[deprecated]
3958        pub service_account: std::string::String,
3959
3960        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3961    }
3962
3963    impl VpcProject {
3964        pub fn new() -> Self {
3965            std::default::Default::default()
3966        }
3967
3968        /// Sets the value of [project_id][crate::model::vpn_connection::VpcProject::project_id].
3969        ///
3970        /// # Example
3971        /// ```ignore,no_run
3972        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::VpcProject;
3973        /// let x = VpcProject::new().set_project_id("example");
3974        /// ```
3975        pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3976            self.project_id = v.into();
3977            self
3978        }
3979
3980        /// Sets the value of [service_account][crate::model::vpn_connection::VpcProject::service_account].
3981        ///
3982        /// # Example
3983        /// ```ignore,no_run
3984        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::VpcProject;
3985        /// let x = VpcProject::new().set_service_account("example");
3986        /// ```
3987        #[deprecated]
3988        pub fn set_service_account<T: std::convert::Into<std::string::String>>(
3989            mut self,
3990            v: T,
3991        ) -> Self {
3992            self.service_account = v.into();
3993            self
3994        }
3995    }
3996
3997    impl wkt::message::Message for VpcProject {
3998        fn typename() -> &'static str {
3999            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.VpcProject"
4000        }
4001    }
4002
4003    /// The created connection details.
4004    #[derive(Clone, Default, PartialEq)]
4005    #[non_exhaustive]
4006    pub struct Details {
4007        /// The state of this connection.
4008        pub state: crate::model::vpn_connection::details::State,
4009
4010        /// The error message. This is only populated when state=ERROR.
4011        pub error: std::string::String,
4012
4013        /// The Cloud Router info.
4014        pub cloud_router: std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
4015
4016        /// Each connection has multiple Cloud VPN gateways.
4017        pub cloud_vpns: std::vec::Vec<crate::model::vpn_connection::details::CloudVpn>,
4018
4019        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4020    }
4021
4022    impl Details {
4023        pub fn new() -> Self {
4024            std::default::Default::default()
4025        }
4026
4027        /// Sets the value of [state][crate::model::vpn_connection::Details::state].
4028        ///
4029        /// # Example
4030        /// ```ignore,no_run
4031        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
4032        /// use google_cloud_edgecontainer_v1::model::vpn_connection::details::State;
4033        /// let x0 = Details::new().set_state(State::Connected);
4034        /// let x1 = Details::new().set_state(State::Connecting);
4035        /// let x2 = Details::new().set_state(State::Error);
4036        /// ```
4037        pub fn set_state<T: std::convert::Into<crate::model::vpn_connection::details::State>>(
4038            mut self,
4039            v: T,
4040        ) -> Self {
4041            self.state = v.into();
4042            self
4043        }
4044
4045        /// Sets the value of [error][crate::model::vpn_connection::Details::error].
4046        ///
4047        /// # Example
4048        /// ```ignore,no_run
4049        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
4050        /// let x = Details::new().set_error("example");
4051        /// ```
4052        pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4053            self.error = v.into();
4054            self
4055        }
4056
4057        /// Sets the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
4058        ///
4059        /// # Example
4060        /// ```ignore,no_run
4061        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
4062        /// use google_cloud_edgecontainer_v1::model::vpn_connection::details::CloudRouter;
4063        /// let x = Details::new().set_cloud_router(CloudRouter::default()/* use setters */);
4064        /// ```
4065        pub fn set_cloud_router<T>(mut self, v: T) -> Self
4066        where
4067            T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
4068        {
4069            self.cloud_router = std::option::Option::Some(v.into());
4070            self
4071        }
4072
4073        /// Sets or clears the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
4074        ///
4075        /// # Example
4076        /// ```ignore,no_run
4077        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
4078        /// use google_cloud_edgecontainer_v1::model::vpn_connection::details::CloudRouter;
4079        /// let x = Details::new().set_or_clear_cloud_router(Some(CloudRouter::default()/* use setters */));
4080        /// let x = Details::new().set_or_clear_cloud_router(None::<CloudRouter>);
4081        /// ```
4082        pub fn set_or_clear_cloud_router<T>(mut self, v: std::option::Option<T>) -> Self
4083        where
4084            T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
4085        {
4086            self.cloud_router = v.map(|x| x.into());
4087            self
4088        }
4089
4090        /// Sets the value of [cloud_vpns][crate::model::vpn_connection::Details::cloud_vpns].
4091        ///
4092        /// # Example
4093        /// ```ignore,no_run
4094        /// # use google_cloud_edgecontainer_v1::model::vpn_connection::Details;
4095        /// use google_cloud_edgecontainer_v1::model::vpn_connection::details::CloudVpn;
4096        /// let x = Details::new()
4097        ///     .set_cloud_vpns([
4098        ///         CloudVpn::default()/* use setters */,
4099        ///         CloudVpn::default()/* use (different) setters */,
4100        ///     ]);
4101        /// ```
4102        pub fn set_cloud_vpns<T, V>(mut self, v: T) -> Self
4103        where
4104            T: std::iter::IntoIterator<Item = V>,
4105            V: std::convert::Into<crate::model::vpn_connection::details::CloudVpn>,
4106        {
4107            use std::iter::Iterator;
4108            self.cloud_vpns = v.into_iter().map(|i| i.into()).collect();
4109            self
4110        }
4111    }
4112
4113    impl wkt::message::Message for Details {
4114        fn typename() -> &'static str {
4115            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details"
4116        }
4117    }
4118
4119    /// Defines additional types related to [Details].
4120    pub mod details {
4121        #[allow(unused_imports)]
4122        use super::*;
4123
4124        /// The Cloud Router info.
4125        #[derive(Clone, Default, PartialEq)]
4126        #[non_exhaustive]
4127        pub struct CloudRouter {
4128            /// The associated Cloud Router name.
4129            pub name: std::string::String,
4130
4131            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4132        }
4133
4134        impl CloudRouter {
4135            pub fn new() -> Self {
4136                std::default::Default::default()
4137            }
4138
4139            /// Sets the value of [name][crate::model::vpn_connection::details::CloudRouter::name].
4140            ///
4141            /// # Example
4142            /// ```ignore,no_run
4143            /// # use google_cloud_edgecontainer_v1::model::vpn_connection::details::CloudRouter;
4144            /// let x = CloudRouter::new().set_name("example");
4145            /// ```
4146            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4147                self.name = v.into();
4148                self
4149            }
4150        }
4151
4152        impl wkt::message::Message for CloudRouter {
4153            fn typename() -> &'static str {
4154                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter"
4155            }
4156        }
4157
4158        /// The Cloud VPN info.
4159        #[derive(Clone, Default, PartialEq)]
4160        #[non_exhaustive]
4161        pub struct CloudVpn {
4162            /// The created Cloud VPN gateway name.
4163            pub gateway: std::string::String,
4164
4165            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4166        }
4167
4168        impl CloudVpn {
4169            pub fn new() -> Self {
4170                std::default::Default::default()
4171            }
4172
4173            /// Sets the value of [gateway][crate::model::vpn_connection::details::CloudVpn::gateway].
4174            ///
4175            /// # Example
4176            /// ```ignore,no_run
4177            /// # use google_cloud_edgecontainer_v1::model::vpn_connection::details::CloudVpn;
4178            /// let x = CloudVpn::new().set_gateway("example");
4179            /// ```
4180            pub fn set_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4181                self.gateway = v.into();
4182                self
4183            }
4184        }
4185
4186        impl wkt::message::Message for CloudVpn {
4187            fn typename() -> &'static str {
4188                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn"
4189            }
4190        }
4191
4192        /// The current connection state.
4193        ///
4194        /// # Working with unknown values
4195        ///
4196        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4197        /// additional enum variants at any time. Adding new variants is not considered
4198        /// a breaking change. Applications should write their code in anticipation of:
4199        ///
4200        /// - New values appearing in future releases of the client library, **and**
4201        /// - New values received dynamically, without application changes.
4202        ///
4203        /// Please consult the [Working with enums] section in the user guide for some
4204        /// guidelines.
4205        ///
4206        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4207        #[derive(Clone, Debug, PartialEq)]
4208        #[non_exhaustive]
4209        pub enum State {
4210            /// Unknown.
4211            Unspecified,
4212            /// Connected.
4213            Connected,
4214            /// Still connecting.
4215            Connecting,
4216            /// Error occurred.
4217            Error,
4218            /// If set, the enum was initialized with an unknown value.
4219            ///
4220            /// Applications can examine the value using [State::value] or
4221            /// [State::name].
4222            UnknownValue(state::UnknownValue),
4223        }
4224
4225        #[doc(hidden)]
4226        pub mod state {
4227            #[allow(unused_imports)]
4228            use super::*;
4229            #[derive(Clone, Debug, PartialEq)]
4230            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4231        }
4232
4233        impl State {
4234            /// Gets the enum value.
4235            ///
4236            /// Returns `None` if the enum contains an unknown value deserialized from
4237            /// the string representation of enums.
4238            pub fn value(&self) -> std::option::Option<i32> {
4239                match self {
4240                    Self::Unspecified => std::option::Option::Some(0),
4241                    Self::Connected => std::option::Option::Some(1),
4242                    Self::Connecting => std::option::Option::Some(2),
4243                    Self::Error => std::option::Option::Some(3),
4244                    Self::UnknownValue(u) => u.0.value(),
4245                }
4246            }
4247
4248            /// Gets the enum value as a string.
4249            ///
4250            /// Returns `None` if the enum contains an unknown value deserialized from
4251            /// the integer representation of enums.
4252            pub fn name(&self) -> std::option::Option<&str> {
4253                match self {
4254                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4255                    Self::Connected => std::option::Option::Some("STATE_CONNECTED"),
4256                    Self::Connecting => std::option::Option::Some("STATE_CONNECTING"),
4257                    Self::Error => std::option::Option::Some("STATE_ERROR"),
4258                    Self::UnknownValue(u) => u.0.name(),
4259                }
4260            }
4261        }
4262
4263        impl std::default::Default for State {
4264            fn default() -> Self {
4265                use std::convert::From;
4266                Self::from(0)
4267            }
4268        }
4269
4270        impl std::fmt::Display for State {
4271            fn fmt(
4272                &self,
4273                f: &mut std::fmt::Formatter<'_>,
4274            ) -> std::result::Result<(), std::fmt::Error> {
4275                wkt::internal::display_enum(f, self.name(), self.value())
4276            }
4277        }
4278
4279        impl std::convert::From<i32> for State {
4280            fn from(value: i32) -> Self {
4281                match value {
4282                    0 => Self::Unspecified,
4283                    1 => Self::Connected,
4284                    2 => Self::Connecting,
4285                    3 => Self::Error,
4286                    _ => Self::UnknownValue(state::UnknownValue(
4287                        wkt::internal::UnknownEnumValue::Integer(value),
4288                    )),
4289                }
4290            }
4291        }
4292
4293        impl std::convert::From<&str> for State {
4294            fn from(value: &str) -> Self {
4295                use std::string::ToString;
4296                match value {
4297                    "STATE_UNSPECIFIED" => Self::Unspecified,
4298                    "STATE_CONNECTED" => Self::Connected,
4299                    "STATE_CONNECTING" => Self::Connecting,
4300                    "STATE_ERROR" => Self::Error,
4301                    _ => Self::UnknownValue(state::UnknownValue(
4302                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4303                    )),
4304                }
4305            }
4306        }
4307
4308        impl serde::ser::Serialize for State {
4309            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4310            where
4311                S: serde::Serializer,
4312            {
4313                match self {
4314                    Self::Unspecified => serializer.serialize_i32(0),
4315                    Self::Connected => serializer.serialize_i32(1),
4316                    Self::Connecting => serializer.serialize_i32(2),
4317                    Self::Error => serializer.serialize_i32(3),
4318                    Self::UnknownValue(u) => u.0.serialize(serializer),
4319                }
4320            }
4321        }
4322
4323        impl<'de> serde::de::Deserialize<'de> for State {
4324            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4325            where
4326                D: serde::Deserializer<'de>,
4327            {
4328                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4329                    ".google.cloud.edgecontainer.v1.VpnConnection.Details.State",
4330                ))
4331            }
4332        }
4333    }
4334
4335    /// Routing mode.
4336    ///
4337    /// # Working with unknown values
4338    ///
4339    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4340    /// additional enum variants at any time. Adding new variants is not considered
4341    /// a breaking change. Applications should write their code in anticipation of:
4342    ///
4343    /// - New values appearing in future releases of the client library, **and**
4344    /// - New values received dynamically, without application changes.
4345    ///
4346    /// Please consult the [Working with enums] section in the user guide for some
4347    /// guidelines.
4348    ///
4349    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4350    #[derive(Clone, Debug, PartialEq)]
4351    #[non_exhaustive]
4352    pub enum BgpRoutingMode {
4353        /// Unknown.
4354        Unspecified,
4355        /// Regional mode.
4356        Regional,
4357        /// Global mode.
4358        Global,
4359        /// If set, the enum was initialized with an unknown value.
4360        ///
4361        /// Applications can examine the value using [BgpRoutingMode::value] or
4362        /// [BgpRoutingMode::name].
4363        UnknownValue(bgp_routing_mode::UnknownValue),
4364    }
4365
4366    #[doc(hidden)]
4367    pub mod bgp_routing_mode {
4368        #[allow(unused_imports)]
4369        use super::*;
4370        #[derive(Clone, Debug, PartialEq)]
4371        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4372    }
4373
4374    impl BgpRoutingMode {
4375        /// Gets the enum value.
4376        ///
4377        /// Returns `None` if the enum contains an unknown value deserialized from
4378        /// the string representation of enums.
4379        pub fn value(&self) -> std::option::Option<i32> {
4380            match self {
4381                Self::Unspecified => std::option::Option::Some(0),
4382                Self::Regional => std::option::Option::Some(1),
4383                Self::Global => std::option::Option::Some(2),
4384                Self::UnknownValue(u) => u.0.value(),
4385            }
4386        }
4387
4388        /// Gets the enum value as a string.
4389        ///
4390        /// Returns `None` if the enum contains an unknown value deserialized from
4391        /// the integer representation of enums.
4392        pub fn name(&self) -> std::option::Option<&str> {
4393            match self {
4394                Self::Unspecified => std::option::Option::Some("BGP_ROUTING_MODE_UNSPECIFIED"),
4395                Self::Regional => std::option::Option::Some("REGIONAL"),
4396                Self::Global => std::option::Option::Some("GLOBAL"),
4397                Self::UnknownValue(u) => u.0.name(),
4398            }
4399        }
4400    }
4401
4402    impl std::default::Default for BgpRoutingMode {
4403        fn default() -> Self {
4404            use std::convert::From;
4405            Self::from(0)
4406        }
4407    }
4408
4409    impl std::fmt::Display for BgpRoutingMode {
4410        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4411            wkt::internal::display_enum(f, self.name(), self.value())
4412        }
4413    }
4414
4415    impl std::convert::From<i32> for BgpRoutingMode {
4416        fn from(value: i32) -> Self {
4417            match value {
4418                0 => Self::Unspecified,
4419                1 => Self::Regional,
4420                2 => Self::Global,
4421                _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
4422                    wkt::internal::UnknownEnumValue::Integer(value),
4423                )),
4424            }
4425        }
4426    }
4427
4428    impl std::convert::From<&str> for BgpRoutingMode {
4429        fn from(value: &str) -> Self {
4430            use std::string::ToString;
4431            match value {
4432                "BGP_ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
4433                "REGIONAL" => Self::Regional,
4434                "GLOBAL" => Self::Global,
4435                _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
4436                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4437                )),
4438            }
4439        }
4440    }
4441
4442    impl serde::ser::Serialize for BgpRoutingMode {
4443        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4444        where
4445            S: serde::Serializer,
4446        {
4447            match self {
4448                Self::Unspecified => serializer.serialize_i32(0),
4449                Self::Regional => serializer.serialize_i32(1),
4450                Self::Global => serializer.serialize_i32(2),
4451                Self::UnknownValue(u) => u.0.serialize(serializer),
4452            }
4453        }
4454    }
4455
4456    impl<'de> serde::de::Deserialize<'de> for BgpRoutingMode {
4457        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4458        where
4459            D: serde::Deserializer<'de>,
4460        {
4461            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BgpRoutingMode>::new(
4462                ".google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode",
4463            ))
4464        }
4465    }
4466}
4467
4468/// Metadata for a given
4469/// [google.cloud.location.Location][google.cloud.location.Location].
4470///
4471/// [google.cloud.location.Location]: google_cloud_location::model::Location
4472#[derive(Clone, Default, PartialEq)]
4473#[non_exhaustive]
4474pub struct LocationMetadata {
4475    /// The set of available Google Distributed Cloud Edge zones in the location.
4476    /// The map is keyed by the lowercase ID of each zone.
4477    pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
4478
4479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl LocationMetadata {
4483    pub fn new() -> Self {
4484        std::default::Default::default()
4485    }
4486
4487    /// Sets the value of [available_zones][crate::model::LocationMetadata::available_zones].
4488    ///
4489    /// # Example
4490    /// ```ignore,no_run
4491    /// # use google_cloud_edgecontainer_v1::model::LocationMetadata;
4492    /// use google_cloud_edgecontainer_v1::model::ZoneMetadata;
4493    /// let x = LocationMetadata::new().set_available_zones([
4494    ///     ("key0", ZoneMetadata::default()/* use setters */),
4495    ///     ("key1", ZoneMetadata::default()/* use (different) setters */),
4496    /// ]);
4497    /// ```
4498    pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
4499    where
4500        T: std::iter::IntoIterator<Item = (K, V)>,
4501        K: std::convert::Into<std::string::String>,
4502        V: std::convert::Into<crate::model::ZoneMetadata>,
4503    {
4504        use std::iter::Iterator;
4505        self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4506        self
4507    }
4508}
4509
4510impl wkt::message::Message for LocationMetadata {
4511    fn typename() -> &'static str {
4512        "type.googleapis.com/google.cloud.edgecontainer.v1.LocationMetadata"
4513    }
4514}
4515
4516/// A Google Distributed Cloud Edge zone where edge machines are located.
4517#[derive(Clone, Default, PartialEq)]
4518#[non_exhaustive]
4519pub struct ZoneMetadata {
4520    /// Quota for resources in this zone.
4521    pub quota: std::vec::Vec<crate::model::Quota>,
4522
4523    /// The map keyed by rack name and has value of RackType.
4524    pub rack_types:
4525        std::collections::HashMap<std::string::String, crate::model::zone_metadata::RackType>,
4526
4527    /// Config data for the zone.
4528    pub config_data: std::option::Option<crate::model::ConfigData>,
4529
4530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4531}
4532
4533impl ZoneMetadata {
4534    pub fn new() -> Self {
4535        std::default::Default::default()
4536    }
4537
4538    /// Sets the value of [quota][crate::model::ZoneMetadata::quota].
4539    ///
4540    /// # Example
4541    /// ```ignore,no_run
4542    /// # use google_cloud_edgecontainer_v1::model::ZoneMetadata;
4543    /// use google_cloud_edgecontainer_v1::model::Quota;
4544    /// let x = ZoneMetadata::new()
4545    ///     .set_quota([
4546    ///         Quota::default()/* use setters */,
4547    ///         Quota::default()/* use (different) setters */,
4548    ///     ]);
4549    /// ```
4550    pub fn set_quota<T, V>(mut self, v: T) -> Self
4551    where
4552        T: std::iter::IntoIterator<Item = V>,
4553        V: std::convert::Into<crate::model::Quota>,
4554    {
4555        use std::iter::Iterator;
4556        self.quota = v.into_iter().map(|i| i.into()).collect();
4557        self
4558    }
4559
4560    /// Sets the value of [rack_types][crate::model::ZoneMetadata::rack_types].
4561    ///
4562    /// # Example
4563    /// ```ignore,no_run
4564    /// # use google_cloud_edgecontainer_v1::model::ZoneMetadata;
4565    /// use google_cloud_edgecontainer_v1::model::zone_metadata::RackType;
4566    /// let x = ZoneMetadata::new().set_rack_types([
4567    ///     ("key0", RackType::Base),
4568    ///     ("key1", RackType::Expansion),
4569    /// ]);
4570    /// ```
4571    pub fn set_rack_types<T, K, V>(mut self, v: T) -> Self
4572    where
4573        T: std::iter::IntoIterator<Item = (K, V)>,
4574        K: std::convert::Into<std::string::String>,
4575        V: std::convert::Into<crate::model::zone_metadata::RackType>,
4576    {
4577        use std::iter::Iterator;
4578        self.rack_types = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4579        self
4580    }
4581
4582    /// Sets the value of [config_data][crate::model::ZoneMetadata::config_data].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_edgecontainer_v1::model::ZoneMetadata;
4587    /// use google_cloud_edgecontainer_v1::model::ConfigData;
4588    /// let x = ZoneMetadata::new().set_config_data(ConfigData::default()/* use setters */);
4589    /// ```
4590    pub fn set_config_data<T>(mut self, v: T) -> Self
4591    where
4592        T: std::convert::Into<crate::model::ConfigData>,
4593    {
4594        self.config_data = std::option::Option::Some(v.into());
4595        self
4596    }
4597
4598    /// Sets or clears the value of [config_data][crate::model::ZoneMetadata::config_data].
4599    ///
4600    /// # Example
4601    /// ```ignore,no_run
4602    /// # use google_cloud_edgecontainer_v1::model::ZoneMetadata;
4603    /// use google_cloud_edgecontainer_v1::model::ConfigData;
4604    /// let x = ZoneMetadata::new().set_or_clear_config_data(Some(ConfigData::default()/* use setters */));
4605    /// let x = ZoneMetadata::new().set_or_clear_config_data(None::<ConfigData>);
4606    /// ```
4607    pub fn set_or_clear_config_data<T>(mut self, v: std::option::Option<T>) -> Self
4608    where
4609        T: std::convert::Into<crate::model::ConfigData>,
4610    {
4611        self.config_data = v.map(|x| x.into());
4612        self
4613    }
4614}
4615
4616impl wkt::message::Message for ZoneMetadata {
4617    fn typename() -> &'static str {
4618        "type.googleapis.com/google.cloud.edgecontainer.v1.ZoneMetadata"
4619    }
4620}
4621
4622/// Defines additional types related to [ZoneMetadata].
4623pub mod zone_metadata {
4624    #[allow(unused_imports)]
4625    use super::*;
4626
4627    /// Type of the rack.
4628    ///
4629    /// # Working with unknown values
4630    ///
4631    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4632    /// additional enum variants at any time. Adding new variants is not considered
4633    /// a breaking change. Applications should write their code in anticipation of:
4634    ///
4635    /// - New values appearing in future releases of the client library, **and**
4636    /// - New values received dynamically, without application changes.
4637    ///
4638    /// Please consult the [Working with enums] section in the user guide for some
4639    /// guidelines.
4640    ///
4641    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4642    #[derive(Clone, Debug, PartialEq)]
4643    #[non_exhaustive]
4644    pub enum RackType {
4645        /// Unspecified rack type, single rack also belongs to this type.
4646        Unspecified,
4647        /// Base rack type, a pair of two modified Config-1 racks containing
4648        /// Aggregation switches.
4649        Base,
4650        /// Expansion rack type, also known as standalone racks,
4651        /// added by customers on demand.
4652        Expansion,
4653        /// If set, the enum was initialized with an unknown value.
4654        ///
4655        /// Applications can examine the value using [RackType::value] or
4656        /// [RackType::name].
4657        UnknownValue(rack_type::UnknownValue),
4658    }
4659
4660    #[doc(hidden)]
4661    pub mod rack_type {
4662        #[allow(unused_imports)]
4663        use super::*;
4664        #[derive(Clone, Debug, PartialEq)]
4665        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4666    }
4667
4668    impl RackType {
4669        /// Gets the enum value.
4670        ///
4671        /// Returns `None` if the enum contains an unknown value deserialized from
4672        /// the string representation of enums.
4673        pub fn value(&self) -> std::option::Option<i32> {
4674            match self {
4675                Self::Unspecified => std::option::Option::Some(0),
4676                Self::Base => std::option::Option::Some(1),
4677                Self::Expansion => std::option::Option::Some(2),
4678                Self::UnknownValue(u) => u.0.value(),
4679            }
4680        }
4681
4682        /// Gets the enum value as a string.
4683        ///
4684        /// Returns `None` if the enum contains an unknown value deserialized from
4685        /// the integer representation of enums.
4686        pub fn name(&self) -> std::option::Option<&str> {
4687            match self {
4688                Self::Unspecified => std::option::Option::Some("RACK_TYPE_UNSPECIFIED"),
4689                Self::Base => std::option::Option::Some("BASE"),
4690                Self::Expansion => std::option::Option::Some("EXPANSION"),
4691                Self::UnknownValue(u) => u.0.name(),
4692            }
4693        }
4694    }
4695
4696    impl std::default::Default for RackType {
4697        fn default() -> Self {
4698            use std::convert::From;
4699            Self::from(0)
4700        }
4701    }
4702
4703    impl std::fmt::Display for RackType {
4704        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4705            wkt::internal::display_enum(f, self.name(), self.value())
4706        }
4707    }
4708
4709    impl std::convert::From<i32> for RackType {
4710        fn from(value: i32) -> Self {
4711            match value {
4712                0 => Self::Unspecified,
4713                1 => Self::Base,
4714                2 => Self::Expansion,
4715                _ => Self::UnknownValue(rack_type::UnknownValue(
4716                    wkt::internal::UnknownEnumValue::Integer(value),
4717                )),
4718            }
4719        }
4720    }
4721
4722    impl std::convert::From<&str> for RackType {
4723        fn from(value: &str) -> Self {
4724            use std::string::ToString;
4725            match value {
4726                "RACK_TYPE_UNSPECIFIED" => Self::Unspecified,
4727                "BASE" => Self::Base,
4728                "EXPANSION" => Self::Expansion,
4729                _ => Self::UnknownValue(rack_type::UnknownValue(
4730                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4731                )),
4732            }
4733        }
4734    }
4735
4736    impl serde::ser::Serialize for RackType {
4737        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4738        where
4739            S: serde::Serializer,
4740        {
4741            match self {
4742                Self::Unspecified => serializer.serialize_i32(0),
4743                Self::Base => serializer.serialize_i32(1),
4744                Self::Expansion => serializer.serialize_i32(2),
4745                Self::UnknownValue(u) => u.0.serialize(serializer),
4746            }
4747        }
4748    }
4749
4750    impl<'de> serde::de::Deserialize<'de> for RackType {
4751        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4752        where
4753            D: serde::Deserializer<'de>,
4754        {
4755            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RackType>::new(
4756                ".google.cloud.edgecontainer.v1.ZoneMetadata.RackType",
4757            ))
4758        }
4759    }
4760}
4761
4762/// Config data holds all the config related data for the zone.
4763#[derive(Clone, Default, PartialEq)]
4764#[non_exhaustive]
4765pub struct ConfigData {
4766    /// list of available v4 ip pools for external loadbalancer
4767    pub available_external_lb_pools_ipv4: std::vec::Vec<std::string::String>,
4768
4769    /// list of available v6 ip pools for external loadbalancer
4770    pub available_external_lb_pools_ipv6: std::vec::Vec<std::string::String>,
4771
4772    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4773}
4774
4775impl ConfigData {
4776    pub fn new() -> Self {
4777        std::default::Default::default()
4778    }
4779
4780    /// Sets the value of [available_external_lb_pools_ipv4][crate::model::ConfigData::available_external_lb_pools_ipv4].
4781    ///
4782    /// # Example
4783    /// ```ignore,no_run
4784    /// # use google_cloud_edgecontainer_v1::model::ConfigData;
4785    /// let x = ConfigData::new().set_available_external_lb_pools_ipv4(["a", "b", "c"]);
4786    /// ```
4787    pub fn set_available_external_lb_pools_ipv4<T, V>(mut self, v: T) -> Self
4788    where
4789        T: std::iter::IntoIterator<Item = V>,
4790        V: std::convert::Into<std::string::String>,
4791    {
4792        use std::iter::Iterator;
4793        self.available_external_lb_pools_ipv4 = v.into_iter().map(|i| i.into()).collect();
4794        self
4795    }
4796
4797    /// Sets the value of [available_external_lb_pools_ipv6][crate::model::ConfigData::available_external_lb_pools_ipv6].
4798    ///
4799    /// # Example
4800    /// ```ignore,no_run
4801    /// # use google_cloud_edgecontainer_v1::model::ConfigData;
4802    /// let x = ConfigData::new().set_available_external_lb_pools_ipv6(["a", "b", "c"]);
4803    /// ```
4804    pub fn set_available_external_lb_pools_ipv6<T, V>(mut self, v: T) -> Self
4805    where
4806        T: std::iter::IntoIterator<Item = V>,
4807        V: std::convert::Into<std::string::String>,
4808    {
4809        use std::iter::Iterator;
4810        self.available_external_lb_pools_ipv6 = v.into_iter().map(|i| i.into()).collect();
4811        self
4812    }
4813}
4814
4815impl wkt::message::Message for ConfigData {
4816    fn typename() -> &'static str {
4817        "type.googleapis.com/google.cloud.edgecontainer.v1.ConfigData"
4818    }
4819}
4820
4821/// Represents quota for Edge Container resources.
4822#[derive(Clone, Default, PartialEq)]
4823#[non_exhaustive]
4824pub struct Quota {
4825    /// Name of the quota metric.
4826    pub metric: std::string::String,
4827
4828    /// Quota limit for this metric.
4829    pub limit: f64,
4830
4831    /// Current usage of this metric.
4832    pub usage: f64,
4833
4834    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4835}
4836
4837impl Quota {
4838    pub fn new() -> Self {
4839        std::default::Default::default()
4840    }
4841
4842    /// Sets the value of [metric][crate::model::Quota::metric].
4843    ///
4844    /// # Example
4845    /// ```ignore,no_run
4846    /// # use google_cloud_edgecontainer_v1::model::Quota;
4847    /// let x = Quota::new().set_metric("example");
4848    /// ```
4849    pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4850        self.metric = v.into();
4851        self
4852    }
4853
4854    /// Sets the value of [limit][crate::model::Quota::limit].
4855    ///
4856    /// # Example
4857    /// ```ignore,no_run
4858    /// # use google_cloud_edgecontainer_v1::model::Quota;
4859    /// let x = Quota::new().set_limit(42.0);
4860    /// ```
4861    pub fn set_limit<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4862        self.limit = v.into();
4863        self
4864    }
4865
4866    /// Sets the value of [usage][crate::model::Quota::usage].
4867    ///
4868    /// # Example
4869    /// ```ignore,no_run
4870    /// # use google_cloud_edgecontainer_v1::model::Quota;
4871    /// let x = Quota::new().set_usage(42.0);
4872    /// ```
4873    pub fn set_usage<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4874        self.usage = v.into();
4875        self
4876    }
4877}
4878
4879impl wkt::message::Message for Quota {
4880    fn typename() -> &'static str {
4881        "type.googleapis.com/google.cloud.edgecontainer.v1.Quota"
4882    }
4883}
4884
4885/// Maintenance policy configuration.
4886#[derive(Clone, Default, PartialEq)]
4887#[non_exhaustive]
4888pub struct MaintenancePolicy {
4889    /// Specifies the maintenance window in which maintenance may be performed.
4890    pub window: std::option::Option<crate::model::MaintenanceWindow>,
4891
4892    /// Optional. Exclusions to automatic maintenance. Non-emergency maintenance
4893    /// should not occur in these windows. Each exclusion has a unique name and may
4894    /// be active or expired. The max number of maintenance exclusions allowed at a
4895    /// given time is 3.
4896    pub maintenance_exclusions: std::vec::Vec<crate::model::MaintenanceExclusionWindow>,
4897
4898    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4899}
4900
4901impl MaintenancePolicy {
4902    pub fn new() -> Self {
4903        std::default::Default::default()
4904    }
4905
4906    /// Sets the value of [window][crate::model::MaintenancePolicy::window].
4907    ///
4908    /// # Example
4909    /// ```ignore,no_run
4910    /// # use google_cloud_edgecontainer_v1::model::MaintenancePolicy;
4911    /// use google_cloud_edgecontainer_v1::model::MaintenanceWindow;
4912    /// let x = MaintenancePolicy::new().set_window(MaintenanceWindow::default()/* use setters */);
4913    /// ```
4914    pub fn set_window<T>(mut self, v: T) -> Self
4915    where
4916        T: std::convert::Into<crate::model::MaintenanceWindow>,
4917    {
4918        self.window = std::option::Option::Some(v.into());
4919        self
4920    }
4921
4922    /// Sets or clears the value of [window][crate::model::MaintenancePolicy::window].
4923    ///
4924    /// # Example
4925    /// ```ignore,no_run
4926    /// # use google_cloud_edgecontainer_v1::model::MaintenancePolicy;
4927    /// use google_cloud_edgecontainer_v1::model::MaintenanceWindow;
4928    /// let x = MaintenancePolicy::new().set_or_clear_window(Some(MaintenanceWindow::default()/* use setters */));
4929    /// let x = MaintenancePolicy::new().set_or_clear_window(None::<MaintenanceWindow>);
4930    /// ```
4931    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
4932    where
4933        T: std::convert::Into<crate::model::MaintenanceWindow>,
4934    {
4935        self.window = v.map(|x| x.into());
4936        self
4937    }
4938
4939    /// Sets the value of [maintenance_exclusions][crate::model::MaintenancePolicy::maintenance_exclusions].
4940    ///
4941    /// # Example
4942    /// ```ignore,no_run
4943    /// # use google_cloud_edgecontainer_v1::model::MaintenancePolicy;
4944    /// use google_cloud_edgecontainer_v1::model::MaintenanceExclusionWindow;
4945    /// let x = MaintenancePolicy::new()
4946    ///     .set_maintenance_exclusions([
4947    ///         MaintenanceExclusionWindow::default()/* use setters */,
4948    ///         MaintenanceExclusionWindow::default()/* use (different) setters */,
4949    ///     ]);
4950    /// ```
4951    pub fn set_maintenance_exclusions<T, V>(mut self, v: T) -> Self
4952    where
4953        T: std::iter::IntoIterator<Item = V>,
4954        V: std::convert::Into<crate::model::MaintenanceExclusionWindow>,
4955    {
4956        use std::iter::Iterator;
4957        self.maintenance_exclusions = v.into_iter().map(|i| i.into()).collect();
4958        self
4959    }
4960}
4961
4962impl wkt::message::Message for MaintenancePolicy {
4963    fn typename() -> &'static str {
4964        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenancePolicy"
4965    }
4966}
4967
4968/// Maintenance window configuration
4969#[derive(Clone, Default, PartialEq)]
4970#[non_exhaustive]
4971pub struct MaintenanceWindow {
4972    /// Configuration of a recurring maintenance window.
4973    pub recurring_window: std::option::Option<crate::model::RecurringTimeWindow>,
4974
4975    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4976}
4977
4978impl MaintenanceWindow {
4979    pub fn new() -> Self {
4980        std::default::Default::default()
4981    }
4982
4983    /// Sets the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
4984    ///
4985    /// # Example
4986    /// ```ignore,no_run
4987    /// # use google_cloud_edgecontainer_v1::model::MaintenanceWindow;
4988    /// use google_cloud_edgecontainer_v1::model::RecurringTimeWindow;
4989    /// let x = MaintenanceWindow::new().set_recurring_window(RecurringTimeWindow::default()/* use setters */);
4990    /// ```
4991    pub fn set_recurring_window<T>(mut self, v: T) -> Self
4992    where
4993        T: std::convert::Into<crate::model::RecurringTimeWindow>,
4994    {
4995        self.recurring_window = std::option::Option::Some(v.into());
4996        self
4997    }
4998
4999    /// Sets or clears the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
5000    ///
5001    /// # Example
5002    /// ```ignore,no_run
5003    /// # use google_cloud_edgecontainer_v1::model::MaintenanceWindow;
5004    /// use google_cloud_edgecontainer_v1::model::RecurringTimeWindow;
5005    /// let x = MaintenanceWindow::new().set_or_clear_recurring_window(Some(RecurringTimeWindow::default()/* use setters */));
5006    /// let x = MaintenanceWindow::new().set_or_clear_recurring_window(None::<RecurringTimeWindow>);
5007    /// ```
5008    pub fn set_or_clear_recurring_window<T>(mut self, v: std::option::Option<T>) -> Self
5009    where
5010        T: std::convert::Into<crate::model::RecurringTimeWindow>,
5011    {
5012        self.recurring_window = v.map(|x| x.into());
5013        self
5014    }
5015}
5016
5017impl wkt::message::Message for MaintenanceWindow {
5018    fn typename() -> &'static str {
5019        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceWindow"
5020    }
5021}
5022
5023/// Represents an arbitrary window of time that recurs.
5024#[derive(Clone, Default, PartialEq)]
5025#[non_exhaustive]
5026pub struct RecurringTimeWindow {
5027    /// The window of the first recurrence.
5028    pub window: std::option::Option<crate::model::TimeWindow>,
5029
5030    /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
5031    /// this window recurs. They go on for the span of time between the start and
5032    /// end time.
5033    pub recurrence: std::string::String,
5034
5035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5036}
5037
5038impl RecurringTimeWindow {
5039    pub fn new() -> Self {
5040        std::default::Default::default()
5041    }
5042
5043    /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
5044    ///
5045    /// # Example
5046    /// ```ignore,no_run
5047    /// # use google_cloud_edgecontainer_v1::model::RecurringTimeWindow;
5048    /// use google_cloud_edgecontainer_v1::model::TimeWindow;
5049    /// let x = RecurringTimeWindow::new().set_window(TimeWindow::default()/* use setters */);
5050    /// ```
5051    pub fn set_window<T>(mut self, v: T) -> Self
5052    where
5053        T: std::convert::Into<crate::model::TimeWindow>,
5054    {
5055        self.window = std::option::Option::Some(v.into());
5056        self
5057    }
5058
5059    /// Sets or clears the value of [window][crate::model::RecurringTimeWindow::window].
5060    ///
5061    /// # Example
5062    /// ```ignore,no_run
5063    /// # use google_cloud_edgecontainer_v1::model::RecurringTimeWindow;
5064    /// use google_cloud_edgecontainer_v1::model::TimeWindow;
5065    /// let x = RecurringTimeWindow::new().set_or_clear_window(Some(TimeWindow::default()/* use setters */));
5066    /// let x = RecurringTimeWindow::new().set_or_clear_window(None::<TimeWindow>);
5067    /// ```
5068    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
5069    where
5070        T: std::convert::Into<crate::model::TimeWindow>,
5071    {
5072        self.window = v.map(|x| x.into());
5073        self
5074    }
5075
5076    /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
5077    ///
5078    /// # Example
5079    /// ```ignore,no_run
5080    /// # use google_cloud_edgecontainer_v1::model::RecurringTimeWindow;
5081    /// let x = RecurringTimeWindow::new().set_recurrence("example");
5082    /// ```
5083    pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5084        self.recurrence = v.into();
5085        self
5086    }
5087}
5088
5089impl wkt::message::Message for RecurringTimeWindow {
5090    fn typename() -> &'static str {
5091        "type.googleapis.com/google.cloud.edgecontainer.v1.RecurringTimeWindow"
5092    }
5093}
5094
5095/// Represents a maintenance exclusion window.
5096#[derive(Clone, Default, PartialEq)]
5097#[non_exhaustive]
5098pub struct MaintenanceExclusionWindow {
5099    /// Optional. The time window.
5100    pub window: std::option::Option<crate::model::TimeWindow>,
5101
5102    /// Optional. A unique (per cluster) id for the window.
5103    pub id: std::string::String,
5104
5105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5106}
5107
5108impl MaintenanceExclusionWindow {
5109    pub fn new() -> Self {
5110        std::default::Default::default()
5111    }
5112
5113    /// Sets the value of [window][crate::model::MaintenanceExclusionWindow::window].
5114    ///
5115    /// # Example
5116    /// ```ignore,no_run
5117    /// # use google_cloud_edgecontainer_v1::model::MaintenanceExclusionWindow;
5118    /// use google_cloud_edgecontainer_v1::model::TimeWindow;
5119    /// let x = MaintenanceExclusionWindow::new().set_window(TimeWindow::default()/* use setters */);
5120    /// ```
5121    pub fn set_window<T>(mut self, v: T) -> Self
5122    where
5123        T: std::convert::Into<crate::model::TimeWindow>,
5124    {
5125        self.window = std::option::Option::Some(v.into());
5126        self
5127    }
5128
5129    /// Sets or clears the value of [window][crate::model::MaintenanceExclusionWindow::window].
5130    ///
5131    /// # Example
5132    /// ```ignore,no_run
5133    /// # use google_cloud_edgecontainer_v1::model::MaintenanceExclusionWindow;
5134    /// use google_cloud_edgecontainer_v1::model::TimeWindow;
5135    /// let x = MaintenanceExclusionWindow::new().set_or_clear_window(Some(TimeWindow::default()/* use setters */));
5136    /// let x = MaintenanceExclusionWindow::new().set_or_clear_window(None::<TimeWindow>);
5137    /// ```
5138    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
5139    where
5140        T: std::convert::Into<crate::model::TimeWindow>,
5141    {
5142        self.window = v.map(|x| x.into());
5143        self
5144    }
5145
5146    /// Sets the value of [id][crate::model::MaintenanceExclusionWindow::id].
5147    ///
5148    /// # Example
5149    /// ```ignore,no_run
5150    /// # use google_cloud_edgecontainer_v1::model::MaintenanceExclusionWindow;
5151    /// let x = MaintenanceExclusionWindow::new().set_id("example");
5152    /// ```
5153    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5154        self.id = v.into();
5155        self
5156    }
5157}
5158
5159impl wkt::message::Message for MaintenanceExclusionWindow {
5160    fn typename() -> &'static str {
5161        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceExclusionWindow"
5162    }
5163}
5164
5165/// Represents an arbitrary window of time.
5166#[derive(Clone, Default, PartialEq)]
5167#[non_exhaustive]
5168pub struct TimeWindow {
5169    /// The time that the window first starts.
5170    pub start_time: std::option::Option<wkt::Timestamp>,
5171
5172    /// The time that the window ends. The end time must take place after the
5173    /// start time.
5174    pub end_time: std::option::Option<wkt::Timestamp>,
5175
5176    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5177}
5178
5179impl TimeWindow {
5180    pub fn new() -> Self {
5181        std::default::Default::default()
5182    }
5183
5184    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
5185    ///
5186    /// # Example
5187    /// ```ignore,no_run
5188    /// # use google_cloud_edgecontainer_v1::model::TimeWindow;
5189    /// use wkt::Timestamp;
5190    /// let x = TimeWindow::new().set_start_time(Timestamp::default()/* use setters */);
5191    /// ```
5192    pub fn set_start_time<T>(mut self, v: T) -> Self
5193    where
5194        T: std::convert::Into<wkt::Timestamp>,
5195    {
5196        self.start_time = std::option::Option::Some(v.into());
5197        self
5198    }
5199
5200    /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
5201    ///
5202    /// # Example
5203    /// ```ignore,no_run
5204    /// # use google_cloud_edgecontainer_v1::model::TimeWindow;
5205    /// use wkt::Timestamp;
5206    /// let x = TimeWindow::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
5207    /// let x = TimeWindow::new().set_or_clear_start_time(None::<Timestamp>);
5208    /// ```
5209    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5210    where
5211        T: std::convert::Into<wkt::Timestamp>,
5212    {
5213        self.start_time = v.map(|x| x.into());
5214        self
5215    }
5216
5217    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
5218    ///
5219    /// # Example
5220    /// ```ignore,no_run
5221    /// # use google_cloud_edgecontainer_v1::model::TimeWindow;
5222    /// use wkt::Timestamp;
5223    /// let x = TimeWindow::new().set_end_time(Timestamp::default()/* use setters */);
5224    /// ```
5225    pub fn set_end_time<T>(mut self, v: T) -> Self
5226    where
5227        T: std::convert::Into<wkt::Timestamp>,
5228    {
5229        self.end_time = std::option::Option::Some(v.into());
5230        self
5231    }
5232
5233    /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
5234    ///
5235    /// # Example
5236    /// ```ignore,no_run
5237    /// # use google_cloud_edgecontainer_v1::model::TimeWindow;
5238    /// use wkt::Timestamp;
5239    /// let x = TimeWindow::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5240    /// let x = TimeWindow::new().set_or_clear_end_time(None::<Timestamp>);
5241    /// ```
5242    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5243    where
5244        T: std::convert::Into<wkt::Timestamp>,
5245    {
5246        self.end_time = v.map(|x| x.into());
5247        self
5248    }
5249}
5250
5251impl wkt::message::Message for TimeWindow {
5252    fn typename() -> &'static str {
5253        "type.googleapis.com/google.cloud.edgecontainer.v1.TimeWindow"
5254    }
5255}
5256
5257/// Server configuration for supported versions and release channels.
5258#[derive(Clone, Default, PartialEq)]
5259#[non_exhaustive]
5260pub struct ServerConfig {
5261    /// Output only. Mapping from release channel to channel config.
5262    pub channels: std::collections::HashMap<std::string::String, crate::model::ChannelConfig>,
5263
5264    /// Output only. Supported versions, e.g.: ["1.4.0", "1.5.0"].
5265    pub versions: std::vec::Vec<crate::model::Version>,
5266
5267    /// Output only. Default version, e.g.: "1.4.0".
5268    pub default_version: std::string::String,
5269
5270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5271}
5272
5273impl ServerConfig {
5274    pub fn new() -> Self {
5275        std::default::Default::default()
5276    }
5277
5278    /// Sets the value of [channels][crate::model::ServerConfig::channels].
5279    ///
5280    /// # Example
5281    /// ```ignore,no_run
5282    /// # use google_cloud_edgecontainer_v1::model::ServerConfig;
5283    /// use google_cloud_edgecontainer_v1::model::ChannelConfig;
5284    /// let x = ServerConfig::new().set_channels([
5285    ///     ("key0", ChannelConfig::default()/* use setters */),
5286    ///     ("key1", ChannelConfig::default()/* use (different) setters */),
5287    /// ]);
5288    /// ```
5289    pub fn set_channels<T, K, V>(mut self, v: T) -> Self
5290    where
5291        T: std::iter::IntoIterator<Item = (K, V)>,
5292        K: std::convert::Into<std::string::String>,
5293        V: std::convert::Into<crate::model::ChannelConfig>,
5294    {
5295        use std::iter::Iterator;
5296        self.channels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5297        self
5298    }
5299
5300    /// Sets the value of [versions][crate::model::ServerConfig::versions].
5301    ///
5302    /// # Example
5303    /// ```ignore,no_run
5304    /// # use google_cloud_edgecontainer_v1::model::ServerConfig;
5305    /// use google_cloud_edgecontainer_v1::model::Version;
5306    /// let x = ServerConfig::new()
5307    ///     .set_versions([
5308    ///         Version::default()/* use setters */,
5309    ///         Version::default()/* use (different) setters */,
5310    ///     ]);
5311    /// ```
5312    pub fn set_versions<T, V>(mut self, v: T) -> Self
5313    where
5314        T: std::iter::IntoIterator<Item = V>,
5315        V: std::convert::Into<crate::model::Version>,
5316    {
5317        use std::iter::Iterator;
5318        self.versions = v.into_iter().map(|i| i.into()).collect();
5319        self
5320    }
5321
5322    /// Sets the value of [default_version][crate::model::ServerConfig::default_version].
5323    ///
5324    /// # Example
5325    /// ```ignore,no_run
5326    /// # use google_cloud_edgecontainer_v1::model::ServerConfig;
5327    /// let x = ServerConfig::new().set_default_version("example");
5328    /// ```
5329    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5330        self.default_version = v.into();
5331        self
5332    }
5333}
5334
5335impl wkt::message::Message for ServerConfig {
5336    fn typename() -> &'static str {
5337        "type.googleapis.com/google.cloud.edgecontainer.v1.ServerConfig"
5338    }
5339}
5340
5341/// Configuration for a release channel.
5342#[derive(Clone, Default, PartialEq)]
5343#[non_exhaustive]
5344pub struct ChannelConfig {
5345    /// Output only. Default version for this release channel, e.g.: "1.4.0".
5346    pub default_version: std::string::String,
5347
5348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5349}
5350
5351impl ChannelConfig {
5352    pub fn new() -> Self {
5353        std::default::Default::default()
5354    }
5355
5356    /// Sets the value of [default_version][crate::model::ChannelConfig::default_version].
5357    ///
5358    /// # Example
5359    /// ```ignore,no_run
5360    /// # use google_cloud_edgecontainer_v1::model::ChannelConfig;
5361    /// let x = ChannelConfig::new().set_default_version("example");
5362    /// ```
5363    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364        self.default_version = v.into();
5365        self
5366    }
5367}
5368
5369impl wkt::message::Message for ChannelConfig {
5370    fn typename() -> &'static str {
5371        "type.googleapis.com/google.cloud.edgecontainer.v1.ChannelConfig"
5372    }
5373}
5374
5375/// Version of a cluster.
5376#[derive(Clone, Default, PartialEq)]
5377#[non_exhaustive]
5378pub struct Version {
5379    /// Output only. Name of the version, e.g.: "1.4.0".
5380    pub name: std::string::String,
5381
5382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5383}
5384
5385impl Version {
5386    pub fn new() -> Self {
5387        std::default::Default::default()
5388    }
5389
5390    /// Sets the value of [name][crate::model::Version::name].
5391    ///
5392    /// # Example
5393    /// ```ignore,no_run
5394    /// # use google_cloud_edgecontainer_v1::model::Version;
5395    /// let x = Version::new().set_name("example");
5396    /// ```
5397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5398        self.name = v.into();
5399        self
5400    }
5401}
5402
5403impl wkt::message::Message for Version {
5404    fn typename() -> &'static str {
5405        "type.googleapis.com/google.cloud.edgecontainer.v1.Version"
5406    }
5407}
5408
5409/// Long-running operation metadata for Edge Container API methods.
5410#[derive(Clone, Default, PartialEq)]
5411#[non_exhaustive]
5412pub struct OperationMetadata {
5413    /// The time the operation was created.
5414    pub create_time: std::option::Option<wkt::Timestamp>,
5415
5416    /// The time the operation finished running.
5417    pub end_time: std::option::Option<wkt::Timestamp>,
5418
5419    /// Server-defined resource path for the target of the operation.
5420    pub target: std::string::String,
5421
5422    /// The verb executed by the operation.
5423    pub verb: std::string::String,
5424
5425    /// Human-readable status of the operation, if any.
5426    pub status_message: std::string::String,
5427
5428    /// Identifies whether the user has requested cancellation of the operation.
5429    /// Operations that have successfully been cancelled have [Operation.error][]
5430    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
5431    /// corresponding to `Code.CANCELLED`.
5432    ///
5433    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
5434    pub requested_cancellation: bool,
5435
5436    /// API version used to start the operation.
5437    pub api_version: std::string::String,
5438
5439    /// Warnings that do not block the operation, but still hold relevant
5440    /// information for the end user to receive.
5441    pub warnings: std::vec::Vec<std::string::String>,
5442
5443    /// Machine-readable status of the operation, if any.
5444    pub status_reason: crate::model::operation_metadata::StatusReason,
5445
5446    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5447}
5448
5449impl OperationMetadata {
5450    pub fn new() -> Self {
5451        std::default::Default::default()
5452    }
5453
5454    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5455    ///
5456    /// # Example
5457    /// ```ignore,no_run
5458    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5459    /// use wkt::Timestamp;
5460    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5461    /// ```
5462    pub fn set_create_time<T>(mut self, v: T) -> Self
5463    where
5464        T: std::convert::Into<wkt::Timestamp>,
5465    {
5466        self.create_time = std::option::Option::Some(v.into());
5467        self
5468    }
5469
5470    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5471    ///
5472    /// # Example
5473    /// ```ignore,no_run
5474    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5475    /// use wkt::Timestamp;
5476    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5477    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5478    /// ```
5479    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5480    where
5481        T: std::convert::Into<wkt::Timestamp>,
5482    {
5483        self.create_time = v.map(|x| x.into());
5484        self
5485    }
5486
5487    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5488    ///
5489    /// # Example
5490    /// ```ignore,no_run
5491    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5492    /// use wkt::Timestamp;
5493    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5494    /// ```
5495    pub fn set_end_time<T>(mut self, v: T) -> Self
5496    where
5497        T: std::convert::Into<wkt::Timestamp>,
5498    {
5499        self.end_time = std::option::Option::Some(v.into());
5500        self
5501    }
5502
5503    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5504    ///
5505    /// # Example
5506    /// ```ignore,no_run
5507    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5508    /// use wkt::Timestamp;
5509    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5510    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5511    /// ```
5512    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5513    where
5514        T: std::convert::Into<wkt::Timestamp>,
5515    {
5516        self.end_time = v.map(|x| x.into());
5517        self
5518    }
5519
5520    /// Sets the value of [target][crate::model::OperationMetadata::target].
5521    ///
5522    /// # Example
5523    /// ```ignore,no_run
5524    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5525    /// let x = OperationMetadata::new().set_target("example");
5526    /// ```
5527    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5528        self.target = v.into();
5529        self
5530    }
5531
5532    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5533    ///
5534    /// # Example
5535    /// ```ignore,no_run
5536    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5537    /// let x = OperationMetadata::new().set_verb("example");
5538    /// ```
5539    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5540        self.verb = v.into();
5541        self
5542    }
5543
5544    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5545    ///
5546    /// # Example
5547    /// ```ignore,no_run
5548    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5549    /// let x = OperationMetadata::new().set_status_message("example");
5550    /// ```
5551    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5552        self.status_message = v.into();
5553        self
5554    }
5555
5556    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5557    ///
5558    /// # Example
5559    /// ```ignore,no_run
5560    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5561    /// let x = OperationMetadata::new().set_requested_cancellation(true);
5562    /// ```
5563    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5564        self.requested_cancellation = v.into();
5565        self
5566    }
5567
5568    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5569    ///
5570    /// # Example
5571    /// ```ignore,no_run
5572    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5573    /// let x = OperationMetadata::new().set_api_version("example");
5574    /// ```
5575    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5576        self.api_version = v.into();
5577        self
5578    }
5579
5580    /// Sets the value of [warnings][crate::model::OperationMetadata::warnings].
5581    ///
5582    /// # Example
5583    /// ```ignore,no_run
5584    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5585    /// let x = OperationMetadata::new().set_warnings(["a", "b", "c"]);
5586    /// ```
5587    pub fn set_warnings<T, V>(mut self, v: T) -> Self
5588    where
5589        T: std::iter::IntoIterator<Item = V>,
5590        V: std::convert::Into<std::string::String>,
5591    {
5592        use std::iter::Iterator;
5593        self.warnings = v.into_iter().map(|i| i.into()).collect();
5594        self
5595    }
5596
5597    /// Sets the value of [status_reason][crate::model::OperationMetadata::status_reason].
5598    ///
5599    /// # Example
5600    /// ```ignore,no_run
5601    /// # use google_cloud_edgecontainer_v1::model::OperationMetadata;
5602    /// use google_cloud_edgecontainer_v1::model::operation_metadata::StatusReason;
5603    /// let x0 = OperationMetadata::new().set_status_reason(StatusReason::UpgradePaused);
5604    /// ```
5605    pub fn set_status_reason<
5606        T: std::convert::Into<crate::model::operation_metadata::StatusReason>,
5607    >(
5608        mut self,
5609        v: T,
5610    ) -> Self {
5611        self.status_reason = v.into();
5612        self
5613    }
5614}
5615
5616impl wkt::message::Message for OperationMetadata {
5617    fn typename() -> &'static str {
5618        "type.googleapis.com/google.cloud.edgecontainer.v1.OperationMetadata"
5619    }
5620}
5621
5622/// Defines additional types related to [OperationMetadata].
5623pub mod operation_metadata {
5624    #[allow(unused_imports)]
5625    use super::*;
5626
5627    /// Indicates the reason for the status of the operation.
5628    ///
5629    /// # Working with unknown values
5630    ///
5631    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5632    /// additional enum variants at any time. Adding new variants is not considered
5633    /// a breaking change. Applications should write their code in anticipation of:
5634    ///
5635    /// - New values appearing in future releases of the client library, **and**
5636    /// - New values received dynamically, without application changes.
5637    ///
5638    /// Please consult the [Working with enums] section in the user guide for some
5639    /// guidelines.
5640    ///
5641    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5642    #[derive(Clone, Debug, PartialEq)]
5643    #[non_exhaustive]
5644    pub enum StatusReason {
5645        /// Reason unknown.
5646        Unspecified,
5647        /// The cluster upgrade is currently paused.
5648        UpgradePaused,
5649        /// If set, the enum was initialized with an unknown value.
5650        ///
5651        /// Applications can examine the value using [StatusReason::value] or
5652        /// [StatusReason::name].
5653        UnknownValue(status_reason::UnknownValue),
5654    }
5655
5656    #[doc(hidden)]
5657    pub mod status_reason {
5658        #[allow(unused_imports)]
5659        use super::*;
5660        #[derive(Clone, Debug, PartialEq)]
5661        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5662    }
5663
5664    impl StatusReason {
5665        /// Gets the enum value.
5666        ///
5667        /// Returns `None` if the enum contains an unknown value deserialized from
5668        /// the string representation of enums.
5669        pub fn value(&self) -> std::option::Option<i32> {
5670            match self {
5671                Self::Unspecified => std::option::Option::Some(0),
5672                Self::UpgradePaused => std::option::Option::Some(1),
5673                Self::UnknownValue(u) => u.0.value(),
5674            }
5675        }
5676
5677        /// Gets the enum value as a string.
5678        ///
5679        /// Returns `None` if the enum contains an unknown value deserialized from
5680        /// the integer representation of enums.
5681        pub fn name(&self) -> std::option::Option<&str> {
5682            match self {
5683                Self::Unspecified => std::option::Option::Some("STATUS_REASON_UNSPECIFIED"),
5684                Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
5685                Self::UnknownValue(u) => u.0.name(),
5686            }
5687        }
5688    }
5689
5690    impl std::default::Default for StatusReason {
5691        fn default() -> Self {
5692            use std::convert::From;
5693            Self::from(0)
5694        }
5695    }
5696
5697    impl std::fmt::Display for StatusReason {
5698        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5699            wkt::internal::display_enum(f, self.name(), self.value())
5700        }
5701    }
5702
5703    impl std::convert::From<i32> for StatusReason {
5704        fn from(value: i32) -> Self {
5705            match value {
5706                0 => Self::Unspecified,
5707                1 => Self::UpgradePaused,
5708                _ => Self::UnknownValue(status_reason::UnknownValue(
5709                    wkt::internal::UnknownEnumValue::Integer(value),
5710                )),
5711            }
5712        }
5713    }
5714
5715    impl std::convert::From<&str> for StatusReason {
5716        fn from(value: &str) -> Self {
5717            use std::string::ToString;
5718            match value {
5719                "STATUS_REASON_UNSPECIFIED" => Self::Unspecified,
5720                "UPGRADE_PAUSED" => Self::UpgradePaused,
5721                _ => Self::UnknownValue(status_reason::UnknownValue(
5722                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5723                )),
5724            }
5725        }
5726    }
5727
5728    impl serde::ser::Serialize for StatusReason {
5729        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5730        where
5731            S: serde::Serializer,
5732        {
5733            match self {
5734                Self::Unspecified => serializer.serialize_i32(0),
5735                Self::UpgradePaused => serializer.serialize_i32(1),
5736                Self::UnknownValue(u) => u.0.serialize(serializer),
5737            }
5738        }
5739    }
5740
5741    impl<'de> serde::de::Deserialize<'de> for StatusReason {
5742        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5743        where
5744            D: serde::Deserializer<'de>,
5745        {
5746            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StatusReason>::new(
5747                ".google.cloud.edgecontainer.v1.OperationMetadata.StatusReason",
5748            ))
5749        }
5750    }
5751}
5752
5753/// Lists clusters in a location.
5754#[derive(Clone, Default, PartialEq)]
5755#[non_exhaustive]
5756pub struct ListClustersRequest {
5757    /// Required. The parent location, which owns this collection of clusters.
5758    pub parent: std::string::String,
5759
5760    /// The maximum number of resources to list.
5761    pub page_size: i32,
5762
5763    /// A page token received from previous list request.
5764    /// A page token received from previous list request.
5765    pub page_token: std::string::String,
5766
5767    /// Only resources matching this filter will be listed.
5768    pub filter: std::string::String,
5769
5770    /// Specifies the order in which resources will be listed.
5771    pub order_by: std::string::String,
5772
5773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5774}
5775
5776impl ListClustersRequest {
5777    pub fn new() -> Self {
5778        std::default::Default::default()
5779    }
5780
5781    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
5782    ///
5783    /// # Example
5784    /// ```ignore,no_run
5785    /// # use google_cloud_edgecontainer_v1::model::ListClustersRequest;
5786    /// let x = ListClustersRequest::new().set_parent("example");
5787    /// ```
5788    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789        self.parent = v.into();
5790        self
5791    }
5792
5793    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
5794    ///
5795    /// # Example
5796    /// ```ignore,no_run
5797    /// # use google_cloud_edgecontainer_v1::model::ListClustersRequest;
5798    /// let x = ListClustersRequest::new().set_page_size(42);
5799    /// ```
5800    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5801        self.page_size = v.into();
5802        self
5803    }
5804
5805    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
5806    ///
5807    /// # Example
5808    /// ```ignore,no_run
5809    /// # use google_cloud_edgecontainer_v1::model::ListClustersRequest;
5810    /// let x = ListClustersRequest::new().set_page_token("example");
5811    /// ```
5812    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5813        self.page_token = v.into();
5814        self
5815    }
5816
5817    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
5818    ///
5819    /// # Example
5820    /// ```ignore,no_run
5821    /// # use google_cloud_edgecontainer_v1::model::ListClustersRequest;
5822    /// let x = ListClustersRequest::new().set_filter("example");
5823    /// ```
5824    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5825        self.filter = v.into();
5826        self
5827    }
5828
5829    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
5830    ///
5831    /// # Example
5832    /// ```ignore,no_run
5833    /// # use google_cloud_edgecontainer_v1::model::ListClustersRequest;
5834    /// let x = ListClustersRequest::new().set_order_by("example");
5835    /// ```
5836    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5837        self.order_by = v.into();
5838        self
5839    }
5840}
5841
5842impl wkt::message::Message for ListClustersRequest {
5843    fn typename() -> &'static str {
5844        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersRequest"
5845    }
5846}
5847
5848/// List of clusters in a location.
5849#[derive(Clone, Default, PartialEq)]
5850#[non_exhaustive]
5851pub struct ListClustersResponse {
5852    /// Clusters in the location.
5853    pub clusters: std::vec::Vec<crate::model::Cluster>,
5854
5855    /// A token to retrieve next page of results.
5856    pub next_page_token: std::string::String,
5857
5858    /// Locations that could not be reached.
5859    pub unreachable: std::vec::Vec<std::string::String>,
5860
5861    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5862}
5863
5864impl ListClustersResponse {
5865    pub fn new() -> Self {
5866        std::default::Default::default()
5867    }
5868
5869    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
5870    ///
5871    /// # Example
5872    /// ```ignore,no_run
5873    /// # use google_cloud_edgecontainer_v1::model::ListClustersResponse;
5874    /// use google_cloud_edgecontainer_v1::model::Cluster;
5875    /// let x = ListClustersResponse::new()
5876    ///     .set_clusters([
5877    ///         Cluster::default()/* use setters */,
5878    ///         Cluster::default()/* use (different) setters */,
5879    ///     ]);
5880    /// ```
5881    pub fn set_clusters<T, V>(mut self, v: T) -> Self
5882    where
5883        T: std::iter::IntoIterator<Item = V>,
5884        V: std::convert::Into<crate::model::Cluster>,
5885    {
5886        use std::iter::Iterator;
5887        self.clusters = v.into_iter().map(|i| i.into()).collect();
5888        self
5889    }
5890
5891    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
5892    ///
5893    /// # Example
5894    /// ```ignore,no_run
5895    /// # use google_cloud_edgecontainer_v1::model::ListClustersResponse;
5896    /// let x = ListClustersResponse::new().set_next_page_token("example");
5897    /// ```
5898    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5899        self.next_page_token = v.into();
5900        self
5901    }
5902
5903    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
5904    ///
5905    /// # Example
5906    /// ```ignore,no_run
5907    /// # use google_cloud_edgecontainer_v1::model::ListClustersResponse;
5908    /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
5909    /// ```
5910    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5911    where
5912        T: std::iter::IntoIterator<Item = V>,
5913        V: std::convert::Into<std::string::String>,
5914    {
5915        use std::iter::Iterator;
5916        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5917        self
5918    }
5919}
5920
5921impl wkt::message::Message for ListClustersResponse {
5922    fn typename() -> &'static str {
5923        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersResponse"
5924    }
5925}
5926
5927#[doc(hidden)]
5928impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
5929    type PageItem = crate::model::Cluster;
5930
5931    fn items(self) -> std::vec::Vec<Self::PageItem> {
5932        self.clusters
5933    }
5934
5935    fn next_page_token(&self) -> std::string::String {
5936        use std::clone::Clone;
5937        self.next_page_token.clone()
5938    }
5939}
5940
5941/// Gets a cluster.
5942#[derive(Clone, Default, PartialEq)]
5943#[non_exhaustive]
5944pub struct GetClusterRequest {
5945    /// Required. The resource name of the cluster.
5946    pub name: std::string::String,
5947
5948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5949}
5950
5951impl GetClusterRequest {
5952    pub fn new() -> Self {
5953        std::default::Default::default()
5954    }
5955
5956    /// Sets the value of [name][crate::model::GetClusterRequest::name].
5957    ///
5958    /// # Example
5959    /// ```ignore,no_run
5960    /// # use google_cloud_edgecontainer_v1::model::GetClusterRequest;
5961    /// let x = GetClusterRequest::new().set_name("example");
5962    /// ```
5963    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5964        self.name = v.into();
5965        self
5966    }
5967}
5968
5969impl wkt::message::Message for GetClusterRequest {
5970    fn typename() -> &'static str {
5971        "type.googleapis.com/google.cloud.edgecontainer.v1.GetClusterRequest"
5972    }
5973}
5974
5975/// Creates a cluster.
5976#[derive(Clone, Default, PartialEq)]
5977#[non_exhaustive]
5978pub struct CreateClusterRequest {
5979    /// Required. The parent location where this cluster will be created.
5980    pub parent: std::string::String,
5981
5982    /// Required. A client-specified unique identifier for the cluster.
5983    pub cluster_id: std::string::String,
5984
5985    /// Required. The cluster to create.
5986    pub cluster: std::option::Option<crate::model::Cluster>,
5987
5988    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
5989    /// random UUID is recommended. This request is only idempotent if
5990    /// `request_id` is provided.
5991    pub request_id: std::string::String,
5992
5993    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5994}
5995
5996impl CreateClusterRequest {
5997    pub fn new() -> Self {
5998        std::default::Default::default()
5999    }
6000
6001    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
6002    ///
6003    /// # Example
6004    /// ```ignore,no_run
6005    /// # use google_cloud_edgecontainer_v1::model::CreateClusterRequest;
6006    /// let x = CreateClusterRequest::new().set_parent("example");
6007    /// ```
6008    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6009        self.parent = v.into();
6010        self
6011    }
6012
6013    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
6014    ///
6015    /// # Example
6016    /// ```ignore,no_run
6017    /// # use google_cloud_edgecontainer_v1::model::CreateClusterRequest;
6018    /// let x = CreateClusterRequest::new().set_cluster_id("example");
6019    /// ```
6020    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6021        self.cluster_id = v.into();
6022        self
6023    }
6024
6025    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
6026    ///
6027    /// # Example
6028    /// ```ignore,no_run
6029    /// # use google_cloud_edgecontainer_v1::model::CreateClusterRequest;
6030    /// use google_cloud_edgecontainer_v1::model::Cluster;
6031    /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
6032    /// ```
6033    pub fn set_cluster<T>(mut self, v: T) -> Self
6034    where
6035        T: std::convert::Into<crate::model::Cluster>,
6036    {
6037        self.cluster = std::option::Option::Some(v.into());
6038        self
6039    }
6040
6041    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
6042    ///
6043    /// # Example
6044    /// ```ignore,no_run
6045    /// # use google_cloud_edgecontainer_v1::model::CreateClusterRequest;
6046    /// use google_cloud_edgecontainer_v1::model::Cluster;
6047    /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
6048    /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
6049    /// ```
6050    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
6051    where
6052        T: std::convert::Into<crate::model::Cluster>,
6053    {
6054        self.cluster = v.map(|x| x.into());
6055        self
6056    }
6057
6058    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
6059    ///
6060    /// # Example
6061    /// ```ignore,no_run
6062    /// # use google_cloud_edgecontainer_v1::model::CreateClusterRequest;
6063    /// let x = CreateClusterRequest::new().set_request_id("example");
6064    /// ```
6065    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6066        self.request_id = v.into();
6067        self
6068    }
6069}
6070
6071impl wkt::message::Message for CreateClusterRequest {
6072    fn typename() -> &'static str {
6073        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateClusterRequest"
6074    }
6075}
6076
6077/// Updates a cluster.
6078#[derive(Clone, Default, PartialEq)]
6079#[non_exhaustive]
6080pub struct UpdateClusterRequest {
6081    /// Field mask is used to specify the fields to be overwritten in the
6082    /// Cluster resource by the update.
6083    /// The fields specified in the update_mask are relative to the resource, not
6084    /// the full request. A field will be overwritten if it is in the mask. If the
6085    /// user does not provide a mask then all fields will be overwritten.
6086    pub update_mask: std::option::Option<wkt::FieldMask>,
6087
6088    /// The updated cluster.
6089    pub cluster: std::option::Option<crate::model::Cluster>,
6090
6091    /// A unique identifier for this request. Restricted to 36 ASCII characters.
6092    /// A random UUID is recommended.
6093    /// This request is only idempotent if `request_id` is provided.
6094    pub request_id: std::string::String,
6095
6096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6097}
6098
6099impl UpdateClusterRequest {
6100    pub fn new() -> Self {
6101        std::default::Default::default()
6102    }
6103
6104    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
6105    ///
6106    /// # Example
6107    /// ```ignore,no_run
6108    /// # use google_cloud_edgecontainer_v1::model::UpdateClusterRequest;
6109    /// use wkt::FieldMask;
6110    /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6111    /// ```
6112    pub fn set_update_mask<T>(mut self, v: T) -> Self
6113    where
6114        T: std::convert::Into<wkt::FieldMask>,
6115    {
6116        self.update_mask = std::option::Option::Some(v.into());
6117        self
6118    }
6119
6120    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
6121    ///
6122    /// # Example
6123    /// ```ignore,no_run
6124    /// # use google_cloud_edgecontainer_v1::model::UpdateClusterRequest;
6125    /// use wkt::FieldMask;
6126    /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6127    /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6128    /// ```
6129    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6130    where
6131        T: std::convert::Into<wkt::FieldMask>,
6132    {
6133        self.update_mask = v.map(|x| x.into());
6134        self
6135    }
6136
6137    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
6138    ///
6139    /// # Example
6140    /// ```ignore,no_run
6141    /// # use google_cloud_edgecontainer_v1::model::UpdateClusterRequest;
6142    /// use google_cloud_edgecontainer_v1::model::Cluster;
6143    /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
6144    /// ```
6145    pub fn set_cluster<T>(mut self, v: T) -> Self
6146    where
6147        T: std::convert::Into<crate::model::Cluster>,
6148    {
6149        self.cluster = std::option::Option::Some(v.into());
6150        self
6151    }
6152
6153    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
6154    ///
6155    /// # Example
6156    /// ```ignore,no_run
6157    /// # use google_cloud_edgecontainer_v1::model::UpdateClusterRequest;
6158    /// use google_cloud_edgecontainer_v1::model::Cluster;
6159    /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
6160    /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
6161    /// ```
6162    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
6163    where
6164        T: std::convert::Into<crate::model::Cluster>,
6165    {
6166        self.cluster = v.map(|x| x.into());
6167        self
6168    }
6169
6170    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
6171    ///
6172    /// # Example
6173    /// ```ignore,no_run
6174    /// # use google_cloud_edgecontainer_v1::model::UpdateClusterRequest;
6175    /// let x = UpdateClusterRequest::new().set_request_id("example");
6176    /// ```
6177    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6178        self.request_id = v.into();
6179        self
6180    }
6181}
6182
6183impl wkt::message::Message for UpdateClusterRequest {
6184    fn typename() -> &'static str {
6185        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateClusterRequest"
6186    }
6187}
6188
6189/// Upgrades a cluster.
6190#[derive(Clone, Default, PartialEq)]
6191#[non_exhaustive]
6192pub struct UpgradeClusterRequest {
6193    /// Required. The resource name of the cluster.
6194    pub name: std::string::String,
6195
6196    /// Required. The version the cluster is going to be upgraded to.
6197    pub target_version: std::string::String,
6198
6199    /// The schedule for the upgrade.
6200    pub schedule: crate::model::upgrade_cluster_request::Schedule,
6201
6202    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
6203    /// random UUID is recommended. This request is only idempotent if
6204    /// `request_id` is provided.
6205    pub request_id: std::string::String,
6206
6207    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6208}
6209
6210impl UpgradeClusterRequest {
6211    pub fn new() -> Self {
6212        std::default::Default::default()
6213    }
6214
6215    /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
6216    ///
6217    /// # Example
6218    /// ```ignore,no_run
6219    /// # use google_cloud_edgecontainer_v1::model::UpgradeClusterRequest;
6220    /// let x = UpgradeClusterRequest::new().set_name("example");
6221    /// ```
6222    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6223        self.name = v.into();
6224        self
6225    }
6226
6227    /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
6228    ///
6229    /// # Example
6230    /// ```ignore,no_run
6231    /// # use google_cloud_edgecontainer_v1::model::UpgradeClusterRequest;
6232    /// let x = UpgradeClusterRequest::new().set_target_version("example");
6233    /// ```
6234    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6235        self.target_version = v.into();
6236        self
6237    }
6238
6239    /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
6240    ///
6241    /// # Example
6242    /// ```ignore,no_run
6243    /// # use google_cloud_edgecontainer_v1::model::UpgradeClusterRequest;
6244    /// use google_cloud_edgecontainer_v1::model::upgrade_cluster_request::Schedule;
6245    /// let x0 = UpgradeClusterRequest::new().set_schedule(Schedule::Immediately);
6246    /// ```
6247    pub fn set_schedule<T: std::convert::Into<crate::model::upgrade_cluster_request::Schedule>>(
6248        mut self,
6249        v: T,
6250    ) -> Self {
6251        self.schedule = v.into();
6252        self
6253    }
6254
6255    /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
6256    ///
6257    /// # Example
6258    /// ```ignore,no_run
6259    /// # use google_cloud_edgecontainer_v1::model::UpgradeClusterRequest;
6260    /// let x = UpgradeClusterRequest::new().set_request_id("example");
6261    /// ```
6262    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6263        self.request_id = v.into();
6264        self
6265    }
6266}
6267
6268impl wkt::message::Message for UpgradeClusterRequest {
6269    fn typename() -> &'static str {
6270        "type.googleapis.com/google.cloud.edgecontainer.v1.UpgradeClusterRequest"
6271    }
6272}
6273
6274/// Defines additional types related to [UpgradeClusterRequest].
6275pub mod upgrade_cluster_request {
6276    #[allow(unused_imports)]
6277    use super::*;
6278
6279    /// Represents the schedule about when the cluster is going to be upgraded.
6280    ///
6281    /// # Working with unknown values
6282    ///
6283    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6284    /// additional enum variants at any time. Adding new variants is not considered
6285    /// a breaking change. Applications should write their code in anticipation of:
6286    ///
6287    /// - New values appearing in future releases of the client library, **and**
6288    /// - New values received dynamically, without application changes.
6289    ///
6290    /// Please consult the [Working with enums] section in the user guide for some
6291    /// guidelines.
6292    ///
6293    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6294    #[derive(Clone, Debug, PartialEq)]
6295    #[non_exhaustive]
6296    pub enum Schedule {
6297        /// Unspecified. The default is to upgrade the cluster immediately which is
6298        /// the only option today.
6299        Unspecified,
6300        /// The cluster is going to be upgraded immediately after receiving the
6301        /// request.
6302        Immediately,
6303        /// If set, the enum was initialized with an unknown value.
6304        ///
6305        /// Applications can examine the value using [Schedule::value] or
6306        /// [Schedule::name].
6307        UnknownValue(schedule::UnknownValue),
6308    }
6309
6310    #[doc(hidden)]
6311    pub mod schedule {
6312        #[allow(unused_imports)]
6313        use super::*;
6314        #[derive(Clone, Debug, PartialEq)]
6315        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6316    }
6317
6318    impl Schedule {
6319        /// Gets the enum value.
6320        ///
6321        /// Returns `None` if the enum contains an unknown value deserialized from
6322        /// the string representation of enums.
6323        pub fn value(&self) -> std::option::Option<i32> {
6324            match self {
6325                Self::Unspecified => std::option::Option::Some(0),
6326                Self::Immediately => std::option::Option::Some(1),
6327                Self::UnknownValue(u) => u.0.value(),
6328            }
6329        }
6330
6331        /// Gets the enum value as a string.
6332        ///
6333        /// Returns `None` if the enum contains an unknown value deserialized from
6334        /// the integer representation of enums.
6335        pub fn name(&self) -> std::option::Option<&str> {
6336            match self {
6337                Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
6338                Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
6339                Self::UnknownValue(u) => u.0.name(),
6340            }
6341        }
6342    }
6343
6344    impl std::default::Default for Schedule {
6345        fn default() -> Self {
6346            use std::convert::From;
6347            Self::from(0)
6348        }
6349    }
6350
6351    impl std::fmt::Display for Schedule {
6352        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6353            wkt::internal::display_enum(f, self.name(), self.value())
6354        }
6355    }
6356
6357    impl std::convert::From<i32> for Schedule {
6358        fn from(value: i32) -> Self {
6359            match value {
6360                0 => Self::Unspecified,
6361                1 => Self::Immediately,
6362                _ => Self::UnknownValue(schedule::UnknownValue(
6363                    wkt::internal::UnknownEnumValue::Integer(value),
6364                )),
6365            }
6366        }
6367    }
6368
6369    impl std::convert::From<&str> for Schedule {
6370        fn from(value: &str) -> Self {
6371            use std::string::ToString;
6372            match value {
6373                "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
6374                "IMMEDIATELY" => Self::Immediately,
6375                _ => Self::UnknownValue(schedule::UnknownValue(
6376                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6377                )),
6378            }
6379        }
6380    }
6381
6382    impl serde::ser::Serialize for Schedule {
6383        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6384        where
6385            S: serde::Serializer,
6386        {
6387            match self {
6388                Self::Unspecified => serializer.serialize_i32(0),
6389                Self::Immediately => serializer.serialize_i32(1),
6390                Self::UnknownValue(u) => u.0.serialize(serializer),
6391            }
6392        }
6393    }
6394
6395    impl<'de> serde::de::Deserialize<'de> for Schedule {
6396        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6397        where
6398            D: serde::Deserializer<'de>,
6399        {
6400            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
6401                ".google.cloud.edgecontainer.v1.UpgradeClusterRequest.Schedule",
6402            ))
6403        }
6404    }
6405}
6406
6407/// Deletes a cluster.
6408#[derive(Clone, Default, PartialEq)]
6409#[non_exhaustive]
6410pub struct DeleteClusterRequest {
6411    /// Required. The resource name of the cluster.
6412    pub name: std::string::String,
6413
6414    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
6415    /// random UUID is recommended. This request is only idempotent if
6416    /// `request_id` is provided.
6417    pub request_id: std::string::String,
6418
6419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6420}
6421
6422impl DeleteClusterRequest {
6423    pub fn new() -> Self {
6424        std::default::Default::default()
6425    }
6426
6427    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
6428    ///
6429    /// # Example
6430    /// ```ignore,no_run
6431    /// # use google_cloud_edgecontainer_v1::model::DeleteClusterRequest;
6432    /// let x = DeleteClusterRequest::new().set_name("example");
6433    /// ```
6434    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6435        self.name = v.into();
6436        self
6437    }
6438
6439    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
6440    ///
6441    /// # Example
6442    /// ```ignore,no_run
6443    /// # use google_cloud_edgecontainer_v1::model::DeleteClusterRequest;
6444    /// let x = DeleteClusterRequest::new().set_request_id("example");
6445    /// ```
6446    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6447        self.request_id = v.into();
6448        self
6449    }
6450}
6451
6452impl wkt::message::Message for DeleteClusterRequest {
6453    fn typename() -> &'static str {
6454        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteClusterRequest"
6455    }
6456}
6457
6458/// Generates an access token for a cluster.
6459#[derive(Clone, Default, PartialEq)]
6460#[non_exhaustive]
6461pub struct GenerateAccessTokenRequest {
6462    /// Required. The resource name of the cluster.
6463    pub cluster: std::string::String,
6464
6465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6466}
6467
6468impl GenerateAccessTokenRequest {
6469    pub fn new() -> Self {
6470        std::default::Default::default()
6471    }
6472
6473    /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
6474    ///
6475    /// # Example
6476    /// ```ignore,no_run
6477    /// # use google_cloud_edgecontainer_v1::model::GenerateAccessTokenRequest;
6478    /// let x = GenerateAccessTokenRequest::new().set_cluster("example");
6479    /// ```
6480    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6481        self.cluster = v.into();
6482        self
6483    }
6484}
6485
6486impl wkt::message::Message for GenerateAccessTokenRequest {
6487    fn typename() -> &'static str {
6488        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenRequest"
6489    }
6490}
6491
6492/// An access token for a cluster.
6493#[derive(Clone, Default, PartialEq)]
6494#[non_exhaustive]
6495pub struct GenerateAccessTokenResponse {
6496    /// Output only. Access token to authenticate to k8s api-server.
6497    pub access_token: std::string::String,
6498
6499    /// Output only. Timestamp at which the token will expire.
6500    pub expire_time: std::option::Option<wkt::Timestamp>,
6501
6502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6503}
6504
6505impl GenerateAccessTokenResponse {
6506    pub fn new() -> Self {
6507        std::default::Default::default()
6508    }
6509
6510    /// Sets the value of [access_token][crate::model::GenerateAccessTokenResponse::access_token].
6511    ///
6512    /// # Example
6513    /// ```ignore,no_run
6514    /// # use google_cloud_edgecontainer_v1::model::GenerateAccessTokenResponse;
6515    /// let x = GenerateAccessTokenResponse::new().set_access_token("example");
6516    /// ```
6517    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6518        self.access_token = v.into();
6519        self
6520    }
6521
6522    /// Sets the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
6523    ///
6524    /// # Example
6525    /// ```ignore,no_run
6526    /// # use google_cloud_edgecontainer_v1::model::GenerateAccessTokenResponse;
6527    /// use wkt::Timestamp;
6528    /// let x = GenerateAccessTokenResponse::new().set_expire_time(Timestamp::default()/* use setters */);
6529    /// ```
6530    pub fn set_expire_time<T>(mut self, v: T) -> Self
6531    where
6532        T: std::convert::Into<wkt::Timestamp>,
6533    {
6534        self.expire_time = std::option::Option::Some(v.into());
6535        self
6536    }
6537
6538    /// Sets or clears the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
6539    ///
6540    /// # Example
6541    /// ```ignore,no_run
6542    /// # use google_cloud_edgecontainer_v1::model::GenerateAccessTokenResponse;
6543    /// use wkt::Timestamp;
6544    /// let x = GenerateAccessTokenResponse::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
6545    /// let x = GenerateAccessTokenResponse::new().set_or_clear_expire_time(None::<Timestamp>);
6546    /// ```
6547    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6548    where
6549        T: std::convert::Into<wkt::Timestamp>,
6550    {
6551        self.expire_time = v.map(|x| x.into());
6552        self
6553    }
6554}
6555
6556impl wkt::message::Message for GenerateAccessTokenResponse {
6557    fn typename() -> &'static str {
6558        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenResponse"
6559    }
6560}
6561
6562/// Generates an offline credential(offline) for a cluster.
6563#[derive(Clone, Default, PartialEq)]
6564#[non_exhaustive]
6565pub struct GenerateOfflineCredentialRequest {
6566    /// Required. The resource name of the cluster.
6567    pub cluster: std::string::String,
6568
6569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6570}
6571
6572impl GenerateOfflineCredentialRequest {
6573    pub fn new() -> Self {
6574        std::default::Default::default()
6575    }
6576
6577    /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
6578    ///
6579    /// # Example
6580    /// ```ignore,no_run
6581    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialRequest;
6582    /// let x = GenerateOfflineCredentialRequest::new().set_cluster("example");
6583    /// ```
6584    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6585        self.cluster = v.into();
6586        self
6587    }
6588}
6589
6590impl wkt::message::Message for GenerateOfflineCredentialRequest {
6591    fn typename() -> &'static str {
6592        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialRequest"
6593    }
6594}
6595
6596/// An offline credential for a cluster.
6597#[derive(Clone, Default, PartialEq)]
6598#[non_exhaustive]
6599pub struct GenerateOfflineCredentialResponse {
6600    /// Output only. Client certificate to authenticate to k8s api-server.
6601    pub client_certificate: std::string::String,
6602
6603    /// Output only. Client private key to authenticate to k8s api-server.
6604    pub client_key: std::string::String,
6605
6606    /// Output only. Client's identity.
6607    pub user_id: std::string::String,
6608
6609    /// Output only. Timestamp at which this credential will expire.
6610    pub expire_time: std::option::Option<wkt::Timestamp>,
6611
6612    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6613}
6614
6615impl GenerateOfflineCredentialResponse {
6616    pub fn new() -> Self {
6617        std::default::Default::default()
6618    }
6619
6620    /// Sets the value of [client_certificate][crate::model::GenerateOfflineCredentialResponse::client_certificate].
6621    ///
6622    /// # Example
6623    /// ```ignore,no_run
6624    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialResponse;
6625    /// let x = GenerateOfflineCredentialResponse::new().set_client_certificate("example");
6626    /// ```
6627    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6628        mut self,
6629        v: T,
6630    ) -> Self {
6631        self.client_certificate = v.into();
6632        self
6633    }
6634
6635    /// Sets the value of [client_key][crate::model::GenerateOfflineCredentialResponse::client_key].
6636    ///
6637    /// # Example
6638    /// ```ignore,no_run
6639    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialResponse;
6640    /// let x = GenerateOfflineCredentialResponse::new().set_client_key("example");
6641    /// ```
6642    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643        self.client_key = v.into();
6644        self
6645    }
6646
6647    /// Sets the value of [user_id][crate::model::GenerateOfflineCredentialResponse::user_id].
6648    ///
6649    /// # Example
6650    /// ```ignore,no_run
6651    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialResponse;
6652    /// let x = GenerateOfflineCredentialResponse::new().set_user_id("example");
6653    /// ```
6654    pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6655        self.user_id = v.into();
6656        self
6657    }
6658
6659    /// Sets the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
6660    ///
6661    /// # Example
6662    /// ```ignore,no_run
6663    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialResponse;
6664    /// use wkt::Timestamp;
6665    /// let x = GenerateOfflineCredentialResponse::new().set_expire_time(Timestamp::default()/* use setters */);
6666    /// ```
6667    pub fn set_expire_time<T>(mut self, v: T) -> Self
6668    where
6669        T: std::convert::Into<wkt::Timestamp>,
6670    {
6671        self.expire_time = std::option::Option::Some(v.into());
6672        self
6673    }
6674
6675    /// Sets or clears the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
6676    ///
6677    /// # Example
6678    /// ```ignore,no_run
6679    /// # use google_cloud_edgecontainer_v1::model::GenerateOfflineCredentialResponse;
6680    /// use wkt::Timestamp;
6681    /// let x = GenerateOfflineCredentialResponse::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
6682    /// let x = GenerateOfflineCredentialResponse::new().set_or_clear_expire_time(None::<Timestamp>);
6683    /// ```
6684    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6685    where
6686        T: std::convert::Into<wkt::Timestamp>,
6687    {
6688        self.expire_time = v.map(|x| x.into());
6689        self
6690    }
6691}
6692
6693impl wkt::message::Message for GenerateOfflineCredentialResponse {
6694    fn typename() -> &'static str {
6695        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialResponse"
6696    }
6697}
6698
6699/// Lists node pools in a cluster.
6700#[derive(Clone, Default, PartialEq)]
6701#[non_exhaustive]
6702pub struct ListNodePoolsRequest {
6703    /// Required. The parent cluster, which owns this collection of node pools.
6704    pub parent: std::string::String,
6705
6706    /// The maximum number of resources to list.
6707    pub page_size: i32,
6708
6709    /// A page token received from previous list request.
6710    pub page_token: std::string::String,
6711
6712    /// Only resources matching this filter will be listed.
6713    pub filter: std::string::String,
6714
6715    /// Specifies the order in which resources will be listed.
6716    pub order_by: std::string::String,
6717
6718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6719}
6720
6721impl ListNodePoolsRequest {
6722    pub fn new() -> Self {
6723        std::default::Default::default()
6724    }
6725
6726    /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
6727    ///
6728    /// # Example
6729    /// ```ignore,no_run
6730    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsRequest;
6731    /// let x = ListNodePoolsRequest::new().set_parent("example");
6732    /// ```
6733    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6734        self.parent = v.into();
6735        self
6736    }
6737
6738    /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
6739    ///
6740    /// # Example
6741    /// ```ignore,no_run
6742    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsRequest;
6743    /// let x = ListNodePoolsRequest::new().set_page_size(42);
6744    /// ```
6745    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6746        self.page_size = v.into();
6747        self
6748    }
6749
6750    /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
6751    ///
6752    /// # Example
6753    /// ```ignore,no_run
6754    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsRequest;
6755    /// let x = ListNodePoolsRequest::new().set_page_token("example");
6756    /// ```
6757    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6758        self.page_token = v.into();
6759        self
6760    }
6761
6762    /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
6763    ///
6764    /// # Example
6765    /// ```ignore,no_run
6766    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsRequest;
6767    /// let x = ListNodePoolsRequest::new().set_filter("example");
6768    /// ```
6769    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6770        self.filter = v.into();
6771        self
6772    }
6773
6774    /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
6775    ///
6776    /// # Example
6777    /// ```ignore,no_run
6778    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsRequest;
6779    /// let x = ListNodePoolsRequest::new().set_order_by("example");
6780    /// ```
6781    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6782        self.order_by = v.into();
6783        self
6784    }
6785}
6786
6787impl wkt::message::Message for ListNodePoolsRequest {
6788    fn typename() -> &'static str {
6789        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsRequest"
6790    }
6791}
6792
6793/// List of node pools in a cluster.
6794#[derive(Clone, Default, PartialEq)]
6795#[non_exhaustive]
6796pub struct ListNodePoolsResponse {
6797    /// Node pools in the cluster.
6798    pub node_pools: std::vec::Vec<crate::model::NodePool>,
6799
6800    /// A token to retrieve next page of results.
6801    pub next_page_token: std::string::String,
6802
6803    /// Locations that could not be reached.
6804    pub unreachable: std::vec::Vec<std::string::String>,
6805
6806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6807}
6808
6809impl ListNodePoolsResponse {
6810    pub fn new() -> Self {
6811        std::default::Default::default()
6812    }
6813
6814    /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
6815    ///
6816    /// # Example
6817    /// ```ignore,no_run
6818    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsResponse;
6819    /// use google_cloud_edgecontainer_v1::model::NodePool;
6820    /// let x = ListNodePoolsResponse::new()
6821    ///     .set_node_pools([
6822    ///         NodePool::default()/* use setters */,
6823    ///         NodePool::default()/* use (different) setters */,
6824    ///     ]);
6825    /// ```
6826    pub fn set_node_pools<T, V>(mut self, v: T) -> Self
6827    where
6828        T: std::iter::IntoIterator<Item = V>,
6829        V: std::convert::Into<crate::model::NodePool>,
6830    {
6831        use std::iter::Iterator;
6832        self.node_pools = v.into_iter().map(|i| i.into()).collect();
6833        self
6834    }
6835
6836    /// Sets the value of [next_page_token][crate::model::ListNodePoolsResponse::next_page_token].
6837    ///
6838    /// # Example
6839    /// ```ignore,no_run
6840    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsResponse;
6841    /// let x = ListNodePoolsResponse::new().set_next_page_token("example");
6842    /// ```
6843    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6844        self.next_page_token = v.into();
6845        self
6846    }
6847
6848    /// Sets the value of [unreachable][crate::model::ListNodePoolsResponse::unreachable].
6849    ///
6850    /// # Example
6851    /// ```ignore,no_run
6852    /// # use google_cloud_edgecontainer_v1::model::ListNodePoolsResponse;
6853    /// let x = ListNodePoolsResponse::new().set_unreachable(["a", "b", "c"]);
6854    /// ```
6855    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6856    where
6857        T: std::iter::IntoIterator<Item = V>,
6858        V: std::convert::Into<std::string::String>,
6859    {
6860        use std::iter::Iterator;
6861        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6862        self
6863    }
6864}
6865
6866impl wkt::message::Message for ListNodePoolsResponse {
6867    fn typename() -> &'static str {
6868        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsResponse"
6869    }
6870}
6871
6872#[doc(hidden)]
6873impl google_cloud_gax::paginator::internal::PageableResponse for ListNodePoolsResponse {
6874    type PageItem = crate::model::NodePool;
6875
6876    fn items(self) -> std::vec::Vec<Self::PageItem> {
6877        self.node_pools
6878    }
6879
6880    fn next_page_token(&self) -> std::string::String {
6881        use std::clone::Clone;
6882        self.next_page_token.clone()
6883    }
6884}
6885
6886/// Gets a node pool.
6887#[derive(Clone, Default, PartialEq)]
6888#[non_exhaustive]
6889pub struct GetNodePoolRequest {
6890    /// Required. The resource name of the node pool.
6891    pub name: std::string::String,
6892
6893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6894}
6895
6896impl GetNodePoolRequest {
6897    pub fn new() -> Self {
6898        std::default::Default::default()
6899    }
6900
6901    /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
6902    ///
6903    /// # Example
6904    /// ```ignore,no_run
6905    /// # use google_cloud_edgecontainer_v1::model::GetNodePoolRequest;
6906    /// let x = GetNodePoolRequest::new().set_name("example");
6907    /// ```
6908    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6909        self.name = v.into();
6910        self
6911    }
6912}
6913
6914impl wkt::message::Message for GetNodePoolRequest {
6915    fn typename() -> &'static str {
6916        "type.googleapis.com/google.cloud.edgecontainer.v1.GetNodePoolRequest"
6917    }
6918}
6919
6920/// Creates a node pool.
6921#[derive(Clone, Default, PartialEq)]
6922#[non_exhaustive]
6923pub struct CreateNodePoolRequest {
6924    /// Required. The parent cluster where this node pool will be created.
6925    pub parent: std::string::String,
6926
6927    /// Required. A client-specified unique identifier for the node pool.
6928    pub node_pool_id: std::string::String,
6929
6930    /// Required. The node pool to create.
6931    pub node_pool: std::option::Option<crate::model::NodePool>,
6932
6933    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
6934    /// random UUID is recommended. This request is only idempotent if
6935    /// `request_id` is provided.
6936    pub request_id: std::string::String,
6937
6938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6939}
6940
6941impl CreateNodePoolRequest {
6942    pub fn new() -> Self {
6943        std::default::Default::default()
6944    }
6945
6946    /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
6947    ///
6948    /// # Example
6949    /// ```ignore,no_run
6950    /// # use google_cloud_edgecontainer_v1::model::CreateNodePoolRequest;
6951    /// let x = CreateNodePoolRequest::new().set_parent("example");
6952    /// ```
6953    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6954        self.parent = v.into();
6955        self
6956    }
6957
6958    /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
6959    ///
6960    /// # Example
6961    /// ```ignore,no_run
6962    /// # use google_cloud_edgecontainer_v1::model::CreateNodePoolRequest;
6963    /// let x = CreateNodePoolRequest::new().set_node_pool_id("example");
6964    /// ```
6965    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6966        self.node_pool_id = v.into();
6967        self
6968    }
6969
6970    /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
6971    ///
6972    /// # Example
6973    /// ```ignore,no_run
6974    /// # use google_cloud_edgecontainer_v1::model::CreateNodePoolRequest;
6975    /// use google_cloud_edgecontainer_v1::model::NodePool;
6976    /// let x = CreateNodePoolRequest::new().set_node_pool(NodePool::default()/* use setters */);
6977    /// ```
6978    pub fn set_node_pool<T>(mut self, v: T) -> Self
6979    where
6980        T: std::convert::Into<crate::model::NodePool>,
6981    {
6982        self.node_pool = std::option::Option::Some(v.into());
6983        self
6984    }
6985
6986    /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
6987    ///
6988    /// # Example
6989    /// ```ignore,no_run
6990    /// # use google_cloud_edgecontainer_v1::model::CreateNodePoolRequest;
6991    /// use google_cloud_edgecontainer_v1::model::NodePool;
6992    /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(Some(NodePool::default()/* use setters */));
6993    /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(None::<NodePool>);
6994    /// ```
6995    pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
6996    where
6997        T: std::convert::Into<crate::model::NodePool>,
6998    {
6999        self.node_pool = v.map(|x| x.into());
7000        self
7001    }
7002
7003    /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
7004    ///
7005    /// # Example
7006    /// ```ignore,no_run
7007    /// # use google_cloud_edgecontainer_v1::model::CreateNodePoolRequest;
7008    /// let x = CreateNodePoolRequest::new().set_request_id("example");
7009    /// ```
7010    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7011        self.request_id = v.into();
7012        self
7013    }
7014}
7015
7016impl wkt::message::Message for CreateNodePoolRequest {
7017    fn typename() -> &'static str {
7018        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateNodePoolRequest"
7019    }
7020}
7021
7022/// Updates a node pool.
7023#[derive(Clone, Default, PartialEq)]
7024#[non_exhaustive]
7025pub struct UpdateNodePoolRequest {
7026    /// Field mask is used to specify the fields to be overwritten in the
7027    /// NodePool resource by the update.
7028    /// The fields specified in the update_mask are relative to the resource, not
7029    /// the full request. A field will be overwritten if it is in the mask. If the
7030    /// user does not provide a mask then all fields will be overwritten.
7031    pub update_mask: std::option::Option<wkt::FieldMask>,
7032
7033    /// The updated node pool.
7034    pub node_pool: std::option::Option<crate::model::NodePool>,
7035
7036    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
7037    /// random UUID is recommended. This request is only idempotent if
7038    /// `request_id` is provided.
7039    pub request_id: std::string::String,
7040
7041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7042}
7043
7044impl UpdateNodePoolRequest {
7045    pub fn new() -> Self {
7046        std::default::Default::default()
7047    }
7048
7049    /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
7050    ///
7051    /// # Example
7052    /// ```ignore,no_run
7053    /// # use google_cloud_edgecontainer_v1::model::UpdateNodePoolRequest;
7054    /// use wkt::FieldMask;
7055    /// let x = UpdateNodePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7056    /// ```
7057    pub fn set_update_mask<T>(mut self, v: T) -> Self
7058    where
7059        T: std::convert::Into<wkt::FieldMask>,
7060    {
7061        self.update_mask = std::option::Option::Some(v.into());
7062        self
7063    }
7064
7065    /// Sets or clears the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
7066    ///
7067    /// # Example
7068    /// ```ignore,no_run
7069    /// # use google_cloud_edgecontainer_v1::model::UpdateNodePoolRequest;
7070    /// use wkt::FieldMask;
7071    /// let x = UpdateNodePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7072    /// let x = UpdateNodePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7073    /// ```
7074    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7075    where
7076        T: std::convert::Into<wkt::FieldMask>,
7077    {
7078        self.update_mask = v.map(|x| x.into());
7079        self
7080    }
7081
7082    /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
7083    ///
7084    /// # Example
7085    /// ```ignore,no_run
7086    /// # use google_cloud_edgecontainer_v1::model::UpdateNodePoolRequest;
7087    /// use google_cloud_edgecontainer_v1::model::NodePool;
7088    /// let x = UpdateNodePoolRequest::new().set_node_pool(NodePool::default()/* use setters */);
7089    /// ```
7090    pub fn set_node_pool<T>(mut self, v: T) -> Self
7091    where
7092        T: std::convert::Into<crate::model::NodePool>,
7093    {
7094        self.node_pool = std::option::Option::Some(v.into());
7095        self
7096    }
7097
7098    /// Sets or clears the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
7099    ///
7100    /// # Example
7101    /// ```ignore,no_run
7102    /// # use google_cloud_edgecontainer_v1::model::UpdateNodePoolRequest;
7103    /// use google_cloud_edgecontainer_v1::model::NodePool;
7104    /// let x = UpdateNodePoolRequest::new().set_or_clear_node_pool(Some(NodePool::default()/* use setters */));
7105    /// let x = UpdateNodePoolRequest::new().set_or_clear_node_pool(None::<NodePool>);
7106    /// ```
7107    pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
7108    where
7109        T: std::convert::Into<crate::model::NodePool>,
7110    {
7111        self.node_pool = v.map(|x| x.into());
7112        self
7113    }
7114
7115    /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
7116    ///
7117    /// # Example
7118    /// ```ignore,no_run
7119    /// # use google_cloud_edgecontainer_v1::model::UpdateNodePoolRequest;
7120    /// let x = UpdateNodePoolRequest::new().set_request_id("example");
7121    /// ```
7122    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7123        self.request_id = v.into();
7124        self
7125    }
7126}
7127
7128impl wkt::message::Message for UpdateNodePoolRequest {
7129    fn typename() -> &'static str {
7130        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateNodePoolRequest"
7131    }
7132}
7133
7134/// Deletes a node pool.
7135#[derive(Clone, Default, PartialEq)]
7136#[non_exhaustive]
7137pub struct DeleteNodePoolRequest {
7138    /// Required. The resource name of the node pool.
7139    pub name: std::string::String,
7140
7141    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
7142    /// random UUID is recommended. This request is only idempotent if
7143    /// `request_id` is provided.
7144    pub request_id: std::string::String,
7145
7146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7147}
7148
7149impl DeleteNodePoolRequest {
7150    pub fn new() -> Self {
7151        std::default::Default::default()
7152    }
7153
7154    /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
7155    ///
7156    /// # Example
7157    /// ```ignore,no_run
7158    /// # use google_cloud_edgecontainer_v1::model::DeleteNodePoolRequest;
7159    /// let x = DeleteNodePoolRequest::new().set_name("example");
7160    /// ```
7161    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7162        self.name = v.into();
7163        self
7164    }
7165
7166    /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
7167    ///
7168    /// # Example
7169    /// ```ignore,no_run
7170    /// # use google_cloud_edgecontainer_v1::model::DeleteNodePoolRequest;
7171    /// let x = DeleteNodePoolRequest::new().set_request_id("example");
7172    /// ```
7173    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7174        self.request_id = v.into();
7175        self
7176    }
7177}
7178
7179impl wkt::message::Message for DeleteNodePoolRequest {
7180    fn typename() -> &'static str {
7181        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteNodePoolRequest"
7182    }
7183}
7184
7185/// Lists machines in a site.
7186#[derive(Clone, Default, PartialEq)]
7187#[non_exhaustive]
7188pub struct ListMachinesRequest {
7189    /// Required. The parent site, which owns this collection of machines.
7190    pub parent: std::string::String,
7191
7192    /// The maximum number of resources to list.
7193    pub page_size: i32,
7194
7195    /// A page token received from previous list request.
7196    pub page_token: std::string::String,
7197
7198    /// Only resources matching this filter will be listed.
7199    pub filter: std::string::String,
7200
7201    /// Specifies the order in which resources will be listed.
7202    pub order_by: std::string::String,
7203
7204    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7205}
7206
7207impl ListMachinesRequest {
7208    pub fn new() -> Self {
7209        std::default::Default::default()
7210    }
7211
7212    /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
7213    ///
7214    /// # Example
7215    /// ```ignore,no_run
7216    /// # use google_cloud_edgecontainer_v1::model::ListMachinesRequest;
7217    /// let x = ListMachinesRequest::new().set_parent("example");
7218    /// ```
7219    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7220        self.parent = v.into();
7221        self
7222    }
7223
7224    /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
7225    ///
7226    /// # Example
7227    /// ```ignore,no_run
7228    /// # use google_cloud_edgecontainer_v1::model::ListMachinesRequest;
7229    /// let x = ListMachinesRequest::new().set_page_size(42);
7230    /// ```
7231    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7232        self.page_size = v.into();
7233        self
7234    }
7235
7236    /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
7237    ///
7238    /// # Example
7239    /// ```ignore,no_run
7240    /// # use google_cloud_edgecontainer_v1::model::ListMachinesRequest;
7241    /// let x = ListMachinesRequest::new().set_page_token("example");
7242    /// ```
7243    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7244        self.page_token = v.into();
7245        self
7246    }
7247
7248    /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
7249    ///
7250    /// # Example
7251    /// ```ignore,no_run
7252    /// # use google_cloud_edgecontainer_v1::model::ListMachinesRequest;
7253    /// let x = ListMachinesRequest::new().set_filter("example");
7254    /// ```
7255    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7256        self.filter = v.into();
7257        self
7258    }
7259
7260    /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
7261    ///
7262    /// # Example
7263    /// ```ignore,no_run
7264    /// # use google_cloud_edgecontainer_v1::model::ListMachinesRequest;
7265    /// let x = ListMachinesRequest::new().set_order_by("example");
7266    /// ```
7267    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7268        self.order_by = v.into();
7269        self
7270    }
7271}
7272
7273impl wkt::message::Message for ListMachinesRequest {
7274    fn typename() -> &'static str {
7275        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesRequest"
7276    }
7277}
7278
7279/// List of machines in a site.
7280#[derive(Clone, Default, PartialEq)]
7281#[non_exhaustive]
7282pub struct ListMachinesResponse {
7283    /// Machines in the site.
7284    pub machines: std::vec::Vec<crate::model::Machine>,
7285
7286    /// A token to retrieve next page of results.
7287    pub next_page_token: std::string::String,
7288
7289    /// Locations that could not be reached.
7290    pub unreachable: std::vec::Vec<std::string::String>,
7291
7292    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7293}
7294
7295impl ListMachinesResponse {
7296    pub fn new() -> Self {
7297        std::default::Default::default()
7298    }
7299
7300    /// Sets the value of [machines][crate::model::ListMachinesResponse::machines].
7301    ///
7302    /// # Example
7303    /// ```ignore,no_run
7304    /// # use google_cloud_edgecontainer_v1::model::ListMachinesResponse;
7305    /// use google_cloud_edgecontainer_v1::model::Machine;
7306    /// let x = ListMachinesResponse::new()
7307    ///     .set_machines([
7308    ///         Machine::default()/* use setters */,
7309    ///         Machine::default()/* use (different) setters */,
7310    ///     ]);
7311    /// ```
7312    pub fn set_machines<T, V>(mut self, v: T) -> Self
7313    where
7314        T: std::iter::IntoIterator<Item = V>,
7315        V: std::convert::Into<crate::model::Machine>,
7316    {
7317        use std::iter::Iterator;
7318        self.machines = v.into_iter().map(|i| i.into()).collect();
7319        self
7320    }
7321
7322    /// Sets the value of [next_page_token][crate::model::ListMachinesResponse::next_page_token].
7323    ///
7324    /// # Example
7325    /// ```ignore,no_run
7326    /// # use google_cloud_edgecontainer_v1::model::ListMachinesResponse;
7327    /// let x = ListMachinesResponse::new().set_next_page_token("example");
7328    /// ```
7329    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7330        self.next_page_token = v.into();
7331        self
7332    }
7333
7334    /// Sets the value of [unreachable][crate::model::ListMachinesResponse::unreachable].
7335    ///
7336    /// # Example
7337    /// ```ignore,no_run
7338    /// # use google_cloud_edgecontainer_v1::model::ListMachinesResponse;
7339    /// let x = ListMachinesResponse::new().set_unreachable(["a", "b", "c"]);
7340    /// ```
7341    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7342    where
7343        T: std::iter::IntoIterator<Item = V>,
7344        V: std::convert::Into<std::string::String>,
7345    {
7346        use std::iter::Iterator;
7347        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7348        self
7349    }
7350}
7351
7352impl wkt::message::Message for ListMachinesResponse {
7353    fn typename() -> &'static str {
7354        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesResponse"
7355    }
7356}
7357
7358#[doc(hidden)]
7359impl google_cloud_gax::paginator::internal::PageableResponse for ListMachinesResponse {
7360    type PageItem = crate::model::Machine;
7361
7362    fn items(self) -> std::vec::Vec<Self::PageItem> {
7363        self.machines
7364    }
7365
7366    fn next_page_token(&self) -> std::string::String {
7367        use std::clone::Clone;
7368        self.next_page_token.clone()
7369    }
7370}
7371
7372/// Gets a machine.
7373#[derive(Clone, Default, PartialEq)]
7374#[non_exhaustive]
7375pub struct GetMachineRequest {
7376    /// Required. The resource name of the machine.
7377    pub name: std::string::String,
7378
7379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7380}
7381
7382impl GetMachineRequest {
7383    pub fn new() -> Self {
7384        std::default::Default::default()
7385    }
7386
7387    /// Sets the value of [name][crate::model::GetMachineRequest::name].
7388    ///
7389    /// # Example
7390    /// ```ignore,no_run
7391    /// # use google_cloud_edgecontainer_v1::model::GetMachineRequest;
7392    /// let x = GetMachineRequest::new().set_name("example");
7393    /// ```
7394    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7395        self.name = v.into();
7396        self
7397    }
7398}
7399
7400impl wkt::message::Message for GetMachineRequest {
7401    fn typename() -> &'static str {
7402        "type.googleapis.com/google.cloud.edgecontainer.v1.GetMachineRequest"
7403    }
7404}
7405
7406/// Lists VPN connections.
7407#[derive(Clone, Default, PartialEq)]
7408#[non_exhaustive]
7409pub struct ListVpnConnectionsRequest {
7410    /// Required. The parent location, which owns this collection of VPN
7411    /// connections.
7412    pub parent: std::string::String,
7413
7414    /// The maximum number of resources to list.
7415    pub page_size: i32,
7416
7417    /// A page token received from previous list request.
7418    pub page_token: std::string::String,
7419
7420    /// Only resources matching this filter will be listed.
7421    pub filter: std::string::String,
7422
7423    /// Specifies the order in which resources will be listed.
7424    pub order_by: std::string::String,
7425
7426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7427}
7428
7429impl ListVpnConnectionsRequest {
7430    pub fn new() -> Self {
7431        std::default::Default::default()
7432    }
7433
7434    /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
7435    ///
7436    /// # Example
7437    /// ```ignore,no_run
7438    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsRequest;
7439    /// let x = ListVpnConnectionsRequest::new().set_parent("example");
7440    /// ```
7441    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7442        self.parent = v.into();
7443        self
7444    }
7445
7446    /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
7447    ///
7448    /// # Example
7449    /// ```ignore,no_run
7450    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsRequest;
7451    /// let x = ListVpnConnectionsRequest::new().set_page_size(42);
7452    /// ```
7453    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7454        self.page_size = v.into();
7455        self
7456    }
7457
7458    /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
7459    ///
7460    /// # Example
7461    /// ```ignore,no_run
7462    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsRequest;
7463    /// let x = ListVpnConnectionsRequest::new().set_page_token("example");
7464    /// ```
7465    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7466        self.page_token = v.into();
7467        self
7468    }
7469
7470    /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
7471    ///
7472    /// # Example
7473    /// ```ignore,no_run
7474    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsRequest;
7475    /// let x = ListVpnConnectionsRequest::new().set_filter("example");
7476    /// ```
7477    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7478        self.filter = v.into();
7479        self
7480    }
7481
7482    /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
7483    ///
7484    /// # Example
7485    /// ```ignore,no_run
7486    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsRequest;
7487    /// let x = ListVpnConnectionsRequest::new().set_order_by("example");
7488    /// ```
7489    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7490        self.order_by = v.into();
7491        self
7492    }
7493}
7494
7495impl wkt::message::Message for ListVpnConnectionsRequest {
7496    fn typename() -> &'static str {
7497        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsRequest"
7498    }
7499}
7500
7501/// List of VPN connections in a location.
7502#[derive(Clone, Default, PartialEq)]
7503#[non_exhaustive]
7504pub struct ListVpnConnectionsResponse {
7505    /// VpnConnections in the location.
7506    pub vpn_connections: std::vec::Vec<crate::model::VpnConnection>,
7507
7508    /// A token to retrieve next page of results.
7509    pub next_page_token: std::string::String,
7510
7511    /// Locations that could not be reached.
7512    pub unreachable: std::vec::Vec<std::string::String>,
7513
7514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7515}
7516
7517impl ListVpnConnectionsResponse {
7518    pub fn new() -> Self {
7519        std::default::Default::default()
7520    }
7521
7522    /// Sets the value of [vpn_connections][crate::model::ListVpnConnectionsResponse::vpn_connections].
7523    ///
7524    /// # Example
7525    /// ```ignore,no_run
7526    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsResponse;
7527    /// use google_cloud_edgecontainer_v1::model::VpnConnection;
7528    /// let x = ListVpnConnectionsResponse::new()
7529    ///     .set_vpn_connections([
7530    ///         VpnConnection::default()/* use setters */,
7531    ///         VpnConnection::default()/* use (different) setters */,
7532    ///     ]);
7533    /// ```
7534    pub fn set_vpn_connections<T, V>(mut self, v: T) -> Self
7535    where
7536        T: std::iter::IntoIterator<Item = V>,
7537        V: std::convert::Into<crate::model::VpnConnection>,
7538    {
7539        use std::iter::Iterator;
7540        self.vpn_connections = v.into_iter().map(|i| i.into()).collect();
7541        self
7542    }
7543
7544    /// Sets the value of [next_page_token][crate::model::ListVpnConnectionsResponse::next_page_token].
7545    ///
7546    /// # Example
7547    /// ```ignore,no_run
7548    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsResponse;
7549    /// let x = ListVpnConnectionsResponse::new().set_next_page_token("example");
7550    /// ```
7551    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7552        self.next_page_token = v.into();
7553        self
7554    }
7555
7556    /// Sets the value of [unreachable][crate::model::ListVpnConnectionsResponse::unreachable].
7557    ///
7558    /// # Example
7559    /// ```ignore,no_run
7560    /// # use google_cloud_edgecontainer_v1::model::ListVpnConnectionsResponse;
7561    /// let x = ListVpnConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
7562    /// ```
7563    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7564    where
7565        T: std::iter::IntoIterator<Item = V>,
7566        V: std::convert::Into<std::string::String>,
7567    {
7568        use std::iter::Iterator;
7569        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7570        self
7571    }
7572}
7573
7574impl wkt::message::Message for ListVpnConnectionsResponse {
7575    fn typename() -> &'static str {
7576        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsResponse"
7577    }
7578}
7579
7580#[doc(hidden)]
7581impl google_cloud_gax::paginator::internal::PageableResponse for ListVpnConnectionsResponse {
7582    type PageItem = crate::model::VpnConnection;
7583
7584    fn items(self) -> std::vec::Vec<Self::PageItem> {
7585        self.vpn_connections
7586    }
7587
7588    fn next_page_token(&self) -> std::string::String {
7589        use std::clone::Clone;
7590        self.next_page_token.clone()
7591    }
7592}
7593
7594/// Gets a VPN connection.
7595#[derive(Clone, Default, PartialEq)]
7596#[non_exhaustive]
7597pub struct GetVpnConnectionRequest {
7598    /// Required. The resource name of the vpn connection.
7599    pub name: std::string::String,
7600
7601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7602}
7603
7604impl GetVpnConnectionRequest {
7605    pub fn new() -> Self {
7606        std::default::Default::default()
7607    }
7608
7609    /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
7610    ///
7611    /// # Example
7612    /// ```ignore,no_run
7613    /// # use google_cloud_edgecontainer_v1::model::GetVpnConnectionRequest;
7614    /// let x = GetVpnConnectionRequest::new().set_name("example");
7615    /// ```
7616    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7617        self.name = v.into();
7618        self
7619    }
7620}
7621
7622impl wkt::message::Message for GetVpnConnectionRequest {
7623    fn typename() -> &'static str {
7624        "type.googleapis.com/google.cloud.edgecontainer.v1.GetVpnConnectionRequest"
7625    }
7626}
7627
7628/// Creates a VPN connection.
7629#[derive(Clone, Default, PartialEq)]
7630#[non_exhaustive]
7631pub struct CreateVpnConnectionRequest {
7632    /// Required. The parent location where this vpn connection will be created.
7633    pub parent: std::string::String,
7634
7635    /// Required. The VPN connection identifier.
7636    pub vpn_connection_id: std::string::String,
7637
7638    /// Required. The VPN connection to create.
7639    pub vpn_connection: std::option::Option<crate::model::VpnConnection>,
7640
7641    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
7642    /// random UUID is recommended. This request is only idempotent if
7643    /// `request_id` is provided.
7644    pub request_id: std::string::String,
7645
7646    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7647}
7648
7649impl CreateVpnConnectionRequest {
7650    pub fn new() -> Self {
7651        std::default::Default::default()
7652    }
7653
7654    /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
7655    ///
7656    /// # Example
7657    /// ```ignore,no_run
7658    /// # use google_cloud_edgecontainer_v1::model::CreateVpnConnectionRequest;
7659    /// let x = CreateVpnConnectionRequest::new().set_parent("example");
7660    /// ```
7661    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7662        self.parent = v.into();
7663        self
7664    }
7665
7666    /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
7667    ///
7668    /// # Example
7669    /// ```ignore,no_run
7670    /// # use google_cloud_edgecontainer_v1::model::CreateVpnConnectionRequest;
7671    /// let x = CreateVpnConnectionRequest::new().set_vpn_connection_id("example");
7672    /// ```
7673    pub fn set_vpn_connection_id<T: std::convert::Into<std::string::String>>(
7674        mut self,
7675        v: T,
7676    ) -> Self {
7677        self.vpn_connection_id = v.into();
7678        self
7679    }
7680
7681    /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
7682    ///
7683    /// # Example
7684    /// ```ignore,no_run
7685    /// # use google_cloud_edgecontainer_v1::model::CreateVpnConnectionRequest;
7686    /// use google_cloud_edgecontainer_v1::model::VpnConnection;
7687    /// let x = CreateVpnConnectionRequest::new().set_vpn_connection(VpnConnection::default()/* use setters */);
7688    /// ```
7689    pub fn set_vpn_connection<T>(mut self, v: T) -> Self
7690    where
7691        T: std::convert::Into<crate::model::VpnConnection>,
7692    {
7693        self.vpn_connection = std::option::Option::Some(v.into());
7694        self
7695    }
7696
7697    /// Sets or clears the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
7698    ///
7699    /// # Example
7700    /// ```ignore,no_run
7701    /// # use google_cloud_edgecontainer_v1::model::CreateVpnConnectionRequest;
7702    /// use google_cloud_edgecontainer_v1::model::VpnConnection;
7703    /// let x = CreateVpnConnectionRequest::new().set_or_clear_vpn_connection(Some(VpnConnection::default()/* use setters */));
7704    /// let x = CreateVpnConnectionRequest::new().set_or_clear_vpn_connection(None::<VpnConnection>);
7705    /// ```
7706    pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
7707    where
7708        T: std::convert::Into<crate::model::VpnConnection>,
7709    {
7710        self.vpn_connection = v.map(|x| x.into());
7711        self
7712    }
7713
7714    /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
7715    ///
7716    /// # Example
7717    /// ```ignore,no_run
7718    /// # use google_cloud_edgecontainer_v1::model::CreateVpnConnectionRequest;
7719    /// let x = CreateVpnConnectionRequest::new().set_request_id("example");
7720    /// ```
7721    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7722        self.request_id = v.into();
7723        self
7724    }
7725}
7726
7727impl wkt::message::Message for CreateVpnConnectionRequest {
7728    fn typename() -> &'static str {
7729        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateVpnConnectionRequest"
7730    }
7731}
7732
7733/// Deletes a vpn connection.
7734#[derive(Clone, Default, PartialEq)]
7735#[non_exhaustive]
7736pub struct DeleteVpnConnectionRequest {
7737    /// Required. The resource name of the vpn connection.
7738    pub name: std::string::String,
7739
7740    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
7741    /// random UUID is recommended. This request is only idempotent if
7742    /// `request_id` is provided.
7743    pub request_id: std::string::String,
7744
7745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7746}
7747
7748impl DeleteVpnConnectionRequest {
7749    pub fn new() -> Self {
7750        std::default::Default::default()
7751    }
7752
7753    /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
7754    ///
7755    /// # Example
7756    /// ```ignore,no_run
7757    /// # use google_cloud_edgecontainer_v1::model::DeleteVpnConnectionRequest;
7758    /// let x = DeleteVpnConnectionRequest::new().set_name("example");
7759    /// ```
7760    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7761        self.name = v.into();
7762        self
7763    }
7764
7765    /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
7766    ///
7767    /// # Example
7768    /// ```ignore,no_run
7769    /// # use google_cloud_edgecontainer_v1::model::DeleteVpnConnectionRequest;
7770    /// let x = DeleteVpnConnectionRequest::new().set_request_id("example");
7771    /// ```
7772    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7773        self.request_id = v.into();
7774        self
7775    }
7776}
7777
7778impl wkt::message::Message for DeleteVpnConnectionRequest {
7779    fn typename() -> &'static str {
7780        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest"
7781    }
7782}
7783
7784/// Gets the server config.
7785#[derive(Clone, Default, PartialEq)]
7786#[non_exhaustive]
7787pub struct GetServerConfigRequest {
7788    /// Required. The name (project and location) of the server config to get,
7789    /// specified in the format `projects/*/locations/*`.
7790    pub name: std::string::String,
7791
7792    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7793}
7794
7795impl GetServerConfigRequest {
7796    pub fn new() -> Self {
7797        std::default::Default::default()
7798    }
7799
7800    /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
7801    ///
7802    /// # Example
7803    /// ```ignore,no_run
7804    /// # use google_cloud_edgecontainer_v1::model::GetServerConfigRequest;
7805    /// let x = GetServerConfigRequest::new().set_name("example");
7806    /// ```
7807    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7808        self.name = v.into();
7809        self
7810    }
7811}
7812
7813impl wkt::message::Message for GetServerConfigRequest {
7814    fn typename() -> &'static str {
7815        "type.googleapis.com/google.cloud.edgecontainer.v1.GetServerConfigRequest"
7816    }
7817}
7818
7819/// Represents the accessibility state of a customer-managed KMS key used for
7820/// CMEK integration.
7821///
7822/// # Working with unknown values
7823///
7824/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7825/// additional enum variants at any time. Adding new variants is not considered
7826/// a breaking change. Applications should write their code in anticipation of:
7827///
7828/// - New values appearing in future releases of the client library, **and**
7829/// - New values received dynamically, without application changes.
7830///
7831/// Please consult the [Working with enums] section in the user guide for some
7832/// guidelines.
7833///
7834/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7835#[derive(Clone, Debug, PartialEq)]
7836#[non_exhaustive]
7837pub enum KmsKeyState {
7838    /// Unspecified.
7839    Unspecified,
7840    /// The key is available for use, and dependent resources should be accessible.
7841    KeyAvailable,
7842    /// The key is unavailable for an unspecified reason. Dependent resources may
7843    /// be inaccessible.
7844    KeyUnavailable,
7845    /// If set, the enum was initialized with an unknown value.
7846    ///
7847    /// Applications can examine the value using [KmsKeyState::value] or
7848    /// [KmsKeyState::name].
7849    UnknownValue(kms_key_state::UnknownValue),
7850}
7851
7852#[doc(hidden)]
7853pub mod kms_key_state {
7854    #[allow(unused_imports)]
7855    use super::*;
7856    #[derive(Clone, Debug, PartialEq)]
7857    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7858}
7859
7860impl KmsKeyState {
7861    /// Gets the enum value.
7862    ///
7863    /// Returns `None` if the enum contains an unknown value deserialized from
7864    /// the string representation of enums.
7865    pub fn value(&self) -> std::option::Option<i32> {
7866        match self {
7867            Self::Unspecified => std::option::Option::Some(0),
7868            Self::KeyAvailable => std::option::Option::Some(1),
7869            Self::KeyUnavailable => std::option::Option::Some(2),
7870            Self::UnknownValue(u) => u.0.value(),
7871        }
7872    }
7873
7874    /// Gets the enum value as a string.
7875    ///
7876    /// Returns `None` if the enum contains an unknown value deserialized from
7877    /// the integer representation of enums.
7878    pub fn name(&self) -> std::option::Option<&str> {
7879        match self {
7880            Self::Unspecified => std::option::Option::Some("KMS_KEY_STATE_UNSPECIFIED"),
7881            Self::KeyAvailable => std::option::Option::Some("KMS_KEY_STATE_KEY_AVAILABLE"),
7882            Self::KeyUnavailable => std::option::Option::Some("KMS_KEY_STATE_KEY_UNAVAILABLE"),
7883            Self::UnknownValue(u) => u.0.name(),
7884        }
7885    }
7886}
7887
7888impl std::default::Default for KmsKeyState {
7889    fn default() -> Self {
7890        use std::convert::From;
7891        Self::from(0)
7892    }
7893}
7894
7895impl std::fmt::Display for KmsKeyState {
7896    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7897        wkt::internal::display_enum(f, self.name(), self.value())
7898    }
7899}
7900
7901impl std::convert::From<i32> for KmsKeyState {
7902    fn from(value: i32) -> Self {
7903        match value {
7904            0 => Self::Unspecified,
7905            1 => Self::KeyAvailable,
7906            2 => Self::KeyUnavailable,
7907            _ => Self::UnknownValue(kms_key_state::UnknownValue(
7908                wkt::internal::UnknownEnumValue::Integer(value),
7909            )),
7910        }
7911    }
7912}
7913
7914impl std::convert::From<&str> for KmsKeyState {
7915    fn from(value: &str) -> Self {
7916        use std::string::ToString;
7917        match value {
7918            "KMS_KEY_STATE_UNSPECIFIED" => Self::Unspecified,
7919            "KMS_KEY_STATE_KEY_AVAILABLE" => Self::KeyAvailable,
7920            "KMS_KEY_STATE_KEY_UNAVAILABLE" => Self::KeyUnavailable,
7921            _ => Self::UnknownValue(kms_key_state::UnknownValue(
7922                wkt::internal::UnknownEnumValue::String(value.to_string()),
7923            )),
7924        }
7925    }
7926}
7927
7928impl serde::ser::Serialize for KmsKeyState {
7929    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7930    where
7931        S: serde::Serializer,
7932    {
7933        match self {
7934            Self::Unspecified => serializer.serialize_i32(0),
7935            Self::KeyAvailable => serializer.serialize_i32(1),
7936            Self::KeyUnavailable => serializer.serialize_i32(2),
7937            Self::UnknownValue(u) => u.0.serialize(serializer),
7938        }
7939    }
7940}
7941
7942impl<'de> serde::de::Deserialize<'de> for KmsKeyState {
7943    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7944    where
7945        D: serde::Deserializer<'de>,
7946    {
7947        deserializer.deserialize_any(wkt::internal::EnumVisitor::<KmsKeyState>::new(
7948            ".google.cloud.edgecontainer.v1.KmsKeyState",
7949        ))
7950    }
7951}
7952
7953/// Represents if the resource is in lock down state or pending.
7954///
7955/// # Working with unknown values
7956///
7957/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7958/// additional enum variants at any time. Adding new variants is not considered
7959/// a breaking change. Applications should write their code in anticipation of:
7960///
7961/// - New values appearing in future releases of the client library, **and**
7962/// - New values received dynamically, without application changes.
7963///
7964/// Please consult the [Working with enums] section in the user guide for some
7965/// guidelines.
7966///
7967/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7968#[derive(Clone, Debug, PartialEq)]
7969#[non_exhaustive]
7970pub enum ResourceState {
7971    /// Default value.
7972    Unspecified,
7973    /// The resource is in LOCK DOWN state.
7974    LockDown,
7975    /// The resource is pending lock down.
7976    LockDownPending,
7977    /// If set, the enum was initialized with an unknown value.
7978    ///
7979    /// Applications can examine the value using [ResourceState::value] or
7980    /// [ResourceState::name].
7981    UnknownValue(resource_state::UnknownValue),
7982}
7983
7984#[doc(hidden)]
7985pub mod resource_state {
7986    #[allow(unused_imports)]
7987    use super::*;
7988    #[derive(Clone, Debug, PartialEq)]
7989    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7990}
7991
7992impl ResourceState {
7993    /// Gets the enum value.
7994    ///
7995    /// Returns `None` if the enum contains an unknown value deserialized from
7996    /// the string representation of enums.
7997    pub fn value(&self) -> std::option::Option<i32> {
7998        match self {
7999            Self::Unspecified => std::option::Option::Some(0),
8000            Self::LockDown => std::option::Option::Some(1),
8001            Self::LockDownPending => std::option::Option::Some(2),
8002            Self::UnknownValue(u) => u.0.value(),
8003        }
8004    }
8005
8006    /// Gets the enum value as a string.
8007    ///
8008    /// Returns `None` if the enum contains an unknown value deserialized from
8009    /// the integer representation of enums.
8010    pub fn name(&self) -> std::option::Option<&str> {
8011        match self {
8012            Self::Unspecified => std::option::Option::Some("RESOURCE_STATE_UNSPECIFIED"),
8013            Self::LockDown => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN"),
8014            Self::LockDownPending => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN_PENDING"),
8015            Self::UnknownValue(u) => u.0.name(),
8016        }
8017    }
8018}
8019
8020impl std::default::Default for ResourceState {
8021    fn default() -> Self {
8022        use std::convert::From;
8023        Self::from(0)
8024    }
8025}
8026
8027impl std::fmt::Display for ResourceState {
8028    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8029        wkt::internal::display_enum(f, self.name(), self.value())
8030    }
8031}
8032
8033impl std::convert::From<i32> for ResourceState {
8034    fn from(value: i32) -> Self {
8035        match value {
8036            0 => Self::Unspecified,
8037            1 => Self::LockDown,
8038            2 => Self::LockDownPending,
8039            _ => Self::UnknownValue(resource_state::UnknownValue(
8040                wkt::internal::UnknownEnumValue::Integer(value),
8041            )),
8042        }
8043    }
8044}
8045
8046impl std::convert::From<&str> for ResourceState {
8047    fn from(value: &str) -> Self {
8048        use std::string::ToString;
8049        match value {
8050            "RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
8051            "RESOURCE_STATE_LOCK_DOWN" => Self::LockDown,
8052            "RESOURCE_STATE_LOCK_DOWN_PENDING" => Self::LockDownPending,
8053            _ => Self::UnknownValue(resource_state::UnknownValue(
8054                wkt::internal::UnknownEnumValue::String(value.to_string()),
8055            )),
8056        }
8057    }
8058}
8059
8060impl serde::ser::Serialize for ResourceState {
8061    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8062    where
8063        S: serde::Serializer,
8064    {
8065        match self {
8066            Self::Unspecified => serializer.serialize_i32(0),
8067            Self::LockDown => serializer.serialize_i32(1),
8068            Self::LockDownPending => serializer.serialize_i32(2),
8069            Self::UnknownValue(u) => u.0.serialize(serializer),
8070        }
8071    }
8072}
8073
8074impl<'de> serde::de::Deserialize<'de> for ResourceState {
8075    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8076    where
8077        D: serde::Deserializer<'de>,
8078    {
8079        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceState>::new(
8080            ".google.cloud.edgecontainer.v1.ResourceState",
8081        ))
8082    }
8083}