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 lazy_static;
24extern crate location;
25extern crate longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// A Google Distributed Cloud Edge Kubernetes cluster.
37#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct Cluster {
42    /// Required. The resource name of the cluster.
43    #[serde(skip_serializing_if = "std::string::String::is_empty")]
44    pub name: std::string::String,
45
46    /// Output only. The time when the cluster was created.
47    #[serde(skip_serializing_if = "std::option::Option::is_none")]
48    pub create_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. The time when the cluster was last updated.
51    #[serde(skip_serializing_if = "std::option::Option::is_none")]
52    pub update_time: std::option::Option<wkt::Timestamp>,
53
54    /// Labels associated with this resource.
55    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
56    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58    /// Required. Fleet configuration.
59    #[serde(skip_serializing_if = "std::option::Option::is_none")]
60    pub fleet: std::option::Option<crate::model::Fleet>,
61
62    /// Required. Cluster-wide networking configuration.
63    #[serde(skip_serializing_if = "std::option::Option::is_none")]
64    pub networking: std::option::Option<crate::model::ClusterNetworking>,
65
66    /// Required. Immutable. RBAC policy that will be applied and managed by GEC.
67    #[serde(skip_serializing_if = "std::option::Option::is_none")]
68    pub authorization: std::option::Option<crate::model::Authorization>,
69
70    /// Optional. The default maximum number of pods per node used if a maximum
71    /// value is not specified explicitly for a node pool in this cluster. If
72    /// unspecified, the Kubernetes default value will be used.
73    pub default_max_pods_per_node: i32,
74
75    /// Output only. The IP address of the Kubernetes API server.
76    #[serde(skip_serializing_if = "std::string::String::is_empty")]
77    pub endpoint: std::string::String,
78
79    /// Output only. The port number of the Kubernetes API server.
80    pub port: i32,
81
82    /// Output only. The PEM-encoded public certificate of the cluster's CA.
83    #[serde(skip_serializing_if = "std::string::String::is_empty")]
84    pub cluster_ca_certificate: std::string::String,
85
86    /// Optional. Cluster-wide maintenance policy configuration.
87    #[serde(skip_serializing_if = "std::option::Option::is_none")]
88    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
89
90    /// Output only. The control plane release version
91    #[serde(skip_serializing_if = "std::string::String::is_empty")]
92    pub control_plane_version: std::string::String,
93
94    /// Output only. The lowest release version among all worker nodes. This field
95    /// can be empty if the cluster does not have any worker nodes.
96    #[serde(skip_serializing_if = "std::string::String::is_empty")]
97    pub node_version: std::string::String,
98
99    /// Optional. The configuration of the cluster control plane.
100    #[serde(skip_serializing_if = "std::option::Option::is_none")]
101    pub control_plane: std::option::Option<crate::model::cluster::ControlPlane>,
102
103    /// Optional. The configuration of the system add-ons.
104    #[serde(skip_serializing_if = "std::option::Option::is_none")]
105    pub system_addons_config: std::option::Option<crate::model::cluster::SystemAddonsConfig>,
106
107    /// Optional. IPv4 address pools for cluster data plane external load
108    /// balancing.
109    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
110    pub external_load_balancer_ipv4_address_pools: std::vec::Vec<std::string::String>,
111
112    /// Optional. Remote control plane disk encryption options. This field is only
113    /// used when enabling CMEK support.
114    #[serde(skip_serializing_if = "std::option::Option::is_none")]
115    pub control_plane_encryption:
116        std::option::Option<crate::model::cluster::ControlPlaneEncryption>,
117
118    /// Output only. The current status of the cluster.
119    pub status: crate::model::cluster::Status,
120
121    /// Output only. All the maintenance events scheduled for the cluster,
122    /// including the ones ongoing, planned for the future and done in the past (up
123    /// to 90 days).
124    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
125    pub maintenance_events: std::vec::Vec<crate::model::cluster::MaintenanceEvent>,
126
127    /// Optional. The target cluster version. For example: "1.5.0".
128    #[serde(skip_serializing_if = "std::string::String::is_empty")]
129    pub target_version: std::string::String,
130
131    /// Optional. The release channel a cluster is subscribed to.
132    pub release_channel: crate::model::cluster::ReleaseChannel,
133
134    /// Optional. Configuration of the cluster survivability, e.g., for the case
135    /// when network connectivity is lost. Note: This only applies to local control
136    /// plane clusters.
137    #[serde(skip_serializing_if = "std::option::Option::is_none")]
138    pub survivability_config: std::option::Option<crate::model::cluster::SurvivabilityConfig>,
139
140    /// Optional. IPv6 address pools for cluster data plane external load
141    /// balancing.
142    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
143    pub external_load_balancer_ipv6_address_pools: std::vec::Vec<std::string::String>,
144
145    /// Output only. The current connection state of the cluster.
146    #[serde(skip_serializing_if = "std::option::Option::is_none")]
147    pub connection_state: std::option::Option<crate::model::cluster::ConnectionState>,
148}
149
150impl Cluster {
151    pub fn new() -> Self {
152        std::default::Default::default()
153    }
154
155    /// Sets the value of [name][crate::model::Cluster::name].
156    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157        self.name = v.into();
158        self
159    }
160
161    /// Sets the value of [create_time][crate::model::Cluster::create_time].
162    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
163        mut self,
164        v: T,
165    ) -> Self {
166        self.create_time = v.into();
167        self
168    }
169
170    /// Sets the value of [update_time][crate::model::Cluster::update_time].
171    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
172        mut self,
173        v: T,
174    ) -> Self {
175        self.update_time = v.into();
176        self
177    }
178
179    /// Sets the value of [fleet][crate::model::Cluster::fleet].
180    pub fn set_fleet<T: std::convert::Into<std::option::Option<crate::model::Fleet>>>(
181        mut self,
182        v: T,
183    ) -> Self {
184        self.fleet = v.into();
185        self
186    }
187
188    /// Sets the value of [networking][crate::model::Cluster::networking].
189    pub fn set_networking<
190        T: std::convert::Into<std::option::Option<crate::model::ClusterNetworking>>,
191    >(
192        mut self,
193        v: T,
194    ) -> Self {
195        self.networking = v.into();
196        self
197    }
198
199    /// Sets the value of [authorization][crate::model::Cluster::authorization].
200    pub fn set_authorization<
201        T: std::convert::Into<std::option::Option<crate::model::Authorization>>,
202    >(
203        mut self,
204        v: T,
205    ) -> Self {
206        self.authorization = v.into();
207        self
208    }
209
210    /// Sets the value of [default_max_pods_per_node][crate::model::Cluster::default_max_pods_per_node].
211    pub fn set_default_max_pods_per_node<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
212        self.default_max_pods_per_node = v.into();
213        self
214    }
215
216    /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
217    pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
218        self.endpoint = v.into();
219        self
220    }
221
222    /// Sets the value of [port][crate::model::Cluster::port].
223    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
224        self.port = v.into();
225        self
226    }
227
228    /// Sets the value of [cluster_ca_certificate][crate::model::Cluster::cluster_ca_certificate].
229    pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
230        mut self,
231        v: T,
232    ) -> Self {
233        self.cluster_ca_certificate = v.into();
234        self
235    }
236
237    /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
238    pub fn set_maintenance_policy<
239        T: std::convert::Into<std::option::Option<crate::model::MaintenancePolicy>>,
240    >(
241        mut self,
242        v: T,
243    ) -> Self {
244        self.maintenance_policy = v.into();
245        self
246    }
247
248    /// Sets the value of [control_plane_version][crate::model::Cluster::control_plane_version].
249    pub fn set_control_plane_version<T: std::convert::Into<std::string::String>>(
250        mut self,
251        v: T,
252    ) -> Self {
253        self.control_plane_version = v.into();
254        self
255    }
256
257    /// Sets the value of [node_version][crate::model::Cluster::node_version].
258    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
259        self.node_version = v.into();
260        self
261    }
262
263    /// Sets the value of [control_plane][crate::model::Cluster::control_plane].
264    pub fn set_control_plane<
265        T: std::convert::Into<std::option::Option<crate::model::cluster::ControlPlane>>,
266    >(
267        mut self,
268        v: T,
269    ) -> Self {
270        self.control_plane = v.into();
271        self
272    }
273
274    /// Sets the value of [system_addons_config][crate::model::Cluster::system_addons_config].
275    pub fn set_system_addons_config<
276        T: std::convert::Into<std::option::Option<crate::model::cluster::SystemAddonsConfig>>,
277    >(
278        mut self,
279        v: T,
280    ) -> Self {
281        self.system_addons_config = v.into();
282        self
283    }
284
285    /// Sets the value of [control_plane_encryption][crate::model::Cluster::control_plane_encryption].
286    pub fn set_control_plane_encryption<
287        T: std::convert::Into<std::option::Option<crate::model::cluster::ControlPlaneEncryption>>,
288    >(
289        mut self,
290        v: T,
291    ) -> Self {
292        self.control_plane_encryption = v.into();
293        self
294    }
295
296    /// Sets the value of [status][crate::model::Cluster::status].
297    pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
298        mut self,
299        v: T,
300    ) -> Self {
301        self.status = v.into();
302        self
303    }
304
305    /// Sets the value of [target_version][crate::model::Cluster::target_version].
306    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
307        self.target_version = v.into();
308        self
309    }
310
311    /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
312    pub fn set_release_channel<T: std::convert::Into<crate::model::cluster::ReleaseChannel>>(
313        mut self,
314        v: T,
315    ) -> Self {
316        self.release_channel = v.into();
317        self
318    }
319
320    /// Sets the value of [survivability_config][crate::model::Cluster::survivability_config].
321    pub fn set_survivability_config<
322        T: std::convert::Into<std::option::Option<crate::model::cluster::SurvivabilityConfig>>,
323    >(
324        mut self,
325        v: T,
326    ) -> Self {
327        self.survivability_config = v.into();
328        self
329    }
330
331    /// Sets the value of [connection_state][crate::model::Cluster::connection_state].
332    pub fn set_connection_state<
333        T: std::convert::Into<std::option::Option<crate::model::cluster::ConnectionState>>,
334    >(
335        mut self,
336        v: T,
337    ) -> Self {
338        self.connection_state = v.into();
339        self
340    }
341
342    /// Sets the value of [external_load_balancer_ipv4_address_pools][crate::model::Cluster::external_load_balancer_ipv4_address_pools].
343    pub fn set_external_load_balancer_ipv4_address_pools<T, V>(mut self, v: T) -> Self
344    where
345        T: std::iter::IntoIterator<Item = V>,
346        V: std::convert::Into<std::string::String>,
347    {
348        use std::iter::Iterator;
349        self.external_load_balancer_ipv4_address_pools = v.into_iter().map(|i| i.into()).collect();
350        self
351    }
352
353    /// Sets the value of [maintenance_events][crate::model::Cluster::maintenance_events].
354    pub fn set_maintenance_events<T, V>(mut self, v: T) -> Self
355    where
356        T: std::iter::IntoIterator<Item = V>,
357        V: std::convert::Into<crate::model::cluster::MaintenanceEvent>,
358    {
359        use std::iter::Iterator;
360        self.maintenance_events = v.into_iter().map(|i| i.into()).collect();
361        self
362    }
363
364    /// Sets the value of [external_load_balancer_ipv6_address_pools][crate::model::Cluster::external_load_balancer_ipv6_address_pools].
365    pub fn set_external_load_balancer_ipv6_address_pools<T, V>(mut self, v: T) -> Self
366    where
367        T: std::iter::IntoIterator<Item = V>,
368        V: std::convert::Into<std::string::String>,
369    {
370        use std::iter::Iterator;
371        self.external_load_balancer_ipv6_address_pools = v.into_iter().map(|i| i.into()).collect();
372        self
373    }
374
375    /// Sets the value of [labels][crate::model::Cluster::labels].
376    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
377    where
378        T: std::iter::IntoIterator<Item = (K, V)>,
379        K: std::convert::Into<std::string::String>,
380        V: std::convert::Into<std::string::String>,
381    {
382        use std::iter::Iterator;
383        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
384        self
385    }
386}
387
388impl wkt::message::Message for Cluster {
389    fn typename() -> &'static str {
390        "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster"
391    }
392}
393
394/// Defines additional types related to Cluster
395pub mod cluster {
396    #[allow(unused_imports)]
397    use super::*;
398
399    /// Configuration of the cluster control plane.
400    #[serde_with::serde_as]
401    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
402    #[serde(default, rename_all = "camelCase")]
403    #[non_exhaustive]
404    pub struct ControlPlane {
405        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
406        pub config: std::option::Option<crate::model::cluster::control_plane::Config>,
407    }
408
409    impl ControlPlane {
410        pub fn new() -> Self {
411            std::default::Default::default()
412        }
413
414        /// Sets the value of `config`.
415        pub fn set_config<
416            T: std::convert::Into<std::option::Option<crate::model::cluster::control_plane::Config>>,
417        >(
418            mut self,
419            v: T,
420        ) -> Self {
421            self.config = v.into();
422            self
423        }
424
425        /// The value of [config][crate::model::cluster::ControlPlane::config]
426        /// if it holds a `Remote`, `None` if the field is not set or
427        /// holds a different branch.
428        pub fn get_remote(
429            &self,
430        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Remote>>
431        {
432            #[allow(unreachable_patterns)]
433            self.config.as_ref().and_then(|v| match v {
434                crate::model::cluster::control_plane::Config::Remote(v) => {
435                    std::option::Option::Some(v)
436                }
437                _ => std::option::Option::None,
438            })
439        }
440
441        /// The value of [config][crate::model::cluster::ControlPlane::config]
442        /// if it holds a `Local`, `None` if the field is not set or
443        /// holds a different branch.
444        pub fn get_local(
445            &self,
446        ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::control_plane::Local>>
447        {
448            #[allow(unreachable_patterns)]
449            self.config.as_ref().and_then(|v| match v {
450                crate::model::cluster::control_plane::Config::Local(v) => {
451                    std::option::Option::Some(v)
452                }
453                _ => std::option::Option::None,
454            })
455        }
456
457        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
458        /// to hold a `Remote`.
459        ///
460        /// Note that all the setters affecting `config` are
461        /// mutually exclusive.
462        pub fn set_remote<
463            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Remote>>,
464        >(
465            mut self,
466            v: T,
467        ) -> Self {
468            self.config = std::option::Option::Some(
469                crate::model::cluster::control_plane::Config::Remote(v.into()),
470            );
471            self
472        }
473
474        /// Sets the value of [config][crate::model::cluster::ControlPlane::config]
475        /// to hold a `Local`.
476        ///
477        /// Note that all the setters affecting `config` are
478        /// mutually exclusive.
479        pub fn set_local<
480            T: std::convert::Into<std::boxed::Box<crate::model::cluster::control_plane::Local>>,
481        >(
482            mut self,
483            v: T,
484        ) -> Self {
485            self.config = std::option::Option::Some(
486                crate::model::cluster::control_plane::Config::Local(v.into()),
487            );
488            self
489        }
490    }
491
492    impl wkt::message::Message for ControlPlane {
493        fn typename() -> &'static str {
494            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane"
495        }
496    }
497
498    /// Defines additional types related to ControlPlane
499    pub mod control_plane {
500        #[allow(unused_imports)]
501        use super::*;
502
503        /// Configuration specific to clusters with a control plane hosted remotely.
504        #[serde_with::serde_as]
505        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
506        #[serde(default, rename_all = "camelCase")]
507        #[non_exhaustive]
508        pub struct Remote {}
509
510        impl Remote {
511            pub fn new() -> Self {
512                std::default::Default::default()
513            }
514        }
515
516        impl wkt::message::Message for Remote {
517            fn typename() -> &'static str {
518                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Remote"
519            }
520        }
521
522        /// Configuration specific to clusters with a control plane hosted locally.
523        ///
524        /// Warning: Local control plane clusters must be created in their own
525        /// project. Local control plane clusters cannot coexist in the same
526        /// project with any other type of clusters, including non-GDCE clusters.
527        /// Mixing local control plane GDCE clusters with any other type of
528        /// clusters in the same project can result in data loss.
529        #[serde_with::serde_as]
530        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
531        #[serde(default, rename_all = "camelCase")]
532        #[non_exhaustive]
533        pub struct Local {
534            /// Name of the Google Distributed Cloud Edge zones where this node pool
535            /// will be created. For example: `us-central1-edge-customer-a`.
536            #[serde(skip_serializing_if = "std::string::String::is_empty")]
537            pub node_location: std::string::String,
538
539            /// The number of nodes to serve as replicas of the Control Plane.
540            pub node_count: i32,
541
542            /// Only machines matching this filter will be allowed to host control
543            /// plane nodes. The filtering language accepts strings like "name=\<name\>",
544            /// and is documented here: [AIP-160](https://google.aip.dev/160).
545            #[serde(skip_serializing_if = "std::string::String::is_empty")]
546            pub machine_filter: std::string::String,
547
548            /// Policy configuration about how user applications are deployed.
549            pub shared_deployment_policy:
550                crate::model::cluster::control_plane::SharedDeploymentPolicy,
551
552            /// Optional. Name for the storage schema of control plane nodes.
553            ///
554            /// Warning: Configurable node local storage schema feature is an
555            /// experimental feature, and is not recommended for general use
556            /// in production clusters/nodepools.
557            #[serde(skip_serializing_if = "std::string::String::is_empty")]
558            pub control_plane_node_storage_schema: std::string::String,
559        }
560
561        impl Local {
562            pub fn new() -> Self {
563                std::default::Default::default()
564            }
565
566            /// Sets the value of [node_location][crate::model::cluster::control_plane::Local::node_location].
567            pub fn set_node_location<T: std::convert::Into<std::string::String>>(
568                mut self,
569                v: T,
570            ) -> Self {
571                self.node_location = v.into();
572                self
573            }
574
575            /// Sets the value of [node_count][crate::model::cluster::control_plane::Local::node_count].
576            pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
577                self.node_count = v.into();
578                self
579            }
580
581            /// Sets the value of [machine_filter][crate::model::cluster::control_plane::Local::machine_filter].
582            pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(
583                mut self,
584                v: T,
585            ) -> Self {
586                self.machine_filter = v.into();
587                self
588            }
589
590            /// Sets the value of [shared_deployment_policy][crate::model::cluster::control_plane::Local::shared_deployment_policy].
591            pub fn set_shared_deployment_policy<
592                T: std::convert::Into<crate::model::cluster::control_plane::SharedDeploymentPolicy>,
593            >(
594                mut self,
595                v: T,
596            ) -> Self {
597                self.shared_deployment_policy = v.into();
598                self
599            }
600
601            /// Sets the value of [control_plane_node_storage_schema][crate::model::cluster::control_plane::Local::control_plane_node_storage_schema].
602            pub fn set_control_plane_node_storage_schema<
603                T: std::convert::Into<std::string::String>,
604            >(
605                mut self,
606                v: T,
607            ) -> Self {
608                self.control_plane_node_storage_schema = v.into();
609                self
610            }
611        }
612
613        impl wkt::message::Message for Local {
614            fn typename() -> &'static str {
615                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlane.Local"
616            }
617        }
618
619        /// Represents the policy configuration about how user applications are
620        /// deployed.
621        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
622        pub struct SharedDeploymentPolicy(std::borrow::Cow<'static, str>);
623
624        impl SharedDeploymentPolicy {
625            /// Creates a new SharedDeploymentPolicy instance.
626            pub const fn new(v: &'static str) -> Self {
627                Self(std::borrow::Cow::Borrowed(v))
628            }
629
630            /// Gets the enum value.
631            pub fn value(&self) -> &str {
632                &self.0
633            }
634        }
635
636        /// Useful constants to work with [SharedDeploymentPolicy](SharedDeploymentPolicy)
637        pub mod shared_deployment_policy {
638            use super::SharedDeploymentPolicy;
639
640            /// Unspecified.
641            pub const SHARED_DEPLOYMENT_POLICY_UNSPECIFIED: SharedDeploymentPolicy =
642                SharedDeploymentPolicy::new("SHARED_DEPLOYMENT_POLICY_UNSPECIFIED");
643
644            /// User applications can be deployed both on control plane and worker
645            /// nodes.
646            pub const ALLOWED: SharedDeploymentPolicy = SharedDeploymentPolicy::new("ALLOWED");
647
648            /// User applications can not be deployed on control plane nodes and can
649            /// only be deployed on worker nodes.
650            pub const DISALLOWED: SharedDeploymentPolicy =
651                SharedDeploymentPolicy::new("DISALLOWED");
652        }
653
654        impl std::convert::From<std::string::String> for SharedDeploymentPolicy {
655            fn from(value: std::string::String) -> Self {
656                Self(std::borrow::Cow::Owned(value))
657            }
658        }
659
660        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
661        #[serde(rename_all = "camelCase")]
662        #[non_exhaustive]
663        pub enum Config {
664            /// Remote control plane configuration.
665            Remote(std::boxed::Box<crate::model::cluster::control_plane::Remote>),
666            /// Local control plane configuration.
667            ///
668            /// Warning: Local control plane clusters must be created in their own
669            /// project. Local control plane clusters cannot coexist in the same
670            /// project with any other type of clusters, including non-GDCE clusters.
671            /// Mixing local control plane GDCE clusters with any other type of
672            /// clusters in the same project can result in data loss.
673            Local(std::boxed::Box<crate::model::cluster::control_plane::Local>),
674        }
675    }
676
677    /// Config that customers are allowed to define for GDCE system add-ons.
678    #[serde_with::serde_as]
679    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
680    #[serde(default, rename_all = "camelCase")]
681    #[non_exhaustive]
682    pub struct SystemAddonsConfig {
683        /// Optional. Config for Ingress.
684        #[serde(skip_serializing_if = "std::option::Option::is_none")]
685        pub ingress: std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
686
687        /// Optional. Config for VM Service.
688        #[serde(skip_serializing_if = "std::option::Option::is_none")]
689        pub vm_service_config:
690            std::option::Option<crate::model::cluster::system_addons_config::VMServiceConfig>,
691    }
692
693    impl SystemAddonsConfig {
694        pub fn new() -> Self {
695            std::default::Default::default()
696        }
697
698        /// Sets the value of [ingress][crate::model::cluster::SystemAddonsConfig::ingress].
699        pub fn set_ingress<
700            T: std::convert::Into<
701                std::option::Option<crate::model::cluster::system_addons_config::Ingress>,
702            >,
703        >(
704            mut self,
705            v: T,
706        ) -> Self {
707            self.ingress = v.into();
708            self
709        }
710
711        /// Sets the value of [vm_service_config][crate::model::cluster::SystemAddonsConfig::vm_service_config].
712        pub fn set_vm_service_config<
713            T: std::convert::Into<
714                std::option::Option<crate::model::cluster::system_addons_config::VMServiceConfig>,
715            >,
716        >(
717            mut self,
718            v: T,
719        ) -> Self {
720            self.vm_service_config = v.into();
721            self
722        }
723    }
724
725    impl wkt::message::Message for SystemAddonsConfig {
726        fn typename() -> &'static str {
727            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig"
728        }
729    }
730
731    /// Defines additional types related to SystemAddonsConfig
732    pub mod system_addons_config {
733        #[allow(unused_imports)]
734        use super::*;
735
736        /// Config for the Ingress add-on which allows customers to create an Ingress
737        /// object to manage external access to the servers in a cluster. The add-on
738        /// consists of istiod and istio-ingress.
739        #[serde_with::serde_as]
740        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
741        #[serde(default, rename_all = "camelCase")]
742        #[non_exhaustive]
743        pub struct Ingress {
744            /// Optional. Whether Ingress is disabled.
745            pub disabled: bool,
746
747            /// Optional. Ingress VIP.
748            #[serde(skip_serializing_if = "std::string::String::is_empty")]
749            pub ipv4_vip: std::string::String,
750        }
751
752        impl Ingress {
753            pub fn new() -> Self {
754                std::default::Default::default()
755            }
756
757            /// Sets the value of [disabled][crate::model::cluster::system_addons_config::Ingress::disabled].
758            pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
759                self.disabled = v.into();
760                self
761            }
762
763            /// Sets the value of [ipv4_vip][crate::model::cluster::system_addons_config::Ingress::ipv4_vip].
764            pub fn set_ipv4_vip<T: std::convert::Into<std::string::String>>(
765                mut self,
766                v: T,
767            ) -> Self {
768                self.ipv4_vip = v.into();
769                self
770            }
771        }
772
773        impl wkt::message::Message for Ingress {
774            fn typename() -> &'static str {
775                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.Ingress"
776            }
777        }
778
779        /// VMServiceConfig defines the configuration for GDCE VM Service.
780        #[serde_with::serde_as]
781        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
782        #[serde(default, rename_all = "camelCase")]
783        #[non_exhaustive]
784        pub struct VMServiceConfig {
785            /// Optional. Whether VMM is enabled.
786            pub vmm_enabled: bool,
787        }
788
789        impl VMServiceConfig {
790            pub fn new() -> Self {
791                std::default::Default::default()
792            }
793
794            /// Sets the value of [vmm_enabled][crate::model::cluster::system_addons_config::VMServiceConfig::vmm_enabled].
795            pub fn set_vmm_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
796                self.vmm_enabled = v.into();
797                self
798            }
799        }
800
801        impl wkt::message::Message for VMServiceConfig {
802            fn typename() -> &'static str {
803                "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SystemAddonsConfig.VMServiceConfig"
804            }
805        }
806    }
807
808    /// Configuration for Customer-managed KMS key support for control plane nodes.
809    #[serde_with::serde_as]
810    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
811    #[serde(default, rename_all = "camelCase")]
812    #[non_exhaustive]
813    pub struct ControlPlaneEncryption {
814        /// Optional. The Cloud KMS CryptoKey e.g.
815        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
816        /// to use for protecting control plane disks. If not specified, a
817        /// Google-managed key will be used instead.
818        #[serde(skip_serializing_if = "std::string::String::is_empty")]
819        pub kms_key: std::string::String,
820
821        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
822        /// protecting control plane disks. Only applicable if kms_key is set.
823        #[serde(skip_serializing_if = "std::string::String::is_empty")]
824        pub kms_key_active_version: std::string::String,
825
826        /// Output only. Availability of the Cloud KMS CryptoKey. If not
827        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
828        /// local data. This can be caused by a lack of permissions to use the key,
829        /// or if the key is disabled or deleted.
830        pub kms_key_state: crate::model::KmsKeyState,
831
832        /// Output only. Error status returned by Cloud KMS when using this key. This
833        /// field may be populated only if `kms_key_state` is not
834        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
835        /// error status reported by Cloud KMS.
836        #[serde(skip_serializing_if = "std::option::Option::is_none")]
837        pub kms_status: std::option::Option<rpc::model::Status>,
838
839        /// Output only. The current resource state associated with the cmek.
840        pub resource_state: crate::model::ResourceState,
841    }
842
843    impl ControlPlaneEncryption {
844        pub fn new() -> Self {
845            std::default::Default::default()
846        }
847
848        /// Sets the value of [kms_key][crate::model::cluster::ControlPlaneEncryption::kms_key].
849        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
850            self.kms_key = v.into();
851            self
852        }
853
854        /// Sets the value of [kms_key_active_version][crate::model::cluster::ControlPlaneEncryption::kms_key_active_version].
855        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
856            mut self,
857            v: T,
858        ) -> Self {
859            self.kms_key_active_version = v.into();
860            self
861        }
862
863        /// Sets the value of [kms_key_state][crate::model::cluster::ControlPlaneEncryption::kms_key_state].
864        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
865            mut self,
866            v: T,
867        ) -> Self {
868            self.kms_key_state = v.into();
869            self
870        }
871
872        /// Sets the value of [kms_status][crate::model::cluster::ControlPlaneEncryption::kms_status].
873        pub fn set_kms_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
874            mut self,
875            v: T,
876        ) -> Self {
877            self.kms_status = v.into();
878            self
879        }
880
881        /// Sets the value of [resource_state][crate::model::cluster::ControlPlaneEncryption::resource_state].
882        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
883            mut self,
884            v: T,
885        ) -> Self {
886            self.resource_state = v.into();
887            self
888        }
889    }
890
891    impl wkt::message::Message for ControlPlaneEncryption {
892        fn typename() -> &'static str {
893            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ControlPlaneEncryption"
894        }
895    }
896
897    /// A Maintenance Event is an operation that could cause temporary disruptions
898    /// to the cluster workloads, including Google-driven or user-initiated cluster
899    /// upgrades, user-initiated cluster configuration changes that require
900    /// restarting nodes, etc.
901    #[serde_with::serde_as]
902    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
903    #[serde(default, rename_all = "camelCase")]
904    #[non_exhaustive]
905    pub struct MaintenanceEvent {
906        /// Output only. UUID of the maintenance event.
907        #[serde(skip_serializing_if = "std::string::String::is_empty")]
908        pub uuid: std::string::String,
909
910        /// Output only. The target version of the cluster.
911        #[serde(skip_serializing_if = "std::string::String::is_empty")]
912        pub target_version: std::string::String,
913
914        /// Output only. The operation for running the maintenance event. Specified
915        /// in the format projects/*/locations/*/operations/*. If the maintenance
916        /// event is split into multiple operations (e.g. due to maintenance
917        /// windows), the latest one is recorded.
918        #[serde(skip_serializing_if = "std::string::String::is_empty")]
919        pub operation: std::string::String,
920
921        /// Output only. The type of the maintenance event.
922        #[serde(rename = "type")]
923        pub r#type: crate::model::cluster::maintenance_event::Type,
924
925        /// Output only. The schedule of the maintenance event.
926        pub schedule: crate::model::cluster::maintenance_event::Schedule,
927
928        /// Output only. The state of the maintenance event.
929        pub state: crate::model::cluster::maintenance_event::State,
930
931        /// Output only. The time when the maintenance event request was created.
932        #[serde(skip_serializing_if = "std::option::Option::is_none")]
933        pub create_time: std::option::Option<wkt::Timestamp>,
934
935        /// Output only. The time when the maintenance event started.
936        #[serde(skip_serializing_if = "std::option::Option::is_none")]
937        pub start_time: std::option::Option<wkt::Timestamp>,
938
939        /// Output only. The time when the maintenance event ended, either
940        /// successfully or not. If the maintenance event is split into multiple
941        /// maintenance windows, end_time is only updated when the whole flow ends.
942        #[serde(skip_serializing_if = "std::option::Option::is_none")]
943        pub end_time: std::option::Option<wkt::Timestamp>,
944
945        /// Output only. The time when the maintenance event message was updated.
946        #[serde(skip_serializing_if = "std::option::Option::is_none")]
947        pub update_time: std::option::Option<wkt::Timestamp>,
948    }
949
950    impl MaintenanceEvent {
951        pub fn new() -> Self {
952            std::default::Default::default()
953        }
954
955        /// Sets the value of [uuid][crate::model::cluster::MaintenanceEvent::uuid].
956        pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
957            self.uuid = v.into();
958            self
959        }
960
961        /// Sets the value of [target_version][crate::model::cluster::MaintenanceEvent::target_version].
962        pub fn set_target_version<T: std::convert::Into<std::string::String>>(
963            mut self,
964            v: T,
965        ) -> Self {
966            self.target_version = v.into();
967            self
968        }
969
970        /// Sets the value of [operation][crate::model::cluster::MaintenanceEvent::operation].
971        pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
972            self.operation = v.into();
973            self
974        }
975
976        /// Sets the value of [r#type][crate::model::cluster::MaintenanceEvent::type].
977        pub fn set_type<T: std::convert::Into<crate::model::cluster::maintenance_event::Type>>(
978            mut self,
979            v: T,
980        ) -> Self {
981            self.r#type = v.into();
982            self
983        }
984
985        /// Sets the value of [schedule][crate::model::cluster::MaintenanceEvent::schedule].
986        pub fn set_schedule<
987            T: std::convert::Into<crate::model::cluster::maintenance_event::Schedule>,
988        >(
989            mut self,
990            v: T,
991        ) -> Self {
992            self.schedule = v.into();
993            self
994        }
995
996        /// Sets the value of [state][crate::model::cluster::MaintenanceEvent::state].
997        pub fn set_state<T: std::convert::Into<crate::model::cluster::maintenance_event::State>>(
998            mut self,
999            v: T,
1000        ) -> Self {
1001            self.state = v.into();
1002            self
1003        }
1004
1005        /// Sets the value of [create_time][crate::model::cluster::MaintenanceEvent::create_time].
1006        pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1007            mut self,
1008            v: T,
1009        ) -> Self {
1010            self.create_time = v.into();
1011            self
1012        }
1013
1014        /// Sets the value of [start_time][crate::model::cluster::MaintenanceEvent::start_time].
1015        pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1016            mut self,
1017            v: T,
1018        ) -> Self {
1019            self.start_time = v.into();
1020            self
1021        }
1022
1023        /// Sets the value of [end_time][crate::model::cluster::MaintenanceEvent::end_time].
1024        pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1025            mut self,
1026            v: T,
1027        ) -> Self {
1028            self.end_time = v.into();
1029            self
1030        }
1031
1032        /// Sets the value of [update_time][crate::model::cluster::MaintenanceEvent::update_time].
1033        pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1034            mut self,
1035            v: T,
1036        ) -> Self {
1037            self.update_time = v.into();
1038            self
1039        }
1040    }
1041
1042    impl wkt::message::Message for MaintenanceEvent {
1043        fn typename() -> &'static str {
1044            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.MaintenanceEvent"
1045        }
1046    }
1047
1048    /// Defines additional types related to MaintenanceEvent
1049    pub mod maintenance_event {
1050        #[allow(unused_imports)]
1051        use super::*;
1052
1053        /// Indicates the maintenance event type.
1054        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1055        pub struct Type(std::borrow::Cow<'static, str>);
1056
1057        impl Type {
1058            /// Creates a new Type instance.
1059            pub const fn new(v: &'static str) -> Self {
1060                Self(std::borrow::Cow::Borrowed(v))
1061            }
1062
1063            /// Gets the enum value.
1064            pub fn value(&self) -> &str {
1065                &self.0
1066            }
1067        }
1068
1069        /// Useful constants to work with [Type](Type)
1070        pub mod r#type {
1071            use super::Type;
1072
1073            /// Unspecified.
1074            pub const TYPE_UNSPECIFIED: Type = Type::new("TYPE_UNSPECIFIED");
1075
1076            /// Upgrade initiated by users.
1077            pub const USER_INITIATED_UPGRADE: Type = Type::new("USER_INITIATED_UPGRADE");
1078
1079            /// Upgrade driven by Google.
1080            pub const GOOGLE_DRIVEN_UPGRADE: Type = Type::new("GOOGLE_DRIVEN_UPGRADE");
1081        }
1082
1083        impl std::convert::From<std::string::String> for Type {
1084            fn from(value: std::string::String) -> Self {
1085                Self(std::borrow::Cow::Owned(value))
1086            }
1087        }
1088
1089        /// Indicates when the maintenance event should be performed.
1090        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1091        pub struct Schedule(std::borrow::Cow<'static, str>);
1092
1093        impl Schedule {
1094            /// Creates a new Schedule instance.
1095            pub const fn new(v: &'static str) -> Self {
1096                Self(std::borrow::Cow::Borrowed(v))
1097            }
1098
1099            /// Gets the enum value.
1100            pub fn value(&self) -> &str {
1101                &self.0
1102            }
1103        }
1104
1105        /// Useful constants to work with [Schedule](Schedule)
1106        pub mod schedule {
1107            use super::Schedule;
1108
1109            /// Unspecified.
1110            pub const SCHEDULE_UNSPECIFIED: Schedule = Schedule::new("SCHEDULE_UNSPECIFIED");
1111
1112            /// Immediately after receiving the request.
1113            pub const IMMEDIATELY: Schedule = Schedule::new("IMMEDIATELY");
1114        }
1115
1116        impl std::convert::From<std::string::String> for Schedule {
1117            fn from(value: std::string::String) -> Self {
1118                Self(std::borrow::Cow::Owned(value))
1119            }
1120        }
1121
1122        /// Indicates the maintenance event state.
1123        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1124        pub struct State(std::borrow::Cow<'static, str>);
1125
1126        impl State {
1127            /// Creates a new State instance.
1128            pub const fn new(v: &'static str) -> Self {
1129                Self(std::borrow::Cow::Borrowed(v))
1130            }
1131
1132            /// Gets the enum value.
1133            pub fn value(&self) -> &str {
1134                &self.0
1135            }
1136        }
1137
1138        /// Useful constants to work with [State](State)
1139        pub mod state {
1140            use super::State;
1141
1142            /// Unspecified.
1143            pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
1144
1145            /// The maintenance event is ongoing. The cluster might be unusable.
1146            pub const RECONCILING: State = State::new("RECONCILING");
1147
1148            /// The maintenance event succeeded.
1149            pub const SUCCEEDED: State = State::new("SUCCEEDED");
1150
1151            /// The maintenance event failed.
1152            pub const FAILED: State = State::new("FAILED");
1153        }
1154
1155        impl std::convert::From<std::string::String> for State {
1156            fn from(value: std::string::String) -> Self {
1157                Self(std::borrow::Cow::Owned(value))
1158            }
1159        }
1160    }
1161
1162    /// Configuration of the cluster survivability, e.g., for the case when network
1163    /// connectivity is lost.
1164    #[serde_with::serde_as]
1165    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1166    #[serde(default, rename_all = "camelCase")]
1167    #[non_exhaustive]
1168    pub struct SurvivabilityConfig {
1169        /// Optional. Time period that allows the cluster nodes to be rebooted and
1170        /// become functional without network connectivity to Google. The default 0
1171        /// means not allowed. The maximum is 7 days.
1172        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1173        pub offline_reboot_ttl: std::option::Option<wkt::Duration>,
1174    }
1175
1176    impl SurvivabilityConfig {
1177        pub fn new() -> Self {
1178            std::default::Default::default()
1179        }
1180
1181        /// Sets the value of [offline_reboot_ttl][crate::model::cluster::SurvivabilityConfig::offline_reboot_ttl].
1182        pub fn set_offline_reboot_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
1183            mut self,
1184            v: T,
1185        ) -> Self {
1186            self.offline_reboot_ttl = v.into();
1187            self
1188        }
1189    }
1190
1191    impl wkt::message::Message for SurvivabilityConfig {
1192        fn typename() -> &'static str {
1193            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.SurvivabilityConfig"
1194        }
1195    }
1196
1197    /// ConnectionState holds the current connection state from the cluster to
1198    /// Google.
1199    #[serde_with::serde_as]
1200    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1201    #[serde(default, rename_all = "camelCase")]
1202    #[non_exhaustive]
1203    pub struct ConnectionState {
1204        /// Output only. The current connection state.
1205        pub state: crate::model::cluster::connection_state::State,
1206
1207        /// Output only. The time when the connection state was last changed.
1208        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1209        pub update_time: std::option::Option<wkt::Timestamp>,
1210    }
1211
1212    impl ConnectionState {
1213        pub fn new() -> Self {
1214            std::default::Default::default()
1215        }
1216
1217        /// Sets the value of [state][crate::model::cluster::ConnectionState::state].
1218        pub fn set_state<T: std::convert::Into<crate::model::cluster::connection_state::State>>(
1219            mut self,
1220            v: T,
1221        ) -> Self {
1222            self.state = v.into();
1223            self
1224        }
1225
1226        /// Sets the value of [update_time][crate::model::cluster::ConnectionState::update_time].
1227        pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1228            mut self,
1229            v: T,
1230        ) -> Self {
1231            self.update_time = v.into();
1232            self
1233        }
1234    }
1235
1236    impl wkt::message::Message for ConnectionState {
1237        fn typename() -> &'static str {
1238            "type.googleapis.com/google.cloud.edgecontainer.v1.Cluster.ConnectionState"
1239        }
1240    }
1241
1242    /// Defines additional types related to ConnectionState
1243    pub mod connection_state {
1244        #[allow(unused_imports)]
1245        use super::*;
1246
1247        /// The connection state.
1248        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1249        pub struct State(std::borrow::Cow<'static, str>);
1250
1251        impl State {
1252            /// Creates a new State instance.
1253            pub const fn new(v: &'static str) -> Self {
1254                Self(std::borrow::Cow::Borrowed(v))
1255            }
1256
1257            /// Gets the enum value.
1258            pub fn value(&self) -> &str {
1259                &self.0
1260            }
1261        }
1262
1263        /// Useful constants to work with [State](State)
1264        pub mod state {
1265            use super::State;
1266
1267            /// Unknown connection state.
1268            pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
1269
1270            /// This cluster is currently disconnected from Google.
1271            pub const DISCONNECTED: State = State::new("DISCONNECTED");
1272
1273            /// This cluster is currently connected to Google.
1274            pub const CONNECTED: State = State::new("CONNECTED");
1275
1276            /// This cluster is currently connected to Google, but may have recently
1277            /// reconnected after a disconnection. It is still syncing back.
1278            pub const CONNECTED_AND_SYNCING: State = State::new("CONNECTED_AND_SYNCING");
1279        }
1280
1281        impl std::convert::From<std::string::String> for State {
1282            fn from(value: std::string::String) -> Self {
1283                Self(std::borrow::Cow::Owned(value))
1284            }
1285        }
1286    }
1287
1288    /// Indicates the status of the cluster.
1289    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1290    pub struct Status(std::borrow::Cow<'static, str>);
1291
1292    impl Status {
1293        /// Creates a new Status instance.
1294        pub const fn new(v: &'static str) -> Self {
1295            Self(std::borrow::Cow::Borrowed(v))
1296        }
1297
1298        /// Gets the enum value.
1299        pub fn value(&self) -> &str {
1300            &self.0
1301        }
1302    }
1303
1304    /// Useful constants to work with [Status](Status)
1305    pub mod status {
1306        use super::Status;
1307
1308        /// Status unknown.
1309        pub const STATUS_UNSPECIFIED: Status = Status::new("STATUS_UNSPECIFIED");
1310
1311        /// The cluster is being created.
1312        pub const PROVISIONING: Status = Status::new("PROVISIONING");
1313
1314        /// The cluster is created and fully usable.
1315        pub const RUNNING: Status = Status::new("RUNNING");
1316
1317        /// The cluster is being deleted.
1318        pub const DELETING: Status = Status::new("DELETING");
1319
1320        /// The status indicates that some errors occurred while reconciling/deleting
1321        /// the cluster.
1322        pub const ERROR: Status = Status::new("ERROR");
1323
1324        /// The cluster is undergoing some work such as version upgrades, etc.
1325        pub const RECONCILING: Status = Status::new("RECONCILING");
1326    }
1327
1328    impl std::convert::From<std::string::String> for Status {
1329        fn from(value: std::string::String) -> Self {
1330            Self(std::borrow::Cow::Owned(value))
1331        }
1332    }
1333
1334    /// The release channel a cluster is subscribed to.
1335    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1336    pub struct ReleaseChannel(std::borrow::Cow<'static, str>);
1337
1338    impl ReleaseChannel {
1339        /// Creates a new ReleaseChannel instance.
1340        pub const fn new(v: &'static str) -> Self {
1341            Self(std::borrow::Cow::Borrowed(v))
1342        }
1343
1344        /// Gets the enum value.
1345        pub fn value(&self) -> &str {
1346            &self.0
1347        }
1348    }
1349
1350    /// Useful constants to work with [ReleaseChannel](ReleaseChannel)
1351    pub mod release_channel {
1352        use super::ReleaseChannel;
1353
1354        /// Unspecified release channel. This will default to the REGULAR channel.
1355        pub const RELEASE_CHANNEL_UNSPECIFIED: ReleaseChannel =
1356            ReleaseChannel::new("RELEASE_CHANNEL_UNSPECIFIED");
1357
1358        /// No release channel.
1359        pub const NONE: ReleaseChannel = ReleaseChannel::new("NONE");
1360
1361        /// Regular release channel.
1362        pub const REGULAR: ReleaseChannel = ReleaseChannel::new("REGULAR");
1363    }
1364
1365    impl std::convert::From<std::string::String> for ReleaseChannel {
1366        fn from(value: std::string::String) -> Self {
1367            Self(std::borrow::Cow::Owned(value))
1368        }
1369    }
1370}
1371
1372/// Cluster-wide networking configuration.
1373#[serde_with::serde_as]
1374#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1375#[serde(default, rename_all = "camelCase")]
1376#[non_exhaustive]
1377pub struct ClusterNetworking {
1378    /// Required. All pods in the cluster are assigned an RFC1918 IPv4 address from
1379    /// these blocks. Only a single block is supported. This field cannot be
1380    /// changed after creation.
1381    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1382    pub cluster_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
1383
1384    /// Required. All services in the cluster are assigned an RFC1918 IPv4 address
1385    /// from these blocks. Only a single block is supported. This field cannot be
1386    /// changed after creation.
1387    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1388    pub services_ipv4_cidr_blocks: std::vec::Vec<std::string::String>,
1389}
1390
1391impl ClusterNetworking {
1392    pub fn new() -> Self {
1393        std::default::Default::default()
1394    }
1395
1396    /// Sets the value of [cluster_ipv4_cidr_blocks][crate::model::ClusterNetworking::cluster_ipv4_cidr_blocks].
1397    pub fn set_cluster_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
1398    where
1399        T: std::iter::IntoIterator<Item = V>,
1400        V: std::convert::Into<std::string::String>,
1401    {
1402        use std::iter::Iterator;
1403        self.cluster_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
1404        self
1405    }
1406
1407    /// Sets the value of [services_ipv4_cidr_blocks][crate::model::ClusterNetworking::services_ipv4_cidr_blocks].
1408    pub fn set_services_ipv4_cidr_blocks<T, V>(mut self, v: T) -> Self
1409    where
1410        T: std::iter::IntoIterator<Item = V>,
1411        V: std::convert::Into<std::string::String>,
1412    {
1413        use std::iter::Iterator;
1414        self.services_ipv4_cidr_blocks = v.into_iter().map(|i| i.into()).collect();
1415        self
1416    }
1417}
1418
1419impl wkt::message::Message for ClusterNetworking {
1420    fn typename() -> &'static str {
1421        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterNetworking"
1422    }
1423}
1424
1425/// Fleet related configuration.
1426///
1427/// Fleets are a Google Cloud concept for logically organizing clusters,
1428/// letting you use and manage multi-cluster capabilities and apply
1429/// consistent policies across your systems.
1430#[serde_with::serde_as]
1431#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1432#[serde(default, rename_all = "camelCase")]
1433#[non_exhaustive]
1434pub struct Fleet {
1435    /// Required. The name of the Fleet host project where this cluster will be
1436    /// registered.
1437    ///
1438    /// Project names are formatted as
1439    /// `projects/<project-number>`.
1440    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1441    pub project: std::string::String,
1442
1443    /// Output only. The name of the managed Hub Membership resource associated to
1444    /// this cluster.
1445    ///
1446    /// Membership names are formatted as
1447    /// `projects/<project-number>/locations/global/membership/<cluster-id>`.
1448    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1449    pub membership: std::string::String,
1450}
1451
1452impl Fleet {
1453    pub fn new() -> Self {
1454        std::default::Default::default()
1455    }
1456
1457    /// Sets the value of [project][crate::model::Fleet::project].
1458    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1459        self.project = v.into();
1460        self
1461    }
1462
1463    /// Sets the value of [membership][crate::model::Fleet::membership].
1464    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1465        self.membership = v.into();
1466        self
1467    }
1468}
1469
1470impl wkt::message::Message for Fleet {
1471    fn typename() -> &'static str {
1472        "type.googleapis.com/google.cloud.edgecontainer.v1.Fleet"
1473    }
1474}
1475
1476/// A user principal for an RBAC policy.
1477#[serde_with::serde_as]
1478#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1479#[serde(default, rename_all = "camelCase")]
1480#[non_exhaustive]
1481pub struct ClusterUser {
1482    /// Required. An active Google username.
1483    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1484    pub username: std::string::String,
1485}
1486
1487impl ClusterUser {
1488    pub fn new() -> Self {
1489        std::default::Default::default()
1490    }
1491
1492    /// Sets the value of [username][crate::model::ClusterUser::username].
1493    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1494        self.username = v.into();
1495        self
1496    }
1497}
1498
1499impl wkt::message::Message for ClusterUser {
1500    fn typename() -> &'static str {
1501        "type.googleapis.com/google.cloud.edgecontainer.v1.ClusterUser"
1502    }
1503}
1504
1505/// RBAC policy that will be applied and managed by GEC.
1506#[serde_with::serde_as]
1507#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1508#[serde(default, rename_all = "camelCase")]
1509#[non_exhaustive]
1510pub struct Authorization {
1511    /// Required. User that will be granted the cluster-admin role on the cluster,
1512    /// providing full access to the cluster. Currently, this is a singular field,
1513    /// but will be expanded to allow multiple admins in the future.
1514    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1515    pub admin_users: std::option::Option<crate::model::ClusterUser>,
1516}
1517
1518impl Authorization {
1519    pub fn new() -> Self {
1520        std::default::Default::default()
1521    }
1522
1523    /// Sets the value of [admin_users][crate::model::Authorization::admin_users].
1524    pub fn set_admin_users<
1525        T: std::convert::Into<std::option::Option<crate::model::ClusterUser>>,
1526    >(
1527        mut self,
1528        v: T,
1529    ) -> Self {
1530        self.admin_users = v.into();
1531        self
1532    }
1533}
1534
1535impl wkt::message::Message for Authorization {
1536    fn typename() -> &'static str {
1537        "type.googleapis.com/google.cloud.edgecontainer.v1.Authorization"
1538    }
1539}
1540
1541/// A set of Kubernetes nodes in a cluster with common configuration and
1542/// specification.
1543#[serde_with::serde_as]
1544#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1545#[serde(default, rename_all = "camelCase")]
1546#[non_exhaustive]
1547pub struct NodePool {
1548    /// Required. The resource name of the node pool.
1549    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1550    pub name: std::string::String,
1551
1552    /// Output only. The time when the node pool was created.
1553    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1554    pub create_time: std::option::Option<wkt::Timestamp>,
1555
1556    /// Output only. The time when the node pool was last updated.
1557    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1558    pub update_time: std::option::Option<wkt::Timestamp>,
1559
1560    /// Labels associated with this resource.
1561    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1562    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1563
1564    /// Name of the Google Distributed Cloud Edge zone where this node pool will be
1565    /// created. For example: `us-central1-edge-customer-a`.
1566    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1567    pub node_location: std::string::String,
1568
1569    /// Required. The number of nodes in the pool.
1570    pub node_count: i32,
1571
1572    /// Only machines matching this filter will be allowed to join the node pool.
1573    /// The filtering language accepts strings like "name=\<name\>", and is
1574    /// documented in more detail in [AIP-160](https://google.aip.dev/160).
1575    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1576    pub machine_filter: std::string::String,
1577
1578    /// Optional. Local disk encryption options. This field is only used when
1579    /// enabling CMEK support.
1580    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1581    pub local_disk_encryption: std::option::Option<crate::model::node_pool::LocalDiskEncryption>,
1582
1583    /// Output only. The lowest release version among all worker nodes.
1584    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1585    pub node_version: std::string::String,
1586
1587    /// Optional. Configuration for each node in the NodePool
1588    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1589    pub node_config: std::option::Option<crate::model::node_pool::NodeConfig>,
1590}
1591
1592impl NodePool {
1593    pub fn new() -> Self {
1594        std::default::Default::default()
1595    }
1596
1597    /// Sets the value of [name][crate::model::NodePool::name].
1598    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1599        self.name = v.into();
1600        self
1601    }
1602
1603    /// Sets the value of [create_time][crate::model::NodePool::create_time].
1604    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1605        mut self,
1606        v: T,
1607    ) -> Self {
1608        self.create_time = v.into();
1609        self
1610    }
1611
1612    /// Sets the value of [update_time][crate::model::NodePool::update_time].
1613    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1614        mut self,
1615        v: T,
1616    ) -> Self {
1617        self.update_time = v.into();
1618        self
1619    }
1620
1621    /// Sets the value of [node_location][crate::model::NodePool::node_location].
1622    pub fn set_node_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1623        self.node_location = v.into();
1624        self
1625    }
1626
1627    /// Sets the value of [node_count][crate::model::NodePool::node_count].
1628    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1629        self.node_count = v.into();
1630        self
1631    }
1632
1633    /// Sets the value of [machine_filter][crate::model::NodePool::machine_filter].
1634    pub fn set_machine_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635        self.machine_filter = v.into();
1636        self
1637    }
1638
1639    /// Sets the value of [local_disk_encryption][crate::model::NodePool::local_disk_encryption].
1640    pub fn set_local_disk_encryption<
1641        T: std::convert::Into<std::option::Option<crate::model::node_pool::LocalDiskEncryption>>,
1642    >(
1643        mut self,
1644        v: T,
1645    ) -> Self {
1646        self.local_disk_encryption = v.into();
1647        self
1648    }
1649
1650    /// Sets the value of [node_version][crate::model::NodePool::node_version].
1651    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1652        self.node_version = v.into();
1653        self
1654    }
1655
1656    /// Sets the value of [node_config][crate::model::NodePool::node_config].
1657    pub fn set_node_config<
1658        T: std::convert::Into<std::option::Option<crate::model::node_pool::NodeConfig>>,
1659    >(
1660        mut self,
1661        v: T,
1662    ) -> Self {
1663        self.node_config = v.into();
1664        self
1665    }
1666
1667    /// Sets the value of [labels][crate::model::NodePool::labels].
1668    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1669    where
1670        T: std::iter::IntoIterator<Item = (K, V)>,
1671        K: std::convert::Into<std::string::String>,
1672        V: std::convert::Into<std::string::String>,
1673    {
1674        use std::iter::Iterator;
1675        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1676        self
1677    }
1678}
1679
1680impl wkt::message::Message for NodePool {
1681    fn typename() -> &'static str {
1682        "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool"
1683    }
1684}
1685
1686/// Defines additional types related to NodePool
1687pub mod node_pool {
1688    #[allow(unused_imports)]
1689    use super::*;
1690
1691    /// Configuration for CMEK support for edge machine local disk encryption.
1692    #[serde_with::serde_as]
1693    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1694    #[serde(default, rename_all = "camelCase")]
1695    #[non_exhaustive]
1696    pub struct LocalDiskEncryption {
1697        /// Optional. The Cloud KMS CryptoKey e.g.
1698        /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
1699        /// to use for protecting node local disks. If not specified, a
1700        /// Google-managed key will be used instead.
1701        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1702        pub kms_key: std::string::String,
1703
1704        /// Output only. The Cloud KMS CryptoKeyVersion currently in use for
1705        /// protecting node local disks. Only applicable if kms_key is set.
1706        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1707        pub kms_key_active_version: std::string::String,
1708
1709        /// Output only. Availability of the Cloud KMS CryptoKey. If not
1710        /// `KEY_AVAILABLE`, then nodes may go offline as they cannot access their
1711        /// local data. This can be caused by a lack of permissions to use the key,
1712        /// or if the key is disabled or deleted.
1713        pub kms_key_state: crate::model::KmsKeyState,
1714
1715        /// Output only. Error status returned by Cloud KMS when using this key. This
1716        /// field may be populated only if `kms_key_state` is not
1717        /// `KMS_KEY_STATE_KEY_AVAILABLE`. If populated, this field contains the
1718        /// error status reported by Cloud KMS.
1719        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1720        pub kms_status: std::option::Option<rpc::model::Status>,
1721
1722        /// Output only. The current resource state associated with the cmek.
1723        pub resource_state: crate::model::ResourceState,
1724    }
1725
1726    impl LocalDiskEncryption {
1727        pub fn new() -> Self {
1728            std::default::Default::default()
1729        }
1730
1731        /// Sets the value of [kms_key][crate::model::node_pool::LocalDiskEncryption::kms_key].
1732        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1733            self.kms_key = v.into();
1734            self
1735        }
1736
1737        /// Sets the value of [kms_key_active_version][crate::model::node_pool::LocalDiskEncryption::kms_key_active_version].
1738        pub fn set_kms_key_active_version<T: std::convert::Into<std::string::String>>(
1739            mut self,
1740            v: T,
1741        ) -> Self {
1742            self.kms_key_active_version = v.into();
1743            self
1744        }
1745
1746        /// Sets the value of [kms_key_state][crate::model::node_pool::LocalDiskEncryption::kms_key_state].
1747        pub fn set_kms_key_state<T: std::convert::Into<crate::model::KmsKeyState>>(
1748            mut self,
1749            v: T,
1750        ) -> Self {
1751            self.kms_key_state = v.into();
1752            self
1753        }
1754
1755        /// Sets the value of [kms_status][crate::model::node_pool::LocalDiskEncryption::kms_status].
1756        pub fn set_kms_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
1757            mut self,
1758            v: T,
1759        ) -> Self {
1760            self.kms_status = v.into();
1761            self
1762        }
1763
1764        /// Sets the value of [resource_state][crate::model::node_pool::LocalDiskEncryption::resource_state].
1765        pub fn set_resource_state<T: std::convert::Into<crate::model::ResourceState>>(
1766            mut self,
1767            v: T,
1768        ) -> Self {
1769            self.resource_state = v.into();
1770            self
1771        }
1772    }
1773
1774    impl wkt::message::Message for LocalDiskEncryption {
1775        fn typename() -> &'static str {
1776            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption"
1777        }
1778    }
1779
1780    /// Configuration for each node in the NodePool
1781    #[serde_with::serde_as]
1782    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1783    #[serde(default, rename_all = "camelCase")]
1784    #[non_exhaustive]
1785    pub struct NodeConfig {
1786        /// Optional. The Kubernetes node labels
1787        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1788        pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1789
1790        /// Optional. Name for the storage schema of worker nodes.
1791        ///
1792        /// Warning: Configurable node local storage schema feature is an
1793        /// experimental feature, and is not recommended for general use
1794        /// in production clusters/nodepools.
1795        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1796        pub node_storage_schema: std::string::String,
1797    }
1798
1799    impl NodeConfig {
1800        pub fn new() -> Self {
1801            std::default::Default::default()
1802        }
1803
1804        /// Sets the value of [node_storage_schema][crate::model::node_pool::NodeConfig::node_storage_schema].
1805        pub fn set_node_storage_schema<T: std::convert::Into<std::string::String>>(
1806            mut self,
1807            v: T,
1808        ) -> Self {
1809            self.node_storage_schema = v.into();
1810            self
1811        }
1812
1813        /// Sets the value of [labels][crate::model::node_pool::NodeConfig::labels].
1814        pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1815        where
1816            T: std::iter::IntoIterator<Item = (K, V)>,
1817            K: std::convert::Into<std::string::String>,
1818            V: std::convert::Into<std::string::String>,
1819        {
1820            use std::iter::Iterator;
1821            self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1822            self
1823        }
1824    }
1825
1826    impl wkt::message::Message for NodeConfig {
1827        fn typename() -> &'static str {
1828            "type.googleapis.com/google.cloud.edgecontainer.v1.NodePool.NodeConfig"
1829        }
1830    }
1831}
1832
1833/// A Google Distributed Cloud Edge machine capable of acting as a Kubernetes
1834/// node.
1835#[serde_with::serde_as]
1836#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1837#[serde(default, rename_all = "camelCase")]
1838#[non_exhaustive]
1839pub struct Machine {
1840    /// Required. The resource name of the machine.
1841    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1842    pub name: std::string::String,
1843
1844    /// Output only. The time when the node pool was created.
1845    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1846    pub create_time: std::option::Option<wkt::Timestamp>,
1847
1848    /// Output only. The time when the node pool was last updated.
1849    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1850    pub update_time: std::option::Option<wkt::Timestamp>,
1851
1852    /// Labels associated with this resource.
1853    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1854    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1855
1856    /// Canonical resource name of the node that this machine is responsible for
1857    /// hosting e.g.
1858    /// projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node},
1859    /// Or empty if the machine is not assigned to assume the role of a node.
1860    ///
1861    /// For control plane nodes hosted on edge machines, this will return
1862    /// the following format:
1863    /// "projects/{project}/locations/{location}/clusters/{cluster_id}/controlPlaneNodes/{node}".
1864    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1865    pub hosted_node: std::string::String,
1866
1867    /// The Google Distributed Cloud Edge zone of this machine.
1868    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1869    pub zone: std::string::String,
1870
1871    /// Output only. The software version of the machine.
1872    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1873    pub version: std::string::String,
1874
1875    /// Output only. Whether the machine is disabled. If disabled, the machine is
1876    /// unable to enter service.
1877    pub disabled: bool,
1878}
1879
1880impl Machine {
1881    pub fn new() -> Self {
1882        std::default::Default::default()
1883    }
1884
1885    /// Sets the value of [name][crate::model::Machine::name].
1886    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1887        self.name = v.into();
1888        self
1889    }
1890
1891    /// Sets the value of [create_time][crate::model::Machine::create_time].
1892    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1893        mut self,
1894        v: T,
1895    ) -> Self {
1896        self.create_time = v.into();
1897        self
1898    }
1899
1900    /// Sets the value of [update_time][crate::model::Machine::update_time].
1901    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1902        mut self,
1903        v: T,
1904    ) -> Self {
1905        self.update_time = v.into();
1906        self
1907    }
1908
1909    /// Sets the value of [hosted_node][crate::model::Machine::hosted_node].
1910    pub fn set_hosted_node<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911        self.hosted_node = v.into();
1912        self
1913    }
1914
1915    /// Sets the value of [zone][crate::model::Machine::zone].
1916    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1917        self.zone = v.into();
1918        self
1919    }
1920
1921    /// Sets the value of [version][crate::model::Machine::version].
1922    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1923        self.version = v.into();
1924        self
1925    }
1926
1927    /// Sets the value of [disabled][crate::model::Machine::disabled].
1928    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1929        self.disabled = v.into();
1930        self
1931    }
1932
1933    /// Sets the value of [labels][crate::model::Machine::labels].
1934    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1935    where
1936        T: std::iter::IntoIterator<Item = (K, V)>,
1937        K: std::convert::Into<std::string::String>,
1938        V: std::convert::Into<std::string::String>,
1939    {
1940        use std::iter::Iterator;
1941        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1942        self
1943    }
1944}
1945
1946impl wkt::message::Message for Machine {
1947    fn typename() -> &'static str {
1948        "type.googleapis.com/google.cloud.edgecontainer.v1.Machine"
1949    }
1950}
1951
1952/// A VPN connection .
1953#[serde_with::serde_as]
1954#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1955#[serde(default, rename_all = "camelCase")]
1956#[non_exhaustive]
1957pub struct VpnConnection {
1958    /// Required. The resource name of VPN connection
1959    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1960    pub name: std::string::String,
1961
1962    /// Output only. The time when the VPN connection was created.
1963    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1964    pub create_time: std::option::Option<wkt::Timestamp>,
1965
1966    /// Output only. The time when the VPN connection was last updated.
1967    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1968    pub update_time: std::option::Option<wkt::Timestamp>,
1969
1970    /// Labels associated with this resource.
1971    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1972    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1973
1974    /// NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the
1975    /// customer needs to configure NAT such that only one external IP maps to the
1976    /// GMEC Anthos cluster. This is empty if NAT is not used.
1977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1978    pub nat_gateway_ip: std::string::String,
1979
1980    /// Dynamic routing mode of the VPC network, `regional` or `global`.
1981    pub bgp_routing_mode: crate::model::vpn_connection::BgpRoutingMode,
1982
1983    /// The canonical Cluster name to connect to. It is in the form of
1984    /// projects/{project}/locations/{location}/clusters/{cluster}.
1985    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1986    pub cluster: std::string::String,
1987
1988    /// The network ID of VPC to connect to.
1989    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1990    pub vpc: std::string::String,
1991
1992    /// Optional. Project detail of the VPC network. Required if VPC is in a
1993    /// different project than the cluster project.
1994    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1995    pub vpc_project: std::option::Option<crate::model::vpn_connection::VpcProject>,
1996
1997    /// Whether this VPN connection has HA enabled on cluster side. If enabled,
1998    /// when creating VPN connection we will attempt to use 2 ANG floating IPs.
1999    pub enable_high_availability: bool,
2000
2001    /// Optional. The VPN connection Cloud Router name.
2002    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2003    pub router: std::string::String,
2004
2005    /// Output only. The created connection details.
2006    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2007    pub details: std::option::Option<crate::model::vpn_connection::Details>,
2008}
2009
2010impl VpnConnection {
2011    pub fn new() -> Self {
2012        std::default::Default::default()
2013    }
2014
2015    /// Sets the value of [name][crate::model::VpnConnection::name].
2016    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2017        self.name = v.into();
2018        self
2019    }
2020
2021    /// Sets the value of [create_time][crate::model::VpnConnection::create_time].
2022    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2023        mut self,
2024        v: T,
2025    ) -> Self {
2026        self.create_time = v.into();
2027        self
2028    }
2029
2030    /// Sets the value of [update_time][crate::model::VpnConnection::update_time].
2031    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2032        mut self,
2033        v: T,
2034    ) -> Self {
2035        self.update_time = v.into();
2036        self
2037    }
2038
2039    /// Sets the value of [nat_gateway_ip][crate::model::VpnConnection::nat_gateway_ip].
2040    pub fn set_nat_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041        self.nat_gateway_ip = v.into();
2042        self
2043    }
2044
2045    /// Sets the value of [bgp_routing_mode][crate::model::VpnConnection::bgp_routing_mode].
2046    pub fn set_bgp_routing_mode<
2047        T: std::convert::Into<crate::model::vpn_connection::BgpRoutingMode>,
2048    >(
2049        mut self,
2050        v: T,
2051    ) -> Self {
2052        self.bgp_routing_mode = v.into();
2053        self
2054    }
2055
2056    /// Sets the value of [cluster][crate::model::VpnConnection::cluster].
2057    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2058        self.cluster = v.into();
2059        self
2060    }
2061
2062    /// Sets the value of [vpc][crate::model::VpnConnection::vpc].
2063    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2064        self.vpc = v.into();
2065        self
2066    }
2067
2068    /// Sets the value of [vpc_project][crate::model::VpnConnection::vpc_project].
2069    pub fn set_vpc_project<
2070        T: std::convert::Into<std::option::Option<crate::model::vpn_connection::VpcProject>>,
2071    >(
2072        mut self,
2073        v: T,
2074    ) -> Self {
2075        self.vpc_project = v.into();
2076        self
2077    }
2078
2079    /// Sets the value of [enable_high_availability][crate::model::VpnConnection::enable_high_availability].
2080    pub fn set_enable_high_availability<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2081        self.enable_high_availability = v.into();
2082        self
2083    }
2084
2085    /// Sets the value of [router][crate::model::VpnConnection::router].
2086    pub fn set_router<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2087        self.router = v.into();
2088        self
2089    }
2090
2091    /// Sets the value of [details][crate::model::VpnConnection::details].
2092    pub fn set_details<
2093        T: std::convert::Into<std::option::Option<crate::model::vpn_connection::Details>>,
2094    >(
2095        mut self,
2096        v: T,
2097    ) -> Self {
2098        self.details = v.into();
2099        self
2100    }
2101
2102    /// Sets the value of [labels][crate::model::VpnConnection::labels].
2103    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2104    where
2105        T: std::iter::IntoIterator<Item = (K, V)>,
2106        K: std::convert::Into<std::string::String>,
2107        V: std::convert::Into<std::string::String>,
2108    {
2109        use std::iter::Iterator;
2110        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2111        self
2112    }
2113}
2114
2115impl wkt::message::Message for VpnConnection {
2116    fn typename() -> &'static str {
2117        "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection"
2118    }
2119}
2120
2121/// Defines additional types related to VpnConnection
2122pub mod vpn_connection {
2123    #[allow(unused_imports)]
2124    use super::*;
2125
2126    /// Project detail of the VPC network.
2127    #[serde_with::serde_as]
2128    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2129    #[serde(default, rename_all = "camelCase")]
2130    #[non_exhaustive]
2131    pub struct VpcProject {
2132        /// The project of the VPC to connect to. If not specified, it is the same as
2133        /// the cluster project.
2134        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2135        pub project_id: std::string::String,
2136
2137        /// Optional. Deprecated: do not use.
2138        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2139        pub service_account: std::string::String,
2140    }
2141
2142    impl VpcProject {
2143        pub fn new() -> Self {
2144            std::default::Default::default()
2145        }
2146
2147        /// Sets the value of [project_id][crate::model::vpn_connection::VpcProject::project_id].
2148        pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2149            self.project_id = v.into();
2150            self
2151        }
2152
2153        /// Sets the value of [service_account][crate::model::vpn_connection::VpcProject::service_account].
2154        pub fn set_service_account<T: std::convert::Into<std::string::String>>(
2155            mut self,
2156            v: T,
2157        ) -> Self {
2158            self.service_account = v.into();
2159            self
2160        }
2161    }
2162
2163    impl wkt::message::Message for VpcProject {
2164        fn typename() -> &'static str {
2165            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.VpcProject"
2166        }
2167    }
2168
2169    /// The created connection details.
2170    #[serde_with::serde_as]
2171    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2172    #[serde(default, rename_all = "camelCase")]
2173    #[non_exhaustive]
2174    pub struct Details {
2175        /// The state of this connection.
2176        pub state: crate::model::vpn_connection::details::State,
2177
2178        /// The error message. This is only populated when state=ERROR.
2179        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2180        pub error: std::string::String,
2181
2182        /// The Cloud Router info.
2183        #[serde(skip_serializing_if = "std::option::Option::is_none")]
2184        pub cloud_router: std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
2185
2186        /// Each connection has multiple Cloud VPN gateways.
2187        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2188        pub cloud_vpns: std::vec::Vec<crate::model::vpn_connection::details::CloudVpn>,
2189    }
2190
2191    impl Details {
2192        pub fn new() -> Self {
2193            std::default::Default::default()
2194        }
2195
2196        /// Sets the value of [state][crate::model::vpn_connection::Details::state].
2197        pub fn set_state<T: std::convert::Into<crate::model::vpn_connection::details::State>>(
2198            mut self,
2199            v: T,
2200        ) -> Self {
2201            self.state = v.into();
2202            self
2203        }
2204
2205        /// Sets the value of [error][crate::model::vpn_connection::Details::error].
2206        pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2207            self.error = v.into();
2208            self
2209        }
2210
2211        /// Sets the value of [cloud_router][crate::model::vpn_connection::Details::cloud_router].
2212        pub fn set_cloud_router<
2213            T: std::convert::Into<
2214                std::option::Option<crate::model::vpn_connection::details::CloudRouter>,
2215            >,
2216        >(
2217            mut self,
2218            v: T,
2219        ) -> Self {
2220            self.cloud_router = v.into();
2221            self
2222        }
2223
2224        /// Sets the value of [cloud_vpns][crate::model::vpn_connection::Details::cloud_vpns].
2225        pub fn set_cloud_vpns<T, V>(mut self, v: T) -> Self
2226        where
2227            T: std::iter::IntoIterator<Item = V>,
2228            V: std::convert::Into<crate::model::vpn_connection::details::CloudVpn>,
2229        {
2230            use std::iter::Iterator;
2231            self.cloud_vpns = v.into_iter().map(|i| i.into()).collect();
2232            self
2233        }
2234    }
2235
2236    impl wkt::message::Message for Details {
2237        fn typename() -> &'static str {
2238            "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details"
2239        }
2240    }
2241
2242    /// Defines additional types related to Details
2243    pub mod details {
2244        #[allow(unused_imports)]
2245        use super::*;
2246
2247        /// The Cloud Router info.
2248        #[serde_with::serde_as]
2249        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2250        #[serde(default, rename_all = "camelCase")]
2251        #[non_exhaustive]
2252        pub struct CloudRouter {
2253            /// The associated Cloud Router name.
2254            #[serde(skip_serializing_if = "std::string::String::is_empty")]
2255            pub name: std::string::String,
2256        }
2257
2258        impl CloudRouter {
2259            pub fn new() -> Self {
2260                std::default::Default::default()
2261            }
2262
2263            /// Sets the value of [name][crate::model::vpn_connection::details::CloudRouter::name].
2264            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2265                self.name = v.into();
2266                self
2267            }
2268        }
2269
2270        impl wkt::message::Message for CloudRouter {
2271            fn typename() -> &'static str {
2272                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter"
2273            }
2274        }
2275
2276        /// The Cloud VPN info.
2277        #[serde_with::serde_as]
2278        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2279        #[serde(default, rename_all = "camelCase")]
2280        #[non_exhaustive]
2281        pub struct CloudVpn {
2282            /// The created Cloud VPN gateway name.
2283            #[serde(skip_serializing_if = "std::string::String::is_empty")]
2284            pub gateway: std::string::String,
2285        }
2286
2287        impl CloudVpn {
2288            pub fn new() -> Self {
2289                std::default::Default::default()
2290            }
2291
2292            /// Sets the value of [gateway][crate::model::vpn_connection::details::CloudVpn::gateway].
2293            pub fn set_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2294                self.gateway = v.into();
2295                self
2296            }
2297        }
2298
2299        impl wkt::message::Message for CloudVpn {
2300            fn typename() -> &'static str {
2301                "type.googleapis.com/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn"
2302            }
2303        }
2304
2305        /// The current connection state.
2306        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2307        pub struct State(std::borrow::Cow<'static, str>);
2308
2309        impl State {
2310            /// Creates a new State instance.
2311            pub const fn new(v: &'static str) -> Self {
2312                Self(std::borrow::Cow::Borrowed(v))
2313            }
2314
2315            /// Gets the enum value.
2316            pub fn value(&self) -> &str {
2317                &self.0
2318            }
2319        }
2320
2321        /// Useful constants to work with [State](State)
2322        pub mod state {
2323            use super::State;
2324
2325            /// Unknown.
2326            pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
2327
2328            /// Connected.
2329            pub const STATE_CONNECTED: State = State::new("STATE_CONNECTED");
2330
2331            /// Still connecting.
2332            pub const STATE_CONNECTING: State = State::new("STATE_CONNECTING");
2333
2334            /// Error occurred.
2335            pub const STATE_ERROR: State = State::new("STATE_ERROR");
2336        }
2337
2338        impl std::convert::From<std::string::String> for State {
2339            fn from(value: std::string::String) -> Self {
2340                Self(std::borrow::Cow::Owned(value))
2341            }
2342        }
2343    }
2344
2345    /// Routing mode.
2346    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2347    pub struct BgpRoutingMode(std::borrow::Cow<'static, str>);
2348
2349    impl BgpRoutingMode {
2350        /// Creates a new BgpRoutingMode instance.
2351        pub const fn new(v: &'static str) -> Self {
2352            Self(std::borrow::Cow::Borrowed(v))
2353        }
2354
2355        /// Gets the enum value.
2356        pub fn value(&self) -> &str {
2357            &self.0
2358        }
2359    }
2360
2361    /// Useful constants to work with [BgpRoutingMode](BgpRoutingMode)
2362    pub mod bgp_routing_mode {
2363        use super::BgpRoutingMode;
2364
2365        /// Unknown.
2366        pub const BGP_ROUTING_MODE_UNSPECIFIED: BgpRoutingMode =
2367            BgpRoutingMode::new("BGP_ROUTING_MODE_UNSPECIFIED");
2368
2369        /// Regional mode.
2370        pub const REGIONAL: BgpRoutingMode = BgpRoutingMode::new("REGIONAL");
2371
2372        /// Global mode.
2373        pub const GLOBAL: BgpRoutingMode = BgpRoutingMode::new("GLOBAL");
2374    }
2375
2376    impl std::convert::From<std::string::String> for BgpRoutingMode {
2377        fn from(value: std::string::String) -> Self {
2378            Self(std::borrow::Cow::Owned(value))
2379        }
2380    }
2381}
2382
2383/// Metadata for a given
2384/// [google.cloud.location.Location][google.cloud.location.Location].
2385///
2386/// [google.cloud.location.Location]: location::model::Location
2387#[serde_with::serde_as]
2388#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2389#[serde(default, rename_all = "camelCase")]
2390#[non_exhaustive]
2391pub struct LocationMetadata {
2392    /// The set of available Google Distributed Cloud Edge zones in the location.
2393    /// The map is keyed by the lowercase ID of each zone.
2394    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2395    pub available_zones: std::collections::HashMap<std::string::String, crate::model::ZoneMetadata>,
2396}
2397
2398impl LocationMetadata {
2399    pub fn new() -> Self {
2400        std::default::Default::default()
2401    }
2402
2403    /// Sets the value of [available_zones][crate::model::LocationMetadata::available_zones].
2404    pub fn set_available_zones<T, K, V>(mut self, v: T) -> Self
2405    where
2406        T: std::iter::IntoIterator<Item = (K, V)>,
2407        K: std::convert::Into<std::string::String>,
2408        V: std::convert::Into<crate::model::ZoneMetadata>,
2409    {
2410        use std::iter::Iterator;
2411        self.available_zones = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2412        self
2413    }
2414}
2415
2416impl wkt::message::Message for LocationMetadata {
2417    fn typename() -> &'static str {
2418        "type.googleapis.com/google.cloud.edgecontainer.v1.LocationMetadata"
2419    }
2420}
2421
2422/// A Google Distributed Cloud Edge zone where edge machines are located.
2423#[serde_with::serde_as]
2424#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2425#[serde(default, rename_all = "camelCase")]
2426#[non_exhaustive]
2427pub struct ZoneMetadata {
2428    /// Quota for resources in this zone.
2429    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2430    pub quota: std::vec::Vec<crate::model::Quota>,
2431
2432    /// The map keyed by rack name and has value of RackType.
2433    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2434    pub rack_types:
2435        std::collections::HashMap<std::string::String, crate::model::zone_metadata::RackType>,
2436
2437    /// Config data for the zone.
2438    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2439    pub config_data: std::option::Option<crate::model::ConfigData>,
2440}
2441
2442impl ZoneMetadata {
2443    pub fn new() -> Self {
2444        std::default::Default::default()
2445    }
2446
2447    /// Sets the value of [config_data][crate::model::ZoneMetadata::config_data].
2448    pub fn set_config_data<T: std::convert::Into<std::option::Option<crate::model::ConfigData>>>(
2449        mut self,
2450        v: T,
2451    ) -> Self {
2452        self.config_data = v.into();
2453        self
2454    }
2455
2456    /// Sets the value of [quota][crate::model::ZoneMetadata::quota].
2457    pub fn set_quota<T, V>(mut self, v: T) -> Self
2458    where
2459        T: std::iter::IntoIterator<Item = V>,
2460        V: std::convert::Into<crate::model::Quota>,
2461    {
2462        use std::iter::Iterator;
2463        self.quota = v.into_iter().map(|i| i.into()).collect();
2464        self
2465    }
2466
2467    /// Sets the value of [rack_types][crate::model::ZoneMetadata::rack_types].
2468    pub fn set_rack_types<T, K, V>(mut self, v: T) -> Self
2469    where
2470        T: std::iter::IntoIterator<Item = (K, V)>,
2471        K: std::convert::Into<std::string::String>,
2472        V: std::convert::Into<crate::model::zone_metadata::RackType>,
2473    {
2474        use std::iter::Iterator;
2475        self.rack_types = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2476        self
2477    }
2478}
2479
2480impl wkt::message::Message for ZoneMetadata {
2481    fn typename() -> &'static str {
2482        "type.googleapis.com/google.cloud.edgecontainer.v1.ZoneMetadata"
2483    }
2484}
2485
2486/// Defines additional types related to ZoneMetadata
2487pub mod zone_metadata {
2488    #[allow(unused_imports)]
2489    use super::*;
2490
2491    /// Type of the rack.
2492    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2493    pub struct RackType(std::borrow::Cow<'static, str>);
2494
2495    impl RackType {
2496        /// Creates a new RackType instance.
2497        pub const fn new(v: &'static str) -> Self {
2498            Self(std::borrow::Cow::Borrowed(v))
2499        }
2500
2501        /// Gets the enum value.
2502        pub fn value(&self) -> &str {
2503            &self.0
2504        }
2505    }
2506
2507    /// Useful constants to work with [RackType](RackType)
2508    pub mod rack_type {
2509        use super::RackType;
2510
2511        /// Unspecified rack type, single rack also belongs to this type.
2512        pub const RACK_TYPE_UNSPECIFIED: RackType = RackType::new("RACK_TYPE_UNSPECIFIED");
2513
2514        /// Base rack type, a pair of two modified Config-1 racks containing
2515        /// Aggregation switches.
2516        pub const BASE: RackType = RackType::new("BASE");
2517
2518        /// Expansion rack type, also known as standalone racks,
2519        /// added by customers on demand.
2520        pub const EXPANSION: RackType = RackType::new("EXPANSION");
2521    }
2522
2523    impl std::convert::From<std::string::String> for RackType {
2524        fn from(value: std::string::String) -> Self {
2525            Self(std::borrow::Cow::Owned(value))
2526        }
2527    }
2528}
2529
2530/// Config data holds all the config related data for the zone.
2531#[serde_with::serde_as]
2532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2533#[serde(default, rename_all = "camelCase")]
2534#[non_exhaustive]
2535pub struct ConfigData {
2536    /// list of available v4 ip pools for external loadbalancer
2537    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2538    pub available_external_lb_pools_ipv4: std::vec::Vec<std::string::String>,
2539
2540    /// list of available v6 ip pools for external loadbalancer
2541    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2542    pub available_external_lb_pools_ipv6: std::vec::Vec<std::string::String>,
2543}
2544
2545impl ConfigData {
2546    pub fn new() -> Self {
2547        std::default::Default::default()
2548    }
2549
2550    /// Sets the value of [available_external_lb_pools_ipv4][crate::model::ConfigData::available_external_lb_pools_ipv4].
2551    pub fn set_available_external_lb_pools_ipv4<T, V>(mut self, v: T) -> Self
2552    where
2553        T: std::iter::IntoIterator<Item = V>,
2554        V: std::convert::Into<std::string::String>,
2555    {
2556        use std::iter::Iterator;
2557        self.available_external_lb_pools_ipv4 = v.into_iter().map(|i| i.into()).collect();
2558        self
2559    }
2560
2561    /// Sets the value of [available_external_lb_pools_ipv6][crate::model::ConfigData::available_external_lb_pools_ipv6].
2562    pub fn set_available_external_lb_pools_ipv6<T, V>(mut self, v: T) -> Self
2563    where
2564        T: std::iter::IntoIterator<Item = V>,
2565        V: std::convert::Into<std::string::String>,
2566    {
2567        use std::iter::Iterator;
2568        self.available_external_lb_pools_ipv6 = v.into_iter().map(|i| i.into()).collect();
2569        self
2570    }
2571}
2572
2573impl wkt::message::Message for ConfigData {
2574    fn typename() -> &'static str {
2575        "type.googleapis.com/google.cloud.edgecontainer.v1.ConfigData"
2576    }
2577}
2578
2579/// Represents quota for Edge Container resources.
2580#[serde_with::serde_as]
2581#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2582#[serde(default, rename_all = "camelCase")]
2583#[non_exhaustive]
2584pub struct Quota {
2585    /// Name of the quota metric.
2586    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2587    pub metric: std::string::String,
2588
2589    /// Quota limit for this metric.
2590    pub limit: f64,
2591
2592    /// Current usage of this metric.
2593    pub usage: f64,
2594}
2595
2596impl Quota {
2597    pub fn new() -> Self {
2598        std::default::Default::default()
2599    }
2600
2601    /// Sets the value of [metric][crate::model::Quota::metric].
2602    pub fn set_metric<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2603        self.metric = v.into();
2604        self
2605    }
2606
2607    /// Sets the value of [limit][crate::model::Quota::limit].
2608    pub fn set_limit<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2609        self.limit = v.into();
2610        self
2611    }
2612
2613    /// Sets the value of [usage][crate::model::Quota::usage].
2614    pub fn set_usage<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2615        self.usage = v.into();
2616        self
2617    }
2618}
2619
2620impl wkt::message::Message for Quota {
2621    fn typename() -> &'static str {
2622        "type.googleapis.com/google.cloud.edgecontainer.v1.Quota"
2623    }
2624}
2625
2626/// Maintenance policy configuration.
2627#[serde_with::serde_as]
2628#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2629#[serde(default, rename_all = "camelCase")]
2630#[non_exhaustive]
2631pub struct MaintenancePolicy {
2632    /// Specifies the maintenance window in which maintenance may be performed.
2633    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2634    pub window: std::option::Option<crate::model::MaintenanceWindow>,
2635
2636    /// Optional. Exclusions to automatic maintenance. Non-emergency maintenance
2637    /// should not occur in these windows. Each exclusion has a unique name and may
2638    /// be active or expired. The max number of maintenance exclusions allowed at a
2639    /// given time is 3.
2640    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2641    pub maintenance_exclusions: std::vec::Vec<crate::model::MaintenanceExclusionWindow>,
2642}
2643
2644impl MaintenancePolicy {
2645    pub fn new() -> Self {
2646        std::default::Default::default()
2647    }
2648
2649    /// Sets the value of [window][crate::model::MaintenancePolicy::window].
2650    pub fn set_window<
2651        T: std::convert::Into<std::option::Option<crate::model::MaintenanceWindow>>,
2652    >(
2653        mut self,
2654        v: T,
2655    ) -> Self {
2656        self.window = v.into();
2657        self
2658    }
2659
2660    /// Sets the value of [maintenance_exclusions][crate::model::MaintenancePolicy::maintenance_exclusions].
2661    pub fn set_maintenance_exclusions<T, V>(mut self, v: T) -> Self
2662    where
2663        T: std::iter::IntoIterator<Item = V>,
2664        V: std::convert::Into<crate::model::MaintenanceExclusionWindow>,
2665    {
2666        use std::iter::Iterator;
2667        self.maintenance_exclusions = v.into_iter().map(|i| i.into()).collect();
2668        self
2669    }
2670}
2671
2672impl wkt::message::Message for MaintenancePolicy {
2673    fn typename() -> &'static str {
2674        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenancePolicy"
2675    }
2676}
2677
2678/// Maintenance window configuration
2679#[serde_with::serde_as]
2680#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2681#[serde(default, rename_all = "camelCase")]
2682#[non_exhaustive]
2683pub struct MaintenanceWindow {
2684    /// Configuration of a recurring maintenance window.
2685    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2686    pub recurring_window: std::option::Option<crate::model::RecurringTimeWindow>,
2687}
2688
2689impl MaintenanceWindow {
2690    pub fn new() -> Self {
2691        std::default::Default::default()
2692    }
2693
2694    /// Sets the value of [recurring_window][crate::model::MaintenanceWindow::recurring_window].
2695    pub fn set_recurring_window<
2696        T: std::convert::Into<std::option::Option<crate::model::RecurringTimeWindow>>,
2697    >(
2698        mut self,
2699        v: T,
2700    ) -> Self {
2701        self.recurring_window = v.into();
2702        self
2703    }
2704}
2705
2706impl wkt::message::Message for MaintenanceWindow {
2707    fn typename() -> &'static str {
2708        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceWindow"
2709    }
2710}
2711
2712/// Represents an arbitrary window of time that recurs.
2713#[serde_with::serde_as]
2714#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2715#[serde(default, rename_all = "camelCase")]
2716#[non_exhaustive]
2717pub struct RecurringTimeWindow {
2718    /// The window of the first recurrence.
2719    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2720    pub window: std::option::Option<crate::model::TimeWindow>,
2721
2722    /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
2723    /// this window recurs. They go on for the span of time between the start and
2724    /// end time.
2725    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2726    pub recurrence: std::string::String,
2727}
2728
2729impl RecurringTimeWindow {
2730    pub fn new() -> Self {
2731        std::default::Default::default()
2732    }
2733
2734    /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
2735    pub fn set_window<T: std::convert::Into<std::option::Option<crate::model::TimeWindow>>>(
2736        mut self,
2737        v: T,
2738    ) -> Self {
2739        self.window = v.into();
2740        self
2741    }
2742
2743    /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
2744    pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2745        self.recurrence = v.into();
2746        self
2747    }
2748}
2749
2750impl wkt::message::Message for RecurringTimeWindow {
2751    fn typename() -> &'static str {
2752        "type.googleapis.com/google.cloud.edgecontainer.v1.RecurringTimeWindow"
2753    }
2754}
2755
2756/// Represents a maintenance exclusion window.
2757#[serde_with::serde_as]
2758#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2759#[serde(default, rename_all = "camelCase")]
2760#[non_exhaustive]
2761pub struct MaintenanceExclusionWindow {
2762    /// Optional. The time window.
2763    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2764    pub window: std::option::Option<crate::model::TimeWindow>,
2765
2766    /// Optional. A unique (per cluster) id for the window.
2767    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2768    pub id: std::string::String,
2769}
2770
2771impl MaintenanceExclusionWindow {
2772    pub fn new() -> Self {
2773        std::default::Default::default()
2774    }
2775
2776    /// Sets the value of [window][crate::model::MaintenanceExclusionWindow::window].
2777    pub fn set_window<T: std::convert::Into<std::option::Option<crate::model::TimeWindow>>>(
2778        mut self,
2779        v: T,
2780    ) -> Self {
2781        self.window = v.into();
2782        self
2783    }
2784
2785    /// Sets the value of [id][crate::model::MaintenanceExclusionWindow::id].
2786    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787        self.id = v.into();
2788        self
2789    }
2790}
2791
2792impl wkt::message::Message for MaintenanceExclusionWindow {
2793    fn typename() -> &'static str {
2794        "type.googleapis.com/google.cloud.edgecontainer.v1.MaintenanceExclusionWindow"
2795    }
2796}
2797
2798/// Represents an arbitrary window of time.
2799#[serde_with::serde_as]
2800#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2801#[serde(default, rename_all = "camelCase")]
2802#[non_exhaustive]
2803pub struct TimeWindow {
2804    /// The time that the window first starts.
2805    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2806    pub start_time: std::option::Option<wkt::Timestamp>,
2807
2808    /// The time that the window ends. The end time must take place after the
2809    /// start time.
2810    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2811    pub end_time: std::option::Option<wkt::Timestamp>,
2812}
2813
2814impl TimeWindow {
2815    pub fn new() -> Self {
2816        std::default::Default::default()
2817    }
2818
2819    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
2820    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2821        mut self,
2822        v: T,
2823    ) -> Self {
2824        self.start_time = v.into();
2825        self
2826    }
2827
2828    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
2829    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2830        mut self,
2831        v: T,
2832    ) -> Self {
2833        self.end_time = v.into();
2834        self
2835    }
2836}
2837
2838impl wkt::message::Message for TimeWindow {
2839    fn typename() -> &'static str {
2840        "type.googleapis.com/google.cloud.edgecontainer.v1.TimeWindow"
2841    }
2842}
2843
2844/// Server configuration for supported versions and release channels.
2845#[serde_with::serde_as]
2846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2847#[serde(default, rename_all = "camelCase")]
2848#[non_exhaustive]
2849pub struct ServerConfig {
2850    /// Output only. Mapping from release channel to channel config.
2851    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2852    pub channels: std::collections::HashMap<std::string::String, crate::model::ChannelConfig>,
2853
2854    /// Output only. Supported versions, e.g.: ["1.4.0", "1.5.0"].
2855    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2856    pub versions: std::vec::Vec<crate::model::Version>,
2857
2858    /// Output only. Default version, e.g.: "1.4.0".
2859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2860    pub default_version: std::string::String,
2861}
2862
2863impl ServerConfig {
2864    pub fn new() -> Self {
2865        std::default::Default::default()
2866    }
2867
2868    /// Sets the value of [default_version][crate::model::ServerConfig::default_version].
2869    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2870        self.default_version = v.into();
2871        self
2872    }
2873
2874    /// Sets the value of [versions][crate::model::ServerConfig::versions].
2875    pub fn set_versions<T, V>(mut self, v: T) -> Self
2876    where
2877        T: std::iter::IntoIterator<Item = V>,
2878        V: std::convert::Into<crate::model::Version>,
2879    {
2880        use std::iter::Iterator;
2881        self.versions = v.into_iter().map(|i| i.into()).collect();
2882        self
2883    }
2884
2885    /// Sets the value of [channels][crate::model::ServerConfig::channels].
2886    pub fn set_channels<T, K, V>(mut self, v: T) -> Self
2887    where
2888        T: std::iter::IntoIterator<Item = (K, V)>,
2889        K: std::convert::Into<std::string::String>,
2890        V: std::convert::Into<crate::model::ChannelConfig>,
2891    {
2892        use std::iter::Iterator;
2893        self.channels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2894        self
2895    }
2896}
2897
2898impl wkt::message::Message for ServerConfig {
2899    fn typename() -> &'static str {
2900        "type.googleapis.com/google.cloud.edgecontainer.v1.ServerConfig"
2901    }
2902}
2903
2904/// Configuration for a release channel.
2905#[serde_with::serde_as]
2906#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2907#[serde(default, rename_all = "camelCase")]
2908#[non_exhaustive]
2909pub struct ChannelConfig {
2910    /// Output only. Default version for this release channel, e.g.: "1.4.0".
2911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2912    pub default_version: std::string::String,
2913}
2914
2915impl ChannelConfig {
2916    pub fn new() -> Self {
2917        std::default::Default::default()
2918    }
2919
2920    /// Sets the value of [default_version][crate::model::ChannelConfig::default_version].
2921    pub fn set_default_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2922        self.default_version = v.into();
2923        self
2924    }
2925}
2926
2927impl wkt::message::Message for ChannelConfig {
2928    fn typename() -> &'static str {
2929        "type.googleapis.com/google.cloud.edgecontainer.v1.ChannelConfig"
2930    }
2931}
2932
2933/// Version of a cluster.
2934#[serde_with::serde_as]
2935#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2936#[serde(default, rename_all = "camelCase")]
2937#[non_exhaustive]
2938pub struct Version {
2939    /// Output only. Name of the version, e.g.: "1.4.0".
2940    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2941    pub name: std::string::String,
2942}
2943
2944impl Version {
2945    pub fn new() -> Self {
2946        std::default::Default::default()
2947    }
2948
2949    /// Sets the value of [name][crate::model::Version::name].
2950    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2951        self.name = v.into();
2952        self
2953    }
2954}
2955
2956impl wkt::message::Message for Version {
2957    fn typename() -> &'static str {
2958        "type.googleapis.com/google.cloud.edgecontainer.v1.Version"
2959    }
2960}
2961
2962/// Long-running operation metadata for Edge Container API methods.
2963#[serde_with::serde_as]
2964#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2965#[serde(default, rename_all = "camelCase")]
2966#[non_exhaustive]
2967pub struct OperationMetadata {
2968    /// The time the operation was created.
2969    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2970    pub create_time: std::option::Option<wkt::Timestamp>,
2971
2972    /// The time the operation finished running.
2973    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2974    pub end_time: std::option::Option<wkt::Timestamp>,
2975
2976    /// Server-defined resource path for the target of the operation.
2977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2978    pub target: std::string::String,
2979
2980    /// The verb executed by the operation.
2981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2982    pub verb: std::string::String,
2983
2984    /// Human-readable status of the operation, if any.
2985    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2986    pub status_message: std::string::String,
2987
2988    /// Identifies whether the user has requested cancellation of the operation.
2989    /// Operations that have successfully been cancelled have [Operation.error][]
2990    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2991    /// corresponding to `Code.CANCELLED`.
2992    ///
2993    /// [google.rpc.Status.code]: rpc::model::Status::code
2994    pub requested_cancellation: bool,
2995
2996    /// API version used to start the operation.
2997    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2998    pub api_version: std::string::String,
2999
3000    /// Warnings that do not block the operation, but still hold relevant
3001    /// information for the end user to receive.
3002    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3003    pub warnings: std::vec::Vec<std::string::String>,
3004
3005    /// Machine-readable status of the operation, if any.
3006    pub status_reason: crate::model::operation_metadata::StatusReason,
3007}
3008
3009impl OperationMetadata {
3010    pub fn new() -> Self {
3011        std::default::Default::default()
3012    }
3013
3014    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3015    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3016        mut self,
3017        v: T,
3018    ) -> Self {
3019        self.create_time = v.into();
3020        self
3021    }
3022
3023    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3024    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3025        mut self,
3026        v: T,
3027    ) -> Self {
3028        self.end_time = v.into();
3029        self
3030    }
3031
3032    /// Sets the value of [target][crate::model::OperationMetadata::target].
3033    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3034        self.target = v.into();
3035        self
3036    }
3037
3038    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3039    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3040        self.verb = v.into();
3041        self
3042    }
3043
3044    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3045    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3046        self.status_message = v.into();
3047        self
3048    }
3049
3050    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3051    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3052        self.requested_cancellation = v.into();
3053        self
3054    }
3055
3056    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3057    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3058        self.api_version = v.into();
3059        self
3060    }
3061
3062    /// Sets the value of [status_reason][crate::model::OperationMetadata::status_reason].
3063    pub fn set_status_reason<
3064        T: std::convert::Into<crate::model::operation_metadata::StatusReason>,
3065    >(
3066        mut self,
3067        v: T,
3068    ) -> Self {
3069        self.status_reason = v.into();
3070        self
3071    }
3072
3073    /// Sets the value of [warnings][crate::model::OperationMetadata::warnings].
3074    pub fn set_warnings<T, V>(mut self, v: T) -> Self
3075    where
3076        T: std::iter::IntoIterator<Item = V>,
3077        V: std::convert::Into<std::string::String>,
3078    {
3079        use std::iter::Iterator;
3080        self.warnings = v.into_iter().map(|i| i.into()).collect();
3081        self
3082    }
3083}
3084
3085impl wkt::message::Message for OperationMetadata {
3086    fn typename() -> &'static str {
3087        "type.googleapis.com/google.cloud.edgecontainer.v1.OperationMetadata"
3088    }
3089}
3090
3091/// Defines additional types related to OperationMetadata
3092pub mod operation_metadata {
3093    #[allow(unused_imports)]
3094    use super::*;
3095
3096    /// Indicates the reason for the status of the operation.
3097    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3098    pub struct StatusReason(std::borrow::Cow<'static, str>);
3099
3100    impl StatusReason {
3101        /// Creates a new StatusReason instance.
3102        pub const fn new(v: &'static str) -> Self {
3103            Self(std::borrow::Cow::Borrowed(v))
3104        }
3105
3106        /// Gets the enum value.
3107        pub fn value(&self) -> &str {
3108            &self.0
3109        }
3110    }
3111
3112    /// Useful constants to work with [StatusReason](StatusReason)
3113    pub mod status_reason {
3114        use super::StatusReason;
3115
3116        /// Reason unknown.
3117        pub const STATUS_REASON_UNSPECIFIED: StatusReason =
3118            StatusReason::new("STATUS_REASON_UNSPECIFIED");
3119
3120        /// The cluster upgrade is currently paused.
3121        pub const UPGRADE_PAUSED: StatusReason = StatusReason::new("UPGRADE_PAUSED");
3122    }
3123
3124    impl std::convert::From<std::string::String> for StatusReason {
3125        fn from(value: std::string::String) -> Self {
3126            Self(std::borrow::Cow::Owned(value))
3127        }
3128    }
3129}
3130
3131/// Lists clusters in a location.
3132#[serde_with::serde_as]
3133#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3134#[serde(default, rename_all = "camelCase")]
3135#[non_exhaustive]
3136pub struct ListClustersRequest {
3137    /// Required. The parent location, which owns this collection of clusters.
3138    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3139    pub parent: std::string::String,
3140
3141    /// The maximum number of resources to list.
3142    pub page_size: i32,
3143
3144    /// A page token received from previous list request.
3145    /// A page token received from previous list request.
3146    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3147    pub page_token: std::string::String,
3148
3149    /// Only resources matching this filter will be listed.
3150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3151    pub filter: std::string::String,
3152
3153    /// Specifies the order in which resources will be listed.
3154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3155    pub order_by: std::string::String,
3156}
3157
3158impl ListClustersRequest {
3159    pub fn new() -> Self {
3160        std::default::Default::default()
3161    }
3162
3163    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
3164    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3165        self.parent = v.into();
3166        self
3167    }
3168
3169    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
3170    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3171        self.page_size = v.into();
3172        self
3173    }
3174
3175    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
3176    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3177        self.page_token = v.into();
3178        self
3179    }
3180
3181    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
3182    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183        self.filter = v.into();
3184        self
3185    }
3186
3187    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
3188    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3189        self.order_by = v.into();
3190        self
3191    }
3192}
3193
3194impl wkt::message::Message for ListClustersRequest {
3195    fn typename() -> &'static str {
3196        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersRequest"
3197    }
3198}
3199
3200/// List of clusters in a location.
3201#[serde_with::serde_as]
3202#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3203#[serde(default, rename_all = "camelCase")]
3204#[non_exhaustive]
3205pub struct ListClustersResponse {
3206    /// Clusters in the location.
3207    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3208    pub clusters: std::vec::Vec<crate::model::Cluster>,
3209
3210    /// A token to retrieve next page of results.
3211    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3212    pub next_page_token: std::string::String,
3213
3214    /// Locations that could not be reached.
3215    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3216    pub unreachable: std::vec::Vec<std::string::String>,
3217}
3218
3219impl ListClustersResponse {
3220    pub fn new() -> Self {
3221        std::default::Default::default()
3222    }
3223
3224    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
3225    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3226        self.next_page_token = v.into();
3227        self
3228    }
3229
3230    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
3231    pub fn set_clusters<T, V>(mut self, v: T) -> Self
3232    where
3233        T: std::iter::IntoIterator<Item = V>,
3234        V: std::convert::Into<crate::model::Cluster>,
3235    {
3236        use std::iter::Iterator;
3237        self.clusters = v.into_iter().map(|i| i.into()).collect();
3238        self
3239    }
3240
3241    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
3242    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3243    where
3244        T: std::iter::IntoIterator<Item = V>,
3245        V: std::convert::Into<std::string::String>,
3246    {
3247        use std::iter::Iterator;
3248        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3249        self
3250    }
3251}
3252
3253impl wkt::message::Message for ListClustersResponse {
3254    fn typename() -> &'static str {
3255        "type.googleapis.com/google.cloud.edgecontainer.v1.ListClustersResponse"
3256    }
3257}
3258
3259#[cfg(feature = "unstable-stream")]
3260impl gax::paginator::PageableResponse for ListClustersResponse {
3261    type PageItem = crate::model::Cluster;
3262
3263    fn items(self) -> std::vec::Vec<Self::PageItem> {
3264        self.clusters
3265    }
3266
3267    fn next_page_token(&self) -> std::string::String {
3268        gax::paginator::extract_token(&self.next_page_token)
3269    }
3270}
3271
3272/// Gets a cluster.
3273#[serde_with::serde_as]
3274#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3275#[serde(default, rename_all = "camelCase")]
3276#[non_exhaustive]
3277pub struct GetClusterRequest {
3278    /// Required. The resource name of the cluster.
3279    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3280    pub name: std::string::String,
3281}
3282
3283impl GetClusterRequest {
3284    pub fn new() -> Self {
3285        std::default::Default::default()
3286    }
3287
3288    /// Sets the value of [name][crate::model::GetClusterRequest::name].
3289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3290        self.name = v.into();
3291        self
3292    }
3293}
3294
3295impl wkt::message::Message for GetClusterRequest {
3296    fn typename() -> &'static str {
3297        "type.googleapis.com/google.cloud.edgecontainer.v1.GetClusterRequest"
3298    }
3299}
3300
3301/// Creates a cluster.
3302#[serde_with::serde_as]
3303#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3304#[serde(default, rename_all = "camelCase")]
3305#[non_exhaustive]
3306pub struct CreateClusterRequest {
3307    /// Required. The parent location where this cluster will be created.
3308    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3309    pub parent: std::string::String,
3310
3311    /// Required. A client-specified unique identifier for the cluster.
3312    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3313    pub cluster_id: std::string::String,
3314
3315    /// Required. The cluster to create.
3316    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3317    pub cluster: std::option::Option<crate::model::Cluster>,
3318
3319    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
3320    /// random UUID is recommended. This request is only idempotent if
3321    /// `request_id` is provided.
3322    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3323    pub request_id: std::string::String,
3324}
3325
3326impl CreateClusterRequest {
3327    pub fn new() -> Self {
3328        std::default::Default::default()
3329    }
3330
3331    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
3332    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3333        self.parent = v.into();
3334        self
3335    }
3336
3337    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
3338    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3339        self.cluster_id = v.into();
3340        self
3341    }
3342
3343    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
3344    pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
3345        mut self,
3346        v: T,
3347    ) -> Self {
3348        self.cluster = v.into();
3349        self
3350    }
3351
3352    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
3353    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3354        self.request_id = v.into();
3355        self
3356    }
3357}
3358
3359impl wkt::message::Message for CreateClusterRequest {
3360    fn typename() -> &'static str {
3361        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateClusterRequest"
3362    }
3363}
3364
3365/// Updates a cluster.
3366#[serde_with::serde_as]
3367#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3368#[serde(default, rename_all = "camelCase")]
3369#[non_exhaustive]
3370pub struct UpdateClusterRequest {
3371    /// Field mask is used to specify the fields to be overwritten in the
3372    /// Cluster resource by the update.
3373    /// The fields specified in the update_mask are relative to the resource, not
3374    /// the full request. A field will be overwritten if it is in the mask. If the
3375    /// user does not provide a mask then all fields will be overwritten.
3376    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3377    pub update_mask: std::option::Option<wkt::FieldMask>,
3378
3379    /// The updated cluster.
3380    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3381    pub cluster: std::option::Option<crate::model::Cluster>,
3382
3383    /// A unique identifier for this request. Restricted to 36 ASCII characters.
3384    /// A random UUID is recommended.
3385    /// This request is only idempotent if `request_id` is provided.
3386    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3387    pub request_id: std::string::String,
3388}
3389
3390impl UpdateClusterRequest {
3391    pub fn new() -> Self {
3392        std::default::Default::default()
3393    }
3394
3395    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
3396    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
3397        mut self,
3398        v: T,
3399    ) -> Self {
3400        self.update_mask = v.into();
3401        self
3402    }
3403
3404    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
3405    pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
3406        mut self,
3407        v: T,
3408    ) -> Self {
3409        self.cluster = v.into();
3410        self
3411    }
3412
3413    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
3414    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415        self.request_id = v.into();
3416        self
3417    }
3418}
3419
3420impl wkt::message::Message for UpdateClusterRequest {
3421    fn typename() -> &'static str {
3422        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateClusterRequest"
3423    }
3424}
3425
3426/// Upgrades a cluster.
3427#[serde_with::serde_as]
3428#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3429#[serde(default, rename_all = "camelCase")]
3430#[non_exhaustive]
3431pub struct UpgradeClusterRequest {
3432    /// Required. The resource name of the cluster.
3433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3434    pub name: std::string::String,
3435
3436    /// Required. The version the cluster is going to be upgraded to.
3437    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3438    pub target_version: std::string::String,
3439
3440    /// The schedule for the upgrade.
3441    pub schedule: crate::model::upgrade_cluster_request::Schedule,
3442
3443    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
3444    /// random UUID is recommended. This request is only idempotent if
3445    /// `request_id` is provided.
3446    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3447    pub request_id: std::string::String,
3448}
3449
3450impl UpgradeClusterRequest {
3451    pub fn new() -> Self {
3452        std::default::Default::default()
3453    }
3454
3455    /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
3456    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3457        self.name = v.into();
3458        self
3459    }
3460
3461    /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
3462    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3463        self.target_version = v.into();
3464        self
3465    }
3466
3467    /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
3468    pub fn set_schedule<T: std::convert::Into<crate::model::upgrade_cluster_request::Schedule>>(
3469        mut self,
3470        v: T,
3471    ) -> Self {
3472        self.schedule = v.into();
3473        self
3474    }
3475
3476    /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
3477    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3478        self.request_id = v.into();
3479        self
3480    }
3481}
3482
3483impl wkt::message::Message for UpgradeClusterRequest {
3484    fn typename() -> &'static str {
3485        "type.googleapis.com/google.cloud.edgecontainer.v1.UpgradeClusterRequest"
3486    }
3487}
3488
3489/// Defines additional types related to UpgradeClusterRequest
3490pub mod upgrade_cluster_request {
3491    #[allow(unused_imports)]
3492    use super::*;
3493
3494    /// Represents the schedule about when the cluster is going to be upgraded.
3495    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3496    pub struct Schedule(std::borrow::Cow<'static, str>);
3497
3498    impl Schedule {
3499        /// Creates a new Schedule instance.
3500        pub const fn new(v: &'static str) -> Self {
3501            Self(std::borrow::Cow::Borrowed(v))
3502        }
3503
3504        /// Gets the enum value.
3505        pub fn value(&self) -> &str {
3506            &self.0
3507        }
3508    }
3509
3510    /// Useful constants to work with [Schedule](Schedule)
3511    pub mod schedule {
3512        use super::Schedule;
3513
3514        /// Unspecified. The default is to upgrade the cluster immediately which is
3515        /// the only option today.
3516        pub const SCHEDULE_UNSPECIFIED: Schedule = Schedule::new("SCHEDULE_UNSPECIFIED");
3517
3518        /// The cluster is going to be upgraded immediately after receiving the
3519        /// request.
3520        pub const IMMEDIATELY: Schedule = Schedule::new("IMMEDIATELY");
3521    }
3522
3523    impl std::convert::From<std::string::String> for Schedule {
3524        fn from(value: std::string::String) -> Self {
3525            Self(std::borrow::Cow::Owned(value))
3526        }
3527    }
3528}
3529
3530/// Deletes a cluster.
3531#[serde_with::serde_as]
3532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3533#[serde(default, rename_all = "camelCase")]
3534#[non_exhaustive]
3535pub struct DeleteClusterRequest {
3536    /// Required. The resource name of the cluster.
3537    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3538    pub name: std::string::String,
3539
3540    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
3541    /// random UUID is recommended. This request is only idempotent if
3542    /// `request_id` is provided.
3543    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3544    pub request_id: std::string::String,
3545}
3546
3547impl DeleteClusterRequest {
3548    pub fn new() -> Self {
3549        std::default::Default::default()
3550    }
3551
3552    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
3553    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3554        self.name = v.into();
3555        self
3556    }
3557
3558    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
3559    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3560        self.request_id = v.into();
3561        self
3562    }
3563}
3564
3565impl wkt::message::Message for DeleteClusterRequest {
3566    fn typename() -> &'static str {
3567        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteClusterRequest"
3568    }
3569}
3570
3571/// Generates an access token for a cluster.
3572#[serde_with::serde_as]
3573#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3574#[serde(default, rename_all = "camelCase")]
3575#[non_exhaustive]
3576pub struct GenerateAccessTokenRequest {
3577    /// Required. The resource name of the cluster.
3578    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3579    pub cluster: std::string::String,
3580}
3581
3582impl GenerateAccessTokenRequest {
3583    pub fn new() -> Self {
3584        std::default::Default::default()
3585    }
3586
3587    /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
3588    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3589        self.cluster = v.into();
3590        self
3591    }
3592}
3593
3594impl wkt::message::Message for GenerateAccessTokenRequest {
3595    fn typename() -> &'static str {
3596        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenRequest"
3597    }
3598}
3599
3600/// An access token for a cluster.
3601#[serde_with::serde_as]
3602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3603#[serde(default, rename_all = "camelCase")]
3604#[non_exhaustive]
3605pub struct GenerateAccessTokenResponse {
3606    /// Output only. Access token to authenticate to k8s api-server.
3607    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3608    pub access_token: std::string::String,
3609
3610    /// Output only. Timestamp at which the token will expire.
3611    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3612    pub expire_time: std::option::Option<wkt::Timestamp>,
3613}
3614
3615impl GenerateAccessTokenResponse {
3616    pub fn new() -> Self {
3617        std::default::Default::default()
3618    }
3619
3620    /// Sets the value of [access_token][crate::model::GenerateAccessTokenResponse::access_token].
3621    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3622        self.access_token = v.into();
3623        self
3624    }
3625
3626    /// Sets the value of [expire_time][crate::model::GenerateAccessTokenResponse::expire_time].
3627    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3628        mut self,
3629        v: T,
3630    ) -> Self {
3631        self.expire_time = v.into();
3632        self
3633    }
3634}
3635
3636impl wkt::message::Message for GenerateAccessTokenResponse {
3637    fn typename() -> &'static str {
3638        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateAccessTokenResponse"
3639    }
3640}
3641
3642/// Generates an offline credential(offline) for a cluster.
3643#[serde_with::serde_as]
3644#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3645#[serde(default, rename_all = "camelCase")]
3646#[non_exhaustive]
3647pub struct GenerateOfflineCredentialRequest {
3648    /// Required. The resource name of the cluster.
3649    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3650    pub cluster: std::string::String,
3651}
3652
3653impl GenerateOfflineCredentialRequest {
3654    pub fn new() -> Self {
3655        std::default::Default::default()
3656    }
3657
3658    /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
3659    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3660        self.cluster = v.into();
3661        self
3662    }
3663}
3664
3665impl wkt::message::Message for GenerateOfflineCredentialRequest {
3666    fn typename() -> &'static str {
3667        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialRequest"
3668    }
3669}
3670
3671/// An offline credential for a cluster.
3672#[serde_with::serde_as]
3673#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3674#[serde(default, rename_all = "camelCase")]
3675#[non_exhaustive]
3676pub struct GenerateOfflineCredentialResponse {
3677    /// Output only. Client certificate to authenticate to k8s api-server.
3678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3679    pub client_certificate: std::string::String,
3680
3681    /// Output only. Client private key to authenticate to k8s api-server.
3682    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3683    pub client_key: std::string::String,
3684
3685    /// Output only. Client's identity.
3686    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3687    pub user_id: std::string::String,
3688
3689    /// Output only. Timestamp at which this credential will expire.
3690    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3691    pub expire_time: std::option::Option<wkt::Timestamp>,
3692}
3693
3694impl GenerateOfflineCredentialResponse {
3695    pub fn new() -> Self {
3696        std::default::Default::default()
3697    }
3698
3699    /// Sets the value of [client_certificate][crate::model::GenerateOfflineCredentialResponse::client_certificate].
3700    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
3701        mut self,
3702        v: T,
3703    ) -> Self {
3704        self.client_certificate = v.into();
3705        self
3706    }
3707
3708    /// Sets the value of [client_key][crate::model::GenerateOfflineCredentialResponse::client_key].
3709    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3710        self.client_key = v.into();
3711        self
3712    }
3713
3714    /// Sets the value of [user_id][crate::model::GenerateOfflineCredentialResponse::user_id].
3715    pub fn set_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3716        self.user_id = v.into();
3717        self
3718    }
3719
3720    /// Sets the value of [expire_time][crate::model::GenerateOfflineCredentialResponse::expire_time].
3721    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3722        mut self,
3723        v: T,
3724    ) -> Self {
3725        self.expire_time = v.into();
3726        self
3727    }
3728}
3729
3730impl wkt::message::Message for GenerateOfflineCredentialResponse {
3731    fn typename() -> &'static str {
3732        "type.googleapis.com/google.cloud.edgecontainer.v1.GenerateOfflineCredentialResponse"
3733    }
3734}
3735
3736/// Lists node pools in a cluster.
3737#[serde_with::serde_as]
3738#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3739#[serde(default, rename_all = "camelCase")]
3740#[non_exhaustive]
3741pub struct ListNodePoolsRequest {
3742    /// Required. The parent cluster, which owns this collection of node pools.
3743    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3744    pub parent: std::string::String,
3745
3746    /// The maximum number of resources to list.
3747    pub page_size: i32,
3748
3749    /// A page token received from previous list request.
3750    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3751    pub page_token: std::string::String,
3752
3753    /// Only resources matching this filter will be listed.
3754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3755    pub filter: std::string::String,
3756
3757    /// Specifies the order in which resources will be listed.
3758    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3759    pub order_by: std::string::String,
3760}
3761
3762impl ListNodePoolsRequest {
3763    pub fn new() -> Self {
3764        std::default::Default::default()
3765    }
3766
3767    /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
3768    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769        self.parent = v.into();
3770        self
3771    }
3772
3773    /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
3774    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3775        self.page_size = v.into();
3776        self
3777    }
3778
3779    /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
3780    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3781        self.page_token = v.into();
3782        self
3783    }
3784
3785    /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
3786    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3787        self.filter = v.into();
3788        self
3789    }
3790
3791    /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
3792    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3793        self.order_by = v.into();
3794        self
3795    }
3796}
3797
3798impl wkt::message::Message for ListNodePoolsRequest {
3799    fn typename() -> &'static str {
3800        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsRequest"
3801    }
3802}
3803
3804/// List of node pools in a cluster.
3805#[serde_with::serde_as]
3806#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3807#[serde(default, rename_all = "camelCase")]
3808#[non_exhaustive]
3809pub struct ListNodePoolsResponse {
3810    /// Node pools in the cluster.
3811    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3812    pub node_pools: std::vec::Vec<crate::model::NodePool>,
3813
3814    /// A token to retrieve next page of results.
3815    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3816    pub next_page_token: std::string::String,
3817
3818    /// Locations that could not be reached.
3819    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3820    pub unreachable: std::vec::Vec<std::string::String>,
3821}
3822
3823impl ListNodePoolsResponse {
3824    pub fn new() -> Self {
3825        std::default::Default::default()
3826    }
3827
3828    /// Sets the value of [next_page_token][crate::model::ListNodePoolsResponse::next_page_token].
3829    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3830        self.next_page_token = v.into();
3831        self
3832    }
3833
3834    /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
3835    pub fn set_node_pools<T, V>(mut self, v: T) -> Self
3836    where
3837        T: std::iter::IntoIterator<Item = V>,
3838        V: std::convert::Into<crate::model::NodePool>,
3839    {
3840        use std::iter::Iterator;
3841        self.node_pools = v.into_iter().map(|i| i.into()).collect();
3842        self
3843    }
3844
3845    /// Sets the value of [unreachable][crate::model::ListNodePoolsResponse::unreachable].
3846    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3847    where
3848        T: std::iter::IntoIterator<Item = V>,
3849        V: std::convert::Into<std::string::String>,
3850    {
3851        use std::iter::Iterator;
3852        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3853        self
3854    }
3855}
3856
3857impl wkt::message::Message for ListNodePoolsResponse {
3858    fn typename() -> &'static str {
3859        "type.googleapis.com/google.cloud.edgecontainer.v1.ListNodePoolsResponse"
3860    }
3861}
3862
3863#[cfg(feature = "unstable-stream")]
3864impl gax::paginator::PageableResponse for ListNodePoolsResponse {
3865    type PageItem = crate::model::NodePool;
3866
3867    fn items(self) -> std::vec::Vec<Self::PageItem> {
3868        self.node_pools
3869    }
3870
3871    fn next_page_token(&self) -> std::string::String {
3872        gax::paginator::extract_token(&self.next_page_token)
3873    }
3874}
3875
3876/// Gets a node pool.
3877#[serde_with::serde_as]
3878#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3879#[serde(default, rename_all = "camelCase")]
3880#[non_exhaustive]
3881pub struct GetNodePoolRequest {
3882    /// Required. The resource name of the node pool.
3883    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3884    pub name: std::string::String,
3885}
3886
3887impl GetNodePoolRequest {
3888    pub fn new() -> Self {
3889        std::default::Default::default()
3890    }
3891
3892    /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
3893    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3894        self.name = v.into();
3895        self
3896    }
3897}
3898
3899impl wkt::message::Message for GetNodePoolRequest {
3900    fn typename() -> &'static str {
3901        "type.googleapis.com/google.cloud.edgecontainer.v1.GetNodePoolRequest"
3902    }
3903}
3904
3905/// Creates a node pool.
3906#[serde_with::serde_as]
3907#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3908#[serde(default, rename_all = "camelCase")]
3909#[non_exhaustive]
3910pub struct CreateNodePoolRequest {
3911    /// Required. The parent cluster where this node pool will be created.
3912    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3913    pub parent: std::string::String,
3914
3915    /// Required. A client-specified unique identifier for the node pool.
3916    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3917    pub node_pool_id: std::string::String,
3918
3919    /// Required. The node pool to create.
3920    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3921    pub node_pool: std::option::Option<crate::model::NodePool>,
3922
3923    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
3924    /// random UUID is recommended. This request is only idempotent if
3925    /// `request_id` is provided.
3926    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3927    pub request_id: std::string::String,
3928}
3929
3930impl CreateNodePoolRequest {
3931    pub fn new() -> Self {
3932        std::default::Default::default()
3933    }
3934
3935    /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
3936    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3937        self.parent = v.into();
3938        self
3939    }
3940
3941    /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
3942    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3943        self.node_pool_id = v.into();
3944        self
3945    }
3946
3947    /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
3948    pub fn set_node_pool<T: std::convert::Into<std::option::Option<crate::model::NodePool>>>(
3949        mut self,
3950        v: T,
3951    ) -> Self {
3952        self.node_pool = v.into();
3953        self
3954    }
3955
3956    /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
3957    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3958        self.request_id = v.into();
3959        self
3960    }
3961}
3962
3963impl wkt::message::Message for CreateNodePoolRequest {
3964    fn typename() -> &'static str {
3965        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateNodePoolRequest"
3966    }
3967}
3968
3969/// Updates a node pool.
3970#[serde_with::serde_as]
3971#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3972#[serde(default, rename_all = "camelCase")]
3973#[non_exhaustive]
3974pub struct UpdateNodePoolRequest {
3975    /// Field mask is used to specify the fields to be overwritten in the
3976    /// NodePool resource by the update.
3977    /// The fields specified in the update_mask are relative to the resource, not
3978    /// the full request. A field will be overwritten if it is in the mask. If the
3979    /// user does not provide a mask then all fields will be overwritten.
3980    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3981    pub update_mask: std::option::Option<wkt::FieldMask>,
3982
3983    /// The updated node pool.
3984    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3985    pub node_pool: std::option::Option<crate::model::NodePool>,
3986
3987    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
3988    /// random UUID is recommended. This request is only idempotent if
3989    /// `request_id` is provided.
3990    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3991    pub request_id: std::string::String,
3992}
3993
3994impl UpdateNodePoolRequest {
3995    pub fn new() -> Self {
3996        std::default::Default::default()
3997    }
3998
3999    /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
4000    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
4001        mut self,
4002        v: T,
4003    ) -> Self {
4004        self.update_mask = v.into();
4005        self
4006    }
4007
4008    /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
4009    pub fn set_node_pool<T: std::convert::Into<std::option::Option<crate::model::NodePool>>>(
4010        mut self,
4011        v: T,
4012    ) -> Self {
4013        self.node_pool = v.into();
4014        self
4015    }
4016
4017    /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
4018    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4019        self.request_id = v.into();
4020        self
4021    }
4022}
4023
4024impl wkt::message::Message for UpdateNodePoolRequest {
4025    fn typename() -> &'static str {
4026        "type.googleapis.com/google.cloud.edgecontainer.v1.UpdateNodePoolRequest"
4027    }
4028}
4029
4030/// Deletes a node pool.
4031#[serde_with::serde_as]
4032#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4033#[serde(default, rename_all = "camelCase")]
4034#[non_exhaustive]
4035pub struct DeleteNodePoolRequest {
4036    /// Required. The resource name of the node pool.
4037    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4038    pub name: std::string::String,
4039
4040    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4041    /// random UUID is recommended. This request is only idempotent if
4042    /// `request_id` is provided.
4043    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4044    pub request_id: std::string::String,
4045}
4046
4047impl DeleteNodePoolRequest {
4048    pub fn new() -> Self {
4049        std::default::Default::default()
4050    }
4051
4052    /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
4053    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4054        self.name = v.into();
4055        self
4056    }
4057
4058    /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
4059    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4060        self.request_id = v.into();
4061        self
4062    }
4063}
4064
4065impl wkt::message::Message for DeleteNodePoolRequest {
4066    fn typename() -> &'static str {
4067        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteNodePoolRequest"
4068    }
4069}
4070
4071/// Lists machines in a site.
4072#[serde_with::serde_as]
4073#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4074#[serde(default, rename_all = "camelCase")]
4075#[non_exhaustive]
4076pub struct ListMachinesRequest {
4077    /// Required. The parent site, which owns this collection of machines.
4078    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4079    pub parent: std::string::String,
4080
4081    /// The maximum number of resources to list.
4082    pub page_size: i32,
4083
4084    /// A page token received from previous list request.
4085    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4086    pub page_token: std::string::String,
4087
4088    /// Only resources matching this filter will be listed.
4089    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4090    pub filter: std::string::String,
4091
4092    /// Specifies the order in which resources will be listed.
4093    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4094    pub order_by: std::string::String,
4095}
4096
4097impl ListMachinesRequest {
4098    pub fn new() -> Self {
4099        std::default::Default::default()
4100    }
4101
4102    /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
4103    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4104        self.parent = v.into();
4105        self
4106    }
4107
4108    /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
4109    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4110        self.page_size = v.into();
4111        self
4112    }
4113
4114    /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
4115    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4116        self.page_token = v.into();
4117        self
4118    }
4119
4120    /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
4121    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4122        self.filter = v.into();
4123        self
4124    }
4125
4126    /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
4127    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4128        self.order_by = v.into();
4129        self
4130    }
4131}
4132
4133impl wkt::message::Message for ListMachinesRequest {
4134    fn typename() -> &'static str {
4135        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesRequest"
4136    }
4137}
4138
4139/// List of machines in a site.
4140#[serde_with::serde_as]
4141#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4142#[serde(default, rename_all = "camelCase")]
4143#[non_exhaustive]
4144pub struct ListMachinesResponse {
4145    /// Machines in the site.
4146    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4147    pub machines: std::vec::Vec<crate::model::Machine>,
4148
4149    /// A token to retrieve next page of results.
4150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4151    pub next_page_token: std::string::String,
4152
4153    /// Locations that could not be reached.
4154    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4155    pub unreachable: std::vec::Vec<std::string::String>,
4156}
4157
4158impl ListMachinesResponse {
4159    pub fn new() -> Self {
4160        std::default::Default::default()
4161    }
4162
4163    /// Sets the value of [next_page_token][crate::model::ListMachinesResponse::next_page_token].
4164    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4165        self.next_page_token = v.into();
4166        self
4167    }
4168
4169    /// Sets the value of [machines][crate::model::ListMachinesResponse::machines].
4170    pub fn set_machines<T, V>(mut self, v: T) -> Self
4171    where
4172        T: std::iter::IntoIterator<Item = V>,
4173        V: std::convert::Into<crate::model::Machine>,
4174    {
4175        use std::iter::Iterator;
4176        self.machines = v.into_iter().map(|i| i.into()).collect();
4177        self
4178    }
4179
4180    /// Sets the value of [unreachable][crate::model::ListMachinesResponse::unreachable].
4181    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4182    where
4183        T: std::iter::IntoIterator<Item = V>,
4184        V: std::convert::Into<std::string::String>,
4185    {
4186        use std::iter::Iterator;
4187        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4188        self
4189    }
4190}
4191
4192impl wkt::message::Message for ListMachinesResponse {
4193    fn typename() -> &'static str {
4194        "type.googleapis.com/google.cloud.edgecontainer.v1.ListMachinesResponse"
4195    }
4196}
4197
4198#[cfg(feature = "unstable-stream")]
4199impl gax::paginator::PageableResponse for ListMachinesResponse {
4200    type PageItem = crate::model::Machine;
4201
4202    fn items(self) -> std::vec::Vec<Self::PageItem> {
4203        self.machines
4204    }
4205
4206    fn next_page_token(&self) -> std::string::String {
4207        gax::paginator::extract_token(&self.next_page_token)
4208    }
4209}
4210
4211/// Gets a machine.
4212#[serde_with::serde_as]
4213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4214#[serde(default, rename_all = "camelCase")]
4215#[non_exhaustive]
4216pub struct GetMachineRequest {
4217    /// Required. The resource name of the machine.
4218    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4219    pub name: std::string::String,
4220}
4221
4222impl GetMachineRequest {
4223    pub fn new() -> Self {
4224        std::default::Default::default()
4225    }
4226
4227    /// Sets the value of [name][crate::model::GetMachineRequest::name].
4228    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4229        self.name = v.into();
4230        self
4231    }
4232}
4233
4234impl wkt::message::Message for GetMachineRequest {
4235    fn typename() -> &'static str {
4236        "type.googleapis.com/google.cloud.edgecontainer.v1.GetMachineRequest"
4237    }
4238}
4239
4240/// Lists VPN connections.
4241#[serde_with::serde_as]
4242#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4243#[serde(default, rename_all = "camelCase")]
4244#[non_exhaustive]
4245pub struct ListVpnConnectionsRequest {
4246    /// Required. The parent location, which owns this collection of VPN
4247    /// connections.
4248    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4249    pub parent: std::string::String,
4250
4251    /// The maximum number of resources to list.
4252    pub page_size: i32,
4253
4254    /// A page token received from previous list request.
4255    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4256    pub page_token: std::string::String,
4257
4258    /// Only resources matching this filter will be listed.
4259    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4260    pub filter: std::string::String,
4261
4262    /// Specifies the order in which resources will be listed.
4263    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4264    pub order_by: std::string::String,
4265}
4266
4267impl ListVpnConnectionsRequest {
4268    pub fn new() -> Self {
4269        std::default::Default::default()
4270    }
4271
4272    /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
4273    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4274        self.parent = v.into();
4275        self
4276    }
4277
4278    /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
4279    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4280        self.page_size = v.into();
4281        self
4282    }
4283
4284    /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
4285    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4286        self.page_token = v.into();
4287        self
4288    }
4289
4290    /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
4291    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4292        self.filter = v.into();
4293        self
4294    }
4295
4296    /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
4297    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4298        self.order_by = v.into();
4299        self
4300    }
4301}
4302
4303impl wkt::message::Message for ListVpnConnectionsRequest {
4304    fn typename() -> &'static str {
4305        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsRequest"
4306    }
4307}
4308
4309/// List of VPN connections in a location.
4310#[serde_with::serde_as]
4311#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4312#[serde(default, rename_all = "camelCase")]
4313#[non_exhaustive]
4314pub struct ListVpnConnectionsResponse {
4315    /// VpnConnections in the location.
4316    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4317    pub vpn_connections: std::vec::Vec<crate::model::VpnConnection>,
4318
4319    /// A token to retrieve next page of results.
4320    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4321    pub next_page_token: std::string::String,
4322
4323    /// Locations that could not be reached.
4324    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4325    pub unreachable: std::vec::Vec<std::string::String>,
4326}
4327
4328impl ListVpnConnectionsResponse {
4329    pub fn new() -> Self {
4330        std::default::Default::default()
4331    }
4332
4333    /// Sets the value of [next_page_token][crate::model::ListVpnConnectionsResponse::next_page_token].
4334    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4335        self.next_page_token = v.into();
4336        self
4337    }
4338
4339    /// Sets the value of [vpn_connections][crate::model::ListVpnConnectionsResponse::vpn_connections].
4340    pub fn set_vpn_connections<T, V>(mut self, v: T) -> Self
4341    where
4342        T: std::iter::IntoIterator<Item = V>,
4343        V: std::convert::Into<crate::model::VpnConnection>,
4344    {
4345        use std::iter::Iterator;
4346        self.vpn_connections = v.into_iter().map(|i| i.into()).collect();
4347        self
4348    }
4349
4350    /// Sets the value of [unreachable][crate::model::ListVpnConnectionsResponse::unreachable].
4351    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4352    where
4353        T: std::iter::IntoIterator<Item = V>,
4354        V: std::convert::Into<std::string::String>,
4355    {
4356        use std::iter::Iterator;
4357        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4358        self
4359    }
4360}
4361
4362impl wkt::message::Message for ListVpnConnectionsResponse {
4363    fn typename() -> &'static str {
4364        "type.googleapis.com/google.cloud.edgecontainer.v1.ListVpnConnectionsResponse"
4365    }
4366}
4367
4368#[cfg(feature = "unstable-stream")]
4369impl gax::paginator::PageableResponse for ListVpnConnectionsResponse {
4370    type PageItem = crate::model::VpnConnection;
4371
4372    fn items(self) -> std::vec::Vec<Self::PageItem> {
4373        self.vpn_connections
4374    }
4375
4376    fn next_page_token(&self) -> std::string::String {
4377        gax::paginator::extract_token(&self.next_page_token)
4378    }
4379}
4380
4381/// Gets a VPN connection.
4382#[serde_with::serde_as]
4383#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4384#[serde(default, rename_all = "camelCase")]
4385#[non_exhaustive]
4386pub struct GetVpnConnectionRequest {
4387    /// Required. The resource name of the vpn connection.
4388    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4389    pub name: std::string::String,
4390}
4391
4392impl GetVpnConnectionRequest {
4393    pub fn new() -> Self {
4394        std::default::Default::default()
4395    }
4396
4397    /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
4398    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4399        self.name = v.into();
4400        self
4401    }
4402}
4403
4404impl wkt::message::Message for GetVpnConnectionRequest {
4405    fn typename() -> &'static str {
4406        "type.googleapis.com/google.cloud.edgecontainer.v1.GetVpnConnectionRequest"
4407    }
4408}
4409
4410/// Creates a VPN connection.
4411#[serde_with::serde_as]
4412#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4413#[serde(default, rename_all = "camelCase")]
4414#[non_exhaustive]
4415pub struct CreateVpnConnectionRequest {
4416    /// Required. The parent location where this vpn connection will be created.
4417    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4418    pub parent: std::string::String,
4419
4420    /// Required. The VPN connection identifier.
4421    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4422    pub vpn_connection_id: std::string::String,
4423
4424    /// Required. The VPN connection to create.
4425    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4426    pub vpn_connection: std::option::Option<crate::model::VpnConnection>,
4427
4428    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4429    /// random UUID is recommended. This request is only idempotent if
4430    /// `request_id` is provided.
4431    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4432    pub request_id: std::string::String,
4433}
4434
4435impl CreateVpnConnectionRequest {
4436    pub fn new() -> Self {
4437        std::default::Default::default()
4438    }
4439
4440    /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
4441    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442        self.parent = v.into();
4443        self
4444    }
4445
4446    /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
4447    pub fn set_vpn_connection_id<T: std::convert::Into<std::string::String>>(
4448        mut self,
4449        v: T,
4450    ) -> Self {
4451        self.vpn_connection_id = v.into();
4452        self
4453    }
4454
4455    /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
4456    pub fn set_vpn_connection<
4457        T: std::convert::Into<std::option::Option<crate::model::VpnConnection>>,
4458    >(
4459        mut self,
4460        v: T,
4461    ) -> Self {
4462        self.vpn_connection = v.into();
4463        self
4464    }
4465
4466    /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
4467    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4468        self.request_id = v.into();
4469        self
4470    }
4471}
4472
4473impl wkt::message::Message for CreateVpnConnectionRequest {
4474    fn typename() -> &'static str {
4475        "type.googleapis.com/google.cloud.edgecontainer.v1.CreateVpnConnectionRequest"
4476    }
4477}
4478
4479/// Deletes a vpn connection.
4480#[serde_with::serde_as]
4481#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4482#[serde(default, rename_all = "camelCase")]
4483#[non_exhaustive]
4484pub struct DeleteVpnConnectionRequest {
4485    /// Required. The resource name of the vpn connection.
4486    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4487    pub name: std::string::String,
4488
4489    /// A unique identifier for this request. Restricted to 36 ASCII characters. A
4490    /// random UUID is recommended. This request is only idempotent if
4491    /// `request_id` is provided.
4492    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4493    pub request_id: std::string::String,
4494}
4495
4496impl DeleteVpnConnectionRequest {
4497    pub fn new() -> Self {
4498        std::default::Default::default()
4499    }
4500
4501    /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
4502    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4503        self.name = v.into();
4504        self
4505    }
4506
4507    /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
4508    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4509        self.request_id = v.into();
4510        self
4511    }
4512}
4513
4514impl wkt::message::Message for DeleteVpnConnectionRequest {
4515    fn typename() -> &'static str {
4516        "type.googleapis.com/google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest"
4517    }
4518}
4519
4520/// Gets the server config.
4521#[serde_with::serde_as]
4522#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4523#[serde(default, rename_all = "camelCase")]
4524#[non_exhaustive]
4525pub struct GetServerConfigRequest {
4526    /// Required. The name (project and location) of the server config to get,
4527    /// specified in the format `projects/*/locations/*`.
4528    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4529    pub name: std::string::String,
4530}
4531
4532impl GetServerConfigRequest {
4533    pub fn new() -> Self {
4534        std::default::Default::default()
4535    }
4536
4537    /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
4538    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4539        self.name = v.into();
4540        self
4541    }
4542}
4543
4544impl wkt::message::Message for GetServerConfigRequest {
4545    fn typename() -> &'static str {
4546        "type.googleapis.com/google.cloud.edgecontainer.v1.GetServerConfigRequest"
4547    }
4548}
4549
4550/// Represents the accessibility state of a customer-managed KMS key used for
4551/// CMEK integration.
4552#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4553pub struct KmsKeyState(std::borrow::Cow<'static, str>);
4554
4555impl KmsKeyState {
4556    /// Creates a new KmsKeyState instance.
4557    pub const fn new(v: &'static str) -> Self {
4558        Self(std::borrow::Cow::Borrowed(v))
4559    }
4560
4561    /// Gets the enum value.
4562    pub fn value(&self) -> &str {
4563        &self.0
4564    }
4565}
4566
4567/// Useful constants to work with [KmsKeyState](KmsKeyState)
4568pub mod kms_key_state {
4569    use super::KmsKeyState;
4570
4571    /// Unspecified.
4572    pub const KMS_KEY_STATE_UNSPECIFIED: KmsKeyState =
4573        KmsKeyState::new("KMS_KEY_STATE_UNSPECIFIED");
4574
4575    /// The key is available for use, and dependent resources should be accessible.
4576    pub const KMS_KEY_STATE_KEY_AVAILABLE: KmsKeyState =
4577        KmsKeyState::new("KMS_KEY_STATE_KEY_AVAILABLE");
4578
4579    /// The key is unavailable for an unspecified reason. Dependent resources may
4580    /// be inaccessible.
4581    pub const KMS_KEY_STATE_KEY_UNAVAILABLE: KmsKeyState =
4582        KmsKeyState::new("KMS_KEY_STATE_KEY_UNAVAILABLE");
4583}
4584
4585impl std::convert::From<std::string::String> for KmsKeyState {
4586    fn from(value: std::string::String) -> Self {
4587        Self(std::borrow::Cow::Owned(value))
4588    }
4589}
4590
4591/// Represents if the resource is in lock down state or pending.
4592#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4593pub struct ResourceState(std::borrow::Cow<'static, str>);
4594
4595impl ResourceState {
4596    /// Creates a new ResourceState instance.
4597    pub const fn new(v: &'static str) -> Self {
4598        Self(std::borrow::Cow::Borrowed(v))
4599    }
4600
4601    /// Gets the enum value.
4602    pub fn value(&self) -> &str {
4603        &self.0
4604    }
4605}
4606
4607/// Useful constants to work with [ResourceState](ResourceState)
4608pub mod resource_state {
4609    use super::ResourceState;
4610
4611    /// Default value.
4612    pub const RESOURCE_STATE_UNSPECIFIED: ResourceState =
4613        ResourceState::new("RESOURCE_STATE_UNSPECIFIED");
4614
4615    /// The resource is in LOCK DOWN state.
4616    pub const RESOURCE_STATE_LOCK_DOWN: ResourceState =
4617        ResourceState::new("RESOURCE_STATE_LOCK_DOWN");
4618
4619    /// The resource is pending lock down.
4620    pub const RESOURCE_STATE_LOCK_DOWN_PENDING: ResourceState =
4621        ResourceState::new("RESOURCE_STATE_LOCK_DOWN_PENDING");
4622}
4623
4624impl std::convert::From<std::string::String> for ResourceState {
4625    fn from(value: std::string::String) -> Self {
4626        Self(std::borrow::Cow::Owned(value))
4627    }
4628}