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