google_cloud_edgecontainer_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37/// A Google Distributed Cloud Edge Kubernetes cluster.
38#[derive(Clone, Debug, Default, PartialEq)]
39#[non_exhaustive]
40pub struct Cluster {
41    /// Required. The resource name of the cluster.
42    pub name: std::string::String,
43
44    /// Output only. The time when the cluster was created.
45    pub create_time: std::option::Option<wkt::Timestamp>,
46
47    /// Output only. The time when the cluster was last updated.
48    pub update_time: std::option::Option<wkt::Timestamp>,
49
50    /// Labels associated with this resource.
51    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
52
53    /// Required. Fleet configuration.
54    pub fleet: std::option::Option<crate::model::Fleet>,
55
56    /// Required. Cluster-wide networking configuration.
57    pub networking: std::option::Option<crate::model::ClusterNetworking>,
58
59    /// Required. Immutable. RBAC policy that will be applied and managed by GEC.
60    pub authorization: std::option::Option<crate::model::Authorization>,
61
62    /// Optional. The default maximum number of pods per node used if a maximum
63    /// value is not specified explicitly for a node pool in this cluster. If
64    /// unspecified, the Kubernetes default value will be used.
65    pub default_max_pods_per_node: i32,
66
67    /// Output only. The IP address of the Kubernetes API server.
68    pub endpoint: std::string::String,
69
70    /// Output only. The port number of the Kubernetes API server.
71    pub port: i32,
72
73    /// Output only. The PEM-encoded public certificate of the cluster's CA.
74    pub cluster_ca_certificate: std::string::String,
75
76    /// Optional. Cluster-wide maintenance policy configuration.
77    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
78
79    /// Output only. The control plane release version
80    pub control_plane_version: std::string::String,
81
82    /// Output only. The lowest release version among all worker nodes. This field
83    /// can be empty if the cluster does not have any worker nodes.
84    pub node_version: std::string::String,
85
86    /// Optional. The configuration of the cluster control plane.
87    pub control_plane: std::option::Option<crate::model::cluster::ControlPlane>,
88
89    /// Optional. The configuration of the system add-ons.
90    pub system_addons_config: std::option::Option<crate::model::cluster::SystemAddonsConfig>,
91
92    /// Optional. IPv4 address pools for cluster data plane external load
93    /// balancing.
94    pub external_load_balancer_ipv4_address_pools: std::vec::Vec<std::string::String>,
95
96    /// Optional. Remote control plane disk encryption options. This field is only
97    /// used when enabling CMEK support.
98    pub control_plane_encryption:
99        std::option::Option<crate::model::cluster::ControlPlaneEncryption>,
100
101    /// Output only. The current status of the cluster.
102    pub status: crate::model::cluster::Status,
103
104    /// Output only. All the maintenance events scheduled for the cluster,
105    /// including the ones ongoing, planned for the future and done in the past (up
106    /// to 90 days).
107    pub maintenance_events: std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
108
109    /// Optional. The target cluster version. For example: "1.5.0".
110    pub target_version: std::string::String,
111
112    /// Optional. The release channel a cluster is subscribed to.
113    pub release_channel: crate::model::cluster::ReleaseChannel,
114
115    /// Optional. Configuration of the cluster survivability, e.g., for the case
116    /// when network connectivity is lost. Note: This only applies to local control
117    /// plane clusters.
118    pub survivability_config: std::option::Option<crate::model::cluster::SurvivabilityConfig>,
119
120    /// Optional. IPv6 address pools for cluster data plane external load
121    /// balancing.
122    pub external_load_balancer_ipv6_address_pools: std::vec::Vec<std::string::String>,
123
124    /// Output only. The current connection state of the cluster.
125    pub connection_state: std::option::Option<crate::model::cluster::ConnectionState>,
126
127    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
128}
129
130impl Cluster {
131    pub fn new() -> Self {
132        std::default::Default::default()
133    }
134
135    /// Sets the value of [name][crate::model::Cluster::name].
136    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
137        self.name = v.into();
138        self
139    }
140
141    /// Sets the value of [create_time][crate::model::Cluster::create_time].
142    pub fn set_create_time<T>(mut self, v: T) -> Self
143    where
144        T: std::convert::Into<wkt::Timestamp>,
145    {
146        self.create_time = std::option::Option::Some(v.into());
147        self
148    }
149
150    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
151    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
152    where
153        T: std::convert::Into<wkt::Timestamp>,
154    {
155        self.create_time = v.map(|x| x.into());
156        self
157    }
158
159    /// Sets the value of [update_time][crate::model::Cluster::update_time].
160    pub fn set_update_time<T>(mut self, v: T) -> Self
161    where
162        T: std::convert::Into<wkt::Timestamp>,
163    {
164        self.update_time = std::option::Option::Some(v.into());
165        self
166    }
167
168    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
169    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
170    where
171        T: std::convert::Into<wkt::Timestamp>,
172    {
173        self.update_time = v.map(|x| x.into());
174        self
175    }
176
177    /// Sets the value of [labels][crate::model::Cluster::labels].
178    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
179    where
180        T: std::iter::IntoIterator<Item = (K, V)>,
181        K: std::convert::Into<std::string::String>,
182        V: std::convert::Into<std::string::String>,
183    {
184        use std::iter::Iterator;
185        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
186        self
187    }
188
189    /// Sets the value of [fleet][crate::model::Cluster::fleet].
190    pub fn set_fleet<T>(mut self, v: T) -> Self
191    where
192        T: std::convert::Into<crate::model::Fleet>,
193    {
194        self.fleet = std::option::Option::Some(v.into());
195        self
196    }
197
198    /// Sets or clears the value of [fleet][crate::model::Cluster::fleet].
199    pub fn set_or_clear_fleet<T>(mut self, v: std::option::Option<T>) -> Self
200    where
201        T: std::convert::Into<crate::model::Fleet>,
202    {
203        self.fleet = v.map(|x| x.into());
204        self
205    }
206
207    /// Sets the value of [networking][crate::model::Cluster::networking].
208    pub fn set_networking<T>(mut self, v: T) -> Self
209    where
210        T: std::convert::Into<crate::model::ClusterNetworking>,
211    {
212        self.networking = std::option::Option::Some(v.into());
213        self
214    }
215
216    /// Sets or clears the value of [networking][crate::model::Cluster::networking].
217    pub fn set_or_clear_networking<T>(mut self, v: std::option::Option<T>) -> Self
218    where
219        T: std::convert::Into<crate::model::ClusterNetworking>,
220    {
221        self.networking = v.map(|x| x.into());
222        self
223    }
224
225    /// Sets the value of [authorization][crate::model::Cluster::authorization].
226    pub fn set_authorization<T>(mut self, v: T) -> Self
227    where
228        T: std::convert::Into<crate::model::Authorization>,
229    {
230        self.authorization = std::option::Option::Some(v.into());
231        self
232    }
233
234    /// Sets or clears the value of [authorization][crate::model::Cluster::authorization].
235    pub fn set_or_clear_authorization<T>(mut self, v: std::option::Option<T>) -> Self
236    where
237        T: std::convert::Into<crate::model::Authorization>,
238    {
239        self.authorization = v.map(|x| x.into());
240        self
241    }
242
243    /// Sets the value of [default_max_pods_per_node][crate::model::Cluster::default_max_pods_per_node].
244    pub fn set_default_max_pods_per_node<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
245        self.default_max_pods_per_node = v.into();
246        self
247    }
248
249    /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
250    pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251        self.endpoint = v.into();
252        self
253    }
254
255    /// Sets the value of [port][crate::model::Cluster::port].
256    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
257        self.port = v.into();
258        self
259    }
260
261    /// Sets the value of [cluster_ca_certificate][crate::model::Cluster::cluster_ca_certificate].
262    pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
263        mut self,
264        v: T,
265    ) -> Self {
266        self.cluster_ca_certificate = v.into();
267        self
268    }
269
270    /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
271    pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
272    where
273        T: std::convert::Into<crate::model::MaintenancePolicy>,
274    {
275        self.maintenance_policy = std::option::Option::Some(v.into());
276        self
277    }
278
279    /// Sets or clears the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
280    pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
281    where
282        T: std::convert::Into<crate::model::MaintenancePolicy>,
283    {
284        self.maintenance_policy = v.map(|x| x.into());
285        self
286    }
287
288    /// Sets the value of [control_plane_version][crate::model::Cluster::control_plane_version].
289    pub fn set_control_plane_version<T: std::convert::Into<std::string::String>>(
290        mut self,
291        v: T,
292    ) -> Self {
293        self.control_plane_version = v.into();
294        self
295    }
296
297    /// Sets the value of [node_version][crate::model::Cluster::node_version].
298    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299        self.node_version = v.into();
300        self
301    }
302
303    /// Sets the value of [control_plane][crate::model::Cluster::control_plane].
304    pub fn set_control_plane<T>(mut self, v: T) -> Self
305    where
306        T: std::convert::Into<crate::model::cluster::ControlPlane>,
307    {
308        self.control_plane = std::option::Option::Some(v.into());
309        self
310    }
311
312    /// Sets or clears the value of [control_plane][crate::model::Cluster::control_plane].
313    pub fn set_or_clear_control_plane<T>(mut self, v: std::option::Option<T>) -> Self
314    where
315        T: std::convert::Into<crate::model::cluster::ControlPlane>,
316    {
317        self.control_plane = v.map(|x| x.into());
318        self
319    }
320
321    /// Sets the value of [system_addons_config][crate::model::Cluster::system_addons_config].
322    pub fn set_system_addons_config<T>(mut self, v: T) -> Self
323    where
324        T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
325    {
326        self.system_addons_config = std::option::Option::Some(v.into());
327        self
328    }
329
330    /// Sets or clears the value of [system_addons_config][crate::model::Cluster::system_addons_config].
331    pub fn set_or_clear_system_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
332    where
333        T: std::convert::Into<crate::model::cluster::SystemAddonsConfig>,
334    {
335        self.system_addons_config = v.map(|x| x.into());
336        self
337    }
338
339    /// Sets the value of [external_load_balancer_ipv4_address_pools][crate::model::Cluster::external_load_balancer_ipv4_address_pools].
340    pub fn set_external_load_balancer_ipv4_address_pools<T, V>(mut self, v: T) -> Self
341    where
342        T: std::iter::IntoIterator<Item = V>,
343        V: std::convert::Into<std::string::String>,
344    {
345        use std::iter::Iterator;
346        self.external_load_balancer_ipv4_address_pools = v.into_iter().map(|i| i.into()).collect();
347        self
348    }
349
350    /// Sets the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
351    pub fn set_control_plane_encryption<T>(mut self, v: T) -> Self
352    where
353        T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
354    {
355        self.control_plane_encryption = std::option::Option::Some(v.into());
356        self
357    }
358
359    /// Sets or clears the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
360    pub fn set_or_clear_control_plane_encryption<T>(mut self, v: std::option::Option<T>) -> Self
361    where
362        T: std::convert::Into<crate::model::cluster::ControlPlaneEncryption>,
363    {
364        self.control_plane_encryption = v.map(|x| x.into());
365        self
366    }
367
368    /// Sets the value of [status][crate::model::Cluster::status].
369    pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
370        mut self,
371        v: T,
372    ) -> Self {
373        self.status = v.into();
374        self
375    }
376
377    /// Sets the value of [maintenance_events][crate::model::Cluster::maintenance_events].
378    pub fn set_maintenance_events<T, V>(mut self, v: T) -> Self
379    where
380        T: std::iter::IntoIterator<Item = V>,
381        V: std::convert::Into<crate::model::cluster::MaintenanceEvent>,
382    {
383        use std::iter::Iterator;
384        self.maintenance_events = v.into_iter().map(|i| i.into()).collect();
385        self
386    }
387
388    /// Sets the value of [target_version][crate::model::Cluster::target_version].
389    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390        self.target_version = v.into();
391        self
392    }
393
394    /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
395    pub fn set_release_channel<T: std::convert::Into<crate::model::cluster::ReleaseChannel>>(
396        mut self,
397        v: T,
398    ) -> Self {
399        self.release_channel = v.into();
400        self
401    }
402
403    /// Sets the value of [survivability_config][crate::model::Cluster::survivability_config].
404    pub fn set_survivability_config<T>(mut self, v: T) -> Self
405    where
406        T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
407    {
408        self.survivability_config = std::option::Option::Some(v.into());
409        self
410    }
411
412    /// Sets or clears the value of [survivability_config][crate::model::Cluster::survivability_config].
413    pub fn set_or_clear_survivability_config<T>(mut self, v: std::option::Option<T>) -> Self
414    where
415        T: std::convert::Into<crate::model::cluster::SurvivabilityConfig>,
416    {
417        self.survivability_config = v.map(|x| x.into());
418        self
419    }
420
421    /// Sets the value of [external_load_balancer_ipv6_address_pools][crate::model::Cluster::external_load_balancer_ipv6_address_pools].
422    pub fn set_external_load_balancer_ipv6_address_pools<T, V>(mut self, v: T) -> Self
423    where
424        T: std::iter::IntoIterator<Item = V>,
425        V: std::convert::Into<std::string::String>,
426    {
427        use std::iter::Iterator;
428        self.external_load_balancer_ipv6_address_pools = v.into_iter().map(|i| i.into()).collect();
429        self
430    }
431
432    /// Sets the value of [connection_state][crate::model::Cluster::connection_state].
433    pub fn set_connection_state<T>(mut self, v: T) -> Self
434    where
435        T: std::convert::Into<crate::model::cluster::ConnectionState>,
436    {
437        self.connection_state = std::option::Option::Some(v.into());
438        self
439    }
440
441    /// Sets or clears the value of [connection_state][crate::model::Cluster::connection_state].
442    pub fn set_or_clear_connection_state<T>(mut self, v: std::option::Option<T>) -> Self
443    where
444        T: std::convert::Into<crate::model::cluster::ConnectionState>,
445    {
446        self.connection_state = v.map(|x| x.into());
447        self
448    }
449}
450
451impl wkt::message::Message for Cluster {
452    fn typename() -> &'static str {
453        "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster"
454    }
455}
456
457#[doc(hidden)]
458impl<'de> serde::de::Deserialize<'de> for Cluster {
459    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
460    where
461        D: serde::Deserializer<'de>,
462    {
463        #[allow(non_camel_case_types)]
464        #[doc(hidden)]
465        #[derive(PartialEq, Eq, Hash)]
466        enum __FieldTag {
467            __name,
468            __create_time,
469            __update_time,
470            __labels,
471            __fleet,
472            __networking,
473            __authorization,
474            __default_max_pods_per_node,
475            __endpoint,
476            __port,
477            __cluster_ca_certificate,
478            __maintenance_policy,
479            __control_plane_version,
480            __node_version,
481            __control_plane,
482            __system_addons_config,
483            __external_load_balancer_ipv4_address_pools,
484            __control_plane_encryption,
485            __status,
486            __maintenance_events,
487            __target_version,
488            __release_channel,
489            __survivability_config,
490            __external_load_balancer_ipv6_address_pools,
491            __connection_state,
492            Unknown(std::string::String),
493        }
494        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
495            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
496            where
497                D: serde::Deserializer<'de>,
498            {
499                struct Visitor;
500                impl<'de> serde::de::Visitor<'de> for Visitor {
501                    type Value = __FieldTag;
502                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
503                        formatter.write_str("a field name for Cluster")
504                    }
505                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
506                    where
507                        E: serde::de::Error,
508                    {
509                        use std::result::Result::Ok;
510                        use std::string::ToString;
511                        match value {
512                            "name" => Ok(__FieldTag::__name),
513                            "createTime" => Ok(__FieldTag::__create_time),
514                            "create_time" => Ok(__FieldTag::__create_time),
515                            "updateTime" => Ok(__FieldTag::__update_time),
516                            "update_time" => Ok(__FieldTag::__update_time),
517                            "labels" => Ok(__FieldTag::__labels),
518                            "fleet" => Ok(__FieldTag::__fleet),
519                            "networking" => Ok(__FieldTag::__networking),
520                            "authorization" => Ok(__FieldTag::__authorization),
521                            "defaultMaxPodsPerNode" => Ok(__FieldTag::__default_max_pods_per_node),
522                            "default_max_pods_per_node" => {
523                                Ok(__FieldTag::__default_max_pods_per_node)
524                            }
525                            "endpoint" => Ok(__FieldTag::__endpoint),
526                            "port" => Ok(__FieldTag::__port),
527                            "clusterCaCertificate" => Ok(__FieldTag::__cluster_ca_certificate),
528                            "cluster_ca_certificate" => Ok(__FieldTag::__cluster_ca_certificate),
529                            "maintenancePolicy" => Ok(__FieldTag::__maintenance_policy),
530                            "maintenance_policy" => Ok(__FieldTag::__maintenance_policy),
531                            "controlPlaneVersion" => Ok(__FieldTag::__control_plane_version),
532                            "control_plane_version" => Ok(__FieldTag::__control_plane_version),
533                            "nodeVersion" => Ok(__FieldTag::__node_version),
534                            "node_version" => Ok(__FieldTag::__node_version),
535                            "controlPlane" => Ok(__FieldTag::__control_plane),
536                            "control_plane" => Ok(__FieldTag::__control_plane),
537                            "systemAddonsConfig" => Ok(__FieldTag::__system_addons_config),
538                            "system_addons_config" => Ok(__FieldTag::__system_addons_config),
539                            "externalLoadBalancerIpv4AddressPools" => {
540                                Ok(__FieldTag::__external_load_balancer_ipv4_address_pools)
541                            }
542                            "external_load_balancer_ipv4_address_pools" => {
543                                Ok(__FieldTag::__external_load_balancer_ipv4_address_pools)
544                            }
545                            "controlPlaneEncryption" => Ok(__FieldTag::__control_plane_encryption),
546                            "control_plane_encryption" => {
547                                Ok(__FieldTag::__control_plane_encryption)
548                            }
549                            "status" => Ok(__FieldTag::__status),
550                            "maintenanceEvents" => Ok(__FieldTag::__maintenance_events),
551                            "maintenance_events" => Ok(__FieldTag::__maintenance_events),
552                            "targetVersion" => Ok(__FieldTag::__target_version),
553                            "target_version" => Ok(__FieldTag::__target_version),
554                            "releaseChannel" => Ok(__FieldTag::__release_channel),
555                            "release_channel" => Ok(__FieldTag::__release_channel),
556                            "survivabilityConfig" => Ok(__FieldTag::__survivability_config),
557                            "survivability_config" => Ok(__FieldTag::__survivability_config),
558                            "externalLoadBalancerIpv6AddressPools" => {
559                                Ok(__FieldTag::__external_load_balancer_ipv6_address_pools)
560                            }
561                            "external_load_balancer_ipv6_address_pools" => {
562                                Ok(__FieldTag::__external_load_balancer_ipv6_address_pools)
563                            }
564                            "connectionState" => Ok(__FieldTag::__connection_state),
565                            "connection_state" => Ok(__FieldTag::__connection_state),
566                            _ => Ok(__FieldTag::Unknown(value.to_string())),
567                        }
568                    }
569                }
570                deserializer.deserialize_identifier(Visitor)
571            }
572        }
573        struct Visitor;
574        impl<'de> serde::de::Visitor<'de> for Visitor {
575            type Value = Cluster;
576            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
577                formatter.write_str("struct Cluster")
578            }
579            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
580            where
581                A: serde::de::MapAccess<'de>,
582            {
583                #[allow(unused_imports)]
584                use serde::de::Error;
585                use std::option::Option::Some;
586                let mut fields = std::collections::HashSet::new();
587                let mut result = Self::Value::new();
588                while let Some(tag) = map.next_key::<__FieldTag>()? {
589                    #[allow(clippy::match_single_binding)]
590                    match tag {
591                        __FieldTag::__name => {
592                            if !fields.insert(__FieldTag::__name) {
593                                return std::result::Result::Err(A::Error::duplicate_field(
594                                    "multiple values for name",
595                                ));
596                            }
597                            result.name = map
598                                .next_value::<std::option::Option<std::string::String>>()?
599                                .unwrap_or_default();
600                        }
601                        __FieldTag::__create_time => {
602                            if !fields.insert(__FieldTag::__create_time) {
603                                return std::result::Result::Err(A::Error::duplicate_field(
604                                    "multiple values for create_time",
605                                ));
606                            }
607                            result.create_time =
608                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
609                        }
610                        __FieldTag::__update_time => {
611                            if !fields.insert(__FieldTag::__update_time) {
612                                return std::result::Result::Err(A::Error::duplicate_field(
613                                    "multiple values for update_time",
614                                ));
615                            }
616                            result.update_time =
617                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
618                        }
619                        __FieldTag::__labels => {
620                            if !fields.insert(__FieldTag::__labels) {
621                                return std::result::Result::Err(A::Error::duplicate_field(
622                                    "multiple values for labels",
623                                ));
624                            }
625                            result.labels = map
626                                .next_value::<std::option::Option<
627                                    std::collections::HashMap<
628                                        std::string::String,
629                                        std::string::String,
630                                    >,
631                                >>()?
632                                .unwrap_or_default();
633                        }
634                        __FieldTag::__fleet => {
635                            if !fields.insert(__FieldTag::__fleet) {
636                                return std::result::Result::Err(A::Error::duplicate_field(
637                                    "multiple values for fleet",
638                                ));
639                            }
640                            result.fleet =
641                                map.next_value::<std::option::Option<crate::model::Fleet>>()?;
642                        }
643                        __FieldTag::__networking => {
644                            if !fields.insert(__FieldTag::__networking) {
645                                return std::result::Result::Err(A::Error::duplicate_field(
646                                    "multiple values for networking",
647                                ));
648                            }
649                            result.networking = map
650                                .next_value::<std::option::Option<crate::model::ClusterNetworking>>(
651                                )?;
652                        }
653                        __FieldTag::__authorization => {
654                            if !fields.insert(__FieldTag::__authorization) {
655                                return std::result::Result::Err(A::Error::duplicate_field(
656                                    "multiple values for authorization",
657                                ));
658                            }
659                            result.authorization = map
660                                .next_value::<std::option::Option<crate::model::Authorization>>()?;
661                        }
662                        __FieldTag::__default_max_pods_per_node => {
663                            if !fields.insert(__FieldTag::__default_max_pods_per_node) {
664                                return std::result::Result::Err(A::Error::duplicate_field(
665                                    "multiple values for default_max_pods_per_node",
666                                ));
667                            }
668                            struct __With(std::option::Option<i32>);
669                            impl<'de> serde::de::Deserialize<'de> for __With {
670                                fn deserialize<D>(
671                                    deserializer: D,
672                                ) -> std::result::Result<Self, D::Error>
673                                where
674                                    D: serde::de::Deserializer<'de>,
675                                {
676                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
677                                }
678                            }
679                            result.default_max_pods_per_node =
680                                map.next_value::<__With>()?.0.unwrap_or_default();
681                        }
682                        __FieldTag::__endpoint => {
683                            if !fields.insert(__FieldTag::__endpoint) {
684                                return std::result::Result::Err(A::Error::duplicate_field(
685                                    "multiple values for endpoint",
686                                ));
687                            }
688                            result.endpoint = map
689                                .next_value::<std::option::Option<std::string::String>>()?
690                                .unwrap_or_default();
691                        }
692                        __FieldTag::__port => {
693                            if !fields.insert(__FieldTag::__port) {
694                                return std::result::Result::Err(A::Error::duplicate_field(
695                                    "multiple values for port",
696                                ));
697                            }
698                            struct __With(std::option::Option<i32>);
699                            impl<'de> serde::de::Deserialize<'de> for __With {
700                                fn deserialize<D>(
701                                    deserializer: D,
702                                ) -> std::result::Result<Self, D::Error>
703                                where
704                                    D: serde::de::Deserializer<'de>,
705                                {
706                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
707                                }
708                            }
709                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
710                        }
711                        __FieldTag::__cluster_ca_certificate => {
712                            if !fields.insert(__FieldTag::__cluster_ca_certificate) {
713                                return std::result::Result::Err(A::Error::duplicate_field(
714                                    "multiple values for cluster_ca_certificate",
715                                ));
716                            }
717                            result.cluster_ca_certificate = map
718                                .next_value::<std::option::Option<std::string::String>>()?
719                                .unwrap_or_default();
720                        }
721                        __FieldTag::__maintenance_policy => {
722                            if !fields.insert(__FieldTag::__maintenance_policy) {
723                                return std::result::Result::Err(A::Error::duplicate_field(
724                                    "multiple values for maintenance_policy",
725                                ));
726                            }
727                            result.maintenance_policy = map
728                                .next_value::<std::option::Option<crate::model::MaintenancePolicy>>(
729                                )?;
730                        }
731                        __FieldTag::__control_plane_version => {
732                            if !fields.insert(__FieldTag::__control_plane_version) {
733                                return std::result::Result::Err(A::Error::duplicate_field(
734                                    "multiple values for control_plane_version",
735                                ));
736                            }
737                            result.control_plane_version = map
738                                .next_value::<std::option::Option<std::string::String>>()?
739                                .unwrap_or_default();
740                        }
741                        __FieldTag::__node_version => {
742                            if !fields.insert(__FieldTag::__node_version) {
743                                return std::result::Result::Err(A::Error::duplicate_field(
744                                    "multiple values for node_version",
745                                ));
746                            }
747                            result.node_version = map
748                                .next_value::<std::option::Option<std::string::String>>()?
749                                .unwrap_or_default();
750                        }
751                        __FieldTag::__control_plane => {
752                            if !fields.insert(__FieldTag::__control_plane) {
753                                return std::result::Result::Err(A::Error::duplicate_field(
754                                    "multiple values for control_plane",
755                                ));
756                            }
757                            result.control_plane = map.next_value::<std::option::Option<crate::model::cluster::ControlPlane>>()?
758                                ;
759                        }
760                        __FieldTag::__system_addons_config => {
761                            if !fields.insert(__FieldTag::__system_addons_config) {
762                                return std::result::Result::Err(A::Error::duplicate_field(
763                                    "multiple values for system_addons_config",
764                                ));
765                            }
766                            result.system_addons_config = map.next_value::<std::option::Option<crate::model::cluster::SystemAddonsConfig>>()?
767                                ;
768                        }
769                        __FieldTag::__external_load_balancer_ipv4_address_pools => {
770                            if !fields
771                                .insert(__FieldTag::__external_load_balancer_ipv4_address_pools)
772                            {
773                                return std::result::Result::Err(A::Error::duplicate_field(
774                                    "multiple values for external_load_balancer_ipv4_address_pools",
775                                ));
776                            }
777                            result.external_load_balancer_ipv4_address_pools = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
778                        }
779                        __FieldTag::__control_plane_encryption => {
780                            if !fields.insert(__FieldTag::__control_plane_encryption) {
781                                return std::result::Result::Err(A::Error::duplicate_field(
782                                    "multiple values for control_plane_encryption",
783                                ));
784                            }
785                            result.control_plane_encryption = map
786                                .next_value::<std::option::Option<
787                                    crate::model::cluster::ControlPlaneEncryption,
788                                >>()?;
789                        }
790                        __FieldTag::__status => {
791                            if !fields.insert(__FieldTag::__status) {
792                                return std::result::Result::Err(A::Error::duplicate_field(
793                                    "multiple values for status",
794                                ));
795                            }
796                            result.status = map
797                                .next_value::<std::option::Option<crate::model::cluster::Status>>()?
798                                .unwrap_or_default();
799                        }
800                        __FieldTag::__maintenance_events => {
801                            if !fields.insert(__FieldTag::__maintenance_events) {
802                                return std::result::Result::Err(A::Error::duplicate_field(
803                                    "multiple values for maintenance_events",
804                                ));
805                            }
806                            result.maintenance_events = map
807                                .next_value::<std::option::Option<
808                                    std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
809                                >>()?
810                                .unwrap_or_default();
811                        }
812                        __FieldTag::__target_version => {
813                            if !fields.insert(__FieldTag::__target_version) {
814                                return std::result::Result::Err(A::Error::duplicate_field(
815                                    "multiple values for target_version",
816                                ));
817                            }
818                            result.target_version = map
819                                .next_value::<std::option::Option<std::string::String>>()?
820                                .unwrap_or_default();
821                        }
822                        __FieldTag::__release_channel => {
823                            if !fields.insert(__FieldTag::__release_channel) {
824                                return std::result::Result::Err(A::Error::duplicate_field(
825                                    "multiple values for release_channel",
826                                ));
827                            }
828                            result.release_channel = map.next_value::<std::option::Option<crate::model::cluster::ReleaseChannel>>()?.unwrap_or_default();
829                        }
830                        __FieldTag::__survivability_config => {
831                            if !fields.insert(__FieldTag::__survivability_config) {
832                                return std::result::Result::Err(A::Error::duplicate_field(
833                                    "multiple values for survivability_config",
834                                ));
835                            }
836                            result.survivability_config = map.next_value::<std::option::Option<crate::model::cluster::SurvivabilityConfig>>()?
837                                ;
838                        }
839                        __FieldTag::__external_load_balancer_ipv6_address_pools => {
840                            if !fields
841                                .insert(__FieldTag::__external_load_balancer_ipv6_address_pools)
842                            {
843                                return std::result::Result::Err(A::Error::duplicate_field(
844                                    "multiple values for external_load_balancer_ipv6_address_pools",
845                                ));
846                            }
847                            result.external_load_balancer_ipv6_address_pools = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
848                        }
849                        __FieldTag::__connection_state => {
850                            if !fields.insert(__FieldTag::__connection_state) {
851                                return std::result::Result::Err(A::Error::duplicate_field(
852                                    "multiple values for connection_state",
853                                ));
854                            }
855                            result.connection_state = map.next_value::<std::option::Option<crate::model::cluster::ConnectionState>>()?
856                                ;
857                        }
858                        __FieldTag::Unknown(key) => {
859                            let value = map.next_value::<serde_json::Value>()?;
860                            result._unknown_fields.insert(key, value);
861                        }
862                    }
863                }
864                std::result::Result::Ok(result)
865            }
866        }
867        deserializer.deserialize_any(Visitor)
868    }
869}
870
871#[doc(hidden)]
872impl serde::ser::Serialize for Cluster {
873    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
874    where
875        S: serde::ser::Serializer,
876    {
877        use serde::ser::SerializeMap;
878        #[allow(unused_imports)]
879        use std::option::Option::Some;
880        let mut state = serializer.serialize_map(std::option::Option::None)?;
881        if !self.name.is_empty() {
882            state.serialize_entry("name", &self.name)?;
883        }
884        if self.create_time.is_some() {
885            state.serialize_entry("createTime", &self.create_time)?;
886        }
887        if self.update_time.is_some() {
888            state.serialize_entry("updateTime", &self.update_time)?;
889        }
890        if !self.labels.is_empty() {
891            state.serialize_entry("labels", &self.labels)?;
892        }
893        if self.fleet.is_some() {
894            state.serialize_entry("fleet", &self.fleet)?;
895        }
896        if self.networking.is_some() {
897            state.serialize_entry("networking", &self.networking)?;
898        }
899        if self.authorization.is_some() {
900            state.serialize_entry("authorization", &self.authorization)?;
901        }
902        if !wkt::internal::is_default(&self.default_max_pods_per_node) {
903            struct __With<'a>(&'a i32);
904            impl<'a> serde::ser::Serialize for __With<'a> {
905                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
906                where
907                    S: serde::ser::Serializer,
908                {
909                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
910                }
911            }
912            state.serialize_entry(
913                "defaultMaxPodsPerNode",
914                &__With(&self.default_max_pods_per_node),
915            )?;
916        }
917        if !self.endpoint.is_empty() {
918            state.serialize_entry("endpoint", &self.endpoint)?;
919        }
920        if !wkt::internal::is_default(&self.port) {
921            struct __With<'a>(&'a i32);
922            impl<'a> serde::ser::Serialize for __With<'a> {
923                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
924                where
925                    S: serde::ser::Serializer,
926                {
927                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
928                }
929            }
930            state.serialize_entry("port", &__With(&self.port))?;
931        }
932        if !self.cluster_ca_certificate.is_empty() {
933            state.serialize_entry("clusterCaCertificate", &self.cluster_ca_certificate)?;
934        }
935        if self.maintenance_policy.is_some() {
936            state.serialize_entry("maintenancePolicy", &self.maintenance_policy)?;
937        }
938        if !self.control_plane_version.is_empty() {
939            state.serialize_entry("controlPlaneVersion", &self.control_plane_version)?;
940        }
941        if !self.node_version.is_empty() {
942            state.serialize_entry("nodeVersion", &self.node_version)?;
943        }
944        if self.control_plane.is_some() {
945            state.serialize_entry("controlPlane", &self.control_plane)?;
946        }
947        if self.system_addons_config.is_some() {
948            state.serialize_entry("systemAddonsConfig", &self.system_addons_config)?;
949        }
950        if !self.external_load_balancer_ipv4_address_pools.is_empty() {
951            state.serialize_entry(
952                "externalLoadBalancerIpv4AddressPools",
953                &self.external_load_balancer_ipv4_address_pools,
954            )?;
955        }
956        if self.control_plane_encryption.is_some() {
957            state.serialize_entry("controlPlaneEncryption", &self.control_plane_encryption)?;
958        }
959        if !wkt::internal::is_default(&self.status) {
960            state.serialize_entry("status", &self.status)?;
961        }
962        if !self.maintenance_events.is_empty() {
963            state.serialize_entry("maintenanceEvents", &self.maintenance_events)?;
964        }
965        if !self.target_version.is_empty() {
966            state.serialize_entry("targetVersion", &self.target_version)?;
967        }
968        if !wkt::internal::is_default(&self.release_channel) {
969            state.serialize_entry("releaseChannel", &self.release_channel)?;
970        }
971        if self.survivability_config.is_some() {
972            state.serialize_entry("survivabilityConfig", &self.survivability_config)?;
973        }
974        if !self.external_load_balancer_ipv6_address_pools.is_empty() {
975            state.serialize_entry(
976                "externalLoadBalancerIpv6AddressPools",
977                &self.external_load_balancer_ipv6_address_pools,
978            )?;
979        }
980        if self.connection_state.is_some() {
981            state.serialize_entry("connectionState", &self.connection_state)?;
982        }
983        if !self._unknown_fields.is_empty() {
984            for (key, value) in self._unknown_fields.iter() {
985                state.serialize_entry(key, &value)?;
986            }
987        }
988        state.end()
989    }
990}
991
992/// Defines additional types related to [Cluster].
993pub mod cluster {
994    #[allow(unused_imports)]
995    use super::*;
996
997    /// Configuration of the cluster control plane.
998    #[derive(Clone, Debug, Default, PartialEq)]
999    #[non_exhaustive]
1000    pub struct ControlPlane {
1001        pub config: std::option::Option<crate::model::cluster::control_plane::Config>,
1002
1003        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1004    }
1005
1006    impl ControlPlane {
1007        pub fn new() -> Self {
1008            std::default::Default::default()
1009        }
1010
1011        /// Sets the value of [config][crate::model::cluster::ControlPlane::config].
1012        ///
1013        /// Note that all the setters affecting `config` are mutually
1014        /// exclusive.
1015        pub fn set_config<
1016            T: std::convert::Into<std::option::Option<crate::model::cluster::control_plane::Config>>,
1017        >(
1018            mut self,
1019            v: T,
1020        ) -> Self {
1021            self.config = v.into();
1022            self
1023        }
1024
1025        /// The value of [config][crate::model::cluster::ControlPlane::config]
1026        /// if it holds a `Remote`, `None` if the field is not set or
1027        /// holds a different branch.
1028        pub fn remote(
1029            &self,
1030        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Remote>>
1031        {
1032            #[allow(unreachable_patterns)]
1033            self.config.as_ref().and_then(|v| match v {
1034                crate::model::cluster::control_plane::Config::Remote(v) => {
1035                    std::option::Option::Some(v)
1036                }
1037                _ => std::option::Option::None,
1038            })
1039        }
1040
1041        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
1042        /// to hold a `Remote`.
1043        ///
1044        /// Note that all the setters affecting `config` are
1045        /// mutually exclusive.
1046        pub fn set_remote<
1047            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Remote>>,
1048        >(
1049            mut self,
1050            v: T,
1051        ) -> Self {
1052            self.config = std::option::Option::Some(
1053                crate::model::cluster::control_plane::Config::Remote(v.into()),
1054            );
1055            self
1056        }
1057
1058        /// The value of [config][crate::model::cluster::ControlPlane::config]
1059        /// if it holds a `Local`, `None` if the field is not set or
1060        /// holds a different branch.
1061        pub fn local(
1062            &self,
1063        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Local>>
1064        {
1065            #[allow(unreachable_patterns)]
1066            self.config.as_ref().and_then(|v| match v {
1067                crate::model::cluster::control_plane::Config::Local(v) => {
1068                    std::option::Option::Some(v)
1069                }
1070                _ => std::option::Option::None,
1071            })
1072        }
1073
1074        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
1075        /// to hold a `Local`.
1076        ///
1077        /// Note that all the setters affecting `config` are
1078        /// mutually exclusive.
1079        pub fn set_local<
1080            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Local>>,
1081        >(
1082            mut self,
1083            v: T,
1084        ) -> Self {
1085            self.config = std::option::Option::Some(
1086                crate::model::cluster::control_plane::Config::Local(v.into()),
1087            );
1088            self
1089        }
1090    }
1091
1092    impl wkt::message::Message for ControlPlane {
1093        fn typename() -> &'static str {
1094            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane"
1095        }
1096    }
1097
1098    #[doc(hidden)]
1099    impl<'de> serde::de::Deserialize<'de> for ControlPlane {
1100        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1101        where
1102            D: serde::Deserializer<'de>,
1103        {
1104            #[allow(non_camel_case_types)]
1105            #[doc(hidden)]
1106            #[derive(PartialEq, Eq, Hash)]
1107            enum __FieldTag {
1108                __remote,
1109                __local,
1110                Unknown(std::string::String),
1111            }
1112            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1113                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1114                where
1115                    D: serde::Deserializer<'de>,
1116                {
1117                    struct Visitor;
1118                    impl<'de> serde::de::Visitor<'de> for Visitor {
1119                        type Value = __FieldTag;
1120                        fn expecting(
1121                            &self,
1122                            formatter: &mut std::fmt::Formatter,
1123                        ) -> std::fmt::Result {
1124                            formatter.write_str("a field name for ControlPlane")
1125                        }
1126                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1127                        where
1128                            E: serde::de::Error,
1129                        {
1130                            use std::result::Result::Ok;
1131                            use std::string::ToString;
1132                            match value {
1133                                "remote" => Ok(__FieldTag::__remote),
1134                                "local" => Ok(__FieldTag::__local),
1135                                _ => Ok(__FieldTag::Unknown(value.to_string())),
1136                            }
1137                        }
1138                    }
1139                    deserializer.deserialize_identifier(Visitor)
1140                }
1141            }
1142            struct Visitor;
1143            impl<'de> serde::de::Visitor<'de> for Visitor {
1144                type Value = ControlPlane;
1145                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1146                    formatter.write_str("struct ControlPlane")
1147                }
1148                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1149                where
1150                    A: serde::de::MapAccess<'de>,
1151                {
1152                    #[allow(unused_imports)]
1153                    use serde::de::Error;
1154                    use std::option::Option::Some;
1155                    let mut fields = std::collections::HashSet::new();
1156                    let mut result = Self::Value::new();
1157                    while let Some(tag) = map.next_key::<__FieldTag>()? {
1158                        #[allow(clippy::match_single_binding)]
1159                        match tag {
1160                            __FieldTag::__remote => {
1161                                if !fields.insert(__FieldTag::__remote) {
1162                                    return std::result::Result::Err(A::Error::duplicate_field(
1163                                        "multiple values for remote",
1164                                    ));
1165                                }
1166                                if result.config.is_some() {
1167                                    return std::result::Result::Err(A::Error::duplicate_field(
1168                                        "multiple values for `config`, a oneof with full ID .google.cloud.edgecontainer.v1.Cluster.ControlPlane.remote, latest field was remote",
1169                                    ));
1170                                }
1171                                result.config = std::option::Option::Some(
1172                                    crate::model::cluster::control_plane::Config::Remote(
1173                                        map.next_value::<std::option::Option<
1174                                            std::boxed::Box<
1175                                                crate::model::cluster::control_plane::Remote,
1176                                            >,
1177                                        >>()?
1178                                        .unwrap_or_default(),
1179                                    ),
1180                                );
1181                            }
1182                            __FieldTag::__local => {
1183                                if !fields.insert(__FieldTag::__local) {
1184                                    return std::result::Result::Err(A::Error::duplicate_field(
1185                                        "multiple values for local",
1186                                    ));
1187                                }
1188                                if result.config.is_some() {
1189                                    return std::result::Result::Err(A::Error::duplicate_field(
1190                                        "multiple values for `config`, a oneof with full ID .google.cloud.edgecontainer.v1.Cluster.ControlPlane.local, latest field was local",
1191                                    ));
1192                                }
1193                                result.config = std::option::Option::Some(
1194                                    crate::model::cluster::control_plane::Config::Local(
1195                                        map.next_value::<std::option::Option<
1196                                            std::boxed::Box<
1197                                                crate::model::cluster::control_plane::Local,
1198                                            >,
1199                                        >>()?
1200                                        .unwrap_or_default(),
1201                                    ),
1202                                );
1203                            }
1204                            __FieldTag::Unknown(key) => {
1205                                let value = map.next_value::<serde_json::Value>()?;
1206                                result._unknown_fields.insert(key, value);
1207                            }
1208                        }
1209                    }
1210                    std::result::Result::Ok(result)
1211                }
1212            }
1213            deserializer.deserialize_any(Visitor)
1214        }
1215    }
1216
1217    #[doc(hidden)]
1218    impl serde::ser::Serialize for ControlPlane {
1219        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1220        where
1221            S: serde::ser::Serializer,
1222        {
1223            use serde::ser::SerializeMap;
1224            #[allow(unused_imports)]
1225            use std::option::Option::Some;
1226            let mut state = serializer.serialize_map(std::option::Option::None)?;
1227            if let Some(value) = self.remote() {
1228                state.serialize_entry("remote", value)?;
1229            }
1230            if let Some(value) = self.local() {
1231                state.serialize_entry("local", value)?;
1232            }
1233            if !self._unknown_fields.is_empty() {
1234                for (key, value) in self._unknown_fields.iter() {
1235                    state.serialize_entry(key, &value)?;
1236                }
1237            }
1238            state.end()
1239        }
1240    }
1241
1242    /// Defines additional types related to [ControlPlane].
1243    pub mod control_plane {
1244        #[allow(unused_imports)]
1245        use super::*;
1246
1247        /// Configuration specific to clusters with a control plane hosted remotely.
1248        #[derive(Clone, Debug, Default, PartialEq)]
1249        #[non_exhaustive]
1250        pub struct Remote {
1251            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1252        }
1253
1254        impl Remote {
1255            pub fn new() -> Self {
1256                std::default::Default::default()
1257            }
1258        }
1259
1260        impl wkt::message::Message for Remote {
1261            fn typename() -> &'static str {
1262                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Remote"
1263            }
1264        }
1265
1266        #[doc(hidden)]
1267        impl<'de> serde::de::Deserialize<'de> for Remote {
1268            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1269            where
1270                D: serde::Deserializer<'de>,
1271            {
1272                #[allow(non_camel_case_types)]
1273                #[doc(hidden)]
1274                #[derive(PartialEq, Eq, Hash)]
1275                enum __FieldTag {
1276                    Unknown(std::string::String),
1277                }
1278                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1279                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1280                    where
1281                        D: serde::Deserializer<'de>,
1282                    {
1283                        struct Visitor;
1284                        impl<'de> serde::de::Visitor<'de> for Visitor {
1285                            type Value = __FieldTag;
1286                            fn expecting(
1287                                &self,
1288                                formatter: &mut std::fmt::Formatter,
1289                            ) -> std::fmt::Result {
1290                                formatter.write_str("a field name for Remote")
1291                            }
1292                            fn visit_str<E>(
1293                                self,
1294                                value: &str,
1295                            ) -> std::result::Result<Self::Value, E>
1296                            where
1297                                E: serde::de::Error,
1298                            {
1299                                use std::result::Result::Ok;
1300                                use std::string::ToString;
1301                                Ok(__FieldTag::Unknown(value.to_string()))
1302                            }
1303                        }
1304                        deserializer.deserialize_identifier(Visitor)
1305                    }
1306                }
1307                struct Visitor;
1308                impl<'de> serde::de::Visitor<'de> for Visitor {
1309                    type Value = Remote;
1310                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1311                        formatter.write_str("struct Remote")
1312                    }
1313                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1314                    where
1315                        A: serde::de::MapAccess<'de>,
1316                    {
1317                        #[allow(unused_imports)]
1318                        use serde::de::Error;
1319                        use std::option::Option::Some;
1320                        let mut result = Self::Value::new();
1321                        while let Some(tag) = map.next_key::<__FieldTag>()? {
1322                            #[allow(clippy::match_single_binding)]
1323                            match tag {
1324                                __FieldTag::Unknown(key) => {
1325                                    let value = map.next_value::<serde_json::Value>()?;
1326                                    result._unknown_fields.insert(key, value);
1327                                }
1328                            }
1329                        }
1330                        std::result::Result::Ok(result)
1331                    }
1332                }
1333                deserializer.deserialize_any(Visitor)
1334            }
1335        }
1336
1337        #[doc(hidden)]
1338        impl serde::ser::Serialize for Remote {
1339            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1340            where
1341                S: serde::ser::Serializer,
1342            {
1343                use serde::ser::SerializeMap;
1344                #[allow(unused_imports)]
1345                use std::option::Option::Some;
1346                let mut state = serializer.serialize_map(std::option::Option::None)?;
1347                if !self._unknown_fields.is_empty() {
1348                    for (key, value) in self._unknown_fields.iter() {
1349                        state.serialize_entry(key, &value)?;
1350                    }
1351                }
1352                state.end()
1353            }
1354        }
1355
1356        /// Configuration specific to clusters with a control plane hosted locally.
1357        ///
1358        /// Warning: Local control plane clusters must be created in their own
1359        /// project. Local control plane clusters cannot coexist in the same
1360        /// project with any other type of clusters, including non-GDCE clusters.
1361        /// Mixing local control plane GDCE clusters with any other type of
1362        /// clusters in the same project can result in data loss.
1363        #[derive(Clone, Debug, Default, PartialEq)]
1364        #[non_exhaustive]
1365        pub struct Local {
1366            /// Name of the Google Distributed Cloud Edge zones where this node pool
1367            /// will be created. For example: `us-central1-edge-customer-a`.
1368            pub node_location: std::string::String,
1369
1370            /// The number of nodes to serve as replicas of the Control Plane.
1371            pub node_count: i32,
1372
1373            /// Only machines matching this filter will be allowed to host control
1374            /// plane nodes. The filtering language accepts strings like "name=\<name\>",
1375            /// and is documented here: [AIP-160](https://google.aip.dev/160).
1376            pub machine_filter: std::string::String,
1377
1378            /// Policy configuration about how user applications are deployed.
1379            pub shared_deployment_policy:
1380                crate::model::cluster::control_plane::SharedDeploymentPolicy,
1381
1382            /// Optional. Name for the storage schema of control plane nodes.
1383            ///
1384            /// Warning: Configurable node local storage schema feature is an
1385            /// experimental feature, and is not recommended for general use
1386            /// in production clusters/nodepools.
1387            pub control_plane_node_storage_schema: std::string::String,
1388
1389            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1390        }
1391
1392        impl Local {
1393            pub fn new() -> Self {
1394                std::default::Default::default()
1395            }
1396
1397            /// Sets the value of [node_location][crate::model::cluster::control_plane::Local::node_location].
1398            pub fn set_node_location<T: std::convert::Into<std::string::String>>(
1399                mut self,
1400                v: T,
1401            ) -> Self {
1402                self.node_location = v.into();
1403                self
1404            }
1405
1406            /// Sets the value of [node_count][crate::model::cluster::control_plane::Local::node_count].
1407            pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1408                self.node_count = v.into();
1409                self
1410            }
1411
1412            /// Sets the value of [machine_filter][crate::model::cluster::control_plane::Local::machine_filter].
1413            pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(
1414                mut self,
1415                v: T,
1416            ) -> Self {
1417                self.machine_filter = v.into();
1418                self
1419            }
1420
1421            /// Sets the value of [shared_deployment_policy][crate::model::cluster::control_plane::Local::shared_deployment_policy].
1422            pub fn set_shared_deployment_policy<
1423                T: std::convert::Into<crate::model::cluster::control_plane::SharedDeploymentPolicy>,
1424            >(
1425                mut self,
1426                v: T,
1427            ) -> Self {
1428                self.shared_deployment_policy = v.into();
1429                self
1430            }
1431
1432            /// Sets the value of [control_plane_node_storage_schema][crate::model::cluster::control_plane::Local::control_plane_node_storage_schema].
1433            pub fn set_control_plane_node_storage_schema<
1434                T: std::convert::Into<std::string::String>,
1435            >(
1436                mut self,
1437                v: T,
1438            ) -> Self {
1439                self.control_plane_node_storage_schema = v.into();
1440                self
1441            }
1442        }
1443
1444        impl wkt::message::Message for Local {
1445            fn typename() -> &'static str {
1446                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Local"
1447            }
1448        }
1449
1450        #[doc(hidden)]
1451        impl<'de> serde::de::Deserialize<'de> for Local {
1452            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1453            where
1454                D: serde::Deserializer<'de>,
1455            {
1456                #[allow(non_camel_case_types)]
1457                #[doc(hidden)]
1458                #[derive(PartialEq, Eq, Hash)]
1459                enum __FieldTag {
1460                    __node_location,
1461                    __node_count,
1462                    __machine_filter,
1463                    __shared_deployment_policy,
1464                    __control_plane_node_storage_schema,
1465                    Unknown(std::string::String),
1466                }
1467                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1468                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1469                    where
1470                        D: serde::Deserializer<'de>,
1471                    {
1472                        struct Visitor;
1473                        impl<'de> serde::de::Visitor<'de> for Visitor {
1474                            type Value = __FieldTag;
1475                            fn expecting(
1476                                &self,
1477                                formatter: &mut std::fmt::Formatter,
1478                            ) -> std::fmt::Result {
1479                                formatter.write_str("a field name for Local")
1480                            }
1481                            fn visit_str<E>(
1482                                self,
1483                                value: &str,
1484                            ) -> std::result::Result<Self::Value, E>
1485                            where
1486                                E: serde::de::Error,
1487                            {
1488                                use std::result::Result::Ok;
1489                                use std::string::ToString;
1490                                match value {
1491                                    "nodeLocation" => Ok(__FieldTag::__node_location),
1492                                    "node_location" => Ok(__FieldTag::__node_location),
1493                                    "nodeCount" => Ok(__FieldTag::__node_count),
1494                                    "node_count" => Ok(__FieldTag::__node_count),
1495                                    "machineFilter" => Ok(__FieldTag::__machine_filter),
1496                                    "machine_filter" => Ok(__FieldTag::__machine_filter),
1497                                    "sharedDeploymentPolicy" => {
1498                                        Ok(__FieldTag::__shared_deployment_policy)
1499                                    }
1500                                    "shared_deployment_policy" => {
1501                                        Ok(__FieldTag::__shared_deployment_policy)
1502                                    }
1503                                    "controlPlaneNodeStorageSchema" => {
1504                                        Ok(__FieldTag::__control_plane_node_storage_schema)
1505                                    }
1506                                    "control_plane_node_storage_schema" => {
1507                                        Ok(__FieldTag::__control_plane_node_storage_schema)
1508                                    }
1509                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
1510                                }
1511                            }
1512                        }
1513                        deserializer.deserialize_identifier(Visitor)
1514                    }
1515                }
1516                struct Visitor;
1517                impl<'de> serde::de::Visitor<'de> for Visitor {
1518                    type Value = Local;
1519                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1520                        formatter.write_str("struct Local")
1521                    }
1522                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1523                    where
1524                        A: serde::de::MapAccess<'de>,
1525                    {
1526                        #[allow(unused_imports)]
1527                        use serde::de::Error;
1528                        use std::option::Option::Some;
1529                        let mut fields = std::collections::HashSet::new();
1530                        let mut result = Self::Value::new();
1531                        while let Some(tag) = map.next_key::<__FieldTag>()? {
1532                            #[allow(clippy::match_single_binding)]
1533                            match tag {
1534                                __FieldTag::__node_location => {
1535                                    if !fields.insert(__FieldTag::__node_location) {
1536                                        return std::result::Result::Err(
1537                                            A::Error::duplicate_field(
1538                                                "multiple values for node_location",
1539                                            ),
1540                                        );
1541                                    }
1542                                    result.node_location = map
1543                                        .next_value::<std::option::Option<std::string::String>>()?
1544                                        .unwrap_or_default();
1545                                }
1546                                __FieldTag::__node_count => {
1547                                    if !fields.insert(__FieldTag::__node_count) {
1548                                        return std::result::Result::Err(
1549                                            A::Error::duplicate_field(
1550                                                "multiple values for node_count",
1551                                            ),
1552                                        );
1553                                    }
1554                                    struct __With(std::option::Option<i32>);
1555                                    impl<'de> serde::de::Deserialize<'de> for __With {
1556                                        fn deserialize<D>(
1557                                            deserializer: D,
1558                                        ) -> std::result::Result<Self, D::Error>
1559                                        where
1560                                            D: serde::de::Deserializer<'de>,
1561                                        {
1562                                            serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1563                                        }
1564                                    }
1565                                    result.node_count =
1566                                        map.next_value::<__With>()?.0.unwrap_or_default();
1567                                }
1568                                __FieldTag::__machine_filter => {
1569                                    if !fields.insert(__FieldTag::__machine_filter) {
1570                                        return std::result::Result::Err(
1571                                            A::Error::duplicate_field(
1572                                                "multiple values for machine_filter",
1573                                            ),
1574                                        );
1575                                    }
1576                                    result.machine_filter = map
1577                                        .next_value::<std::option::Option<std::string::String>>()?
1578                                        .unwrap_or_default();
1579                                }
1580                                __FieldTag::__shared_deployment_policy => {
1581                                    if !fields.insert(__FieldTag::__shared_deployment_policy) {
1582                                        return std::result::Result::Err(
1583                                            A::Error::duplicate_field(
1584                                                "multiple values for shared_deployment_policy",
1585                                            ),
1586                                        );
1587                                    }
1588                                    result.shared_deployment_policy = map.next_value::<std::option::Option<crate::model::cluster::control_plane::SharedDeploymentPolicy>>()?.unwrap_or_default();
1589                                }
1590                                __FieldTag::__control_plane_node_storage_schema => {
1591                                    if !fields
1592                                        .insert(__FieldTag::__control_plane_node_storage_schema)
1593                                    {
1594                                        return std::result::Result::Err(
1595                                            A::Error::duplicate_field(
1596                                                "multiple values for control_plane_node_storage_schema",
1597                                            ),
1598                                        );
1599                                    }
1600                                    result.control_plane_node_storage_schema = map
1601                                        .next_value::<std::option::Option<std::string::String>>()?
1602                                        .unwrap_or_default();
1603                                }
1604                                __FieldTag::Unknown(key) => {
1605                                    let value = map.next_value::<serde_json::Value>()?;
1606                                    result._unknown_fields.insert(key, value);
1607                                }
1608                            }
1609                        }
1610                        std::result::Result::Ok(result)
1611                    }
1612                }
1613                deserializer.deserialize_any(Visitor)
1614            }
1615        }
1616
1617        #[doc(hidden)]
1618        impl serde::ser::Serialize for Local {
1619            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1620            where
1621                S: serde::ser::Serializer,
1622            {
1623                use serde::ser::SerializeMap;
1624                #[allow(unused_imports)]
1625                use std::option::Option::Some;
1626                let mut state = serializer.serialize_map(std::option::Option::None)?;
1627                if !self.node_location.is_empty() {
1628                    state.serialize_entry("nodeLocation", &self.node_location)?;
1629                }
1630                if !wkt::internal::is_default(&self.node_count) {
1631                    struct __With<'a>(&'a i32);
1632                    impl<'a> serde::ser::Serialize for __With<'a> {
1633                        fn serialize<S>(
1634                            &self,
1635                            serializer: S,
1636                        ) -> std::result::Result<S::Ok, S::Error>
1637                        where
1638                            S: serde::ser::Serializer,
1639                        {
1640                            serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1641                        }
1642                    }
1643                    state.serialize_entry("nodeCount", &__With(&self.node_count))?;
1644                }
1645                if !self.machine_filter.is_empty() {
1646                    state.serialize_entry("machineFilter", &self.machine_filter)?;
1647                }
1648                if !wkt::internal::is_default(&self.shared_deployment_policy) {
1649                    state.serialize_entry(
1650                        "sharedDeploymentPolicy",
1651                        &self.shared_deployment_policy,
1652                    )?;
1653                }
1654                if !self.control_plane_node_storage_schema.is_empty() {
1655                    state.serialize_entry(
1656                        "controlPlaneNodeStorageSchema",
1657                        &self.control_plane_node_storage_schema,
1658                    )?;
1659                }
1660                if !self._unknown_fields.is_empty() {
1661                    for (key, value) in self._unknown_fields.iter() {
1662                        state.serialize_entry(key, &value)?;
1663                    }
1664                }
1665                state.end()
1666            }
1667        }
1668
1669        /// Represents the policy configuration about how user applications are
1670        /// deployed.
1671        ///
1672        /// # Working with unknown values
1673        ///
1674        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1675        /// additional enum variants at any time. Adding new variants is not considered
1676        /// a breaking change. Applications should write their code in anticipation of:
1677        ///
1678        /// - New values appearing in future releases of the client library, **and**
1679        /// - New values received dynamically, without application changes.
1680        ///
1681        /// Please consult the [Working with enums] section in the user guide for some
1682        /// guidelines.
1683        ///
1684        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1685        #[derive(Clone, Debug, PartialEq)]
1686        #[non_exhaustive]
1687        pub enum SharedDeploymentPolicy {
1688            /// Unspecified.
1689            Unspecified,
1690            /// User applications can be deployed both on control plane and worker
1691            /// nodes.
1692            Allowed,
1693            /// User applications can not be deployed on control plane nodes and can
1694            /// only be deployed on worker nodes.
1695            Disallowed,
1696            /// If set, the enum was initialized with an unknown value.
1697            ///
1698            /// Applications can examine the value using [SharedDeploymentPolicy::value] or
1699            /// [SharedDeploymentPolicy::name].
1700            UnknownValue(shared_deployment_policy::UnknownValue),
1701        }
1702
1703        #[doc(hidden)]
1704        pub mod shared_deployment_policy {
1705            #[allow(unused_imports)]
1706            use super::*;
1707            #[derive(Clone, Debug, PartialEq)]
1708            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1709        }
1710
1711        impl SharedDeploymentPolicy {
1712            /// Gets the enum value.
1713            ///
1714            /// Returns `None` if the enum contains an unknown value deserialized from
1715            /// the string representation of enums.
1716            pub fn value(&self) -> std::option::Option<i32> {
1717                match self {
1718                    Self::Unspecified => std::option::Option::Some(0),
1719                    Self::Allowed => std::option::Option::Some(1),
1720                    Self::Disallowed => std::option::Option::Some(2),
1721                    Self::UnknownValue(u) => u.0.value(),
1722                }
1723            }
1724
1725            /// Gets the enum value as a string.
1726            ///
1727            /// Returns `None` if the enum contains an unknown value deserialized from
1728            /// the integer representation of enums.
1729            pub fn name(&self) -> std::option::Option<&str> {
1730                match self {
1731                    Self::Unspecified => {
1732                        std::option::Option::Some("SHARED_DEPLOYMENT_POLICY_UNSPECIFIED")
1733                    }
1734                    Self::Allowed => std::option::Option::Some("ALLOWED"),
1735                    Self::Disallowed => std::option::Option::Some("DISALLOWED"),
1736                    Self::UnknownValue(u) => u.0.name(),
1737                }
1738            }
1739        }
1740
1741        impl std::default::Default for SharedDeploymentPolicy {
1742            fn default() -> Self {
1743                use std::convert::From;
1744                Self::from(0)
1745            }
1746        }
1747
1748        impl std::fmt::Display for SharedDeploymentPolicy {
1749            fn fmt(
1750                &self,
1751                f: &mut std::fmt::Formatter<'_>,
1752            ) -> std::result::Result<(), std::fmt::Error> {
1753                wkt::internal::display_enum(f, self.name(), self.value())
1754            }
1755        }
1756
1757        impl std::convert::From<i32> for SharedDeploymentPolicy {
1758            fn from(value: i32) -> Self {
1759                match value {
1760                    0 => Self::Unspecified,
1761                    1 => Self::Allowed,
1762                    2 => Self::Disallowed,
1763                    _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
1764                        wkt::internal::UnknownEnumValue::Integer(value),
1765                    )),
1766                }
1767            }
1768        }
1769
1770        impl std::convert::From<&str> for SharedDeploymentPolicy {
1771            fn from(value: &str) -> Self {
1772                use std::string::ToString;
1773                match value {
1774                    "SHARED_DEPLOYMENT_POLICY_UNSPECIFIED" => Self::Unspecified,
1775                    "ALLOWED" => Self::Allowed,
1776                    "DISALLOWED" => Self::Disallowed,
1777                    _ => Self::UnknownValue(shared_deployment_policy::UnknownValue(
1778                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1779                    )),
1780                }
1781            }
1782        }
1783
1784        impl serde::ser::Serialize for SharedDeploymentPolicy {
1785            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1786            where
1787                S: serde::Serializer,
1788            {
1789                match self {
1790                    Self::Unspecified => serializer.serialize_i32(0),
1791                    Self::Allowed => serializer.serialize_i32(1),
1792                    Self::Disallowed => serializer.serialize_i32(2),
1793                    Self::UnknownValue(u) => u.0.serialize(serializer),
1794                }
1795            }
1796        }
1797
1798        impl<'de> serde::de::Deserialize<'de> for SharedDeploymentPolicy {
1799            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1800            where
1801                D: serde::Deserializer<'de>,
1802            {
1803                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedDeploymentPolicy>::new(
1804                    ".google.cloud.edgecontainer.v1.Cluster.ControlPlane.SharedDeploymentPolicy"))
1805            }
1806        }
1807
1808        #[derive(Clone, Debug, PartialEq)]
1809        #[non_exhaustive]
1810        pub enum Config {
1811            /// Remote control plane configuration.
1812            Remote(std::boxed::Box<crate::model::cluster::control_plane::Remote>),
1813            /// Local control plane configuration.
1814            ///
1815            /// Warning: Local control plane clusters must be created in their own
1816            /// project. Local control plane clusters cannot coexist in the same
1817            /// project with any other type of clusters, including non-GDCE clusters.
1818            /// Mixing local control plane GDCE clusters with any other type of
1819            /// clusters in the same project can result in data loss.
1820            Local(std::boxed::Box<crate::model::cluster::control_plane::Local>),
1821        }
1822    }
1823
1824    /// Config that customers are allowed to define for GDCE system add-ons.
1825    #[derive(Clone, Debug, Default, PartialEq)]
1826    #[non_exhaustive]
1827    pub struct SystemAddonsConfig {
1828        /// Optional. Config for Ingress.
1829        pub ingress: std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
1830
1831        /// Optional. Config for VM Service.
1832        pub vm_service_config:
1833            std::option::Option<crate::model::cluster::system_addons_config::VMServiceConfig>,
1834
1835        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1836    }
1837
1838    impl SystemAddonsConfig {
1839        pub fn new() -> Self {
1840            std::default::Default::default()
1841        }
1842
1843        /// Sets the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
1844        pub fn set_ingress<T>(mut self, v: T) -> Self
1845        where
1846            T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
1847        {
1848            self.ingress = std::option::Option::Some(v.into());
1849            self
1850        }
1851
1852        /// Sets or clears the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
1853        pub fn set_or_clear_ingress<T>(mut self, v: std::option::Option<T>) -> Self
1854        where
1855            T: std::convert::Into<crate::model::cluster::system_addons_config::Ingress>,
1856        {
1857            self.ingress = v.map(|x| x.into());
1858            self
1859        }
1860
1861        /// Sets the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
1862        pub fn set_vm_service_config<T>(mut self, v: T) -> Self
1863        where
1864            T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
1865        {
1866            self.vm_service_config = std::option::Option::Some(v.into());
1867            self
1868        }
1869
1870        /// Sets or clears the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
1871        pub fn set_or_clear_vm_service_config<T>(mut self, v: std::option::Option<T>) -> Self
1872        where
1873            T: std::convert::Into<crate::model::cluster::system_addons_config::VMServiceConfig>,
1874        {
1875            self.vm_service_config = v.map(|x| x.into());
1876            self
1877        }
1878    }
1879
1880    impl wkt::message::Message for SystemAddonsConfig {
1881        fn typename() -> &'static str {
1882            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig"
1883        }
1884    }
1885
1886    #[doc(hidden)]
1887    impl<'de> serde::de::Deserialize<'de> for SystemAddonsConfig {
1888        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1889        where
1890            D: serde::Deserializer<'de>,
1891        {
1892            #[allow(non_camel_case_types)]
1893            #[doc(hidden)]
1894            #[derive(PartialEq, Eq, Hash)]
1895            enum __FieldTag {
1896                __ingress,
1897                __vm_service_config,
1898                Unknown(std::string::String),
1899            }
1900            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1901                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1902                where
1903                    D: serde::Deserializer<'de>,
1904                {
1905                    struct Visitor;
1906                    impl<'de> serde::de::Visitor<'de> for Visitor {
1907                        type Value = __FieldTag;
1908                        fn expecting(
1909                            &self,
1910                            formatter: &mut std::fmt::Formatter,
1911                        ) -> std::fmt::Result {
1912                            formatter.write_str("a field name for SystemAddonsConfig")
1913                        }
1914                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1915                        where
1916                            E: serde::de::Error,
1917                        {
1918                            use std::result::Result::Ok;
1919                            use std::string::ToString;
1920                            match value {
1921                                "ingress" => Ok(__FieldTag::__ingress),
1922                                "vmServiceConfig" => Ok(__FieldTag::__vm_service_config),
1923                                "vm_service_config" => Ok(__FieldTag::__vm_service_config),
1924                                _ => Ok(__FieldTag::Unknown(value.to_string())),
1925                            }
1926                        }
1927                    }
1928                    deserializer.deserialize_identifier(Visitor)
1929                }
1930            }
1931            struct Visitor;
1932            impl<'de> serde::de::Visitor<'de> for Visitor {
1933                type Value = SystemAddonsConfig;
1934                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1935                    formatter.write_str("struct SystemAddonsConfig")
1936                }
1937                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1938                where
1939                    A: serde::de::MapAccess<'de>,
1940                {
1941                    #[allow(unused_imports)]
1942                    use serde::de::Error;
1943                    use std::option::Option::Some;
1944                    let mut fields = std::collections::HashSet::new();
1945                    let mut result = Self::Value::new();
1946                    while let Some(tag) = map.next_key::<__FieldTag>()? {
1947                        #[allow(clippy::match_single_binding)]
1948                        match tag {
1949                            __FieldTag::__ingress => {
1950                                if !fields.insert(__FieldTag::__ingress) {
1951                                    return std::result::Result::Err(A::Error::duplicate_field(
1952                                        "multiple values for ingress",
1953                                    ));
1954                                }
1955                                result.ingress = map.next_value::<std::option::Option<
1956                                    crate::model::cluster::system_addons_config::Ingress,
1957                                >>()?;
1958                            }
1959                            __FieldTag::__vm_service_config => {
1960                                if !fields.insert(__FieldTag::__vm_service_config) {
1961                                    return std::result::Result::Err(A::Error::duplicate_field(
1962                                        "multiple values for vm_service_config",
1963                                    ));
1964                                }
1965                                result.vm_service_config = map.next_value::<std::option::Option<
1966                                    crate::model::cluster::system_addons_config::VMServiceConfig,
1967                                >>(
1968                                )?;
1969                            }
1970                            __FieldTag::Unknown(key) => {
1971                                let value = map.next_value::<serde_json::Value>()?;
1972                                result._unknown_fields.insert(key, value);
1973                            }
1974                        }
1975                    }
1976                    std::result::Result::Ok(result)
1977                }
1978            }
1979            deserializer.deserialize_any(Visitor)
1980        }
1981    }
1982
1983    #[doc(hidden)]
1984    impl serde::ser::Serialize for SystemAddonsConfig {
1985        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1986        where
1987            S: serde::ser::Serializer,
1988        {
1989            use serde::ser::SerializeMap;
1990            #[allow(unused_imports)]
1991            use std::option::Option::Some;
1992            let mut state = serializer.serialize_map(std::option::Option::None)?;
1993            if self.ingress.is_some() {
1994                state.serialize_entry("ingress", &self.ingress)?;
1995            }
1996            if self.vm_service_config.is_some() {
1997                state.serialize_entry("vmServiceConfig", &self.vm_service_config)?;
1998            }
1999            if !self._unknown_fields.is_empty() {
2000                for (key, value) in self._unknown_fields.iter() {
2001                    state.serialize_entry(key, &value)?;
2002                }
2003            }
2004            state.end()
2005        }
2006    }
2007
2008    /// Defines additional types related to [SystemAddonsConfig].
2009    pub mod system_addons_config {
2010        #[allow(unused_imports)]
2011        use super::*;
2012
2013        /// Config for the Ingress add-on which allows customers to create an Ingress
2014        /// object to manage external access to the servers in a cluster. The add-on
2015        /// consists of istiod and istio-ingress.
2016        #[derive(Clone, Debug, Default, PartialEq)]
2017        #[non_exhaustive]
2018        pub struct Ingress {
2019            /// Optional. Whether Ingress is disabled.
2020            pub disabled: bool,
2021
2022            /// Optional. Ingress VIP.
2023            pub ipv4_vip: std::string::String,
2024
2025            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2026        }
2027
2028        impl Ingress {
2029            pub fn new() -> Self {
2030                std::default::Default::default()
2031            }
2032
2033            /// Sets the value of [disabled][crate::model::cluster::system_addons_config::Ingress::disabled].
2034            pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2035                self.disabled = v.into();
2036                self
2037            }
2038
2039            /// Sets the value of [ipv4_vip][crate::model::cluster::system_addons_config::Ingress::ipv4_vip].
2040            pub fn set_ipv4_vip<T: std::convert::Into<std::string::String>>(
2041                mut self,
2042                v: T,
2043            ) -> Self {
2044                self.ipv4_vip = v.into();
2045                self
2046            }
2047        }
2048
2049        impl wkt::message::Message for Ingress {
2050            fn typename() -> &'static str {
2051                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.Ingress"
2052            }
2053        }
2054
2055        #[doc(hidden)]
2056        impl<'de> serde::de::Deserialize<'de> for Ingress {
2057            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2058            where
2059                D: serde::Deserializer<'de>,
2060            {
2061                #[allow(non_camel_case_types)]
2062                #[doc(hidden)]
2063                #[derive(PartialEq, Eq, Hash)]
2064                enum __FieldTag {
2065                    __disabled,
2066                    __ipv4_vip,
2067                    Unknown(std::string::String),
2068                }
2069                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2070                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2071                    where
2072                        D: serde::Deserializer<'de>,
2073                    {
2074                        struct Visitor;
2075                        impl<'de> serde::de::Visitor<'de> for Visitor {
2076                            type Value = __FieldTag;
2077                            fn expecting(
2078                                &self,
2079                                formatter: &mut std::fmt::Formatter,
2080                            ) -> std::fmt::Result {
2081                                formatter.write_str("a field name for Ingress")
2082                            }
2083                            fn visit_str<E>(
2084                                self,
2085                                value: &str,
2086                            ) -> std::result::Result<Self::Value, E>
2087                            where
2088                                E: serde::de::Error,
2089                            {
2090                                use std::result::Result::Ok;
2091                                use std::string::ToString;
2092                                match value {
2093                                    "disabled" => Ok(__FieldTag::__disabled),
2094                                    "ipv4Vip" => Ok(__FieldTag::__ipv4_vip),
2095                                    "ipv4_vip" => Ok(__FieldTag::__ipv4_vip),
2096                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
2097                                }
2098                            }
2099                        }
2100                        deserializer.deserialize_identifier(Visitor)
2101                    }
2102                }
2103                struct Visitor;
2104                impl<'de> serde::de::Visitor<'de> for Visitor {
2105                    type Value = Ingress;
2106                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2107                        formatter.write_str("struct Ingress")
2108                    }
2109                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2110                    where
2111                        A: serde::de::MapAccess<'de>,
2112                    {
2113                        #[allow(unused_imports)]
2114                        use serde::de::Error;
2115                        use std::option::Option::Some;
2116                        let mut fields = std::collections::HashSet::new();
2117                        let mut result = Self::Value::new();
2118                        while let Some(tag) = map.next_key::<__FieldTag>()? {
2119                            #[allow(clippy::match_single_binding)]
2120                            match tag {
2121                                __FieldTag::__disabled => {
2122                                    if !fields.insert(__FieldTag::__disabled) {
2123                                        return std::result::Result::Err(
2124                                            A::Error::duplicate_field(
2125                                                "multiple values for disabled",
2126                                            ),
2127                                        );
2128                                    }
2129                                    result.disabled = map
2130                                        .next_value::<std::option::Option<bool>>()?
2131                                        .unwrap_or_default();
2132                                }
2133                                __FieldTag::__ipv4_vip => {
2134                                    if !fields.insert(__FieldTag::__ipv4_vip) {
2135                                        return std::result::Result::Err(
2136                                            A::Error::duplicate_field(
2137                                                "multiple values for ipv4_vip",
2138                                            ),
2139                                        );
2140                                    }
2141                                    result.ipv4_vip = map
2142                                        .next_value::<std::option::Option<std::string::String>>()?
2143                                        .unwrap_or_default();
2144                                }
2145                                __FieldTag::Unknown(key) => {
2146                                    let value = map.next_value::<serde_json::Value>()?;
2147                                    result._unknown_fields.insert(key, value);
2148                                }
2149                            }
2150                        }
2151                        std::result::Result::Ok(result)
2152                    }
2153                }
2154                deserializer.deserialize_any(Visitor)
2155            }
2156        }
2157
2158        #[doc(hidden)]
2159        impl serde::ser::Serialize for Ingress {
2160            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2161            where
2162                S: serde::ser::Serializer,
2163            {
2164                use serde::ser::SerializeMap;
2165                #[allow(unused_imports)]
2166                use std::option::Option::Some;
2167                let mut state = serializer.serialize_map(std::option::Option::None)?;
2168                if !wkt::internal::is_default(&self.disabled) {
2169                    state.serialize_entry("disabled", &self.disabled)?;
2170                }
2171                if !self.ipv4_vip.is_empty() {
2172                    state.serialize_entry("ipv4Vip", &self.ipv4_vip)?;
2173                }
2174                if !self._unknown_fields.is_empty() {
2175                    for (key, value) in self._unknown_fields.iter() {
2176                        state.serialize_entry(key, &value)?;
2177                    }
2178                }
2179                state.end()
2180            }
2181        }
2182
2183        /// VMServiceConfig defines the configuration for GDCE VM Service.
2184        #[derive(Clone, Debug, Default, PartialEq)]
2185        #[non_exhaustive]
2186        pub struct VMServiceConfig {
2187            /// Optional. Whether VMM is enabled.
2188            pub vmm_enabled: bool,
2189
2190            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2191        }
2192
2193        impl VMServiceConfig {
2194            pub fn new() -> Self {
2195                std::default::Default::default()
2196            }
2197
2198            /// Sets the value of [vmm_enabled][crate::model::cluster::system_addons_config::VMServiceConfig::vmm_enabled].
2199            pub fn set_vmm_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2200                self.vmm_enabled = v.into();
2201                self
2202            }
2203        }
2204
2205        impl wkt::message::Message for VMServiceConfig {
2206            fn typename() -> &'static str {
2207                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.VMServiceConfig"
2208            }
2209        }
2210
2211        #[doc(hidden)]
2212        impl<'de> serde::de::Deserialize<'de> for VMServiceConfig {
2213            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2214            where
2215                D: serde::Deserializer<'de>,
2216            {
2217                #[allow(non_camel_case_types)]
2218                #[doc(hidden)]
2219                #[derive(PartialEq, Eq, Hash)]
2220                enum __FieldTag {
2221                    __vmm_enabled,
2222                    Unknown(std::string::String),
2223                }
2224                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2225                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2226                    where
2227                        D: serde::Deserializer<'de>,
2228                    {
2229                        struct Visitor;
2230                        impl<'de> serde::de::Visitor<'de> for Visitor {
2231                            type Value = __FieldTag;
2232                            fn expecting(
2233                                &self,
2234                                formatter: &mut std::fmt::Formatter,
2235                            ) -> std::fmt::Result {
2236                                formatter.write_str("a field name for VMServiceConfig")
2237                            }
2238                            fn visit_str<E>(
2239                                self,
2240                                value: &str,
2241                            ) -> std::result::Result<Self::Value, E>
2242                            where
2243                                E: serde::de::Error,
2244                            {
2245                                use std::result::Result::Ok;
2246                                use std::string::ToString;
2247                                match value {
2248                                    "vmmEnabled" => Ok(__FieldTag::__vmm_enabled),
2249                                    "vmm_enabled" => Ok(__FieldTag::__vmm_enabled),
2250                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
2251                                }
2252                            }
2253                        }
2254                        deserializer.deserialize_identifier(Visitor)
2255                    }
2256                }
2257                struct Visitor;
2258                impl<'de> serde::de::Visitor<'de> for Visitor {
2259                    type Value = VMServiceConfig;
2260                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2261                        formatter.write_str("struct VMServiceConfig")
2262                    }
2263                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2264                    where
2265                        A: serde::de::MapAccess<'de>,
2266                    {
2267                        #[allow(unused_imports)]
2268                        use serde::de::Error;
2269                        use std::option::Option::Some;
2270                        let mut fields = std::collections::HashSet::new();
2271                        let mut result = Self::Value::new();
2272                        while let Some(tag) = map.next_key::<__FieldTag>()? {
2273                            #[allow(clippy::match_single_binding)]
2274                            match tag {
2275                                __FieldTag::__vmm_enabled => {
2276                                    if !fields.insert(__FieldTag::__vmm_enabled) {
2277                                        return std::result::Result::Err(
2278                                            A::Error::duplicate_field(
2279                                                "multiple values for vmm_enabled",
2280                                            ),
2281                                        );
2282                                    }
2283                                    result.vmm_enabled = map
2284                                        .next_value::<std::option::Option<bool>>()?
2285                                        .unwrap_or_default();
2286                                }
2287                                __FieldTag::Unknown(key) => {
2288                                    let value = map.next_value::<serde_json::Value>()?;
2289                                    result._unknown_fields.insert(key, value);
2290                                }
2291                            }
2292                        }
2293                        std::result::Result::Ok(result)
2294                    }
2295                }
2296                deserializer.deserialize_any(Visitor)
2297            }
2298        }
2299
2300        #[doc(hidden)]
2301        impl serde::ser::Serialize for VMServiceConfig {
2302            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2303            where
2304                S: serde::ser::Serializer,
2305            {
2306                use serde::ser::SerializeMap;
2307                #[allow(unused_imports)]
2308                use std::option::Option::Some;
2309                let mut state = serializer.serialize_map(std::option::Option::None)?;
2310                if !wkt::internal::is_default(&self.vmm_enabled) {
2311                    state.serialize_entry("vmmEnabled", &self.vmm_enabled)?;
2312                }
2313                if !self._unknown_fields.is_empty() {
2314                    for (key, value) in self._unknown_fields.iter() {
2315                        state.serialize_entry(key, &value)?;
2316                    }
2317                }
2318                state.end()
2319            }
2320        }
2321    }
2322
2323    /// Configuration for Customer-managed KMS key support for control plane nodes.
2324    #[derive(Clone, Debug, Default, PartialEq)]
2325    #[non_exhaustive]
2326    pub struct ControlPlaneEncryption {
2327        /// Optional. The Cloud KMS CryptoKey e.g.
2328        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
2329        /// to use for protecting control plane disks. If not specified, a
2330        /// Google-managed key will be used instead.
2331        pub kms_key: std::string::String,
2332
2333        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
2334        /// protecting control plane disks. Only applicable if kms_key is set.
2335        pub kms_key_active_version: std::string::String,
2336
2337        /// Output only. Availability of the Cloud KMS CryptoKey. If not
2338        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
2339        /// local data. This can be caused by a lack of permissions to use the key,
2340        /// or if the key is disabled or deleted.
2341        pub kms_key_state: crate::model::KmsKeyState,
2342
2343        /// Output only. Error status returned by Cloud KMS when using this key. This
2344        /// field may be populated only if `kms_key_state` is not
2345        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
2346        /// error status reported by Cloud KMS.
2347        pub kms_status: std::option::Option<rpc::model::Status>,
2348
2349        /// Output only. The current resource state associated with the cmek.
2350        pub resource_state: crate::model::ResourceState,
2351
2352        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2353    }
2354
2355    impl ControlPlaneEncryption {
2356        pub fn new() -> Self {
2357            std::default::Default::default()
2358        }
2359
2360        /// Sets the value of [kms_key][crate::model::cluster::ControlPlaneEncryption::kms_key].
2361        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2362            self.kms_key = v.into();
2363            self
2364        }
2365
2366        /// Sets the value of [kms_key_active_version][crate::model::cluster::ControlPlaneEncryption::kms_key_active_version].
2367        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
2368            mut self,
2369            v: T,
2370        ) -> Self {
2371            self.kms_key_active_version = v.into();
2372            self
2373        }
2374
2375        /// Sets the value of [kms_key_state][crate::model::cluster::ControlPlaneEncryption::kms_key_state].
2376        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
2377            mut self,
2378            v: T,
2379        ) -> Self {
2380            self.kms_key_state = v.into();
2381            self
2382        }
2383
2384        /// Sets the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
2385        pub fn set_kms_status<T>(mut self, v: T) -> Self
2386        where
2387            T: std::convert::Into<rpc::model::Status>,
2388        {
2389            self.kms_status = std::option::Option::Some(v.into());
2390            self
2391        }
2392
2393        /// Sets or clears the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
2394        pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
2395        where
2396            T: std::convert::Into<rpc::model::Status>,
2397        {
2398            self.kms_status = v.map(|x| x.into());
2399            self
2400        }
2401
2402        /// Sets the value of [resource_state][crate::model::cluster::ControlPlaneEncryption::resource_state].
2403        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
2404            mut self,
2405            v: T,
2406        ) -> Self {
2407            self.resource_state = v.into();
2408            self
2409        }
2410    }
2411
2412    impl wkt::message::Message for ControlPlaneEncryption {
2413        fn typename() -> &'static str {
2414            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlaneEncryption"
2415        }
2416    }
2417
2418    #[doc(hidden)]
2419    impl<'de> serde::de::Deserialize<'de> for ControlPlaneEncryption {
2420        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2421        where
2422            D: serde::Deserializer<'de>,
2423        {
2424            #[allow(non_camel_case_types)]
2425            #[doc(hidden)]
2426            #[derive(PartialEq, Eq, Hash)]
2427            enum __FieldTag {
2428                __kms_key,
2429                __kms_key_active_version,
2430                __kms_key_state,
2431                __kms_status,
2432                __resource_state,
2433                Unknown(std::string::String),
2434            }
2435            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2436                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2437                where
2438                    D: serde::Deserializer<'de>,
2439                {
2440                    struct Visitor;
2441                    impl<'de> serde::de::Visitor<'de> for Visitor {
2442                        type Value = __FieldTag;
2443                        fn expecting(
2444                            &self,
2445                            formatter: &mut std::fmt::Formatter,
2446                        ) -> std::fmt::Result {
2447                            formatter.write_str("a field name for ControlPlaneEncryption")
2448                        }
2449                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2450                        where
2451                            E: serde::de::Error,
2452                        {
2453                            use std::result::Result::Ok;
2454                            use std::string::ToString;
2455                            match value {
2456                                "kmsKey" => Ok(__FieldTag::__kms_key),
2457                                "kms_key" => Ok(__FieldTag::__kms_key),
2458                                "kmsKeyActiveVersion" => Ok(__FieldTag::__kms_key_active_version),
2459                                "kms_key_active_version" => {
2460                                    Ok(__FieldTag::__kms_key_active_version)
2461                                }
2462                                "kmsKeyState" => Ok(__FieldTag::__kms_key_state),
2463                                "kms_key_state" => Ok(__FieldTag::__kms_key_state),
2464                                "kmsStatus" => Ok(__FieldTag::__kms_status),
2465                                "kms_status" => Ok(__FieldTag::__kms_status),
2466                                "resourceState" => Ok(__FieldTag::__resource_state),
2467                                "resource_state" => Ok(__FieldTag::__resource_state),
2468                                _ => Ok(__FieldTag::Unknown(value.to_string())),
2469                            }
2470                        }
2471                    }
2472                    deserializer.deserialize_identifier(Visitor)
2473                }
2474            }
2475            struct Visitor;
2476            impl<'de> serde::de::Visitor<'de> for Visitor {
2477                type Value = ControlPlaneEncryption;
2478                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2479                    formatter.write_str("struct ControlPlaneEncryption")
2480                }
2481                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2482                where
2483                    A: serde::de::MapAccess<'de>,
2484                {
2485                    #[allow(unused_imports)]
2486                    use serde::de::Error;
2487                    use std::option::Option::Some;
2488                    let mut fields = std::collections::HashSet::new();
2489                    let mut result = Self::Value::new();
2490                    while let Some(tag) = map.next_key::<__FieldTag>()? {
2491                        #[allow(clippy::match_single_binding)]
2492                        match tag {
2493                            __FieldTag::__kms_key => {
2494                                if !fields.insert(__FieldTag::__kms_key) {
2495                                    return std::result::Result::Err(A::Error::duplicate_field(
2496                                        "multiple values for kms_key",
2497                                    ));
2498                                }
2499                                result.kms_key = map
2500                                    .next_value::<std::option::Option<std::string::String>>()?
2501                                    .unwrap_or_default();
2502                            }
2503                            __FieldTag::__kms_key_active_version => {
2504                                if !fields.insert(__FieldTag::__kms_key_active_version) {
2505                                    return std::result::Result::Err(A::Error::duplicate_field(
2506                                        "multiple values for kms_key_active_version",
2507                                    ));
2508                                }
2509                                result.kms_key_active_version = map
2510                                    .next_value::<std::option::Option<std::string::String>>()?
2511                                    .unwrap_or_default();
2512                            }
2513                            __FieldTag::__kms_key_state => {
2514                                if !fields.insert(__FieldTag::__kms_key_state) {
2515                                    return std::result::Result::Err(A::Error::duplicate_field(
2516                                        "multiple values for kms_key_state",
2517                                    ));
2518                                }
2519                                result.kms_key_state = map
2520                                    .next_value::<std::option::Option<crate::model::KmsKeyState>>()?
2521                                    .unwrap_or_default();
2522                            }
2523                            __FieldTag::__kms_status => {
2524                                if !fields.insert(__FieldTag::__kms_status) {
2525                                    return std::result::Result::Err(A::Error::duplicate_field(
2526                                        "multiple values for kms_status",
2527                                    ));
2528                                }
2529                                result.kms_status =
2530                                    map.next_value::<std::option::Option<rpc::model::Status>>()?;
2531                            }
2532                            __FieldTag::__resource_state => {
2533                                if !fields.insert(__FieldTag::__resource_state) {
2534                                    return std::result::Result::Err(A::Error::duplicate_field(
2535                                        "multiple values for resource_state",
2536                                    ));
2537                                }
2538                                result.resource_state = map
2539                                    .next_value::<std::option::Option<crate::model::ResourceState>>(
2540                                    )?
2541                                    .unwrap_or_default();
2542                            }
2543                            __FieldTag::Unknown(key) => {
2544                                let value = map.next_value::<serde_json::Value>()?;
2545                                result._unknown_fields.insert(key, value);
2546                            }
2547                        }
2548                    }
2549                    std::result::Result::Ok(result)
2550                }
2551            }
2552            deserializer.deserialize_any(Visitor)
2553        }
2554    }
2555
2556    #[doc(hidden)]
2557    impl serde::ser::Serialize for ControlPlaneEncryption {
2558        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2559        where
2560            S: serde::ser::Serializer,
2561        {
2562            use serde::ser::SerializeMap;
2563            #[allow(unused_imports)]
2564            use std::option::Option::Some;
2565            let mut state = serializer.serialize_map(std::option::Option::None)?;
2566            if !self.kms_key.is_empty() {
2567                state.serialize_entry("kmsKey", &self.kms_key)?;
2568            }
2569            if !self.kms_key_active_version.is_empty() {
2570                state.serialize_entry("kmsKeyActiveVersion", &self.kms_key_active_version)?;
2571            }
2572            if !wkt::internal::is_default(&self.kms_key_state) {
2573                state.serialize_entry("kmsKeyState", &self.kms_key_state)?;
2574            }
2575            if self.kms_status.is_some() {
2576                state.serialize_entry("kmsStatus", &self.kms_status)?;
2577            }
2578            if !wkt::internal::is_default(&self.resource_state) {
2579                state.serialize_entry("resourceState", &self.resource_state)?;
2580            }
2581            if !self._unknown_fields.is_empty() {
2582                for (key, value) in self._unknown_fields.iter() {
2583                    state.serialize_entry(key, &value)?;
2584                }
2585            }
2586            state.end()
2587        }
2588    }
2589
2590    /// A Maintenance Event is an operation that could cause temporary disruptions
2591    /// to the cluster workloads, including Google-driven or user-initiated cluster
2592    /// upgrades, user-initiated cluster configuration changes that require
2593    /// restarting nodes, etc.
2594    #[derive(Clone, Debug, Default, PartialEq)]
2595    #[non_exhaustive]
2596    pub struct MaintenanceEvent {
2597        /// Output only. UUID of the maintenance event.
2598        pub uuid: std::string::String,
2599
2600        /// Output only. The target version of the cluster.
2601        pub target_version: std::string::String,
2602
2603        /// Output only. The operation for running the maintenance event. Specified
2604        /// in the format projects/*/locations/*/operations/*. If the maintenance
2605        /// event is split into multiple operations (e.g. due to maintenance
2606        /// windows), the latest one is recorded.
2607        pub operation: std::string::String,
2608
2609        /// Output only. The type of the maintenance event.
2610        pub r#type: crate::model::cluster::maintenance_event::Type,
2611
2612        /// Output only. The schedule of the maintenance event.
2613        pub schedule: crate::model::cluster::maintenance_event::Schedule,
2614
2615        /// Output only. The state of the maintenance event.
2616        pub state: crate::model::cluster::maintenance_event::State,
2617
2618        /// Output only. The time when the maintenance event request was created.
2619        pub create_time: std::option::Option<wkt::Timestamp>,
2620
2621        /// Output only. The time when the maintenance event started.
2622        pub start_time: std::option::Option<wkt::Timestamp>,
2623
2624        /// Output only. The time when the maintenance event ended, either
2625        /// successfully or not. If the maintenance event is split into multiple
2626        /// maintenance windows, end_time is only updated when the whole flow ends.
2627        pub end_time: std::option::Option<wkt::Timestamp>,
2628
2629        /// Output only. The time when the maintenance event message was updated.
2630        pub update_time: std::option::Option<wkt::Timestamp>,
2631
2632        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2633    }
2634
2635    impl MaintenanceEvent {
2636        pub fn new() -> Self {
2637            std::default::Default::default()
2638        }
2639
2640        /// Sets the value of [uuid][crate::model::cluster::MaintenanceEvent::uuid].
2641        pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2642            self.uuid = v.into();
2643            self
2644        }
2645
2646        /// Sets the value of [target_version][crate::model::cluster::MaintenanceEvent::target_version].
2647        pub fn set_target_version<T: std::convert::Into<std::string::String>>(
2648            mut self,
2649            v: T,
2650        ) -> Self {
2651            self.target_version = v.into();
2652            self
2653        }
2654
2655        /// Sets the value of [operation][crate::model::cluster::MaintenanceEvent::operation].
2656        pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2657            self.operation = v.into();
2658            self
2659        }
2660
2661        /// Sets the value of [r#type][crate::model::cluster::MaintenanceEvent::type].
2662        pub fn set_type<T: std::convert::Into<crate::model::cluster::maintenance_event::Type>>(
2663            mut self,
2664            v: T,
2665        ) -> Self {
2666            self.r#type = v.into();
2667            self
2668        }
2669
2670        /// Sets the value of [schedule][crate::model::cluster::MaintenanceEvent::schedule].
2671        pub fn set_schedule<
2672            T: std::convert::Into<crate::model::cluster::maintenance_event::Schedule>,
2673        >(
2674            mut self,
2675            v: T,
2676        ) -> Self {
2677            self.schedule = v.into();
2678            self
2679        }
2680
2681        /// Sets the value of [state][crate::model::cluster::MaintenanceEvent::state].
2682        pub fn set_state<T: std::convert::Into<crate::model::cluster::maintenance_event::State>>(
2683            mut self,
2684            v: T,
2685        ) -> Self {
2686            self.state = v.into();
2687            self
2688        }
2689
2690        /// Sets the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
2691        pub fn set_create_time<T>(mut self, v: T) -> Self
2692        where
2693            T: std::convert::Into<wkt::Timestamp>,
2694        {
2695            self.create_time = std::option::Option::Some(v.into());
2696            self
2697        }
2698
2699        /// Sets or clears the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
2700        pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2701        where
2702            T: std::convert::Into<wkt::Timestamp>,
2703        {
2704            self.create_time = v.map(|x| x.into());
2705            self
2706        }
2707
2708        /// Sets the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
2709        pub fn set_start_time<T>(mut self, v: T) -> Self
2710        where
2711            T: std::convert::Into<wkt::Timestamp>,
2712        {
2713            self.start_time = std::option::Option::Some(v.into());
2714            self
2715        }
2716
2717        /// Sets or clears the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
2718        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2719        where
2720            T: std::convert::Into<wkt::Timestamp>,
2721        {
2722            self.start_time = v.map(|x| x.into());
2723            self
2724        }
2725
2726        /// Sets the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
2727        pub fn set_end_time<T>(mut self, v: T) -> Self
2728        where
2729            T: std::convert::Into<wkt::Timestamp>,
2730        {
2731            self.end_time = std::option::Option::Some(v.into());
2732            self
2733        }
2734
2735        /// Sets or clears the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
2736        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2737        where
2738            T: std::convert::Into<wkt::Timestamp>,
2739        {
2740            self.end_time = v.map(|x| x.into());
2741            self
2742        }
2743
2744        /// Sets the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
2745        pub fn set_update_time<T>(mut self, v: T) -> Self
2746        where
2747            T: std::convert::Into<wkt::Timestamp>,
2748        {
2749            self.update_time = std::option::Option::Some(v.into());
2750            self
2751        }
2752
2753        /// Sets or clears the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
2754        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2755        where
2756            T: std::convert::Into<wkt::Timestamp>,
2757        {
2758            self.update_time = v.map(|x| x.into());
2759            self
2760        }
2761    }
2762
2763    impl wkt::message::Message for MaintenanceEvent {
2764        fn typename() -> &'static str {
2765            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent"
2766        }
2767    }
2768
2769    #[doc(hidden)]
2770    impl<'de> serde::de::Deserialize<'de> for MaintenanceEvent {
2771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2772        where
2773            D: serde::Deserializer<'de>,
2774        {
2775            #[allow(non_camel_case_types)]
2776            #[doc(hidden)]
2777            #[derive(PartialEq, Eq, Hash)]
2778            enum __FieldTag {
2779                __uuid,
2780                __target_version,
2781                __operation,
2782                __type,
2783                __schedule,
2784                __state,
2785                __create_time,
2786                __start_time,
2787                __end_time,
2788                __update_time,
2789                Unknown(std::string::String),
2790            }
2791            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2792                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2793                where
2794                    D: serde::Deserializer<'de>,
2795                {
2796                    struct Visitor;
2797                    impl<'de> serde::de::Visitor<'de> for Visitor {
2798                        type Value = __FieldTag;
2799                        fn expecting(
2800                            &self,
2801                            formatter: &mut std::fmt::Formatter,
2802                        ) -> std::fmt::Result {
2803                            formatter.write_str("a field name for MaintenanceEvent")
2804                        }
2805                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2806                        where
2807                            E: serde::de::Error,
2808                        {
2809                            use std::result::Result::Ok;
2810                            use std::string::ToString;
2811                            match value {
2812                                "uuid" => Ok(__FieldTag::__uuid),
2813                                "targetVersion" => Ok(__FieldTag::__target_version),
2814                                "target_version" => Ok(__FieldTag::__target_version),
2815                                "operation" => Ok(__FieldTag::__operation),
2816                                "type" => Ok(__FieldTag::__type),
2817                                "schedule" => Ok(__FieldTag::__schedule),
2818                                "state" => Ok(__FieldTag::__state),
2819                                "createTime" => Ok(__FieldTag::__create_time),
2820                                "create_time" => Ok(__FieldTag::__create_time),
2821                                "startTime" => Ok(__FieldTag::__start_time),
2822                                "start_time" => Ok(__FieldTag::__start_time),
2823                                "endTime" => Ok(__FieldTag::__end_time),
2824                                "end_time" => Ok(__FieldTag::__end_time),
2825                                "updateTime" => Ok(__FieldTag::__update_time),
2826                                "update_time" => Ok(__FieldTag::__update_time),
2827                                _ => Ok(__FieldTag::Unknown(value.to_string())),
2828                            }
2829                        }
2830                    }
2831                    deserializer.deserialize_identifier(Visitor)
2832                }
2833            }
2834            struct Visitor;
2835            impl<'de> serde::de::Visitor<'de> for Visitor {
2836                type Value = MaintenanceEvent;
2837                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2838                    formatter.write_str("struct MaintenanceEvent")
2839                }
2840                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2841                where
2842                    A: serde::de::MapAccess<'de>,
2843                {
2844                    #[allow(unused_imports)]
2845                    use serde::de::Error;
2846                    use std::option::Option::Some;
2847                    let mut fields = std::collections::HashSet::new();
2848                    let mut result = Self::Value::new();
2849                    while let Some(tag) = map.next_key::<__FieldTag>()? {
2850                        #[allow(clippy::match_single_binding)]
2851                        match tag {
2852                            __FieldTag::__uuid => {
2853                                if !fields.insert(__FieldTag::__uuid) {
2854                                    return std::result::Result::Err(A::Error::duplicate_field(
2855                                        "multiple values for uuid",
2856                                    ));
2857                                }
2858                                result.uuid = map
2859                                    .next_value::<std::option::Option<std::string::String>>()?
2860                                    .unwrap_or_default();
2861                            }
2862                            __FieldTag::__target_version => {
2863                                if !fields.insert(__FieldTag::__target_version) {
2864                                    return std::result::Result::Err(A::Error::duplicate_field(
2865                                        "multiple values for target_version",
2866                                    ));
2867                                }
2868                                result.target_version = map
2869                                    .next_value::<std::option::Option<std::string::String>>()?
2870                                    .unwrap_or_default();
2871                            }
2872                            __FieldTag::__operation => {
2873                                if !fields.insert(__FieldTag::__operation) {
2874                                    return std::result::Result::Err(A::Error::duplicate_field(
2875                                        "multiple values for operation",
2876                                    ));
2877                                }
2878                                result.operation = map
2879                                    .next_value::<std::option::Option<std::string::String>>()?
2880                                    .unwrap_or_default();
2881                            }
2882                            __FieldTag::__type => {
2883                                if !fields.insert(__FieldTag::__type) {
2884                                    return std::result::Result::Err(A::Error::duplicate_field(
2885                                        "multiple values for type",
2886                                    ));
2887                                }
2888                                result.r#type = map
2889                                    .next_value::<std::option::Option<
2890                                        crate::model::cluster::maintenance_event::Type,
2891                                    >>()?
2892                                    .unwrap_or_default();
2893                            }
2894                            __FieldTag::__schedule => {
2895                                if !fields.insert(__FieldTag::__schedule) {
2896                                    return std::result::Result::Err(A::Error::duplicate_field(
2897                                        "multiple values for schedule",
2898                                    ));
2899                                }
2900                                result.schedule = map
2901                                    .next_value::<std::option::Option<
2902                                        crate::model::cluster::maintenance_event::Schedule,
2903                                    >>()?
2904                                    .unwrap_or_default();
2905                            }
2906                            __FieldTag::__state => {
2907                                if !fields.insert(__FieldTag::__state) {
2908                                    return std::result::Result::Err(A::Error::duplicate_field(
2909                                        "multiple values for state",
2910                                    ));
2911                                }
2912                                result.state = map
2913                                    .next_value::<std::option::Option<
2914                                        crate::model::cluster::maintenance_event::State,
2915                                    >>()?
2916                                    .unwrap_or_default();
2917                            }
2918                            __FieldTag::__create_time => {
2919                                if !fields.insert(__FieldTag::__create_time) {
2920                                    return std::result::Result::Err(A::Error::duplicate_field(
2921                                        "multiple values for create_time",
2922                                    ));
2923                                }
2924                                result.create_time =
2925                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2926                            }
2927                            __FieldTag::__start_time => {
2928                                if !fields.insert(__FieldTag::__start_time) {
2929                                    return std::result::Result::Err(A::Error::duplicate_field(
2930                                        "multiple values for start_time",
2931                                    ));
2932                                }
2933                                result.start_time =
2934                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2935                            }
2936                            __FieldTag::__end_time => {
2937                                if !fields.insert(__FieldTag::__end_time) {
2938                                    return std::result::Result::Err(A::Error::duplicate_field(
2939                                        "multiple values for end_time",
2940                                    ));
2941                                }
2942                                result.end_time =
2943                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2944                            }
2945                            __FieldTag::__update_time => {
2946                                if !fields.insert(__FieldTag::__update_time) {
2947                                    return std::result::Result::Err(A::Error::duplicate_field(
2948                                        "multiple values for update_time",
2949                                    ));
2950                                }
2951                                result.update_time =
2952                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2953                            }
2954                            __FieldTag::Unknown(key) => {
2955                                let value = map.next_value::<serde_json::Value>()?;
2956                                result._unknown_fields.insert(key, value);
2957                            }
2958                        }
2959                    }
2960                    std::result::Result::Ok(result)
2961                }
2962            }
2963            deserializer.deserialize_any(Visitor)
2964        }
2965    }
2966
2967    #[doc(hidden)]
2968    impl serde::ser::Serialize for MaintenanceEvent {
2969        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2970        where
2971            S: serde::ser::Serializer,
2972        {
2973            use serde::ser::SerializeMap;
2974            #[allow(unused_imports)]
2975            use std::option::Option::Some;
2976            let mut state = serializer.serialize_map(std::option::Option::None)?;
2977            if !self.uuid.is_empty() {
2978                state.serialize_entry("uuid", &self.uuid)?;
2979            }
2980            if !self.target_version.is_empty() {
2981                state.serialize_entry("targetVersion", &self.target_version)?;
2982            }
2983            if !self.operation.is_empty() {
2984                state.serialize_entry("operation", &self.operation)?;
2985            }
2986            if !wkt::internal::is_default(&self.r#type) {
2987                state.serialize_entry("type", &self.r#type)?;
2988            }
2989            if !wkt::internal::is_default(&self.schedule) {
2990                state.serialize_entry("schedule", &self.schedule)?;
2991            }
2992            if !wkt::internal::is_default(&self.state) {
2993                state.serialize_entry("state", &self.state)?;
2994            }
2995            if self.create_time.is_some() {
2996                state.serialize_entry("createTime", &self.create_time)?;
2997            }
2998            if self.start_time.is_some() {
2999                state.serialize_entry("startTime", &self.start_time)?;
3000            }
3001            if self.end_time.is_some() {
3002                state.serialize_entry("endTime", &self.end_time)?;
3003            }
3004            if self.update_time.is_some() {
3005                state.serialize_entry("updateTime", &self.update_time)?;
3006            }
3007            if !self._unknown_fields.is_empty() {
3008                for (key, value) in self._unknown_fields.iter() {
3009                    state.serialize_entry(key, &value)?;
3010                }
3011            }
3012            state.end()
3013        }
3014    }
3015
3016    /// Defines additional types related to [MaintenanceEvent].
3017    pub mod maintenance_event {
3018        #[allow(unused_imports)]
3019        use super::*;
3020
3021        /// Indicates the maintenance event type.
3022        ///
3023        /// # Working with unknown values
3024        ///
3025        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3026        /// additional enum variants at any time. Adding new variants is not considered
3027        /// a breaking change. Applications should write their code in anticipation of:
3028        ///
3029        /// - New values appearing in future releases of the client library, **and**
3030        /// - New values received dynamically, without application changes.
3031        ///
3032        /// Please consult the [Working with enums] section in the user guide for some
3033        /// guidelines.
3034        ///
3035        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3036        #[derive(Clone, Debug, PartialEq)]
3037        #[non_exhaustive]
3038        pub enum Type {
3039            /// Unspecified.
3040            Unspecified,
3041            /// Upgrade initiated by users.
3042            UserInitiatedUpgrade,
3043            /// Upgrade driven by Google.
3044            GoogleDrivenUpgrade,
3045            /// If set, the enum was initialized with an unknown value.
3046            ///
3047            /// Applications can examine the value using [Type::value] or
3048            /// [Type::name].
3049            UnknownValue(r#type::UnknownValue),
3050        }
3051
3052        #[doc(hidden)]
3053        pub mod r#type {
3054            #[allow(unused_imports)]
3055            use super::*;
3056            #[derive(Clone, Debug, PartialEq)]
3057            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3058        }
3059
3060        impl Type {
3061            /// Gets the enum value.
3062            ///
3063            /// Returns `None` if the enum contains an unknown value deserialized from
3064            /// the string representation of enums.
3065            pub fn value(&self) -> std::option::Option<i32> {
3066                match self {
3067                    Self::Unspecified => std::option::Option::Some(0),
3068                    Self::UserInitiatedUpgrade => std::option::Option::Some(1),
3069                    Self::GoogleDrivenUpgrade => std::option::Option::Some(2),
3070                    Self::UnknownValue(u) => u.0.value(),
3071                }
3072            }
3073
3074            /// Gets the enum value as a string.
3075            ///
3076            /// Returns `None` if the enum contains an unknown value deserialized from
3077            /// the integer representation of enums.
3078            pub fn name(&self) -> std::option::Option<&str> {
3079                match self {
3080                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3081                    Self::UserInitiatedUpgrade => {
3082                        std::option::Option::Some("USER_INITIATED_UPGRADE")
3083                    }
3084                    Self::GoogleDrivenUpgrade => std::option::Option::Some("GOOGLE_DRIVEN_UPGRADE"),
3085                    Self::UnknownValue(u) => u.0.name(),
3086                }
3087            }
3088        }
3089
3090        impl std::default::Default for Type {
3091            fn default() -> Self {
3092                use std::convert::From;
3093                Self::from(0)
3094            }
3095        }
3096
3097        impl std::fmt::Display for Type {
3098            fn fmt(
3099                &self,
3100                f: &mut std::fmt::Formatter<'_>,
3101            ) -> std::result::Result<(), std::fmt::Error> {
3102                wkt::internal::display_enum(f, self.name(), self.value())
3103            }
3104        }
3105
3106        impl std::convert::From<i32> for Type {
3107            fn from(value: i32) -> Self {
3108                match value {
3109                    0 => Self::Unspecified,
3110                    1 => Self::UserInitiatedUpgrade,
3111                    2 => Self::GoogleDrivenUpgrade,
3112                    _ => Self::UnknownValue(r#type::UnknownValue(
3113                        wkt::internal::UnknownEnumValue::Integer(value),
3114                    )),
3115                }
3116            }
3117        }
3118
3119        impl std::convert::From<&str> for Type {
3120            fn from(value: &str) -> Self {
3121                use std::string::ToString;
3122                match value {
3123                    "TYPE_UNSPECIFIED" => Self::Unspecified,
3124                    "USER_INITIATED_UPGRADE" => Self::UserInitiatedUpgrade,
3125                    "GOOGLE_DRIVEN_UPGRADE" => Self::GoogleDrivenUpgrade,
3126                    _ => Self::UnknownValue(r#type::UnknownValue(
3127                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3128                    )),
3129                }
3130            }
3131        }
3132
3133        impl serde::ser::Serialize for Type {
3134            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3135            where
3136                S: serde::Serializer,
3137            {
3138                match self {
3139                    Self::Unspecified => serializer.serialize_i32(0),
3140                    Self::UserInitiatedUpgrade => serializer.serialize_i32(1),
3141                    Self::GoogleDrivenUpgrade => serializer.serialize_i32(2),
3142                    Self::UnknownValue(u) => u.0.serialize(serializer),
3143                }
3144            }
3145        }
3146
3147        impl<'de> serde::de::Deserialize<'de> for Type {
3148            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3149            where
3150                D: serde::Deserializer<'de>,
3151            {
3152                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
3153                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Type",
3154                ))
3155            }
3156        }
3157
3158        /// Indicates when the maintenance event should be performed.
3159        ///
3160        /// # Working with unknown values
3161        ///
3162        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3163        /// additional enum variants at any time. Adding new variants is not considered
3164        /// a breaking change. Applications should write their code in anticipation of:
3165        ///
3166        /// - New values appearing in future releases of the client library, **and**
3167        /// - New values received dynamically, without application changes.
3168        ///
3169        /// Please consult the [Working with enums] section in the user guide for some
3170        /// guidelines.
3171        ///
3172        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3173        #[derive(Clone, Debug, PartialEq)]
3174        #[non_exhaustive]
3175        pub enum Schedule {
3176            /// Unspecified.
3177            Unspecified,
3178            /// Immediately after receiving the request.
3179            Immediately,
3180            /// If set, the enum was initialized with an unknown value.
3181            ///
3182            /// Applications can examine the value using [Schedule::value] or
3183            /// [Schedule::name].
3184            UnknownValue(schedule::UnknownValue),
3185        }
3186
3187        #[doc(hidden)]
3188        pub mod schedule {
3189            #[allow(unused_imports)]
3190            use super::*;
3191            #[derive(Clone, Debug, PartialEq)]
3192            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3193        }
3194
3195        impl Schedule {
3196            /// Gets the enum value.
3197            ///
3198            /// Returns `None` if the enum contains an unknown value deserialized from
3199            /// the string representation of enums.
3200            pub fn value(&self) -> std::option::Option<i32> {
3201                match self {
3202                    Self::Unspecified => std::option::Option::Some(0),
3203                    Self::Immediately => std::option::Option::Some(1),
3204                    Self::UnknownValue(u) => u.0.value(),
3205                }
3206            }
3207
3208            /// Gets the enum value as a string.
3209            ///
3210            /// Returns `None` if the enum contains an unknown value deserialized from
3211            /// the integer representation of enums.
3212            pub fn name(&self) -> std::option::Option<&str> {
3213                match self {
3214                    Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
3215                    Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
3216                    Self::UnknownValue(u) => u.0.name(),
3217                }
3218            }
3219        }
3220
3221        impl std::default::Default for Schedule {
3222            fn default() -> Self {
3223                use std::convert::From;
3224                Self::from(0)
3225            }
3226        }
3227
3228        impl std::fmt::Display for Schedule {
3229            fn fmt(
3230                &self,
3231                f: &mut std::fmt::Formatter<'_>,
3232            ) -> std::result::Result<(), std::fmt::Error> {
3233                wkt::internal::display_enum(f, self.name(), self.value())
3234            }
3235        }
3236
3237        impl std::convert::From<i32> for Schedule {
3238            fn from(value: i32) -> Self {
3239                match value {
3240                    0 => Self::Unspecified,
3241                    1 => Self::Immediately,
3242                    _ => Self::UnknownValue(schedule::UnknownValue(
3243                        wkt::internal::UnknownEnumValue::Integer(value),
3244                    )),
3245                }
3246            }
3247        }
3248
3249        impl std::convert::From<&str> for Schedule {
3250            fn from(value: &str) -> Self {
3251                use std::string::ToString;
3252                match value {
3253                    "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
3254                    "IMMEDIATELY" => Self::Immediately,
3255                    _ => Self::UnknownValue(schedule::UnknownValue(
3256                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3257                    )),
3258                }
3259            }
3260        }
3261
3262        impl serde::ser::Serialize for Schedule {
3263            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3264            where
3265                S: serde::Serializer,
3266            {
3267                match self {
3268                    Self::Unspecified => serializer.serialize_i32(0),
3269                    Self::Immediately => serializer.serialize_i32(1),
3270                    Self::UnknownValue(u) => u.0.serialize(serializer),
3271                }
3272            }
3273        }
3274
3275        impl<'de> serde::de::Deserialize<'de> for Schedule {
3276            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3277            where
3278                D: serde::Deserializer<'de>,
3279            {
3280                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
3281                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.Schedule",
3282                ))
3283            }
3284        }
3285
3286        /// Indicates the maintenance event state.
3287        ///
3288        /// # Working with unknown values
3289        ///
3290        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3291        /// additional enum variants at any time. Adding new variants is not considered
3292        /// a breaking change. Applications should write their code in anticipation of:
3293        ///
3294        /// - New values appearing in future releases of the client library, **and**
3295        /// - New values received dynamically, without application changes.
3296        ///
3297        /// Please consult the [Working with enums] section in the user guide for some
3298        /// guidelines.
3299        ///
3300        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3301        #[derive(Clone, Debug, PartialEq)]
3302        #[non_exhaustive]
3303        pub enum State {
3304            /// Unspecified.
3305            Unspecified,
3306            /// The maintenance event is ongoing. The cluster might be unusable.
3307            Reconciling,
3308            /// The maintenance event succeeded.
3309            Succeeded,
3310            /// The maintenance event failed.
3311            Failed,
3312            /// If set, the enum was initialized with an unknown value.
3313            ///
3314            /// Applications can examine the value using [State::value] or
3315            /// [State::name].
3316            UnknownValue(state::UnknownValue),
3317        }
3318
3319        #[doc(hidden)]
3320        pub mod state {
3321            #[allow(unused_imports)]
3322            use super::*;
3323            #[derive(Clone, Debug, PartialEq)]
3324            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3325        }
3326
3327        impl State {
3328            /// Gets the enum value.
3329            ///
3330            /// Returns `None` if the enum contains an unknown value deserialized from
3331            /// the string representation of enums.
3332            pub fn value(&self) -> std::option::Option<i32> {
3333                match self {
3334                    Self::Unspecified => std::option::Option::Some(0),
3335                    Self::Reconciling => std::option::Option::Some(1),
3336                    Self::Succeeded => std::option::Option::Some(2),
3337                    Self::Failed => std::option::Option::Some(3),
3338                    Self::UnknownValue(u) => u.0.value(),
3339                }
3340            }
3341
3342            /// Gets the enum value as a string.
3343            ///
3344            /// Returns `None` if the enum contains an unknown value deserialized from
3345            /// the integer representation of enums.
3346            pub fn name(&self) -> std::option::Option<&str> {
3347                match self {
3348                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3349                    Self::Reconciling => std::option::Option::Some("RECONCILING"),
3350                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
3351                    Self::Failed => std::option::Option::Some("FAILED"),
3352                    Self::UnknownValue(u) => u.0.name(),
3353                }
3354            }
3355        }
3356
3357        impl std::default::Default for State {
3358            fn default() -> Self {
3359                use std::convert::From;
3360                Self::from(0)
3361            }
3362        }
3363
3364        impl std::fmt::Display for State {
3365            fn fmt(
3366                &self,
3367                f: &mut std::fmt::Formatter<'_>,
3368            ) -> std::result::Result<(), std::fmt::Error> {
3369                wkt::internal::display_enum(f, self.name(), self.value())
3370            }
3371        }
3372
3373        impl std::convert::From<i32> for State {
3374            fn from(value: i32) -> Self {
3375                match value {
3376                    0 => Self::Unspecified,
3377                    1 => Self::Reconciling,
3378                    2 => Self::Succeeded,
3379                    3 => Self::Failed,
3380                    _ => Self::UnknownValue(state::UnknownValue(
3381                        wkt::internal::UnknownEnumValue::Integer(value),
3382                    )),
3383                }
3384            }
3385        }
3386
3387        impl std::convert::From<&str> for State {
3388            fn from(value: &str) -> Self {
3389                use std::string::ToString;
3390                match value {
3391                    "STATE_UNSPECIFIED" => Self::Unspecified,
3392                    "RECONCILING" => Self::Reconciling,
3393                    "SUCCEEDED" => Self::Succeeded,
3394                    "FAILED" => Self::Failed,
3395                    _ => Self::UnknownValue(state::UnknownValue(
3396                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3397                    )),
3398                }
3399            }
3400        }
3401
3402        impl serde::ser::Serialize for State {
3403            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3404            where
3405                S: serde::Serializer,
3406            {
3407                match self {
3408                    Self::Unspecified => serializer.serialize_i32(0),
3409                    Self::Reconciling => serializer.serialize_i32(1),
3410                    Self::Succeeded => serializer.serialize_i32(2),
3411                    Self::Failed => serializer.serialize_i32(3),
3412                    Self::UnknownValue(u) => u.0.serialize(serializer),
3413                }
3414            }
3415        }
3416
3417        impl<'de> serde::de::Deserialize<'de> for State {
3418            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3419            where
3420                D: serde::Deserializer<'de>,
3421            {
3422                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3423                    ".google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent.State",
3424                ))
3425            }
3426        }
3427    }
3428
3429    /// Configuration of the cluster survivability, e.g., for the case when network
3430    /// connectivity is lost.
3431    #[derive(Clone, Debug, Default, PartialEq)]
3432    #[non_exhaustive]
3433    pub struct SurvivabilityConfig {
3434        /// Optional. Time period that allows the cluster nodes to be rebooted and
3435        /// become functional without network connectivity to Google. The default 0
3436        /// means not allowed. The maximum is 7 days.
3437        pub offline_reboot_ttl: std::option::Option<wkt::Duration>,
3438
3439        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3440    }
3441
3442    impl SurvivabilityConfig {
3443        pub fn new() -> Self {
3444            std::default::Default::default()
3445        }
3446
3447        /// Sets the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
3448        pub fn set_offline_reboot_ttl<T>(mut self, v: T) -> Self
3449        where
3450            T: std::convert::Into<wkt::Duration>,
3451        {
3452            self.offline_reboot_ttl = std::option::Option::Some(v.into());
3453            self
3454        }
3455
3456        /// Sets or clears the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
3457        pub fn set_or_clear_offline_reboot_ttl<T>(mut self, v: std::option::Option<T>) -> Self
3458        where
3459            T: std::convert::Into<wkt::Duration>,
3460        {
3461            self.offline_reboot_ttl = v.map(|x| x.into());
3462            self
3463        }
3464    }
3465
3466    impl wkt::message::Message for SurvivabilityConfig {
3467        fn typename() -> &'static str {
3468            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SurvivabilityConfig"
3469        }
3470    }
3471
3472    #[doc(hidden)]
3473    impl<'de> serde::de::Deserialize<'de> for SurvivabilityConfig {
3474        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3475        where
3476            D: serde::Deserializer<'de>,
3477        {
3478            #[allow(non_camel_case_types)]
3479            #[doc(hidden)]
3480            #[derive(PartialEq, Eq, Hash)]
3481            enum __FieldTag {
3482                __offline_reboot_ttl,
3483                Unknown(std::string::String),
3484            }
3485            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3486                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3487                where
3488                    D: serde::Deserializer<'de>,
3489                {
3490                    struct Visitor;
3491                    impl<'de> serde::de::Visitor<'de> for Visitor {
3492                        type Value = __FieldTag;
3493                        fn expecting(
3494                            &self,
3495                            formatter: &mut std::fmt::Formatter,
3496                        ) -> std::fmt::Result {
3497                            formatter.write_str("a field name for SurvivabilityConfig")
3498                        }
3499                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3500                        where
3501                            E: serde::de::Error,
3502                        {
3503                            use std::result::Result::Ok;
3504                            use std::string::ToString;
3505                            match value {
3506                                "offlineRebootTtl" => Ok(__FieldTag::__offline_reboot_ttl),
3507                                "offline_reboot_ttl" => Ok(__FieldTag::__offline_reboot_ttl),
3508                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3509                            }
3510                        }
3511                    }
3512                    deserializer.deserialize_identifier(Visitor)
3513                }
3514            }
3515            struct Visitor;
3516            impl<'de> serde::de::Visitor<'de> for Visitor {
3517                type Value = SurvivabilityConfig;
3518                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3519                    formatter.write_str("struct SurvivabilityConfig")
3520                }
3521                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3522                where
3523                    A: serde::de::MapAccess<'de>,
3524                {
3525                    #[allow(unused_imports)]
3526                    use serde::de::Error;
3527                    use std::option::Option::Some;
3528                    let mut fields = std::collections::HashSet::new();
3529                    let mut result = Self::Value::new();
3530                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3531                        #[allow(clippy::match_single_binding)]
3532                        match tag {
3533                            __FieldTag::__offline_reboot_ttl => {
3534                                if !fields.insert(__FieldTag::__offline_reboot_ttl) {
3535                                    return std::result::Result::Err(A::Error::duplicate_field(
3536                                        "multiple values for offline_reboot_ttl",
3537                                    ));
3538                                }
3539                                result.offline_reboot_ttl =
3540                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
3541                            }
3542                            __FieldTag::Unknown(key) => {
3543                                let value = map.next_value::<serde_json::Value>()?;
3544                                result._unknown_fields.insert(key, value);
3545                            }
3546                        }
3547                    }
3548                    std::result::Result::Ok(result)
3549                }
3550            }
3551            deserializer.deserialize_any(Visitor)
3552        }
3553    }
3554
3555    #[doc(hidden)]
3556    impl serde::ser::Serialize for SurvivabilityConfig {
3557        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3558        where
3559            S: serde::ser::Serializer,
3560        {
3561            use serde::ser::SerializeMap;
3562            #[allow(unused_imports)]
3563            use std::option::Option::Some;
3564            let mut state = serializer.serialize_map(std::option::Option::None)?;
3565            if self.offline_reboot_ttl.is_some() {
3566                state.serialize_entry("offlineRebootTtl", &self.offline_reboot_ttl)?;
3567            }
3568            if !self._unknown_fields.is_empty() {
3569                for (key, value) in self._unknown_fields.iter() {
3570                    state.serialize_entry(key, &value)?;
3571                }
3572            }
3573            state.end()
3574        }
3575    }
3576
3577    /// ConnectionState holds the current connection state from the cluster to
3578    /// Google.
3579    #[derive(Clone, Debug, Default, PartialEq)]
3580    #[non_exhaustive]
3581    pub struct ConnectionState {
3582        /// Output only. The current connection state.
3583        pub state: crate::model::cluster::connection_state::State,
3584
3585        /// Output only. The time when the connection state was last changed.
3586        pub update_time: std::option::Option<wkt::Timestamp>,
3587
3588        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3589    }
3590
3591    impl ConnectionState {
3592        pub fn new() -> Self {
3593            std::default::Default::default()
3594        }
3595
3596        /// Sets the value of [state][crate::model::cluster::ConnectionState::state].
3597        pub fn set_state<T: std::convert::Into<crate::model::cluster::connection_state::State>>(
3598            mut self,
3599            v: T,
3600        ) -> Self {
3601            self.state = v.into();
3602            self
3603        }
3604
3605        /// Sets the value of [update_time][crate::model::cluster::ConnectionState::update_time].
3606        pub fn set_update_time<T>(mut self, v: T) -> Self
3607        where
3608            T: std::convert::Into<wkt::Timestamp>,
3609        {
3610            self.update_time = std::option::Option::Some(v.into());
3611            self
3612        }
3613
3614        /// Sets or clears the value of [update_time][crate::model::cluster::ConnectionState::update_time].
3615        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3616        where
3617            T: std::convert::Into<wkt::Timestamp>,
3618        {
3619            self.update_time = v.map(|x| x.into());
3620            self
3621        }
3622    }
3623
3624    impl wkt::message::Message for ConnectionState {
3625        fn typename() -> &'static str {
3626            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ConnectionState"
3627        }
3628    }
3629
3630    #[doc(hidden)]
3631    impl<'de> serde::de::Deserialize<'de> for ConnectionState {
3632        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3633        where
3634            D: serde::Deserializer<'de>,
3635        {
3636            #[allow(non_camel_case_types)]
3637            #[doc(hidden)]
3638            #[derive(PartialEq, Eq, Hash)]
3639            enum __FieldTag {
3640                __state,
3641                __update_time,
3642                Unknown(std::string::String),
3643            }
3644            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3645                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3646                where
3647                    D: serde::Deserializer<'de>,
3648                {
3649                    struct Visitor;
3650                    impl<'de> serde::de::Visitor<'de> for Visitor {
3651                        type Value = __FieldTag;
3652                        fn expecting(
3653                            &self,
3654                            formatter: &mut std::fmt::Formatter,
3655                        ) -> std::fmt::Result {
3656                            formatter.write_str("a field name for ConnectionState")
3657                        }
3658                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3659                        where
3660                            E: serde::de::Error,
3661                        {
3662                            use std::result::Result::Ok;
3663                            use std::string::ToString;
3664                            match value {
3665                                "state" => Ok(__FieldTag::__state),
3666                                "updateTime" => Ok(__FieldTag::__update_time),
3667                                "update_time" => Ok(__FieldTag::__update_time),
3668                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3669                            }
3670                        }
3671                    }
3672                    deserializer.deserialize_identifier(Visitor)
3673                }
3674            }
3675            struct Visitor;
3676            impl<'de> serde::de::Visitor<'de> for Visitor {
3677                type Value = ConnectionState;
3678                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3679                    formatter.write_str("struct ConnectionState")
3680                }
3681                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3682                where
3683                    A: serde::de::MapAccess<'de>,
3684                {
3685                    #[allow(unused_imports)]
3686                    use serde::de::Error;
3687                    use std::option::Option::Some;
3688                    let mut fields = std::collections::HashSet::new();
3689                    let mut result = Self::Value::new();
3690                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3691                        #[allow(clippy::match_single_binding)]
3692                        match tag {
3693                            __FieldTag::__state => {
3694                                if !fields.insert(__FieldTag::__state) {
3695                                    return std::result::Result::Err(A::Error::duplicate_field(
3696                                        "multiple values for state",
3697                                    ));
3698                                }
3699                                result.state = map
3700                                    .next_value::<std::option::Option<
3701                                        crate::model::cluster::connection_state::State,
3702                                    >>()?
3703                                    .unwrap_or_default();
3704                            }
3705                            __FieldTag::__update_time => {
3706                                if !fields.insert(__FieldTag::__update_time) {
3707                                    return std::result::Result::Err(A::Error::duplicate_field(
3708                                        "multiple values for update_time",
3709                                    ));
3710                                }
3711                                result.update_time =
3712                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3713                            }
3714                            __FieldTag::Unknown(key) => {
3715                                let value = map.next_value::<serde_json::Value>()?;
3716                                result._unknown_fields.insert(key, value);
3717                            }
3718                        }
3719                    }
3720                    std::result::Result::Ok(result)
3721                }
3722            }
3723            deserializer.deserialize_any(Visitor)
3724        }
3725    }
3726
3727    #[doc(hidden)]
3728    impl serde::ser::Serialize for ConnectionState {
3729        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3730        where
3731            S: serde::ser::Serializer,
3732        {
3733            use serde::ser::SerializeMap;
3734            #[allow(unused_imports)]
3735            use std::option::Option::Some;
3736            let mut state = serializer.serialize_map(std::option::Option::None)?;
3737            if !wkt::internal::is_default(&self.state) {
3738                state.serialize_entry("state", &self.state)?;
3739            }
3740            if self.update_time.is_some() {
3741                state.serialize_entry("updateTime", &self.update_time)?;
3742            }
3743            if !self._unknown_fields.is_empty() {
3744                for (key, value) in self._unknown_fields.iter() {
3745                    state.serialize_entry(key, &value)?;
3746                }
3747            }
3748            state.end()
3749        }
3750    }
3751
3752    /// Defines additional types related to [ConnectionState].
3753    pub mod connection_state {
3754        #[allow(unused_imports)]
3755        use super::*;
3756
3757        /// The connection state.
3758        ///
3759        /// # Working with unknown values
3760        ///
3761        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3762        /// additional enum variants at any time. Adding new variants is not considered
3763        /// a breaking change. Applications should write their code in anticipation of:
3764        ///
3765        /// - New values appearing in future releases of the client library, **and**
3766        /// - New values received dynamically, without application changes.
3767        ///
3768        /// Please consult the [Working with enums] section in the user guide for some
3769        /// guidelines.
3770        ///
3771        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3772        #[derive(Clone, Debug, PartialEq)]
3773        #[non_exhaustive]
3774        pub enum State {
3775            /// Unknown connection state.
3776            Unspecified,
3777            /// This cluster is currently disconnected from Google.
3778            Disconnected,
3779            /// This cluster is currently connected to Google.
3780            Connected,
3781            /// This cluster is currently connected to Google, but may have recently
3782            /// reconnected after a disconnection. It is still syncing back.
3783            ConnectedAndSyncing,
3784            /// If set, the enum was initialized with an unknown value.
3785            ///
3786            /// Applications can examine the value using [State::value] or
3787            /// [State::name].
3788            UnknownValue(state::UnknownValue),
3789        }
3790
3791        #[doc(hidden)]
3792        pub mod state {
3793            #[allow(unused_imports)]
3794            use super::*;
3795            #[derive(Clone, Debug, PartialEq)]
3796            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3797        }
3798
3799        impl State {
3800            /// Gets the enum value.
3801            ///
3802            /// Returns `None` if the enum contains an unknown value deserialized from
3803            /// the string representation of enums.
3804            pub fn value(&self) -> std::option::Option<i32> {
3805                match self {
3806                    Self::Unspecified => std::option::Option::Some(0),
3807                    Self::Disconnected => std::option::Option::Some(1),
3808                    Self::Connected => std::option::Option::Some(2),
3809                    Self::ConnectedAndSyncing => std::option::Option::Some(3),
3810                    Self::UnknownValue(u) => u.0.value(),
3811                }
3812            }
3813
3814            /// Gets the enum value as a string.
3815            ///
3816            /// Returns `None` if the enum contains an unknown value deserialized from
3817            /// the integer representation of enums.
3818            pub fn name(&self) -> std::option::Option<&str> {
3819                match self {
3820                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3821                    Self::Disconnected => std::option::Option::Some("DISCONNECTED"),
3822                    Self::Connected => std::option::Option::Some("CONNECTED"),
3823                    Self::ConnectedAndSyncing => std::option::Option::Some("CONNECTED_AND_SYNCING"),
3824                    Self::UnknownValue(u) => u.0.name(),
3825                }
3826            }
3827        }
3828
3829        impl std::default::Default for State {
3830            fn default() -> Self {
3831                use std::convert::From;
3832                Self::from(0)
3833            }
3834        }
3835
3836        impl std::fmt::Display for State {
3837            fn fmt(
3838                &self,
3839                f: &mut std::fmt::Formatter<'_>,
3840            ) -> std::result::Result<(), std::fmt::Error> {
3841                wkt::internal::display_enum(f, self.name(), self.value())
3842            }
3843        }
3844
3845        impl std::convert::From<i32> for State {
3846            fn from(value: i32) -> Self {
3847                match value {
3848                    0 => Self::Unspecified,
3849                    1 => Self::Disconnected,
3850                    2 => Self::Connected,
3851                    3 => Self::ConnectedAndSyncing,
3852                    _ => Self::UnknownValue(state::UnknownValue(
3853                        wkt::internal::UnknownEnumValue::Integer(value),
3854                    )),
3855                }
3856            }
3857        }
3858
3859        impl std::convert::From<&str> for State {
3860            fn from(value: &str) -> Self {
3861                use std::string::ToString;
3862                match value {
3863                    "STATE_UNSPECIFIED" => Self::Unspecified,
3864                    "DISCONNECTED" => Self::Disconnected,
3865                    "CONNECTED" => Self::Connected,
3866                    "CONNECTED_AND_SYNCING" => Self::ConnectedAndSyncing,
3867                    _ => Self::UnknownValue(state::UnknownValue(
3868                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3869                    )),
3870                }
3871            }
3872        }
3873
3874        impl serde::ser::Serialize for State {
3875            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3876            where
3877                S: serde::Serializer,
3878            {
3879                match self {
3880                    Self::Unspecified => serializer.serialize_i32(0),
3881                    Self::Disconnected => serializer.serialize_i32(1),
3882                    Self::Connected => serializer.serialize_i32(2),
3883                    Self::ConnectedAndSyncing => serializer.serialize_i32(3),
3884                    Self::UnknownValue(u) => u.0.serialize(serializer),
3885                }
3886            }
3887        }
3888
3889        impl<'de> serde::de::Deserialize<'de> for State {
3890            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3891            where
3892                D: serde::Deserializer<'de>,
3893            {
3894                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3895                    ".google.cloud.edgecontainer.v1.Cluster.ConnectionState.State",
3896                ))
3897            }
3898        }
3899    }
3900
3901    /// Indicates the status of the cluster.
3902    ///
3903    /// # Working with unknown values
3904    ///
3905    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3906    /// additional enum variants at any time. Adding new variants is not considered
3907    /// a breaking change. Applications should write their code in anticipation of:
3908    ///
3909    /// - New values appearing in future releases of the client library, **and**
3910    /// - New values received dynamically, without application changes.
3911    ///
3912    /// Please consult the [Working with enums] section in the user guide for some
3913    /// guidelines.
3914    ///
3915    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3916    #[derive(Clone, Debug, PartialEq)]
3917    #[non_exhaustive]
3918    pub enum Status {
3919        /// Status unknown.
3920        Unspecified,
3921        /// The cluster is being created.
3922        Provisioning,
3923        /// The cluster is created and fully usable.
3924        Running,
3925        /// The cluster is being deleted.
3926        Deleting,
3927        /// The status indicates that some errors occurred while reconciling/deleting
3928        /// the cluster.
3929        Error,
3930        /// The cluster is undergoing some work such as version upgrades, etc.
3931        Reconciling,
3932        /// If set, the enum was initialized with an unknown value.
3933        ///
3934        /// Applications can examine the value using [Status::value] or
3935        /// [Status::name].
3936        UnknownValue(status::UnknownValue),
3937    }
3938
3939    #[doc(hidden)]
3940    pub mod status {
3941        #[allow(unused_imports)]
3942        use super::*;
3943        #[derive(Clone, Debug, PartialEq)]
3944        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3945    }
3946
3947    impl Status {
3948        /// Gets the enum value.
3949        ///
3950        /// Returns `None` if the enum contains an unknown value deserialized from
3951        /// the string representation of enums.
3952        pub fn value(&self) -> std::option::Option<i32> {
3953            match self {
3954                Self::Unspecified => std::option::Option::Some(0),
3955                Self::Provisioning => std::option::Option::Some(1),
3956                Self::Running => std::option::Option::Some(2),
3957                Self::Deleting => std::option::Option::Some(3),
3958                Self::Error => std::option::Option::Some(4),
3959                Self::Reconciling => std::option::Option::Some(5),
3960                Self::UnknownValue(u) => u.0.value(),
3961            }
3962        }
3963
3964        /// Gets the enum value as a string.
3965        ///
3966        /// Returns `None` if the enum contains an unknown value deserialized from
3967        /// the integer representation of enums.
3968        pub fn name(&self) -> std::option::Option<&str> {
3969            match self {
3970                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
3971                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
3972                Self::Running => std::option::Option::Some("RUNNING"),
3973                Self::Deleting => std::option::Option::Some("DELETING"),
3974                Self::Error => std::option::Option::Some("ERROR"),
3975                Self::Reconciling => std::option::Option::Some("RECONCILING"),
3976                Self::UnknownValue(u) => u.0.name(),
3977            }
3978        }
3979    }
3980
3981    impl std::default::Default for Status {
3982        fn default() -> Self {
3983            use std::convert::From;
3984            Self::from(0)
3985        }
3986    }
3987
3988    impl std::fmt::Display for Status {
3989        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3990            wkt::internal::display_enum(f, self.name(), self.value())
3991        }
3992    }
3993
3994    impl std::convert::From<i32> for Status {
3995        fn from(value: i32) -> Self {
3996            match value {
3997                0 => Self::Unspecified,
3998                1 => Self::Provisioning,
3999                2 => Self::Running,
4000                3 => Self::Deleting,
4001                4 => Self::Error,
4002                5 => Self::Reconciling,
4003                _ => Self::UnknownValue(status::UnknownValue(
4004                    wkt::internal::UnknownEnumValue::Integer(value),
4005                )),
4006            }
4007        }
4008    }
4009
4010    impl std::convert::From<&str> for Status {
4011        fn from(value: &str) -> Self {
4012            use std::string::ToString;
4013            match value {
4014                "STATUS_UNSPECIFIED" => Self::Unspecified,
4015                "PROVISIONING" => Self::Provisioning,
4016                "RUNNING" => Self::Running,
4017                "DELETING" => Self::Deleting,
4018                "ERROR" => Self::Error,
4019                "RECONCILING" => Self::Reconciling,
4020                _ => Self::UnknownValue(status::UnknownValue(
4021                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4022                )),
4023            }
4024        }
4025    }
4026
4027    impl serde::ser::Serialize for Status {
4028        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4029        where
4030            S: serde::Serializer,
4031        {
4032            match self {
4033                Self::Unspecified => serializer.serialize_i32(0),
4034                Self::Provisioning => serializer.serialize_i32(1),
4035                Self::Running => serializer.serialize_i32(2),
4036                Self::Deleting => serializer.serialize_i32(3),
4037                Self::Error => serializer.serialize_i32(4),
4038                Self::Reconciling => serializer.serialize_i32(5),
4039                Self::UnknownValue(u) => u.0.serialize(serializer),
4040            }
4041        }
4042    }
4043
4044    impl<'de> serde::de::Deserialize<'de> for Status {
4045        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4046        where
4047            D: serde::Deserializer<'de>,
4048        {
4049            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
4050                ".google.cloud.edgecontainer.v1.Cluster.Status",
4051            ))
4052        }
4053    }
4054
4055    /// The release channel a cluster is subscribed to.
4056    ///
4057    /// # Working with unknown values
4058    ///
4059    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4060    /// additional enum variants at any time. Adding new variants is not considered
4061    /// a breaking change. Applications should write their code in anticipation of:
4062    ///
4063    /// - New values appearing in future releases of the client library, **and**
4064    /// - New values received dynamically, without application changes.
4065    ///
4066    /// Please consult the [Working with enums] section in the user guide for some
4067    /// guidelines.
4068    ///
4069    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4070    #[derive(Clone, Debug, PartialEq)]
4071    #[non_exhaustive]
4072    pub enum ReleaseChannel {
4073        /// Unspecified release channel. This will default to the REGULAR channel.
4074        Unspecified,
4075        /// No release channel.
4076        None,
4077        /// Regular release channel.
4078        Regular,
4079        /// If set, the enum was initialized with an unknown value.
4080        ///
4081        /// Applications can examine the value using [ReleaseChannel::value] or
4082        /// [ReleaseChannel::name].
4083        UnknownValue(release_channel::UnknownValue),
4084    }
4085
4086    #[doc(hidden)]
4087    pub mod release_channel {
4088        #[allow(unused_imports)]
4089        use super::*;
4090        #[derive(Clone, Debug, PartialEq)]
4091        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4092    }
4093
4094    impl ReleaseChannel {
4095        /// Gets the enum value.
4096        ///
4097        /// Returns `None` if the enum contains an unknown value deserialized from
4098        /// the string representation of enums.
4099        pub fn value(&self) -> std::option::Option<i32> {
4100            match self {
4101                Self::Unspecified => std::option::Option::Some(0),
4102                Self::None => std::option::Option::Some(1),
4103                Self::Regular => std::option::Option::Some(2),
4104                Self::UnknownValue(u) => u.0.value(),
4105            }
4106        }
4107
4108        /// Gets the enum value as a string.
4109        ///
4110        /// Returns `None` if the enum contains an unknown value deserialized from
4111        /// the integer representation of enums.
4112        pub fn name(&self) -> std::option::Option<&str> {
4113            match self {
4114                Self::Unspecified => std::option::Option::Some("RELEASE_CHANNEL_UNSPECIFIED"),
4115                Self::None => std::option::Option::Some("NONE"),
4116                Self::Regular => std::option::Option::Some("REGULAR"),
4117                Self::UnknownValue(u) => u.0.name(),
4118            }
4119        }
4120    }
4121
4122    impl std::default::Default for ReleaseChannel {
4123        fn default() -> Self {
4124            use std::convert::From;
4125            Self::from(0)
4126        }
4127    }
4128
4129    impl std::fmt::Display for ReleaseChannel {
4130        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4131            wkt::internal::display_enum(f, self.name(), self.value())
4132        }
4133    }
4134
4135    impl std::convert::From<i32> for ReleaseChannel {
4136        fn from(value: i32) -> Self {
4137            match value {
4138                0 => Self::Unspecified,
4139                1 => Self::None,
4140                2 => Self::Regular,
4141                _ => Self::UnknownValue(release_channel::UnknownValue(
4142                    wkt::internal::UnknownEnumValue::Integer(value),
4143                )),
4144            }
4145        }
4146    }
4147
4148    impl std::convert::From<&str> for ReleaseChannel {
4149        fn from(value: &str) -> Self {
4150            use std::string::ToString;
4151            match value {
4152                "RELEASE_CHANNEL_UNSPECIFIED" => Self::Unspecified,
4153                "NONE" => Self::None,
4154                "REGULAR" => Self::Regular,
4155                _ => Self::UnknownValue(release_channel::UnknownValue(
4156                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4157                )),
4158            }
4159        }
4160    }
4161
4162    impl serde::ser::Serialize for ReleaseChannel {
4163        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4164        where
4165            S: serde::Serializer,
4166        {
4167            match self {
4168                Self::Unspecified => serializer.serialize_i32(0),
4169                Self::None => serializer.serialize_i32(1),
4170                Self::Regular => serializer.serialize_i32(2),
4171                Self::UnknownValue(u) => u.0.serialize(serializer),
4172            }
4173        }
4174    }
4175
4176    impl<'de> serde::de::Deserialize<'de> for ReleaseChannel {
4177        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4178        where
4179            D: serde::Deserializer<'de>,
4180        {
4181            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReleaseChannel>::new(
4182                ".google.cloud.edgecontainer.v1.Cluster.ReleaseChannel",
4183            ))
4184        }
4185    }
4186}
4187
4188/// Cluster-wide networking configuration.
4189#[derive(Clone, Debug, Default, PartialEq)]
4190#[non_exhaustive]
4191pub struct ClusterNetworking {
4192    /// Required. All pods in the cluster are assigned an RFC1918 IPv4 address from
4193    /// these blocks. Only a single block is supported. This field cannot be
4194    /// changed after creation.
4195    pub cluster_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
4196
4197    /// Required. All services in the cluster are assigned an RFC1918 IPv4 address
4198    /// from these blocks. Only a single block is supported. This field cannot be
4199    /// changed after creation.
4200    pub services_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
4201
4202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4203}
4204
4205impl ClusterNetworking {
4206    pub fn new() -> Self {
4207        std::default::Default::default()
4208    }
4209
4210    /// Sets the value of [cluster_ipv4_cidr_blocks][crate::model::ClusterNetworking::cluster_ipv4_cidr_blocks].
4211    pub fn set_cluster_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
4212    where
4213        T: std::iter::IntoIterator<Item = V>,
4214        V: std::convert::Into<std::string::String>,
4215    {
4216        use std::iter::Iterator;
4217        self.cluster_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
4218        self
4219    }
4220
4221    /// Sets the value of [services_ipv4_cidr_blocks][crate::model::ClusterNetworking::services_ipv4_cidr_blocks].
4222    pub fn set_services_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
4223    where
4224        T: std::iter::IntoIterator<Item = V>,
4225        V: std::convert::Into<std::string::String>,
4226    {
4227        use std::iter::Iterator;
4228        self.services_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
4229        self
4230    }
4231}
4232
4233impl wkt::message::Message for ClusterNetworking {
4234    fn typename() -> &'static str {
4235        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterNetworking"
4236    }
4237}
4238
4239#[doc(hidden)]
4240impl<'de> serde::de::Deserialize<'de> for ClusterNetworking {
4241    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4242    where
4243        D: serde::Deserializer<'de>,
4244    {
4245        #[allow(non_camel_case_types)]
4246        #[doc(hidden)]
4247        #[derive(PartialEq, Eq, Hash)]
4248        enum __FieldTag {
4249            __cluster_ipv4_cidr_blocks,
4250            __services_ipv4_cidr_blocks,
4251            Unknown(std::string::String),
4252        }
4253        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4254            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4255            where
4256                D: serde::Deserializer<'de>,
4257            {
4258                struct Visitor;
4259                impl<'de> serde::de::Visitor<'de> for Visitor {
4260                    type Value = __FieldTag;
4261                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4262                        formatter.write_str("a field name for ClusterNetworking")
4263                    }
4264                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4265                    where
4266                        E: serde::de::Error,
4267                    {
4268                        use std::result::Result::Ok;
4269                        use std::string::ToString;
4270                        match value {
4271                            "clusterIpv4CidrBlocks" => Ok(__FieldTag::__cluster_ipv4_cidr_blocks),
4272                            "cluster_ipv4_cidr_blocks" => {
4273                                Ok(__FieldTag::__cluster_ipv4_cidr_blocks)
4274                            }
4275                            "servicesIpv4CidrBlocks" => Ok(__FieldTag::__services_ipv4_cidr_blocks),
4276                            "services_ipv4_cidr_blocks" => {
4277                                Ok(__FieldTag::__services_ipv4_cidr_blocks)
4278                            }
4279                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4280                        }
4281                    }
4282                }
4283                deserializer.deserialize_identifier(Visitor)
4284            }
4285        }
4286        struct Visitor;
4287        impl<'de> serde::de::Visitor<'de> for Visitor {
4288            type Value = ClusterNetworking;
4289            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4290                formatter.write_str("struct ClusterNetworking")
4291            }
4292            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4293            where
4294                A: serde::de::MapAccess<'de>,
4295            {
4296                #[allow(unused_imports)]
4297                use serde::de::Error;
4298                use std::option::Option::Some;
4299                let mut fields = std::collections::HashSet::new();
4300                let mut result = Self::Value::new();
4301                while let Some(tag) = map.next_key::<__FieldTag>()? {
4302                    #[allow(clippy::match_single_binding)]
4303                    match tag {
4304                        __FieldTag::__cluster_ipv4_cidr_blocks => {
4305                            if !fields.insert(__FieldTag::__cluster_ipv4_cidr_blocks) {
4306                                return std::result::Result::Err(A::Error::duplicate_field(
4307                                    "multiple values for cluster_ipv4_cidr_blocks",
4308                                ));
4309                            }
4310                            result.cluster_ipv4_cidr_blocks = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
4311                        }
4312                        __FieldTag::__services_ipv4_cidr_blocks => {
4313                            if !fields.insert(__FieldTag::__services_ipv4_cidr_blocks) {
4314                                return std::result::Result::Err(A::Error::duplicate_field(
4315                                    "multiple values for services_ipv4_cidr_blocks",
4316                                ));
4317                            }
4318                            result.services_ipv4_cidr_blocks = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
4319                        }
4320                        __FieldTag::Unknown(key) => {
4321                            let value = map.next_value::<serde_json::Value>()?;
4322                            result._unknown_fields.insert(key, value);
4323                        }
4324                    }
4325                }
4326                std::result::Result::Ok(result)
4327            }
4328        }
4329        deserializer.deserialize_any(Visitor)
4330    }
4331}
4332
4333#[doc(hidden)]
4334impl serde::ser::Serialize for ClusterNetworking {
4335    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4336    where
4337        S: serde::ser::Serializer,
4338    {
4339        use serde::ser::SerializeMap;
4340        #[allow(unused_imports)]
4341        use std::option::Option::Some;
4342        let mut state = serializer.serialize_map(std::option::Option::None)?;
4343        if !self.cluster_ipv4_cidr_blocks.is_empty() {
4344            state.serialize_entry("clusterIpv4CidrBlocks", &self.cluster_ipv4_cidr_blocks)?;
4345        }
4346        if !self.services_ipv4_cidr_blocks.is_empty() {
4347            state.serialize_entry("servicesIpv4CidrBlocks", &self.services_ipv4_cidr_blocks)?;
4348        }
4349        if !self._unknown_fields.is_empty() {
4350            for (key, value) in self._unknown_fields.iter() {
4351                state.serialize_entry(key, &value)?;
4352            }
4353        }
4354        state.end()
4355    }
4356}
4357
4358/// Fleet related configuration.
4359///
4360/// Fleets are a Google Cloud concept for logically organizing clusters,
4361/// letting you use and manage multi-cluster capabilities and apply
4362/// consistent policies across your systems.
4363#[derive(Clone, Debug, Default, PartialEq)]
4364#[non_exhaustive]
4365pub struct Fleet {
4366    /// Required. The name of the Fleet host project where this cluster will be
4367    /// registered.
4368    ///
4369    /// Project names are formatted as
4370    /// `projects/<project-number>`.
4371    pub project: std::string::String,
4372
4373    /// Output only. The name of the managed Hub Membership resource associated to
4374    /// this cluster.
4375    ///
4376    /// Membership names are formatted as
4377    /// `projects/<project-number>/locations/global/membership/<cluster-id>`.
4378    pub membership: std::string::String,
4379
4380    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4381}
4382
4383impl Fleet {
4384    pub fn new() -> Self {
4385        std::default::Default::default()
4386    }
4387
4388    /// Sets the value of [project][crate::model::Fleet::project].
4389    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4390        self.project = v.into();
4391        self
4392    }
4393
4394    /// Sets the value of [membership][crate::model::Fleet::membership].
4395    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4396        self.membership = v.into();
4397        self
4398    }
4399}
4400
4401impl wkt::message::Message for Fleet {
4402    fn typename() -> &'static str {
4403        "type.googleapis.com/google.cloud.edgecontainer.v1.Fleet"
4404    }
4405}
4406
4407#[doc(hidden)]
4408impl<'de> serde::de::Deserialize<'de> for Fleet {
4409    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4410    where
4411        D: serde::Deserializer<'de>,
4412    {
4413        #[allow(non_camel_case_types)]
4414        #[doc(hidden)]
4415        #[derive(PartialEq, Eq, Hash)]
4416        enum __FieldTag {
4417            __project,
4418            __membership,
4419            Unknown(std::string::String),
4420        }
4421        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4422            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4423            where
4424                D: serde::Deserializer<'de>,
4425            {
4426                struct Visitor;
4427                impl<'de> serde::de::Visitor<'de> for Visitor {
4428                    type Value = __FieldTag;
4429                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4430                        formatter.write_str("a field name for Fleet")
4431                    }
4432                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4433                    where
4434                        E: serde::de::Error,
4435                    {
4436                        use std::result::Result::Ok;
4437                        use std::string::ToString;
4438                        match value {
4439                            "project" => Ok(__FieldTag::__project),
4440                            "membership" => Ok(__FieldTag::__membership),
4441                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4442                        }
4443                    }
4444                }
4445                deserializer.deserialize_identifier(Visitor)
4446            }
4447        }
4448        struct Visitor;
4449        impl<'de> serde::de::Visitor<'de> for Visitor {
4450            type Value = Fleet;
4451            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4452                formatter.write_str("struct Fleet")
4453            }
4454            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4455            where
4456                A: serde::de::MapAccess<'de>,
4457            {
4458                #[allow(unused_imports)]
4459                use serde::de::Error;
4460                use std::option::Option::Some;
4461                let mut fields = std::collections::HashSet::new();
4462                let mut result = Self::Value::new();
4463                while let Some(tag) = map.next_key::<__FieldTag>()? {
4464                    #[allow(clippy::match_single_binding)]
4465                    match tag {
4466                        __FieldTag::__project => {
4467                            if !fields.insert(__FieldTag::__project) {
4468                                return std::result::Result::Err(A::Error::duplicate_field(
4469                                    "multiple values for project",
4470                                ));
4471                            }
4472                            result.project = map
4473                                .next_value::<std::option::Option<std::string::String>>()?
4474                                .unwrap_or_default();
4475                        }
4476                        __FieldTag::__membership => {
4477                            if !fields.insert(__FieldTag::__membership) {
4478                                return std::result::Result::Err(A::Error::duplicate_field(
4479                                    "multiple values for membership",
4480                                ));
4481                            }
4482                            result.membership = map
4483                                .next_value::<std::option::Option<std::string::String>>()?
4484                                .unwrap_or_default();
4485                        }
4486                        __FieldTag::Unknown(key) => {
4487                            let value = map.next_value::<serde_json::Value>()?;
4488                            result._unknown_fields.insert(key, value);
4489                        }
4490                    }
4491                }
4492                std::result::Result::Ok(result)
4493            }
4494        }
4495        deserializer.deserialize_any(Visitor)
4496    }
4497}
4498
4499#[doc(hidden)]
4500impl serde::ser::Serialize for Fleet {
4501    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4502    where
4503        S: serde::ser::Serializer,
4504    {
4505        use serde::ser::SerializeMap;
4506        #[allow(unused_imports)]
4507        use std::option::Option::Some;
4508        let mut state = serializer.serialize_map(std::option::Option::None)?;
4509        if !self.project.is_empty() {
4510            state.serialize_entry("project", &self.project)?;
4511        }
4512        if !self.membership.is_empty() {
4513            state.serialize_entry("membership", &self.membership)?;
4514        }
4515        if !self._unknown_fields.is_empty() {
4516            for (key, value) in self._unknown_fields.iter() {
4517                state.serialize_entry(key, &value)?;
4518            }
4519        }
4520        state.end()
4521    }
4522}
4523
4524/// A user principal for an RBAC policy.
4525#[derive(Clone, Debug, Default, PartialEq)]
4526#[non_exhaustive]
4527pub struct ClusterUser {
4528    /// Required. An active Google username.
4529    pub username: std::string::String,
4530
4531    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4532}
4533
4534impl ClusterUser {
4535    pub fn new() -> Self {
4536        std::default::Default::default()
4537    }
4538
4539    /// Sets the value of [username][crate::model::ClusterUser::username].
4540    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541        self.username = v.into();
4542        self
4543    }
4544}
4545
4546impl wkt::message::Message for ClusterUser {
4547    fn typename() -> &'static str {
4548        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterUser"
4549    }
4550}
4551
4552#[doc(hidden)]
4553impl<'de> serde::de::Deserialize<'de> for ClusterUser {
4554    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4555    where
4556        D: serde::Deserializer<'de>,
4557    {
4558        #[allow(non_camel_case_types)]
4559        #[doc(hidden)]
4560        #[derive(PartialEq, Eq, Hash)]
4561        enum __FieldTag {
4562            __username,
4563            Unknown(std::string::String),
4564        }
4565        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4566            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4567            where
4568                D: serde::Deserializer<'de>,
4569            {
4570                struct Visitor;
4571                impl<'de> serde::de::Visitor<'de> for Visitor {
4572                    type Value = __FieldTag;
4573                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4574                        formatter.write_str("a field name for ClusterUser")
4575                    }
4576                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4577                    where
4578                        E: serde::de::Error,
4579                    {
4580                        use std::result::Result::Ok;
4581                        use std::string::ToString;
4582                        match value {
4583                            "username" => Ok(__FieldTag::__username),
4584                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4585                        }
4586                    }
4587                }
4588                deserializer.deserialize_identifier(Visitor)
4589            }
4590        }
4591        struct Visitor;
4592        impl<'de> serde::de::Visitor<'de> for Visitor {
4593            type Value = ClusterUser;
4594            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4595                formatter.write_str("struct ClusterUser")
4596            }
4597            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4598            where
4599                A: serde::de::MapAccess<'de>,
4600            {
4601                #[allow(unused_imports)]
4602                use serde::de::Error;
4603                use std::option::Option::Some;
4604                let mut fields = std::collections::HashSet::new();
4605                let mut result = Self::Value::new();
4606                while let Some(tag) = map.next_key::<__FieldTag>()? {
4607                    #[allow(clippy::match_single_binding)]
4608                    match tag {
4609                        __FieldTag::__username => {
4610                            if !fields.insert(__FieldTag::__username) {
4611                                return std::result::Result::Err(A::Error::duplicate_field(
4612                                    "multiple values for username",
4613                                ));
4614                            }
4615                            result.username = map
4616                                .next_value::<std::option::Option<std::string::String>>()?
4617                                .unwrap_or_default();
4618                        }
4619                        __FieldTag::Unknown(key) => {
4620                            let value = map.next_value::<serde_json::Value>()?;
4621                            result._unknown_fields.insert(key, value);
4622                        }
4623                    }
4624                }
4625                std::result::Result::Ok(result)
4626            }
4627        }
4628        deserializer.deserialize_any(Visitor)
4629    }
4630}
4631
4632#[doc(hidden)]
4633impl serde::ser::Serialize for ClusterUser {
4634    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4635    where
4636        S: serde::ser::Serializer,
4637    {
4638        use serde::ser::SerializeMap;
4639        #[allow(unused_imports)]
4640        use std::option::Option::Some;
4641        let mut state = serializer.serialize_map(std::option::Option::None)?;
4642        if !self.username.is_empty() {
4643            state.serialize_entry("username", &self.username)?;
4644        }
4645        if !self._unknown_fields.is_empty() {
4646            for (key, value) in self._unknown_fields.iter() {
4647                state.serialize_entry(key, &value)?;
4648            }
4649        }
4650        state.end()
4651    }
4652}
4653
4654/// RBAC policy that will be applied and managed by GEC.
4655#[derive(Clone, Debug, Default, PartialEq)]
4656#[non_exhaustive]
4657pub struct Authorization {
4658    /// Required. User that will be granted the cluster-admin role on the cluster,
4659    /// providing full access to the cluster. Currently, this is a singular field,
4660    /// but will be expanded to allow multiple admins in the future.
4661    pub admin_users: std::option::Option<crate::model::ClusterUser>,
4662
4663    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4664}
4665
4666impl Authorization {
4667    pub fn new() -> Self {
4668        std::default::Default::default()
4669    }
4670
4671    /// Sets the value of [admin_users][crate::model::Authorization::admin_users].
4672    pub fn set_admin_users<T>(mut self, v: T) -> Self
4673    where
4674        T: std::convert::Into<crate::model::ClusterUser>,
4675    {
4676        self.admin_users = std::option::Option::Some(v.into());
4677        self
4678    }
4679
4680    /// Sets or clears the value of [admin_users][crate::model::Authorization::admin_users].
4681    pub fn set_or_clear_admin_users<T>(mut self, v: std::option::Option<T>) -> Self
4682    where
4683        T: std::convert::Into<crate::model::ClusterUser>,
4684    {
4685        self.admin_users = v.map(|x| x.into());
4686        self
4687    }
4688}
4689
4690impl wkt::message::Message for Authorization {
4691    fn typename() -> &'static str {
4692        "type.googleapis.com/google.cloud.edgecontainer.v1.Authorization"
4693    }
4694}
4695
4696#[doc(hidden)]
4697impl<'de> serde::de::Deserialize<'de> for Authorization {
4698    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4699    where
4700        D: serde::Deserializer<'de>,
4701    {
4702        #[allow(non_camel_case_types)]
4703        #[doc(hidden)]
4704        #[derive(PartialEq, Eq, Hash)]
4705        enum __FieldTag {
4706            __admin_users,
4707            Unknown(std::string::String),
4708        }
4709        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4710            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4711            where
4712                D: serde::Deserializer<'de>,
4713            {
4714                struct Visitor;
4715                impl<'de> serde::de::Visitor<'de> for Visitor {
4716                    type Value = __FieldTag;
4717                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4718                        formatter.write_str("a field name for Authorization")
4719                    }
4720                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4721                    where
4722                        E: serde::de::Error,
4723                    {
4724                        use std::result::Result::Ok;
4725                        use std::string::ToString;
4726                        match value {
4727                            "adminUsers" => Ok(__FieldTag::__admin_users),
4728                            "admin_users" => Ok(__FieldTag::__admin_users),
4729                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4730                        }
4731                    }
4732                }
4733                deserializer.deserialize_identifier(Visitor)
4734            }
4735        }
4736        struct Visitor;
4737        impl<'de> serde::de::Visitor<'de> for Visitor {
4738            type Value = Authorization;
4739            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4740                formatter.write_str("struct Authorization")
4741            }
4742            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4743            where
4744                A: serde::de::MapAccess<'de>,
4745            {
4746                #[allow(unused_imports)]
4747                use serde::de::Error;
4748                use std::option::Option::Some;
4749                let mut fields = std::collections::HashSet::new();
4750                let mut result = Self::Value::new();
4751                while let Some(tag) = map.next_key::<__FieldTag>()? {
4752                    #[allow(clippy::match_single_binding)]
4753                    match tag {
4754                        __FieldTag::__admin_users => {
4755                            if !fields.insert(__FieldTag::__admin_users) {
4756                                return std::result::Result::Err(A::Error::duplicate_field(
4757                                    "multiple values for admin_users",
4758                                ));
4759                            }
4760                            result.admin_users =
4761                                map.next_value::<std::option::Option<crate::model::ClusterUser>>()?;
4762                        }
4763                        __FieldTag::Unknown(key) => {
4764                            let value = map.next_value::<serde_json::Value>()?;
4765                            result._unknown_fields.insert(key, value);
4766                        }
4767                    }
4768                }
4769                std::result::Result::Ok(result)
4770            }
4771        }
4772        deserializer.deserialize_any(Visitor)
4773    }
4774}
4775
4776#[doc(hidden)]
4777impl serde::ser::Serialize for Authorization {
4778    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4779    where
4780        S: serde::ser::Serializer,
4781    {
4782        use serde::ser::SerializeMap;
4783        #[allow(unused_imports)]
4784        use std::option::Option::Some;
4785        let mut state = serializer.serialize_map(std::option::Option::None)?;
4786        if self.admin_users.is_some() {
4787            state.serialize_entry("adminUsers", &self.admin_users)?;
4788        }
4789        if !self._unknown_fields.is_empty() {
4790            for (key, value) in self._unknown_fields.iter() {
4791                state.serialize_entry(key, &value)?;
4792            }
4793        }
4794        state.end()
4795    }
4796}
4797
4798/// A set of Kubernetes nodes in a cluster with common configuration and
4799/// specification.
4800#[derive(Clone, Debug, Default, PartialEq)]
4801#[non_exhaustive]
4802pub struct NodePool {
4803    /// Required. The resource name of the node pool.
4804    pub name: std::string::String,
4805
4806    /// Output only. The time when the node pool was created.
4807    pub create_time: std::option::Option<wkt::Timestamp>,
4808
4809    /// Output only. The time when the node pool was last updated.
4810    pub update_time: std::option::Option<wkt::Timestamp>,
4811
4812    /// Labels associated with this resource.
4813    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4814
4815    /// Name of the Google Distributed Cloud Edge zone where this node pool will be
4816    /// created. For example: `us-central1-edge-customer-a`.
4817    pub node_location: std::string::String,
4818
4819    /// Required. The number of nodes in the pool.
4820    pub node_count: i32,
4821
4822    /// Only machines matching this filter will be allowed to join the node pool.
4823    /// The filtering language accepts strings like "name=\<name\>", and is
4824    /// documented in more detail in [AIP-160](https://google.aip.dev/160).
4825    pub machine_filter: std::string::String,
4826
4827    /// Optional. Local disk encryption options. This field is only used when
4828    /// enabling CMEK support.
4829    pub local_disk_encryption: std::option::Option<crate::model::node_pool::LocalDiskEncryption>,
4830
4831    /// Output only. The lowest release version among all worker nodes.
4832    pub node_version: std::string::String,
4833
4834    /// Optional. Configuration for each node in the NodePool
4835    pub node_config: std::option::Option<crate::model::node_pool::NodeConfig>,
4836
4837    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4838}
4839
4840impl NodePool {
4841    pub fn new() -> Self {
4842        std::default::Default::default()
4843    }
4844
4845    /// Sets the value of [name][crate::model::NodePool::name].
4846    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4847        self.name = v.into();
4848        self
4849    }
4850
4851    /// Sets the value of [create_time][crate::model::NodePool::create_time].
4852    pub fn set_create_time<T>(mut self, v: T) -> Self
4853    where
4854        T: std::convert::Into<wkt::Timestamp>,
4855    {
4856        self.create_time = std::option::Option::Some(v.into());
4857        self
4858    }
4859
4860    /// Sets or clears the value of [create_time][crate::model::NodePool::create_time].
4861    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4862    where
4863        T: std::convert::Into<wkt::Timestamp>,
4864    {
4865        self.create_time = v.map(|x| x.into());
4866        self
4867    }
4868
4869    /// Sets the value of [update_time][crate::model::NodePool::update_time].
4870    pub fn set_update_time<T>(mut self, v: T) -> Self
4871    where
4872        T: std::convert::Into<wkt::Timestamp>,
4873    {
4874        self.update_time = std::option::Option::Some(v.into());
4875        self
4876    }
4877
4878    /// Sets or clears the value of [update_time][crate::model::NodePool::update_time].
4879    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4880    where
4881        T: std::convert::Into<wkt::Timestamp>,
4882    {
4883        self.update_time = v.map(|x| x.into());
4884        self
4885    }
4886
4887    /// Sets the value of [labels][crate::model::NodePool::labels].
4888    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4889    where
4890        T: std::iter::IntoIterator<Item = (K, V)>,
4891        K: std::convert::Into<std::string::String>,
4892        V: std::convert::Into<std::string::String>,
4893    {
4894        use std::iter::Iterator;
4895        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4896        self
4897    }
4898
4899    /// Sets the value of [node_location][crate::model::NodePool::node_location].
4900    pub fn set_node_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4901        self.node_location = v.into();
4902        self
4903    }
4904
4905    /// Sets the value of [node_count][crate::model::NodePool::node_count].
4906    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4907        self.node_count = v.into();
4908        self
4909    }
4910
4911    /// Sets the value of [machine_filter][crate::model::NodePool::machine_filter].
4912    pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4913        self.machine_filter = v.into();
4914        self
4915    }
4916
4917    /// Sets the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
4918    pub fn set_local_disk_encryption<T>(mut self, v: T) -> Self
4919    where
4920        T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
4921    {
4922        self.local_disk_encryption = std::option::Option::Some(v.into());
4923        self
4924    }
4925
4926    /// Sets or clears the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
4927    pub fn set_or_clear_local_disk_encryption<T>(mut self, v: std::option::Option<T>) -> Self
4928    where
4929        T: std::convert::Into<crate::model::node_pool::LocalDiskEncryption>,
4930    {
4931        self.local_disk_encryption = v.map(|x| x.into());
4932        self
4933    }
4934
4935    /// Sets the value of [node_version][crate::model::NodePool::node_version].
4936    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4937        self.node_version = v.into();
4938        self
4939    }
4940
4941    /// Sets the value of [node_config][crate::model::NodePool::node_config].
4942    pub fn set_node_config<T>(mut self, v: T) -> Self
4943    where
4944        T: std::convert::Into<crate::model::node_pool::NodeConfig>,
4945    {
4946        self.node_config = std::option::Option::Some(v.into());
4947        self
4948    }
4949
4950    /// Sets or clears the value of [node_config][crate::model::NodePool::node_config].
4951    pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
4952    where
4953        T: std::convert::Into<crate::model::node_pool::NodeConfig>,
4954    {
4955        self.node_config = v.map(|x| x.into());
4956        self
4957    }
4958}
4959
4960impl wkt::message::Message for NodePool {
4961    fn typename() -> &'static str {
4962        "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool"
4963    }
4964}
4965
4966#[doc(hidden)]
4967impl<'de> serde::de::Deserialize<'de> for NodePool {
4968    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4969    where
4970        D: serde::Deserializer<'de>,
4971    {
4972        #[allow(non_camel_case_types)]
4973        #[doc(hidden)]
4974        #[derive(PartialEq, Eq, Hash)]
4975        enum __FieldTag {
4976            __name,
4977            __create_time,
4978            __update_time,
4979            __labels,
4980            __node_location,
4981            __node_count,
4982            __machine_filter,
4983            __local_disk_encryption,
4984            __node_version,
4985            __node_config,
4986            Unknown(std::string::String),
4987        }
4988        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4989            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4990            where
4991                D: serde::Deserializer<'de>,
4992            {
4993                struct Visitor;
4994                impl<'de> serde::de::Visitor<'de> for Visitor {
4995                    type Value = __FieldTag;
4996                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4997                        formatter.write_str("a field name for NodePool")
4998                    }
4999                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5000                    where
5001                        E: serde::de::Error,
5002                    {
5003                        use std::result::Result::Ok;
5004                        use std::string::ToString;
5005                        match value {
5006                            "name" => Ok(__FieldTag::__name),
5007                            "createTime" => Ok(__FieldTag::__create_time),
5008                            "create_time" => Ok(__FieldTag::__create_time),
5009                            "updateTime" => Ok(__FieldTag::__update_time),
5010                            "update_time" => Ok(__FieldTag::__update_time),
5011                            "labels" => Ok(__FieldTag::__labels),
5012                            "nodeLocation" => Ok(__FieldTag::__node_location),
5013                            "node_location" => Ok(__FieldTag::__node_location),
5014                            "nodeCount" => Ok(__FieldTag::__node_count),
5015                            "node_count" => Ok(__FieldTag::__node_count),
5016                            "machineFilter" => Ok(__FieldTag::__machine_filter),
5017                            "machine_filter" => Ok(__FieldTag::__machine_filter),
5018                            "localDiskEncryption" => Ok(__FieldTag::__local_disk_encryption),
5019                            "local_disk_encryption" => Ok(__FieldTag::__local_disk_encryption),
5020                            "nodeVersion" => Ok(__FieldTag::__node_version),
5021                            "node_version" => Ok(__FieldTag::__node_version),
5022                            "nodeConfig" => Ok(__FieldTag::__node_config),
5023                            "node_config" => Ok(__FieldTag::__node_config),
5024                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5025                        }
5026                    }
5027                }
5028                deserializer.deserialize_identifier(Visitor)
5029            }
5030        }
5031        struct Visitor;
5032        impl<'de> serde::de::Visitor<'de> for Visitor {
5033            type Value = NodePool;
5034            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5035                formatter.write_str("struct NodePool")
5036            }
5037            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5038            where
5039                A: serde::de::MapAccess<'de>,
5040            {
5041                #[allow(unused_imports)]
5042                use serde::de::Error;
5043                use std::option::Option::Some;
5044                let mut fields = std::collections::HashSet::new();
5045                let mut result = Self::Value::new();
5046                while let Some(tag) = map.next_key::<__FieldTag>()? {
5047                    #[allow(clippy::match_single_binding)]
5048                    match tag {
5049                        __FieldTag::__name => {
5050                            if !fields.insert(__FieldTag::__name) {
5051                                return std::result::Result::Err(A::Error::duplicate_field(
5052                                    "multiple values for name",
5053                                ));
5054                            }
5055                            result.name = map
5056                                .next_value::<std::option::Option<std::string::String>>()?
5057                                .unwrap_or_default();
5058                        }
5059                        __FieldTag::__create_time => {
5060                            if !fields.insert(__FieldTag::__create_time) {
5061                                return std::result::Result::Err(A::Error::duplicate_field(
5062                                    "multiple values for create_time",
5063                                ));
5064                            }
5065                            result.create_time =
5066                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5067                        }
5068                        __FieldTag::__update_time => {
5069                            if !fields.insert(__FieldTag::__update_time) {
5070                                return std::result::Result::Err(A::Error::duplicate_field(
5071                                    "multiple values for update_time",
5072                                ));
5073                            }
5074                            result.update_time =
5075                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5076                        }
5077                        __FieldTag::__labels => {
5078                            if !fields.insert(__FieldTag::__labels) {
5079                                return std::result::Result::Err(A::Error::duplicate_field(
5080                                    "multiple values for labels",
5081                                ));
5082                            }
5083                            result.labels = map
5084                                .next_value::<std::option::Option<
5085                                    std::collections::HashMap<
5086                                        std::string::String,
5087                                        std::string::String,
5088                                    >,
5089                                >>()?
5090                                .unwrap_or_default();
5091                        }
5092                        __FieldTag::__node_location => {
5093                            if !fields.insert(__FieldTag::__node_location) {
5094                                return std::result::Result::Err(A::Error::duplicate_field(
5095                                    "multiple values for node_location",
5096                                ));
5097                            }
5098                            result.node_location = map
5099                                .next_value::<std::option::Option<std::string::String>>()?
5100                                .unwrap_or_default();
5101                        }
5102                        __FieldTag::__node_count => {
5103                            if !fields.insert(__FieldTag::__node_count) {
5104                                return std::result::Result::Err(A::Error::duplicate_field(
5105                                    "multiple values for node_count",
5106                                ));
5107                            }
5108                            struct __With(std::option::Option<i32>);
5109                            impl<'de> serde::de::Deserialize<'de> for __With {
5110                                fn deserialize<D>(
5111                                    deserializer: D,
5112                                ) -> std::result::Result<Self, D::Error>
5113                                where
5114                                    D: serde::de::Deserializer<'de>,
5115                                {
5116                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5117                                }
5118                            }
5119                            result.node_count = map.next_value::<__With>()?.0.unwrap_or_default();
5120                        }
5121                        __FieldTag::__machine_filter => {
5122                            if !fields.insert(__FieldTag::__machine_filter) {
5123                                return std::result::Result::Err(A::Error::duplicate_field(
5124                                    "multiple values for machine_filter",
5125                                ));
5126                            }
5127                            result.machine_filter = map
5128                                .next_value::<std::option::Option<std::string::String>>()?
5129                                .unwrap_or_default();
5130                        }
5131                        __FieldTag::__local_disk_encryption => {
5132                            if !fields.insert(__FieldTag::__local_disk_encryption) {
5133                                return std::result::Result::Err(A::Error::duplicate_field(
5134                                    "multiple values for local_disk_encryption",
5135                                ));
5136                            }
5137                            result.local_disk_encryption =
5138                                map.next_value::<std::option::Option<
5139                                    crate::model::node_pool::LocalDiskEncryption,
5140                                >>()?;
5141                        }
5142                        __FieldTag::__node_version => {
5143                            if !fields.insert(__FieldTag::__node_version) {
5144                                return std::result::Result::Err(A::Error::duplicate_field(
5145                                    "multiple values for node_version",
5146                                ));
5147                            }
5148                            result.node_version = map
5149                                .next_value::<std::option::Option<std::string::String>>()?
5150                                .unwrap_or_default();
5151                        }
5152                        __FieldTag::__node_config => {
5153                            if !fields.insert(__FieldTag::__node_config) {
5154                                return std::result::Result::Err(A::Error::duplicate_field(
5155                                    "multiple values for node_config",
5156                                ));
5157                            }
5158                            result.node_config = map.next_value::<std::option::Option<crate::model::node_pool::NodeConfig>>()?
5159                                ;
5160                        }
5161                        __FieldTag::Unknown(key) => {
5162                            let value = map.next_value::<serde_json::Value>()?;
5163                            result._unknown_fields.insert(key, value);
5164                        }
5165                    }
5166                }
5167                std::result::Result::Ok(result)
5168            }
5169        }
5170        deserializer.deserialize_any(Visitor)
5171    }
5172}
5173
5174#[doc(hidden)]
5175impl serde::ser::Serialize for NodePool {
5176    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5177    where
5178        S: serde::ser::Serializer,
5179    {
5180        use serde::ser::SerializeMap;
5181        #[allow(unused_imports)]
5182        use std::option::Option::Some;
5183        let mut state = serializer.serialize_map(std::option::Option::None)?;
5184        if !self.name.is_empty() {
5185            state.serialize_entry("name", &self.name)?;
5186        }
5187        if self.create_time.is_some() {
5188            state.serialize_entry("createTime", &self.create_time)?;
5189        }
5190        if self.update_time.is_some() {
5191            state.serialize_entry("updateTime", &self.update_time)?;
5192        }
5193        if !self.labels.is_empty() {
5194            state.serialize_entry("labels", &self.labels)?;
5195        }
5196        if !self.node_location.is_empty() {
5197            state.serialize_entry("nodeLocation", &self.node_location)?;
5198        }
5199        if !wkt::internal::is_default(&self.node_count) {
5200            struct __With<'a>(&'a i32);
5201            impl<'a> serde::ser::Serialize for __With<'a> {
5202                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5203                where
5204                    S: serde::ser::Serializer,
5205                {
5206                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5207                }
5208            }
5209            state.serialize_entry("nodeCount", &__With(&self.node_count))?;
5210        }
5211        if !self.machine_filter.is_empty() {
5212            state.serialize_entry("machineFilter", &self.machine_filter)?;
5213        }
5214        if self.local_disk_encryption.is_some() {
5215            state.serialize_entry("localDiskEncryption", &self.local_disk_encryption)?;
5216        }
5217        if !self.node_version.is_empty() {
5218            state.serialize_entry("nodeVersion", &self.node_version)?;
5219        }
5220        if self.node_config.is_some() {
5221            state.serialize_entry("nodeConfig", &self.node_config)?;
5222        }
5223        if !self._unknown_fields.is_empty() {
5224            for (key, value) in self._unknown_fields.iter() {
5225                state.serialize_entry(key, &value)?;
5226            }
5227        }
5228        state.end()
5229    }
5230}
5231
5232/// Defines additional types related to [NodePool].
5233pub mod node_pool {
5234    #[allow(unused_imports)]
5235    use super::*;
5236
5237    /// Configuration for CMEK support for edge machine local disk encryption.
5238    #[derive(Clone, Debug, Default, PartialEq)]
5239    #[non_exhaustive]
5240    pub struct LocalDiskEncryption {
5241        /// Optional. The Cloud KMS CryptoKey e.g.
5242        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
5243        /// to use for protecting node local disks. If not specified, a
5244        /// Google-managed key will be used instead.
5245        pub kms_key: std::string::String,
5246
5247        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
5248        /// protecting node local disks. Only applicable if kms_key is set.
5249        pub kms_key_active_version: std::string::String,
5250
5251        /// Output only. Availability of the Cloud KMS CryptoKey. If not
5252        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
5253        /// local data. This can be caused by a lack of permissions to use the key,
5254        /// or if the key is disabled or deleted.
5255        pub kms_key_state: crate::model::KmsKeyState,
5256
5257        /// Output only. Error status returned by Cloud KMS when using this key. This
5258        /// field may be populated only if `kms_key_state` is not
5259        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
5260        /// error status reported by Cloud KMS.
5261        pub kms_status: std::option::Option<rpc::model::Status>,
5262
5263        /// Output only. The current resource state associated with the cmek.
5264        pub resource_state: crate::model::ResourceState,
5265
5266        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5267    }
5268
5269    impl LocalDiskEncryption {
5270        pub fn new() -> Self {
5271            std::default::Default::default()
5272        }
5273
5274        /// Sets the value of [kms_key][crate::model::node_pool::LocalDiskEncryption::kms_key].
5275        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5276            self.kms_key = v.into();
5277            self
5278        }
5279
5280        /// Sets the value of [kms_key_active_version][crate::model::node_pool::LocalDiskEncryption::kms_key_active_version].
5281        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
5282            mut self,
5283            v: T,
5284        ) -> Self {
5285            self.kms_key_active_version = v.into();
5286            self
5287        }
5288
5289        /// Sets the value of [kms_key_state][crate::model::node_pool::LocalDiskEncryption::kms_key_state].
5290        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
5291            mut self,
5292            v: T,
5293        ) -> Self {
5294            self.kms_key_state = v.into();
5295            self
5296        }
5297
5298        /// Sets the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
5299        pub fn set_kms_status<T>(mut self, v: T) -> Self
5300        where
5301            T: std::convert::Into<rpc::model::Status>,
5302        {
5303            self.kms_status = std::option::Option::Some(v.into());
5304            self
5305        }
5306
5307        /// Sets or clears the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
5308        pub fn set_or_clear_kms_status<T>(mut self, v: std::option::Option<T>) -> Self
5309        where
5310            T: std::convert::Into<rpc::model::Status>,
5311        {
5312            self.kms_status = v.map(|x| x.into());
5313            self
5314        }
5315
5316        /// Sets the value of [resource_state][crate::model::node_pool::LocalDiskEncryption::resource_state].
5317        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
5318            mut self,
5319            v: T,
5320        ) -> Self {
5321            self.resource_state = v.into();
5322            self
5323        }
5324    }
5325
5326    impl wkt::message::Message for LocalDiskEncryption {
5327        fn typename() -> &'static str {
5328            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption"
5329        }
5330    }
5331
5332    #[doc(hidden)]
5333    impl<'de> serde::de::Deserialize<'de> for LocalDiskEncryption {
5334        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5335        where
5336            D: serde::Deserializer<'de>,
5337        {
5338            #[allow(non_camel_case_types)]
5339            #[doc(hidden)]
5340            #[derive(PartialEq, Eq, Hash)]
5341            enum __FieldTag {
5342                __kms_key,
5343                __kms_key_active_version,
5344                __kms_key_state,
5345                __kms_status,
5346                __resource_state,
5347                Unknown(std::string::String),
5348            }
5349            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5350                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5351                where
5352                    D: serde::Deserializer<'de>,
5353                {
5354                    struct Visitor;
5355                    impl<'de> serde::de::Visitor<'de> for Visitor {
5356                        type Value = __FieldTag;
5357                        fn expecting(
5358                            &self,
5359                            formatter: &mut std::fmt::Formatter,
5360                        ) -> std::fmt::Result {
5361                            formatter.write_str("a field name for LocalDiskEncryption")
5362                        }
5363                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5364                        where
5365                            E: serde::de::Error,
5366                        {
5367                            use std::result::Result::Ok;
5368                            use std::string::ToString;
5369                            match value {
5370                                "kmsKey" => Ok(__FieldTag::__kms_key),
5371                                "kms_key" => Ok(__FieldTag::__kms_key),
5372                                "kmsKeyActiveVersion" => Ok(__FieldTag::__kms_key_active_version),
5373                                "kms_key_active_version" => {
5374                                    Ok(__FieldTag::__kms_key_active_version)
5375                                }
5376                                "kmsKeyState" => Ok(__FieldTag::__kms_key_state),
5377                                "kms_key_state" => Ok(__FieldTag::__kms_key_state),
5378                                "kmsStatus" => Ok(__FieldTag::__kms_status),
5379                                "kms_status" => Ok(__FieldTag::__kms_status),
5380                                "resourceState" => Ok(__FieldTag::__resource_state),
5381                                "resource_state" => Ok(__FieldTag::__resource_state),
5382                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5383                            }
5384                        }
5385                    }
5386                    deserializer.deserialize_identifier(Visitor)
5387                }
5388            }
5389            struct Visitor;
5390            impl<'de> serde::de::Visitor<'de> for Visitor {
5391                type Value = LocalDiskEncryption;
5392                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5393                    formatter.write_str("struct LocalDiskEncryption")
5394                }
5395                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5396                where
5397                    A: serde::de::MapAccess<'de>,
5398                {
5399                    #[allow(unused_imports)]
5400                    use serde::de::Error;
5401                    use std::option::Option::Some;
5402                    let mut fields = std::collections::HashSet::new();
5403                    let mut result = Self::Value::new();
5404                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5405                        #[allow(clippy::match_single_binding)]
5406                        match tag {
5407                            __FieldTag::__kms_key => {
5408                                if !fields.insert(__FieldTag::__kms_key) {
5409                                    return std::result::Result::Err(A::Error::duplicate_field(
5410                                        "multiple values for kms_key",
5411                                    ));
5412                                }
5413                                result.kms_key = map
5414                                    .next_value::<std::option::Option<std::string::String>>()?
5415                                    .unwrap_or_default();
5416                            }
5417                            __FieldTag::__kms_key_active_version => {
5418                                if !fields.insert(__FieldTag::__kms_key_active_version) {
5419                                    return std::result::Result::Err(A::Error::duplicate_field(
5420                                        "multiple values for kms_key_active_version",
5421                                    ));
5422                                }
5423                                result.kms_key_active_version = map
5424                                    .next_value::<std::option::Option<std::string::String>>()?
5425                                    .unwrap_or_default();
5426                            }
5427                            __FieldTag::__kms_key_state => {
5428                                if !fields.insert(__FieldTag::__kms_key_state) {
5429                                    return std::result::Result::Err(A::Error::duplicate_field(
5430                                        "multiple values for kms_key_state",
5431                                    ));
5432                                }
5433                                result.kms_key_state = map
5434                                    .next_value::<std::option::Option<crate::model::KmsKeyState>>()?
5435                                    .unwrap_or_default();
5436                            }
5437                            __FieldTag::__kms_status => {
5438                                if !fields.insert(__FieldTag::__kms_status) {
5439                                    return std::result::Result::Err(A::Error::duplicate_field(
5440                                        "multiple values for kms_status",
5441                                    ));
5442                                }
5443                                result.kms_status =
5444                                    map.next_value::<std::option::Option<rpc::model::Status>>()?;
5445                            }
5446                            __FieldTag::__resource_state => {
5447                                if !fields.insert(__FieldTag::__resource_state) {
5448                                    return std::result::Result::Err(A::Error::duplicate_field(
5449                                        "multiple values for resource_state",
5450                                    ));
5451                                }
5452                                result.resource_state = map
5453                                    .next_value::<std::option::Option<crate::model::ResourceState>>(
5454                                    )?
5455                                    .unwrap_or_default();
5456                            }
5457                            __FieldTag::Unknown(key) => {
5458                                let value = map.next_value::<serde_json::Value>()?;
5459                                result._unknown_fields.insert(key, value);
5460                            }
5461                        }
5462                    }
5463                    std::result::Result::Ok(result)
5464                }
5465            }
5466            deserializer.deserialize_any(Visitor)
5467        }
5468    }
5469
5470    #[doc(hidden)]
5471    impl serde::ser::Serialize for LocalDiskEncryption {
5472        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5473        where
5474            S: serde::ser::Serializer,
5475        {
5476            use serde::ser::SerializeMap;
5477            #[allow(unused_imports)]
5478            use std::option::Option::Some;
5479            let mut state = serializer.serialize_map(std::option::Option::None)?;
5480            if !self.kms_key.is_empty() {
5481                state.serialize_entry("kmsKey", &self.kms_key)?;
5482            }
5483            if !self.kms_key_active_version.is_empty() {
5484                state.serialize_entry("kmsKeyActiveVersion", &self.kms_key_active_version)?;
5485            }
5486            if !wkt::internal::is_default(&self.kms_key_state) {
5487                state.serialize_entry("kmsKeyState", &self.kms_key_state)?;
5488            }
5489            if self.kms_status.is_some() {
5490                state.serialize_entry("kmsStatus", &self.kms_status)?;
5491            }
5492            if !wkt::internal::is_default(&self.resource_state) {
5493                state.serialize_entry("resourceState", &self.resource_state)?;
5494            }
5495            if !self._unknown_fields.is_empty() {
5496                for (key, value) in self._unknown_fields.iter() {
5497                    state.serialize_entry(key, &value)?;
5498                }
5499            }
5500            state.end()
5501        }
5502    }
5503
5504    /// Configuration for each node in the NodePool
5505    #[derive(Clone, Debug, Default, PartialEq)]
5506    #[non_exhaustive]
5507    pub struct NodeConfig {
5508        /// Optional. The Kubernetes node labels
5509        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5510
5511        /// Optional. Name for the storage schema of worker nodes.
5512        ///
5513        /// Warning: Configurable node local storage schema feature is an
5514        /// experimental feature, and is not recommended for general use
5515        /// in production clusters/nodepools.
5516        pub node_storage_schema: std::string::String,
5517
5518        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5519    }
5520
5521    impl NodeConfig {
5522        pub fn new() -> Self {
5523            std::default::Default::default()
5524        }
5525
5526        /// Sets the value of [labels][crate::model::node_pool::NodeConfig::labels].
5527        pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5528        where
5529            T: std::iter::IntoIterator<Item = (K, V)>,
5530            K: std::convert::Into<std::string::String>,
5531            V: std::convert::Into<std::string::String>,
5532        {
5533            use std::iter::Iterator;
5534            self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5535            self
5536        }
5537
5538        /// Sets the value of [node_storage_schema][crate::model::node_pool::NodeConfig::node_storage_schema].
5539        pub fn set_node_storage_schema<T: std::convert::Into<std::string::String>>(
5540            mut self,
5541            v: T,
5542        ) -> Self {
5543            self.node_storage_schema = v.into();
5544            self
5545        }
5546    }
5547
5548    impl wkt::message::Message for NodeConfig {
5549        fn typename() -> &'static str {
5550            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.NodeConfig"
5551        }
5552    }
5553
5554    #[doc(hidden)]
5555    impl<'de> serde::de::Deserialize<'de> for NodeConfig {
5556        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5557        where
5558            D: serde::Deserializer<'de>,
5559        {
5560            #[allow(non_camel_case_types)]
5561            #[doc(hidden)]
5562            #[derive(PartialEq, Eq, Hash)]
5563            enum __FieldTag {
5564                __labels,
5565                __node_storage_schema,
5566                Unknown(std::string::String),
5567            }
5568            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5569                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5570                where
5571                    D: serde::Deserializer<'de>,
5572                {
5573                    struct Visitor;
5574                    impl<'de> serde::de::Visitor<'de> for Visitor {
5575                        type Value = __FieldTag;
5576                        fn expecting(
5577                            &self,
5578                            formatter: &mut std::fmt::Formatter,
5579                        ) -> std::fmt::Result {
5580                            formatter.write_str("a field name for NodeConfig")
5581                        }
5582                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5583                        where
5584                            E: serde::de::Error,
5585                        {
5586                            use std::result::Result::Ok;
5587                            use std::string::ToString;
5588                            match value {
5589                                "labels" => Ok(__FieldTag::__labels),
5590                                "nodeStorageSchema" => Ok(__FieldTag::__node_storage_schema),
5591                                "node_storage_schema" => Ok(__FieldTag::__node_storage_schema),
5592                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5593                            }
5594                        }
5595                    }
5596                    deserializer.deserialize_identifier(Visitor)
5597                }
5598            }
5599            struct Visitor;
5600            impl<'de> serde::de::Visitor<'de> for Visitor {
5601                type Value = NodeConfig;
5602                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5603                    formatter.write_str("struct NodeConfig")
5604                }
5605                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5606                where
5607                    A: serde::de::MapAccess<'de>,
5608                {
5609                    #[allow(unused_imports)]
5610                    use serde::de::Error;
5611                    use std::option::Option::Some;
5612                    let mut fields = std::collections::HashSet::new();
5613                    let mut result = Self::Value::new();
5614                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5615                        #[allow(clippy::match_single_binding)]
5616                        match tag {
5617                            __FieldTag::__labels => {
5618                                if !fields.insert(__FieldTag::__labels) {
5619                                    return std::result::Result::Err(A::Error::duplicate_field(
5620                                        "multiple values for labels",
5621                                    ));
5622                                }
5623                                result.labels = map
5624                                    .next_value::<std::option::Option<
5625                                        std::collections::HashMap<
5626                                            std::string::String,
5627                                            std::string::String,
5628                                        >,
5629                                    >>()?
5630                                    .unwrap_or_default();
5631                            }
5632                            __FieldTag::__node_storage_schema => {
5633                                if !fields.insert(__FieldTag::__node_storage_schema) {
5634                                    return std::result::Result::Err(A::Error::duplicate_field(
5635                                        "multiple values for node_storage_schema",
5636                                    ));
5637                                }
5638                                result.node_storage_schema = map
5639                                    .next_value::<std::option::Option<std::string::String>>()?
5640                                    .unwrap_or_default();
5641                            }
5642                            __FieldTag::Unknown(key) => {
5643                                let value = map.next_value::<serde_json::Value>()?;
5644                                result._unknown_fields.insert(key, value);
5645                            }
5646                        }
5647                    }
5648                    std::result::Result::Ok(result)
5649                }
5650            }
5651            deserializer.deserialize_any(Visitor)
5652        }
5653    }
5654
5655    #[doc(hidden)]
5656    impl serde::ser::Serialize for NodeConfig {
5657        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5658        where
5659            S: serde::ser::Serializer,
5660        {
5661            use serde::ser::SerializeMap;
5662            #[allow(unused_imports)]
5663            use std::option::Option::Some;
5664            let mut state = serializer.serialize_map(std::option::Option::None)?;
5665            if !self.labels.is_empty() {
5666                state.serialize_entry("labels", &self.labels)?;
5667            }
5668            if !self.node_storage_schema.is_empty() {
5669                state.serialize_entry("nodeStorageSchema", &self.node_storage_schema)?;
5670            }
5671            if !self._unknown_fields.is_empty() {
5672                for (key, value) in self._unknown_fields.iter() {
5673                    state.serialize_entry(key, &value)?;
5674                }
5675            }
5676            state.end()
5677        }
5678    }
5679}
5680
5681/// A Google Distributed Cloud Edge machine capable of acting as a Kubernetes
5682/// node.
5683#[derive(Clone, Debug, Default, PartialEq)]
5684#[non_exhaustive]
5685pub struct Machine {
5686    /// Required. The resource name of the machine.
5687    pub name: std::string::String,
5688
5689    /// Output only. The time when the node pool was created.
5690    pub create_time: std::option::Option<wkt::Timestamp>,
5691
5692    /// Output only. The time when the node pool was last updated.
5693    pub update_time: std::option::Option<wkt::Timestamp>,
5694
5695    /// Labels associated with this resource.
5696    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5697
5698    /// Canonical resource name of the node that this machine is responsible for
5699    /// hosting e.g.
5700    /// projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node},
5701    /// Or empty if the machine is not assigned to assume the role of a node.
5702    ///
5703    /// For control plane nodes hosted on edge machines, this will return
5704    /// the following format:
5705    /// "projects/{project}/locations/{location}/clusters/{cluster_id}/controlPlaneNodes/{node}".
5706    pub hosted_node: std::string::String,
5707
5708    /// The Google Distributed Cloud Edge zone of this machine.
5709    pub zone: std::string::String,
5710
5711    /// Output only. The software version of the machine.
5712    pub version: std::string::String,
5713
5714    /// Output only. Whether the machine is disabled. If disabled, the machine is
5715    /// unable to enter service.
5716    pub disabled: bool,
5717
5718    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5719}
5720
5721impl Machine {
5722    pub fn new() -> Self {
5723        std::default::Default::default()
5724    }
5725
5726    /// Sets the value of [name][crate::model::Machine::name].
5727    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5728        self.name = v.into();
5729        self
5730    }
5731
5732    /// Sets the value of [create_time][crate::model::Machine::create_time].
5733    pub fn set_create_time<T>(mut self, v: T) -> Self
5734    where
5735        T: std::convert::Into<wkt::Timestamp>,
5736    {
5737        self.create_time = std::option::Option::Some(v.into());
5738        self
5739    }
5740
5741    /// Sets or clears the value of [create_time][crate::model::Machine::create_time].
5742    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5743    where
5744        T: std::convert::Into<wkt::Timestamp>,
5745    {
5746        self.create_time = v.map(|x| x.into());
5747        self
5748    }
5749
5750    /// Sets the value of [update_time][crate::model::Machine::update_time].
5751    pub fn set_update_time<T>(mut self, v: T) -> Self
5752    where
5753        T: std::convert::Into<wkt::Timestamp>,
5754    {
5755        self.update_time = std::option::Option::Some(v.into());
5756        self
5757    }
5758
5759    /// Sets or clears the value of [update_time][crate::model::Machine::update_time].
5760    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5761    where
5762        T: std::convert::Into<wkt::Timestamp>,
5763    {
5764        self.update_time = v.map(|x| x.into());
5765        self
5766    }
5767
5768    /// Sets the value of [labels][crate::model::Machine::labels].
5769    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5770    where
5771        T: std::iter::IntoIterator<Item = (K, V)>,
5772        K: std::convert::Into<std::string::String>,
5773        V: std::convert::Into<std::string::String>,
5774    {
5775        use std::iter::Iterator;
5776        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5777        self
5778    }
5779
5780    /// Sets the value of [hosted_node][crate::model::Machine::hosted_node].
5781    pub fn set_hosted_node<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5782        self.hosted_node = v.into();
5783        self
5784    }
5785
5786    /// Sets the value of [zone][crate::model::Machine::zone].
5787    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5788        self.zone = v.into();
5789        self
5790    }
5791
5792    /// Sets the value of [version][crate::model::Machine::version].
5793    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5794        self.version = v.into();
5795        self
5796    }
5797
5798    /// Sets the value of [disabled][crate::model::Machine::disabled].
5799    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5800        self.disabled = v.into();
5801        self
5802    }
5803}
5804
5805impl wkt::message::Message for Machine {
5806    fn typename() -> &'static str {
5807        "type.googleapis.com/google.cloud.edgecontainer.v1.Machine"
5808    }
5809}
5810
5811#[doc(hidden)]
5812impl<'de> serde::de::Deserialize<'de> for Machine {
5813    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5814    where
5815        D: serde::Deserializer<'de>,
5816    {
5817        #[allow(non_camel_case_types)]
5818        #[doc(hidden)]
5819        #[derive(PartialEq, Eq, Hash)]
5820        enum __FieldTag {
5821            __name,
5822            __create_time,
5823            __update_time,
5824            __labels,
5825            __hosted_node,
5826            __zone,
5827            __version,
5828            __disabled,
5829            Unknown(std::string::String),
5830        }
5831        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5832            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5833            where
5834                D: serde::Deserializer<'de>,
5835            {
5836                struct Visitor;
5837                impl<'de> serde::de::Visitor<'de> for Visitor {
5838                    type Value = __FieldTag;
5839                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5840                        formatter.write_str("a field name for Machine")
5841                    }
5842                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5843                    where
5844                        E: serde::de::Error,
5845                    {
5846                        use std::result::Result::Ok;
5847                        use std::string::ToString;
5848                        match value {
5849                            "name" => Ok(__FieldTag::__name),
5850                            "createTime" => Ok(__FieldTag::__create_time),
5851                            "create_time" => Ok(__FieldTag::__create_time),
5852                            "updateTime" => Ok(__FieldTag::__update_time),
5853                            "update_time" => Ok(__FieldTag::__update_time),
5854                            "labels" => Ok(__FieldTag::__labels),
5855                            "hostedNode" => Ok(__FieldTag::__hosted_node),
5856                            "hosted_node" => Ok(__FieldTag::__hosted_node),
5857                            "zone" => Ok(__FieldTag::__zone),
5858                            "version" => Ok(__FieldTag::__version),
5859                            "disabled" => Ok(__FieldTag::__disabled),
5860                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5861                        }
5862                    }
5863                }
5864                deserializer.deserialize_identifier(Visitor)
5865            }
5866        }
5867        struct Visitor;
5868        impl<'de> serde::de::Visitor<'de> for Visitor {
5869            type Value = Machine;
5870            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5871                formatter.write_str("struct Machine")
5872            }
5873            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5874            where
5875                A: serde::de::MapAccess<'de>,
5876            {
5877                #[allow(unused_imports)]
5878                use serde::de::Error;
5879                use std::option::Option::Some;
5880                let mut fields = std::collections::HashSet::new();
5881                let mut result = Self::Value::new();
5882                while let Some(tag) = map.next_key::<__FieldTag>()? {
5883                    #[allow(clippy::match_single_binding)]
5884                    match tag {
5885                        __FieldTag::__name => {
5886                            if !fields.insert(__FieldTag::__name) {
5887                                return std::result::Result::Err(A::Error::duplicate_field(
5888                                    "multiple values for name",
5889                                ));
5890                            }
5891                            result.name = map
5892                                .next_value::<std::option::Option<std::string::String>>()?
5893                                .unwrap_or_default();
5894                        }
5895                        __FieldTag::__create_time => {
5896                            if !fields.insert(__FieldTag::__create_time) {
5897                                return std::result::Result::Err(A::Error::duplicate_field(
5898                                    "multiple values for create_time",
5899                                ));
5900                            }
5901                            result.create_time =
5902                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5903                        }
5904                        __FieldTag::__update_time => {
5905                            if !fields.insert(__FieldTag::__update_time) {
5906                                return std::result::Result::Err(A::Error::duplicate_field(
5907                                    "multiple values for update_time",
5908                                ));
5909                            }
5910                            result.update_time =
5911                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5912                        }
5913                        __FieldTag::__labels => {
5914                            if !fields.insert(__FieldTag::__labels) {
5915                                return std::result::Result::Err(A::Error::duplicate_field(
5916                                    "multiple values for labels",
5917                                ));
5918                            }
5919                            result.labels = map
5920                                .next_value::<std::option::Option<
5921                                    std::collections::HashMap<
5922                                        std::string::String,
5923                                        std::string::String,
5924                                    >,
5925                                >>()?
5926                                .unwrap_or_default();
5927                        }
5928                        __FieldTag::__hosted_node => {
5929                            if !fields.insert(__FieldTag::__hosted_node) {
5930                                return std::result::Result::Err(A::Error::duplicate_field(
5931                                    "multiple values for hosted_node",
5932                                ));
5933                            }
5934                            result.hosted_node = map
5935                                .next_value::<std::option::Option<std::string::String>>()?
5936                                .unwrap_or_default();
5937                        }
5938                        __FieldTag::__zone => {
5939                            if !fields.insert(__FieldTag::__zone) {
5940                                return std::result::Result::Err(A::Error::duplicate_field(
5941                                    "multiple values for zone",
5942                                ));
5943                            }
5944                            result.zone = map
5945                                .next_value::<std::option::Option<std::string::String>>()?
5946                                .unwrap_or_default();
5947                        }
5948                        __FieldTag::__version => {
5949                            if !fields.insert(__FieldTag::__version) {
5950                                return std::result::Result::Err(A::Error::duplicate_field(
5951                                    "multiple values for version",
5952                                ));
5953                            }
5954                            result.version = map
5955                                .next_value::<std::option::Option<std::string::String>>()?
5956                                .unwrap_or_default();
5957                        }
5958                        __FieldTag::__disabled => {
5959                            if !fields.insert(__FieldTag::__disabled) {
5960                                return std::result::Result::Err(A::Error::duplicate_field(
5961                                    "multiple values for disabled",
5962                                ));
5963                            }
5964                            result.disabled = map
5965                                .next_value::<std::option::Option<bool>>()?
5966                                .unwrap_or_default();
5967                        }
5968                        __FieldTag::Unknown(key) => {
5969                            let value = map.next_value::<serde_json::Value>()?;
5970                            result._unknown_fields.insert(key, value);
5971                        }
5972                    }
5973                }
5974                std::result::Result::Ok(result)
5975            }
5976        }
5977        deserializer.deserialize_any(Visitor)
5978    }
5979}
5980
5981#[doc(hidden)]
5982impl serde::ser::Serialize for Machine {
5983    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5984    where
5985        S: serde::ser::Serializer,
5986    {
5987        use serde::ser::SerializeMap;
5988        #[allow(unused_imports)]
5989        use std::option::Option::Some;
5990        let mut state = serializer.serialize_map(std::option::Option::None)?;
5991        if !self.name.is_empty() {
5992            state.serialize_entry("name", &self.name)?;
5993        }
5994        if self.create_time.is_some() {
5995            state.serialize_entry("createTime", &self.create_time)?;
5996        }
5997        if self.update_time.is_some() {
5998            state.serialize_entry("updateTime", &self.update_time)?;
5999        }
6000        if !self.labels.is_empty() {
6001            state.serialize_entry("labels", &self.labels)?;
6002        }
6003        if !self.hosted_node.is_empty() {
6004            state.serialize_entry("hostedNode", &self.hosted_node)?;
6005        }
6006        if !self.zone.is_empty() {
6007            state.serialize_entry("zone", &self.zone)?;
6008        }
6009        if !self.version.is_empty() {
6010            state.serialize_entry("version", &self.version)?;
6011        }
6012        if !wkt::internal::is_default(&self.disabled) {
6013            state.serialize_entry("disabled", &self.disabled)?;
6014        }
6015        if !self._unknown_fields.is_empty() {
6016            for (key, value) in self._unknown_fields.iter() {
6017                state.serialize_entry(key, &value)?;
6018            }
6019        }
6020        state.end()
6021    }
6022}
6023
6024/// A VPN connection .
6025#[derive(Clone, Debug, Default, PartialEq)]
6026#[non_exhaustive]
6027pub struct VpnConnection {
6028    /// Required. The resource name of VPN connection
6029    pub name: std::string::String,
6030
6031    /// Output only. The time when the VPN connection was created.
6032    pub create_time: std::option::Option<wkt::Timestamp>,
6033
6034    /// Output only. The time when the VPN connection was last updated.
6035    pub update_time: std::option::Option<wkt::Timestamp>,
6036
6037    /// Labels associated with this resource.
6038    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6039
6040    /// NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the
6041    /// customer needs to configure NAT such that only one external IP maps to the
6042    /// GMEC Anthos cluster. This is empty if NAT is not used.
6043    pub nat_gateway_ip: std::string::String,
6044
6045    /// Dynamic routing mode of the VPC network, `regional` or `global`.
6046    #[deprecated]
6047    pub bgp_routing_mode: crate::model::vpn_connection::BgpRoutingMode,
6048
6049    /// The canonical Cluster name to connect to. It is in the form of
6050    /// projects/{project}/locations/{location}/clusters/{cluster}.
6051    pub cluster: std::string::String,
6052
6053    /// The network ID of VPC to connect to.
6054    pub vpc: std::string::String,
6055
6056    /// Optional. Project detail of the VPC network. Required if VPC is in a
6057    /// different project than the cluster project.
6058    pub vpc_project: std::option::Option<crate::model::vpn_connection::VpcProject>,
6059
6060    /// Whether this VPN connection has HA enabled on cluster side. If enabled,
6061    /// when creating VPN connection we will attempt to use 2 ANG floating IPs.
6062    pub enable_high_availability: bool,
6063
6064    /// Optional. The VPN connection Cloud Router name.
6065    pub router: std::string::String,
6066
6067    /// Output only. The created connection details.
6068    pub details: std::option::Option<crate::model::vpn_connection::Details>,
6069
6070    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6071}
6072
6073impl VpnConnection {
6074    pub fn new() -> Self {
6075        std::default::Default::default()
6076    }
6077
6078    /// Sets the value of [name][crate::model::VpnConnection::name].
6079    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6080        self.name = v.into();
6081        self
6082    }
6083
6084    /// Sets the value of [create_time][crate::model::VpnConnection::create_time].
6085    pub fn set_create_time<T>(mut self, v: T) -> Self
6086    where
6087        T: std::convert::Into<wkt::Timestamp>,
6088    {
6089        self.create_time = std::option::Option::Some(v.into());
6090        self
6091    }
6092
6093    /// Sets or clears the value of [create_time][crate::model::VpnConnection::create_time].
6094    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6095    where
6096        T: std::convert::Into<wkt::Timestamp>,
6097    {
6098        self.create_time = v.map(|x| x.into());
6099        self
6100    }
6101
6102    /// Sets the value of [update_time][crate::model::VpnConnection::update_time].
6103    pub fn set_update_time<T>(mut self, v: T) -> Self
6104    where
6105        T: std::convert::Into<wkt::Timestamp>,
6106    {
6107        self.update_time = std::option::Option::Some(v.into());
6108        self
6109    }
6110
6111    /// Sets or clears the value of [update_time][crate::model::VpnConnection::update_time].
6112    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6113    where
6114        T: std::convert::Into<wkt::Timestamp>,
6115    {
6116        self.update_time = v.map(|x| x.into());
6117        self
6118    }
6119
6120    /// Sets the value of [labels][crate::model::VpnConnection::labels].
6121    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6122    where
6123        T: std::iter::IntoIterator<Item = (K, V)>,
6124        K: std::convert::Into<std::string::String>,
6125        V: std::convert::Into<std::string::String>,
6126    {
6127        use std::iter::Iterator;
6128        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6129        self
6130    }
6131
6132    /// Sets the value of [nat_gateway_ip][crate::model::VpnConnection::nat_gateway_ip].
6133    pub fn set_nat_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6134        self.nat_gateway_ip = v.into();
6135        self
6136    }
6137
6138    /// Sets the value of [bgp_routing_mode][crate::model::VpnConnection::bgp_routing_mode].
6139    #[deprecated]
6140    pub fn set_bgp_routing_mode<
6141        T: std::convert::Into<crate::model::vpn_connection::BgpRoutingMode>,
6142    >(
6143        mut self,
6144        v: T,
6145    ) -> Self {
6146        self.bgp_routing_mode = v.into();
6147        self
6148    }
6149
6150    /// Sets the value of [cluster][crate::model::VpnConnection::cluster].
6151    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6152        self.cluster = v.into();
6153        self
6154    }
6155
6156    /// Sets the value of [vpc][crate::model::VpnConnection::vpc].
6157    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6158        self.vpc = v.into();
6159        self
6160    }
6161
6162    /// Sets the value of [vpc_project][crate::model::VpnConnection::vpc_project].
6163    pub fn set_vpc_project<T>(mut self, v: T) -> Self
6164    where
6165        T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
6166    {
6167        self.vpc_project = std::option::Option::Some(v.into());
6168        self
6169    }
6170
6171    /// Sets or clears the value of [vpc_project][crate::model::VpnConnection::vpc_project].
6172    pub fn set_or_clear_vpc_project<T>(mut self, v: std::option::Option<T>) -> Self
6173    where
6174        T: std::convert::Into<crate::model::vpn_connection::VpcProject>,
6175    {
6176        self.vpc_project = v.map(|x| x.into());
6177        self
6178    }
6179
6180    /// Sets the value of [enable_high_availability][crate::model::VpnConnection::enable_high_availability].
6181    pub fn set_enable_high_availability<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6182        self.enable_high_availability = v.into();
6183        self
6184    }
6185
6186    /// Sets the value of [router][crate::model::VpnConnection::router].
6187    pub fn set_router<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188        self.router = v.into();
6189        self
6190    }
6191
6192    /// Sets the value of [details][crate::model::VpnConnection::details].
6193    pub fn set_details<T>(mut self, v: T) -> Self
6194    where
6195        T: std::convert::Into<crate::model::vpn_connection::Details>,
6196    {
6197        self.details = std::option::Option::Some(v.into());
6198        self
6199    }
6200
6201    /// Sets or clears the value of [details][crate::model::VpnConnection::details].
6202    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
6203    where
6204        T: std::convert::Into<crate::model::vpn_connection::Details>,
6205    {
6206        self.details = v.map(|x| x.into());
6207        self
6208    }
6209}
6210
6211impl wkt::message::Message for VpnConnection {
6212    fn typename() -> &'static str {
6213        "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection"
6214    }
6215}
6216
6217#[doc(hidden)]
6218impl<'de> serde::de::Deserialize<'de> for VpnConnection {
6219    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6220    where
6221        D: serde::Deserializer<'de>,
6222    {
6223        #[allow(non_camel_case_types)]
6224        #[doc(hidden)]
6225        #[derive(PartialEq, Eq, Hash)]
6226        enum __FieldTag {
6227            __name,
6228            __create_time,
6229            __update_time,
6230            __labels,
6231            __nat_gateway_ip,
6232            __bgp_routing_mode,
6233            __cluster,
6234            __vpc,
6235            __vpc_project,
6236            __enable_high_availability,
6237            __router,
6238            __details,
6239            Unknown(std::string::String),
6240        }
6241        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6242            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6243            where
6244                D: serde::Deserializer<'de>,
6245            {
6246                struct Visitor;
6247                impl<'de> serde::de::Visitor<'de> for Visitor {
6248                    type Value = __FieldTag;
6249                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6250                        formatter.write_str("a field name for VpnConnection")
6251                    }
6252                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6253                    where
6254                        E: serde::de::Error,
6255                    {
6256                        use std::result::Result::Ok;
6257                        use std::string::ToString;
6258                        match value {
6259                            "name" => Ok(__FieldTag::__name),
6260                            "createTime" => Ok(__FieldTag::__create_time),
6261                            "create_time" => Ok(__FieldTag::__create_time),
6262                            "updateTime" => Ok(__FieldTag::__update_time),
6263                            "update_time" => Ok(__FieldTag::__update_time),
6264                            "labels" => Ok(__FieldTag::__labels),
6265                            "natGatewayIp" => Ok(__FieldTag::__nat_gateway_ip),
6266                            "nat_gateway_ip" => Ok(__FieldTag::__nat_gateway_ip),
6267                            "bgpRoutingMode" => Ok(__FieldTag::__bgp_routing_mode),
6268                            "bgp_routing_mode" => Ok(__FieldTag::__bgp_routing_mode),
6269                            "cluster" => Ok(__FieldTag::__cluster),
6270                            "vpc" => Ok(__FieldTag::__vpc),
6271                            "vpcProject" => Ok(__FieldTag::__vpc_project),
6272                            "vpc_project" => Ok(__FieldTag::__vpc_project),
6273                            "enableHighAvailability" => Ok(__FieldTag::__enable_high_availability),
6274                            "enable_high_availability" => {
6275                                Ok(__FieldTag::__enable_high_availability)
6276                            }
6277                            "router" => Ok(__FieldTag::__router),
6278                            "details" => Ok(__FieldTag::__details),
6279                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6280                        }
6281                    }
6282                }
6283                deserializer.deserialize_identifier(Visitor)
6284            }
6285        }
6286        struct Visitor;
6287        impl<'de> serde::de::Visitor<'de> for Visitor {
6288            type Value = VpnConnection;
6289            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6290                formatter.write_str("struct VpnConnection")
6291            }
6292            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6293            where
6294                A: serde::de::MapAccess<'de>,
6295            {
6296                #[allow(unused_imports)]
6297                use serde::de::Error;
6298                use std::option::Option::Some;
6299                let mut fields = std::collections::HashSet::new();
6300                let mut result = Self::Value::new();
6301                while let Some(tag) = map.next_key::<__FieldTag>()? {
6302                    #[allow(clippy::match_single_binding)]
6303                    match tag {
6304                        __FieldTag::__name => {
6305                            if !fields.insert(__FieldTag::__name) {
6306                                return std::result::Result::Err(A::Error::duplicate_field(
6307                                    "multiple values for name",
6308                                ));
6309                            }
6310                            result.name = map
6311                                .next_value::<std::option::Option<std::string::String>>()?
6312                                .unwrap_or_default();
6313                        }
6314                        __FieldTag::__create_time => {
6315                            if !fields.insert(__FieldTag::__create_time) {
6316                                return std::result::Result::Err(A::Error::duplicate_field(
6317                                    "multiple values for create_time",
6318                                ));
6319                            }
6320                            result.create_time =
6321                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6322                        }
6323                        __FieldTag::__update_time => {
6324                            if !fields.insert(__FieldTag::__update_time) {
6325                                return std::result::Result::Err(A::Error::duplicate_field(
6326                                    "multiple values for update_time",
6327                                ));
6328                            }
6329                            result.update_time =
6330                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6331                        }
6332                        __FieldTag::__labels => {
6333                            if !fields.insert(__FieldTag::__labels) {
6334                                return std::result::Result::Err(A::Error::duplicate_field(
6335                                    "multiple values for labels",
6336                                ));
6337                            }
6338                            result.labels = map
6339                                .next_value::<std::option::Option<
6340                                    std::collections::HashMap<
6341                                        std::string::String,
6342                                        std::string::String,
6343                                    >,
6344                                >>()?
6345                                .unwrap_or_default();
6346                        }
6347                        __FieldTag::__nat_gateway_ip => {
6348                            if !fields.insert(__FieldTag::__nat_gateway_ip) {
6349                                return std::result::Result::Err(A::Error::duplicate_field(
6350                                    "multiple values for nat_gateway_ip",
6351                                ));
6352                            }
6353                            result.nat_gateway_ip = map
6354                                .next_value::<std::option::Option<std::string::String>>()?
6355                                .unwrap_or_default();
6356                        }
6357                        __FieldTag::__bgp_routing_mode => {
6358                            if !fields.insert(__FieldTag::__bgp_routing_mode) {
6359                                return std::result::Result::Err(A::Error::duplicate_field(
6360                                    "multiple values for bgp_routing_mode",
6361                                ));
6362                            }
6363                            result.bgp_routing_mode =
6364                                map.next_value::<std::option::Option<
6365                                    crate::model::vpn_connection::BgpRoutingMode,
6366                                >>()?
6367                                .unwrap_or_default();
6368                        }
6369                        __FieldTag::__cluster => {
6370                            if !fields.insert(__FieldTag::__cluster) {
6371                                return std::result::Result::Err(A::Error::duplicate_field(
6372                                    "multiple values for cluster",
6373                                ));
6374                            }
6375                            result.cluster = map
6376                                .next_value::<std::option::Option<std::string::String>>()?
6377                                .unwrap_or_default();
6378                        }
6379                        __FieldTag::__vpc => {
6380                            if !fields.insert(__FieldTag::__vpc) {
6381                                return std::result::Result::Err(A::Error::duplicate_field(
6382                                    "multiple values for vpc",
6383                                ));
6384                            }
6385                            result.vpc = map
6386                                .next_value::<std::option::Option<std::string::String>>()?
6387                                .unwrap_or_default();
6388                        }
6389                        __FieldTag::__vpc_project => {
6390                            if !fields.insert(__FieldTag::__vpc_project) {
6391                                return std::result::Result::Err(A::Error::duplicate_field(
6392                                    "multiple values for vpc_project",
6393                                ));
6394                            }
6395                            result.vpc_project = map.next_value::<std::option::Option<crate::model::vpn_connection::VpcProject>>()?
6396                                ;
6397                        }
6398                        __FieldTag::__enable_high_availability => {
6399                            if !fields.insert(__FieldTag::__enable_high_availability) {
6400                                return std::result::Result::Err(A::Error::duplicate_field(
6401                                    "multiple values for enable_high_availability",
6402                                ));
6403                            }
6404                            result.enable_high_availability = map
6405                                .next_value::<std::option::Option<bool>>()?
6406                                .unwrap_or_default();
6407                        }
6408                        __FieldTag::__router => {
6409                            if !fields.insert(__FieldTag::__router) {
6410                                return std::result::Result::Err(A::Error::duplicate_field(
6411                                    "multiple values for router",
6412                                ));
6413                            }
6414                            result.router = map
6415                                .next_value::<std::option::Option<std::string::String>>()?
6416                                .unwrap_or_default();
6417                        }
6418                        __FieldTag::__details => {
6419                            if !fields.insert(__FieldTag::__details) {
6420                                return std::result::Result::Err(A::Error::duplicate_field(
6421                                    "multiple values for details",
6422                                ));
6423                            }
6424                            result.details = map.next_value::<std::option::Option<crate::model::vpn_connection::Details>>()?
6425                                ;
6426                        }
6427                        __FieldTag::Unknown(key) => {
6428                            let value = map.next_value::<serde_json::Value>()?;
6429                            result._unknown_fields.insert(key, value);
6430                        }
6431                    }
6432                }
6433                std::result::Result::Ok(result)
6434            }
6435        }
6436        deserializer.deserialize_any(Visitor)
6437    }
6438}
6439
6440#[doc(hidden)]
6441impl serde::ser::Serialize for VpnConnection {
6442    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6443    where
6444        S: serde::ser::Serializer,
6445    {
6446        use serde::ser::SerializeMap;
6447        #[allow(unused_imports)]
6448        use std::option::Option::Some;
6449        let mut state = serializer.serialize_map(std::option::Option::None)?;
6450        if !self.name.is_empty() {
6451            state.serialize_entry("name", &self.name)?;
6452        }
6453        if self.create_time.is_some() {
6454            state.serialize_entry("createTime", &self.create_time)?;
6455        }
6456        if self.update_time.is_some() {
6457            state.serialize_entry("updateTime", &self.update_time)?;
6458        }
6459        if !self.labels.is_empty() {
6460            state.serialize_entry("labels", &self.labels)?;
6461        }
6462        if !self.nat_gateway_ip.is_empty() {
6463            state.serialize_entry("natGatewayIp", &self.nat_gateway_ip)?;
6464        }
6465        if !wkt::internal::is_default(&self.bgp_routing_mode) {
6466            state.serialize_entry("bgpRoutingMode", &self.bgp_routing_mode)?;
6467        }
6468        if !self.cluster.is_empty() {
6469            state.serialize_entry("cluster", &self.cluster)?;
6470        }
6471        if !self.vpc.is_empty() {
6472            state.serialize_entry("vpc", &self.vpc)?;
6473        }
6474        if self.vpc_project.is_some() {
6475            state.serialize_entry("vpcProject", &self.vpc_project)?;
6476        }
6477        if !wkt::internal::is_default(&self.enable_high_availability) {
6478            state.serialize_entry("enableHighAvailability", &self.enable_high_availability)?;
6479        }
6480        if !self.router.is_empty() {
6481            state.serialize_entry("router", &self.router)?;
6482        }
6483        if self.details.is_some() {
6484            state.serialize_entry("details", &self.details)?;
6485        }
6486        if !self._unknown_fields.is_empty() {
6487            for (key, value) in self._unknown_fields.iter() {
6488                state.serialize_entry(key, &value)?;
6489            }
6490        }
6491        state.end()
6492    }
6493}
6494
6495/// Defines additional types related to [VpnConnection].
6496pub mod vpn_connection {
6497    #[allow(unused_imports)]
6498    use super::*;
6499
6500    /// Project detail of the VPC network.
6501    #[derive(Clone, Debug, Default, PartialEq)]
6502    #[non_exhaustive]
6503    pub struct VpcProject {
6504        /// The project of the VPC to connect to. If not specified, it is the same as
6505        /// the cluster project.
6506        pub project_id: std::string::String,
6507
6508        /// Optional. Deprecated: do not use.
6509        #[deprecated]
6510        pub service_account: std::string::String,
6511
6512        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6513    }
6514
6515    impl VpcProject {
6516        pub fn new() -> Self {
6517            std::default::Default::default()
6518        }
6519
6520        /// Sets the value of [project_id][crate::model::vpn_connection::VpcProject::project_id].
6521        pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6522            self.project_id = v.into();
6523            self
6524        }
6525
6526        /// Sets the value of [service_account][crate::model::vpn_connection::VpcProject::service_account].
6527        #[deprecated]
6528        pub fn set_service_account<T: std::convert::Into<std::string::String>>(
6529            mut self,
6530            v: T,
6531        ) -> Self {
6532            self.service_account = v.into();
6533            self
6534        }
6535    }
6536
6537    impl wkt::message::Message for VpcProject {
6538        fn typename() -> &'static str {
6539            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.VpcProject"
6540        }
6541    }
6542
6543    #[doc(hidden)]
6544    impl<'de> serde::de::Deserialize<'de> for VpcProject {
6545        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6546        where
6547            D: serde::Deserializer<'de>,
6548        {
6549            #[allow(non_camel_case_types)]
6550            #[doc(hidden)]
6551            #[derive(PartialEq, Eq, Hash)]
6552            enum __FieldTag {
6553                __project_id,
6554                __service_account,
6555                Unknown(std::string::String),
6556            }
6557            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6558                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6559                where
6560                    D: serde::Deserializer<'de>,
6561                {
6562                    struct Visitor;
6563                    impl<'de> serde::de::Visitor<'de> for Visitor {
6564                        type Value = __FieldTag;
6565                        fn expecting(
6566                            &self,
6567                            formatter: &mut std::fmt::Formatter,
6568                        ) -> std::fmt::Result {
6569                            formatter.write_str("a field name for VpcProject")
6570                        }
6571                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6572                        where
6573                            E: serde::de::Error,
6574                        {
6575                            use std::result::Result::Ok;
6576                            use std::string::ToString;
6577                            match value {
6578                                "projectId" => Ok(__FieldTag::__project_id),
6579                                "project_id" => Ok(__FieldTag::__project_id),
6580                                "serviceAccount" => Ok(__FieldTag::__service_account),
6581                                "service_account" => Ok(__FieldTag::__service_account),
6582                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6583                            }
6584                        }
6585                    }
6586                    deserializer.deserialize_identifier(Visitor)
6587                }
6588            }
6589            struct Visitor;
6590            impl<'de> serde::de::Visitor<'de> for Visitor {
6591                type Value = VpcProject;
6592                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6593                    formatter.write_str("struct VpcProject")
6594                }
6595                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6596                where
6597                    A: serde::de::MapAccess<'de>,
6598                {
6599                    #[allow(unused_imports)]
6600                    use serde::de::Error;
6601                    use std::option::Option::Some;
6602                    let mut fields = std::collections::HashSet::new();
6603                    let mut result = Self::Value::new();
6604                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6605                        #[allow(clippy::match_single_binding)]
6606                        match tag {
6607                            __FieldTag::__project_id => {
6608                                if !fields.insert(__FieldTag::__project_id) {
6609                                    return std::result::Result::Err(A::Error::duplicate_field(
6610                                        "multiple values for project_id",
6611                                    ));
6612                                }
6613                                result.project_id = map
6614                                    .next_value::<std::option::Option<std::string::String>>()?
6615                                    .unwrap_or_default();
6616                            }
6617                            __FieldTag::__service_account => {
6618                                if !fields.insert(__FieldTag::__service_account) {
6619                                    return std::result::Result::Err(A::Error::duplicate_field(
6620                                        "multiple values for service_account",
6621                                    ));
6622                                }
6623                                result.service_account = map
6624                                    .next_value::<std::option::Option<std::string::String>>()?
6625                                    .unwrap_or_default();
6626                            }
6627                            __FieldTag::Unknown(key) => {
6628                                let value = map.next_value::<serde_json::Value>()?;
6629                                result._unknown_fields.insert(key, value);
6630                            }
6631                        }
6632                    }
6633                    std::result::Result::Ok(result)
6634                }
6635            }
6636            deserializer.deserialize_any(Visitor)
6637        }
6638    }
6639
6640    #[doc(hidden)]
6641    impl serde::ser::Serialize for VpcProject {
6642        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6643        where
6644            S: serde::ser::Serializer,
6645        {
6646            use serde::ser::SerializeMap;
6647            #[allow(unused_imports)]
6648            use std::option::Option::Some;
6649            let mut state = serializer.serialize_map(std::option::Option::None)?;
6650            if !self.project_id.is_empty() {
6651                state.serialize_entry("projectId", &self.project_id)?;
6652            }
6653            if !self.service_account.is_empty() {
6654                state.serialize_entry("serviceAccount", &self.service_account)?;
6655            }
6656            if !self._unknown_fields.is_empty() {
6657                for (key, value) in self._unknown_fields.iter() {
6658                    state.serialize_entry(key, &value)?;
6659                }
6660            }
6661            state.end()
6662        }
6663    }
6664
6665    /// The created connection details.
6666    #[derive(Clone, Debug, Default, PartialEq)]
6667    #[non_exhaustive]
6668    pub struct Details {
6669        /// The state of this connection.
6670        pub state: crate::model::vpn_connection::details::State,
6671
6672        /// The error message. This is only populated when state=ERROR.
6673        pub error: std::string::String,
6674
6675        /// The Cloud Router info.
6676        pub cloud_router: std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
6677
6678        /// Each connection has multiple Cloud VPN gateways.
6679        pub cloud_vpns: std::vec::Vec<crate::model::vpn_connection::details::CloudVpn>,
6680
6681        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6682    }
6683
6684    impl Details {
6685        pub fn new() -> Self {
6686            std::default::Default::default()
6687        }
6688
6689        /// Sets the value of [state][crate::model::vpn_connection::Details::state].
6690        pub fn set_state<T: std::convert::Into<crate::model::vpn_connection::details::State>>(
6691            mut self,
6692            v: T,
6693        ) -> Self {
6694            self.state = v.into();
6695            self
6696        }
6697
6698        /// Sets the value of [error][crate::model::vpn_connection::Details::error].
6699        pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6700            self.error = v.into();
6701            self
6702        }
6703
6704        /// Sets the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
6705        pub fn set_cloud_router<T>(mut self, v: T) -> Self
6706        where
6707            T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
6708        {
6709            self.cloud_router = std::option::Option::Some(v.into());
6710            self
6711        }
6712
6713        /// Sets or clears the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
6714        pub fn set_or_clear_cloud_router<T>(mut self, v: std::option::Option<T>) -> Self
6715        where
6716            T: std::convert::Into<crate::model::vpn_connection::details::CloudRouter>,
6717        {
6718            self.cloud_router = v.map(|x| x.into());
6719            self
6720        }
6721
6722        /// Sets the value of [cloud_vpns][crate::model::vpn_connection::Details::cloud_vpns].
6723        pub fn set_cloud_vpns<T, V>(mut self, v: T) -> Self
6724        where
6725            T: std::iter::IntoIterator<Item = V>,
6726            V: std::convert::Into<crate::model::vpn_connection::details::CloudVpn>,
6727        {
6728            use std::iter::Iterator;
6729            self.cloud_vpns = v.into_iter().map(|i| i.into()).collect();
6730            self
6731        }
6732    }
6733
6734    impl wkt::message::Message for Details {
6735        fn typename() -> &'static str {
6736            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details"
6737        }
6738    }
6739
6740    #[doc(hidden)]
6741    impl<'de> serde::de::Deserialize<'de> for Details {
6742        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6743        where
6744            D: serde::Deserializer<'de>,
6745        {
6746            #[allow(non_camel_case_types)]
6747            #[doc(hidden)]
6748            #[derive(PartialEq, Eq, Hash)]
6749            enum __FieldTag {
6750                __state,
6751                __error,
6752                __cloud_router,
6753                __cloud_vpns,
6754                Unknown(std::string::String),
6755            }
6756            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6757                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6758                where
6759                    D: serde::Deserializer<'de>,
6760                {
6761                    struct Visitor;
6762                    impl<'de> serde::de::Visitor<'de> for Visitor {
6763                        type Value = __FieldTag;
6764                        fn expecting(
6765                            &self,
6766                            formatter: &mut std::fmt::Formatter,
6767                        ) -> std::fmt::Result {
6768                            formatter.write_str("a field name for Details")
6769                        }
6770                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6771                        where
6772                            E: serde::de::Error,
6773                        {
6774                            use std::result::Result::Ok;
6775                            use std::string::ToString;
6776                            match value {
6777                                "state" => Ok(__FieldTag::__state),
6778                                "error" => Ok(__FieldTag::__error),
6779                                "cloudRouter" => Ok(__FieldTag::__cloud_router),
6780                                "cloud_router" => Ok(__FieldTag::__cloud_router),
6781                                "cloudVpns" => Ok(__FieldTag::__cloud_vpns),
6782                                "cloud_vpns" => Ok(__FieldTag::__cloud_vpns),
6783                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6784                            }
6785                        }
6786                    }
6787                    deserializer.deserialize_identifier(Visitor)
6788                }
6789            }
6790            struct Visitor;
6791            impl<'de> serde::de::Visitor<'de> for Visitor {
6792                type Value = Details;
6793                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6794                    formatter.write_str("struct Details")
6795                }
6796                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6797                where
6798                    A: serde::de::MapAccess<'de>,
6799                {
6800                    #[allow(unused_imports)]
6801                    use serde::de::Error;
6802                    use std::option::Option::Some;
6803                    let mut fields = std::collections::HashSet::new();
6804                    let mut result = Self::Value::new();
6805                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6806                        #[allow(clippy::match_single_binding)]
6807                        match tag {
6808                            __FieldTag::__state => {
6809                                if !fields.insert(__FieldTag::__state) {
6810                                    return std::result::Result::Err(A::Error::duplicate_field(
6811                                        "multiple values for state",
6812                                    ));
6813                                }
6814                                result.state = map
6815                                    .next_value::<std::option::Option<
6816                                        crate::model::vpn_connection::details::State,
6817                                    >>()?
6818                                    .unwrap_or_default();
6819                            }
6820                            __FieldTag::__error => {
6821                                if !fields.insert(__FieldTag::__error) {
6822                                    return std::result::Result::Err(A::Error::duplicate_field(
6823                                        "multiple values for error",
6824                                    ));
6825                                }
6826                                result.error = map
6827                                    .next_value::<std::option::Option<std::string::String>>()?
6828                                    .unwrap_or_default();
6829                            }
6830                            __FieldTag::__cloud_router => {
6831                                if !fields.insert(__FieldTag::__cloud_router) {
6832                                    return std::result::Result::Err(A::Error::duplicate_field(
6833                                        "multiple values for cloud_router",
6834                                    ));
6835                                }
6836                                result.cloud_router = map.next_value::<std::option::Option<
6837                                    crate::model::vpn_connection::details::CloudRouter,
6838                                >>()?;
6839                            }
6840                            __FieldTag::__cloud_vpns => {
6841                                if !fields.insert(__FieldTag::__cloud_vpns) {
6842                                    return std::result::Result::Err(A::Error::duplicate_field(
6843                                        "multiple values for cloud_vpns",
6844                                    ));
6845                                }
6846                                result.cloud_vpns = map
6847                                    .next_value::<std::option::Option<
6848                                        std::vec::Vec<
6849                                            crate::model::vpn_connection::details::CloudVpn,
6850                                        >,
6851                                    >>()?
6852                                    .unwrap_or_default();
6853                            }
6854                            __FieldTag::Unknown(key) => {
6855                                let value = map.next_value::<serde_json::Value>()?;
6856                                result._unknown_fields.insert(key, value);
6857                            }
6858                        }
6859                    }
6860                    std::result::Result::Ok(result)
6861                }
6862            }
6863            deserializer.deserialize_any(Visitor)
6864        }
6865    }
6866
6867    #[doc(hidden)]
6868    impl serde::ser::Serialize for Details {
6869        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6870        where
6871            S: serde::ser::Serializer,
6872        {
6873            use serde::ser::SerializeMap;
6874            #[allow(unused_imports)]
6875            use std::option::Option::Some;
6876            let mut state = serializer.serialize_map(std::option::Option::None)?;
6877            if !wkt::internal::is_default(&self.state) {
6878                state.serialize_entry("state", &self.state)?;
6879            }
6880            if !self.error.is_empty() {
6881                state.serialize_entry("error", &self.error)?;
6882            }
6883            if self.cloud_router.is_some() {
6884                state.serialize_entry("cloudRouter", &self.cloud_router)?;
6885            }
6886            if !self.cloud_vpns.is_empty() {
6887                state.serialize_entry("cloudVpns", &self.cloud_vpns)?;
6888            }
6889            if !self._unknown_fields.is_empty() {
6890                for (key, value) in self._unknown_fields.iter() {
6891                    state.serialize_entry(key, &value)?;
6892                }
6893            }
6894            state.end()
6895        }
6896    }
6897
6898    /// Defines additional types related to [Details].
6899    pub mod details {
6900        #[allow(unused_imports)]
6901        use super::*;
6902
6903        /// The Cloud Router info.
6904        #[derive(Clone, Debug, Default, PartialEq)]
6905        #[non_exhaustive]
6906        pub struct CloudRouter {
6907            /// The associated Cloud Router name.
6908            pub name: std::string::String,
6909
6910            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6911        }
6912
6913        impl CloudRouter {
6914            pub fn new() -> Self {
6915                std::default::Default::default()
6916            }
6917
6918            /// Sets the value of [name][crate::model::vpn_connection::details::CloudRouter::name].
6919            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6920                self.name = v.into();
6921                self
6922            }
6923        }
6924
6925        impl wkt::message::Message for CloudRouter {
6926            fn typename() -> &'static str {
6927                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter"
6928            }
6929        }
6930
6931        #[doc(hidden)]
6932        impl<'de> serde::de::Deserialize<'de> for CloudRouter {
6933            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6934            where
6935                D: serde::Deserializer<'de>,
6936            {
6937                #[allow(non_camel_case_types)]
6938                #[doc(hidden)]
6939                #[derive(PartialEq, Eq, Hash)]
6940                enum __FieldTag {
6941                    __name,
6942                    Unknown(std::string::String),
6943                }
6944                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6945                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6946                    where
6947                        D: serde::Deserializer<'de>,
6948                    {
6949                        struct Visitor;
6950                        impl<'de> serde::de::Visitor<'de> for Visitor {
6951                            type Value = __FieldTag;
6952                            fn expecting(
6953                                &self,
6954                                formatter: &mut std::fmt::Formatter,
6955                            ) -> std::fmt::Result {
6956                                formatter.write_str("a field name for CloudRouter")
6957                            }
6958                            fn visit_str<E>(
6959                                self,
6960                                value: &str,
6961                            ) -> std::result::Result<Self::Value, E>
6962                            where
6963                                E: serde::de::Error,
6964                            {
6965                                use std::result::Result::Ok;
6966                                use std::string::ToString;
6967                                match value {
6968                                    "name" => Ok(__FieldTag::__name),
6969                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
6970                                }
6971                            }
6972                        }
6973                        deserializer.deserialize_identifier(Visitor)
6974                    }
6975                }
6976                struct Visitor;
6977                impl<'de> serde::de::Visitor<'de> for Visitor {
6978                    type Value = CloudRouter;
6979                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6980                        formatter.write_str("struct CloudRouter")
6981                    }
6982                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6983                    where
6984                        A: serde::de::MapAccess<'de>,
6985                    {
6986                        #[allow(unused_imports)]
6987                        use serde::de::Error;
6988                        use std::option::Option::Some;
6989                        let mut fields = std::collections::HashSet::new();
6990                        let mut result = Self::Value::new();
6991                        while let Some(tag) = map.next_key::<__FieldTag>()? {
6992                            #[allow(clippy::match_single_binding)]
6993                            match tag {
6994                                __FieldTag::__name => {
6995                                    if !fields.insert(__FieldTag::__name) {
6996                                        return std::result::Result::Err(
6997                                            A::Error::duplicate_field("multiple values for name"),
6998                                        );
6999                                    }
7000                                    result.name = map
7001                                        .next_value::<std::option::Option<std::string::String>>()?
7002                                        .unwrap_or_default();
7003                                }
7004                                __FieldTag::Unknown(key) => {
7005                                    let value = map.next_value::<serde_json::Value>()?;
7006                                    result._unknown_fields.insert(key, value);
7007                                }
7008                            }
7009                        }
7010                        std::result::Result::Ok(result)
7011                    }
7012                }
7013                deserializer.deserialize_any(Visitor)
7014            }
7015        }
7016
7017        #[doc(hidden)]
7018        impl serde::ser::Serialize for CloudRouter {
7019            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7020            where
7021                S: serde::ser::Serializer,
7022            {
7023                use serde::ser::SerializeMap;
7024                #[allow(unused_imports)]
7025                use std::option::Option::Some;
7026                let mut state = serializer.serialize_map(std::option::Option::None)?;
7027                if !self.name.is_empty() {
7028                    state.serialize_entry("name", &self.name)?;
7029                }
7030                if !self._unknown_fields.is_empty() {
7031                    for (key, value) in self._unknown_fields.iter() {
7032                        state.serialize_entry(key, &value)?;
7033                    }
7034                }
7035                state.end()
7036            }
7037        }
7038
7039        /// The Cloud VPN info.
7040        #[derive(Clone, Debug, Default, PartialEq)]
7041        #[non_exhaustive]
7042        pub struct CloudVpn {
7043            /// The created Cloud VPN gateway name.
7044            pub gateway: std::string::String,
7045
7046            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7047        }
7048
7049        impl CloudVpn {
7050            pub fn new() -> Self {
7051                std::default::Default::default()
7052            }
7053
7054            /// Sets the value of [gateway][crate::model::vpn_connection::details::CloudVpn::gateway].
7055            pub fn set_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7056                self.gateway = v.into();
7057                self
7058            }
7059        }
7060
7061        impl wkt::message::Message for CloudVpn {
7062            fn typename() -> &'static str {
7063                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn"
7064            }
7065        }
7066
7067        #[doc(hidden)]
7068        impl<'de> serde::de::Deserialize<'de> for CloudVpn {
7069            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7070            where
7071                D: serde::Deserializer<'de>,
7072            {
7073                #[allow(non_camel_case_types)]
7074                #[doc(hidden)]
7075                #[derive(PartialEq, Eq, Hash)]
7076                enum __FieldTag {
7077                    __gateway,
7078                    Unknown(std::string::String),
7079                }
7080                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7081                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7082                    where
7083                        D: serde::Deserializer<'de>,
7084                    {
7085                        struct Visitor;
7086                        impl<'de> serde::de::Visitor<'de> for Visitor {
7087                            type Value = __FieldTag;
7088                            fn expecting(
7089                                &self,
7090                                formatter: &mut std::fmt::Formatter,
7091                            ) -> std::fmt::Result {
7092                                formatter.write_str("a field name for CloudVpn")
7093                            }
7094                            fn visit_str<E>(
7095                                self,
7096                                value: &str,
7097                            ) -> std::result::Result<Self::Value, E>
7098                            where
7099                                E: serde::de::Error,
7100                            {
7101                                use std::result::Result::Ok;
7102                                use std::string::ToString;
7103                                match value {
7104                                    "gateway" => Ok(__FieldTag::__gateway),
7105                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
7106                                }
7107                            }
7108                        }
7109                        deserializer.deserialize_identifier(Visitor)
7110                    }
7111                }
7112                struct Visitor;
7113                impl<'de> serde::de::Visitor<'de> for Visitor {
7114                    type Value = CloudVpn;
7115                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7116                        formatter.write_str("struct CloudVpn")
7117                    }
7118                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7119                    where
7120                        A: serde::de::MapAccess<'de>,
7121                    {
7122                        #[allow(unused_imports)]
7123                        use serde::de::Error;
7124                        use std::option::Option::Some;
7125                        let mut fields = std::collections::HashSet::new();
7126                        let mut result = Self::Value::new();
7127                        while let Some(tag) = map.next_key::<__FieldTag>()? {
7128                            #[allow(clippy::match_single_binding)]
7129                            match tag {
7130                                __FieldTag::__gateway => {
7131                                    if !fields.insert(__FieldTag::__gateway) {
7132                                        return std::result::Result::Err(
7133                                            A::Error::duplicate_field(
7134                                                "multiple values for gateway",
7135                                            ),
7136                                        );
7137                                    }
7138                                    result.gateway = map
7139                                        .next_value::<std::option::Option<std::string::String>>()?
7140                                        .unwrap_or_default();
7141                                }
7142                                __FieldTag::Unknown(key) => {
7143                                    let value = map.next_value::<serde_json::Value>()?;
7144                                    result._unknown_fields.insert(key, value);
7145                                }
7146                            }
7147                        }
7148                        std::result::Result::Ok(result)
7149                    }
7150                }
7151                deserializer.deserialize_any(Visitor)
7152            }
7153        }
7154
7155        #[doc(hidden)]
7156        impl serde::ser::Serialize for CloudVpn {
7157            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7158            where
7159                S: serde::ser::Serializer,
7160            {
7161                use serde::ser::SerializeMap;
7162                #[allow(unused_imports)]
7163                use std::option::Option::Some;
7164                let mut state = serializer.serialize_map(std::option::Option::None)?;
7165                if !self.gateway.is_empty() {
7166                    state.serialize_entry("gateway", &self.gateway)?;
7167                }
7168                if !self._unknown_fields.is_empty() {
7169                    for (key, value) in self._unknown_fields.iter() {
7170                        state.serialize_entry(key, &value)?;
7171                    }
7172                }
7173                state.end()
7174            }
7175        }
7176
7177        /// The current connection state.
7178        ///
7179        /// # Working with unknown values
7180        ///
7181        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7182        /// additional enum variants at any time. Adding new variants is not considered
7183        /// a breaking change. Applications should write their code in anticipation of:
7184        ///
7185        /// - New values appearing in future releases of the client library, **and**
7186        /// - New values received dynamically, without application changes.
7187        ///
7188        /// Please consult the [Working with enums] section in the user guide for some
7189        /// guidelines.
7190        ///
7191        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7192        #[derive(Clone, Debug, PartialEq)]
7193        #[non_exhaustive]
7194        pub enum State {
7195            /// Unknown.
7196            Unspecified,
7197            /// Connected.
7198            Connected,
7199            /// Still connecting.
7200            Connecting,
7201            /// Error occurred.
7202            Error,
7203            /// If set, the enum was initialized with an unknown value.
7204            ///
7205            /// Applications can examine the value using [State::value] or
7206            /// [State::name].
7207            UnknownValue(state::UnknownValue),
7208        }
7209
7210        #[doc(hidden)]
7211        pub mod state {
7212            #[allow(unused_imports)]
7213            use super::*;
7214            #[derive(Clone, Debug, PartialEq)]
7215            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7216        }
7217
7218        impl State {
7219            /// Gets the enum value.
7220            ///
7221            /// Returns `None` if the enum contains an unknown value deserialized from
7222            /// the string representation of enums.
7223            pub fn value(&self) -> std::option::Option<i32> {
7224                match self {
7225                    Self::Unspecified => std::option::Option::Some(0),
7226                    Self::Connected => std::option::Option::Some(1),
7227                    Self::Connecting => std::option::Option::Some(2),
7228                    Self::Error => std::option::Option::Some(3),
7229                    Self::UnknownValue(u) => u.0.value(),
7230                }
7231            }
7232
7233            /// Gets the enum value as a string.
7234            ///
7235            /// Returns `None` if the enum contains an unknown value deserialized from
7236            /// the integer representation of enums.
7237            pub fn name(&self) -> std::option::Option<&str> {
7238                match self {
7239                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7240                    Self::Connected => std::option::Option::Some("STATE_CONNECTED"),
7241                    Self::Connecting => std::option::Option::Some("STATE_CONNECTING"),
7242                    Self::Error => std::option::Option::Some("STATE_ERROR"),
7243                    Self::UnknownValue(u) => u.0.name(),
7244                }
7245            }
7246        }
7247
7248        impl std::default::Default for State {
7249            fn default() -> Self {
7250                use std::convert::From;
7251                Self::from(0)
7252            }
7253        }
7254
7255        impl std::fmt::Display for State {
7256            fn fmt(
7257                &self,
7258                f: &mut std::fmt::Formatter<'_>,
7259            ) -> std::result::Result<(), std::fmt::Error> {
7260                wkt::internal::display_enum(f, self.name(), self.value())
7261            }
7262        }
7263
7264        impl std::convert::From<i32> for State {
7265            fn from(value: i32) -> Self {
7266                match value {
7267                    0 => Self::Unspecified,
7268                    1 => Self::Connected,
7269                    2 => Self::Connecting,
7270                    3 => Self::Error,
7271                    _ => Self::UnknownValue(state::UnknownValue(
7272                        wkt::internal::UnknownEnumValue::Integer(value),
7273                    )),
7274                }
7275            }
7276        }
7277
7278        impl std::convert::From<&str> for State {
7279            fn from(value: &str) -> Self {
7280                use std::string::ToString;
7281                match value {
7282                    "STATE_UNSPECIFIED" => Self::Unspecified,
7283                    "STATE_CONNECTED" => Self::Connected,
7284                    "STATE_CONNECTING" => Self::Connecting,
7285                    "STATE_ERROR" => Self::Error,
7286                    _ => Self::UnknownValue(state::UnknownValue(
7287                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7288                    )),
7289                }
7290            }
7291        }
7292
7293        impl serde::ser::Serialize for State {
7294            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7295            where
7296                S: serde::Serializer,
7297            {
7298                match self {
7299                    Self::Unspecified => serializer.serialize_i32(0),
7300                    Self::Connected => serializer.serialize_i32(1),
7301                    Self::Connecting => serializer.serialize_i32(2),
7302                    Self::Error => serializer.serialize_i32(3),
7303                    Self::UnknownValue(u) => u.0.serialize(serializer),
7304                }
7305            }
7306        }
7307
7308        impl<'de> serde::de::Deserialize<'de> for State {
7309            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7310            where
7311                D: serde::Deserializer<'de>,
7312            {
7313                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7314                    ".google.cloud.edgecontainer.v1.VpnConnection.Details.State",
7315                ))
7316            }
7317        }
7318    }
7319
7320    /// Routing mode.
7321    ///
7322    /// # Working with unknown values
7323    ///
7324    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7325    /// additional enum variants at any time. Adding new variants is not considered
7326    /// a breaking change. Applications should write their code in anticipation of:
7327    ///
7328    /// - New values appearing in future releases of the client library, **and**
7329    /// - New values received dynamically, without application changes.
7330    ///
7331    /// Please consult the [Working with enums] section in the user guide for some
7332    /// guidelines.
7333    ///
7334    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7335    #[derive(Clone, Debug, PartialEq)]
7336    #[non_exhaustive]
7337    pub enum BgpRoutingMode {
7338        /// Unknown.
7339        Unspecified,
7340        /// Regional mode.
7341        Regional,
7342        /// Global mode.
7343        Global,
7344        /// If set, the enum was initialized with an unknown value.
7345        ///
7346        /// Applications can examine the value using [BgpRoutingMode::value] or
7347        /// [BgpRoutingMode::name].
7348        UnknownValue(bgp_routing_mode::UnknownValue),
7349    }
7350
7351    #[doc(hidden)]
7352    pub mod bgp_routing_mode {
7353        #[allow(unused_imports)]
7354        use super::*;
7355        #[derive(Clone, Debug, PartialEq)]
7356        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7357    }
7358
7359    impl BgpRoutingMode {
7360        /// Gets the enum value.
7361        ///
7362        /// Returns `None` if the enum contains an unknown value deserialized from
7363        /// the string representation of enums.
7364        pub fn value(&self) -> std::option::Option<i32> {
7365            match self {
7366                Self::Unspecified => std::option::Option::Some(0),
7367                Self::Regional => std::option::Option::Some(1),
7368                Self::Global => std::option::Option::Some(2),
7369                Self::UnknownValue(u) => u.0.value(),
7370            }
7371        }
7372
7373        /// Gets the enum value as a string.
7374        ///
7375        /// Returns `None` if the enum contains an unknown value deserialized from
7376        /// the integer representation of enums.
7377        pub fn name(&self) -> std::option::Option<&str> {
7378            match self {
7379                Self::Unspecified => std::option::Option::Some("BGP_ROUTING_MODE_UNSPECIFIED"),
7380                Self::Regional => std::option::Option::Some("REGIONAL"),
7381                Self::Global => std::option::Option::Some("GLOBAL"),
7382                Self::UnknownValue(u) => u.0.name(),
7383            }
7384        }
7385    }
7386
7387    impl std::default::Default for BgpRoutingMode {
7388        fn default() -> Self {
7389            use std::convert::From;
7390            Self::from(0)
7391        }
7392    }
7393
7394    impl std::fmt::Display for BgpRoutingMode {
7395        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7396            wkt::internal::display_enum(f, self.name(), self.value())
7397        }
7398    }
7399
7400    impl std::convert::From<i32> for BgpRoutingMode {
7401        fn from(value: i32) -> Self {
7402            match value {
7403                0 => Self::Unspecified,
7404                1 => Self::Regional,
7405                2 => Self::Global,
7406                _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
7407                    wkt::internal::UnknownEnumValue::Integer(value),
7408                )),
7409            }
7410        }
7411    }
7412
7413    impl std::convert::From<&str> for BgpRoutingMode {
7414        fn from(value: &str) -> Self {
7415            use std::string::ToString;
7416            match value {
7417                "BGP_ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
7418                "REGIONAL" => Self::Regional,
7419                "GLOBAL" => Self::Global,
7420                _ => Self::UnknownValue(bgp_routing_mode::UnknownValue(
7421                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7422                )),
7423            }
7424        }
7425    }
7426
7427    impl serde::ser::Serialize for BgpRoutingMode {
7428        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7429        where
7430            S: serde::Serializer,
7431        {
7432            match self {
7433                Self::Unspecified => serializer.serialize_i32(0),
7434                Self::Regional => serializer.serialize_i32(1),
7435                Self::Global => serializer.serialize_i32(2),
7436                Self::UnknownValue(u) => u.0.serialize(serializer),
7437            }
7438        }
7439    }
7440
7441    impl<'de> serde::de::Deserialize<'de> for BgpRoutingMode {
7442        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7443        where
7444            D: serde::Deserializer<'de>,
7445        {
7446            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BgpRoutingMode>::new(
7447                ".google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode",
7448            ))
7449        }
7450    }
7451}
7452
7453/// Metadata for a given
7454/// [google.cloud.location.Location][google.cloud.location.Location].
7455///
7456/// [google.cloud.location.Location]: location::model::Location
7457#[derive(Clone, Debug, Default, PartialEq)]
7458#[non_exhaustive]
7459pub struct LocationMetadata {
7460    /// The set of available Google Distributed Cloud Edge zones in the location.
7461    /// The map is keyed by the lowercase ID of each zone.
7462    pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
7463
7464    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7465}
7466
7467impl LocationMetadata {
7468    pub fn new() -> Self {
7469        std::default::Default::default()
7470    }
7471
7472    /// Sets the value of [available_zones][crate::model::LocationMetadata::available_zones].
7473    pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
7474    where
7475        T: std::iter::IntoIterator<Item = (K, V)>,
7476        K: std::convert::Into<std::string::String>,
7477        V: std::convert::Into<crate::model::ZoneMetadata>,
7478    {
7479        use std::iter::Iterator;
7480        self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7481        self
7482    }
7483}
7484
7485impl wkt::message::Message for LocationMetadata {
7486    fn typename() -> &'static str {
7487        "type.googleapis.com/google.cloud.edgecontainer.v1.LocationMetadata"
7488    }
7489}
7490
7491#[doc(hidden)]
7492impl<'de> serde::de::Deserialize<'de> for LocationMetadata {
7493    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7494    where
7495        D: serde::Deserializer<'de>,
7496    {
7497        #[allow(non_camel_case_types)]
7498        #[doc(hidden)]
7499        #[derive(PartialEq, Eq, Hash)]
7500        enum __FieldTag {
7501            __available_zones,
7502            Unknown(std::string::String),
7503        }
7504        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7505            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7506            where
7507                D: serde::Deserializer<'de>,
7508            {
7509                struct Visitor;
7510                impl<'de> serde::de::Visitor<'de> for Visitor {
7511                    type Value = __FieldTag;
7512                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7513                        formatter.write_str("a field name for LocationMetadata")
7514                    }
7515                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7516                    where
7517                        E: serde::de::Error,
7518                    {
7519                        use std::result::Result::Ok;
7520                        use std::string::ToString;
7521                        match value {
7522                            "availableZones" => Ok(__FieldTag::__available_zones),
7523                            "available_zones" => Ok(__FieldTag::__available_zones),
7524                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7525                        }
7526                    }
7527                }
7528                deserializer.deserialize_identifier(Visitor)
7529            }
7530        }
7531        struct Visitor;
7532        impl<'de> serde::de::Visitor<'de> for Visitor {
7533            type Value = LocationMetadata;
7534            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7535                formatter.write_str("struct LocationMetadata")
7536            }
7537            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7538            where
7539                A: serde::de::MapAccess<'de>,
7540            {
7541                #[allow(unused_imports)]
7542                use serde::de::Error;
7543                use std::option::Option::Some;
7544                let mut fields = std::collections::HashSet::new();
7545                let mut result = Self::Value::new();
7546                while let Some(tag) = map.next_key::<__FieldTag>()? {
7547                    #[allow(clippy::match_single_binding)]
7548                    match tag {
7549                        __FieldTag::__available_zones => {
7550                            if !fields.insert(__FieldTag::__available_zones) {
7551                                return std::result::Result::Err(A::Error::duplicate_field(
7552                                    "multiple values for available_zones",
7553                                ));
7554                            }
7555                            result.available_zones = map
7556                                .next_value::<std::option::Option<
7557                                    std::collections::HashMap<
7558                                        std::string::String,
7559                                        crate::model::ZoneMetadata,
7560                                    >,
7561                                >>()?
7562                                .unwrap_or_default();
7563                        }
7564                        __FieldTag::Unknown(key) => {
7565                            let value = map.next_value::<serde_json::Value>()?;
7566                            result._unknown_fields.insert(key, value);
7567                        }
7568                    }
7569                }
7570                std::result::Result::Ok(result)
7571            }
7572        }
7573        deserializer.deserialize_any(Visitor)
7574    }
7575}
7576
7577#[doc(hidden)]
7578impl serde::ser::Serialize for LocationMetadata {
7579    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7580    where
7581        S: serde::ser::Serializer,
7582    {
7583        use serde::ser::SerializeMap;
7584        #[allow(unused_imports)]
7585        use std::option::Option::Some;
7586        let mut state = serializer.serialize_map(std::option::Option::None)?;
7587        if !self.available_zones.is_empty() {
7588            state.serialize_entry("availableZones", &self.available_zones)?;
7589        }
7590        if !self._unknown_fields.is_empty() {
7591            for (key, value) in self._unknown_fields.iter() {
7592                state.serialize_entry(key, &value)?;
7593            }
7594        }
7595        state.end()
7596    }
7597}
7598
7599/// A Google Distributed Cloud Edge zone where edge machines are located.
7600#[derive(Clone, Debug, Default, PartialEq)]
7601#[non_exhaustive]
7602pub struct ZoneMetadata {
7603    /// Quota for resources in this zone.
7604    pub quota: std::vec::Vec<crate::model::Quota>,
7605
7606    /// The map keyed by rack name and has value of RackType.
7607    pub rack_types:
7608        std::collections::HashMap<std::string::String, crate::model::zone_metadata::RackType>,
7609
7610    /// Config data for the zone.
7611    pub config_data: std::option::Option<crate::model::ConfigData>,
7612
7613    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7614}
7615
7616impl ZoneMetadata {
7617    pub fn new() -> Self {
7618        std::default::Default::default()
7619    }
7620
7621    /// Sets the value of [quota][crate::model::ZoneMetadata::quota].
7622    pub fn set_quota<T, V>(mut self, v: T) -> Self
7623    where
7624        T: std::iter::IntoIterator<Item = V>,
7625        V: std::convert::Into<crate::model::Quota>,
7626    {
7627        use std::iter::Iterator;
7628        self.quota = v.into_iter().map(|i| i.into()).collect();
7629        self
7630    }
7631
7632    /// Sets the value of [rack_types][crate::model::ZoneMetadata::rack_types].
7633    pub fn set_rack_types<T, K, V>(mut self, v: T) -> Self
7634    where
7635        T: std::iter::IntoIterator<Item = (K, V)>,
7636        K: std::convert::Into<std::string::String>,
7637        V: std::convert::Into<crate::model::zone_metadata::RackType>,
7638    {
7639        use std::iter::Iterator;
7640        self.rack_types = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7641        self
7642    }
7643
7644    /// Sets the value of [config_data][crate::model::ZoneMetadata::config_data].
7645    pub fn set_config_data<T>(mut self, v: T) -> Self
7646    where
7647        T: std::convert::Into<crate::model::ConfigData>,
7648    {
7649        self.config_data = std::option::Option::Some(v.into());
7650        self
7651    }
7652
7653    /// Sets or clears the value of [config_data][crate::model::ZoneMetadata::config_data].
7654    pub fn set_or_clear_config_data<T>(mut self, v: std::option::Option<T>) -> Self
7655    where
7656        T: std::convert::Into<crate::model::ConfigData>,
7657    {
7658        self.config_data = v.map(|x| x.into());
7659        self
7660    }
7661}
7662
7663impl wkt::message::Message for ZoneMetadata {
7664    fn typename() -> &'static str {
7665        "type.googleapis.com/google.cloud.edgecontainer.v1.ZoneMetadata"
7666    }
7667}
7668
7669#[doc(hidden)]
7670impl<'de> serde::de::Deserialize<'de> for ZoneMetadata {
7671    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7672    where
7673        D: serde::Deserializer<'de>,
7674    {
7675        #[allow(non_camel_case_types)]
7676        #[doc(hidden)]
7677        #[derive(PartialEq, Eq, Hash)]
7678        enum __FieldTag {
7679            __quota,
7680            __rack_types,
7681            __config_data,
7682            Unknown(std::string::String),
7683        }
7684        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7685            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7686            where
7687                D: serde::Deserializer<'de>,
7688            {
7689                struct Visitor;
7690                impl<'de> serde::de::Visitor<'de> for Visitor {
7691                    type Value = __FieldTag;
7692                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7693                        formatter.write_str("a field name for ZoneMetadata")
7694                    }
7695                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7696                    where
7697                        E: serde::de::Error,
7698                    {
7699                        use std::result::Result::Ok;
7700                        use std::string::ToString;
7701                        match value {
7702                            "quota" => Ok(__FieldTag::__quota),
7703                            "rackTypes" => Ok(__FieldTag::__rack_types),
7704                            "rack_types" => Ok(__FieldTag::__rack_types),
7705                            "configData" => Ok(__FieldTag::__config_data),
7706                            "config_data" => Ok(__FieldTag::__config_data),
7707                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7708                        }
7709                    }
7710                }
7711                deserializer.deserialize_identifier(Visitor)
7712            }
7713        }
7714        struct Visitor;
7715        impl<'de> serde::de::Visitor<'de> for Visitor {
7716            type Value = ZoneMetadata;
7717            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7718                formatter.write_str("struct ZoneMetadata")
7719            }
7720            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7721            where
7722                A: serde::de::MapAccess<'de>,
7723            {
7724                #[allow(unused_imports)]
7725                use serde::de::Error;
7726                use std::option::Option::Some;
7727                let mut fields = std::collections::HashSet::new();
7728                let mut result = Self::Value::new();
7729                while let Some(tag) = map.next_key::<__FieldTag>()? {
7730                    #[allow(clippy::match_single_binding)]
7731                    match tag {
7732                        __FieldTag::__quota => {
7733                            if !fields.insert(__FieldTag::__quota) {
7734                                return std::result::Result::Err(A::Error::duplicate_field(
7735                                    "multiple values for quota",
7736                                ));
7737                            }
7738                            result.quota = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Quota>>>()?.unwrap_or_default();
7739                        }
7740                        __FieldTag::__rack_types => {
7741                            if !fields.insert(__FieldTag::__rack_types) {
7742                                return std::result::Result::Err(A::Error::duplicate_field(
7743                                    "multiple values for rack_types",
7744                                ));
7745                            }
7746                            result.rack_types = map
7747                                .next_value::<std::option::Option<
7748                                    std::collections::HashMap<
7749                                        std::string::String,
7750                                        crate::model::zone_metadata::RackType,
7751                                    >,
7752                                >>()?
7753                                .unwrap_or_default();
7754                        }
7755                        __FieldTag::__config_data => {
7756                            if !fields.insert(__FieldTag::__config_data) {
7757                                return std::result::Result::Err(A::Error::duplicate_field(
7758                                    "multiple values for config_data",
7759                                ));
7760                            }
7761                            result.config_data =
7762                                map.next_value::<std::option::Option<crate::model::ConfigData>>()?;
7763                        }
7764                        __FieldTag::Unknown(key) => {
7765                            let value = map.next_value::<serde_json::Value>()?;
7766                            result._unknown_fields.insert(key, value);
7767                        }
7768                    }
7769                }
7770                std::result::Result::Ok(result)
7771            }
7772        }
7773        deserializer.deserialize_any(Visitor)
7774    }
7775}
7776
7777#[doc(hidden)]
7778impl serde::ser::Serialize for ZoneMetadata {
7779    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7780    where
7781        S: serde::ser::Serializer,
7782    {
7783        use serde::ser::SerializeMap;
7784        #[allow(unused_imports)]
7785        use std::option::Option::Some;
7786        let mut state = serializer.serialize_map(std::option::Option::None)?;
7787        if !self.quota.is_empty() {
7788            state.serialize_entry("quota", &self.quota)?;
7789        }
7790        if !self.rack_types.is_empty() {
7791            state.serialize_entry("rackTypes", &self.rack_types)?;
7792        }
7793        if self.config_data.is_some() {
7794            state.serialize_entry("configData", &self.config_data)?;
7795        }
7796        if !self._unknown_fields.is_empty() {
7797            for (key, value) in self._unknown_fields.iter() {
7798                state.serialize_entry(key, &value)?;
7799            }
7800        }
7801        state.end()
7802    }
7803}
7804
7805/// Defines additional types related to [ZoneMetadata].
7806pub mod zone_metadata {
7807    #[allow(unused_imports)]
7808    use super::*;
7809
7810    /// Type of the rack.
7811    ///
7812    /// # Working with unknown values
7813    ///
7814    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7815    /// additional enum variants at any time. Adding new variants is not considered
7816    /// a breaking change. Applications should write their code in anticipation of:
7817    ///
7818    /// - New values appearing in future releases of the client library, **and**
7819    /// - New values received dynamically, without application changes.
7820    ///
7821    /// Please consult the [Working with enums] section in the user guide for some
7822    /// guidelines.
7823    ///
7824    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7825    #[derive(Clone, Debug, PartialEq)]
7826    #[non_exhaustive]
7827    pub enum RackType {
7828        /// Unspecified rack type, single rack also belongs to this type.
7829        Unspecified,
7830        /// Base rack type, a pair of two modified Config-1 racks containing
7831        /// Aggregation switches.
7832        Base,
7833        /// Expansion rack type, also known as standalone racks,
7834        /// added by customers on demand.
7835        Expansion,
7836        /// If set, the enum was initialized with an unknown value.
7837        ///
7838        /// Applications can examine the value using [RackType::value] or
7839        /// [RackType::name].
7840        UnknownValue(rack_type::UnknownValue),
7841    }
7842
7843    #[doc(hidden)]
7844    pub mod rack_type {
7845        #[allow(unused_imports)]
7846        use super::*;
7847        #[derive(Clone, Debug, PartialEq)]
7848        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7849    }
7850
7851    impl RackType {
7852        /// Gets the enum value.
7853        ///
7854        /// Returns `None` if the enum contains an unknown value deserialized from
7855        /// the string representation of enums.
7856        pub fn value(&self) -> std::option::Option<i32> {
7857            match self {
7858                Self::Unspecified => std::option::Option::Some(0),
7859                Self::Base => std::option::Option::Some(1),
7860                Self::Expansion => std::option::Option::Some(2),
7861                Self::UnknownValue(u) => u.0.value(),
7862            }
7863        }
7864
7865        /// Gets the enum value as a string.
7866        ///
7867        /// Returns `None` if the enum contains an unknown value deserialized from
7868        /// the integer representation of enums.
7869        pub fn name(&self) -> std::option::Option<&str> {
7870            match self {
7871                Self::Unspecified => std::option::Option::Some("RACK_TYPE_UNSPECIFIED"),
7872                Self::Base => std::option::Option::Some("BASE"),
7873                Self::Expansion => std::option::Option::Some("EXPANSION"),
7874                Self::UnknownValue(u) => u.0.name(),
7875            }
7876        }
7877    }
7878
7879    impl std::default::Default for RackType {
7880        fn default() -> Self {
7881            use std::convert::From;
7882            Self::from(0)
7883        }
7884    }
7885
7886    impl std::fmt::Display for RackType {
7887        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7888            wkt::internal::display_enum(f, self.name(), self.value())
7889        }
7890    }
7891
7892    impl std::convert::From<i32> for RackType {
7893        fn from(value: i32) -> Self {
7894            match value {
7895                0 => Self::Unspecified,
7896                1 => Self::Base,
7897                2 => Self::Expansion,
7898                _ => Self::UnknownValue(rack_type::UnknownValue(
7899                    wkt::internal::UnknownEnumValue::Integer(value),
7900                )),
7901            }
7902        }
7903    }
7904
7905    impl std::convert::From<&str> for RackType {
7906        fn from(value: &str) -> Self {
7907            use std::string::ToString;
7908            match value {
7909                "RACK_TYPE_UNSPECIFIED" => Self::Unspecified,
7910                "BASE" => Self::Base,
7911                "EXPANSION" => Self::Expansion,
7912                _ => Self::UnknownValue(rack_type::UnknownValue(
7913                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7914                )),
7915            }
7916        }
7917    }
7918
7919    impl serde::ser::Serialize for RackType {
7920        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7921        where
7922            S: serde::Serializer,
7923        {
7924            match self {
7925                Self::Unspecified => serializer.serialize_i32(0),
7926                Self::Base => serializer.serialize_i32(1),
7927                Self::Expansion => serializer.serialize_i32(2),
7928                Self::UnknownValue(u) => u.0.serialize(serializer),
7929            }
7930        }
7931    }
7932
7933    impl<'de> serde::de::Deserialize<'de> for RackType {
7934        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7935        where
7936            D: serde::Deserializer<'de>,
7937        {
7938            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RackType>::new(
7939                ".google.cloud.edgecontainer.v1.ZoneMetadata.RackType",
7940            ))
7941        }
7942    }
7943}
7944
7945/// Config data holds all the config related data for the zone.
7946#[derive(Clone, Debug, Default, PartialEq)]
7947#[non_exhaustive]
7948pub struct ConfigData {
7949    /// list of available v4 ip pools for external loadbalancer
7950    pub available_external_lb_pools_ipv4: std::vec::Vec<std::string::String>,
7951
7952    /// list of available v6 ip pools for external loadbalancer
7953    pub available_external_lb_pools_ipv6: std::vec::Vec<std::string::String>,
7954
7955    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7956}
7957
7958impl ConfigData {
7959    pub fn new() -> Self {
7960        std::default::Default::default()
7961    }
7962
7963    /// Sets the value of [available_external_lb_pools_ipv4][crate::model::ConfigData::available_external_lb_pools_ipv4].
7964    pub fn set_available_external_lb_pools_ipv4<T, V>(mut self, v: T) -> Self
7965    where
7966        T: std::iter::IntoIterator<Item = V>,
7967        V: std::convert::Into<std::string::String>,
7968    {
7969        use std::iter::Iterator;
7970        self.available_external_lb_pools_ipv4 = v.into_iter().map(|i| i.into()).collect();
7971        self
7972    }
7973
7974    /// Sets the value of [available_external_lb_pools_ipv6][crate::model::ConfigData::available_external_lb_pools_ipv6].
7975    pub fn set_available_external_lb_pools_ipv6<T, V>(mut self, v: T) -> Self
7976    where
7977        T: std::iter::IntoIterator<Item = V>,
7978        V: std::convert::Into<std::string::String>,
7979    {
7980        use std::iter::Iterator;
7981        self.available_external_lb_pools_ipv6 = v.into_iter().map(|i| i.into()).collect();
7982        self
7983    }
7984}
7985
7986impl wkt::message::Message for ConfigData {
7987    fn typename() -> &'static str {
7988        "type.googleapis.com/google.cloud.edgecontainer.v1.ConfigData"
7989    }
7990}
7991
7992#[doc(hidden)]
7993impl<'de> serde::de::Deserialize<'de> for ConfigData {
7994    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7995    where
7996        D: serde::Deserializer<'de>,
7997    {
7998        #[allow(non_camel_case_types)]
7999        #[doc(hidden)]
8000        #[derive(PartialEq, Eq, Hash)]
8001        enum __FieldTag {
8002            __available_external_lb_pools_ipv4,
8003            __available_external_lb_pools_ipv6,
8004            Unknown(std::string::String),
8005        }
8006        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8007            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8008            where
8009                D: serde::Deserializer<'de>,
8010            {
8011                struct Visitor;
8012                impl<'de> serde::de::Visitor<'de> for Visitor {
8013                    type Value = __FieldTag;
8014                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8015                        formatter.write_str("a field name for ConfigData")
8016                    }
8017                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8018                    where
8019                        E: serde::de::Error,
8020                    {
8021                        use std::result::Result::Ok;
8022                        use std::string::ToString;
8023                        match value {
8024                            "availableExternalLbPoolsIpv4" => {
8025                                Ok(__FieldTag::__available_external_lb_pools_ipv4)
8026                            }
8027                            "available_external_lb_pools_ipv4" => {
8028                                Ok(__FieldTag::__available_external_lb_pools_ipv4)
8029                            }
8030                            "availableExternalLbPoolsIpv6" => {
8031                                Ok(__FieldTag::__available_external_lb_pools_ipv6)
8032                            }
8033                            "available_external_lb_pools_ipv6" => {
8034                                Ok(__FieldTag::__available_external_lb_pools_ipv6)
8035                            }
8036                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8037                        }
8038                    }
8039                }
8040                deserializer.deserialize_identifier(Visitor)
8041            }
8042        }
8043        struct Visitor;
8044        impl<'de> serde::de::Visitor<'de> for Visitor {
8045            type Value = ConfigData;
8046            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8047                formatter.write_str("struct ConfigData")
8048            }
8049            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8050            where
8051                A: serde::de::MapAccess<'de>,
8052            {
8053                #[allow(unused_imports)]
8054                use serde::de::Error;
8055                use std::option::Option::Some;
8056                let mut fields = std::collections::HashSet::new();
8057                let mut result = Self::Value::new();
8058                while let Some(tag) = map.next_key::<__FieldTag>()? {
8059                    #[allow(clippy::match_single_binding)]
8060                    match tag {
8061                        __FieldTag::__available_external_lb_pools_ipv4 => {
8062                            if !fields.insert(__FieldTag::__available_external_lb_pools_ipv4) {
8063                                return std::result::Result::Err(A::Error::duplicate_field(
8064                                    "multiple values for available_external_lb_pools_ipv4",
8065                                ));
8066                            }
8067                            result.available_external_lb_pools_ipv4 = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8068                        }
8069                        __FieldTag::__available_external_lb_pools_ipv6 => {
8070                            if !fields.insert(__FieldTag::__available_external_lb_pools_ipv6) {
8071                                return std::result::Result::Err(A::Error::duplicate_field(
8072                                    "multiple values for available_external_lb_pools_ipv6",
8073                                ));
8074                            }
8075                            result.available_external_lb_pools_ipv6 = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8076                        }
8077                        __FieldTag::Unknown(key) => {
8078                            let value = map.next_value::<serde_json::Value>()?;
8079                            result._unknown_fields.insert(key, value);
8080                        }
8081                    }
8082                }
8083                std::result::Result::Ok(result)
8084            }
8085        }
8086        deserializer.deserialize_any(Visitor)
8087    }
8088}
8089
8090#[doc(hidden)]
8091impl serde::ser::Serialize for ConfigData {
8092    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8093    where
8094        S: serde::ser::Serializer,
8095    {
8096        use serde::ser::SerializeMap;
8097        #[allow(unused_imports)]
8098        use std::option::Option::Some;
8099        let mut state = serializer.serialize_map(std::option::Option::None)?;
8100        if !self.available_external_lb_pools_ipv4.is_empty() {
8101            state.serialize_entry(
8102                "availableExternalLbPoolsIpv4",
8103                &self.available_external_lb_pools_ipv4,
8104            )?;
8105        }
8106        if !self.available_external_lb_pools_ipv6.is_empty() {
8107            state.serialize_entry(
8108                "availableExternalLbPoolsIpv6",
8109                &self.available_external_lb_pools_ipv6,
8110            )?;
8111        }
8112        if !self._unknown_fields.is_empty() {
8113            for (key, value) in self._unknown_fields.iter() {
8114                state.serialize_entry(key, &value)?;
8115            }
8116        }
8117        state.end()
8118    }
8119}
8120
8121/// Represents quota for Edge Container resources.
8122#[derive(Clone, Debug, Default, PartialEq)]
8123#[non_exhaustive]
8124pub struct Quota {
8125    /// Name of the quota metric.
8126    pub metric: std::string::String,
8127
8128    /// Quota limit for this metric.
8129    pub limit: f64,
8130
8131    /// Current usage of this metric.
8132    pub usage: f64,
8133
8134    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8135}
8136
8137impl Quota {
8138    pub fn new() -> Self {
8139        std::default::Default::default()
8140    }
8141
8142    /// Sets the value of [metric][crate::model::Quota::metric].
8143    pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8144        self.metric = v.into();
8145        self
8146    }
8147
8148    /// Sets the value of [limit][crate::model::Quota::limit].
8149    pub fn set_limit<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8150        self.limit = v.into();
8151        self
8152    }
8153
8154    /// Sets the value of [usage][crate::model::Quota::usage].
8155    pub fn set_usage<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8156        self.usage = v.into();
8157        self
8158    }
8159}
8160
8161impl wkt::message::Message for Quota {
8162    fn typename() -> &'static str {
8163        "type.googleapis.com/google.cloud.edgecontainer.v1.Quota"
8164    }
8165}
8166
8167#[doc(hidden)]
8168impl<'de> serde::de::Deserialize<'de> for Quota {
8169    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8170    where
8171        D: serde::Deserializer<'de>,
8172    {
8173        #[allow(non_camel_case_types)]
8174        #[doc(hidden)]
8175        #[derive(PartialEq, Eq, Hash)]
8176        enum __FieldTag {
8177            __metric,
8178            __limit,
8179            __usage,
8180            Unknown(std::string::String),
8181        }
8182        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8183            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8184            where
8185                D: serde::Deserializer<'de>,
8186            {
8187                struct Visitor;
8188                impl<'de> serde::de::Visitor<'de> for Visitor {
8189                    type Value = __FieldTag;
8190                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8191                        formatter.write_str("a field name for Quota")
8192                    }
8193                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8194                    where
8195                        E: serde::de::Error,
8196                    {
8197                        use std::result::Result::Ok;
8198                        use std::string::ToString;
8199                        match value {
8200                            "metric" => Ok(__FieldTag::__metric),
8201                            "limit" => Ok(__FieldTag::__limit),
8202                            "usage" => Ok(__FieldTag::__usage),
8203                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8204                        }
8205                    }
8206                }
8207                deserializer.deserialize_identifier(Visitor)
8208            }
8209        }
8210        struct Visitor;
8211        impl<'de> serde::de::Visitor<'de> for Visitor {
8212            type Value = Quota;
8213            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8214                formatter.write_str("struct Quota")
8215            }
8216            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8217            where
8218                A: serde::de::MapAccess<'de>,
8219            {
8220                #[allow(unused_imports)]
8221                use serde::de::Error;
8222                use std::option::Option::Some;
8223                let mut fields = std::collections::HashSet::new();
8224                let mut result = Self::Value::new();
8225                while let Some(tag) = map.next_key::<__FieldTag>()? {
8226                    #[allow(clippy::match_single_binding)]
8227                    match tag {
8228                        __FieldTag::__metric => {
8229                            if !fields.insert(__FieldTag::__metric) {
8230                                return std::result::Result::Err(A::Error::duplicate_field(
8231                                    "multiple values for metric",
8232                                ));
8233                            }
8234                            result.metric = map
8235                                .next_value::<std::option::Option<std::string::String>>()?
8236                                .unwrap_or_default();
8237                        }
8238                        __FieldTag::__limit => {
8239                            if !fields.insert(__FieldTag::__limit) {
8240                                return std::result::Result::Err(A::Error::duplicate_field(
8241                                    "multiple values for limit",
8242                                ));
8243                            }
8244                            struct __With(std::option::Option<f64>);
8245                            impl<'de> serde::de::Deserialize<'de> for __With {
8246                                fn deserialize<D>(
8247                                    deserializer: D,
8248                                ) -> std::result::Result<Self, D::Error>
8249                                where
8250                                    D: serde::de::Deserializer<'de>,
8251                                {
8252                                    serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
8253                                }
8254                            }
8255                            result.limit = map.next_value::<__With>()?.0.unwrap_or_default();
8256                        }
8257                        __FieldTag::__usage => {
8258                            if !fields.insert(__FieldTag::__usage) {
8259                                return std::result::Result::Err(A::Error::duplicate_field(
8260                                    "multiple values for usage",
8261                                ));
8262                            }
8263                            struct __With(std::option::Option<f64>);
8264                            impl<'de> serde::de::Deserialize<'de> for __With {
8265                                fn deserialize<D>(
8266                                    deserializer: D,
8267                                ) -> std::result::Result<Self, D::Error>
8268                                where
8269                                    D: serde::de::Deserializer<'de>,
8270                                {
8271                                    serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
8272                                }
8273                            }
8274                            result.usage = map.next_value::<__With>()?.0.unwrap_or_default();
8275                        }
8276                        __FieldTag::Unknown(key) => {
8277                            let value = map.next_value::<serde_json::Value>()?;
8278                            result._unknown_fields.insert(key, value);
8279                        }
8280                    }
8281                }
8282                std::result::Result::Ok(result)
8283            }
8284        }
8285        deserializer.deserialize_any(Visitor)
8286    }
8287}
8288
8289#[doc(hidden)]
8290impl serde::ser::Serialize for Quota {
8291    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8292    where
8293        S: serde::ser::Serializer,
8294    {
8295        use serde::ser::SerializeMap;
8296        #[allow(unused_imports)]
8297        use std::option::Option::Some;
8298        let mut state = serializer.serialize_map(std::option::Option::None)?;
8299        if !self.metric.is_empty() {
8300            state.serialize_entry("metric", &self.metric)?;
8301        }
8302        if !wkt::internal::is_default(&self.limit) {
8303            struct __With<'a>(&'a f64);
8304            impl<'a> serde::ser::Serialize for __With<'a> {
8305                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8306                where
8307                    S: serde::ser::Serializer,
8308                {
8309                    serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
8310                }
8311            }
8312            state.serialize_entry("limit", &__With(&self.limit))?;
8313        }
8314        if !wkt::internal::is_default(&self.usage) {
8315            struct __With<'a>(&'a f64);
8316            impl<'a> serde::ser::Serialize for __With<'a> {
8317                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8318                where
8319                    S: serde::ser::Serializer,
8320                {
8321                    serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
8322                }
8323            }
8324            state.serialize_entry("usage", &__With(&self.usage))?;
8325        }
8326        if !self._unknown_fields.is_empty() {
8327            for (key, value) in self._unknown_fields.iter() {
8328                state.serialize_entry(key, &value)?;
8329            }
8330        }
8331        state.end()
8332    }
8333}
8334
8335/// Maintenance policy configuration.
8336#[derive(Clone, Debug, Default, PartialEq)]
8337#[non_exhaustive]
8338pub struct MaintenancePolicy {
8339    /// Specifies the maintenance window in which maintenance may be performed.
8340    pub window: std::option::Option<crate::model::MaintenanceWindow>,
8341
8342    /// Optional. Exclusions to automatic maintenance. Non-emergency maintenance
8343    /// should not occur in these windows. Each exclusion has a unique name and may
8344    /// be active or expired. The max number of maintenance exclusions allowed at a
8345    /// given time is 3.
8346    pub maintenance_exclusions: std::vec::Vec<crate::model::MaintenanceExclusionWindow>,
8347
8348    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8349}
8350
8351impl MaintenancePolicy {
8352    pub fn new() -> Self {
8353        std::default::Default::default()
8354    }
8355
8356    /// Sets the value of [window][crate::model::MaintenancePolicy::window].
8357    pub fn set_window<T>(mut self, v: T) -> Self
8358    where
8359        T: std::convert::Into<crate::model::MaintenanceWindow>,
8360    {
8361        self.window = std::option::Option::Some(v.into());
8362        self
8363    }
8364
8365    /// Sets or clears the value of [window][crate::model::MaintenancePolicy::window].
8366    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
8367    where
8368        T: std::convert::Into<crate::model::MaintenanceWindow>,
8369    {
8370        self.window = v.map(|x| x.into());
8371        self
8372    }
8373
8374    /// Sets the value of [maintenance_exclusions][crate::model::MaintenancePolicy::maintenance_exclusions].
8375    pub fn set_maintenance_exclusions<T, V>(mut self, v: T) -> Self
8376    where
8377        T: std::iter::IntoIterator<Item = V>,
8378        V: std::convert::Into<crate::model::MaintenanceExclusionWindow>,
8379    {
8380        use std::iter::Iterator;
8381        self.maintenance_exclusions = v.into_iter().map(|i| i.into()).collect();
8382        self
8383    }
8384}
8385
8386impl wkt::message::Message for MaintenancePolicy {
8387    fn typename() -> &'static str {
8388        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenancePolicy"
8389    }
8390}
8391
8392#[doc(hidden)]
8393impl<'de> serde::de::Deserialize<'de> for MaintenancePolicy {
8394    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8395    where
8396        D: serde::Deserializer<'de>,
8397    {
8398        #[allow(non_camel_case_types)]
8399        #[doc(hidden)]
8400        #[derive(PartialEq, Eq, Hash)]
8401        enum __FieldTag {
8402            __window,
8403            __maintenance_exclusions,
8404            Unknown(std::string::String),
8405        }
8406        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8407            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8408            where
8409                D: serde::Deserializer<'de>,
8410            {
8411                struct Visitor;
8412                impl<'de> serde::de::Visitor<'de> for Visitor {
8413                    type Value = __FieldTag;
8414                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8415                        formatter.write_str("a field name for MaintenancePolicy")
8416                    }
8417                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8418                    where
8419                        E: serde::de::Error,
8420                    {
8421                        use std::result::Result::Ok;
8422                        use std::string::ToString;
8423                        match value {
8424                            "window" => Ok(__FieldTag::__window),
8425                            "maintenanceExclusions" => Ok(__FieldTag::__maintenance_exclusions),
8426                            "maintenance_exclusions" => Ok(__FieldTag::__maintenance_exclusions),
8427                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8428                        }
8429                    }
8430                }
8431                deserializer.deserialize_identifier(Visitor)
8432            }
8433        }
8434        struct Visitor;
8435        impl<'de> serde::de::Visitor<'de> for Visitor {
8436            type Value = MaintenancePolicy;
8437            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8438                formatter.write_str("struct MaintenancePolicy")
8439            }
8440            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8441            where
8442                A: serde::de::MapAccess<'de>,
8443            {
8444                #[allow(unused_imports)]
8445                use serde::de::Error;
8446                use std::option::Option::Some;
8447                let mut fields = std::collections::HashSet::new();
8448                let mut result = Self::Value::new();
8449                while let Some(tag) = map.next_key::<__FieldTag>()? {
8450                    #[allow(clippy::match_single_binding)]
8451                    match tag {
8452                        __FieldTag::__window => {
8453                            if !fields.insert(__FieldTag::__window) {
8454                                return std::result::Result::Err(A::Error::duplicate_field(
8455                                    "multiple values for window",
8456                                ));
8457                            }
8458                            result.window = map
8459                                .next_value::<std::option::Option<crate::model::MaintenanceWindow>>(
8460                                )?;
8461                        }
8462                        __FieldTag::__maintenance_exclusions => {
8463                            if !fields.insert(__FieldTag::__maintenance_exclusions) {
8464                                return std::result::Result::Err(A::Error::duplicate_field(
8465                                    "multiple values for maintenance_exclusions",
8466                                ));
8467                            }
8468                            result.maintenance_exclusions = map
8469                                .next_value::<std::option::Option<
8470                                    std::vec::Vec<crate::model::MaintenanceExclusionWindow>,
8471                                >>()?
8472                                .unwrap_or_default();
8473                        }
8474                        __FieldTag::Unknown(key) => {
8475                            let value = map.next_value::<serde_json::Value>()?;
8476                            result._unknown_fields.insert(key, value);
8477                        }
8478                    }
8479                }
8480                std::result::Result::Ok(result)
8481            }
8482        }
8483        deserializer.deserialize_any(Visitor)
8484    }
8485}
8486
8487#[doc(hidden)]
8488impl serde::ser::Serialize for MaintenancePolicy {
8489    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8490    where
8491        S: serde::ser::Serializer,
8492    {
8493        use serde::ser::SerializeMap;
8494        #[allow(unused_imports)]
8495        use std::option::Option::Some;
8496        let mut state = serializer.serialize_map(std::option::Option::None)?;
8497        if self.window.is_some() {
8498            state.serialize_entry("window", &self.window)?;
8499        }
8500        if !self.maintenance_exclusions.is_empty() {
8501            state.serialize_entry("maintenanceExclusions", &self.maintenance_exclusions)?;
8502        }
8503        if !self._unknown_fields.is_empty() {
8504            for (key, value) in self._unknown_fields.iter() {
8505                state.serialize_entry(key, &value)?;
8506            }
8507        }
8508        state.end()
8509    }
8510}
8511
8512/// Maintenance window configuration
8513#[derive(Clone, Debug, Default, PartialEq)]
8514#[non_exhaustive]
8515pub struct MaintenanceWindow {
8516    /// Configuration of a recurring maintenance window.
8517    pub recurring_window: std::option::Option<crate::model::RecurringTimeWindow>,
8518
8519    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8520}
8521
8522impl MaintenanceWindow {
8523    pub fn new() -> Self {
8524        std::default::Default::default()
8525    }
8526
8527    /// Sets the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
8528    pub fn set_recurring_window<T>(mut self, v: T) -> Self
8529    where
8530        T: std::convert::Into<crate::model::RecurringTimeWindow>,
8531    {
8532        self.recurring_window = std::option::Option::Some(v.into());
8533        self
8534    }
8535
8536    /// Sets or clears the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
8537    pub fn set_or_clear_recurring_window<T>(mut self, v: std::option::Option<T>) -> Self
8538    where
8539        T: std::convert::Into<crate::model::RecurringTimeWindow>,
8540    {
8541        self.recurring_window = v.map(|x| x.into());
8542        self
8543    }
8544}
8545
8546impl wkt::message::Message for MaintenanceWindow {
8547    fn typename() -> &'static str {
8548        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceWindow"
8549    }
8550}
8551
8552#[doc(hidden)]
8553impl<'de> serde::de::Deserialize<'de> for MaintenanceWindow {
8554    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8555    where
8556        D: serde::Deserializer<'de>,
8557    {
8558        #[allow(non_camel_case_types)]
8559        #[doc(hidden)]
8560        #[derive(PartialEq, Eq, Hash)]
8561        enum __FieldTag {
8562            __recurring_window,
8563            Unknown(std::string::String),
8564        }
8565        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8566            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8567            where
8568                D: serde::Deserializer<'de>,
8569            {
8570                struct Visitor;
8571                impl<'de> serde::de::Visitor<'de> for Visitor {
8572                    type Value = __FieldTag;
8573                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8574                        formatter.write_str("a field name for MaintenanceWindow")
8575                    }
8576                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8577                    where
8578                        E: serde::de::Error,
8579                    {
8580                        use std::result::Result::Ok;
8581                        use std::string::ToString;
8582                        match value {
8583                            "recurringWindow" => Ok(__FieldTag::__recurring_window),
8584                            "recurring_window" => Ok(__FieldTag::__recurring_window),
8585                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8586                        }
8587                    }
8588                }
8589                deserializer.deserialize_identifier(Visitor)
8590            }
8591        }
8592        struct Visitor;
8593        impl<'de> serde::de::Visitor<'de> for Visitor {
8594            type Value = MaintenanceWindow;
8595            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8596                formatter.write_str("struct MaintenanceWindow")
8597            }
8598            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8599            where
8600                A: serde::de::MapAccess<'de>,
8601            {
8602                #[allow(unused_imports)]
8603                use serde::de::Error;
8604                use std::option::Option::Some;
8605                let mut fields = std::collections::HashSet::new();
8606                let mut result = Self::Value::new();
8607                while let Some(tag) = map.next_key::<__FieldTag>()? {
8608                    #[allow(clippy::match_single_binding)]
8609                    match tag {
8610                        __FieldTag::__recurring_window => {
8611                            if !fields.insert(__FieldTag::__recurring_window) {
8612                                return std::result::Result::Err(A::Error::duplicate_field(
8613                                    "multiple values for recurring_window",
8614                                ));
8615                            }
8616                            result.recurring_window = map.next_value::<std::option::Option<crate::model::RecurringTimeWindow>>()?
8617                                ;
8618                        }
8619                        __FieldTag::Unknown(key) => {
8620                            let value = map.next_value::<serde_json::Value>()?;
8621                            result._unknown_fields.insert(key, value);
8622                        }
8623                    }
8624                }
8625                std::result::Result::Ok(result)
8626            }
8627        }
8628        deserializer.deserialize_any(Visitor)
8629    }
8630}
8631
8632#[doc(hidden)]
8633impl serde::ser::Serialize for MaintenanceWindow {
8634    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8635    where
8636        S: serde::ser::Serializer,
8637    {
8638        use serde::ser::SerializeMap;
8639        #[allow(unused_imports)]
8640        use std::option::Option::Some;
8641        let mut state = serializer.serialize_map(std::option::Option::None)?;
8642        if self.recurring_window.is_some() {
8643            state.serialize_entry("recurringWindow", &self.recurring_window)?;
8644        }
8645        if !self._unknown_fields.is_empty() {
8646            for (key, value) in self._unknown_fields.iter() {
8647                state.serialize_entry(key, &value)?;
8648            }
8649        }
8650        state.end()
8651    }
8652}
8653
8654/// Represents an arbitrary window of time that recurs.
8655#[derive(Clone, Debug, Default, PartialEq)]
8656#[non_exhaustive]
8657pub struct RecurringTimeWindow {
8658    /// The window of the first recurrence.
8659    pub window: std::option::Option<crate::model::TimeWindow>,
8660
8661    /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
8662    /// this window recurs. They go on for the span of time between the start and
8663    /// end time.
8664    pub recurrence: std::string::String,
8665
8666    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8667}
8668
8669impl RecurringTimeWindow {
8670    pub fn new() -> Self {
8671        std::default::Default::default()
8672    }
8673
8674    /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
8675    pub fn set_window<T>(mut self, v: T) -> Self
8676    where
8677        T: std::convert::Into<crate::model::TimeWindow>,
8678    {
8679        self.window = std::option::Option::Some(v.into());
8680        self
8681    }
8682
8683    /// Sets or clears the value of [window][crate::model::RecurringTimeWindow::window].
8684    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
8685    where
8686        T: std::convert::Into<crate::model::TimeWindow>,
8687    {
8688        self.window = v.map(|x| x.into());
8689        self
8690    }
8691
8692    /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
8693    pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8694        self.recurrence = v.into();
8695        self
8696    }
8697}
8698
8699impl wkt::message::Message for RecurringTimeWindow {
8700    fn typename() -> &'static str {
8701        "type.googleapis.com/google.cloud.edgecontainer.v1.RecurringTimeWindow"
8702    }
8703}
8704
8705#[doc(hidden)]
8706impl<'de> serde::de::Deserialize<'de> for RecurringTimeWindow {
8707    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8708    where
8709        D: serde::Deserializer<'de>,
8710    {
8711        #[allow(non_camel_case_types)]
8712        #[doc(hidden)]
8713        #[derive(PartialEq, Eq, Hash)]
8714        enum __FieldTag {
8715            __window,
8716            __recurrence,
8717            Unknown(std::string::String),
8718        }
8719        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8720            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8721            where
8722                D: serde::Deserializer<'de>,
8723            {
8724                struct Visitor;
8725                impl<'de> serde::de::Visitor<'de> for Visitor {
8726                    type Value = __FieldTag;
8727                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8728                        formatter.write_str("a field name for RecurringTimeWindow")
8729                    }
8730                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8731                    where
8732                        E: serde::de::Error,
8733                    {
8734                        use std::result::Result::Ok;
8735                        use std::string::ToString;
8736                        match value {
8737                            "window" => Ok(__FieldTag::__window),
8738                            "recurrence" => Ok(__FieldTag::__recurrence),
8739                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8740                        }
8741                    }
8742                }
8743                deserializer.deserialize_identifier(Visitor)
8744            }
8745        }
8746        struct Visitor;
8747        impl<'de> serde::de::Visitor<'de> for Visitor {
8748            type Value = RecurringTimeWindow;
8749            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8750                formatter.write_str("struct RecurringTimeWindow")
8751            }
8752            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8753            where
8754                A: serde::de::MapAccess<'de>,
8755            {
8756                #[allow(unused_imports)]
8757                use serde::de::Error;
8758                use std::option::Option::Some;
8759                let mut fields = std::collections::HashSet::new();
8760                let mut result = Self::Value::new();
8761                while let Some(tag) = map.next_key::<__FieldTag>()? {
8762                    #[allow(clippy::match_single_binding)]
8763                    match tag {
8764                        __FieldTag::__window => {
8765                            if !fields.insert(__FieldTag::__window) {
8766                                return std::result::Result::Err(A::Error::duplicate_field(
8767                                    "multiple values for window",
8768                                ));
8769                            }
8770                            result.window =
8771                                map.next_value::<std::option::Option<crate::model::TimeWindow>>()?;
8772                        }
8773                        __FieldTag::__recurrence => {
8774                            if !fields.insert(__FieldTag::__recurrence) {
8775                                return std::result::Result::Err(A::Error::duplicate_field(
8776                                    "multiple values for recurrence",
8777                                ));
8778                            }
8779                            result.recurrence = map
8780                                .next_value::<std::option::Option<std::string::String>>()?
8781                                .unwrap_or_default();
8782                        }
8783                        __FieldTag::Unknown(key) => {
8784                            let value = map.next_value::<serde_json::Value>()?;
8785                            result._unknown_fields.insert(key, value);
8786                        }
8787                    }
8788                }
8789                std::result::Result::Ok(result)
8790            }
8791        }
8792        deserializer.deserialize_any(Visitor)
8793    }
8794}
8795
8796#[doc(hidden)]
8797impl serde::ser::Serialize for RecurringTimeWindow {
8798    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8799    where
8800        S: serde::ser::Serializer,
8801    {
8802        use serde::ser::SerializeMap;
8803        #[allow(unused_imports)]
8804        use std::option::Option::Some;
8805        let mut state = serializer.serialize_map(std::option::Option::None)?;
8806        if self.window.is_some() {
8807            state.serialize_entry("window", &self.window)?;
8808        }
8809        if !self.recurrence.is_empty() {
8810            state.serialize_entry("recurrence", &self.recurrence)?;
8811        }
8812        if !self._unknown_fields.is_empty() {
8813            for (key, value) in self._unknown_fields.iter() {
8814                state.serialize_entry(key, &value)?;
8815            }
8816        }
8817        state.end()
8818    }
8819}
8820
8821/// Represents a maintenance exclusion window.
8822#[derive(Clone, Debug, Default, PartialEq)]
8823#[non_exhaustive]
8824pub struct MaintenanceExclusionWindow {
8825    /// Optional. The time window.
8826    pub window: std::option::Option<crate::model::TimeWindow>,
8827
8828    /// Optional. A unique (per cluster) id for the window.
8829    pub id: std::string::String,
8830
8831    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8832}
8833
8834impl MaintenanceExclusionWindow {
8835    pub fn new() -> Self {
8836        std::default::Default::default()
8837    }
8838
8839    /// Sets the value of [window][crate::model::MaintenanceExclusionWindow::window].
8840    pub fn set_window<T>(mut self, v: T) -> Self
8841    where
8842        T: std::convert::Into<crate::model::TimeWindow>,
8843    {
8844        self.window = std::option::Option::Some(v.into());
8845        self
8846    }
8847
8848    /// Sets or clears the value of [window][crate::model::MaintenanceExclusionWindow::window].
8849    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
8850    where
8851        T: std::convert::Into<crate::model::TimeWindow>,
8852    {
8853        self.window = v.map(|x| x.into());
8854        self
8855    }
8856
8857    /// Sets the value of [id][crate::model::MaintenanceExclusionWindow::id].
8858    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8859        self.id = v.into();
8860        self
8861    }
8862}
8863
8864impl wkt::message::Message for MaintenanceExclusionWindow {
8865    fn typename() -> &'static str {
8866        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceExclusionWindow"
8867    }
8868}
8869
8870#[doc(hidden)]
8871impl<'de> serde::de::Deserialize<'de> for MaintenanceExclusionWindow {
8872    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8873    where
8874        D: serde::Deserializer<'de>,
8875    {
8876        #[allow(non_camel_case_types)]
8877        #[doc(hidden)]
8878        #[derive(PartialEq, Eq, Hash)]
8879        enum __FieldTag {
8880            __window,
8881            __id,
8882            Unknown(std::string::String),
8883        }
8884        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8885            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8886            where
8887                D: serde::Deserializer<'de>,
8888            {
8889                struct Visitor;
8890                impl<'de> serde::de::Visitor<'de> for Visitor {
8891                    type Value = __FieldTag;
8892                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8893                        formatter.write_str("a field name for MaintenanceExclusionWindow")
8894                    }
8895                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8896                    where
8897                        E: serde::de::Error,
8898                    {
8899                        use std::result::Result::Ok;
8900                        use std::string::ToString;
8901                        match value {
8902                            "window" => Ok(__FieldTag::__window),
8903                            "id" => Ok(__FieldTag::__id),
8904                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8905                        }
8906                    }
8907                }
8908                deserializer.deserialize_identifier(Visitor)
8909            }
8910        }
8911        struct Visitor;
8912        impl<'de> serde::de::Visitor<'de> for Visitor {
8913            type Value = MaintenanceExclusionWindow;
8914            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8915                formatter.write_str("struct MaintenanceExclusionWindow")
8916            }
8917            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8918            where
8919                A: serde::de::MapAccess<'de>,
8920            {
8921                #[allow(unused_imports)]
8922                use serde::de::Error;
8923                use std::option::Option::Some;
8924                let mut fields = std::collections::HashSet::new();
8925                let mut result = Self::Value::new();
8926                while let Some(tag) = map.next_key::<__FieldTag>()? {
8927                    #[allow(clippy::match_single_binding)]
8928                    match tag {
8929                        __FieldTag::__window => {
8930                            if !fields.insert(__FieldTag::__window) {
8931                                return std::result::Result::Err(A::Error::duplicate_field(
8932                                    "multiple values for window",
8933                                ));
8934                            }
8935                            result.window =
8936                                map.next_value::<std::option::Option<crate::model::TimeWindow>>()?;
8937                        }
8938                        __FieldTag::__id => {
8939                            if !fields.insert(__FieldTag::__id) {
8940                                return std::result::Result::Err(A::Error::duplicate_field(
8941                                    "multiple values for id",
8942                                ));
8943                            }
8944                            result.id = map
8945                                .next_value::<std::option::Option<std::string::String>>()?
8946                                .unwrap_or_default();
8947                        }
8948                        __FieldTag::Unknown(key) => {
8949                            let value = map.next_value::<serde_json::Value>()?;
8950                            result._unknown_fields.insert(key, value);
8951                        }
8952                    }
8953                }
8954                std::result::Result::Ok(result)
8955            }
8956        }
8957        deserializer.deserialize_any(Visitor)
8958    }
8959}
8960
8961#[doc(hidden)]
8962impl serde::ser::Serialize for MaintenanceExclusionWindow {
8963    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8964    where
8965        S: serde::ser::Serializer,
8966    {
8967        use serde::ser::SerializeMap;
8968        #[allow(unused_imports)]
8969        use std::option::Option::Some;
8970        let mut state = serializer.serialize_map(std::option::Option::None)?;
8971        if self.window.is_some() {
8972            state.serialize_entry("window", &self.window)?;
8973        }
8974        if !self.id.is_empty() {
8975            state.serialize_entry("id", &self.id)?;
8976        }
8977        if !self._unknown_fields.is_empty() {
8978            for (key, value) in self._unknown_fields.iter() {
8979                state.serialize_entry(key, &value)?;
8980            }
8981        }
8982        state.end()
8983    }
8984}
8985
8986/// Represents an arbitrary window of time.
8987#[derive(Clone, Debug, Default, PartialEq)]
8988#[non_exhaustive]
8989pub struct TimeWindow {
8990    /// The time that the window first starts.
8991    pub start_time: std::option::Option<wkt::Timestamp>,
8992
8993    /// The time that the window ends. The end time must take place after the
8994    /// start time.
8995    pub end_time: std::option::Option<wkt::Timestamp>,
8996
8997    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8998}
8999
9000impl TimeWindow {
9001    pub fn new() -> Self {
9002        std::default::Default::default()
9003    }
9004
9005    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
9006    pub fn set_start_time<T>(mut self, v: T) -> Self
9007    where
9008        T: std::convert::Into<wkt::Timestamp>,
9009    {
9010        self.start_time = std::option::Option::Some(v.into());
9011        self
9012    }
9013
9014    /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
9015    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9016    where
9017        T: std::convert::Into<wkt::Timestamp>,
9018    {
9019        self.start_time = v.map(|x| x.into());
9020        self
9021    }
9022
9023    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
9024    pub fn set_end_time<T>(mut self, v: T) -> Self
9025    where
9026        T: std::convert::Into<wkt::Timestamp>,
9027    {
9028        self.end_time = std::option::Option::Some(v.into());
9029        self
9030    }
9031
9032    /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
9033    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9034    where
9035        T: std::convert::Into<wkt::Timestamp>,
9036    {
9037        self.end_time = v.map(|x| x.into());
9038        self
9039    }
9040}
9041
9042impl wkt::message::Message for TimeWindow {
9043    fn typename() -> &'static str {
9044        "type.googleapis.com/google.cloud.edgecontainer.v1.TimeWindow"
9045    }
9046}
9047
9048#[doc(hidden)]
9049impl<'de> serde::de::Deserialize<'de> for TimeWindow {
9050    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9051    where
9052        D: serde::Deserializer<'de>,
9053    {
9054        #[allow(non_camel_case_types)]
9055        #[doc(hidden)]
9056        #[derive(PartialEq, Eq, Hash)]
9057        enum __FieldTag {
9058            __start_time,
9059            __end_time,
9060            Unknown(std::string::String),
9061        }
9062        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9063            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9064            where
9065                D: serde::Deserializer<'de>,
9066            {
9067                struct Visitor;
9068                impl<'de> serde::de::Visitor<'de> for Visitor {
9069                    type Value = __FieldTag;
9070                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9071                        formatter.write_str("a field name for TimeWindow")
9072                    }
9073                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9074                    where
9075                        E: serde::de::Error,
9076                    {
9077                        use std::result::Result::Ok;
9078                        use std::string::ToString;
9079                        match value {
9080                            "startTime" => Ok(__FieldTag::__start_time),
9081                            "start_time" => Ok(__FieldTag::__start_time),
9082                            "endTime" => Ok(__FieldTag::__end_time),
9083                            "end_time" => Ok(__FieldTag::__end_time),
9084                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9085                        }
9086                    }
9087                }
9088                deserializer.deserialize_identifier(Visitor)
9089            }
9090        }
9091        struct Visitor;
9092        impl<'de> serde::de::Visitor<'de> for Visitor {
9093            type Value = TimeWindow;
9094            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9095                formatter.write_str("struct TimeWindow")
9096            }
9097            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9098            where
9099                A: serde::de::MapAccess<'de>,
9100            {
9101                #[allow(unused_imports)]
9102                use serde::de::Error;
9103                use std::option::Option::Some;
9104                let mut fields = std::collections::HashSet::new();
9105                let mut result = Self::Value::new();
9106                while let Some(tag) = map.next_key::<__FieldTag>()? {
9107                    #[allow(clippy::match_single_binding)]
9108                    match tag {
9109                        __FieldTag::__start_time => {
9110                            if !fields.insert(__FieldTag::__start_time) {
9111                                return std::result::Result::Err(A::Error::duplicate_field(
9112                                    "multiple values for start_time",
9113                                ));
9114                            }
9115                            result.start_time =
9116                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9117                        }
9118                        __FieldTag::__end_time => {
9119                            if !fields.insert(__FieldTag::__end_time) {
9120                                return std::result::Result::Err(A::Error::duplicate_field(
9121                                    "multiple values for end_time",
9122                                ));
9123                            }
9124                            result.end_time =
9125                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9126                        }
9127                        __FieldTag::Unknown(key) => {
9128                            let value = map.next_value::<serde_json::Value>()?;
9129                            result._unknown_fields.insert(key, value);
9130                        }
9131                    }
9132                }
9133                std::result::Result::Ok(result)
9134            }
9135        }
9136        deserializer.deserialize_any(Visitor)
9137    }
9138}
9139
9140#[doc(hidden)]
9141impl serde::ser::Serialize for TimeWindow {
9142    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9143    where
9144        S: serde::ser::Serializer,
9145    {
9146        use serde::ser::SerializeMap;
9147        #[allow(unused_imports)]
9148        use std::option::Option::Some;
9149        let mut state = serializer.serialize_map(std::option::Option::None)?;
9150        if self.start_time.is_some() {
9151            state.serialize_entry("startTime", &self.start_time)?;
9152        }
9153        if self.end_time.is_some() {
9154            state.serialize_entry("endTime", &self.end_time)?;
9155        }
9156        if !self._unknown_fields.is_empty() {
9157            for (key, value) in self._unknown_fields.iter() {
9158                state.serialize_entry(key, &value)?;
9159            }
9160        }
9161        state.end()
9162    }
9163}
9164
9165/// Server configuration for supported versions and release channels.
9166#[derive(Clone, Debug, Default, PartialEq)]
9167#[non_exhaustive]
9168pub struct ServerConfig {
9169    /// Output only. Mapping from release channel to channel config.
9170    pub channels: std::collections::HashMap<std::string::String, crate::model::ChannelConfig>,
9171
9172    /// Output only. Supported versions, e.g.: ["1.4.0", "1.5.0"].
9173    pub versions: std::vec::Vec<crate::model::Version>,
9174
9175    /// Output only. Default version, e.g.: "1.4.0".
9176    pub default_version: std::string::String,
9177
9178    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9179}
9180
9181impl ServerConfig {
9182    pub fn new() -> Self {
9183        std::default::Default::default()
9184    }
9185
9186    /// Sets the value of [channels][crate::model::ServerConfig::channels].
9187    pub fn set_channels<T, K, V>(mut self, v: T) -> Self
9188    where
9189        T: std::iter::IntoIterator<Item = (K, V)>,
9190        K: std::convert::Into<std::string::String>,
9191        V: std::convert::Into<crate::model::ChannelConfig>,
9192    {
9193        use std::iter::Iterator;
9194        self.channels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9195        self
9196    }
9197
9198    /// Sets the value of [versions][crate::model::ServerConfig::versions].
9199    pub fn set_versions<T, V>(mut self, v: T) -> Self
9200    where
9201        T: std::iter::IntoIterator<Item = V>,
9202        V: std::convert::Into<crate::model::Version>,
9203    {
9204        use std::iter::Iterator;
9205        self.versions = v.into_iter().map(|i| i.into()).collect();
9206        self
9207    }
9208
9209    /// Sets the value of [default_version][crate::model::ServerConfig::default_version].
9210    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9211        self.default_version = v.into();
9212        self
9213    }
9214}
9215
9216impl wkt::message::Message for ServerConfig {
9217    fn typename() -> &'static str {
9218        "type.googleapis.com/google.cloud.edgecontainer.v1.ServerConfig"
9219    }
9220}
9221
9222#[doc(hidden)]
9223impl<'de> serde::de::Deserialize<'de> for ServerConfig {
9224    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9225    where
9226        D: serde::Deserializer<'de>,
9227    {
9228        #[allow(non_camel_case_types)]
9229        #[doc(hidden)]
9230        #[derive(PartialEq, Eq, Hash)]
9231        enum __FieldTag {
9232            __channels,
9233            __versions,
9234            __default_version,
9235            Unknown(std::string::String),
9236        }
9237        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9238            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9239            where
9240                D: serde::Deserializer<'de>,
9241            {
9242                struct Visitor;
9243                impl<'de> serde::de::Visitor<'de> for Visitor {
9244                    type Value = __FieldTag;
9245                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9246                        formatter.write_str("a field name for ServerConfig")
9247                    }
9248                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9249                    where
9250                        E: serde::de::Error,
9251                    {
9252                        use std::result::Result::Ok;
9253                        use std::string::ToString;
9254                        match value {
9255                            "channels" => Ok(__FieldTag::__channels),
9256                            "versions" => Ok(__FieldTag::__versions),
9257                            "defaultVersion" => Ok(__FieldTag::__default_version),
9258                            "default_version" => Ok(__FieldTag::__default_version),
9259                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9260                        }
9261                    }
9262                }
9263                deserializer.deserialize_identifier(Visitor)
9264            }
9265        }
9266        struct Visitor;
9267        impl<'de> serde::de::Visitor<'de> for Visitor {
9268            type Value = ServerConfig;
9269            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9270                formatter.write_str("struct ServerConfig")
9271            }
9272            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9273            where
9274                A: serde::de::MapAccess<'de>,
9275            {
9276                #[allow(unused_imports)]
9277                use serde::de::Error;
9278                use std::option::Option::Some;
9279                let mut fields = std::collections::HashSet::new();
9280                let mut result = Self::Value::new();
9281                while let Some(tag) = map.next_key::<__FieldTag>()? {
9282                    #[allow(clippy::match_single_binding)]
9283                    match tag {
9284                        __FieldTag::__channels => {
9285                            if !fields.insert(__FieldTag::__channels) {
9286                                return std::result::Result::Err(A::Error::duplicate_field(
9287                                    "multiple values for channels",
9288                                ));
9289                            }
9290                            result.channels = map
9291                                .next_value::<std::option::Option<
9292                                    std::collections::HashMap<
9293                                        std::string::String,
9294                                        crate::model::ChannelConfig,
9295                                    >,
9296                                >>()?
9297                                .unwrap_or_default();
9298                        }
9299                        __FieldTag::__versions => {
9300                            if !fields.insert(__FieldTag::__versions) {
9301                                return std::result::Result::Err(A::Error::duplicate_field(
9302                                    "multiple values for versions",
9303                                ));
9304                            }
9305                            result.versions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Version>>>()?.unwrap_or_default();
9306                        }
9307                        __FieldTag::__default_version => {
9308                            if !fields.insert(__FieldTag::__default_version) {
9309                                return std::result::Result::Err(A::Error::duplicate_field(
9310                                    "multiple values for default_version",
9311                                ));
9312                            }
9313                            result.default_version = map
9314                                .next_value::<std::option::Option<std::string::String>>()?
9315                                .unwrap_or_default();
9316                        }
9317                        __FieldTag::Unknown(key) => {
9318                            let value = map.next_value::<serde_json::Value>()?;
9319                            result._unknown_fields.insert(key, value);
9320                        }
9321                    }
9322                }
9323                std::result::Result::Ok(result)
9324            }
9325        }
9326        deserializer.deserialize_any(Visitor)
9327    }
9328}
9329
9330#[doc(hidden)]
9331impl serde::ser::Serialize for ServerConfig {
9332    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9333    where
9334        S: serde::ser::Serializer,
9335    {
9336        use serde::ser::SerializeMap;
9337        #[allow(unused_imports)]
9338        use std::option::Option::Some;
9339        let mut state = serializer.serialize_map(std::option::Option::None)?;
9340        if !self.channels.is_empty() {
9341            state.serialize_entry("channels", &self.channels)?;
9342        }
9343        if !self.versions.is_empty() {
9344            state.serialize_entry("versions", &self.versions)?;
9345        }
9346        if !self.default_version.is_empty() {
9347            state.serialize_entry("defaultVersion", &self.default_version)?;
9348        }
9349        if !self._unknown_fields.is_empty() {
9350            for (key, value) in self._unknown_fields.iter() {
9351                state.serialize_entry(key, &value)?;
9352            }
9353        }
9354        state.end()
9355    }
9356}
9357
9358/// Configuration for a release channel.
9359#[derive(Clone, Debug, Default, PartialEq)]
9360#[non_exhaustive]
9361pub struct ChannelConfig {
9362    /// Output only. Default version for this release channel, e.g.: "1.4.0".
9363    pub default_version: std::string::String,
9364
9365    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9366}
9367
9368impl ChannelConfig {
9369    pub fn new() -> Self {
9370        std::default::Default::default()
9371    }
9372
9373    /// Sets the value of [default_version][crate::model::ChannelConfig::default_version].
9374    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9375        self.default_version = v.into();
9376        self
9377    }
9378}
9379
9380impl wkt::message::Message for ChannelConfig {
9381    fn typename() -> &'static str {
9382        "type.googleapis.com/google.cloud.edgecontainer.v1.ChannelConfig"
9383    }
9384}
9385
9386#[doc(hidden)]
9387impl<'de> serde::de::Deserialize<'de> for ChannelConfig {
9388    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9389    where
9390        D: serde::Deserializer<'de>,
9391    {
9392        #[allow(non_camel_case_types)]
9393        #[doc(hidden)]
9394        #[derive(PartialEq, Eq, Hash)]
9395        enum __FieldTag {
9396            __default_version,
9397            Unknown(std::string::String),
9398        }
9399        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9400            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9401            where
9402                D: serde::Deserializer<'de>,
9403            {
9404                struct Visitor;
9405                impl<'de> serde::de::Visitor<'de> for Visitor {
9406                    type Value = __FieldTag;
9407                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9408                        formatter.write_str("a field name for ChannelConfig")
9409                    }
9410                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9411                    where
9412                        E: serde::de::Error,
9413                    {
9414                        use std::result::Result::Ok;
9415                        use std::string::ToString;
9416                        match value {
9417                            "defaultVersion" => Ok(__FieldTag::__default_version),
9418                            "default_version" => Ok(__FieldTag::__default_version),
9419                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9420                        }
9421                    }
9422                }
9423                deserializer.deserialize_identifier(Visitor)
9424            }
9425        }
9426        struct Visitor;
9427        impl<'de> serde::de::Visitor<'de> for Visitor {
9428            type Value = ChannelConfig;
9429            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9430                formatter.write_str("struct ChannelConfig")
9431            }
9432            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9433            where
9434                A: serde::de::MapAccess<'de>,
9435            {
9436                #[allow(unused_imports)]
9437                use serde::de::Error;
9438                use std::option::Option::Some;
9439                let mut fields = std::collections::HashSet::new();
9440                let mut result = Self::Value::new();
9441                while let Some(tag) = map.next_key::<__FieldTag>()? {
9442                    #[allow(clippy::match_single_binding)]
9443                    match tag {
9444                        __FieldTag::__default_version => {
9445                            if !fields.insert(__FieldTag::__default_version) {
9446                                return std::result::Result::Err(A::Error::duplicate_field(
9447                                    "multiple values for default_version",
9448                                ));
9449                            }
9450                            result.default_version = map
9451                                .next_value::<std::option::Option<std::string::String>>()?
9452                                .unwrap_or_default();
9453                        }
9454                        __FieldTag::Unknown(key) => {
9455                            let value = map.next_value::<serde_json::Value>()?;
9456                            result._unknown_fields.insert(key, value);
9457                        }
9458                    }
9459                }
9460                std::result::Result::Ok(result)
9461            }
9462        }
9463        deserializer.deserialize_any(Visitor)
9464    }
9465}
9466
9467#[doc(hidden)]
9468impl serde::ser::Serialize for ChannelConfig {
9469    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9470    where
9471        S: serde::ser::Serializer,
9472    {
9473        use serde::ser::SerializeMap;
9474        #[allow(unused_imports)]
9475        use std::option::Option::Some;
9476        let mut state = serializer.serialize_map(std::option::Option::None)?;
9477        if !self.default_version.is_empty() {
9478            state.serialize_entry("defaultVersion", &self.default_version)?;
9479        }
9480        if !self._unknown_fields.is_empty() {
9481            for (key, value) in self._unknown_fields.iter() {
9482                state.serialize_entry(key, &value)?;
9483            }
9484        }
9485        state.end()
9486    }
9487}
9488
9489/// Version of a cluster.
9490#[derive(Clone, Debug, Default, PartialEq)]
9491#[non_exhaustive]
9492pub struct Version {
9493    /// Output only. Name of the version, e.g.: "1.4.0".
9494    pub name: std::string::String,
9495
9496    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9497}
9498
9499impl Version {
9500    pub fn new() -> Self {
9501        std::default::Default::default()
9502    }
9503
9504    /// Sets the value of [name][crate::model::Version::name].
9505    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9506        self.name = v.into();
9507        self
9508    }
9509}
9510
9511impl wkt::message::Message for Version {
9512    fn typename() -> &'static str {
9513        "type.googleapis.com/google.cloud.edgecontainer.v1.Version"
9514    }
9515}
9516
9517#[doc(hidden)]
9518impl<'de> serde::de::Deserialize<'de> for Version {
9519    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9520    where
9521        D: serde::Deserializer<'de>,
9522    {
9523        #[allow(non_camel_case_types)]
9524        #[doc(hidden)]
9525        #[derive(PartialEq, Eq, Hash)]
9526        enum __FieldTag {
9527            __name,
9528            Unknown(std::string::String),
9529        }
9530        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9531            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9532            where
9533                D: serde::Deserializer<'de>,
9534            {
9535                struct Visitor;
9536                impl<'de> serde::de::Visitor<'de> for Visitor {
9537                    type Value = __FieldTag;
9538                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9539                        formatter.write_str("a field name for Version")
9540                    }
9541                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9542                    where
9543                        E: serde::de::Error,
9544                    {
9545                        use std::result::Result::Ok;
9546                        use std::string::ToString;
9547                        match value {
9548                            "name" => Ok(__FieldTag::__name),
9549                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9550                        }
9551                    }
9552                }
9553                deserializer.deserialize_identifier(Visitor)
9554            }
9555        }
9556        struct Visitor;
9557        impl<'de> serde::de::Visitor<'de> for Visitor {
9558            type Value = Version;
9559            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9560                formatter.write_str("struct Version")
9561            }
9562            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9563            where
9564                A: serde::de::MapAccess<'de>,
9565            {
9566                #[allow(unused_imports)]
9567                use serde::de::Error;
9568                use std::option::Option::Some;
9569                let mut fields = std::collections::HashSet::new();
9570                let mut result = Self::Value::new();
9571                while let Some(tag) = map.next_key::<__FieldTag>()? {
9572                    #[allow(clippy::match_single_binding)]
9573                    match tag {
9574                        __FieldTag::__name => {
9575                            if !fields.insert(__FieldTag::__name) {
9576                                return std::result::Result::Err(A::Error::duplicate_field(
9577                                    "multiple values for name",
9578                                ));
9579                            }
9580                            result.name = map
9581                                .next_value::<std::option::Option<std::string::String>>()?
9582                                .unwrap_or_default();
9583                        }
9584                        __FieldTag::Unknown(key) => {
9585                            let value = map.next_value::<serde_json::Value>()?;
9586                            result._unknown_fields.insert(key, value);
9587                        }
9588                    }
9589                }
9590                std::result::Result::Ok(result)
9591            }
9592        }
9593        deserializer.deserialize_any(Visitor)
9594    }
9595}
9596
9597#[doc(hidden)]
9598impl serde::ser::Serialize for Version {
9599    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9600    where
9601        S: serde::ser::Serializer,
9602    {
9603        use serde::ser::SerializeMap;
9604        #[allow(unused_imports)]
9605        use std::option::Option::Some;
9606        let mut state = serializer.serialize_map(std::option::Option::None)?;
9607        if !self.name.is_empty() {
9608            state.serialize_entry("name", &self.name)?;
9609        }
9610        if !self._unknown_fields.is_empty() {
9611            for (key, value) in self._unknown_fields.iter() {
9612                state.serialize_entry(key, &value)?;
9613            }
9614        }
9615        state.end()
9616    }
9617}
9618
9619/// Long-running operation metadata for Edge Container API methods.
9620#[derive(Clone, Debug, Default, PartialEq)]
9621#[non_exhaustive]
9622pub struct OperationMetadata {
9623    /// The time the operation was created.
9624    pub create_time: std::option::Option<wkt::Timestamp>,
9625
9626    /// The time the operation finished running.
9627    pub end_time: std::option::Option<wkt::Timestamp>,
9628
9629    /// Server-defined resource path for the target of the operation.
9630    pub target: std::string::String,
9631
9632    /// The verb executed by the operation.
9633    pub verb: std::string::String,
9634
9635    /// Human-readable status of the operation, if any.
9636    pub status_message: std::string::String,
9637
9638    /// Identifies whether the user has requested cancellation of the operation.
9639    /// Operations that have successfully been cancelled have [Operation.error][]
9640    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
9641    /// corresponding to `Code.CANCELLED`.
9642    ///
9643    /// [google.rpc.Status.code]: rpc::model::Status::code
9644    pub requested_cancellation: bool,
9645
9646    /// API version used to start the operation.
9647    pub api_version: std::string::String,
9648
9649    /// Warnings that do not block the operation, but still hold relevant
9650    /// information for the end user to receive.
9651    pub warnings: std::vec::Vec<std::string::String>,
9652
9653    /// Machine-readable status of the operation, if any.
9654    pub status_reason: crate::model::operation_metadata::StatusReason,
9655
9656    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9657}
9658
9659impl OperationMetadata {
9660    pub fn new() -> Self {
9661        std::default::Default::default()
9662    }
9663
9664    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
9665    pub fn set_create_time<T>(mut self, v: T) -> Self
9666    where
9667        T: std::convert::Into<wkt::Timestamp>,
9668    {
9669        self.create_time = std::option::Option::Some(v.into());
9670        self
9671    }
9672
9673    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
9674    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9675    where
9676        T: std::convert::Into<wkt::Timestamp>,
9677    {
9678        self.create_time = v.map(|x| x.into());
9679        self
9680    }
9681
9682    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
9683    pub fn set_end_time<T>(mut self, v: T) -> Self
9684    where
9685        T: std::convert::Into<wkt::Timestamp>,
9686    {
9687        self.end_time = std::option::Option::Some(v.into());
9688        self
9689    }
9690
9691    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
9692    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9693    where
9694        T: std::convert::Into<wkt::Timestamp>,
9695    {
9696        self.end_time = v.map(|x| x.into());
9697        self
9698    }
9699
9700    /// Sets the value of [target][crate::model::OperationMetadata::target].
9701    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9702        self.target = v.into();
9703        self
9704    }
9705
9706    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
9707    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9708        self.verb = v.into();
9709        self
9710    }
9711
9712    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
9713    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9714        self.status_message = v.into();
9715        self
9716    }
9717
9718    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
9719    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9720        self.requested_cancellation = v.into();
9721        self
9722    }
9723
9724    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
9725    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9726        self.api_version = v.into();
9727        self
9728    }
9729
9730    /// Sets the value of [warnings][crate::model::OperationMetadata::warnings].
9731    pub fn set_warnings<T, V>(mut self, v: T) -> Self
9732    where
9733        T: std::iter::IntoIterator<Item = V>,
9734        V: std::convert::Into<std::string::String>,
9735    {
9736        use std::iter::Iterator;
9737        self.warnings = v.into_iter().map(|i| i.into()).collect();
9738        self
9739    }
9740
9741    /// Sets the value of [status_reason][crate::model::OperationMetadata::status_reason].
9742    pub fn set_status_reason<
9743        T: std::convert::Into<crate::model::operation_metadata::StatusReason>,
9744    >(
9745        mut self,
9746        v: T,
9747    ) -> Self {
9748        self.status_reason = v.into();
9749        self
9750    }
9751}
9752
9753impl wkt::message::Message for OperationMetadata {
9754    fn typename() -> &'static str {
9755        "type.googleapis.com/google.cloud.edgecontainer.v1.OperationMetadata"
9756    }
9757}
9758
9759#[doc(hidden)]
9760impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
9761    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9762    where
9763        D: serde::Deserializer<'de>,
9764    {
9765        #[allow(non_camel_case_types)]
9766        #[doc(hidden)]
9767        #[derive(PartialEq, Eq, Hash)]
9768        enum __FieldTag {
9769            __create_time,
9770            __end_time,
9771            __target,
9772            __verb,
9773            __status_message,
9774            __requested_cancellation,
9775            __api_version,
9776            __warnings,
9777            __status_reason,
9778            Unknown(std::string::String),
9779        }
9780        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9781            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9782            where
9783                D: serde::Deserializer<'de>,
9784            {
9785                struct Visitor;
9786                impl<'de> serde::de::Visitor<'de> for Visitor {
9787                    type Value = __FieldTag;
9788                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9789                        formatter.write_str("a field name for OperationMetadata")
9790                    }
9791                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9792                    where
9793                        E: serde::de::Error,
9794                    {
9795                        use std::result::Result::Ok;
9796                        use std::string::ToString;
9797                        match value {
9798                            "createTime" => Ok(__FieldTag::__create_time),
9799                            "create_time" => Ok(__FieldTag::__create_time),
9800                            "endTime" => Ok(__FieldTag::__end_time),
9801                            "end_time" => Ok(__FieldTag::__end_time),
9802                            "target" => Ok(__FieldTag::__target),
9803                            "verb" => Ok(__FieldTag::__verb),
9804                            "statusMessage" => Ok(__FieldTag::__status_message),
9805                            "status_message" => Ok(__FieldTag::__status_message),
9806                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
9807                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
9808                            "apiVersion" => Ok(__FieldTag::__api_version),
9809                            "api_version" => Ok(__FieldTag::__api_version),
9810                            "warnings" => Ok(__FieldTag::__warnings),
9811                            "statusReason" => Ok(__FieldTag::__status_reason),
9812                            "status_reason" => Ok(__FieldTag::__status_reason),
9813                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9814                        }
9815                    }
9816                }
9817                deserializer.deserialize_identifier(Visitor)
9818            }
9819        }
9820        struct Visitor;
9821        impl<'de> serde::de::Visitor<'de> for Visitor {
9822            type Value = OperationMetadata;
9823            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9824                formatter.write_str("struct OperationMetadata")
9825            }
9826            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9827            where
9828                A: serde::de::MapAccess<'de>,
9829            {
9830                #[allow(unused_imports)]
9831                use serde::de::Error;
9832                use std::option::Option::Some;
9833                let mut fields = std::collections::HashSet::new();
9834                let mut result = Self::Value::new();
9835                while let Some(tag) = map.next_key::<__FieldTag>()? {
9836                    #[allow(clippy::match_single_binding)]
9837                    match tag {
9838                        __FieldTag::__create_time => {
9839                            if !fields.insert(__FieldTag::__create_time) {
9840                                return std::result::Result::Err(A::Error::duplicate_field(
9841                                    "multiple values for create_time",
9842                                ));
9843                            }
9844                            result.create_time =
9845                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9846                        }
9847                        __FieldTag::__end_time => {
9848                            if !fields.insert(__FieldTag::__end_time) {
9849                                return std::result::Result::Err(A::Error::duplicate_field(
9850                                    "multiple values for end_time",
9851                                ));
9852                            }
9853                            result.end_time =
9854                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9855                        }
9856                        __FieldTag::__target => {
9857                            if !fields.insert(__FieldTag::__target) {
9858                                return std::result::Result::Err(A::Error::duplicate_field(
9859                                    "multiple values for target",
9860                                ));
9861                            }
9862                            result.target = map
9863                                .next_value::<std::option::Option<std::string::String>>()?
9864                                .unwrap_or_default();
9865                        }
9866                        __FieldTag::__verb => {
9867                            if !fields.insert(__FieldTag::__verb) {
9868                                return std::result::Result::Err(A::Error::duplicate_field(
9869                                    "multiple values for verb",
9870                                ));
9871                            }
9872                            result.verb = map
9873                                .next_value::<std::option::Option<std::string::String>>()?
9874                                .unwrap_or_default();
9875                        }
9876                        __FieldTag::__status_message => {
9877                            if !fields.insert(__FieldTag::__status_message) {
9878                                return std::result::Result::Err(A::Error::duplicate_field(
9879                                    "multiple values for status_message",
9880                                ));
9881                            }
9882                            result.status_message = map
9883                                .next_value::<std::option::Option<std::string::String>>()?
9884                                .unwrap_or_default();
9885                        }
9886                        __FieldTag::__requested_cancellation => {
9887                            if !fields.insert(__FieldTag::__requested_cancellation) {
9888                                return std::result::Result::Err(A::Error::duplicate_field(
9889                                    "multiple values for requested_cancellation",
9890                                ));
9891                            }
9892                            result.requested_cancellation = map
9893                                .next_value::<std::option::Option<bool>>()?
9894                                .unwrap_or_default();
9895                        }
9896                        __FieldTag::__api_version => {
9897                            if !fields.insert(__FieldTag::__api_version) {
9898                                return std::result::Result::Err(A::Error::duplicate_field(
9899                                    "multiple values for api_version",
9900                                ));
9901                            }
9902                            result.api_version = map
9903                                .next_value::<std::option::Option<std::string::String>>()?
9904                                .unwrap_or_default();
9905                        }
9906                        __FieldTag::__warnings => {
9907                            if !fields.insert(__FieldTag::__warnings) {
9908                                return std::result::Result::Err(A::Error::duplicate_field(
9909                                    "multiple values for warnings",
9910                                ));
9911                            }
9912                            result.warnings = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9913                        }
9914                        __FieldTag::__status_reason => {
9915                            if !fields.insert(__FieldTag::__status_reason) {
9916                                return std::result::Result::Err(A::Error::duplicate_field(
9917                                    "multiple values for status_reason",
9918                                ));
9919                            }
9920                            result.status_reason =
9921                                map.next_value::<std::option::Option<
9922                                    crate::model::operation_metadata::StatusReason,
9923                                >>()?
9924                                .unwrap_or_default();
9925                        }
9926                        __FieldTag::Unknown(key) => {
9927                            let value = map.next_value::<serde_json::Value>()?;
9928                            result._unknown_fields.insert(key, value);
9929                        }
9930                    }
9931                }
9932                std::result::Result::Ok(result)
9933            }
9934        }
9935        deserializer.deserialize_any(Visitor)
9936    }
9937}
9938
9939#[doc(hidden)]
9940impl serde::ser::Serialize for OperationMetadata {
9941    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9942    where
9943        S: serde::ser::Serializer,
9944    {
9945        use serde::ser::SerializeMap;
9946        #[allow(unused_imports)]
9947        use std::option::Option::Some;
9948        let mut state = serializer.serialize_map(std::option::Option::None)?;
9949        if self.create_time.is_some() {
9950            state.serialize_entry("createTime", &self.create_time)?;
9951        }
9952        if self.end_time.is_some() {
9953            state.serialize_entry("endTime", &self.end_time)?;
9954        }
9955        if !self.target.is_empty() {
9956            state.serialize_entry("target", &self.target)?;
9957        }
9958        if !self.verb.is_empty() {
9959            state.serialize_entry("verb", &self.verb)?;
9960        }
9961        if !self.status_message.is_empty() {
9962            state.serialize_entry("statusMessage", &self.status_message)?;
9963        }
9964        if !wkt::internal::is_default(&self.requested_cancellation) {
9965            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
9966        }
9967        if !self.api_version.is_empty() {
9968            state.serialize_entry("apiVersion", &self.api_version)?;
9969        }
9970        if !self.warnings.is_empty() {
9971            state.serialize_entry("warnings", &self.warnings)?;
9972        }
9973        if !wkt::internal::is_default(&self.status_reason) {
9974            state.serialize_entry("statusReason", &self.status_reason)?;
9975        }
9976        if !self._unknown_fields.is_empty() {
9977            for (key, value) in self._unknown_fields.iter() {
9978                state.serialize_entry(key, &value)?;
9979            }
9980        }
9981        state.end()
9982    }
9983}
9984
9985/// Defines additional types related to [OperationMetadata].
9986pub mod operation_metadata {
9987    #[allow(unused_imports)]
9988    use super::*;
9989
9990    /// Indicates the reason for the status of the operation.
9991    ///
9992    /// # Working with unknown values
9993    ///
9994    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9995    /// additional enum variants at any time. Adding new variants is not considered
9996    /// a breaking change. Applications should write their code in anticipation of:
9997    ///
9998    /// - New values appearing in future releases of the client library, **and**
9999    /// - New values received dynamically, without application changes.
10000    ///
10001    /// Please consult the [Working with enums] section in the user guide for some
10002    /// guidelines.
10003    ///
10004    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10005    #[derive(Clone, Debug, PartialEq)]
10006    #[non_exhaustive]
10007    pub enum StatusReason {
10008        /// Reason unknown.
10009        Unspecified,
10010        /// The cluster upgrade is currently paused.
10011        UpgradePaused,
10012        /// If set, the enum was initialized with an unknown value.
10013        ///
10014        /// Applications can examine the value using [StatusReason::value] or
10015        /// [StatusReason::name].
10016        UnknownValue(status_reason::UnknownValue),
10017    }
10018
10019    #[doc(hidden)]
10020    pub mod status_reason {
10021        #[allow(unused_imports)]
10022        use super::*;
10023        #[derive(Clone, Debug, PartialEq)]
10024        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10025    }
10026
10027    impl StatusReason {
10028        /// Gets the enum value.
10029        ///
10030        /// Returns `None` if the enum contains an unknown value deserialized from
10031        /// the string representation of enums.
10032        pub fn value(&self) -> std::option::Option<i32> {
10033            match self {
10034                Self::Unspecified => std::option::Option::Some(0),
10035                Self::UpgradePaused => std::option::Option::Some(1),
10036                Self::UnknownValue(u) => u.0.value(),
10037            }
10038        }
10039
10040        /// Gets the enum value as a string.
10041        ///
10042        /// Returns `None` if the enum contains an unknown value deserialized from
10043        /// the integer representation of enums.
10044        pub fn name(&self) -> std::option::Option<&str> {
10045            match self {
10046                Self::Unspecified => std::option::Option::Some("STATUS_REASON_UNSPECIFIED"),
10047                Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
10048                Self::UnknownValue(u) => u.0.name(),
10049            }
10050        }
10051    }
10052
10053    impl std::default::Default for StatusReason {
10054        fn default() -> Self {
10055            use std::convert::From;
10056            Self::from(0)
10057        }
10058    }
10059
10060    impl std::fmt::Display for StatusReason {
10061        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10062            wkt::internal::display_enum(f, self.name(), self.value())
10063        }
10064    }
10065
10066    impl std::convert::From<i32> for StatusReason {
10067        fn from(value: i32) -> Self {
10068            match value {
10069                0 => Self::Unspecified,
10070                1 => Self::UpgradePaused,
10071                _ => Self::UnknownValue(status_reason::UnknownValue(
10072                    wkt::internal::UnknownEnumValue::Integer(value),
10073                )),
10074            }
10075        }
10076    }
10077
10078    impl std::convert::From<&str> for StatusReason {
10079        fn from(value: &str) -> Self {
10080            use std::string::ToString;
10081            match value {
10082                "STATUS_REASON_UNSPECIFIED" => Self::Unspecified,
10083                "UPGRADE_PAUSED" => Self::UpgradePaused,
10084                _ => Self::UnknownValue(status_reason::UnknownValue(
10085                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10086                )),
10087            }
10088        }
10089    }
10090
10091    impl serde::ser::Serialize for StatusReason {
10092        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10093        where
10094            S: serde::Serializer,
10095        {
10096            match self {
10097                Self::Unspecified => serializer.serialize_i32(0),
10098                Self::UpgradePaused => serializer.serialize_i32(1),
10099                Self::UnknownValue(u) => u.0.serialize(serializer),
10100            }
10101        }
10102    }
10103
10104    impl<'de> serde::de::Deserialize<'de> for StatusReason {
10105        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10106        where
10107            D: serde::Deserializer<'de>,
10108        {
10109            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StatusReason>::new(
10110                ".google.cloud.edgecontainer.v1.OperationMetadata.StatusReason",
10111            ))
10112        }
10113    }
10114}
10115
10116/// Lists clusters in a location.
10117#[derive(Clone, Debug, Default, PartialEq)]
10118#[non_exhaustive]
10119pub struct ListClustersRequest {
10120    /// Required. The parent location, which owns this collection of clusters.
10121    pub parent: std::string::String,
10122
10123    /// The maximum number of resources to list.
10124    pub page_size: i32,
10125
10126    /// A page token received from previous list request.
10127    /// A page token received from previous list request.
10128    pub page_token: std::string::String,
10129
10130    /// Only resources matching this filter will be listed.
10131    pub filter: std::string::String,
10132
10133    /// Specifies the order in which resources will be listed.
10134    pub order_by: std::string::String,
10135
10136    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10137}
10138
10139impl ListClustersRequest {
10140    pub fn new() -> Self {
10141        std::default::Default::default()
10142    }
10143
10144    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
10145    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10146        self.parent = v.into();
10147        self
10148    }
10149
10150    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
10151    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10152        self.page_size = v.into();
10153        self
10154    }
10155
10156    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
10157    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10158        self.page_token = v.into();
10159        self
10160    }
10161
10162    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
10163    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10164        self.filter = v.into();
10165        self
10166    }
10167
10168    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
10169    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10170        self.order_by = v.into();
10171        self
10172    }
10173}
10174
10175impl wkt::message::Message for ListClustersRequest {
10176    fn typename() -> &'static str {
10177        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersRequest"
10178    }
10179}
10180
10181#[doc(hidden)]
10182impl<'de> serde::de::Deserialize<'de> for ListClustersRequest {
10183    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10184    where
10185        D: serde::Deserializer<'de>,
10186    {
10187        #[allow(non_camel_case_types)]
10188        #[doc(hidden)]
10189        #[derive(PartialEq, Eq, Hash)]
10190        enum __FieldTag {
10191            __parent,
10192            __page_size,
10193            __page_token,
10194            __filter,
10195            __order_by,
10196            Unknown(std::string::String),
10197        }
10198        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10199            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10200            where
10201                D: serde::Deserializer<'de>,
10202            {
10203                struct Visitor;
10204                impl<'de> serde::de::Visitor<'de> for Visitor {
10205                    type Value = __FieldTag;
10206                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10207                        formatter.write_str("a field name for ListClustersRequest")
10208                    }
10209                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10210                    where
10211                        E: serde::de::Error,
10212                    {
10213                        use std::result::Result::Ok;
10214                        use std::string::ToString;
10215                        match value {
10216                            "parent" => Ok(__FieldTag::__parent),
10217                            "pageSize" => Ok(__FieldTag::__page_size),
10218                            "page_size" => Ok(__FieldTag::__page_size),
10219                            "pageToken" => Ok(__FieldTag::__page_token),
10220                            "page_token" => Ok(__FieldTag::__page_token),
10221                            "filter" => Ok(__FieldTag::__filter),
10222                            "orderBy" => Ok(__FieldTag::__order_by),
10223                            "order_by" => Ok(__FieldTag::__order_by),
10224                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10225                        }
10226                    }
10227                }
10228                deserializer.deserialize_identifier(Visitor)
10229            }
10230        }
10231        struct Visitor;
10232        impl<'de> serde::de::Visitor<'de> for Visitor {
10233            type Value = ListClustersRequest;
10234            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10235                formatter.write_str("struct ListClustersRequest")
10236            }
10237            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10238            where
10239                A: serde::de::MapAccess<'de>,
10240            {
10241                #[allow(unused_imports)]
10242                use serde::de::Error;
10243                use std::option::Option::Some;
10244                let mut fields = std::collections::HashSet::new();
10245                let mut result = Self::Value::new();
10246                while let Some(tag) = map.next_key::<__FieldTag>()? {
10247                    #[allow(clippy::match_single_binding)]
10248                    match tag {
10249                        __FieldTag::__parent => {
10250                            if !fields.insert(__FieldTag::__parent) {
10251                                return std::result::Result::Err(A::Error::duplicate_field(
10252                                    "multiple values for parent",
10253                                ));
10254                            }
10255                            result.parent = map
10256                                .next_value::<std::option::Option<std::string::String>>()?
10257                                .unwrap_or_default();
10258                        }
10259                        __FieldTag::__page_size => {
10260                            if !fields.insert(__FieldTag::__page_size) {
10261                                return std::result::Result::Err(A::Error::duplicate_field(
10262                                    "multiple values for page_size",
10263                                ));
10264                            }
10265                            struct __With(std::option::Option<i32>);
10266                            impl<'de> serde::de::Deserialize<'de> for __With {
10267                                fn deserialize<D>(
10268                                    deserializer: D,
10269                                ) -> std::result::Result<Self, D::Error>
10270                                where
10271                                    D: serde::de::Deserializer<'de>,
10272                                {
10273                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10274                                }
10275                            }
10276                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
10277                        }
10278                        __FieldTag::__page_token => {
10279                            if !fields.insert(__FieldTag::__page_token) {
10280                                return std::result::Result::Err(A::Error::duplicate_field(
10281                                    "multiple values for page_token",
10282                                ));
10283                            }
10284                            result.page_token = map
10285                                .next_value::<std::option::Option<std::string::String>>()?
10286                                .unwrap_or_default();
10287                        }
10288                        __FieldTag::__filter => {
10289                            if !fields.insert(__FieldTag::__filter) {
10290                                return std::result::Result::Err(A::Error::duplicate_field(
10291                                    "multiple values for filter",
10292                                ));
10293                            }
10294                            result.filter = map
10295                                .next_value::<std::option::Option<std::string::String>>()?
10296                                .unwrap_or_default();
10297                        }
10298                        __FieldTag::__order_by => {
10299                            if !fields.insert(__FieldTag::__order_by) {
10300                                return std::result::Result::Err(A::Error::duplicate_field(
10301                                    "multiple values for order_by",
10302                                ));
10303                            }
10304                            result.order_by = map
10305                                .next_value::<std::option::Option<std::string::String>>()?
10306                                .unwrap_or_default();
10307                        }
10308                        __FieldTag::Unknown(key) => {
10309                            let value = map.next_value::<serde_json::Value>()?;
10310                            result._unknown_fields.insert(key, value);
10311                        }
10312                    }
10313                }
10314                std::result::Result::Ok(result)
10315            }
10316        }
10317        deserializer.deserialize_any(Visitor)
10318    }
10319}
10320
10321#[doc(hidden)]
10322impl serde::ser::Serialize for ListClustersRequest {
10323    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10324    where
10325        S: serde::ser::Serializer,
10326    {
10327        use serde::ser::SerializeMap;
10328        #[allow(unused_imports)]
10329        use std::option::Option::Some;
10330        let mut state = serializer.serialize_map(std::option::Option::None)?;
10331        if !self.parent.is_empty() {
10332            state.serialize_entry("parent", &self.parent)?;
10333        }
10334        if !wkt::internal::is_default(&self.page_size) {
10335            struct __With<'a>(&'a i32);
10336            impl<'a> serde::ser::Serialize for __With<'a> {
10337                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10338                where
10339                    S: serde::ser::Serializer,
10340                {
10341                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10342                }
10343            }
10344            state.serialize_entry("pageSize", &__With(&self.page_size))?;
10345        }
10346        if !self.page_token.is_empty() {
10347            state.serialize_entry("pageToken", &self.page_token)?;
10348        }
10349        if !self.filter.is_empty() {
10350            state.serialize_entry("filter", &self.filter)?;
10351        }
10352        if !self.order_by.is_empty() {
10353            state.serialize_entry("orderBy", &self.order_by)?;
10354        }
10355        if !self._unknown_fields.is_empty() {
10356            for (key, value) in self._unknown_fields.iter() {
10357                state.serialize_entry(key, &value)?;
10358            }
10359        }
10360        state.end()
10361    }
10362}
10363
10364/// List of clusters in a location.
10365#[derive(Clone, Debug, Default, PartialEq)]
10366#[non_exhaustive]
10367pub struct ListClustersResponse {
10368    /// Clusters in the location.
10369    pub clusters: std::vec::Vec<crate::model::Cluster>,
10370
10371    /// A token to retrieve next page of results.
10372    pub next_page_token: std::string::String,
10373
10374    /// Locations that could not be reached.
10375    pub unreachable: std::vec::Vec<std::string::String>,
10376
10377    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10378}
10379
10380impl ListClustersResponse {
10381    pub fn new() -> Self {
10382        std::default::Default::default()
10383    }
10384
10385    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
10386    pub fn set_clusters<T, V>(mut self, v: T) -> Self
10387    where
10388        T: std::iter::IntoIterator<Item = V>,
10389        V: std::convert::Into<crate::model::Cluster>,
10390    {
10391        use std::iter::Iterator;
10392        self.clusters = v.into_iter().map(|i| i.into()).collect();
10393        self
10394    }
10395
10396    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
10397    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10398        self.next_page_token = v.into();
10399        self
10400    }
10401
10402    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
10403    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10404    where
10405        T: std::iter::IntoIterator<Item = V>,
10406        V: std::convert::Into<std::string::String>,
10407    {
10408        use std::iter::Iterator;
10409        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10410        self
10411    }
10412}
10413
10414impl wkt::message::Message for ListClustersResponse {
10415    fn typename() -> &'static str {
10416        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersResponse"
10417    }
10418}
10419
10420#[doc(hidden)]
10421impl gax::paginator::internal::PageableResponse for ListClustersResponse {
10422    type PageItem = crate::model::Cluster;
10423
10424    fn items(self) -> std::vec::Vec<Self::PageItem> {
10425        self.clusters
10426    }
10427
10428    fn next_page_token(&self) -> std::string::String {
10429        use std::clone::Clone;
10430        self.next_page_token.clone()
10431    }
10432}
10433
10434#[doc(hidden)]
10435impl<'de> serde::de::Deserialize<'de> for ListClustersResponse {
10436    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10437    where
10438        D: serde::Deserializer<'de>,
10439    {
10440        #[allow(non_camel_case_types)]
10441        #[doc(hidden)]
10442        #[derive(PartialEq, Eq, Hash)]
10443        enum __FieldTag {
10444            __clusters,
10445            __next_page_token,
10446            __unreachable,
10447            Unknown(std::string::String),
10448        }
10449        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10450            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10451            where
10452                D: serde::Deserializer<'de>,
10453            {
10454                struct Visitor;
10455                impl<'de> serde::de::Visitor<'de> for Visitor {
10456                    type Value = __FieldTag;
10457                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10458                        formatter.write_str("a field name for ListClustersResponse")
10459                    }
10460                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10461                    where
10462                        E: serde::de::Error,
10463                    {
10464                        use std::result::Result::Ok;
10465                        use std::string::ToString;
10466                        match value {
10467                            "clusters" => Ok(__FieldTag::__clusters),
10468                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
10469                            "next_page_token" => Ok(__FieldTag::__next_page_token),
10470                            "unreachable" => Ok(__FieldTag::__unreachable),
10471                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10472                        }
10473                    }
10474                }
10475                deserializer.deserialize_identifier(Visitor)
10476            }
10477        }
10478        struct Visitor;
10479        impl<'de> serde::de::Visitor<'de> for Visitor {
10480            type Value = ListClustersResponse;
10481            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10482                formatter.write_str("struct ListClustersResponse")
10483            }
10484            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10485            where
10486                A: serde::de::MapAccess<'de>,
10487            {
10488                #[allow(unused_imports)]
10489                use serde::de::Error;
10490                use std::option::Option::Some;
10491                let mut fields = std::collections::HashSet::new();
10492                let mut result = Self::Value::new();
10493                while let Some(tag) = map.next_key::<__FieldTag>()? {
10494                    #[allow(clippy::match_single_binding)]
10495                    match tag {
10496                        __FieldTag::__clusters => {
10497                            if !fields.insert(__FieldTag::__clusters) {
10498                                return std::result::Result::Err(A::Error::duplicate_field(
10499                                    "multiple values for clusters",
10500                                ));
10501                            }
10502                            result.clusters = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Cluster>>>()?.unwrap_or_default();
10503                        }
10504                        __FieldTag::__next_page_token => {
10505                            if !fields.insert(__FieldTag::__next_page_token) {
10506                                return std::result::Result::Err(A::Error::duplicate_field(
10507                                    "multiple values for next_page_token",
10508                                ));
10509                            }
10510                            result.next_page_token = map
10511                                .next_value::<std::option::Option<std::string::String>>()?
10512                                .unwrap_or_default();
10513                        }
10514                        __FieldTag::__unreachable => {
10515                            if !fields.insert(__FieldTag::__unreachable) {
10516                                return std::result::Result::Err(A::Error::duplicate_field(
10517                                    "multiple values for unreachable",
10518                                ));
10519                            }
10520                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
10521                        }
10522                        __FieldTag::Unknown(key) => {
10523                            let value = map.next_value::<serde_json::Value>()?;
10524                            result._unknown_fields.insert(key, value);
10525                        }
10526                    }
10527                }
10528                std::result::Result::Ok(result)
10529            }
10530        }
10531        deserializer.deserialize_any(Visitor)
10532    }
10533}
10534
10535#[doc(hidden)]
10536impl serde::ser::Serialize for ListClustersResponse {
10537    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10538    where
10539        S: serde::ser::Serializer,
10540    {
10541        use serde::ser::SerializeMap;
10542        #[allow(unused_imports)]
10543        use std::option::Option::Some;
10544        let mut state = serializer.serialize_map(std::option::Option::None)?;
10545        if !self.clusters.is_empty() {
10546            state.serialize_entry("clusters", &self.clusters)?;
10547        }
10548        if !self.next_page_token.is_empty() {
10549            state.serialize_entry("nextPageToken", &self.next_page_token)?;
10550        }
10551        if !self.unreachable.is_empty() {
10552            state.serialize_entry("unreachable", &self.unreachable)?;
10553        }
10554        if !self._unknown_fields.is_empty() {
10555            for (key, value) in self._unknown_fields.iter() {
10556                state.serialize_entry(key, &value)?;
10557            }
10558        }
10559        state.end()
10560    }
10561}
10562
10563/// Gets a cluster.
10564#[derive(Clone, Debug, Default, PartialEq)]
10565#[non_exhaustive]
10566pub struct GetClusterRequest {
10567    /// Required. The resource name of the cluster.
10568    pub name: std::string::String,
10569
10570    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10571}
10572
10573impl GetClusterRequest {
10574    pub fn new() -> Self {
10575        std::default::Default::default()
10576    }
10577
10578    /// Sets the value of [name][crate::model::GetClusterRequest::name].
10579    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10580        self.name = v.into();
10581        self
10582    }
10583}
10584
10585impl wkt::message::Message for GetClusterRequest {
10586    fn typename() -> &'static str {
10587        "type.googleapis.com/google.cloud.edgecontainer.v1.GetClusterRequest"
10588    }
10589}
10590
10591#[doc(hidden)]
10592impl<'de> serde::de::Deserialize<'de> for GetClusterRequest {
10593    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10594    where
10595        D: serde::Deserializer<'de>,
10596    {
10597        #[allow(non_camel_case_types)]
10598        #[doc(hidden)]
10599        #[derive(PartialEq, Eq, Hash)]
10600        enum __FieldTag {
10601            __name,
10602            Unknown(std::string::String),
10603        }
10604        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10605            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10606            where
10607                D: serde::Deserializer<'de>,
10608            {
10609                struct Visitor;
10610                impl<'de> serde::de::Visitor<'de> for Visitor {
10611                    type Value = __FieldTag;
10612                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10613                        formatter.write_str("a field name for GetClusterRequest")
10614                    }
10615                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10616                    where
10617                        E: serde::de::Error,
10618                    {
10619                        use std::result::Result::Ok;
10620                        use std::string::ToString;
10621                        match value {
10622                            "name" => Ok(__FieldTag::__name),
10623                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10624                        }
10625                    }
10626                }
10627                deserializer.deserialize_identifier(Visitor)
10628            }
10629        }
10630        struct Visitor;
10631        impl<'de> serde::de::Visitor<'de> for Visitor {
10632            type Value = GetClusterRequest;
10633            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10634                formatter.write_str("struct GetClusterRequest")
10635            }
10636            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10637            where
10638                A: serde::de::MapAccess<'de>,
10639            {
10640                #[allow(unused_imports)]
10641                use serde::de::Error;
10642                use std::option::Option::Some;
10643                let mut fields = std::collections::HashSet::new();
10644                let mut result = Self::Value::new();
10645                while let Some(tag) = map.next_key::<__FieldTag>()? {
10646                    #[allow(clippy::match_single_binding)]
10647                    match tag {
10648                        __FieldTag::__name => {
10649                            if !fields.insert(__FieldTag::__name) {
10650                                return std::result::Result::Err(A::Error::duplicate_field(
10651                                    "multiple values for name",
10652                                ));
10653                            }
10654                            result.name = map
10655                                .next_value::<std::option::Option<std::string::String>>()?
10656                                .unwrap_or_default();
10657                        }
10658                        __FieldTag::Unknown(key) => {
10659                            let value = map.next_value::<serde_json::Value>()?;
10660                            result._unknown_fields.insert(key, value);
10661                        }
10662                    }
10663                }
10664                std::result::Result::Ok(result)
10665            }
10666        }
10667        deserializer.deserialize_any(Visitor)
10668    }
10669}
10670
10671#[doc(hidden)]
10672impl serde::ser::Serialize for GetClusterRequest {
10673    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10674    where
10675        S: serde::ser::Serializer,
10676    {
10677        use serde::ser::SerializeMap;
10678        #[allow(unused_imports)]
10679        use std::option::Option::Some;
10680        let mut state = serializer.serialize_map(std::option::Option::None)?;
10681        if !self.name.is_empty() {
10682            state.serialize_entry("name", &self.name)?;
10683        }
10684        if !self._unknown_fields.is_empty() {
10685            for (key, value) in self._unknown_fields.iter() {
10686                state.serialize_entry(key, &value)?;
10687            }
10688        }
10689        state.end()
10690    }
10691}
10692
10693/// Creates a cluster.
10694#[derive(Clone, Debug, Default, PartialEq)]
10695#[non_exhaustive]
10696pub struct CreateClusterRequest {
10697    /// Required. The parent location where this cluster will be created.
10698    pub parent: std::string::String,
10699
10700    /// Required. A client-specified unique identifier for the cluster.
10701    pub cluster_id: std::string::String,
10702
10703    /// Required. The cluster to create.
10704    pub cluster: std::option::Option<crate::model::Cluster>,
10705
10706    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
10707    /// random UUID is recommended. This request is only idempotent if
10708    /// `request_id` is provided.
10709    pub request_id: std::string::String,
10710
10711    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10712}
10713
10714impl CreateClusterRequest {
10715    pub fn new() -> Self {
10716        std::default::Default::default()
10717    }
10718
10719    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
10720    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10721        self.parent = v.into();
10722        self
10723    }
10724
10725    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
10726    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10727        self.cluster_id = v.into();
10728        self
10729    }
10730
10731    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
10732    pub fn set_cluster<T>(mut self, v: T) -> Self
10733    where
10734        T: std::convert::Into<crate::model::Cluster>,
10735    {
10736        self.cluster = std::option::Option::Some(v.into());
10737        self
10738    }
10739
10740    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
10741    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
10742    where
10743        T: std::convert::Into<crate::model::Cluster>,
10744    {
10745        self.cluster = v.map(|x| x.into());
10746        self
10747    }
10748
10749    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
10750    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10751        self.request_id = v.into();
10752        self
10753    }
10754}
10755
10756impl wkt::message::Message for CreateClusterRequest {
10757    fn typename() -> &'static str {
10758        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateClusterRequest"
10759    }
10760}
10761
10762#[doc(hidden)]
10763impl<'de> serde::de::Deserialize<'de> for CreateClusterRequest {
10764    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10765    where
10766        D: serde::Deserializer<'de>,
10767    {
10768        #[allow(non_camel_case_types)]
10769        #[doc(hidden)]
10770        #[derive(PartialEq, Eq, Hash)]
10771        enum __FieldTag {
10772            __parent,
10773            __cluster_id,
10774            __cluster,
10775            __request_id,
10776            Unknown(std::string::String),
10777        }
10778        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10779            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10780            where
10781                D: serde::Deserializer<'de>,
10782            {
10783                struct Visitor;
10784                impl<'de> serde::de::Visitor<'de> for Visitor {
10785                    type Value = __FieldTag;
10786                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10787                        formatter.write_str("a field name for CreateClusterRequest")
10788                    }
10789                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10790                    where
10791                        E: serde::de::Error,
10792                    {
10793                        use std::result::Result::Ok;
10794                        use std::string::ToString;
10795                        match value {
10796                            "parent" => Ok(__FieldTag::__parent),
10797                            "clusterId" => Ok(__FieldTag::__cluster_id),
10798                            "cluster_id" => Ok(__FieldTag::__cluster_id),
10799                            "cluster" => Ok(__FieldTag::__cluster),
10800                            "requestId" => Ok(__FieldTag::__request_id),
10801                            "request_id" => Ok(__FieldTag::__request_id),
10802                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10803                        }
10804                    }
10805                }
10806                deserializer.deserialize_identifier(Visitor)
10807            }
10808        }
10809        struct Visitor;
10810        impl<'de> serde::de::Visitor<'de> for Visitor {
10811            type Value = CreateClusterRequest;
10812            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10813                formatter.write_str("struct CreateClusterRequest")
10814            }
10815            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10816            where
10817                A: serde::de::MapAccess<'de>,
10818            {
10819                #[allow(unused_imports)]
10820                use serde::de::Error;
10821                use std::option::Option::Some;
10822                let mut fields = std::collections::HashSet::new();
10823                let mut result = Self::Value::new();
10824                while let Some(tag) = map.next_key::<__FieldTag>()? {
10825                    #[allow(clippy::match_single_binding)]
10826                    match tag {
10827                        __FieldTag::__parent => {
10828                            if !fields.insert(__FieldTag::__parent) {
10829                                return std::result::Result::Err(A::Error::duplicate_field(
10830                                    "multiple values for parent",
10831                                ));
10832                            }
10833                            result.parent = map
10834                                .next_value::<std::option::Option<std::string::String>>()?
10835                                .unwrap_or_default();
10836                        }
10837                        __FieldTag::__cluster_id => {
10838                            if !fields.insert(__FieldTag::__cluster_id) {
10839                                return std::result::Result::Err(A::Error::duplicate_field(
10840                                    "multiple values for cluster_id",
10841                                ));
10842                            }
10843                            result.cluster_id = map
10844                                .next_value::<std::option::Option<std::string::String>>()?
10845                                .unwrap_or_default();
10846                        }
10847                        __FieldTag::__cluster => {
10848                            if !fields.insert(__FieldTag::__cluster) {
10849                                return std::result::Result::Err(A::Error::duplicate_field(
10850                                    "multiple values for cluster",
10851                                ));
10852                            }
10853                            result.cluster =
10854                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
10855                        }
10856                        __FieldTag::__request_id => {
10857                            if !fields.insert(__FieldTag::__request_id) {
10858                                return std::result::Result::Err(A::Error::duplicate_field(
10859                                    "multiple values for request_id",
10860                                ));
10861                            }
10862                            result.request_id = map
10863                                .next_value::<std::option::Option<std::string::String>>()?
10864                                .unwrap_or_default();
10865                        }
10866                        __FieldTag::Unknown(key) => {
10867                            let value = map.next_value::<serde_json::Value>()?;
10868                            result._unknown_fields.insert(key, value);
10869                        }
10870                    }
10871                }
10872                std::result::Result::Ok(result)
10873            }
10874        }
10875        deserializer.deserialize_any(Visitor)
10876    }
10877}
10878
10879#[doc(hidden)]
10880impl serde::ser::Serialize for CreateClusterRequest {
10881    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10882    where
10883        S: serde::ser::Serializer,
10884    {
10885        use serde::ser::SerializeMap;
10886        #[allow(unused_imports)]
10887        use std::option::Option::Some;
10888        let mut state = serializer.serialize_map(std::option::Option::None)?;
10889        if !self.parent.is_empty() {
10890            state.serialize_entry("parent", &self.parent)?;
10891        }
10892        if !self.cluster_id.is_empty() {
10893            state.serialize_entry("clusterId", &self.cluster_id)?;
10894        }
10895        if self.cluster.is_some() {
10896            state.serialize_entry("cluster", &self.cluster)?;
10897        }
10898        if !self.request_id.is_empty() {
10899            state.serialize_entry("requestId", &self.request_id)?;
10900        }
10901        if !self._unknown_fields.is_empty() {
10902            for (key, value) in self._unknown_fields.iter() {
10903                state.serialize_entry(key, &value)?;
10904            }
10905        }
10906        state.end()
10907    }
10908}
10909
10910/// Updates a cluster.
10911#[derive(Clone, Debug, Default, PartialEq)]
10912#[non_exhaustive]
10913pub struct UpdateClusterRequest {
10914    /// Field mask is used to specify the fields to be overwritten in the
10915    /// Cluster resource by the update.
10916    /// The fields specified in the update_mask are relative to the resource, not
10917    /// the full request. A field will be overwritten if it is in the mask. If the
10918    /// user does not provide a mask then all fields will be overwritten.
10919    pub update_mask: std::option::Option<wkt::FieldMask>,
10920
10921    /// The updated cluster.
10922    pub cluster: std::option::Option<crate::model::Cluster>,
10923
10924    /// A unique identifier for this request. Restricted to 36 ASCII characters.
10925    /// A random UUID is recommended.
10926    /// This request is only idempotent if `request_id` is provided.
10927    pub request_id: std::string::String,
10928
10929    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10930}
10931
10932impl UpdateClusterRequest {
10933    pub fn new() -> Self {
10934        std::default::Default::default()
10935    }
10936
10937    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
10938    pub fn set_update_mask<T>(mut self, v: T) -> Self
10939    where
10940        T: std::convert::Into<wkt::FieldMask>,
10941    {
10942        self.update_mask = std::option::Option::Some(v.into());
10943        self
10944    }
10945
10946    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
10947    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10948    where
10949        T: std::convert::Into<wkt::FieldMask>,
10950    {
10951        self.update_mask = v.map(|x| x.into());
10952        self
10953    }
10954
10955    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
10956    pub fn set_cluster<T>(mut self, v: T) -> Self
10957    where
10958        T: std::convert::Into<crate::model::Cluster>,
10959    {
10960        self.cluster = std::option::Option::Some(v.into());
10961        self
10962    }
10963
10964    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
10965    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
10966    where
10967        T: std::convert::Into<crate::model::Cluster>,
10968    {
10969        self.cluster = v.map(|x| x.into());
10970        self
10971    }
10972
10973    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
10974    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10975        self.request_id = v.into();
10976        self
10977    }
10978}
10979
10980impl wkt::message::Message for UpdateClusterRequest {
10981    fn typename() -> &'static str {
10982        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateClusterRequest"
10983    }
10984}
10985
10986#[doc(hidden)]
10987impl<'de> serde::de::Deserialize<'de> for UpdateClusterRequest {
10988    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10989    where
10990        D: serde::Deserializer<'de>,
10991    {
10992        #[allow(non_camel_case_types)]
10993        #[doc(hidden)]
10994        #[derive(PartialEq, Eq, Hash)]
10995        enum __FieldTag {
10996            __update_mask,
10997            __cluster,
10998            __request_id,
10999            Unknown(std::string::String),
11000        }
11001        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11002            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11003            where
11004                D: serde::Deserializer<'de>,
11005            {
11006                struct Visitor;
11007                impl<'de> serde::de::Visitor<'de> for Visitor {
11008                    type Value = __FieldTag;
11009                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11010                        formatter.write_str("a field name for UpdateClusterRequest")
11011                    }
11012                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11013                    where
11014                        E: serde::de::Error,
11015                    {
11016                        use std::result::Result::Ok;
11017                        use std::string::ToString;
11018                        match value {
11019                            "updateMask" => Ok(__FieldTag::__update_mask),
11020                            "update_mask" => Ok(__FieldTag::__update_mask),
11021                            "cluster" => Ok(__FieldTag::__cluster),
11022                            "requestId" => Ok(__FieldTag::__request_id),
11023                            "request_id" => Ok(__FieldTag::__request_id),
11024                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11025                        }
11026                    }
11027                }
11028                deserializer.deserialize_identifier(Visitor)
11029            }
11030        }
11031        struct Visitor;
11032        impl<'de> serde::de::Visitor<'de> for Visitor {
11033            type Value = UpdateClusterRequest;
11034            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11035                formatter.write_str("struct UpdateClusterRequest")
11036            }
11037            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11038            where
11039                A: serde::de::MapAccess<'de>,
11040            {
11041                #[allow(unused_imports)]
11042                use serde::de::Error;
11043                use std::option::Option::Some;
11044                let mut fields = std::collections::HashSet::new();
11045                let mut result = Self::Value::new();
11046                while let Some(tag) = map.next_key::<__FieldTag>()? {
11047                    #[allow(clippy::match_single_binding)]
11048                    match tag {
11049                        __FieldTag::__update_mask => {
11050                            if !fields.insert(__FieldTag::__update_mask) {
11051                                return std::result::Result::Err(A::Error::duplicate_field(
11052                                    "multiple values for update_mask",
11053                                ));
11054                            }
11055                            result.update_mask =
11056                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
11057                        }
11058                        __FieldTag::__cluster => {
11059                            if !fields.insert(__FieldTag::__cluster) {
11060                                return std::result::Result::Err(A::Error::duplicate_field(
11061                                    "multiple values for cluster",
11062                                ));
11063                            }
11064                            result.cluster =
11065                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
11066                        }
11067                        __FieldTag::__request_id => {
11068                            if !fields.insert(__FieldTag::__request_id) {
11069                                return std::result::Result::Err(A::Error::duplicate_field(
11070                                    "multiple values for request_id",
11071                                ));
11072                            }
11073                            result.request_id = map
11074                                .next_value::<std::option::Option<std::string::String>>()?
11075                                .unwrap_or_default();
11076                        }
11077                        __FieldTag::Unknown(key) => {
11078                            let value = map.next_value::<serde_json::Value>()?;
11079                            result._unknown_fields.insert(key, value);
11080                        }
11081                    }
11082                }
11083                std::result::Result::Ok(result)
11084            }
11085        }
11086        deserializer.deserialize_any(Visitor)
11087    }
11088}
11089
11090#[doc(hidden)]
11091impl serde::ser::Serialize for UpdateClusterRequest {
11092    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11093    where
11094        S: serde::ser::Serializer,
11095    {
11096        use serde::ser::SerializeMap;
11097        #[allow(unused_imports)]
11098        use std::option::Option::Some;
11099        let mut state = serializer.serialize_map(std::option::Option::None)?;
11100        if self.update_mask.is_some() {
11101            state.serialize_entry("updateMask", &self.update_mask)?;
11102        }
11103        if self.cluster.is_some() {
11104            state.serialize_entry("cluster", &self.cluster)?;
11105        }
11106        if !self.request_id.is_empty() {
11107            state.serialize_entry("requestId", &self.request_id)?;
11108        }
11109        if !self._unknown_fields.is_empty() {
11110            for (key, value) in self._unknown_fields.iter() {
11111                state.serialize_entry(key, &value)?;
11112            }
11113        }
11114        state.end()
11115    }
11116}
11117
11118/// Upgrades a cluster.
11119#[derive(Clone, Debug, Default, PartialEq)]
11120#[non_exhaustive]
11121pub struct UpgradeClusterRequest {
11122    /// Required. The resource name of the cluster.
11123    pub name: std::string::String,
11124
11125    /// Required. The version the cluster is going to be upgraded to.
11126    pub target_version: std::string::String,
11127
11128    /// The schedule for the upgrade.
11129    pub schedule: crate::model::upgrade_cluster_request::Schedule,
11130
11131    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
11132    /// random UUID is recommended. This request is only idempotent if
11133    /// `request_id` is provided.
11134    pub request_id: std::string::String,
11135
11136    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11137}
11138
11139impl UpgradeClusterRequest {
11140    pub fn new() -> Self {
11141        std::default::Default::default()
11142    }
11143
11144    /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
11145    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11146        self.name = v.into();
11147        self
11148    }
11149
11150    /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
11151    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11152        self.target_version = v.into();
11153        self
11154    }
11155
11156    /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
11157    pub fn set_schedule<T: std::convert::Into<crate::model::upgrade_cluster_request::Schedule>>(
11158        mut self,
11159        v: T,
11160    ) -> Self {
11161        self.schedule = v.into();
11162        self
11163    }
11164
11165    /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
11166    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11167        self.request_id = v.into();
11168        self
11169    }
11170}
11171
11172impl wkt::message::Message for UpgradeClusterRequest {
11173    fn typename() -> &'static str {
11174        "type.googleapis.com/google.cloud.edgecontainer.v1.UpgradeClusterRequest"
11175    }
11176}
11177
11178#[doc(hidden)]
11179impl<'de> serde::de::Deserialize<'de> for UpgradeClusterRequest {
11180    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11181    where
11182        D: serde::Deserializer<'de>,
11183    {
11184        #[allow(non_camel_case_types)]
11185        #[doc(hidden)]
11186        #[derive(PartialEq, Eq, Hash)]
11187        enum __FieldTag {
11188            __name,
11189            __target_version,
11190            __schedule,
11191            __request_id,
11192            Unknown(std::string::String),
11193        }
11194        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11195            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11196            where
11197                D: serde::Deserializer<'de>,
11198            {
11199                struct Visitor;
11200                impl<'de> serde::de::Visitor<'de> for Visitor {
11201                    type Value = __FieldTag;
11202                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11203                        formatter.write_str("a field name for UpgradeClusterRequest")
11204                    }
11205                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11206                    where
11207                        E: serde::de::Error,
11208                    {
11209                        use std::result::Result::Ok;
11210                        use std::string::ToString;
11211                        match value {
11212                            "name" => Ok(__FieldTag::__name),
11213                            "targetVersion" => Ok(__FieldTag::__target_version),
11214                            "target_version" => Ok(__FieldTag::__target_version),
11215                            "schedule" => Ok(__FieldTag::__schedule),
11216                            "requestId" => Ok(__FieldTag::__request_id),
11217                            "request_id" => Ok(__FieldTag::__request_id),
11218                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11219                        }
11220                    }
11221                }
11222                deserializer.deserialize_identifier(Visitor)
11223            }
11224        }
11225        struct Visitor;
11226        impl<'de> serde::de::Visitor<'de> for Visitor {
11227            type Value = UpgradeClusterRequest;
11228            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11229                formatter.write_str("struct UpgradeClusterRequest")
11230            }
11231            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11232            where
11233                A: serde::de::MapAccess<'de>,
11234            {
11235                #[allow(unused_imports)]
11236                use serde::de::Error;
11237                use std::option::Option::Some;
11238                let mut fields = std::collections::HashSet::new();
11239                let mut result = Self::Value::new();
11240                while let Some(tag) = map.next_key::<__FieldTag>()? {
11241                    #[allow(clippy::match_single_binding)]
11242                    match tag {
11243                        __FieldTag::__name => {
11244                            if !fields.insert(__FieldTag::__name) {
11245                                return std::result::Result::Err(A::Error::duplicate_field(
11246                                    "multiple values for name",
11247                                ));
11248                            }
11249                            result.name = map
11250                                .next_value::<std::option::Option<std::string::String>>()?
11251                                .unwrap_or_default();
11252                        }
11253                        __FieldTag::__target_version => {
11254                            if !fields.insert(__FieldTag::__target_version) {
11255                                return std::result::Result::Err(A::Error::duplicate_field(
11256                                    "multiple values for target_version",
11257                                ));
11258                            }
11259                            result.target_version = map
11260                                .next_value::<std::option::Option<std::string::String>>()?
11261                                .unwrap_or_default();
11262                        }
11263                        __FieldTag::__schedule => {
11264                            if !fields.insert(__FieldTag::__schedule) {
11265                                return std::result::Result::Err(A::Error::duplicate_field(
11266                                    "multiple values for schedule",
11267                                ));
11268                            }
11269                            result.schedule = map
11270                                .next_value::<std::option::Option<
11271                                    crate::model::upgrade_cluster_request::Schedule,
11272                                >>()?
11273                                .unwrap_or_default();
11274                        }
11275                        __FieldTag::__request_id => {
11276                            if !fields.insert(__FieldTag::__request_id) {
11277                                return std::result::Result::Err(A::Error::duplicate_field(
11278                                    "multiple values for request_id",
11279                                ));
11280                            }
11281                            result.request_id = map
11282                                .next_value::<std::option::Option<std::string::String>>()?
11283                                .unwrap_or_default();
11284                        }
11285                        __FieldTag::Unknown(key) => {
11286                            let value = map.next_value::<serde_json::Value>()?;
11287                            result._unknown_fields.insert(key, value);
11288                        }
11289                    }
11290                }
11291                std::result::Result::Ok(result)
11292            }
11293        }
11294        deserializer.deserialize_any(Visitor)
11295    }
11296}
11297
11298#[doc(hidden)]
11299impl serde::ser::Serialize for UpgradeClusterRequest {
11300    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11301    where
11302        S: serde::ser::Serializer,
11303    {
11304        use serde::ser::SerializeMap;
11305        #[allow(unused_imports)]
11306        use std::option::Option::Some;
11307        let mut state = serializer.serialize_map(std::option::Option::None)?;
11308        if !self.name.is_empty() {
11309            state.serialize_entry("name", &self.name)?;
11310        }
11311        if !self.target_version.is_empty() {
11312            state.serialize_entry("targetVersion", &self.target_version)?;
11313        }
11314        if !wkt::internal::is_default(&self.schedule) {
11315            state.serialize_entry("schedule", &self.schedule)?;
11316        }
11317        if !self.request_id.is_empty() {
11318            state.serialize_entry("requestId", &self.request_id)?;
11319        }
11320        if !self._unknown_fields.is_empty() {
11321            for (key, value) in self._unknown_fields.iter() {
11322                state.serialize_entry(key, &value)?;
11323            }
11324        }
11325        state.end()
11326    }
11327}
11328
11329/// Defines additional types related to [UpgradeClusterRequest].
11330pub mod upgrade_cluster_request {
11331    #[allow(unused_imports)]
11332    use super::*;
11333
11334    /// Represents the schedule about when the cluster is going to be upgraded.
11335    ///
11336    /// # Working with unknown values
11337    ///
11338    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11339    /// additional enum variants at any time. Adding new variants is not considered
11340    /// a breaking change. Applications should write their code in anticipation of:
11341    ///
11342    /// - New values appearing in future releases of the client library, **and**
11343    /// - New values received dynamically, without application changes.
11344    ///
11345    /// Please consult the [Working with enums] section in the user guide for some
11346    /// guidelines.
11347    ///
11348    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11349    #[derive(Clone, Debug, PartialEq)]
11350    #[non_exhaustive]
11351    pub enum Schedule {
11352        /// Unspecified. The default is to upgrade the cluster immediately which is
11353        /// the only option today.
11354        Unspecified,
11355        /// The cluster is going to be upgraded immediately after receiving the
11356        /// request.
11357        Immediately,
11358        /// If set, the enum was initialized with an unknown value.
11359        ///
11360        /// Applications can examine the value using [Schedule::value] or
11361        /// [Schedule::name].
11362        UnknownValue(schedule::UnknownValue),
11363    }
11364
11365    #[doc(hidden)]
11366    pub mod schedule {
11367        #[allow(unused_imports)]
11368        use super::*;
11369        #[derive(Clone, Debug, PartialEq)]
11370        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11371    }
11372
11373    impl Schedule {
11374        /// Gets the enum value.
11375        ///
11376        /// Returns `None` if the enum contains an unknown value deserialized from
11377        /// the string representation of enums.
11378        pub fn value(&self) -> std::option::Option<i32> {
11379            match self {
11380                Self::Unspecified => std::option::Option::Some(0),
11381                Self::Immediately => std::option::Option::Some(1),
11382                Self::UnknownValue(u) => u.0.value(),
11383            }
11384        }
11385
11386        /// Gets the enum value as a string.
11387        ///
11388        /// Returns `None` if the enum contains an unknown value deserialized from
11389        /// the integer representation of enums.
11390        pub fn name(&self) -> std::option::Option<&str> {
11391            match self {
11392                Self::Unspecified => std::option::Option::Some("SCHEDULE_UNSPECIFIED"),
11393                Self::Immediately => std::option::Option::Some("IMMEDIATELY"),
11394                Self::UnknownValue(u) => u.0.name(),
11395            }
11396        }
11397    }
11398
11399    impl std::default::Default for Schedule {
11400        fn default() -> Self {
11401            use std::convert::From;
11402            Self::from(0)
11403        }
11404    }
11405
11406    impl std::fmt::Display for Schedule {
11407        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11408            wkt::internal::display_enum(f, self.name(), self.value())
11409        }
11410    }
11411
11412    impl std::convert::From<i32> for Schedule {
11413        fn from(value: i32) -> Self {
11414            match value {
11415                0 => Self::Unspecified,
11416                1 => Self::Immediately,
11417                _ => Self::UnknownValue(schedule::UnknownValue(
11418                    wkt::internal::UnknownEnumValue::Integer(value),
11419                )),
11420            }
11421        }
11422    }
11423
11424    impl std::convert::From<&str> for Schedule {
11425        fn from(value: &str) -> Self {
11426            use std::string::ToString;
11427            match value {
11428                "SCHEDULE_UNSPECIFIED" => Self::Unspecified,
11429                "IMMEDIATELY" => Self::Immediately,
11430                _ => Self::UnknownValue(schedule::UnknownValue(
11431                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11432                )),
11433            }
11434        }
11435    }
11436
11437    impl serde::ser::Serialize for Schedule {
11438        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11439        where
11440            S: serde::Serializer,
11441        {
11442            match self {
11443                Self::Unspecified => serializer.serialize_i32(0),
11444                Self::Immediately => serializer.serialize_i32(1),
11445                Self::UnknownValue(u) => u.0.serialize(serializer),
11446            }
11447        }
11448    }
11449
11450    impl<'de> serde::de::Deserialize<'de> for Schedule {
11451        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11452        where
11453            D: serde::Deserializer<'de>,
11454        {
11455            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Schedule>::new(
11456                ".google.cloud.edgecontainer.v1.UpgradeClusterRequest.Schedule",
11457            ))
11458        }
11459    }
11460}
11461
11462/// Deletes a cluster.
11463#[derive(Clone, Debug, Default, PartialEq)]
11464#[non_exhaustive]
11465pub struct DeleteClusterRequest {
11466    /// Required. The resource name of the cluster.
11467    pub name: std::string::String,
11468
11469    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
11470    /// random UUID is recommended. This request is only idempotent if
11471    /// `request_id` is provided.
11472    pub request_id: std::string::String,
11473
11474    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11475}
11476
11477impl DeleteClusterRequest {
11478    pub fn new() -> Self {
11479        std::default::Default::default()
11480    }
11481
11482    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
11483    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11484        self.name = v.into();
11485        self
11486    }
11487
11488    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
11489    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11490        self.request_id = v.into();
11491        self
11492    }
11493}
11494
11495impl wkt::message::Message for DeleteClusterRequest {
11496    fn typename() -> &'static str {
11497        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteClusterRequest"
11498    }
11499}
11500
11501#[doc(hidden)]
11502impl<'de> serde::de::Deserialize<'de> for DeleteClusterRequest {
11503    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11504    where
11505        D: serde::Deserializer<'de>,
11506    {
11507        #[allow(non_camel_case_types)]
11508        #[doc(hidden)]
11509        #[derive(PartialEq, Eq, Hash)]
11510        enum __FieldTag {
11511            __name,
11512            __request_id,
11513            Unknown(std::string::String),
11514        }
11515        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11516            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11517            where
11518                D: serde::Deserializer<'de>,
11519            {
11520                struct Visitor;
11521                impl<'de> serde::de::Visitor<'de> for Visitor {
11522                    type Value = __FieldTag;
11523                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11524                        formatter.write_str("a field name for DeleteClusterRequest")
11525                    }
11526                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11527                    where
11528                        E: serde::de::Error,
11529                    {
11530                        use std::result::Result::Ok;
11531                        use std::string::ToString;
11532                        match value {
11533                            "name" => Ok(__FieldTag::__name),
11534                            "requestId" => Ok(__FieldTag::__request_id),
11535                            "request_id" => Ok(__FieldTag::__request_id),
11536                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11537                        }
11538                    }
11539                }
11540                deserializer.deserialize_identifier(Visitor)
11541            }
11542        }
11543        struct Visitor;
11544        impl<'de> serde::de::Visitor<'de> for Visitor {
11545            type Value = DeleteClusterRequest;
11546            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11547                formatter.write_str("struct DeleteClusterRequest")
11548            }
11549            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11550            where
11551                A: serde::de::MapAccess<'de>,
11552            {
11553                #[allow(unused_imports)]
11554                use serde::de::Error;
11555                use std::option::Option::Some;
11556                let mut fields = std::collections::HashSet::new();
11557                let mut result = Self::Value::new();
11558                while let Some(tag) = map.next_key::<__FieldTag>()? {
11559                    #[allow(clippy::match_single_binding)]
11560                    match tag {
11561                        __FieldTag::__name => {
11562                            if !fields.insert(__FieldTag::__name) {
11563                                return std::result::Result::Err(A::Error::duplicate_field(
11564                                    "multiple values for name",
11565                                ));
11566                            }
11567                            result.name = map
11568                                .next_value::<std::option::Option<std::string::String>>()?
11569                                .unwrap_or_default();
11570                        }
11571                        __FieldTag::__request_id => {
11572                            if !fields.insert(__FieldTag::__request_id) {
11573                                return std::result::Result::Err(A::Error::duplicate_field(
11574                                    "multiple values for request_id",
11575                                ));
11576                            }
11577                            result.request_id = map
11578                                .next_value::<std::option::Option<std::string::String>>()?
11579                                .unwrap_or_default();
11580                        }
11581                        __FieldTag::Unknown(key) => {
11582                            let value = map.next_value::<serde_json::Value>()?;
11583                            result._unknown_fields.insert(key, value);
11584                        }
11585                    }
11586                }
11587                std::result::Result::Ok(result)
11588            }
11589        }
11590        deserializer.deserialize_any(Visitor)
11591    }
11592}
11593
11594#[doc(hidden)]
11595impl serde::ser::Serialize for DeleteClusterRequest {
11596    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11597    where
11598        S: serde::ser::Serializer,
11599    {
11600        use serde::ser::SerializeMap;
11601        #[allow(unused_imports)]
11602        use std::option::Option::Some;
11603        let mut state = serializer.serialize_map(std::option::Option::None)?;
11604        if !self.name.is_empty() {
11605            state.serialize_entry("name", &self.name)?;
11606        }
11607        if !self.request_id.is_empty() {
11608            state.serialize_entry("requestId", &self.request_id)?;
11609        }
11610        if !self._unknown_fields.is_empty() {
11611            for (key, value) in self._unknown_fields.iter() {
11612                state.serialize_entry(key, &value)?;
11613            }
11614        }
11615        state.end()
11616    }
11617}
11618
11619/// Generates an access token for a cluster.
11620#[derive(Clone, Debug, Default, PartialEq)]
11621#[non_exhaustive]
11622pub struct GenerateAccessTokenRequest {
11623    /// Required. The resource name of the cluster.
11624    pub cluster: std::string::String,
11625
11626    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11627}
11628
11629impl GenerateAccessTokenRequest {
11630    pub fn new() -> Self {
11631        std::default::Default::default()
11632    }
11633
11634    /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
11635    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11636        self.cluster = v.into();
11637        self
11638    }
11639}
11640
11641impl wkt::message::Message for GenerateAccessTokenRequest {
11642    fn typename() -> &'static str {
11643        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenRequest"
11644    }
11645}
11646
11647#[doc(hidden)]
11648impl<'de> serde::de::Deserialize<'de> for GenerateAccessTokenRequest {
11649    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11650    where
11651        D: serde::Deserializer<'de>,
11652    {
11653        #[allow(non_camel_case_types)]
11654        #[doc(hidden)]
11655        #[derive(PartialEq, Eq, Hash)]
11656        enum __FieldTag {
11657            __cluster,
11658            Unknown(std::string::String),
11659        }
11660        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11661            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11662            where
11663                D: serde::Deserializer<'de>,
11664            {
11665                struct Visitor;
11666                impl<'de> serde::de::Visitor<'de> for Visitor {
11667                    type Value = __FieldTag;
11668                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11669                        formatter.write_str("a field name for GenerateAccessTokenRequest")
11670                    }
11671                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11672                    where
11673                        E: serde::de::Error,
11674                    {
11675                        use std::result::Result::Ok;
11676                        use std::string::ToString;
11677                        match value {
11678                            "cluster" => Ok(__FieldTag::__cluster),
11679                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11680                        }
11681                    }
11682                }
11683                deserializer.deserialize_identifier(Visitor)
11684            }
11685        }
11686        struct Visitor;
11687        impl<'de> serde::de::Visitor<'de> for Visitor {
11688            type Value = GenerateAccessTokenRequest;
11689            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11690                formatter.write_str("struct GenerateAccessTokenRequest")
11691            }
11692            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11693            where
11694                A: serde::de::MapAccess<'de>,
11695            {
11696                #[allow(unused_imports)]
11697                use serde::de::Error;
11698                use std::option::Option::Some;
11699                let mut fields = std::collections::HashSet::new();
11700                let mut result = Self::Value::new();
11701                while let Some(tag) = map.next_key::<__FieldTag>()? {
11702                    #[allow(clippy::match_single_binding)]
11703                    match tag {
11704                        __FieldTag::__cluster => {
11705                            if !fields.insert(__FieldTag::__cluster) {
11706                                return std::result::Result::Err(A::Error::duplicate_field(
11707                                    "multiple values for cluster",
11708                                ));
11709                            }
11710                            result.cluster = map
11711                                .next_value::<std::option::Option<std::string::String>>()?
11712                                .unwrap_or_default();
11713                        }
11714                        __FieldTag::Unknown(key) => {
11715                            let value = map.next_value::<serde_json::Value>()?;
11716                            result._unknown_fields.insert(key, value);
11717                        }
11718                    }
11719                }
11720                std::result::Result::Ok(result)
11721            }
11722        }
11723        deserializer.deserialize_any(Visitor)
11724    }
11725}
11726
11727#[doc(hidden)]
11728impl serde::ser::Serialize for GenerateAccessTokenRequest {
11729    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11730    where
11731        S: serde::ser::Serializer,
11732    {
11733        use serde::ser::SerializeMap;
11734        #[allow(unused_imports)]
11735        use std::option::Option::Some;
11736        let mut state = serializer.serialize_map(std::option::Option::None)?;
11737        if !self.cluster.is_empty() {
11738            state.serialize_entry("cluster", &self.cluster)?;
11739        }
11740        if !self._unknown_fields.is_empty() {
11741            for (key, value) in self._unknown_fields.iter() {
11742                state.serialize_entry(key, &value)?;
11743            }
11744        }
11745        state.end()
11746    }
11747}
11748
11749/// An access token for a cluster.
11750#[derive(Clone, Debug, Default, PartialEq)]
11751#[non_exhaustive]
11752pub struct GenerateAccessTokenResponse {
11753    /// Output only. Access token to authenticate to k8s api-server.
11754    pub access_token: std::string::String,
11755
11756    /// Output only. Timestamp at which the token will expire.
11757    pub expire_time: std::option::Option<wkt::Timestamp>,
11758
11759    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11760}
11761
11762impl GenerateAccessTokenResponse {
11763    pub fn new() -> Self {
11764        std::default::Default::default()
11765    }
11766
11767    /// Sets the value of [access_token][crate::model::GenerateAccessTokenResponse::access_token].
11768    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11769        self.access_token = v.into();
11770        self
11771    }
11772
11773    /// Sets the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
11774    pub fn set_expire_time<T>(mut self, v: T) -> Self
11775    where
11776        T: std::convert::Into<wkt::Timestamp>,
11777    {
11778        self.expire_time = std::option::Option::Some(v.into());
11779        self
11780    }
11781
11782    /// Sets or clears the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
11783    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
11784    where
11785        T: std::convert::Into<wkt::Timestamp>,
11786    {
11787        self.expire_time = v.map(|x| x.into());
11788        self
11789    }
11790}
11791
11792impl wkt::message::Message for GenerateAccessTokenResponse {
11793    fn typename() -> &'static str {
11794        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenResponse"
11795    }
11796}
11797
11798#[doc(hidden)]
11799impl<'de> serde::de::Deserialize<'de> for GenerateAccessTokenResponse {
11800    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11801    where
11802        D: serde::Deserializer<'de>,
11803    {
11804        #[allow(non_camel_case_types)]
11805        #[doc(hidden)]
11806        #[derive(PartialEq, Eq, Hash)]
11807        enum __FieldTag {
11808            __access_token,
11809            __expire_time,
11810            Unknown(std::string::String),
11811        }
11812        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11813            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11814            where
11815                D: serde::Deserializer<'de>,
11816            {
11817                struct Visitor;
11818                impl<'de> serde::de::Visitor<'de> for Visitor {
11819                    type Value = __FieldTag;
11820                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11821                        formatter.write_str("a field name for GenerateAccessTokenResponse")
11822                    }
11823                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11824                    where
11825                        E: serde::de::Error,
11826                    {
11827                        use std::result::Result::Ok;
11828                        use std::string::ToString;
11829                        match value {
11830                            "accessToken" => Ok(__FieldTag::__access_token),
11831                            "access_token" => Ok(__FieldTag::__access_token),
11832                            "expireTime" => Ok(__FieldTag::__expire_time),
11833                            "expire_time" => Ok(__FieldTag::__expire_time),
11834                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11835                        }
11836                    }
11837                }
11838                deserializer.deserialize_identifier(Visitor)
11839            }
11840        }
11841        struct Visitor;
11842        impl<'de> serde::de::Visitor<'de> for Visitor {
11843            type Value = GenerateAccessTokenResponse;
11844            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11845                formatter.write_str("struct GenerateAccessTokenResponse")
11846            }
11847            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11848            where
11849                A: serde::de::MapAccess<'de>,
11850            {
11851                #[allow(unused_imports)]
11852                use serde::de::Error;
11853                use std::option::Option::Some;
11854                let mut fields = std::collections::HashSet::new();
11855                let mut result = Self::Value::new();
11856                while let Some(tag) = map.next_key::<__FieldTag>()? {
11857                    #[allow(clippy::match_single_binding)]
11858                    match tag {
11859                        __FieldTag::__access_token => {
11860                            if !fields.insert(__FieldTag::__access_token) {
11861                                return std::result::Result::Err(A::Error::duplicate_field(
11862                                    "multiple values for access_token",
11863                                ));
11864                            }
11865                            result.access_token = map
11866                                .next_value::<std::option::Option<std::string::String>>()?
11867                                .unwrap_or_default();
11868                        }
11869                        __FieldTag::__expire_time => {
11870                            if !fields.insert(__FieldTag::__expire_time) {
11871                                return std::result::Result::Err(A::Error::duplicate_field(
11872                                    "multiple values for expire_time",
11873                                ));
11874                            }
11875                            result.expire_time =
11876                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
11877                        }
11878                        __FieldTag::Unknown(key) => {
11879                            let value = map.next_value::<serde_json::Value>()?;
11880                            result._unknown_fields.insert(key, value);
11881                        }
11882                    }
11883                }
11884                std::result::Result::Ok(result)
11885            }
11886        }
11887        deserializer.deserialize_any(Visitor)
11888    }
11889}
11890
11891#[doc(hidden)]
11892impl serde::ser::Serialize for GenerateAccessTokenResponse {
11893    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11894    where
11895        S: serde::ser::Serializer,
11896    {
11897        use serde::ser::SerializeMap;
11898        #[allow(unused_imports)]
11899        use std::option::Option::Some;
11900        let mut state = serializer.serialize_map(std::option::Option::None)?;
11901        if !self.access_token.is_empty() {
11902            state.serialize_entry("accessToken", &self.access_token)?;
11903        }
11904        if self.expire_time.is_some() {
11905            state.serialize_entry("expireTime", &self.expire_time)?;
11906        }
11907        if !self._unknown_fields.is_empty() {
11908            for (key, value) in self._unknown_fields.iter() {
11909                state.serialize_entry(key, &value)?;
11910            }
11911        }
11912        state.end()
11913    }
11914}
11915
11916/// Generates an offline credential(offline) for a cluster.
11917#[derive(Clone, Debug, Default, PartialEq)]
11918#[non_exhaustive]
11919pub struct GenerateOfflineCredentialRequest {
11920    /// Required. The resource name of the cluster.
11921    pub cluster: std::string::String,
11922
11923    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11924}
11925
11926impl GenerateOfflineCredentialRequest {
11927    pub fn new() -> Self {
11928        std::default::Default::default()
11929    }
11930
11931    /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
11932    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11933        self.cluster = v.into();
11934        self
11935    }
11936}
11937
11938impl wkt::message::Message for GenerateOfflineCredentialRequest {
11939    fn typename() -> &'static str {
11940        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialRequest"
11941    }
11942}
11943
11944#[doc(hidden)]
11945impl<'de> serde::de::Deserialize<'de> for GenerateOfflineCredentialRequest {
11946    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11947    where
11948        D: serde::Deserializer<'de>,
11949    {
11950        #[allow(non_camel_case_types)]
11951        #[doc(hidden)]
11952        #[derive(PartialEq, Eq, Hash)]
11953        enum __FieldTag {
11954            __cluster,
11955            Unknown(std::string::String),
11956        }
11957        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11958            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11959            where
11960                D: serde::Deserializer<'de>,
11961            {
11962                struct Visitor;
11963                impl<'de> serde::de::Visitor<'de> for Visitor {
11964                    type Value = __FieldTag;
11965                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11966                        formatter.write_str("a field name for GenerateOfflineCredentialRequest")
11967                    }
11968                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11969                    where
11970                        E: serde::de::Error,
11971                    {
11972                        use std::result::Result::Ok;
11973                        use std::string::ToString;
11974                        match value {
11975                            "cluster" => Ok(__FieldTag::__cluster),
11976                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11977                        }
11978                    }
11979                }
11980                deserializer.deserialize_identifier(Visitor)
11981            }
11982        }
11983        struct Visitor;
11984        impl<'de> serde::de::Visitor<'de> for Visitor {
11985            type Value = GenerateOfflineCredentialRequest;
11986            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11987                formatter.write_str("struct GenerateOfflineCredentialRequest")
11988            }
11989            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11990            where
11991                A: serde::de::MapAccess<'de>,
11992            {
11993                #[allow(unused_imports)]
11994                use serde::de::Error;
11995                use std::option::Option::Some;
11996                let mut fields = std::collections::HashSet::new();
11997                let mut result = Self::Value::new();
11998                while let Some(tag) = map.next_key::<__FieldTag>()? {
11999                    #[allow(clippy::match_single_binding)]
12000                    match tag {
12001                        __FieldTag::__cluster => {
12002                            if !fields.insert(__FieldTag::__cluster) {
12003                                return std::result::Result::Err(A::Error::duplicate_field(
12004                                    "multiple values for cluster",
12005                                ));
12006                            }
12007                            result.cluster = map
12008                                .next_value::<std::option::Option<std::string::String>>()?
12009                                .unwrap_or_default();
12010                        }
12011                        __FieldTag::Unknown(key) => {
12012                            let value = map.next_value::<serde_json::Value>()?;
12013                            result._unknown_fields.insert(key, value);
12014                        }
12015                    }
12016                }
12017                std::result::Result::Ok(result)
12018            }
12019        }
12020        deserializer.deserialize_any(Visitor)
12021    }
12022}
12023
12024#[doc(hidden)]
12025impl serde::ser::Serialize for GenerateOfflineCredentialRequest {
12026    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12027    where
12028        S: serde::ser::Serializer,
12029    {
12030        use serde::ser::SerializeMap;
12031        #[allow(unused_imports)]
12032        use std::option::Option::Some;
12033        let mut state = serializer.serialize_map(std::option::Option::None)?;
12034        if !self.cluster.is_empty() {
12035            state.serialize_entry("cluster", &self.cluster)?;
12036        }
12037        if !self._unknown_fields.is_empty() {
12038            for (key, value) in self._unknown_fields.iter() {
12039                state.serialize_entry(key, &value)?;
12040            }
12041        }
12042        state.end()
12043    }
12044}
12045
12046/// An offline credential for a cluster.
12047#[derive(Clone, Debug, Default, PartialEq)]
12048#[non_exhaustive]
12049pub struct GenerateOfflineCredentialResponse {
12050    /// Output only. Client certificate to authenticate to k8s api-server.
12051    pub client_certificate: std::string::String,
12052
12053    /// Output only. Client private key to authenticate to k8s api-server.
12054    pub client_key: std::string::String,
12055
12056    /// Output only. Client's identity.
12057    pub user_id: std::string::String,
12058
12059    /// Output only. Timestamp at which this credential will expire.
12060    pub expire_time: std::option::Option<wkt::Timestamp>,
12061
12062    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12063}
12064
12065impl GenerateOfflineCredentialResponse {
12066    pub fn new() -> Self {
12067        std::default::Default::default()
12068    }
12069
12070    /// Sets the value of [client_certificate][crate::model::GenerateOfflineCredentialResponse::client_certificate].
12071    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
12072        mut self,
12073        v: T,
12074    ) -> Self {
12075        self.client_certificate = v.into();
12076        self
12077    }
12078
12079    /// Sets the value of [client_key][crate::model::GenerateOfflineCredentialResponse::client_key].
12080    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12081        self.client_key = v.into();
12082        self
12083    }
12084
12085    /// Sets the value of [user_id][crate::model::GenerateOfflineCredentialResponse::user_id].
12086    pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12087        self.user_id = v.into();
12088        self
12089    }
12090
12091    /// Sets the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
12092    pub fn set_expire_time<T>(mut self, v: T) -> Self
12093    where
12094        T: std::convert::Into<wkt::Timestamp>,
12095    {
12096        self.expire_time = std::option::Option::Some(v.into());
12097        self
12098    }
12099
12100    /// Sets or clears the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
12101    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
12102    where
12103        T: std::convert::Into<wkt::Timestamp>,
12104    {
12105        self.expire_time = v.map(|x| x.into());
12106        self
12107    }
12108}
12109
12110impl wkt::message::Message for GenerateOfflineCredentialResponse {
12111    fn typename() -> &'static str {
12112        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialResponse"
12113    }
12114}
12115
12116#[doc(hidden)]
12117impl<'de> serde::de::Deserialize<'de> for GenerateOfflineCredentialResponse {
12118    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12119    where
12120        D: serde::Deserializer<'de>,
12121    {
12122        #[allow(non_camel_case_types)]
12123        #[doc(hidden)]
12124        #[derive(PartialEq, Eq, Hash)]
12125        enum __FieldTag {
12126            __client_certificate,
12127            __client_key,
12128            __user_id,
12129            __expire_time,
12130            Unknown(std::string::String),
12131        }
12132        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12133            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12134            where
12135                D: serde::Deserializer<'de>,
12136            {
12137                struct Visitor;
12138                impl<'de> serde::de::Visitor<'de> for Visitor {
12139                    type Value = __FieldTag;
12140                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12141                        formatter.write_str("a field name for GenerateOfflineCredentialResponse")
12142                    }
12143                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12144                    where
12145                        E: serde::de::Error,
12146                    {
12147                        use std::result::Result::Ok;
12148                        use std::string::ToString;
12149                        match value {
12150                            "clientCertificate" => Ok(__FieldTag::__client_certificate),
12151                            "client_certificate" => Ok(__FieldTag::__client_certificate),
12152                            "clientKey" => Ok(__FieldTag::__client_key),
12153                            "client_key" => Ok(__FieldTag::__client_key),
12154                            "userId" => Ok(__FieldTag::__user_id),
12155                            "user_id" => Ok(__FieldTag::__user_id),
12156                            "expireTime" => Ok(__FieldTag::__expire_time),
12157                            "expire_time" => Ok(__FieldTag::__expire_time),
12158                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12159                        }
12160                    }
12161                }
12162                deserializer.deserialize_identifier(Visitor)
12163            }
12164        }
12165        struct Visitor;
12166        impl<'de> serde::de::Visitor<'de> for Visitor {
12167            type Value = GenerateOfflineCredentialResponse;
12168            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12169                formatter.write_str("struct GenerateOfflineCredentialResponse")
12170            }
12171            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12172            where
12173                A: serde::de::MapAccess<'de>,
12174            {
12175                #[allow(unused_imports)]
12176                use serde::de::Error;
12177                use std::option::Option::Some;
12178                let mut fields = std::collections::HashSet::new();
12179                let mut result = Self::Value::new();
12180                while let Some(tag) = map.next_key::<__FieldTag>()? {
12181                    #[allow(clippy::match_single_binding)]
12182                    match tag {
12183                        __FieldTag::__client_certificate => {
12184                            if !fields.insert(__FieldTag::__client_certificate) {
12185                                return std::result::Result::Err(A::Error::duplicate_field(
12186                                    "multiple values for client_certificate",
12187                                ));
12188                            }
12189                            result.client_certificate = map
12190                                .next_value::<std::option::Option<std::string::String>>()?
12191                                .unwrap_or_default();
12192                        }
12193                        __FieldTag::__client_key => {
12194                            if !fields.insert(__FieldTag::__client_key) {
12195                                return std::result::Result::Err(A::Error::duplicate_field(
12196                                    "multiple values for client_key",
12197                                ));
12198                            }
12199                            result.client_key = map
12200                                .next_value::<std::option::Option<std::string::String>>()?
12201                                .unwrap_or_default();
12202                        }
12203                        __FieldTag::__user_id => {
12204                            if !fields.insert(__FieldTag::__user_id) {
12205                                return std::result::Result::Err(A::Error::duplicate_field(
12206                                    "multiple values for user_id",
12207                                ));
12208                            }
12209                            result.user_id = map
12210                                .next_value::<std::option::Option<std::string::String>>()?
12211                                .unwrap_or_default();
12212                        }
12213                        __FieldTag::__expire_time => {
12214                            if !fields.insert(__FieldTag::__expire_time) {
12215                                return std::result::Result::Err(A::Error::duplicate_field(
12216                                    "multiple values for expire_time",
12217                                ));
12218                            }
12219                            result.expire_time =
12220                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12221                        }
12222                        __FieldTag::Unknown(key) => {
12223                            let value = map.next_value::<serde_json::Value>()?;
12224                            result._unknown_fields.insert(key, value);
12225                        }
12226                    }
12227                }
12228                std::result::Result::Ok(result)
12229            }
12230        }
12231        deserializer.deserialize_any(Visitor)
12232    }
12233}
12234
12235#[doc(hidden)]
12236impl serde::ser::Serialize for GenerateOfflineCredentialResponse {
12237    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12238    where
12239        S: serde::ser::Serializer,
12240    {
12241        use serde::ser::SerializeMap;
12242        #[allow(unused_imports)]
12243        use std::option::Option::Some;
12244        let mut state = serializer.serialize_map(std::option::Option::None)?;
12245        if !self.client_certificate.is_empty() {
12246            state.serialize_entry("clientCertificate", &self.client_certificate)?;
12247        }
12248        if !self.client_key.is_empty() {
12249            state.serialize_entry("clientKey", &self.client_key)?;
12250        }
12251        if !self.user_id.is_empty() {
12252            state.serialize_entry("userId", &self.user_id)?;
12253        }
12254        if self.expire_time.is_some() {
12255            state.serialize_entry("expireTime", &self.expire_time)?;
12256        }
12257        if !self._unknown_fields.is_empty() {
12258            for (key, value) in self._unknown_fields.iter() {
12259                state.serialize_entry(key, &value)?;
12260            }
12261        }
12262        state.end()
12263    }
12264}
12265
12266/// Lists node pools in a cluster.
12267#[derive(Clone, Debug, Default, PartialEq)]
12268#[non_exhaustive]
12269pub struct ListNodePoolsRequest {
12270    /// Required. The parent cluster, which owns this collection of node pools.
12271    pub parent: std::string::String,
12272
12273    /// The maximum number of resources to list.
12274    pub page_size: i32,
12275
12276    /// A page token received from previous list request.
12277    pub page_token: std::string::String,
12278
12279    /// Only resources matching this filter will be listed.
12280    pub filter: std::string::String,
12281
12282    /// Specifies the order in which resources will be listed.
12283    pub order_by: std::string::String,
12284
12285    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12286}
12287
12288impl ListNodePoolsRequest {
12289    pub fn new() -> Self {
12290        std::default::Default::default()
12291    }
12292
12293    /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
12294    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12295        self.parent = v.into();
12296        self
12297    }
12298
12299    /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
12300    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12301        self.page_size = v.into();
12302        self
12303    }
12304
12305    /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
12306    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12307        self.page_token = v.into();
12308        self
12309    }
12310
12311    /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
12312    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12313        self.filter = v.into();
12314        self
12315    }
12316
12317    /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
12318    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12319        self.order_by = v.into();
12320        self
12321    }
12322}
12323
12324impl wkt::message::Message for ListNodePoolsRequest {
12325    fn typename() -> &'static str {
12326        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsRequest"
12327    }
12328}
12329
12330#[doc(hidden)]
12331impl<'de> serde::de::Deserialize<'de> for ListNodePoolsRequest {
12332    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12333    where
12334        D: serde::Deserializer<'de>,
12335    {
12336        #[allow(non_camel_case_types)]
12337        #[doc(hidden)]
12338        #[derive(PartialEq, Eq, Hash)]
12339        enum __FieldTag {
12340            __parent,
12341            __page_size,
12342            __page_token,
12343            __filter,
12344            __order_by,
12345            Unknown(std::string::String),
12346        }
12347        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12348            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12349            where
12350                D: serde::Deserializer<'de>,
12351            {
12352                struct Visitor;
12353                impl<'de> serde::de::Visitor<'de> for Visitor {
12354                    type Value = __FieldTag;
12355                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12356                        formatter.write_str("a field name for ListNodePoolsRequest")
12357                    }
12358                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12359                    where
12360                        E: serde::de::Error,
12361                    {
12362                        use std::result::Result::Ok;
12363                        use std::string::ToString;
12364                        match value {
12365                            "parent" => Ok(__FieldTag::__parent),
12366                            "pageSize" => Ok(__FieldTag::__page_size),
12367                            "page_size" => Ok(__FieldTag::__page_size),
12368                            "pageToken" => Ok(__FieldTag::__page_token),
12369                            "page_token" => Ok(__FieldTag::__page_token),
12370                            "filter" => Ok(__FieldTag::__filter),
12371                            "orderBy" => Ok(__FieldTag::__order_by),
12372                            "order_by" => Ok(__FieldTag::__order_by),
12373                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12374                        }
12375                    }
12376                }
12377                deserializer.deserialize_identifier(Visitor)
12378            }
12379        }
12380        struct Visitor;
12381        impl<'de> serde::de::Visitor<'de> for Visitor {
12382            type Value = ListNodePoolsRequest;
12383            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12384                formatter.write_str("struct ListNodePoolsRequest")
12385            }
12386            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12387            where
12388                A: serde::de::MapAccess<'de>,
12389            {
12390                #[allow(unused_imports)]
12391                use serde::de::Error;
12392                use std::option::Option::Some;
12393                let mut fields = std::collections::HashSet::new();
12394                let mut result = Self::Value::new();
12395                while let Some(tag) = map.next_key::<__FieldTag>()? {
12396                    #[allow(clippy::match_single_binding)]
12397                    match tag {
12398                        __FieldTag::__parent => {
12399                            if !fields.insert(__FieldTag::__parent) {
12400                                return std::result::Result::Err(A::Error::duplicate_field(
12401                                    "multiple values for parent",
12402                                ));
12403                            }
12404                            result.parent = map
12405                                .next_value::<std::option::Option<std::string::String>>()?
12406                                .unwrap_or_default();
12407                        }
12408                        __FieldTag::__page_size => {
12409                            if !fields.insert(__FieldTag::__page_size) {
12410                                return std::result::Result::Err(A::Error::duplicate_field(
12411                                    "multiple values for page_size",
12412                                ));
12413                            }
12414                            struct __With(std::option::Option<i32>);
12415                            impl<'de> serde::de::Deserialize<'de> for __With {
12416                                fn deserialize<D>(
12417                                    deserializer: D,
12418                                ) -> std::result::Result<Self, D::Error>
12419                                where
12420                                    D: serde::de::Deserializer<'de>,
12421                                {
12422                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12423                                }
12424                            }
12425                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
12426                        }
12427                        __FieldTag::__page_token => {
12428                            if !fields.insert(__FieldTag::__page_token) {
12429                                return std::result::Result::Err(A::Error::duplicate_field(
12430                                    "multiple values for page_token",
12431                                ));
12432                            }
12433                            result.page_token = map
12434                                .next_value::<std::option::Option<std::string::String>>()?
12435                                .unwrap_or_default();
12436                        }
12437                        __FieldTag::__filter => {
12438                            if !fields.insert(__FieldTag::__filter) {
12439                                return std::result::Result::Err(A::Error::duplicate_field(
12440                                    "multiple values for filter",
12441                                ));
12442                            }
12443                            result.filter = map
12444                                .next_value::<std::option::Option<std::string::String>>()?
12445                                .unwrap_or_default();
12446                        }
12447                        __FieldTag::__order_by => {
12448                            if !fields.insert(__FieldTag::__order_by) {
12449                                return std::result::Result::Err(A::Error::duplicate_field(
12450                                    "multiple values for order_by",
12451                                ));
12452                            }
12453                            result.order_by = map
12454                                .next_value::<std::option::Option<std::string::String>>()?
12455                                .unwrap_or_default();
12456                        }
12457                        __FieldTag::Unknown(key) => {
12458                            let value = map.next_value::<serde_json::Value>()?;
12459                            result._unknown_fields.insert(key, value);
12460                        }
12461                    }
12462                }
12463                std::result::Result::Ok(result)
12464            }
12465        }
12466        deserializer.deserialize_any(Visitor)
12467    }
12468}
12469
12470#[doc(hidden)]
12471impl serde::ser::Serialize for ListNodePoolsRequest {
12472    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12473    where
12474        S: serde::ser::Serializer,
12475    {
12476        use serde::ser::SerializeMap;
12477        #[allow(unused_imports)]
12478        use std::option::Option::Some;
12479        let mut state = serializer.serialize_map(std::option::Option::None)?;
12480        if !self.parent.is_empty() {
12481            state.serialize_entry("parent", &self.parent)?;
12482        }
12483        if !wkt::internal::is_default(&self.page_size) {
12484            struct __With<'a>(&'a i32);
12485            impl<'a> serde::ser::Serialize for __With<'a> {
12486                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12487                where
12488                    S: serde::ser::Serializer,
12489                {
12490                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12491                }
12492            }
12493            state.serialize_entry("pageSize", &__With(&self.page_size))?;
12494        }
12495        if !self.page_token.is_empty() {
12496            state.serialize_entry("pageToken", &self.page_token)?;
12497        }
12498        if !self.filter.is_empty() {
12499            state.serialize_entry("filter", &self.filter)?;
12500        }
12501        if !self.order_by.is_empty() {
12502            state.serialize_entry("orderBy", &self.order_by)?;
12503        }
12504        if !self._unknown_fields.is_empty() {
12505            for (key, value) in self._unknown_fields.iter() {
12506                state.serialize_entry(key, &value)?;
12507            }
12508        }
12509        state.end()
12510    }
12511}
12512
12513/// List of node pools in a cluster.
12514#[derive(Clone, Debug, Default, PartialEq)]
12515#[non_exhaustive]
12516pub struct ListNodePoolsResponse {
12517    /// Node pools in the cluster.
12518    pub node_pools: std::vec::Vec<crate::model::NodePool>,
12519
12520    /// A token to retrieve next page of results.
12521    pub next_page_token: std::string::String,
12522
12523    /// Locations that could not be reached.
12524    pub unreachable: std::vec::Vec<std::string::String>,
12525
12526    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12527}
12528
12529impl ListNodePoolsResponse {
12530    pub fn new() -> Self {
12531        std::default::Default::default()
12532    }
12533
12534    /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
12535    pub fn set_node_pools<T, V>(mut self, v: T) -> Self
12536    where
12537        T: std::iter::IntoIterator<Item = V>,
12538        V: std::convert::Into<crate::model::NodePool>,
12539    {
12540        use std::iter::Iterator;
12541        self.node_pools = v.into_iter().map(|i| i.into()).collect();
12542        self
12543    }
12544
12545    /// Sets the value of [next_page_token][crate::model::ListNodePoolsResponse::next_page_token].
12546    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12547        self.next_page_token = v.into();
12548        self
12549    }
12550
12551    /// Sets the value of [unreachable][crate::model::ListNodePoolsResponse::unreachable].
12552    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12553    where
12554        T: std::iter::IntoIterator<Item = V>,
12555        V: std::convert::Into<std::string::String>,
12556    {
12557        use std::iter::Iterator;
12558        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12559        self
12560    }
12561}
12562
12563impl wkt::message::Message for ListNodePoolsResponse {
12564    fn typename() -> &'static str {
12565        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsResponse"
12566    }
12567}
12568
12569#[doc(hidden)]
12570impl gax::paginator::internal::PageableResponse for ListNodePoolsResponse {
12571    type PageItem = crate::model::NodePool;
12572
12573    fn items(self) -> std::vec::Vec<Self::PageItem> {
12574        self.node_pools
12575    }
12576
12577    fn next_page_token(&self) -> std::string::String {
12578        use std::clone::Clone;
12579        self.next_page_token.clone()
12580    }
12581}
12582
12583#[doc(hidden)]
12584impl<'de> serde::de::Deserialize<'de> for ListNodePoolsResponse {
12585    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12586    where
12587        D: serde::Deserializer<'de>,
12588    {
12589        #[allow(non_camel_case_types)]
12590        #[doc(hidden)]
12591        #[derive(PartialEq, Eq, Hash)]
12592        enum __FieldTag {
12593            __node_pools,
12594            __next_page_token,
12595            __unreachable,
12596            Unknown(std::string::String),
12597        }
12598        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12599            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12600            where
12601                D: serde::Deserializer<'de>,
12602            {
12603                struct Visitor;
12604                impl<'de> serde::de::Visitor<'de> for Visitor {
12605                    type Value = __FieldTag;
12606                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12607                        formatter.write_str("a field name for ListNodePoolsResponse")
12608                    }
12609                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12610                    where
12611                        E: serde::de::Error,
12612                    {
12613                        use std::result::Result::Ok;
12614                        use std::string::ToString;
12615                        match value {
12616                            "nodePools" => Ok(__FieldTag::__node_pools),
12617                            "node_pools" => Ok(__FieldTag::__node_pools),
12618                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
12619                            "next_page_token" => Ok(__FieldTag::__next_page_token),
12620                            "unreachable" => Ok(__FieldTag::__unreachable),
12621                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12622                        }
12623                    }
12624                }
12625                deserializer.deserialize_identifier(Visitor)
12626            }
12627        }
12628        struct Visitor;
12629        impl<'de> serde::de::Visitor<'de> for Visitor {
12630            type Value = ListNodePoolsResponse;
12631            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12632                formatter.write_str("struct ListNodePoolsResponse")
12633            }
12634            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12635            where
12636                A: serde::de::MapAccess<'de>,
12637            {
12638                #[allow(unused_imports)]
12639                use serde::de::Error;
12640                use std::option::Option::Some;
12641                let mut fields = std::collections::HashSet::new();
12642                let mut result = Self::Value::new();
12643                while let Some(tag) = map.next_key::<__FieldTag>()? {
12644                    #[allow(clippy::match_single_binding)]
12645                    match tag {
12646                        __FieldTag::__node_pools => {
12647                            if !fields.insert(__FieldTag::__node_pools) {
12648                                return std::result::Result::Err(A::Error::duplicate_field(
12649                                    "multiple values for node_pools",
12650                                ));
12651                            }
12652                            result.node_pools = map.next_value::<std::option::Option<std::vec::Vec<crate::model::NodePool>>>()?.unwrap_or_default();
12653                        }
12654                        __FieldTag::__next_page_token => {
12655                            if !fields.insert(__FieldTag::__next_page_token) {
12656                                return std::result::Result::Err(A::Error::duplicate_field(
12657                                    "multiple values for next_page_token",
12658                                ));
12659                            }
12660                            result.next_page_token = map
12661                                .next_value::<std::option::Option<std::string::String>>()?
12662                                .unwrap_or_default();
12663                        }
12664                        __FieldTag::__unreachable => {
12665                            if !fields.insert(__FieldTag::__unreachable) {
12666                                return std::result::Result::Err(A::Error::duplicate_field(
12667                                    "multiple values for unreachable",
12668                                ));
12669                            }
12670                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12671                        }
12672                        __FieldTag::Unknown(key) => {
12673                            let value = map.next_value::<serde_json::Value>()?;
12674                            result._unknown_fields.insert(key, value);
12675                        }
12676                    }
12677                }
12678                std::result::Result::Ok(result)
12679            }
12680        }
12681        deserializer.deserialize_any(Visitor)
12682    }
12683}
12684
12685#[doc(hidden)]
12686impl serde::ser::Serialize for ListNodePoolsResponse {
12687    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12688    where
12689        S: serde::ser::Serializer,
12690    {
12691        use serde::ser::SerializeMap;
12692        #[allow(unused_imports)]
12693        use std::option::Option::Some;
12694        let mut state = serializer.serialize_map(std::option::Option::None)?;
12695        if !self.node_pools.is_empty() {
12696            state.serialize_entry("nodePools", &self.node_pools)?;
12697        }
12698        if !self.next_page_token.is_empty() {
12699            state.serialize_entry("nextPageToken", &self.next_page_token)?;
12700        }
12701        if !self.unreachable.is_empty() {
12702            state.serialize_entry("unreachable", &self.unreachable)?;
12703        }
12704        if !self._unknown_fields.is_empty() {
12705            for (key, value) in self._unknown_fields.iter() {
12706                state.serialize_entry(key, &value)?;
12707            }
12708        }
12709        state.end()
12710    }
12711}
12712
12713/// Gets a node pool.
12714#[derive(Clone, Debug, Default, PartialEq)]
12715#[non_exhaustive]
12716pub struct GetNodePoolRequest {
12717    /// Required. The resource name of the node pool.
12718    pub name: std::string::String,
12719
12720    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12721}
12722
12723impl GetNodePoolRequest {
12724    pub fn new() -> Self {
12725        std::default::Default::default()
12726    }
12727
12728    /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
12729    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12730        self.name = v.into();
12731        self
12732    }
12733}
12734
12735impl wkt::message::Message for GetNodePoolRequest {
12736    fn typename() -> &'static str {
12737        "type.googleapis.com/google.cloud.edgecontainer.v1.GetNodePoolRequest"
12738    }
12739}
12740
12741#[doc(hidden)]
12742impl<'de> serde::de::Deserialize<'de> for GetNodePoolRequest {
12743    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12744    where
12745        D: serde::Deserializer<'de>,
12746    {
12747        #[allow(non_camel_case_types)]
12748        #[doc(hidden)]
12749        #[derive(PartialEq, Eq, Hash)]
12750        enum __FieldTag {
12751            __name,
12752            Unknown(std::string::String),
12753        }
12754        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12755            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12756            where
12757                D: serde::Deserializer<'de>,
12758            {
12759                struct Visitor;
12760                impl<'de> serde::de::Visitor<'de> for Visitor {
12761                    type Value = __FieldTag;
12762                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12763                        formatter.write_str("a field name for GetNodePoolRequest")
12764                    }
12765                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12766                    where
12767                        E: serde::de::Error,
12768                    {
12769                        use std::result::Result::Ok;
12770                        use std::string::ToString;
12771                        match value {
12772                            "name" => Ok(__FieldTag::__name),
12773                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12774                        }
12775                    }
12776                }
12777                deserializer.deserialize_identifier(Visitor)
12778            }
12779        }
12780        struct Visitor;
12781        impl<'de> serde::de::Visitor<'de> for Visitor {
12782            type Value = GetNodePoolRequest;
12783            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12784                formatter.write_str("struct GetNodePoolRequest")
12785            }
12786            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12787            where
12788                A: serde::de::MapAccess<'de>,
12789            {
12790                #[allow(unused_imports)]
12791                use serde::de::Error;
12792                use std::option::Option::Some;
12793                let mut fields = std::collections::HashSet::new();
12794                let mut result = Self::Value::new();
12795                while let Some(tag) = map.next_key::<__FieldTag>()? {
12796                    #[allow(clippy::match_single_binding)]
12797                    match tag {
12798                        __FieldTag::__name => {
12799                            if !fields.insert(__FieldTag::__name) {
12800                                return std::result::Result::Err(A::Error::duplicate_field(
12801                                    "multiple values for name",
12802                                ));
12803                            }
12804                            result.name = map
12805                                .next_value::<std::option::Option<std::string::String>>()?
12806                                .unwrap_or_default();
12807                        }
12808                        __FieldTag::Unknown(key) => {
12809                            let value = map.next_value::<serde_json::Value>()?;
12810                            result._unknown_fields.insert(key, value);
12811                        }
12812                    }
12813                }
12814                std::result::Result::Ok(result)
12815            }
12816        }
12817        deserializer.deserialize_any(Visitor)
12818    }
12819}
12820
12821#[doc(hidden)]
12822impl serde::ser::Serialize for GetNodePoolRequest {
12823    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12824    where
12825        S: serde::ser::Serializer,
12826    {
12827        use serde::ser::SerializeMap;
12828        #[allow(unused_imports)]
12829        use std::option::Option::Some;
12830        let mut state = serializer.serialize_map(std::option::Option::None)?;
12831        if !self.name.is_empty() {
12832            state.serialize_entry("name", &self.name)?;
12833        }
12834        if !self._unknown_fields.is_empty() {
12835            for (key, value) in self._unknown_fields.iter() {
12836                state.serialize_entry(key, &value)?;
12837            }
12838        }
12839        state.end()
12840    }
12841}
12842
12843/// Creates a node pool.
12844#[derive(Clone, Debug, Default, PartialEq)]
12845#[non_exhaustive]
12846pub struct CreateNodePoolRequest {
12847    /// Required. The parent cluster where this node pool will be created.
12848    pub parent: std::string::String,
12849
12850    /// Required. A client-specified unique identifier for the node pool.
12851    pub node_pool_id: std::string::String,
12852
12853    /// Required. The node pool to create.
12854    pub node_pool: std::option::Option<crate::model::NodePool>,
12855
12856    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
12857    /// random UUID is recommended. This request is only idempotent if
12858    /// `request_id` is provided.
12859    pub request_id: std::string::String,
12860
12861    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12862}
12863
12864impl CreateNodePoolRequest {
12865    pub fn new() -> Self {
12866        std::default::Default::default()
12867    }
12868
12869    /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
12870    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12871        self.parent = v.into();
12872        self
12873    }
12874
12875    /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
12876    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12877        self.node_pool_id = v.into();
12878        self
12879    }
12880
12881    /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
12882    pub fn set_node_pool<T>(mut self, v: T) -> Self
12883    where
12884        T: std::convert::Into<crate::model::NodePool>,
12885    {
12886        self.node_pool = std::option::Option::Some(v.into());
12887        self
12888    }
12889
12890    /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
12891    pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
12892    where
12893        T: std::convert::Into<crate::model::NodePool>,
12894    {
12895        self.node_pool = v.map(|x| x.into());
12896        self
12897    }
12898
12899    /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
12900    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12901        self.request_id = v.into();
12902        self
12903    }
12904}
12905
12906impl wkt::message::Message for CreateNodePoolRequest {
12907    fn typename() -> &'static str {
12908        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateNodePoolRequest"
12909    }
12910}
12911
12912#[doc(hidden)]
12913impl<'de> serde::de::Deserialize<'de> for CreateNodePoolRequest {
12914    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12915    where
12916        D: serde::Deserializer<'de>,
12917    {
12918        #[allow(non_camel_case_types)]
12919        #[doc(hidden)]
12920        #[derive(PartialEq, Eq, Hash)]
12921        enum __FieldTag {
12922            __parent,
12923            __node_pool_id,
12924            __node_pool,
12925            __request_id,
12926            Unknown(std::string::String),
12927        }
12928        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12929            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12930            where
12931                D: serde::Deserializer<'de>,
12932            {
12933                struct Visitor;
12934                impl<'de> serde::de::Visitor<'de> for Visitor {
12935                    type Value = __FieldTag;
12936                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12937                        formatter.write_str("a field name for CreateNodePoolRequest")
12938                    }
12939                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12940                    where
12941                        E: serde::de::Error,
12942                    {
12943                        use std::result::Result::Ok;
12944                        use std::string::ToString;
12945                        match value {
12946                            "parent" => Ok(__FieldTag::__parent),
12947                            "nodePoolId" => Ok(__FieldTag::__node_pool_id),
12948                            "node_pool_id" => Ok(__FieldTag::__node_pool_id),
12949                            "nodePool" => Ok(__FieldTag::__node_pool),
12950                            "node_pool" => Ok(__FieldTag::__node_pool),
12951                            "requestId" => Ok(__FieldTag::__request_id),
12952                            "request_id" => Ok(__FieldTag::__request_id),
12953                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12954                        }
12955                    }
12956                }
12957                deserializer.deserialize_identifier(Visitor)
12958            }
12959        }
12960        struct Visitor;
12961        impl<'de> serde::de::Visitor<'de> for Visitor {
12962            type Value = CreateNodePoolRequest;
12963            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12964                formatter.write_str("struct CreateNodePoolRequest")
12965            }
12966            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12967            where
12968                A: serde::de::MapAccess<'de>,
12969            {
12970                #[allow(unused_imports)]
12971                use serde::de::Error;
12972                use std::option::Option::Some;
12973                let mut fields = std::collections::HashSet::new();
12974                let mut result = Self::Value::new();
12975                while let Some(tag) = map.next_key::<__FieldTag>()? {
12976                    #[allow(clippy::match_single_binding)]
12977                    match tag {
12978                        __FieldTag::__parent => {
12979                            if !fields.insert(__FieldTag::__parent) {
12980                                return std::result::Result::Err(A::Error::duplicate_field(
12981                                    "multiple values for parent",
12982                                ));
12983                            }
12984                            result.parent = map
12985                                .next_value::<std::option::Option<std::string::String>>()?
12986                                .unwrap_or_default();
12987                        }
12988                        __FieldTag::__node_pool_id => {
12989                            if !fields.insert(__FieldTag::__node_pool_id) {
12990                                return std::result::Result::Err(A::Error::duplicate_field(
12991                                    "multiple values for node_pool_id",
12992                                ));
12993                            }
12994                            result.node_pool_id = map
12995                                .next_value::<std::option::Option<std::string::String>>()?
12996                                .unwrap_or_default();
12997                        }
12998                        __FieldTag::__node_pool => {
12999                            if !fields.insert(__FieldTag::__node_pool) {
13000                                return std::result::Result::Err(A::Error::duplicate_field(
13001                                    "multiple values for node_pool",
13002                                ));
13003                            }
13004                            result.node_pool =
13005                                map.next_value::<std::option::Option<crate::model::NodePool>>()?;
13006                        }
13007                        __FieldTag::__request_id => {
13008                            if !fields.insert(__FieldTag::__request_id) {
13009                                return std::result::Result::Err(A::Error::duplicate_field(
13010                                    "multiple values for request_id",
13011                                ));
13012                            }
13013                            result.request_id = map
13014                                .next_value::<std::option::Option<std::string::String>>()?
13015                                .unwrap_or_default();
13016                        }
13017                        __FieldTag::Unknown(key) => {
13018                            let value = map.next_value::<serde_json::Value>()?;
13019                            result._unknown_fields.insert(key, value);
13020                        }
13021                    }
13022                }
13023                std::result::Result::Ok(result)
13024            }
13025        }
13026        deserializer.deserialize_any(Visitor)
13027    }
13028}
13029
13030#[doc(hidden)]
13031impl serde::ser::Serialize for CreateNodePoolRequest {
13032    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13033    where
13034        S: serde::ser::Serializer,
13035    {
13036        use serde::ser::SerializeMap;
13037        #[allow(unused_imports)]
13038        use std::option::Option::Some;
13039        let mut state = serializer.serialize_map(std::option::Option::None)?;
13040        if !self.parent.is_empty() {
13041            state.serialize_entry("parent", &self.parent)?;
13042        }
13043        if !self.node_pool_id.is_empty() {
13044            state.serialize_entry("nodePoolId", &self.node_pool_id)?;
13045        }
13046        if self.node_pool.is_some() {
13047            state.serialize_entry("nodePool", &self.node_pool)?;
13048        }
13049        if !self.request_id.is_empty() {
13050            state.serialize_entry("requestId", &self.request_id)?;
13051        }
13052        if !self._unknown_fields.is_empty() {
13053            for (key, value) in self._unknown_fields.iter() {
13054                state.serialize_entry(key, &value)?;
13055            }
13056        }
13057        state.end()
13058    }
13059}
13060
13061/// Updates a node pool.
13062#[derive(Clone, Debug, Default, PartialEq)]
13063#[non_exhaustive]
13064pub struct UpdateNodePoolRequest {
13065    /// Field mask is used to specify the fields to be overwritten in the
13066    /// NodePool resource by the update.
13067    /// The fields specified in the update_mask are relative to the resource, not
13068    /// the full request. A field will be overwritten if it is in the mask. If the
13069    /// user does not provide a mask then all fields will be overwritten.
13070    pub update_mask: std::option::Option<wkt::FieldMask>,
13071
13072    /// The updated node pool.
13073    pub node_pool: std::option::Option<crate::model::NodePool>,
13074
13075    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
13076    /// random UUID is recommended. This request is only idempotent if
13077    /// `request_id` is provided.
13078    pub request_id: std::string::String,
13079
13080    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13081}
13082
13083impl UpdateNodePoolRequest {
13084    pub fn new() -> Self {
13085        std::default::Default::default()
13086    }
13087
13088    /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
13089    pub fn set_update_mask<T>(mut self, v: T) -> Self
13090    where
13091        T: std::convert::Into<wkt::FieldMask>,
13092    {
13093        self.update_mask = std::option::Option::Some(v.into());
13094        self
13095    }
13096
13097    /// Sets or clears the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
13098    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13099    where
13100        T: std::convert::Into<wkt::FieldMask>,
13101    {
13102        self.update_mask = v.map(|x| x.into());
13103        self
13104    }
13105
13106    /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
13107    pub fn set_node_pool<T>(mut self, v: T) -> Self
13108    where
13109        T: std::convert::Into<crate::model::NodePool>,
13110    {
13111        self.node_pool = std::option::Option::Some(v.into());
13112        self
13113    }
13114
13115    /// Sets or clears the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
13116    pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
13117    where
13118        T: std::convert::Into<crate::model::NodePool>,
13119    {
13120        self.node_pool = v.map(|x| x.into());
13121        self
13122    }
13123
13124    /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
13125    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13126        self.request_id = v.into();
13127        self
13128    }
13129}
13130
13131impl wkt::message::Message for UpdateNodePoolRequest {
13132    fn typename() -> &'static str {
13133        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateNodePoolRequest"
13134    }
13135}
13136
13137#[doc(hidden)]
13138impl<'de> serde::de::Deserialize<'de> for UpdateNodePoolRequest {
13139    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13140    where
13141        D: serde::Deserializer<'de>,
13142    {
13143        #[allow(non_camel_case_types)]
13144        #[doc(hidden)]
13145        #[derive(PartialEq, Eq, Hash)]
13146        enum __FieldTag {
13147            __update_mask,
13148            __node_pool,
13149            __request_id,
13150            Unknown(std::string::String),
13151        }
13152        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13153            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13154            where
13155                D: serde::Deserializer<'de>,
13156            {
13157                struct Visitor;
13158                impl<'de> serde::de::Visitor<'de> for Visitor {
13159                    type Value = __FieldTag;
13160                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13161                        formatter.write_str("a field name for UpdateNodePoolRequest")
13162                    }
13163                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13164                    where
13165                        E: serde::de::Error,
13166                    {
13167                        use std::result::Result::Ok;
13168                        use std::string::ToString;
13169                        match value {
13170                            "updateMask" => Ok(__FieldTag::__update_mask),
13171                            "update_mask" => Ok(__FieldTag::__update_mask),
13172                            "nodePool" => Ok(__FieldTag::__node_pool),
13173                            "node_pool" => Ok(__FieldTag::__node_pool),
13174                            "requestId" => Ok(__FieldTag::__request_id),
13175                            "request_id" => Ok(__FieldTag::__request_id),
13176                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13177                        }
13178                    }
13179                }
13180                deserializer.deserialize_identifier(Visitor)
13181            }
13182        }
13183        struct Visitor;
13184        impl<'de> serde::de::Visitor<'de> for Visitor {
13185            type Value = UpdateNodePoolRequest;
13186            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13187                formatter.write_str("struct UpdateNodePoolRequest")
13188            }
13189            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13190            where
13191                A: serde::de::MapAccess<'de>,
13192            {
13193                #[allow(unused_imports)]
13194                use serde::de::Error;
13195                use std::option::Option::Some;
13196                let mut fields = std::collections::HashSet::new();
13197                let mut result = Self::Value::new();
13198                while let Some(tag) = map.next_key::<__FieldTag>()? {
13199                    #[allow(clippy::match_single_binding)]
13200                    match tag {
13201                        __FieldTag::__update_mask => {
13202                            if !fields.insert(__FieldTag::__update_mask) {
13203                                return std::result::Result::Err(A::Error::duplicate_field(
13204                                    "multiple values for update_mask",
13205                                ));
13206                            }
13207                            result.update_mask =
13208                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
13209                        }
13210                        __FieldTag::__node_pool => {
13211                            if !fields.insert(__FieldTag::__node_pool) {
13212                                return std::result::Result::Err(A::Error::duplicate_field(
13213                                    "multiple values for node_pool",
13214                                ));
13215                            }
13216                            result.node_pool =
13217                                map.next_value::<std::option::Option<crate::model::NodePool>>()?;
13218                        }
13219                        __FieldTag::__request_id => {
13220                            if !fields.insert(__FieldTag::__request_id) {
13221                                return std::result::Result::Err(A::Error::duplicate_field(
13222                                    "multiple values for request_id",
13223                                ));
13224                            }
13225                            result.request_id = map
13226                                .next_value::<std::option::Option<std::string::String>>()?
13227                                .unwrap_or_default();
13228                        }
13229                        __FieldTag::Unknown(key) => {
13230                            let value = map.next_value::<serde_json::Value>()?;
13231                            result._unknown_fields.insert(key, value);
13232                        }
13233                    }
13234                }
13235                std::result::Result::Ok(result)
13236            }
13237        }
13238        deserializer.deserialize_any(Visitor)
13239    }
13240}
13241
13242#[doc(hidden)]
13243impl serde::ser::Serialize for UpdateNodePoolRequest {
13244    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13245    where
13246        S: serde::ser::Serializer,
13247    {
13248        use serde::ser::SerializeMap;
13249        #[allow(unused_imports)]
13250        use std::option::Option::Some;
13251        let mut state = serializer.serialize_map(std::option::Option::None)?;
13252        if self.update_mask.is_some() {
13253            state.serialize_entry("updateMask", &self.update_mask)?;
13254        }
13255        if self.node_pool.is_some() {
13256            state.serialize_entry("nodePool", &self.node_pool)?;
13257        }
13258        if !self.request_id.is_empty() {
13259            state.serialize_entry("requestId", &self.request_id)?;
13260        }
13261        if !self._unknown_fields.is_empty() {
13262            for (key, value) in self._unknown_fields.iter() {
13263                state.serialize_entry(key, &value)?;
13264            }
13265        }
13266        state.end()
13267    }
13268}
13269
13270/// Deletes a node pool.
13271#[derive(Clone, Debug, Default, PartialEq)]
13272#[non_exhaustive]
13273pub struct DeleteNodePoolRequest {
13274    /// Required. The resource name of the node pool.
13275    pub name: std::string::String,
13276
13277    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
13278    /// random UUID is recommended. This request is only idempotent if
13279    /// `request_id` is provided.
13280    pub request_id: std::string::String,
13281
13282    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13283}
13284
13285impl DeleteNodePoolRequest {
13286    pub fn new() -> Self {
13287        std::default::Default::default()
13288    }
13289
13290    /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
13291    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13292        self.name = v.into();
13293        self
13294    }
13295
13296    /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
13297    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13298        self.request_id = v.into();
13299        self
13300    }
13301}
13302
13303impl wkt::message::Message for DeleteNodePoolRequest {
13304    fn typename() -> &'static str {
13305        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteNodePoolRequest"
13306    }
13307}
13308
13309#[doc(hidden)]
13310impl<'de> serde::de::Deserialize<'de> for DeleteNodePoolRequest {
13311    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13312    where
13313        D: serde::Deserializer<'de>,
13314    {
13315        #[allow(non_camel_case_types)]
13316        #[doc(hidden)]
13317        #[derive(PartialEq, Eq, Hash)]
13318        enum __FieldTag {
13319            __name,
13320            __request_id,
13321            Unknown(std::string::String),
13322        }
13323        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13324            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13325            where
13326                D: serde::Deserializer<'de>,
13327            {
13328                struct Visitor;
13329                impl<'de> serde::de::Visitor<'de> for Visitor {
13330                    type Value = __FieldTag;
13331                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13332                        formatter.write_str("a field name for DeleteNodePoolRequest")
13333                    }
13334                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13335                    where
13336                        E: serde::de::Error,
13337                    {
13338                        use std::result::Result::Ok;
13339                        use std::string::ToString;
13340                        match value {
13341                            "name" => Ok(__FieldTag::__name),
13342                            "requestId" => Ok(__FieldTag::__request_id),
13343                            "request_id" => Ok(__FieldTag::__request_id),
13344                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13345                        }
13346                    }
13347                }
13348                deserializer.deserialize_identifier(Visitor)
13349            }
13350        }
13351        struct Visitor;
13352        impl<'de> serde::de::Visitor<'de> for Visitor {
13353            type Value = DeleteNodePoolRequest;
13354            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13355                formatter.write_str("struct DeleteNodePoolRequest")
13356            }
13357            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13358            where
13359                A: serde::de::MapAccess<'de>,
13360            {
13361                #[allow(unused_imports)]
13362                use serde::de::Error;
13363                use std::option::Option::Some;
13364                let mut fields = std::collections::HashSet::new();
13365                let mut result = Self::Value::new();
13366                while let Some(tag) = map.next_key::<__FieldTag>()? {
13367                    #[allow(clippy::match_single_binding)]
13368                    match tag {
13369                        __FieldTag::__name => {
13370                            if !fields.insert(__FieldTag::__name) {
13371                                return std::result::Result::Err(A::Error::duplicate_field(
13372                                    "multiple values for name",
13373                                ));
13374                            }
13375                            result.name = map
13376                                .next_value::<std::option::Option<std::string::String>>()?
13377                                .unwrap_or_default();
13378                        }
13379                        __FieldTag::__request_id => {
13380                            if !fields.insert(__FieldTag::__request_id) {
13381                                return std::result::Result::Err(A::Error::duplicate_field(
13382                                    "multiple values for request_id",
13383                                ));
13384                            }
13385                            result.request_id = map
13386                                .next_value::<std::option::Option<std::string::String>>()?
13387                                .unwrap_or_default();
13388                        }
13389                        __FieldTag::Unknown(key) => {
13390                            let value = map.next_value::<serde_json::Value>()?;
13391                            result._unknown_fields.insert(key, value);
13392                        }
13393                    }
13394                }
13395                std::result::Result::Ok(result)
13396            }
13397        }
13398        deserializer.deserialize_any(Visitor)
13399    }
13400}
13401
13402#[doc(hidden)]
13403impl serde::ser::Serialize for DeleteNodePoolRequest {
13404    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13405    where
13406        S: serde::ser::Serializer,
13407    {
13408        use serde::ser::SerializeMap;
13409        #[allow(unused_imports)]
13410        use std::option::Option::Some;
13411        let mut state = serializer.serialize_map(std::option::Option::None)?;
13412        if !self.name.is_empty() {
13413            state.serialize_entry("name", &self.name)?;
13414        }
13415        if !self.request_id.is_empty() {
13416            state.serialize_entry("requestId", &self.request_id)?;
13417        }
13418        if !self._unknown_fields.is_empty() {
13419            for (key, value) in self._unknown_fields.iter() {
13420                state.serialize_entry(key, &value)?;
13421            }
13422        }
13423        state.end()
13424    }
13425}
13426
13427/// Lists machines in a site.
13428#[derive(Clone, Debug, Default, PartialEq)]
13429#[non_exhaustive]
13430pub struct ListMachinesRequest {
13431    /// Required. The parent site, which owns this collection of machines.
13432    pub parent: std::string::String,
13433
13434    /// The maximum number of resources to list.
13435    pub page_size: i32,
13436
13437    /// A page token received from previous list request.
13438    pub page_token: std::string::String,
13439
13440    /// Only resources matching this filter will be listed.
13441    pub filter: std::string::String,
13442
13443    /// Specifies the order in which resources will be listed.
13444    pub order_by: std::string::String,
13445
13446    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13447}
13448
13449impl ListMachinesRequest {
13450    pub fn new() -> Self {
13451        std::default::Default::default()
13452    }
13453
13454    /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
13455    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13456        self.parent = v.into();
13457        self
13458    }
13459
13460    /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
13461    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13462        self.page_size = v.into();
13463        self
13464    }
13465
13466    /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
13467    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13468        self.page_token = v.into();
13469        self
13470    }
13471
13472    /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
13473    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13474        self.filter = v.into();
13475        self
13476    }
13477
13478    /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
13479    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13480        self.order_by = v.into();
13481        self
13482    }
13483}
13484
13485impl wkt::message::Message for ListMachinesRequest {
13486    fn typename() -> &'static str {
13487        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesRequest"
13488    }
13489}
13490
13491#[doc(hidden)]
13492impl<'de> serde::de::Deserialize<'de> for ListMachinesRequest {
13493    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13494    where
13495        D: serde::Deserializer<'de>,
13496    {
13497        #[allow(non_camel_case_types)]
13498        #[doc(hidden)]
13499        #[derive(PartialEq, Eq, Hash)]
13500        enum __FieldTag {
13501            __parent,
13502            __page_size,
13503            __page_token,
13504            __filter,
13505            __order_by,
13506            Unknown(std::string::String),
13507        }
13508        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13509            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13510            where
13511                D: serde::Deserializer<'de>,
13512            {
13513                struct Visitor;
13514                impl<'de> serde::de::Visitor<'de> for Visitor {
13515                    type Value = __FieldTag;
13516                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13517                        formatter.write_str("a field name for ListMachinesRequest")
13518                    }
13519                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13520                    where
13521                        E: serde::de::Error,
13522                    {
13523                        use std::result::Result::Ok;
13524                        use std::string::ToString;
13525                        match value {
13526                            "parent" => Ok(__FieldTag::__parent),
13527                            "pageSize" => Ok(__FieldTag::__page_size),
13528                            "page_size" => Ok(__FieldTag::__page_size),
13529                            "pageToken" => Ok(__FieldTag::__page_token),
13530                            "page_token" => Ok(__FieldTag::__page_token),
13531                            "filter" => Ok(__FieldTag::__filter),
13532                            "orderBy" => Ok(__FieldTag::__order_by),
13533                            "order_by" => Ok(__FieldTag::__order_by),
13534                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13535                        }
13536                    }
13537                }
13538                deserializer.deserialize_identifier(Visitor)
13539            }
13540        }
13541        struct Visitor;
13542        impl<'de> serde::de::Visitor<'de> for Visitor {
13543            type Value = ListMachinesRequest;
13544            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13545                formatter.write_str("struct ListMachinesRequest")
13546            }
13547            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13548            where
13549                A: serde::de::MapAccess<'de>,
13550            {
13551                #[allow(unused_imports)]
13552                use serde::de::Error;
13553                use std::option::Option::Some;
13554                let mut fields = std::collections::HashSet::new();
13555                let mut result = Self::Value::new();
13556                while let Some(tag) = map.next_key::<__FieldTag>()? {
13557                    #[allow(clippy::match_single_binding)]
13558                    match tag {
13559                        __FieldTag::__parent => {
13560                            if !fields.insert(__FieldTag::__parent) {
13561                                return std::result::Result::Err(A::Error::duplicate_field(
13562                                    "multiple values for parent",
13563                                ));
13564                            }
13565                            result.parent = map
13566                                .next_value::<std::option::Option<std::string::String>>()?
13567                                .unwrap_or_default();
13568                        }
13569                        __FieldTag::__page_size => {
13570                            if !fields.insert(__FieldTag::__page_size) {
13571                                return std::result::Result::Err(A::Error::duplicate_field(
13572                                    "multiple values for page_size",
13573                                ));
13574                            }
13575                            struct __With(std::option::Option<i32>);
13576                            impl<'de> serde::de::Deserialize<'de> for __With {
13577                                fn deserialize<D>(
13578                                    deserializer: D,
13579                                ) -> std::result::Result<Self, D::Error>
13580                                where
13581                                    D: serde::de::Deserializer<'de>,
13582                                {
13583                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13584                                }
13585                            }
13586                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
13587                        }
13588                        __FieldTag::__page_token => {
13589                            if !fields.insert(__FieldTag::__page_token) {
13590                                return std::result::Result::Err(A::Error::duplicate_field(
13591                                    "multiple values for page_token",
13592                                ));
13593                            }
13594                            result.page_token = map
13595                                .next_value::<std::option::Option<std::string::String>>()?
13596                                .unwrap_or_default();
13597                        }
13598                        __FieldTag::__filter => {
13599                            if !fields.insert(__FieldTag::__filter) {
13600                                return std::result::Result::Err(A::Error::duplicate_field(
13601                                    "multiple values for filter",
13602                                ));
13603                            }
13604                            result.filter = map
13605                                .next_value::<std::option::Option<std::string::String>>()?
13606                                .unwrap_or_default();
13607                        }
13608                        __FieldTag::__order_by => {
13609                            if !fields.insert(__FieldTag::__order_by) {
13610                                return std::result::Result::Err(A::Error::duplicate_field(
13611                                    "multiple values for order_by",
13612                                ));
13613                            }
13614                            result.order_by = map
13615                                .next_value::<std::option::Option<std::string::String>>()?
13616                                .unwrap_or_default();
13617                        }
13618                        __FieldTag::Unknown(key) => {
13619                            let value = map.next_value::<serde_json::Value>()?;
13620                            result._unknown_fields.insert(key, value);
13621                        }
13622                    }
13623                }
13624                std::result::Result::Ok(result)
13625            }
13626        }
13627        deserializer.deserialize_any(Visitor)
13628    }
13629}
13630
13631#[doc(hidden)]
13632impl serde::ser::Serialize for ListMachinesRequest {
13633    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13634    where
13635        S: serde::ser::Serializer,
13636    {
13637        use serde::ser::SerializeMap;
13638        #[allow(unused_imports)]
13639        use std::option::Option::Some;
13640        let mut state = serializer.serialize_map(std::option::Option::None)?;
13641        if !self.parent.is_empty() {
13642            state.serialize_entry("parent", &self.parent)?;
13643        }
13644        if !wkt::internal::is_default(&self.page_size) {
13645            struct __With<'a>(&'a i32);
13646            impl<'a> serde::ser::Serialize for __With<'a> {
13647                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13648                where
13649                    S: serde::ser::Serializer,
13650                {
13651                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13652                }
13653            }
13654            state.serialize_entry("pageSize", &__With(&self.page_size))?;
13655        }
13656        if !self.page_token.is_empty() {
13657            state.serialize_entry("pageToken", &self.page_token)?;
13658        }
13659        if !self.filter.is_empty() {
13660            state.serialize_entry("filter", &self.filter)?;
13661        }
13662        if !self.order_by.is_empty() {
13663            state.serialize_entry("orderBy", &self.order_by)?;
13664        }
13665        if !self._unknown_fields.is_empty() {
13666            for (key, value) in self._unknown_fields.iter() {
13667                state.serialize_entry(key, &value)?;
13668            }
13669        }
13670        state.end()
13671    }
13672}
13673
13674/// List of machines in a site.
13675#[derive(Clone, Debug, Default, PartialEq)]
13676#[non_exhaustive]
13677pub struct ListMachinesResponse {
13678    /// Machines in the site.
13679    pub machines: std::vec::Vec<crate::model::Machine>,
13680
13681    /// A token to retrieve next page of results.
13682    pub next_page_token: std::string::String,
13683
13684    /// Locations that could not be reached.
13685    pub unreachable: std::vec::Vec<std::string::String>,
13686
13687    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13688}
13689
13690impl ListMachinesResponse {
13691    pub fn new() -> Self {
13692        std::default::Default::default()
13693    }
13694
13695    /// Sets the value of [machines][crate::model::ListMachinesResponse::machines].
13696    pub fn set_machines<T, V>(mut self, v: T) -> Self
13697    where
13698        T: std::iter::IntoIterator<Item = V>,
13699        V: std::convert::Into<crate::model::Machine>,
13700    {
13701        use std::iter::Iterator;
13702        self.machines = v.into_iter().map(|i| i.into()).collect();
13703        self
13704    }
13705
13706    /// Sets the value of [next_page_token][crate::model::ListMachinesResponse::next_page_token].
13707    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13708        self.next_page_token = v.into();
13709        self
13710    }
13711
13712    /// Sets the value of [unreachable][crate::model::ListMachinesResponse::unreachable].
13713    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13714    where
13715        T: std::iter::IntoIterator<Item = V>,
13716        V: std::convert::Into<std::string::String>,
13717    {
13718        use std::iter::Iterator;
13719        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13720        self
13721    }
13722}
13723
13724impl wkt::message::Message for ListMachinesResponse {
13725    fn typename() -> &'static str {
13726        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesResponse"
13727    }
13728}
13729
13730#[doc(hidden)]
13731impl gax::paginator::internal::PageableResponse for ListMachinesResponse {
13732    type PageItem = crate::model::Machine;
13733
13734    fn items(self) -> std::vec::Vec<Self::PageItem> {
13735        self.machines
13736    }
13737
13738    fn next_page_token(&self) -> std::string::String {
13739        use std::clone::Clone;
13740        self.next_page_token.clone()
13741    }
13742}
13743
13744#[doc(hidden)]
13745impl<'de> serde::de::Deserialize<'de> for ListMachinesResponse {
13746    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13747    where
13748        D: serde::Deserializer<'de>,
13749    {
13750        #[allow(non_camel_case_types)]
13751        #[doc(hidden)]
13752        #[derive(PartialEq, Eq, Hash)]
13753        enum __FieldTag {
13754            __machines,
13755            __next_page_token,
13756            __unreachable,
13757            Unknown(std::string::String),
13758        }
13759        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13760            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13761            where
13762                D: serde::Deserializer<'de>,
13763            {
13764                struct Visitor;
13765                impl<'de> serde::de::Visitor<'de> for Visitor {
13766                    type Value = __FieldTag;
13767                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13768                        formatter.write_str("a field name for ListMachinesResponse")
13769                    }
13770                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13771                    where
13772                        E: serde::de::Error,
13773                    {
13774                        use std::result::Result::Ok;
13775                        use std::string::ToString;
13776                        match value {
13777                            "machines" => Ok(__FieldTag::__machines),
13778                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
13779                            "next_page_token" => Ok(__FieldTag::__next_page_token),
13780                            "unreachable" => Ok(__FieldTag::__unreachable),
13781                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13782                        }
13783                    }
13784                }
13785                deserializer.deserialize_identifier(Visitor)
13786            }
13787        }
13788        struct Visitor;
13789        impl<'de> serde::de::Visitor<'de> for Visitor {
13790            type Value = ListMachinesResponse;
13791            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13792                formatter.write_str("struct ListMachinesResponse")
13793            }
13794            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13795            where
13796                A: serde::de::MapAccess<'de>,
13797            {
13798                #[allow(unused_imports)]
13799                use serde::de::Error;
13800                use std::option::Option::Some;
13801                let mut fields = std::collections::HashSet::new();
13802                let mut result = Self::Value::new();
13803                while let Some(tag) = map.next_key::<__FieldTag>()? {
13804                    #[allow(clippy::match_single_binding)]
13805                    match tag {
13806                        __FieldTag::__machines => {
13807                            if !fields.insert(__FieldTag::__machines) {
13808                                return std::result::Result::Err(A::Error::duplicate_field(
13809                                    "multiple values for machines",
13810                                ));
13811                            }
13812                            result.machines = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Machine>>>()?.unwrap_or_default();
13813                        }
13814                        __FieldTag::__next_page_token => {
13815                            if !fields.insert(__FieldTag::__next_page_token) {
13816                                return std::result::Result::Err(A::Error::duplicate_field(
13817                                    "multiple values for next_page_token",
13818                                ));
13819                            }
13820                            result.next_page_token = map
13821                                .next_value::<std::option::Option<std::string::String>>()?
13822                                .unwrap_or_default();
13823                        }
13824                        __FieldTag::__unreachable => {
13825                            if !fields.insert(__FieldTag::__unreachable) {
13826                                return std::result::Result::Err(A::Error::duplicate_field(
13827                                    "multiple values for unreachable",
13828                                ));
13829                            }
13830                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
13831                        }
13832                        __FieldTag::Unknown(key) => {
13833                            let value = map.next_value::<serde_json::Value>()?;
13834                            result._unknown_fields.insert(key, value);
13835                        }
13836                    }
13837                }
13838                std::result::Result::Ok(result)
13839            }
13840        }
13841        deserializer.deserialize_any(Visitor)
13842    }
13843}
13844
13845#[doc(hidden)]
13846impl serde::ser::Serialize for ListMachinesResponse {
13847    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13848    where
13849        S: serde::ser::Serializer,
13850    {
13851        use serde::ser::SerializeMap;
13852        #[allow(unused_imports)]
13853        use std::option::Option::Some;
13854        let mut state = serializer.serialize_map(std::option::Option::None)?;
13855        if !self.machines.is_empty() {
13856            state.serialize_entry("machines", &self.machines)?;
13857        }
13858        if !self.next_page_token.is_empty() {
13859            state.serialize_entry("nextPageToken", &self.next_page_token)?;
13860        }
13861        if !self.unreachable.is_empty() {
13862            state.serialize_entry("unreachable", &self.unreachable)?;
13863        }
13864        if !self._unknown_fields.is_empty() {
13865            for (key, value) in self._unknown_fields.iter() {
13866                state.serialize_entry(key, &value)?;
13867            }
13868        }
13869        state.end()
13870    }
13871}
13872
13873/// Gets a machine.
13874#[derive(Clone, Debug, Default, PartialEq)]
13875#[non_exhaustive]
13876pub struct GetMachineRequest {
13877    /// Required. The resource name of the machine.
13878    pub name: std::string::String,
13879
13880    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13881}
13882
13883impl GetMachineRequest {
13884    pub fn new() -> Self {
13885        std::default::Default::default()
13886    }
13887
13888    /// Sets the value of [name][crate::model::GetMachineRequest::name].
13889    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13890        self.name = v.into();
13891        self
13892    }
13893}
13894
13895impl wkt::message::Message for GetMachineRequest {
13896    fn typename() -> &'static str {
13897        "type.googleapis.com/google.cloud.edgecontainer.v1.GetMachineRequest"
13898    }
13899}
13900
13901#[doc(hidden)]
13902impl<'de> serde::de::Deserialize<'de> for GetMachineRequest {
13903    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13904    where
13905        D: serde::Deserializer<'de>,
13906    {
13907        #[allow(non_camel_case_types)]
13908        #[doc(hidden)]
13909        #[derive(PartialEq, Eq, Hash)]
13910        enum __FieldTag {
13911            __name,
13912            Unknown(std::string::String),
13913        }
13914        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13915            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13916            where
13917                D: serde::Deserializer<'de>,
13918            {
13919                struct Visitor;
13920                impl<'de> serde::de::Visitor<'de> for Visitor {
13921                    type Value = __FieldTag;
13922                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13923                        formatter.write_str("a field name for GetMachineRequest")
13924                    }
13925                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13926                    where
13927                        E: serde::de::Error,
13928                    {
13929                        use std::result::Result::Ok;
13930                        use std::string::ToString;
13931                        match value {
13932                            "name" => Ok(__FieldTag::__name),
13933                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13934                        }
13935                    }
13936                }
13937                deserializer.deserialize_identifier(Visitor)
13938            }
13939        }
13940        struct Visitor;
13941        impl<'de> serde::de::Visitor<'de> for Visitor {
13942            type Value = GetMachineRequest;
13943            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13944                formatter.write_str("struct GetMachineRequest")
13945            }
13946            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13947            where
13948                A: serde::de::MapAccess<'de>,
13949            {
13950                #[allow(unused_imports)]
13951                use serde::de::Error;
13952                use std::option::Option::Some;
13953                let mut fields = std::collections::HashSet::new();
13954                let mut result = Self::Value::new();
13955                while let Some(tag) = map.next_key::<__FieldTag>()? {
13956                    #[allow(clippy::match_single_binding)]
13957                    match tag {
13958                        __FieldTag::__name => {
13959                            if !fields.insert(__FieldTag::__name) {
13960                                return std::result::Result::Err(A::Error::duplicate_field(
13961                                    "multiple values for name",
13962                                ));
13963                            }
13964                            result.name = map
13965                                .next_value::<std::option::Option<std::string::String>>()?
13966                                .unwrap_or_default();
13967                        }
13968                        __FieldTag::Unknown(key) => {
13969                            let value = map.next_value::<serde_json::Value>()?;
13970                            result._unknown_fields.insert(key, value);
13971                        }
13972                    }
13973                }
13974                std::result::Result::Ok(result)
13975            }
13976        }
13977        deserializer.deserialize_any(Visitor)
13978    }
13979}
13980
13981#[doc(hidden)]
13982impl serde::ser::Serialize for GetMachineRequest {
13983    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13984    where
13985        S: serde::ser::Serializer,
13986    {
13987        use serde::ser::SerializeMap;
13988        #[allow(unused_imports)]
13989        use std::option::Option::Some;
13990        let mut state = serializer.serialize_map(std::option::Option::None)?;
13991        if !self.name.is_empty() {
13992            state.serialize_entry("name", &self.name)?;
13993        }
13994        if !self._unknown_fields.is_empty() {
13995            for (key, value) in self._unknown_fields.iter() {
13996                state.serialize_entry(key, &value)?;
13997            }
13998        }
13999        state.end()
14000    }
14001}
14002
14003/// Lists VPN connections.
14004#[derive(Clone, Debug, Default, PartialEq)]
14005#[non_exhaustive]
14006pub struct ListVpnConnectionsRequest {
14007    /// Required. The parent location, which owns this collection of VPN
14008    /// connections.
14009    pub parent: std::string::String,
14010
14011    /// The maximum number of resources to list.
14012    pub page_size: i32,
14013
14014    /// A page token received from previous list request.
14015    pub page_token: std::string::String,
14016
14017    /// Only resources matching this filter will be listed.
14018    pub filter: std::string::String,
14019
14020    /// Specifies the order in which resources will be listed.
14021    pub order_by: std::string::String,
14022
14023    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14024}
14025
14026impl ListVpnConnectionsRequest {
14027    pub fn new() -> Self {
14028        std::default::Default::default()
14029    }
14030
14031    /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
14032    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14033        self.parent = v.into();
14034        self
14035    }
14036
14037    /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
14038    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14039        self.page_size = v.into();
14040        self
14041    }
14042
14043    /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
14044    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14045        self.page_token = v.into();
14046        self
14047    }
14048
14049    /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
14050    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14051        self.filter = v.into();
14052        self
14053    }
14054
14055    /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
14056    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14057        self.order_by = v.into();
14058        self
14059    }
14060}
14061
14062impl wkt::message::Message for ListVpnConnectionsRequest {
14063    fn typename() -> &'static str {
14064        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsRequest"
14065    }
14066}
14067
14068#[doc(hidden)]
14069impl<'de> serde::de::Deserialize<'de> for ListVpnConnectionsRequest {
14070    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14071    where
14072        D: serde::Deserializer<'de>,
14073    {
14074        #[allow(non_camel_case_types)]
14075        #[doc(hidden)]
14076        #[derive(PartialEq, Eq, Hash)]
14077        enum __FieldTag {
14078            __parent,
14079            __page_size,
14080            __page_token,
14081            __filter,
14082            __order_by,
14083            Unknown(std::string::String),
14084        }
14085        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14086            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14087            where
14088                D: serde::Deserializer<'de>,
14089            {
14090                struct Visitor;
14091                impl<'de> serde::de::Visitor<'de> for Visitor {
14092                    type Value = __FieldTag;
14093                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14094                        formatter.write_str("a field name for ListVpnConnectionsRequest")
14095                    }
14096                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14097                    where
14098                        E: serde::de::Error,
14099                    {
14100                        use std::result::Result::Ok;
14101                        use std::string::ToString;
14102                        match value {
14103                            "parent" => Ok(__FieldTag::__parent),
14104                            "pageSize" => Ok(__FieldTag::__page_size),
14105                            "page_size" => Ok(__FieldTag::__page_size),
14106                            "pageToken" => Ok(__FieldTag::__page_token),
14107                            "page_token" => Ok(__FieldTag::__page_token),
14108                            "filter" => Ok(__FieldTag::__filter),
14109                            "orderBy" => Ok(__FieldTag::__order_by),
14110                            "order_by" => Ok(__FieldTag::__order_by),
14111                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14112                        }
14113                    }
14114                }
14115                deserializer.deserialize_identifier(Visitor)
14116            }
14117        }
14118        struct Visitor;
14119        impl<'de> serde::de::Visitor<'de> for Visitor {
14120            type Value = ListVpnConnectionsRequest;
14121            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14122                formatter.write_str("struct ListVpnConnectionsRequest")
14123            }
14124            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14125            where
14126                A: serde::de::MapAccess<'de>,
14127            {
14128                #[allow(unused_imports)]
14129                use serde::de::Error;
14130                use std::option::Option::Some;
14131                let mut fields = std::collections::HashSet::new();
14132                let mut result = Self::Value::new();
14133                while let Some(tag) = map.next_key::<__FieldTag>()? {
14134                    #[allow(clippy::match_single_binding)]
14135                    match tag {
14136                        __FieldTag::__parent => {
14137                            if !fields.insert(__FieldTag::__parent) {
14138                                return std::result::Result::Err(A::Error::duplicate_field(
14139                                    "multiple values for parent",
14140                                ));
14141                            }
14142                            result.parent = map
14143                                .next_value::<std::option::Option<std::string::String>>()?
14144                                .unwrap_or_default();
14145                        }
14146                        __FieldTag::__page_size => {
14147                            if !fields.insert(__FieldTag::__page_size) {
14148                                return std::result::Result::Err(A::Error::duplicate_field(
14149                                    "multiple values for page_size",
14150                                ));
14151                            }
14152                            struct __With(std::option::Option<i32>);
14153                            impl<'de> serde::de::Deserialize<'de> for __With {
14154                                fn deserialize<D>(
14155                                    deserializer: D,
14156                                ) -> std::result::Result<Self, D::Error>
14157                                where
14158                                    D: serde::de::Deserializer<'de>,
14159                                {
14160                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14161                                }
14162                            }
14163                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
14164                        }
14165                        __FieldTag::__page_token => {
14166                            if !fields.insert(__FieldTag::__page_token) {
14167                                return std::result::Result::Err(A::Error::duplicate_field(
14168                                    "multiple values for page_token",
14169                                ));
14170                            }
14171                            result.page_token = map
14172                                .next_value::<std::option::Option<std::string::String>>()?
14173                                .unwrap_or_default();
14174                        }
14175                        __FieldTag::__filter => {
14176                            if !fields.insert(__FieldTag::__filter) {
14177                                return std::result::Result::Err(A::Error::duplicate_field(
14178                                    "multiple values for filter",
14179                                ));
14180                            }
14181                            result.filter = map
14182                                .next_value::<std::option::Option<std::string::String>>()?
14183                                .unwrap_or_default();
14184                        }
14185                        __FieldTag::__order_by => {
14186                            if !fields.insert(__FieldTag::__order_by) {
14187                                return std::result::Result::Err(A::Error::duplicate_field(
14188                                    "multiple values for order_by",
14189                                ));
14190                            }
14191                            result.order_by = map
14192                                .next_value::<std::option::Option<std::string::String>>()?
14193                                .unwrap_or_default();
14194                        }
14195                        __FieldTag::Unknown(key) => {
14196                            let value = map.next_value::<serde_json::Value>()?;
14197                            result._unknown_fields.insert(key, value);
14198                        }
14199                    }
14200                }
14201                std::result::Result::Ok(result)
14202            }
14203        }
14204        deserializer.deserialize_any(Visitor)
14205    }
14206}
14207
14208#[doc(hidden)]
14209impl serde::ser::Serialize for ListVpnConnectionsRequest {
14210    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14211    where
14212        S: serde::ser::Serializer,
14213    {
14214        use serde::ser::SerializeMap;
14215        #[allow(unused_imports)]
14216        use std::option::Option::Some;
14217        let mut state = serializer.serialize_map(std::option::Option::None)?;
14218        if !self.parent.is_empty() {
14219            state.serialize_entry("parent", &self.parent)?;
14220        }
14221        if !wkt::internal::is_default(&self.page_size) {
14222            struct __With<'a>(&'a i32);
14223            impl<'a> serde::ser::Serialize for __With<'a> {
14224                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14225                where
14226                    S: serde::ser::Serializer,
14227                {
14228                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14229                }
14230            }
14231            state.serialize_entry("pageSize", &__With(&self.page_size))?;
14232        }
14233        if !self.page_token.is_empty() {
14234            state.serialize_entry("pageToken", &self.page_token)?;
14235        }
14236        if !self.filter.is_empty() {
14237            state.serialize_entry("filter", &self.filter)?;
14238        }
14239        if !self.order_by.is_empty() {
14240            state.serialize_entry("orderBy", &self.order_by)?;
14241        }
14242        if !self._unknown_fields.is_empty() {
14243            for (key, value) in self._unknown_fields.iter() {
14244                state.serialize_entry(key, &value)?;
14245            }
14246        }
14247        state.end()
14248    }
14249}
14250
14251/// List of VPN connections in a location.
14252#[derive(Clone, Debug, Default, PartialEq)]
14253#[non_exhaustive]
14254pub struct ListVpnConnectionsResponse {
14255    /// VpnConnections in the location.
14256    pub vpn_connections: std::vec::Vec<crate::model::VpnConnection>,
14257
14258    /// A token to retrieve next page of results.
14259    pub next_page_token: std::string::String,
14260
14261    /// Locations that could not be reached.
14262    pub unreachable: std::vec::Vec<std::string::String>,
14263
14264    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14265}
14266
14267impl ListVpnConnectionsResponse {
14268    pub fn new() -> Self {
14269        std::default::Default::default()
14270    }
14271
14272    /// Sets the value of [vpn_connections][crate::model::ListVpnConnectionsResponse::vpn_connections].
14273    pub fn set_vpn_connections<T, V>(mut self, v: T) -> Self
14274    where
14275        T: std::iter::IntoIterator<Item = V>,
14276        V: std::convert::Into<crate::model::VpnConnection>,
14277    {
14278        use std::iter::Iterator;
14279        self.vpn_connections = v.into_iter().map(|i| i.into()).collect();
14280        self
14281    }
14282
14283    /// Sets the value of [next_page_token][crate::model::ListVpnConnectionsResponse::next_page_token].
14284    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14285        self.next_page_token = v.into();
14286        self
14287    }
14288
14289    /// Sets the value of [unreachable][crate::model::ListVpnConnectionsResponse::unreachable].
14290    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14291    where
14292        T: std::iter::IntoIterator<Item = V>,
14293        V: std::convert::Into<std::string::String>,
14294    {
14295        use std::iter::Iterator;
14296        self.unreachable = v.into_iter().map(|i| i.into()).collect();
14297        self
14298    }
14299}
14300
14301impl wkt::message::Message for ListVpnConnectionsResponse {
14302    fn typename() -> &'static str {
14303        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsResponse"
14304    }
14305}
14306
14307#[doc(hidden)]
14308impl gax::paginator::internal::PageableResponse for ListVpnConnectionsResponse {
14309    type PageItem = crate::model::VpnConnection;
14310
14311    fn items(self) -> std::vec::Vec<Self::PageItem> {
14312        self.vpn_connections
14313    }
14314
14315    fn next_page_token(&self) -> std::string::String {
14316        use std::clone::Clone;
14317        self.next_page_token.clone()
14318    }
14319}
14320
14321#[doc(hidden)]
14322impl<'de> serde::de::Deserialize<'de> for ListVpnConnectionsResponse {
14323    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14324    where
14325        D: serde::Deserializer<'de>,
14326    {
14327        #[allow(non_camel_case_types)]
14328        #[doc(hidden)]
14329        #[derive(PartialEq, Eq, Hash)]
14330        enum __FieldTag {
14331            __vpn_connections,
14332            __next_page_token,
14333            __unreachable,
14334            Unknown(std::string::String),
14335        }
14336        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14337            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14338            where
14339                D: serde::Deserializer<'de>,
14340            {
14341                struct Visitor;
14342                impl<'de> serde::de::Visitor<'de> for Visitor {
14343                    type Value = __FieldTag;
14344                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14345                        formatter.write_str("a field name for ListVpnConnectionsResponse")
14346                    }
14347                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14348                    where
14349                        E: serde::de::Error,
14350                    {
14351                        use std::result::Result::Ok;
14352                        use std::string::ToString;
14353                        match value {
14354                            "vpnConnections" => Ok(__FieldTag::__vpn_connections),
14355                            "vpn_connections" => Ok(__FieldTag::__vpn_connections),
14356                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
14357                            "next_page_token" => Ok(__FieldTag::__next_page_token),
14358                            "unreachable" => Ok(__FieldTag::__unreachable),
14359                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14360                        }
14361                    }
14362                }
14363                deserializer.deserialize_identifier(Visitor)
14364            }
14365        }
14366        struct Visitor;
14367        impl<'de> serde::de::Visitor<'de> for Visitor {
14368            type Value = ListVpnConnectionsResponse;
14369            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14370                formatter.write_str("struct ListVpnConnectionsResponse")
14371            }
14372            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14373            where
14374                A: serde::de::MapAccess<'de>,
14375            {
14376                #[allow(unused_imports)]
14377                use serde::de::Error;
14378                use std::option::Option::Some;
14379                let mut fields = std::collections::HashSet::new();
14380                let mut result = Self::Value::new();
14381                while let Some(tag) = map.next_key::<__FieldTag>()? {
14382                    #[allow(clippy::match_single_binding)]
14383                    match tag {
14384                        __FieldTag::__vpn_connections => {
14385                            if !fields.insert(__FieldTag::__vpn_connections) {
14386                                return std::result::Result::Err(A::Error::duplicate_field(
14387                                    "multiple values for vpn_connections",
14388                                ));
14389                            }
14390                            result.vpn_connections = map.next_value::<std::option::Option<std::vec::Vec<crate::model::VpnConnection>>>()?.unwrap_or_default();
14391                        }
14392                        __FieldTag::__next_page_token => {
14393                            if !fields.insert(__FieldTag::__next_page_token) {
14394                                return std::result::Result::Err(A::Error::duplicate_field(
14395                                    "multiple values for next_page_token",
14396                                ));
14397                            }
14398                            result.next_page_token = map
14399                                .next_value::<std::option::Option<std::string::String>>()?
14400                                .unwrap_or_default();
14401                        }
14402                        __FieldTag::__unreachable => {
14403                            if !fields.insert(__FieldTag::__unreachable) {
14404                                return std::result::Result::Err(A::Error::duplicate_field(
14405                                    "multiple values for unreachable",
14406                                ));
14407                            }
14408                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
14409                        }
14410                        __FieldTag::Unknown(key) => {
14411                            let value = map.next_value::<serde_json::Value>()?;
14412                            result._unknown_fields.insert(key, value);
14413                        }
14414                    }
14415                }
14416                std::result::Result::Ok(result)
14417            }
14418        }
14419        deserializer.deserialize_any(Visitor)
14420    }
14421}
14422
14423#[doc(hidden)]
14424impl serde::ser::Serialize for ListVpnConnectionsResponse {
14425    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14426    where
14427        S: serde::ser::Serializer,
14428    {
14429        use serde::ser::SerializeMap;
14430        #[allow(unused_imports)]
14431        use std::option::Option::Some;
14432        let mut state = serializer.serialize_map(std::option::Option::None)?;
14433        if !self.vpn_connections.is_empty() {
14434            state.serialize_entry("vpnConnections", &self.vpn_connections)?;
14435        }
14436        if !self.next_page_token.is_empty() {
14437            state.serialize_entry("nextPageToken", &self.next_page_token)?;
14438        }
14439        if !self.unreachable.is_empty() {
14440            state.serialize_entry("unreachable", &self.unreachable)?;
14441        }
14442        if !self._unknown_fields.is_empty() {
14443            for (key, value) in self._unknown_fields.iter() {
14444                state.serialize_entry(key, &value)?;
14445            }
14446        }
14447        state.end()
14448    }
14449}
14450
14451/// Gets a VPN connection.
14452#[derive(Clone, Debug, Default, PartialEq)]
14453#[non_exhaustive]
14454pub struct GetVpnConnectionRequest {
14455    /// Required. The resource name of the vpn connection.
14456    pub name: std::string::String,
14457
14458    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14459}
14460
14461impl GetVpnConnectionRequest {
14462    pub fn new() -> Self {
14463        std::default::Default::default()
14464    }
14465
14466    /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
14467    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14468        self.name = v.into();
14469        self
14470    }
14471}
14472
14473impl wkt::message::Message for GetVpnConnectionRequest {
14474    fn typename() -> &'static str {
14475        "type.googleapis.com/google.cloud.edgecontainer.v1.GetVpnConnectionRequest"
14476    }
14477}
14478
14479#[doc(hidden)]
14480impl<'de> serde::de::Deserialize<'de> for GetVpnConnectionRequest {
14481    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14482    where
14483        D: serde::Deserializer<'de>,
14484    {
14485        #[allow(non_camel_case_types)]
14486        #[doc(hidden)]
14487        #[derive(PartialEq, Eq, Hash)]
14488        enum __FieldTag {
14489            __name,
14490            Unknown(std::string::String),
14491        }
14492        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14493            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14494            where
14495                D: serde::Deserializer<'de>,
14496            {
14497                struct Visitor;
14498                impl<'de> serde::de::Visitor<'de> for Visitor {
14499                    type Value = __FieldTag;
14500                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14501                        formatter.write_str("a field name for GetVpnConnectionRequest")
14502                    }
14503                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14504                    where
14505                        E: serde::de::Error,
14506                    {
14507                        use std::result::Result::Ok;
14508                        use std::string::ToString;
14509                        match value {
14510                            "name" => Ok(__FieldTag::__name),
14511                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14512                        }
14513                    }
14514                }
14515                deserializer.deserialize_identifier(Visitor)
14516            }
14517        }
14518        struct Visitor;
14519        impl<'de> serde::de::Visitor<'de> for Visitor {
14520            type Value = GetVpnConnectionRequest;
14521            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14522                formatter.write_str("struct GetVpnConnectionRequest")
14523            }
14524            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14525            where
14526                A: serde::de::MapAccess<'de>,
14527            {
14528                #[allow(unused_imports)]
14529                use serde::de::Error;
14530                use std::option::Option::Some;
14531                let mut fields = std::collections::HashSet::new();
14532                let mut result = Self::Value::new();
14533                while let Some(tag) = map.next_key::<__FieldTag>()? {
14534                    #[allow(clippy::match_single_binding)]
14535                    match tag {
14536                        __FieldTag::__name => {
14537                            if !fields.insert(__FieldTag::__name) {
14538                                return std::result::Result::Err(A::Error::duplicate_field(
14539                                    "multiple values for name",
14540                                ));
14541                            }
14542                            result.name = map
14543                                .next_value::<std::option::Option<std::string::String>>()?
14544                                .unwrap_or_default();
14545                        }
14546                        __FieldTag::Unknown(key) => {
14547                            let value = map.next_value::<serde_json::Value>()?;
14548                            result._unknown_fields.insert(key, value);
14549                        }
14550                    }
14551                }
14552                std::result::Result::Ok(result)
14553            }
14554        }
14555        deserializer.deserialize_any(Visitor)
14556    }
14557}
14558
14559#[doc(hidden)]
14560impl serde::ser::Serialize for GetVpnConnectionRequest {
14561    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14562    where
14563        S: serde::ser::Serializer,
14564    {
14565        use serde::ser::SerializeMap;
14566        #[allow(unused_imports)]
14567        use std::option::Option::Some;
14568        let mut state = serializer.serialize_map(std::option::Option::None)?;
14569        if !self.name.is_empty() {
14570            state.serialize_entry("name", &self.name)?;
14571        }
14572        if !self._unknown_fields.is_empty() {
14573            for (key, value) in self._unknown_fields.iter() {
14574                state.serialize_entry(key, &value)?;
14575            }
14576        }
14577        state.end()
14578    }
14579}
14580
14581/// Creates a VPN connection.
14582#[derive(Clone, Debug, Default, PartialEq)]
14583#[non_exhaustive]
14584pub struct CreateVpnConnectionRequest {
14585    /// Required. The parent location where this vpn connection will be created.
14586    pub parent: std::string::String,
14587
14588    /// Required. The VPN connection identifier.
14589    pub vpn_connection_id: std::string::String,
14590
14591    /// Required. The VPN connection to create.
14592    pub vpn_connection: std::option::Option<crate::model::VpnConnection>,
14593
14594    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
14595    /// random UUID is recommended. This request is only idempotent if
14596    /// `request_id` is provided.
14597    pub request_id: std::string::String,
14598
14599    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14600}
14601
14602impl CreateVpnConnectionRequest {
14603    pub fn new() -> Self {
14604        std::default::Default::default()
14605    }
14606
14607    /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
14608    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14609        self.parent = v.into();
14610        self
14611    }
14612
14613    /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
14614    pub fn set_vpn_connection_id<T: std::convert::Into<std::string::String>>(
14615        mut self,
14616        v: T,
14617    ) -> Self {
14618        self.vpn_connection_id = v.into();
14619        self
14620    }
14621
14622    /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
14623    pub fn set_vpn_connection<T>(mut self, v: T) -> Self
14624    where
14625        T: std::convert::Into<crate::model::VpnConnection>,
14626    {
14627        self.vpn_connection = std::option::Option::Some(v.into());
14628        self
14629    }
14630
14631    /// Sets or clears the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
14632    pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
14633    where
14634        T: std::convert::Into<crate::model::VpnConnection>,
14635    {
14636        self.vpn_connection = v.map(|x| x.into());
14637        self
14638    }
14639
14640    /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
14641    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14642        self.request_id = v.into();
14643        self
14644    }
14645}
14646
14647impl wkt::message::Message for CreateVpnConnectionRequest {
14648    fn typename() -> &'static str {
14649        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateVpnConnectionRequest"
14650    }
14651}
14652
14653#[doc(hidden)]
14654impl<'de> serde::de::Deserialize<'de> for CreateVpnConnectionRequest {
14655    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14656    where
14657        D: serde::Deserializer<'de>,
14658    {
14659        #[allow(non_camel_case_types)]
14660        #[doc(hidden)]
14661        #[derive(PartialEq, Eq, Hash)]
14662        enum __FieldTag {
14663            __parent,
14664            __vpn_connection_id,
14665            __vpn_connection,
14666            __request_id,
14667            Unknown(std::string::String),
14668        }
14669        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14670            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14671            where
14672                D: serde::Deserializer<'de>,
14673            {
14674                struct Visitor;
14675                impl<'de> serde::de::Visitor<'de> for Visitor {
14676                    type Value = __FieldTag;
14677                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14678                        formatter.write_str("a field name for CreateVpnConnectionRequest")
14679                    }
14680                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14681                    where
14682                        E: serde::de::Error,
14683                    {
14684                        use std::result::Result::Ok;
14685                        use std::string::ToString;
14686                        match value {
14687                            "parent" => Ok(__FieldTag::__parent),
14688                            "vpnConnectionId" => Ok(__FieldTag::__vpn_connection_id),
14689                            "vpn_connection_id" => Ok(__FieldTag::__vpn_connection_id),
14690                            "vpnConnection" => Ok(__FieldTag::__vpn_connection),
14691                            "vpn_connection" => Ok(__FieldTag::__vpn_connection),
14692                            "requestId" => Ok(__FieldTag::__request_id),
14693                            "request_id" => Ok(__FieldTag::__request_id),
14694                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14695                        }
14696                    }
14697                }
14698                deserializer.deserialize_identifier(Visitor)
14699            }
14700        }
14701        struct Visitor;
14702        impl<'de> serde::de::Visitor<'de> for Visitor {
14703            type Value = CreateVpnConnectionRequest;
14704            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14705                formatter.write_str("struct CreateVpnConnectionRequest")
14706            }
14707            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14708            where
14709                A: serde::de::MapAccess<'de>,
14710            {
14711                #[allow(unused_imports)]
14712                use serde::de::Error;
14713                use std::option::Option::Some;
14714                let mut fields = std::collections::HashSet::new();
14715                let mut result = Self::Value::new();
14716                while let Some(tag) = map.next_key::<__FieldTag>()? {
14717                    #[allow(clippy::match_single_binding)]
14718                    match tag {
14719                        __FieldTag::__parent => {
14720                            if !fields.insert(__FieldTag::__parent) {
14721                                return std::result::Result::Err(A::Error::duplicate_field(
14722                                    "multiple values for parent",
14723                                ));
14724                            }
14725                            result.parent = map
14726                                .next_value::<std::option::Option<std::string::String>>()?
14727                                .unwrap_or_default();
14728                        }
14729                        __FieldTag::__vpn_connection_id => {
14730                            if !fields.insert(__FieldTag::__vpn_connection_id) {
14731                                return std::result::Result::Err(A::Error::duplicate_field(
14732                                    "multiple values for vpn_connection_id",
14733                                ));
14734                            }
14735                            result.vpn_connection_id = map
14736                                .next_value::<std::option::Option<std::string::String>>()?
14737                                .unwrap_or_default();
14738                        }
14739                        __FieldTag::__vpn_connection => {
14740                            if !fields.insert(__FieldTag::__vpn_connection) {
14741                                return std::result::Result::Err(A::Error::duplicate_field(
14742                                    "multiple values for vpn_connection",
14743                                ));
14744                            }
14745                            result.vpn_connection = map
14746                                .next_value::<std::option::Option<crate::model::VpnConnection>>()?;
14747                        }
14748                        __FieldTag::__request_id => {
14749                            if !fields.insert(__FieldTag::__request_id) {
14750                                return std::result::Result::Err(A::Error::duplicate_field(
14751                                    "multiple values for request_id",
14752                                ));
14753                            }
14754                            result.request_id = map
14755                                .next_value::<std::option::Option<std::string::String>>()?
14756                                .unwrap_or_default();
14757                        }
14758                        __FieldTag::Unknown(key) => {
14759                            let value = map.next_value::<serde_json::Value>()?;
14760                            result._unknown_fields.insert(key, value);
14761                        }
14762                    }
14763                }
14764                std::result::Result::Ok(result)
14765            }
14766        }
14767        deserializer.deserialize_any(Visitor)
14768    }
14769}
14770
14771#[doc(hidden)]
14772impl serde::ser::Serialize for CreateVpnConnectionRequest {
14773    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14774    where
14775        S: serde::ser::Serializer,
14776    {
14777        use serde::ser::SerializeMap;
14778        #[allow(unused_imports)]
14779        use std::option::Option::Some;
14780        let mut state = serializer.serialize_map(std::option::Option::None)?;
14781        if !self.parent.is_empty() {
14782            state.serialize_entry("parent", &self.parent)?;
14783        }
14784        if !self.vpn_connection_id.is_empty() {
14785            state.serialize_entry("vpnConnectionId", &self.vpn_connection_id)?;
14786        }
14787        if self.vpn_connection.is_some() {
14788            state.serialize_entry("vpnConnection", &self.vpn_connection)?;
14789        }
14790        if !self.request_id.is_empty() {
14791            state.serialize_entry("requestId", &self.request_id)?;
14792        }
14793        if !self._unknown_fields.is_empty() {
14794            for (key, value) in self._unknown_fields.iter() {
14795                state.serialize_entry(key, &value)?;
14796            }
14797        }
14798        state.end()
14799    }
14800}
14801
14802/// Deletes a vpn connection.
14803#[derive(Clone, Debug, Default, PartialEq)]
14804#[non_exhaustive]
14805pub struct DeleteVpnConnectionRequest {
14806    /// Required. The resource name of the vpn connection.
14807    pub name: std::string::String,
14808
14809    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
14810    /// random UUID is recommended. This request is only idempotent if
14811    /// `request_id` is provided.
14812    pub request_id: std::string::String,
14813
14814    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14815}
14816
14817impl DeleteVpnConnectionRequest {
14818    pub fn new() -> Self {
14819        std::default::Default::default()
14820    }
14821
14822    /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
14823    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14824        self.name = v.into();
14825        self
14826    }
14827
14828    /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
14829    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14830        self.request_id = v.into();
14831        self
14832    }
14833}
14834
14835impl wkt::message::Message for DeleteVpnConnectionRequest {
14836    fn typename() -> &'static str {
14837        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest"
14838    }
14839}
14840
14841#[doc(hidden)]
14842impl<'de> serde::de::Deserialize<'de> for DeleteVpnConnectionRequest {
14843    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14844    where
14845        D: serde::Deserializer<'de>,
14846    {
14847        #[allow(non_camel_case_types)]
14848        #[doc(hidden)]
14849        #[derive(PartialEq, Eq, Hash)]
14850        enum __FieldTag {
14851            __name,
14852            __request_id,
14853            Unknown(std::string::String),
14854        }
14855        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14856            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14857            where
14858                D: serde::Deserializer<'de>,
14859            {
14860                struct Visitor;
14861                impl<'de> serde::de::Visitor<'de> for Visitor {
14862                    type Value = __FieldTag;
14863                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14864                        formatter.write_str("a field name for DeleteVpnConnectionRequest")
14865                    }
14866                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14867                    where
14868                        E: serde::de::Error,
14869                    {
14870                        use std::result::Result::Ok;
14871                        use std::string::ToString;
14872                        match value {
14873                            "name" => Ok(__FieldTag::__name),
14874                            "requestId" => Ok(__FieldTag::__request_id),
14875                            "request_id" => Ok(__FieldTag::__request_id),
14876                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14877                        }
14878                    }
14879                }
14880                deserializer.deserialize_identifier(Visitor)
14881            }
14882        }
14883        struct Visitor;
14884        impl<'de> serde::de::Visitor<'de> for Visitor {
14885            type Value = DeleteVpnConnectionRequest;
14886            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14887                formatter.write_str("struct DeleteVpnConnectionRequest")
14888            }
14889            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14890            where
14891                A: serde::de::MapAccess<'de>,
14892            {
14893                #[allow(unused_imports)]
14894                use serde::de::Error;
14895                use std::option::Option::Some;
14896                let mut fields = std::collections::HashSet::new();
14897                let mut result = Self::Value::new();
14898                while let Some(tag) = map.next_key::<__FieldTag>()? {
14899                    #[allow(clippy::match_single_binding)]
14900                    match tag {
14901                        __FieldTag::__name => {
14902                            if !fields.insert(__FieldTag::__name) {
14903                                return std::result::Result::Err(A::Error::duplicate_field(
14904                                    "multiple values for name",
14905                                ));
14906                            }
14907                            result.name = map
14908                                .next_value::<std::option::Option<std::string::String>>()?
14909                                .unwrap_or_default();
14910                        }
14911                        __FieldTag::__request_id => {
14912                            if !fields.insert(__FieldTag::__request_id) {
14913                                return std::result::Result::Err(A::Error::duplicate_field(
14914                                    "multiple values for request_id",
14915                                ));
14916                            }
14917                            result.request_id = map
14918                                .next_value::<std::option::Option<std::string::String>>()?
14919                                .unwrap_or_default();
14920                        }
14921                        __FieldTag::Unknown(key) => {
14922                            let value = map.next_value::<serde_json::Value>()?;
14923                            result._unknown_fields.insert(key, value);
14924                        }
14925                    }
14926                }
14927                std::result::Result::Ok(result)
14928            }
14929        }
14930        deserializer.deserialize_any(Visitor)
14931    }
14932}
14933
14934#[doc(hidden)]
14935impl serde::ser::Serialize for DeleteVpnConnectionRequest {
14936    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14937    where
14938        S: serde::ser::Serializer,
14939    {
14940        use serde::ser::SerializeMap;
14941        #[allow(unused_imports)]
14942        use std::option::Option::Some;
14943        let mut state = serializer.serialize_map(std::option::Option::None)?;
14944        if !self.name.is_empty() {
14945            state.serialize_entry("name", &self.name)?;
14946        }
14947        if !self.request_id.is_empty() {
14948            state.serialize_entry("requestId", &self.request_id)?;
14949        }
14950        if !self._unknown_fields.is_empty() {
14951            for (key, value) in self._unknown_fields.iter() {
14952                state.serialize_entry(key, &value)?;
14953            }
14954        }
14955        state.end()
14956    }
14957}
14958
14959/// Gets the server config.
14960#[derive(Clone, Debug, Default, PartialEq)]
14961#[non_exhaustive]
14962pub struct GetServerConfigRequest {
14963    /// Required. The name (project and location) of the server config to get,
14964    /// specified in the format `projects/*/locations/*`.
14965    pub name: std::string::String,
14966
14967    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14968}
14969
14970impl GetServerConfigRequest {
14971    pub fn new() -> Self {
14972        std::default::Default::default()
14973    }
14974
14975    /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
14976    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14977        self.name = v.into();
14978        self
14979    }
14980}
14981
14982impl wkt::message::Message for GetServerConfigRequest {
14983    fn typename() -> &'static str {
14984        "type.googleapis.com/google.cloud.edgecontainer.v1.GetServerConfigRequest"
14985    }
14986}
14987
14988#[doc(hidden)]
14989impl<'de> serde::de::Deserialize<'de> for GetServerConfigRequest {
14990    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14991    where
14992        D: serde::Deserializer<'de>,
14993    {
14994        #[allow(non_camel_case_types)]
14995        #[doc(hidden)]
14996        #[derive(PartialEq, Eq, Hash)]
14997        enum __FieldTag {
14998            __name,
14999            Unknown(std::string::String),
15000        }
15001        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15002            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15003            where
15004                D: serde::Deserializer<'de>,
15005            {
15006                struct Visitor;
15007                impl<'de> serde::de::Visitor<'de> for Visitor {
15008                    type Value = __FieldTag;
15009                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15010                        formatter.write_str("a field name for GetServerConfigRequest")
15011                    }
15012                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15013                    where
15014                        E: serde::de::Error,
15015                    {
15016                        use std::result::Result::Ok;
15017                        use std::string::ToString;
15018                        match value {
15019                            "name" => Ok(__FieldTag::__name),
15020                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15021                        }
15022                    }
15023                }
15024                deserializer.deserialize_identifier(Visitor)
15025            }
15026        }
15027        struct Visitor;
15028        impl<'de> serde::de::Visitor<'de> for Visitor {
15029            type Value = GetServerConfigRequest;
15030            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15031                formatter.write_str("struct GetServerConfigRequest")
15032            }
15033            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15034            where
15035                A: serde::de::MapAccess<'de>,
15036            {
15037                #[allow(unused_imports)]
15038                use serde::de::Error;
15039                use std::option::Option::Some;
15040                let mut fields = std::collections::HashSet::new();
15041                let mut result = Self::Value::new();
15042                while let Some(tag) = map.next_key::<__FieldTag>()? {
15043                    #[allow(clippy::match_single_binding)]
15044                    match tag {
15045                        __FieldTag::__name => {
15046                            if !fields.insert(__FieldTag::__name) {
15047                                return std::result::Result::Err(A::Error::duplicate_field(
15048                                    "multiple values for name",
15049                                ));
15050                            }
15051                            result.name = map
15052                                .next_value::<std::option::Option<std::string::String>>()?
15053                                .unwrap_or_default();
15054                        }
15055                        __FieldTag::Unknown(key) => {
15056                            let value = map.next_value::<serde_json::Value>()?;
15057                            result._unknown_fields.insert(key, value);
15058                        }
15059                    }
15060                }
15061                std::result::Result::Ok(result)
15062            }
15063        }
15064        deserializer.deserialize_any(Visitor)
15065    }
15066}
15067
15068#[doc(hidden)]
15069impl serde::ser::Serialize for GetServerConfigRequest {
15070    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15071    where
15072        S: serde::ser::Serializer,
15073    {
15074        use serde::ser::SerializeMap;
15075        #[allow(unused_imports)]
15076        use std::option::Option::Some;
15077        let mut state = serializer.serialize_map(std::option::Option::None)?;
15078        if !self.name.is_empty() {
15079            state.serialize_entry("name", &self.name)?;
15080        }
15081        if !self._unknown_fields.is_empty() {
15082            for (key, value) in self._unknown_fields.iter() {
15083                state.serialize_entry(key, &value)?;
15084            }
15085        }
15086        state.end()
15087    }
15088}
15089
15090/// Represents the accessibility state of a customer-managed KMS key used for
15091/// CMEK integration.
15092///
15093/// # Working with unknown values
15094///
15095/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15096/// additional enum variants at any time. Adding new variants is not considered
15097/// a breaking change. Applications should write their code in anticipation of:
15098///
15099/// - New values appearing in future releases of the client library, **and**
15100/// - New values received dynamically, without application changes.
15101///
15102/// Please consult the [Working with enums] section in the user guide for some
15103/// guidelines.
15104///
15105/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15106#[derive(Clone, Debug, PartialEq)]
15107#[non_exhaustive]
15108pub enum KmsKeyState {
15109    /// Unspecified.
15110    Unspecified,
15111    /// The key is available for use, and dependent resources should be accessible.
15112    KeyAvailable,
15113    /// The key is unavailable for an unspecified reason. Dependent resources may
15114    /// be inaccessible.
15115    KeyUnavailable,
15116    /// If set, the enum was initialized with an unknown value.
15117    ///
15118    /// Applications can examine the value using [KmsKeyState::value] or
15119    /// [KmsKeyState::name].
15120    UnknownValue(kms_key_state::UnknownValue),
15121}
15122
15123#[doc(hidden)]
15124pub mod kms_key_state {
15125    #[allow(unused_imports)]
15126    use super::*;
15127    #[derive(Clone, Debug, PartialEq)]
15128    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15129}
15130
15131impl KmsKeyState {
15132    /// Gets the enum value.
15133    ///
15134    /// Returns `None` if the enum contains an unknown value deserialized from
15135    /// the string representation of enums.
15136    pub fn value(&self) -> std::option::Option<i32> {
15137        match self {
15138            Self::Unspecified => std::option::Option::Some(0),
15139            Self::KeyAvailable => std::option::Option::Some(1),
15140            Self::KeyUnavailable => std::option::Option::Some(2),
15141            Self::UnknownValue(u) => u.0.value(),
15142        }
15143    }
15144
15145    /// Gets the enum value as a string.
15146    ///
15147    /// Returns `None` if the enum contains an unknown value deserialized from
15148    /// the integer representation of enums.
15149    pub fn name(&self) -> std::option::Option<&str> {
15150        match self {
15151            Self::Unspecified => std::option::Option::Some("KMS_KEY_STATE_UNSPECIFIED"),
15152            Self::KeyAvailable => std::option::Option::Some("KMS_KEY_STATE_KEY_AVAILABLE"),
15153            Self::KeyUnavailable => std::option::Option::Some("KMS_KEY_STATE_KEY_UNAVAILABLE"),
15154            Self::UnknownValue(u) => u.0.name(),
15155        }
15156    }
15157}
15158
15159impl std::default::Default for KmsKeyState {
15160    fn default() -> Self {
15161        use std::convert::From;
15162        Self::from(0)
15163    }
15164}
15165
15166impl std::fmt::Display for KmsKeyState {
15167    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15168        wkt::internal::display_enum(f, self.name(), self.value())
15169    }
15170}
15171
15172impl std::convert::From<i32> for KmsKeyState {
15173    fn from(value: i32) -> Self {
15174        match value {
15175            0 => Self::Unspecified,
15176            1 => Self::KeyAvailable,
15177            2 => Self::KeyUnavailable,
15178            _ => Self::UnknownValue(kms_key_state::UnknownValue(
15179                wkt::internal::UnknownEnumValue::Integer(value),
15180            )),
15181        }
15182    }
15183}
15184
15185impl std::convert::From<&str> for KmsKeyState {
15186    fn from(value: &str) -> Self {
15187        use std::string::ToString;
15188        match value {
15189            "KMS_KEY_STATE_UNSPECIFIED" => Self::Unspecified,
15190            "KMS_KEY_STATE_KEY_AVAILABLE" => Self::KeyAvailable,
15191            "KMS_KEY_STATE_KEY_UNAVAILABLE" => Self::KeyUnavailable,
15192            _ => Self::UnknownValue(kms_key_state::UnknownValue(
15193                wkt::internal::UnknownEnumValue::String(value.to_string()),
15194            )),
15195        }
15196    }
15197}
15198
15199impl serde::ser::Serialize for KmsKeyState {
15200    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15201    where
15202        S: serde::Serializer,
15203    {
15204        match self {
15205            Self::Unspecified => serializer.serialize_i32(0),
15206            Self::KeyAvailable => serializer.serialize_i32(1),
15207            Self::KeyUnavailable => serializer.serialize_i32(2),
15208            Self::UnknownValue(u) => u.0.serialize(serializer),
15209        }
15210    }
15211}
15212
15213impl<'de> serde::de::Deserialize<'de> for KmsKeyState {
15214    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15215    where
15216        D: serde::Deserializer<'de>,
15217    {
15218        deserializer.deserialize_any(wkt::internal::EnumVisitor::<KmsKeyState>::new(
15219            ".google.cloud.edgecontainer.v1.KmsKeyState",
15220        ))
15221    }
15222}
15223
15224/// Represents if the resource is in lock down state or pending.
15225///
15226/// # Working with unknown values
15227///
15228/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15229/// additional enum variants at any time. Adding new variants is not considered
15230/// a breaking change. Applications should write their code in anticipation of:
15231///
15232/// - New values appearing in future releases of the client library, **and**
15233/// - New values received dynamically, without application changes.
15234///
15235/// Please consult the [Working with enums] section in the user guide for some
15236/// guidelines.
15237///
15238/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15239#[derive(Clone, Debug, PartialEq)]
15240#[non_exhaustive]
15241pub enum ResourceState {
15242    /// Default value.
15243    Unspecified,
15244    /// The resource is in LOCK DOWN state.
15245    LockDown,
15246    /// The resource is pending lock down.
15247    LockDownPending,
15248    /// If set, the enum was initialized with an unknown value.
15249    ///
15250    /// Applications can examine the value using [ResourceState::value] or
15251    /// [ResourceState::name].
15252    UnknownValue(resource_state::UnknownValue),
15253}
15254
15255#[doc(hidden)]
15256pub mod resource_state {
15257    #[allow(unused_imports)]
15258    use super::*;
15259    #[derive(Clone, Debug, PartialEq)]
15260    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15261}
15262
15263impl ResourceState {
15264    /// Gets the enum value.
15265    ///
15266    /// Returns `None` if the enum contains an unknown value deserialized from
15267    /// the string representation of enums.
15268    pub fn value(&self) -> std::option::Option<i32> {
15269        match self {
15270            Self::Unspecified => std::option::Option::Some(0),
15271            Self::LockDown => std::option::Option::Some(1),
15272            Self::LockDownPending => std::option::Option::Some(2),
15273            Self::UnknownValue(u) => u.0.value(),
15274        }
15275    }
15276
15277    /// Gets the enum value as a string.
15278    ///
15279    /// Returns `None` if the enum contains an unknown value deserialized from
15280    /// the integer representation of enums.
15281    pub fn name(&self) -> std::option::Option<&str> {
15282        match self {
15283            Self::Unspecified => std::option::Option::Some("RESOURCE_STATE_UNSPECIFIED"),
15284            Self::LockDown => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN"),
15285            Self::LockDownPending => std::option::Option::Some("RESOURCE_STATE_LOCK_DOWN_PENDING"),
15286            Self::UnknownValue(u) => u.0.name(),
15287        }
15288    }
15289}
15290
15291impl std::default::Default for ResourceState {
15292    fn default() -> Self {
15293        use std::convert::From;
15294        Self::from(0)
15295    }
15296}
15297
15298impl std::fmt::Display for ResourceState {
15299    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15300        wkt::internal::display_enum(f, self.name(), self.value())
15301    }
15302}
15303
15304impl std::convert::From<i32> for ResourceState {
15305    fn from(value: i32) -> Self {
15306        match value {
15307            0 => Self::Unspecified,
15308            1 => Self::LockDown,
15309            2 => Self::LockDownPending,
15310            _ => Self::UnknownValue(resource_state::UnknownValue(
15311                wkt::internal::UnknownEnumValue::Integer(value),
15312            )),
15313        }
15314    }
15315}
15316
15317impl std::convert::From<&str> for ResourceState {
15318    fn from(value: &str) -> Self {
15319        use std::string::ToString;
15320        match value {
15321            "RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
15322            "RESOURCE_STATE_LOCK_DOWN" => Self::LockDown,
15323            "RESOURCE_STATE_LOCK_DOWN_PENDING" => Self::LockDownPending,
15324            _ => Self::UnknownValue(resource_state::UnknownValue(
15325                wkt::internal::UnknownEnumValue::String(value.to_string()),
15326            )),
15327        }
15328    }
15329}
15330
15331impl serde::ser::Serialize for ResourceState {
15332    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15333    where
15334        S: serde::Serializer,
15335    {
15336        match self {
15337            Self::Unspecified => serializer.serialize_i32(0),
15338            Self::LockDown => serializer.serialize_i32(1),
15339            Self::LockDownPending => serializer.serialize_i32(2),
15340            Self::UnknownValue(u) => u.0.serialize(serializer),
15341        }
15342    }
15343}
15344
15345impl<'de> serde::de::Deserialize<'de> for ResourceState {
15346    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15347    where
15348        D: serde::Deserializer<'de>,
15349    {
15350        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceState>::new(
15351            ".google.cloud.edgecontainer.v1.ResourceState",
15352        ))
15353    }
15354}