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