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