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