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