google_cloud_edgecontainer_v1/
model.rs

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