google_cloud_container_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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_rpc;
27extern crate google_cloud_type;
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/// Parameters that can be configured on Linux nodes.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct LinuxNodeConfig {
43 /// The Linux kernel parameters to be applied to the nodes and all pods running
44 /// on the nodes.
45 ///
46 /// The following parameters are supported.
47 ///
48 /// net.core.busy_poll
49 /// net.core.busy_read
50 /// net.core.netdev_max_backlog
51 /// net.core.rmem_max
52 /// net.core.rmem_default
53 /// net.core.wmem_default
54 /// net.core.wmem_max
55 /// net.core.optmem_max
56 /// net.core.somaxconn
57 /// net.ipv4.neigh.default.gc_thresh1
58 /// net.ipv4.neigh.default.gc_thresh2
59 /// net.ipv4.neigh.default.gc_thresh3
60 /// net.ipv4.tcp_rmem
61 /// net.ipv4.tcp_wmem
62 /// net.ipv4.tcp_tw_reuse
63 /// net.ipv4.tcp_mtu_probing
64 /// net.ipv4.tcp_max_orphans
65 /// net.ipv4.tcp_max_tw_buckets
66 /// net.ipv4.tcp_syn_retries
67 /// net.ipv4.tcp_ecn
68 /// net.ipv4.tcp_congestion_control
69 /// net.netfilter.nf_conntrack_max
70 /// net.netfilter.nf_conntrack_buckets
71 /// net.netfilter.nf_conntrack_tcp_timeout_close_wait
72 /// net.netfilter.nf_conntrack_tcp_timeout_time_wait
73 /// net.netfilter.nf_conntrack_tcp_timeout_established
74 /// net.netfilter.nf_conntrack_acct
75 /// kernel.keys.maxkeys
76 /// kernel.keys.maxbytes
77 /// kernel.shmmni
78 /// kernel.shmmax
79 /// kernel.shmall
80 /// kernel.perf_event_paranoid
81 /// kernel.sched_rt_runtime_us
82 /// kernel.softlockup_panic
83 /// kernel.yama.ptrace_scope
84 /// kernel.kptr_restrict
85 /// kernel.dmesg_restrict
86 /// kernel.sysrq
87 /// fs.aio-max-nr
88 /// fs.file-max
89 /// fs.inotify.max_user_instances
90 /// fs.inotify.max_user_watches
91 /// fs.nr_open
92 /// vm.dirty_background_ratio
93 /// vm.dirty_background_bytes
94 /// vm.dirty_expire_centisecs
95 /// vm.dirty_ratio
96 /// vm.dirty_bytes
97 /// vm.dirty_writeback_centisecs
98 /// vm.max_map_count
99 /// vm.overcommit_memory
100 /// vm.overcommit_ratio
101 /// vm.vfs_cache_pressure
102 /// vm.swappiness
103 /// vm.watermark_scale_factor
104 /// vm.min_free_kbytes
105 pub sysctls: std::collections::HashMap<std::string::String, std::string::String>,
106
107 /// cgroup_mode specifies the cgroup mode to be used on the node.
108 pub cgroup_mode: crate::model::linux_node_config::CgroupMode,
109
110 /// Optional. Amounts for 2M and 1G hugepages
111 pub hugepages: std::option::Option<crate::model::linux_node_config::HugepagesConfig>,
112
113 /// Optional. Transparent hugepage support for anonymous memory can be entirely
114 /// disabled (mostly for debugging purposes) or only enabled inside
115 /// MADV_HUGEPAGE regions (to avoid the risk of consuming more memory
116 /// resources) or enabled system wide.
117 ///
118 /// See <https://docs.kernel.org/admin-guide/mm/transhuge.html>
119 /// for more details.
120 pub transparent_hugepage_enabled: crate::model::linux_node_config::TransparentHugepageEnabled,
121
122 /// Optional. Defines the transparent hugepage defrag configuration on the
123 /// node. VM hugepage allocation can be managed by either limiting
124 /// defragmentation for delayed allocation or skipping it entirely for
125 /// immediate allocation only.
126 ///
127 /// See <https://docs.kernel.org/admin-guide/mm/transhuge.html>
128 /// for more details.
129 pub transparent_hugepage_defrag: crate::model::linux_node_config::TransparentHugepageDefrag,
130
131 /// Optional. Allow users to run arbitrary bash script or container on the
132 /// node.
133 pub custom_node_init: std::option::Option<crate::model::linux_node_config::CustomNodeInit>,
134
135 /// Optional. Enables and configures swap space on nodes.
136 /// If omitted, swap is disabled.
137 pub swap_config: std::option::Option<crate::model::linux_node_config::SwapConfig>,
138
139 /// Optional. Configuration for kernel module loading on nodes.
140 /// When enabled, the node pool will be provisioned with a Container-Optimized
141 /// OS image that enforces kernel module signature verification.
142 pub node_kernel_module_loading:
143 std::option::Option<crate::model::linux_node_config::NodeKernelModuleLoading>,
144
145 /// Optional. The accurate time configuration for the node pool.
146 pub accurate_time_config:
147 std::option::Option<crate::model::linux_node_config::AccurateTimeConfig>,
148
149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
150}
151
152impl LinuxNodeConfig {
153 /// Creates a new default instance.
154 pub fn new() -> Self {
155 std::default::Default::default()
156 }
157
158 /// Sets the value of [sysctls][crate::model::LinuxNodeConfig::sysctls].
159 ///
160 /// # Example
161 /// ```ignore,no_run
162 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
163 /// let x = LinuxNodeConfig::new().set_sysctls([
164 /// ("key0", "abc"),
165 /// ("key1", "xyz"),
166 /// ]);
167 /// ```
168 pub fn set_sysctls<T, K, V>(mut self, v: T) -> Self
169 where
170 T: std::iter::IntoIterator<Item = (K, V)>,
171 K: std::convert::Into<std::string::String>,
172 V: std::convert::Into<std::string::String>,
173 {
174 use std::iter::Iterator;
175 self.sysctls = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
176 self
177 }
178
179 /// Sets the value of [cgroup_mode][crate::model::LinuxNodeConfig::cgroup_mode].
180 ///
181 /// # Example
182 /// ```ignore,no_run
183 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
184 /// use google_cloud_container_v1::model::linux_node_config::CgroupMode;
185 /// let x0 = LinuxNodeConfig::new().set_cgroup_mode(CgroupMode::V1);
186 /// let x1 = LinuxNodeConfig::new().set_cgroup_mode(CgroupMode::V2);
187 /// ```
188 pub fn set_cgroup_mode<T: std::convert::Into<crate::model::linux_node_config::CgroupMode>>(
189 mut self,
190 v: T,
191 ) -> Self {
192 self.cgroup_mode = v.into();
193 self
194 }
195
196 /// Sets the value of [hugepages][crate::model::LinuxNodeConfig::hugepages].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
201 /// use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
202 /// let x = LinuxNodeConfig::new().set_hugepages(HugepagesConfig::default()/* use setters */);
203 /// ```
204 pub fn set_hugepages<T>(mut self, v: T) -> Self
205 where
206 T: std::convert::Into<crate::model::linux_node_config::HugepagesConfig>,
207 {
208 self.hugepages = std::option::Option::Some(v.into());
209 self
210 }
211
212 /// Sets or clears the value of [hugepages][crate::model::LinuxNodeConfig::hugepages].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
217 /// use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
218 /// let x = LinuxNodeConfig::new().set_or_clear_hugepages(Some(HugepagesConfig::default()/* use setters */));
219 /// let x = LinuxNodeConfig::new().set_or_clear_hugepages(None::<HugepagesConfig>);
220 /// ```
221 pub fn set_or_clear_hugepages<T>(mut self, v: std::option::Option<T>) -> Self
222 where
223 T: std::convert::Into<crate::model::linux_node_config::HugepagesConfig>,
224 {
225 self.hugepages = v.map(|x| x.into());
226 self
227 }
228
229 /// Sets the value of [transparent_hugepage_enabled][crate::model::LinuxNodeConfig::transparent_hugepage_enabled].
230 ///
231 /// # Example
232 /// ```ignore,no_run
233 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
234 /// use google_cloud_container_v1::model::linux_node_config::TransparentHugepageEnabled;
235 /// let x0 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Always);
236 /// let x1 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Madvise);
237 /// let x2 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Never);
238 /// ```
239 pub fn set_transparent_hugepage_enabled<
240 T: std::convert::Into<crate::model::linux_node_config::TransparentHugepageEnabled>,
241 >(
242 mut self,
243 v: T,
244 ) -> Self {
245 self.transparent_hugepage_enabled = v.into();
246 self
247 }
248
249 /// Sets the value of [transparent_hugepage_defrag][crate::model::LinuxNodeConfig::transparent_hugepage_defrag].
250 ///
251 /// # Example
252 /// ```ignore,no_run
253 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
254 /// use google_cloud_container_v1::model::linux_node_config::TransparentHugepageDefrag;
255 /// let x0 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::Always);
256 /// let x1 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::Defer);
257 /// let x2 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::DeferWithMadvise);
258 /// ```
259 pub fn set_transparent_hugepage_defrag<
260 T: std::convert::Into<crate::model::linux_node_config::TransparentHugepageDefrag>,
261 >(
262 mut self,
263 v: T,
264 ) -> Self {
265 self.transparent_hugepage_defrag = v.into();
266 self
267 }
268
269 /// Sets the value of [custom_node_init][crate::model::LinuxNodeConfig::custom_node_init].
270 ///
271 /// # Example
272 /// ```ignore,no_run
273 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
274 /// use google_cloud_container_v1::model::linux_node_config::CustomNodeInit;
275 /// let x = LinuxNodeConfig::new().set_custom_node_init(CustomNodeInit::default()/* use setters */);
276 /// ```
277 pub fn set_custom_node_init<T>(mut self, v: T) -> Self
278 where
279 T: std::convert::Into<crate::model::linux_node_config::CustomNodeInit>,
280 {
281 self.custom_node_init = std::option::Option::Some(v.into());
282 self
283 }
284
285 /// Sets or clears the value of [custom_node_init][crate::model::LinuxNodeConfig::custom_node_init].
286 ///
287 /// # Example
288 /// ```ignore,no_run
289 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
290 /// use google_cloud_container_v1::model::linux_node_config::CustomNodeInit;
291 /// let x = LinuxNodeConfig::new().set_or_clear_custom_node_init(Some(CustomNodeInit::default()/* use setters */));
292 /// let x = LinuxNodeConfig::new().set_or_clear_custom_node_init(None::<CustomNodeInit>);
293 /// ```
294 pub fn set_or_clear_custom_node_init<T>(mut self, v: std::option::Option<T>) -> Self
295 where
296 T: std::convert::Into<crate::model::linux_node_config::CustomNodeInit>,
297 {
298 self.custom_node_init = v.map(|x| x.into());
299 self
300 }
301
302 /// Sets the value of [swap_config][crate::model::LinuxNodeConfig::swap_config].
303 ///
304 /// # Example
305 /// ```ignore,no_run
306 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
307 /// use google_cloud_container_v1::model::linux_node_config::SwapConfig;
308 /// let x = LinuxNodeConfig::new().set_swap_config(SwapConfig::default()/* use setters */);
309 /// ```
310 pub fn set_swap_config<T>(mut self, v: T) -> Self
311 where
312 T: std::convert::Into<crate::model::linux_node_config::SwapConfig>,
313 {
314 self.swap_config = std::option::Option::Some(v.into());
315 self
316 }
317
318 /// Sets or clears the value of [swap_config][crate::model::LinuxNodeConfig::swap_config].
319 ///
320 /// # Example
321 /// ```ignore,no_run
322 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
323 /// use google_cloud_container_v1::model::linux_node_config::SwapConfig;
324 /// let x = LinuxNodeConfig::new().set_or_clear_swap_config(Some(SwapConfig::default()/* use setters */));
325 /// let x = LinuxNodeConfig::new().set_or_clear_swap_config(None::<SwapConfig>);
326 /// ```
327 pub fn set_or_clear_swap_config<T>(mut self, v: std::option::Option<T>) -> Self
328 where
329 T: std::convert::Into<crate::model::linux_node_config::SwapConfig>,
330 {
331 self.swap_config = v.map(|x| x.into());
332 self
333 }
334
335 /// Sets the value of [node_kernel_module_loading][crate::model::LinuxNodeConfig::node_kernel_module_loading].
336 ///
337 /// # Example
338 /// ```ignore,no_run
339 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
340 /// use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
341 /// let x = LinuxNodeConfig::new().set_node_kernel_module_loading(NodeKernelModuleLoading::default()/* use setters */);
342 /// ```
343 pub fn set_node_kernel_module_loading<T>(mut self, v: T) -> Self
344 where
345 T: std::convert::Into<crate::model::linux_node_config::NodeKernelModuleLoading>,
346 {
347 self.node_kernel_module_loading = std::option::Option::Some(v.into());
348 self
349 }
350
351 /// Sets or clears the value of [node_kernel_module_loading][crate::model::LinuxNodeConfig::node_kernel_module_loading].
352 ///
353 /// # Example
354 /// ```ignore,no_run
355 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
356 /// use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
357 /// let x = LinuxNodeConfig::new().set_or_clear_node_kernel_module_loading(Some(NodeKernelModuleLoading::default()/* use setters */));
358 /// let x = LinuxNodeConfig::new().set_or_clear_node_kernel_module_loading(None::<NodeKernelModuleLoading>);
359 /// ```
360 pub fn set_or_clear_node_kernel_module_loading<T>(mut self, v: std::option::Option<T>) -> Self
361 where
362 T: std::convert::Into<crate::model::linux_node_config::NodeKernelModuleLoading>,
363 {
364 self.node_kernel_module_loading = v.map(|x| x.into());
365 self
366 }
367
368 /// Sets the value of [accurate_time_config][crate::model::LinuxNodeConfig::accurate_time_config].
369 ///
370 /// # Example
371 /// ```ignore,no_run
372 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
373 /// use google_cloud_container_v1::model::linux_node_config::AccurateTimeConfig;
374 /// let x = LinuxNodeConfig::new().set_accurate_time_config(AccurateTimeConfig::default()/* use setters */);
375 /// ```
376 pub fn set_accurate_time_config<T>(mut self, v: T) -> Self
377 where
378 T: std::convert::Into<crate::model::linux_node_config::AccurateTimeConfig>,
379 {
380 self.accurate_time_config = std::option::Option::Some(v.into());
381 self
382 }
383
384 /// Sets or clears the value of [accurate_time_config][crate::model::LinuxNodeConfig::accurate_time_config].
385 ///
386 /// # Example
387 /// ```ignore,no_run
388 /// # use google_cloud_container_v1::model::LinuxNodeConfig;
389 /// use google_cloud_container_v1::model::linux_node_config::AccurateTimeConfig;
390 /// let x = LinuxNodeConfig::new().set_or_clear_accurate_time_config(Some(AccurateTimeConfig::default()/* use setters */));
391 /// let x = LinuxNodeConfig::new().set_or_clear_accurate_time_config(None::<AccurateTimeConfig>);
392 /// ```
393 pub fn set_or_clear_accurate_time_config<T>(mut self, v: std::option::Option<T>) -> Self
394 where
395 T: std::convert::Into<crate::model::linux_node_config::AccurateTimeConfig>,
396 {
397 self.accurate_time_config = v.map(|x| x.into());
398 self
399 }
400}
401
402impl wkt::message::Message for LinuxNodeConfig {
403 fn typename() -> &'static str {
404 "type.googleapis.com/google.container.v1.LinuxNodeConfig"
405 }
406}
407
408/// Defines additional types related to [LinuxNodeConfig].
409pub mod linux_node_config {
410 #[allow(unused_imports)]
411 use super::*;
412
413 /// Hugepages amount in both 2m and 1g size
414 #[derive(Clone, Default, PartialEq)]
415 #[non_exhaustive]
416 pub struct HugepagesConfig {
417 /// Optional. Amount of 2M hugepages
418 pub hugepage_size2m: std::option::Option<i32>,
419
420 /// Optional. Amount of 1G hugepages
421 pub hugepage_size1g: std::option::Option<i32>,
422
423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
424 }
425
426 impl HugepagesConfig {
427 /// Creates a new default instance.
428 pub fn new() -> Self {
429 std::default::Default::default()
430 }
431
432 /// Sets the value of [hugepage_size2m][crate::model::linux_node_config::HugepagesConfig::hugepage_size2m].
433 ///
434 /// # Example
435 /// ```ignore,no_run
436 /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
437 /// let x = HugepagesConfig::new().set_hugepage_size2m(42);
438 /// ```
439 pub fn set_hugepage_size2m<T>(mut self, v: T) -> Self
440 where
441 T: std::convert::Into<i32>,
442 {
443 self.hugepage_size2m = std::option::Option::Some(v.into());
444 self
445 }
446
447 /// Sets or clears the value of [hugepage_size2m][crate::model::linux_node_config::HugepagesConfig::hugepage_size2m].
448 ///
449 /// # Example
450 /// ```ignore,no_run
451 /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
452 /// let x = HugepagesConfig::new().set_or_clear_hugepage_size2m(Some(42));
453 /// let x = HugepagesConfig::new().set_or_clear_hugepage_size2m(None::<i32>);
454 /// ```
455 pub fn set_or_clear_hugepage_size2m<T>(mut self, v: std::option::Option<T>) -> Self
456 where
457 T: std::convert::Into<i32>,
458 {
459 self.hugepage_size2m = v.map(|x| x.into());
460 self
461 }
462
463 /// Sets the value of [hugepage_size1g][crate::model::linux_node_config::HugepagesConfig::hugepage_size1g].
464 ///
465 /// # Example
466 /// ```ignore,no_run
467 /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
468 /// let x = HugepagesConfig::new().set_hugepage_size1g(42);
469 /// ```
470 pub fn set_hugepage_size1g<T>(mut self, v: T) -> Self
471 where
472 T: std::convert::Into<i32>,
473 {
474 self.hugepage_size1g = std::option::Option::Some(v.into());
475 self
476 }
477
478 /// Sets or clears the value of [hugepage_size1g][crate::model::linux_node_config::HugepagesConfig::hugepage_size1g].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
483 /// let x = HugepagesConfig::new().set_or_clear_hugepage_size1g(Some(42));
484 /// let x = HugepagesConfig::new().set_or_clear_hugepage_size1g(None::<i32>);
485 /// ```
486 pub fn set_or_clear_hugepage_size1g<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<i32>,
489 {
490 self.hugepage_size1g = v.map(|x| x.into());
491 self
492 }
493 }
494
495 impl wkt::message::Message for HugepagesConfig {
496 fn typename() -> &'static str {
497 "type.googleapis.com/google.container.v1.LinuxNodeConfig.HugepagesConfig"
498 }
499 }
500
501 /// Support for running custom init code while bootstrapping nodes.
502 #[derive(Clone, Default, PartialEq)]
503 #[non_exhaustive]
504 pub struct CustomNodeInit {
505 /// Optional. The init script to be executed on the node.
506 pub init_script:
507 std::option::Option<crate::model::linux_node_config::custom_node_init::InitScript>,
508
509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
510 }
511
512 impl CustomNodeInit {
513 /// Creates a new default instance.
514 pub fn new() -> Self {
515 std::default::Default::default()
516 }
517
518 /// Sets the value of [init_script][crate::model::linux_node_config::CustomNodeInit::init_script].
519 ///
520 /// # Example
521 /// ```ignore,no_run
522 /// # use google_cloud_container_v1::model::linux_node_config::CustomNodeInit;
523 /// use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
524 /// let x = CustomNodeInit::new().set_init_script(InitScript::default()/* use setters */);
525 /// ```
526 pub fn set_init_script<T>(mut self, v: T) -> Self
527 where
528 T: std::convert::Into<crate::model::linux_node_config::custom_node_init::InitScript>,
529 {
530 self.init_script = std::option::Option::Some(v.into());
531 self
532 }
533
534 /// Sets or clears the value of [init_script][crate::model::linux_node_config::CustomNodeInit::init_script].
535 ///
536 /// # Example
537 /// ```ignore,no_run
538 /// # use google_cloud_container_v1::model::linux_node_config::CustomNodeInit;
539 /// use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
540 /// let x = CustomNodeInit::new().set_or_clear_init_script(Some(InitScript::default()/* use setters */));
541 /// let x = CustomNodeInit::new().set_or_clear_init_script(None::<InitScript>);
542 /// ```
543 pub fn set_or_clear_init_script<T>(mut self, v: std::option::Option<T>) -> Self
544 where
545 T: std::convert::Into<crate::model::linux_node_config::custom_node_init::InitScript>,
546 {
547 self.init_script = v.map(|x| x.into());
548 self
549 }
550 }
551
552 impl wkt::message::Message for CustomNodeInit {
553 fn typename() -> &'static str {
554 "type.googleapis.com/google.container.v1.LinuxNodeConfig.CustomNodeInit"
555 }
556 }
557
558 /// Defines additional types related to [CustomNodeInit].
559 pub mod custom_node_init {
560 #[allow(unused_imports)]
561 use super::*;
562
563 /// InitScript provide a simply bash script to be executed on the node.
564 #[derive(Clone, Default, PartialEq)]
565 #[non_exhaustive]
566 pub struct InitScript {
567 /// The Cloud Storage URI for storing the init script.
568 /// Format: gs://BUCKET_NAME/OBJECT_NAME
569 /// The service account on the node pool must have read access to the
570 /// object.
571 /// User can't configure both gcs_uri and gcp_secret_manager_secret_uri.
572 pub gcs_uri: std::string::String,
573
574 /// The generation of the init script stored in Gloud Storage.
575 /// This is the required field to identify the version of the
576 /// init script.
577 /// User can get the genetaion from
578 /// `gcloud storage objects describe gs://BUCKET_NAME/OBJECT_NAME
579 /// --format="value(generation)"` or from the "Version history" tab of the
580 /// object in the Cloud Console UI.
581 pub gcs_generation: i64,
582
583 /// Optional. The optional arguments line to be passed to the init script.
584 pub args: std::vec::Vec<std::string::String>,
585
586 /// The resource name of the secret manager secret hosting the init script.
587 /// Both global and regional secrets are supported with format below:
588 /// Global secret: projects/{project}/secrets/{secret}/versions/{version}
589 /// Regional secret:
590 /// projects/{project}/locations/{location}/secrets/{secret}/versions/{version}
591 /// Example: projects/1234567890/secrets/script_1/versions/1.
592 /// Accept version number only, not support version alias.
593 /// User can't configure both gcp_secret_manager_secret_uri and gcs_uri.
594 pub gcp_secret_manager_secret_uri: std::string::String,
595
596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
597 }
598
599 impl InitScript {
600 /// Creates a new default instance.
601 pub fn new() -> Self {
602 std::default::Default::default()
603 }
604
605 /// Sets the value of [gcs_uri][crate::model::linux_node_config::custom_node_init::InitScript::gcs_uri].
606 ///
607 /// # Example
608 /// ```ignore,no_run
609 /// # use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
610 /// let x = InitScript::new().set_gcs_uri("example");
611 /// ```
612 pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613 self.gcs_uri = v.into();
614 self
615 }
616
617 /// Sets the value of [gcs_generation][crate::model::linux_node_config::custom_node_init::InitScript::gcs_generation].
618 ///
619 /// # Example
620 /// ```ignore,no_run
621 /// # use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
622 /// let x = InitScript::new().set_gcs_generation(42);
623 /// ```
624 pub fn set_gcs_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
625 self.gcs_generation = v.into();
626 self
627 }
628
629 /// Sets the value of [args][crate::model::linux_node_config::custom_node_init::InitScript::args].
630 ///
631 /// # Example
632 /// ```ignore,no_run
633 /// # use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
634 /// let x = InitScript::new().set_args(["a", "b", "c"]);
635 /// ```
636 pub fn set_args<T, V>(mut self, v: T) -> Self
637 where
638 T: std::iter::IntoIterator<Item = V>,
639 V: std::convert::Into<std::string::String>,
640 {
641 use std::iter::Iterator;
642 self.args = v.into_iter().map(|i| i.into()).collect();
643 self
644 }
645
646 /// Sets the value of [gcp_secret_manager_secret_uri][crate::model::linux_node_config::custom_node_init::InitScript::gcp_secret_manager_secret_uri].
647 ///
648 /// # Example
649 /// ```ignore,no_run
650 /// # use google_cloud_container_v1::model::linux_node_config::custom_node_init::InitScript;
651 /// let x = InitScript::new().set_gcp_secret_manager_secret_uri("example");
652 /// ```
653 pub fn set_gcp_secret_manager_secret_uri<T: std::convert::Into<std::string::String>>(
654 mut self,
655 v: T,
656 ) -> Self {
657 self.gcp_secret_manager_secret_uri = v.into();
658 self
659 }
660 }
661
662 impl wkt::message::Message for InitScript {
663 fn typename() -> &'static str {
664 "type.googleapis.com/google.container.v1.LinuxNodeConfig.CustomNodeInit.InitScript"
665 }
666 }
667 }
668
669 /// Configuration for swap memory on a node pool.
670 #[derive(Clone, Default, PartialEq)]
671 #[non_exhaustive]
672 pub struct SwapConfig {
673 /// Optional. Enables or disables swap for the node pool.
674 pub enabled: std::option::Option<bool>,
675
676 /// Optional. If omitted, swap space is encrypted by default.
677 pub encryption_config:
678 std::option::Option<crate::model::linux_node_config::swap_config::EncryptionConfig>,
679
680 /// Optional. Defines the backing storage for the swap space.
681 /// If omitted, defaults to the 'boot_disk_profile'.
682 pub performance_profile:
683 std::option::Option<crate::model::linux_node_config::swap_config::PerformanceProfile>,
684
685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
686 }
687
688 impl SwapConfig {
689 /// Creates a new default instance.
690 pub fn new() -> Self {
691 std::default::Default::default()
692 }
693
694 /// Sets the value of [enabled][crate::model::linux_node_config::SwapConfig::enabled].
695 ///
696 /// # Example
697 /// ```ignore,no_run
698 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
699 /// let x = SwapConfig::new().set_enabled(true);
700 /// ```
701 pub fn set_enabled<T>(mut self, v: T) -> Self
702 where
703 T: std::convert::Into<bool>,
704 {
705 self.enabled = std::option::Option::Some(v.into());
706 self
707 }
708
709 /// Sets or clears the value of [enabled][crate::model::linux_node_config::SwapConfig::enabled].
710 ///
711 /// # Example
712 /// ```ignore,no_run
713 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
714 /// let x = SwapConfig::new().set_or_clear_enabled(Some(false));
715 /// let x = SwapConfig::new().set_or_clear_enabled(None::<bool>);
716 /// ```
717 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
718 where
719 T: std::convert::Into<bool>,
720 {
721 self.enabled = v.map(|x| x.into());
722 self
723 }
724
725 /// Sets the value of [encryption_config][crate::model::linux_node_config::SwapConfig::encryption_config].
726 ///
727 /// # Example
728 /// ```ignore,no_run
729 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
730 /// use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
731 /// let x = SwapConfig::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
732 /// ```
733 pub fn set_encryption_config<T>(mut self, v: T) -> Self
734 where
735 T: std::convert::Into<crate::model::linux_node_config::swap_config::EncryptionConfig>,
736 {
737 self.encryption_config = std::option::Option::Some(v.into());
738 self
739 }
740
741 /// Sets or clears the value of [encryption_config][crate::model::linux_node_config::SwapConfig::encryption_config].
742 ///
743 /// # Example
744 /// ```ignore,no_run
745 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
746 /// use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
747 /// let x = SwapConfig::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
748 /// let x = SwapConfig::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
749 /// ```
750 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
751 where
752 T: std::convert::Into<crate::model::linux_node_config::swap_config::EncryptionConfig>,
753 {
754 self.encryption_config = v.map(|x| x.into());
755 self
756 }
757
758 /// Sets the value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile].
759 ///
760 /// Note that all the setters affecting `performance_profile` are mutually
761 /// exclusive.
762 ///
763 /// # Example
764 /// ```ignore,no_run
765 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
766 /// use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
767 /// let x = SwapConfig::new().set_performance_profile(Some(
768 /// google_cloud_container_v1::model::linux_node_config::swap_config::PerformanceProfile::BootDiskProfile(BootDiskProfile::default().into())));
769 /// ```
770 pub fn set_performance_profile<
771 T: std::convert::Into<
772 std::option::Option<
773 crate::model::linux_node_config::swap_config::PerformanceProfile,
774 >,
775 >,
776 >(
777 mut self,
778 v: T,
779 ) -> Self {
780 self.performance_profile = v.into();
781 self
782 }
783
784 /// The value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
785 /// if it holds a `BootDiskProfile`, `None` if the field is not set or
786 /// holds a different branch.
787 pub fn boot_disk_profile(
788 &self,
789 ) -> std::option::Option<
790 &std::boxed::Box<crate::model::linux_node_config::swap_config::BootDiskProfile>,
791 > {
792 #[allow(unreachable_patterns)]
793 self.performance_profile.as_ref().and_then(|v| match v {
794 crate::model::linux_node_config::swap_config::PerformanceProfile::BootDiskProfile(v) => std::option::Option::Some(v),
795 _ => std::option::Option::None,
796 })
797 }
798
799 /// Sets the value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
800 /// to hold a `BootDiskProfile`.
801 ///
802 /// Note that all the setters affecting `performance_profile` are
803 /// mutually exclusive.
804 ///
805 /// # Example
806 /// ```ignore,no_run
807 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
808 /// use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
809 /// let x = SwapConfig::new().set_boot_disk_profile(BootDiskProfile::default()/* use setters */);
810 /// assert!(x.boot_disk_profile().is_some());
811 /// assert!(x.ephemeral_local_ssd_profile().is_none());
812 /// assert!(x.dedicated_local_ssd_profile().is_none());
813 /// ```
814 pub fn set_boot_disk_profile<
815 T: std::convert::Into<
816 std::boxed::Box<crate::model::linux_node_config::swap_config::BootDiskProfile>,
817 >,
818 >(
819 mut self,
820 v: T,
821 ) -> Self {
822 self.performance_profile = std::option::Option::Some(
823 crate::model::linux_node_config::swap_config::PerformanceProfile::BootDiskProfile(
824 v.into(),
825 ),
826 );
827 self
828 }
829
830 /// The value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
831 /// if it holds a `EphemeralLocalSsdProfile`, `None` if the field is not set or
832 /// holds a different branch.
833 pub fn ephemeral_local_ssd_profile(
834 &self,
835 ) -> std::option::Option<
836 &std::boxed::Box<
837 crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile,
838 >,
839 > {
840 #[allow(unreachable_patterns)]
841 self.performance_profile.as_ref().and_then(|v| match v {
842 crate::model::linux_node_config::swap_config::PerformanceProfile::EphemeralLocalSsdProfile(v) => std::option::Option::Some(v),
843 _ => std::option::Option::None,
844 })
845 }
846
847 /// Sets the value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
848 /// to hold a `EphemeralLocalSsdProfile`.
849 ///
850 /// Note that all the setters affecting `performance_profile` are
851 /// mutually exclusive.
852 ///
853 /// # Example
854 /// ```ignore,no_run
855 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
856 /// use google_cloud_container_v1::model::linux_node_config::swap_config::EphemeralLocalSsdProfile;
857 /// let x = SwapConfig::new().set_ephemeral_local_ssd_profile(EphemeralLocalSsdProfile::default()/* use setters */);
858 /// assert!(x.ephemeral_local_ssd_profile().is_some());
859 /// assert!(x.boot_disk_profile().is_none());
860 /// assert!(x.dedicated_local_ssd_profile().is_none());
861 /// ```
862 pub fn set_ephemeral_local_ssd_profile<
863 T: std::convert::Into<
864 std::boxed::Box<
865 crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile,
866 >,
867 >,
868 >(
869 mut self,
870 v: T,
871 ) -> Self {
872 self.performance_profile = std::option::Option::Some(
873 crate::model::linux_node_config::swap_config::PerformanceProfile::EphemeralLocalSsdProfile(
874 v.into()
875 )
876 );
877 self
878 }
879
880 /// The value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
881 /// if it holds a `DedicatedLocalSsdProfile`, `None` if the field is not set or
882 /// holds a different branch.
883 pub fn dedicated_local_ssd_profile(
884 &self,
885 ) -> std::option::Option<
886 &std::boxed::Box<
887 crate::model::linux_node_config::swap_config::DedicatedLocalSsdProfile,
888 >,
889 > {
890 #[allow(unreachable_patterns)]
891 self.performance_profile.as_ref().and_then(|v| match v {
892 crate::model::linux_node_config::swap_config::PerformanceProfile::DedicatedLocalSsdProfile(v) => std::option::Option::Some(v),
893 _ => std::option::Option::None,
894 })
895 }
896
897 /// Sets the value of [performance_profile][crate::model::linux_node_config::SwapConfig::performance_profile]
898 /// to hold a `DedicatedLocalSsdProfile`.
899 ///
900 /// Note that all the setters affecting `performance_profile` are
901 /// mutually exclusive.
902 ///
903 /// # Example
904 /// ```ignore,no_run
905 /// # use google_cloud_container_v1::model::linux_node_config::SwapConfig;
906 /// use google_cloud_container_v1::model::linux_node_config::swap_config::DedicatedLocalSsdProfile;
907 /// let x = SwapConfig::new().set_dedicated_local_ssd_profile(DedicatedLocalSsdProfile::default()/* use setters */);
908 /// assert!(x.dedicated_local_ssd_profile().is_some());
909 /// assert!(x.boot_disk_profile().is_none());
910 /// assert!(x.ephemeral_local_ssd_profile().is_none());
911 /// ```
912 pub fn set_dedicated_local_ssd_profile<
913 T: std::convert::Into<
914 std::boxed::Box<
915 crate::model::linux_node_config::swap_config::DedicatedLocalSsdProfile,
916 >,
917 >,
918 >(
919 mut self,
920 v: T,
921 ) -> Self {
922 self.performance_profile = std::option::Option::Some(
923 crate::model::linux_node_config::swap_config::PerformanceProfile::DedicatedLocalSsdProfile(
924 v.into()
925 )
926 );
927 self
928 }
929 }
930
931 impl wkt::message::Message for SwapConfig {
932 fn typename() -> &'static str {
933 "type.googleapis.com/google.container.v1.LinuxNodeConfig.SwapConfig"
934 }
935 }
936
937 /// Defines additional types related to [SwapConfig].
938 pub mod swap_config {
939 #[allow(unused_imports)]
940 use super::*;
941
942 /// Defines encryption settings for the swap space.
943 #[derive(Clone, Default, PartialEq)]
944 #[non_exhaustive]
945 pub struct EncryptionConfig {
946 /// Optional. If true, swap space will not be encrypted.
947 /// Defaults to false (encrypted).
948 pub disabled: std::option::Option<bool>,
949
950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
951 }
952
953 impl EncryptionConfig {
954 /// Creates a new default instance.
955 pub fn new() -> Self {
956 std::default::Default::default()
957 }
958
959 /// Sets the value of [disabled][crate::model::linux_node_config::swap_config::EncryptionConfig::disabled].
960 ///
961 /// # Example
962 /// ```ignore,no_run
963 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
964 /// let x = EncryptionConfig::new().set_disabled(true);
965 /// ```
966 pub fn set_disabled<T>(mut self, v: T) -> Self
967 where
968 T: std::convert::Into<bool>,
969 {
970 self.disabled = std::option::Option::Some(v.into());
971 self
972 }
973
974 /// Sets or clears the value of [disabled][crate::model::linux_node_config::swap_config::EncryptionConfig::disabled].
975 ///
976 /// # Example
977 /// ```ignore,no_run
978 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
979 /// let x = EncryptionConfig::new().set_or_clear_disabled(Some(false));
980 /// let x = EncryptionConfig::new().set_or_clear_disabled(None::<bool>);
981 /// ```
982 pub fn set_or_clear_disabled<T>(mut self, v: std::option::Option<T>) -> Self
983 where
984 T: std::convert::Into<bool>,
985 {
986 self.disabled = v.map(|x| x.into());
987 self
988 }
989 }
990
991 impl wkt::message::Message for EncryptionConfig {
992 fn typename() -> &'static str {
993 "type.googleapis.com/google.container.v1.LinuxNodeConfig.SwapConfig.EncryptionConfig"
994 }
995 }
996
997 /// Swap on the node's boot disk.
998 #[derive(Clone, Default, PartialEq)]
999 #[non_exhaustive]
1000 pub struct BootDiskProfile {
1001 /// Optional. Specifies the size of the swap space. If omitted, GKE
1002 /// determines an optimal size based on node memory.
1003 pub swap_size: std::option::Option<
1004 crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize,
1005 >,
1006
1007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1008 }
1009
1010 impl BootDiskProfile {
1011 /// Creates a new default instance.
1012 pub fn new() -> Self {
1013 std::default::Default::default()
1014 }
1015
1016 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::BootDiskProfile::swap_size].
1017 ///
1018 /// Note that all the setters affecting `swap_size` are mutually
1019 /// exclusive.
1020 ///
1021 /// # Example
1022 /// ```ignore,no_run
1023 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
1024 /// use google_cloud_container_v1::model::linux_node_config::swap_config::boot_disk_profile::SwapSize;
1025 /// let x = BootDiskProfile::new().set_swap_size(Some(SwapSize::SwapSizeGib(42)));
1026 /// ```
1027 pub fn set_swap_size<T: std::convert::Into<std::option::Option<crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize>>>(mut self, v: T) -> Self
1028 {
1029 self.swap_size = v.into();
1030 self
1031 }
1032
1033 /// The value of [swap_size][crate::model::linux_node_config::swap_config::BootDiskProfile::swap_size]
1034 /// if it holds a `SwapSizeGib`, `None` if the field is not set or
1035 /// holds a different branch.
1036 pub fn swap_size_gib(&self) -> std::option::Option<&i64> {
1037 #[allow(unreachable_patterns)]
1038 self.swap_size.as_ref().and_then(|v| match v {
1039 crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize::SwapSizeGib(v) => std::option::Option::Some(v),
1040 _ => std::option::Option::None,
1041 })
1042 }
1043
1044 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::BootDiskProfile::swap_size]
1045 /// to hold a `SwapSizeGib`.
1046 ///
1047 /// Note that all the setters affecting `swap_size` are
1048 /// mutually exclusive.
1049 ///
1050 /// # Example
1051 /// ```ignore,no_run
1052 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
1053 /// let x = BootDiskProfile::new().set_swap_size_gib(42);
1054 /// assert!(x.swap_size_gib().is_some());
1055 /// assert!(x.swap_size_percent().is_none());
1056 /// ```
1057 pub fn set_swap_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1058 self.swap_size = std::option::Option::Some(
1059 crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize::SwapSizeGib(
1060 v.into()
1061 )
1062 );
1063 self
1064 }
1065
1066 /// The value of [swap_size][crate::model::linux_node_config::swap_config::BootDiskProfile::swap_size]
1067 /// if it holds a `SwapSizePercent`, `None` if the field is not set or
1068 /// holds a different branch.
1069 pub fn swap_size_percent(&self) -> std::option::Option<&i32> {
1070 #[allow(unreachable_patterns)]
1071 self.swap_size.as_ref().and_then(|v| match v {
1072 crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize::SwapSizePercent(v) => std::option::Option::Some(v),
1073 _ => std::option::Option::None,
1074 })
1075 }
1076
1077 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::BootDiskProfile::swap_size]
1078 /// to hold a `SwapSizePercent`.
1079 ///
1080 /// Note that all the setters affecting `swap_size` are
1081 /// mutually exclusive.
1082 ///
1083 /// # Example
1084 /// ```ignore,no_run
1085 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
1086 /// let x = BootDiskProfile::new().set_swap_size_percent(42);
1087 /// assert!(x.swap_size_percent().is_some());
1088 /// assert!(x.swap_size_gib().is_none());
1089 /// ```
1090 pub fn set_swap_size_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1091 self.swap_size = std::option::Option::Some(
1092 crate::model::linux_node_config::swap_config::boot_disk_profile::SwapSize::SwapSizePercent(
1093 v.into()
1094 )
1095 );
1096 self
1097 }
1098 }
1099
1100 impl wkt::message::Message for BootDiskProfile {
1101 fn typename() -> &'static str {
1102 "type.googleapis.com/google.container.v1.LinuxNodeConfig.SwapConfig.BootDiskProfile"
1103 }
1104 }
1105
1106 /// Defines additional types related to [BootDiskProfile].
1107 pub mod boot_disk_profile {
1108 #[allow(unused_imports)]
1109 use super::*;
1110
1111 /// Optional. Specifies the size of the swap space. If omitted, GKE
1112 /// determines an optimal size based on node memory.
1113 #[derive(Clone, Debug, PartialEq)]
1114 #[non_exhaustive]
1115 pub enum SwapSize {
1116 /// Specifies the size of the swap space in gibibytes (GiB).
1117 SwapSizeGib(i64),
1118 /// Specifies the size of the swap space as a percentage of the boot disk
1119 /// size.
1120 SwapSizePercent(i32),
1121 }
1122 }
1123
1124 /// Swap on the local SSD shared with pod ephemeral storage.
1125 #[derive(Clone, Default, PartialEq)]
1126 #[non_exhaustive]
1127 pub struct EphemeralLocalSsdProfile {
1128 /// Specifies the size of the swap space to be provisioned.
1129 pub swap_size: std::option::Option<
1130 crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize,
1131 >,
1132
1133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1134 }
1135
1136 impl EphemeralLocalSsdProfile {
1137 /// Creates a new default instance.
1138 pub fn new() -> Self {
1139 std::default::Default::default()
1140 }
1141
1142 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile::swap_size].
1143 ///
1144 /// Note that all the setters affecting `swap_size` are mutually
1145 /// exclusive.
1146 ///
1147 /// # Example
1148 /// ```ignore,no_run
1149 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::EphemeralLocalSsdProfile;
1150 /// use google_cloud_container_v1::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize;
1151 /// let x = EphemeralLocalSsdProfile::new().set_swap_size(Some(SwapSize::SwapSizeGib(42)));
1152 /// ```
1153 pub fn set_swap_size<T: std::convert::Into<std::option::Option<crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize>>>(mut self, v: T) -> Self
1154 {
1155 self.swap_size = v.into();
1156 self
1157 }
1158
1159 /// The value of [swap_size][crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile::swap_size]
1160 /// if it holds a `SwapSizeGib`, `None` if the field is not set or
1161 /// holds a different branch.
1162 pub fn swap_size_gib(&self) -> std::option::Option<&i64> {
1163 #[allow(unreachable_patterns)]
1164 self.swap_size.as_ref().and_then(|v| match v {
1165 crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize::SwapSizeGib(v) => std::option::Option::Some(v),
1166 _ => std::option::Option::None,
1167 })
1168 }
1169
1170 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile::swap_size]
1171 /// to hold a `SwapSizeGib`.
1172 ///
1173 /// Note that all the setters affecting `swap_size` are
1174 /// mutually exclusive.
1175 ///
1176 /// # Example
1177 /// ```ignore,no_run
1178 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::EphemeralLocalSsdProfile;
1179 /// let x = EphemeralLocalSsdProfile::new().set_swap_size_gib(42);
1180 /// assert!(x.swap_size_gib().is_some());
1181 /// assert!(x.swap_size_percent().is_none());
1182 /// ```
1183 pub fn set_swap_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1184 self.swap_size = std::option::Option::Some(
1185 crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize::SwapSizeGib(
1186 v.into()
1187 )
1188 );
1189 self
1190 }
1191
1192 /// The value of [swap_size][crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile::swap_size]
1193 /// if it holds a `SwapSizePercent`, `None` if the field is not set or
1194 /// holds a different branch.
1195 pub fn swap_size_percent(&self) -> std::option::Option<&i32> {
1196 #[allow(unreachable_patterns)]
1197 self.swap_size.as_ref().and_then(|v| match v {
1198 crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize::SwapSizePercent(v) => std::option::Option::Some(v),
1199 _ => std::option::Option::None,
1200 })
1201 }
1202
1203 /// Sets the value of [swap_size][crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile::swap_size]
1204 /// to hold a `SwapSizePercent`.
1205 ///
1206 /// Note that all the setters affecting `swap_size` are
1207 /// mutually exclusive.
1208 ///
1209 /// # Example
1210 /// ```ignore,no_run
1211 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::EphemeralLocalSsdProfile;
1212 /// let x = EphemeralLocalSsdProfile::new().set_swap_size_percent(42);
1213 /// assert!(x.swap_size_percent().is_some());
1214 /// assert!(x.swap_size_gib().is_none());
1215 /// ```
1216 pub fn set_swap_size_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1217 self.swap_size = std::option::Option::Some(
1218 crate::model::linux_node_config::swap_config::ephemeral_local_ssd_profile::SwapSize::SwapSizePercent(
1219 v.into()
1220 )
1221 );
1222 self
1223 }
1224 }
1225
1226 impl wkt::message::Message for EphemeralLocalSsdProfile {
1227 fn typename() -> &'static str {
1228 "type.googleapis.com/google.container.v1.LinuxNodeConfig.SwapConfig.EphemeralLocalSsdProfile"
1229 }
1230 }
1231
1232 /// Defines additional types related to [EphemeralLocalSsdProfile].
1233 pub mod ephemeral_local_ssd_profile {
1234 #[allow(unused_imports)]
1235 use super::*;
1236
1237 /// Specifies the size of the swap space to be provisioned.
1238 #[derive(Clone, Debug, PartialEq)]
1239 #[non_exhaustive]
1240 pub enum SwapSize {
1241 /// Specifies the size of the swap space in gibibytes (GiB).
1242 SwapSizeGib(i64),
1243 /// Specifies the size of the swap space as a percentage of the ephemeral
1244 /// local SSD capacity.
1245 SwapSizePercent(i32),
1246 }
1247 }
1248
1249 /// Provisions a new, separate local NVMe SSD exclusively for swap.
1250 #[derive(Clone, Default, PartialEq)]
1251 #[non_exhaustive]
1252 pub struct DedicatedLocalSsdProfile {
1253 /// The number of physical local NVMe SSD disks to attach.
1254 pub disk_count: i64,
1255
1256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1257 }
1258
1259 impl DedicatedLocalSsdProfile {
1260 /// Creates a new default instance.
1261 pub fn new() -> Self {
1262 std::default::Default::default()
1263 }
1264
1265 /// Sets the value of [disk_count][crate::model::linux_node_config::swap_config::DedicatedLocalSsdProfile::disk_count].
1266 ///
1267 /// # Example
1268 /// ```ignore,no_run
1269 /// # use google_cloud_container_v1::model::linux_node_config::swap_config::DedicatedLocalSsdProfile;
1270 /// let x = DedicatedLocalSsdProfile::new().set_disk_count(42);
1271 /// ```
1272 pub fn set_disk_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1273 self.disk_count = v.into();
1274 self
1275 }
1276 }
1277
1278 impl wkt::message::Message for DedicatedLocalSsdProfile {
1279 fn typename() -> &'static str {
1280 "type.googleapis.com/google.container.v1.LinuxNodeConfig.SwapConfig.DedicatedLocalSsdProfile"
1281 }
1282 }
1283
1284 /// Optional. Defines the backing storage for the swap space.
1285 /// If omitted, defaults to the 'boot_disk_profile'.
1286 #[derive(Clone, Debug, PartialEq)]
1287 #[non_exhaustive]
1288 pub enum PerformanceProfile {
1289 /// Swap on the node's boot disk.
1290 BootDiskProfile(
1291 std::boxed::Box<crate::model::linux_node_config::swap_config::BootDiskProfile>,
1292 ),
1293 /// Swap on the local SSD shared with pod ephemeral storage.
1294 EphemeralLocalSsdProfile(
1295 std::boxed::Box<
1296 crate::model::linux_node_config::swap_config::EphemeralLocalSsdProfile,
1297 >,
1298 ),
1299 /// Provisions a new, separate local NVMe SSD exclusively for swap.
1300 DedicatedLocalSsdProfile(
1301 std::boxed::Box<
1302 crate::model::linux_node_config::swap_config::DedicatedLocalSsdProfile,
1303 >,
1304 ),
1305 }
1306 }
1307
1308 /// Configuration for kernel module loading on nodes.
1309 #[derive(Clone, Default, PartialEq)]
1310 #[non_exhaustive]
1311 pub struct NodeKernelModuleLoading {
1312 /// Set the node module loading policy for nodes in the node pool.
1313 pub policy: crate::model::linux_node_config::node_kernel_module_loading::Policy,
1314
1315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1316 }
1317
1318 impl NodeKernelModuleLoading {
1319 /// Creates a new default instance.
1320 pub fn new() -> Self {
1321 std::default::Default::default()
1322 }
1323
1324 /// Sets the value of [policy][crate::model::linux_node_config::NodeKernelModuleLoading::policy].
1325 ///
1326 /// # Example
1327 /// ```ignore,no_run
1328 /// # use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
1329 /// use google_cloud_container_v1::model::linux_node_config::node_kernel_module_loading::Policy;
1330 /// let x0 = NodeKernelModuleLoading::new().set_policy(Policy::EnforceSignedModules);
1331 /// let x1 = NodeKernelModuleLoading::new().set_policy(Policy::DoNotEnforceSignedModules);
1332 /// ```
1333 pub fn set_policy<
1334 T: std::convert::Into<crate::model::linux_node_config::node_kernel_module_loading::Policy>,
1335 >(
1336 mut self,
1337 v: T,
1338 ) -> Self {
1339 self.policy = v.into();
1340 self
1341 }
1342 }
1343
1344 impl wkt::message::Message for NodeKernelModuleLoading {
1345 fn typename() -> &'static str {
1346 "type.googleapis.com/google.container.v1.LinuxNodeConfig.NodeKernelModuleLoading"
1347 }
1348 }
1349
1350 /// Defines additional types related to [NodeKernelModuleLoading].
1351 pub mod node_kernel_module_loading {
1352 #[allow(unused_imports)]
1353 use super::*;
1354
1355 /// Defines the kernel module loading policy for nodes in the node pool.
1356 ///
1357 /// # Working with unknown values
1358 ///
1359 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1360 /// additional enum variants at any time. Adding new variants is not considered
1361 /// a breaking change. Applications should write their code in anticipation of:
1362 ///
1363 /// - New values appearing in future releases of the client library, **and**
1364 /// - New values received dynamically, without application changes.
1365 ///
1366 /// Please consult the [Working with enums] section in the user guide for some
1367 /// guidelines.
1368 ///
1369 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1370 #[derive(Clone, Debug, PartialEq)]
1371 #[non_exhaustive]
1372 pub enum Policy {
1373 /// Default behavior. GKE selects the image based on node type.
1374 /// For CPU and TPU nodes, the image will not allow loading external
1375 /// kernel modules.
1376 /// For GPU nodes, the image will allow loading any module, whether it
1377 /// is signed or not.
1378 Unspecified,
1379 /// Enforced signature verification: Node pools will use a
1380 /// Container-Optimized OS image configured to allow loading of
1381 /// *Google-signed* external kernel modules.
1382 /// Loadpin is enabled but configured to exclude modules, and kernel
1383 /// module signature checking is enforced.
1384 EnforceSignedModules,
1385 /// Mirrors existing DEFAULT behavior:
1386 /// For CPU and TPU nodes, the image will not allow loading external
1387 /// kernel modules.
1388 /// For GPU nodes, the image will allow loading any module, whether it
1389 /// is signed or not.
1390 DoNotEnforceSignedModules,
1391 /// If set, the enum was initialized with an unknown value.
1392 ///
1393 /// Applications can examine the value using [Policy::value] or
1394 /// [Policy::name].
1395 UnknownValue(policy::UnknownValue),
1396 }
1397
1398 #[doc(hidden)]
1399 pub mod policy {
1400 #[allow(unused_imports)]
1401 use super::*;
1402 #[derive(Clone, Debug, PartialEq)]
1403 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1404 }
1405
1406 impl Policy {
1407 /// Gets the enum value.
1408 ///
1409 /// Returns `None` if the enum contains an unknown value deserialized from
1410 /// the string representation of enums.
1411 pub fn value(&self) -> std::option::Option<i32> {
1412 match self {
1413 Self::Unspecified => std::option::Option::Some(0),
1414 Self::EnforceSignedModules => std::option::Option::Some(1),
1415 Self::DoNotEnforceSignedModules => std::option::Option::Some(2),
1416 Self::UnknownValue(u) => u.0.value(),
1417 }
1418 }
1419
1420 /// Gets the enum value as a string.
1421 ///
1422 /// Returns `None` if the enum contains an unknown value deserialized from
1423 /// the integer representation of enums.
1424 pub fn name(&self) -> std::option::Option<&str> {
1425 match self {
1426 Self::Unspecified => std::option::Option::Some("POLICY_UNSPECIFIED"),
1427 Self::EnforceSignedModules => {
1428 std::option::Option::Some("ENFORCE_SIGNED_MODULES")
1429 }
1430 Self::DoNotEnforceSignedModules => {
1431 std::option::Option::Some("DO_NOT_ENFORCE_SIGNED_MODULES")
1432 }
1433 Self::UnknownValue(u) => u.0.name(),
1434 }
1435 }
1436 }
1437
1438 impl std::default::Default for Policy {
1439 fn default() -> Self {
1440 use std::convert::From;
1441 Self::from(0)
1442 }
1443 }
1444
1445 impl std::fmt::Display for Policy {
1446 fn fmt(
1447 &self,
1448 f: &mut std::fmt::Formatter<'_>,
1449 ) -> std::result::Result<(), std::fmt::Error> {
1450 wkt::internal::display_enum(f, self.name(), self.value())
1451 }
1452 }
1453
1454 impl std::convert::From<i32> for Policy {
1455 fn from(value: i32) -> Self {
1456 match value {
1457 0 => Self::Unspecified,
1458 1 => Self::EnforceSignedModules,
1459 2 => Self::DoNotEnforceSignedModules,
1460 _ => Self::UnknownValue(policy::UnknownValue(
1461 wkt::internal::UnknownEnumValue::Integer(value),
1462 )),
1463 }
1464 }
1465 }
1466
1467 impl std::convert::From<&str> for Policy {
1468 fn from(value: &str) -> Self {
1469 use std::string::ToString;
1470 match value {
1471 "POLICY_UNSPECIFIED" => Self::Unspecified,
1472 "ENFORCE_SIGNED_MODULES" => Self::EnforceSignedModules,
1473 "DO_NOT_ENFORCE_SIGNED_MODULES" => Self::DoNotEnforceSignedModules,
1474 _ => Self::UnknownValue(policy::UnknownValue(
1475 wkt::internal::UnknownEnumValue::String(value.to_string()),
1476 )),
1477 }
1478 }
1479 }
1480
1481 impl serde::ser::Serialize for Policy {
1482 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1483 where
1484 S: serde::Serializer,
1485 {
1486 match self {
1487 Self::Unspecified => serializer.serialize_i32(0),
1488 Self::EnforceSignedModules => serializer.serialize_i32(1),
1489 Self::DoNotEnforceSignedModules => serializer.serialize_i32(2),
1490 Self::UnknownValue(u) => u.0.serialize(serializer),
1491 }
1492 }
1493 }
1494
1495 impl<'de> serde::de::Deserialize<'de> for Policy {
1496 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1497 where
1498 D: serde::Deserializer<'de>,
1499 {
1500 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Policy>::new(
1501 ".google.container.v1.LinuxNodeConfig.NodeKernelModuleLoading.Policy",
1502 ))
1503 }
1504 }
1505 }
1506
1507 /// AccurateTimeConfig contains configuration for the accurate time
1508 /// synchronization feature.
1509 #[derive(Clone, Default, PartialEq)]
1510 #[non_exhaustive]
1511 pub struct AccurateTimeConfig {
1512 /// Enables enhanced time synchronization using PTP-KVM.
1513 pub enable_ptp_kvm_time_sync: std::option::Option<bool>,
1514
1515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1516 }
1517
1518 impl AccurateTimeConfig {
1519 /// Creates a new default instance.
1520 pub fn new() -> Self {
1521 std::default::Default::default()
1522 }
1523
1524 /// Sets the value of [enable_ptp_kvm_time_sync][crate::model::linux_node_config::AccurateTimeConfig::enable_ptp_kvm_time_sync].
1525 ///
1526 /// # Example
1527 /// ```ignore,no_run
1528 /// # use google_cloud_container_v1::model::linux_node_config::AccurateTimeConfig;
1529 /// let x = AccurateTimeConfig::new().set_enable_ptp_kvm_time_sync(true);
1530 /// ```
1531 pub fn set_enable_ptp_kvm_time_sync<T>(mut self, v: T) -> Self
1532 where
1533 T: std::convert::Into<bool>,
1534 {
1535 self.enable_ptp_kvm_time_sync = std::option::Option::Some(v.into());
1536 self
1537 }
1538
1539 /// Sets or clears the value of [enable_ptp_kvm_time_sync][crate::model::linux_node_config::AccurateTimeConfig::enable_ptp_kvm_time_sync].
1540 ///
1541 /// # Example
1542 /// ```ignore,no_run
1543 /// # use google_cloud_container_v1::model::linux_node_config::AccurateTimeConfig;
1544 /// let x = AccurateTimeConfig::new().set_or_clear_enable_ptp_kvm_time_sync(Some(false));
1545 /// let x = AccurateTimeConfig::new().set_or_clear_enable_ptp_kvm_time_sync(None::<bool>);
1546 /// ```
1547 pub fn set_or_clear_enable_ptp_kvm_time_sync<T>(mut self, v: std::option::Option<T>) -> Self
1548 where
1549 T: std::convert::Into<bool>,
1550 {
1551 self.enable_ptp_kvm_time_sync = v.map(|x| x.into());
1552 self
1553 }
1554 }
1555
1556 impl wkt::message::Message for AccurateTimeConfig {
1557 fn typename() -> &'static str {
1558 "type.googleapis.com/google.container.v1.LinuxNodeConfig.AccurateTimeConfig"
1559 }
1560 }
1561
1562 /// Possible cgroup modes that can be used.
1563 ///
1564 /// # Working with unknown values
1565 ///
1566 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1567 /// additional enum variants at any time. Adding new variants is not considered
1568 /// a breaking change. Applications should write their code in anticipation of:
1569 ///
1570 /// - New values appearing in future releases of the client library, **and**
1571 /// - New values received dynamically, without application changes.
1572 ///
1573 /// Please consult the [Working with enums] section in the user guide for some
1574 /// guidelines.
1575 ///
1576 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1577 #[derive(Clone, Debug, PartialEq)]
1578 #[non_exhaustive]
1579 pub enum CgroupMode {
1580 /// CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used.
1581 /// The default for the GKE node OS image will be used.
1582 Unspecified,
1583 /// CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on
1584 /// the node image.
1585 V1,
1586 /// CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on
1587 /// the node image.
1588 V2,
1589 /// If set, the enum was initialized with an unknown value.
1590 ///
1591 /// Applications can examine the value using [CgroupMode::value] or
1592 /// [CgroupMode::name].
1593 UnknownValue(cgroup_mode::UnknownValue),
1594 }
1595
1596 #[doc(hidden)]
1597 pub mod cgroup_mode {
1598 #[allow(unused_imports)]
1599 use super::*;
1600 #[derive(Clone, Debug, PartialEq)]
1601 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1602 }
1603
1604 impl CgroupMode {
1605 /// Gets the enum value.
1606 ///
1607 /// Returns `None` if the enum contains an unknown value deserialized from
1608 /// the string representation of enums.
1609 pub fn value(&self) -> std::option::Option<i32> {
1610 match self {
1611 Self::Unspecified => std::option::Option::Some(0),
1612 Self::V1 => std::option::Option::Some(1),
1613 Self::V2 => std::option::Option::Some(2),
1614 Self::UnknownValue(u) => u.0.value(),
1615 }
1616 }
1617
1618 /// Gets the enum value as a string.
1619 ///
1620 /// Returns `None` if the enum contains an unknown value deserialized from
1621 /// the integer representation of enums.
1622 pub fn name(&self) -> std::option::Option<&str> {
1623 match self {
1624 Self::Unspecified => std::option::Option::Some("CGROUP_MODE_UNSPECIFIED"),
1625 Self::V1 => std::option::Option::Some("CGROUP_MODE_V1"),
1626 Self::V2 => std::option::Option::Some("CGROUP_MODE_V2"),
1627 Self::UnknownValue(u) => u.0.name(),
1628 }
1629 }
1630 }
1631
1632 impl std::default::Default for CgroupMode {
1633 fn default() -> Self {
1634 use std::convert::From;
1635 Self::from(0)
1636 }
1637 }
1638
1639 impl std::fmt::Display for CgroupMode {
1640 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1641 wkt::internal::display_enum(f, self.name(), self.value())
1642 }
1643 }
1644
1645 impl std::convert::From<i32> for CgroupMode {
1646 fn from(value: i32) -> Self {
1647 match value {
1648 0 => Self::Unspecified,
1649 1 => Self::V1,
1650 2 => Self::V2,
1651 _ => Self::UnknownValue(cgroup_mode::UnknownValue(
1652 wkt::internal::UnknownEnumValue::Integer(value),
1653 )),
1654 }
1655 }
1656 }
1657
1658 impl std::convert::From<&str> for CgroupMode {
1659 fn from(value: &str) -> Self {
1660 use std::string::ToString;
1661 match value {
1662 "CGROUP_MODE_UNSPECIFIED" => Self::Unspecified,
1663 "CGROUP_MODE_V1" => Self::V1,
1664 "CGROUP_MODE_V2" => Self::V2,
1665 _ => Self::UnknownValue(cgroup_mode::UnknownValue(
1666 wkt::internal::UnknownEnumValue::String(value.to_string()),
1667 )),
1668 }
1669 }
1670 }
1671
1672 impl serde::ser::Serialize for CgroupMode {
1673 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1674 where
1675 S: serde::Serializer,
1676 {
1677 match self {
1678 Self::Unspecified => serializer.serialize_i32(0),
1679 Self::V1 => serializer.serialize_i32(1),
1680 Self::V2 => serializer.serialize_i32(2),
1681 Self::UnknownValue(u) => u.0.serialize(serializer),
1682 }
1683 }
1684 }
1685
1686 impl<'de> serde::de::Deserialize<'de> for CgroupMode {
1687 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1688 where
1689 D: serde::Deserializer<'de>,
1690 {
1691 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CgroupMode>::new(
1692 ".google.container.v1.LinuxNodeConfig.CgroupMode",
1693 ))
1694 }
1695 }
1696
1697 /// Possible values for transparent hugepage enabled support.
1698 ///
1699 /// # Working with unknown values
1700 ///
1701 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1702 /// additional enum variants at any time. Adding new variants is not considered
1703 /// a breaking change. Applications should write their code in anticipation of:
1704 ///
1705 /// - New values appearing in future releases of the client library, **and**
1706 /// - New values received dynamically, without application changes.
1707 ///
1708 /// Please consult the [Working with enums] section in the user guide for some
1709 /// guidelines.
1710 ///
1711 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1712 #[derive(Clone, Debug, PartialEq)]
1713 #[non_exhaustive]
1714 pub enum TransparentHugepageEnabled {
1715 /// Default value. GKE will not modify the kernel configuration.
1716 Unspecified,
1717 /// Transparent hugepage support for anonymous memory is enabled system wide.
1718 Always,
1719 /// Transparent hugepage support for anonymous memory is enabled inside
1720 /// MADV_HUGEPAGE regions. This is the default kernel configuration.
1721 Madvise,
1722 /// Transparent hugepage support for anonymous memory is disabled.
1723 Never,
1724 /// If set, the enum was initialized with an unknown value.
1725 ///
1726 /// Applications can examine the value using [TransparentHugepageEnabled::value] or
1727 /// [TransparentHugepageEnabled::name].
1728 UnknownValue(transparent_hugepage_enabled::UnknownValue),
1729 }
1730
1731 #[doc(hidden)]
1732 pub mod transparent_hugepage_enabled {
1733 #[allow(unused_imports)]
1734 use super::*;
1735 #[derive(Clone, Debug, PartialEq)]
1736 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1737 }
1738
1739 impl TransparentHugepageEnabled {
1740 /// Gets the enum value.
1741 ///
1742 /// Returns `None` if the enum contains an unknown value deserialized from
1743 /// the string representation of enums.
1744 pub fn value(&self) -> std::option::Option<i32> {
1745 match self {
1746 Self::Unspecified => std::option::Option::Some(0),
1747 Self::Always => std::option::Option::Some(1),
1748 Self::Madvise => std::option::Option::Some(2),
1749 Self::Never => std::option::Option::Some(3),
1750 Self::UnknownValue(u) => u.0.value(),
1751 }
1752 }
1753
1754 /// Gets the enum value as a string.
1755 ///
1756 /// Returns `None` if the enum contains an unknown value deserialized from
1757 /// the integer representation of enums.
1758 pub fn name(&self) -> std::option::Option<&str> {
1759 match self {
1760 Self::Unspecified => {
1761 std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_UNSPECIFIED")
1762 }
1763 Self::Always => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_ALWAYS"),
1764 Self::Madvise => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_MADVISE"),
1765 Self::Never => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_NEVER"),
1766 Self::UnknownValue(u) => u.0.name(),
1767 }
1768 }
1769 }
1770
1771 impl std::default::Default for TransparentHugepageEnabled {
1772 fn default() -> Self {
1773 use std::convert::From;
1774 Self::from(0)
1775 }
1776 }
1777
1778 impl std::fmt::Display for TransparentHugepageEnabled {
1779 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1780 wkt::internal::display_enum(f, self.name(), self.value())
1781 }
1782 }
1783
1784 impl std::convert::From<i32> for TransparentHugepageEnabled {
1785 fn from(value: i32) -> Self {
1786 match value {
1787 0 => Self::Unspecified,
1788 1 => Self::Always,
1789 2 => Self::Madvise,
1790 3 => Self::Never,
1791 _ => Self::UnknownValue(transparent_hugepage_enabled::UnknownValue(
1792 wkt::internal::UnknownEnumValue::Integer(value),
1793 )),
1794 }
1795 }
1796 }
1797
1798 impl std::convert::From<&str> for TransparentHugepageEnabled {
1799 fn from(value: &str) -> Self {
1800 use std::string::ToString;
1801 match value {
1802 "TRANSPARENT_HUGEPAGE_ENABLED_UNSPECIFIED" => Self::Unspecified,
1803 "TRANSPARENT_HUGEPAGE_ENABLED_ALWAYS" => Self::Always,
1804 "TRANSPARENT_HUGEPAGE_ENABLED_MADVISE" => Self::Madvise,
1805 "TRANSPARENT_HUGEPAGE_ENABLED_NEVER" => Self::Never,
1806 _ => Self::UnknownValue(transparent_hugepage_enabled::UnknownValue(
1807 wkt::internal::UnknownEnumValue::String(value.to_string()),
1808 )),
1809 }
1810 }
1811 }
1812
1813 impl serde::ser::Serialize for TransparentHugepageEnabled {
1814 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1815 where
1816 S: serde::Serializer,
1817 {
1818 match self {
1819 Self::Unspecified => serializer.serialize_i32(0),
1820 Self::Always => serializer.serialize_i32(1),
1821 Self::Madvise => serializer.serialize_i32(2),
1822 Self::Never => serializer.serialize_i32(3),
1823 Self::UnknownValue(u) => u.0.serialize(serializer),
1824 }
1825 }
1826 }
1827
1828 impl<'de> serde::de::Deserialize<'de> for TransparentHugepageEnabled {
1829 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1830 where
1831 D: serde::Deserializer<'de>,
1832 {
1833 deserializer.deserialize_any(
1834 wkt::internal::EnumVisitor::<TransparentHugepageEnabled>::new(
1835 ".google.container.v1.LinuxNodeConfig.TransparentHugepageEnabled",
1836 ),
1837 )
1838 }
1839 }
1840
1841 /// Possible values for transparent hugepage defrag support.
1842 ///
1843 /// # Working with unknown values
1844 ///
1845 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1846 /// additional enum variants at any time. Adding new variants is not considered
1847 /// a breaking change. Applications should write their code in anticipation of:
1848 ///
1849 /// - New values appearing in future releases of the client library, **and**
1850 /// - New values received dynamically, without application changes.
1851 ///
1852 /// Please consult the [Working with enums] section in the user guide for some
1853 /// guidelines.
1854 ///
1855 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1856 #[derive(Clone, Debug, PartialEq)]
1857 #[non_exhaustive]
1858 pub enum TransparentHugepageDefrag {
1859 /// Default value. GKE will not modify the kernel configuration.
1860 Unspecified,
1861 /// It means that an application requesting THP will stall on allocation
1862 /// failure and directly reclaim pages and compact memory in an effort to
1863 /// allocate a THP immediately.
1864 Always,
1865 /// It means that an application will wake kswapd in the background to
1866 /// reclaim pages and wake kcompactd to compact memory so that THP is
1867 /// available in the near future. It's the responsibility of khugepaged to
1868 /// then install the THP pages later.
1869 Defer,
1870 /// It means that an application will enter direct reclaim and compaction
1871 /// like always, but only for regions that have used madvise(MADV_HUGEPAGE);
1872 /// all other regions will wake kswapd in the background to reclaim pages and
1873 /// wake kcompactd to compact memory so that THP is available in the near
1874 /// future.
1875 DeferWithMadvise,
1876 /// It means that an application will enter direct reclaim like always but
1877 /// only for regions that are have used madvise(MADV_HUGEPAGE). This is the
1878 /// default kernel configuration.
1879 Madvise,
1880 /// It means that an application will never enter direct reclaim or
1881 /// compaction.
1882 Never,
1883 /// If set, the enum was initialized with an unknown value.
1884 ///
1885 /// Applications can examine the value using [TransparentHugepageDefrag::value] or
1886 /// [TransparentHugepageDefrag::name].
1887 UnknownValue(transparent_hugepage_defrag::UnknownValue),
1888 }
1889
1890 #[doc(hidden)]
1891 pub mod transparent_hugepage_defrag {
1892 #[allow(unused_imports)]
1893 use super::*;
1894 #[derive(Clone, Debug, PartialEq)]
1895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1896 }
1897
1898 impl TransparentHugepageDefrag {
1899 /// Gets the enum value.
1900 ///
1901 /// Returns `None` if the enum contains an unknown value deserialized from
1902 /// the string representation of enums.
1903 pub fn value(&self) -> std::option::Option<i32> {
1904 match self {
1905 Self::Unspecified => std::option::Option::Some(0),
1906 Self::Always => std::option::Option::Some(1),
1907 Self::Defer => std::option::Option::Some(2),
1908 Self::DeferWithMadvise => std::option::Option::Some(3),
1909 Self::Madvise => std::option::Option::Some(4),
1910 Self::Never => std::option::Option::Some(5),
1911 Self::UnknownValue(u) => u.0.value(),
1912 }
1913 }
1914
1915 /// Gets the enum value as a string.
1916 ///
1917 /// Returns `None` if the enum contains an unknown value deserialized from
1918 /// the integer representation of enums.
1919 pub fn name(&self) -> std::option::Option<&str> {
1920 match self {
1921 Self::Unspecified => {
1922 std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_UNSPECIFIED")
1923 }
1924 Self::Always => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_ALWAYS"),
1925 Self::Defer => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_DEFER"),
1926 Self::DeferWithMadvise => {
1927 std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_DEFER_WITH_MADVISE")
1928 }
1929 Self::Madvise => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_MADVISE"),
1930 Self::Never => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_NEVER"),
1931 Self::UnknownValue(u) => u.0.name(),
1932 }
1933 }
1934 }
1935
1936 impl std::default::Default for TransparentHugepageDefrag {
1937 fn default() -> Self {
1938 use std::convert::From;
1939 Self::from(0)
1940 }
1941 }
1942
1943 impl std::fmt::Display for TransparentHugepageDefrag {
1944 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1945 wkt::internal::display_enum(f, self.name(), self.value())
1946 }
1947 }
1948
1949 impl std::convert::From<i32> for TransparentHugepageDefrag {
1950 fn from(value: i32) -> Self {
1951 match value {
1952 0 => Self::Unspecified,
1953 1 => Self::Always,
1954 2 => Self::Defer,
1955 3 => Self::DeferWithMadvise,
1956 4 => Self::Madvise,
1957 5 => Self::Never,
1958 _ => Self::UnknownValue(transparent_hugepage_defrag::UnknownValue(
1959 wkt::internal::UnknownEnumValue::Integer(value),
1960 )),
1961 }
1962 }
1963 }
1964
1965 impl std::convert::From<&str> for TransparentHugepageDefrag {
1966 fn from(value: &str) -> Self {
1967 use std::string::ToString;
1968 match value {
1969 "TRANSPARENT_HUGEPAGE_DEFRAG_UNSPECIFIED" => Self::Unspecified,
1970 "TRANSPARENT_HUGEPAGE_DEFRAG_ALWAYS" => Self::Always,
1971 "TRANSPARENT_HUGEPAGE_DEFRAG_DEFER" => Self::Defer,
1972 "TRANSPARENT_HUGEPAGE_DEFRAG_DEFER_WITH_MADVISE" => Self::DeferWithMadvise,
1973 "TRANSPARENT_HUGEPAGE_DEFRAG_MADVISE" => Self::Madvise,
1974 "TRANSPARENT_HUGEPAGE_DEFRAG_NEVER" => Self::Never,
1975 _ => Self::UnknownValue(transparent_hugepage_defrag::UnknownValue(
1976 wkt::internal::UnknownEnumValue::String(value.to_string()),
1977 )),
1978 }
1979 }
1980 }
1981
1982 impl serde::ser::Serialize for TransparentHugepageDefrag {
1983 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1984 where
1985 S: serde::Serializer,
1986 {
1987 match self {
1988 Self::Unspecified => serializer.serialize_i32(0),
1989 Self::Always => serializer.serialize_i32(1),
1990 Self::Defer => serializer.serialize_i32(2),
1991 Self::DeferWithMadvise => serializer.serialize_i32(3),
1992 Self::Madvise => serializer.serialize_i32(4),
1993 Self::Never => serializer.serialize_i32(5),
1994 Self::UnknownValue(u) => u.0.serialize(serializer),
1995 }
1996 }
1997 }
1998
1999 impl<'de> serde::de::Deserialize<'de> for TransparentHugepageDefrag {
2000 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2001 where
2002 D: serde::Deserializer<'de>,
2003 {
2004 deserializer.deserialize_any(
2005 wkt::internal::EnumVisitor::<TransparentHugepageDefrag>::new(
2006 ".google.container.v1.LinuxNodeConfig.TransparentHugepageDefrag",
2007 ),
2008 )
2009 }
2010 }
2011}
2012
2013/// Parameters that can be configured on Windows nodes.
2014/// Windows Node Config that define the parameters that will be used to
2015/// configure the Windows node pool settings.
2016#[derive(Clone, Default, PartialEq)]
2017#[non_exhaustive]
2018pub struct WindowsNodeConfig {
2019 /// OSVersion specifies the Windows node config to be used on the node.
2020 pub os_version: crate::model::windows_node_config::OSVersion,
2021
2022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2023}
2024
2025impl WindowsNodeConfig {
2026 /// Creates a new default instance.
2027 pub fn new() -> Self {
2028 std::default::Default::default()
2029 }
2030
2031 /// Sets the value of [os_version][crate::model::WindowsNodeConfig::os_version].
2032 ///
2033 /// # Example
2034 /// ```ignore,no_run
2035 /// # use google_cloud_container_v1::model::WindowsNodeConfig;
2036 /// use google_cloud_container_v1::model::windows_node_config::OSVersion;
2037 /// let x0 = WindowsNodeConfig::new().set_os_version(OSVersion::Ltsc2019);
2038 /// let x1 = WindowsNodeConfig::new().set_os_version(OSVersion::Ltsc2022);
2039 /// ```
2040 pub fn set_os_version<T: std::convert::Into<crate::model::windows_node_config::OSVersion>>(
2041 mut self,
2042 v: T,
2043 ) -> Self {
2044 self.os_version = v.into();
2045 self
2046 }
2047}
2048
2049impl wkt::message::Message for WindowsNodeConfig {
2050 fn typename() -> &'static str {
2051 "type.googleapis.com/google.container.v1.WindowsNodeConfig"
2052 }
2053}
2054
2055/// Defines additional types related to [WindowsNodeConfig].
2056pub mod windows_node_config {
2057 #[allow(unused_imports)]
2058 use super::*;
2059
2060 /// Possible OS version that can be used.
2061 ///
2062 /// # Working with unknown values
2063 ///
2064 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2065 /// additional enum variants at any time. Adding new variants is not considered
2066 /// a breaking change. Applications should write their code in anticipation of:
2067 ///
2068 /// - New values appearing in future releases of the client library, **and**
2069 /// - New values received dynamically, without application changes.
2070 ///
2071 /// Please consult the [Working with enums] section in the user guide for some
2072 /// guidelines.
2073 ///
2074 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2075 #[derive(Clone, Debug, PartialEq)]
2076 #[non_exhaustive]
2077 pub enum OSVersion {
2078 /// When OSVersion is not specified.
2079 Unspecified,
2080 /// LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image.
2081 Ltsc2019,
2082 /// LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image.
2083 Ltsc2022,
2084 /// If set, the enum was initialized with an unknown value.
2085 ///
2086 /// Applications can examine the value using [OSVersion::value] or
2087 /// [OSVersion::name].
2088 UnknownValue(os_version::UnknownValue),
2089 }
2090
2091 #[doc(hidden)]
2092 pub mod os_version {
2093 #[allow(unused_imports)]
2094 use super::*;
2095 #[derive(Clone, Debug, PartialEq)]
2096 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2097 }
2098
2099 impl OSVersion {
2100 /// Gets the enum value.
2101 ///
2102 /// Returns `None` if the enum contains an unknown value deserialized from
2103 /// the string representation of enums.
2104 pub fn value(&self) -> std::option::Option<i32> {
2105 match self {
2106 Self::Unspecified => std::option::Option::Some(0),
2107 Self::Ltsc2019 => std::option::Option::Some(1),
2108 Self::Ltsc2022 => std::option::Option::Some(2),
2109 Self::UnknownValue(u) => u.0.value(),
2110 }
2111 }
2112
2113 /// Gets the enum value as a string.
2114 ///
2115 /// Returns `None` if the enum contains an unknown value deserialized from
2116 /// the integer representation of enums.
2117 pub fn name(&self) -> std::option::Option<&str> {
2118 match self {
2119 Self::Unspecified => std::option::Option::Some("OS_VERSION_UNSPECIFIED"),
2120 Self::Ltsc2019 => std::option::Option::Some("OS_VERSION_LTSC2019"),
2121 Self::Ltsc2022 => std::option::Option::Some("OS_VERSION_LTSC2022"),
2122 Self::UnknownValue(u) => u.0.name(),
2123 }
2124 }
2125 }
2126
2127 impl std::default::Default for OSVersion {
2128 fn default() -> Self {
2129 use std::convert::From;
2130 Self::from(0)
2131 }
2132 }
2133
2134 impl std::fmt::Display for OSVersion {
2135 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2136 wkt::internal::display_enum(f, self.name(), self.value())
2137 }
2138 }
2139
2140 impl std::convert::From<i32> for OSVersion {
2141 fn from(value: i32) -> Self {
2142 match value {
2143 0 => Self::Unspecified,
2144 1 => Self::Ltsc2019,
2145 2 => Self::Ltsc2022,
2146 _ => Self::UnknownValue(os_version::UnknownValue(
2147 wkt::internal::UnknownEnumValue::Integer(value),
2148 )),
2149 }
2150 }
2151 }
2152
2153 impl std::convert::From<&str> for OSVersion {
2154 fn from(value: &str) -> Self {
2155 use std::string::ToString;
2156 match value {
2157 "OS_VERSION_UNSPECIFIED" => Self::Unspecified,
2158 "OS_VERSION_LTSC2019" => Self::Ltsc2019,
2159 "OS_VERSION_LTSC2022" => Self::Ltsc2022,
2160 _ => Self::UnknownValue(os_version::UnknownValue(
2161 wkt::internal::UnknownEnumValue::String(value.to_string()),
2162 )),
2163 }
2164 }
2165 }
2166
2167 impl serde::ser::Serialize for OSVersion {
2168 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2169 where
2170 S: serde::Serializer,
2171 {
2172 match self {
2173 Self::Unspecified => serializer.serialize_i32(0),
2174 Self::Ltsc2019 => serializer.serialize_i32(1),
2175 Self::Ltsc2022 => serializer.serialize_i32(2),
2176 Self::UnknownValue(u) => u.0.serialize(serializer),
2177 }
2178 }
2179 }
2180
2181 impl<'de> serde::de::Deserialize<'de> for OSVersion {
2182 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2183 where
2184 D: serde::Deserializer<'de>,
2185 {
2186 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OSVersion>::new(
2187 ".google.container.v1.WindowsNodeConfig.OSVersion",
2188 ))
2189 }
2190 }
2191}
2192
2193/// Node kubelet configs.
2194#[derive(Clone, Default, PartialEq)]
2195#[non_exhaustive]
2196pub struct NodeKubeletConfig {
2197 /// Control the CPU management policy on the node.
2198 /// See
2199 /// <https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/>
2200 ///
2201 /// The following values are allowed.
2202 ///
2203 /// * "none": the default, which represents the existing scheduling behavior.
2204 /// * "static": allows pods with certain resource characteristics to be granted
2205 /// increased CPU affinity and exclusivity on the node.
2206 /// The default value is 'none' if unspecified.
2207 pub cpu_manager_policy: std::string::String,
2208
2209 /// Optional. Controls Topology Manager configuration on the node.
2210 /// For more information, see:
2211 /// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/>
2212 pub topology_manager: std::option::Option<crate::model::TopologyManager>,
2213
2214 /// Optional. Controls NUMA-aware Memory Manager configuration on the
2215 /// node. For more information, see:
2216 /// <https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/>
2217 pub memory_manager: std::option::Option<crate::model::MemoryManager>,
2218
2219 /// Enable CPU CFS quota enforcement for containers that specify CPU limits.
2220 ///
2221 /// This option is enabled by default which makes kubelet use CFS quota
2222 /// (<https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt>) to
2223 /// enforce container CPU limits. Otherwise, CPU limits will not be enforced at
2224 /// all.
2225 ///
2226 /// Disable this option to mitigate CPU throttling problems while still having
2227 /// your pods to be in Guaranteed QoS class by specifying the CPU limits.
2228 ///
2229 /// The default value is 'true' if unspecified.
2230 pub cpu_cfs_quota: std::option::Option<wkt::BoolValue>,
2231
2232 /// Set the CPU CFS quota period value 'cpu.cfs_period_us'.
2233 ///
2234 /// The string must be a sequence of decimal numbers, each with optional
2235 /// fraction and a unit suffix, such as "300ms".
2236 /// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
2237 /// The value must be a positive duration between 1ms and 1 second, inclusive.
2238 pub cpu_cfs_quota_period: std::string::String,
2239
2240 /// Set the Pod PID limits. See
2241 /// <https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits>
2242 ///
2243 /// Controls the maximum number of processes allowed to run in a pod. The value
2244 /// must be greater than or equal to 1024 and less than 4194304.
2245 pub pod_pids_limit: i64,
2246
2247 /// Enable or disable Kubelet read only port.
2248 pub insecure_kubelet_readonly_port_enabled: std::option::Option<bool>,
2249
2250 /// Optional. Defines the percent of disk usage before which image garbage
2251 /// collection is never run. Lowest disk usage to garbage collect to. The
2252 /// percent is calculated as this field value out of 100.
2253 ///
2254 /// The value must be between 10 and 85, inclusive and smaller than
2255 /// image_gc_high_threshold_percent.
2256 ///
2257 /// The default value is 80 if unspecified.
2258 pub image_gc_low_threshold_percent: i32,
2259
2260 /// Optional. Defines the percent of disk usage after which image garbage
2261 /// collection is always run. The percent is calculated as this field value out
2262 /// of 100.
2263 ///
2264 /// The value must be between 10 and 85, inclusive and greater than
2265 /// image_gc_low_threshold_percent.
2266 ///
2267 /// The default value is 85 if unspecified.
2268 pub image_gc_high_threshold_percent: i32,
2269
2270 /// Optional. Defines the minimum age for an unused image before it is garbage
2271 /// collected.
2272 ///
2273 /// The string must be a sequence of decimal numbers, each with optional
2274 /// fraction and a unit suffix, such as "300s", "1.5h", and "2h45m". Valid time
2275 /// units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
2276 ///
2277 /// The value must be a positive duration less than or equal to 2 minutes.
2278 ///
2279 /// The default value is "2m0s" if unspecified.
2280 pub image_minimum_gc_age: std::string::String,
2281
2282 /// Optional. Defines the maximum age an image can be unused before it is
2283 /// garbage collected. The string must be a sequence of decimal numbers, each
2284 /// with optional fraction and a unit suffix, such as "300s", "1.5h", and
2285 /// "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
2286 ///
2287 /// The value must be a positive duration greater than image_minimum_gc_age
2288 /// or "0s".
2289 ///
2290 /// The default value is "0s" if unspecified, which disables this field,
2291 /// meaning images won't be garbage collected based on being unused for too
2292 /// long.
2293 pub image_maximum_gc_age: std::string::String,
2294
2295 /// Optional. Defines the maximum size of the container log file before it is
2296 /// rotated. See
2297 /// <https://kubernetes.io/docs/concepts/cluster-administration/logging/#log-rotation>
2298 ///
2299 /// Valid format is positive number + unit, e.g. 100Ki, 10Mi. Valid units are
2300 /// Ki, Mi, Gi.
2301 /// The value must be between 10Mi and 500Mi, inclusive.
2302 ///
2303 /// Note that the total container log size (container_log_max_size *
2304 /// container_log_max_files) cannot exceed 1% of the total
2305 /// storage of the node, to avoid disk pressure caused by log files.
2306 ///
2307 /// The default value is 10Mi if unspecified.
2308 pub container_log_max_size: std::string::String,
2309
2310 /// Optional. Defines the maximum number of container log files that can be
2311 /// present for a container. See
2312 /// <https://kubernetes.io/docs/concepts/cluster-administration/logging/#log-rotation>
2313 ///
2314 /// The value must be an integer between 2 and 10, inclusive.
2315 /// The default value is 5 if unspecified.
2316 pub container_log_max_files: i32,
2317
2318 /// Optional. Defines a comma-separated allowlist of unsafe sysctls or sysctl
2319 /// patterns (ending in `*`).
2320 ///
2321 /// The unsafe namespaced sysctl groups are `kernel.shm*`, `kernel.msg*`,
2322 /// `kernel.sem`, `fs.mqueue.*`, and `net.*`. Leaving this allowlist empty
2323 /// means they cannot be set on Pods.
2324 ///
2325 /// To allow certain sysctls or sysctl patterns to be set on Pods, list them
2326 /// separated by commas.
2327 /// For example: `kernel.msg*,net.ipv4.route.min_pmtu`.
2328 ///
2329 /// See <https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/>
2330 /// for more details.
2331 pub allowed_unsafe_sysctls: std::vec::Vec<std::string::String>,
2332
2333 /// Optional. eviction_soft is a map of signal names to quantities that defines
2334 /// soft eviction thresholds. Each signal is compared to its corresponding
2335 /// threshold to determine if a pod eviction should occur.
2336 pub eviction_soft: std::option::Option<crate::model::EvictionSignals>,
2337
2338 /// Optional. eviction_soft_grace_period is a map of signal names to quantities
2339 /// that defines grace periods for each soft eviction signal. The grace period
2340 /// is the amount of time that a pod must be under pressure before an eviction
2341 /// occurs.
2342 pub eviction_soft_grace_period: std::option::Option<crate::model::EvictionGracePeriod>,
2343
2344 /// Optional. eviction_minimum_reclaim is a map of signal names to quantities
2345 /// that defines minimum reclaims, which describe the minimum amount of a given
2346 /// resource the kubelet will reclaim when performing a pod eviction while that
2347 /// resource is under pressure.
2348 pub eviction_minimum_reclaim: std::option::Option<crate::model::EvictionMinimumReclaim>,
2349
2350 /// Optional. eviction_max_pod_grace_period_seconds is the maximum allowed
2351 /// grace period (in seconds) to use when terminating pods in response to a
2352 /// soft eviction threshold being met. This value effectively caps the Pod's
2353 /// terminationGracePeriodSeconds value during soft evictions. Default: 0.
2354 /// Range: [0, 300].
2355 pub eviction_max_pod_grace_period_seconds: i32,
2356
2357 /// Optional. Defines the maximum number of image pulls in parallel.
2358 /// The range is 2 to 5, inclusive.
2359 /// The default value is 2 or 3 depending on the disk type.
2360 ///
2361 /// See
2362 /// <https://kubernetes.io/docs/concepts/containers/images/#maximum-parallel-image-pulls>
2363 /// for more details.
2364 pub max_parallel_image_pulls: i32,
2365
2366 /// Optional. Defines whether to enable single process OOM killer.
2367 /// If true, will prevent the memory.oom.group flag from being set for
2368 /// container cgroups in cgroups v2. This causes processes in the container to
2369 /// be OOM killed individually instead of as a group.
2370 pub single_process_oom_kill: std::option::Option<bool>,
2371
2372 /// Optional. Contains configuration options to modify node-level parameters
2373 /// for container restart behavior.
2374 pub crash_loop_back_off:
2375 std::option::Option<crate::model::node_kubelet_config::CrashLoopBackOffConfig>,
2376
2377 /// Optional. shutdown_grace_period_seconds is the maximum allowed grace period
2378 /// (in seconds) the total duration that the node should delay the shutdown
2379 /// during a graceful shutdown. This is the total grace period for pod
2380 /// termination for both regular and critical pods.
2381 /// <https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/>
2382 /// If set to 0, node will not enable the graceful node shutdown functionality.
2383 /// This field is only valid for Spot VMs.
2384 /// Allowed values: 0, 30, 120.
2385 pub shutdown_grace_period_seconds: std::option::Option<i32>,
2386
2387 /// Optional. shutdown_grace_period_critical_pods_seconds is the maximum
2388 /// allowed grace period (in seconds) used to terminate critical pods during a
2389 /// node shutdown. This value should be <= shutdown_grace_period_seconds, and
2390 /// is only valid if shutdown_grace_period_seconds is set.
2391 /// <https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/>
2392 /// Range: [0, 120].
2393 pub shutdown_grace_period_critical_pods_seconds: std::option::Option<i32>,
2394
2395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2396}
2397
2398impl NodeKubeletConfig {
2399 /// Creates a new default instance.
2400 pub fn new() -> Self {
2401 std::default::Default::default()
2402 }
2403
2404 /// Sets the value of [cpu_manager_policy][crate::model::NodeKubeletConfig::cpu_manager_policy].
2405 ///
2406 /// # Example
2407 /// ```ignore,no_run
2408 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2409 /// let x = NodeKubeletConfig::new().set_cpu_manager_policy("example");
2410 /// ```
2411 pub fn set_cpu_manager_policy<T: std::convert::Into<std::string::String>>(
2412 mut self,
2413 v: T,
2414 ) -> Self {
2415 self.cpu_manager_policy = v.into();
2416 self
2417 }
2418
2419 /// Sets the value of [topology_manager][crate::model::NodeKubeletConfig::topology_manager].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2424 /// use google_cloud_container_v1::model::TopologyManager;
2425 /// let x = NodeKubeletConfig::new().set_topology_manager(TopologyManager::default()/* use setters */);
2426 /// ```
2427 pub fn set_topology_manager<T>(mut self, v: T) -> Self
2428 where
2429 T: std::convert::Into<crate::model::TopologyManager>,
2430 {
2431 self.topology_manager = std::option::Option::Some(v.into());
2432 self
2433 }
2434
2435 /// Sets or clears the value of [topology_manager][crate::model::NodeKubeletConfig::topology_manager].
2436 ///
2437 /// # Example
2438 /// ```ignore,no_run
2439 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2440 /// use google_cloud_container_v1::model::TopologyManager;
2441 /// let x = NodeKubeletConfig::new().set_or_clear_topology_manager(Some(TopologyManager::default()/* use setters */));
2442 /// let x = NodeKubeletConfig::new().set_or_clear_topology_manager(None::<TopologyManager>);
2443 /// ```
2444 pub fn set_or_clear_topology_manager<T>(mut self, v: std::option::Option<T>) -> Self
2445 where
2446 T: std::convert::Into<crate::model::TopologyManager>,
2447 {
2448 self.topology_manager = v.map(|x| x.into());
2449 self
2450 }
2451
2452 /// Sets the value of [memory_manager][crate::model::NodeKubeletConfig::memory_manager].
2453 ///
2454 /// # Example
2455 /// ```ignore,no_run
2456 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2457 /// use google_cloud_container_v1::model::MemoryManager;
2458 /// let x = NodeKubeletConfig::new().set_memory_manager(MemoryManager::default()/* use setters */);
2459 /// ```
2460 pub fn set_memory_manager<T>(mut self, v: T) -> Self
2461 where
2462 T: std::convert::Into<crate::model::MemoryManager>,
2463 {
2464 self.memory_manager = std::option::Option::Some(v.into());
2465 self
2466 }
2467
2468 /// Sets or clears the value of [memory_manager][crate::model::NodeKubeletConfig::memory_manager].
2469 ///
2470 /// # Example
2471 /// ```ignore,no_run
2472 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2473 /// use google_cloud_container_v1::model::MemoryManager;
2474 /// let x = NodeKubeletConfig::new().set_or_clear_memory_manager(Some(MemoryManager::default()/* use setters */));
2475 /// let x = NodeKubeletConfig::new().set_or_clear_memory_manager(None::<MemoryManager>);
2476 /// ```
2477 pub fn set_or_clear_memory_manager<T>(mut self, v: std::option::Option<T>) -> Self
2478 where
2479 T: std::convert::Into<crate::model::MemoryManager>,
2480 {
2481 self.memory_manager = v.map(|x| x.into());
2482 self
2483 }
2484
2485 /// Sets the value of [cpu_cfs_quota][crate::model::NodeKubeletConfig::cpu_cfs_quota].
2486 ///
2487 /// # Example
2488 /// ```ignore,no_run
2489 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2490 /// use wkt::BoolValue;
2491 /// let x = NodeKubeletConfig::new().set_cpu_cfs_quota(BoolValue::default()/* use setters */);
2492 /// ```
2493 pub fn set_cpu_cfs_quota<T>(mut self, v: T) -> Self
2494 where
2495 T: std::convert::Into<wkt::BoolValue>,
2496 {
2497 self.cpu_cfs_quota = std::option::Option::Some(v.into());
2498 self
2499 }
2500
2501 /// Sets or clears the value of [cpu_cfs_quota][crate::model::NodeKubeletConfig::cpu_cfs_quota].
2502 ///
2503 /// # Example
2504 /// ```ignore,no_run
2505 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2506 /// use wkt::BoolValue;
2507 /// let x = NodeKubeletConfig::new().set_or_clear_cpu_cfs_quota(Some(BoolValue::default()/* use setters */));
2508 /// let x = NodeKubeletConfig::new().set_or_clear_cpu_cfs_quota(None::<BoolValue>);
2509 /// ```
2510 pub fn set_or_clear_cpu_cfs_quota<T>(mut self, v: std::option::Option<T>) -> Self
2511 where
2512 T: std::convert::Into<wkt::BoolValue>,
2513 {
2514 self.cpu_cfs_quota = v.map(|x| x.into());
2515 self
2516 }
2517
2518 /// Sets the value of [cpu_cfs_quota_period][crate::model::NodeKubeletConfig::cpu_cfs_quota_period].
2519 ///
2520 /// # Example
2521 /// ```ignore,no_run
2522 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2523 /// let x = NodeKubeletConfig::new().set_cpu_cfs_quota_period("example");
2524 /// ```
2525 pub fn set_cpu_cfs_quota_period<T: std::convert::Into<std::string::String>>(
2526 mut self,
2527 v: T,
2528 ) -> Self {
2529 self.cpu_cfs_quota_period = v.into();
2530 self
2531 }
2532
2533 /// Sets the value of [pod_pids_limit][crate::model::NodeKubeletConfig::pod_pids_limit].
2534 ///
2535 /// # Example
2536 /// ```ignore,no_run
2537 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2538 /// let x = NodeKubeletConfig::new().set_pod_pids_limit(42);
2539 /// ```
2540 pub fn set_pod_pids_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2541 self.pod_pids_limit = v.into();
2542 self
2543 }
2544
2545 /// Sets the value of [insecure_kubelet_readonly_port_enabled][crate::model::NodeKubeletConfig::insecure_kubelet_readonly_port_enabled].
2546 ///
2547 /// # Example
2548 /// ```ignore,no_run
2549 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2550 /// let x = NodeKubeletConfig::new().set_insecure_kubelet_readonly_port_enabled(true);
2551 /// ```
2552 pub fn set_insecure_kubelet_readonly_port_enabled<T>(mut self, v: T) -> Self
2553 where
2554 T: std::convert::Into<bool>,
2555 {
2556 self.insecure_kubelet_readonly_port_enabled = std::option::Option::Some(v.into());
2557 self
2558 }
2559
2560 /// Sets or clears the value of [insecure_kubelet_readonly_port_enabled][crate::model::NodeKubeletConfig::insecure_kubelet_readonly_port_enabled].
2561 ///
2562 /// # Example
2563 /// ```ignore,no_run
2564 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2565 /// let x = NodeKubeletConfig::new().set_or_clear_insecure_kubelet_readonly_port_enabled(Some(false));
2566 /// let x = NodeKubeletConfig::new().set_or_clear_insecure_kubelet_readonly_port_enabled(None::<bool>);
2567 /// ```
2568 pub fn set_or_clear_insecure_kubelet_readonly_port_enabled<T>(
2569 mut self,
2570 v: std::option::Option<T>,
2571 ) -> Self
2572 where
2573 T: std::convert::Into<bool>,
2574 {
2575 self.insecure_kubelet_readonly_port_enabled = v.map(|x| x.into());
2576 self
2577 }
2578
2579 /// Sets the value of [image_gc_low_threshold_percent][crate::model::NodeKubeletConfig::image_gc_low_threshold_percent].
2580 ///
2581 /// # Example
2582 /// ```ignore,no_run
2583 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2584 /// let x = NodeKubeletConfig::new().set_image_gc_low_threshold_percent(42);
2585 /// ```
2586 pub fn set_image_gc_low_threshold_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2587 self.image_gc_low_threshold_percent = v.into();
2588 self
2589 }
2590
2591 /// Sets the value of [image_gc_high_threshold_percent][crate::model::NodeKubeletConfig::image_gc_high_threshold_percent].
2592 ///
2593 /// # Example
2594 /// ```ignore,no_run
2595 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2596 /// let x = NodeKubeletConfig::new().set_image_gc_high_threshold_percent(42);
2597 /// ```
2598 pub fn set_image_gc_high_threshold_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2599 self.image_gc_high_threshold_percent = v.into();
2600 self
2601 }
2602
2603 /// Sets the value of [image_minimum_gc_age][crate::model::NodeKubeletConfig::image_minimum_gc_age].
2604 ///
2605 /// # Example
2606 /// ```ignore,no_run
2607 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2608 /// let x = NodeKubeletConfig::new().set_image_minimum_gc_age("example");
2609 /// ```
2610 pub fn set_image_minimum_gc_age<T: std::convert::Into<std::string::String>>(
2611 mut self,
2612 v: T,
2613 ) -> Self {
2614 self.image_minimum_gc_age = v.into();
2615 self
2616 }
2617
2618 /// Sets the value of [image_maximum_gc_age][crate::model::NodeKubeletConfig::image_maximum_gc_age].
2619 ///
2620 /// # Example
2621 /// ```ignore,no_run
2622 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2623 /// let x = NodeKubeletConfig::new().set_image_maximum_gc_age("example");
2624 /// ```
2625 pub fn set_image_maximum_gc_age<T: std::convert::Into<std::string::String>>(
2626 mut self,
2627 v: T,
2628 ) -> Self {
2629 self.image_maximum_gc_age = v.into();
2630 self
2631 }
2632
2633 /// Sets the value of [container_log_max_size][crate::model::NodeKubeletConfig::container_log_max_size].
2634 ///
2635 /// # Example
2636 /// ```ignore,no_run
2637 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2638 /// let x = NodeKubeletConfig::new().set_container_log_max_size("example");
2639 /// ```
2640 pub fn set_container_log_max_size<T: std::convert::Into<std::string::String>>(
2641 mut self,
2642 v: T,
2643 ) -> Self {
2644 self.container_log_max_size = v.into();
2645 self
2646 }
2647
2648 /// Sets the value of [container_log_max_files][crate::model::NodeKubeletConfig::container_log_max_files].
2649 ///
2650 /// # Example
2651 /// ```ignore,no_run
2652 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2653 /// let x = NodeKubeletConfig::new().set_container_log_max_files(42);
2654 /// ```
2655 pub fn set_container_log_max_files<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2656 self.container_log_max_files = v.into();
2657 self
2658 }
2659
2660 /// Sets the value of [allowed_unsafe_sysctls][crate::model::NodeKubeletConfig::allowed_unsafe_sysctls].
2661 ///
2662 /// # Example
2663 /// ```ignore,no_run
2664 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2665 /// let x = NodeKubeletConfig::new().set_allowed_unsafe_sysctls(["a", "b", "c"]);
2666 /// ```
2667 pub fn set_allowed_unsafe_sysctls<T, V>(mut self, v: T) -> Self
2668 where
2669 T: std::iter::IntoIterator<Item = V>,
2670 V: std::convert::Into<std::string::String>,
2671 {
2672 use std::iter::Iterator;
2673 self.allowed_unsafe_sysctls = v.into_iter().map(|i| i.into()).collect();
2674 self
2675 }
2676
2677 /// Sets the value of [eviction_soft][crate::model::NodeKubeletConfig::eviction_soft].
2678 ///
2679 /// # Example
2680 /// ```ignore,no_run
2681 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2682 /// use google_cloud_container_v1::model::EvictionSignals;
2683 /// let x = NodeKubeletConfig::new().set_eviction_soft(EvictionSignals::default()/* use setters */);
2684 /// ```
2685 pub fn set_eviction_soft<T>(mut self, v: T) -> Self
2686 where
2687 T: std::convert::Into<crate::model::EvictionSignals>,
2688 {
2689 self.eviction_soft = std::option::Option::Some(v.into());
2690 self
2691 }
2692
2693 /// Sets or clears the value of [eviction_soft][crate::model::NodeKubeletConfig::eviction_soft].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2698 /// use google_cloud_container_v1::model::EvictionSignals;
2699 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft(Some(EvictionSignals::default()/* use setters */));
2700 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft(None::<EvictionSignals>);
2701 /// ```
2702 pub fn set_or_clear_eviction_soft<T>(mut self, v: std::option::Option<T>) -> Self
2703 where
2704 T: std::convert::Into<crate::model::EvictionSignals>,
2705 {
2706 self.eviction_soft = v.map(|x| x.into());
2707 self
2708 }
2709
2710 /// Sets the value of [eviction_soft_grace_period][crate::model::NodeKubeletConfig::eviction_soft_grace_period].
2711 ///
2712 /// # Example
2713 /// ```ignore,no_run
2714 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2715 /// use google_cloud_container_v1::model::EvictionGracePeriod;
2716 /// let x = NodeKubeletConfig::new().set_eviction_soft_grace_period(EvictionGracePeriod::default()/* use setters */);
2717 /// ```
2718 pub fn set_eviction_soft_grace_period<T>(mut self, v: T) -> Self
2719 where
2720 T: std::convert::Into<crate::model::EvictionGracePeriod>,
2721 {
2722 self.eviction_soft_grace_period = std::option::Option::Some(v.into());
2723 self
2724 }
2725
2726 /// Sets or clears the value of [eviction_soft_grace_period][crate::model::NodeKubeletConfig::eviction_soft_grace_period].
2727 ///
2728 /// # Example
2729 /// ```ignore,no_run
2730 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2731 /// use google_cloud_container_v1::model::EvictionGracePeriod;
2732 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft_grace_period(Some(EvictionGracePeriod::default()/* use setters */));
2733 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft_grace_period(None::<EvictionGracePeriod>);
2734 /// ```
2735 pub fn set_or_clear_eviction_soft_grace_period<T>(mut self, v: std::option::Option<T>) -> Self
2736 where
2737 T: std::convert::Into<crate::model::EvictionGracePeriod>,
2738 {
2739 self.eviction_soft_grace_period = v.map(|x| x.into());
2740 self
2741 }
2742
2743 /// Sets the value of [eviction_minimum_reclaim][crate::model::NodeKubeletConfig::eviction_minimum_reclaim].
2744 ///
2745 /// # Example
2746 /// ```ignore,no_run
2747 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2748 /// use google_cloud_container_v1::model::EvictionMinimumReclaim;
2749 /// let x = NodeKubeletConfig::new().set_eviction_minimum_reclaim(EvictionMinimumReclaim::default()/* use setters */);
2750 /// ```
2751 pub fn set_eviction_minimum_reclaim<T>(mut self, v: T) -> Self
2752 where
2753 T: std::convert::Into<crate::model::EvictionMinimumReclaim>,
2754 {
2755 self.eviction_minimum_reclaim = std::option::Option::Some(v.into());
2756 self
2757 }
2758
2759 /// Sets or clears the value of [eviction_minimum_reclaim][crate::model::NodeKubeletConfig::eviction_minimum_reclaim].
2760 ///
2761 /// # Example
2762 /// ```ignore,no_run
2763 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2764 /// use google_cloud_container_v1::model::EvictionMinimumReclaim;
2765 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_minimum_reclaim(Some(EvictionMinimumReclaim::default()/* use setters */));
2766 /// let x = NodeKubeletConfig::new().set_or_clear_eviction_minimum_reclaim(None::<EvictionMinimumReclaim>);
2767 /// ```
2768 pub fn set_or_clear_eviction_minimum_reclaim<T>(mut self, v: std::option::Option<T>) -> Self
2769 where
2770 T: std::convert::Into<crate::model::EvictionMinimumReclaim>,
2771 {
2772 self.eviction_minimum_reclaim = v.map(|x| x.into());
2773 self
2774 }
2775
2776 /// Sets the value of [eviction_max_pod_grace_period_seconds][crate::model::NodeKubeletConfig::eviction_max_pod_grace_period_seconds].
2777 ///
2778 /// # Example
2779 /// ```ignore,no_run
2780 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2781 /// let x = NodeKubeletConfig::new().set_eviction_max_pod_grace_period_seconds(42);
2782 /// ```
2783 pub fn set_eviction_max_pod_grace_period_seconds<T: std::convert::Into<i32>>(
2784 mut self,
2785 v: T,
2786 ) -> Self {
2787 self.eviction_max_pod_grace_period_seconds = v.into();
2788 self
2789 }
2790
2791 /// Sets the value of [max_parallel_image_pulls][crate::model::NodeKubeletConfig::max_parallel_image_pulls].
2792 ///
2793 /// # Example
2794 /// ```ignore,no_run
2795 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2796 /// let x = NodeKubeletConfig::new().set_max_parallel_image_pulls(42);
2797 /// ```
2798 pub fn set_max_parallel_image_pulls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2799 self.max_parallel_image_pulls = v.into();
2800 self
2801 }
2802
2803 /// Sets the value of [single_process_oom_kill][crate::model::NodeKubeletConfig::single_process_oom_kill].
2804 ///
2805 /// # Example
2806 /// ```ignore,no_run
2807 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2808 /// let x = NodeKubeletConfig::new().set_single_process_oom_kill(true);
2809 /// ```
2810 pub fn set_single_process_oom_kill<T>(mut self, v: T) -> Self
2811 where
2812 T: std::convert::Into<bool>,
2813 {
2814 self.single_process_oom_kill = std::option::Option::Some(v.into());
2815 self
2816 }
2817
2818 /// Sets or clears the value of [single_process_oom_kill][crate::model::NodeKubeletConfig::single_process_oom_kill].
2819 ///
2820 /// # Example
2821 /// ```ignore,no_run
2822 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2823 /// let x = NodeKubeletConfig::new().set_or_clear_single_process_oom_kill(Some(false));
2824 /// let x = NodeKubeletConfig::new().set_or_clear_single_process_oom_kill(None::<bool>);
2825 /// ```
2826 pub fn set_or_clear_single_process_oom_kill<T>(mut self, v: std::option::Option<T>) -> Self
2827 where
2828 T: std::convert::Into<bool>,
2829 {
2830 self.single_process_oom_kill = v.map(|x| x.into());
2831 self
2832 }
2833
2834 /// Sets the value of [crash_loop_back_off][crate::model::NodeKubeletConfig::crash_loop_back_off].
2835 ///
2836 /// # Example
2837 /// ```ignore,no_run
2838 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2839 /// use google_cloud_container_v1::model::node_kubelet_config::CrashLoopBackOffConfig;
2840 /// let x = NodeKubeletConfig::new().set_crash_loop_back_off(CrashLoopBackOffConfig::default()/* use setters */);
2841 /// ```
2842 pub fn set_crash_loop_back_off<T>(mut self, v: T) -> Self
2843 where
2844 T: std::convert::Into<crate::model::node_kubelet_config::CrashLoopBackOffConfig>,
2845 {
2846 self.crash_loop_back_off = std::option::Option::Some(v.into());
2847 self
2848 }
2849
2850 /// Sets or clears the value of [crash_loop_back_off][crate::model::NodeKubeletConfig::crash_loop_back_off].
2851 ///
2852 /// # Example
2853 /// ```ignore,no_run
2854 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2855 /// use google_cloud_container_v1::model::node_kubelet_config::CrashLoopBackOffConfig;
2856 /// let x = NodeKubeletConfig::new().set_or_clear_crash_loop_back_off(Some(CrashLoopBackOffConfig::default()/* use setters */));
2857 /// let x = NodeKubeletConfig::new().set_or_clear_crash_loop_back_off(None::<CrashLoopBackOffConfig>);
2858 /// ```
2859 pub fn set_or_clear_crash_loop_back_off<T>(mut self, v: std::option::Option<T>) -> Self
2860 where
2861 T: std::convert::Into<crate::model::node_kubelet_config::CrashLoopBackOffConfig>,
2862 {
2863 self.crash_loop_back_off = v.map(|x| x.into());
2864 self
2865 }
2866
2867 /// Sets the value of [shutdown_grace_period_seconds][crate::model::NodeKubeletConfig::shutdown_grace_period_seconds].
2868 ///
2869 /// # Example
2870 /// ```ignore,no_run
2871 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2872 /// let x = NodeKubeletConfig::new().set_shutdown_grace_period_seconds(42);
2873 /// ```
2874 pub fn set_shutdown_grace_period_seconds<T>(mut self, v: T) -> Self
2875 where
2876 T: std::convert::Into<i32>,
2877 {
2878 self.shutdown_grace_period_seconds = std::option::Option::Some(v.into());
2879 self
2880 }
2881
2882 /// Sets or clears the value of [shutdown_grace_period_seconds][crate::model::NodeKubeletConfig::shutdown_grace_period_seconds].
2883 ///
2884 /// # Example
2885 /// ```ignore,no_run
2886 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2887 /// let x = NodeKubeletConfig::new().set_or_clear_shutdown_grace_period_seconds(Some(42));
2888 /// let x = NodeKubeletConfig::new().set_or_clear_shutdown_grace_period_seconds(None::<i32>);
2889 /// ```
2890 pub fn set_or_clear_shutdown_grace_period_seconds<T>(
2891 mut self,
2892 v: std::option::Option<T>,
2893 ) -> Self
2894 where
2895 T: std::convert::Into<i32>,
2896 {
2897 self.shutdown_grace_period_seconds = v.map(|x| x.into());
2898 self
2899 }
2900
2901 /// Sets the value of [shutdown_grace_period_critical_pods_seconds][crate::model::NodeKubeletConfig::shutdown_grace_period_critical_pods_seconds].
2902 ///
2903 /// # Example
2904 /// ```ignore,no_run
2905 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2906 /// let x = NodeKubeletConfig::new().set_shutdown_grace_period_critical_pods_seconds(42);
2907 /// ```
2908 pub fn set_shutdown_grace_period_critical_pods_seconds<T>(mut self, v: T) -> Self
2909 where
2910 T: std::convert::Into<i32>,
2911 {
2912 self.shutdown_grace_period_critical_pods_seconds = std::option::Option::Some(v.into());
2913 self
2914 }
2915
2916 /// Sets or clears the value of [shutdown_grace_period_critical_pods_seconds][crate::model::NodeKubeletConfig::shutdown_grace_period_critical_pods_seconds].
2917 ///
2918 /// # Example
2919 /// ```ignore,no_run
2920 /// # use google_cloud_container_v1::model::NodeKubeletConfig;
2921 /// let x = NodeKubeletConfig::new().set_or_clear_shutdown_grace_period_critical_pods_seconds(Some(42));
2922 /// let x = NodeKubeletConfig::new().set_or_clear_shutdown_grace_period_critical_pods_seconds(None::<i32>);
2923 /// ```
2924 pub fn set_or_clear_shutdown_grace_period_critical_pods_seconds<T>(
2925 mut self,
2926 v: std::option::Option<T>,
2927 ) -> Self
2928 where
2929 T: std::convert::Into<i32>,
2930 {
2931 self.shutdown_grace_period_critical_pods_seconds = v.map(|x| x.into());
2932 self
2933 }
2934}
2935
2936impl wkt::message::Message for NodeKubeletConfig {
2937 fn typename() -> &'static str {
2938 "type.googleapis.com/google.container.v1.NodeKubeletConfig"
2939 }
2940}
2941
2942/// Defines additional types related to [NodeKubeletConfig].
2943pub mod node_kubelet_config {
2944 #[allow(unused_imports)]
2945 use super::*;
2946
2947 /// Contains config to modify node-level parameters for container restart
2948 /// behavior.
2949 #[derive(Clone, Default, PartialEq)]
2950 #[non_exhaustive]
2951 pub struct CrashLoopBackOffConfig {
2952 /// Optional. The maximum duration the backoff delay can accrue to for
2953 /// container restarts, minimum 1 second, maximum 300 seconds. If not set,
2954 /// defaults to the internal crashloopbackoff maximum.
2955 ///
2956 /// The string must be a sequence of decimal numbers, each with optional
2957 /// fraction and a unit suffix, such as "300ms".
2958 /// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
2959 ///
2960 /// See
2961 /// <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#configurable-container-restart-delay>
2962 /// for more details.
2963 pub max_container_restart_period: std::string::String,
2964
2965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2966 }
2967
2968 impl CrashLoopBackOffConfig {
2969 /// Creates a new default instance.
2970 pub fn new() -> Self {
2971 std::default::Default::default()
2972 }
2973
2974 /// Sets the value of [max_container_restart_period][crate::model::node_kubelet_config::CrashLoopBackOffConfig::max_container_restart_period].
2975 ///
2976 /// # Example
2977 /// ```ignore,no_run
2978 /// # use google_cloud_container_v1::model::node_kubelet_config::CrashLoopBackOffConfig;
2979 /// let x = CrashLoopBackOffConfig::new().set_max_container_restart_period("example");
2980 /// ```
2981 pub fn set_max_container_restart_period<T: std::convert::Into<std::string::String>>(
2982 mut self,
2983 v: T,
2984 ) -> Self {
2985 self.max_container_restart_period = v.into();
2986 self
2987 }
2988 }
2989
2990 impl wkt::message::Message for CrashLoopBackOffConfig {
2991 fn typename() -> &'static str {
2992 "type.googleapis.com/google.container.v1.NodeKubeletConfig.CrashLoopBackOffConfig"
2993 }
2994 }
2995}
2996
2997/// TopologyManager defines the configuration options for Topology Manager
2998/// feature. See
2999/// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/>
3000#[derive(Clone, Default, PartialEq)]
3001#[non_exhaustive]
3002pub struct TopologyManager {
3003 /// Configures the strategy for resource alignment.
3004 /// Allowed values are:
3005 ///
3006 /// * none: the default policy, and does not perform any topology alignment.
3007 /// * restricted: the topology manager stores the preferred NUMA node affinity
3008 /// for the container, and will reject the pod if the affinity if not
3009 /// preferred.
3010 /// * best-effort: the topology manager stores the preferred NUMA node affinity
3011 /// for the container. If the affinity is not preferred, the topology manager
3012 /// will admit the pod to the node anyway.
3013 /// * single-numa-node: the topology manager determines if the single NUMA node
3014 /// affinity is possible. If it is, Topology Manager will store this and the
3015 /// Hint Providers can then use this information when making the resource
3016 /// allocation decision. If, however, this is not possible then the
3017 /// Topology Manager will reject the pod from the node. This will result in a
3018 /// pod in a Terminated state with a pod admission failure.
3019 ///
3020 /// The default policy value is 'none' if unspecified.
3021 /// Details about each strategy can be found
3022 /// [here](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/#topology-manager-policies).
3023 pub policy: std::string::String,
3024
3025 /// The Topology Manager aligns resources in following scopes:
3026 ///
3027 /// * container
3028 /// * pod
3029 ///
3030 /// The default scope is 'container' if unspecified.
3031 /// See
3032 /// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/#topology-manager-scopes>
3033 pub scope: std::string::String,
3034
3035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3036}
3037
3038impl TopologyManager {
3039 /// Creates a new default instance.
3040 pub fn new() -> Self {
3041 std::default::Default::default()
3042 }
3043
3044 /// Sets the value of [policy][crate::model::TopologyManager::policy].
3045 ///
3046 /// # Example
3047 /// ```ignore,no_run
3048 /// # use google_cloud_container_v1::model::TopologyManager;
3049 /// let x = TopologyManager::new().set_policy("example");
3050 /// ```
3051 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3052 self.policy = v.into();
3053 self
3054 }
3055
3056 /// Sets the value of [scope][crate::model::TopologyManager::scope].
3057 ///
3058 /// # Example
3059 /// ```ignore,no_run
3060 /// # use google_cloud_container_v1::model::TopologyManager;
3061 /// let x = TopologyManager::new().set_scope("example");
3062 /// ```
3063 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.scope = v.into();
3065 self
3066 }
3067}
3068
3069impl wkt::message::Message for TopologyManager {
3070 fn typename() -> &'static str {
3071 "type.googleapis.com/google.container.v1.TopologyManager"
3072 }
3073}
3074
3075/// The option enables the Kubernetes NUMA-aware Memory Manager feature.
3076/// Detailed description about the feature can be found
3077/// [here](https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/).
3078#[derive(Clone, Default, PartialEq)]
3079#[non_exhaustive]
3080pub struct MemoryManager {
3081 /// Controls the memory management policy on the Node.
3082 /// See
3083 /// <https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/#policies>
3084 ///
3085 /// The following values are allowed.
3086 ///
3087 /// * "none"
3088 /// * "static"
3089 /// The default value is 'none' if unspecified.
3090 pub policy: std::string::String,
3091
3092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3093}
3094
3095impl MemoryManager {
3096 /// Creates a new default instance.
3097 pub fn new() -> Self {
3098 std::default::Default::default()
3099 }
3100
3101 /// Sets the value of [policy][crate::model::MemoryManager::policy].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_container_v1::model::MemoryManager;
3106 /// let x = MemoryManager::new().set_policy("example");
3107 /// ```
3108 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3109 self.policy = v.into();
3110 self
3111 }
3112}
3113
3114impl wkt::message::Message for MemoryManager {
3115 fn typename() -> &'static str {
3116 "type.googleapis.com/google.container.v1.MemoryManager"
3117 }
3118}
3119
3120/// Eviction signals are the current state of a particular resource at a specific
3121/// point in time. The kubelet uses eviction signals to make eviction decisions
3122/// by comparing the signals to eviction thresholds, which are the minimum amount
3123/// of the resource that should be available on the node.
3124#[derive(Clone, Default, PartialEq)]
3125#[non_exhaustive]
3126pub struct EvictionSignals {
3127 /// Optional. Memory available (i.e. capacity - workingSet), in bytes. Defines
3128 /// the amount of "memory.available" signal in kubelet. Default is unset, if
3129 /// not specified in the kubelet config. Format: positive number + unit, e.g.
3130 /// 100Ki, 10Mi, 5Gi. Valid units are Ki, Mi, Gi. Must be >= 100Mi and <= 50%
3131 /// of the node's memory. See
3132 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3133 pub memory_available: std::string::String,
3134
3135 /// Optional. Amount of storage available on filesystem that kubelet uses for
3136 /// volumes, daemon logs, etc. Defines the amount of "nodefs.available" signal
3137 /// in kubelet. Default is unset, if not specified in the kubelet config. It
3138 /// takses percentage value for now. Sample format: "30%". Must be >= 10% and
3139 /// <= 50%. See
3140 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3141 pub nodefs_available: std::string::String,
3142
3143 /// Optional. Amount of inodes available on filesystem that kubelet uses for
3144 /// volumes, daemon logs, etc. Defines the amount of "nodefs.inodesFree" signal
3145 /// in kubelet. Default is unset, if not specified in the kubelet config. Linux
3146 /// only. It takses percentage value for now. Sample format: "30%". Must be >=
3147 /// 5% and <= 50%. See
3148 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3149 pub nodefs_inodes_free: std::string::String,
3150
3151 /// Optional. Amount of storage available on filesystem that container runtime
3152 /// uses for storing images layers. If the container filesystem and image
3153 /// filesystem are not separate, then imagefs can store both image layers and
3154 /// writeable layers. Defines the amount of "imagefs.available" signal in
3155 /// kubelet. Default is unset, if not specified in the kubelet config. It
3156 /// takses percentage value for now. Sample format: "30%". Must be >= 15% and
3157 /// <= 50%. See
3158 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3159 pub imagefs_available: std::string::String,
3160
3161 /// Optional. Amount of inodes available on filesystem that container runtime
3162 /// uses for storing images layers. Defines the amount of "imagefs.inodesFree"
3163 /// signal in kubelet. Default is unset, if not specified in the kubelet
3164 /// config. Linux only. It takses percentage value for now. Sample format:
3165 /// "30%". Must be >= 5% and <= 50%. See
3166 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3167 pub imagefs_inodes_free: std::string::String,
3168
3169 /// Optional. Amount of PID available for pod allocation. Defines the amount of
3170 /// "pid.available" signal in kubelet. Default is unset, if not specified in
3171 /// the kubelet config. It takses percentage value for now. Sample format:
3172 /// "30%". Must be >= 10% and <= 50%. See
3173 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3174 pub pid_available: std::string::String,
3175
3176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3177}
3178
3179impl EvictionSignals {
3180 /// Creates a new default instance.
3181 pub fn new() -> Self {
3182 std::default::Default::default()
3183 }
3184
3185 /// Sets the value of [memory_available][crate::model::EvictionSignals::memory_available].
3186 ///
3187 /// # Example
3188 /// ```ignore,no_run
3189 /// # use google_cloud_container_v1::model::EvictionSignals;
3190 /// let x = EvictionSignals::new().set_memory_available("example");
3191 /// ```
3192 pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
3193 mut self,
3194 v: T,
3195 ) -> Self {
3196 self.memory_available = v.into();
3197 self
3198 }
3199
3200 /// Sets the value of [nodefs_available][crate::model::EvictionSignals::nodefs_available].
3201 ///
3202 /// # Example
3203 /// ```ignore,no_run
3204 /// # use google_cloud_container_v1::model::EvictionSignals;
3205 /// let x = EvictionSignals::new().set_nodefs_available("example");
3206 /// ```
3207 pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
3208 mut self,
3209 v: T,
3210 ) -> Self {
3211 self.nodefs_available = v.into();
3212 self
3213 }
3214
3215 /// Sets the value of [nodefs_inodes_free][crate::model::EvictionSignals::nodefs_inodes_free].
3216 ///
3217 /// # Example
3218 /// ```ignore,no_run
3219 /// # use google_cloud_container_v1::model::EvictionSignals;
3220 /// let x = EvictionSignals::new().set_nodefs_inodes_free("example");
3221 /// ```
3222 pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
3223 mut self,
3224 v: T,
3225 ) -> Self {
3226 self.nodefs_inodes_free = v.into();
3227 self
3228 }
3229
3230 /// Sets the value of [imagefs_available][crate::model::EvictionSignals::imagefs_available].
3231 ///
3232 /// # Example
3233 /// ```ignore,no_run
3234 /// # use google_cloud_container_v1::model::EvictionSignals;
3235 /// let x = EvictionSignals::new().set_imagefs_available("example");
3236 /// ```
3237 pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
3238 mut self,
3239 v: T,
3240 ) -> Self {
3241 self.imagefs_available = v.into();
3242 self
3243 }
3244
3245 /// Sets the value of [imagefs_inodes_free][crate::model::EvictionSignals::imagefs_inodes_free].
3246 ///
3247 /// # Example
3248 /// ```ignore,no_run
3249 /// # use google_cloud_container_v1::model::EvictionSignals;
3250 /// let x = EvictionSignals::new().set_imagefs_inodes_free("example");
3251 /// ```
3252 pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
3253 mut self,
3254 v: T,
3255 ) -> Self {
3256 self.imagefs_inodes_free = v.into();
3257 self
3258 }
3259
3260 /// Sets the value of [pid_available][crate::model::EvictionSignals::pid_available].
3261 ///
3262 /// # Example
3263 /// ```ignore,no_run
3264 /// # use google_cloud_container_v1::model::EvictionSignals;
3265 /// let x = EvictionSignals::new().set_pid_available("example");
3266 /// ```
3267 pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3268 self.pid_available = v.into();
3269 self
3270 }
3271}
3272
3273impl wkt::message::Message for EvictionSignals {
3274 fn typename() -> &'static str {
3275 "type.googleapis.com/google.container.v1.EvictionSignals"
3276 }
3277}
3278
3279/// Eviction grace periods are grace periods for each eviction signal.
3280#[derive(Clone, Default, PartialEq)]
3281#[non_exhaustive]
3282pub struct EvictionGracePeriod {
3283 /// Optional. Grace period for eviction due to memory available signal. Sample
3284 /// format: "10s". Must be >= 0. See
3285 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3286 pub memory_available: std::string::String,
3287
3288 /// Optional. Grace period for eviction due to nodefs available signal. Sample
3289 /// format: "10s". Must be >= 0. See
3290 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3291 pub nodefs_available: std::string::String,
3292
3293 /// Optional. Grace period for eviction due to nodefs inodes free signal.
3294 /// Sample format: "10s". Must be >= 0. See
3295 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3296 pub nodefs_inodes_free: std::string::String,
3297
3298 /// Optional. Grace period for eviction due to imagefs available signal. Sample
3299 /// format: "10s". Must be >= 0. See
3300 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3301 pub imagefs_available: std::string::String,
3302
3303 /// Optional. Grace period for eviction due to imagefs inodes free signal.
3304 /// Sample format: "10s". Must be >= 0. See
3305 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3306 pub imagefs_inodes_free: std::string::String,
3307
3308 /// Optional. Grace period for eviction due to pid available signal. Sample
3309 /// format: "10s". Must be >= 0. See
3310 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3311 pub pid_available: std::string::String,
3312
3313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3314}
3315
3316impl EvictionGracePeriod {
3317 /// Creates a new default instance.
3318 pub fn new() -> Self {
3319 std::default::Default::default()
3320 }
3321
3322 /// Sets the value of [memory_available][crate::model::EvictionGracePeriod::memory_available].
3323 ///
3324 /// # Example
3325 /// ```ignore,no_run
3326 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3327 /// let x = EvictionGracePeriod::new().set_memory_available("example");
3328 /// ```
3329 pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
3330 mut self,
3331 v: T,
3332 ) -> Self {
3333 self.memory_available = v.into();
3334 self
3335 }
3336
3337 /// Sets the value of [nodefs_available][crate::model::EvictionGracePeriod::nodefs_available].
3338 ///
3339 /// # Example
3340 /// ```ignore,no_run
3341 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3342 /// let x = EvictionGracePeriod::new().set_nodefs_available("example");
3343 /// ```
3344 pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
3345 mut self,
3346 v: T,
3347 ) -> Self {
3348 self.nodefs_available = v.into();
3349 self
3350 }
3351
3352 /// Sets the value of [nodefs_inodes_free][crate::model::EvictionGracePeriod::nodefs_inodes_free].
3353 ///
3354 /// # Example
3355 /// ```ignore,no_run
3356 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3357 /// let x = EvictionGracePeriod::new().set_nodefs_inodes_free("example");
3358 /// ```
3359 pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
3360 mut self,
3361 v: T,
3362 ) -> Self {
3363 self.nodefs_inodes_free = v.into();
3364 self
3365 }
3366
3367 /// Sets the value of [imagefs_available][crate::model::EvictionGracePeriod::imagefs_available].
3368 ///
3369 /// # Example
3370 /// ```ignore,no_run
3371 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3372 /// let x = EvictionGracePeriod::new().set_imagefs_available("example");
3373 /// ```
3374 pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
3375 mut self,
3376 v: T,
3377 ) -> Self {
3378 self.imagefs_available = v.into();
3379 self
3380 }
3381
3382 /// Sets the value of [imagefs_inodes_free][crate::model::EvictionGracePeriod::imagefs_inodes_free].
3383 ///
3384 /// # Example
3385 /// ```ignore,no_run
3386 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3387 /// let x = EvictionGracePeriod::new().set_imagefs_inodes_free("example");
3388 /// ```
3389 pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
3390 mut self,
3391 v: T,
3392 ) -> Self {
3393 self.imagefs_inodes_free = v.into();
3394 self
3395 }
3396
3397 /// Sets the value of [pid_available][crate::model::EvictionGracePeriod::pid_available].
3398 ///
3399 /// # Example
3400 /// ```ignore,no_run
3401 /// # use google_cloud_container_v1::model::EvictionGracePeriod;
3402 /// let x = EvictionGracePeriod::new().set_pid_available("example");
3403 /// ```
3404 pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.pid_available = v.into();
3406 self
3407 }
3408}
3409
3410impl wkt::message::Message for EvictionGracePeriod {
3411 fn typename() -> &'static str {
3412 "type.googleapis.com/google.container.v1.EvictionGracePeriod"
3413 }
3414}
3415
3416/// Eviction minimum reclaims are the resource amounts of minimum reclaims for
3417/// each eviction signal.
3418#[derive(Clone, Default, PartialEq)]
3419#[non_exhaustive]
3420pub struct EvictionMinimumReclaim {
3421 /// Optional. Minimum reclaim for eviction due to memory available signal. Only
3422 /// take percentage value for now. Sample format: "10%". Must be <=10%. See
3423 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3424 pub memory_available: std::string::String,
3425
3426 /// Optional. Minimum reclaim for eviction due to nodefs available signal. Only
3427 /// take percentage value for now. Sample format: "10%". Must be <=10%. See
3428 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3429 pub nodefs_available: std::string::String,
3430
3431 /// Optional. Minimum reclaim for eviction due to nodefs inodes free signal.
3432 /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
3433 /// See
3434 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3435 pub nodefs_inodes_free: std::string::String,
3436
3437 /// Optional. Minimum reclaim for eviction due to imagefs available signal.
3438 /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
3439 /// See
3440 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3441 pub imagefs_available: std::string::String,
3442
3443 /// Optional. Minimum reclaim for eviction due to imagefs inodes free signal.
3444 /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
3445 /// See
3446 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3447 pub imagefs_inodes_free: std::string::String,
3448
3449 /// Optional. Minimum reclaim for eviction due to pid available signal. Only
3450 /// take percentage value for now. Sample format: "10%". Must be <=10%. See
3451 /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
3452 pub pid_available: std::string::String,
3453
3454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3455}
3456
3457impl EvictionMinimumReclaim {
3458 /// Creates a new default instance.
3459 pub fn new() -> Self {
3460 std::default::Default::default()
3461 }
3462
3463 /// Sets the value of [memory_available][crate::model::EvictionMinimumReclaim::memory_available].
3464 ///
3465 /// # Example
3466 /// ```ignore,no_run
3467 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3468 /// let x = EvictionMinimumReclaim::new().set_memory_available("example");
3469 /// ```
3470 pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
3471 mut self,
3472 v: T,
3473 ) -> Self {
3474 self.memory_available = v.into();
3475 self
3476 }
3477
3478 /// Sets the value of [nodefs_available][crate::model::EvictionMinimumReclaim::nodefs_available].
3479 ///
3480 /// # Example
3481 /// ```ignore,no_run
3482 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3483 /// let x = EvictionMinimumReclaim::new().set_nodefs_available("example");
3484 /// ```
3485 pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
3486 mut self,
3487 v: T,
3488 ) -> Self {
3489 self.nodefs_available = v.into();
3490 self
3491 }
3492
3493 /// Sets the value of [nodefs_inodes_free][crate::model::EvictionMinimumReclaim::nodefs_inodes_free].
3494 ///
3495 /// # Example
3496 /// ```ignore,no_run
3497 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3498 /// let x = EvictionMinimumReclaim::new().set_nodefs_inodes_free("example");
3499 /// ```
3500 pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
3501 mut self,
3502 v: T,
3503 ) -> Self {
3504 self.nodefs_inodes_free = v.into();
3505 self
3506 }
3507
3508 /// Sets the value of [imagefs_available][crate::model::EvictionMinimumReclaim::imagefs_available].
3509 ///
3510 /// # Example
3511 /// ```ignore,no_run
3512 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3513 /// let x = EvictionMinimumReclaim::new().set_imagefs_available("example");
3514 /// ```
3515 pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
3516 mut self,
3517 v: T,
3518 ) -> Self {
3519 self.imagefs_available = v.into();
3520 self
3521 }
3522
3523 /// Sets the value of [imagefs_inodes_free][crate::model::EvictionMinimumReclaim::imagefs_inodes_free].
3524 ///
3525 /// # Example
3526 /// ```ignore,no_run
3527 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3528 /// let x = EvictionMinimumReclaim::new().set_imagefs_inodes_free("example");
3529 /// ```
3530 pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
3531 mut self,
3532 v: T,
3533 ) -> Self {
3534 self.imagefs_inodes_free = v.into();
3535 self
3536 }
3537
3538 /// Sets the value of [pid_available][crate::model::EvictionMinimumReclaim::pid_available].
3539 ///
3540 /// # Example
3541 /// ```ignore,no_run
3542 /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
3543 /// let x = EvictionMinimumReclaim::new().set_pid_available("example");
3544 /// ```
3545 pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3546 self.pid_available = v.into();
3547 self
3548 }
3549}
3550
3551impl wkt::message::Message for EvictionMinimumReclaim {
3552 fn typename() -> &'static str {
3553 "type.googleapis.com/google.container.v1.EvictionMinimumReclaim"
3554 }
3555}
3556
3557/// Parameters that describe the nodes in a cluster.
3558///
3559/// GKE Autopilot clusters do not
3560/// recognize parameters in `NodeConfig`. Use
3561/// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults]
3562/// instead.
3563///
3564/// [google.container.v1.AutoprovisioningNodePoolDefaults]: crate::model::AutoprovisioningNodePoolDefaults
3565#[derive(Clone, Default, PartialEq)]
3566#[non_exhaustive]
3567pub struct NodeConfig {
3568 /// The name of a Google Compute Engine [machine
3569 /// type](https://cloud.google.com/compute/docs/machine-types)
3570 ///
3571 /// If unspecified, the default machine type is `e2-medium`.
3572 pub machine_type: std::string::String,
3573
3574 /// Size of the disk attached to each node, specified in GB.
3575 /// The smallest allowed disk size is 10GB.
3576 ///
3577 /// If unspecified, the default disk size is 100GB.
3578 pub disk_size_gb: i32,
3579
3580 /// The set of Google API scopes to be made available on all of the
3581 /// node VMs under the "default" service account.
3582 ///
3583 /// The following scopes are recommended, but not required, and by default are
3584 /// not included:
3585 ///
3586 /// * `<https://www.googleapis.com/auth/compute>` is required for mounting
3587 /// persistent storage on your nodes.
3588 /// * `<https://www.googleapis.com/auth/devstorage.read_only>` is required for
3589 /// communicating with **gcr.io**
3590 /// (the [Artifact Registry](https://cloud.google.com/artifact-registry/)).
3591 ///
3592 /// If unspecified, no scopes are added, unless Cloud Logging or Cloud
3593 /// Monitoring are enabled, in which case their required scopes will be added.
3594 pub oauth_scopes: std::vec::Vec<std::string::String>,
3595
3596 /// The Google Cloud Platform Service Account to be used by the node VMs.
3597 /// Specify the email address of the Service Account; otherwise, if no Service
3598 /// Account is specified, the "default" service account is used.
3599 pub service_account: std::string::String,
3600
3601 /// The metadata key/value pairs assigned to instances in the cluster.
3602 ///
3603 /// Keys must conform to the regexp `[a-zA-Z0-9-_]+` and be less than 128 bytes
3604 /// in length. These are reflected as part of a URL in the metadata server.
3605 /// Additionally, to avoid ambiguity, keys must not conflict with any other
3606 /// metadata keys for the project or be one of the reserved keys:
3607 ///
3608 /// - "cluster-location"
3609 /// - "cluster-name"
3610 /// - "cluster-uid"
3611 /// - "configure-sh"
3612 /// - "containerd-configure-sh"
3613 /// - "enable-os-login"
3614 /// - "gci-ensure-gke-docker"
3615 /// - "gci-metrics-enabled"
3616 /// - "gci-update-strategy"
3617 /// - "instance-template"
3618 /// - "kube-env"
3619 /// - "startup-script"
3620 /// - "user-data"
3621 /// - "disable-address-manager"
3622 /// - "windows-startup-script-ps1"
3623 /// - "common-psm1"
3624 /// - "k8s-node-setup-psm1"
3625 /// - "install-ssh-psm1"
3626 /// - "user-profile-psm1"
3627 ///
3628 /// Values are free-form strings, and only have meaning as interpreted by
3629 /// the image running in the instance. The only restriction placed on them is
3630 /// that each value's size must be less than or equal to 32 KB.
3631 ///
3632 /// The total size of all keys and values must be less than 512 KB.
3633 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
3634
3635 /// The image type to use for this node. Note that for a given image type,
3636 /// the latest version of it will be used. Please see
3637 /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
3638 /// for available image types.
3639 pub image_type: std::string::String,
3640
3641 /// The node image configuration to use for this node pool. Note that this is
3642 /// only applicable for node pools using image_type=CUSTOM.
3643 pub node_image_config: std::option::Option<crate::model::CustomImageConfig>,
3644
3645 /// The Kubernetes labels (key/value pairs) to apply to each node. The values
3646 /// in this field are added to the set of default labels Kubernetes applies to
3647 /// nodes.
3648 ///
3649 /// This field has the following restrictions:
3650 ///
3651 /// * Labels must use a valid Kubernetes syntax and character set, as defined
3652 /// in
3653 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set>.
3654 /// * This field supports up to 1,024 total characters in a single request.
3655 ///
3656 /// Depending on the Kubernetes version, keys in this field might conflict with
3657 /// the keys of the default labels, which might change which of your labels
3658 /// are applied to the nodes. Assume that the behavior is unpredictable and
3659 /// avoid label key conflicts. For more information about the default labels,
3660 /// see:
3661 /// <https://kubernetes.io/docs/reference/labels-annotations-taints/>
3662 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3663
3664 /// The number of local SSD disks to be attached to the node.
3665 ///
3666 /// The limit for this value is dependent upon the maximum number of
3667 /// disks available on a machine per zone. See:
3668 /// <https://cloud.google.com/compute/docs/disks/local-ssd>
3669 /// for more information.
3670 pub local_ssd_count: i32,
3671
3672 /// The list of instance tags applied to all nodes. Tags are used to identify
3673 /// valid sources or targets for network firewalls and are specified by
3674 /// the client during cluster or node pool creation. Each tag within the list
3675 /// must comply with RFC1035.
3676 pub tags: std::vec::Vec<std::string::String>,
3677
3678 /// Whether the nodes are created as preemptible VM instances. See:
3679 /// <https://cloud.google.com/compute/docs/instances/preemptible>
3680 /// for more information about preemptible VM instances.
3681 pub preemptible: bool,
3682
3683 /// A list of hardware accelerators to be attached to each node.
3684 /// See
3685 /// <https://cloud.google.com/compute/docs/gpus>
3686 /// for more information about support for GPUs.
3687 pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
3688
3689 /// Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or
3690 /// 'pd-balanced')
3691 ///
3692 /// If unspecified, the default disk type is 'pd-standard'
3693 pub disk_type: std::string::String,
3694
3695 /// Minimum CPU platform to be used by this instance. The instance may be
3696 /// scheduled on the specified or newer CPU platform. Applicable values are the
3697 /// friendly names of CPU platforms, such as
3698 /// `minCpuPlatform: "Intel Haswell"` or
3699 /// `minCpuPlatform: "Intel Sandy Bridge"`. For more
3700 /// information, read [how to specify min CPU
3701 /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
3702 pub min_cpu_platform: std::string::String,
3703
3704 /// The workload metadata configuration for this node.
3705 pub workload_metadata_config: std::option::Option<crate::model::WorkloadMetadataConfig>,
3706
3707 /// List of kubernetes taints to be applied to each node.
3708 ///
3709 /// For more information, including usage and the valid values, see:
3710 /// <https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/>
3711 pub taints: std::vec::Vec<crate::model::NodeTaint>,
3712
3713 /// Sandbox configuration for this node.
3714 pub sandbox_config: std::option::Option<crate::model::SandboxConfig>,
3715
3716 /// Setting this field will assign instances of this
3717 /// pool to run on the specified node group. This is useful for running
3718 /// workloads on [sole tenant
3719 /// nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes).
3720 pub node_group: std::string::String,
3721
3722 /// The optional reservation affinity. Setting this field will apply
3723 /// the specified [Zonal Compute
3724 /// Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
3725 /// to this node pool.
3726 pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
3727
3728 /// Shielded Instance options.
3729 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
3730
3731 /// Parameters that can be configured on Linux nodes.
3732 pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
3733
3734 /// Node kubelet configs.
3735 pub kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
3736
3737 /// The Customer Managed Encryption Key used to encrypt the boot disk attached
3738 /// to each node in the node pool. This should be of the form
3739 /// projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
3740 /// For more information about protecting resources with Cloud KMS Keys please
3741 /// see:
3742 /// <https://cloud.google.com/compute/docs/disks/customer-managed-encryption>
3743 pub boot_disk_kms_key: std::string::String,
3744
3745 /// Google Container File System (image streaming) configs.
3746 pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
3747
3748 /// Advanced features for the Compute Engine VM.
3749 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
3750
3751 /// Enable or disable gvnic in the node pool.
3752 pub gvnic: std::option::Option<crate::model::VirtualNIC>,
3753
3754 /// Spot flag for enabling Spot VM, which is a rebrand of
3755 /// the existing preemptible flag.
3756 pub spot: bool,
3757
3758 /// Confidential nodes config.
3759 /// All the nodes in the node pool will be Confidential VM once enabled.
3760 pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
3761
3762 /// Enable or disable NCCL fast socket for the node pool.
3763 pub fast_socket: std::option::Option<crate::model::FastSocket>,
3764
3765 /// The resource labels for the node pool to use to annotate any related
3766 /// Google Compute Engine resources.
3767 pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
3768
3769 /// Logging configuration.
3770 pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
3771
3772 /// Parameters that can be configured on Windows nodes.
3773 pub windows_node_config: std::option::Option<crate::model::WindowsNodeConfig>,
3774
3775 /// Parameters for using raw-block Local NVMe SSDs.
3776 pub local_nvme_ssd_block_config: std::option::Option<crate::model::LocalNvmeSsdBlockConfig>,
3777
3778 /// Parameters for the node ephemeral storage using Local SSDs.
3779 /// If unspecified, ephemeral storage is backed by the boot disk.
3780 pub ephemeral_storage_local_ssd_config:
3781 std::option::Option<crate::model::EphemeralStorageLocalSsdConfig>,
3782
3783 /// Parameters for node pools to be backed by shared sole tenant node groups.
3784 pub sole_tenant_config: std::option::Option<crate::model::SoleTenantConfig>,
3785
3786 /// Parameters for containerd customization.
3787 pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
3788
3789 /// A map of resource manager tag keys and values to be attached to the nodes.
3790 pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
3791
3792 /// Optional. Reserved for future use.
3793 pub enable_confidential_storage: bool,
3794
3795 /// List of secondary boot disks attached to the nodes.
3796 pub secondary_boot_disks: std::vec::Vec<crate::model::SecondaryBootDisk>,
3797
3798 /// List of Storage Pools where boot disks are provisioned.
3799 pub storage_pools: std::vec::Vec<std::string::String>,
3800
3801 /// Secondary boot disk update strategy.
3802 pub secondary_boot_disk_update_strategy:
3803 std::option::Option<crate::model::SecondaryBootDiskUpdateStrategy>,
3804
3805 /// The configuration for GPU Direct
3806 pub gpu_direct_config: std::option::Option<crate::model::GPUDirectConfig>,
3807
3808 /// The maximum duration for the nodes to exist.
3809 /// If unspecified, the nodes can exist indefinitely.
3810 pub max_run_duration: std::option::Option<wkt::Duration>,
3811
3812 /// Specifies which method should be used for encrypting the
3813 /// Local SSDs attached to the node.
3814 pub local_ssd_encryption_mode:
3815 std::option::Option<crate::model::node_config::LocalSsdEncryptionMode>,
3816
3817 /// Output only. effective_cgroup_mode is the cgroup mode actually used by the
3818 /// node pool. It is determined by the cgroup mode specified in the
3819 /// LinuxNodeConfig or the default cgroup mode based on the cluster creation
3820 /// version.
3821 pub effective_cgroup_mode: crate::model::node_config::EffectiveCgroupMode,
3822
3823 /// Flex Start flag for enabling Flex Start VM.
3824 pub flex_start: std::option::Option<bool>,
3825
3826 /// The boot disk configuration for the node pool.
3827 pub boot_disk: std::option::Option<crate::model::BootDisk>,
3828
3829 /// Consolidation delay defines duration after which the Cluster Autoscaler can
3830 /// scale down underutilized nodes. If not set, nodes are scaled down by
3831 /// default behavior, i.e. according to the chosen autoscaling profile.
3832 pub consolidation_delay: std::option::Option<wkt::Duration>,
3833
3834 /// Optional. The taint configuration for the node pool.
3835 pub taint_config: std::option::Option<crate::model::TaintConfig>,
3836
3837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3838}
3839
3840impl NodeConfig {
3841 /// Creates a new default instance.
3842 pub fn new() -> Self {
3843 std::default::Default::default()
3844 }
3845
3846 /// Sets the value of [machine_type][crate::model::NodeConfig::machine_type].
3847 ///
3848 /// # Example
3849 /// ```ignore,no_run
3850 /// # use google_cloud_container_v1::model::NodeConfig;
3851 /// let x = NodeConfig::new().set_machine_type("example");
3852 /// ```
3853 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.machine_type = v.into();
3855 self
3856 }
3857
3858 /// Sets the value of [disk_size_gb][crate::model::NodeConfig::disk_size_gb].
3859 ///
3860 /// # Example
3861 /// ```ignore,no_run
3862 /// # use google_cloud_container_v1::model::NodeConfig;
3863 /// let x = NodeConfig::new().set_disk_size_gb(42);
3864 /// ```
3865 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3866 self.disk_size_gb = v.into();
3867 self
3868 }
3869
3870 /// Sets the value of [oauth_scopes][crate::model::NodeConfig::oauth_scopes].
3871 ///
3872 /// # Example
3873 /// ```ignore,no_run
3874 /// # use google_cloud_container_v1::model::NodeConfig;
3875 /// let x = NodeConfig::new().set_oauth_scopes(["a", "b", "c"]);
3876 /// ```
3877 pub fn set_oauth_scopes<T, V>(mut self, v: T) -> Self
3878 where
3879 T: std::iter::IntoIterator<Item = V>,
3880 V: std::convert::Into<std::string::String>,
3881 {
3882 use std::iter::Iterator;
3883 self.oauth_scopes = v.into_iter().map(|i| i.into()).collect();
3884 self
3885 }
3886
3887 /// Sets the value of [service_account][crate::model::NodeConfig::service_account].
3888 ///
3889 /// # Example
3890 /// ```ignore,no_run
3891 /// # use google_cloud_container_v1::model::NodeConfig;
3892 /// let x = NodeConfig::new().set_service_account("example");
3893 /// ```
3894 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3895 self.service_account = v.into();
3896 self
3897 }
3898
3899 /// Sets the value of [metadata][crate::model::NodeConfig::metadata].
3900 ///
3901 /// # Example
3902 /// ```ignore,no_run
3903 /// # use google_cloud_container_v1::model::NodeConfig;
3904 /// let x = NodeConfig::new().set_metadata([
3905 /// ("key0", "abc"),
3906 /// ("key1", "xyz"),
3907 /// ]);
3908 /// ```
3909 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
3910 where
3911 T: std::iter::IntoIterator<Item = (K, V)>,
3912 K: std::convert::Into<std::string::String>,
3913 V: std::convert::Into<std::string::String>,
3914 {
3915 use std::iter::Iterator;
3916 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3917 self
3918 }
3919
3920 /// Sets the value of [image_type][crate::model::NodeConfig::image_type].
3921 ///
3922 /// # Example
3923 /// ```ignore,no_run
3924 /// # use google_cloud_container_v1::model::NodeConfig;
3925 /// let x = NodeConfig::new().set_image_type("example");
3926 /// ```
3927 pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3928 self.image_type = v.into();
3929 self
3930 }
3931
3932 /// Sets the value of [node_image_config][crate::model::NodeConfig::node_image_config].
3933 ///
3934 /// # Example
3935 /// ```ignore,no_run
3936 /// # use google_cloud_container_v1::model::NodeConfig;
3937 /// use google_cloud_container_v1::model::CustomImageConfig;
3938 /// let x = NodeConfig::new().set_node_image_config(CustomImageConfig::default()/* use setters */);
3939 /// ```
3940 pub fn set_node_image_config<T>(mut self, v: T) -> Self
3941 where
3942 T: std::convert::Into<crate::model::CustomImageConfig>,
3943 {
3944 self.node_image_config = std::option::Option::Some(v.into());
3945 self
3946 }
3947
3948 /// Sets or clears the value of [node_image_config][crate::model::NodeConfig::node_image_config].
3949 ///
3950 /// # Example
3951 /// ```ignore,no_run
3952 /// # use google_cloud_container_v1::model::NodeConfig;
3953 /// use google_cloud_container_v1::model::CustomImageConfig;
3954 /// let x = NodeConfig::new().set_or_clear_node_image_config(Some(CustomImageConfig::default()/* use setters */));
3955 /// let x = NodeConfig::new().set_or_clear_node_image_config(None::<CustomImageConfig>);
3956 /// ```
3957 pub fn set_or_clear_node_image_config<T>(mut self, v: std::option::Option<T>) -> Self
3958 where
3959 T: std::convert::Into<crate::model::CustomImageConfig>,
3960 {
3961 self.node_image_config = v.map(|x| x.into());
3962 self
3963 }
3964
3965 /// Sets the value of [labels][crate::model::NodeConfig::labels].
3966 ///
3967 /// # Example
3968 /// ```ignore,no_run
3969 /// # use google_cloud_container_v1::model::NodeConfig;
3970 /// let x = NodeConfig::new().set_labels([
3971 /// ("key0", "abc"),
3972 /// ("key1", "xyz"),
3973 /// ]);
3974 /// ```
3975 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3976 where
3977 T: std::iter::IntoIterator<Item = (K, V)>,
3978 K: std::convert::Into<std::string::String>,
3979 V: std::convert::Into<std::string::String>,
3980 {
3981 use std::iter::Iterator;
3982 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3983 self
3984 }
3985
3986 /// Sets the value of [local_ssd_count][crate::model::NodeConfig::local_ssd_count].
3987 ///
3988 /// # Example
3989 /// ```ignore,no_run
3990 /// # use google_cloud_container_v1::model::NodeConfig;
3991 /// let x = NodeConfig::new().set_local_ssd_count(42);
3992 /// ```
3993 pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3994 self.local_ssd_count = v.into();
3995 self
3996 }
3997
3998 /// Sets the value of [tags][crate::model::NodeConfig::tags].
3999 ///
4000 /// # Example
4001 /// ```ignore,no_run
4002 /// # use google_cloud_container_v1::model::NodeConfig;
4003 /// let x = NodeConfig::new().set_tags(["a", "b", "c"]);
4004 /// ```
4005 pub fn set_tags<T, V>(mut self, v: T) -> Self
4006 where
4007 T: std::iter::IntoIterator<Item = V>,
4008 V: std::convert::Into<std::string::String>,
4009 {
4010 use std::iter::Iterator;
4011 self.tags = v.into_iter().map(|i| i.into()).collect();
4012 self
4013 }
4014
4015 /// Sets the value of [preemptible][crate::model::NodeConfig::preemptible].
4016 ///
4017 /// # Example
4018 /// ```ignore,no_run
4019 /// # use google_cloud_container_v1::model::NodeConfig;
4020 /// let x = NodeConfig::new().set_preemptible(true);
4021 /// ```
4022 pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4023 self.preemptible = v.into();
4024 self
4025 }
4026
4027 /// Sets the value of [accelerators][crate::model::NodeConfig::accelerators].
4028 ///
4029 /// # Example
4030 /// ```ignore,no_run
4031 /// # use google_cloud_container_v1::model::NodeConfig;
4032 /// use google_cloud_container_v1::model::AcceleratorConfig;
4033 /// let x = NodeConfig::new()
4034 /// .set_accelerators([
4035 /// AcceleratorConfig::default()/* use setters */,
4036 /// AcceleratorConfig::default()/* use (different) setters */,
4037 /// ]);
4038 /// ```
4039 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
4040 where
4041 T: std::iter::IntoIterator<Item = V>,
4042 V: std::convert::Into<crate::model::AcceleratorConfig>,
4043 {
4044 use std::iter::Iterator;
4045 self.accelerators = v.into_iter().map(|i| i.into()).collect();
4046 self
4047 }
4048
4049 /// Sets the value of [disk_type][crate::model::NodeConfig::disk_type].
4050 ///
4051 /// # Example
4052 /// ```ignore,no_run
4053 /// # use google_cloud_container_v1::model::NodeConfig;
4054 /// let x = NodeConfig::new().set_disk_type("example");
4055 /// ```
4056 pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4057 self.disk_type = v.into();
4058 self
4059 }
4060
4061 /// Sets the value of [min_cpu_platform][crate::model::NodeConfig::min_cpu_platform].
4062 ///
4063 /// # Example
4064 /// ```ignore,no_run
4065 /// # use google_cloud_container_v1::model::NodeConfig;
4066 /// let x = NodeConfig::new().set_min_cpu_platform("example");
4067 /// ```
4068 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
4069 mut self,
4070 v: T,
4071 ) -> Self {
4072 self.min_cpu_platform = v.into();
4073 self
4074 }
4075
4076 /// Sets the value of [workload_metadata_config][crate::model::NodeConfig::workload_metadata_config].
4077 ///
4078 /// # Example
4079 /// ```ignore,no_run
4080 /// # use google_cloud_container_v1::model::NodeConfig;
4081 /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
4082 /// let x = NodeConfig::new().set_workload_metadata_config(WorkloadMetadataConfig::default()/* use setters */);
4083 /// ```
4084 pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
4085 where
4086 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
4087 {
4088 self.workload_metadata_config = std::option::Option::Some(v.into());
4089 self
4090 }
4091
4092 /// Sets or clears the value of [workload_metadata_config][crate::model::NodeConfig::workload_metadata_config].
4093 ///
4094 /// # Example
4095 /// ```ignore,no_run
4096 /// # use google_cloud_container_v1::model::NodeConfig;
4097 /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
4098 /// let x = NodeConfig::new().set_or_clear_workload_metadata_config(Some(WorkloadMetadataConfig::default()/* use setters */));
4099 /// let x = NodeConfig::new().set_or_clear_workload_metadata_config(None::<WorkloadMetadataConfig>);
4100 /// ```
4101 pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
4102 where
4103 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
4104 {
4105 self.workload_metadata_config = v.map(|x| x.into());
4106 self
4107 }
4108
4109 /// Sets the value of [taints][crate::model::NodeConfig::taints].
4110 ///
4111 /// # Example
4112 /// ```ignore,no_run
4113 /// # use google_cloud_container_v1::model::NodeConfig;
4114 /// use google_cloud_container_v1::model::NodeTaint;
4115 /// let x = NodeConfig::new()
4116 /// .set_taints([
4117 /// NodeTaint::default()/* use setters */,
4118 /// NodeTaint::default()/* use (different) setters */,
4119 /// ]);
4120 /// ```
4121 pub fn set_taints<T, V>(mut self, v: T) -> Self
4122 where
4123 T: std::iter::IntoIterator<Item = V>,
4124 V: std::convert::Into<crate::model::NodeTaint>,
4125 {
4126 use std::iter::Iterator;
4127 self.taints = v.into_iter().map(|i| i.into()).collect();
4128 self
4129 }
4130
4131 /// Sets the value of [sandbox_config][crate::model::NodeConfig::sandbox_config].
4132 ///
4133 /// # Example
4134 /// ```ignore,no_run
4135 /// # use google_cloud_container_v1::model::NodeConfig;
4136 /// use google_cloud_container_v1::model::SandboxConfig;
4137 /// let x = NodeConfig::new().set_sandbox_config(SandboxConfig::default()/* use setters */);
4138 /// ```
4139 pub fn set_sandbox_config<T>(mut self, v: T) -> Self
4140 where
4141 T: std::convert::Into<crate::model::SandboxConfig>,
4142 {
4143 self.sandbox_config = std::option::Option::Some(v.into());
4144 self
4145 }
4146
4147 /// Sets or clears the value of [sandbox_config][crate::model::NodeConfig::sandbox_config].
4148 ///
4149 /// # Example
4150 /// ```ignore,no_run
4151 /// # use google_cloud_container_v1::model::NodeConfig;
4152 /// use google_cloud_container_v1::model::SandboxConfig;
4153 /// let x = NodeConfig::new().set_or_clear_sandbox_config(Some(SandboxConfig::default()/* use setters */));
4154 /// let x = NodeConfig::new().set_or_clear_sandbox_config(None::<SandboxConfig>);
4155 /// ```
4156 pub fn set_or_clear_sandbox_config<T>(mut self, v: std::option::Option<T>) -> Self
4157 where
4158 T: std::convert::Into<crate::model::SandboxConfig>,
4159 {
4160 self.sandbox_config = v.map(|x| x.into());
4161 self
4162 }
4163
4164 /// Sets the value of [node_group][crate::model::NodeConfig::node_group].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_container_v1::model::NodeConfig;
4169 /// let x = NodeConfig::new().set_node_group("example");
4170 /// ```
4171 pub fn set_node_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4172 self.node_group = v.into();
4173 self
4174 }
4175
4176 /// Sets the value of [reservation_affinity][crate::model::NodeConfig::reservation_affinity].
4177 ///
4178 /// # Example
4179 /// ```ignore,no_run
4180 /// # use google_cloud_container_v1::model::NodeConfig;
4181 /// use google_cloud_container_v1::model::ReservationAffinity;
4182 /// let x = NodeConfig::new().set_reservation_affinity(ReservationAffinity::default()/* use setters */);
4183 /// ```
4184 pub fn set_reservation_affinity<T>(mut self, v: T) -> Self
4185 where
4186 T: std::convert::Into<crate::model::ReservationAffinity>,
4187 {
4188 self.reservation_affinity = std::option::Option::Some(v.into());
4189 self
4190 }
4191
4192 /// Sets or clears the value of [reservation_affinity][crate::model::NodeConfig::reservation_affinity].
4193 ///
4194 /// # Example
4195 /// ```ignore,no_run
4196 /// # use google_cloud_container_v1::model::NodeConfig;
4197 /// use google_cloud_container_v1::model::ReservationAffinity;
4198 /// let x = NodeConfig::new().set_or_clear_reservation_affinity(Some(ReservationAffinity::default()/* use setters */));
4199 /// let x = NodeConfig::new().set_or_clear_reservation_affinity(None::<ReservationAffinity>);
4200 /// ```
4201 pub fn set_or_clear_reservation_affinity<T>(mut self, v: std::option::Option<T>) -> Self
4202 where
4203 T: std::convert::Into<crate::model::ReservationAffinity>,
4204 {
4205 self.reservation_affinity = v.map(|x| x.into());
4206 self
4207 }
4208
4209 /// Sets the value of [shielded_instance_config][crate::model::NodeConfig::shielded_instance_config].
4210 ///
4211 /// # Example
4212 /// ```ignore,no_run
4213 /// # use google_cloud_container_v1::model::NodeConfig;
4214 /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
4215 /// let x = NodeConfig::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
4216 /// ```
4217 pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
4218 where
4219 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
4220 {
4221 self.shielded_instance_config = std::option::Option::Some(v.into());
4222 self
4223 }
4224
4225 /// Sets or clears the value of [shielded_instance_config][crate::model::NodeConfig::shielded_instance_config].
4226 ///
4227 /// # Example
4228 /// ```ignore,no_run
4229 /// # use google_cloud_container_v1::model::NodeConfig;
4230 /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
4231 /// let x = NodeConfig::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
4232 /// let x = NodeConfig::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
4233 /// ```
4234 pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
4235 where
4236 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
4237 {
4238 self.shielded_instance_config = v.map(|x| x.into());
4239 self
4240 }
4241
4242 /// Sets the value of [linux_node_config][crate::model::NodeConfig::linux_node_config].
4243 ///
4244 /// # Example
4245 /// ```ignore,no_run
4246 /// # use google_cloud_container_v1::model::NodeConfig;
4247 /// use google_cloud_container_v1::model::LinuxNodeConfig;
4248 /// let x = NodeConfig::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
4249 /// ```
4250 pub fn set_linux_node_config<T>(mut self, v: T) -> Self
4251 where
4252 T: std::convert::Into<crate::model::LinuxNodeConfig>,
4253 {
4254 self.linux_node_config = std::option::Option::Some(v.into());
4255 self
4256 }
4257
4258 /// Sets or clears the value of [linux_node_config][crate::model::NodeConfig::linux_node_config].
4259 ///
4260 /// # Example
4261 /// ```ignore,no_run
4262 /// # use google_cloud_container_v1::model::NodeConfig;
4263 /// use google_cloud_container_v1::model::LinuxNodeConfig;
4264 /// let x = NodeConfig::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
4265 /// let x = NodeConfig::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
4266 /// ```
4267 pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
4268 where
4269 T: std::convert::Into<crate::model::LinuxNodeConfig>,
4270 {
4271 self.linux_node_config = v.map(|x| x.into());
4272 self
4273 }
4274
4275 /// Sets the value of [kubelet_config][crate::model::NodeConfig::kubelet_config].
4276 ///
4277 /// # Example
4278 /// ```ignore,no_run
4279 /// # use google_cloud_container_v1::model::NodeConfig;
4280 /// use google_cloud_container_v1::model::NodeKubeletConfig;
4281 /// let x = NodeConfig::new().set_kubelet_config(NodeKubeletConfig::default()/* use setters */);
4282 /// ```
4283 pub fn set_kubelet_config<T>(mut self, v: T) -> Self
4284 where
4285 T: std::convert::Into<crate::model::NodeKubeletConfig>,
4286 {
4287 self.kubelet_config = std::option::Option::Some(v.into());
4288 self
4289 }
4290
4291 /// Sets or clears the value of [kubelet_config][crate::model::NodeConfig::kubelet_config].
4292 ///
4293 /// # Example
4294 /// ```ignore,no_run
4295 /// # use google_cloud_container_v1::model::NodeConfig;
4296 /// use google_cloud_container_v1::model::NodeKubeletConfig;
4297 /// let x = NodeConfig::new().set_or_clear_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
4298 /// let x = NodeConfig::new().set_or_clear_kubelet_config(None::<NodeKubeletConfig>);
4299 /// ```
4300 pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
4301 where
4302 T: std::convert::Into<crate::model::NodeKubeletConfig>,
4303 {
4304 self.kubelet_config = v.map(|x| x.into());
4305 self
4306 }
4307
4308 /// Sets the value of [boot_disk_kms_key][crate::model::NodeConfig::boot_disk_kms_key].
4309 ///
4310 /// # Example
4311 /// ```ignore,no_run
4312 /// # use google_cloud_container_v1::model::NodeConfig;
4313 /// let x = NodeConfig::new().set_boot_disk_kms_key("example");
4314 /// ```
4315 pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
4316 mut self,
4317 v: T,
4318 ) -> Self {
4319 self.boot_disk_kms_key = v.into();
4320 self
4321 }
4322
4323 /// Sets the value of [gcfs_config][crate::model::NodeConfig::gcfs_config].
4324 ///
4325 /// # Example
4326 /// ```ignore,no_run
4327 /// # use google_cloud_container_v1::model::NodeConfig;
4328 /// use google_cloud_container_v1::model::GcfsConfig;
4329 /// let x = NodeConfig::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
4330 /// ```
4331 pub fn set_gcfs_config<T>(mut self, v: T) -> Self
4332 where
4333 T: std::convert::Into<crate::model::GcfsConfig>,
4334 {
4335 self.gcfs_config = std::option::Option::Some(v.into());
4336 self
4337 }
4338
4339 /// Sets or clears the value of [gcfs_config][crate::model::NodeConfig::gcfs_config].
4340 ///
4341 /// # Example
4342 /// ```ignore,no_run
4343 /// # use google_cloud_container_v1::model::NodeConfig;
4344 /// use google_cloud_container_v1::model::GcfsConfig;
4345 /// let x = NodeConfig::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
4346 /// let x = NodeConfig::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
4347 /// ```
4348 pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
4349 where
4350 T: std::convert::Into<crate::model::GcfsConfig>,
4351 {
4352 self.gcfs_config = v.map(|x| x.into());
4353 self
4354 }
4355
4356 /// Sets the value of [advanced_machine_features][crate::model::NodeConfig::advanced_machine_features].
4357 ///
4358 /// # Example
4359 /// ```ignore,no_run
4360 /// # use google_cloud_container_v1::model::NodeConfig;
4361 /// use google_cloud_container_v1::model::AdvancedMachineFeatures;
4362 /// let x = NodeConfig::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
4363 /// ```
4364 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
4365 where
4366 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
4367 {
4368 self.advanced_machine_features = std::option::Option::Some(v.into());
4369 self
4370 }
4371
4372 /// Sets or clears the value of [advanced_machine_features][crate::model::NodeConfig::advanced_machine_features].
4373 ///
4374 /// # Example
4375 /// ```ignore,no_run
4376 /// # use google_cloud_container_v1::model::NodeConfig;
4377 /// use google_cloud_container_v1::model::AdvancedMachineFeatures;
4378 /// let x = NodeConfig::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
4379 /// let x = NodeConfig::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
4380 /// ```
4381 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
4382 where
4383 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
4384 {
4385 self.advanced_machine_features = v.map(|x| x.into());
4386 self
4387 }
4388
4389 /// Sets the value of [gvnic][crate::model::NodeConfig::gvnic].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_container_v1::model::NodeConfig;
4394 /// use google_cloud_container_v1::model::VirtualNIC;
4395 /// let x = NodeConfig::new().set_gvnic(VirtualNIC::default()/* use setters */);
4396 /// ```
4397 pub fn set_gvnic<T>(mut self, v: T) -> Self
4398 where
4399 T: std::convert::Into<crate::model::VirtualNIC>,
4400 {
4401 self.gvnic = std::option::Option::Some(v.into());
4402 self
4403 }
4404
4405 /// Sets or clears the value of [gvnic][crate::model::NodeConfig::gvnic].
4406 ///
4407 /// # Example
4408 /// ```ignore,no_run
4409 /// # use google_cloud_container_v1::model::NodeConfig;
4410 /// use google_cloud_container_v1::model::VirtualNIC;
4411 /// let x = NodeConfig::new().set_or_clear_gvnic(Some(VirtualNIC::default()/* use setters */));
4412 /// let x = NodeConfig::new().set_or_clear_gvnic(None::<VirtualNIC>);
4413 /// ```
4414 pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
4415 where
4416 T: std::convert::Into<crate::model::VirtualNIC>,
4417 {
4418 self.gvnic = v.map(|x| x.into());
4419 self
4420 }
4421
4422 /// Sets the value of [spot][crate::model::NodeConfig::spot].
4423 ///
4424 /// # Example
4425 /// ```ignore,no_run
4426 /// # use google_cloud_container_v1::model::NodeConfig;
4427 /// let x = NodeConfig::new().set_spot(true);
4428 /// ```
4429 pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4430 self.spot = v.into();
4431 self
4432 }
4433
4434 /// Sets the value of [confidential_nodes][crate::model::NodeConfig::confidential_nodes].
4435 ///
4436 /// # Example
4437 /// ```ignore,no_run
4438 /// # use google_cloud_container_v1::model::NodeConfig;
4439 /// use google_cloud_container_v1::model::ConfidentialNodes;
4440 /// let x = NodeConfig::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
4441 /// ```
4442 pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
4443 where
4444 T: std::convert::Into<crate::model::ConfidentialNodes>,
4445 {
4446 self.confidential_nodes = std::option::Option::Some(v.into());
4447 self
4448 }
4449
4450 /// Sets or clears the value of [confidential_nodes][crate::model::NodeConfig::confidential_nodes].
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_container_v1::model::NodeConfig;
4455 /// use google_cloud_container_v1::model::ConfidentialNodes;
4456 /// let x = NodeConfig::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
4457 /// let x = NodeConfig::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
4458 /// ```
4459 pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
4460 where
4461 T: std::convert::Into<crate::model::ConfidentialNodes>,
4462 {
4463 self.confidential_nodes = v.map(|x| x.into());
4464 self
4465 }
4466
4467 /// Sets the value of [fast_socket][crate::model::NodeConfig::fast_socket].
4468 ///
4469 /// # Example
4470 /// ```ignore,no_run
4471 /// # use google_cloud_container_v1::model::NodeConfig;
4472 /// use google_cloud_container_v1::model::FastSocket;
4473 /// let x = NodeConfig::new().set_fast_socket(FastSocket::default()/* use setters */);
4474 /// ```
4475 pub fn set_fast_socket<T>(mut self, v: T) -> Self
4476 where
4477 T: std::convert::Into<crate::model::FastSocket>,
4478 {
4479 self.fast_socket = std::option::Option::Some(v.into());
4480 self
4481 }
4482
4483 /// Sets or clears the value of [fast_socket][crate::model::NodeConfig::fast_socket].
4484 ///
4485 /// # Example
4486 /// ```ignore,no_run
4487 /// # use google_cloud_container_v1::model::NodeConfig;
4488 /// use google_cloud_container_v1::model::FastSocket;
4489 /// let x = NodeConfig::new().set_or_clear_fast_socket(Some(FastSocket::default()/* use setters */));
4490 /// let x = NodeConfig::new().set_or_clear_fast_socket(None::<FastSocket>);
4491 /// ```
4492 pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
4493 where
4494 T: std::convert::Into<crate::model::FastSocket>,
4495 {
4496 self.fast_socket = v.map(|x| x.into());
4497 self
4498 }
4499
4500 /// Sets the value of [resource_labels][crate::model::NodeConfig::resource_labels].
4501 ///
4502 /// # Example
4503 /// ```ignore,no_run
4504 /// # use google_cloud_container_v1::model::NodeConfig;
4505 /// let x = NodeConfig::new().set_resource_labels([
4506 /// ("key0", "abc"),
4507 /// ("key1", "xyz"),
4508 /// ]);
4509 /// ```
4510 pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
4511 where
4512 T: std::iter::IntoIterator<Item = (K, V)>,
4513 K: std::convert::Into<std::string::String>,
4514 V: std::convert::Into<std::string::String>,
4515 {
4516 use std::iter::Iterator;
4517 self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4518 self
4519 }
4520
4521 /// Sets the value of [logging_config][crate::model::NodeConfig::logging_config].
4522 ///
4523 /// # Example
4524 /// ```ignore,no_run
4525 /// # use google_cloud_container_v1::model::NodeConfig;
4526 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
4527 /// let x = NodeConfig::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
4528 /// ```
4529 pub fn set_logging_config<T>(mut self, v: T) -> Self
4530 where
4531 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
4532 {
4533 self.logging_config = std::option::Option::Some(v.into());
4534 self
4535 }
4536
4537 /// Sets or clears the value of [logging_config][crate::model::NodeConfig::logging_config].
4538 ///
4539 /// # Example
4540 /// ```ignore,no_run
4541 /// # use google_cloud_container_v1::model::NodeConfig;
4542 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
4543 /// let x = NodeConfig::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
4544 /// let x = NodeConfig::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
4545 /// ```
4546 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
4547 where
4548 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
4549 {
4550 self.logging_config = v.map(|x| x.into());
4551 self
4552 }
4553
4554 /// Sets the value of [windows_node_config][crate::model::NodeConfig::windows_node_config].
4555 ///
4556 /// # Example
4557 /// ```ignore,no_run
4558 /// # use google_cloud_container_v1::model::NodeConfig;
4559 /// use google_cloud_container_v1::model::WindowsNodeConfig;
4560 /// let x = NodeConfig::new().set_windows_node_config(WindowsNodeConfig::default()/* use setters */);
4561 /// ```
4562 pub fn set_windows_node_config<T>(mut self, v: T) -> Self
4563 where
4564 T: std::convert::Into<crate::model::WindowsNodeConfig>,
4565 {
4566 self.windows_node_config = std::option::Option::Some(v.into());
4567 self
4568 }
4569
4570 /// Sets or clears the value of [windows_node_config][crate::model::NodeConfig::windows_node_config].
4571 ///
4572 /// # Example
4573 /// ```ignore,no_run
4574 /// # use google_cloud_container_v1::model::NodeConfig;
4575 /// use google_cloud_container_v1::model::WindowsNodeConfig;
4576 /// let x = NodeConfig::new().set_or_clear_windows_node_config(Some(WindowsNodeConfig::default()/* use setters */));
4577 /// let x = NodeConfig::new().set_or_clear_windows_node_config(None::<WindowsNodeConfig>);
4578 /// ```
4579 pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
4580 where
4581 T: std::convert::Into<crate::model::WindowsNodeConfig>,
4582 {
4583 self.windows_node_config = v.map(|x| x.into());
4584 self
4585 }
4586
4587 /// Sets the value of [local_nvme_ssd_block_config][crate::model::NodeConfig::local_nvme_ssd_block_config].
4588 ///
4589 /// # Example
4590 /// ```ignore,no_run
4591 /// # use google_cloud_container_v1::model::NodeConfig;
4592 /// use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
4593 /// let x = NodeConfig::new().set_local_nvme_ssd_block_config(LocalNvmeSsdBlockConfig::default()/* use setters */);
4594 /// ```
4595 pub fn set_local_nvme_ssd_block_config<T>(mut self, v: T) -> Self
4596 where
4597 T: std::convert::Into<crate::model::LocalNvmeSsdBlockConfig>,
4598 {
4599 self.local_nvme_ssd_block_config = std::option::Option::Some(v.into());
4600 self
4601 }
4602
4603 /// Sets or clears the value of [local_nvme_ssd_block_config][crate::model::NodeConfig::local_nvme_ssd_block_config].
4604 ///
4605 /// # Example
4606 /// ```ignore,no_run
4607 /// # use google_cloud_container_v1::model::NodeConfig;
4608 /// use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
4609 /// let x = NodeConfig::new().set_or_clear_local_nvme_ssd_block_config(Some(LocalNvmeSsdBlockConfig::default()/* use setters */));
4610 /// let x = NodeConfig::new().set_or_clear_local_nvme_ssd_block_config(None::<LocalNvmeSsdBlockConfig>);
4611 /// ```
4612 pub fn set_or_clear_local_nvme_ssd_block_config<T>(mut self, v: std::option::Option<T>) -> Self
4613 where
4614 T: std::convert::Into<crate::model::LocalNvmeSsdBlockConfig>,
4615 {
4616 self.local_nvme_ssd_block_config = v.map(|x| x.into());
4617 self
4618 }
4619
4620 /// Sets the value of [ephemeral_storage_local_ssd_config][crate::model::NodeConfig::ephemeral_storage_local_ssd_config].
4621 ///
4622 /// # Example
4623 /// ```ignore,no_run
4624 /// # use google_cloud_container_v1::model::NodeConfig;
4625 /// use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
4626 /// let x = NodeConfig::new().set_ephemeral_storage_local_ssd_config(EphemeralStorageLocalSsdConfig::default()/* use setters */);
4627 /// ```
4628 pub fn set_ephemeral_storage_local_ssd_config<T>(mut self, v: T) -> Self
4629 where
4630 T: std::convert::Into<crate::model::EphemeralStorageLocalSsdConfig>,
4631 {
4632 self.ephemeral_storage_local_ssd_config = std::option::Option::Some(v.into());
4633 self
4634 }
4635
4636 /// Sets or clears the value of [ephemeral_storage_local_ssd_config][crate::model::NodeConfig::ephemeral_storage_local_ssd_config].
4637 ///
4638 /// # Example
4639 /// ```ignore,no_run
4640 /// # use google_cloud_container_v1::model::NodeConfig;
4641 /// use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
4642 /// let x = NodeConfig::new().set_or_clear_ephemeral_storage_local_ssd_config(Some(EphemeralStorageLocalSsdConfig::default()/* use setters */));
4643 /// let x = NodeConfig::new().set_or_clear_ephemeral_storage_local_ssd_config(None::<EphemeralStorageLocalSsdConfig>);
4644 /// ```
4645 pub fn set_or_clear_ephemeral_storage_local_ssd_config<T>(
4646 mut self,
4647 v: std::option::Option<T>,
4648 ) -> Self
4649 where
4650 T: std::convert::Into<crate::model::EphemeralStorageLocalSsdConfig>,
4651 {
4652 self.ephemeral_storage_local_ssd_config = v.map(|x| x.into());
4653 self
4654 }
4655
4656 /// Sets the value of [sole_tenant_config][crate::model::NodeConfig::sole_tenant_config].
4657 ///
4658 /// # Example
4659 /// ```ignore,no_run
4660 /// # use google_cloud_container_v1::model::NodeConfig;
4661 /// use google_cloud_container_v1::model::SoleTenantConfig;
4662 /// let x = NodeConfig::new().set_sole_tenant_config(SoleTenantConfig::default()/* use setters */);
4663 /// ```
4664 pub fn set_sole_tenant_config<T>(mut self, v: T) -> Self
4665 where
4666 T: std::convert::Into<crate::model::SoleTenantConfig>,
4667 {
4668 self.sole_tenant_config = std::option::Option::Some(v.into());
4669 self
4670 }
4671
4672 /// Sets or clears the value of [sole_tenant_config][crate::model::NodeConfig::sole_tenant_config].
4673 ///
4674 /// # Example
4675 /// ```ignore,no_run
4676 /// # use google_cloud_container_v1::model::NodeConfig;
4677 /// use google_cloud_container_v1::model::SoleTenantConfig;
4678 /// let x = NodeConfig::new().set_or_clear_sole_tenant_config(Some(SoleTenantConfig::default()/* use setters */));
4679 /// let x = NodeConfig::new().set_or_clear_sole_tenant_config(None::<SoleTenantConfig>);
4680 /// ```
4681 pub fn set_or_clear_sole_tenant_config<T>(mut self, v: std::option::Option<T>) -> Self
4682 where
4683 T: std::convert::Into<crate::model::SoleTenantConfig>,
4684 {
4685 self.sole_tenant_config = v.map(|x| x.into());
4686 self
4687 }
4688
4689 /// Sets the value of [containerd_config][crate::model::NodeConfig::containerd_config].
4690 ///
4691 /// # Example
4692 /// ```ignore,no_run
4693 /// # use google_cloud_container_v1::model::NodeConfig;
4694 /// use google_cloud_container_v1::model::ContainerdConfig;
4695 /// let x = NodeConfig::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
4696 /// ```
4697 pub fn set_containerd_config<T>(mut self, v: T) -> Self
4698 where
4699 T: std::convert::Into<crate::model::ContainerdConfig>,
4700 {
4701 self.containerd_config = std::option::Option::Some(v.into());
4702 self
4703 }
4704
4705 /// Sets or clears the value of [containerd_config][crate::model::NodeConfig::containerd_config].
4706 ///
4707 /// # Example
4708 /// ```ignore,no_run
4709 /// # use google_cloud_container_v1::model::NodeConfig;
4710 /// use google_cloud_container_v1::model::ContainerdConfig;
4711 /// let x = NodeConfig::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
4712 /// let x = NodeConfig::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
4713 /// ```
4714 pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
4715 where
4716 T: std::convert::Into<crate::model::ContainerdConfig>,
4717 {
4718 self.containerd_config = v.map(|x| x.into());
4719 self
4720 }
4721
4722 /// Sets the value of [resource_manager_tags][crate::model::NodeConfig::resource_manager_tags].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_container_v1::model::NodeConfig;
4727 /// use google_cloud_container_v1::model::ResourceManagerTags;
4728 /// let x = NodeConfig::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
4729 /// ```
4730 pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
4731 where
4732 T: std::convert::Into<crate::model::ResourceManagerTags>,
4733 {
4734 self.resource_manager_tags = std::option::Option::Some(v.into());
4735 self
4736 }
4737
4738 /// Sets or clears the value of [resource_manager_tags][crate::model::NodeConfig::resource_manager_tags].
4739 ///
4740 /// # Example
4741 /// ```ignore,no_run
4742 /// # use google_cloud_container_v1::model::NodeConfig;
4743 /// use google_cloud_container_v1::model::ResourceManagerTags;
4744 /// let x = NodeConfig::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
4745 /// let x = NodeConfig::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
4746 /// ```
4747 pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
4748 where
4749 T: std::convert::Into<crate::model::ResourceManagerTags>,
4750 {
4751 self.resource_manager_tags = v.map(|x| x.into());
4752 self
4753 }
4754
4755 /// Sets the value of [enable_confidential_storage][crate::model::NodeConfig::enable_confidential_storage].
4756 ///
4757 /// # Example
4758 /// ```ignore,no_run
4759 /// # use google_cloud_container_v1::model::NodeConfig;
4760 /// let x = NodeConfig::new().set_enable_confidential_storage(true);
4761 /// ```
4762 pub fn set_enable_confidential_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4763 self.enable_confidential_storage = v.into();
4764 self
4765 }
4766
4767 /// Sets the value of [secondary_boot_disks][crate::model::NodeConfig::secondary_boot_disks].
4768 ///
4769 /// # Example
4770 /// ```ignore,no_run
4771 /// # use google_cloud_container_v1::model::NodeConfig;
4772 /// use google_cloud_container_v1::model::SecondaryBootDisk;
4773 /// let x = NodeConfig::new()
4774 /// .set_secondary_boot_disks([
4775 /// SecondaryBootDisk::default()/* use setters */,
4776 /// SecondaryBootDisk::default()/* use (different) setters */,
4777 /// ]);
4778 /// ```
4779 pub fn set_secondary_boot_disks<T, V>(mut self, v: T) -> Self
4780 where
4781 T: std::iter::IntoIterator<Item = V>,
4782 V: std::convert::Into<crate::model::SecondaryBootDisk>,
4783 {
4784 use std::iter::Iterator;
4785 self.secondary_boot_disks = v.into_iter().map(|i| i.into()).collect();
4786 self
4787 }
4788
4789 /// Sets the value of [storage_pools][crate::model::NodeConfig::storage_pools].
4790 ///
4791 /// # Example
4792 /// ```ignore,no_run
4793 /// # use google_cloud_container_v1::model::NodeConfig;
4794 /// let x = NodeConfig::new().set_storage_pools(["a", "b", "c"]);
4795 /// ```
4796 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
4797 where
4798 T: std::iter::IntoIterator<Item = V>,
4799 V: std::convert::Into<std::string::String>,
4800 {
4801 use std::iter::Iterator;
4802 self.storage_pools = v.into_iter().map(|i| i.into()).collect();
4803 self
4804 }
4805
4806 /// Sets the value of [secondary_boot_disk_update_strategy][crate::model::NodeConfig::secondary_boot_disk_update_strategy].
4807 ///
4808 /// # Example
4809 /// ```ignore,no_run
4810 /// # use google_cloud_container_v1::model::NodeConfig;
4811 /// use google_cloud_container_v1::model::SecondaryBootDiskUpdateStrategy;
4812 /// let x = NodeConfig::new().set_secondary_boot_disk_update_strategy(SecondaryBootDiskUpdateStrategy::default()/* use setters */);
4813 /// ```
4814 pub fn set_secondary_boot_disk_update_strategy<T>(mut self, v: T) -> Self
4815 where
4816 T: std::convert::Into<crate::model::SecondaryBootDiskUpdateStrategy>,
4817 {
4818 self.secondary_boot_disk_update_strategy = std::option::Option::Some(v.into());
4819 self
4820 }
4821
4822 /// Sets or clears the value of [secondary_boot_disk_update_strategy][crate::model::NodeConfig::secondary_boot_disk_update_strategy].
4823 ///
4824 /// # Example
4825 /// ```ignore,no_run
4826 /// # use google_cloud_container_v1::model::NodeConfig;
4827 /// use google_cloud_container_v1::model::SecondaryBootDiskUpdateStrategy;
4828 /// let x = NodeConfig::new().set_or_clear_secondary_boot_disk_update_strategy(Some(SecondaryBootDiskUpdateStrategy::default()/* use setters */));
4829 /// let x = NodeConfig::new().set_or_clear_secondary_boot_disk_update_strategy(None::<SecondaryBootDiskUpdateStrategy>);
4830 /// ```
4831 pub fn set_or_clear_secondary_boot_disk_update_strategy<T>(
4832 mut self,
4833 v: std::option::Option<T>,
4834 ) -> Self
4835 where
4836 T: std::convert::Into<crate::model::SecondaryBootDiskUpdateStrategy>,
4837 {
4838 self.secondary_boot_disk_update_strategy = v.map(|x| x.into());
4839 self
4840 }
4841
4842 /// Sets the value of [gpu_direct_config][crate::model::NodeConfig::gpu_direct_config].
4843 ///
4844 /// # Example
4845 /// ```ignore,no_run
4846 /// # use google_cloud_container_v1::model::NodeConfig;
4847 /// use google_cloud_container_v1::model::GPUDirectConfig;
4848 /// let x = NodeConfig::new().set_gpu_direct_config(GPUDirectConfig::default()/* use setters */);
4849 /// ```
4850 pub fn set_gpu_direct_config<T>(mut self, v: T) -> Self
4851 where
4852 T: std::convert::Into<crate::model::GPUDirectConfig>,
4853 {
4854 self.gpu_direct_config = std::option::Option::Some(v.into());
4855 self
4856 }
4857
4858 /// Sets or clears the value of [gpu_direct_config][crate::model::NodeConfig::gpu_direct_config].
4859 ///
4860 /// # Example
4861 /// ```ignore,no_run
4862 /// # use google_cloud_container_v1::model::NodeConfig;
4863 /// use google_cloud_container_v1::model::GPUDirectConfig;
4864 /// let x = NodeConfig::new().set_or_clear_gpu_direct_config(Some(GPUDirectConfig::default()/* use setters */));
4865 /// let x = NodeConfig::new().set_or_clear_gpu_direct_config(None::<GPUDirectConfig>);
4866 /// ```
4867 pub fn set_or_clear_gpu_direct_config<T>(mut self, v: std::option::Option<T>) -> Self
4868 where
4869 T: std::convert::Into<crate::model::GPUDirectConfig>,
4870 {
4871 self.gpu_direct_config = v.map(|x| x.into());
4872 self
4873 }
4874
4875 /// Sets the value of [max_run_duration][crate::model::NodeConfig::max_run_duration].
4876 ///
4877 /// # Example
4878 /// ```ignore,no_run
4879 /// # use google_cloud_container_v1::model::NodeConfig;
4880 /// use wkt::Duration;
4881 /// let x = NodeConfig::new().set_max_run_duration(Duration::default()/* use setters */);
4882 /// ```
4883 pub fn set_max_run_duration<T>(mut self, v: T) -> Self
4884 where
4885 T: std::convert::Into<wkt::Duration>,
4886 {
4887 self.max_run_duration = std::option::Option::Some(v.into());
4888 self
4889 }
4890
4891 /// Sets or clears the value of [max_run_duration][crate::model::NodeConfig::max_run_duration].
4892 ///
4893 /// # Example
4894 /// ```ignore,no_run
4895 /// # use google_cloud_container_v1::model::NodeConfig;
4896 /// use wkt::Duration;
4897 /// let x = NodeConfig::new().set_or_clear_max_run_duration(Some(Duration::default()/* use setters */));
4898 /// let x = NodeConfig::new().set_or_clear_max_run_duration(None::<Duration>);
4899 /// ```
4900 pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
4901 where
4902 T: std::convert::Into<wkt::Duration>,
4903 {
4904 self.max_run_duration = v.map(|x| x.into());
4905 self
4906 }
4907
4908 /// Sets the value of [local_ssd_encryption_mode][crate::model::NodeConfig::local_ssd_encryption_mode].
4909 ///
4910 /// # Example
4911 /// ```ignore,no_run
4912 /// # use google_cloud_container_v1::model::NodeConfig;
4913 /// use google_cloud_container_v1::model::node_config::LocalSsdEncryptionMode;
4914 /// let x0 = NodeConfig::new().set_local_ssd_encryption_mode(LocalSsdEncryptionMode::StandardEncryption);
4915 /// let x1 = NodeConfig::new().set_local_ssd_encryption_mode(LocalSsdEncryptionMode::EphemeralKeyEncryption);
4916 /// ```
4917 pub fn set_local_ssd_encryption_mode<T>(mut self, v: T) -> Self
4918 where
4919 T: std::convert::Into<crate::model::node_config::LocalSsdEncryptionMode>,
4920 {
4921 self.local_ssd_encryption_mode = std::option::Option::Some(v.into());
4922 self
4923 }
4924
4925 /// Sets or clears the value of [local_ssd_encryption_mode][crate::model::NodeConfig::local_ssd_encryption_mode].
4926 ///
4927 /// # Example
4928 /// ```ignore,no_run
4929 /// # use google_cloud_container_v1::model::NodeConfig;
4930 /// use google_cloud_container_v1::model::node_config::LocalSsdEncryptionMode;
4931 /// let x0 = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(Some(LocalSsdEncryptionMode::StandardEncryption));
4932 /// let x1 = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(Some(LocalSsdEncryptionMode::EphemeralKeyEncryption));
4933 /// let x_none = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(None::<LocalSsdEncryptionMode>);
4934 /// ```
4935 pub fn set_or_clear_local_ssd_encryption_mode<T>(mut self, v: std::option::Option<T>) -> Self
4936 where
4937 T: std::convert::Into<crate::model::node_config::LocalSsdEncryptionMode>,
4938 {
4939 self.local_ssd_encryption_mode = v.map(|x| x.into());
4940 self
4941 }
4942
4943 /// Sets the value of [effective_cgroup_mode][crate::model::NodeConfig::effective_cgroup_mode].
4944 ///
4945 /// # Example
4946 /// ```ignore,no_run
4947 /// # use google_cloud_container_v1::model::NodeConfig;
4948 /// use google_cloud_container_v1::model::node_config::EffectiveCgroupMode;
4949 /// let x0 = NodeConfig::new().set_effective_cgroup_mode(EffectiveCgroupMode::V1);
4950 /// let x1 = NodeConfig::new().set_effective_cgroup_mode(EffectiveCgroupMode::V2);
4951 /// ```
4952 pub fn set_effective_cgroup_mode<
4953 T: std::convert::Into<crate::model::node_config::EffectiveCgroupMode>,
4954 >(
4955 mut self,
4956 v: T,
4957 ) -> Self {
4958 self.effective_cgroup_mode = v.into();
4959 self
4960 }
4961
4962 /// Sets the value of [flex_start][crate::model::NodeConfig::flex_start].
4963 ///
4964 /// # Example
4965 /// ```ignore,no_run
4966 /// # use google_cloud_container_v1::model::NodeConfig;
4967 /// let x = NodeConfig::new().set_flex_start(true);
4968 /// ```
4969 pub fn set_flex_start<T>(mut self, v: T) -> Self
4970 where
4971 T: std::convert::Into<bool>,
4972 {
4973 self.flex_start = std::option::Option::Some(v.into());
4974 self
4975 }
4976
4977 /// Sets or clears the value of [flex_start][crate::model::NodeConfig::flex_start].
4978 ///
4979 /// # Example
4980 /// ```ignore,no_run
4981 /// # use google_cloud_container_v1::model::NodeConfig;
4982 /// let x = NodeConfig::new().set_or_clear_flex_start(Some(false));
4983 /// let x = NodeConfig::new().set_or_clear_flex_start(None::<bool>);
4984 /// ```
4985 pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
4986 where
4987 T: std::convert::Into<bool>,
4988 {
4989 self.flex_start = v.map(|x| x.into());
4990 self
4991 }
4992
4993 /// Sets the value of [boot_disk][crate::model::NodeConfig::boot_disk].
4994 ///
4995 /// # Example
4996 /// ```ignore,no_run
4997 /// # use google_cloud_container_v1::model::NodeConfig;
4998 /// use google_cloud_container_v1::model::BootDisk;
4999 /// let x = NodeConfig::new().set_boot_disk(BootDisk::default()/* use setters */);
5000 /// ```
5001 pub fn set_boot_disk<T>(mut self, v: T) -> Self
5002 where
5003 T: std::convert::Into<crate::model::BootDisk>,
5004 {
5005 self.boot_disk = std::option::Option::Some(v.into());
5006 self
5007 }
5008
5009 /// Sets or clears the value of [boot_disk][crate::model::NodeConfig::boot_disk].
5010 ///
5011 /// # Example
5012 /// ```ignore,no_run
5013 /// # use google_cloud_container_v1::model::NodeConfig;
5014 /// use google_cloud_container_v1::model::BootDisk;
5015 /// let x = NodeConfig::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
5016 /// let x = NodeConfig::new().set_or_clear_boot_disk(None::<BootDisk>);
5017 /// ```
5018 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
5019 where
5020 T: std::convert::Into<crate::model::BootDisk>,
5021 {
5022 self.boot_disk = v.map(|x| x.into());
5023 self
5024 }
5025
5026 /// Sets the value of [consolidation_delay][crate::model::NodeConfig::consolidation_delay].
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_container_v1::model::NodeConfig;
5031 /// use wkt::Duration;
5032 /// let x = NodeConfig::new().set_consolidation_delay(Duration::default()/* use setters */);
5033 /// ```
5034 pub fn set_consolidation_delay<T>(mut self, v: T) -> Self
5035 where
5036 T: std::convert::Into<wkt::Duration>,
5037 {
5038 self.consolidation_delay = std::option::Option::Some(v.into());
5039 self
5040 }
5041
5042 /// Sets or clears the value of [consolidation_delay][crate::model::NodeConfig::consolidation_delay].
5043 ///
5044 /// # Example
5045 /// ```ignore,no_run
5046 /// # use google_cloud_container_v1::model::NodeConfig;
5047 /// use wkt::Duration;
5048 /// let x = NodeConfig::new().set_or_clear_consolidation_delay(Some(Duration::default()/* use setters */));
5049 /// let x = NodeConfig::new().set_or_clear_consolidation_delay(None::<Duration>);
5050 /// ```
5051 pub fn set_or_clear_consolidation_delay<T>(mut self, v: std::option::Option<T>) -> Self
5052 where
5053 T: std::convert::Into<wkt::Duration>,
5054 {
5055 self.consolidation_delay = v.map(|x| x.into());
5056 self
5057 }
5058
5059 /// Sets the value of [taint_config][crate::model::NodeConfig::taint_config].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_container_v1::model::NodeConfig;
5064 /// use google_cloud_container_v1::model::TaintConfig;
5065 /// let x = NodeConfig::new().set_taint_config(TaintConfig::default()/* use setters */);
5066 /// ```
5067 pub fn set_taint_config<T>(mut self, v: T) -> Self
5068 where
5069 T: std::convert::Into<crate::model::TaintConfig>,
5070 {
5071 self.taint_config = std::option::Option::Some(v.into());
5072 self
5073 }
5074
5075 /// Sets or clears the value of [taint_config][crate::model::NodeConfig::taint_config].
5076 ///
5077 /// # Example
5078 /// ```ignore,no_run
5079 /// # use google_cloud_container_v1::model::NodeConfig;
5080 /// use google_cloud_container_v1::model::TaintConfig;
5081 /// let x = NodeConfig::new().set_or_clear_taint_config(Some(TaintConfig::default()/* use setters */));
5082 /// let x = NodeConfig::new().set_or_clear_taint_config(None::<TaintConfig>);
5083 /// ```
5084 pub fn set_or_clear_taint_config<T>(mut self, v: std::option::Option<T>) -> Self
5085 where
5086 T: std::convert::Into<crate::model::TaintConfig>,
5087 {
5088 self.taint_config = v.map(|x| x.into());
5089 self
5090 }
5091}
5092
5093impl wkt::message::Message for NodeConfig {
5094 fn typename() -> &'static str {
5095 "type.googleapis.com/google.container.v1.NodeConfig"
5096 }
5097}
5098
5099/// Defines additional types related to [NodeConfig].
5100pub mod node_config {
5101 #[allow(unused_imports)]
5102 use super::*;
5103
5104 /// LocalSsdEncryptionMode specifies the method used for encrypting the Local
5105 /// SSDs attached to the node.
5106 ///
5107 /// # Working with unknown values
5108 ///
5109 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5110 /// additional enum variants at any time. Adding new variants is not considered
5111 /// a breaking change. Applications should write their code in anticipation of:
5112 ///
5113 /// - New values appearing in future releases of the client library, **and**
5114 /// - New values received dynamically, without application changes.
5115 ///
5116 /// Please consult the [Working with enums] section in the user guide for some
5117 /// guidelines.
5118 ///
5119 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5120 #[derive(Clone, Debug, PartialEq)]
5121 #[non_exhaustive]
5122 pub enum LocalSsdEncryptionMode {
5123 /// The given node will be encrypted using keys managed by Google
5124 /// infrastructure and the keys will be deleted when the node is
5125 /// deleted.
5126 Unspecified,
5127 /// The given node will be encrypted using keys managed by Google
5128 /// infrastructure and the keys will be deleted when the node is
5129 /// deleted.
5130 StandardEncryption,
5131 /// The given node will opt-in for using ephemeral key for
5132 /// encryption of Local SSDs.
5133 /// The Local SSDs will not be able to recover data in case of node
5134 /// crash.
5135 EphemeralKeyEncryption,
5136 /// If set, the enum was initialized with an unknown value.
5137 ///
5138 /// Applications can examine the value using [LocalSsdEncryptionMode::value] or
5139 /// [LocalSsdEncryptionMode::name].
5140 UnknownValue(local_ssd_encryption_mode::UnknownValue),
5141 }
5142
5143 #[doc(hidden)]
5144 pub mod local_ssd_encryption_mode {
5145 #[allow(unused_imports)]
5146 use super::*;
5147 #[derive(Clone, Debug, PartialEq)]
5148 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5149 }
5150
5151 impl LocalSsdEncryptionMode {
5152 /// Gets the enum value.
5153 ///
5154 /// Returns `None` if the enum contains an unknown value deserialized from
5155 /// the string representation of enums.
5156 pub fn value(&self) -> std::option::Option<i32> {
5157 match self {
5158 Self::Unspecified => std::option::Option::Some(0),
5159 Self::StandardEncryption => std::option::Option::Some(1),
5160 Self::EphemeralKeyEncryption => std::option::Option::Some(2),
5161 Self::UnknownValue(u) => u.0.value(),
5162 }
5163 }
5164
5165 /// Gets the enum value as a string.
5166 ///
5167 /// Returns `None` if the enum contains an unknown value deserialized from
5168 /// the integer representation of enums.
5169 pub fn name(&self) -> std::option::Option<&str> {
5170 match self {
5171 Self::Unspecified => {
5172 std::option::Option::Some("LOCAL_SSD_ENCRYPTION_MODE_UNSPECIFIED")
5173 }
5174 Self::StandardEncryption => std::option::Option::Some("STANDARD_ENCRYPTION"),
5175 Self::EphemeralKeyEncryption => {
5176 std::option::Option::Some("EPHEMERAL_KEY_ENCRYPTION")
5177 }
5178 Self::UnknownValue(u) => u.0.name(),
5179 }
5180 }
5181 }
5182
5183 impl std::default::Default for LocalSsdEncryptionMode {
5184 fn default() -> Self {
5185 use std::convert::From;
5186 Self::from(0)
5187 }
5188 }
5189
5190 impl std::fmt::Display for LocalSsdEncryptionMode {
5191 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5192 wkt::internal::display_enum(f, self.name(), self.value())
5193 }
5194 }
5195
5196 impl std::convert::From<i32> for LocalSsdEncryptionMode {
5197 fn from(value: i32) -> Self {
5198 match value {
5199 0 => Self::Unspecified,
5200 1 => Self::StandardEncryption,
5201 2 => Self::EphemeralKeyEncryption,
5202 _ => Self::UnknownValue(local_ssd_encryption_mode::UnknownValue(
5203 wkt::internal::UnknownEnumValue::Integer(value),
5204 )),
5205 }
5206 }
5207 }
5208
5209 impl std::convert::From<&str> for LocalSsdEncryptionMode {
5210 fn from(value: &str) -> Self {
5211 use std::string::ToString;
5212 match value {
5213 "LOCAL_SSD_ENCRYPTION_MODE_UNSPECIFIED" => Self::Unspecified,
5214 "STANDARD_ENCRYPTION" => Self::StandardEncryption,
5215 "EPHEMERAL_KEY_ENCRYPTION" => Self::EphemeralKeyEncryption,
5216 _ => Self::UnknownValue(local_ssd_encryption_mode::UnknownValue(
5217 wkt::internal::UnknownEnumValue::String(value.to_string()),
5218 )),
5219 }
5220 }
5221 }
5222
5223 impl serde::ser::Serialize for LocalSsdEncryptionMode {
5224 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5225 where
5226 S: serde::Serializer,
5227 {
5228 match self {
5229 Self::Unspecified => serializer.serialize_i32(0),
5230 Self::StandardEncryption => serializer.serialize_i32(1),
5231 Self::EphemeralKeyEncryption => serializer.serialize_i32(2),
5232 Self::UnknownValue(u) => u.0.serialize(serializer),
5233 }
5234 }
5235 }
5236
5237 impl<'de> serde::de::Deserialize<'de> for LocalSsdEncryptionMode {
5238 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5239 where
5240 D: serde::Deserializer<'de>,
5241 {
5242 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocalSsdEncryptionMode>::new(
5243 ".google.container.v1.NodeConfig.LocalSsdEncryptionMode",
5244 ))
5245 }
5246 }
5247
5248 /// Possible effective cgroup modes for the node.
5249 ///
5250 /// # Working with unknown values
5251 ///
5252 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5253 /// additional enum variants at any time. Adding new variants is not considered
5254 /// a breaking change. Applications should write their code in anticipation of:
5255 ///
5256 /// - New values appearing in future releases of the client library, **and**
5257 /// - New values received dynamically, without application changes.
5258 ///
5259 /// Please consult the [Working with enums] section in the user guide for some
5260 /// guidelines.
5261 ///
5262 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5263 #[derive(Clone, Debug, PartialEq)]
5264 #[non_exhaustive]
5265 pub enum EffectiveCgroupMode {
5266 /// EFFECTIVE_CGROUP_MODE_UNSPECIFIED means the cgroup configuration for the
5267 /// node pool is unspecified, i.e. the node pool is a Windows node pool.
5268 Unspecified,
5269 /// CGROUP_MODE_V1 means the node pool is configured to use cgroupv1 for the
5270 /// cgroup configuration.
5271 V1,
5272 /// CGROUP_MODE_V2 means the node pool is configured to use cgroupv2 for the
5273 /// cgroup configuration.
5274 V2,
5275 /// If set, the enum was initialized with an unknown value.
5276 ///
5277 /// Applications can examine the value using [EffectiveCgroupMode::value] or
5278 /// [EffectiveCgroupMode::name].
5279 UnknownValue(effective_cgroup_mode::UnknownValue),
5280 }
5281
5282 #[doc(hidden)]
5283 pub mod effective_cgroup_mode {
5284 #[allow(unused_imports)]
5285 use super::*;
5286 #[derive(Clone, Debug, PartialEq)]
5287 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5288 }
5289
5290 impl EffectiveCgroupMode {
5291 /// Gets the enum value.
5292 ///
5293 /// Returns `None` if the enum contains an unknown value deserialized from
5294 /// the string representation of enums.
5295 pub fn value(&self) -> std::option::Option<i32> {
5296 match self {
5297 Self::Unspecified => std::option::Option::Some(0),
5298 Self::V1 => std::option::Option::Some(1),
5299 Self::V2 => std::option::Option::Some(2),
5300 Self::UnknownValue(u) => u.0.value(),
5301 }
5302 }
5303
5304 /// Gets the enum value as a string.
5305 ///
5306 /// Returns `None` if the enum contains an unknown value deserialized from
5307 /// the integer representation of enums.
5308 pub fn name(&self) -> std::option::Option<&str> {
5309 match self {
5310 Self::Unspecified => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_UNSPECIFIED"),
5311 Self::V1 => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_V1"),
5312 Self::V2 => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_V2"),
5313 Self::UnknownValue(u) => u.0.name(),
5314 }
5315 }
5316 }
5317
5318 impl std::default::Default for EffectiveCgroupMode {
5319 fn default() -> Self {
5320 use std::convert::From;
5321 Self::from(0)
5322 }
5323 }
5324
5325 impl std::fmt::Display for EffectiveCgroupMode {
5326 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5327 wkt::internal::display_enum(f, self.name(), self.value())
5328 }
5329 }
5330
5331 impl std::convert::From<i32> for EffectiveCgroupMode {
5332 fn from(value: i32) -> Self {
5333 match value {
5334 0 => Self::Unspecified,
5335 1 => Self::V1,
5336 2 => Self::V2,
5337 _ => Self::UnknownValue(effective_cgroup_mode::UnknownValue(
5338 wkt::internal::UnknownEnumValue::Integer(value),
5339 )),
5340 }
5341 }
5342 }
5343
5344 impl std::convert::From<&str> for EffectiveCgroupMode {
5345 fn from(value: &str) -> Self {
5346 use std::string::ToString;
5347 match value {
5348 "EFFECTIVE_CGROUP_MODE_UNSPECIFIED" => Self::Unspecified,
5349 "EFFECTIVE_CGROUP_MODE_V1" => Self::V1,
5350 "EFFECTIVE_CGROUP_MODE_V2" => Self::V2,
5351 _ => Self::UnknownValue(effective_cgroup_mode::UnknownValue(
5352 wkt::internal::UnknownEnumValue::String(value.to_string()),
5353 )),
5354 }
5355 }
5356 }
5357
5358 impl serde::ser::Serialize for EffectiveCgroupMode {
5359 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5360 where
5361 S: serde::Serializer,
5362 {
5363 match self {
5364 Self::Unspecified => serializer.serialize_i32(0),
5365 Self::V1 => serializer.serialize_i32(1),
5366 Self::V2 => serializer.serialize_i32(2),
5367 Self::UnknownValue(u) => u.0.serialize(serializer),
5368 }
5369 }
5370 }
5371
5372 impl<'de> serde::de::Deserialize<'de> for EffectiveCgroupMode {
5373 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5374 where
5375 D: serde::Deserializer<'de>,
5376 {
5377 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveCgroupMode>::new(
5378 ".google.container.v1.NodeConfig.EffectiveCgroupMode",
5379 ))
5380 }
5381 }
5382}
5383
5384/// TaintConfig contains the configuration for the taints of the node pool.
5385#[derive(Clone, Default, PartialEq)]
5386#[non_exhaustive]
5387pub struct TaintConfig {
5388 /// Optional. Controls architecture tainting behavior.
5389 pub architecture_taint_behavior:
5390 std::option::Option<crate::model::taint_config::ArchitectureTaintBehavior>,
5391
5392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5393}
5394
5395impl TaintConfig {
5396 /// Creates a new default instance.
5397 pub fn new() -> Self {
5398 std::default::Default::default()
5399 }
5400
5401 /// Sets the value of [architecture_taint_behavior][crate::model::TaintConfig::architecture_taint_behavior].
5402 ///
5403 /// # Example
5404 /// ```ignore,no_run
5405 /// # use google_cloud_container_v1::model::TaintConfig;
5406 /// use google_cloud_container_v1::model::taint_config::ArchitectureTaintBehavior;
5407 /// let x0 = TaintConfig::new().set_architecture_taint_behavior(ArchitectureTaintBehavior::None);
5408 /// let x1 = TaintConfig::new().set_architecture_taint_behavior(ArchitectureTaintBehavior::Arm);
5409 /// ```
5410 pub fn set_architecture_taint_behavior<T>(mut self, v: T) -> Self
5411 where
5412 T: std::convert::Into<crate::model::taint_config::ArchitectureTaintBehavior>,
5413 {
5414 self.architecture_taint_behavior = std::option::Option::Some(v.into());
5415 self
5416 }
5417
5418 /// Sets or clears the value of [architecture_taint_behavior][crate::model::TaintConfig::architecture_taint_behavior].
5419 ///
5420 /// # Example
5421 /// ```ignore,no_run
5422 /// # use google_cloud_container_v1::model::TaintConfig;
5423 /// use google_cloud_container_v1::model::taint_config::ArchitectureTaintBehavior;
5424 /// let x0 = TaintConfig::new().set_or_clear_architecture_taint_behavior(Some(ArchitectureTaintBehavior::None));
5425 /// let x1 = TaintConfig::new().set_or_clear_architecture_taint_behavior(Some(ArchitectureTaintBehavior::Arm));
5426 /// let x_none = TaintConfig::new().set_or_clear_architecture_taint_behavior(None::<ArchitectureTaintBehavior>);
5427 /// ```
5428 pub fn set_or_clear_architecture_taint_behavior<T>(mut self, v: std::option::Option<T>) -> Self
5429 where
5430 T: std::convert::Into<crate::model::taint_config::ArchitectureTaintBehavior>,
5431 {
5432 self.architecture_taint_behavior = v.map(|x| x.into());
5433 self
5434 }
5435}
5436
5437impl wkt::message::Message for TaintConfig {
5438 fn typename() -> &'static str {
5439 "type.googleapis.com/google.container.v1.TaintConfig"
5440 }
5441}
5442
5443/// Defines additional types related to [TaintConfig].
5444pub mod taint_config {
5445 #[allow(unused_imports)]
5446 use super::*;
5447
5448 /// Controls architecture tainting behavior for a node pool.
5449 /// New values may be added in the future.
5450 ///
5451 /// # Working with unknown values
5452 ///
5453 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5454 /// additional enum variants at any time. Adding new variants is not considered
5455 /// a breaking change. Applications should write their code in anticipation of:
5456 ///
5457 /// - New values appearing in future releases of the client library, **and**
5458 /// - New values received dynamically, without application changes.
5459 ///
5460 /// Please consult the [Working with enums] section in the user guide for some
5461 /// guidelines.
5462 ///
5463 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5464 #[derive(Clone, Debug, PartialEq)]
5465 #[non_exhaustive]
5466 pub enum ArchitectureTaintBehavior {
5467 /// Specifies that the behavior is unspecified, defaults to ARM.
5468 Unspecified,
5469 /// Disables default architecture taints on the node pool.
5470 None,
5471 /// Taints all the nodes in the node pool with the default ARM taint.
5472 Arm,
5473 /// If set, the enum was initialized with an unknown value.
5474 ///
5475 /// Applications can examine the value using [ArchitectureTaintBehavior::value] or
5476 /// [ArchitectureTaintBehavior::name].
5477 UnknownValue(architecture_taint_behavior::UnknownValue),
5478 }
5479
5480 #[doc(hidden)]
5481 pub mod architecture_taint_behavior {
5482 #[allow(unused_imports)]
5483 use super::*;
5484 #[derive(Clone, Debug, PartialEq)]
5485 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5486 }
5487
5488 impl ArchitectureTaintBehavior {
5489 /// Gets the enum value.
5490 ///
5491 /// Returns `None` if the enum contains an unknown value deserialized from
5492 /// the string representation of enums.
5493 pub fn value(&self) -> std::option::Option<i32> {
5494 match self {
5495 Self::Unspecified => std::option::Option::Some(0),
5496 Self::None => std::option::Option::Some(1),
5497 Self::Arm => std::option::Option::Some(2),
5498 Self::UnknownValue(u) => u.0.value(),
5499 }
5500 }
5501
5502 /// Gets the enum value as a string.
5503 ///
5504 /// Returns `None` if the enum contains an unknown value deserialized from
5505 /// the integer representation of enums.
5506 pub fn name(&self) -> std::option::Option<&str> {
5507 match self {
5508 Self::Unspecified => {
5509 std::option::Option::Some("ARCHITECTURE_TAINT_BEHAVIOR_UNSPECIFIED")
5510 }
5511 Self::None => std::option::Option::Some("NONE"),
5512 Self::Arm => std::option::Option::Some("ARM"),
5513 Self::UnknownValue(u) => u.0.name(),
5514 }
5515 }
5516 }
5517
5518 impl std::default::Default for ArchitectureTaintBehavior {
5519 fn default() -> Self {
5520 use std::convert::From;
5521 Self::from(0)
5522 }
5523 }
5524
5525 impl std::fmt::Display for ArchitectureTaintBehavior {
5526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5527 wkt::internal::display_enum(f, self.name(), self.value())
5528 }
5529 }
5530
5531 impl std::convert::From<i32> for ArchitectureTaintBehavior {
5532 fn from(value: i32) -> Self {
5533 match value {
5534 0 => Self::Unspecified,
5535 1 => Self::None,
5536 2 => Self::Arm,
5537 _ => Self::UnknownValue(architecture_taint_behavior::UnknownValue(
5538 wkt::internal::UnknownEnumValue::Integer(value),
5539 )),
5540 }
5541 }
5542 }
5543
5544 impl std::convert::From<&str> for ArchitectureTaintBehavior {
5545 fn from(value: &str) -> Self {
5546 use std::string::ToString;
5547 match value {
5548 "ARCHITECTURE_TAINT_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
5549 "NONE" => Self::None,
5550 "ARM" => Self::Arm,
5551 _ => Self::UnknownValue(architecture_taint_behavior::UnknownValue(
5552 wkt::internal::UnknownEnumValue::String(value.to_string()),
5553 )),
5554 }
5555 }
5556 }
5557
5558 impl serde::ser::Serialize for ArchitectureTaintBehavior {
5559 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5560 where
5561 S: serde::Serializer,
5562 {
5563 match self {
5564 Self::Unspecified => serializer.serialize_i32(0),
5565 Self::None => serializer.serialize_i32(1),
5566 Self::Arm => serializer.serialize_i32(2),
5567 Self::UnknownValue(u) => u.0.serialize(serializer),
5568 }
5569 }
5570 }
5571
5572 impl<'de> serde::de::Deserialize<'de> for ArchitectureTaintBehavior {
5573 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5574 where
5575 D: serde::Deserializer<'de>,
5576 {
5577 deserializer.deserialize_any(
5578 wkt::internal::EnumVisitor::<ArchitectureTaintBehavior>::new(
5579 ".google.container.v1.TaintConfig.ArchitectureTaintBehavior",
5580 ),
5581 )
5582 }
5583 }
5584}
5585
5586/// Specifies options for controlling advanced machine features.
5587#[derive(Clone, Default, PartialEq)]
5588#[non_exhaustive]
5589pub struct AdvancedMachineFeatures {
5590 /// The number of threads per physical core. To disable simultaneous
5591 /// multithreading (SMT) set this to 1. If unset, the maximum number of threads
5592 /// supported per core by the underlying processor is assumed.
5593 pub threads_per_core: std::option::Option<i64>,
5594
5595 /// Whether or not to enable nested virtualization (defaults to false).
5596 pub enable_nested_virtualization: std::option::Option<bool>,
5597
5598 /// Type of Performance Monitoring Unit (PMU) requested on node pool instances.
5599 /// If unset, PMU will not be available to the node.
5600 pub performance_monitoring_unit:
5601 std::option::Option<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
5602
5603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5604}
5605
5606impl AdvancedMachineFeatures {
5607 /// Creates a new default instance.
5608 pub fn new() -> Self {
5609 std::default::Default::default()
5610 }
5611
5612 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
5613 ///
5614 /// # Example
5615 /// ```ignore,no_run
5616 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5617 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
5618 /// ```
5619 pub fn set_threads_per_core<T>(mut self, v: T) -> Self
5620 where
5621 T: std::convert::Into<i64>,
5622 {
5623 self.threads_per_core = std::option::Option::Some(v.into());
5624 self
5625 }
5626
5627 /// Sets or clears the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
5628 ///
5629 /// # Example
5630 /// ```ignore,no_run
5631 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5632 /// let x = AdvancedMachineFeatures::new().set_or_clear_threads_per_core(Some(42));
5633 /// let x = AdvancedMachineFeatures::new().set_or_clear_threads_per_core(None::<i32>);
5634 /// ```
5635 pub fn set_or_clear_threads_per_core<T>(mut self, v: std::option::Option<T>) -> Self
5636 where
5637 T: std::convert::Into<i64>,
5638 {
5639 self.threads_per_core = v.map(|x| x.into());
5640 self
5641 }
5642
5643 /// Sets the value of [enable_nested_virtualization][crate::model::AdvancedMachineFeatures::enable_nested_virtualization].
5644 ///
5645 /// # Example
5646 /// ```ignore,no_run
5647 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5648 /// let x = AdvancedMachineFeatures::new().set_enable_nested_virtualization(true);
5649 /// ```
5650 pub fn set_enable_nested_virtualization<T>(mut self, v: T) -> Self
5651 where
5652 T: std::convert::Into<bool>,
5653 {
5654 self.enable_nested_virtualization = std::option::Option::Some(v.into());
5655 self
5656 }
5657
5658 /// Sets or clears the value of [enable_nested_virtualization][crate::model::AdvancedMachineFeatures::enable_nested_virtualization].
5659 ///
5660 /// # Example
5661 /// ```ignore,no_run
5662 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5663 /// let x = AdvancedMachineFeatures::new().set_or_clear_enable_nested_virtualization(Some(false));
5664 /// let x = AdvancedMachineFeatures::new().set_or_clear_enable_nested_virtualization(None::<bool>);
5665 /// ```
5666 pub fn set_or_clear_enable_nested_virtualization<T>(mut self, v: std::option::Option<T>) -> Self
5667 where
5668 T: std::convert::Into<bool>,
5669 {
5670 self.enable_nested_virtualization = v.map(|x| x.into());
5671 self
5672 }
5673
5674 /// Sets the value of [performance_monitoring_unit][crate::model::AdvancedMachineFeatures::performance_monitoring_unit].
5675 ///
5676 /// # Example
5677 /// ```ignore,no_run
5678 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5679 /// use google_cloud_container_v1::model::advanced_machine_features::PerformanceMonitoringUnit;
5680 /// let x0 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Architectural);
5681 /// let x1 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Standard);
5682 /// let x2 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Enhanced);
5683 /// ```
5684 pub fn set_performance_monitoring_unit<T>(mut self, v: T) -> Self
5685 where
5686 T: std::convert::Into<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
5687 {
5688 self.performance_monitoring_unit = std::option::Option::Some(v.into());
5689 self
5690 }
5691
5692 /// Sets or clears the value of [performance_monitoring_unit][crate::model::AdvancedMachineFeatures::performance_monitoring_unit].
5693 ///
5694 /// # Example
5695 /// ```ignore,no_run
5696 /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
5697 /// use google_cloud_container_v1::model::advanced_machine_features::PerformanceMonitoringUnit;
5698 /// let x0 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Architectural));
5699 /// let x1 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Standard));
5700 /// let x2 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Enhanced));
5701 /// let x_none = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(None::<PerformanceMonitoringUnit>);
5702 /// ```
5703 pub fn set_or_clear_performance_monitoring_unit<T>(mut self, v: std::option::Option<T>) -> Self
5704 where
5705 T: std::convert::Into<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
5706 {
5707 self.performance_monitoring_unit = v.map(|x| x.into());
5708 self
5709 }
5710}
5711
5712impl wkt::message::Message for AdvancedMachineFeatures {
5713 fn typename() -> &'static str {
5714 "type.googleapis.com/google.container.v1.AdvancedMachineFeatures"
5715 }
5716}
5717
5718/// Defines additional types related to [AdvancedMachineFeatures].
5719pub mod advanced_machine_features {
5720 #[allow(unused_imports)]
5721 use super::*;
5722
5723 /// Level of PMU access.
5724 ///
5725 /// # Working with unknown values
5726 ///
5727 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5728 /// additional enum variants at any time. Adding new variants is not considered
5729 /// a breaking change. Applications should write their code in anticipation of:
5730 ///
5731 /// - New values appearing in future releases of the client library, **and**
5732 /// - New values received dynamically, without application changes.
5733 ///
5734 /// Please consult the [Working with enums] section in the user guide for some
5735 /// guidelines.
5736 ///
5737 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5738 #[derive(Clone, Debug, PartialEq)]
5739 #[non_exhaustive]
5740 pub enum PerformanceMonitoringUnit {
5741 /// PMU not enabled.
5742 Unspecified,
5743 /// Architecturally defined non-LLC events.
5744 Architectural,
5745 /// Most documented core/L2 events.
5746 Standard,
5747 /// Most documented core/L2 and LLC events.
5748 Enhanced,
5749 /// If set, the enum was initialized with an unknown value.
5750 ///
5751 /// Applications can examine the value using [PerformanceMonitoringUnit::value] or
5752 /// [PerformanceMonitoringUnit::name].
5753 UnknownValue(performance_monitoring_unit::UnknownValue),
5754 }
5755
5756 #[doc(hidden)]
5757 pub mod performance_monitoring_unit {
5758 #[allow(unused_imports)]
5759 use super::*;
5760 #[derive(Clone, Debug, PartialEq)]
5761 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5762 }
5763
5764 impl PerformanceMonitoringUnit {
5765 /// Gets the enum value.
5766 ///
5767 /// Returns `None` if the enum contains an unknown value deserialized from
5768 /// the string representation of enums.
5769 pub fn value(&self) -> std::option::Option<i32> {
5770 match self {
5771 Self::Unspecified => std::option::Option::Some(0),
5772 Self::Architectural => std::option::Option::Some(1),
5773 Self::Standard => std::option::Option::Some(2),
5774 Self::Enhanced => std::option::Option::Some(3),
5775 Self::UnknownValue(u) => u.0.value(),
5776 }
5777 }
5778
5779 /// Gets the enum value as a string.
5780 ///
5781 /// Returns `None` if the enum contains an unknown value deserialized from
5782 /// the integer representation of enums.
5783 pub fn name(&self) -> std::option::Option<&str> {
5784 match self {
5785 Self::Unspecified => {
5786 std::option::Option::Some("PERFORMANCE_MONITORING_UNIT_UNSPECIFIED")
5787 }
5788 Self::Architectural => std::option::Option::Some("ARCHITECTURAL"),
5789 Self::Standard => std::option::Option::Some("STANDARD"),
5790 Self::Enhanced => std::option::Option::Some("ENHANCED"),
5791 Self::UnknownValue(u) => u.0.name(),
5792 }
5793 }
5794 }
5795
5796 impl std::default::Default for PerformanceMonitoringUnit {
5797 fn default() -> Self {
5798 use std::convert::From;
5799 Self::from(0)
5800 }
5801 }
5802
5803 impl std::fmt::Display for PerformanceMonitoringUnit {
5804 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5805 wkt::internal::display_enum(f, self.name(), self.value())
5806 }
5807 }
5808
5809 impl std::convert::From<i32> for PerformanceMonitoringUnit {
5810 fn from(value: i32) -> Self {
5811 match value {
5812 0 => Self::Unspecified,
5813 1 => Self::Architectural,
5814 2 => Self::Standard,
5815 3 => Self::Enhanced,
5816 _ => Self::UnknownValue(performance_monitoring_unit::UnknownValue(
5817 wkt::internal::UnknownEnumValue::Integer(value),
5818 )),
5819 }
5820 }
5821 }
5822
5823 impl std::convert::From<&str> for PerformanceMonitoringUnit {
5824 fn from(value: &str) -> Self {
5825 use std::string::ToString;
5826 match value {
5827 "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED" => Self::Unspecified,
5828 "ARCHITECTURAL" => Self::Architectural,
5829 "STANDARD" => Self::Standard,
5830 "ENHANCED" => Self::Enhanced,
5831 _ => Self::UnknownValue(performance_monitoring_unit::UnknownValue(
5832 wkt::internal::UnknownEnumValue::String(value.to_string()),
5833 )),
5834 }
5835 }
5836 }
5837
5838 impl serde::ser::Serialize for PerformanceMonitoringUnit {
5839 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5840 where
5841 S: serde::Serializer,
5842 {
5843 match self {
5844 Self::Unspecified => serializer.serialize_i32(0),
5845 Self::Architectural => serializer.serialize_i32(1),
5846 Self::Standard => serializer.serialize_i32(2),
5847 Self::Enhanced => serializer.serialize_i32(3),
5848 Self::UnknownValue(u) => u.0.serialize(serializer),
5849 }
5850 }
5851 }
5852
5853 impl<'de> serde::de::Deserialize<'de> for PerformanceMonitoringUnit {
5854 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5855 where
5856 D: serde::Deserializer<'de>,
5857 {
5858 deserializer.deserialize_any(
5859 wkt::internal::EnumVisitor::<PerformanceMonitoringUnit>::new(
5860 ".google.container.v1.AdvancedMachineFeatures.PerformanceMonitoringUnit",
5861 ),
5862 )
5863 }
5864 }
5865}
5866
5867/// Parameters for node pool-level network config.
5868#[derive(Clone, Default, PartialEq)]
5869#[non_exhaustive]
5870pub struct NodeNetworkConfig {
5871 /// Input only. Whether to create a new range for pod IPs in this node pool.
5872 /// Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they
5873 /// are not specified.
5874 ///
5875 /// If neither `create_pod_range` or `pod_range` are specified, the
5876 /// cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is
5877 /// used.
5878 ///
5879 /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
5880 ///
5881 /// This field cannot be changed after the node pool has been created.
5882 pub create_pod_range: bool,
5883
5884 /// The ID of the secondary range for pod IPs.
5885 /// If `create_pod_range` is true, this ID is used for the new range.
5886 /// If `create_pod_range` is false, uses an existing secondary range with this
5887 /// ID.
5888 ///
5889 /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
5890 ///
5891 /// This field cannot be changed after the node pool has been created.
5892 pub pod_range: std::string::String,
5893
5894 /// The IP address range for pod IPs in this node pool.
5895 ///
5896 /// Only applicable if `create_pod_range` is true.
5897 ///
5898 /// Set to blank to have a range chosen with the default size.
5899 ///
5900 /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
5901 /// netmask.
5902 ///
5903 /// Set to a
5904 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
5905 /// notation (e.g. `10.96.0.0/14`) to pick a specific range to use.
5906 ///
5907 /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
5908 ///
5909 /// This field cannot be changed after the node pool has been created.
5910 pub pod_ipv4_cidr_block: std::string::String,
5911
5912 /// Whether nodes have internal IP addresses only.
5913 /// If enable_private_nodes is not specified, then the value is derived from
5914 /// [Cluster.NetworkConfig.default_enable_private_nodes][]
5915 pub enable_private_nodes: std::option::Option<bool>,
5916
5917 /// Network bandwidth tier configuration.
5918 pub network_performance_config:
5919 std::option::Option<crate::model::node_network_config::NetworkPerformanceConfig>,
5920
5921 /// [PRIVATE FIELD]
5922 /// Pod CIDR size overprovisioning config for the node pool.
5923 ///
5924 /// Pod CIDR size per node depends on max_pods_per_node. By default, the value
5925 /// of max_pods_per_node is rounded off to next power of 2 and we then double
5926 /// that to get the size of pod CIDR block per node.
5927 /// Example: max_pods_per_node of 30 would result in 64 IPs (/26).
5928 ///
5929 /// This config can disable the doubling of IPs (we still round off to next
5930 /// power of 2)
5931 /// Example: max_pods_per_node of 30 will result in 32 IPs (/27) when
5932 /// overprovisioning is disabled.
5933 pub pod_cidr_overprovision_config:
5934 std::option::Option<crate::model::PodCIDROverprovisionConfig>,
5935
5936 /// We specify the additional node networks for this node pool using this list.
5937 /// Each node network corresponds to an additional interface
5938 pub additional_node_network_configs: std::vec::Vec<crate::model::AdditionalNodeNetworkConfig>,
5939
5940 /// We specify the additional pod networks for this node pool using this list.
5941 /// Each pod network corresponds to an additional alias IP range for the node
5942 pub additional_pod_network_configs: std::vec::Vec<crate::model::AdditionalPodNetworkConfig>,
5943
5944 /// Output only. The utilization of the IPv4 range for the pod.
5945 /// The ratio is Usage/[Total number of IPs in the secondary range],
5946 /// Usage=numNodes*numZones*podIPsPerNode.
5947 pub pod_ipv4_range_utilization: f64,
5948
5949 /// Optional. The subnetwork name/path for the node pool.
5950 /// Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}
5951 /// If the cluster is associated with multiple subnetworks, the subnetwork can
5952 /// be either:
5953 ///
5954 /// - A user supplied subnetwork name during node pool creation (e.g.,
5955 /// `my-subnet`). The name must be between 1 and 63 characters long, start
5956 /// with a letter, contain only letters, numbers, and hyphens, and end with a
5957 /// letter or a number.
5958 /// - A full subnetwork path during node pool creation, such as
5959 /// `projects/gke-project/regions/us-central1/subnetworks/my-subnet`
5960 /// - A subnetwork path picked based on the IP utilization during node pool
5961 /// creation and is immutable.
5962 pub subnetwork: std::string::String,
5963
5964 /// Output only. The network tier configuration for the node pool inherits from
5965 /// the cluster-level configuration and remains immutable throughout the node
5966 /// pool's lifecycle, including during upgrades.
5967 pub network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
5968
5969 /// Immutable. The accelerator network profile for the node pool. For now the
5970 /// only valid value is "auto". If specified, the network configuration of the
5971 /// nodes in this node pool will be managed by this profile for the supported
5972 /// machine types, zone, etc.
5973 pub accelerator_network_profile: std::string::String,
5974
5975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5976}
5977
5978impl NodeNetworkConfig {
5979 /// Creates a new default instance.
5980 pub fn new() -> Self {
5981 std::default::Default::default()
5982 }
5983
5984 /// Sets the value of [create_pod_range][crate::model::NodeNetworkConfig::create_pod_range].
5985 ///
5986 /// # Example
5987 /// ```ignore,no_run
5988 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
5989 /// let x = NodeNetworkConfig::new().set_create_pod_range(true);
5990 /// ```
5991 pub fn set_create_pod_range<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5992 self.create_pod_range = v.into();
5993 self
5994 }
5995
5996 /// Sets the value of [pod_range][crate::model::NodeNetworkConfig::pod_range].
5997 ///
5998 /// # Example
5999 /// ```ignore,no_run
6000 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6001 /// let x = NodeNetworkConfig::new().set_pod_range("example");
6002 /// ```
6003 pub fn set_pod_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6004 self.pod_range = v.into();
6005 self
6006 }
6007
6008 /// Sets the value of [pod_ipv4_cidr_block][crate::model::NodeNetworkConfig::pod_ipv4_cidr_block].
6009 ///
6010 /// # Example
6011 /// ```ignore,no_run
6012 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6013 /// let x = NodeNetworkConfig::new().set_pod_ipv4_cidr_block("example");
6014 /// ```
6015 pub fn set_pod_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
6016 mut self,
6017 v: T,
6018 ) -> Self {
6019 self.pod_ipv4_cidr_block = v.into();
6020 self
6021 }
6022
6023 /// Sets the value of [enable_private_nodes][crate::model::NodeNetworkConfig::enable_private_nodes].
6024 ///
6025 /// # Example
6026 /// ```ignore,no_run
6027 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6028 /// let x = NodeNetworkConfig::new().set_enable_private_nodes(true);
6029 /// ```
6030 pub fn set_enable_private_nodes<T>(mut self, v: T) -> Self
6031 where
6032 T: std::convert::Into<bool>,
6033 {
6034 self.enable_private_nodes = std::option::Option::Some(v.into());
6035 self
6036 }
6037
6038 /// Sets or clears the value of [enable_private_nodes][crate::model::NodeNetworkConfig::enable_private_nodes].
6039 ///
6040 /// # Example
6041 /// ```ignore,no_run
6042 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6043 /// let x = NodeNetworkConfig::new().set_or_clear_enable_private_nodes(Some(false));
6044 /// let x = NodeNetworkConfig::new().set_or_clear_enable_private_nodes(None::<bool>);
6045 /// ```
6046 pub fn set_or_clear_enable_private_nodes<T>(mut self, v: std::option::Option<T>) -> Self
6047 where
6048 T: std::convert::Into<bool>,
6049 {
6050 self.enable_private_nodes = v.map(|x| x.into());
6051 self
6052 }
6053
6054 /// Sets the value of [network_performance_config][crate::model::NodeNetworkConfig::network_performance_config].
6055 ///
6056 /// # Example
6057 /// ```ignore,no_run
6058 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6059 /// use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
6060 /// let x = NodeNetworkConfig::new().set_network_performance_config(NetworkPerformanceConfig::default()/* use setters */);
6061 /// ```
6062 pub fn set_network_performance_config<T>(mut self, v: T) -> Self
6063 where
6064 T: std::convert::Into<crate::model::node_network_config::NetworkPerformanceConfig>,
6065 {
6066 self.network_performance_config = std::option::Option::Some(v.into());
6067 self
6068 }
6069
6070 /// Sets or clears the value of [network_performance_config][crate::model::NodeNetworkConfig::network_performance_config].
6071 ///
6072 /// # Example
6073 /// ```ignore,no_run
6074 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6075 /// use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
6076 /// let x = NodeNetworkConfig::new().set_or_clear_network_performance_config(Some(NetworkPerformanceConfig::default()/* use setters */));
6077 /// let x = NodeNetworkConfig::new().set_or_clear_network_performance_config(None::<NetworkPerformanceConfig>);
6078 /// ```
6079 pub fn set_or_clear_network_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
6080 where
6081 T: std::convert::Into<crate::model::node_network_config::NetworkPerformanceConfig>,
6082 {
6083 self.network_performance_config = v.map(|x| x.into());
6084 self
6085 }
6086
6087 /// Sets the value of [pod_cidr_overprovision_config][crate::model::NodeNetworkConfig::pod_cidr_overprovision_config].
6088 ///
6089 /// # Example
6090 /// ```ignore,no_run
6091 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6092 /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
6093 /// let x = NodeNetworkConfig::new().set_pod_cidr_overprovision_config(PodCIDROverprovisionConfig::default()/* use setters */);
6094 /// ```
6095 pub fn set_pod_cidr_overprovision_config<T>(mut self, v: T) -> Self
6096 where
6097 T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
6098 {
6099 self.pod_cidr_overprovision_config = std::option::Option::Some(v.into());
6100 self
6101 }
6102
6103 /// Sets or clears the value of [pod_cidr_overprovision_config][crate::model::NodeNetworkConfig::pod_cidr_overprovision_config].
6104 ///
6105 /// # Example
6106 /// ```ignore,no_run
6107 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6108 /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
6109 /// let x = NodeNetworkConfig::new().set_or_clear_pod_cidr_overprovision_config(Some(PodCIDROverprovisionConfig::default()/* use setters */));
6110 /// let x = NodeNetworkConfig::new().set_or_clear_pod_cidr_overprovision_config(None::<PodCIDROverprovisionConfig>);
6111 /// ```
6112 pub fn set_or_clear_pod_cidr_overprovision_config<T>(
6113 mut self,
6114 v: std::option::Option<T>,
6115 ) -> Self
6116 where
6117 T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
6118 {
6119 self.pod_cidr_overprovision_config = v.map(|x| x.into());
6120 self
6121 }
6122
6123 /// Sets the value of [additional_node_network_configs][crate::model::NodeNetworkConfig::additional_node_network_configs].
6124 ///
6125 /// # Example
6126 /// ```ignore,no_run
6127 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6128 /// use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
6129 /// let x = NodeNetworkConfig::new()
6130 /// .set_additional_node_network_configs([
6131 /// AdditionalNodeNetworkConfig::default()/* use setters */,
6132 /// AdditionalNodeNetworkConfig::default()/* use (different) setters */,
6133 /// ]);
6134 /// ```
6135 pub fn set_additional_node_network_configs<T, V>(mut self, v: T) -> Self
6136 where
6137 T: std::iter::IntoIterator<Item = V>,
6138 V: std::convert::Into<crate::model::AdditionalNodeNetworkConfig>,
6139 {
6140 use std::iter::Iterator;
6141 self.additional_node_network_configs = v.into_iter().map(|i| i.into()).collect();
6142 self
6143 }
6144
6145 /// Sets the value of [additional_pod_network_configs][crate::model::NodeNetworkConfig::additional_pod_network_configs].
6146 ///
6147 /// # Example
6148 /// ```ignore,no_run
6149 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6150 /// use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
6151 /// let x = NodeNetworkConfig::new()
6152 /// .set_additional_pod_network_configs([
6153 /// AdditionalPodNetworkConfig::default()/* use setters */,
6154 /// AdditionalPodNetworkConfig::default()/* use (different) setters */,
6155 /// ]);
6156 /// ```
6157 pub fn set_additional_pod_network_configs<T, V>(mut self, v: T) -> Self
6158 where
6159 T: std::iter::IntoIterator<Item = V>,
6160 V: std::convert::Into<crate::model::AdditionalPodNetworkConfig>,
6161 {
6162 use std::iter::Iterator;
6163 self.additional_pod_network_configs = v.into_iter().map(|i| i.into()).collect();
6164 self
6165 }
6166
6167 /// Sets the value of [pod_ipv4_range_utilization][crate::model::NodeNetworkConfig::pod_ipv4_range_utilization].
6168 ///
6169 /// # Example
6170 /// ```ignore,no_run
6171 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6172 /// let x = NodeNetworkConfig::new().set_pod_ipv4_range_utilization(42.0);
6173 /// ```
6174 pub fn set_pod_ipv4_range_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6175 self.pod_ipv4_range_utilization = v.into();
6176 self
6177 }
6178
6179 /// Sets the value of [subnetwork][crate::model::NodeNetworkConfig::subnetwork].
6180 ///
6181 /// # Example
6182 /// ```ignore,no_run
6183 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6184 /// let x = NodeNetworkConfig::new().set_subnetwork("example");
6185 /// ```
6186 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6187 self.subnetwork = v.into();
6188 self
6189 }
6190
6191 /// Sets the value of [network_tier_config][crate::model::NodeNetworkConfig::network_tier_config].
6192 ///
6193 /// # Example
6194 /// ```ignore,no_run
6195 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6196 /// use google_cloud_container_v1::model::NetworkTierConfig;
6197 /// let x = NodeNetworkConfig::new().set_network_tier_config(NetworkTierConfig::default()/* use setters */);
6198 /// ```
6199 pub fn set_network_tier_config<T>(mut self, v: T) -> Self
6200 where
6201 T: std::convert::Into<crate::model::NetworkTierConfig>,
6202 {
6203 self.network_tier_config = std::option::Option::Some(v.into());
6204 self
6205 }
6206
6207 /// Sets or clears the value of [network_tier_config][crate::model::NodeNetworkConfig::network_tier_config].
6208 ///
6209 /// # Example
6210 /// ```ignore,no_run
6211 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6212 /// use google_cloud_container_v1::model::NetworkTierConfig;
6213 /// let x = NodeNetworkConfig::new().set_or_clear_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
6214 /// let x = NodeNetworkConfig::new().set_or_clear_network_tier_config(None::<NetworkTierConfig>);
6215 /// ```
6216 pub fn set_or_clear_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
6217 where
6218 T: std::convert::Into<crate::model::NetworkTierConfig>,
6219 {
6220 self.network_tier_config = v.map(|x| x.into());
6221 self
6222 }
6223
6224 /// Sets the value of [accelerator_network_profile][crate::model::NodeNetworkConfig::accelerator_network_profile].
6225 ///
6226 /// # Example
6227 /// ```ignore,no_run
6228 /// # use google_cloud_container_v1::model::NodeNetworkConfig;
6229 /// let x = NodeNetworkConfig::new().set_accelerator_network_profile("example");
6230 /// ```
6231 pub fn set_accelerator_network_profile<T: std::convert::Into<std::string::String>>(
6232 mut self,
6233 v: T,
6234 ) -> Self {
6235 self.accelerator_network_profile = v.into();
6236 self
6237 }
6238}
6239
6240impl wkt::message::Message for NodeNetworkConfig {
6241 fn typename() -> &'static str {
6242 "type.googleapis.com/google.container.v1.NodeNetworkConfig"
6243 }
6244}
6245
6246/// Defines additional types related to [NodeNetworkConfig].
6247pub mod node_network_config {
6248 #[allow(unused_imports)]
6249 use super::*;
6250
6251 /// Configuration of all network bandwidth tiers
6252 #[derive(Clone, Default, PartialEq)]
6253 #[non_exhaustive]
6254 pub struct NetworkPerformanceConfig {
6255 /// Specifies the total network bandwidth tier for the NodePool.
6256 pub total_egress_bandwidth_tier: std::option::Option<
6257 crate::model::node_network_config::network_performance_config::Tier,
6258 >,
6259
6260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6261 }
6262
6263 impl NetworkPerformanceConfig {
6264 /// Creates a new default instance.
6265 pub fn new() -> Self {
6266 std::default::Default::default()
6267 }
6268
6269 /// Sets the value of [total_egress_bandwidth_tier][crate::model::node_network_config::NetworkPerformanceConfig::total_egress_bandwidth_tier].
6270 ///
6271 /// # Example
6272 /// ```ignore,no_run
6273 /// # use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
6274 /// use google_cloud_container_v1::model::node_network_config::network_performance_config::Tier;
6275 /// let x0 = NetworkPerformanceConfig::new().set_total_egress_bandwidth_tier(Tier::Tier1);
6276 /// ```
6277 pub fn set_total_egress_bandwidth_tier<T>(mut self, v: T) -> Self
6278 where
6279 T: std::convert::Into<
6280 crate::model::node_network_config::network_performance_config::Tier,
6281 >,
6282 {
6283 self.total_egress_bandwidth_tier = std::option::Option::Some(v.into());
6284 self
6285 }
6286
6287 /// Sets or clears the value of [total_egress_bandwidth_tier][crate::model::node_network_config::NetworkPerformanceConfig::total_egress_bandwidth_tier].
6288 ///
6289 /// # Example
6290 /// ```ignore,no_run
6291 /// # use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
6292 /// use google_cloud_container_v1::model::node_network_config::network_performance_config::Tier;
6293 /// let x0 = NetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(Some(Tier::Tier1));
6294 /// let x_none = NetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(None::<Tier>);
6295 /// ```
6296 pub fn set_or_clear_total_egress_bandwidth_tier<T>(
6297 mut self,
6298 v: std::option::Option<T>,
6299 ) -> Self
6300 where
6301 T: std::convert::Into<
6302 crate::model::node_network_config::network_performance_config::Tier,
6303 >,
6304 {
6305 self.total_egress_bandwidth_tier = v.map(|x| x.into());
6306 self
6307 }
6308 }
6309
6310 impl wkt::message::Message for NetworkPerformanceConfig {
6311 fn typename() -> &'static str {
6312 "type.googleapis.com/google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig"
6313 }
6314 }
6315
6316 /// Defines additional types related to [NetworkPerformanceConfig].
6317 pub mod network_performance_config {
6318 #[allow(unused_imports)]
6319 use super::*;
6320
6321 /// Node network tier
6322 ///
6323 /// # Working with unknown values
6324 ///
6325 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6326 /// additional enum variants at any time. Adding new variants is not considered
6327 /// a breaking change. Applications should write their code in anticipation of:
6328 ///
6329 /// - New values appearing in future releases of the client library, **and**
6330 /// - New values received dynamically, without application changes.
6331 ///
6332 /// Please consult the [Working with enums] section in the user guide for some
6333 /// guidelines.
6334 ///
6335 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6336 #[derive(Clone, Debug, PartialEq)]
6337 #[non_exhaustive]
6338 pub enum Tier {
6339 /// Default value
6340 Unspecified,
6341 /// Higher bandwidth, actual values based on VM size.
6342 Tier1,
6343 /// If set, the enum was initialized with an unknown value.
6344 ///
6345 /// Applications can examine the value using [Tier::value] or
6346 /// [Tier::name].
6347 UnknownValue(tier::UnknownValue),
6348 }
6349
6350 #[doc(hidden)]
6351 pub mod tier {
6352 #[allow(unused_imports)]
6353 use super::*;
6354 #[derive(Clone, Debug, PartialEq)]
6355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6356 }
6357
6358 impl Tier {
6359 /// Gets the enum value.
6360 ///
6361 /// Returns `None` if the enum contains an unknown value deserialized from
6362 /// the string representation of enums.
6363 pub fn value(&self) -> std::option::Option<i32> {
6364 match self {
6365 Self::Unspecified => std::option::Option::Some(0),
6366 Self::Tier1 => std::option::Option::Some(1),
6367 Self::UnknownValue(u) => u.0.value(),
6368 }
6369 }
6370
6371 /// Gets the enum value as a string.
6372 ///
6373 /// Returns `None` if the enum contains an unknown value deserialized from
6374 /// the integer representation of enums.
6375 pub fn name(&self) -> std::option::Option<&str> {
6376 match self {
6377 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
6378 Self::Tier1 => std::option::Option::Some("TIER_1"),
6379 Self::UnknownValue(u) => u.0.name(),
6380 }
6381 }
6382 }
6383
6384 impl std::default::Default for Tier {
6385 fn default() -> Self {
6386 use std::convert::From;
6387 Self::from(0)
6388 }
6389 }
6390
6391 impl std::fmt::Display for Tier {
6392 fn fmt(
6393 &self,
6394 f: &mut std::fmt::Formatter<'_>,
6395 ) -> std::result::Result<(), std::fmt::Error> {
6396 wkt::internal::display_enum(f, self.name(), self.value())
6397 }
6398 }
6399
6400 impl std::convert::From<i32> for Tier {
6401 fn from(value: i32) -> Self {
6402 match value {
6403 0 => Self::Unspecified,
6404 1 => Self::Tier1,
6405 _ => Self::UnknownValue(tier::UnknownValue(
6406 wkt::internal::UnknownEnumValue::Integer(value),
6407 )),
6408 }
6409 }
6410 }
6411
6412 impl std::convert::From<&str> for Tier {
6413 fn from(value: &str) -> Self {
6414 use std::string::ToString;
6415 match value {
6416 "TIER_UNSPECIFIED" => Self::Unspecified,
6417 "TIER_1" => Self::Tier1,
6418 _ => Self::UnknownValue(tier::UnknownValue(
6419 wkt::internal::UnknownEnumValue::String(value.to_string()),
6420 )),
6421 }
6422 }
6423 }
6424
6425 impl serde::ser::Serialize for Tier {
6426 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6427 where
6428 S: serde::Serializer,
6429 {
6430 match self {
6431 Self::Unspecified => serializer.serialize_i32(0),
6432 Self::Tier1 => serializer.serialize_i32(1),
6433 Self::UnknownValue(u) => u.0.serialize(serializer),
6434 }
6435 }
6436 }
6437
6438 impl<'de> serde::de::Deserialize<'de> for Tier {
6439 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6440 where
6441 D: serde::Deserializer<'de>,
6442 {
6443 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
6444 ".google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig.Tier",
6445 ))
6446 }
6447 }
6448 }
6449}
6450
6451/// AdditionalNodeNetworkConfig is the configuration for additional node networks
6452/// within the NodeNetworkConfig message
6453#[derive(Clone, Default, PartialEq)]
6454#[non_exhaustive]
6455pub struct AdditionalNodeNetworkConfig {
6456 /// Name of the VPC where the additional interface belongs
6457 pub network: std::string::String,
6458
6459 /// Name of the subnetwork where the additional interface belongs
6460 pub subnetwork: std::string::String,
6461
6462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6463}
6464
6465impl AdditionalNodeNetworkConfig {
6466 /// Creates a new default instance.
6467 pub fn new() -> Self {
6468 std::default::Default::default()
6469 }
6470
6471 /// Sets the value of [network][crate::model::AdditionalNodeNetworkConfig::network].
6472 ///
6473 /// # Example
6474 /// ```ignore,no_run
6475 /// # use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
6476 /// let x = AdditionalNodeNetworkConfig::new().set_network("example");
6477 /// ```
6478 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6479 self.network = v.into();
6480 self
6481 }
6482
6483 /// Sets the value of [subnetwork][crate::model::AdditionalNodeNetworkConfig::subnetwork].
6484 ///
6485 /// # Example
6486 /// ```ignore,no_run
6487 /// # use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
6488 /// let x = AdditionalNodeNetworkConfig::new().set_subnetwork("example");
6489 /// ```
6490 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491 self.subnetwork = v.into();
6492 self
6493 }
6494}
6495
6496impl wkt::message::Message for AdditionalNodeNetworkConfig {
6497 fn typename() -> &'static str {
6498 "type.googleapis.com/google.container.v1.AdditionalNodeNetworkConfig"
6499 }
6500}
6501
6502/// AdditionalPodNetworkConfig is the configuration for additional pod networks
6503/// within the NodeNetworkConfig message
6504#[derive(Clone, Default, PartialEq)]
6505#[non_exhaustive]
6506pub struct AdditionalPodNetworkConfig {
6507 /// Name of the subnetwork where the additional pod network belongs.
6508 pub subnetwork: std::string::String,
6509
6510 /// The name of the secondary range on the subnet which provides IP address for
6511 /// this pod range.
6512 pub secondary_pod_range: std::string::String,
6513
6514 /// The maximum number of pods per node which use this pod network.
6515 pub max_pods_per_node: std::option::Option<crate::model::MaxPodsConstraint>,
6516
6517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6518}
6519
6520impl AdditionalPodNetworkConfig {
6521 /// Creates a new default instance.
6522 pub fn new() -> Self {
6523 std::default::Default::default()
6524 }
6525
6526 /// Sets the value of [subnetwork][crate::model::AdditionalPodNetworkConfig::subnetwork].
6527 ///
6528 /// # Example
6529 /// ```ignore,no_run
6530 /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
6531 /// let x = AdditionalPodNetworkConfig::new().set_subnetwork("example");
6532 /// ```
6533 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6534 self.subnetwork = v.into();
6535 self
6536 }
6537
6538 /// Sets the value of [secondary_pod_range][crate::model::AdditionalPodNetworkConfig::secondary_pod_range].
6539 ///
6540 /// # Example
6541 /// ```ignore,no_run
6542 /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
6543 /// let x = AdditionalPodNetworkConfig::new().set_secondary_pod_range("example");
6544 /// ```
6545 pub fn set_secondary_pod_range<T: std::convert::Into<std::string::String>>(
6546 mut self,
6547 v: T,
6548 ) -> Self {
6549 self.secondary_pod_range = v.into();
6550 self
6551 }
6552
6553 /// Sets the value of [max_pods_per_node][crate::model::AdditionalPodNetworkConfig::max_pods_per_node].
6554 ///
6555 /// # Example
6556 /// ```ignore,no_run
6557 /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
6558 /// use google_cloud_container_v1::model::MaxPodsConstraint;
6559 /// let x = AdditionalPodNetworkConfig::new().set_max_pods_per_node(MaxPodsConstraint::default()/* use setters */);
6560 /// ```
6561 pub fn set_max_pods_per_node<T>(mut self, v: T) -> Self
6562 where
6563 T: std::convert::Into<crate::model::MaxPodsConstraint>,
6564 {
6565 self.max_pods_per_node = std::option::Option::Some(v.into());
6566 self
6567 }
6568
6569 /// Sets or clears the value of [max_pods_per_node][crate::model::AdditionalPodNetworkConfig::max_pods_per_node].
6570 ///
6571 /// # Example
6572 /// ```ignore,no_run
6573 /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
6574 /// use google_cloud_container_v1::model::MaxPodsConstraint;
6575 /// let x = AdditionalPodNetworkConfig::new().set_or_clear_max_pods_per_node(Some(MaxPodsConstraint::default()/* use setters */));
6576 /// let x = AdditionalPodNetworkConfig::new().set_or_clear_max_pods_per_node(None::<MaxPodsConstraint>);
6577 /// ```
6578 pub fn set_or_clear_max_pods_per_node<T>(mut self, v: std::option::Option<T>) -> Self
6579 where
6580 T: std::convert::Into<crate::model::MaxPodsConstraint>,
6581 {
6582 self.max_pods_per_node = v.map(|x| x.into());
6583 self
6584 }
6585}
6586
6587impl wkt::message::Message for AdditionalPodNetworkConfig {
6588 fn typename() -> &'static str {
6589 "type.googleapis.com/google.container.v1.AdditionalPodNetworkConfig"
6590 }
6591}
6592
6593/// A set of Shielded Instance options.
6594#[derive(Clone, Default, PartialEq)]
6595#[non_exhaustive]
6596pub struct ShieldedInstanceConfig {
6597 /// Defines whether the instance has Secure Boot enabled.
6598 ///
6599 /// Secure Boot helps ensure that the system only runs authentic software by
6600 /// verifying the digital signature of all boot components, and halting the
6601 /// boot process if signature verification fails.
6602 pub enable_secure_boot: bool,
6603
6604 /// Defines whether the instance has integrity monitoring enabled.
6605 ///
6606 /// Enables monitoring and attestation of the boot integrity of the instance.
6607 /// The attestation is performed against the integrity policy baseline. This
6608 /// baseline is initially derived from the implicitly trusted boot image when
6609 /// the instance is created.
6610 pub enable_integrity_monitoring: bool,
6611
6612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6613}
6614
6615impl ShieldedInstanceConfig {
6616 /// Creates a new default instance.
6617 pub fn new() -> Self {
6618 std::default::Default::default()
6619 }
6620
6621 /// Sets the value of [enable_secure_boot][crate::model::ShieldedInstanceConfig::enable_secure_boot].
6622 ///
6623 /// # Example
6624 /// ```ignore,no_run
6625 /// # use google_cloud_container_v1::model::ShieldedInstanceConfig;
6626 /// let x = ShieldedInstanceConfig::new().set_enable_secure_boot(true);
6627 /// ```
6628 pub fn set_enable_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6629 self.enable_secure_boot = v.into();
6630 self
6631 }
6632
6633 /// Sets the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
6634 ///
6635 /// # Example
6636 /// ```ignore,no_run
6637 /// # use google_cloud_container_v1::model::ShieldedInstanceConfig;
6638 /// let x = ShieldedInstanceConfig::new().set_enable_integrity_monitoring(true);
6639 /// ```
6640 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6641 self.enable_integrity_monitoring = v.into();
6642 self
6643 }
6644}
6645
6646impl wkt::message::Message for ShieldedInstanceConfig {
6647 fn typename() -> &'static str {
6648 "type.googleapis.com/google.container.v1.ShieldedInstanceConfig"
6649 }
6650}
6651
6652/// CustomImageConfig contains the information r
6653#[derive(Clone, Default, PartialEq)]
6654#[non_exhaustive]
6655pub struct CustomImageConfig {
6656 /// The name of the image to use for this node.
6657 pub image: std::string::String,
6658
6659 /// The project containing the image to use for this node.
6660 pub image_project: std::string::String,
6661
6662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6663}
6664
6665impl CustomImageConfig {
6666 /// Creates a new default instance.
6667 pub fn new() -> Self {
6668 std::default::Default::default()
6669 }
6670
6671 /// Sets the value of [image][crate::model::CustomImageConfig::image].
6672 ///
6673 /// # Example
6674 /// ```ignore,no_run
6675 /// # use google_cloud_container_v1::model::CustomImageConfig;
6676 /// let x = CustomImageConfig::new().set_image("example");
6677 /// ```
6678 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6679 self.image = v.into();
6680 self
6681 }
6682
6683 /// Sets the value of [image_project][crate::model::CustomImageConfig::image_project].
6684 ///
6685 /// # Example
6686 /// ```ignore,no_run
6687 /// # use google_cloud_container_v1::model::CustomImageConfig;
6688 /// let x = CustomImageConfig::new().set_image_project("example");
6689 /// ```
6690 pub fn set_image_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6691 self.image_project = v.into();
6692 self
6693 }
6694}
6695
6696impl wkt::message::Message for CustomImageConfig {
6697 fn typename() -> &'static str {
6698 "type.googleapis.com/google.container.v1.CustomImageConfig"
6699 }
6700}
6701
6702/// SandboxConfig contains configurations of the sandbox to use for the node.
6703#[derive(Clone, Default, PartialEq)]
6704#[non_exhaustive]
6705pub struct SandboxConfig {
6706 /// Type of the sandbox to use for the node.
6707 pub r#type: crate::model::sandbox_config::Type,
6708
6709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6710}
6711
6712impl SandboxConfig {
6713 /// Creates a new default instance.
6714 pub fn new() -> Self {
6715 std::default::Default::default()
6716 }
6717
6718 /// Sets the value of [r#type][crate::model::SandboxConfig::type].
6719 ///
6720 /// # Example
6721 /// ```ignore,no_run
6722 /// # use google_cloud_container_v1::model::SandboxConfig;
6723 /// use google_cloud_container_v1::model::sandbox_config::Type;
6724 /// let x0 = SandboxConfig::new().set_type(Type::Gvisor);
6725 /// ```
6726 pub fn set_type<T: std::convert::Into<crate::model::sandbox_config::Type>>(
6727 mut self,
6728 v: T,
6729 ) -> Self {
6730 self.r#type = v.into();
6731 self
6732 }
6733}
6734
6735impl wkt::message::Message for SandboxConfig {
6736 fn typename() -> &'static str {
6737 "type.googleapis.com/google.container.v1.SandboxConfig"
6738 }
6739}
6740
6741/// Defines additional types related to [SandboxConfig].
6742pub mod sandbox_config {
6743 #[allow(unused_imports)]
6744 use super::*;
6745
6746 /// Possible types of sandboxes.
6747 ///
6748 /// # Working with unknown values
6749 ///
6750 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6751 /// additional enum variants at any time. Adding new variants is not considered
6752 /// a breaking change. Applications should write their code in anticipation of:
6753 ///
6754 /// - New values appearing in future releases of the client library, **and**
6755 /// - New values received dynamically, without application changes.
6756 ///
6757 /// Please consult the [Working with enums] section in the user guide for some
6758 /// guidelines.
6759 ///
6760 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6761 #[derive(Clone, Debug, PartialEq)]
6762 #[non_exhaustive]
6763 pub enum Type {
6764 /// Default value. This should not be used.
6765 Unspecified,
6766 /// Run sandbox using gvisor.
6767 Gvisor,
6768 /// If set, the enum was initialized with an unknown value.
6769 ///
6770 /// Applications can examine the value using [Type::value] or
6771 /// [Type::name].
6772 UnknownValue(r#type::UnknownValue),
6773 }
6774
6775 #[doc(hidden)]
6776 pub mod r#type {
6777 #[allow(unused_imports)]
6778 use super::*;
6779 #[derive(Clone, Debug, PartialEq)]
6780 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6781 }
6782
6783 impl Type {
6784 /// Gets the enum value.
6785 ///
6786 /// Returns `None` if the enum contains an unknown value deserialized from
6787 /// the string representation of enums.
6788 pub fn value(&self) -> std::option::Option<i32> {
6789 match self {
6790 Self::Unspecified => std::option::Option::Some(0),
6791 Self::Gvisor => std::option::Option::Some(1),
6792 Self::UnknownValue(u) => u.0.value(),
6793 }
6794 }
6795
6796 /// Gets the enum value as a string.
6797 ///
6798 /// Returns `None` if the enum contains an unknown value deserialized from
6799 /// the integer representation of enums.
6800 pub fn name(&self) -> std::option::Option<&str> {
6801 match self {
6802 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
6803 Self::Gvisor => std::option::Option::Some("GVISOR"),
6804 Self::UnknownValue(u) => u.0.name(),
6805 }
6806 }
6807 }
6808
6809 impl std::default::Default for Type {
6810 fn default() -> Self {
6811 use std::convert::From;
6812 Self::from(0)
6813 }
6814 }
6815
6816 impl std::fmt::Display for Type {
6817 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6818 wkt::internal::display_enum(f, self.name(), self.value())
6819 }
6820 }
6821
6822 impl std::convert::From<i32> for Type {
6823 fn from(value: i32) -> Self {
6824 match value {
6825 0 => Self::Unspecified,
6826 1 => Self::Gvisor,
6827 _ => Self::UnknownValue(r#type::UnknownValue(
6828 wkt::internal::UnknownEnumValue::Integer(value),
6829 )),
6830 }
6831 }
6832 }
6833
6834 impl std::convert::From<&str> for Type {
6835 fn from(value: &str) -> Self {
6836 use std::string::ToString;
6837 match value {
6838 "UNSPECIFIED" => Self::Unspecified,
6839 "GVISOR" => Self::Gvisor,
6840 _ => Self::UnknownValue(r#type::UnknownValue(
6841 wkt::internal::UnknownEnumValue::String(value.to_string()),
6842 )),
6843 }
6844 }
6845 }
6846
6847 impl serde::ser::Serialize for Type {
6848 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6849 where
6850 S: serde::Serializer,
6851 {
6852 match self {
6853 Self::Unspecified => serializer.serialize_i32(0),
6854 Self::Gvisor => serializer.serialize_i32(1),
6855 Self::UnknownValue(u) => u.0.serialize(serializer),
6856 }
6857 }
6858 }
6859
6860 impl<'de> serde::de::Deserialize<'de> for Type {
6861 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6862 where
6863 D: serde::Deserializer<'de>,
6864 {
6865 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6866 ".google.container.v1.SandboxConfig.Type",
6867 ))
6868 }
6869 }
6870}
6871
6872/// GcfsConfig contains configurations of Google Container File System
6873/// (image streaming).
6874#[derive(Clone, Default, PartialEq)]
6875#[non_exhaustive]
6876pub struct GcfsConfig {
6877 /// Whether to use GCFS.
6878 pub enabled: bool,
6879
6880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6881}
6882
6883impl GcfsConfig {
6884 /// Creates a new default instance.
6885 pub fn new() -> Self {
6886 std::default::Default::default()
6887 }
6888
6889 /// Sets the value of [enabled][crate::model::GcfsConfig::enabled].
6890 ///
6891 /// # Example
6892 /// ```ignore,no_run
6893 /// # use google_cloud_container_v1::model::GcfsConfig;
6894 /// let x = GcfsConfig::new().set_enabled(true);
6895 /// ```
6896 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6897 self.enabled = v.into();
6898 self
6899 }
6900}
6901
6902impl wkt::message::Message for GcfsConfig {
6903 fn typename() -> &'static str {
6904 "type.googleapis.com/google.container.v1.GcfsConfig"
6905 }
6906}
6907
6908/// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
6909/// is the configuration of desired reservation which instances could take
6910/// capacity from.
6911#[derive(Clone, Default, PartialEq)]
6912#[non_exhaustive]
6913pub struct ReservationAffinity {
6914 /// Corresponds to the type of reservation consumption.
6915 pub consume_reservation_type: crate::model::reservation_affinity::Type,
6916
6917 /// Corresponds to the label key of a reservation resource. To target a
6918 /// SPECIFIC_RESERVATION by name, specify
6919 /// "compute.googleapis.com/reservation-name" as the key and specify the name
6920 /// of your reservation as its value.
6921 pub key: std::string::String,
6922
6923 /// Corresponds to the label value(s) of reservation resource(s).
6924 pub values: std::vec::Vec<std::string::String>,
6925
6926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6927}
6928
6929impl ReservationAffinity {
6930 /// Creates a new default instance.
6931 pub fn new() -> Self {
6932 std::default::Default::default()
6933 }
6934
6935 /// Sets the value of [consume_reservation_type][crate::model::ReservationAffinity::consume_reservation_type].
6936 ///
6937 /// # Example
6938 /// ```ignore,no_run
6939 /// # use google_cloud_container_v1::model::ReservationAffinity;
6940 /// use google_cloud_container_v1::model::reservation_affinity::Type;
6941 /// let x0 = ReservationAffinity::new().set_consume_reservation_type(Type::NoReservation);
6942 /// let x1 = ReservationAffinity::new().set_consume_reservation_type(Type::AnyReservation);
6943 /// let x2 = ReservationAffinity::new().set_consume_reservation_type(Type::SpecificReservation);
6944 /// ```
6945 pub fn set_consume_reservation_type<
6946 T: std::convert::Into<crate::model::reservation_affinity::Type>,
6947 >(
6948 mut self,
6949 v: T,
6950 ) -> Self {
6951 self.consume_reservation_type = v.into();
6952 self
6953 }
6954
6955 /// Sets the value of [key][crate::model::ReservationAffinity::key].
6956 ///
6957 /// # Example
6958 /// ```ignore,no_run
6959 /// # use google_cloud_container_v1::model::ReservationAffinity;
6960 /// let x = ReservationAffinity::new().set_key("example");
6961 /// ```
6962 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6963 self.key = v.into();
6964 self
6965 }
6966
6967 /// Sets the value of [values][crate::model::ReservationAffinity::values].
6968 ///
6969 /// # Example
6970 /// ```ignore,no_run
6971 /// # use google_cloud_container_v1::model::ReservationAffinity;
6972 /// let x = ReservationAffinity::new().set_values(["a", "b", "c"]);
6973 /// ```
6974 pub fn set_values<T, V>(mut self, v: T) -> Self
6975 where
6976 T: std::iter::IntoIterator<Item = V>,
6977 V: std::convert::Into<std::string::String>,
6978 {
6979 use std::iter::Iterator;
6980 self.values = v.into_iter().map(|i| i.into()).collect();
6981 self
6982 }
6983}
6984
6985impl wkt::message::Message for ReservationAffinity {
6986 fn typename() -> &'static str {
6987 "type.googleapis.com/google.container.v1.ReservationAffinity"
6988 }
6989}
6990
6991/// Defines additional types related to [ReservationAffinity].
6992pub mod reservation_affinity {
6993 #[allow(unused_imports)]
6994 use super::*;
6995
6996 /// Indicates whether to consume capacity from a reservation or not.
6997 ///
6998 /// # Working with unknown values
6999 ///
7000 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7001 /// additional enum variants at any time. Adding new variants is not considered
7002 /// a breaking change. Applications should write their code in anticipation of:
7003 ///
7004 /// - New values appearing in future releases of the client library, **and**
7005 /// - New values received dynamically, without application changes.
7006 ///
7007 /// Please consult the [Working with enums] section in the user guide for some
7008 /// guidelines.
7009 ///
7010 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7011 #[derive(Clone, Debug, PartialEq)]
7012 #[non_exhaustive]
7013 pub enum Type {
7014 /// Default value. This should not be used.
7015 Unspecified,
7016 /// Do not consume from any reserved capacity.
7017 NoReservation,
7018 /// Consume any reservation available.
7019 AnyReservation,
7020 /// Must consume from a specific reservation. Must specify key value fields
7021 /// for specifying the reservations.
7022 SpecificReservation,
7023 /// If set, the enum was initialized with an unknown value.
7024 ///
7025 /// Applications can examine the value using [Type::value] or
7026 /// [Type::name].
7027 UnknownValue(r#type::UnknownValue),
7028 }
7029
7030 #[doc(hidden)]
7031 pub mod r#type {
7032 #[allow(unused_imports)]
7033 use super::*;
7034 #[derive(Clone, Debug, PartialEq)]
7035 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7036 }
7037
7038 impl Type {
7039 /// Gets the enum value.
7040 ///
7041 /// Returns `None` if the enum contains an unknown value deserialized from
7042 /// the string representation of enums.
7043 pub fn value(&self) -> std::option::Option<i32> {
7044 match self {
7045 Self::Unspecified => std::option::Option::Some(0),
7046 Self::NoReservation => std::option::Option::Some(1),
7047 Self::AnyReservation => std::option::Option::Some(2),
7048 Self::SpecificReservation => std::option::Option::Some(3),
7049 Self::UnknownValue(u) => u.0.value(),
7050 }
7051 }
7052
7053 /// Gets the enum value as a string.
7054 ///
7055 /// Returns `None` if the enum contains an unknown value deserialized from
7056 /// the integer representation of enums.
7057 pub fn name(&self) -> std::option::Option<&str> {
7058 match self {
7059 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
7060 Self::NoReservation => std::option::Option::Some("NO_RESERVATION"),
7061 Self::AnyReservation => std::option::Option::Some("ANY_RESERVATION"),
7062 Self::SpecificReservation => std::option::Option::Some("SPECIFIC_RESERVATION"),
7063 Self::UnknownValue(u) => u.0.name(),
7064 }
7065 }
7066 }
7067
7068 impl std::default::Default for Type {
7069 fn default() -> Self {
7070 use std::convert::From;
7071 Self::from(0)
7072 }
7073 }
7074
7075 impl std::fmt::Display for Type {
7076 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7077 wkt::internal::display_enum(f, self.name(), self.value())
7078 }
7079 }
7080
7081 impl std::convert::From<i32> for Type {
7082 fn from(value: i32) -> Self {
7083 match value {
7084 0 => Self::Unspecified,
7085 1 => Self::NoReservation,
7086 2 => Self::AnyReservation,
7087 3 => Self::SpecificReservation,
7088 _ => Self::UnknownValue(r#type::UnknownValue(
7089 wkt::internal::UnknownEnumValue::Integer(value),
7090 )),
7091 }
7092 }
7093 }
7094
7095 impl std::convert::From<&str> for Type {
7096 fn from(value: &str) -> Self {
7097 use std::string::ToString;
7098 match value {
7099 "UNSPECIFIED" => Self::Unspecified,
7100 "NO_RESERVATION" => Self::NoReservation,
7101 "ANY_RESERVATION" => Self::AnyReservation,
7102 "SPECIFIC_RESERVATION" => Self::SpecificReservation,
7103 _ => Self::UnknownValue(r#type::UnknownValue(
7104 wkt::internal::UnknownEnumValue::String(value.to_string()),
7105 )),
7106 }
7107 }
7108 }
7109
7110 impl serde::ser::Serialize for Type {
7111 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7112 where
7113 S: serde::Serializer,
7114 {
7115 match self {
7116 Self::Unspecified => serializer.serialize_i32(0),
7117 Self::NoReservation => serializer.serialize_i32(1),
7118 Self::AnyReservation => serializer.serialize_i32(2),
7119 Self::SpecificReservation => serializer.serialize_i32(3),
7120 Self::UnknownValue(u) => u.0.serialize(serializer),
7121 }
7122 }
7123 }
7124
7125 impl<'de> serde::de::Deserialize<'de> for Type {
7126 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7127 where
7128 D: serde::Deserializer<'de>,
7129 {
7130 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7131 ".google.container.v1.ReservationAffinity.Type",
7132 ))
7133 }
7134 }
7135}
7136
7137/// SoleTenantConfig contains the NodeAffinities to specify what shared sole
7138/// tenant node groups should back the node pool.
7139#[derive(Clone, Default, PartialEq)]
7140#[non_exhaustive]
7141pub struct SoleTenantConfig {
7142 /// NodeAffinities used to match to a shared sole tenant node group.
7143 pub node_affinities: std::vec::Vec<crate::model::sole_tenant_config::NodeAffinity>,
7144
7145 /// Optional. The minimum number of virtual CPUs this instance will consume
7146 /// when running on a sole-tenant node. This field can only be set if the node
7147 /// pool is created in a shared sole-tenant node group.
7148 pub min_node_cpus: std::option::Option<i32>,
7149
7150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7151}
7152
7153impl SoleTenantConfig {
7154 /// Creates a new default instance.
7155 pub fn new() -> Self {
7156 std::default::Default::default()
7157 }
7158
7159 /// Sets the value of [node_affinities][crate::model::SoleTenantConfig::node_affinities].
7160 ///
7161 /// # Example
7162 /// ```ignore,no_run
7163 /// # use google_cloud_container_v1::model::SoleTenantConfig;
7164 /// use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
7165 /// let x = SoleTenantConfig::new()
7166 /// .set_node_affinities([
7167 /// NodeAffinity::default()/* use setters */,
7168 /// NodeAffinity::default()/* use (different) setters */,
7169 /// ]);
7170 /// ```
7171 pub fn set_node_affinities<T, V>(mut self, v: T) -> Self
7172 where
7173 T: std::iter::IntoIterator<Item = V>,
7174 V: std::convert::Into<crate::model::sole_tenant_config::NodeAffinity>,
7175 {
7176 use std::iter::Iterator;
7177 self.node_affinities = v.into_iter().map(|i| i.into()).collect();
7178 self
7179 }
7180
7181 /// Sets the value of [min_node_cpus][crate::model::SoleTenantConfig::min_node_cpus].
7182 ///
7183 /// # Example
7184 /// ```ignore,no_run
7185 /// # use google_cloud_container_v1::model::SoleTenantConfig;
7186 /// let x = SoleTenantConfig::new().set_min_node_cpus(42);
7187 /// ```
7188 pub fn set_min_node_cpus<T>(mut self, v: T) -> Self
7189 where
7190 T: std::convert::Into<i32>,
7191 {
7192 self.min_node_cpus = std::option::Option::Some(v.into());
7193 self
7194 }
7195
7196 /// Sets or clears the value of [min_node_cpus][crate::model::SoleTenantConfig::min_node_cpus].
7197 ///
7198 /// # Example
7199 /// ```ignore,no_run
7200 /// # use google_cloud_container_v1::model::SoleTenantConfig;
7201 /// let x = SoleTenantConfig::new().set_or_clear_min_node_cpus(Some(42));
7202 /// let x = SoleTenantConfig::new().set_or_clear_min_node_cpus(None::<i32>);
7203 /// ```
7204 pub fn set_or_clear_min_node_cpus<T>(mut self, v: std::option::Option<T>) -> Self
7205 where
7206 T: std::convert::Into<i32>,
7207 {
7208 self.min_node_cpus = v.map(|x| x.into());
7209 self
7210 }
7211}
7212
7213impl wkt::message::Message for SoleTenantConfig {
7214 fn typename() -> &'static str {
7215 "type.googleapis.com/google.container.v1.SoleTenantConfig"
7216 }
7217}
7218
7219/// Defines additional types related to [SoleTenantConfig].
7220pub mod sole_tenant_config {
7221 #[allow(unused_imports)]
7222 use super::*;
7223
7224 /// Specifies the NodeAffinity key, values, and affinity operator according to
7225 /// [shared sole tenant node group
7226 /// affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity).
7227 #[derive(Clone, Default, PartialEq)]
7228 #[non_exhaustive]
7229 pub struct NodeAffinity {
7230 /// Key for NodeAffinity.
7231 pub key: std::string::String,
7232
7233 /// Operator for NodeAffinity.
7234 pub operator: crate::model::sole_tenant_config::node_affinity::Operator,
7235
7236 /// Values for NodeAffinity.
7237 pub values: std::vec::Vec<std::string::String>,
7238
7239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7240 }
7241
7242 impl NodeAffinity {
7243 /// Creates a new default instance.
7244 pub fn new() -> Self {
7245 std::default::Default::default()
7246 }
7247
7248 /// Sets the value of [key][crate::model::sole_tenant_config::NodeAffinity::key].
7249 ///
7250 /// # Example
7251 /// ```ignore,no_run
7252 /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
7253 /// let x = NodeAffinity::new().set_key("example");
7254 /// ```
7255 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7256 self.key = v.into();
7257 self
7258 }
7259
7260 /// Sets the value of [operator][crate::model::sole_tenant_config::NodeAffinity::operator].
7261 ///
7262 /// # Example
7263 /// ```ignore,no_run
7264 /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
7265 /// use google_cloud_container_v1::model::sole_tenant_config::node_affinity::Operator;
7266 /// let x0 = NodeAffinity::new().set_operator(Operator::In);
7267 /// let x1 = NodeAffinity::new().set_operator(Operator::NotIn);
7268 /// ```
7269 pub fn set_operator<
7270 T: std::convert::Into<crate::model::sole_tenant_config::node_affinity::Operator>,
7271 >(
7272 mut self,
7273 v: T,
7274 ) -> Self {
7275 self.operator = v.into();
7276 self
7277 }
7278
7279 /// Sets the value of [values][crate::model::sole_tenant_config::NodeAffinity::values].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
7284 /// let x = NodeAffinity::new().set_values(["a", "b", "c"]);
7285 /// ```
7286 pub fn set_values<T, V>(mut self, v: T) -> Self
7287 where
7288 T: std::iter::IntoIterator<Item = V>,
7289 V: std::convert::Into<std::string::String>,
7290 {
7291 use std::iter::Iterator;
7292 self.values = v.into_iter().map(|i| i.into()).collect();
7293 self
7294 }
7295 }
7296
7297 impl wkt::message::Message for NodeAffinity {
7298 fn typename() -> &'static str {
7299 "type.googleapis.com/google.container.v1.SoleTenantConfig.NodeAffinity"
7300 }
7301 }
7302
7303 /// Defines additional types related to [NodeAffinity].
7304 pub mod node_affinity {
7305 #[allow(unused_imports)]
7306 use super::*;
7307
7308 /// Operator allows user to specify affinity or anti-affinity for the
7309 /// given key values.
7310 ///
7311 /// # Working with unknown values
7312 ///
7313 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7314 /// additional enum variants at any time. Adding new variants is not considered
7315 /// a breaking change. Applications should write their code in anticipation of:
7316 ///
7317 /// - New values appearing in future releases of the client library, **and**
7318 /// - New values received dynamically, without application changes.
7319 ///
7320 /// Please consult the [Working with enums] section in the user guide for some
7321 /// guidelines.
7322 ///
7323 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7324 #[derive(Clone, Debug, PartialEq)]
7325 #[non_exhaustive]
7326 pub enum Operator {
7327 /// Invalid or unspecified affinity operator.
7328 Unspecified,
7329 /// Affinity operator.
7330 In,
7331 /// Anti-affinity operator.
7332 NotIn,
7333 /// If set, the enum was initialized with an unknown value.
7334 ///
7335 /// Applications can examine the value using [Operator::value] or
7336 /// [Operator::name].
7337 UnknownValue(operator::UnknownValue),
7338 }
7339
7340 #[doc(hidden)]
7341 pub mod operator {
7342 #[allow(unused_imports)]
7343 use super::*;
7344 #[derive(Clone, Debug, PartialEq)]
7345 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7346 }
7347
7348 impl Operator {
7349 /// Gets the enum value.
7350 ///
7351 /// Returns `None` if the enum contains an unknown value deserialized from
7352 /// the string representation of enums.
7353 pub fn value(&self) -> std::option::Option<i32> {
7354 match self {
7355 Self::Unspecified => std::option::Option::Some(0),
7356 Self::In => std::option::Option::Some(1),
7357 Self::NotIn => std::option::Option::Some(2),
7358 Self::UnknownValue(u) => u.0.value(),
7359 }
7360 }
7361
7362 /// Gets the enum value as a string.
7363 ///
7364 /// Returns `None` if the enum contains an unknown value deserialized from
7365 /// the integer representation of enums.
7366 pub fn name(&self) -> std::option::Option<&str> {
7367 match self {
7368 Self::Unspecified => std::option::Option::Some("OPERATOR_UNSPECIFIED"),
7369 Self::In => std::option::Option::Some("IN"),
7370 Self::NotIn => std::option::Option::Some("NOT_IN"),
7371 Self::UnknownValue(u) => u.0.name(),
7372 }
7373 }
7374 }
7375
7376 impl std::default::Default for Operator {
7377 fn default() -> Self {
7378 use std::convert::From;
7379 Self::from(0)
7380 }
7381 }
7382
7383 impl std::fmt::Display for Operator {
7384 fn fmt(
7385 &self,
7386 f: &mut std::fmt::Formatter<'_>,
7387 ) -> std::result::Result<(), std::fmt::Error> {
7388 wkt::internal::display_enum(f, self.name(), self.value())
7389 }
7390 }
7391
7392 impl std::convert::From<i32> for Operator {
7393 fn from(value: i32) -> Self {
7394 match value {
7395 0 => Self::Unspecified,
7396 1 => Self::In,
7397 2 => Self::NotIn,
7398 _ => Self::UnknownValue(operator::UnknownValue(
7399 wkt::internal::UnknownEnumValue::Integer(value),
7400 )),
7401 }
7402 }
7403 }
7404
7405 impl std::convert::From<&str> for Operator {
7406 fn from(value: &str) -> Self {
7407 use std::string::ToString;
7408 match value {
7409 "OPERATOR_UNSPECIFIED" => Self::Unspecified,
7410 "IN" => Self::In,
7411 "NOT_IN" => Self::NotIn,
7412 _ => Self::UnknownValue(operator::UnknownValue(
7413 wkt::internal::UnknownEnumValue::String(value.to_string()),
7414 )),
7415 }
7416 }
7417 }
7418
7419 impl serde::ser::Serialize for Operator {
7420 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7421 where
7422 S: serde::Serializer,
7423 {
7424 match self {
7425 Self::Unspecified => serializer.serialize_i32(0),
7426 Self::In => serializer.serialize_i32(1),
7427 Self::NotIn => serializer.serialize_i32(2),
7428 Self::UnknownValue(u) => u.0.serialize(serializer),
7429 }
7430 }
7431 }
7432
7433 impl<'de> serde::de::Deserialize<'de> for Operator {
7434 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7435 where
7436 D: serde::Deserializer<'de>,
7437 {
7438 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operator>::new(
7439 ".google.container.v1.SoleTenantConfig.NodeAffinity.Operator",
7440 ))
7441 }
7442 }
7443 }
7444}
7445
7446/// ContainerdConfig contains configuration to customize containerd.
7447#[derive(Clone, Default, PartialEq)]
7448#[non_exhaustive]
7449pub struct ContainerdConfig {
7450 /// PrivateRegistryAccessConfig is used to configure access configuration
7451 /// for private container registries.
7452 pub private_registry_access_config:
7453 std::option::Option<crate::model::containerd_config::PrivateRegistryAccessConfig>,
7454
7455 /// Optional. WritableCgroups defines writable cgroups configuration for the
7456 /// node pool.
7457 pub writable_cgroups: std::option::Option<crate::model::containerd_config::WritableCgroups>,
7458
7459 /// RegistryHostConfig configures containerd registry host configuration.
7460 /// Each registry_hosts represents a hosts.toml file.
7461 /// At most 25 registry_hosts are allowed.
7462 pub registry_hosts: std::vec::Vec<crate::model::containerd_config::RegistryHostConfig>,
7463
7464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7465}
7466
7467impl ContainerdConfig {
7468 /// Creates a new default instance.
7469 pub fn new() -> Self {
7470 std::default::Default::default()
7471 }
7472
7473 /// Sets the value of [private_registry_access_config][crate::model::ContainerdConfig::private_registry_access_config].
7474 ///
7475 /// # Example
7476 /// ```ignore,no_run
7477 /// # use google_cloud_container_v1::model::ContainerdConfig;
7478 /// use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
7479 /// let x = ContainerdConfig::new().set_private_registry_access_config(PrivateRegistryAccessConfig::default()/* use setters */);
7480 /// ```
7481 pub fn set_private_registry_access_config<T>(mut self, v: T) -> Self
7482 where
7483 T: std::convert::Into<crate::model::containerd_config::PrivateRegistryAccessConfig>,
7484 {
7485 self.private_registry_access_config = std::option::Option::Some(v.into());
7486 self
7487 }
7488
7489 /// Sets or clears the value of [private_registry_access_config][crate::model::ContainerdConfig::private_registry_access_config].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_container_v1::model::ContainerdConfig;
7494 /// use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
7495 /// let x = ContainerdConfig::new().set_or_clear_private_registry_access_config(Some(PrivateRegistryAccessConfig::default()/* use setters */));
7496 /// let x = ContainerdConfig::new().set_or_clear_private_registry_access_config(None::<PrivateRegistryAccessConfig>);
7497 /// ```
7498 pub fn set_or_clear_private_registry_access_config<T>(
7499 mut self,
7500 v: std::option::Option<T>,
7501 ) -> Self
7502 where
7503 T: std::convert::Into<crate::model::containerd_config::PrivateRegistryAccessConfig>,
7504 {
7505 self.private_registry_access_config = v.map(|x| x.into());
7506 self
7507 }
7508
7509 /// Sets the value of [writable_cgroups][crate::model::ContainerdConfig::writable_cgroups].
7510 ///
7511 /// # Example
7512 /// ```ignore,no_run
7513 /// # use google_cloud_container_v1::model::ContainerdConfig;
7514 /// use google_cloud_container_v1::model::containerd_config::WritableCgroups;
7515 /// let x = ContainerdConfig::new().set_writable_cgroups(WritableCgroups::default()/* use setters */);
7516 /// ```
7517 pub fn set_writable_cgroups<T>(mut self, v: T) -> Self
7518 where
7519 T: std::convert::Into<crate::model::containerd_config::WritableCgroups>,
7520 {
7521 self.writable_cgroups = std::option::Option::Some(v.into());
7522 self
7523 }
7524
7525 /// Sets or clears the value of [writable_cgroups][crate::model::ContainerdConfig::writable_cgroups].
7526 ///
7527 /// # Example
7528 /// ```ignore,no_run
7529 /// # use google_cloud_container_v1::model::ContainerdConfig;
7530 /// use google_cloud_container_v1::model::containerd_config::WritableCgroups;
7531 /// let x = ContainerdConfig::new().set_or_clear_writable_cgroups(Some(WritableCgroups::default()/* use setters */));
7532 /// let x = ContainerdConfig::new().set_or_clear_writable_cgroups(None::<WritableCgroups>);
7533 /// ```
7534 pub fn set_or_clear_writable_cgroups<T>(mut self, v: std::option::Option<T>) -> Self
7535 where
7536 T: std::convert::Into<crate::model::containerd_config::WritableCgroups>,
7537 {
7538 self.writable_cgroups = v.map(|x| x.into());
7539 self
7540 }
7541
7542 /// Sets the value of [registry_hosts][crate::model::ContainerdConfig::registry_hosts].
7543 ///
7544 /// # Example
7545 /// ```ignore,no_run
7546 /// # use google_cloud_container_v1::model::ContainerdConfig;
7547 /// use google_cloud_container_v1::model::containerd_config::RegistryHostConfig;
7548 /// let x = ContainerdConfig::new()
7549 /// .set_registry_hosts([
7550 /// RegistryHostConfig::default()/* use setters */,
7551 /// RegistryHostConfig::default()/* use (different) setters */,
7552 /// ]);
7553 /// ```
7554 pub fn set_registry_hosts<T, V>(mut self, v: T) -> Self
7555 where
7556 T: std::iter::IntoIterator<Item = V>,
7557 V: std::convert::Into<crate::model::containerd_config::RegistryHostConfig>,
7558 {
7559 use std::iter::Iterator;
7560 self.registry_hosts = v.into_iter().map(|i| i.into()).collect();
7561 self
7562 }
7563}
7564
7565impl wkt::message::Message for ContainerdConfig {
7566 fn typename() -> &'static str {
7567 "type.googleapis.com/google.container.v1.ContainerdConfig"
7568 }
7569}
7570
7571/// Defines additional types related to [ContainerdConfig].
7572pub mod containerd_config {
7573 #[allow(unused_imports)]
7574 use super::*;
7575
7576 /// PrivateRegistryAccessConfig contains access configuration for
7577 /// private container registries.
7578 #[derive(Clone, Default, PartialEq)]
7579 #[non_exhaustive]
7580 pub struct PrivateRegistryAccessConfig {
7581
7582 /// Private registry access is enabled.
7583 pub enabled: bool,
7584
7585 /// Private registry access configuration.
7586 pub certificate_authority_domain_config: std::vec::Vec<crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig>,
7587
7588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7589 }
7590
7591 impl PrivateRegistryAccessConfig {
7592 /// Creates a new default instance.
7593 pub fn new() -> Self {
7594 std::default::Default::default()
7595 }
7596
7597 /// Sets the value of [enabled][crate::model::containerd_config::PrivateRegistryAccessConfig::enabled].
7598 ///
7599 /// # Example
7600 /// ```ignore,no_run
7601 /// # use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
7602 /// let x = PrivateRegistryAccessConfig::new().set_enabled(true);
7603 /// ```
7604 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7605 self.enabled = v.into();
7606 self
7607 }
7608
7609 /// Sets the value of [certificate_authority_domain_config][crate::model::containerd_config::PrivateRegistryAccessConfig::certificate_authority_domain_config].
7610 ///
7611 /// # Example
7612 /// ```ignore,no_run
7613 /// # use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
7614 /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
7615 /// let x = PrivateRegistryAccessConfig::new()
7616 /// .set_certificate_authority_domain_config([
7617 /// CertificateAuthorityDomainConfig::default()/* use setters */,
7618 /// CertificateAuthorityDomainConfig::default()/* use (different) setters */,
7619 /// ]);
7620 /// ```
7621 pub fn set_certificate_authority_domain_config<T, V>(mut self, v: T) -> Self
7622 where
7623 T: std::iter::IntoIterator<Item = V>,
7624 V: std::convert::Into<crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig>
7625 {
7626 use std::iter::Iterator;
7627 self.certificate_authority_domain_config = v.into_iter().map(|i| i.into()).collect();
7628 self
7629 }
7630 }
7631
7632 impl wkt::message::Message for PrivateRegistryAccessConfig {
7633 fn typename() -> &'static str {
7634 "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig"
7635 }
7636 }
7637
7638 /// Defines additional types related to [PrivateRegistryAccessConfig].
7639 pub mod private_registry_access_config {
7640 #[allow(unused_imports)]
7641 use super::*;
7642
7643 /// CertificateAuthorityDomainConfig configures one or more fully qualified
7644 /// domain names (FQDN) to a specific certificate.
7645 #[derive(Clone, Default, PartialEq)]
7646 #[non_exhaustive]
7647 pub struct CertificateAuthorityDomainConfig {
7648
7649 /// List of fully qualified domain names (FQDN).
7650 /// Specifying port is supported.
7651 /// Wildcards are NOT supported.
7652 /// Examples:
7653 ///
7654 /// - `my.customdomain.com`
7655 /// - `10.0.1.2:5000`
7656 pub fqdns: std::vec::Vec<std::string::String>,
7657
7658 /// Certificate access config. The following are supported:
7659 ///
7660 /// - GCPSecretManagerCertificateConfig
7661 pub certificate_config: std::option::Option<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig>,
7662
7663 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7664 }
7665
7666 impl CertificateAuthorityDomainConfig {
7667 /// Creates a new default instance.
7668 pub fn new() -> Self {
7669 std::default::Default::default()
7670 }
7671
7672 /// Sets the value of [fqdns][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::fqdns].
7673 ///
7674 /// # Example
7675 /// ```ignore,no_run
7676 /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
7677 /// let x = CertificateAuthorityDomainConfig::new().set_fqdns(["a", "b", "c"]);
7678 /// ```
7679 pub fn set_fqdns<T, V>(mut self, v: T) -> Self
7680 where
7681 T: std::iter::IntoIterator<Item = V>,
7682 V: std::convert::Into<std::string::String>,
7683 {
7684 use std::iter::Iterator;
7685 self.fqdns = v.into_iter().map(|i| i.into()).collect();
7686 self
7687 }
7688
7689 /// Sets the value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config].
7690 ///
7691 /// Note that all the setters affecting `certificate_config` are mutually
7692 /// exclusive.
7693 ///
7694 /// # Example
7695 /// ```ignore,no_run
7696 /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
7697 /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
7698 /// let x = CertificateAuthorityDomainConfig::new().set_certificate_config(Some(
7699 /// google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(GCPSecretManagerCertificateConfig::default().into())));
7700 /// ```
7701 pub fn set_certificate_config<T: std::convert::Into<std::option::Option<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig>>>(mut self, v: T) -> Self
7702 {
7703 self.certificate_config = v.into();
7704 self
7705 }
7706
7707 /// The value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config]
7708 /// if it holds a `GcpSecretManagerCertificateConfig`, `None` if the field is not set or
7709 /// holds a different branch.
7710 pub fn gcp_secret_manager_certificate_config(&self) -> std::option::Option<&std::boxed::Box<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig>>{
7711 #[allow(unreachable_patterns)]
7712 self.certificate_config.as_ref().and_then(|v| match v {
7713 crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(v) => std::option::Option::Some(v),
7714 _ => std::option::Option::None,
7715 })
7716 }
7717
7718 /// Sets the value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config]
7719 /// to hold a `GcpSecretManagerCertificateConfig`.
7720 ///
7721 /// Note that all the setters affecting `certificate_config` are
7722 /// mutually exclusive.
7723 ///
7724 /// # Example
7725 /// ```ignore,no_run
7726 /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
7727 /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
7728 /// let x = CertificateAuthorityDomainConfig::new().set_gcp_secret_manager_certificate_config(GCPSecretManagerCertificateConfig::default()/* use setters */);
7729 /// assert!(x.gcp_secret_manager_certificate_config().is_some());
7730 /// ```
7731 pub fn set_gcp_secret_manager_certificate_config<T: std::convert::Into<std::boxed::Box<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig>>>(mut self, v: T) -> Self{
7732 self.certificate_config = std::option::Option::Some(
7733 crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(
7734 v.into()
7735 )
7736 );
7737 self
7738 }
7739 }
7740
7741 impl wkt::message::Message for CertificateAuthorityDomainConfig {
7742 fn typename() -> &'static str {
7743 "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig"
7744 }
7745 }
7746
7747 /// Defines additional types related to [CertificateAuthorityDomainConfig].
7748 pub mod certificate_authority_domain_config {
7749 #[allow(unused_imports)]
7750 use super::*;
7751
7752 /// GCPSecretManagerCertificateConfig configures a secret from
7753 /// [Secret Manager](https://cloud.google.com/secret-manager).
7754 #[derive(Clone, Default, PartialEq)]
7755 #[non_exhaustive]
7756 pub struct GCPSecretManagerCertificateConfig {
7757 /// Secret URI, in the form
7758 /// "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION".
7759 /// Version can be fixed (e.g. "2") or "latest"
7760 pub secret_uri: std::string::String,
7761
7762 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7763 }
7764
7765 impl GCPSecretManagerCertificateConfig {
7766 /// Creates a new default instance.
7767 pub fn new() -> Self {
7768 std::default::Default::default()
7769 }
7770
7771 /// Sets the value of [secret_uri][crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig::secret_uri].
7772 ///
7773 /// # Example
7774 /// ```ignore,no_run
7775 /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
7776 /// let x = GCPSecretManagerCertificateConfig::new().set_secret_uri("example");
7777 /// ```
7778 pub fn set_secret_uri<T: std::convert::Into<std::string::String>>(
7779 mut self,
7780 v: T,
7781 ) -> Self {
7782 self.secret_uri = v.into();
7783 self
7784 }
7785 }
7786
7787 impl wkt::message::Message for GCPSecretManagerCertificateConfig {
7788 fn typename() -> &'static str {
7789 "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig"
7790 }
7791 }
7792
7793 /// Certificate access config. The following are supported:
7794 ///
7795 /// - GCPSecretManagerCertificateConfig
7796 #[derive(Clone, Debug, PartialEq)]
7797 #[non_exhaustive]
7798 pub enum CertificateConfig {
7799 /// Secret Manager certificate configuration.
7800 GcpSecretManagerCertificateConfig(std::boxed::Box<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig>),
7801 }
7802 }
7803 }
7804
7805 /// Defines writable cgroups configuration.
7806 #[derive(Clone, Default, PartialEq)]
7807 #[non_exhaustive]
7808 pub struct WritableCgroups {
7809 /// Optional. Whether writable cgroups is enabled.
7810 pub enabled: bool,
7811
7812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7813 }
7814
7815 impl WritableCgroups {
7816 /// Creates a new default instance.
7817 pub fn new() -> Self {
7818 std::default::Default::default()
7819 }
7820
7821 /// Sets the value of [enabled][crate::model::containerd_config::WritableCgroups::enabled].
7822 ///
7823 /// # Example
7824 /// ```ignore,no_run
7825 /// # use google_cloud_container_v1::model::containerd_config::WritableCgroups;
7826 /// let x = WritableCgroups::new().set_enabled(true);
7827 /// ```
7828 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7829 self.enabled = v.into();
7830 self
7831 }
7832 }
7833
7834 impl wkt::message::Message for WritableCgroups {
7835 fn typename() -> &'static str {
7836 "type.googleapis.com/google.container.v1.ContainerdConfig.WritableCgroups"
7837 }
7838 }
7839
7840 /// RegistryHostConfig configures the top-level structure for a single
7841 /// containerd registry server's configuration, which represents one hosts.toml
7842 /// file on the node. It will override the same fqdns in
7843 /// PrivateRegistryAccessConfig.
7844 #[derive(Clone, Default, PartialEq)]
7845 #[non_exhaustive]
7846 pub struct RegistryHostConfig {
7847 /// Defines the host name of the registry server, which will be used to
7848 /// create configuration file as /etc/containerd/hosts.d/\<server\>/hosts.toml.
7849 /// It supports fully qualified domain names (FQDN) and IP addresses:
7850 /// Specifying port is supported, while scheme and path are NOT supported.
7851 /// Wildcards are NOT supported.
7852 /// Examples:
7853 ///
7854 /// - `my.customdomain.com`
7855 /// - `10.0.1.2:5000`
7856 pub server: std::string::String,
7857
7858 /// HostConfig configures a list of host-specific configurations for the
7859 /// server.
7860 /// Each server can have at most 10 host configurations.
7861 pub hosts: std::vec::Vec<crate::model::containerd_config::registry_host_config::HostConfig>,
7862
7863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7864 }
7865
7866 impl RegistryHostConfig {
7867 /// Creates a new default instance.
7868 pub fn new() -> Self {
7869 std::default::Default::default()
7870 }
7871
7872 /// Sets the value of [server][crate::model::containerd_config::RegistryHostConfig::server].
7873 ///
7874 /// # Example
7875 /// ```ignore,no_run
7876 /// # use google_cloud_container_v1::model::containerd_config::RegistryHostConfig;
7877 /// let x = RegistryHostConfig::new().set_server("example");
7878 /// ```
7879 pub fn set_server<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7880 self.server = v.into();
7881 self
7882 }
7883
7884 /// Sets the value of [hosts][crate::model::containerd_config::RegistryHostConfig::hosts].
7885 ///
7886 /// # Example
7887 /// ```ignore,no_run
7888 /// # use google_cloud_container_v1::model::containerd_config::RegistryHostConfig;
7889 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
7890 /// let x = RegistryHostConfig::new()
7891 /// .set_hosts([
7892 /// HostConfig::default()/* use setters */,
7893 /// HostConfig::default()/* use (different) setters */,
7894 /// ]);
7895 /// ```
7896 pub fn set_hosts<T, V>(mut self, v: T) -> Self
7897 where
7898 T: std::iter::IntoIterator<Item = V>,
7899 V: std::convert::Into<
7900 crate::model::containerd_config::registry_host_config::HostConfig,
7901 >,
7902 {
7903 use std::iter::Iterator;
7904 self.hosts = v.into_iter().map(|i| i.into()).collect();
7905 self
7906 }
7907 }
7908
7909 impl wkt::message::Message for RegistryHostConfig {
7910 fn typename() -> &'static str {
7911 "type.googleapis.com/google.container.v1.ContainerdConfig.RegistryHostConfig"
7912 }
7913 }
7914
7915 /// Defines additional types related to [RegistryHostConfig].
7916 pub mod registry_host_config {
7917 #[allow(unused_imports)]
7918 use super::*;
7919
7920 /// CertificateConfig configures certificate for the registry.
7921 #[derive(Clone, Default, PartialEq)]
7922 #[non_exhaustive]
7923 pub struct CertificateConfig {
7924
7925 /// One of the methods to configure the certificate.
7926 pub certificate: std::option::Option<crate::model::containerd_config::registry_host_config::certificate_config::Certificate>,
7927
7928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7929 }
7930
7931 impl CertificateConfig {
7932 /// Creates a new default instance.
7933 pub fn new() -> Self {
7934 std::default::Default::default()
7935 }
7936
7937 /// Sets the value of [certificate][crate::model::containerd_config::registry_host_config::CertificateConfig::certificate].
7938 ///
7939 /// Note that all the setters affecting `certificate` are mutually
7940 /// exclusive.
7941 ///
7942 /// # Example
7943 /// ```ignore,no_run
7944 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
7945 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::certificate_config::Certificate;
7946 /// let x = CertificateConfig::new().set_certificate(Some(Certificate::GcpSecretManagerSecretUri("example".to_string())));
7947 /// ```
7948 pub fn set_certificate<T: std::convert::Into<std::option::Option<crate::model::containerd_config::registry_host_config::certificate_config::Certificate>>>(mut self, v: T) -> Self
7949 {
7950 self.certificate = v.into();
7951 self
7952 }
7953
7954 /// The value of [certificate][crate::model::containerd_config::registry_host_config::CertificateConfig::certificate]
7955 /// if it holds a `GcpSecretManagerSecretUri`, `None` if the field is not set or
7956 /// holds a different branch.
7957 pub fn gcp_secret_manager_secret_uri(
7958 &self,
7959 ) -> std::option::Option<&std::string::String> {
7960 #[allow(unreachable_patterns)]
7961 self.certificate.as_ref().and_then(|v| match v {
7962 crate::model::containerd_config::registry_host_config::certificate_config::Certificate::GcpSecretManagerSecretUri(v) => std::option::Option::Some(v),
7963 _ => std::option::Option::None,
7964 })
7965 }
7966
7967 /// Sets the value of [certificate][crate::model::containerd_config::registry_host_config::CertificateConfig::certificate]
7968 /// to hold a `GcpSecretManagerSecretUri`.
7969 ///
7970 /// Note that all the setters affecting `certificate` are
7971 /// mutually exclusive.
7972 ///
7973 /// # Example
7974 /// ```ignore,no_run
7975 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
7976 /// let x = CertificateConfig::new().set_gcp_secret_manager_secret_uri("example");
7977 /// assert!(x.gcp_secret_manager_secret_uri().is_some());
7978 /// ```
7979 pub fn set_gcp_secret_manager_secret_uri<T: std::convert::Into<std::string::String>>(
7980 mut self,
7981 v: T,
7982 ) -> Self {
7983 self.certificate = std::option::Option::Some(
7984 crate::model::containerd_config::registry_host_config::certificate_config::Certificate::GcpSecretManagerSecretUri(
7985 v.into()
7986 )
7987 );
7988 self
7989 }
7990 }
7991
7992 impl wkt::message::Message for CertificateConfig {
7993 fn typename() -> &'static str {
7994 "type.googleapis.com/google.container.v1.ContainerdConfig.RegistryHostConfig.CertificateConfig"
7995 }
7996 }
7997
7998 /// Defines additional types related to [CertificateConfig].
7999 pub mod certificate_config {
8000 #[allow(unused_imports)]
8001 use super::*;
8002
8003 /// One of the methods to configure the certificate.
8004 #[derive(Clone, Debug, PartialEq)]
8005 #[non_exhaustive]
8006 pub enum Certificate {
8007 /// The URI configures a secret from
8008 /// [Secret Manager](https://cloud.google.com/secret-manager)
8009 /// in the format
8010 /// "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION" for
8011 /// global secret or
8012 /// "projects/$PROJECT_ID/locations/$REGION/secrets/$SECRET_NAME/versions/$VERSION"
8013 /// for regional secret. Version can be fixed (e.g. "2") or "latest"
8014 GcpSecretManagerSecretUri(std::string::String),
8015 }
8016 }
8017
8018 /// CertificateConfigPair configures pairs of certificates, which is used for
8019 /// client certificate and key pairs under a registry.
8020 #[derive(Clone, Default, PartialEq)]
8021 #[non_exhaustive]
8022 pub struct CertificateConfigPair {
8023 /// Cert configures the client certificate.
8024 pub cert: std::option::Option<
8025 crate::model::containerd_config::registry_host_config::CertificateConfig,
8026 >,
8027
8028 /// Key configures the client private key. Optional.
8029 pub key: std::option::Option<
8030 crate::model::containerd_config::registry_host_config::CertificateConfig,
8031 >,
8032
8033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8034 }
8035
8036 impl CertificateConfigPair {
8037 /// Creates a new default instance.
8038 pub fn new() -> Self {
8039 std::default::Default::default()
8040 }
8041
8042 /// Sets the value of [cert][crate::model::containerd_config::registry_host_config::CertificateConfigPair::cert].
8043 ///
8044 /// # Example
8045 /// ```ignore,no_run
8046 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfigPair;
8047 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
8048 /// let x = CertificateConfigPair::new().set_cert(CertificateConfig::default()/* use setters */);
8049 /// ```
8050 pub fn set_cert<T>(mut self, v: T) -> Self
8051 where
8052 T: std::convert::Into<
8053 crate::model::containerd_config::registry_host_config::CertificateConfig,
8054 >,
8055 {
8056 self.cert = std::option::Option::Some(v.into());
8057 self
8058 }
8059
8060 /// Sets or clears the value of [cert][crate::model::containerd_config::registry_host_config::CertificateConfigPair::cert].
8061 ///
8062 /// # Example
8063 /// ```ignore,no_run
8064 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfigPair;
8065 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
8066 /// let x = CertificateConfigPair::new().set_or_clear_cert(Some(CertificateConfig::default()/* use setters */));
8067 /// let x = CertificateConfigPair::new().set_or_clear_cert(None::<CertificateConfig>);
8068 /// ```
8069 pub fn set_or_clear_cert<T>(mut self, v: std::option::Option<T>) -> Self
8070 where
8071 T: std::convert::Into<
8072 crate::model::containerd_config::registry_host_config::CertificateConfig,
8073 >,
8074 {
8075 self.cert = v.map(|x| x.into());
8076 self
8077 }
8078
8079 /// Sets the value of [key][crate::model::containerd_config::registry_host_config::CertificateConfigPair::key].
8080 ///
8081 /// # Example
8082 /// ```ignore,no_run
8083 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfigPair;
8084 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
8085 /// let x = CertificateConfigPair::new().set_key(CertificateConfig::default()/* use setters */);
8086 /// ```
8087 pub fn set_key<T>(mut self, v: T) -> Self
8088 where
8089 T: std::convert::Into<
8090 crate::model::containerd_config::registry_host_config::CertificateConfig,
8091 >,
8092 {
8093 self.key = std::option::Option::Some(v.into());
8094 self
8095 }
8096
8097 /// Sets or clears the value of [key][crate::model::containerd_config::registry_host_config::CertificateConfigPair::key].
8098 ///
8099 /// # Example
8100 /// ```ignore,no_run
8101 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfigPair;
8102 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
8103 /// let x = CertificateConfigPair::new().set_or_clear_key(Some(CertificateConfig::default()/* use setters */));
8104 /// let x = CertificateConfigPair::new().set_or_clear_key(None::<CertificateConfig>);
8105 /// ```
8106 pub fn set_or_clear_key<T>(mut self, v: std::option::Option<T>) -> Self
8107 where
8108 T: std::convert::Into<
8109 crate::model::containerd_config::registry_host_config::CertificateConfig,
8110 >,
8111 {
8112 self.key = v.map(|x| x.into());
8113 self
8114 }
8115 }
8116
8117 impl wkt::message::Message for CertificateConfigPair {
8118 fn typename() -> &'static str {
8119 "type.googleapis.com/google.container.v1.ContainerdConfig.RegistryHostConfig.CertificateConfigPair"
8120 }
8121 }
8122
8123 /// RegistryHeader configures headers for the registry.
8124 #[derive(Clone, Default, PartialEq)]
8125 #[non_exhaustive]
8126 pub struct RegistryHeader {
8127 /// Key configures the header key.
8128 pub key: std::string::String,
8129
8130 /// Value configures the header value.
8131 pub value: std::vec::Vec<std::string::String>,
8132
8133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8134 }
8135
8136 impl RegistryHeader {
8137 /// Creates a new default instance.
8138 pub fn new() -> Self {
8139 std::default::Default::default()
8140 }
8141
8142 /// Sets the value of [key][crate::model::containerd_config::registry_host_config::RegistryHeader::key].
8143 ///
8144 /// # Example
8145 /// ```ignore,no_run
8146 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::RegistryHeader;
8147 /// let x = RegistryHeader::new().set_key("example");
8148 /// ```
8149 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8150 self.key = v.into();
8151 self
8152 }
8153
8154 /// Sets the value of [value][crate::model::containerd_config::registry_host_config::RegistryHeader::value].
8155 ///
8156 /// # Example
8157 /// ```ignore,no_run
8158 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::RegistryHeader;
8159 /// let x = RegistryHeader::new().set_value(["a", "b", "c"]);
8160 /// ```
8161 pub fn set_value<T, V>(mut self, v: T) -> Self
8162 where
8163 T: std::iter::IntoIterator<Item = V>,
8164 V: std::convert::Into<std::string::String>,
8165 {
8166 use std::iter::Iterator;
8167 self.value = v.into_iter().map(|i| i.into()).collect();
8168 self
8169 }
8170 }
8171
8172 impl wkt::message::Message for RegistryHeader {
8173 fn typename() -> &'static str {
8174 "type.googleapis.com/google.container.v1.ContainerdConfig.RegistryHostConfig.RegistryHeader"
8175 }
8176 }
8177
8178 /// HostConfig configures the registry host under a given Server.
8179 #[derive(Clone, Default, PartialEq)]
8180 #[non_exhaustive]
8181 pub struct HostConfig {
8182 /// Host configures the registry host/mirror.
8183 /// It supports fully qualified domain names (FQDNs) and IP addresses.
8184 /// Specifying scheme, port or path is supported. Scheme can only be http
8185 /// or https.
8186 /// Wildcards are NOT supported.
8187 /// Examples:
8188 ///
8189 /// - `my.customdomain.com`
8190 /// - `<https://my.customdomain.com/path>`
8191 /// - `10.0.1.2:5000`
8192 pub host: std::string::String,
8193
8194 /// Capabilities represent the capabilities of the registry host,
8195 /// specifying what operations a host is capable of performing.
8196 /// If not set, containerd enables all capabilities by default.
8197 pub capabilities: std::vec::Vec<
8198 crate::model::containerd_config::registry_host_config::HostCapability,
8199 >,
8200
8201 /// OverridePath is used to indicate the host's API root endpoint is
8202 /// defined in the URL path rather than by the API specification. This may
8203 /// be used with non-compliant OCI registries which are missing the /v2
8204 /// prefix.
8205 /// If not set, containerd sets default false.
8206 pub override_path: bool,
8207
8208 /// Header configures the registry host headers.
8209 pub header: std::vec::Vec<
8210 crate::model::containerd_config::registry_host_config::RegistryHeader,
8211 >,
8212
8213 /// CA configures the registry host certificate.
8214 pub ca: std::vec::Vec<
8215 crate::model::containerd_config::registry_host_config::CertificateConfig,
8216 >,
8217
8218 /// Client configures the registry host client certificate and key.
8219 pub client: std::vec::Vec<
8220 crate::model::containerd_config::registry_host_config::CertificateConfigPair,
8221 >,
8222
8223 /// Specifies the maximum duration allowed for a connection attempt to
8224 /// complete. A shorter timeout helps reduce delays when falling back to
8225 /// the original registry if the mirror is unreachable.
8226 /// Maximum allowed value is 180s. If not set, containerd sets default 30s.
8227 /// The value should be a decimal number of seconds with an `s` suffix.
8228 pub dial_timeout: std::option::Option<wkt::Duration>,
8229
8230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8231 }
8232
8233 impl HostConfig {
8234 /// Creates a new default instance.
8235 pub fn new() -> Self {
8236 std::default::Default::default()
8237 }
8238
8239 /// Sets the value of [host][crate::model::containerd_config::registry_host_config::HostConfig::host].
8240 ///
8241 /// # Example
8242 /// ```ignore,no_run
8243 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8244 /// let x = HostConfig::new().set_host("example");
8245 /// ```
8246 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8247 self.host = v.into();
8248 self
8249 }
8250
8251 /// Sets the value of [capabilities][crate::model::containerd_config::registry_host_config::HostConfig::capabilities].
8252 ///
8253 /// # Example
8254 /// ```ignore,no_run
8255 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8256 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::HostCapability;
8257 /// let x = HostConfig::new().set_capabilities([
8258 /// HostCapability::Pull,
8259 /// HostCapability::Resolve,
8260 /// HostCapability::Push,
8261 /// ]);
8262 /// ```
8263 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
8264 where
8265 T: std::iter::IntoIterator<Item = V>,
8266 V: std::convert::Into<
8267 crate::model::containerd_config::registry_host_config::HostCapability,
8268 >,
8269 {
8270 use std::iter::Iterator;
8271 self.capabilities = v.into_iter().map(|i| i.into()).collect();
8272 self
8273 }
8274
8275 /// Sets the value of [override_path][crate::model::containerd_config::registry_host_config::HostConfig::override_path].
8276 ///
8277 /// # Example
8278 /// ```ignore,no_run
8279 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8280 /// let x = HostConfig::new().set_override_path(true);
8281 /// ```
8282 pub fn set_override_path<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8283 self.override_path = v.into();
8284 self
8285 }
8286
8287 /// Sets the value of [header][crate::model::containerd_config::registry_host_config::HostConfig::header].
8288 ///
8289 /// # Example
8290 /// ```ignore,no_run
8291 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8292 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::RegistryHeader;
8293 /// let x = HostConfig::new()
8294 /// .set_header([
8295 /// RegistryHeader::default()/* use setters */,
8296 /// RegistryHeader::default()/* use (different) setters */,
8297 /// ]);
8298 /// ```
8299 pub fn set_header<T, V>(mut self, v: T) -> Self
8300 where
8301 T: std::iter::IntoIterator<Item = V>,
8302 V: std::convert::Into<
8303 crate::model::containerd_config::registry_host_config::RegistryHeader,
8304 >,
8305 {
8306 use std::iter::Iterator;
8307 self.header = v.into_iter().map(|i| i.into()).collect();
8308 self
8309 }
8310
8311 /// Sets the value of [ca][crate::model::containerd_config::registry_host_config::HostConfig::ca].
8312 ///
8313 /// # Example
8314 /// ```ignore,no_run
8315 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8316 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfig;
8317 /// let x = HostConfig::new()
8318 /// .set_ca([
8319 /// CertificateConfig::default()/* use setters */,
8320 /// CertificateConfig::default()/* use (different) setters */,
8321 /// ]);
8322 /// ```
8323 pub fn set_ca<T, V>(mut self, v: T) -> Self
8324 where
8325 T: std::iter::IntoIterator<Item = V>,
8326 V: std::convert::Into<
8327 crate::model::containerd_config::registry_host_config::CertificateConfig,
8328 >,
8329 {
8330 use std::iter::Iterator;
8331 self.ca = v.into_iter().map(|i| i.into()).collect();
8332 self
8333 }
8334
8335 /// Sets the value of [client][crate::model::containerd_config::registry_host_config::HostConfig::client].
8336 ///
8337 /// # Example
8338 /// ```ignore,no_run
8339 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8340 /// use google_cloud_container_v1::model::containerd_config::registry_host_config::CertificateConfigPair;
8341 /// let x = HostConfig::new()
8342 /// .set_client([
8343 /// CertificateConfigPair::default()/* use setters */,
8344 /// CertificateConfigPair::default()/* use (different) setters */,
8345 /// ]);
8346 /// ```
8347 pub fn set_client<T, V>(mut self, v: T) -> Self
8348 where
8349 T: std::iter::IntoIterator<Item = V>,
8350 V: std::convert::Into<crate::model::containerd_config::registry_host_config::CertificateConfigPair>
8351 {
8352 use std::iter::Iterator;
8353 self.client = v.into_iter().map(|i| i.into()).collect();
8354 self
8355 }
8356
8357 /// Sets the value of [dial_timeout][crate::model::containerd_config::registry_host_config::HostConfig::dial_timeout].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8362 /// use wkt::Duration;
8363 /// let x = HostConfig::new().set_dial_timeout(Duration::default()/* use setters */);
8364 /// ```
8365 pub fn set_dial_timeout<T>(mut self, v: T) -> Self
8366 where
8367 T: std::convert::Into<wkt::Duration>,
8368 {
8369 self.dial_timeout = std::option::Option::Some(v.into());
8370 self
8371 }
8372
8373 /// Sets or clears the value of [dial_timeout][crate::model::containerd_config::registry_host_config::HostConfig::dial_timeout].
8374 ///
8375 /// # Example
8376 /// ```ignore,no_run
8377 /// # use google_cloud_container_v1::model::containerd_config::registry_host_config::HostConfig;
8378 /// use wkt::Duration;
8379 /// let x = HostConfig::new().set_or_clear_dial_timeout(Some(Duration::default()/* use setters */));
8380 /// let x = HostConfig::new().set_or_clear_dial_timeout(None::<Duration>);
8381 /// ```
8382 pub fn set_or_clear_dial_timeout<T>(mut self, v: std::option::Option<T>) -> Self
8383 where
8384 T: std::convert::Into<wkt::Duration>,
8385 {
8386 self.dial_timeout = v.map(|x| x.into());
8387 self
8388 }
8389 }
8390
8391 impl wkt::message::Message for HostConfig {
8392 fn typename() -> &'static str {
8393 "type.googleapis.com/google.container.v1.ContainerdConfig.RegistryHostConfig.HostConfig"
8394 }
8395 }
8396
8397 /// HostCapability configures capabilities for the registry host.
8398 ///
8399 /// # Working with unknown values
8400 ///
8401 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8402 /// additional enum variants at any time. Adding new variants is not considered
8403 /// a breaking change. Applications should write their code in anticipation of:
8404 ///
8405 /// - New values appearing in future releases of the client library, **and**
8406 /// - New values received dynamically, without application changes.
8407 ///
8408 /// Please consult the [Working with enums] section in the user guide for some
8409 /// guidelines.
8410 ///
8411 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8412 #[derive(Clone, Debug, PartialEq)]
8413 #[non_exhaustive]
8414 pub enum HostCapability {
8415 /// UNKNOWN should never be set.
8416 Unspecified,
8417 /// Pull represents the capability to fetch manifests and blobs by digest.
8418 Pull,
8419 /// Resolve represents the capability to fetch manifests by name.
8420 Resolve,
8421 /// Push represents the capability to push blobs and manifests.
8422 Push,
8423 /// If set, the enum was initialized with an unknown value.
8424 ///
8425 /// Applications can examine the value using [HostCapability::value] or
8426 /// [HostCapability::name].
8427 UnknownValue(host_capability::UnknownValue),
8428 }
8429
8430 #[doc(hidden)]
8431 pub mod host_capability {
8432 #[allow(unused_imports)]
8433 use super::*;
8434 #[derive(Clone, Debug, PartialEq)]
8435 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8436 }
8437
8438 impl HostCapability {
8439 /// Gets the enum value.
8440 ///
8441 /// Returns `None` if the enum contains an unknown value deserialized from
8442 /// the string representation of enums.
8443 pub fn value(&self) -> std::option::Option<i32> {
8444 match self {
8445 Self::Unspecified => std::option::Option::Some(0),
8446 Self::Pull => std::option::Option::Some(1),
8447 Self::Resolve => std::option::Option::Some(2),
8448 Self::Push => std::option::Option::Some(3),
8449 Self::UnknownValue(u) => u.0.value(),
8450 }
8451 }
8452
8453 /// Gets the enum value as a string.
8454 ///
8455 /// Returns `None` if the enum contains an unknown value deserialized from
8456 /// the integer representation of enums.
8457 pub fn name(&self) -> std::option::Option<&str> {
8458 match self {
8459 Self::Unspecified => std::option::Option::Some("HOST_CAPABILITY_UNSPECIFIED"),
8460 Self::Pull => std::option::Option::Some("HOST_CAPABILITY_PULL"),
8461 Self::Resolve => std::option::Option::Some("HOST_CAPABILITY_RESOLVE"),
8462 Self::Push => std::option::Option::Some("HOST_CAPABILITY_PUSH"),
8463 Self::UnknownValue(u) => u.0.name(),
8464 }
8465 }
8466 }
8467
8468 impl std::default::Default for HostCapability {
8469 fn default() -> Self {
8470 use std::convert::From;
8471 Self::from(0)
8472 }
8473 }
8474
8475 impl std::fmt::Display for HostCapability {
8476 fn fmt(
8477 &self,
8478 f: &mut std::fmt::Formatter<'_>,
8479 ) -> std::result::Result<(), std::fmt::Error> {
8480 wkt::internal::display_enum(f, self.name(), self.value())
8481 }
8482 }
8483
8484 impl std::convert::From<i32> for HostCapability {
8485 fn from(value: i32) -> Self {
8486 match value {
8487 0 => Self::Unspecified,
8488 1 => Self::Pull,
8489 2 => Self::Resolve,
8490 3 => Self::Push,
8491 _ => Self::UnknownValue(host_capability::UnknownValue(
8492 wkt::internal::UnknownEnumValue::Integer(value),
8493 )),
8494 }
8495 }
8496 }
8497
8498 impl std::convert::From<&str> for HostCapability {
8499 fn from(value: &str) -> Self {
8500 use std::string::ToString;
8501 match value {
8502 "HOST_CAPABILITY_UNSPECIFIED" => Self::Unspecified,
8503 "HOST_CAPABILITY_PULL" => Self::Pull,
8504 "HOST_CAPABILITY_RESOLVE" => Self::Resolve,
8505 "HOST_CAPABILITY_PUSH" => Self::Push,
8506 _ => Self::UnknownValue(host_capability::UnknownValue(
8507 wkt::internal::UnknownEnumValue::String(value.to_string()),
8508 )),
8509 }
8510 }
8511 }
8512
8513 impl serde::ser::Serialize for HostCapability {
8514 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8515 where
8516 S: serde::Serializer,
8517 {
8518 match self {
8519 Self::Unspecified => serializer.serialize_i32(0),
8520 Self::Pull => serializer.serialize_i32(1),
8521 Self::Resolve => serializer.serialize_i32(2),
8522 Self::Push => serializer.serialize_i32(3),
8523 Self::UnknownValue(u) => u.0.serialize(serializer),
8524 }
8525 }
8526 }
8527
8528 impl<'de> serde::de::Deserialize<'de> for HostCapability {
8529 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8530 where
8531 D: serde::Deserializer<'de>,
8532 {
8533 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HostCapability>::new(
8534 ".google.container.v1.ContainerdConfig.RegistryHostConfig.HostCapability",
8535 ))
8536 }
8537 }
8538 }
8539}
8540
8541/// Kubernetes taint is composed of three fields: key, value, and effect. Effect
8542/// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute.
8543///
8544/// See
8545/// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration)
8546/// for more information, including usage and the valid values.
8547#[derive(Clone, Default, PartialEq)]
8548#[non_exhaustive]
8549pub struct NodeTaint {
8550 /// Key for taint.
8551 pub key: std::string::String,
8552
8553 /// Value for taint.
8554 pub value: std::string::String,
8555
8556 /// Effect for taint.
8557 pub effect: crate::model::node_taint::Effect,
8558
8559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8560}
8561
8562impl NodeTaint {
8563 /// Creates a new default instance.
8564 pub fn new() -> Self {
8565 std::default::Default::default()
8566 }
8567
8568 /// Sets the value of [key][crate::model::NodeTaint::key].
8569 ///
8570 /// # Example
8571 /// ```ignore,no_run
8572 /// # use google_cloud_container_v1::model::NodeTaint;
8573 /// let x = NodeTaint::new().set_key("example");
8574 /// ```
8575 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8576 self.key = v.into();
8577 self
8578 }
8579
8580 /// Sets the value of [value][crate::model::NodeTaint::value].
8581 ///
8582 /// # Example
8583 /// ```ignore,no_run
8584 /// # use google_cloud_container_v1::model::NodeTaint;
8585 /// let x = NodeTaint::new().set_value("example");
8586 /// ```
8587 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8588 self.value = v.into();
8589 self
8590 }
8591
8592 /// Sets the value of [effect][crate::model::NodeTaint::effect].
8593 ///
8594 /// # Example
8595 /// ```ignore,no_run
8596 /// # use google_cloud_container_v1::model::NodeTaint;
8597 /// use google_cloud_container_v1::model::node_taint::Effect;
8598 /// let x0 = NodeTaint::new().set_effect(Effect::NoSchedule);
8599 /// let x1 = NodeTaint::new().set_effect(Effect::PreferNoSchedule);
8600 /// let x2 = NodeTaint::new().set_effect(Effect::NoExecute);
8601 /// ```
8602 pub fn set_effect<T: std::convert::Into<crate::model::node_taint::Effect>>(
8603 mut self,
8604 v: T,
8605 ) -> Self {
8606 self.effect = v.into();
8607 self
8608 }
8609}
8610
8611impl wkt::message::Message for NodeTaint {
8612 fn typename() -> &'static str {
8613 "type.googleapis.com/google.container.v1.NodeTaint"
8614 }
8615}
8616
8617/// Defines additional types related to [NodeTaint].
8618pub mod node_taint {
8619 #[allow(unused_imports)]
8620 use super::*;
8621
8622 /// Possible values for Effect in taint.
8623 ///
8624 /// # Working with unknown values
8625 ///
8626 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8627 /// additional enum variants at any time. Adding new variants is not considered
8628 /// a breaking change. Applications should write their code in anticipation of:
8629 ///
8630 /// - New values appearing in future releases of the client library, **and**
8631 /// - New values received dynamically, without application changes.
8632 ///
8633 /// Please consult the [Working with enums] section in the user guide for some
8634 /// guidelines.
8635 ///
8636 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8637 #[derive(Clone, Debug, PartialEq)]
8638 #[non_exhaustive]
8639 pub enum Effect {
8640 /// Not set
8641 Unspecified,
8642 /// NoSchedule
8643 NoSchedule,
8644 /// PreferNoSchedule
8645 PreferNoSchedule,
8646 /// NoExecute
8647 NoExecute,
8648 /// If set, the enum was initialized with an unknown value.
8649 ///
8650 /// Applications can examine the value using [Effect::value] or
8651 /// [Effect::name].
8652 UnknownValue(effect::UnknownValue),
8653 }
8654
8655 #[doc(hidden)]
8656 pub mod effect {
8657 #[allow(unused_imports)]
8658 use super::*;
8659 #[derive(Clone, Debug, PartialEq)]
8660 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8661 }
8662
8663 impl Effect {
8664 /// Gets the enum value.
8665 ///
8666 /// Returns `None` if the enum contains an unknown value deserialized from
8667 /// the string representation of enums.
8668 pub fn value(&self) -> std::option::Option<i32> {
8669 match self {
8670 Self::Unspecified => std::option::Option::Some(0),
8671 Self::NoSchedule => std::option::Option::Some(1),
8672 Self::PreferNoSchedule => std::option::Option::Some(2),
8673 Self::NoExecute => std::option::Option::Some(3),
8674 Self::UnknownValue(u) => u.0.value(),
8675 }
8676 }
8677
8678 /// Gets the enum value as a string.
8679 ///
8680 /// Returns `None` if the enum contains an unknown value deserialized from
8681 /// the integer representation of enums.
8682 pub fn name(&self) -> std::option::Option<&str> {
8683 match self {
8684 Self::Unspecified => std::option::Option::Some("EFFECT_UNSPECIFIED"),
8685 Self::NoSchedule => std::option::Option::Some("NO_SCHEDULE"),
8686 Self::PreferNoSchedule => std::option::Option::Some("PREFER_NO_SCHEDULE"),
8687 Self::NoExecute => std::option::Option::Some("NO_EXECUTE"),
8688 Self::UnknownValue(u) => u.0.name(),
8689 }
8690 }
8691 }
8692
8693 impl std::default::Default for Effect {
8694 fn default() -> Self {
8695 use std::convert::From;
8696 Self::from(0)
8697 }
8698 }
8699
8700 impl std::fmt::Display for Effect {
8701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8702 wkt::internal::display_enum(f, self.name(), self.value())
8703 }
8704 }
8705
8706 impl std::convert::From<i32> for Effect {
8707 fn from(value: i32) -> Self {
8708 match value {
8709 0 => Self::Unspecified,
8710 1 => Self::NoSchedule,
8711 2 => Self::PreferNoSchedule,
8712 3 => Self::NoExecute,
8713 _ => Self::UnknownValue(effect::UnknownValue(
8714 wkt::internal::UnknownEnumValue::Integer(value),
8715 )),
8716 }
8717 }
8718 }
8719
8720 impl std::convert::From<&str> for Effect {
8721 fn from(value: &str) -> Self {
8722 use std::string::ToString;
8723 match value {
8724 "EFFECT_UNSPECIFIED" => Self::Unspecified,
8725 "NO_SCHEDULE" => Self::NoSchedule,
8726 "PREFER_NO_SCHEDULE" => Self::PreferNoSchedule,
8727 "NO_EXECUTE" => Self::NoExecute,
8728 _ => Self::UnknownValue(effect::UnknownValue(
8729 wkt::internal::UnknownEnumValue::String(value.to_string()),
8730 )),
8731 }
8732 }
8733 }
8734
8735 impl serde::ser::Serialize for Effect {
8736 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8737 where
8738 S: serde::Serializer,
8739 {
8740 match self {
8741 Self::Unspecified => serializer.serialize_i32(0),
8742 Self::NoSchedule => serializer.serialize_i32(1),
8743 Self::PreferNoSchedule => serializer.serialize_i32(2),
8744 Self::NoExecute => serializer.serialize_i32(3),
8745 Self::UnknownValue(u) => u.0.serialize(serializer),
8746 }
8747 }
8748 }
8749
8750 impl<'de> serde::de::Deserialize<'de> for Effect {
8751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8752 where
8753 D: serde::Deserializer<'de>,
8754 {
8755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Effect>::new(
8756 ".google.container.v1.NodeTaint.Effect",
8757 ))
8758 }
8759 }
8760}
8761
8762/// Collection of Kubernetes [node
8763/// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration).
8764#[derive(Clone, Default, PartialEq)]
8765#[non_exhaustive]
8766pub struct NodeTaints {
8767 /// List of node taints.
8768 pub taints: std::vec::Vec<crate::model::NodeTaint>,
8769
8770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8771}
8772
8773impl NodeTaints {
8774 /// Creates a new default instance.
8775 pub fn new() -> Self {
8776 std::default::Default::default()
8777 }
8778
8779 /// Sets the value of [taints][crate::model::NodeTaints::taints].
8780 ///
8781 /// # Example
8782 /// ```ignore,no_run
8783 /// # use google_cloud_container_v1::model::NodeTaints;
8784 /// use google_cloud_container_v1::model::NodeTaint;
8785 /// let x = NodeTaints::new()
8786 /// .set_taints([
8787 /// NodeTaint::default()/* use setters */,
8788 /// NodeTaint::default()/* use (different) setters */,
8789 /// ]);
8790 /// ```
8791 pub fn set_taints<T, V>(mut self, v: T) -> Self
8792 where
8793 T: std::iter::IntoIterator<Item = V>,
8794 V: std::convert::Into<crate::model::NodeTaint>,
8795 {
8796 use std::iter::Iterator;
8797 self.taints = v.into_iter().map(|i| i.into()).collect();
8798 self
8799 }
8800}
8801
8802impl wkt::message::Message for NodeTaints {
8803 fn typename() -> &'static str {
8804 "type.googleapis.com/google.container.v1.NodeTaints"
8805 }
8806}
8807
8808/// Collection of node-level [Kubernetes
8809/// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels).
8810#[derive(Clone, Default, PartialEq)]
8811#[non_exhaustive]
8812pub struct NodeLabels {
8813 /// Map of node label keys and node label values.
8814 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8815
8816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8817}
8818
8819impl NodeLabels {
8820 /// Creates a new default instance.
8821 pub fn new() -> Self {
8822 std::default::Default::default()
8823 }
8824
8825 /// Sets the value of [labels][crate::model::NodeLabels::labels].
8826 ///
8827 /// # Example
8828 /// ```ignore,no_run
8829 /// # use google_cloud_container_v1::model::NodeLabels;
8830 /// let x = NodeLabels::new().set_labels([
8831 /// ("key0", "abc"),
8832 /// ("key1", "xyz"),
8833 /// ]);
8834 /// ```
8835 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8836 where
8837 T: std::iter::IntoIterator<Item = (K, V)>,
8838 K: std::convert::Into<std::string::String>,
8839 V: std::convert::Into<std::string::String>,
8840 {
8841 use std::iter::Iterator;
8842 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8843 self
8844 }
8845}
8846
8847impl wkt::message::Message for NodeLabels {
8848 fn typename() -> &'static str {
8849 "type.googleapis.com/google.container.v1.NodeLabels"
8850 }
8851}
8852
8853/// Collection of [Resource Manager
8854/// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels).
8855#[derive(Clone, Default, PartialEq)]
8856#[non_exhaustive]
8857pub struct ResourceLabels {
8858 /// Map of node label keys and node label values.
8859 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8860
8861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8862}
8863
8864impl ResourceLabels {
8865 /// Creates a new default instance.
8866 pub fn new() -> Self {
8867 std::default::Default::default()
8868 }
8869
8870 /// Sets the value of [labels][crate::model::ResourceLabels::labels].
8871 ///
8872 /// # Example
8873 /// ```ignore,no_run
8874 /// # use google_cloud_container_v1::model::ResourceLabels;
8875 /// let x = ResourceLabels::new().set_labels([
8876 /// ("key0", "abc"),
8877 /// ("key1", "xyz"),
8878 /// ]);
8879 /// ```
8880 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8881 where
8882 T: std::iter::IntoIterator<Item = (K, V)>,
8883 K: std::convert::Into<std::string::String>,
8884 V: std::convert::Into<std::string::String>,
8885 {
8886 use std::iter::Iterator;
8887 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8888 self
8889 }
8890}
8891
8892impl wkt::message::Message for ResourceLabels {
8893 fn typename() -> &'static str {
8894 "type.googleapis.com/google.container.v1.ResourceLabels"
8895 }
8896}
8897
8898/// Collection of Compute Engine network tags that can be applied to a node's
8899/// underlying VM instance.
8900#[derive(Clone, Default, PartialEq)]
8901#[non_exhaustive]
8902pub struct NetworkTags {
8903 /// List of network tags.
8904 pub tags: std::vec::Vec<std::string::String>,
8905
8906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8907}
8908
8909impl NetworkTags {
8910 /// Creates a new default instance.
8911 pub fn new() -> Self {
8912 std::default::Default::default()
8913 }
8914
8915 /// Sets the value of [tags][crate::model::NetworkTags::tags].
8916 ///
8917 /// # Example
8918 /// ```ignore,no_run
8919 /// # use google_cloud_container_v1::model::NetworkTags;
8920 /// let x = NetworkTags::new().set_tags(["a", "b", "c"]);
8921 /// ```
8922 pub fn set_tags<T, V>(mut self, v: T) -> Self
8923 where
8924 T: std::iter::IntoIterator<Item = V>,
8925 V: std::convert::Into<std::string::String>,
8926 {
8927 use std::iter::Iterator;
8928 self.tags = v.into_iter().map(|i| i.into()).collect();
8929 self
8930 }
8931}
8932
8933impl wkt::message::Message for NetworkTags {
8934 fn typename() -> &'static str {
8935 "type.googleapis.com/google.container.v1.NetworkTags"
8936 }
8937}
8938
8939/// The authentication information for accessing the master endpoint.
8940/// Authentication can be done using HTTP basic auth or using client
8941/// certificates.
8942#[derive(Clone, Default, PartialEq)]
8943#[non_exhaustive]
8944pub struct MasterAuth {
8945 /// The username to use for HTTP basic authentication to the master endpoint.
8946 /// For clusters v1.6.0 and later, basic authentication can be disabled by
8947 /// leaving username unspecified (or setting it to the empty string).
8948 ///
8949 /// Warning: basic authentication is deprecated, and will be removed in GKE
8950 /// control plane versions 1.19 and newer. For a list of recommended
8951 /// authentication methods, see:
8952 /// <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>
8953 #[deprecated]
8954 pub username: std::string::String,
8955
8956 /// The password to use for HTTP basic authentication to the master endpoint.
8957 /// Because the master endpoint is open to the Internet, you should create a
8958 /// strong password. If a password is provided for cluster creation, username
8959 /// must be non-empty.
8960 ///
8961 /// Warning: basic authentication is deprecated, and will be removed in GKE
8962 /// control plane versions 1.19 and newer. For a list of recommended
8963 /// authentication methods, see:
8964 /// <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>
8965 #[deprecated]
8966 pub password: std::string::String,
8967
8968 /// Configuration for client certificate authentication on the cluster. For
8969 /// clusters before v1.12, if no configuration is specified, a client
8970 /// certificate is issued.
8971 pub client_certificate_config: std::option::Option<crate::model::ClientCertificateConfig>,
8972
8973 /// Output only. Base64-encoded public certificate that is the root of
8974 /// trust for the cluster.
8975 pub cluster_ca_certificate: std::string::String,
8976
8977 /// Output only. Base64-encoded public certificate used by clients to
8978 /// authenticate to the cluster endpoint. Issued only if
8979 /// client_certificate_config is set.
8980 pub client_certificate: std::string::String,
8981
8982 /// Output only. Base64-encoded private key used by clients to authenticate
8983 /// to the cluster endpoint.
8984 pub client_key: std::string::String,
8985
8986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8987}
8988
8989impl MasterAuth {
8990 /// Creates a new default instance.
8991 pub fn new() -> Self {
8992 std::default::Default::default()
8993 }
8994
8995 /// Sets the value of [username][crate::model::MasterAuth::username].
8996 ///
8997 /// # Example
8998 /// ```ignore,no_run
8999 /// # use google_cloud_container_v1::model::MasterAuth;
9000 /// let x = MasterAuth::new().set_username("example");
9001 /// ```
9002 #[deprecated]
9003 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9004 self.username = v.into();
9005 self
9006 }
9007
9008 /// Sets the value of [password][crate::model::MasterAuth::password].
9009 ///
9010 /// # Example
9011 /// ```ignore,no_run
9012 /// # use google_cloud_container_v1::model::MasterAuth;
9013 /// let x = MasterAuth::new().set_password("example");
9014 /// ```
9015 #[deprecated]
9016 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.password = v.into();
9018 self
9019 }
9020
9021 /// Sets the value of [client_certificate_config][crate::model::MasterAuth::client_certificate_config].
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_container_v1::model::MasterAuth;
9026 /// use google_cloud_container_v1::model::ClientCertificateConfig;
9027 /// let x = MasterAuth::new().set_client_certificate_config(ClientCertificateConfig::default()/* use setters */);
9028 /// ```
9029 pub fn set_client_certificate_config<T>(mut self, v: T) -> Self
9030 where
9031 T: std::convert::Into<crate::model::ClientCertificateConfig>,
9032 {
9033 self.client_certificate_config = std::option::Option::Some(v.into());
9034 self
9035 }
9036
9037 /// Sets or clears the value of [client_certificate_config][crate::model::MasterAuth::client_certificate_config].
9038 ///
9039 /// # Example
9040 /// ```ignore,no_run
9041 /// # use google_cloud_container_v1::model::MasterAuth;
9042 /// use google_cloud_container_v1::model::ClientCertificateConfig;
9043 /// let x = MasterAuth::new().set_or_clear_client_certificate_config(Some(ClientCertificateConfig::default()/* use setters */));
9044 /// let x = MasterAuth::new().set_or_clear_client_certificate_config(None::<ClientCertificateConfig>);
9045 /// ```
9046 pub fn set_or_clear_client_certificate_config<T>(mut self, v: std::option::Option<T>) -> Self
9047 where
9048 T: std::convert::Into<crate::model::ClientCertificateConfig>,
9049 {
9050 self.client_certificate_config = v.map(|x| x.into());
9051 self
9052 }
9053
9054 /// Sets the value of [cluster_ca_certificate][crate::model::MasterAuth::cluster_ca_certificate].
9055 ///
9056 /// # Example
9057 /// ```ignore,no_run
9058 /// # use google_cloud_container_v1::model::MasterAuth;
9059 /// let x = MasterAuth::new().set_cluster_ca_certificate("example");
9060 /// ```
9061 pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
9062 mut self,
9063 v: T,
9064 ) -> Self {
9065 self.cluster_ca_certificate = v.into();
9066 self
9067 }
9068
9069 /// Sets the value of [client_certificate][crate::model::MasterAuth::client_certificate].
9070 ///
9071 /// # Example
9072 /// ```ignore,no_run
9073 /// # use google_cloud_container_v1::model::MasterAuth;
9074 /// let x = MasterAuth::new().set_client_certificate("example");
9075 /// ```
9076 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
9077 mut self,
9078 v: T,
9079 ) -> Self {
9080 self.client_certificate = v.into();
9081 self
9082 }
9083
9084 /// Sets the value of [client_key][crate::model::MasterAuth::client_key].
9085 ///
9086 /// # Example
9087 /// ```ignore,no_run
9088 /// # use google_cloud_container_v1::model::MasterAuth;
9089 /// let x = MasterAuth::new().set_client_key("example");
9090 /// ```
9091 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9092 self.client_key = v.into();
9093 self
9094 }
9095}
9096
9097impl wkt::message::Message for MasterAuth {
9098 fn typename() -> &'static str {
9099 "type.googleapis.com/google.container.v1.MasterAuth"
9100 }
9101}
9102
9103/// Configuration for client certificates on the cluster.
9104#[derive(Clone, Default, PartialEq)]
9105#[non_exhaustive]
9106pub struct ClientCertificateConfig {
9107 /// Issue a client certificate.
9108 pub issue_client_certificate: bool,
9109
9110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9111}
9112
9113impl ClientCertificateConfig {
9114 /// Creates a new default instance.
9115 pub fn new() -> Self {
9116 std::default::Default::default()
9117 }
9118
9119 /// Sets the value of [issue_client_certificate][crate::model::ClientCertificateConfig::issue_client_certificate].
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_container_v1::model::ClientCertificateConfig;
9124 /// let x = ClientCertificateConfig::new().set_issue_client_certificate(true);
9125 /// ```
9126 pub fn set_issue_client_certificate<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9127 self.issue_client_certificate = v.into();
9128 self
9129 }
9130}
9131
9132impl wkt::message::Message for ClientCertificateConfig {
9133 fn typename() -> &'static str {
9134 "type.googleapis.com/google.container.v1.ClientCertificateConfig"
9135 }
9136}
9137
9138/// Configuration for the addons that can be automatically spun up in the
9139/// cluster, enabling additional functionality.
9140#[derive(Clone, Default, PartialEq)]
9141#[non_exhaustive]
9142pub struct AddonsConfig {
9143 /// Configuration for the HTTP (L7) load balancing controller addon, which
9144 /// makes it easy to set up HTTP load balancers for services in a cluster.
9145 pub http_load_balancing: std::option::Option<crate::model::HttpLoadBalancing>,
9146
9147 /// Configuration for the horizontal pod autoscaling feature, which
9148 /// increases or decreases the number of replica pods a replication controller
9149 /// has based on the resource usage of the existing pods.
9150 pub horizontal_pod_autoscaling: std::option::Option<crate::model::HorizontalPodAutoscaling>,
9151
9152 /// Configuration for the Kubernetes Dashboard.
9153 /// This addon is deprecated, and will be disabled in 1.15. It is recommended
9154 /// to use the Cloud Console to manage and monitor your Kubernetes clusters,
9155 /// workloads and applications. For more information, see:
9156 /// <https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards>
9157 #[deprecated]
9158 pub kubernetes_dashboard: std::option::Option<crate::model::KubernetesDashboard>,
9159
9160 /// Configuration for NetworkPolicy. This only tracks whether the addon
9161 /// is enabled or not on the Master, it does not track whether network policy
9162 /// is enabled for the nodes.
9163 pub network_policy_config: std::option::Option<crate::model::NetworkPolicyConfig>,
9164
9165 /// Configuration for the Cloud Run addon, which allows the user to use a
9166 /// managed Knative service.
9167 pub cloud_run_config: std::option::Option<crate::model::CloudRunConfig>,
9168
9169 /// Configuration for NodeLocalDNS, a dns cache running on cluster nodes
9170 pub dns_cache_config: std::option::Option<crate::model::DnsCacheConfig>,
9171
9172 /// Configuration for the ConfigConnector add-on, a Kubernetes
9173 /// extension to manage hosted Google Cloud services through the Kubernetes
9174 /// API.
9175 pub config_connector_config: std::option::Option<crate::model::ConfigConnectorConfig>,
9176
9177 /// Configuration for the Compute Engine Persistent Disk CSI driver.
9178 pub gce_persistent_disk_csi_driver_config:
9179 std::option::Option<crate::model::GcePersistentDiskCsiDriverConfig>,
9180
9181 /// Configuration for the Filestore CSI driver.
9182 pub gcp_filestore_csi_driver_config:
9183 std::option::Option<crate::model::GcpFilestoreCsiDriverConfig>,
9184
9185 /// Configuration for the Backup for GKE agent addon.
9186 pub gke_backup_agent_config: std::option::Option<crate::model::GkeBackupAgentConfig>,
9187
9188 /// Configuration for the Cloud Storage Fuse CSI driver.
9189 pub gcs_fuse_csi_driver_config: std::option::Option<crate::model::GcsFuseCsiDriverConfig>,
9190
9191 /// Optional. Configuration for the StatefulHA add-on.
9192 pub stateful_ha_config: std::option::Option<crate::model::StatefulHAConfig>,
9193
9194 /// Configuration for the Cloud Storage Parallelstore CSI driver.
9195 pub parallelstore_csi_driver_config:
9196 std::option::Option<crate::model::ParallelstoreCsiDriverConfig>,
9197
9198 /// Optional. Configuration for Ray Operator addon.
9199 pub ray_operator_config: std::option::Option<crate::model::RayOperatorConfig>,
9200
9201 /// Configuration for the High Scale Checkpointing add-on.
9202 pub high_scale_checkpointing_config:
9203 std::option::Option<crate::model::HighScaleCheckpointingConfig>,
9204
9205 /// Configuration for the Lustre CSI driver.
9206 pub lustre_csi_driver_config: std::option::Option<crate::model::LustreCsiDriverConfig>,
9207
9208 /// Optional. Configuration for the Pod Snapshot feature.
9209 pub pod_snapshot_config: std::option::Option<crate::model::PodSnapshotConfig>,
9210
9211 /// Configuration for the Slurm Operator.
9212 pub slurm_operator_config: std::option::Option<crate::model::SlurmOperatorConfig>,
9213
9214 /// Optional. Configuration for the slice controller add-on.
9215 pub slice_controller_config: std::option::Option<crate::model::SliceControllerConfig>,
9216
9217 /// Optional. Configuration for the AgentSandbox addon.
9218 pub agent_sandbox_config: std::option::Option<crate::model::AgentSandboxConfig>,
9219
9220 /// Optional. Configuration for NodeReadinessController add-on.
9221 pub node_readiness_config: std::option::Option<crate::model::NodeReadinessConfig>,
9222
9223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9224}
9225
9226impl AddonsConfig {
9227 /// Creates a new default instance.
9228 pub fn new() -> Self {
9229 std::default::Default::default()
9230 }
9231
9232 /// Sets the value of [http_load_balancing][crate::model::AddonsConfig::http_load_balancing].
9233 ///
9234 /// # Example
9235 /// ```ignore,no_run
9236 /// # use google_cloud_container_v1::model::AddonsConfig;
9237 /// use google_cloud_container_v1::model::HttpLoadBalancing;
9238 /// let x = AddonsConfig::new().set_http_load_balancing(HttpLoadBalancing::default()/* use setters */);
9239 /// ```
9240 pub fn set_http_load_balancing<T>(mut self, v: T) -> Self
9241 where
9242 T: std::convert::Into<crate::model::HttpLoadBalancing>,
9243 {
9244 self.http_load_balancing = std::option::Option::Some(v.into());
9245 self
9246 }
9247
9248 /// Sets or clears the value of [http_load_balancing][crate::model::AddonsConfig::http_load_balancing].
9249 ///
9250 /// # Example
9251 /// ```ignore,no_run
9252 /// # use google_cloud_container_v1::model::AddonsConfig;
9253 /// use google_cloud_container_v1::model::HttpLoadBalancing;
9254 /// let x = AddonsConfig::new().set_or_clear_http_load_balancing(Some(HttpLoadBalancing::default()/* use setters */));
9255 /// let x = AddonsConfig::new().set_or_clear_http_load_balancing(None::<HttpLoadBalancing>);
9256 /// ```
9257 pub fn set_or_clear_http_load_balancing<T>(mut self, v: std::option::Option<T>) -> Self
9258 where
9259 T: std::convert::Into<crate::model::HttpLoadBalancing>,
9260 {
9261 self.http_load_balancing = v.map(|x| x.into());
9262 self
9263 }
9264
9265 /// Sets the value of [horizontal_pod_autoscaling][crate::model::AddonsConfig::horizontal_pod_autoscaling].
9266 ///
9267 /// # Example
9268 /// ```ignore,no_run
9269 /// # use google_cloud_container_v1::model::AddonsConfig;
9270 /// use google_cloud_container_v1::model::HorizontalPodAutoscaling;
9271 /// let x = AddonsConfig::new().set_horizontal_pod_autoscaling(HorizontalPodAutoscaling::default()/* use setters */);
9272 /// ```
9273 pub fn set_horizontal_pod_autoscaling<T>(mut self, v: T) -> Self
9274 where
9275 T: std::convert::Into<crate::model::HorizontalPodAutoscaling>,
9276 {
9277 self.horizontal_pod_autoscaling = std::option::Option::Some(v.into());
9278 self
9279 }
9280
9281 /// Sets or clears the value of [horizontal_pod_autoscaling][crate::model::AddonsConfig::horizontal_pod_autoscaling].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_container_v1::model::AddonsConfig;
9286 /// use google_cloud_container_v1::model::HorizontalPodAutoscaling;
9287 /// let x = AddonsConfig::new().set_or_clear_horizontal_pod_autoscaling(Some(HorizontalPodAutoscaling::default()/* use setters */));
9288 /// let x = AddonsConfig::new().set_or_clear_horizontal_pod_autoscaling(None::<HorizontalPodAutoscaling>);
9289 /// ```
9290 pub fn set_or_clear_horizontal_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
9291 where
9292 T: std::convert::Into<crate::model::HorizontalPodAutoscaling>,
9293 {
9294 self.horizontal_pod_autoscaling = v.map(|x| x.into());
9295 self
9296 }
9297
9298 /// Sets the value of [kubernetes_dashboard][crate::model::AddonsConfig::kubernetes_dashboard].
9299 ///
9300 /// # Example
9301 /// ```ignore,no_run
9302 /// # use google_cloud_container_v1::model::AddonsConfig;
9303 /// use google_cloud_container_v1::model::KubernetesDashboard;
9304 /// let x = AddonsConfig::new().set_kubernetes_dashboard(KubernetesDashboard::default()/* use setters */);
9305 /// ```
9306 #[deprecated]
9307 pub fn set_kubernetes_dashboard<T>(mut self, v: T) -> Self
9308 where
9309 T: std::convert::Into<crate::model::KubernetesDashboard>,
9310 {
9311 self.kubernetes_dashboard = std::option::Option::Some(v.into());
9312 self
9313 }
9314
9315 /// Sets or clears the value of [kubernetes_dashboard][crate::model::AddonsConfig::kubernetes_dashboard].
9316 ///
9317 /// # Example
9318 /// ```ignore,no_run
9319 /// # use google_cloud_container_v1::model::AddonsConfig;
9320 /// use google_cloud_container_v1::model::KubernetesDashboard;
9321 /// let x = AddonsConfig::new().set_or_clear_kubernetes_dashboard(Some(KubernetesDashboard::default()/* use setters */));
9322 /// let x = AddonsConfig::new().set_or_clear_kubernetes_dashboard(None::<KubernetesDashboard>);
9323 /// ```
9324 #[deprecated]
9325 pub fn set_or_clear_kubernetes_dashboard<T>(mut self, v: std::option::Option<T>) -> Self
9326 where
9327 T: std::convert::Into<crate::model::KubernetesDashboard>,
9328 {
9329 self.kubernetes_dashboard = v.map(|x| x.into());
9330 self
9331 }
9332
9333 /// Sets the value of [network_policy_config][crate::model::AddonsConfig::network_policy_config].
9334 ///
9335 /// # Example
9336 /// ```ignore,no_run
9337 /// # use google_cloud_container_v1::model::AddonsConfig;
9338 /// use google_cloud_container_v1::model::NetworkPolicyConfig;
9339 /// let x = AddonsConfig::new().set_network_policy_config(NetworkPolicyConfig::default()/* use setters */);
9340 /// ```
9341 pub fn set_network_policy_config<T>(mut self, v: T) -> Self
9342 where
9343 T: std::convert::Into<crate::model::NetworkPolicyConfig>,
9344 {
9345 self.network_policy_config = std::option::Option::Some(v.into());
9346 self
9347 }
9348
9349 /// Sets or clears the value of [network_policy_config][crate::model::AddonsConfig::network_policy_config].
9350 ///
9351 /// # Example
9352 /// ```ignore,no_run
9353 /// # use google_cloud_container_v1::model::AddonsConfig;
9354 /// use google_cloud_container_v1::model::NetworkPolicyConfig;
9355 /// let x = AddonsConfig::new().set_or_clear_network_policy_config(Some(NetworkPolicyConfig::default()/* use setters */));
9356 /// let x = AddonsConfig::new().set_or_clear_network_policy_config(None::<NetworkPolicyConfig>);
9357 /// ```
9358 pub fn set_or_clear_network_policy_config<T>(mut self, v: std::option::Option<T>) -> Self
9359 where
9360 T: std::convert::Into<crate::model::NetworkPolicyConfig>,
9361 {
9362 self.network_policy_config = v.map(|x| x.into());
9363 self
9364 }
9365
9366 /// Sets the value of [cloud_run_config][crate::model::AddonsConfig::cloud_run_config].
9367 ///
9368 /// # Example
9369 /// ```ignore,no_run
9370 /// # use google_cloud_container_v1::model::AddonsConfig;
9371 /// use google_cloud_container_v1::model::CloudRunConfig;
9372 /// let x = AddonsConfig::new().set_cloud_run_config(CloudRunConfig::default()/* use setters */);
9373 /// ```
9374 pub fn set_cloud_run_config<T>(mut self, v: T) -> Self
9375 where
9376 T: std::convert::Into<crate::model::CloudRunConfig>,
9377 {
9378 self.cloud_run_config = std::option::Option::Some(v.into());
9379 self
9380 }
9381
9382 /// Sets or clears the value of [cloud_run_config][crate::model::AddonsConfig::cloud_run_config].
9383 ///
9384 /// # Example
9385 /// ```ignore,no_run
9386 /// # use google_cloud_container_v1::model::AddonsConfig;
9387 /// use google_cloud_container_v1::model::CloudRunConfig;
9388 /// let x = AddonsConfig::new().set_or_clear_cloud_run_config(Some(CloudRunConfig::default()/* use setters */));
9389 /// let x = AddonsConfig::new().set_or_clear_cloud_run_config(None::<CloudRunConfig>);
9390 /// ```
9391 pub fn set_or_clear_cloud_run_config<T>(mut self, v: std::option::Option<T>) -> Self
9392 where
9393 T: std::convert::Into<crate::model::CloudRunConfig>,
9394 {
9395 self.cloud_run_config = v.map(|x| x.into());
9396 self
9397 }
9398
9399 /// Sets the value of [dns_cache_config][crate::model::AddonsConfig::dns_cache_config].
9400 ///
9401 /// # Example
9402 /// ```ignore,no_run
9403 /// # use google_cloud_container_v1::model::AddonsConfig;
9404 /// use google_cloud_container_v1::model::DnsCacheConfig;
9405 /// let x = AddonsConfig::new().set_dns_cache_config(DnsCacheConfig::default()/* use setters */);
9406 /// ```
9407 pub fn set_dns_cache_config<T>(mut self, v: T) -> Self
9408 where
9409 T: std::convert::Into<crate::model::DnsCacheConfig>,
9410 {
9411 self.dns_cache_config = std::option::Option::Some(v.into());
9412 self
9413 }
9414
9415 /// Sets or clears the value of [dns_cache_config][crate::model::AddonsConfig::dns_cache_config].
9416 ///
9417 /// # Example
9418 /// ```ignore,no_run
9419 /// # use google_cloud_container_v1::model::AddonsConfig;
9420 /// use google_cloud_container_v1::model::DnsCacheConfig;
9421 /// let x = AddonsConfig::new().set_or_clear_dns_cache_config(Some(DnsCacheConfig::default()/* use setters */));
9422 /// let x = AddonsConfig::new().set_or_clear_dns_cache_config(None::<DnsCacheConfig>);
9423 /// ```
9424 pub fn set_or_clear_dns_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
9425 where
9426 T: std::convert::Into<crate::model::DnsCacheConfig>,
9427 {
9428 self.dns_cache_config = v.map(|x| x.into());
9429 self
9430 }
9431
9432 /// Sets the value of [config_connector_config][crate::model::AddonsConfig::config_connector_config].
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_container_v1::model::AddonsConfig;
9437 /// use google_cloud_container_v1::model::ConfigConnectorConfig;
9438 /// let x = AddonsConfig::new().set_config_connector_config(ConfigConnectorConfig::default()/* use setters */);
9439 /// ```
9440 pub fn set_config_connector_config<T>(mut self, v: T) -> Self
9441 where
9442 T: std::convert::Into<crate::model::ConfigConnectorConfig>,
9443 {
9444 self.config_connector_config = std::option::Option::Some(v.into());
9445 self
9446 }
9447
9448 /// Sets or clears the value of [config_connector_config][crate::model::AddonsConfig::config_connector_config].
9449 ///
9450 /// # Example
9451 /// ```ignore,no_run
9452 /// # use google_cloud_container_v1::model::AddonsConfig;
9453 /// use google_cloud_container_v1::model::ConfigConnectorConfig;
9454 /// let x = AddonsConfig::new().set_or_clear_config_connector_config(Some(ConfigConnectorConfig::default()/* use setters */));
9455 /// let x = AddonsConfig::new().set_or_clear_config_connector_config(None::<ConfigConnectorConfig>);
9456 /// ```
9457 pub fn set_or_clear_config_connector_config<T>(mut self, v: std::option::Option<T>) -> Self
9458 where
9459 T: std::convert::Into<crate::model::ConfigConnectorConfig>,
9460 {
9461 self.config_connector_config = v.map(|x| x.into());
9462 self
9463 }
9464
9465 /// Sets the value of [gce_persistent_disk_csi_driver_config][crate::model::AddonsConfig::gce_persistent_disk_csi_driver_config].
9466 ///
9467 /// # Example
9468 /// ```ignore,no_run
9469 /// # use google_cloud_container_v1::model::AddonsConfig;
9470 /// use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
9471 /// let x = AddonsConfig::new().set_gce_persistent_disk_csi_driver_config(GcePersistentDiskCsiDriverConfig::default()/* use setters */);
9472 /// ```
9473 pub fn set_gce_persistent_disk_csi_driver_config<T>(mut self, v: T) -> Self
9474 where
9475 T: std::convert::Into<crate::model::GcePersistentDiskCsiDriverConfig>,
9476 {
9477 self.gce_persistent_disk_csi_driver_config = std::option::Option::Some(v.into());
9478 self
9479 }
9480
9481 /// Sets or clears the value of [gce_persistent_disk_csi_driver_config][crate::model::AddonsConfig::gce_persistent_disk_csi_driver_config].
9482 ///
9483 /// # Example
9484 /// ```ignore,no_run
9485 /// # use google_cloud_container_v1::model::AddonsConfig;
9486 /// use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
9487 /// let x = AddonsConfig::new().set_or_clear_gce_persistent_disk_csi_driver_config(Some(GcePersistentDiskCsiDriverConfig::default()/* use setters */));
9488 /// let x = AddonsConfig::new().set_or_clear_gce_persistent_disk_csi_driver_config(None::<GcePersistentDiskCsiDriverConfig>);
9489 /// ```
9490 pub fn set_or_clear_gce_persistent_disk_csi_driver_config<T>(
9491 mut self,
9492 v: std::option::Option<T>,
9493 ) -> Self
9494 where
9495 T: std::convert::Into<crate::model::GcePersistentDiskCsiDriverConfig>,
9496 {
9497 self.gce_persistent_disk_csi_driver_config = v.map(|x| x.into());
9498 self
9499 }
9500
9501 /// Sets the value of [gcp_filestore_csi_driver_config][crate::model::AddonsConfig::gcp_filestore_csi_driver_config].
9502 ///
9503 /// # Example
9504 /// ```ignore,no_run
9505 /// # use google_cloud_container_v1::model::AddonsConfig;
9506 /// use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
9507 /// let x = AddonsConfig::new().set_gcp_filestore_csi_driver_config(GcpFilestoreCsiDriverConfig::default()/* use setters */);
9508 /// ```
9509 pub fn set_gcp_filestore_csi_driver_config<T>(mut self, v: T) -> Self
9510 where
9511 T: std::convert::Into<crate::model::GcpFilestoreCsiDriverConfig>,
9512 {
9513 self.gcp_filestore_csi_driver_config = std::option::Option::Some(v.into());
9514 self
9515 }
9516
9517 /// Sets or clears the value of [gcp_filestore_csi_driver_config][crate::model::AddonsConfig::gcp_filestore_csi_driver_config].
9518 ///
9519 /// # Example
9520 /// ```ignore,no_run
9521 /// # use google_cloud_container_v1::model::AddonsConfig;
9522 /// use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
9523 /// let x = AddonsConfig::new().set_or_clear_gcp_filestore_csi_driver_config(Some(GcpFilestoreCsiDriverConfig::default()/* use setters */));
9524 /// let x = AddonsConfig::new().set_or_clear_gcp_filestore_csi_driver_config(None::<GcpFilestoreCsiDriverConfig>);
9525 /// ```
9526 pub fn set_or_clear_gcp_filestore_csi_driver_config<T>(
9527 mut self,
9528 v: std::option::Option<T>,
9529 ) -> Self
9530 where
9531 T: std::convert::Into<crate::model::GcpFilestoreCsiDriverConfig>,
9532 {
9533 self.gcp_filestore_csi_driver_config = v.map(|x| x.into());
9534 self
9535 }
9536
9537 /// Sets the value of [gke_backup_agent_config][crate::model::AddonsConfig::gke_backup_agent_config].
9538 ///
9539 /// # Example
9540 /// ```ignore,no_run
9541 /// # use google_cloud_container_v1::model::AddonsConfig;
9542 /// use google_cloud_container_v1::model::GkeBackupAgentConfig;
9543 /// let x = AddonsConfig::new().set_gke_backup_agent_config(GkeBackupAgentConfig::default()/* use setters */);
9544 /// ```
9545 pub fn set_gke_backup_agent_config<T>(mut self, v: T) -> Self
9546 where
9547 T: std::convert::Into<crate::model::GkeBackupAgentConfig>,
9548 {
9549 self.gke_backup_agent_config = std::option::Option::Some(v.into());
9550 self
9551 }
9552
9553 /// Sets or clears the value of [gke_backup_agent_config][crate::model::AddonsConfig::gke_backup_agent_config].
9554 ///
9555 /// # Example
9556 /// ```ignore,no_run
9557 /// # use google_cloud_container_v1::model::AddonsConfig;
9558 /// use google_cloud_container_v1::model::GkeBackupAgentConfig;
9559 /// let x = AddonsConfig::new().set_or_clear_gke_backup_agent_config(Some(GkeBackupAgentConfig::default()/* use setters */));
9560 /// let x = AddonsConfig::new().set_or_clear_gke_backup_agent_config(None::<GkeBackupAgentConfig>);
9561 /// ```
9562 pub fn set_or_clear_gke_backup_agent_config<T>(mut self, v: std::option::Option<T>) -> Self
9563 where
9564 T: std::convert::Into<crate::model::GkeBackupAgentConfig>,
9565 {
9566 self.gke_backup_agent_config = v.map(|x| x.into());
9567 self
9568 }
9569
9570 /// Sets the value of [gcs_fuse_csi_driver_config][crate::model::AddonsConfig::gcs_fuse_csi_driver_config].
9571 ///
9572 /// # Example
9573 /// ```ignore,no_run
9574 /// # use google_cloud_container_v1::model::AddonsConfig;
9575 /// use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
9576 /// let x = AddonsConfig::new().set_gcs_fuse_csi_driver_config(GcsFuseCsiDriverConfig::default()/* use setters */);
9577 /// ```
9578 pub fn set_gcs_fuse_csi_driver_config<T>(mut self, v: T) -> Self
9579 where
9580 T: std::convert::Into<crate::model::GcsFuseCsiDriverConfig>,
9581 {
9582 self.gcs_fuse_csi_driver_config = std::option::Option::Some(v.into());
9583 self
9584 }
9585
9586 /// Sets or clears the value of [gcs_fuse_csi_driver_config][crate::model::AddonsConfig::gcs_fuse_csi_driver_config].
9587 ///
9588 /// # Example
9589 /// ```ignore,no_run
9590 /// # use google_cloud_container_v1::model::AddonsConfig;
9591 /// use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
9592 /// let x = AddonsConfig::new().set_or_clear_gcs_fuse_csi_driver_config(Some(GcsFuseCsiDriverConfig::default()/* use setters */));
9593 /// let x = AddonsConfig::new().set_or_clear_gcs_fuse_csi_driver_config(None::<GcsFuseCsiDriverConfig>);
9594 /// ```
9595 pub fn set_or_clear_gcs_fuse_csi_driver_config<T>(mut self, v: std::option::Option<T>) -> Self
9596 where
9597 T: std::convert::Into<crate::model::GcsFuseCsiDriverConfig>,
9598 {
9599 self.gcs_fuse_csi_driver_config = v.map(|x| x.into());
9600 self
9601 }
9602
9603 /// Sets the value of [stateful_ha_config][crate::model::AddonsConfig::stateful_ha_config].
9604 ///
9605 /// # Example
9606 /// ```ignore,no_run
9607 /// # use google_cloud_container_v1::model::AddonsConfig;
9608 /// use google_cloud_container_v1::model::StatefulHAConfig;
9609 /// let x = AddonsConfig::new().set_stateful_ha_config(StatefulHAConfig::default()/* use setters */);
9610 /// ```
9611 pub fn set_stateful_ha_config<T>(mut self, v: T) -> Self
9612 where
9613 T: std::convert::Into<crate::model::StatefulHAConfig>,
9614 {
9615 self.stateful_ha_config = std::option::Option::Some(v.into());
9616 self
9617 }
9618
9619 /// Sets or clears the value of [stateful_ha_config][crate::model::AddonsConfig::stateful_ha_config].
9620 ///
9621 /// # Example
9622 /// ```ignore,no_run
9623 /// # use google_cloud_container_v1::model::AddonsConfig;
9624 /// use google_cloud_container_v1::model::StatefulHAConfig;
9625 /// let x = AddonsConfig::new().set_or_clear_stateful_ha_config(Some(StatefulHAConfig::default()/* use setters */));
9626 /// let x = AddonsConfig::new().set_or_clear_stateful_ha_config(None::<StatefulHAConfig>);
9627 /// ```
9628 pub fn set_or_clear_stateful_ha_config<T>(mut self, v: std::option::Option<T>) -> Self
9629 where
9630 T: std::convert::Into<crate::model::StatefulHAConfig>,
9631 {
9632 self.stateful_ha_config = v.map(|x| x.into());
9633 self
9634 }
9635
9636 /// Sets the value of [parallelstore_csi_driver_config][crate::model::AddonsConfig::parallelstore_csi_driver_config].
9637 ///
9638 /// # Example
9639 /// ```ignore,no_run
9640 /// # use google_cloud_container_v1::model::AddonsConfig;
9641 /// use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
9642 /// let x = AddonsConfig::new().set_parallelstore_csi_driver_config(ParallelstoreCsiDriverConfig::default()/* use setters */);
9643 /// ```
9644 pub fn set_parallelstore_csi_driver_config<T>(mut self, v: T) -> Self
9645 where
9646 T: std::convert::Into<crate::model::ParallelstoreCsiDriverConfig>,
9647 {
9648 self.parallelstore_csi_driver_config = std::option::Option::Some(v.into());
9649 self
9650 }
9651
9652 /// Sets or clears the value of [parallelstore_csi_driver_config][crate::model::AddonsConfig::parallelstore_csi_driver_config].
9653 ///
9654 /// # Example
9655 /// ```ignore,no_run
9656 /// # use google_cloud_container_v1::model::AddonsConfig;
9657 /// use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
9658 /// let x = AddonsConfig::new().set_or_clear_parallelstore_csi_driver_config(Some(ParallelstoreCsiDriverConfig::default()/* use setters */));
9659 /// let x = AddonsConfig::new().set_or_clear_parallelstore_csi_driver_config(None::<ParallelstoreCsiDriverConfig>);
9660 /// ```
9661 pub fn set_or_clear_parallelstore_csi_driver_config<T>(
9662 mut self,
9663 v: std::option::Option<T>,
9664 ) -> Self
9665 where
9666 T: std::convert::Into<crate::model::ParallelstoreCsiDriverConfig>,
9667 {
9668 self.parallelstore_csi_driver_config = v.map(|x| x.into());
9669 self
9670 }
9671
9672 /// Sets the value of [ray_operator_config][crate::model::AddonsConfig::ray_operator_config].
9673 ///
9674 /// # Example
9675 /// ```ignore,no_run
9676 /// # use google_cloud_container_v1::model::AddonsConfig;
9677 /// use google_cloud_container_v1::model::RayOperatorConfig;
9678 /// let x = AddonsConfig::new().set_ray_operator_config(RayOperatorConfig::default()/* use setters */);
9679 /// ```
9680 pub fn set_ray_operator_config<T>(mut self, v: T) -> Self
9681 where
9682 T: std::convert::Into<crate::model::RayOperatorConfig>,
9683 {
9684 self.ray_operator_config = std::option::Option::Some(v.into());
9685 self
9686 }
9687
9688 /// Sets or clears the value of [ray_operator_config][crate::model::AddonsConfig::ray_operator_config].
9689 ///
9690 /// # Example
9691 /// ```ignore,no_run
9692 /// # use google_cloud_container_v1::model::AddonsConfig;
9693 /// use google_cloud_container_v1::model::RayOperatorConfig;
9694 /// let x = AddonsConfig::new().set_or_clear_ray_operator_config(Some(RayOperatorConfig::default()/* use setters */));
9695 /// let x = AddonsConfig::new().set_or_clear_ray_operator_config(None::<RayOperatorConfig>);
9696 /// ```
9697 pub fn set_or_clear_ray_operator_config<T>(mut self, v: std::option::Option<T>) -> Self
9698 where
9699 T: std::convert::Into<crate::model::RayOperatorConfig>,
9700 {
9701 self.ray_operator_config = v.map(|x| x.into());
9702 self
9703 }
9704
9705 /// Sets the value of [high_scale_checkpointing_config][crate::model::AddonsConfig::high_scale_checkpointing_config].
9706 ///
9707 /// # Example
9708 /// ```ignore,no_run
9709 /// # use google_cloud_container_v1::model::AddonsConfig;
9710 /// use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
9711 /// let x = AddonsConfig::new().set_high_scale_checkpointing_config(HighScaleCheckpointingConfig::default()/* use setters */);
9712 /// ```
9713 pub fn set_high_scale_checkpointing_config<T>(mut self, v: T) -> Self
9714 where
9715 T: std::convert::Into<crate::model::HighScaleCheckpointingConfig>,
9716 {
9717 self.high_scale_checkpointing_config = std::option::Option::Some(v.into());
9718 self
9719 }
9720
9721 /// Sets or clears the value of [high_scale_checkpointing_config][crate::model::AddonsConfig::high_scale_checkpointing_config].
9722 ///
9723 /// # Example
9724 /// ```ignore,no_run
9725 /// # use google_cloud_container_v1::model::AddonsConfig;
9726 /// use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
9727 /// let x = AddonsConfig::new().set_or_clear_high_scale_checkpointing_config(Some(HighScaleCheckpointingConfig::default()/* use setters */));
9728 /// let x = AddonsConfig::new().set_or_clear_high_scale_checkpointing_config(None::<HighScaleCheckpointingConfig>);
9729 /// ```
9730 pub fn set_or_clear_high_scale_checkpointing_config<T>(
9731 mut self,
9732 v: std::option::Option<T>,
9733 ) -> Self
9734 where
9735 T: std::convert::Into<crate::model::HighScaleCheckpointingConfig>,
9736 {
9737 self.high_scale_checkpointing_config = v.map(|x| x.into());
9738 self
9739 }
9740
9741 /// Sets the value of [lustre_csi_driver_config][crate::model::AddonsConfig::lustre_csi_driver_config].
9742 ///
9743 /// # Example
9744 /// ```ignore,no_run
9745 /// # use google_cloud_container_v1::model::AddonsConfig;
9746 /// use google_cloud_container_v1::model::LustreCsiDriverConfig;
9747 /// let x = AddonsConfig::new().set_lustre_csi_driver_config(LustreCsiDriverConfig::default()/* use setters */);
9748 /// ```
9749 pub fn set_lustre_csi_driver_config<T>(mut self, v: T) -> Self
9750 where
9751 T: std::convert::Into<crate::model::LustreCsiDriverConfig>,
9752 {
9753 self.lustre_csi_driver_config = std::option::Option::Some(v.into());
9754 self
9755 }
9756
9757 /// Sets or clears the value of [lustre_csi_driver_config][crate::model::AddonsConfig::lustre_csi_driver_config].
9758 ///
9759 /// # Example
9760 /// ```ignore,no_run
9761 /// # use google_cloud_container_v1::model::AddonsConfig;
9762 /// use google_cloud_container_v1::model::LustreCsiDriverConfig;
9763 /// let x = AddonsConfig::new().set_or_clear_lustre_csi_driver_config(Some(LustreCsiDriverConfig::default()/* use setters */));
9764 /// let x = AddonsConfig::new().set_or_clear_lustre_csi_driver_config(None::<LustreCsiDriverConfig>);
9765 /// ```
9766 pub fn set_or_clear_lustre_csi_driver_config<T>(mut self, v: std::option::Option<T>) -> Self
9767 where
9768 T: std::convert::Into<crate::model::LustreCsiDriverConfig>,
9769 {
9770 self.lustre_csi_driver_config = v.map(|x| x.into());
9771 self
9772 }
9773
9774 /// Sets the value of [pod_snapshot_config][crate::model::AddonsConfig::pod_snapshot_config].
9775 ///
9776 /// # Example
9777 /// ```ignore,no_run
9778 /// # use google_cloud_container_v1::model::AddonsConfig;
9779 /// use google_cloud_container_v1::model::PodSnapshotConfig;
9780 /// let x = AddonsConfig::new().set_pod_snapshot_config(PodSnapshotConfig::default()/* use setters */);
9781 /// ```
9782 pub fn set_pod_snapshot_config<T>(mut self, v: T) -> Self
9783 where
9784 T: std::convert::Into<crate::model::PodSnapshotConfig>,
9785 {
9786 self.pod_snapshot_config = std::option::Option::Some(v.into());
9787 self
9788 }
9789
9790 /// Sets or clears the value of [pod_snapshot_config][crate::model::AddonsConfig::pod_snapshot_config].
9791 ///
9792 /// # Example
9793 /// ```ignore,no_run
9794 /// # use google_cloud_container_v1::model::AddonsConfig;
9795 /// use google_cloud_container_v1::model::PodSnapshotConfig;
9796 /// let x = AddonsConfig::new().set_or_clear_pod_snapshot_config(Some(PodSnapshotConfig::default()/* use setters */));
9797 /// let x = AddonsConfig::new().set_or_clear_pod_snapshot_config(None::<PodSnapshotConfig>);
9798 /// ```
9799 pub fn set_or_clear_pod_snapshot_config<T>(mut self, v: std::option::Option<T>) -> Self
9800 where
9801 T: std::convert::Into<crate::model::PodSnapshotConfig>,
9802 {
9803 self.pod_snapshot_config = v.map(|x| x.into());
9804 self
9805 }
9806
9807 /// Sets the value of [slurm_operator_config][crate::model::AddonsConfig::slurm_operator_config].
9808 ///
9809 /// # Example
9810 /// ```ignore,no_run
9811 /// # use google_cloud_container_v1::model::AddonsConfig;
9812 /// use google_cloud_container_v1::model::SlurmOperatorConfig;
9813 /// let x = AddonsConfig::new().set_slurm_operator_config(SlurmOperatorConfig::default()/* use setters */);
9814 /// ```
9815 pub fn set_slurm_operator_config<T>(mut self, v: T) -> Self
9816 where
9817 T: std::convert::Into<crate::model::SlurmOperatorConfig>,
9818 {
9819 self.slurm_operator_config = std::option::Option::Some(v.into());
9820 self
9821 }
9822
9823 /// Sets or clears the value of [slurm_operator_config][crate::model::AddonsConfig::slurm_operator_config].
9824 ///
9825 /// # Example
9826 /// ```ignore,no_run
9827 /// # use google_cloud_container_v1::model::AddonsConfig;
9828 /// use google_cloud_container_v1::model::SlurmOperatorConfig;
9829 /// let x = AddonsConfig::new().set_or_clear_slurm_operator_config(Some(SlurmOperatorConfig::default()/* use setters */));
9830 /// let x = AddonsConfig::new().set_or_clear_slurm_operator_config(None::<SlurmOperatorConfig>);
9831 /// ```
9832 pub fn set_or_clear_slurm_operator_config<T>(mut self, v: std::option::Option<T>) -> Self
9833 where
9834 T: std::convert::Into<crate::model::SlurmOperatorConfig>,
9835 {
9836 self.slurm_operator_config = v.map(|x| x.into());
9837 self
9838 }
9839
9840 /// Sets the value of [slice_controller_config][crate::model::AddonsConfig::slice_controller_config].
9841 ///
9842 /// # Example
9843 /// ```ignore,no_run
9844 /// # use google_cloud_container_v1::model::AddonsConfig;
9845 /// use google_cloud_container_v1::model::SliceControllerConfig;
9846 /// let x = AddonsConfig::new().set_slice_controller_config(SliceControllerConfig::default()/* use setters */);
9847 /// ```
9848 pub fn set_slice_controller_config<T>(mut self, v: T) -> Self
9849 where
9850 T: std::convert::Into<crate::model::SliceControllerConfig>,
9851 {
9852 self.slice_controller_config = std::option::Option::Some(v.into());
9853 self
9854 }
9855
9856 /// Sets or clears the value of [slice_controller_config][crate::model::AddonsConfig::slice_controller_config].
9857 ///
9858 /// # Example
9859 /// ```ignore,no_run
9860 /// # use google_cloud_container_v1::model::AddonsConfig;
9861 /// use google_cloud_container_v1::model::SliceControllerConfig;
9862 /// let x = AddonsConfig::new().set_or_clear_slice_controller_config(Some(SliceControllerConfig::default()/* use setters */));
9863 /// let x = AddonsConfig::new().set_or_clear_slice_controller_config(None::<SliceControllerConfig>);
9864 /// ```
9865 pub fn set_or_clear_slice_controller_config<T>(mut self, v: std::option::Option<T>) -> Self
9866 where
9867 T: std::convert::Into<crate::model::SliceControllerConfig>,
9868 {
9869 self.slice_controller_config = v.map(|x| x.into());
9870 self
9871 }
9872
9873 /// Sets the value of [agent_sandbox_config][crate::model::AddonsConfig::agent_sandbox_config].
9874 ///
9875 /// # Example
9876 /// ```ignore,no_run
9877 /// # use google_cloud_container_v1::model::AddonsConfig;
9878 /// use google_cloud_container_v1::model::AgentSandboxConfig;
9879 /// let x = AddonsConfig::new().set_agent_sandbox_config(AgentSandboxConfig::default()/* use setters */);
9880 /// ```
9881 pub fn set_agent_sandbox_config<T>(mut self, v: T) -> Self
9882 where
9883 T: std::convert::Into<crate::model::AgentSandboxConfig>,
9884 {
9885 self.agent_sandbox_config = std::option::Option::Some(v.into());
9886 self
9887 }
9888
9889 /// Sets or clears the value of [agent_sandbox_config][crate::model::AddonsConfig::agent_sandbox_config].
9890 ///
9891 /// # Example
9892 /// ```ignore,no_run
9893 /// # use google_cloud_container_v1::model::AddonsConfig;
9894 /// use google_cloud_container_v1::model::AgentSandboxConfig;
9895 /// let x = AddonsConfig::new().set_or_clear_agent_sandbox_config(Some(AgentSandboxConfig::default()/* use setters */));
9896 /// let x = AddonsConfig::new().set_or_clear_agent_sandbox_config(None::<AgentSandboxConfig>);
9897 /// ```
9898 pub fn set_or_clear_agent_sandbox_config<T>(mut self, v: std::option::Option<T>) -> Self
9899 where
9900 T: std::convert::Into<crate::model::AgentSandboxConfig>,
9901 {
9902 self.agent_sandbox_config = v.map(|x| x.into());
9903 self
9904 }
9905
9906 /// Sets the value of [node_readiness_config][crate::model::AddonsConfig::node_readiness_config].
9907 ///
9908 /// # Example
9909 /// ```ignore,no_run
9910 /// # use google_cloud_container_v1::model::AddonsConfig;
9911 /// use google_cloud_container_v1::model::NodeReadinessConfig;
9912 /// let x = AddonsConfig::new().set_node_readiness_config(NodeReadinessConfig::default()/* use setters */);
9913 /// ```
9914 pub fn set_node_readiness_config<T>(mut self, v: T) -> Self
9915 where
9916 T: std::convert::Into<crate::model::NodeReadinessConfig>,
9917 {
9918 self.node_readiness_config = std::option::Option::Some(v.into());
9919 self
9920 }
9921
9922 /// Sets or clears the value of [node_readiness_config][crate::model::AddonsConfig::node_readiness_config].
9923 ///
9924 /// # Example
9925 /// ```ignore,no_run
9926 /// # use google_cloud_container_v1::model::AddonsConfig;
9927 /// use google_cloud_container_v1::model::NodeReadinessConfig;
9928 /// let x = AddonsConfig::new().set_or_clear_node_readiness_config(Some(NodeReadinessConfig::default()/* use setters */));
9929 /// let x = AddonsConfig::new().set_or_clear_node_readiness_config(None::<NodeReadinessConfig>);
9930 /// ```
9931 pub fn set_or_clear_node_readiness_config<T>(mut self, v: std::option::Option<T>) -> Self
9932 where
9933 T: std::convert::Into<crate::model::NodeReadinessConfig>,
9934 {
9935 self.node_readiness_config = v.map(|x| x.into());
9936 self
9937 }
9938}
9939
9940impl wkt::message::Message for AddonsConfig {
9941 fn typename() -> &'static str {
9942 "type.googleapis.com/google.container.v1.AddonsConfig"
9943 }
9944}
9945
9946/// Configuration options for the HTTP (L7) load balancing controller addon,
9947/// which makes it easy to set up HTTP load balancers for services in a cluster.
9948#[derive(Clone, Default, PartialEq)]
9949#[non_exhaustive]
9950pub struct HttpLoadBalancing {
9951 /// Whether the HTTP Load Balancing controller is enabled in the cluster.
9952 /// When enabled, it runs a small pod in the cluster that manages the load
9953 /// balancers.
9954 pub disabled: bool,
9955
9956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9957}
9958
9959impl HttpLoadBalancing {
9960 /// Creates a new default instance.
9961 pub fn new() -> Self {
9962 std::default::Default::default()
9963 }
9964
9965 /// Sets the value of [disabled][crate::model::HttpLoadBalancing::disabled].
9966 ///
9967 /// # Example
9968 /// ```ignore,no_run
9969 /// # use google_cloud_container_v1::model::HttpLoadBalancing;
9970 /// let x = HttpLoadBalancing::new().set_disabled(true);
9971 /// ```
9972 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9973 self.disabled = v.into();
9974 self
9975 }
9976}
9977
9978impl wkt::message::Message for HttpLoadBalancing {
9979 fn typename() -> &'static str {
9980 "type.googleapis.com/google.container.v1.HttpLoadBalancing"
9981 }
9982}
9983
9984/// Configuration options for the horizontal pod autoscaling feature, which
9985/// increases or decreases the number of replica pods a replication controller
9986/// has based on the resource usage of the existing pods.
9987#[derive(Clone, Default, PartialEq)]
9988#[non_exhaustive]
9989pub struct HorizontalPodAutoscaling {
9990 /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster.
9991 /// When enabled, it ensures that metrics are collected into Stackdriver
9992 /// Monitoring.
9993 pub disabled: bool,
9994
9995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9996}
9997
9998impl HorizontalPodAutoscaling {
9999 /// Creates a new default instance.
10000 pub fn new() -> Self {
10001 std::default::Default::default()
10002 }
10003
10004 /// Sets the value of [disabled][crate::model::HorizontalPodAutoscaling::disabled].
10005 ///
10006 /// # Example
10007 /// ```ignore,no_run
10008 /// # use google_cloud_container_v1::model::HorizontalPodAutoscaling;
10009 /// let x = HorizontalPodAutoscaling::new().set_disabled(true);
10010 /// ```
10011 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10012 self.disabled = v.into();
10013 self
10014 }
10015}
10016
10017impl wkt::message::Message for HorizontalPodAutoscaling {
10018 fn typename() -> &'static str {
10019 "type.googleapis.com/google.container.v1.HorizontalPodAutoscaling"
10020 }
10021}
10022
10023/// Configuration for the Kubernetes Dashboard.
10024#[derive(Clone, Default, PartialEq)]
10025#[non_exhaustive]
10026pub struct KubernetesDashboard {
10027 /// Whether the Kubernetes Dashboard is enabled for this cluster.
10028 pub disabled: bool,
10029
10030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10031}
10032
10033impl KubernetesDashboard {
10034 /// Creates a new default instance.
10035 pub fn new() -> Self {
10036 std::default::Default::default()
10037 }
10038
10039 /// Sets the value of [disabled][crate::model::KubernetesDashboard::disabled].
10040 ///
10041 /// # Example
10042 /// ```ignore,no_run
10043 /// # use google_cloud_container_v1::model::KubernetesDashboard;
10044 /// let x = KubernetesDashboard::new().set_disabled(true);
10045 /// ```
10046 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10047 self.disabled = v.into();
10048 self
10049 }
10050}
10051
10052impl wkt::message::Message for KubernetesDashboard {
10053 fn typename() -> &'static str {
10054 "type.googleapis.com/google.container.v1.KubernetesDashboard"
10055 }
10056}
10057
10058/// Configuration for NetworkPolicy. This only tracks whether the addon
10059/// is enabled or not on the Master, it does not track whether network policy
10060/// is enabled for the nodes.
10061#[derive(Clone, Default, PartialEq)]
10062#[non_exhaustive]
10063pub struct NetworkPolicyConfig {
10064 /// Whether NetworkPolicy is enabled for this cluster.
10065 pub disabled: bool,
10066
10067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10068}
10069
10070impl NetworkPolicyConfig {
10071 /// Creates a new default instance.
10072 pub fn new() -> Self {
10073 std::default::Default::default()
10074 }
10075
10076 /// Sets the value of [disabled][crate::model::NetworkPolicyConfig::disabled].
10077 ///
10078 /// # Example
10079 /// ```ignore,no_run
10080 /// # use google_cloud_container_v1::model::NetworkPolicyConfig;
10081 /// let x = NetworkPolicyConfig::new().set_disabled(true);
10082 /// ```
10083 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10084 self.disabled = v.into();
10085 self
10086 }
10087}
10088
10089impl wkt::message::Message for NetworkPolicyConfig {
10090 fn typename() -> &'static str {
10091 "type.googleapis.com/google.container.v1.NetworkPolicyConfig"
10092 }
10093}
10094
10095/// Configuration for NodeLocal DNSCache
10096#[derive(Clone, Default, PartialEq)]
10097#[non_exhaustive]
10098pub struct DnsCacheConfig {
10099 /// Whether NodeLocal DNSCache is enabled for this cluster.
10100 pub enabled: bool,
10101
10102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10103}
10104
10105impl DnsCacheConfig {
10106 /// Creates a new default instance.
10107 pub fn new() -> Self {
10108 std::default::Default::default()
10109 }
10110
10111 /// Sets the value of [enabled][crate::model::DnsCacheConfig::enabled].
10112 ///
10113 /// # Example
10114 /// ```ignore,no_run
10115 /// # use google_cloud_container_v1::model::DnsCacheConfig;
10116 /// let x = DnsCacheConfig::new().set_enabled(true);
10117 /// ```
10118 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10119 self.enabled = v.into();
10120 self
10121 }
10122}
10123
10124impl wkt::message::Message for DnsCacheConfig {
10125 fn typename() -> &'static str {
10126 "type.googleapis.com/google.container.v1.DnsCacheConfig"
10127 }
10128}
10129
10130/// Configuration for controlling master global access settings.
10131#[derive(Clone, Default, PartialEq)]
10132#[non_exhaustive]
10133pub struct PrivateClusterMasterGlobalAccessConfig {
10134 /// Whenever master is accessible globally or not.
10135 pub enabled: bool,
10136
10137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10138}
10139
10140impl PrivateClusterMasterGlobalAccessConfig {
10141 /// Creates a new default instance.
10142 pub fn new() -> Self {
10143 std::default::Default::default()
10144 }
10145
10146 /// Sets the value of [enabled][crate::model::PrivateClusterMasterGlobalAccessConfig::enabled].
10147 ///
10148 /// # Example
10149 /// ```ignore,no_run
10150 /// # use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
10151 /// let x = PrivateClusterMasterGlobalAccessConfig::new().set_enabled(true);
10152 /// ```
10153 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10154 self.enabled = v.into();
10155 self
10156 }
10157}
10158
10159impl wkt::message::Message for PrivateClusterMasterGlobalAccessConfig {
10160 fn typename() -> &'static str {
10161 "type.googleapis.com/google.container.v1.PrivateClusterMasterGlobalAccessConfig"
10162 }
10163}
10164
10165/// Configuration options for private clusters.
10166#[derive(Clone, Default, PartialEq)]
10167#[non_exhaustive]
10168pub struct PrivateClusterConfig {
10169 /// Whether nodes have internal IP addresses only. If enabled, all nodes are
10170 /// given only RFC 1918 private addresses and communicate with the master via
10171 /// private networking.
10172 ///
10173 /// Deprecated: Use
10174 /// [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes]
10175 /// instead.
10176 ///
10177 /// [google.container.v1.NetworkConfig.default_enable_private_nodes]: crate::model::NetworkConfig::default_enable_private_nodes
10178 #[deprecated]
10179 pub enable_private_nodes: bool,
10180
10181 /// Whether the master's internal IP address is used as the cluster endpoint.
10182 ///
10183 /// Deprecated: Use
10184 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint]
10185 /// instead. Note that the value of enable_public_endpoint is reversed: if
10186 /// enable_private_endpoint is false, then enable_public_endpoint will be true.
10187 ///
10188 /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint
10189 #[deprecated]
10190 pub enable_private_endpoint: bool,
10191
10192 /// The IP range in CIDR notation to use for the hosted master network. This
10193 /// range will be used for assigning internal IP addresses to the master or
10194 /// set of masters, as well as the ILB VIP. This range must not overlap with
10195 /// any other ranges in use within the cluster's network.
10196 pub master_ipv4_cidr_block: std::string::String,
10197
10198 /// Output only. The internal IP address of this cluster's master endpoint.
10199 ///
10200 /// Deprecated: Use
10201 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint]
10202 /// instead.
10203 ///
10204 /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint
10205 #[deprecated]
10206 pub private_endpoint: std::string::String,
10207
10208 /// Output only. The external IP address of this cluster's master endpoint.
10209 ///
10210 /// Deprecated:Use
10211 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint]
10212 /// instead.
10213 ///
10214 /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::public_endpoint
10215 #[deprecated]
10216 pub public_endpoint: std::string::String,
10217
10218 /// Output only. The peering name in the customer VPC used by this cluster.
10219 pub peering_name: std::string::String,
10220
10221 /// Controls master global access settings.
10222 ///
10223 /// Deprecated: Use
10224 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][]
10225 /// instead.
10226 #[deprecated]
10227 pub master_global_access_config:
10228 std::option::Option<crate::model::PrivateClusterMasterGlobalAccessConfig>,
10229
10230 /// Subnet to provision the master's private endpoint during cluster creation.
10231 /// Specified in projects/*/regions/*/subnetworks/* format.
10232 ///
10233 /// Deprecated: Use
10234 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork]
10235 /// instead.
10236 ///
10237 /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint_subnetwork
10238 #[deprecated]
10239 pub private_endpoint_subnetwork: std::string::String,
10240
10241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10242}
10243
10244impl PrivateClusterConfig {
10245 /// Creates a new default instance.
10246 pub fn new() -> Self {
10247 std::default::Default::default()
10248 }
10249
10250 /// Sets the value of [enable_private_nodes][crate::model::PrivateClusterConfig::enable_private_nodes].
10251 ///
10252 /// # Example
10253 /// ```ignore,no_run
10254 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10255 /// let x = PrivateClusterConfig::new().set_enable_private_nodes(true);
10256 /// ```
10257 #[deprecated]
10258 pub fn set_enable_private_nodes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10259 self.enable_private_nodes = v.into();
10260 self
10261 }
10262
10263 /// Sets the value of [enable_private_endpoint][crate::model::PrivateClusterConfig::enable_private_endpoint].
10264 ///
10265 /// # Example
10266 /// ```ignore,no_run
10267 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10268 /// let x = PrivateClusterConfig::new().set_enable_private_endpoint(true);
10269 /// ```
10270 #[deprecated]
10271 pub fn set_enable_private_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10272 self.enable_private_endpoint = v.into();
10273 self
10274 }
10275
10276 /// Sets the value of [master_ipv4_cidr_block][crate::model::PrivateClusterConfig::master_ipv4_cidr_block].
10277 ///
10278 /// # Example
10279 /// ```ignore,no_run
10280 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10281 /// let x = PrivateClusterConfig::new().set_master_ipv4_cidr_block("example");
10282 /// ```
10283 pub fn set_master_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
10284 mut self,
10285 v: T,
10286 ) -> Self {
10287 self.master_ipv4_cidr_block = v.into();
10288 self
10289 }
10290
10291 /// Sets the value of [private_endpoint][crate::model::PrivateClusterConfig::private_endpoint].
10292 ///
10293 /// # Example
10294 /// ```ignore,no_run
10295 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10296 /// let x = PrivateClusterConfig::new().set_private_endpoint("example");
10297 /// ```
10298 #[deprecated]
10299 pub fn set_private_endpoint<T: std::convert::Into<std::string::String>>(
10300 mut self,
10301 v: T,
10302 ) -> Self {
10303 self.private_endpoint = v.into();
10304 self
10305 }
10306
10307 /// Sets the value of [public_endpoint][crate::model::PrivateClusterConfig::public_endpoint].
10308 ///
10309 /// # Example
10310 /// ```ignore,no_run
10311 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10312 /// let x = PrivateClusterConfig::new().set_public_endpoint("example");
10313 /// ```
10314 #[deprecated]
10315 pub fn set_public_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10316 self.public_endpoint = v.into();
10317 self
10318 }
10319
10320 /// Sets the value of [peering_name][crate::model::PrivateClusterConfig::peering_name].
10321 ///
10322 /// # Example
10323 /// ```ignore,no_run
10324 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10325 /// let x = PrivateClusterConfig::new().set_peering_name("example");
10326 /// ```
10327 pub fn set_peering_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10328 self.peering_name = v.into();
10329 self
10330 }
10331
10332 /// Sets the value of [master_global_access_config][crate::model::PrivateClusterConfig::master_global_access_config].
10333 ///
10334 /// # Example
10335 /// ```ignore,no_run
10336 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10337 /// use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
10338 /// let x = PrivateClusterConfig::new().set_master_global_access_config(PrivateClusterMasterGlobalAccessConfig::default()/* use setters */);
10339 /// ```
10340 #[deprecated]
10341 pub fn set_master_global_access_config<T>(mut self, v: T) -> Self
10342 where
10343 T: std::convert::Into<crate::model::PrivateClusterMasterGlobalAccessConfig>,
10344 {
10345 self.master_global_access_config = std::option::Option::Some(v.into());
10346 self
10347 }
10348
10349 /// Sets or clears the value of [master_global_access_config][crate::model::PrivateClusterConfig::master_global_access_config].
10350 ///
10351 /// # Example
10352 /// ```ignore,no_run
10353 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10354 /// use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
10355 /// let x = PrivateClusterConfig::new().set_or_clear_master_global_access_config(Some(PrivateClusterMasterGlobalAccessConfig::default()/* use setters */));
10356 /// let x = PrivateClusterConfig::new().set_or_clear_master_global_access_config(None::<PrivateClusterMasterGlobalAccessConfig>);
10357 /// ```
10358 #[deprecated]
10359 pub fn set_or_clear_master_global_access_config<T>(mut self, v: std::option::Option<T>) -> Self
10360 where
10361 T: std::convert::Into<crate::model::PrivateClusterMasterGlobalAccessConfig>,
10362 {
10363 self.master_global_access_config = v.map(|x| x.into());
10364 self
10365 }
10366
10367 /// Sets the value of [private_endpoint_subnetwork][crate::model::PrivateClusterConfig::private_endpoint_subnetwork].
10368 ///
10369 /// # Example
10370 /// ```ignore,no_run
10371 /// # use google_cloud_container_v1::model::PrivateClusterConfig;
10372 /// let x = PrivateClusterConfig::new().set_private_endpoint_subnetwork("example");
10373 /// ```
10374 #[deprecated]
10375 pub fn set_private_endpoint_subnetwork<T: std::convert::Into<std::string::String>>(
10376 mut self,
10377 v: T,
10378 ) -> Self {
10379 self.private_endpoint_subnetwork = v.into();
10380 self
10381 }
10382}
10383
10384impl wkt::message::Message for PrivateClusterConfig {
10385 fn typename() -> &'static str {
10386 "type.googleapis.com/google.container.v1.PrivateClusterConfig"
10387 }
10388}
10389
10390/// Configuration for returning group information from authenticators.
10391#[derive(Clone, Default, PartialEq)]
10392#[non_exhaustive]
10393pub struct AuthenticatorGroupsConfig {
10394 /// Whether this cluster should return group membership lookups
10395 /// during authentication using a group of security groups.
10396 pub enabled: bool,
10397
10398 /// The name of the security group-of-groups to be used. Only relevant
10399 /// if enabled = true.
10400 pub security_group: std::string::String,
10401
10402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10403}
10404
10405impl AuthenticatorGroupsConfig {
10406 /// Creates a new default instance.
10407 pub fn new() -> Self {
10408 std::default::Default::default()
10409 }
10410
10411 /// Sets the value of [enabled][crate::model::AuthenticatorGroupsConfig::enabled].
10412 ///
10413 /// # Example
10414 /// ```ignore,no_run
10415 /// # use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
10416 /// let x = AuthenticatorGroupsConfig::new().set_enabled(true);
10417 /// ```
10418 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10419 self.enabled = v.into();
10420 self
10421 }
10422
10423 /// Sets the value of [security_group][crate::model::AuthenticatorGroupsConfig::security_group].
10424 ///
10425 /// # Example
10426 /// ```ignore,no_run
10427 /// # use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
10428 /// let x = AuthenticatorGroupsConfig::new().set_security_group("example");
10429 /// ```
10430 pub fn set_security_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10431 self.security_group = v.into();
10432 self
10433 }
10434}
10435
10436impl wkt::message::Message for AuthenticatorGroupsConfig {
10437 fn typename() -> &'static str {
10438 "type.googleapis.com/google.container.v1.AuthenticatorGroupsConfig"
10439 }
10440}
10441
10442/// Configuration options for the Cloud Run feature.
10443#[derive(Clone, Default, PartialEq)]
10444#[non_exhaustive]
10445pub struct CloudRunConfig {
10446 /// Whether Cloud Run addon is enabled for this cluster.
10447 pub disabled: bool,
10448
10449 /// Which load balancer type is installed for Cloud Run.
10450 pub load_balancer_type: crate::model::cloud_run_config::LoadBalancerType,
10451
10452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10453}
10454
10455impl CloudRunConfig {
10456 /// Creates a new default instance.
10457 pub fn new() -> Self {
10458 std::default::Default::default()
10459 }
10460
10461 /// Sets the value of [disabled][crate::model::CloudRunConfig::disabled].
10462 ///
10463 /// # Example
10464 /// ```ignore,no_run
10465 /// # use google_cloud_container_v1::model::CloudRunConfig;
10466 /// let x = CloudRunConfig::new().set_disabled(true);
10467 /// ```
10468 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10469 self.disabled = v.into();
10470 self
10471 }
10472
10473 /// Sets the value of [load_balancer_type][crate::model::CloudRunConfig::load_balancer_type].
10474 ///
10475 /// # Example
10476 /// ```ignore,no_run
10477 /// # use google_cloud_container_v1::model::CloudRunConfig;
10478 /// use google_cloud_container_v1::model::cloud_run_config::LoadBalancerType;
10479 /// let x0 = CloudRunConfig::new().set_load_balancer_type(LoadBalancerType::External);
10480 /// let x1 = CloudRunConfig::new().set_load_balancer_type(LoadBalancerType::Internal);
10481 /// ```
10482 pub fn set_load_balancer_type<
10483 T: std::convert::Into<crate::model::cloud_run_config::LoadBalancerType>,
10484 >(
10485 mut self,
10486 v: T,
10487 ) -> Self {
10488 self.load_balancer_type = v.into();
10489 self
10490 }
10491}
10492
10493impl wkt::message::Message for CloudRunConfig {
10494 fn typename() -> &'static str {
10495 "type.googleapis.com/google.container.v1.CloudRunConfig"
10496 }
10497}
10498
10499/// Defines additional types related to [CloudRunConfig].
10500pub mod cloud_run_config {
10501 #[allow(unused_imports)]
10502 use super::*;
10503
10504 /// Load balancer type of ingress service of Cloud Run.
10505 ///
10506 /// # Working with unknown values
10507 ///
10508 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10509 /// additional enum variants at any time. Adding new variants is not considered
10510 /// a breaking change. Applications should write their code in anticipation of:
10511 ///
10512 /// - New values appearing in future releases of the client library, **and**
10513 /// - New values received dynamically, without application changes.
10514 ///
10515 /// Please consult the [Working with enums] section in the user guide for some
10516 /// guidelines.
10517 ///
10518 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10519 #[derive(Clone, Debug, PartialEq)]
10520 #[non_exhaustive]
10521 pub enum LoadBalancerType {
10522 /// Load balancer type for Cloud Run is unspecified.
10523 Unspecified,
10524 /// Install external load balancer for Cloud Run.
10525 External,
10526 /// Install internal load balancer for Cloud Run.
10527 Internal,
10528 /// If set, the enum was initialized with an unknown value.
10529 ///
10530 /// Applications can examine the value using [LoadBalancerType::value] or
10531 /// [LoadBalancerType::name].
10532 UnknownValue(load_balancer_type::UnknownValue),
10533 }
10534
10535 #[doc(hidden)]
10536 pub mod load_balancer_type {
10537 #[allow(unused_imports)]
10538 use super::*;
10539 #[derive(Clone, Debug, PartialEq)]
10540 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10541 }
10542
10543 impl LoadBalancerType {
10544 /// Gets the enum value.
10545 ///
10546 /// Returns `None` if the enum contains an unknown value deserialized from
10547 /// the string representation of enums.
10548 pub fn value(&self) -> std::option::Option<i32> {
10549 match self {
10550 Self::Unspecified => std::option::Option::Some(0),
10551 Self::External => std::option::Option::Some(1),
10552 Self::Internal => std::option::Option::Some(2),
10553 Self::UnknownValue(u) => u.0.value(),
10554 }
10555 }
10556
10557 /// Gets the enum value as a string.
10558 ///
10559 /// Returns `None` if the enum contains an unknown value deserialized from
10560 /// the integer representation of enums.
10561 pub fn name(&self) -> std::option::Option<&str> {
10562 match self {
10563 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
10564 Self::External => std::option::Option::Some("LOAD_BALANCER_TYPE_EXTERNAL"),
10565 Self::Internal => std::option::Option::Some("LOAD_BALANCER_TYPE_INTERNAL"),
10566 Self::UnknownValue(u) => u.0.name(),
10567 }
10568 }
10569 }
10570
10571 impl std::default::Default for LoadBalancerType {
10572 fn default() -> Self {
10573 use std::convert::From;
10574 Self::from(0)
10575 }
10576 }
10577
10578 impl std::fmt::Display for LoadBalancerType {
10579 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10580 wkt::internal::display_enum(f, self.name(), self.value())
10581 }
10582 }
10583
10584 impl std::convert::From<i32> for LoadBalancerType {
10585 fn from(value: i32) -> Self {
10586 match value {
10587 0 => Self::Unspecified,
10588 1 => Self::External,
10589 2 => Self::Internal,
10590 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
10591 wkt::internal::UnknownEnumValue::Integer(value),
10592 )),
10593 }
10594 }
10595 }
10596
10597 impl std::convert::From<&str> for LoadBalancerType {
10598 fn from(value: &str) -> Self {
10599 use std::string::ToString;
10600 match value {
10601 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
10602 "LOAD_BALANCER_TYPE_EXTERNAL" => Self::External,
10603 "LOAD_BALANCER_TYPE_INTERNAL" => Self::Internal,
10604 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
10605 wkt::internal::UnknownEnumValue::String(value.to_string()),
10606 )),
10607 }
10608 }
10609 }
10610
10611 impl serde::ser::Serialize for LoadBalancerType {
10612 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10613 where
10614 S: serde::Serializer,
10615 {
10616 match self {
10617 Self::Unspecified => serializer.serialize_i32(0),
10618 Self::External => serializer.serialize_i32(1),
10619 Self::Internal => serializer.serialize_i32(2),
10620 Self::UnknownValue(u) => u.0.serialize(serializer),
10621 }
10622 }
10623 }
10624
10625 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
10626 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10627 where
10628 D: serde::Deserializer<'de>,
10629 {
10630 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
10631 ".google.container.v1.CloudRunConfig.LoadBalancerType",
10632 ))
10633 }
10634 }
10635}
10636
10637/// Configuration options for the Config Connector add-on.
10638#[derive(Clone, Default, PartialEq)]
10639#[non_exhaustive]
10640pub struct ConfigConnectorConfig {
10641 /// Whether Cloud Connector is enabled for this cluster.
10642 pub enabled: bool,
10643
10644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10645}
10646
10647impl ConfigConnectorConfig {
10648 /// Creates a new default instance.
10649 pub fn new() -> Self {
10650 std::default::Default::default()
10651 }
10652
10653 /// Sets the value of [enabled][crate::model::ConfigConnectorConfig::enabled].
10654 ///
10655 /// # Example
10656 /// ```ignore,no_run
10657 /// # use google_cloud_container_v1::model::ConfigConnectorConfig;
10658 /// let x = ConfigConnectorConfig::new().set_enabled(true);
10659 /// ```
10660 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10661 self.enabled = v.into();
10662 self
10663 }
10664}
10665
10666impl wkt::message::Message for ConfigConnectorConfig {
10667 fn typename() -> &'static str {
10668 "type.googleapis.com/google.container.v1.ConfigConnectorConfig"
10669 }
10670}
10671
10672/// Configuration for the Compute Engine PD CSI driver.
10673#[derive(Clone, Default, PartialEq)]
10674#[non_exhaustive]
10675pub struct GcePersistentDiskCsiDriverConfig {
10676 /// Whether the Compute Engine PD CSI driver is enabled for this cluster.
10677 pub enabled: bool,
10678
10679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10680}
10681
10682impl GcePersistentDiskCsiDriverConfig {
10683 /// Creates a new default instance.
10684 pub fn new() -> Self {
10685 std::default::Default::default()
10686 }
10687
10688 /// Sets the value of [enabled][crate::model::GcePersistentDiskCsiDriverConfig::enabled].
10689 ///
10690 /// # Example
10691 /// ```ignore,no_run
10692 /// # use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
10693 /// let x = GcePersistentDiskCsiDriverConfig::new().set_enabled(true);
10694 /// ```
10695 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10696 self.enabled = v.into();
10697 self
10698 }
10699}
10700
10701impl wkt::message::Message for GcePersistentDiskCsiDriverConfig {
10702 fn typename() -> &'static str {
10703 "type.googleapis.com/google.container.v1.GcePersistentDiskCsiDriverConfig"
10704 }
10705}
10706
10707/// Configuration for the Filestore CSI driver.
10708#[derive(Clone, Default, PartialEq)]
10709#[non_exhaustive]
10710pub struct GcpFilestoreCsiDriverConfig {
10711 /// Whether the Filestore CSI driver is enabled for this cluster.
10712 pub enabled: bool,
10713
10714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10715}
10716
10717impl GcpFilestoreCsiDriverConfig {
10718 /// Creates a new default instance.
10719 pub fn new() -> Self {
10720 std::default::Default::default()
10721 }
10722
10723 /// Sets the value of [enabled][crate::model::GcpFilestoreCsiDriverConfig::enabled].
10724 ///
10725 /// # Example
10726 /// ```ignore,no_run
10727 /// # use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
10728 /// let x = GcpFilestoreCsiDriverConfig::new().set_enabled(true);
10729 /// ```
10730 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10731 self.enabled = v.into();
10732 self
10733 }
10734}
10735
10736impl wkt::message::Message for GcpFilestoreCsiDriverConfig {
10737 fn typename() -> &'static str {
10738 "type.googleapis.com/google.container.v1.GcpFilestoreCsiDriverConfig"
10739 }
10740}
10741
10742/// Configuration for the Cloud Storage Fuse CSI driver.
10743#[derive(Clone, Default, PartialEq)]
10744#[non_exhaustive]
10745pub struct GcsFuseCsiDriverConfig {
10746 /// Whether the Cloud Storage Fuse CSI driver is enabled for this cluster.
10747 pub enabled: bool,
10748
10749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10750}
10751
10752impl GcsFuseCsiDriverConfig {
10753 /// Creates a new default instance.
10754 pub fn new() -> Self {
10755 std::default::Default::default()
10756 }
10757
10758 /// Sets the value of [enabled][crate::model::GcsFuseCsiDriverConfig::enabled].
10759 ///
10760 /// # Example
10761 /// ```ignore,no_run
10762 /// # use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
10763 /// let x = GcsFuseCsiDriverConfig::new().set_enabled(true);
10764 /// ```
10765 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10766 self.enabled = v.into();
10767 self
10768 }
10769}
10770
10771impl wkt::message::Message for GcsFuseCsiDriverConfig {
10772 fn typename() -> &'static str {
10773 "type.googleapis.com/google.container.v1.GcsFuseCsiDriverConfig"
10774 }
10775}
10776
10777/// Configuration for the Cloud Storage Parallelstore CSI driver.
10778#[derive(Clone, Default, PartialEq)]
10779#[non_exhaustive]
10780pub struct ParallelstoreCsiDriverConfig {
10781 /// Whether the Cloud Storage Parallelstore CSI driver is enabled for this
10782 /// cluster.
10783 pub enabled: bool,
10784
10785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10786}
10787
10788impl ParallelstoreCsiDriverConfig {
10789 /// Creates a new default instance.
10790 pub fn new() -> Self {
10791 std::default::Default::default()
10792 }
10793
10794 /// Sets the value of [enabled][crate::model::ParallelstoreCsiDriverConfig::enabled].
10795 ///
10796 /// # Example
10797 /// ```ignore,no_run
10798 /// # use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
10799 /// let x = ParallelstoreCsiDriverConfig::new().set_enabled(true);
10800 /// ```
10801 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10802 self.enabled = v.into();
10803 self
10804 }
10805}
10806
10807impl wkt::message::Message for ParallelstoreCsiDriverConfig {
10808 fn typename() -> &'static str {
10809 "type.googleapis.com/google.container.v1.ParallelstoreCsiDriverConfig"
10810 }
10811}
10812
10813/// Configuration for the High Scale Checkpointing.
10814#[derive(Clone, Default, PartialEq)]
10815#[non_exhaustive]
10816pub struct HighScaleCheckpointingConfig {
10817 /// Whether the High Scale Checkpointing is enabled for this
10818 /// cluster.
10819 pub enabled: bool,
10820
10821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10822}
10823
10824impl HighScaleCheckpointingConfig {
10825 /// Creates a new default instance.
10826 pub fn new() -> Self {
10827 std::default::Default::default()
10828 }
10829
10830 /// Sets the value of [enabled][crate::model::HighScaleCheckpointingConfig::enabled].
10831 ///
10832 /// # Example
10833 /// ```ignore,no_run
10834 /// # use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
10835 /// let x = HighScaleCheckpointingConfig::new().set_enabled(true);
10836 /// ```
10837 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10838 self.enabled = v.into();
10839 self
10840 }
10841}
10842
10843impl wkt::message::Message for HighScaleCheckpointingConfig {
10844 fn typename() -> &'static str {
10845 "type.googleapis.com/google.container.v1.HighScaleCheckpointingConfig"
10846 }
10847}
10848
10849/// Configuration for the Lustre CSI driver.
10850#[derive(Clone, Default, PartialEq)]
10851#[non_exhaustive]
10852pub struct LustreCsiDriverConfig {
10853 /// Whether the Lustre CSI driver is enabled for this cluster.
10854 pub enabled: bool,
10855
10856 /// If set to true, the Lustre CSI driver will install Lustre kernel modules
10857 /// using port 6988.
10858 /// This serves as a workaround for a port conflict with the
10859 /// gke-metadata-server. This field is required ONLY under the following
10860 /// conditions:
10861 ///
10862 /// 1. The GKE node version is older than 1.33.2-gke.4655000.
10863 /// 1. You're connecting to a Lustre instance that has the
10864 /// 'gke-support-enabled' flag.
10865 /// Deprecated: This flag is no longer required as of GKE node version
10866 /// 1.33.2-gke.4655000, unless you are connecting to a Lustre instance
10867 /// that has the `gke-support-enabled` flag.
10868 #[deprecated]
10869 pub enable_legacy_lustre_port: bool,
10870
10871 /// When set to true, this disables multi-NIC support for the Lustre CSI
10872 /// driver.
10873 /// By default, GKE enables multi-NIC support, which allows the Lustre
10874 /// CSI driver to automatically detect and configure all suitable network
10875 /// interfaces on a node to maximize I/O performance for demanding workloads.
10876 pub disable_multi_nic: bool,
10877
10878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10879}
10880
10881impl LustreCsiDriverConfig {
10882 /// Creates a new default instance.
10883 pub fn new() -> Self {
10884 std::default::Default::default()
10885 }
10886
10887 /// Sets the value of [enabled][crate::model::LustreCsiDriverConfig::enabled].
10888 ///
10889 /// # Example
10890 /// ```ignore,no_run
10891 /// # use google_cloud_container_v1::model::LustreCsiDriverConfig;
10892 /// let x = LustreCsiDriverConfig::new().set_enabled(true);
10893 /// ```
10894 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10895 self.enabled = v.into();
10896 self
10897 }
10898
10899 /// Sets the value of [enable_legacy_lustre_port][crate::model::LustreCsiDriverConfig::enable_legacy_lustre_port].
10900 ///
10901 /// # Example
10902 /// ```ignore,no_run
10903 /// # use google_cloud_container_v1::model::LustreCsiDriverConfig;
10904 /// let x = LustreCsiDriverConfig::new().set_enable_legacy_lustre_port(true);
10905 /// ```
10906 #[deprecated]
10907 pub fn set_enable_legacy_lustre_port<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10908 self.enable_legacy_lustre_port = v.into();
10909 self
10910 }
10911
10912 /// Sets the value of [disable_multi_nic][crate::model::LustreCsiDriverConfig::disable_multi_nic].
10913 ///
10914 /// # Example
10915 /// ```ignore,no_run
10916 /// # use google_cloud_container_v1::model::LustreCsiDriverConfig;
10917 /// let x = LustreCsiDriverConfig::new().set_disable_multi_nic(true);
10918 /// ```
10919 pub fn set_disable_multi_nic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10920 self.disable_multi_nic = v.into();
10921 self
10922 }
10923}
10924
10925impl wkt::message::Message for LustreCsiDriverConfig {
10926 fn typename() -> &'static str {
10927 "type.googleapis.com/google.container.v1.LustreCsiDriverConfig"
10928 }
10929}
10930
10931/// Configuration for the Slurm Operator.
10932#[derive(Clone, Default, PartialEq)]
10933#[non_exhaustive]
10934pub struct SlurmOperatorConfig {
10935 /// When enabled, it runs a Slurm Operator that manages the set of compute pods
10936 /// for Slurm Cluster.
10937 pub enabled: bool,
10938
10939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10940}
10941
10942impl SlurmOperatorConfig {
10943 /// Creates a new default instance.
10944 pub fn new() -> Self {
10945 std::default::Default::default()
10946 }
10947
10948 /// Sets the value of [enabled][crate::model::SlurmOperatorConfig::enabled].
10949 ///
10950 /// # Example
10951 /// ```ignore,no_run
10952 /// # use google_cloud_container_v1::model::SlurmOperatorConfig;
10953 /// let x = SlurmOperatorConfig::new().set_enabled(true);
10954 /// ```
10955 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10956 self.enabled = v.into();
10957 self
10958 }
10959}
10960
10961impl wkt::message::Message for SlurmOperatorConfig {
10962 fn typename() -> &'static str {
10963 "type.googleapis.com/google.container.v1.SlurmOperatorConfig"
10964 }
10965}
10966
10967/// Configuration for the AgentSandbox addon.
10968#[derive(Clone, Default, PartialEq)]
10969#[non_exhaustive]
10970pub struct AgentSandboxConfig {
10971 /// Optional. Whether AgentSandbox is enabled for this cluster.
10972 pub enabled: bool,
10973
10974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10975}
10976
10977impl AgentSandboxConfig {
10978 /// Creates a new default instance.
10979 pub fn new() -> Self {
10980 std::default::Default::default()
10981 }
10982
10983 /// Sets the value of [enabled][crate::model::AgentSandboxConfig::enabled].
10984 ///
10985 /// # Example
10986 /// ```ignore,no_run
10987 /// # use google_cloud_container_v1::model::AgentSandboxConfig;
10988 /// let x = AgentSandboxConfig::new().set_enabled(true);
10989 /// ```
10990 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10991 self.enabled = v.into();
10992 self
10993 }
10994}
10995
10996impl wkt::message::Message for AgentSandboxConfig {
10997 fn typename() -> &'static str {
10998 "type.googleapis.com/google.container.v1.AgentSandboxConfig"
10999 }
11000}
11001
11002/// Configuration for the GKE Node Readiness Controller.
11003#[derive(Clone, Default, PartialEq)]
11004#[non_exhaustive]
11005pub struct NodeReadinessConfig {
11006 /// Optional. Whether the GKE Node Readiness Controller is enabled for this
11007 /// cluster.
11008 pub enabled: bool,
11009
11010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11011}
11012
11013impl NodeReadinessConfig {
11014 /// Creates a new default instance.
11015 pub fn new() -> Self {
11016 std::default::Default::default()
11017 }
11018
11019 /// Sets the value of [enabled][crate::model::NodeReadinessConfig::enabled].
11020 ///
11021 /// # Example
11022 /// ```ignore,no_run
11023 /// # use google_cloud_container_v1::model::NodeReadinessConfig;
11024 /// let x = NodeReadinessConfig::new().set_enabled(true);
11025 /// ```
11026 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11027 self.enabled = v.into();
11028 self
11029 }
11030}
11031
11032impl wkt::message::Message for NodeReadinessConfig {
11033 fn typename() -> &'static str {
11034 "type.googleapis.com/google.container.v1.NodeReadinessConfig"
11035 }
11036}
11037
11038/// Configuration for the Slice Controller.
11039#[derive(Clone, Default, PartialEq)]
11040#[non_exhaustive]
11041pub struct SliceControllerConfig {
11042 /// Optional. Indicates whether Slice Controller is enabled in the cluster.
11043 pub enabled: bool,
11044
11045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11046}
11047
11048impl SliceControllerConfig {
11049 /// Creates a new default instance.
11050 pub fn new() -> Self {
11051 std::default::Default::default()
11052 }
11053
11054 /// Sets the value of [enabled][crate::model::SliceControllerConfig::enabled].
11055 ///
11056 /// # Example
11057 /// ```ignore,no_run
11058 /// # use google_cloud_container_v1::model::SliceControllerConfig;
11059 /// let x = SliceControllerConfig::new().set_enabled(true);
11060 /// ```
11061 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11062 self.enabled = v.into();
11063 self
11064 }
11065}
11066
11067impl wkt::message::Message for SliceControllerConfig {
11068 fn typename() -> &'static str {
11069 "type.googleapis.com/google.container.v1.SliceControllerConfig"
11070 }
11071}
11072
11073/// Configuration options for the Ray Operator add-on.
11074#[derive(Clone, Default, PartialEq)]
11075#[non_exhaustive]
11076pub struct RayOperatorConfig {
11077 /// Whether the Ray Operator addon is enabled for this cluster.
11078 pub enabled: bool,
11079
11080 /// Optional. Logging configuration for Ray clusters.
11081 pub ray_cluster_logging_config: std::option::Option<crate::model::RayClusterLoggingConfig>,
11082
11083 /// Optional. Monitoring configuration for Ray clusters.
11084 pub ray_cluster_monitoring_config:
11085 std::option::Option<crate::model::RayClusterMonitoringConfig>,
11086
11087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11088}
11089
11090impl RayOperatorConfig {
11091 /// Creates a new default instance.
11092 pub fn new() -> Self {
11093 std::default::Default::default()
11094 }
11095
11096 /// Sets the value of [enabled][crate::model::RayOperatorConfig::enabled].
11097 ///
11098 /// # Example
11099 /// ```ignore,no_run
11100 /// # use google_cloud_container_v1::model::RayOperatorConfig;
11101 /// let x = RayOperatorConfig::new().set_enabled(true);
11102 /// ```
11103 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11104 self.enabled = v.into();
11105 self
11106 }
11107
11108 /// Sets the value of [ray_cluster_logging_config][crate::model::RayOperatorConfig::ray_cluster_logging_config].
11109 ///
11110 /// # Example
11111 /// ```ignore,no_run
11112 /// # use google_cloud_container_v1::model::RayOperatorConfig;
11113 /// use google_cloud_container_v1::model::RayClusterLoggingConfig;
11114 /// let x = RayOperatorConfig::new().set_ray_cluster_logging_config(RayClusterLoggingConfig::default()/* use setters */);
11115 /// ```
11116 pub fn set_ray_cluster_logging_config<T>(mut self, v: T) -> Self
11117 where
11118 T: std::convert::Into<crate::model::RayClusterLoggingConfig>,
11119 {
11120 self.ray_cluster_logging_config = std::option::Option::Some(v.into());
11121 self
11122 }
11123
11124 /// Sets or clears the value of [ray_cluster_logging_config][crate::model::RayOperatorConfig::ray_cluster_logging_config].
11125 ///
11126 /// # Example
11127 /// ```ignore,no_run
11128 /// # use google_cloud_container_v1::model::RayOperatorConfig;
11129 /// use google_cloud_container_v1::model::RayClusterLoggingConfig;
11130 /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_logging_config(Some(RayClusterLoggingConfig::default()/* use setters */));
11131 /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_logging_config(None::<RayClusterLoggingConfig>);
11132 /// ```
11133 pub fn set_or_clear_ray_cluster_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
11134 where
11135 T: std::convert::Into<crate::model::RayClusterLoggingConfig>,
11136 {
11137 self.ray_cluster_logging_config = v.map(|x| x.into());
11138 self
11139 }
11140
11141 /// Sets the value of [ray_cluster_monitoring_config][crate::model::RayOperatorConfig::ray_cluster_monitoring_config].
11142 ///
11143 /// # Example
11144 /// ```ignore,no_run
11145 /// # use google_cloud_container_v1::model::RayOperatorConfig;
11146 /// use google_cloud_container_v1::model::RayClusterMonitoringConfig;
11147 /// let x = RayOperatorConfig::new().set_ray_cluster_monitoring_config(RayClusterMonitoringConfig::default()/* use setters */);
11148 /// ```
11149 pub fn set_ray_cluster_monitoring_config<T>(mut self, v: T) -> Self
11150 where
11151 T: std::convert::Into<crate::model::RayClusterMonitoringConfig>,
11152 {
11153 self.ray_cluster_monitoring_config = std::option::Option::Some(v.into());
11154 self
11155 }
11156
11157 /// Sets or clears the value of [ray_cluster_monitoring_config][crate::model::RayOperatorConfig::ray_cluster_monitoring_config].
11158 ///
11159 /// # Example
11160 /// ```ignore,no_run
11161 /// # use google_cloud_container_v1::model::RayOperatorConfig;
11162 /// use google_cloud_container_v1::model::RayClusterMonitoringConfig;
11163 /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_monitoring_config(Some(RayClusterMonitoringConfig::default()/* use setters */));
11164 /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_monitoring_config(None::<RayClusterMonitoringConfig>);
11165 /// ```
11166 pub fn set_or_clear_ray_cluster_monitoring_config<T>(
11167 mut self,
11168 v: std::option::Option<T>,
11169 ) -> Self
11170 where
11171 T: std::convert::Into<crate::model::RayClusterMonitoringConfig>,
11172 {
11173 self.ray_cluster_monitoring_config = v.map(|x| x.into());
11174 self
11175 }
11176}
11177
11178impl wkt::message::Message for RayOperatorConfig {
11179 fn typename() -> &'static str {
11180 "type.googleapis.com/google.container.v1.RayOperatorConfig"
11181 }
11182}
11183
11184/// Configuration for the Backup for GKE Agent.
11185#[derive(Clone, Default, PartialEq)]
11186#[non_exhaustive]
11187pub struct GkeBackupAgentConfig {
11188 /// Whether the Backup for GKE agent is enabled for this cluster.
11189 pub enabled: bool,
11190
11191 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11192}
11193
11194impl GkeBackupAgentConfig {
11195 /// Creates a new default instance.
11196 pub fn new() -> Self {
11197 std::default::Default::default()
11198 }
11199
11200 /// Sets the value of [enabled][crate::model::GkeBackupAgentConfig::enabled].
11201 ///
11202 /// # Example
11203 /// ```ignore,no_run
11204 /// # use google_cloud_container_v1::model::GkeBackupAgentConfig;
11205 /// let x = GkeBackupAgentConfig::new().set_enabled(true);
11206 /// ```
11207 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11208 self.enabled = v.into();
11209 self
11210 }
11211}
11212
11213impl wkt::message::Message for GkeBackupAgentConfig {
11214 fn typename() -> &'static str {
11215 "type.googleapis.com/google.container.v1.GkeBackupAgentConfig"
11216 }
11217}
11218
11219/// Configuration for the Stateful HA add-on.
11220#[derive(Clone, Default, PartialEq)]
11221#[non_exhaustive]
11222pub struct StatefulHAConfig {
11223 /// Whether the Stateful HA add-on is enabled for this cluster.
11224 pub enabled: bool,
11225
11226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11227}
11228
11229impl StatefulHAConfig {
11230 /// Creates a new default instance.
11231 pub fn new() -> Self {
11232 std::default::Default::default()
11233 }
11234
11235 /// Sets the value of [enabled][crate::model::StatefulHAConfig::enabled].
11236 ///
11237 /// # Example
11238 /// ```ignore,no_run
11239 /// # use google_cloud_container_v1::model::StatefulHAConfig;
11240 /// let x = StatefulHAConfig::new().set_enabled(true);
11241 /// ```
11242 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11243 self.enabled = v.into();
11244 self
11245 }
11246}
11247
11248impl wkt::message::Message for StatefulHAConfig {
11249 fn typename() -> &'static str {
11250 "type.googleapis.com/google.container.v1.StatefulHAConfig"
11251 }
11252}
11253
11254/// Configuration options for the master authorized networks feature. Enabled
11255/// master authorized networks will disallow all external traffic to access
11256/// Kubernetes master through HTTPS except traffic from the given CIDR blocks,
11257/// Google Compute Engine Public IPs and Google Prod IPs.
11258#[derive(Clone, Default, PartialEq)]
11259#[non_exhaustive]
11260pub struct MasterAuthorizedNetworksConfig {
11261 /// Whether or not master authorized networks is enabled.
11262 pub enabled: bool,
11263
11264 /// cidr_blocks define up to 50 external networks that could access
11265 /// Kubernetes master through HTTPS.
11266 pub cidr_blocks: std::vec::Vec<crate::model::master_authorized_networks_config::CidrBlock>,
11267
11268 /// Whether master is accessible via Google Compute Engine Public IP addresses.
11269 pub gcp_public_cidrs_access_enabled: std::option::Option<bool>,
11270
11271 /// Whether master authorized networks is enforced on private endpoint or not.
11272 pub private_endpoint_enforcement_enabled: std::option::Option<bool>,
11273
11274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11275}
11276
11277impl MasterAuthorizedNetworksConfig {
11278 /// Creates a new default instance.
11279 pub fn new() -> Self {
11280 std::default::Default::default()
11281 }
11282
11283 /// Sets the value of [enabled][crate::model::MasterAuthorizedNetworksConfig::enabled].
11284 ///
11285 /// # Example
11286 /// ```ignore,no_run
11287 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11288 /// let x = MasterAuthorizedNetworksConfig::new().set_enabled(true);
11289 /// ```
11290 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11291 self.enabled = v.into();
11292 self
11293 }
11294
11295 /// Sets the value of [cidr_blocks][crate::model::MasterAuthorizedNetworksConfig::cidr_blocks].
11296 ///
11297 /// # Example
11298 /// ```ignore,no_run
11299 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11300 /// use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
11301 /// let x = MasterAuthorizedNetworksConfig::new()
11302 /// .set_cidr_blocks([
11303 /// CidrBlock::default()/* use setters */,
11304 /// CidrBlock::default()/* use (different) setters */,
11305 /// ]);
11306 /// ```
11307 pub fn set_cidr_blocks<T, V>(mut self, v: T) -> Self
11308 where
11309 T: std::iter::IntoIterator<Item = V>,
11310 V: std::convert::Into<crate::model::master_authorized_networks_config::CidrBlock>,
11311 {
11312 use std::iter::Iterator;
11313 self.cidr_blocks = v.into_iter().map(|i| i.into()).collect();
11314 self
11315 }
11316
11317 /// Sets the value of [gcp_public_cidrs_access_enabled][crate::model::MasterAuthorizedNetworksConfig::gcp_public_cidrs_access_enabled].
11318 ///
11319 /// # Example
11320 /// ```ignore,no_run
11321 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11322 /// let x = MasterAuthorizedNetworksConfig::new().set_gcp_public_cidrs_access_enabled(true);
11323 /// ```
11324 pub fn set_gcp_public_cidrs_access_enabled<T>(mut self, v: T) -> Self
11325 where
11326 T: std::convert::Into<bool>,
11327 {
11328 self.gcp_public_cidrs_access_enabled = std::option::Option::Some(v.into());
11329 self
11330 }
11331
11332 /// Sets or clears the value of [gcp_public_cidrs_access_enabled][crate::model::MasterAuthorizedNetworksConfig::gcp_public_cidrs_access_enabled].
11333 ///
11334 /// # Example
11335 /// ```ignore,no_run
11336 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11337 /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_gcp_public_cidrs_access_enabled(Some(false));
11338 /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_gcp_public_cidrs_access_enabled(None::<bool>);
11339 /// ```
11340 pub fn set_or_clear_gcp_public_cidrs_access_enabled<T>(
11341 mut self,
11342 v: std::option::Option<T>,
11343 ) -> Self
11344 where
11345 T: std::convert::Into<bool>,
11346 {
11347 self.gcp_public_cidrs_access_enabled = v.map(|x| x.into());
11348 self
11349 }
11350
11351 /// Sets the value of [private_endpoint_enforcement_enabled][crate::model::MasterAuthorizedNetworksConfig::private_endpoint_enforcement_enabled].
11352 ///
11353 /// # Example
11354 /// ```ignore,no_run
11355 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11356 /// let x = MasterAuthorizedNetworksConfig::new().set_private_endpoint_enforcement_enabled(true);
11357 /// ```
11358 pub fn set_private_endpoint_enforcement_enabled<T>(mut self, v: T) -> Self
11359 where
11360 T: std::convert::Into<bool>,
11361 {
11362 self.private_endpoint_enforcement_enabled = std::option::Option::Some(v.into());
11363 self
11364 }
11365
11366 /// Sets or clears the value of [private_endpoint_enforcement_enabled][crate::model::MasterAuthorizedNetworksConfig::private_endpoint_enforcement_enabled].
11367 ///
11368 /// # Example
11369 /// ```ignore,no_run
11370 /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
11371 /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_private_endpoint_enforcement_enabled(Some(false));
11372 /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_private_endpoint_enforcement_enabled(None::<bool>);
11373 /// ```
11374 pub fn set_or_clear_private_endpoint_enforcement_enabled<T>(
11375 mut self,
11376 v: std::option::Option<T>,
11377 ) -> Self
11378 where
11379 T: std::convert::Into<bool>,
11380 {
11381 self.private_endpoint_enforcement_enabled = v.map(|x| x.into());
11382 self
11383 }
11384}
11385
11386impl wkt::message::Message for MasterAuthorizedNetworksConfig {
11387 fn typename() -> &'static str {
11388 "type.googleapis.com/google.container.v1.MasterAuthorizedNetworksConfig"
11389 }
11390}
11391
11392/// Defines additional types related to [MasterAuthorizedNetworksConfig].
11393pub mod master_authorized_networks_config {
11394 #[allow(unused_imports)]
11395 use super::*;
11396
11397 /// CidrBlock contains an optional name and one CIDR block.
11398 #[derive(Clone, Default, PartialEq)]
11399 #[non_exhaustive]
11400 pub struct CidrBlock {
11401 /// display_name is an optional field for users to identify CIDR blocks.
11402 pub display_name: std::string::String,
11403
11404 /// cidr_block must be specified in CIDR notation.
11405 pub cidr_block: std::string::String,
11406
11407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11408 }
11409
11410 impl CidrBlock {
11411 /// Creates a new default instance.
11412 pub fn new() -> Self {
11413 std::default::Default::default()
11414 }
11415
11416 /// Sets the value of [display_name][crate::model::master_authorized_networks_config::CidrBlock::display_name].
11417 ///
11418 /// # Example
11419 /// ```ignore,no_run
11420 /// # use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
11421 /// let x = CidrBlock::new().set_display_name("example");
11422 /// ```
11423 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
11424 mut self,
11425 v: T,
11426 ) -> Self {
11427 self.display_name = v.into();
11428 self
11429 }
11430
11431 /// Sets the value of [cidr_block][crate::model::master_authorized_networks_config::CidrBlock::cidr_block].
11432 ///
11433 /// # Example
11434 /// ```ignore,no_run
11435 /// # use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
11436 /// let x = CidrBlock::new().set_cidr_block("example");
11437 /// ```
11438 pub fn set_cidr_block<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11439 self.cidr_block = v.into();
11440 self
11441 }
11442 }
11443
11444 impl wkt::message::Message for CidrBlock {
11445 fn typename() -> &'static str {
11446 "type.googleapis.com/google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock"
11447 }
11448 }
11449}
11450
11451/// Configuration for the legacy Attribute Based Access Control authorization
11452/// mode.
11453#[derive(Clone, Default, PartialEq)]
11454#[non_exhaustive]
11455pub struct LegacyAbac {
11456 /// Whether the ABAC authorizer is enabled for this cluster. When enabled,
11457 /// identities in the system, including service accounts, nodes, and
11458 /// controllers, will have statically granted permissions beyond those
11459 /// provided by the RBAC configuration or IAM.
11460 pub enabled: bool,
11461
11462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11463}
11464
11465impl LegacyAbac {
11466 /// Creates a new default instance.
11467 pub fn new() -> Self {
11468 std::default::Default::default()
11469 }
11470
11471 /// Sets the value of [enabled][crate::model::LegacyAbac::enabled].
11472 ///
11473 /// # Example
11474 /// ```ignore,no_run
11475 /// # use google_cloud_container_v1::model::LegacyAbac;
11476 /// let x = LegacyAbac::new().set_enabled(true);
11477 /// ```
11478 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11479 self.enabled = v.into();
11480 self
11481 }
11482}
11483
11484impl wkt::message::Message for LegacyAbac {
11485 fn typename() -> &'static str {
11486 "type.googleapis.com/google.container.v1.LegacyAbac"
11487 }
11488}
11489
11490/// Configuration options for the NetworkPolicy feature.
11491/// <https://kubernetes.io/docs/concepts/services-networking/networkpolicies/>
11492#[derive(Clone, Default, PartialEq)]
11493#[non_exhaustive]
11494pub struct NetworkPolicy {
11495 /// The selected network policy provider.
11496 pub provider: crate::model::network_policy::Provider,
11497
11498 /// Whether network policy is enabled on the cluster.
11499 pub enabled: bool,
11500
11501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11502}
11503
11504impl NetworkPolicy {
11505 /// Creates a new default instance.
11506 pub fn new() -> Self {
11507 std::default::Default::default()
11508 }
11509
11510 /// Sets the value of [provider][crate::model::NetworkPolicy::provider].
11511 ///
11512 /// # Example
11513 /// ```ignore,no_run
11514 /// # use google_cloud_container_v1::model::NetworkPolicy;
11515 /// use google_cloud_container_v1::model::network_policy::Provider;
11516 /// let x0 = NetworkPolicy::new().set_provider(Provider::Calico);
11517 /// ```
11518 pub fn set_provider<T: std::convert::Into<crate::model::network_policy::Provider>>(
11519 mut self,
11520 v: T,
11521 ) -> Self {
11522 self.provider = v.into();
11523 self
11524 }
11525
11526 /// Sets the value of [enabled][crate::model::NetworkPolicy::enabled].
11527 ///
11528 /// # Example
11529 /// ```ignore,no_run
11530 /// # use google_cloud_container_v1::model::NetworkPolicy;
11531 /// let x = NetworkPolicy::new().set_enabled(true);
11532 /// ```
11533 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11534 self.enabled = v.into();
11535 self
11536 }
11537}
11538
11539impl wkt::message::Message for NetworkPolicy {
11540 fn typename() -> &'static str {
11541 "type.googleapis.com/google.container.v1.NetworkPolicy"
11542 }
11543}
11544
11545/// Defines additional types related to [NetworkPolicy].
11546pub mod network_policy {
11547 #[allow(unused_imports)]
11548 use super::*;
11549
11550 /// Allowed Network Policy providers.
11551 ///
11552 /// # Working with unknown values
11553 ///
11554 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11555 /// additional enum variants at any time. Adding new variants is not considered
11556 /// a breaking change. Applications should write their code in anticipation of:
11557 ///
11558 /// - New values appearing in future releases of the client library, **and**
11559 /// - New values received dynamically, without application changes.
11560 ///
11561 /// Please consult the [Working with enums] section in the user guide for some
11562 /// guidelines.
11563 ///
11564 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11565 #[derive(Clone, Debug, PartialEq)]
11566 #[non_exhaustive]
11567 pub enum Provider {
11568 /// Not set
11569 Unspecified,
11570 /// Tigera (Calico Felix).
11571 Calico,
11572 /// If set, the enum was initialized with an unknown value.
11573 ///
11574 /// Applications can examine the value using [Provider::value] or
11575 /// [Provider::name].
11576 UnknownValue(provider::UnknownValue),
11577 }
11578
11579 #[doc(hidden)]
11580 pub mod provider {
11581 #[allow(unused_imports)]
11582 use super::*;
11583 #[derive(Clone, Debug, PartialEq)]
11584 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11585 }
11586
11587 impl Provider {
11588 /// Gets the enum value.
11589 ///
11590 /// Returns `None` if the enum contains an unknown value deserialized from
11591 /// the string representation of enums.
11592 pub fn value(&self) -> std::option::Option<i32> {
11593 match self {
11594 Self::Unspecified => std::option::Option::Some(0),
11595 Self::Calico => std::option::Option::Some(1),
11596 Self::UnknownValue(u) => u.0.value(),
11597 }
11598 }
11599
11600 /// Gets the enum value as a string.
11601 ///
11602 /// Returns `None` if the enum contains an unknown value deserialized from
11603 /// the integer representation of enums.
11604 pub fn name(&self) -> std::option::Option<&str> {
11605 match self {
11606 Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
11607 Self::Calico => std::option::Option::Some("CALICO"),
11608 Self::UnknownValue(u) => u.0.name(),
11609 }
11610 }
11611 }
11612
11613 impl std::default::Default for Provider {
11614 fn default() -> Self {
11615 use std::convert::From;
11616 Self::from(0)
11617 }
11618 }
11619
11620 impl std::fmt::Display for Provider {
11621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11622 wkt::internal::display_enum(f, self.name(), self.value())
11623 }
11624 }
11625
11626 impl std::convert::From<i32> for Provider {
11627 fn from(value: i32) -> Self {
11628 match value {
11629 0 => Self::Unspecified,
11630 1 => Self::Calico,
11631 _ => Self::UnknownValue(provider::UnknownValue(
11632 wkt::internal::UnknownEnumValue::Integer(value),
11633 )),
11634 }
11635 }
11636 }
11637
11638 impl std::convert::From<&str> for Provider {
11639 fn from(value: &str) -> Self {
11640 use std::string::ToString;
11641 match value {
11642 "PROVIDER_UNSPECIFIED" => Self::Unspecified,
11643 "CALICO" => Self::Calico,
11644 _ => Self::UnknownValue(provider::UnknownValue(
11645 wkt::internal::UnknownEnumValue::String(value.to_string()),
11646 )),
11647 }
11648 }
11649 }
11650
11651 impl serde::ser::Serialize for Provider {
11652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11653 where
11654 S: serde::Serializer,
11655 {
11656 match self {
11657 Self::Unspecified => serializer.serialize_i32(0),
11658 Self::Calico => serializer.serialize_i32(1),
11659 Self::UnknownValue(u) => u.0.serialize(serializer),
11660 }
11661 }
11662 }
11663
11664 impl<'de> serde::de::Deserialize<'de> for Provider {
11665 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11666 where
11667 D: serde::Deserializer<'de>,
11668 {
11669 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
11670 ".google.container.v1.NetworkPolicy.Provider",
11671 ))
11672 }
11673 }
11674}
11675
11676/// Configuration for Binary Authorization.
11677#[derive(Clone, Default, PartialEq)]
11678#[non_exhaustive]
11679pub struct BinaryAuthorization {
11680 /// This field is deprecated. Leave this unset and instead configure
11681 /// BinaryAuthorization using evaluation_mode. If evaluation_mode is set to
11682 /// anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored.
11683 #[deprecated]
11684 pub enabled: bool,
11685
11686 /// Mode of operation for binauthz policy evaluation. If unspecified, defaults
11687 /// to DISABLED.
11688 pub evaluation_mode: crate::model::binary_authorization::EvaluationMode,
11689
11690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11691}
11692
11693impl BinaryAuthorization {
11694 /// Creates a new default instance.
11695 pub fn new() -> Self {
11696 std::default::Default::default()
11697 }
11698
11699 /// Sets the value of [enabled][crate::model::BinaryAuthorization::enabled].
11700 ///
11701 /// # Example
11702 /// ```ignore,no_run
11703 /// # use google_cloud_container_v1::model::BinaryAuthorization;
11704 /// let x = BinaryAuthorization::new().set_enabled(true);
11705 /// ```
11706 #[deprecated]
11707 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11708 self.enabled = v.into();
11709 self
11710 }
11711
11712 /// Sets the value of [evaluation_mode][crate::model::BinaryAuthorization::evaluation_mode].
11713 ///
11714 /// # Example
11715 /// ```ignore,no_run
11716 /// # use google_cloud_container_v1::model::BinaryAuthorization;
11717 /// use google_cloud_container_v1::model::binary_authorization::EvaluationMode;
11718 /// let x0 = BinaryAuthorization::new().set_evaluation_mode(EvaluationMode::Disabled);
11719 /// let x1 = BinaryAuthorization::new().set_evaluation_mode(EvaluationMode::ProjectSingletonPolicyEnforce);
11720 /// ```
11721 pub fn set_evaluation_mode<
11722 T: std::convert::Into<crate::model::binary_authorization::EvaluationMode>,
11723 >(
11724 mut self,
11725 v: T,
11726 ) -> Self {
11727 self.evaluation_mode = v.into();
11728 self
11729 }
11730}
11731
11732impl wkt::message::Message for BinaryAuthorization {
11733 fn typename() -> &'static str {
11734 "type.googleapis.com/google.container.v1.BinaryAuthorization"
11735 }
11736}
11737
11738/// Defines additional types related to [BinaryAuthorization].
11739pub mod binary_authorization {
11740 #[allow(unused_imports)]
11741 use super::*;
11742
11743 /// Binary Authorization mode of operation.
11744 ///
11745 /// # Working with unknown values
11746 ///
11747 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11748 /// additional enum variants at any time. Adding new variants is not considered
11749 /// a breaking change. Applications should write their code in anticipation of:
11750 ///
11751 /// - New values appearing in future releases of the client library, **and**
11752 /// - New values received dynamically, without application changes.
11753 ///
11754 /// Please consult the [Working with enums] section in the user guide for some
11755 /// guidelines.
11756 ///
11757 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11758 #[derive(Clone, Debug, PartialEq)]
11759 #[non_exhaustive]
11760 pub enum EvaluationMode {
11761 /// Default value
11762 Unspecified,
11763 /// Disable BinaryAuthorization
11764 Disabled,
11765 /// Enforce Kubernetes admission requests with BinaryAuthorization using the
11766 /// project's singleton policy. This is equivalent to setting the
11767 /// enabled boolean to true.
11768 ProjectSingletonPolicyEnforce,
11769 /// If set, the enum was initialized with an unknown value.
11770 ///
11771 /// Applications can examine the value using [EvaluationMode::value] or
11772 /// [EvaluationMode::name].
11773 UnknownValue(evaluation_mode::UnknownValue),
11774 }
11775
11776 #[doc(hidden)]
11777 pub mod evaluation_mode {
11778 #[allow(unused_imports)]
11779 use super::*;
11780 #[derive(Clone, Debug, PartialEq)]
11781 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11782 }
11783
11784 impl EvaluationMode {
11785 /// Gets the enum value.
11786 ///
11787 /// Returns `None` if the enum contains an unknown value deserialized from
11788 /// the string representation of enums.
11789 pub fn value(&self) -> std::option::Option<i32> {
11790 match self {
11791 Self::Unspecified => std::option::Option::Some(0),
11792 Self::Disabled => std::option::Option::Some(1),
11793 Self::ProjectSingletonPolicyEnforce => std::option::Option::Some(2),
11794 Self::UnknownValue(u) => u.0.value(),
11795 }
11796 }
11797
11798 /// Gets the enum value as a string.
11799 ///
11800 /// Returns `None` if the enum contains an unknown value deserialized from
11801 /// the integer representation of enums.
11802 pub fn name(&self) -> std::option::Option<&str> {
11803 match self {
11804 Self::Unspecified => std::option::Option::Some("EVALUATION_MODE_UNSPECIFIED"),
11805 Self::Disabled => std::option::Option::Some("DISABLED"),
11806 Self::ProjectSingletonPolicyEnforce => {
11807 std::option::Option::Some("PROJECT_SINGLETON_POLICY_ENFORCE")
11808 }
11809 Self::UnknownValue(u) => u.0.name(),
11810 }
11811 }
11812 }
11813
11814 impl std::default::Default for EvaluationMode {
11815 fn default() -> Self {
11816 use std::convert::From;
11817 Self::from(0)
11818 }
11819 }
11820
11821 impl std::fmt::Display for EvaluationMode {
11822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11823 wkt::internal::display_enum(f, self.name(), self.value())
11824 }
11825 }
11826
11827 impl std::convert::From<i32> for EvaluationMode {
11828 fn from(value: i32) -> Self {
11829 match value {
11830 0 => Self::Unspecified,
11831 1 => Self::Disabled,
11832 2 => Self::ProjectSingletonPolicyEnforce,
11833 _ => Self::UnknownValue(evaluation_mode::UnknownValue(
11834 wkt::internal::UnknownEnumValue::Integer(value),
11835 )),
11836 }
11837 }
11838 }
11839
11840 impl std::convert::From<&str> for EvaluationMode {
11841 fn from(value: &str) -> Self {
11842 use std::string::ToString;
11843 match value {
11844 "EVALUATION_MODE_UNSPECIFIED" => Self::Unspecified,
11845 "DISABLED" => Self::Disabled,
11846 "PROJECT_SINGLETON_POLICY_ENFORCE" => Self::ProjectSingletonPolicyEnforce,
11847 _ => Self::UnknownValue(evaluation_mode::UnknownValue(
11848 wkt::internal::UnknownEnumValue::String(value.to_string()),
11849 )),
11850 }
11851 }
11852 }
11853
11854 impl serde::ser::Serialize for EvaluationMode {
11855 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11856 where
11857 S: serde::Serializer,
11858 {
11859 match self {
11860 Self::Unspecified => serializer.serialize_i32(0),
11861 Self::Disabled => serializer.serialize_i32(1),
11862 Self::ProjectSingletonPolicyEnforce => serializer.serialize_i32(2),
11863 Self::UnknownValue(u) => u.0.serialize(serializer),
11864 }
11865 }
11866 }
11867
11868 impl<'de> serde::de::Deserialize<'de> for EvaluationMode {
11869 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11870 where
11871 D: serde::Deserializer<'de>,
11872 {
11873 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationMode>::new(
11874 ".google.container.v1.BinaryAuthorization.EvaluationMode",
11875 ))
11876 }
11877 }
11878}
11879
11880/// [PRIVATE FIELD]
11881/// Config for pod CIDR size overprovisioning.
11882#[derive(Clone, Default, PartialEq)]
11883#[non_exhaustive]
11884pub struct PodCIDROverprovisionConfig {
11885 /// Whether Pod CIDR overprovisioning is disabled.
11886 /// Note: Pod CIDR overprovisioning is enabled by default.
11887 pub disable: bool,
11888
11889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11890}
11891
11892impl PodCIDROverprovisionConfig {
11893 /// Creates a new default instance.
11894 pub fn new() -> Self {
11895 std::default::Default::default()
11896 }
11897
11898 /// Sets the value of [disable][crate::model::PodCIDROverprovisionConfig::disable].
11899 ///
11900 /// # Example
11901 /// ```ignore,no_run
11902 /// # use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
11903 /// let x = PodCIDROverprovisionConfig::new().set_disable(true);
11904 /// ```
11905 pub fn set_disable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11906 self.disable = v.into();
11907 self
11908 }
11909}
11910
11911impl wkt::message::Message for PodCIDROverprovisionConfig {
11912 fn typename() -> &'static str {
11913 "type.googleapis.com/google.container.v1.PodCIDROverprovisionConfig"
11914 }
11915}
11916
11917/// Configuration for controlling how IPs are allocated in the cluster.
11918#[derive(Clone, Default, PartialEq)]
11919#[non_exhaustive]
11920pub struct IPAllocationPolicy {
11921 /// Whether alias IPs will be used for pod IPs in the cluster.
11922 /// This is used in conjunction with use_routes. It cannot
11923 /// be true if use_routes is true. If both use_ip_aliases and use_routes are
11924 /// false, then the server picks the default IP allocation mode
11925 pub use_ip_aliases: bool,
11926
11927 /// Whether a new subnetwork will be created automatically for the cluster.
11928 ///
11929 /// This field is only applicable when `use_ip_aliases` is true.
11930 pub create_subnetwork: bool,
11931
11932 /// A custom subnetwork name to be used if `create_subnetwork` is true. If
11933 /// this field is empty, then an automatic name will be chosen for the new
11934 /// subnetwork.
11935 pub subnetwork_name: std::string::String,
11936
11937 /// This field is deprecated, use cluster_ipv4_cidr_block.
11938 #[deprecated]
11939 pub cluster_ipv4_cidr: std::string::String,
11940
11941 /// This field is deprecated, use node_ipv4_cidr_block.
11942 #[deprecated]
11943 pub node_ipv4_cidr: std::string::String,
11944
11945 /// This field is deprecated, use services_ipv4_cidr_block.
11946 #[deprecated]
11947 pub services_ipv4_cidr: std::string::String,
11948
11949 /// The name of the secondary range to be used for the cluster CIDR
11950 /// block. The secondary range will be used for pod IP
11951 /// addresses. This must be an existing secondary range associated
11952 /// with the cluster subnetwork.
11953 ///
11954 /// This field is only applicable with use_ip_aliases is true and
11955 /// create_subnetwork is false.
11956 pub cluster_secondary_range_name: std::string::String,
11957
11958 /// The name of the secondary range to be used as for the services
11959 /// CIDR block. The secondary range will be used for service
11960 /// ClusterIPs. This must be an existing secondary range associated
11961 /// with the cluster subnetwork.
11962 ///
11963 /// This field is only applicable with use_ip_aliases is true and
11964 /// create_subnetwork is false.
11965 pub services_secondary_range_name: std::string::String,
11966
11967 /// The IP address range for the cluster pod IPs. If this field is set, then
11968 /// `cluster.cluster_ipv4_cidr` must be left blank.
11969 ///
11970 /// This field is only applicable when `use_ip_aliases` is true.
11971 ///
11972 /// Set to blank to have a range chosen with the default size.
11973 ///
11974 /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
11975 /// netmask.
11976 ///
11977 /// Set to a
11978 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
11979 /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
11980 /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
11981 /// to use.
11982 pub cluster_ipv4_cidr_block: std::string::String,
11983
11984 /// The IP address range of the instance IPs in this cluster.
11985 ///
11986 /// This is applicable only if `create_subnetwork` is true.
11987 ///
11988 /// Set to blank to have a range chosen with the default size.
11989 ///
11990 /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
11991 /// netmask.
11992 ///
11993 /// Set to a
11994 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
11995 /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
11996 /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
11997 /// to use.
11998 pub node_ipv4_cidr_block: std::string::String,
11999
12000 /// The IP address range of the services IPs in this cluster. If blank, a range
12001 /// will be automatically chosen with the default size.
12002 ///
12003 /// This field is only applicable when `use_ip_aliases` is true.
12004 ///
12005 /// Set to blank to have a range chosen with the default size.
12006 ///
12007 /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
12008 /// netmask.
12009 ///
12010 /// Set to a
12011 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
12012 /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
12013 /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
12014 /// to use.
12015 pub services_ipv4_cidr_block: std::string::String,
12016
12017 /// The IP address range of the Cloud TPUs in this cluster. If unspecified, a
12018 /// range will be automatically chosen with the default size.
12019 ///
12020 /// This field is only applicable when `use_ip_aliases` is true.
12021 ///
12022 /// If unspecified, the range will use the default size.
12023 ///
12024 /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
12025 /// netmask.
12026 ///
12027 /// Set to a
12028 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
12029 /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
12030 /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
12031 /// to use.
12032 ///
12033 /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
12034 /// date for 2VM TPU is 2025-04-25.
12035 #[deprecated]
12036 pub tpu_ipv4_cidr_block: std::string::String,
12037
12038 /// Whether routes will be used for pod IPs in the cluster.
12039 /// This is used in conjunction with use_ip_aliases. It cannot be true if
12040 /// use_ip_aliases is true. If both use_ip_aliases and use_routes are false,
12041 /// then the server picks the default IP allocation mode
12042 pub use_routes: bool,
12043
12044 /// The IP stack type of the cluster
12045 pub stack_type: crate::model::StackType,
12046
12047 /// The ipv6 access type (internal or external) when create_subnetwork is true
12048 pub ipv6_access_type: crate::model::IPv6AccessType,
12049
12050 /// [PRIVATE FIELD]
12051 /// Pod CIDR size overprovisioning config for the cluster.
12052 ///
12053 /// Pod CIDR size per node depends on max_pods_per_node. By default, the value
12054 /// of max_pods_per_node is doubled and then rounded off to next power of 2 to
12055 /// get the size of pod CIDR block per node.
12056 /// Example: max_pods_per_node of 30 would result in 64 IPs (/26).
12057 ///
12058 /// This config can disable the doubling of IPs (we still round off to next
12059 /// power of 2)
12060 /// Example: max_pods_per_node of 30 will result in 32 IPs (/27) when
12061 /// overprovisioning is disabled.
12062 pub pod_cidr_overprovision_config:
12063 std::option::Option<crate::model::PodCIDROverprovisionConfig>,
12064
12065 /// Output only. The subnet's IPv6 CIDR block used by nodes and pods.
12066 pub subnet_ipv6_cidr_block: std::string::String,
12067
12068 /// Output only. The services IPv6 CIDR block for the cluster.
12069 pub services_ipv6_cidr_block: std::string::String,
12070
12071 /// Output only. The additional pod ranges that are added to the cluster.
12072 /// These pod ranges can be used by new node pools to allocate pod IPs
12073 /// automatically. Once the range is removed it will not show up in
12074 /// IPAllocationPolicy.
12075 pub additional_pod_ranges_config: std::option::Option<crate::model::AdditionalPodRangesConfig>,
12076
12077 /// Output only. The utilization of the cluster default IPv4 range for the
12078 /// pod. The ratio is Usage/[Total number of IPs in the secondary range],
12079 /// Usage=numNodes*numZones*podIPsPerNode.
12080 pub default_pod_ipv4_range_utilization: f64,
12081
12082 /// Output only. The additional IP ranges that are added to the cluster.
12083 /// These IP ranges can be used by new node pools to allocate node and pod IPs
12084 /// automatically.
12085 /// Each AdditionalIPRangesConfig corresponds to a single subnetwork.
12086 /// Once a range is removed it will not show up in IPAllocationPolicy.
12087 pub additional_ip_ranges_configs: std::vec::Vec<crate::model::AdditionalIPRangesConfig>,
12088
12089 /// Optional. AutoIpamConfig contains all information related to Auto IPAM
12090 pub auto_ipam_config: std::option::Option<crate::model::AutoIpamConfig>,
12091
12092 /// Cluster-level network tier configuration is used to determine the default
12093 /// network tier for external IP addresses on cluster resources, such as node
12094 /// pools and load balancers.
12095 pub network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
12096
12097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12098}
12099
12100impl IPAllocationPolicy {
12101 /// Creates a new default instance.
12102 pub fn new() -> Self {
12103 std::default::Default::default()
12104 }
12105
12106 /// Sets the value of [use_ip_aliases][crate::model::IPAllocationPolicy::use_ip_aliases].
12107 ///
12108 /// # Example
12109 /// ```ignore,no_run
12110 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12111 /// let x = IPAllocationPolicy::new().set_use_ip_aliases(true);
12112 /// ```
12113 pub fn set_use_ip_aliases<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12114 self.use_ip_aliases = v.into();
12115 self
12116 }
12117
12118 /// Sets the value of [create_subnetwork][crate::model::IPAllocationPolicy::create_subnetwork].
12119 ///
12120 /// # Example
12121 /// ```ignore,no_run
12122 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12123 /// let x = IPAllocationPolicy::new().set_create_subnetwork(true);
12124 /// ```
12125 pub fn set_create_subnetwork<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12126 self.create_subnetwork = v.into();
12127 self
12128 }
12129
12130 /// Sets the value of [subnetwork_name][crate::model::IPAllocationPolicy::subnetwork_name].
12131 ///
12132 /// # Example
12133 /// ```ignore,no_run
12134 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12135 /// let x = IPAllocationPolicy::new().set_subnetwork_name("example");
12136 /// ```
12137 pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12138 self.subnetwork_name = v.into();
12139 self
12140 }
12141
12142 /// Sets the value of [cluster_ipv4_cidr][crate::model::IPAllocationPolicy::cluster_ipv4_cidr].
12143 ///
12144 /// # Example
12145 /// ```ignore,no_run
12146 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12147 /// let x = IPAllocationPolicy::new().set_cluster_ipv4_cidr("example");
12148 /// ```
12149 #[deprecated]
12150 pub fn set_cluster_ipv4_cidr<T: std::convert::Into<std::string::String>>(
12151 mut self,
12152 v: T,
12153 ) -> Self {
12154 self.cluster_ipv4_cidr = v.into();
12155 self
12156 }
12157
12158 /// Sets the value of [node_ipv4_cidr][crate::model::IPAllocationPolicy::node_ipv4_cidr].
12159 ///
12160 /// # Example
12161 /// ```ignore,no_run
12162 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12163 /// let x = IPAllocationPolicy::new().set_node_ipv4_cidr("example");
12164 /// ```
12165 #[deprecated]
12166 pub fn set_node_ipv4_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12167 self.node_ipv4_cidr = v.into();
12168 self
12169 }
12170
12171 /// Sets the value of [services_ipv4_cidr][crate::model::IPAllocationPolicy::services_ipv4_cidr].
12172 ///
12173 /// # Example
12174 /// ```ignore,no_run
12175 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12176 /// let x = IPAllocationPolicy::new().set_services_ipv4_cidr("example");
12177 /// ```
12178 #[deprecated]
12179 pub fn set_services_ipv4_cidr<T: std::convert::Into<std::string::String>>(
12180 mut self,
12181 v: T,
12182 ) -> Self {
12183 self.services_ipv4_cidr = v.into();
12184 self
12185 }
12186
12187 /// Sets the value of [cluster_secondary_range_name][crate::model::IPAllocationPolicy::cluster_secondary_range_name].
12188 ///
12189 /// # Example
12190 /// ```ignore,no_run
12191 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12192 /// let x = IPAllocationPolicy::new().set_cluster_secondary_range_name("example");
12193 /// ```
12194 pub fn set_cluster_secondary_range_name<T: std::convert::Into<std::string::String>>(
12195 mut self,
12196 v: T,
12197 ) -> Self {
12198 self.cluster_secondary_range_name = v.into();
12199 self
12200 }
12201
12202 /// Sets the value of [services_secondary_range_name][crate::model::IPAllocationPolicy::services_secondary_range_name].
12203 ///
12204 /// # Example
12205 /// ```ignore,no_run
12206 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12207 /// let x = IPAllocationPolicy::new().set_services_secondary_range_name("example");
12208 /// ```
12209 pub fn set_services_secondary_range_name<T: std::convert::Into<std::string::String>>(
12210 mut self,
12211 v: T,
12212 ) -> Self {
12213 self.services_secondary_range_name = v.into();
12214 self
12215 }
12216
12217 /// Sets the value of [cluster_ipv4_cidr_block][crate::model::IPAllocationPolicy::cluster_ipv4_cidr_block].
12218 ///
12219 /// # Example
12220 /// ```ignore,no_run
12221 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12222 /// let x = IPAllocationPolicy::new().set_cluster_ipv4_cidr_block("example");
12223 /// ```
12224 pub fn set_cluster_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
12225 mut self,
12226 v: T,
12227 ) -> Self {
12228 self.cluster_ipv4_cidr_block = v.into();
12229 self
12230 }
12231
12232 /// Sets the value of [node_ipv4_cidr_block][crate::model::IPAllocationPolicy::node_ipv4_cidr_block].
12233 ///
12234 /// # Example
12235 /// ```ignore,no_run
12236 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12237 /// let x = IPAllocationPolicy::new().set_node_ipv4_cidr_block("example");
12238 /// ```
12239 pub fn set_node_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
12240 mut self,
12241 v: T,
12242 ) -> Self {
12243 self.node_ipv4_cidr_block = v.into();
12244 self
12245 }
12246
12247 /// Sets the value of [services_ipv4_cidr_block][crate::model::IPAllocationPolicy::services_ipv4_cidr_block].
12248 ///
12249 /// # Example
12250 /// ```ignore,no_run
12251 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12252 /// let x = IPAllocationPolicy::new().set_services_ipv4_cidr_block("example");
12253 /// ```
12254 pub fn set_services_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
12255 mut self,
12256 v: T,
12257 ) -> Self {
12258 self.services_ipv4_cidr_block = v.into();
12259 self
12260 }
12261
12262 /// Sets the value of [tpu_ipv4_cidr_block][crate::model::IPAllocationPolicy::tpu_ipv4_cidr_block].
12263 ///
12264 /// # Example
12265 /// ```ignore,no_run
12266 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12267 /// let x = IPAllocationPolicy::new().set_tpu_ipv4_cidr_block("example");
12268 /// ```
12269 #[deprecated]
12270 pub fn set_tpu_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
12271 mut self,
12272 v: T,
12273 ) -> Self {
12274 self.tpu_ipv4_cidr_block = v.into();
12275 self
12276 }
12277
12278 /// Sets the value of [use_routes][crate::model::IPAllocationPolicy::use_routes].
12279 ///
12280 /// # Example
12281 /// ```ignore,no_run
12282 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12283 /// let x = IPAllocationPolicy::new().set_use_routes(true);
12284 /// ```
12285 pub fn set_use_routes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12286 self.use_routes = v.into();
12287 self
12288 }
12289
12290 /// Sets the value of [stack_type][crate::model::IPAllocationPolicy::stack_type].
12291 ///
12292 /// # Example
12293 /// ```ignore,no_run
12294 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12295 /// use google_cloud_container_v1::model::StackType;
12296 /// let x0 = IPAllocationPolicy::new().set_stack_type(StackType::Ipv4);
12297 /// let x1 = IPAllocationPolicy::new().set_stack_type(StackType::Ipv4Ipv6);
12298 /// ```
12299 pub fn set_stack_type<T: std::convert::Into<crate::model::StackType>>(mut self, v: T) -> Self {
12300 self.stack_type = v.into();
12301 self
12302 }
12303
12304 /// Sets the value of [ipv6_access_type][crate::model::IPAllocationPolicy::ipv6_access_type].
12305 ///
12306 /// # Example
12307 /// ```ignore,no_run
12308 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12309 /// use google_cloud_container_v1::model::IPv6AccessType;
12310 /// let x0 = IPAllocationPolicy::new().set_ipv6_access_type(IPv6AccessType::Internal);
12311 /// let x1 = IPAllocationPolicy::new().set_ipv6_access_type(IPv6AccessType::External);
12312 /// ```
12313 pub fn set_ipv6_access_type<T: std::convert::Into<crate::model::IPv6AccessType>>(
12314 mut self,
12315 v: T,
12316 ) -> Self {
12317 self.ipv6_access_type = v.into();
12318 self
12319 }
12320
12321 /// Sets the value of [pod_cidr_overprovision_config][crate::model::IPAllocationPolicy::pod_cidr_overprovision_config].
12322 ///
12323 /// # Example
12324 /// ```ignore,no_run
12325 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12326 /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
12327 /// let x = IPAllocationPolicy::new().set_pod_cidr_overprovision_config(PodCIDROverprovisionConfig::default()/* use setters */);
12328 /// ```
12329 pub fn set_pod_cidr_overprovision_config<T>(mut self, v: T) -> Self
12330 where
12331 T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
12332 {
12333 self.pod_cidr_overprovision_config = std::option::Option::Some(v.into());
12334 self
12335 }
12336
12337 /// Sets or clears the value of [pod_cidr_overprovision_config][crate::model::IPAllocationPolicy::pod_cidr_overprovision_config].
12338 ///
12339 /// # Example
12340 /// ```ignore,no_run
12341 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12342 /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
12343 /// let x = IPAllocationPolicy::new().set_or_clear_pod_cidr_overprovision_config(Some(PodCIDROverprovisionConfig::default()/* use setters */));
12344 /// let x = IPAllocationPolicy::new().set_or_clear_pod_cidr_overprovision_config(None::<PodCIDROverprovisionConfig>);
12345 /// ```
12346 pub fn set_or_clear_pod_cidr_overprovision_config<T>(
12347 mut self,
12348 v: std::option::Option<T>,
12349 ) -> Self
12350 where
12351 T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
12352 {
12353 self.pod_cidr_overprovision_config = v.map(|x| x.into());
12354 self
12355 }
12356
12357 /// Sets the value of [subnet_ipv6_cidr_block][crate::model::IPAllocationPolicy::subnet_ipv6_cidr_block].
12358 ///
12359 /// # Example
12360 /// ```ignore,no_run
12361 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12362 /// let x = IPAllocationPolicy::new().set_subnet_ipv6_cidr_block("example");
12363 /// ```
12364 pub fn set_subnet_ipv6_cidr_block<T: std::convert::Into<std::string::String>>(
12365 mut self,
12366 v: T,
12367 ) -> Self {
12368 self.subnet_ipv6_cidr_block = v.into();
12369 self
12370 }
12371
12372 /// Sets the value of [services_ipv6_cidr_block][crate::model::IPAllocationPolicy::services_ipv6_cidr_block].
12373 ///
12374 /// # Example
12375 /// ```ignore,no_run
12376 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12377 /// let x = IPAllocationPolicy::new().set_services_ipv6_cidr_block("example");
12378 /// ```
12379 pub fn set_services_ipv6_cidr_block<T: std::convert::Into<std::string::String>>(
12380 mut self,
12381 v: T,
12382 ) -> Self {
12383 self.services_ipv6_cidr_block = v.into();
12384 self
12385 }
12386
12387 /// Sets the value of [additional_pod_ranges_config][crate::model::IPAllocationPolicy::additional_pod_ranges_config].
12388 ///
12389 /// # Example
12390 /// ```ignore,no_run
12391 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12392 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
12393 /// let x = IPAllocationPolicy::new().set_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
12394 /// ```
12395 pub fn set_additional_pod_ranges_config<T>(mut self, v: T) -> Self
12396 where
12397 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
12398 {
12399 self.additional_pod_ranges_config = std::option::Option::Some(v.into());
12400 self
12401 }
12402
12403 /// Sets or clears the value of [additional_pod_ranges_config][crate::model::IPAllocationPolicy::additional_pod_ranges_config].
12404 ///
12405 /// # Example
12406 /// ```ignore,no_run
12407 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12408 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
12409 /// let x = IPAllocationPolicy::new().set_or_clear_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
12410 /// let x = IPAllocationPolicy::new().set_or_clear_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
12411 /// ```
12412 pub fn set_or_clear_additional_pod_ranges_config<T>(mut self, v: std::option::Option<T>) -> Self
12413 where
12414 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
12415 {
12416 self.additional_pod_ranges_config = v.map(|x| x.into());
12417 self
12418 }
12419
12420 /// Sets the value of [default_pod_ipv4_range_utilization][crate::model::IPAllocationPolicy::default_pod_ipv4_range_utilization].
12421 ///
12422 /// # Example
12423 /// ```ignore,no_run
12424 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12425 /// let x = IPAllocationPolicy::new().set_default_pod_ipv4_range_utilization(42.0);
12426 /// ```
12427 pub fn set_default_pod_ipv4_range_utilization<T: std::convert::Into<f64>>(
12428 mut self,
12429 v: T,
12430 ) -> Self {
12431 self.default_pod_ipv4_range_utilization = v.into();
12432 self
12433 }
12434
12435 /// Sets the value of [additional_ip_ranges_configs][crate::model::IPAllocationPolicy::additional_ip_ranges_configs].
12436 ///
12437 /// # Example
12438 /// ```ignore,no_run
12439 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12440 /// use google_cloud_container_v1::model::AdditionalIPRangesConfig;
12441 /// let x = IPAllocationPolicy::new()
12442 /// .set_additional_ip_ranges_configs([
12443 /// AdditionalIPRangesConfig::default()/* use setters */,
12444 /// AdditionalIPRangesConfig::default()/* use (different) setters */,
12445 /// ]);
12446 /// ```
12447 pub fn set_additional_ip_ranges_configs<T, V>(mut self, v: T) -> Self
12448 where
12449 T: std::iter::IntoIterator<Item = V>,
12450 V: std::convert::Into<crate::model::AdditionalIPRangesConfig>,
12451 {
12452 use std::iter::Iterator;
12453 self.additional_ip_ranges_configs = v.into_iter().map(|i| i.into()).collect();
12454 self
12455 }
12456
12457 /// Sets the value of [auto_ipam_config][crate::model::IPAllocationPolicy::auto_ipam_config].
12458 ///
12459 /// # Example
12460 /// ```ignore,no_run
12461 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12462 /// use google_cloud_container_v1::model::AutoIpamConfig;
12463 /// let x = IPAllocationPolicy::new().set_auto_ipam_config(AutoIpamConfig::default()/* use setters */);
12464 /// ```
12465 pub fn set_auto_ipam_config<T>(mut self, v: T) -> Self
12466 where
12467 T: std::convert::Into<crate::model::AutoIpamConfig>,
12468 {
12469 self.auto_ipam_config = std::option::Option::Some(v.into());
12470 self
12471 }
12472
12473 /// Sets or clears the value of [auto_ipam_config][crate::model::IPAllocationPolicy::auto_ipam_config].
12474 ///
12475 /// # Example
12476 /// ```ignore,no_run
12477 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12478 /// use google_cloud_container_v1::model::AutoIpamConfig;
12479 /// let x = IPAllocationPolicy::new().set_or_clear_auto_ipam_config(Some(AutoIpamConfig::default()/* use setters */));
12480 /// let x = IPAllocationPolicy::new().set_or_clear_auto_ipam_config(None::<AutoIpamConfig>);
12481 /// ```
12482 pub fn set_or_clear_auto_ipam_config<T>(mut self, v: std::option::Option<T>) -> Self
12483 where
12484 T: std::convert::Into<crate::model::AutoIpamConfig>,
12485 {
12486 self.auto_ipam_config = v.map(|x| x.into());
12487 self
12488 }
12489
12490 /// Sets the value of [network_tier_config][crate::model::IPAllocationPolicy::network_tier_config].
12491 ///
12492 /// # Example
12493 /// ```ignore,no_run
12494 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12495 /// use google_cloud_container_v1::model::NetworkTierConfig;
12496 /// let x = IPAllocationPolicy::new().set_network_tier_config(NetworkTierConfig::default()/* use setters */);
12497 /// ```
12498 pub fn set_network_tier_config<T>(mut self, v: T) -> Self
12499 where
12500 T: std::convert::Into<crate::model::NetworkTierConfig>,
12501 {
12502 self.network_tier_config = std::option::Option::Some(v.into());
12503 self
12504 }
12505
12506 /// Sets or clears the value of [network_tier_config][crate::model::IPAllocationPolicy::network_tier_config].
12507 ///
12508 /// # Example
12509 /// ```ignore,no_run
12510 /// # use google_cloud_container_v1::model::IPAllocationPolicy;
12511 /// use google_cloud_container_v1::model::NetworkTierConfig;
12512 /// let x = IPAllocationPolicy::new().set_or_clear_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
12513 /// let x = IPAllocationPolicy::new().set_or_clear_network_tier_config(None::<NetworkTierConfig>);
12514 /// ```
12515 pub fn set_or_clear_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
12516 where
12517 T: std::convert::Into<crate::model::NetworkTierConfig>,
12518 {
12519 self.network_tier_config = v.map(|x| x.into());
12520 self
12521 }
12522}
12523
12524impl wkt::message::Message for IPAllocationPolicy {
12525 fn typename() -> &'static str {
12526 "type.googleapis.com/google.container.v1.IPAllocationPolicy"
12527 }
12528}
12529
12530/// A Google Kubernetes Engine cluster.
12531#[derive(Clone, Default, PartialEq)]
12532#[non_exhaustive]
12533pub struct Cluster {
12534 /// The name of this cluster. The name must be unique within this project
12535 /// and location (e.g. zone or region), and can be up to 40 characters with
12536 /// the following restrictions:
12537 ///
12538 /// * Lowercase letters, numbers, and hyphens only.
12539 /// * Must start with a letter.
12540 /// * Must end with a number or a letter.
12541 pub name: std::string::String,
12542
12543 /// An optional description of this cluster.
12544 pub description: std::string::String,
12545
12546 /// The number of nodes to create in this cluster. You must ensure that your
12547 /// Compute Engine [resource
12548 /// quota](https://cloud.google.com/compute/quotas)
12549 /// is sufficient for this number of instances. You must also have available
12550 /// firewall and routes quota.
12551 /// For requests, this field should only be used in lieu of a
12552 /// "node_pool" object, since this configuration (along with the
12553 /// "node_config") will be used to create a "NodePool" object with an
12554 /// auto-generated name. Do not use this and a node_pool at the same time.
12555 ///
12556 /// This field is deprecated, use node_pool.initial_node_count instead.
12557 #[deprecated]
12558 pub initial_node_count: i32,
12559
12560 /// Parameters used in creating the cluster's nodes.
12561 /// For requests, this field should only be used in lieu of a
12562 /// "node_pool" object, since this configuration (along with the
12563 /// "initial_node_count") will be used to create a "NodePool" object with an
12564 /// auto-generated name. Do not use this and a node_pool at the same time.
12565 /// For responses, this field will be populated with the node configuration of
12566 /// the first node pool. (For configuration of each node pool, see
12567 /// `node_pool.config`)
12568 ///
12569 /// If unspecified, the defaults are used.
12570 /// This field is deprecated, use node_pool.config instead.
12571 #[deprecated]
12572 pub node_config: std::option::Option<crate::model::NodeConfig>,
12573
12574 /// The authentication information for accessing the master endpoint.
12575 /// If unspecified, the defaults are used:
12576 /// For clusters before v1.12, if master_auth is unspecified, `username` will
12577 /// be set to "admin", a random password will be generated, and a client
12578 /// certificate will be issued.
12579 pub master_auth: std::option::Option<crate::model::MasterAuth>,
12580
12581 /// The logging service the cluster should use to write logs.
12582 /// Currently available options:
12583 ///
12584 /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
12585 /// service with a Kubernetes-native resource model
12586 /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
12587 /// available as of GKE 1.15).
12588 /// * `none` - no logs will be exported from the cluster.
12589 ///
12590 /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
12591 /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
12592 pub logging_service: std::string::String,
12593
12594 /// The monitoring service the cluster should use to write metrics.
12595 /// Currently available options:
12596 ///
12597 /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
12598 /// service with a Kubernetes-native resource model
12599 /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
12600 /// longer available as of GKE 1.15).
12601 /// * `none` - No metrics will be exported from the cluster.
12602 ///
12603 /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
12604 /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
12605 pub monitoring_service: std::string::String,
12606
12607 /// The name of the Google Compute Engine
12608 /// [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks)
12609 /// to which the cluster is connected. If left unspecified, the `default`
12610 /// network will be used.
12611 pub network: std::string::String,
12612
12613 /// The IP address range of the container pods in this cluster, in
12614 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
12615 /// notation (e.g. `10.96.0.0/14`). Leave blank to have
12616 /// one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
12617 pub cluster_ipv4_cidr: std::string::String,
12618
12619 /// Configurations for the various addons available to run in the cluster.
12620 pub addons_config: std::option::Option<crate::model::AddonsConfig>,
12621
12622 /// The name of the Google Compute Engine
12623 /// [subnetwork](https://cloud.google.com/compute/docs/subnetworks)
12624 /// to which the cluster is connected.
12625 pub subnetwork: std::string::String,
12626
12627 /// The node pools associated with this cluster.
12628 /// This field should not be set if "node_config" or "initial_node_count" are
12629 /// specified.
12630 pub node_pools: std::vec::Vec<crate::model::NodePool>,
12631
12632 /// The list of Google Compute Engine
12633 /// [zones](https://cloud.google.com/compute/docs/zones#available)
12634 /// in which the cluster's nodes should be located.
12635 ///
12636 /// This field provides a default value if
12637 /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
12638 /// are not specified during node pool creation.
12639 ///
12640 /// Warning: changing cluster locations will update the
12641 /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
12642 /// of all node pools and will result in nodes being added and/or removed.
12643 pub locations: std::vec::Vec<std::string::String>,
12644
12645 /// Kubernetes alpha features are enabled on this cluster. This includes alpha
12646 /// API groups (e.g. v1alpha1) and features that may not be production ready in
12647 /// the kubernetes version of the master and nodes.
12648 /// The cluster has no SLA for uptime and master/node upgrades are disabled.
12649 /// Alpha enabled clusters are automatically deleted thirty days after
12650 /// creation.
12651 pub enable_kubernetes_alpha: bool,
12652
12653 /// The list of user specified Kubernetes feature gates.
12654 /// Each string represents the activation status of a feature gate (e.g.
12655 /// "featureX=true" or "featureX=false")
12656 pub alpha_cluster_feature_gates: std::vec::Vec<std::string::String>,
12657
12658 /// The resource labels for the cluster to use to annotate any related
12659 /// Google Compute Engine resources.
12660 pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
12661
12662 /// The fingerprint of the set of labels for this cluster.
12663 pub label_fingerprint: std::string::String,
12664
12665 /// Configuration for the legacy ABAC authorization mode.
12666 pub legacy_abac: std::option::Option<crate::model::LegacyAbac>,
12667
12668 /// Configuration options for the NetworkPolicy feature.
12669 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
12670
12671 /// Configuration for cluster IP allocation.
12672 pub ip_allocation_policy: std::option::Option<crate::model::IPAllocationPolicy>,
12673
12674 /// The configuration options for master authorized networks feature.
12675 ///
12676 /// Deprecated: Use
12677 /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]
12678 /// instead.
12679 ///
12680 /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config
12681 #[deprecated]
12682 pub master_authorized_networks_config:
12683 std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
12684
12685 /// Configure the maintenance policy for this cluster.
12686 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
12687
12688 /// Configuration for Binary Authorization.
12689 pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
12690
12691 /// Cluster-level autoscaling configuration.
12692 pub autoscaling: std::option::Option<crate::model::ClusterAutoscaling>,
12693
12694 /// Configuration for cluster networking.
12695 pub network_config: std::option::Option<crate::model::NetworkConfig>,
12696
12697 /// The default constraint on the maximum number of pods that can be run
12698 /// simultaneously on a node in the node pool of this cluster. Only honored
12699 /// if cluster created with IP Alias support.
12700 pub default_max_pods_constraint: std::option::Option<crate::model::MaxPodsConstraint>,
12701
12702 /// Configuration for exporting resource usages. Resource usage export is
12703 /// disabled when this config is unspecified.
12704 pub resource_usage_export_config: std::option::Option<crate::model::ResourceUsageExportConfig>,
12705
12706 /// Configuration controlling RBAC group membership information.
12707 pub authenticator_groups_config: std::option::Option<crate::model::AuthenticatorGroupsConfig>,
12708
12709 /// Configuration for private cluster.
12710 pub private_cluster_config: std::option::Option<crate::model::PrivateClusterConfig>,
12711
12712 /// Configuration of etcd encryption.
12713 pub database_encryption: std::option::Option<crate::model::DatabaseEncryption>,
12714
12715 /// Cluster-level Vertical Pod Autoscaling configuration.
12716 pub vertical_pod_autoscaling: std::option::Option<crate::model::VerticalPodAutoscaling>,
12717
12718 /// Shielded Nodes configuration.
12719 pub shielded_nodes: std::option::Option<crate::model::ShieldedNodes>,
12720
12721 /// Release channel configuration. If left unspecified on cluster creation and
12722 /// a version is specified, the cluster is enrolled in the most mature release
12723 /// channel where the version is available (first checking STABLE, then
12724 /// REGULAR, and finally RAPID). Otherwise, if no release channel
12725 /// configuration and no version is specified, the cluster is enrolled in the
12726 /// REGULAR channel with its default version.
12727 pub release_channel: std::option::Option<crate::model::ReleaseChannel>,
12728
12729 /// Configuration for the use of Kubernetes Service Accounts in IAM policies.
12730 pub workload_identity_config: std::option::Option<crate::model::WorkloadIdentityConfig>,
12731
12732 /// Configuration for issuance of mTLS keys and certificates to Kubernetes
12733 /// pods.
12734 pub mesh_certificates: std::option::Option<crate::model::MeshCertificates>,
12735
12736 /// Configuration for the fine-grained cost management feature.
12737 pub cost_management_config: std::option::Option<crate::model::CostManagementConfig>,
12738
12739 /// Notification configuration of the cluster.
12740 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
12741
12742 /// Configuration of Confidential Nodes.
12743 /// All the nodes in the cluster will be Confidential VM once enabled.
12744 pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
12745
12746 /// Configuration for Identity Service component.
12747 pub identity_service_config: std::option::Option<crate::model::IdentityServiceConfig>,
12748
12749 /// Output only. Server-defined URL for the resource.
12750 pub self_link: std::string::String,
12751
12752 /// Output only. The name of the Google Compute Engine
12753 /// [zone](https://cloud.google.com/compute/docs/zones#available)
12754 /// in which the cluster resides. This field is deprecated, use location
12755 /// instead.
12756 #[deprecated]
12757 pub zone: std::string::String,
12758
12759 /// Output only. The IP address of this cluster's master endpoint.
12760 /// The endpoint can be accessed from the internet at
12761 /// `https://username:password@endpoint/`.
12762 ///
12763 /// See the `masterAuth` property of this resource for username and
12764 /// password information.
12765 pub endpoint: std::string::String,
12766
12767 /// The initial Kubernetes version for this cluster. Valid versions are those
12768 /// found in validMasterVersions returned by getServerConfig. The version can
12769 /// be upgraded over time; such upgrades are reflected in
12770 /// currentMasterVersion and currentNodeVersion.
12771 ///
12772 /// Users may specify either explicit versions offered by
12773 /// Kubernetes Engine or version aliases, which have the following behavior:
12774 ///
12775 /// - "latest": picks the highest valid Kubernetes version
12776 /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
12777 /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
12778 /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
12779 /// - "","-": picks the default Kubernetes version
12780 pub initial_cluster_version: std::string::String,
12781
12782 /// Output only. The current software version of the master endpoint.
12783 pub current_master_version: std::string::String,
12784
12785 /// Output only. Deprecated, use
12786 /// [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools)
12787 /// instead. The current version of the node software components. If they are
12788 /// currently at multiple versions because they're in the process of being
12789 /// upgraded, this reflects the minimum version of all nodes.
12790 #[deprecated]
12791 pub current_node_version: std::string::String,
12792
12793 /// Output only. The time the cluster was created, in
12794 /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
12795 pub create_time: std::string::String,
12796
12797 /// Output only. The current status of this cluster.
12798 pub status: crate::model::cluster::Status,
12799
12800 /// Output only. Deprecated. Use conditions instead.
12801 /// Additional information about the current status of this
12802 /// cluster, if available.
12803 #[deprecated]
12804 pub status_message: std::string::String,
12805
12806 /// Output only. The size of the address space on each node for hosting
12807 /// containers. This is provisioned from within the `container_ipv4_cidr`
12808 /// range. This field will only be set when cluster is in route-based network
12809 /// mode.
12810 pub node_ipv4_cidr_size: i32,
12811
12812 /// Output only. The IP address range of the Kubernetes services in
12813 /// this cluster, in
12814 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
12815 /// notation (e.g. `1.2.3.4/29`). Service addresses are
12816 /// typically put in the last `/16` from the container CIDR.
12817 pub services_ipv4_cidr: std::string::String,
12818
12819 /// Output only. Deprecated. Use node_pools.instance_group_urls.
12820 #[deprecated]
12821 pub instance_group_urls: std::vec::Vec<std::string::String>,
12822
12823 /// Output only. The number of nodes currently in the cluster. Deprecated.
12824 /// Call Kubernetes API directly to retrieve node information.
12825 #[deprecated]
12826 pub current_node_count: i32,
12827
12828 /// Output only. The time the cluster will be automatically
12829 /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
12830 pub expire_time: std::string::String,
12831
12832 /// Output only. The name of the Google Compute Engine
12833 /// [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
12834 /// or
12835 /// [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
12836 /// in which the cluster resides.
12837 pub location: std::string::String,
12838
12839 /// Enable the ability to use Cloud TPUs in this cluster.
12840 /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
12841 /// date for 2VM TPU is 2025-04-25.
12842 #[deprecated]
12843 pub enable_tpu: bool,
12844
12845 /// Output only. The IP address range of the Cloud TPUs in this cluster, in
12846 /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
12847 /// notation (e.g. `1.2.3.4/29`).
12848 /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
12849 /// date for 2VM TPU is 2025-04-25.
12850 #[deprecated]
12851 pub tpu_ipv4_cidr_block: std::string::String,
12852
12853 /// Which conditions caused the current cluster state.
12854 pub conditions: std::vec::Vec<crate::model::StatusCondition>,
12855
12856 /// Autopilot configuration for the cluster.
12857 pub autopilot: std::option::Option<crate::model::Autopilot>,
12858
12859 /// Output only. Unique id for the cluster.
12860 pub id: std::string::String,
12861
12862 /// Default NodePool settings for the entire cluster. These settings are
12863 /// overridden if specified on the specific NodePool object.
12864 pub node_pool_defaults: std::option::Option<crate::model::NodePoolDefaults>,
12865
12866 /// Logging configuration for the cluster.
12867 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
12868
12869 /// Monitoring configuration for the cluster.
12870 pub monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
12871
12872 /// Node pool configs that apply to all auto-provisioned node pools
12873 /// in autopilot clusters and node auto-provisioning enabled clusters.
12874 pub node_pool_auto_config: std::option::Option<crate::model::NodePoolAutoConfig>,
12875
12876 /// The config for pod autoscaling.
12877 pub pod_autoscaling: std::option::Option<crate::model::PodAutoscaling>,
12878
12879 /// This checksum is computed by the server based on the value of cluster
12880 /// fields, and may be sent on update requests to ensure the client has an
12881 /// up-to-date value before proceeding.
12882 pub etag: std::string::String,
12883
12884 /// Fleet information for the cluster.
12885 pub fleet: std::option::Option<crate::model::Fleet>,
12886
12887 /// Optional. Enable/Disable Security Posture API features for the cluster.
12888 pub security_posture_config: std::option::Option<crate::model::SecurityPostureConfig>,
12889
12890 /// Configuration for all cluster's control plane endpoints.
12891 pub control_plane_endpoints_config:
12892 std::option::Option<crate::model::ControlPlaneEndpointsConfig>,
12893
12894 /// Beta APIs Config
12895 pub enable_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
12896
12897 /// GKE Enterprise Configuration.
12898 ///
12899 /// Deprecated: GKE Enterprise features are now available without an Enterprise
12900 /// tier.
12901 #[deprecated]
12902 pub enterprise_config: std::option::Option<crate::model::EnterpriseConfig>,
12903
12904 /// Secret CSI driver configuration.
12905 pub secret_manager_config: std::option::Option<crate::model::SecretManagerConfig>,
12906
12907 /// Optional. Deprecated: Compliance Posture is no longer supported.
12908 /// For more details, see
12909 /// <https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation>.
12910 ///
12911 /// Enable/Disable Compliance Posture features for the cluster.
12912 #[deprecated]
12913 pub compliance_posture_config: std::option::Option<crate::model::CompliancePostureConfig>,
12914
12915 /// Output only. Reserved for future use.
12916 pub satisfies_pzs: std::option::Option<bool>,
12917
12918 /// Output only. Reserved for future use.
12919 pub satisfies_pzi: std::option::Option<bool>,
12920
12921 /// The Custom keys configuration for the cluster.
12922 pub user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
12923
12924 /// RBACBindingConfig allows user to restrict ClusterRoleBindings an
12925 /// RoleBindings that can be created.
12926 pub rbac_binding_config: std::option::Option<crate::model::RBACBindingConfig>,
12927
12928 /// Configuration for GKE auto upgrades.
12929 pub gke_auto_upgrade_config: std::option::Option<crate::model::GkeAutoUpgradeConfig>,
12930
12931 /// Configuration for limiting anonymous access to all endpoints except the
12932 /// health checks.
12933 pub anonymous_authentication_config:
12934 std::option::Option<crate::model::AnonymousAuthenticationConfig>,
12935
12936 /// Optional. Configuration for scheduled upgrades.
12937 pub schedule_upgrade_config: std::option::Option<crate::model::ScheduleUpgradeConfig>,
12938
12939 /// Configuration for sync Secret Manager secrets as k8s secrets.
12940 pub secret_sync_config: std::option::Option<crate::model::SecretSyncConfig>,
12941
12942 /// Configuration for Managed OpenTelemetry pipeline.
12943 pub managed_opentelemetry_config: std::option::Option<crate::model::ManagedOpenTelemetryConfig>,
12944
12945 /// Configuration for control plane egress control.
12946 pub control_plane_egress: std::option::Option<crate::model::ControlPlaneEgress>,
12947
12948 /// Configuration for Managed Machine Learning Diagnostics.
12949 pub managed_machine_learning_diagnostics_config:
12950 std::option::Option<crate::model::ManagedMachineLearningDiagnosticsConfig>,
12951
12952 /// Optional. Configuration for Node Creation Mode.
12953 pub node_creation_config: std::option::Option<crate::model::NodeCreationConfig>,
12954
12955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12956}
12957
12958impl Cluster {
12959 /// Creates a new default instance.
12960 pub fn new() -> Self {
12961 std::default::Default::default()
12962 }
12963
12964 /// Sets the value of [name][crate::model::Cluster::name].
12965 ///
12966 /// # Example
12967 /// ```ignore,no_run
12968 /// # use google_cloud_container_v1::model::Cluster;
12969 /// let x = Cluster::new().set_name("example");
12970 /// ```
12971 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12972 self.name = v.into();
12973 self
12974 }
12975
12976 /// Sets the value of [description][crate::model::Cluster::description].
12977 ///
12978 /// # Example
12979 /// ```ignore,no_run
12980 /// # use google_cloud_container_v1::model::Cluster;
12981 /// let x = Cluster::new().set_description("example");
12982 /// ```
12983 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12984 self.description = v.into();
12985 self
12986 }
12987
12988 /// Sets the value of [initial_node_count][crate::model::Cluster::initial_node_count].
12989 ///
12990 /// # Example
12991 /// ```ignore,no_run
12992 /// # use google_cloud_container_v1::model::Cluster;
12993 /// let x = Cluster::new().set_initial_node_count(42);
12994 /// ```
12995 #[deprecated]
12996 pub fn set_initial_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12997 self.initial_node_count = v.into();
12998 self
12999 }
13000
13001 /// Sets the value of [node_config][crate::model::Cluster::node_config].
13002 ///
13003 /// # Example
13004 /// ```ignore,no_run
13005 /// # use google_cloud_container_v1::model::Cluster;
13006 /// use google_cloud_container_v1::model::NodeConfig;
13007 /// let x = Cluster::new().set_node_config(NodeConfig::default()/* use setters */);
13008 /// ```
13009 #[deprecated]
13010 pub fn set_node_config<T>(mut self, v: T) -> Self
13011 where
13012 T: std::convert::Into<crate::model::NodeConfig>,
13013 {
13014 self.node_config = std::option::Option::Some(v.into());
13015 self
13016 }
13017
13018 /// Sets or clears the value of [node_config][crate::model::Cluster::node_config].
13019 ///
13020 /// # Example
13021 /// ```ignore,no_run
13022 /// # use google_cloud_container_v1::model::Cluster;
13023 /// use google_cloud_container_v1::model::NodeConfig;
13024 /// let x = Cluster::new().set_or_clear_node_config(Some(NodeConfig::default()/* use setters */));
13025 /// let x = Cluster::new().set_or_clear_node_config(None::<NodeConfig>);
13026 /// ```
13027 #[deprecated]
13028 pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
13029 where
13030 T: std::convert::Into<crate::model::NodeConfig>,
13031 {
13032 self.node_config = v.map(|x| x.into());
13033 self
13034 }
13035
13036 /// Sets the value of [master_auth][crate::model::Cluster::master_auth].
13037 ///
13038 /// # Example
13039 /// ```ignore,no_run
13040 /// # use google_cloud_container_v1::model::Cluster;
13041 /// use google_cloud_container_v1::model::MasterAuth;
13042 /// let x = Cluster::new().set_master_auth(MasterAuth::default()/* use setters */);
13043 /// ```
13044 pub fn set_master_auth<T>(mut self, v: T) -> Self
13045 where
13046 T: std::convert::Into<crate::model::MasterAuth>,
13047 {
13048 self.master_auth = std::option::Option::Some(v.into());
13049 self
13050 }
13051
13052 /// Sets or clears the value of [master_auth][crate::model::Cluster::master_auth].
13053 ///
13054 /// # Example
13055 /// ```ignore,no_run
13056 /// # use google_cloud_container_v1::model::Cluster;
13057 /// use google_cloud_container_v1::model::MasterAuth;
13058 /// let x = Cluster::new().set_or_clear_master_auth(Some(MasterAuth::default()/* use setters */));
13059 /// let x = Cluster::new().set_or_clear_master_auth(None::<MasterAuth>);
13060 /// ```
13061 pub fn set_or_clear_master_auth<T>(mut self, v: std::option::Option<T>) -> Self
13062 where
13063 T: std::convert::Into<crate::model::MasterAuth>,
13064 {
13065 self.master_auth = v.map(|x| x.into());
13066 self
13067 }
13068
13069 /// Sets the value of [logging_service][crate::model::Cluster::logging_service].
13070 ///
13071 /// # Example
13072 /// ```ignore,no_run
13073 /// # use google_cloud_container_v1::model::Cluster;
13074 /// let x = Cluster::new().set_logging_service("example");
13075 /// ```
13076 pub fn set_logging_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13077 self.logging_service = v.into();
13078 self
13079 }
13080
13081 /// Sets the value of [monitoring_service][crate::model::Cluster::monitoring_service].
13082 ///
13083 /// # Example
13084 /// ```ignore,no_run
13085 /// # use google_cloud_container_v1::model::Cluster;
13086 /// let x = Cluster::new().set_monitoring_service("example");
13087 /// ```
13088 pub fn set_monitoring_service<T: std::convert::Into<std::string::String>>(
13089 mut self,
13090 v: T,
13091 ) -> Self {
13092 self.monitoring_service = v.into();
13093 self
13094 }
13095
13096 /// Sets the value of [network][crate::model::Cluster::network].
13097 ///
13098 /// # Example
13099 /// ```ignore,no_run
13100 /// # use google_cloud_container_v1::model::Cluster;
13101 /// let x = Cluster::new().set_network("example");
13102 /// ```
13103 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13104 self.network = v.into();
13105 self
13106 }
13107
13108 /// Sets the value of [cluster_ipv4_cidr][crate::model::Cluster::cluster_ipv4_cidr].
13109 ///
13110 /// # Example
13111 /// ```ignore,no_run
13112 /// # use google_cloud_container_v1::model::Cluster;
13113 /// let x = Cluster::new().set_cluster_ipv4_cidr("example");
13114 /// ```
13115 pub fn set_cluster_ipv4_cidr<T: std::convert::Into<std::string::String>>(
13116 mut self,
13117 v: T,
13118 ) -> Self {
13119 self.cluster_ipv4_cidr = v.into();
13120 self
13121 }
13122
13123 /// Sets the value of [addons_config][crate::model::Cluster::addons_config].
13124 ///
13125 /// # Example
13126 /// ```ignore,no_run
13127 /// # use google_cloud_container_v1::model::Cluster;
13128 /// use google_cloud_container_v1::model::AddonsConfig;
13129 /// let x = Cluster::new().set_addons_config(AddonsConfig::default()/* use setters */);
13130 /// ```
13131 pub fn set_addons_config<T>(mut self, v: T) -> Self
13132 where
13133 T: std::convert::Into<crate::model::AddonsConfig>,
13134 {
13135 self.addons_config = std::option::Option::Some(v.into());
13136 self
13137 }
13138
13139 /// Sets or clears the value of [addons_config][crate::model::Cluster::addons_config].
13140 ///
13141 /// # Example
13142 /// ```ignore,no_run
13143 /// # use google_cloud_container_v1::model::Cluster;
13144 /// use google_cloud_container_v1::model::AddonsConfig;
13145 /// let x = Cluster::new().set_or_clear_addons_config(Some(AddonsConfig::default()/* use setters */));
13146 /// let x = Cluster::new().set_or_clear_addons_config(None::<AddonsConfig>);
13147 /// ```
13148 pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
13149 where
13150 T: std::convert::Into<crate::model::AddonsConfig>,
13151 {
13152 self.addons_config = v.map(|x| x.into());
13153 self
13154 }
13155
13156 /// Sets the value of [subnetwork][crate::model::Cluster::subnetwork].
13157 ///
13158 /// # Example
13159 /// ```ignore,no_run
13160 /// # use google_cloud_container_v1::model::Cluster;
13161 /// let x = Cluster::new().set_subnetwork("example");
13162 /// ```
13163 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13164 self.subnetwork = v.into();
13165 self
13166 }
13167
13168 /// Sets the value of [node_pools][crate::model::Cluster::node_pools].
13169 ///
13170 /// # Example
13171 /// ```ignore,no_run
13172 /// # use google_cloud_container_v1::model::Cluster;
13173 /// use google_cloud_container_v1::model::NodePool;
13174 /// let x = Cluster::new()
13175 /// .set_node_pools([
13176 /// NodePool::default()/* use setters */,
13177 /// NodePool::default()/* use (different) setters */,
13178 /// ]);
13179 /// ```
13180 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
13181 where
13182 T: std::iter::IntoIterator<Item = V>,
13183 V: std::convert::Into<crate::model::NodePool>,
13184 {
13185 use std::iter::Iterator;
13186 self.node_pools = v.into_iter().map(|i| i.into()).collect();
13187 self
13188 }
13189
13190 /// Sets the value of [locations][crate::model::Cluster::locations].
13191 ///
13192 /// # Example
13193 /// ```ignore,no_run
13194 /// # use google_cloud_container_v1::model::Cluster;
13195 /// let x = Cluster::new().set_locations(["a", "b", "c"]);
13196 /// ```
13197 pub fn set_locations<T, V>(mut self, v: T) -> Self
13198 where
13199 T: std::iter::IntoIterator<Item = V>,
13200 V: std::convert::Into<std::string::String>,
13201 {
13202 use std::iter::Iterator;
13203 self.locations = v.into_iter().map(|i| i.into()).collect();
13204 self
13205 }
13206
13207 /// Sets the value of [enable_kubernetes_alpha][crate::model::Cluster::enable_kubernetes_alpha].
13208 ///
13209 /// # Example
13210 /// ```ignore,no_run
13211 /// # use google_cloud_container_v1::model::Cluster;
13212 /// let x = Cluster::new().set_enable_kubernetes_alpha(true);
13213 /// ```
13214 pub fn set_enable_kubernetes_alpha<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13215 self.enable_kubernetes_alpha = v.into();
13216 self
13217 }
13218
13219 /// Sets the value of [alpha_cluster_feature_gates][crate::model::Cluster::alpha_cluster_feature_gates].
13220 ///
13221 /// # Example
13222 /// ```ignore,no_run
13223 /// # use google_cloud_container_v1::model::Cluster;
13224 /// let x = Cluster::new().set_alpha_cluster_feature_gates(["a", "b", "c"]);
13225 /// ```
13226 pub fn set_alpha_cluster_feature_gates<T, V>(mut self, v: T) -> Self
13227 where
13228 T: std::iter::IntoIterator<Item = V>,
13229 V: std::convert::Into<std::string::String>,
13230 {
13231 use std::iter::Iterator;
13232 self.alpha_cluster_feature_gates = v.into_iter().map(|i| i.into()).collect();
13233 self
13234 }
13235
13236 /// Sets the value of [resource_labels][crate::model::Cluster::resource_labels].
13237 ///
13238 /// # Example
13239 /// ```ignore,no_run
13240 /// # use google_cloud_container_v1::model::Cluster;
13241 /// let x = Cluster::new().set_resource_labels([
13242 /// ("key0", "abc"),
13243 /// ("key1", "xyz"),
13244 /// ]);
13245 /// ```
13246 pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
13247 where
13248 T: std::iter::IntoIterator<Item = (K, V)>,
13249 K: std::convert::Into<std::string::String>,
13250 V: std::convert::Into<std::string::String>,
13251 {
13252 use std::iter::Iterator;
13253 self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13254 self
13255 }
13256
13257 /// Sets the value of [label_fingerprint][crate::model::Cluster::label_fingerprint].
13258 ///
13259 /// # Example
13260 /// ```ignore,no_run
13261 /// # use google_cloud_container_v1::model::Cluster;
13262 /// let x = Cluster::new().set_label_fingerprint("example");
13263 /// ```
13264 pub fn set_label_fingerprint<T: std::convert::Into<std::string::String>>(
13265 mut self,
13266 v: T,
13267 ) -> Self {
13268 self.label_fingerprint = v.into();
13269 self
13270 }
13271
13272 /// Sets the value of [legacy_abac][crate::model::Cluster::legacy_abac].
13273 ///
13274 /// # Example
13275 /// ```ignore,no_run
13276 /// # use google_cloud_container_v1::model::Cluster;
13277 /// use google_cloud_container_v1::model::LegacyAbac;
13278 /// let x = Cluster::new().set_legacy_abac(LegacyAbac::default()/* use setters */);
13279 /// ```
13280 pub fn set_legacy_abac<T>(mut self, v: T) -> Self
13281 where
13282 T: std::convert::Into<crate::model::LegacyAbac>,
13283 {
13284 self.legacy_abac = std::option::Option::Some(v.into());
13285 self
13286 }
13287
13288 /// Sets or clears the value of [legacy_abac][crate::model::Cluster::legacy_abac].
13289 ///
13290 /// # Example
13291 /// ```ignore,no_run
13292 /// # use google_cloud_container_v1::model::Cluster;
13293 /// use google_cloud_container_v1::model::LegacyAbac;
13294 /// let x = Cluster::new().set_or_clear_legacy_abac(Some(LegacyAbac::default()/* use setters */));
13295 /// let x = Cluster::new().set_or_clear_legacy_abac(None::<LegacyAbac>);
13296 /// ```
13297 pub fn set_or_clear_legacy_abac<T>(mut self, v: std::option::Option<T>) -> Self
13298 where
13299 T: std::convert::Into<crate::model::LegacyAbac>,
13300 {
13301 self.legacy_abac = v.map(|x| x.into());
13302 self
13303 }
13304
13305 /// Sets the value of [network_policy][crate::model::Cluster::network_policy].
13306 ///
13307 /// # Example
13308 /// ```ignore,no_run
13309 /// # use google_cloud_container_v1::model::Cluster;
13310 /// use google_cloud_container_v1::model::NetworkPolicy;
13311 /// let x = Cluster::new().set_network_policy(NetworkPolicy::default()/* use setters */);
13312 /// ```
13313 pub fn set_network_policy<T>(mut self, v: T) -> Self
13314 where
13315 T: std::convert::Into<crate::model::NetworkPolicy>,
13316 {
13317 self.network_policy = std::option::Option::Some(v.into());
13318 self
13319 }
13320
13321 /// Sets or clears the value of [network_policy][crate::model::Cluster::network_policy].
13322 ///
13323 /// # Example
13324 /// ```ignore,no_run
13325 /// # use google_cloud_container_v1::model::Cluster;
13326 /// use google_cloud_container_v1::model::NetworkPolicy;
13327 /// let x = Cluster::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
13328 /// let x = Cluster::new().set_or_clear_network_policy(None::<NetworkPolicy>);
13329 /// ```
13330 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
13331 where
13332 T: std::convert::Into<crate::model::NetworkPolicy>,
13333 {
13334 self.network_policy = v.map(|x| x.into());
13335 self
13336 }
13337
13338 /// Sets the value of [ip_allocation_policy][crate::model::Cluster::ip_allocation_policy].
13339 ///
13340 /// # Example
13341 /// ```ignore,no_run
13342 /// # use google_cloud_container_v1::model::Cluster;
13343 /// use google_cloud_container_v1::model::IPAllocationPolicy;
13344 /// let x = Cluster::new().set_ip_allocation_policy(IPAllocationPolicy::default()/* use setters */);
13345 /// ```
13346 pub fn set_ip_allocation_policy<T>(mut self, v: T) -> Self
13347 where
13348 T: std::convert::Into<crate::model::IPAllocationPolicy>,
13349 {
13350 self.ip_allocation_policy = std::option::Option::Some(v.into());
13351 self
13352 }
13353
13354 /// Sets or clears the value of [ip_allocation_policy][crate::model::Cluster::ip_allocation_policy].
13355 ///
13356 /// # Example
13357 /// ```ignore,no_run
13358 /// # use google_cloud_container_v1::model::Cluster;
13359 /// use google_cloud_container_v1::model::IPAllocationPolicy;
13360 /// let x = Cluster::new().set_or_clear_ip_allocation_policy(Some(IPAllocationPolicy::default()/* use setters */));
13361 /// let x = Cluster::new().set_or_clear_ip_allocation_policy(None::<IPAllocationPolicy>);
13362 /// ```
13363 pub fn set_or_clear_ip_allocation_policy<T>(mut self, v: std::option::Option<T>) -> Self
13364 where
13365 T: std::convert::Into<crate::model::IPAllocationPolicy>,
13366 {
13367 self.ip_allocation_policy = v.map(|x| x.into());
13368 self
13369 }
13370
13371 /// Sets the value of [master_authorized_networks_config][crate::model::Cluster::master_authorized_networks_config].
13372 ///
13373 /// # Example
13374 /// ```ignore,no_run
13375 /// # use google_cloud_container_v1::model::Cluster;
13376 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
13377 /// let x = Cluster::new().set_master_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
13378 /// ```
13379 #[deprecated]
13380 pub fn set_master_authorized_networks_config<T>(mut self, v: T) -> Self
13381 where
13382 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
13383 {
13384 self.master_authorized_networks_config = std::option::Option::Some(v.into());
13385 self
13386 }
13387
13388 /// Sets or clears the value of [master_authorized_networks_config][crate::model::Cluster::master_authorized_networks_config].
13389 ///
13390 /// # Example
13391 /// ```ignore,no_run
13392 /// # use google_cloud_container_v1::model::Cluster;
13393 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
13394 /// let x = Cluster::new().set_or_clear_master_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
13395 /// let x = Cluster::new().set_or_clear_master_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
13396 /// ```
13397 #[deprecated]
13398 pub fn set_or_clear_master_authorized_networks_config<T>(
13399 mut self,
13400 v: std::option::Option<T>,
13401 ) -> Self
13402 where
13403 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
13404 {
13405 self.master_authorized_networks_config = v.map(|x| x.into());
13406 self
13407 }
13408
13409 /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
13410 ///
13411 /// # Example
13412 /// ```ignore,no_run
13413 /// # use google_cloud_container_v1::model::Cluster;
13414 /// use google_cloud_container_v1::model::MaintenancePolicy;
13415 /// let x = Cluster::new().set_maintenance_policy(MaintenancePolicy::default()/* use setters */);
13416 /// ```
13417 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
13418 where
13419 T: std::convert::Into<crate::model::MaintenancePolicy>,
13420 {
13421 self.maintenance_policy = std::option::Option::Some(v.into());
13422 self
13423 }
13424
13425 /// Sets or clears the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
13426 ///
13427 /// # Example
13428 /// ```ignore,no_run
13429 /// # use google_cloud_container_v1::model::Cluster;
13430 /// use google_cloud_container_v1::model::MaintenancePolicy;
13431 /// let x = Cluster::new().set_or_clear_maintenance_policy(Some(MaintenancePolicy::default()/* use setters */));
13432 /// let x = Cluster::new().set_or_clear_maintenance_policy(None::<MaintenancePolicy>);
13433 /// ```
13434 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
13435 where
13436 T: std::convert::Into<crate::model::MaintenancePolicy>,
13437 {
13438 self.maintenance_policy = v.map(|x| x.into());
13439 self
13440 }
13441
13442 /// Sets the value of [binary_authorization][crate::model::Cluster::binary_authorization].
13443 ///
13444 /// # Example
13445 /// ```ignore,no_run
13446 /// # use google_cloud_container_v1::model::Cluster;
13447 /// use google_cloud_container_v1::model::BinaryAuthorization;
13448 /// let x = Cluster::new().set_binary_authorization(BinaryAuthorization::default()/* use setters */);
13449 /// ```
13450 pub fn set_binary_authorization<T>(mut self, v: T) -> Self
13451 where
13452 T: std::convert::Into<crate::model::BinaryAuthorization>,
13453 {
13454 self.binary_authorization = std::option::Option::Some(v.into());
13455 self
13456 }
13457
13458 /// Sets or clears the value of [binary_authorization][crate::model::Cluster::binary_authorization].
13459 ///
13460 /// # Example
13461 /// ```ignore,no_run
13462 /// # use google_cloud_container_v1::model::Cluster;
13463 /// use google_cloud_container_v1::model::BinaryAuthorization;
13464 /// let x = Cluster::new().set_or_clear_binary_authorization(Some(BinaryAuthorization::default()/* use setters */));
13465 /// let x = Cluster::new().set_or_clear_binary_authorization(None::<BinaryAuthorization>);
13466 /// ```
13467 pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
13468 where
13469 T: std::convert::Into<crate::model::BinaryAuthorization>,
13470 {
13471 self.binary_authorization = v.map(|x| x.into());
13472 self
13473 }
13474
13475 /// Sets the value of [autoscaling][crate::model::Cluster::autoscaling].
13476 ///
13477 /// # Example
13478 /// ```ignore,no_run
13479 /// # use google_cloud_container_v1::model::Cluster;
13480 /// use google_cloud_container_v1::model::ClusterAutoscaling;
13481 /// let x = Cluster::new().set_autoscaling(ClusterAutoscaling::default()/* use setters */);
13482 /// ```
13483 pub fn set_autoscaling<T>(mut self, v: T) -> Self
13484 where
13485 T: std::convert::Into<crate::model::ClusterAutoscaling>,
13486 {
13487 self.autoscaling = std::option::Option::Some(v.into());
13488 self
13489 }
13490
13491 /// Sets or clears the value of [autoscaling][crate::model::Cluster::autoscaling].
13492 ///
13493 /// # Example
13494 /// ```ignore,no_run
13495 /// # use google_cloud_container_v1::model::Cluster;
13496 /// use google_cloud_container_v1::model::ClusterAutoscaling;
13497 /// let x = Cluster::new().set_or_clear_autoscaling(Some(ClusterAutoscaling::default()/* use setters */));
13498 /// let x = Cluster::new().set_or_clear_autoscaling(None::<ClusterAutoscaling>);
13499 /// ```
13500 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
13501 where
13502 T: std::convert::Into<crate::model::ClusterAutoscaling>,
13503 {
13504 self.autoscaling = v.map(|x| x.into());
13505 self
13506 }
13507
13508 /// Sets the value of [network_config][crate::model::Cluster::network_config].
13509 ///
13510 /// # Example
13511 /// ```ignore,no_run
13512 /// # use google_cloud_container_v1::model::Cluster;
13513 /// use google_cloud_container_v1::model::NetworkConfig;
13514 /// let x = Cluster::new().set_network_config(NetworkConfig::default()/* use setters */);
13515 /// ```
13516 pub fn set_network_config<T>(mut self, v: T) -> Self
13517 where
13518 T: std::convert::Into<crate::model::NetworkConfig>,
13519 {
13520 self.network_config = std::option::Option::Some(v.into());
13521 self
13522 }
13523
13524 /// Sets or clears the value of [network_config][crate::model::Cluster::network_config].
13525 ///
13526 /// # Example
13527 /// ```ignore,no_run
13528 /// # use google_cloud_container_v1::model::Cluster;
13529 /// use google_cloud_container_v1::model::NetworkConfig;
13530 /// let x = Cluster::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
13531 /// let x = Cluster::new().set_or_clear_network_config(None::<NetworkConfig>);
13532 /// ```
13533 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
13534 where
13535 T: std::convert::Into<crate::model::NetworkConfig>,
13536 {
13537 self.network_config = v.map(|x| x.into());
13538 self
13539 }
13540
13541 /// Sets the value of [default_max_pods_constraint][crate::model::Cluster::default_max_pods_constraint].
13542 ///
13543 /// # Example
13544 /// ```ignore,no_run
13545 /// # use google_cloud_container_v1::model::Cluster;
13546 /// use google_cloud_container_v1::model::MaxPodsConstraint;
13547 /// let x = Cluster::new().set_default_max_pods_constraint(MaxPodsConstraint::default()/* use setters */);
13548 /// ```
13549 pub fn set_default_max_pods_constraint<T>(mut self, v: T) -> Self
13550 where
13551 T: std::convert::Into<crate::model::MaxPodsConstraint>,
13552 {
13553 self.default_max_pods_constraint = std::option::Option::Some(v.into());
13554 self
13555 }
13556
13557 /// Sets or clears the value of [default_max_pods_constraint][crate::model::Cluster::default_max_pods_constraint].
13558 ///
13559 /// # Example
13560 /// ```ignore,no_run
13561 /// # use google_cloud_container_v1::model::Cluster;
13562 /// use google_cloud_container_v1::model::MaxPodsConstraint;
13563 /// let x = Cluster::new().set_or_clear_default_max_pods_constraint(Some(MaxPodsConstraint::default()/* use setters */));
13564 /// let x = Cluster::new().set_or_clear_default_max_pods_constraint(None::<MaxPodsConstraint>);
13565 /// ```
13566 pub fn set_or_clear_default_max_pods_constraint<T>(mut self, v: std::option::Option<T>) -> Self
13567 where
13568 T: std::convert::Into<crate::model::MaxPodsConstraint>,
13569 {
13570 self.default_max_pods_constraint = v.map(|x| x.into());
13571 self
13572 }
13573
13574 /// Sets the value of [resource_usage_export_config][crate::model::Cluster::resource_usage_export_config].
13575 ///
13576 /// # Example
13577 /// ```ignore,no_run
13578 /// # use google_cloud_container_v1::model::Cluster;
13579 /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
13580 /// let x = Cluster::new().set_resource_usage_export_config(ResourceUsageExportConfig::default()/* use setters */);
13581 /// ```
13582 pub fn set_resource_usage_export_config<T>(mut self, v: T) -> Self
13583 where
13584 T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
13585 {
13586 self.resource_usage_export_config = std::option::Option::Some(v.into());
13587 self
13588 }
13589
13590 /// Sets or clears the value of [resource_usage_export_config][crate::model::Cluster::resource_usage_export_config].
13591 ///
13592 /// # Example
13593 /// ```ignore,no_run
13594 /// # use google_cloud_container_v1::model::Cluster;
13595 /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
13596 /// let x = Cluster::new().set_or_clear_resource_usage_export_config(Some(ResourceUsageExportConfig::default()/* use setters */));
13597 /// let x = Cluster::new().set_or_clear_resource_usage_export_config(None::<ResourceUsageExportConfig>);
13598 /// ```
13599 pub fn set_or_clear_resource_usage_export_config<T>(mut self, v: std::option::Option<T>) -> Self
13600 where
13601 T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
13602 {
13603 self.resource_usage_export_config = v.map(|x| x.into());
13604 self
13605 }
13606
13607 /// Sets the value of [authenticator_groups_config][crate::model::Cluster::authenticator_groups_config].
13608 ///
13609 /// # Example
13610 /// ```ignore,no_run
13611 /// # use google_cloud_container_v1::model::Cluster;
13612 /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
13613 /// let x = Cluster::new().set_authenticator_groups_config(AuthenticatorGroupsConfig::default()/* use setters */);
13614 /// ```
13615 pub fn set_authenticator_groups_config<T>(mut self, v: T) -> Self
13616 where
13617 T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
13618 {
13619 self.authenticator_groups_config = std::option::Option::Some(v.into());
13620 self
13621 }
13622
13623 /// Sets or clears the value of [authenticator_groups_config][crate::model::Cluster::authenticator_groups_config].
13624 ///
13625 /// # Example
13626 /// ```ignore,no_run
13627 /// # use google_cloud_container_v1::model::Cluster;
13628 /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
13629 /// let x = Cluster::new().set_or_clear_authenticator_groups_config(Some(AuthenticatorGroupsConfig::default()/* use setters */));
13630 /// let x = Cluster::new().set_or_clear_authenticator_groups_config(None::<AuthenticatorGroupsConfig>);
13631 /// ```
13632 pub fn set_or_clear_authenticator_groups_config<T>(mut self, v: std::option::Option<T>) -> Self
13633 where
13634 T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
13635 {
13636 self.authenticator_groups_config = v.map(|x| x.into());
13637 self
13638 }
13639
13640 /// Sets the value of [private_cluster_config][crate::model::Cluster::private_cluster_config].
13641 ///
13642 /// # Example
13643 /// ```ignore,no_run
13644 /// # use google_cloud_container_v1::model::Cluster;
13645 /// use google_cloud_container_v1::model::PrivateClusterConfig;
13646 /// let x = Cluster::new().set_private_cluster_config(PrivateClusterConfig::default()/* use setters */);
13647 /// ```
13648 pub fn set_private_cluster_config<T>(mut self, v: T) -> Self
13649 where
13650 T: std::convert::Into<crate::model::PrivateClusterConfig>,
13651 {
13652 self.private_cluster_config = std::option::Option::Some(v.into());
13653 self
13654 }
13655
13656 /// Sets or clears the value of [private_cluster_config][crate::model::Cluster::private_cluster_config].
13657 ///
13658 /// # Example
13659 /// ```ignore,no_run
13660 /// # use google_cloud_container_v1::model::Cluster;
13661 /// use google_cloud_container_v1::model::PrivateClusterConfig;
13662 /// let x = Cluster::new().set_or_clear_private_cluster_config(Some(PrivateClusterConfig::default()/* use setters */));
13663 /// let x = Cluster::new().set_or_clear_private_cluster_config(None::<PrivateClusterConfig>);
13664 /// ```
13665 pub fn set_or_clear_private_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
13666 where
13667 T: std::convert::Into<crate::model::PrivateClusterConfig>,
13668 {
13669 self.private_cluster_config = v.map(|x| x.into());
13670 self
13671 }
13672
13673 /// Sets the value of [database_encryption][crate::model::Cluster::database_encryption].
13674 ///
13675 /// # Example
13676 /// ```ignore,no_run
13677 /// # use google_cloud_container_v1::model::Cluster;
13678 /// use google_cloud_container_v1::model::DatabaseEncryption;
13679 /// let x = Cluster::new().set_database_encryption(DatabaseEncryption::default()/* use setters */);
13680 /// ```
13681 pub fn set_database_encryption<T>(mut self, v: T) -> Self
13682 where
13683 T: std::convert::Into<crate::model::DatabaseEncryption>,
13684 {
13685 self.database_encryption = std::option::Option::Some(v.into());
13686 self
13687 }
13688
13689 /// Sets or clears the value of [database_encryption][crate::model::Cluster::database_encryption].
13690 ///
13691 /// # Example
13692 /// ```ignore,no_run
13693 /// # use google_cloud_container_v1::model::Cluster;
13694 /// use google_cloud_container_v1::model::DatabaseEncryption;
13695 /// let x = Cluster::new().set_or_clear_database_encryption(Some(DatabaseEncryption::default()/* use setters */));
13696 /// let x = Cluster::new().set_or_clear_database_encryption(None::<DatabaseEncryption>);
13697 /// ```
13698 pub fn set_or_clear_database_encryption<T>(mut self, v: std::option::Option<T>) -> Self
13699 where
13700 T: std::convert::Into<crate::model::DatabaseEncryption>,
13701 {
13702 self.database_encryption = v.map(|x| x.into());
13703 self
13704 }
13705
13706 /// Sets the value of [vertical_pod_autoscaling][crate::model::Cluster::vertical_pod_autoscaling].
13707 ///
13708 /// # Example
13709 /// ```ignore,no_run
13710 /// # use google_cloud_container_v1::model::Cluster;
13711 /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
13712 /// let x = Cluster::new().set_vertical_pod_autoscaling(VerticalPodAutoscaling::default()/* use setters */);
13713 /// ```
13714 pub fn set_vertical_pod_autoscaling<T>(mut self, v: T) -> Self
13715 where
13716 T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
13717 {
13718 self.vertical_pod_autoscaling = std::option::Option::Some(v.into());
13719 self
13720 }
13721
13722 /// Sets or clears the value of [vertical_pod_autoscaling][crate::model::Cluster::vertical_pod_autoscaling].
13723 ///
13724 /// # Example
13725 /// ```ignore,no_run
13726 /// # use google_cloud_container_v1::model::Cluster;
13727 /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
13728 /// let x = Cluster::new().set_or_clear_vertical_pod_autoscaling(Some(VerticalPodAutoscaling::default()/* use setters */));
13729 /// let x = Cluster::new().set_or_clear_vertical_pod_autoscaling(None::<VerticalPodAutoscaling>);
13730 /// ```
13731 pub fn set_or_clear_vertical_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
13732 where
13733 T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
13734 {
13735 self.vertical_pod_autoscaling = v.map(|x| x.into());
13736 self
13737 }
13738
13739 /// Sets the value of [shielded_nodes][crate::model::Cluster::shielded_nodes].
13740 ///
13741 /// # Example
13742 /// ```ignore,no_run
13743 /// # use google_cloud_container_v1::model::Cluster;
13744 /// use google_cloud_container_v1::model::ShieldedNodes;
13745 /// let x = Cluster::new().set_shielded_nodes(ShieldedNodes::default()/* use setters */);
13746 /// ```
13747 pub fn set_shielded_nodes<T>(mut self, v: T) -> Self
13748 where
13749 T: std::convert::Into<crate::model::ShieldedNodes>,
13750 {
13751 self.shielded_nodes = std::option::Option::Some(v.into());
13752 self
13753 }
13754
13755 /// Sets or clears the value of [shielded_nodes][crate::model::Cluster::shielded_nodes].
13756 ///
13757 /// # Example
13758 /// ```ignore,no_run
13759 /// # use google_cloud_container_v1::model::Cluster;
13760 /// use google_cloud_container_v1::model::ShieldedNodes;
13761 /// let x = Cluster::new().set_or_clear_shielded_nodes(Some(ShieldedNodes::default()/* use setters */));
13762 /// let x = Cluster::new().set_or_clear_shielded_nodes(None::<ShieldedNodes>);
13763 /// ```
13764 pub fn set_or_clear_shielded_nodes<T>(mut self, v: std::option::Option<T>) -> Self
13765 where
13766 T: std::convert::Into<crate::model::ShieldedNodes>,
13767 {
13768 self.shielded_nodes = v.map(|x| x.into());
13769 self
13770 }
13771
13772 /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
13773 ///
13774 /// # Example
13775 /// ```ignore,no_run
13776 /// # use google_cloud_container_v1::model::Cluster;
13777 /// use google_cloud_container_v1::model::ReleaseChannel;
13778 /// let x = Cluster::new().set_release_channel(ReleaseChannel::default()/* use setters */);
13779 /// ```
13780 pub fn set_release_channel<T>(mut self, v: T) -> Self
13781 where
13782 T: std::convert::Into<crate::model::ReleaseChannel>,
13783 {
13784 self.release_channel = std::option::Option::Some(v.into());
13785 self
13786 }
13787
13788 /// Sets or clears the value of [release_channel][crate::model::Cluster::release_channel].
13789 ///
13790 /// # Example
13791 /// ```ignore,no_run
13792 /// # use google_cloud_container_v1::model::Cluster;
13793 /// use google_cloud_container_v1::model::ReleaseChannel;
13794 /// let x = Cluster::new().set_or_clear_release_channel(Some(ReleaseChannel::default()/* use setters */));
13795 /// let x = Cluster::new().set_or_clear_release_channel(None::<ReleaseChannel>);
13796 /// ```
13797 pub fn set_or_clear_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
13798 where
13799 T: std::convert::Into<crate::model::ReleaseChannel>,
13800 {
13801 self.release_channel = v.map(|x| x.into());
13802 self
13803 }
13804
13805 /// Sets the value of [workload_identity_config][crate::model::Cluster::workload_identity_config].
13806 ///
13807 /// # Example
13808 /// ```ignore,no_run
13809 /// # use google_cloud_container_v1::model::Cluster;
13810 /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
13811 /// let x = Cluster::new().set_workload_identity_config(WorkloadIdentityConfig::default()/* use setters */);
13812 /// ```
13813 pub fn set_workload_identity_config<T>(mut self, v: T) -> Self
13814 where
13815 T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
13816 {
13817 self.workload_identity_config = std::option::Option::Some(v.into());
13818 self
13819 }
13820
13821 /// Sets or clears the value of [workload_identity_config][crate::model::Cluster::workload_identity_config].
13822 ///
13823 /// # Example
13824 /// ```ignore,no_run
13825 /// # use google_cloud_container_v1::model::Cluster;
13826 /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
13827 /// let x = Cluster::new().set_or_clear_workload_identity_config(Some(WorkloadIdentityConfig::default()/* use setters */));
13828 /// let x = Cluster::new().set_or_clear_workload_identity_config(None::<WorkloadIdentityConfig>);
13829 /// ```
13830 pub fn set_or_clear_workload_identity_config<T>(mut self, v: std::option::Option<T>) -> Self
13831 where
13832 T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
13833 {
13834 self.workload_identity_config = v.map(|x| x.into());
13835 self
13836 }
13837
13838 /// Sets the value of [mesh_certificates][crate::model::Cluster::mesh_certificates].
13839 ///
13840 /// # Example
13841 /// ```ignore,no_run
13842 /// # use google_cloud_container_v1::model::Cluster;
13843 /// use google_cloud_container_v1::model::MeshCertificates;
13844 /// let x = Cluster::new().set_mesh_certificates(MeshCertificates::default()/* use setters */);
13845 /// ```
13846 pub fn set_mesh_certificates<T>(mut self, v: T) -> Self
13847 where
13848 T: std::convert::Into<crate::model::MeshCertificates>,
13849 {
13850 self.mesh_certificates = std::option::Option::Some(v.into());
13851 self
13852 }
13853
13854 /// Sets or clears the value of [mesh_certificates][crate::model::Cluster::mesh_certificates].
13855 ///
13856 /// # Example
13857 /// ```ignore,no_run
13858 /// # use google_cloud_container_v1::model::Cluster;
13859 /// use google_cloud_container_v1::model::MeshCertificates;
13860 /// let x = Cluster::new().set_or_clear_mesh_certificates(Some(MeshCertificates::default()/* use setters */));
13861 /// let x = Cluster::new().set_or_clear_mesh_certificates(None::<MeshCertificates>);
13862 /// ```
13863 pub fn set_or_clear_mesh_certificates<T>(mut self, v: std::option::Option<T>) -> Self
13864 where
13865 T: std::convert::Into<crate::model::MeshCertificates>,
13866 {
13867 self.mesh_certificates = v.map(|x| x.into());
13868 self
13869 }
13870
13871 /// Sets the value of [cost_management_config][crate::model::Cluster::cost_management_config].
13872 ///
13873 /// # Example
13874 /// ```ignore,no_run
13875 /// # use google_cloud_container_v1::model::Cluster;
13876 /// use google_cloud_container_v1::model::CostManagementConfig;
13877 /// let x = Cluster::new().set_cost_management_config(CostManagementConfig::default()/* use setters */);
13878 /// ```
13879 pub fn set_cost_management_config<T>(mut self, v: T) -> Self
13880 where
13881 T: std::convert::Into<crate::model::CostManagementConfig>,
13882 {
13883 self.cost_management_config = std::option::Option::Some(v.into());
13884 self
13885 }
13886
13887 /// Sets or clears the value of [cost_management_config][crate::model::Cluster::cost_management_config].
13888 ///
13889 /// # Example
13890 /// ```ignore,no_run
13891 /// # use google_cloud_container_v1::model::Cluster;
13892 /// use google_cloud_container_v1::model::CostManagementConfig;
13893 /// let x = Cluster::new().set_or_clear_cost_management_config(Some(CostManagementConfig::default()/* use setters */));
13894 /// let x = Cluster::new().set_or_clear_cost_management_config(None::<CostManagementConfig>);
13895 /// ```
13896 pub fn set_or_clear_cost_management_config<T>(mut self, v: std::option::Option<T>) -> Self
13897 where
13898 T: std::convert::Into<crate::model::CostManagementConfig>,
13899 {
13900 self.cost_management_config = v.map(|x| x.into());
13901 self
13902 }
13903
13904 /// Sets the value of [notification_config][crate::model::Cluster::notification_config].
13905 ///
13906 /// # Example
13907 /// ```ignore,no_run
13908 /// # use google_cloud_container_v1::model::Cluster;
13909 /// use google_cloud_container_v1::model::NotificationConfig;
13910 /// let x = Cluster::new().set_notification_config(NotificationConfig::default()/* use setters */);
13911 /// ```
13912 pub fn set_notification_config<T>(mut self, v: T) -> Self
13913 where
13914 T: std::convert::Into<crate::model::NotificationConfig>,
13915 {
13916 self.notification_config = std::option::Option::Some(v.into());
13917 self
13918 }
13919
13920 /// Sets or clears the value of [notification_config][crate::model::Cluster::notification_config].
13921 ///
13922 /// # Example
13923 /// ```ignore,no_run
13924 /// # use google_cloud_container_v1::model::Cluster;
13925 /// use google_cloud_container_v1::model::NotificationConfig;
13926 /// let x = Cluster::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
13927 /// let x = Cluster::new().set_or_clear_notification_config(None::<NotificationConfig>);
13928 /// ```
13929 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
13930 where
13931 T: std::convert::Into<crate::model::NotificationConfig>,
13932 {
13933 self.notification_config = v.map(|x| x.into());
13934 self
13935 }
13936
13937 /// Sets the value of [confidential_nodes][crate::model::Cluster::confidential_nodes].
13938 ///
13939 /// # Example
13940 /// ```ignore,no_run
13941 /// # use google_cloud_container_v1::model::Cluster;
13942 /// use google_cloud_container_v1::model::ConfidentialNodes;
13943 /// let x = Cluster::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
13944 /// ```
13945 pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
13946 where
13947 T: std::convert::Into<crate::model::ConfidentialNodes>,
13948 {
13949 self.confidential_nodes = std::option::Option::Some(v.into());
13950 self
13951 }
13952
13953 /// Sets or clears the value of [confidential_nodes][crate::model::Cluster::confidential_nodes].
13954 ///
13955 /// # Example
13956 /// ```ignore,no_run
13957 /// # use google_cloud_container_v1::model::Cluster;
13958 /// use google_cloud_container_v1::model::ConfidentialNodes;
13959 /// let x = Cluster::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
13960 /// let x = Cluster::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
13961 /// ```
13962 pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
13963 where
13964 T: std::convert::Into<crate::model::ConfidentialNodes>,
13965 {
13966 self.confidential_nodes = v.map(|x| x.into());
13967 self
13968 }
13969
13970 /// Sets the value of [identity_service_config][crate::model::Cluster::identity_service_config].
13971 ///
13972 /// # Example
13973 /// ```ignore,no_run
13974 /// # use google_cloud_container_v1::model::Cluster;
13975 /// use google_cloud_container_v1::model::IdentityServiceConfig;
13976 /// let x = Cluster::new().set_identity_service_config(IdentityServiceConfig::default()/* use setters */);
13977 /// ```
13978 pub fn set_identity_service_config<T>(mut self, v: T) -> Self
13979 where
13980 T: std::convert::Into<crate::model::IdentityServiceConfig>,
13981 {
13982 self.identity_service_config = std::option::Option::Some(v.into());
13983 self
13984 }
13985
13986 /// Sets or clears the value of [identity_service_config][crate::model::Cluster::identity_service_config].
13987 ///
13988 /// # Example
13989 /// ```ignore,no_run
13990 /// # use google_cloud_container_v1::model::Cluster;
13991 /// use google_cloud_container_v1::model::IdentityServiceConfig;
13992 /// let x = Cluster::new().set_or_clear_identity_service_config(Some(IdentityServiceConfig::default()/* use setters */));
13993 /// let x = Cluster::new().set_or_clear_identity_service_config(None::<IdentityServiceConfig>);
13994 /// ```
13995 pub fn set_or_clear_identity_service_config<T>(mut self, v: std::option::Option<T>) -> Self
13996 where
13997 T: std::convert::Into<crate::model::IdentityServiceConfig>,
13998 {
13999 self.identity_service_config = v.map(|x| x.into());
14000 self
14001 }
14002
14003 /// Sets the value of [self_link][crate::model::Cluster::self_link].
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_container_v1::model::Cluster;
14008 /// let x = Cluster::new().set_self_link("example");
14009 /// ```
14010 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14011 self.self_link = v.into();
14012 self
14013 }
14014
14015 /// Sets the value of [zone][crate::model::Cluster::zone].
14016 ///
14017 /// # Example
14018 /// ```ignore,no_run
14019 /// # use google_cloud_container_v1::model::Cluster;
14020 /// let x = Cluster::new().set_zone("example");
14021 /// ```
14022 #[deprecated]
14023 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14024 self.zone = v.into();
14025 self
14026 }
14027
14028 /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
14029 ///
14030 /// # Example
14031 /// ```ignore,no_run
14032 /// # use google_cloud_container_v1::model::Cluster;
14033 /// let x = Cluster::new().set_endpoint("example");
14034 /// ```
14035 pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14036 self.endpoint = v.into();
14037 self
14038 }
14039
14040 /// Sets the value of [initial_cluster_version][crate::model::Cluster::initial_cluster_version].
14041 ///
14042 /// # Example
14043 /// ```ignore,no_run
14044 /// # use google_cloud_container_v1::model::Cluster;
14045 /// let x = Cluster::new().set_initial_cluster_version("example");
14046 /// ```
14047 pub fn set_initial_cluster_version<T: std::convert::Into<std::string::String>>(
14048 mut self,
14049 v: T,
14050 ) -> Self {
14051 self.initial_cluster_version = v.into();
14052 self
14053 }
14054
14055 /// Sets the value of [current_master_version][crate::model::Cluster::current_master_version].
14056 ///
14057 /// # Example
14058 /// ```ignore,no_run
14059 /// # use google_cloud_container_v1::model::Cluster;
14060 /// let x = Cluster::new().set_current_master_version("example");
14061 /// ```
14062 pub fn set_current_master_version<T: std::convert::Into<std::string::String>>(
14063 mut self,
14064 v: T,
14065 ) -> Self {
14066 self.current_master_version = v.into();
14067 self
14068 }
14069
14070 /// Sets the value of [current_node_version][crate::model::Cluster::current_node_version].
14071 ///
14072 /// # Example
14073 /// ```ignore,no_run
14074 /// # use google_cloud_container_v1::model::Cluster;
14075 /// let x = Cluster::new().set_current_node_version("example");
14076 /// ```
14077 #[deprecated]
14078 pub fn set_current_node_version<T: std::convert::Into<std::string::String>>(
14079 mut self,
14080 v: T,
14081 ) -> Self {
14082 self.current_node_version = v.into();
14083 self
14084 }
14085
14086 /// Sets the value of [create_time][crate::model::Cluster::create_time].
14087 ///
14088 /// # Example
14089 /// ```ignore,no_run
14090 /// # use google_cloud_container_v1::model::Cluster;
14091 /// let x = Cluster::new().set_create_time("example");
14092 /// ```
14093 pub fn set_create_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14094 self.create_time = v.into();
14095 self
14096 }
14097
14098 /// Sets the value of [status][crate::model::Cluster::status].
14099 ///
14100 /// # Example
14101 /// ```ignore,no_run
14102 /// # use google_cloud_container_v1::model::Cluster;
14103 /// use google_cloud_container_v1::model::cluster::Status;
14104 /// let x0 = Cluster::new().set_status(Status::Provisioning);
14105 /// let x1 = Cluster::new().set_status(Status::Running);
14106 /// let x2 = Cluster::new().set_status(Status::Reconciling);
14107 /// ```
14108 pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
14109 mut self,
14110 v: T,
14111 ) -> Self {
14112 self.status = v.into();
14113 self
14114 }
14115
14116 /// Sets the value of [status_message][crate::model::Cluster::status_message].
14117 ///
14118 /// # Example
14119 /// ```ignore,no_run
14120 /// # use google_cloud_container_v1::model::Cluster;
14121 /// let x = Cluster::new().set_status_message("example");
14122 /// ```
14123 #[deprecated]
14124 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14125 self.status_message = v.into();
14126 self
14127 }
14128
14129 /// Sets the value of [node_ipv4_cidr_size][crate::model::Cluster::node_ipv4_cidr_size].
14130 ///
14131 /// # Example
14132 /// ```ignore,no_run
14133 /// # use google_cloud_container_v1::model::Cluster;
14134 /// let x = Cluster::new().set_node_ipv4_cidr_size(42);
14135 /// ```
14136 pub fn set_node_ipv4_cidr_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14137 self.node_ipv4_cidr_size = v.into();
14138 self
14139 }
14140
14141 /// Sets the value of [services_ipv4_cidr][crate::model::Cluster::services_ipv4_cidr].
14142 ///
14143 /// # Example
14144 /// ```ignore,no_run
14145 /// # use google_cloud_container_v1::model::Cluster;
14146 /// let x = Cluster::new().set_services_ipv4_cidr("example");
14147 /// ```
14148 pub fn set_services_ipv4_cidr<T: std::convert::Into<std::string::String>>(
14149 mut self,
14150 v: T,
14151 ) -> Self {
14152 self.services_ipv4_cidr = v.into();
14153 self
14154 }
14155
14156 /// Sets the value of [instance_group_urls][crate::model::Cluster::instance_group_urls].
14157 ///
14158 /// # Example
14159 /// ```ignore,no_run
14160 /// # use google_cloud_container_v1::model::Cluster;
14161 /// let x = Cluster::new().set_instance_group_urls(["a", "b", "c"]);
14162 /// ```
14163 #[deprecated]
14164 pub fn set_instance_group_urls<T, V>(mut self, v: T) -> Self
14165 where
14166 T: std::iter::IntoIterator<Item = V>,
14167 V: std::convert::Into<std::string::String>,
14168 {
14169 use std::iter::Iterator;
14170 self.instance_group_urls = v.into_iter().map(|i| i.into()).collect();
14171 self
14172 }
14173
14174 /// Sets the value of [current_node_count][crate::model::Cluster::current_node_count].
14175 ///
14176 /// # Example
14177 /// ```ignore,no_run
14178 /// # use google_cloud_container_v1::model::Cluster;
14179 /// let x = Cluster::new().set_current_node_count(42);
14180 /// ```
14181 #[deprecated]
14182 pub fn set_current_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14183 self.current_node_count = v.into();
14184 self
14185 }
14186
14187 /// Sets the value of [expire_time][crate::model::Cluster::expire_time].
14188 ///
14189 /// # Example
14190 /// ```ignore,no_run
14191 /// # use google_cloud_container_v1::model::Cluster;
14192 /// let x = Cluster::new().set_expire_time("example");
14193 /// ```
14194 pub fn set_expire_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14195 self.expire_time = v.into();
14196 self
14197 }
14198
14199 /// Sets the value of [location][crate::model::Cluster::location].
14200 ///
14201 /// # Example
14202 /// ```ignore,no_run
14203 /// # use google_cloud_container_v1::model::Cluster;
14204 /// let x = Cluster::new().set_location("example");
14205 /// ```
14206 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14207 self.location = v.into();
14208 self
14209 }
14210
14211 /// Sets the value of [enable_tpu][crate::model::Cluster::enable_tpu].
14212 ///
14213 /// # Example
14214 /// ```ignore,no_run
14215 /// # use google_cloud_container_v1::model::Cluster;
14216 /// let x = Cluster::new().set_enable_tpu(true);
14217 /// ```
14218 #[deprecated]
14219 pub fn set_enable_tpu<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14220 self.enable_tpu = v.into();
14221 self
14222 }
14223
14224 /// Sets the value of [tpu_ipv4_cidr_block][crate::model::Cluster::tpu_ipv4_cidr_block].
14225 ///
14226 /// # Example
14227 /// ```ignore,no_run
14228 /// # use google_cloud_container_v1::model::Cluster;
14229 /// let x = Cluster::new().set_tpu_ipv4_cidr_block("example");
14230 /// ```
14231 #[deprecated]
14232 pub fn set_tpu_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
14233 mut self,
14234 v: T,
14235 ) -> Self {
14236 self.tpu_ipv4_cidr_block = v.into();
14237 self
14238 }
14239
14240 /// Sets the value of [conditions][crate::model::Cluster::conditions].
14241 ///
14242 /// # Example
14243 /// ```ignore,no_run
14244 /// # use google_cloud_container_v1::model::Cluster;
14245 /// use google_cloud_container_v1::model::StatusCondition;
14246 /// let x = Cluster::new()
14247 /// .set_conditions([
14248 /// StatusCondition::default()/* use setters */,
14249 /// StatusCondition::default()/* use (different) setters */,
14250 /// ]);
14251 /// ```
14252 pub fn set_conditions<T, V>(mut self, v: T) -> Self
14253 where
14254 T: std::iter::IntoIterator<Item = V>,
14255 V: std::convert::Into<crate::model::StatusCondition>,
14256 {
14257 use std::iter::Iterator;
14258 self.conditions = v.into_iter().map(|i| i.into()).collect();
14259 self
14260 }
14261
14262 /// Sets the value of [autopilot][crate::model::Cluster::autopilot].
14263 ///
14264 /// # Example
14265 /// ```ignore,no_run
14266 /// # use google_cloud_container_v1::model::Cluster;
14267 /// use google_cloud_container_v1::model::Autopilot;
14268 /// let x = Cluster::new().set_autopilot(Autopilot::default()/* use setters */);
14269 /// ```
14270 pub fn set_autopilot<T>(mut self, v: T) -> Self
14271 where
14272 T: std::convert::Into<crate::model::Autopilot>,
14273 {
14274 self.autopilot = std::option::Option::Some(v.into());
14275 self
14276 }
14277
14278 /// Sets or clears the value of [autopilot][crate::model::Cluster::autopilot].
14279 ///
14280 /// # Example
14281 /// ```ignore,no_run
14282 /// # use google_cloud_container_v1::model::Cluster;
14283 /// use google_cloud_container_v1::model::Autopilot;
14284 /// let x = Cluster::new().set_or_clear_autopilot(Some(Autopilot::default()/* use setters */));
14285 /// let x = Cluster::new().set_or_clear_autopilot(None::<Autopilot>);
14286 /// ```
14287 pub fn set_or_clear_autopilot<T>(mut self, v: std::option::Option<T>) -> Self
14288 where
14289 T: std::convert::Into<crate::model::Autopilot>,
14290 {
14291 self.autopilot = v.map(|x| x.into());
14292 self
14293 }
14294
14295 /// Sets the value of [id][crate::model::Cluster::id].
14296 ///
14297 /// # Example
14298 /// ```ignore,no_run
14299 /// # use google_cloud_container_v1::model::Cluster;
14300 /// let x = Cluster::new().set_id("example");
14301 /// ```
14302 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14303 self.id = v.into();
14304 self
14305 }
14306
14307 /// Sets the value of [node_pool_defaults][crate::model::Cluster::node_pool_defaults].
14308 ///
14309 /// # Example
14310 /// ```ignore,no_run
14311 /// # use google_cloud_container_v1::model::Cluster;
14312 /// use google_cloud_container_v1::model::NodePoolDefaults;
14313 /// let x = Cluster::new().set_node_pool_defaults(NodePoolDefaults::default()/* use setters */);
14314 /// ```
14315 pub fn set_node_pool_defaults<T>(mut self, v: T) -> Self
14316 where
14317 T: std::convert::Into<crate::model::NodePoolDefaults>,
14318 {
14319 self.node_pool_defaults = std::option::Option::Some(v.into());
14320 self
14321 }
14322
14323 /// Sets or clears the value of [node_pool_defaults][crate::model::Cluster::node_pool_defaults].
14324 ///
14325 /// # Example
14326 /// ```ignore,no_run
14327 /// # use google_cloud_container_v1::model::Cluster;
14328 /// use google_cloud_container_v1::model::NodePoolDefaults;
14329 /// let x = Cluster::new().set_or_clear_node_pool_defaults(Some(NodePoolDefaults::default()/* use setters */));
14330 /// let x = Cluster::new().set_or_clear_node_pool_defaults(None::<NodePoolDefaults>);
14331 /// ```
14332 pub fn set_or_clear_node_pool_defaults<T>(mut self, v: std::option::Option<T>) -> Self
14333 where
14334 T: std::convert::Into<crate::model::NodePoolDefaults>,
14335 {
14336 self.node_pool_defaults = v.map(|x| x.into());
14337 self
14338 }
14339
14340 /// Sets the value of [logging_config][crate::model::Cluster::logging_config].
14341 ///
14342 /// # Example
14343 /// ```ignore,no_run
14344 /// # use google_cloud_container_v1::model::Cluster;
14345 /// use google_cloud_container_v1::model::LoggingConfig;
14346 /// let x = Cluster::new().set_logging_config(LoggingConfig::default()/* use setters */);
14347 /// ```
14348 pub fn set_logging_config<T>(mut self, v: T) -> Self
14349 where
14350 T: std::convert::Into<crate::model::LoggingConfig>,
14351 {
14352 self.logging_config = std::option::Option::Some(v.into());
14353 self
14354 }
14355
14356 /// Sets or clears the value of [logging_config][crate::model::Cluster::logging_config].
14357 ///
14358 /// # Example
14359 /// ```ignore,no_run
14360 /// # use google_cloud_container_v1::model::Cluster;
14361 /// use google_cloud_container_v1::model::LoggingConfig;
14362 /// let x = Cluster::new().set_or_clear_logging_config(Some(LoggingConfig::default()/* use setters */));
14363 /// let x = Cluster::new().set_or_clear_logging_config(None::<LoggingConfig>);
14364 /// ```
14365 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
14366 where
14367 T: std::convert::Into<crate::model::LoggingConfig>,
14368 {
14369 self.logging_config = v.map(|x| x.into());
14370 self
14371 }
14372
14373 /// Sets the value of [monitoring_config][crate::model::Cluster::monitoring_config].
14374 ///
14375 /// # Example
14376 /// ```ignore,no_run
14377 /// # use google_cloud_container_v1::model::Cluster;
14378 /// use google_cloud_container_v1::model::MonitoringConfig;
14379 /// let x = Cluster::new().set_monitoring_config(MonitoringConfig::default()/* use setters */);
14380 /// ```
14381 pub fn set_monitoring_config<T>(mut self, v: T) -> Self
14382 where
14383 T: std::convert::Into<crate::model::MonitoringConfig>,
14384 {
14385 self.monitoring_config = std::option::Option::Some(v.into());
14386 self
14387 }
14388
14389 /// Sets or clears the value of [monitoring_config][crate::model::Cluster::monitoring_config].
14390 ///
14391 /// # Example
14392 /// ```ignore,no_run
14393 /// # use google_cloud_container_v1::model::Cluster;
14394 /// use google_cloud_container_v1::model::MonitoringConfig;
14395 /// let x = Cluster::new().set_or_clear_monitoring_config(Some(MonitoringConfig::default()/* use setters */));
14396 /// let x = Cluster::new().set_or_clear_monitoring_config(None::<MonitoringConfig>);
14397 /// ```
14398 pub fn set_or_clear_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
14399 where
14400 T: std::convert::Into<crate::model::MonitoringConfig>,
14401 {
14402 self.monitoring_config = v.map(|x| x.into());
14403 self
14404 }
14405
14406 /// Sets the value of [node_pool_auto_config][crate::model::Cluster::node_pool_auto_config].
14407 ///
14408 /// # Example
14409 /// ```ignore,no_run
14410 /// # use google_cloud_container_v1::model::Cluster;
14411 /// use google_cloud_container_v1::model::NodePoolAutoConfig;
14412 /// let x = Cluster::new().set_node_pool_auto_config(NodePoolAutoConfig::default()/* use setters */);
14413 /// ```
14414 pub fn set_node_pool_auto_config<T>(mut self, v: T) -> Self
14415 where
14416 T: std::convert::Into<crate::model::NodePoolAutoConfig>,
14417 {
14418 self.node_pool_auto_config = std::option::Option::Some(v.into());
14419 self
14420 }
14421
14422 /// Sets or clears the value of [node_pool_auto_config][crate::model::Cluster::node_pool_auto_config].
14423 ///
14424 /// # Example
14425 /// ```ignore,no_run
14426 /// # use google_cloud_container_v1::model::Cluster;
14427 /// use google_cloud_container_v1::model::NodePoolAutoConfig;
14428 /// let x = Cluster::new().set_or_clear_node_pool_auto_config(Some(NodePoolAutoConfig::default()/* use setters */));
14429 /// let x = Cluster::new().set_or_clear_node_pool_auto_config(None::<NodePoolAutoConfig>);
14430 /// ```
14431 pub fn set_or_clear_node_pool_auto_config<T>(mut self, v: std::option::Option<T>) -> Self
14432 where
14433 T: std::convert::Into<crate::model::NodePoolAutoConfig>,
14434 {
14435 self.node_pool_auto_config = v.map(|x| x.into());
14436 self
14437 }
14438
14439 /// Sets the value of [pod_autoscaling][crate::model::Cluster::pod_autoscaling].
14440 ///
14441 /// # Example
14442 /// ```ignore,no_run
14443 /// # use google_cloud_container_v1::model::Cluster;
14444 /// use google_cloud_container_v1::model::PodAutoscaling;
14445 /// let x = Cluster::new().set_pod_autoscaling(PodAutoscaling::default()/* use setters */);
14446 /// ```
14447 pub fn set_pod_autoscaling<T>(mut self, v: T) -> Self
14448 where
14449 T: std::convert::Into<crate::model::PodAutoscaling>,
14450 {
14451 self.pod_autoscaling = std::option::Option::Some(v.into());
14452 self
14453 }
14454
14455 /// Sets or clears the value of [pod_autoscaling][crate::model::Cluster::pod_autoscaling].
14456 ///
14457 /// # Example
14458 /// ```ignore,no_run
14459 /// # use google_cloud_container_v1::model::Cluster;
14460 /// use google_cloud_container_v1::model::PodAutoscaling;
14461 /// let x = Cluster::new().set_or_clear_pod_autoscaling(Some(PodAutoscaling::default()/* use setters */));
14462 /// let x = Cluster::new().set_or_clear_pod_autoscaling(None::<PodAutoscaling>);
14463 /// ```
14464 pub fn set_or_clear_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
14465 where
14466 T: std::convert::Into<crate::model::PodAutoscaling>,
14467 {
14468 self.pod_autoscaling = v.map(|x| x.into());
14469 self
14470 }
14471
14472 /// Sets the value of [etag][crate::model::Cluster::etag].
14473 ///
14474 /// # Example
14475 /// ```ignore,no_run
14476 /// # use google_cloud_container_v1::model::Cluster;
14477 /// let x = Cluster::new().set_etag("example");
14478 /// ```
14479 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14480 self.etag = v.into();
14481 self
14482 }
14483
14484 /// Sets the value of [fleet][crate::model::Cluster::fleet].
14485 ///
14486 /// # Example
14487 /// ```ignore,no_run
14488 /// # use google_cloud_container_v1::model::Cluster;
14489 /// use google_cloud_container_v1::model::Fleet;
14490 /// let x = Cluster::new().set_fleet(Fleet::default()/* use setters */);
14491 /// ```
14492 pub fn set_fleet<T>(mut self, v: T) -> Self
14493 where
14494 T: std::convert::Into<crate::model::Fleet>,
14495 {
14496 self.fleet = std::option::Option::Some(v.into());
14497 self
14498 }
14499
14500 /// Sets or clears the value of [fleet][crate::model::Cluster::fleet].
14501 ///
14502 /// # Example
14503 /// ```ignore,no_run
14504 /// # use google_cloud_container_v1::model::Cluster;
14505 /// use google_cloud_container_v1::model::Fleet;
14506 /// let x = Cluster::new().set_or_clear_fleet(Some(Fleet::default()/* use setters */));
14507 /// let x = Cluster::new().set_or_clear_fleet(None::<Fleet>);
14508 /// ```
14509 pub fn set_or_clear_fleet<T>(mut self, v: std::option::Option<T>) -> Self
14510 where
14511 T: std::convert::Into<crate::model::Fleet>,
14512 {
14513 self.fleet = v.map(|x| x.into());
14514 self
14515 }
14516
14517 /// Sets the value of [security_posture_config][crate::model::Cluster::security_posture_config].
14518 ///
14519 /// # Example
14520 /// ```ignore,no_run
14521 /// # use google_cloud_container_v1::model::Cluster;
14522 /// use google_cloud_container_v1::model::SecurityPostureConfig;
14523 /// let x = Cluster::new().set_security_posture_config(SecurityPostureConfig::default()/* use setters */);
14524 /// ```
14525 pub fn set_security_posture_config<T>(mut self, v: T) -> Self
14526 where
14527 T: std::convert::Into<crate::model::SecurityPostureConfig>,
14528 {
14529 self.security_posture_config = std::option::Option::Some(v.into());
14530 self
14531 }
14532
14533 /// Sets or clears the value of [security_posture_config][crate::model::Cluster::security_posture_config].
14534 ///
14535 /// # Example
14536 /// ```ignore,no_run
14537 /// # use google_cloud_container_v1::model::Cluster;
14538 /// use google_cloud_container_v1::model::SecurityPostureConfig;
14539 /// let x = Cluster::new().set_or_clear_security_posture_config(Some(SecurityPostureConfig::default()/* use setters */));
14540 /// let x = Cluster::new().set_or_clear_security_posture_config(None::<SecurityPostureConfig>);
14541 /// ```
14542 pub fn set_or_clear_security_posture_config<T>(mut self, v: std::option::Option<T>) -> Self
14543 where
14544 T: std::convert::Into<crate::model::SecurityPostureConfig>,
14545 {
14546 self.security_posture_config = v.map(|x| x.into());
14547 self
14548 }
14549
14550 /// Sets the value of [control_plane_endpoints_config][crate::model::Cluster::control_plane_endpoints_config].
14551 ///
14552 /// # Example
14553 /// ```ignore,no_run
14554 /// # use google_cloud_container_v1::model::Cluster;
14555 /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
14556 /// let x = Cluster::new().set_control_plane_endpoints_config(ControlPlaneEndpointsConfig::default()/* use setters */);
14557 /// ```
14558 pub fn set_control_plane_endpoints_config<T>(mut self, v: T) -> Self
14559 where
14560 T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
14561 {
14562 self.control_plane_endpoints_config = std::option::Option::Some(v.into());
14563 self
14564 }
14565
14566 /// Sets or clears the value of [control_plane_endpoints_config][crate::model::Cluster::control_plane_endpoints_config].
14567 ///
14568 /// # Example
14569 /// ```ignore,no_run
14570 /// # use google_cloud_container_v1::model::Cluster;
14571 /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
14572 /// let x = Cluster::new().set_or_clear_control_plane_endpoints_config(Some(ControlPlaneEndpointsConfig::default()/* use setters */));
14573 /// let x = Cluster::new().set_or_clear_control_plane_endpoints_config(None::<ControlPlaneEndpointsConfig>);
14574 /// ```
14575 pub fn set_or_clear_control_plane_endpoints_config<T>(
14576 mut self,
14577 v: std::option::Option<T>,
14578 ) -> Self
14579 where
14580 T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
14581 {
14582 self.control_plane_endpoints_config = v.map(|x| x.into());
14583 self
14584 }
14585
14586 /// Sets the value of [enable_k8s_beta_apis][crate::model::Cluster::enable_k8s_beta_apis].
14587 ///
14588 /// # Example
14589 /// ```ignore,no_run
14590 /// # use google_cloud_container_v1::model::Cluster;
14591 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
14592 /// let x = Cluster::new().set_enable_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
14593 /// ```
14594 pub fn set_enable_k8s_beta_apis<T>(mut self, v: T) -> Self
14595 where
14596 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
14597 {
14598 self.enable_k8s_beta_apis = std::option::Option::Some(v.into());
14599 self
14600 }
14601
14602 /// Sets or clears the value of [enable_k8s_beta_apis][crate::model::Cluster::enable_k8s_beta_apis].
14603 ///
14604 /// # Example
14605 /// ```ignore,no_run
14606 /// # use google_cloud_container_v1::model::Cluster;
14607 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
14608 /// let x = Cluster::new().set_or_clear_enable_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
14609 /// let x = Cluster::new().set_or_clear_enable_k8s_beta_apis(None::<K8sBetaAPIConfig>);
14610 /// ```
14611 pub fn set_or_clear_enable_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
14612 where
14613 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
14614 {
14615 self.enable_k8s_beta_apis = v.map(|x| x.into());
14616 self
14617 }
14618
14619 /// Sets the value of [enterprise_config][crate::model::Cluster::enterprise_config].
14620 ///
14621 /// # Example
14622 /// ```ignore,no_run
14623 /// # use google_cloud_container_v1::model::Cluster;
14624 /// use google_cloud_container_v1::model::EnterpriseConfig;
14625 /// let x = Cluster::new().set_enterprise_config(EnterpriseConfig::default()/* use setters */);
14626 /// ```
14627 #[deprecated]
14628 pub fn set_enterprise_config<T>(mut self, v: T) -> Self
14629 where
14630 T: std::convert::Into<crate::model::EnterpriseConfig>,
14631 {
14632 self.enterprise_config = std::option::Option::Some(v.into());
14633 self
14634 }
14635
14636 /// Sets or clears the value of [enterprise_config][crate::model::Cluster::enterprise_config].
14637 ///
14638 /// # Example
14639 /// ```ignore,no_run
14640 /// # use google_cloud_container_v1::model::Cluster;
14641 /// use google_cloud_container_v1::model::EnterpriseConfig;
14642 /// let x = Cluster::new().set_or_clear_enterprise_config(Some(EnterpriseConfig::default()/* use setters */));
14643 /// let x = Cluster::new().set_or_clear_enterprise_config(None::<EnterpriseConfig>);
14644 /// ```
14645 #[deprecated]
14646 pub fn set_or_clear_enterprise_config<T>(mut self, v: std::option::Option<T>) -> Self
14647 where
14648 T: std::convert::Into<crate::model::EnterpriseConfig>,
14649 {
14650 self.enterprise_config = v.map(|x| x.into());
14651 self
14652 }
14653
14654 /// Sets the value of [secret_manager_config][crate::model::Cluster::secret_manager_config].
14655 ///
14656 /// # Example
14657 /// ```ignore,no_run
14658 /// # use google_cloud_container_v1::model::Cluster;
14659 /// use google_cloud_container_v1::model::SecretManagerConfig;
14660 /// let x = Cluster::new().set_secret_manager_config(SecretManagerConfig::default()/* use setters */);
14661 /// ```
14662 pub fn set_secret_manager_config<T>(mut self, v: T) -> Self
14663 where
14664 T: std::convert::Into<crate::model::SecretManagerConfig>,
14665 {
14666 self.secret_manager_config = std::option::Option::Some(v.into());
14667 self
14668 }
14669
14670 /// Sets or clears the value of [secret_manager_config][crate::model::Cluster::secret_manager_config].
14671 ///
14672 /// # Example
14673 /// ```ignore,no_run
14674 /// # use google_cloud_container_v1::model::Cluster;
14675 /// use google_cloud_container_v1::model::SecretManagerConfig;
14676 /// let x = Cluster::new().set_or_clear_secret_manager_config(Some(SecretManagerConfig::default()/* use setters */));
14677 /// let x = Cluster::new().set_or_clear_secret_manager_config(None::<SecretManagerConfig>);
14678 /// ```
14679 pub fn set_or_clear_secret_manager_config<T>(mut self, v: std::option::Option<T>) -> Self
14680 where
14681 T: std::convert::Into<crate::model::SecretManagerConfig>,
14682 {
14683 self.secret_manager_config = v.map(|x| x.into());
14684 self
14685 }
14686
14687 /// Sets the value of [compliance_posture_config][crate::model::Cluster::compliance_posture_config].
14688 ///
14689 /// # Example
14690 /// ```ignore,no_run
14691 /// # use google_cloud_container_v1::model::Cluster;
14692 /// use google_cloud_container_v1::model::CompliancePostureConfig;
14693 /// let x = Cluster::new().set_compliance_posture_config(CompliancePostureConfig::default()/* use setters */);
14694 /// ```
14695 #[deprecated]
14696 pub fn set_compliance_posture_config<T>(mut self, v: T) -> Self
14697 where
14698 T: std::convert::Into<crate::model::CompliancePostureConfig>,
14699 {
14700 self.compliance_posture_config = std::option::Option::Some(v.into());
14701 self
14702 }
14703
14704 /// Sets or clears the value of [compliance_posture_config][crate::model::Cluster::compliance_posture_config].
14705 ///
14706 /// # Example
14707 /// ```ignore,no_run
14708 /// # use google_cloud_container_v1::model::Cluster;
14709 /// use google_cloud_container_v1::model::CompliancePostureConfig;
14710 /// let x = Cluster::new().set_or_clear_compliance_posture_config(Some(CompliancePostureConfig::default()/* use setters */));
14711 /// let x = Cluster::new().set_or_clear_compliance_posture_config(None::<CompliancePostureConfig>);
14712 /// ```
14713 #[deprecated]
14714 pub fn set_or_clear_compliance_posture_config<T>(mut self, v: std::option::Option<T>) -> Self
14715 where
14716 T: std::convert::Into<crate::model::CompliancePostureConfig>,
14717 {
14718 self.compliance_posture_config = v.map(|x| x.into());
14719 self
14720 }
14721
14722 /// Sets the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
14723 ///
14724 /// # Example
14725 /// ```ignore,no_run
14726 /// # use google_cloud_container_v1::model::Cluster;
14727 /// let x = Cluster::new().set_satisfies_pzs(true);
14728 /// ```
14729 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
14730 where
14731 T: std::convert::Into<bool>,
14732 {
14733 self.satisfies_pzs = std::option::Option::Some(v.into());
14734 self
14735 }
14736
14737 /// Sets or clears the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
14738 ///
14739 /// # Example
14740 /// ```ignore,no_run
14741 /// # use google_cloud_container_v1::model::Cluster;
14742 /// let x = Cluster::new().set_or_clear_satisfies_pzs(Some(false));
14743 /// let x = Cluster::new().set_or_clear_satisfies_pzs(None::<bool>);
14744 /// ```
14745 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
14746 where
14747 T: std::convert::Into<bool>,
14748 {
14749 self.satisfies_pzs = v.map(|x| x.into());
14750 self
14751 }
14752
14753 /// Sets the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
14754 ///
14755 /// # Example
14756 /// ```ignore,no_run
14757 /// # use google_cloud_container_v1::model::Cluster;
14758 /// let x = Cluster::new().set_satisfies_pzi(true);
14759 /// ```
14760 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
14761 where
14762 T: std::convert::Into<bool>,
14763 {
14764 self.satisfies_pzi = std::option::Option::Some(v.into());
14765 self
14766 }
14767
14768 /// Sets or clears the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
14769 ///
14770 /// # Example
14771 /// ```ignore,no_run
14772 /// # use google_cloud_container_v1::model::Cluster;
14773 /// let x = Cluster::new().set_or_clear_satisfies_pzi(Some(false));
14774 /// let x = Cluster::new().set_or_clear_satisfies_pzi(None::<bool>);
14775 /// ```
14776 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
14777 where
14778 T: std::convert::Into<bool>,
14779 {
14780 self.satisfies_pzi = v.map(|x| x.into());
14781 self
14782 }
14783
14784 /// Sets the value of [user_managed_keys_config][crate::model::Cluster::user_managed_keys_config].
14785 ///
14786 /// # Example
14787 /// ```ignore,no_run
14788 /// # use google_cloud_container_v1::model::Cluster;
14789 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
14790 /// let x = Cluster::new().set_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
14791 /// ```
14792 pub fn set_user_managed_keys_config<T>(mut self, v: T) -> Self
14793 where
14794 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
14795 {
14796 self.user_managed_keys_config = std::option::Option::Some(v.into());
14797 self
14798 }
14799
14800 /// Sets or clears the value of [user_managed_keys_config][crate::model::Cluster::user_managed_keys_config].
14801 ///
14802 /// # Example
14803 /// ```ignore,no_run
14804 /// # use google_cloud_container_v1::model::Cluster;
14805 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
14806 /// let x = Cluster::new().set_or_clear_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
14807 /// let x = Cluster::new().set_or_clear_user_managed_keys_config(None::<UserManagedKeysConfig>);
14808 /// ```
14809 pub fn set_or_clear_user_managed_keys_config<T>(mut self, v: std::option::Option<T>) -> Self
14810 where
14811 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
14812 {
14813 self.user_managed_keys_config = v.map(|x| x.into());
14814 self
14815 }
14816
14817 /// Sets the value of [rbac_binding_config][crate::model::Cluster::rbac_binding_config].
14818 ///
14819 /// # Example
14820 /// ```ignore,no_run
14821 /// # use google_cloud_container_v1::model::Cluster;
14822 /// use google_cloud_container_v1::model::RBACBindingConfig;
14823 /// let x = Cluster::new().set_rbac_binding_config(RBACBindingConfig::default()/* use setters */);
14824 /// ```
14825 pub fn set_rbac_binding_config<T>(mut self, v: T) -> Self
14826 where
14827 T: std::convert::Into<crate::model::RBACBindingConfig>,
14828 {
14829 self.rbac_binding_config = std::option::Option::Some(v.into());
14830 self
14831 }
14832
14833 /// Sets or clears the value of [rbac_binding_config][crate::model::Cluster::rbac_binding_config].
14834 ///
14835 /// # Example
14836 /// ```ignore,no_run
14837 /// # use google_cloud_container_v1::model::Cluster;
14838 /// use google_cloud_container_v1::model::RBACBindingConfig;
14839 /// let x = Cluster::new().set_or_clear_rbac_binding_config(Some(RBACBindingConfig::default()/* use setters */));
14840 /// let x = Cluster::new().set_or_clear_rbac_binding_config(None::<RBACBindingConfig>);
14841 /// ```
14842 pub fn set_or_clear_rbac_binding_config<T>(mut self, v: std::option::Option<T>) -> Self
14843 where
14844 T: std::convert::Into<crate::model::RBACBindingConfig>,
14845 {
14846 self.rbac_binding_config = v.map(|x| x.into());
14847 self
14848 }
14849
14850 /// Sets the value of [gke_auto_upgrade_config][crate::model::Cluster::gke_auto_upgrade_config].
14851 ///
14852 /// # Example
14853 /// ```ignore,no_run
14854 /// # use google_cloud_container_v1::model::Cluster;
14855 /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
14856 /// let x = Cluster::new().set_gke_auto_upgrade_config(GkeAutoUpgradeConfig::default()/* use setters */);
14857 /// ```
14858 pub fn set_gke_auto_upgrade_config<T>(mut self, v: T) -> Self
14859 where
14860 T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
14861 {
14862 self.gke_auto_upgrade_config = std::option::Option::Some(v.into());
14863 self
14864 }
14865
14866 /// Sets or clears the value of [gke_auto_upgrade_config][crate::model::Cluster::gke_auto_upgrade_config].
14867 ///
14868 /// # Example
14869 /// ```ignore,no_run
14870 /// # use google_cloud_container_v1::model::Cluster;
14871 /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
14872 /// let x = Cluster::new().set_or_clear_gke_auto_upgrade_config(Some(GkeAutoUpgradeConfig::default()/* use setters */));
14873 /// let x = Cluster::new().set_or_clear_gke_auto_upgrade_config(None::<GkeAutoUpgradeConfig>);
14874 /// ```
14875 pub fn set_or_clear_gke_auto_upgrade_config<T>(mut self, v: std::option::Option<T>) -> Self
14876 where
14877 T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
14878 {
14879 self.gke_auto_upgrade_config = v.map(|x| x.into());
14880 self
14881 }
14882
14883 /// Sets the value of [anonymous_authentication_config][crate::model::Cluster::anonymous_authentication_config].
14884 ///
14885 /// # Example
14886 /// ```ignore,no_run
14887 /// # use google_cloud_container_v1::model::Cluster;
14888 /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
14889 /// let x = Cluster::new().set_anonymous_authentication_config(AnonymousAuthenticationConfig::default()/* use setters */);
14890 /// ```
14891 pub fn set_anonymous_authentication_config<T>(mut self, v: T) -> Self
14892 where
14893 T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
14894 {
14895 self.anonymous_authentication_config = std::option::Option::Some(v.into());
14896 self
14897 }
14898
14899 /// Sets or clears the value of [anonymous_authentication_config][crate::model::Cluster::anonymous_authentication_config].
14900 ///
14901 /// # Example
14902 /// ```ignore,no_run
14903 /// # use google_cloud_container_v1::model::Cluster;
14904 /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
14905 /// let x = Cluster::new().set_or_clear_anonymous_authentication_config(Some(AnonymousAuthenticationConfig::default()/* use setters */));
14906 /// let x = Cluster::new().set_or_clear_anonymous_authentication_config(None::<AnonymousAuthenticationConfig>);
14907 /// ```
14908 pub fn set_or_clear_anonymous_authentication_config<T>(
14909 mut self,
14910 v: std::option::Option<T>,
14911 ) -> Self
14912 where
14913 T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
14914 {
14915 self.anonymous_authentication_config = v.map(|x| x.into());
14916 self
14917 }
14918
14919 /// Sets the value of [schedule_upgrade_config][crate::model::Cluster::schedule_upgrade_config].
14920 ///
14921 /// # Example
14922 /// ```ignore,no_run
14923 /// # use google_cloud_container_v1::model::Cluster;
14924 /// use google_cloud_container_v1::model::ScheduleUpgradeConfig;
14925 /// let x = Cluster::new().set_schedule_upgrade_config(ScheduleUpgradeConfig::default()/* use setters */);
14926 /// ```
14927 pub fn set_schedule_upgrade_config<T>(mut self, v: T) -> Self
14928 where
14929 T: std::convert::Into<crate::model::ScheduleUpgradeConfig>,
14930 {
14931 self.schedule_upgrade_config = std::option::Option::Some(v.into());
14932 self
14933 }
14934
14935 /// Sets or clears the value of [schedule_upgrade_config][crate::model::Cluster::schedule_upgrade_config].
14936 ///
14937 /// # Example
14938 /// ```ignore,no_run
14939 /// # use google_cloud_container_v1::model::Cluster;
14940 /// use google_cloud_container_v1::model::ScheduleUpgradeConfig;
14941 /// let x = Cluster::new().set_or_clear_schedule_upgrade_config(Some(ScheduleUpgradeConfig::default()/* use setters */));
14942 /// let x = Cluster::new().set_or_clear_schedule_upgrade_config(None::<ScheduleUpgradeConfig>);
14943 /// ```
14944 pub fn set_or_clear_schedule_upgrade_config<T>(mut self, v: std::option::Option<T>) -> Self
14945 where
14946 T: std::convert::Into<crate::model::ScheduleUpgradeConfig>,
14947 {
14948 self.schedule_upgrade_config = v.map(|x| x.into());
14949 self
14950 }
14951
14952 /// Sets the value of [secret_sync_config][crate::model::Cluster::secret_sync_config].
14953 ///
14954 /// # Example
14955 /// ```ignore,no_run
14956 /// # use google_cloud_container_v1::model::Cluster;
14957 /// use google_cloud_container_v1::model::SecretSyncConfig;
14958 /// let x = Cluster::new().set_secret_sync_config(SecretSyncConfig::default()/* use setters */);
14959 /// ```
14960 pub fn set_secret_sync_config<T>(mut self, v: T) -> Self
14961 where
14962 T: std::convert::Into<crate::model::SecretSyncConfig>,
14963 {
14964 self.secret_sync_config = std::option::Option::Some(v.into());
14965 self
14966 }
14967
14968 /// Sets or clears the value of [secret_sync_config][crate::model::Cluster::secret_sync_config].
14969 ///
14970 /// # Example
14971 /// ```ignore,no_run
14972 /// # use google_cloud_container_v1::model::Cluster;
14973 /// use google_cloud_container_v1::model::SecretSyncConfig;
14974 /// let x = Cluster::new().set_or_clear_secret_sync_config(Some(SecretSyncConfig::default()/* use setters */));
14975 /// let x = Cluster::new().set_or_clear_secret_sync_config(None::<SecretSyncConfig>);
14976 /// ```
14977 pub fn set_or_clear_secret_sync_config<T>(mut self, v: std::option::Option<T>) -> Self
14978 where
14979 T: std::convert::Into<crate::model::SecretSyncConfig>,
14980 {
14981 self.secret_sync_config = v.map(|x| x.into());
14982 self
14983 }
14984
14985 /// Sets the value of [managed_opentelemetry_config][crate::model::Cluster::managed_opentelemetry_config].
14986 ///
14987 /// # Example
14988 /// ```ignore,no_run
14989 /// # use google_cloud_container_v1::model::Cluster;
14990 /// use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
14991 /// let x = Cluster::new().set_managed_opentelemetry_config(ManagedOpenTelemetryConfig::default()/* use setters */);
14992 /// ```
14993 pub fn set_managed_opentelemetry_config<T>(mut self, v: T) -> Self
14994 where
14995 T: std::convert::Into<crate::model::ManagedOpenTelemetryConfig>,
14996 {
14997 self.managed_opentelemetry_config = std::option::Option::Some(v.into());
14998 self
14999 }
15000
15001 /// Sets or clears the value of [managed_opentelemetry_config][crate::model::Cluster::managed_opentelemetry_config].
15002 ///
15003 /// # Example
15004 /// ```ignore,no_run
15005 /// # use google_cloud_container_v1::model::Cluster;
15006 /// use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
15007 /// let x = Cluster::new().set_or_clear_managed_opentelemetry_config(Some(ManagedOpenTelemetryConfig::default()/* use setters */));
15008 /// let x = Cluster::new().set_or_clear_managed_opentelemetry_config(None::<ManagedOpenTelemetryConfig>);
15009 /// ```
15010 pub fn set_or_clear_managed_opentelemetry_config<T>(mut self, v: std::option::Option<T>) -> Self
15011 where
15012 T: std::convert::Into<crate::model::ManagedOpenTelemetryConfig>,
15013 {
15014 self.managed_opentelemetry_config = v.map(|x| x.into());
15015 self
15016 }
15017
15018 /// Sets the value of [control_plane_egress][crate::model::Cluster::control_plane_egress].
15019 ///
15020 /// # Example
15021 /// ```ignore,no_run
15022 /// # use google_cloud_container_v1::model::Cluster;
15023 /// use google_cloud_container_v1::model::ControlPlaneEgress;
15024 /// let x = Cluster::new().set_control_plane_egress(ControlPlaneEgress::default()/* use setters */);
15025 /// ```
15026 pub fn set_control_plane_egress<T>(mut self, v: T) -> Self
15027 where
15028 T: std::convert::Into<crate::model::ControlPlaneEgress>,
15029 {
15030 self.control_plane_egress = std::option::Option::Some(v.into());
15031 self
15032 }
15033
15034 /// Sets or clears the value of [control_plane_egress][crate::model::Cluster::control_plane_egress].
15035 ///
15036 /// # Example
15037 /// ```ignore,no_run
15038 /// # use google_cloud_container_v1::model::Cluster;
15039 /// use google_cloud_container_v1::model::ControlPlaneEgress;
15040 /// let x = Cluster::new().set_or_clear_control_plane_egress(Some(ControlPlaneEgress::default()/* use setters */));
15041 /// let x = Cluster::new().set_or_clear_control_plane_egress(None::<ControlPlaneEgress>);
15042 /// ```
15043 pub fn set_or_clear_control_plane_egress<T>(mut self, v: std::option::Option<T>) -> Self
15044 where
15045 T: std::convert::Into<crate::model::ControlPlaneEgress>,
15046 {
15047 self.control_plane_egress = v.map(|x| x.into());
15048 self
15049 }
15050
15051 /// Sets the value of [managed_machine_learning_diagnostics_config][crate::model::Cluster::managed_machine_learning_diagnostics_config].
15052 ///
15053 /// # Example
15054 /// ```ignore,no_run
15055 /// # use google_cloud_container_v1::model::Cluster;
15056 /// use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
15057 /// let x = Cluster::new().set_managed_machine_learning_diagnostics_config(ManagedMachineLearningDiagnosticsConfig::default()/* use setters */);
15058 /// ```
15059 pub fn set_managed_machine_learning_diagnostics_config<T>(mut self, v: T) -> Self
15060 where
15061 T: std::convert::Into<crate::model::ManagedMachineLearningDiagnosticsConfig>,
15062 {
15063 self.managed_machine_learning_diagnostics_config = std::option::Option::Some(v.into());
15064 self
15065 }
15066
15067 /// Sets or clears the value of [managed_machine_learning_diagnostics_config][crate::model::Cluster::managed_machine_learning_diagnostics_config].
15068 ///
15069 /// # Example
15070 /// ```ignore,no_run
15071 /// # use google_cloud_container_v1::model::Cluster;
15072 /// use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
15073 /// let x = Cluster::new().set_or_clear_managed_machine_learning_diagnostics_config(Some(ManagedMachineLearningDiagnosticsConfig::default()/* use setters */));
15074 /// let x = Cluster::new().set_or_clear_managed_machine_learning_diagnostics_config(None::<ManagedMachineLearningDiagnosticsConfig>);
15075 /// ```
15076 pub fn set_or_clear_managed_machine_learning_diagnostics_config<T>(
15077 mut self,
15078 v: std::option::Option<T>,
15079 ) -> Self
15080 where
15081 T: std::convert::Into<crate::model::ManagedMachineLearningDiagnosticsConfig>,
15082 {
15083 self.managed_machine_learning_diagnostics_config = v.map(|x| x.into());
15084 self
15085 }
15086
15087 /// Sets the value of [node_creation_config][crate::model::Cluster::node_creation_config].
15088 ///
15089 /// # Example
15090 /// ```ignore,no_run
15091 /// # use google_cloud_container_v1::model::Cluster;
15092 /// use google_cloud_container_v1::model::NodeCreationConfig;
15093 /// let x = Cluster::new().set_node_creation_config(NodeCreationConfig::default()/* use setters */);
15094 /// ```
15095 pub fn set_node_creation_config<T>(mut self, v: T) -> Self
15096 where
15097 T: std::convert::Into<crate::model::NodeCreationConfig>,
15098 {
15099 self.node_creation_config = std::option::Option::Some(v.into());
15100 self
15101 }
15102
15103 /// Sets or clears the value of [node_creation_config][crate::model::Cluster::node_creation_config].
15104 ///
15105 /// # Example
15106 /// ```ignore,no_run
15107 /// # use google_cloud_container_v1::model::Cluster;
15108 /// use google_cloud_container_v1::model::NodeCreationConfig;
15109 /// let x = Cluster::new().set_or_clear_node_creation_config(Some(NodeCreationConfig::default()/* use setters */));
15110 /// let x = Cluster::new().set_or_clear_node_creation_config(None::<NodeCreationConfig>);
15111 /// ```
15112 pub fn set_or_clear_node_creation_config<T>(mut self, v: std::option::Option<T>) -> Self
15113 where
15114 T: std::convert::Into<crate::model::NodeCreationConfig>,
15115 {
15116 self.node_creation_config = v.map(|x| x.into());
15117 self
15118 }
15119}
15120
15121impl wkt::message::Message for Cluster {
15122 fn typename() -> &'static str {
15123 "type.googleapis.com/google.container.v1.Cluster"
15124 }
15125}
15126
15127/// Defines additional types related to [Cluster].
15128pub mod cluster {
15129 #[allow(unused_imports)]
15130 use super::*;
15131
15132 /// The current status of the cluster.
15133 ///
15134 /// # Working with unknown values
15135 ///
15136 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15137 /// additional enum variants at any time. Adding new variants is not considered
15138 /// a breaking change. Applications should write their code in anticipation of:
15139 ///
15140 /// - New values appearing in future releases of the client library, **and**
15141 /// - New values received dynamically, without application changes.
15142 ///
15143 /// Please consult the [Working with enums] section in the user guide for some
15144 /// guidelines.
15145 ///
15146 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15147 #[derive(Clone, Debug, PartialEq)]
15148 #[non_exhaustive]
15149 pub enum Status {
15150 /// Not set.
15151 Unspecified,
15152 /// The PROVISIONING state indicates the cluster is being created.
15153 Provisioning,
15154 /// The RUNNING state indicates the cluster has been created and is fully
15155 /// usable.
15156 Running,
15157 /// The RECONCILING state indicates that some work is actively being done on
15158 /// the cluster, such as upgrading the master or node software. Details can
15159 /// be found in the `statusMessage` field.
15160 Reconciling,
15161 /// The STOPPING state indicates the cluster is being deleted.
15162 Stopping,
15163 /// The ERROR state indicates the cluster is unusable. It will be
15164 /// automatically deleted. Details can be found in the `statusMessage` field.
15165 Error,
15166 /// The DEGRADED state indicates the cluster requires user action to restore
15167 /// full functionality. Details can be found in the `statusMessage` field.
15168 Degraded,
15169 /// If set, the enum was initialized with an unknown value.
15170 ///
15171 /// Applications can examine the value using [Status::value] or
15172 /// [Status::name].
15173 UnknownValue(status::UnknownValue),
15174 }
15175
15176 #[doc(hidden)]
15177 pub mod status {
15178 #[allow(unused_imports)]
15179 use super::*;
15180 #[derive(Clone, Debug, PartialEq)]
15181 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15182 }
15183
15184 impl Status {
15185 /// Gets the enum value.
15186 ///
15187 /// Returns `None` if the enum contains an unknown value deserialized from
15188 /// the string representation of enums.
15189 pub fn value(&self) -> std::option::Option<i32> {
15190 match self {
15191 Self::Unspecified => std::option::Option::Some(0),
15192 Self::Provisioning => std::option::Option::Some(1),
15193 Self::Running => std::option::Option::Some(2),
15194 Self::Reconciling => std::option::Option::Some(3),
15195 Self::Stopping => std::option::Option::Some(4),
15196 Self::Error => std::option::Option::Some(5),
15197 Self::Degraded => std::option::Option::Some(6),
15198 Self::UnknownValue(u) => u.0.value(),
15199 }
15200 }
15201
15202 /// Gets the enum value as a string.
15203 ///
15204 /// Returns `None` if the enum contains an unknown value deserialized from
15205 /// the integer representation of enums.
15206 pub fn name(&self) -> std::option::Option<&str> {
15207 match self {
15208 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
15209 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
15210 Self::Running => std::option::Option::Some("RUNNING"),
15211 Self::Reconciling => std::option::Option::Some("RECONCILING"),
15212 Self::Stopping => std::option::Option::Some("STOPPING"),
15213 Self::Error => std::option::Option::Some("ERROR"),
15214 Self::Degraded => std::option::Option::Some("DEGRADED"),
15215 Self::UnknownValue(u) => u.0.name(),
15216 }
15217 }
15218 }
15219
15220 impl std::default::Default for Status {
15221 fn default() -> Self {
15222 use std::convert::From;
15223 Self::from(0)
15224 }
15225 }
15226
15227 impl std::fmt::Display for Status {
15228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15229 wkt::internal::display_enum(f, self.name(), self.value())
15230 }
15231 }
15232
15233 impl std::convert::From<i32> for Status {
15234 fn from(value: i32) -> Self {
15235 match value {
15236 0 => Self::Unspecified,
15237 1 => Self::Provisioning,
15238 2 => Self::Running,
15239 3 => Self::Reconciling,
15240 4 => Self::Stopping,
15241 5 => Self::Error,
15242 6 => Self::Degraded,
15243 _ => Self::UnknownValue(status::UnknownValue(
15244 wkt::internal::UnknownEnumValue::Integer(value),
15245 )),
15246 }
15247 }
15248 }
15249
15250 impl std::convert::From<&str> for Status {
15251 fn from(value: &str) -> Self {
15252 use std::string::ToString;
15253 match value {
15254 "STATUS_UNSPECIFIED" => Self::Unspecified,
15255 "PROVISIONING" => Self::Provisioning,
15256 "RUNNING" => Self::Running,
15257 "RECONCILING" => Self::Reconciling,
15258 "STOPPING" => Self::Stopping,
15259 "ERROR" => Self::Error,
15260 "DEGRADED" => Self::Degraded,
15261 _ => Self::UnknownValue(status::UnknownValue(
15262 wkt::internal::UnknownEnumValue::String(value.to_string()),
15263 )),
15264 }
15265 }
15266 }
15267
15268 impl serde::ser::Serialize for Status {
15269 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15270 where
15271 S: serde::Serializer,
15272 {
15273 match self {
15274 Self::Unspecified => serializer.serialize_i32(0),
15275 Self::Provisioning => serializer.serialize_i32(1),
15276 Self::Running => serializer.serialize_i32(2),
15277 Self::Reconciling => serializer.serialize_i32(3),
15278 Self::Stopping => serializer.serialize_i32(4),
15279 Self::Error => serializer.serialize_i32(5),
15280 Self::Degraded => serializer.serialize_i32(6),
15281 Self::UnknownValue(u) => u.0.serialize(serializer),
15282 }
15283 }
15284 }
15285
15286 impl<'de> serde::de::Deserialize<'de> for Status {
15287 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15288 where
15289 D: serde::Deserializer<'de>,
15290 {
15291 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
15292 ".google.container.v1.Cluster.Status",
15293 ))
15294 }
15295 }
15296}
15297
15298/// NodeCreationConfig defines the settings of node creation mode.
15299#[derive(Clone, Default, PartialEq)]
15300#[non_exhaustive]
15301pub struct NodeCreationConfig {
15302 /// The mode of node creation.
15303 pub node_creation_mode: crate::model::node_creation_config::Mode,
15304
15305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15306}
15307
15308impl NodeCreationConfig {
15309 /// Creates a new default instance.
15310 pub fn new() -> Self {
15311 std::default::Default::default()
15312 }
15313
15314 /// Sets the value of [node_creation_mode][crate::model::NodeCreationConfig::node_creation_mode].
15315 ///
15316 /// # Example
15317 /// ```ignore,no_run
15318 /// # use google_cloud_container_v1::model::NodeCreationConfig;
15319 /// use google_cloud_container_v1::model::node_creation_config::Mode;
15320 /// let x0 = NodeCreationConfig::new().set_node_creation_mode(Mode::ViaKubelet);
15321 /// let x1 = NodeCreationConfig::new().set_node_creation_mode(Mode::ViaControlPlane);
15322 /// ```
15323 pub fn set_node_creation_mode<
15324 T: std::convert::Into<crate::model::node_creation_config::Mode>,
15325 >(
15326 mut self,
15327 v: T,
15328 ) -> Self {
15329 self.node_creation_mode = v.into();
15330 self
15331 }
15332}
15333
15334impl wkt::message::Message for NodeCreationConfig {
15335 fn typename() -> &'static str {
15336 "type.googleapis.com/google.container.v1.NodeCreationConfig"
15337 }
15338}
15339
15340/// Defines additional types related to [NodeCreationConfig].
15341pub mod node_creation_config {
15342 #[allow(unused_imports)]
15343 use super::*;
15344
15345 /// The mode of node creation.
15346 ///
15347 /// # Working with unknown values
15348 ///
15349 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15350 /// additional enum variants at any time. Adding new variants is not considered
15351 /// a breaking change. Applications should write their code in anticipation of:
15352 ///
15353 /// - New values appearing in future releases of the client library, **and**
15354 /// - New values received dynamically, without application changes.
15355 ///
15356 /// Please consult the [Working with enums] section in the user guide for some
15357 /// guidelines.
15358 ///
15359 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15360 #[derive(Clone, Debug, PartialEq)]
15361 #[non_exhaustive]
15362 pub enum Mode {
15363 /// When no user input is provided.
15364 Unspecified,
15365 /// Kubelet registers itself.
15366 ViaKubelet,
15367 /// gcp-controller-manager automatically creates the node object after
15368 /// CSR approval.
15369 ViaControlPlane,
15370 /// If set, the enum was initialized with an unknown value.
15371 ///
15372 /// Applications can examine the value using [Mode::value] or
15373 /// [Mode::name].
15374 UnknownValue(mode::UnknownValue),
15375 }
15376
15377 #[doc(hidden)]
15378 pub mod mode {
15379 #[allow(unused_imports)]
15380 use super::*;
15381 #[derive(Clone, Debug, PartialEq)]
15382 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15383 }
15384
15385 impl Mode {
15386 /// Gets the enum value.
15387 ///
15388 /// Returns `None` if the enum contains an unknown value deserialized from
15389 /// the string representation of enums.
15390 pub fn value(&self) -> std::option::Option<i32> {
15391 match self {
15392 Self::Unspecified => std::option::Option::Some(0),
15393 Self::ViaKubelet => std::option::Option::Some(1),
15394 Self::ViaControlPlane => std::option::Option::Some(2),
15395 Self::UnknownValue(u) => u.0.value(),
15396 }
15397 }
15398
15399 /// Gets the enum value as a string.
15400 ///
15401 /// Returns `None` if the enum contains an unknown value deserialized from
15402 /// the integer representation of enums.
15403 pub fn name(&self) -> std::option::Option<&str> {
15404 match self {
15405 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
15406 Self::ViaKubelet => std::option::Option::Some("VIA_KUBELET"),
15407 Self::ViaControlPlane => std::option::Option::Some("VIA_CONTROL_PLANE"),
15408 Self::UnknownValue(u) => u.0.name(),
15409 }
15410 }
15411 }
15412
15413 impl std::default::Default for Mode {
15414 fn default() -> Self {
15415 use std::convert::From;
15416 Self::from(0)
15417 }
15418 }
15419
15420 impl std::fmt::Display for Mode {
15421 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15422 wkt::internal::display_enum(f, self.name(), self.value())
15423 }
15424 }
15425
15426 impl std::convert::From<i32> for Mode {
15427 fn from(value: i32) -> Self {
15428 match value {
15429 0 => Self::Unspecified,
15430 1 => Self::ViaKubelet,
15431 2 => Self::ViaControlPlane,
15432 _ => Self::UnknownValue(mode::UnknownValue(
15433 wkt::internal::UnknownEnumValue::Integer(value),
15434 )),
15435 }
15436 }
15437 }
15438
15439 impl std::convert::From<&str> for Mode {
15440 fn from(value: &str) -> Self {
15441 use std::string::ToString;
15442 match value {
15443 "MODE_UNSPECIFIED" => Self::Unspecified,
15444 "VIA_KUBELET" => Self::ViaKubelet,
15445 "VIA_CONTROL_PLANE" => Self::ViaControlPlane,
15446 _ => Self::UnknownValue(mode::UnknownValue(
15447 wkt::internal::UnknownEnumValue::String(value.to_string()),
15448 )),
15449 }
15450 }
15451 }
15452
15453 impl serde::ser::Serialize for Mode {
15454 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15455 where
15456 S: serde::Serializer,
15457 {
15458 match self {
15459 Self::Unspecified => serializer.serialize_i32(0),
15460 Self::ViaKubelet => serializer.serialize_i32(1),
15461 Self::ViaControlPlane => serializer.serialize_i32(2),
15462 Self::UnknownValue(u) => u.0.serialize(serializer),
15463 }
15464 }
15465 }
15466
15467 impl<'de> serde::de::Deserialize<'de> for Mode {
15468 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15469 where
15470 D: serde::Deserializer<'de>,
15471 {
15472 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
15473 ".google.container.v1.NodeCreationConfig.Mode",
15474 ))
15475 }
15476 }
15477}
15478
15479/// ControlPlaneEgress defines the settings needed to enable
15480/// control plane egress control.
15481#[derive(Clone, Default, PartialEq)]
15482#[non_exhaustive]
15483pub struct ControlPlaneEgress {
15484 /// Defines the mode of control plane egress.
15485 pub mode: crate::model::control_plane_egress::Mode,
15486
15487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15488}
15489
15490impl ControlPlaneEgress {
15491 /// Creates a new default instance.
15492 pub fn new() -> Self {
15493 std::default::Default::default()
15494 }
15495
15496 /// Sets the value of [mode][crate::model::ControlPlaneEgress::mode].
15497 ///
15498 /// # Example
15499 /// ```ignore,no_run
15500 /// # use google_cloud_container_v1::model::ControlPlaneEgress;
15501 /// use google_cloud_container_v1::model::control_plane_egress::Mode;
15502 /// let x0 = ControlPlaneEgress::new().set_mode(Mode::ViaControlPlane);
15503 /// let x1 = ControlPlaneEgress::new().set_mode(Mode::None);
15504 /// ```
15505 pub fn set_mode<T: std::convert::Into<crate::model::control_plane_egress::Mode>>(
15506 mut self,
15507 v: T,
15508 ) -> Self {
15509 self.mode = v.into();
15510 self
15511 }
15512}
15513
15514impl wkt::message::Message for ControlPlaneEgress {
15515 fn typename() -> &'static str {
15516 "type.googleapis.com/google.container.v1.ControlPlaneEgress"
15517 }
15518}
15519
15520/// Defines additional types related to [ControlPlaneEgress].
15521pub mod control_plane_egress {
15522 #[allow(unused_imports)]
15523 use super::*;
15524
15525 /// Mode defines the mode of control plane egress.
15526 ///
15527 /// # Working with unknown values
15528 ///
15529 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15530 /// additional enum variants at any time. Adding new variants is not considered
15531 /// a breaking change. Applications should write their code in anticipation of:
15532 ///
15533 /// - New values appearing in future releases of the client library, **and**
15534 /// - New values received dynamically, without application changes.
15535 ///
15536 /// Please consult the [Working with enums] section in the user guide for some
15537 /// guidelines.
15538 ///
15539 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15540 #[derive(Clone, Debug, PartialEq)]
15541 #[non_exhaustive]
15542 pub enum Mode {
15543 /// Default value not specified.
15544 Unspecified,
15545 /// Control plane has public IP and no restriction on egress.
15546 ViaControlPlane,
15547 /// No public IP on control plane and only internal allowlisted egress.
15548 None,
15549 /// If set, the enum was initialized with an unknown value.
15550 ///
15551 /// Applications can examine the value using [Mode::value] or
15552 /// [Mode::name].
15553 UnknownValue(mode::UnknownValue),
15554 }
15555
15556 #[doc(hidden)]
15557 pub mod mode {
15558 #[allow(unused_imports)]
15559 use super::*;
15560 #[derive(Clone, Debug, PartialEq)]
15561 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15562 }
15563
15564 impl Mode {
15565 /// Gets the enum value.
15566 ///
15567 /// Returns `None` if the enum contains an unknown value deserialized from
15568 /// the string representation of enums.
15569 pub fn value(&self) -> std::option::Option<i32> {
15570 match self {
15571 Self::Unspecified => std::option::Option::Some(0),
15572 Self::ViaControlPlane => std::option::Option::Some(1),
15573 Self::None => std::option::Option::Some(2),
15574 Self::UnknownValue(u) => u.0.value(),
15575 }
15576 }
15577
15578 /// Gets the enum value as a string.
15579 ///
15580 /// Returns `None` if the enum contains an unknown value deserialized from
15581 /// the integer representation of enums.
15582 pub fn name(&self) -> std::option::Option<&str> {
15583 match self {
15584 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
15585 Self::ViaControlPlane => std::option::Option::Some("VIA_CONTROL_PLANE"),
15586 Self::None => std::option::Option::Some("NONE"),
15587 Self::UnknownValue(u) => u.0.name(),
15588 }
15589 }
15590 }
15591
15592 impl std::default::Default for Mode {
15593 fn default() -> Self {
15594 use std::convert::From;
15595 Self::from(0)
15596 }
15597 }
15598
15599 impl std::fmt::Display for Mode {
15600 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15601 wkt::internal::display_enum(f, self.name(), self.value())
15602 }
15603 }
15604
15605 impl std::convert::From<i32> for Mode {
15606 fn from(value: i32) -> Self {
15607 match value {
15608 0 => Self::Unspecified,
15609 1 => Self::ViaControlPlane,
15610 2 => Self::None,
15611 _ => Self::UnknownValue(mode::UnknownValue(
15612 wkt::internal::UnknownEnumValue::Integer(value),
15613 )),
15614 }
15615 }
15616 }
15617
15618 impl std::convert::From<&str> for Mode {
15619 fn from(value: &str) -> Self {
15620 use std::string::ToString;
15621 match value {
15622 "MODE_UNSPECIFIED" => Self::Unspecified,
15623 "VIA_CONTROL_PLANE" => Self::ViaControlPlane,
15624 "NONE" => Self::None,
15625 _ => Self::UnknownValue(mode::UnknownValue(
15626 wkt::internal::UnknownEnumValue::String(value.to_string()),
15627 )),
15628 }
15629 }
15630 }
15631
15632 impl serde::ser::Serialize for Mode {
15633 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15634 where
15635 S: serde::Serializer,
15636 {
15637 match self {
15638 Self::Unspecified => serializer.serialize_i32(0),
15639 Self::ViaControlPlane => serializer.serialize_i32(1),
15640 Self::None => serializer.serialize_i32(2),
15641 Self::UnknownValue(u) => u.0.serialize(serializer),
15642 }
15643 }
15644 }
15645
15646 impl<'de> serde::de::Deserialize<'de> for Mode {
15647 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15648 where
15649 D: serde::Deserializer<'de>,
15650 {
15651 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
15652 ".google.container.v1.ControlPlaneEgress.Mode",
15653 ))
15654 }
15655 }
15656}
15657
15658/// RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings
15659/// that can be created.
15660#[derive(Clone, Default, PartialEq)]
15661#[non_exhaustive]
15662pub struct RBACBindingConfig {
15663 /// Setting this to true will allow any ClusterRoleBinding and RoleBinding
15664 /// with subjets system:anonymous or system:unauthenticated.
15665 pub enable_insecure_binding_system_unauthenticated: std::option::Option<bool>,
15666
15667 /// Setting this to true will allow any ClusterRoleBinding and RoleBinding
15668 /// with subjects system:authenticated.
15669 pub enable_insecure_binding_system_authenticated: std::option::Option<bool>,
15670
15671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15672}
15673
15674impl RBACBindingConfig {
15675 /// Creates a new default instance.
15676 pub fn new() -> Self {
15677 std::default::Default::default()
15678 }
15679
15680 /// Sets the value of [enable_insecure_binding_system_unauthenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_unauthenticated].
15681 ///
15682 /// # Example
15683 /// ```ignore,no_run
15684 /// # use google_cloud_container_v1::model::RBACBindingConfig;
15685 /// let x = RBACBindingConfig::new().set_enable_insecure_binding_system_unauthenticated(true);
15686 /// ```
15687 pub fn set_enable_insecure_binding_system_unauthenticated<T>(mut self, v: T) -> Self
15688 where
15689 T: std::convert::Into<bool>,
15690 {
15691 self.enable_insecure_binding_system_unauthenticated = std::option::Option::Some(v.into());
15692 self
15693 }
15694
15695 /// Sets or clears the value of [enable_insecure_binding_system_unauthenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_unauthenticated].
15696 ///
15697 /// # Example
15698 /// ```ignore,no_run
15699 /// # use google_cloud_container_v1::model::RBACBindingConfig;
15700 /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_unauthenticated(Some(false));
15701 /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_unauthenticated(None::<bool>);
15702 /// ```
15703 pub fn set_or_clear_enable_insecure_binding_system_unauthenticated<T>(
15704 mut self,
15705 v: std::option::Option<T>,
15706 ) -> Self
15707 where
15708 T: std::convert::Into<bool>,
15709 {
15710 self.enable_insecure_binding_system_unauthenticated = v.map(|x| x.into());
15711 self
15712 }
15713
15714 /// Sets the value of [enable_insecure_binding_system_authenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_authenticated].
15715 ///
15716 /// # Example
15717 /// ```ignore,no_run
15718 /// # use google_cloud_container_v1::model::RBACBindingConfig;
15719 /// let x = RBACBindingConfig::new().set_enable_insecure_binding_system_authenticated(true);
15720 /// ```
15721 pub fn set_enable_insecure_binding_system_authenticated<T>(mut self, v: T) -> Self
15722 where
15723 T: std::convert::Into<bool>,
15724 {
15725 self.enable_insecure_binding_system_authenticated = std::option::Option::Some(v.into());
15726 self
15727 }
15728
15729 /// Sets or clears the value of [enable_insecure_binding_system_authenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_authenticated].
15730 ///
15731 /// # Example
15732 /// ```ignore,no_run
15733 /// # use google_cloud_container_v1::model::RBACBindingConfig;
15734 /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_authenticated(Some(false));
15735 /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_authenticated(None::<bool>);
15736 /// ```
15737 pub fn set_or_clear_enable_insecure_binding_system_authenticated<T>(
15738 mut self,
15739 v: std::option::Option<T>,
15740 ) -> Self
15741 where
15742 T: std::convert::Into<bool>,
15743 {
15744 self.enable_insecure_binding_system_authenticated = v.map(|x| x.into());
15745 self
15746 }
15747}
15748
15749impl wkt::message::Message for RBACBindingConfig {
15750 fn typename() -> &'static str {
15751 "type.googleapis.com/google.container.v1.RBACBindingConfig"
15752 }
15753}
15754
15755/// UserManagedKeysConfig holds the resource address to Keys which are used
15756/// for signing certs and token that are used for communication within cluster.
15757#[derive(Clone, Default, PartialEq)]
15758#[non_exhaustive]
15759pub struct UserManagedKeysConfig {
15760 /// The Certificate Authority Service caPool to use for the cluster CA in this
15761 /// cluster.
15762 pub cluster_ca: std::string::String,
15763
15764 /// Resource path of the Certificate Authority Service caPool to use for the
15765 /// etcd API CA in this cluster.
15766 pub etcd_api_ca: std::string::String,
15767
15768 /// Resource path of the Certificate Authority Service caPool to use for the
15769 /// etcd peer CA in this cluster.
15770 pub etcd_peer_ca: std::string::String,
15771
15772 /// The Cloud KMS cryptoKeyVersions to use for signing service account JWTs
15773 /// issued by this cluster.
15774 ///
15775 /// Format:
15776 /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}`
15777 pub service_account_signing_keys: std::vec::Vec<std::string::String>,
15778
15779 /// The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs
15780 /// issued by this cluster.
15781 ///
15782 /// Format:
15783 /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}`
15784 pub service_account_verification_keys: std::vec::Vec<std::string::String>,
15785
15786 /// The Certificate Authority Service caPool to use for the aggregation CA in
15787 /// this cluster.
15788 pub aggregation_ca: std::string::String,
15789
15790 /// The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control
15791 /// plane nodes.
15792 pub control_plane_disk_encryption_key: std::string::String,
15793
15794 /// Output only. All of the versions of the Cloud KMS cryptoKey that are used
15795 /// by Confidential Hyperdisks on the control plane nodes.
15796 pub control_plane_disk_encryption_key_versions: std::vec::Vec<std::string::String>,
15797
15798 /// Resource path of the Cloud KMS cryptoKey to use for encryption of internal
15799 /// etcd backups.
15800 pub gkeops_etcd_backup_encryption_key: std::string::String,
15801
15802 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15803}
15804
15805impl UserManagedKeysConfig {
15806 /// Creates a new default instance.
15807 pub fn new() -> Self {
15808 std::default::Default::default()
15809 }
15810
15811 /// Sets the value of [cluster_ca][crate::model::UserManagedKeysConfig::cluster_ca].
15812 ///
15813 /// # Example
15814 /// ```ignore,no_run
15815 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15816 /// let x = UserManagedKeysConfig::new().set_cluster_ca("example");
15817 /// ```
15818 pub fn set_cluster_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15819 self.cluster_ca = v.into();
15820 self
15821 }
15822
15823 /// Sets the value of [etcd_api_ca][crate::model::UserManagedKeysConfig::etcd_api_ca].
15824 ///
15825 /// # Example
15826 /// ```ignore,no_run
15827 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15828 /// let x = UserManagedKeysConfig::new().set_etcd_api_ca("example");
15829 /// ```
15830 pub fn set_etcd_api_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15831 self.etcd_api_ca = v.into();
15832 self
15833 }
15834
15835 /// Sets the value of [etcd_peer_ca][crate::model::UserManagedKeysConfig::etcd_peer_ca].
15836 ///
15837 /// # Example
15838 /// ```ignore,no_run
15839 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15840 /// let x = UserManagedKeysConfig::new().set_etcd_peer_ca("example");
15841 /// ```
15842 pub fn set_etcd_peer_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15843 self.etcd_peer_ca = v.into();
15844 self
15845 }
15846
15847 /// Sets the value of [service_account_signing_keys][crate::model::UserManagedKeysConfig::service_account_signing_keys].
15848 ///
15849 /// # Example
15850 /// ```ignore,no_run
15851 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15852 /// let x = UserManagedKeysConfig::new().set_service_account_signing_keys(["a", "b", "c"]);
15853 /// ```
15854 pub fn set_service_account_signing_keys<T, V>(mut self, v: T) -> Self
15855 where
15856 T: std::iter::IntoIterator<Item = V>,
15857 V: std::convert::Into<std::string::String>,
15858 {
15859 use std::iter::Iterator;
15860 self.service_account_signing_keys = v.into_iter().map(|i| i.into()).collect();
15861 self
15862 }
15863
15864 /// Sets the value of [service_account_verification_keys][crate::model::UserManagedKeysConfig::service_account_verification_keys].
15865 ///
15866 /// # Example
15867 /// ```ignore,no_run
15868 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15869 /// let x = UserManagedKeysConfig::new().set_service_account_verification_keys(["a", "b", "c"]);
15870 /// ```
15871 pub fn set_service_account_verification_keys<T, V>(mut self, v: T) -> Self
15872 where
15873 T: std::iter::IntoIterator<Item = V>,
15874 V: std::convert::Into<std::string::String>,
15875 {
15876 use std::iter::Iterator;
15877 self.service_account_verification_keys = v.into_iter().map(|i| i.into()).collect();
15878 self
15879 }
15880
15881 /// Sets the value of [aggregation_ca][crate::model::UserManagedKeysConfig::aggregation_ca].
15882 ///
15883 /// # Example
15884 /// ```ignore,no_run
15885 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15886 /// let x = UserManagedKeysConfig::new().set_aggregation_ca("example");
15887 /// ```
15888 pub fn set_aggregation_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15889 self.aggregation_ca = v.into();
15890 self
15891 }
15892
15893 /// Sets the value of [control_plane_disk_encryption_key][crate::model::UserManagedKeysConfig::control_plane_disk_encryption_key].
15894 ///
15895 /// # Example
15896 /// ```ignore,no_run
15897 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15898 /// let x = UserManagedKeysConfig::new().set_control_plane_disk_encryption_key("example");
15899 /// ```
15900 pub fn set_control_plane_disk_encryption_key<T: std::convert::Into<std::string::String>>(
15901 mut self,
15902 v: T,
15903 ) -> Self {
15904 self.control_plane_disk_encryption_key = v.into();
15905 self
15906 }
15907
15908 /// Sets the value of [control_plane_disk_encryption_key_versions][crate::model::UserManagedKeysConfig::control_plane_disk_encryption_key_versions].
15909 ///
15910 /// # Example
15911 /// ```ignore,no_run
15912 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15913 /// let x = UserManagedKeysConfig::new().set_control_plane_disk_encryption_key_versions(["a", "b", "c"]);
15914 /// ```
15915 pub fn set_control_plane_disk_encryption_key_versions<T, V>(mut self, v: T) -> Self
15916 where
15917 T: std::iter::IntoIterator<Item = V>,
15918 V: std::convert::Into<std::string::String>,
15919 {
15920 use std::iter::Iterator;
15921 self.control_plane_disk_encryption_key_versions = v.into_iter().map(|i| i.into()).collect();
15922 self
15923 }
15924
15925 /// Sets the value of [gkeops_etcd_backup_encryption_key][crate::model::UserManagedKeysConfig::gkeops_etcd_backup_encryption_key].
15926 ///
15927 /// # Example
15928 /// ```ignore,no_run
15929 /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
15930 /// let x = UserManagedKeysConfig::new().set_gkeops_etcd_backup_encryption_key("example");
15931 /// ```
15932 pub fn set_gkeops_etcd_backup_encryption_key<T: std::convert::Into<std::string::String>>(
15933 mut self,
15934 v: T,
15935 ) -> Self {
15936 self.gkeops_etcd_backup_encryption_key = v.into();
15937 self
15938 }
15939}
15940
15941impl wkt::message::Message for UserManagedKeysConfig {
15942 fn typename() -> &'static str {
15943 "type.googleapis.com/google.container.v1.UserManagedKeysConfig"
15944 }
15945}
15946
15947/// AnonymousAuthenticationConfig defines the settings needed to limit endpoints
15948/// that allow anonymous authentication.
15949#[derive(Clone, Default, PartialEq)]
15950#[non_exhaustive]
15951pub struct AnonymousAuthenticationConfig {
15952 /// Defines the mode of limiting anonymous access in the cluster.
15953 pub mode: crate::model::anonymous_authentication_config::Mode,
15954
15955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15956}
15957
15958impl AnonymousAuthenticationConfig {
15959 /// Creates a new default instance.
15960 pub fn new() -> Self {
15961 std::default::Default::default()
15962 }
15963
15964 /// Sets the value of [mode][crate::model::AnonymousAuthenticationConfig::mode].
15965 ///
15966 /// # Example
15967 /// ```ignore,no_run
15968 /// # use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
15969 /// use google_cloud_container_v1::model::anonymous_authentication_config::Mode;
15970 /// let x0 = AnonymousAuthenticationConfig::new().set_mode(Mode::Enabled);
15971 /// let x1 = AnonymousAuthenticationConfig::new().set_mode(Mode::Limited);
15972 /// ```
15973 pub fn set_mode<T: std::convert::Into<crate::model::anonymous_authentication_config::Mode>>(
15974 mut self,
15975 v: T,
15976 ) -> Self {
15977 self.mode = v.into();
15978 self
15979 }
15980}
15981
15982impl wkt::message::Message for AnonymousAuthenticationConfig {
15983 fn typename() -> &'static str {
15984 "type.googleapis.com/google.container.v1.AnonymousAuthenticationConfig"
15985 }
15986}
15987
15988/// Defines additional types related to [AnonymousAuthenticationConfig].
15989pub mod anonymous_authentication_config {
15990 #[allow(unused_imports)]
15991 use super::*;
15992
15993 /// Mode defines the mode of anonymous authentication
15994 /// allowed in the cluster.
15995 ///
15996 /// # Working with unknown values
15997 ///
15998 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15999 /// additional enum variants at any time. Adding new variants is not considered
16000 /// a breaking change. Applications should write their code in anticipation of:
16001 ///
16002 /// - New values appearing in future releases of the client library, **and**
16003 /// - New values received dynamically, without application changes.
16004 ///
16005 /// Please consult the [Working with enums] section in the user guide for some
16006 /// guidelines.
16007 ///
16008 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16009 #[derive(Clone, Debug, PartialEq)]
16010 #[non_exhaustive]
16011 pub enum Mode {
16012 /// Default value not specified.
16013 Unspecified,
16014 /// Anonymous authentication is allowed for all endpoints.
16015 Enabled,
16016 /// Anonymous authentication is allowed for only health check endpoints.
16017 Limited,
16018 /// If set, the enum was initialized with an unknown value.
16019 ///
16020 /// Applications can examine the value using [Mode::value] or
16021 /// [Mode::name].
16022 UnknownValue(mode::UnknownValue),
16023 }
16024
16025 #[doc(hidden)]
16026 pub mod mode {
16027 #[allow(unused_imports)]
16028 use super::*;
16029 #[derive(Clone, Debug, PartialEq)]
16030 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16031 }
16032
16033 impl Mode {
16034 /// Gets the enum value.
16035 ///
16036 /// Returns `None` if the enum contains an unknown value deserialized from
16037 /// the string representation of enums.
16038 pub fn value(&self) -> std::option::Option<i32> {
16039 match self {
16040 Self::Unspecified => std::option::Option::Some(0),
16041 Self::Enabled => std::option::Option::Some(1),
16042 Self::Limited => std::option::Option::Some(2),
16043 Self::UnknownValue(u) => u.0.value(),
16044 }
16045 }
16046
16047 /// Gets the enum value as a string.
16048 ///
16049 /// Returns `None` if the enum contains an unknown value deserialized from
16050 /// the integer representation of enums.
16051 pub fn name(&self) -> std::option::Option<&str> {
16052 match self {
16053 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
16054 Self::Enabled => std::option::Option::Some("ENABLED"),
16055 Self::Limited => std::option::Option::Some("LIMITED"),
16056 Self::UnknownValue(u) => u.0.name(),
16057 }
16058 }
16059 }
16060
16061 impl std::default::Default for Mode {
16062 fn default() -> Self {
16063 use std::convert::From;
16064 Self::from(0)
16065 }
16066 }
16067
16068 impl std::fmt::Display for Mode {
16069 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16070 wkt::internal::display_enum(f, self.name(), self.value())
16071 }
16072 }
16073
16074 impl std::convert::From<i32> for Mode {
16075 fn from(value: i32) -> Self {
16076 match value {
16077 0 => Self::Unspecified,
16078 1 => Self::Enabled,
16079 2 => Self::Limited,
16080 _ => Self::UnknownValue(mode::UnknownValue(
16081 wkt::internal::UnknownEnumValue::Integer(value),
16082 )),
16083 }
16084 }
16085 }
16086
16087 impl std::convert::From<&str> for Mode {
16088 fn from(value: &str) -> Self {
16089 use std::string::ToString;
16090 match value {
16091 "MODE_UNSPECIFIED" => Self::Unspecified,
16092 "ENABLED" => Self::Enabled,
16093 "LIMITED" => Self::Limited,
16094 _ => Self::UnknownValue(mode::UnknownValue(
16095 wkt::internal::UnknownEnumValue::String(value.to_string()),
16096 )),
16097 }
16098 }
16099 }
16100
16101 impl serde::ser::Serialize for Mode {
16102 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16103 where
16104 S: serde::Serializer,
16105 {
16106 match self {
16107 Self::Unspecified => serializer.serialize_i32(0),
16108 Self::Enabled => serializer.serialize_i32(1),
16109 Self::Limited => serializer.serialize_i32(2),
16110 Self::UnknownValue(u) => u.0.serialize(serializer),
16111 }
16112 }
16113 }
16114
16115 impl<'de> serde::de::Deserialize<'de> for Mode {
16116 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16117 where
16118 D: serde::Deserializer<'de>,
16119 {
16120 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
16121 ".google.container.v1.AnonymousAuthenticationConfig.Mode",
16122 ))
16123 }
16124 }
16125}
16126
16127/// Deprecated: Compliance Posture is no longer supported.
16128/// For more details, see
16129/// <https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation>.
16130///
16131/// CompliancePostureConfig defines the settings needed to enable/disable
16132/// features for the Compliance Posture.
16133#[derive(Clone, Default, PartialEq)]
16134#[non_exhaustive]
16135#[deprecated]
16136pub struct CompliancePostureConfig {
16137 /// Defines the enablement mode for Compliance Posture.
16138 pub mode: std::option::Option<crate::model::compliance_posture_config::Mode>,
16139
16140 /// List of enabled compliance standards.
16141 pub compliance_standards:
16142 std::vec::Vec<crate::model::compliance_posture_config::ComplianceStandard>,
16143
16144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16145}
16146
16147impl CompliancePostureConfig {
16148 /// Creates a new default instance.
16149 pub fn new() -> Self {
16150 std::default::Default::default()
16151 }
16152
16153 /// Sets the value of [mode][crate::model::CompliancePostureConfig::mode].
16154 ///
16155 /// # Example
16156 /// ```ignore,no_run
16157 /// # use google_cloud_container_v1::model::CompliancePostureConfig;
16158 /// use google_cloud_container_v1::model::compliance_posture_config::Mode;
16159 /// let x0 = CompliancePostureConfig::new().set_mode(Mode::Disabled);
16160 /// let x1 = CompliancePostureConfig::new().set_mode(Mode::Enabled);
16161 /// ```
16162 pub fn set_mode<T>(mut self, v: T) -> Self
16163 where
16164 T: std::convert::Into<crate::model::compliance_posture_config::Mode>,
16165 {
16166 self.mode = std::option::Option::Some(v.into());
16167 self
16168 }
16169
16170 /// Sets or clears the value of [mode][crate::model::CompliancePostureConfig::mode].
16171 ///
16172 /// # Example
16173 /// ```ignore,no_run
16174 /// # use google_cloud_container_v1::model::CompliancePostureConfig;
16175 /// use google_cloud_container_v1::model::compliance_posture_config::Mode;
16176 /// let x0 = CompliancePostureConfig::new().set_or_clear_mode(Some(Mode::Disabled));
16177 /// let x1 = CompliancePostureConfig::new().set_or_clear_mode(Some(Mode::Enabled));
16178 /// let x_none = CompliancePostureConfig::new().set_or_clear_mode(None::<Mode>);
16179 /// ```
16180 pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
16181 where
16182 T: std::convert::Into<crate::model::compliance_posture_config::Mode>,
16183 {
16184 self.mode = v.map(|x| x.into());
16185 self
16186 }
16187
16188 /// Sets the value of [compliance_standards][crate::model::CompliancePostureConfig::compliance_standards].
16189 ///
16190 /// # Example
16191 /// ```ignore,no_run
16192 /// # use google_cloud_container_v1::model::CompliancePostureConfig;
16193 /// use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
16194 /// let x = CompliancePostureConfig::new()
16195 /// .set_compliance_standards([
16196 /// ComplianceStandard::default()/* use setters */,
16197 /// ComplianceStandard::default()/* use (different) setters */,
16198 /// ]);
16199 /// ```
16200 pub fn set_compliance_standards<T, V>(mut self, v: T) -> Self
16201 where
16202 T: std::iter::IntoIterator<Item = V>,
16203 V: std::convert::Into<crate::model::compliance_posture_config::ComplianceStandard>,
16204 {
16205 use std::iter::Iterator;
16206 self.compliance_standards = v.into_iter().map(|i| i.into()).collect();
16207 self
16208 }
16209}
16210
16211impl wkt::message::Message for CompliancePostureConfig {
16212 fn typename() -> &'static str {
16213 "type.googleapis.com/google.container.v1.CompliancePostureConfig"
16214 }
16215}
16216
16217/// Defines additional types related to [CompliancePostureConfig].
16218pub mod compliance_posture_config {
16219 #[allow(unused_imports)]
16220 use super::*;
16221
16222 /// Defines the details of a compliance standard.
16223 #[derive(Clone, Default, PartialEq)]
16224 #[non_exhaustive]
16225 pub struct ComplianceStandard {
16226 /// Name of the compliance standard.
16227 pub standard: std::option::Option<std::string::String>,
16228
16229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16230 }
16231
16232 impl ComplianceStandard {
16233 /// Creates a new default instance.
16234 pub fn new() -> Self {
16235 std::default::Default::default()
16236 }
16237
16238 /// Sets the value of [standard][crate::model::compliance_posture_config::ComplianceStandard::standard].
16239 ///
16240 /// # Example
16241 /// ```ignore,no_run
16242 /// # use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
16243 /// let x = ComplianceStandard::new().set_standard("example");
16244 /// ```
16245 pub fn set_standard<T>(mut self, v: T) -> Self
16246 where
16247 T: std::convert::Into<std::string::String>,
16248 {
16249 self.standard = std::option::Option::Some(v.into());
16250 self
16251 }
16252
16253 /// Sets or clears the value of [standard][crate::model::compliance_posture_config::ComplianceStandard::standard].
16254 ///
16255 /// # Example
16256 /// ```ignore,no_run
16257 /// # use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
16258 /// let x = ComplianceStandard::new().set_or_clear_standard(Some("example"));
16259 /// let x = ComplianceStandard::new().set_or_clear_standard(None::<String>);
16260 /// ```
16261 pub fn set_or_clear_standard<T>(mut self, v: std::option::Option<T>) -> Self
16262 where
16263 T: std::convert::Into<std::string::String>,
16264 {
16265 self.standard = v.map(|x| x.into());
16266 self
16267 }
16268 }
16269
16270 impl wkt::message::Message for ComplianceStandard {
16271 fn typename() -> &'static str {
16272 "type.googleapis.com/google.container.v1.CompliancePostureConfig.ComplianceStandard"
16273 }
16274 }
16275
16276 /// Mode defines enablement mode for Compliance Posture.
16277 ///
16278 /// # Working with unknown values
16279 ///
16280 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16281 /// additional enum variants at any time. Adding new variants is not considered
16282 /// a breaking change. Applications should write their code in anticipation of:
16283 ///
16284 /// - New values appearing in future releases of the client library, **and**
16285 /// - New values received dynamically, without application changes.
16286 ///
16287 /// Please consult the [Working with enums] section in the user guide for some
16288 /// guidelines.
16289 ///
16290 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16291 #[derive(Clone, Debug, PartialEq)]
16292 #[non_exhaustive]
16293 pub enum Mode {
16294 /// Default value not specified.
16295 Unspecified,
16296 /// Disables Compliance Posture features on the cluster.
16297 Disabled,
16298 /// Enables Compliance Posture features on the cluster.
16299 Enabled,
16300 /// If set, the enum was initialized with an unknown value.
16301 ///
16302 /// Applications can examine the value using [Mode::value] or
16303 /// [Mode::name].
16304 UnknownValue(mode::UnknownValue),
16305 }
16306
16307 #[doc(hidden)]
16308 pub mod mode {
16309 #[allow(unused_imports)]
16310 use super::*;
16311 #[derive(Clone, Debug, PartialEq)]
16312 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16313 }
16314
16315 impl Mode {
16316 /// Gets the enum value.
16317 ///
16318 /// Returns `None` if the enum contains an unknown value deserialized from
16319 /// the string representation of enums.
16320 pub fn value(&self) -> std::option::Option<i32> {
16321 match self {
16322 Self::Unspecified => std::option::Option::Some(0),
16323 Self::Disabled => std::option::Option::Some(1),
16324 Self::Enabled => std::option::Option::Some(2),
16325 Self::UnknownValue(u) => u.0.value(),
16326 }
16327 }
16328
16329 /// Gets the enum value as a string.
16330 ///
16331 /// Returns `None` if the enum contains an unknown value deserialized from
16332 /// the integer representation of enums.
16333 pub fn name(&self) -> std::option::Option<&str> {
16334 match self {
16335 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
16336 Self::Disabled => std::option::Option::Some("DISABLED"),
16337 Self::Enabled => std::option::Option::Some("ENABLED"),
16338 Self::UnknownValue(u) => u.0.name(),
16339 }
16340 }
16341 }
16342
16343 impl std::default::Default for Mode {
16344 fn default() -> Self {
16345 use std::convert::From;
16346 Self::from(0)
16347 }
16348 }
16349
16350 impl std::fmt::Display for Mode {
16351 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16352 wkt::internal::display_enum(f, self.name(), self.value())
16353 }
16354 }
16355
16356 impl std::convert::From<i32> for Mode {
16357 fn from(value: i32) -> Self {
16358 match value {
16359 0 => Self::Unspecified,
16360 1 => Self::Disabled,
16361 2 => Self::Enabled,
16362 _ => Self::UnknownValue(mode::UnknownValue(
16363 wkt::internal::UnknownEnumValue::Integer(value),
16364 )),
16365 }
16366 }
16367 }
16368
16369 impl std::convert::From<&str> for Mode {
16370 fn from(value: &str) -> Self {
16371 use std::string::ToString;
16372 match value {
16373 "MODE_UNSPECIFIED" => Self::Unspecified,
16374 "DISABLED" => Self::Disabled,
16375 "ENABLED" => Self::Enabled,
16376 _ => Self::UnknownValue(mode::UnknownValue(
16377 wkt::internal::UnknownEnumValue::String(value.to_string()),
16378 )),
16379 }
16380 }
16381 }
16382
16383 impl serde::ser::Serialize for Mode {
16384 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16385 where
16386 S: serde::Serializer,
16387 {
16388 match self {
16389 Self::Unspecified => serializer.serialize_i32(0),
16390 Self::Disabled => serializer.serialize_i32(1),
16391 Self::Enabled => serializer.serialize_i32(2),
16392 Self::UnknownValue(u) => u.0.serialize(serializer),
16393 }
16394 }
16395 }
16396
16397 impl<'de> serde::de::Deserialize<'de> for Mode {
16398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16399 where
16400 D: serde::Deserializer<'de>,
16401 {
16402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
16403 ".google.container.v1.CompliancePostureConfig.Mode",
16404 ))
16405 }
16406 }
16407}
16408
16409/// K8sBetaAPIConfig , configuration for beta APIs
16410#[derive(Clone, Default, PartialEq)]
16411#[non_exhaustive]
16412pub struct K8sBetaAPIConfig {
16413 /// Enabled k8s beta APIs.
16414 pub enabled_apis: std::vec::Vec<std::string::String>,
16415
16416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16417}
16418
16419impl K8sBetaAPIConfig {
16420 /// Creates a new default instance.
16421 pub fn new() -> Self {
16422 std::default::Default::default()
16423 }
16424
16425 /// Sets the value of [enabled_apis][crate::model::K8sBetaAPIConfig::enabled_apis].
16426 ///
16427 /// # Example
16428 /// ```ignore,no_run
16429 /// # use google_cloud_container_v1::model::K8sBetaAPIConfig;
16430 /// let x = K8sBetaAPIConfig::new().set_enabled_apis(["a", "b", "c"]);
16431 /// ```
16432 pub fn set_enabled_apis<T, V>(mut self, v: T) -> Self
16433 where
16434 T: std::iter::IntoIterator<Item = V>,
16435 V: std::convert::Into<std::string::String>,
16436 {
16437 use std::iter::Iterator;
16438 self.enabled_apis = v.into_iter().map(|i| i.into()).collect();
16439 self
16440 }
16441}
16442
16443impl wkt::message::Message for K8sBetaAPIConfig {
16444 fn typename() -> &'static str {
16445 "type.googleapis.com/google.container.v1.K8sBetaAPIConfig"
16446 }
16447}
16448
16449/// SecurityPostureConfig defines the flags needed to enable/disable features for
16450/// the Security Posture API.
16451#[derive(Clone, Default, PartialEq)]
16452#[non_exhaustive]
16453pub struct SecurityPostureConfig {
16454 /// Sets which mode to use for Security Posture features.
16455 pub mode: std::option::Option<crate::model::security_posture_config::Mode>,
16456
16457 /// Sets which mode to use for vulnerability scanning.
16458 pub vulnerability_mode:
16459 std::option::Option<crate::model::security_posture_config::VulnerabilityMode>,
16460
16461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16462}
16463
16464impl SecurityPostureConfig {
16465 /// Creates a new default instance.
16466 pub fn new() -> Self {
16467 std::default::Default::default()
16468 }
16469
16470 /// Sets the value of [mode][crate::model::SecurityPostureConfig::mode].
16471 ///
16472 /// # Example
16473 /// ```ignore,no_run
16474 /// # use google_cloud_container_v1::model::SecurityPostureConfig;
16475 /// use google_cloud_container_v1::model::security_posture_config::Mode;
16476 /// let x0 = SecurityPostureConfig::new().set_mode(Mode::Disabled);
16477 /// let x1 = SecurityPostureConfig::new().set_mode(Mode::Basic);
16478 /// ```
16479 pub fn set_mode<T>(mut self, v: T) -> Self
16480 where
16481 T: std::convert::Into<crate::model::security_posture_config::Mode>,
16482 {
16483 self.mode = std::option::Option::Some(v.into());
16484 self
16485 }
16486
16487 /// Sets or clears the value of [mode][crate::model::SecurityPostureConfig::mode].
16488 ///
16489 /// # Example
16490 /// ```ignore,no_run
16491 /// # use google_cloud_container_v1::model::SecurityPostureConfig;
16492 /// use google_cloud_container_v1::model::security_posture_config::Mode;
16493 /// let x0 = SecurityPostureConfig::new().set_or_clear_mode(Some(Mode::Disabled));
16494 /// let x1 = SecurityPostureConfig::new().set_or_clear_mode(Some(Mode::Basic));
16495 /// let x_none = SecurityPostureConfig::new().set_or_clear_mode(None::<Mode>);
16496 /// ```
16497 pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
16498 where
16499 T: std::convert::Into<crate::model::security_posture_config::Mode>,
16500 {
16501 self.mode = v.map(|x| x.into());
16502 self
16503 }
16504
16505 /// Sets the value of [vulnerability_mode][crate::model::SecurityPostureConfig::vulnerability_mode].
16506 ///
16507 /// # Example
16508 /// ```ignore,no_run
16509 /// # use google_cloud_container_v1::model::SecurityPostureConfig;
16510 /// use google_cloud_container_v1::model::security_posture_config::VulnerabilityMode;
16511 /// let x0 = SecurityPostureConfig::new().set_vulnerability_mode(VulnerabilityMode::VulnerabilityDisabled);
16512 /// let x1 = SecurityPostureConfig::new().set_vulnerability_mode(VulnerabilityMode::VulnerabilityEnterprise);
16513 /// ```
16514 pub fn set_vulnerability_mode<T>(mut self, v: T) -> Self
16515 where
16516 T: std::convert::Into<crate::model::security_posture_config::VulnerabilityMode>,
16517 {
16518 self.vulnerability_mode = std::option::Option::Some(v.into());
16519 self
16520 }
16521
16522 /// Sets or clears the value of [vulnerability_mode][crate::model::SecurityPostureConfig::vulnerability_mode].
16523 ///
16524 /// # Example
16525 /// ```ignore,no_run
16526 /// # use google_cloud_container_v1::model::SecurityPostureConfig;
16527 /// use google_cloud_container_v1::model::security_posture_config::VulnerabilityMode;
16528 /// let x0 = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(Some(VulnerabilityMode::VulnerabilityDisabled));
16529 /// let x1 = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(Some(VulnerabilityMode::VulnerabilityEnterprise));
16530 /// let x_none = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(None::<VulnerabilityMode>);
16531 /// ```
16532 pub fn set_or_clear_vulnerability_mode<T>(mut self, v: std::option::Option<T>) -> Self
16533 where
16534 T: std::convert::Into<crate::model::security_posture_config::VulnerabilityMode>,
16535 {
16536 self.vulnerability_mode = v.map(|x| x.into());
16537 self
16538 }
16539}
16540
16541impl wkt::message::Message for SecurityPostureConfig {
16542 fn typename() -> &'static str {
16543 "type.googleapis.com/google.container.v1.SecurityPostureConfig"
16544 }
16545}
16546
16547/// Defines additional types related to [SecurityPostureConfig].
16548pub mod security_posture_config {
16549 #[allow(unused_imports)]
16550 use super::*;
16551
16552 /// Mode defines enablement mode for GKE Security posture features.
16553 ///
16554 /// # Working with unknown values
16555 ///
16556 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16557 /// additional enum variants at any time. Adding new variants is not considered
16558 /// a breaking change. Applications should write their code in anticipation of:
16559 ///
16560 /// - New values appearing in future releases of the client library, **and**
16561 /// - New values received dynamically, without application changes.
16562 ///
16563 /// Please consult the [Working with enums] section in the user guide for some
16564 /// guidelines.
16565 ///
16566 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16567 #[derive(Clone, Debug, PartialEq)]
16568 #[non_exhaustive]
16569 pub enum Mode {
16570 /// Default value not specified.
16571 Unspecified,
16572 /// Disables Security Posture features on the cluster.
16573 Disabled,
16574 /// Applies Security Posture features on the cluster.
16575 Basic,
16576 /// Deprecated: Security Posture Enterprise features are no longer supported.
16577 /// For more details, see
16578 /// <https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation>.
16579 ///
16580 /// Applies the Security Posture off cluster Enterprise level features.
16581 #[deprecated]
16582 Enterprise,
16583 /// If set, the enum was initialized with an unknown value.
16584 ///
16585 /// Applications can examine the value using [Mode::value] or
16586 /// [Mode::name].
16587 UnknownValue(mode::UnknownValue),
16588 }
16589
16590 #[doc(hidden)]
16591 pub mod mode {
16592 #[allow(unused_imports)]
16593 use super::*;
16594 #[derive(Clone, Debug, PartialEq)]
16595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16596 }
16597
16598 impl Mode {
16599 /// Gets the enum value.
16600 ///
16601 /// Returns `None` if the enum contains an unknown value deserialized from
16602 /// the string representation of enums.
16603 pub fn value(&self) -> std::option::Option<i32> {
16604 match self {
16605 Self::Unspecified => std::option::Option::Some(0),
16606 Self::Disabled => std::option::Option::Some(1),
16607 Self::Basic => std::option::Option::Some(2),
16608 Self::Enterprise => std::option::Option::Some(3),
16609 Self::UnknownValue(u) => u.0.value(),
16610 }
16611 }
16612
16613 /// Gets the enum value as a string.
16614 ///
16615 /// Returns `None` if the enum contains an unknown value deserialized from
16616 /// the integer representation of enums.
16617 pub fn name(&self) -> std::option::Option<&str> {
16618 match self {
16619 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
16620 Self::Disabled => std::option::Option::Some("DISABLED"),
16621 Self::Basic => std::option::Option::Some("BASIC"),
16622 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
16623 Self::UnknownValue(u) => u.0.name(),
16624 }
16625 }
16626 }
16627
16628 impl std::default::Default for Mode {
16629 fn default() -> Self {
16630 use std::convert::From;
16631 Self::from(0)
16632 }
16633 }
16634
16635 impl std::fmt::Display for Mode {
16636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16637 wkt::internal::display_enum(f, self.name(), self.value())
16638 }
16639 }
16640
16641 impl std::convert::From<i32> for Mode {
16642 fn from(value: i32) -> Self {
16643 match value {
16644 0 => Self::Unspecified,
16645 1 => Self::Disabled,
16646 2 => Self::Basic,
16647 3 => Self::Enterprise,
16648 _ => Self::UnknownValue(mode::UnknownValue(
16649 wkt::internal::UnknownEnumValue::Integer(value),
16650 )),
16651 }
16652 }
16653 }
16654
16655 impl std::convert::From<&str> for Mode {
16656 fn from(value: &str) -> Self {
16657 use std::string::ToString;
16658 match value {
16659 "MODE_UNSPECIFIED" => Self::Unspecified,
16660 "DISABLED" => Self::Disabled,
16661 "BASIC" => Self::Basic,
16662 "ENTERPRISE" => Self::Enterprise,
16663 _ => Self::UnknownValue(mode::UnknownValue(
16664 wkt::internal::UnknownEnumValue::String(value.to_string()),
16665 )),
16666 }
16667 }
16668 }
16669
16670 impl serde::ser::Serialize for Mode {
16671 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16672 where
16673 S: serde::Serializer,
16674 {
16675 match self {
16676 Self::Unspecified => serializer.serialize_i32(0),
16677 Self::Disabled => serializer.serialize_i32(1),
16678 Self::Basic => serializer.serialize_i32(2),
16679 Self::Enterprise => serializer.serialize_i32(3),
16680 Self::UnknownValue(u) => u.0.serialize(serializer),
16681 }
16682 }
16683 }
16684
16685 impl<'de> serde::de::Deserialize<'de> for Mode {
16686 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16687 where
16688 D: serde::Deserializer<'de>,
16689 {
16690 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
16691 ".google.container.v1.SecurityPostureConfig.Mode",
16692 ))
16693 }
16694 }
16695
16696 /// VulnerabilityMode defines enablement mode for vulnerability scanning.
16697 ///
16698 /// # Working with unknown values
16699 ///
16700 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16701 /// additional enum variants at any time. Adding new variants is not considered
16702 /// a breaking change. Applications should write their code in anticipation of:
16703 ///
16704 /// - New values appearing in future releases of the client library, **and**
16705 /// - New values received dynamically, without application changes.
16706 ///
16707 /// Please consult the [Working with enums] section in the user guide for some
16708 /// guidelines.
16709 ///
16710 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16711 #[derive(Clone, Debug, PartialEq)]
16712 #[non_exhaustive]
16713 pub enum VulnerabilityMode {
16714 /// Default value not specified.
16715 Unspecified,
16716 /// Disables vulnerability scanning on the cluster.
16717 VulnerabilityDisabled,
16718 /// Deprecated: Basic vulnerability scanning is no longer supported.
16719 /// For more details, see
16720 /// <https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation>.
16721 ///
16722 /// Applies basic vulnerability scanning on the cluster.
16723 #[deprecated]
16724 VulnerabilityBasic,
16725 /// Applies the Security Posture's vulnerability on cluster Enterprise level
16726 /// features.
16727 VulnerabilityEnterprise,
16728 /// If set, the enum was initialized with an unknown value.
16729 ///
16730 /// Applications can examine the value using [VulnerabilityMode::value] or
16731 /// [VulnerabilityMode::name].
16732 UnknownValue(vulnerability_mode::UnknownValue),
16733 }
16734
16735 #[doc(hidden)]
16736 pub mod vulnerability_mode {
16737 #[allow(unused_imports)]
16738 use super::*;
16739 #[derive(Clone, Debug, PartialEq)]
16740 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16741 }
16742
16743 impl VulnerabilityMode {
16744 /// Gets the enum value.
16745 ///
16746 /// Returns `None` if the enum contains an unknown value deserialized from
16747 /// the string representation of enums.
16748 pub fn value(&self) -> std::option::Option<i32> {
16749 match self {
16750 Self::Unspecified => std::option::Option::Some(0),
16751 Self::VulnerabilityDisabled => std::option::Option::Some(1),
16752 Self::VulnerabilityBasic => std::option::Option::Some(2),
16753 Self::VulnerabilityEnterprise => std::option::Option::Some(3),
16754 Self::UnknownValue(u) => u.0.value(),
16755 }
16756 }
16757
16758 /// Gets the enum value as a string.
16759 ///
16760 /// Returns `None` if the enum contains an unknown value deserialized from
16761 /// the integer representation of enums.
16762 pub fn name(&self) -> std::option::Option<&str> {
16763 match self {
16764 Self::Unspecified => std::option::Option::Some("VULNERABILITY_MODE_UNSPECIFIED"),
16765 Self::VulnerabilityDisabled => std::option::Option::Some("VULNERABILITY_DISABLED"),
16766 Self::VulnerabilityBasic => std::option::Option::Some("VULNERABILITY_BASIC"),
16767 Self::VulnerabilityEnterprise => {
16768 std::option::Option::Some("VULNERABILITY_ENTERPRISE")
16769 }
16770 Self::UnknownValue(u) => u.0.name(),
16771 }
16772 }
16773 }
16774
16775 impl std::default::Default for VulnerabilityMode {
16776 fn default() -> Self {
16777 use std::convert::From;
16778 Self::from(0)
16779 }
16780 }
16781
16782 impl std::fmt::Display for VulnerabilityMode {
16783 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16784 wkt::internal::display_enum(f, self.name(), self.value())
16785 }
16786 }
16787
16788 impl std::convert::From<i32> for VulnerabilityMode {
16789 fn from(value: i32) -> Self {
16790 match value {
16791 0 => Self::Unspecified,
16792 1 => Self::VulnerabilityDisabled,
16793 2 => Self::VulnerabilityBasic,
16794 3 => Self::VulnerabilityEnterprise,
16795 _ => Self::UnknownValue(vulnerability_mode::UnknownValue(
16796 wkt::internal::UnknownEnumValue::Integer(value),
16797 )),
16798 }
16799 }
16800 }
16801
16802 impl std::convert::From<&str> for VulnerabilityMode {
16803 fn from(value: &str) -> Self {
16804 use std::string::ToString;
16805 match value {
16806 "VULNERABILITY_MODE_UNSPECIFIED" => Self::Unspecified,
16807 "VULNERABILITY_DISABLED" => Self::VulnerabilityDisabled,
16808 "VULNERABILITY_BASIC" => Self::VulnerabilityBasic,
16809 "VULNERABILITY_ENTERPRISE" => Self::VulnerabilityEnterprise,
16810 _ => Self::UnknownValue(vulnerability_mode::UnknownValue(
16811 wkt::internal::UnknownEnumValue::String(value.to_string()),
16812 )),
16813 }
16814 }
16815 }
16816
16817 impl serde::ser::Serialize for VulnerabilityMode {
16818 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16819 where
16820 S: serde::Serializer,
16821 {
16822 match self {
16823 Self::Unspecified => serializer.serialize_i32(0),
16824 Self::VulnerabilityDisabled => serializer.serialize_i32(1),
16825 Self::VulnerabilityBasic => serializer.serialize_i32(2),
16826 Self::VulnerabilityEnterprise => serializer.serialize_i32(3),
16827 Self::UnknownValue(u) => u.0.serialize(serializer),
16828 }
16829 }
16830 }
16831
16832 impl<'de> serde::de::Deserialize<'de> for VulnerabilityMode {
16833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16834 where
16835 D: serde::Deserializer<'de>,
16836 {
16837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VulnerabilityMode>::new(
16838 ".google.container.v1.SecurityPostureConfig.VulnerabilityMode",
16839 ))
16840 }
16841 }
16842}
16843
16844/// Node pool configs that apply to all auto-provisioned node pools
16845/// in autopilot clusters and node auto-provisioning enabled clusters.
16846#[derive(Clone, Default, PartialEq)]
16847#[non_exhaustive]
16848pub struct NodePoolAutoConfig {
16849 /// The list of instance tags applied to all nodes. Tags are used to identify
16850 /// valid sources or targets for network firewalls and are specified by
16851 /// the client during cluster creation. Each tag within the list
16852 /// must comply with RFC1035.
16853 pub network_tags: std::option::Option<crate::model::NetworkTags>,
16854
16855 /// Resource manager tag keys and values to be attached to the nodes
16856 /// for managing Compute Engine firewalls using Network Firewall Policies.
16857 pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
16858
16859 /// NodeKubeletConfig controls the defaults for autoprovisioned node-pools.
16860 ///
16861 /// Currently only `insecure_kubelet_readonly_port_enabled` can be set here.
16862 pub node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
16863
16864 /// Output only. Configuration options for Linux nodes.
16865 pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
16866
16867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16868}
16869
16870impl NodePoolAutoConfig {
16871 /// Creates a new default instance.
16872 pub fn new() -> Self {
16873 std::default::Default::default()
16874 }
16875
16876 /// Sets the value of [network_tags][crate::model::NodePoolAutoConfig::network_tags].
16877 ///
16878 /// # Example
16879 /// ```ignore,no_run
16880 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16881 /// use google_cloud_container_v1::model::NetworkTags;
16882 /// let x = NodePoolAutoConfig::new().set_network_tags(NetworkTags::default()/* use setters */);
16883 /// ```
16884 pub fn set_network_tags<T>(mut self, v: T) -> Self
16885 where
16886 T: std::convert::Into<crate::model::NetworkTags>,
16887 {
16888 self.network_tags = std::option::Option::Some(v.into());
16889 self
16890 }
16891
16892 /// Sets or clears the value of [network_tags][crate::model::NodePoolAutoConfig::network_tags].
16893 ///
16894 /// # Example
16895 /// ```ignore,no_run
16896 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16897 /// use google_cloud_container_v1::model::NetworkTags;
16898 /// let x = NodePoolAutoConfig::new().set_or_clear_network_tags(Some(NetworkTags::default()/* use setters */));
16899 /// let x = NodePoolAutoConfig::new().set_or_clear_network_tags(None::<NetworkTags>);
16900 /// ```
16901 pub fn set_or_clear_network_tags<T>(mut self, v: std::option::Option<T>) -> Self
16902 where
16903 T: std::convert::Into<crate::model::NetworkTags>,
16904 {
16905 self.network_tags = v.map(|x| x.into());
16906 self
16907 }
16908
16909 /// Sets the value of [resource_manager_tags][crate::model::NodePoolAutoConfig::resource_manager_tags].
16910 ///
16911 /// # Example
16912 /// ```ignore,no_run
16913 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16914 /// use google_cloud_container_v1::model::ResourceManagerTags;
16915 /// let x = NodePoolAutoConfig::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
16916 /// ```
16917 pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
16918 where
16919 T: std::convert::Into<crate::model::ResourceManagerTags>,
16920 {
16921 self.resource_manager_tags = std::option::Option::Some(v.into());
16922 self
16923 }
16924
16925 /// Sets or clears the value of [resource_manager_tags][crate::model::NodePoolAutoConfig::resource_manager_tags].
16926 ///
16927 /// # Example
16928 /// ```ignore,no_run
16929 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16930 /// use google_cloud_container_v1::model::ResourceManagerTags;
16931 /// let x = NodePoolAutoConfig::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
16932 /// let x = NodePoolAutoConfig::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
16933 /// ```
16934 pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
16935 where
16936 T: std::convert::Into<crate::model::ResourceManagerTags>,
16937 {
16938 self.resource_manager_tags = v.map(|x| x.into());
16939 self
16940 }
16941
16942 /// Sets the value of [node_kubelet_config][crate::model::NodePoolAutoConfig::node_kubelet_config].
16943 ///
16944 /// # Example
16945 /// ```ignore,no_run
16946 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16947 /// use google_cloud_container_v1::model::NodeKubeletConfig;
16948 /// let x = NodePoolAutoConfig::new().set_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
16949 /// ```
16950 pub fn set_node_kubelet_config<T>(mut self, v: T) -> Self
16951 where
16952 T: std::convert::Into<crate::model::NodeKubeletConfig>,
16953 {
16954 self.node_kubelet_config = std::option::Option::Some(v.into());
16955 self
16956 }
16957
16958 /// Sets or clears the value of [node_kubelet_config][crate::model::NodePoolAutoConfig::node_kubelet_config].
16959 ///
16960 /// # Example
16961 /// ```ignore,no_run
16962 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16963 /// use google_cloud_container_v1::model::NodeKubeletConfig;
16964 /// let x = NodePoolAutoConfig::new().set_or_clear_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
16965 /// let x = NodePoolAutoConfig::new().set_or_clear_node_kubelet_config(None::<NodeKubeletConfig>);
16966 /// ```
16967 pub fn set_or_clear_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
16968 where
16969 T: std::convert::Into<crate::model::NodeKubeletConfig>,
16970 {
16971 self.node_kubelet_config = v.map(|x| x.into());
16972 self
16973 }
16974
16975 /// Sets the value of [linux_node_config][crate::model::NodePoolAutoConfig::linux_node_config].
16976 ///
16977 /// # Example
16978 /// ```ignore,no_run
16979 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16980 /// use google_cloud_container_v1::model::LinuxNodeConfig;
16981 /// let x = NodePoolAutoConfig::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
16982 /// ```
16983 pub fn set_linux_node_config<T>(mut self, v: T) -> Self
16984 where
16985 T: std::convert::Into<crate::model::LinuxNodeConfig>,
16986 {
16987 self.linux_node_config = std::option::Option::Some(v.into());
16988 self
16989 }
16990
16991 /// Sets or clears the value of [linux_node_config][crate::model::NodePoolAutoConfig::linux_node_config].
16992 ///
16993 /// # Example
16994 /// ```ignore,no_run
16995 /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
16996 /// use google_cloud_container_v1::model::LinuxNodeConfig;
16997 /// let x = NodePoolAutoConfig::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
16998 /// let x = NodePoolAutoConfig::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
16999 /// ```
17000 pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
17001 where
17002 T: std::convert::Into<crate::model::LinuxNodeConfig>,
17003 {
17004 self.linux_node_config = v.map(|x| x.into());
17005 self
17006 }
17007}
17008
17009impl wkt::message::Message for NodePoolAutoConfig {
17010 fn typename() -> &'static str {
17011 "type.googleapis.com/google.container.v1.NodePoolAutoConfig"
17012 }
17013}
17014
17015/// Subset of Nodepool message that has defaults.
17016#[derive(Clone, Default, PartialEq)]
17017#[non_exhaustive]
17018pub struct NodePoolDefaults {
17019 /// Subset of NodeConfig message that has defaults.
17020 pub node_config_defaults: std::option::Option<crate::model::NodeConfigDefaults>,
17021
17022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17023}
17024
17025impl NodePoolDefaults {
17026 /// Creates a new default instance.
17027 pub fn new() -> Self {
17028 std::default::Default::default()
17029 }
17030
17031 /// Sets the value of [node_config_defaults][crate::model::NodePoolDefaults::node_config_defaults].
17032 ///
17033 /// # Example
17034 /// ```ignore,no_run
17035 /// # use google_cloud_container_v1::model::NodePoolDefaults;
17036 /// use google_cloud_container_v1::model::NodeConfigDefaults;
17037 /// let x = NodePoolDefaults::new().set_node_config_defaults(NodeConfigDefaults::default()/* use setters */);
17038 /// ```
17039 pub fn set_node_config_defaults<T>(mut self, v: T) -> Self
17040 where
17041 T: std::convert::Into<crate::model::NodeConfigDefaults>,
17042 {
17043 self.node_config_defaults = std::option::Option::Some(v.into());
17044 self
17045 }
17046
17047 /// Sets or clears the value of [node_config_defaults][crate::model::NodePoolDefaults::node_config_defaults].
17048 ///
17049 /// # Example
17050 /// ```ignore,no_run
17051 /// # use google_cloud_container_v1::model::NodePoolDefaults;
17052 /// use google_cloud_container_v1::model::NodeConfigDefaults;
17053 /// let x = NodePoolDefaults::new().set_or_clear_node_config_defaults(Some(NodeConfigDefaults::default()/* use setters */));
17054 /// let x = NodePoolDefaults::new().set_or_clear_node_config_defaults(None::<NodeConfigDefaults>);
17055 /// ```
17056 pub fn set_or_clear_node_config_defaults<T>(mut self, v: std::option::Option<T>) -> Self
17057 where
17058 T: std::convert::Into<crate::model::NodeConfigDefaults>,
17059 {
17060 self.node_config_defaults = v.map(|x| x.into());
17061 self
17062 }
17063}
17064
17065impl wkt::message::Message for NodePoolDefaults {
17066 fn typename() -> &'static str {
17067 "type.googleapis.com/google.container.v1.NodePoolDefaults"
17068 }
17069}
17070
17071/// Subset of NodeConfig message that has defaults.
17072#[derive(Clone, Default, PartialEq)]
17073#[non_exhaustive]
17074pub struct NodeConfigDefaults {
17075 /// GCFS (Google Container File System, also known as Riptide) options.
17076 pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
17077
17078 /// Logging configuration for node pools.
17079 pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
17080
17081 /// Parameters for containerd customization.
17082 pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
17083
17084 /// NodeKubeletConfig controls the defaults for new node-pools.
17085 ///
17086 /// Currently only `insecure_kubelet_readonly_port_enabled` can be set here.
17087 pub node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
17088
17089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17090}
17091
17092impl NodeConfigDefaults {
17093 /// Creates a new default instance.
17094 pub fn new() -> Self {
17095 std::default::Default::default()
17096 }
17097
17098 /// Sets the value of [gcfs_config][crate::model::NodeConfigDefaults::gcfs_config].
17099 ///
17100 /// # Example
17101 /// ```ignore,no_run
17102 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17103 /// use google_cloud_container_v1::model::GcfsConfig;
17104 /// let x = NodeConfigDefaults::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
17105 /// ```
17106 pub fn set_gcfs_config<T>(mut self, v: T) -> Self
17107 where
17108 T: std::convert::Into<crate::model::GcfsConfig>,
17109 {
17110 self.gcfs_config = std::option::Option::Some(v.into());
17111 self
17112 }
17113
17114 /// Sets or clears the value of [gcfs_config][crate::model::NodeConfigDefaults::gcfs_config].
17115 ///
17116 /// # Example
17117 /// ```ignore,no_run
17118 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17119 /// use google_cloud_container_v1::model::GcfsConfig;
17120 /// let x = NodeConfigDefaults::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
17121 /// let x = NodeConfigDefaults::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
17122 /// ```
17123 pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
17124 where
17125 T: std::convert::Into<crate::model::GcfsConfig>,
17126 {
17127 self.gcfs_config = v.map(|x| x.into());
17128 self
17129 }
17130
17131 /// Sets the value of [logging_config][crate::model::NodeConfigDefaults::logging_config].
17132 ///
17133 /// # Example
17134 /// ```ignore,no_run
17135 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17136 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
17137 /// let x = NodeConfigDefaults::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
17138 /// ```
17139 pub fn set_logging_config<T>(mut self, v: T) -> Self
17140 where
17141 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
17142 {
17143 self.logging_config = std::option::Option::Some(v.into());
17144 self
17145 }
17146
17147 /// Sets or clears the value of [logging_config][crate::model::NodeConfigDefaults::logging_config].
17148 ///
17149 /// # Example
17150 /// ```ignore,no_run
17151 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17152 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
17153 /// let x = NodeConfigDefaults::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
17154 /// let x = NodeConfigDefaults::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
17155 /// ```
17156 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
17157 where
17158 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
17159 {
17160 self.logging_config = v.map(|x| x.into());
17161 self
17162 }
17163
17164 /// Sets the value of [containerd_config][crate::model::NodeConfigDefaults::containerd_config].
17165 ///
17166 /// # Example
17167 /// ```ignore,no_run
17168 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17169 /// use google_cloud_container_v1::model::ContainerdConfig;
17170 /// let x = NodeConfigDefaults::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
17171 /// ```
17172 pub fn set_containerd_config<T>(mut self, v: T) -> Self
17173 where
17174 T: std::convert::Into<crate::model::ContainerdConfig>,
17175 {
17176 self.containerd_config = std::option::Option::Some(v.into());
17177 self
17178 }
17179
17180 /// Sets or clears the value of [containerd_config][crate::model::NodeConfigDefaults::containerd_config].
17181 ///
17182 /// # Example
17183 /// ```ignore,no_run
17184 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17185 /// use google_cloud_container_v1::model::ContainerdConfig;
17186 /// let x = NodeConfigDefaults::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
17187 /// let x = NodeConfigDefaults::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
17188 /// ```
17189 pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
17190 where
17191 T: std::convert::Into<crate::model::ContainerdConfig>,
17192 {
17193 self.containerd_config = v.map(|x| x.into());
17194 self
17195 }
17196
17197 /// Sets the value of [node_kubelet_config][crate::model::NodeConfigDefaults::node_kubelet_config].
17198 ///
17199 /// # Example
17200 /// ```ignore,no_run
17201 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17202 /// use google_cloud_container_v1::model::NodeKubeletConfig;
17203 /// let x = NodeConfigDefaults::new().set_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
17204 /// ```
17205 pub fn set_node_kubelet_config<T>(mut self, v: T) -> Self
17206 where
17207 T: std::convert::Into<crate::model::NodeKubeletConfig>,
17208 {
17209 self.node_kubelet_config = std::option::Option::Some(v.into());
17210 self
17211 }
17212
17213 /// Sets or clears the value of [node_kubelet_config][crate::model::NodeConfigDefaults::node_kubelet_config].
17214 ///
17215 /// # Example
17216 /// ```ignore,no_run
17217 /// # use google_cloud_container_v1::model::NodeConfigDefaults;
17218 /// use google_cloud_container_v1::model::NodeKubeletConfig;
17219 /// let x = NodeConfigDefaults::new().set_or_clear_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
17220 /// let x = NodeConfigDefaults::new().set_or_clear_node_kubelet_config(None::<NodeKubeletConfig>);
17221 /// ```
17222 pub fn set_or_clear_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
17223 where
17224 T: std::convert::Into<crate::model::NodeKubeletConfig>,
17225 {
17226 self.node_kubelet_config = v.map(|x| x.into());
17227 self
17228 }
17229}
17230
17231impl wkt::message::Message for NodeConfigDefaults {
17232 fn typename() -> &'static str {
17233 "type.googleapis.com/google.container.v1.NodeConfigDefaults"
17234 }
17235}
17236
17237/// ClusterUpdate describes an update to the cluster. Exactly one update can
17238/// be applied to a cluster with each request, so at most one field can be
17239/// provided.
17240#[derive(Clone, Default, PartialEq)]
17241#[non_exhaustive]
17242pub struct ClusterUpdate {
17243 /// The Kubernetes version to change the nodes to (typically an
17244 /// upgrade).
17245 ///
17246 /// Users may specify either explicit versions offered by
17247 /// Kubernetes Engine or version aliases, which have the following behavior:
17248 ///
17249 /// - "latest": picks the highest valid Kubernetes version
17250 /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
17251 /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
17252 /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
17253 /// - "-": picks the Kubernetes master version
17254 pub desired_node_version: std::string::String,
17255
17256 /// The monitoring service the cluster should use to write metrics.
17257 /// Currently available options:
17258 ///
17259 /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
17260 /// service with a Kubernetes-native resource model
17261 /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
17262 /// longer available as of GKE 1.15).
17263 /// * `none` - No metrics will be exported from the cluster.
17264 ///
17265 /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
17266 /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
17267 pub desired_monitoring_service: std::string::String,
17268
17269 /// Configurations for the various addons available to run in the cluster.
17270 pub desired_addons_config: std::option::Option<crate::model::AddonsConfig>,
17271
17272 /// The node pool to be upgraded. This field is mandatory if
17273 /// "desired_node_version", "desired_image_family" or
17274 /// "desired_node_pool_autoscaling" is specified and there is more than one
17275 /// node pool on the cluster.
17276 pub desired_node_pool_id: std::string::String,
17277
17278 /// The desired image type for the node pool.
17279 /// NOTE: Set the "desired_node_pool" field as well.
17280 pub desired_image_type: std::string::String,
17281
17282 /// The desired name of the image to use for this node.
17283 /// This is used to create clusters using a custom image.
17284 /// NOTE: Set the "desired_node_pool" field as well.
17285 pub desired_image: std::string::String,
17286
17287 /// The project containing the desired image to use for this node.
17288 /// This is used to create clusters using a custom image.
17289 /// NOTE: Set the "desired_node_pool" field as well.
17290 pub desired_image_project: std::string::String,
17291
17292 /// Configuration of etcd encryption.
17293 pub desired_database_encryption: std::option::Option<crate::model::DatabaseEncryption>,
17294
17295 /// Configuration for Workload Identity.
17296 pub desired_workload_identity_config: std::option::Option<crate::model::WorkloadIdentityConfig>,
17297
17298 /// Configuration for issuance of mTLS keys and certificates to Kubernetes
17299 /// pods.
17300 pub desired_mesh_certificates: std::option::Option<crate::model::MeshCertificates>,
17301
17302 /// Configuration for Shielded Nodes.
17303 pub desired_shielded_nodes: std::option::Option<crate::model::ShieldedNodes>,
17304
17305 /// The desired configuration for the fine-grained cost management feature.
17306 pub desired_cost_management_config: std::option::Option<crate::model::CostManagementConfig>,
17307
17308 /// DNSConfig contains clusterDNS config for this cluster.
17309 pub desired_dns_config: std::option::Option<crate::model::DNSConfig>,
17310
17311 /// Autoscaler configuration for the node pool specified in
17312 /// desired_node_pool_id. If there is only one pool in the
17313 /// cluster and desired_node_pool_id is not provided then
17314 /// the change applies to that single node pool.
17315 pub desired_node_pool_autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
17316
17317 /// The desired list of Google Compute Engine
17318 /// [zones](https://cloud.google.com/compute/docs/zones#available)
17319 /// in which the cluster's nodes should be located.
17320 ///
17321 /// This list must always include the cluster's primary zone.
17322 ///
17323 /// Warning: changing cluster locations will update the locations of all node
17324 /// pools and will result in nodes being added and/or removed.
17325 pub desired_locations: std::vec::Vec<std::string::String>,
17326
17327 /// The desired configuration options for master authorized networks feature.
17328 ///
17329 /// Deprecated: Use
17330 /// desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config
17331 /// instead.
17332 #[deprecated]
17333 pub desired_master_authorized_networks_config:
17334 std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
17335
17336 /// Cluster-level autoscaling configuration.
17337 pub desired_cluster_autoscaling: std::option::Option<crate::model::ClusterAutoscaling>,
17338
17339 /// The desired configuration options for the Binary Authorization feature.
17340 pub desired_binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
17341
17342 /// The logging service the cluster should use to write logs.
17343 /// Currently available options:
17344 ///
17345 /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
17346 /// service with a Kubernetes-native resource model
17347 /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
17348 /// available as of GKE 1.15).
17349 /// * `none` - no logs will be exported from the cluster.
17350 ///
17351 /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
17352 /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
17353 pub desired_logging_service: std::string::String,
17354
17355 /// The desired configuration for exporting resource usage.
17356 pub desired_resource_usage_export_config:
17357 std::option::Option<crate::model::ResourceUsageExportConfig>,
17358
17359 /// Cluster-level Vertical Pod Autoscaling configuration.
17360 pub desired_vertical_pod_autoscaling: std::option::Option<crate::model::VerticalPodAutoscaling>,
17361
17362 /// The desired private cluster configuration. master_global_access_config is
17363 /// the only field that can be changed via this field.
17364 /// See also
17365 /// [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint]
17366 /// for modifying other fields within
17367 /// [PrivateClusterConfig][google.container.v1.PrivateClusterConfig].
17368 ///
17369 /// Deprecated: Use
17370 /// desired_control_plane_endpoints_config.ip_endpoints_config.global_access
17371 /// instead.
17372 ///
17373 /// [google.container.v1.ClusterUpdate.desired_enable_private_endpoint]: crate::model::ClusterUpdate::desired_enable_private_endpoint
17374 /// [google.container.v1.PrivateClusterConfig]: crate::model::PrivateClusterConfig
17375 #[deprecated]
17376 pub desired_private_cluster_config: std::option::Option<crate::model::PrivateClusterConfig>,
17377
17378 /// The desired config of Intra-node visibility.
17379 pub desired_intra_node_visibility_config:
17380 std::option::Option<crate::model::IntraNodeVisibilityConfig>,
17381
17382 /// The desired status of whether to disable default sNAT for this cluster.
17383 pub desired_default_snat_status: std::option::Option<crate::model::DefaultSnatStatus>,
17384
17385 /// The desired release channel configuration.
17386 pub desired_release_channel: std::option::Option<crate::model::ReleaseChannel>,
17387
17388 /// The desired L4 Internal Load Balancer Subsetting configuration.
17389 pub desired_l4ilb_subsetting_config: std::option::Option<crate::model::ILBSubsettingConfig>,
17390
17391 /// The desired datapath provider for the cluster.
17392 pub desired_datapath_provider: crate::model::DatapathProvider,
17393
17394 /// The desired state of IPv6 connectivity to Google Services.
17395 pub desired_private_ipv6_google_access: crate::model::PrivateIPv6GoogleAccess,
17396
17397 /// The desired notification configuration.
17398 pub desired_notification_config: std::option::Option<crate::model::NotificationConfig>,
17399
17400 /// The desired authenticator groups config for the cluster.
17401 pub desired_authenticator_groups_config:
17402 std::option::Option<crate::model::AuthenticatorGroupsConfig>,
17403
17404 /// The desired logging configuration.
17405 pub desired_logging_config: std::option::Option<crate::model::LoggingConfig>,
17406
17407 /// The desired monitoring configuration.
17408 pub desired_monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
17409
17410 /// The desired Identity Service component configuration.
17411 pub desired_identity_service_config: std::option::Option<crate::model::IdentityServiceConfig>,
17412
17413 /// ServiceExternalIPsConfig specifies the config for the use of Services with
17414 /// ExternalIPs field.
17415 pub desired_service_external_ips_config:
17416 std::option::Option<crate::model::ServiceExternalIPsConfig>,
17417
17418 /// Enable/Disable private endpoint for the cluster's master.
17419 ///
17420 /// Deprecated: Use
17421 /// desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint
17422 /// instead. Note that the value of enable_public_endpoint is reversed: if
17423 /// enable_private_endpoint is false, then enable_public_endpoint will be true.
17424 #[deprecated]
17425 pub desired_enable_private_endpoint: std::option::Option<bool>,
17426
17427 /// Override the default setting of whether future created
17428 /// nodes have private IP addresses only, namely
17429 /// [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes]
17430 ///
17431 /// [google.container.v1.NetworkConfig.default_enable_private_nodes]: crate::model::NetworkConfig::default_enable_private_nodes
17432 pub desired_default_enable_private_nodes: std::option::Option<bool>,
17433
17434 /// [Control plane
17435 /// endpoints][google.container.v1.Cluster.control_plane_endpoints_config]
17436 /// configuration.
17437 ///
17438 /// [google.container.v1.Cluster.control_plane_endpoints_config]: crate::model::Cluster::control_plane_endpoints_config
17439 pub desired_control_plane_endpoints_config:
17440 std::option::Option<crate::model::ControlPlaneEndpointsConfig>,
17441
17442 /// The Kubernetes version to change the master to.
17443 ///
17444 /// Users may specify either explicit versions offered by
17445 /// Kubernetes Engine or version aliases, which have the following behavior:
17446 ///
17447 /// - "latest": picks the highest valid Kubernetes version
17448 /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
17449 /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
17450 /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
17451 /// - "-": picks the default Kubernetes version
17452 pub desired_master_version: std::string::String,
17453
17454 /// The desired GCFS config for the cluster
17455 pub desired_gcfs_config: std::option::Option<crate::model::GcfsConfig>,
17456
17457 /// The desired network tags that apply to all auto-provisioned node pools
17458 /// in autopilot clusters and node auto-provisioning enabled clusters.
17459 pub desired_node_pool_auto_config_network_tags: std::option::Option<crate::model::NetworkTags>,
17460
17461 /// The desired config for pod autoscaling.
17462 pub desired_pod_autoscaling: std::option::Option<crate::model::PodAutoscaling>,
17463
17464 /// The desired config of Gateway API on this cluster.
17465 pub desired_gateway_api_config: std::option::Option<crate::model::GatewayAPIConfig>,
17466
17467 /// The current etag of the cluster.
17468 /// If an etag is provided and does not match the current etag of the cluster,
17469 /// update will be blocked and an ABORTED error will be returned.
17470 pub etag: std::string::String,
17471
17472 /// The desired node pool logging configuration defaults for the cluster.
17473 pub desired_node_pool_logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
17474
17475 /// The desired fleet configuration for the cluster.
17476 pub desired_fleet: std::option::Option<crate::model::Fleet>,
17477
17478 /// The desired stack type of the cluster.
17479 /// If a stack type is provided and does not match the current stack type of
17480 /// the cluster, update will attempt to change the stack type to the new type.
17481 pub desired_stack_type: crate::model::StackType,
17482
17483 /// The additional pod ranges to be added to the cluster. These pod ranges
17484 /// can be used by node pools to allocate pod IPs.
17485 pub additional_pod_ranges_config: std::option::Option<crate::model::AdditionalPodRangesConfig>,
17486
17487 /// The additional pod ranges that are to be removed from the cluster.
17488 /// The pod ranges specified here must have been specified earlier in the
17489 /// 'additional_pod_ranges_config' argument.
17490 pub removed_additional_pod_ranges_config:
17491 std::option::Option<crate::model::AdditionalPodRangesConfig>,
17492
17493 /// Kubernetes open source beta apis enabled on the cluster. Only beta apis
17494 pub enable_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
17495
17496 /// Enable/Disable Security Posture API features for the cluster.
17497 pub desired_security_posture_config: std::option::Option<crate::model::SecurityPostureConfig>,
17498
17499 /// The desired network performance config.
17500 pub desired_network_performance_config:
17501 std::option::Option<crate::model::network_config::ClusterNetworkPerformanceConfig>,
17502
17503 /// Enable/Disable FQDN Network Policy for the cluster.
17504 pub desired_enable_fqdn_network_policy: std::option::Option<bool>,
17505
17506 /// WorkloadPolicyConfig is the configuration related to GCW workload policy
17507 pub desired_autopilot_workload_policy_config:
17508 std::option::Option<crate::model::WorkloadPolicyConfig>,
17509
17510 /// Desired Beta APIs to be enabled for cluster.
17511 pub desired_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
17512
17513 /// The desired containerd config for the cluster.
17514 pub desired_containerd_config: std::option::Option<crate::model::ContainerdConfig>,
17515
17516 /// Enable/Disable Multi-Networking for the cluster
17517 pub desired_enable_multi_networking: std::option::Option<bool>,
17518
17519 /// The desired resource manager tags that apply to all auto-provisioned node
17520 /// pools in autopilot clusters and node auto-provisioning enabled clusters.
17521 pub desired_node_pool_auto_config_resource_manager_tags:
17522 std::option::Option<crate::model::ResourceManagerTags>,
17523
17524 /// Specify the details of in-transit encryption.
17525 pub desired_in_transit_encryption_config:
17526 std::option::Option<crate::model::InTransitEncryptionConfig>,
17527
17528 /// Enable/Disable Cilium Clusterwide Network Policy for the cluster.
17529 pub desired_enable_cilium_clusterwide_network_policy: std::option::Option<bool>,
17530
17531 /// Enable/Disable Secret Manager Config.
17532 pub desired_secret_manager_config: std::option::Option<crate::model::SecretManagerConfig>,
17533
17534 /// Deprecated: Compliance Posture is no longer supported.
17535 /// For more details, see
17536 /// <https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation>.
17537 ///
17538 /// Enable/Disable Compliance Posture features for the cluster.
17539 #[deprecated]
17540 pub desired_compliance_posture_config:
17541 std::option::Option<crate::model::CompliancePostureConfig>,
17542
17543 /// The desired node kubelet config for the cluster.
17544 pub desired_node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
17545
17546 /// The desired node kubelet config for all auto-provisioned node pools
17547 /// in autopilot clusters and node auto-provisioning enabled clusters.
17548 pub desired_node_pool_auto_config_kubelet_config:
17549 std::option::Option<crate::model::NodeKubeletConfig>,
17550
17551 /// The Custom keys configuration for the cluster.
17552 ///
17553 /// This field is deprecated.
17554 /// Use
17555 /// [ClusterUpdate.desired_user_managed_keys_config][google.container.v1.ClusterUpdate.desired_user_managed_keys_config]
17556 /// instead.
17557 ///
17558 /// [google.container.v1.ClusterUpdate.desired_user_managed_keys_config]: crate::model::ClusterUpdate::desired_user_managed_keys_config
17559 #[deprecated]
17560 pub user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
17561
17562 /// RBACBindingConfig allows user to restrict ClusterRoleBindings an
17563 /// RoleBindings that can be created.
17564 pub desired_rbac_binding_config: std::option::Option<crate::model::RBACBindingConfig>,
17565
17566 /// The desired config for additional subnetworks attached to the cluster.
17567 pub desired_additional_ip_ranges_config:
17568 std::option::Option<crate::model::DesiredAdditionalIPRangesConfig>,
17569
17570 /// The desired enterprise configuration for the cluster.
17571 ///
17572 /// Deprecated: GKE Enterprise features are now available without an Enterprise
17573 /// tier.
17574 #[deprecated]
17575 pub desired_enterprise_config: std::option::Option<crate::model::DesiredEnterpriseConfig>,
17576
17577 /// AutoIpamConfig contains all information related to Auto IPAM
17578 pub desired_auto_ipam_config: std::option::Option<crate::model::AutoIpamConfig>,
17579
17580 /// Enable/Disable L4 LB VPC firewall reconciliation for the cluster.
17581 pub desired_disable_l4_lb_firewall_reconciliation: std::option::Option<bool>,
17582
17583 /// The desired Linux node config for all auto-provisioned node pools
17584 /// in autopilot clusters and node auto-provisioning enabled clusters.
17585 ///
17586 /// Currently only `cgroup_mode` can be set here.
17587 pub desired_node_pool_auto_config_linux_node_config:
17588 std::option::Option<crate::model::LinuxNodeConfig>,
17589
17590 /// The desired user managed keys config for the cluster.
17591 pub desired_user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
17592
17593 /// Configuration for limiting anonymous access to all endpoints except the
17594 /// health checks.
17595 pub desired_anonymous_authentication_config:
17596 std::option::Option<crate::model::AnonymousAuthenticationConfig>,
17597
17598 /// Configuration for GKE auto upgrade.
17599 pub gke_auto_upgrade_config: std::option::Option<crate::model::GkeAutoUpgradeConfig>,
17600
17601 /// The desired network tier configuration for the cluster.
17602 pub desired_network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
17603
17604 /// Configuration for sync Secret Manager secrets as k8s secrets.
17605 pub desired_secret_sync_config: std::option::Option<crate::model::SecretSyncConfig>,
17606
17607 /// The desired privileged admission config for the cluster.
17608 pub desired_privileged_admission_config:
17609 std::option::Option<crate::model::PrivilegedAdmissionConfig>,
17610
17611 /// The desired control plane egress control config for the cluster.
17612 pub desired_control_plane_egress: std::option::Option<crate::model::ControlPlaneEgress>,
17613
17614 /// The desired managed open telemetry configuration.
17615 pub desired_managed_opentelemetry_config:
17616 std::option::Option<crate::model::ManagedOpenTelemetryConfig>,
17617
17618 /// The desired autopilot cluster policies that to be enforced in the cluster.
17619 pub desired_autopilot_cluster_policy_config:
17620 std::option::Option<crate::model::ClusterPolicyConfig>,
17621
17622 /// The desired managed machine learning diagnostics configuration.
17623 pub desired_managed_machine_learning_diagnostics_config:
17624 std::option::Option<crate::model::ManagedMachineLearningDiagnosticsConfig>,
17625
17626 /// Optional. The desired NodeCreationConfig for the cluster.
17627 pub desired_node_creation_config: std::option::Option<crate::model::NodeCreationConfig>,
17628
17629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17630}
17631
17632impl ClusterUpdate {
17633 /// Creates a new default instance.
17634 pub fn new() -> Self {
17635 std::default::Default::default()
17636 }
17637
17638 /// Sets the value of [desired_node_version][crate::model::ClusterUpdate::desired_node_version].
17639 ///
17640 /// # Example
17641 /// ```ignore,no_run
17642 /// # use google_cloud_container_v1::model::ClusterUpdate;
17643 /// let x = ClusterUpdate::new().set_desired_node_version("example");
17644 /// ```
17645 pub fn set_desired_node_version<T: std::convert::Into<std::string::String>>(
17646 mut self,
17647 v: T,
17648 ) -> Self {
17649 self.desired_node_version = v.into();
17650 self
17651 }
17652
17653 /// Sets the value of [desired_monitoring_service][crate::model::ClusterUpdate::desired_monitoring_service].
17654 ///
17655 /// # Example
17656 /// ```ignore,no_run
17657 /// # use google_cloud_container_v1::model::ClusterUpdate;
17658 /// let x = ClusterUpdate::new().set_desired_monitoring_service("example");
17659 /// ```
17660 pub fn set_desired_monitoring_service<T: std::convert::Into<std::string::String>>(
17661 mut self,
17662 v: T,
17663 ) -> Self {
17664 self.desired_monitoring_service = v.into();
17665 self
17666 }
17667
17668 /// Sets the value of [desired_addons_config][crate::model::ClusterUpdate::desired_addons_config].
17669 ///
17670 /// # Example
17671 /// ```ignore,no_run
17672 /// # use google_cloud_container_v1::model::ClusterUpdate;
17673 /// use google_cloud_container_v1::model::AddonsConfig;
17674 /// let x = ClusterUpdate::new().set_desired_addons_config(AddonsConfig::default()/* use setters */);
17675 /// ```
17676 pub fn set_desired_addons_config<T>(mut self, v: T) -> Self
17677 where
17678 T: std::convert::Into<crate::model::AddonsConfig>,
17679 {
17680 self.desired_addons_config = std::option::Option::Some(v.into());
17681 self
17682 }
17683
17684 /// Sets or clears the value of [desired_addons_config][crate::model::ClusterUpdate::desired_addons_config].
17685 ///
17686 /// # Example
17687 /// ```ignore,no_run
17688 /// # use google_cloud_container_v1::model::ClusterUpdate;
17689 /// use google_cloud_container_v1::model::AddonsConfig;
17690 /// let x = ClusterUpdate::new().set_or_clear_desired_addons_config(Some(AddonsConfig::default()/* use setters */));
17691 /// let x = ClusterUpdate::new().set_or_clear_desired_addons_config(None::<AddonsConfig>);
17692 /// ```
17693 pub fn set_or_clear_desired_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
17694 where
17695 T: std::convert::Into<crate::model::AddonsConfig>,
17696 {
17697 self.desired_addons_config = v.map(|x| x.into());
17698 self
17699 }
17700
17701 /// Sets the value of [desired_node_pool_id][crate::model::ClusterUpdate::desired_node_pool_id].
17702 ///
17703 /// # Example
17704 /// ```ignore,no_run
17705 /// # use google_cloud_container_v1::model::ClusterUpdate;
17706 /// let x = ClusterUpdate::new().set_desired_node_pool_id("example");
17707 /// ```
17708 pub fn set_desired_node_pool_id<T: std::convert::Into<std::string::String>>(
17709 mut self,
17710 v: T,
17711 ) -> Self {
17712 self.desired_node_pool_id = v.into();
17713 self
17714 }
17715
17716 /// Sets the value of [desired_image_type][crate::model::ClusterUpdate::desired_image_type].
17717 ///
17718 /// # Example
17719 /// ```ignore,no_run
17720 /// # use google_cloud_container_v1::model::ClusterUpdate;
17721 /// let x = ClusterUpdate::new().set_desired_image_type("example");
17722 /// ```
17723 pub fn set_desired_image_type<T: std::convert::Into<std::string::String>>(
17724 mut self,
17725 v: T,
17726 ) -> Self {
17727 self.desired_image_type = v.into();
17728 self
17729 }
17730
17731 /// Sets the value of [desired_image][crate::model::ClusterUpdate::desired_image].
17732 ///
17733 /// # Example
17734 /// ```ignore,no_run
17735 /// # use google_cloud_container_v1::model::ClusterUpdate;
17736 /// let x = ClusterUpdate::new().set_desired_image("example");
17737 /// ```
17738 pub fn set_desired_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17739 self.desired_image = v.into();
17740 self
17741 }
17742
17743 /// Sets the value of [desired_image_project][crate::model::ClusterUpdate::desired_image_project].
17744 ///
17745 /// # Example
17746 /// ```ignore,no_run
17747 /// # use google_cloud_container_v1::model::ClusterUpdate;
17748 /// let x = ClusterUpdate::new().set_desired_image_project("example");
17749 /// ```
17750 pub fn set_desired_image_project<T: std::convert::Into<std::string::String>>(
17751 mut self,
17752 v: T,
17753 ) -> Self {
17754 self.desired_image_project = v.into();
17755 self
17756 }
17757
17758 /// Sets the value of [desired_database_encryption][crate::model::ClusterUpdate::desired_database_encryption].
17759 ///
17760 /// # Example
17761 /// ```ignore,no_run
17762 /// # use google_cloud_container_v1::model::ClusterUpdate;
17763 /// use google_cloud_container_v1::model::DatabaseEncryption;
17764 /// let x = ClusterUpdate::new().set_desired_database_encryption(DatabaseEncryption::default()/* use setters */);
17765 /// ```
17766 pub fn set_desired_database_encryption<T>(mut self, v: T) -> Self
17767 where
17768 T: std::convert::Into<crate::model::DatabaseEncryption>,
17769 {
17770 self.desired_database_encryption = std::option::Option::Some(v.into());
17771 self
17772 }
17773
17774 /// Sets or clears the value of [desired_database_encryption][crate::model::ClusterUpdate::desired_database_encryption].
17775 ///
17776 /// # Example
17777 /// ```ignore,no_run
17778 /// # use google_cloud_container_v1::model::ClusterUpdate;
17779 /// use google_cloud_container_v1::model::DatabaseEncryption;
17780 /// let x = ClusterUpdate::new().set_or_clear_desired_database_encryption(Some(DatabaseEncryption::default()/* use setters */));
17781 /// let x = ClusterUpdate::new().set_or_clear_desired_database_encryption(None::<DatabaseEncryption>);
17782 /// ```
17783 pub fn set_or_clear_desired_database_encryption<T>(mut self, v: std::option::Option<T>) -> Self
17784 where
17785 T: std::convert::Into<crate::model::DatabaseEncryption>,
17786 {
17787 self.desired_database_encryption = v.map(|x| x.into());
17788 self
17789 }
17790
17791 /// Sets the value of [desired_workload_identity_config][crate::model::ClusterUpdate::desired_workload_identity_config].
17792 ///
17793 /// # Example
17794 /// ```ignore,no_run
17795 /// # use google_cloud_container_v1::model::ClusterUpdate;
17796 /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
17797 /// let x = ClusterUpdate::new().set_desired_workload_identity_config(WorkloadIdentityConfig::default()/* use setters */);
17798 /// ```
17799 pub fn set_desired_workload_identity_config<T>(mut self, v: T) -> Self
17800 where
17801 T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
17802 {
17803 self.desired_workload_identity_config = std::option::Option::Some(v.into());
17804 self
17805 }
17806
17807 /// Sets or clears the value of [desired_workload_identity_config][crate::model::ClusterUpdate::desired_workload_identity_config].
17808 ///
17809 /// # Example
17810 /// ```ignore,no_run
17811 /// # use google_cloud_container_v1::model::ClusterUpdate;
17812 /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
17813 /// let x = ClusterUpdate::new().set_or_clear_desired_workload_identity_config(Some(WorkloadIdentityConfig::default()/* use setters */));
17814 /// let x = ClusterUpdate::new().set_or_clear_desired_workload_identity_config(None::<WorkloadIdentityConfig>);
17815 /// ```
17816 pub fn set_or_clear_desired_workload_identity_config<T>(
17817 mut self,
17818 v: std::option::Option<T>,
17819 ) -> Self
17820 where
17821 T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
17822 {
17823 self.desired_workload_identity_config = v.map(|x| x.into());
17824 self
17825 }
17826
17827 /// Sets the value of [desired_mesh_certificates][crate::model::ClusterUpdate::desired_mesh_certificates].
17828 ///
17829 /// # Example
17830 /// ```ignore,no_run
17831 /// # use google_cloud_container_v1::model::ClusterUpdate;
17832 /// use google_cloud_container_v1::model::MeshCertificates;
17833 /// let x = ClusterUpdate::new().set_desired_mesh_certificates(MeshCertificates::default()/* use setters */);
17834 /// ```
17835 pub fn set_desired_mesh_certificates<T>(mut self, v: T) -> Self
17836 where
17837 T: std::convert::Into<crate::model::MeshCertificates>,
17838 {
17839 self.desired_mesh_certificates = std::option::Option::Some(v.into());
17840 self
17841 }
17842
17843 /// Sets or clears the value of [desired_mesh_certificates][crate::model::ClusterUpdate::desired_mesh_certificates].
17844 ///
17845 /// # Example
17846 /// ```ignore,no_run
17847 /// # use google_cloud_container_v1::model::ClusterUpdate;
17848 /// use google_cloud_container_v1::model::MeshCertificates;
17849 /// let x = ClusterUpdate::new().set_or_clear_desired_mesh_certificates(Some(MeshCertificates::default()/* use setters */));
17850 /// let x = ClusterUpdate::new().set_or_clear_desired_mesh_certificates(None::<MeshCertificates>);
17851 /// ```
17852 pub fn set_or_clear_desired_mesh_certificates<T>(mut self, v: std::option::Option<T>) -> Self
17853 where
17854 T: std::convert::Into<crate::model::MeshCertificates>,
17855 {
17856 self.desired_mesh_certificates = v.map(|x| x.into());
17857 self
17858 }
17859
17860 /// Sets the value of [desired_shielded_nodes][crate::model::ClusterUpdate::desired_shielded_nodes].
17861 ///
17862 /// # Example
17863 /// ```ignore,no_run
17864 /// # use google_cloud_container_v1::model::ClusterUpdate;
17865 /// use google_cloud_container_v1::model::ShieldedNodes;
17866 /// let x = ClusterUpdate::new().set_desired_shielded_nodes(ShieldedNodes::default()/* use setters */);
17867 /// ```
17868 pub fn set_desired_shielded_nodes<T>(mut self, v: T) -> Self
17869 where
17870 T: std::convert::Into<crate::model::ShieldedNodes>,
17871 {
17872 self.desired_shielded_nodes = std::option::Option::Some(v.into());
17873 self
17874 }
17875
17876 /// Sets or clears the value of [desired_shielded_nodes][crate::model::ClusterUpdate::desired_shielded_nodes].
17877 ///
17878 /// # Example
17879 /// ```ignore,no_run
17880 /// # use google_cloud_container_v1::model::ClusterUpdate;
17881 /// use google_cloud_container_v1::model::ShieldedNodes;
17882 /// let x = ClusterUpdate::new().set_or_clear_desired_shielded_nodes(Some(ShieldedNodes::default()/* use setters */));
17883 /// let x = ClusterUpdate::new().set_or_clear_desired_shielded_nodes(None::<ShieldedNodes>);
17884 /// ```
17885 pub fn set_or_clear_desired_shielded_nodes<T>(mut self, v: std::option::Option<T>) -> Self
17886 where
17887 T: std::convert::Into<crate::model::ShieldedNodes>,
17888 {
17889 self.desired_shielded_nodes = v.map(|x| x.into());
17890 self
17891 }
17892
17893 /// Sets the value of [desired_cost_management_config][crate::model::ClusterUpdate::desired_cost_management_config].
17894 ///
17895 /// # Example
17896 /// ```ignore,no_run
17897 /// # use google_cloud_container_v1::model::ClusterUpdate;
17898 /// use google_cloud_container_v1::model::CostManagementConfig;
17899 /// let x = ClusterUpdate::new().set_desired_cost_management_config(CostManagementConfig::default()/* use setters */);
17900 /// ```
17901 pub fn set_desired_cost_management_config<T>(mut self, v: T) -> Self
17902 where
17903 T: std::convert::Into<crate::model::CostManagementConfig>,
17904 {
17905 self.desired_cost_management_config = std::option::Option::Some(v.into());
17906 self
17907 }
17908
17909 /// Sets or clears the value of [desired_cost_management_config][crate::model::ClusterUpdate::desired_cost_management_config].
17910 ///
17911 /// # Example
17912 /// ```ignore,no_run
17913 /// # use google_cloud_container_v1::model::ClusterUpdate;
17914 /// use google_cloud_container_v1::model::CostManagementConfig;
17915 /// let x = ClusterUpdate::new().set_or_clear_desired_cost_management_config(Some(CostManagementConfig::default()/* use setters */));
17916 /// let x = ClusterUpdate::new().set_or_clear_desired_cost_management_config(None::<CostManagementConfig>);
17917 /// ```
17918 pub fn set_or_clear_desired_cost_management_config<T>(
17919 mut self,
17920 v: std::option::Option<T>,
17921 ) -> Self
17922 where
17923 T: std::convert::Into<crate::model::CostManagementConfig>,
17924 {
17925 self.desired_cost_management_config = v.map(|x| x.into());
17926 self
17927 }
17928
17929 /// Sets the value of [desired_dns_config][crate::model::ClusterUpdate::desired_dns_config].
17930 ///
17931 /// # Example
17932 /// ```ignore,no_run
17933 /// # use google_cloud_container_v1::model::ClusterUpdate;
17934 /// use google_cloud_container_v1::model::DNSConfig;
17935 /// let x = ClusterUpdate::new().set_desired_dns_config(DNSConfig::default()/* use setters */);
17936 /// ```
17937 pub fn set_desired_dns_config<T>(mut self, v: T) -> Self
17938 where
17939 T: std::convert::Into<crate::model::DNSConfig>,
17940 {
17941 self.desired_dns_config = std::option::Option::Some(v.into());
17942 self
17943 }
17944
17945 /// Sets or clears the value of [desired_dns_config][crate::model::ClusterUpdate::desired_dns_config].
17946 ///
17947 /// # Example
17948 /// ```ignore,no_run
17949 /// # use google_cloud_container_v1::model::ClusterUpdate;
17950 /// use google_cloud_container_v1::model::DNSConfig;
17951 /// let x = ClusterUpdate::new().set_or_clear_desired_dns_config(Some(DNSConfig::default()/* use setters */));
17952 /// let x = ClusterUpdate::new().set_or_clear_desired_dns_config(None::<DNSConfig>);
17953 /// ```
17954 pub fn set_or_clear_desired_dns_config<T>(mut self, v: std::option::Option<T>) -> Self
17955 where
17956 T: std::convert::Into<crate::model::DNSConfig>,
17957 {
17958 self.desired_dns_config = v.map(|x| x.into());
17959 self
17960 }
17961
17962 /// Sets the value of [desired_node_pool_autoscaling][crate::model::ClusterUpdate::desired_node_pool_autoscaling].
17963 ///
17964 /// # Example
17965 /// ```ignore,no_run
17966 /// # use google_cloud_container_v1::model::ClusterUpdate;
17967 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
17968 /// let x = ClusterUpdate::new().set_desired_node_pool_autoscaling(NodePoolAutoscaling::default()/* use setters */);
17969 /// ```
17970 pub fn set_desired_node_pool_autoscaling<T>(mut self, v: T) -> Self
17971 where
17972 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
17973 {
17974 self.desired_node_pool_autoscaling = std::option::Option::Some(v.into());
17975 self
17976 }
17977
17978 /// Sets or clears the value of [desired_node_pool_autoscaling][crate::model::ClusterUpdate::desired_node_pool_autoscaling].
17979 ///
17980 /// # Example
17981 /// ```ignore,no_run
17982 /// # use google_cloud_container_v1::model::ClusterUpdate;
17983 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
17984 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
17985 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_autoscaling(None::<NodePoolAutoscaling>);
17986 /// ```
17987 pub fn set_or_clear_desired_node_pool_autoscaling<T>(
17988 mut self,
17989 v: std::option::Option<T>,
17990 ) -> Self
17991 where
17992 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
17993 {
17994 self.desired_node_pool_autoscaling = v.map(|x| x.into());
17995 self
17996 }
17997
17998 /// Sets the value of [desired_locations][crate::model::ClusterUpdate::desired_locations].
17999 ///
18000 /// # Example
18001 /// ```ignore,no_run
18002 /// # use google_cloud_container_v1::model::ClusterUpdate;
18003 /// let x = ClusterUpdate::new().set_desired_locations(["a", "b", "c"]);
18004 /// ```
18005 pub fn set_desired_locations<T, V>(mut self, v: T) -> Self
18006 where
18007 T: std::iter::IntoIterator<Item = V>,
18008 V: std::convert::Into<std::string::String>,
18009 {
18010 use std::iter::Iterator;
18011 self.desired_locations = v.into_iter().map(|i| i.into()).collect();
18012 self
18013 }
18014
18015 /// Sets the value of [desired_master_authorized_networks_config][crate::model::ClusterUpdate::desired_master_authorized_networks_config].
18016 ///
18017 /// # Example
18018 /// ```ignore,no_run
18019 /// # use google_cloud_container_v1::model::ClusterUpdate;
18020 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
18021 /// let x = ClusterUpdate::new().set_desired_master_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
18022 /// ```
18023 #[deprecated]
18024 pub fn set_desired_master_authorized_networks_config<T>(mut self, v: T) -> Self
18025 where
18026 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
18027 {
18028 self.desired_master_authorized_networks_config = std::option::Option::Some(v.into());
18029 self
18030 }
18031
18032 /// Sets or clears the value of [desired_master_authorized_networks_config][crate::model::ClusterUpdate::desired_master_authorized_networks_config].
18033 ///
18034 /// # Example
18035 /// ```ignore,no_run
18036 /// # use google_cloud_container_v1::model::ClusterUpdate;
18037 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
18038 /// let x = ClusterUpdate::new().set_or_clear_desired_master_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
18039 /// let x = ClusterUpdate::new().set_or_clear_desired_master_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
18040 /// ```
18041 #[deprecated]
18042 pub fn set_or_clear_desired_master_authorized_networks_config<T>(
18043 mut self,
18044 v: std::option::Option<T>,
18045 ) -> Self
18046 where
18047 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
18048 {
18049 self.desired_master_authorized_networks_config = v.map(|x| x.into());
18050 self
18051 }
18052
18053 /// Sets the value of [desired_cluster_autoscaling][crate::model::ClusterUpdate::desired_cluster_autoscaling].
18054 ///
18055 /// # Example
18056 /// ```ignore,no_run
18057 /// # use google_cloud_container_v1::model::ClusterUpdate;
18058 /// use google_cloud_container_v1::model::ClusterAutoscaling;
18059 /// let x = ClusterUpdate::new().set_desired_cluster_autoscaling(ClusterAutoscaling::default()/* use setters */);
18060 /// ```
18061 pub fn set_desired_cluster_autoscaling<T>(mut self, v: T) -> Self
18062 where
18063 T: std::convert::Into<crate::model::ClusterAutoscaling>,
18064 {
18065 self.desired_cluster_autoscaling = std::option::Option::Some(v.into());
18066 self
18067 }
18068
18069 /// Sets or clears the value of [desired_cluster_autoscaling][crate::model::ClusterUpdate::desired_cluster_autoscaling].
18070 ///
18071 /// # Example
18072 /// ```ignore,no_run
18073 /// # use google_cloud_container_v1::model::ClusterUpdate;
18074 /// use google_cloud_container_v1::model::ClusterAutoscaling;
18075 /// let x = ClusterUpdate::new().set_or_clear_desired_cluster_autoscaling(Some(ClusterAutoscaling::default()/* use setters */));
18076 /// let x = ClusterUpdate::new().set_or_clear_desired_cluster_autoscaling(None::<ClusterAutoscaling>);
18077 /// ```
18078 pub fn set_or_clear_desired_cluster_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
18079 where
18080 T: std::convert::Into<crate::model::ClusterAutoscaling>,
18081 {
18082 self.desired_cluster_autoscaling = v.map(|x| x.into());
18083 self
18084 }
18085
18086 /// Sets the value of [desired_binary_authorization][crate::model::ClusterUpdate::desired_binary_authorization].
18087 ///
18088 /// # Example
18089 /// ```ignore,no_run
18090 /// # use google_cloud_container_v1::model::ClusterUpdate;
18091 /// use google_cloud_container_v1::model::BinaryAuthorization;
18092 /// let x = ClusterUpdate::new().set_desired_binary_authorization(BinaryAuthorization::default()/* use setters */);
18093 /// ```
18094 pub fn set_desired_binary_authorization<T>(mut self, v: T) -> Self
18095 where
18096 T: std::convert::Into<crate::model::BinaryAuthorization>,
18097 {
18098 self.desired_binary_authorization = std::option::Option::Some(v.into());
18099 self
18100 }
18101
18102 /// Sets or clears the value of [desired_binary_authorization][crate::model::ClusterUpdate::desired_binary_authorization].
18103 ///
18104 /// # Example
18105 /// ```ignore,no_run
18106 /// # use google_cloud_container_v1::model::ClusterUpdate;
18107 /// use google_cloud_container_v1::model::BinaryAuthorization;
18108 /// let x = ClusterUpdate::new().set_or_clear_desired_binary_authorization(Some(BinaryAuthorization::default()/* use setters */));
18109 /// let x = ClusterUpdate::new().set_or_clear_desired_binary_authorization(None::<BinaryAuthorization>);
18110 /// ```
18111 pub fn set_or_clear_desired_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
18112 where
18113 T: std::convert::Into<crate::model::BinaryAuthorization>,
18114 {
18115 self.desired_binary_authorization = v.map(|x| x.into());
18116 self
18117 }
18118
18119 /// Sets the value of [desired_logging_service][crate::model::ClusterUpdate::desired_logging_service].
18120 ///
18121 /// # Example
18122 /// ```ignore,no_run
18123 /// # use google_cloud_container_v1::model::ClusterUpdate;
18124 /// let x = ClusterUpdate::new().set_desired_logging_service("example");
18125 /// ```
18126 pub fn set_desired_logging_service<T: std::convert::Into<std::string::String>>(
18127 mut self,
18128 v: T,
18129 ) -> Self {
18130 self.desired_logging_service = v.into();
18131 self
18132 }
18133
18134 /// Sets the value of [desired_resource_usage_export_config][crate::model::ClusterUpdate::desired_resource_usage_export_config].
18135 ///
18136 /// # Example
18137 /// ```ignore,no_run
18138 /// # use google_cloud_container_v1::model::ClusterUpdate;
18139 /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
18140 /// let x = ClusterUpdate::new().set_desired_resource_usage_export_config(ResourceUsageExportConfig::default()/* use setters */);
18141 /// ```
18142 pub fn set_desired_resource_usage_export_config<T>(mut self, v: T) -> Self
18143 where
18144 T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
18145 {
18146 self.desired_resource_usage_export_config = std::option::Option::Some(v.into());
18147 self
18148 }
18149
18150 /// Sets or clears the value of [desired_resource_usage_export_config][crate::model::ClusterUpdate::desired_resource_usage_export_config].
18151 ///
18152 /// # Example
18153 /// ```ignore,no_run
18154 /// # use google_cloud_container_v1::model::ClusterUpdate;
18155 /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
18156 /// let x = ClusterUpdate::new().set_or_clear_desired_resource_usage_export_config(Some(ResourceUsageExportConfig::default()/* use setters */));
18157 /// let x = ClusterUpdate::new().set_or_clear_desired_resource_usage_export_config(None::<ResourceUsageExportConfig>);
18158 /// ```
18159 pub fn set_or_clear_desired_resource_usage_export_config<T>(
18160 mut self,
18161 v: std::option::Option<T>,
18162 ) -> Self
18163 where
18164 T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
18165 {
18166 self.desired_resource_usage_export_config = v.map(|x| x.into());
18167 self
18168 }
18169
18170 /// Sets the value of [desired_vertical_pod_autoscaling][crate::model::ClusterUpdate::desired_vertical_pod_autoscaling].
18171 ///
18172 /// # Example
18173 /// ```ignore,no_run
18174 /// # use google_cloud_container_v1::model::ClusterUpdate;
18175 /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
18176 /// let x = ClusterUpdate::new().set_desired_vertical_pod_autoscaling(VerticalPodAutoscaling::default()/* use setters */);
18177 /// ```
18178 pub fn set_desired_vertical_pod_autoscaling<T>(mut self, v: T) -> Self
18179 where
18180 T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
18181 {
18182 self.desired_vertical_pod_autoscaling = std::option::Option::Some(v.into());
18183 self
18184 }
18185
18186 /// Sets or clears the value of [desired_vertical_pod_autoscaling][crate::model::ClusterUpdate::desired_vertical_pod_autoscaling].
18187 ///
18188 /// # Example
18189 /// ```ignore,no_run
18190 /// # use google_cloud_container_v1::model::ClusterUpdate;
18191 /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
18192 /// let x = ClusterUpdate::new().set_or_clear_desired_vertical_pod_autoscaling(Some(VerticalPodAutoscaling::default()/* use setters */));
18193 /// let x = ClusterUpdate::new().set_or_clear_desired_vertical_pod_autoscaling(None::<VerticalPodAutoscaling>);
18194 /// ```
18195 pub fn set_or_clear_desired_vertical_pod_autoscaling<T>(
18196 mut self,
18197 v: std::option::Option<T>,
18198 ) -> Self
18199 where
18200 T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
18201 {
18202 self.desired_vertical_pod_autoscaling = v.map(|x| x.into());
18203 self
18204 }
18205
18206 /// Sets the value of [desired_private_cluster_config][crate::model::ClusterUpdate::desired_private_cluster_config].
18207 ///
18208 /// # Example
18209 /// ```ignore,no_run
18210 /// # use google_cloud_container_v1::model::ClusterUpdate;
18211 /// use google_cloud_container_v1::model::PrivateClusterConfig;
18212 /// let x = ClusterUpdate::new().set_desired_private_cluster_config(PrivateClusterConfig::default()/* use setters */);
18213 /// ```
18214 #[deprecated]
18215 pub fn set_desired_private_cluster_config<T>(mut self, v: T) -> Self
18216 where
18217 T: std::convert::Into<crate::model::PrivateClusterConfig>,
18218 {
18219 self.desired_private_cluster_config = std::option::Option::Some(v.into());
18220 self
18221 }
18222
18223 /// Sets or clears the value of [desired_private_cluster_config][crate::model::ClusterUpdate::desired_private_cluster_config].
18224 ///
18225 /// # Example
18226 /// ```ignore,no_run
18227 /// # use google_cloud_container_v1::model::ClusterUpdate;
18228 /// use google_cloud_container_v1::model::PrivateClusterConfig;
18229 /// let x = ClusterUpdate::new().set_or_clear_desired_private_cluster_config(Some(PrivateClusterConfig::default()/* use setters */));
18230 /// let x = ClusterUpdate::new().set_or_clear_desired_private_cluster_config(None::<PrivateClusterConfig>);
18231 /// ```
18232 #[deprecated]
18233 pub fn set_or_clear_desired_private_cluster_config<T>(
18234 mut self,
18235 v: std::option::Option<T>,
18236 ) -> Self
18237 where
18238 T: std::convert::Into<crate::model::PrivateClusterConfig>,
18239 {
18240 self.desired_private_cluster_config = v.map(|x| x.into());
18241 self
18242 }
18243
18244 /// Sets the value of [desired_intra_node_visibility_config][crate::model::ClusterUpdate::desired_intra_node_visibility_config].
18245 ///
18246 /// # Example
18247 /// ```ignore,no_run
18248 /// # use google_cloud_container_v1::model::ClusterUpdate;
18249 /// use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
18250 /// let x = ClusterUpdate::new().set_desired_intra_node_visibility_config(IntraNodeVisibilityConfig::default()/* use setters */);
18251 /// ```
18252 pub fn set_desired_intra_node_visibility_config<T>(mut self, v: T) -> Self
18253 where
18254 T: std::convert::Into<crate::model::IntraNodeVisibilityConfig>,
18255 {
18256 self.desired_intra_node_visibility_config = std::option::Option::Some(v.into());
18257 self
18258 }
18259
18260 /// Sets or clears the value of [desired_intra_node_visibility_config][crate::model::ClusterUpdate::desired_intra_node_visibility_config].
18261 ///
18262 /// # Example
18263 /// ```ignore,no_run
18264 /// # use google_cloud_container_v1::model::ClusterUpdate;
18265 /// use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
18266 /// let x = ClusterUpdate::new().set_or_clear_desired_intra_node_visibility_config(Some(IntraNodeVisibilityConfig::default()/* use setters */));
18267 /// let x = ClusterUpdate::new().set_or_clear_desired_intra_node_visibility_config(None::<IntraNodeVisibilityConfig>);
18268 /// ```
18269 pub fn set_or_clear_desired_intra_node_visibility_config<T>(
18270 mut self,
18271 v: std::option::Option<T>,
18272 ) -> Self
18273 where
18274 T: std::convert::Into<crate::model::IntraNodeVisibilityConfig>,
18275 {
18276 self.desired_intra_node_visibility_config = v.map(|x| x.into());
18277 self
18278 }
18279
18280 /// Sets the value of [desired_default_snat_status][crate::model::ClusterUpdate::desired_default_snat_status].
18281 ///
18282 /// # Example
18283 /// ```ignore,no_run
18284 /// # use google_cloud_container_v1::model::ClusterUpdate;
18285 /// use google_cloud_container_v1::model::DefaultSnatStatus;
18286 /// let x = ClusterUpdate::new().set_desired_default_snat_status(DefaultSnatStatus::default()/* use setters */);
18287 /// ```
18288 pub fn set_desired_default_snat_status<T>(mut self, v: T) -> Self
18289 where
18290 T: std::convert::Into<crate::model::DefaultSnatStatus>,
18291 {
18292 self.desired_default_snat_status = std::option::Option::Some(v.into());
18293 self
18294 }
18295
18296 /// Sets or clears the value of [desired_default_snat_status][crate::model::ClusterUpdate::desired_default_snat_status].
18297 ///
18298 /// # Example
18299 /// ```ignore,no_run
18300 /// # use google_cloud_container_v1::model::ClusterUpdate;
18301 /// use google_cloud_container_v1::model::DefaultSnatStatus;
18302 /// let x = ClusterUpdate::new().set_or_clear_desired_default_snat_status(Some(DefaultSnatStatus::default()/* use setters */));
18303 /// let x = ClusterUpdate::new().set_or_clear_desired_default_snat_status(None::<DefaultSnatStatus>);
18304 /// ```
18305 pub fn set_or_clear_desired_default_snat_status<T>(mut self, v: std::option::Option<T>) -> Self
18306 where
18307 T: std::convert::Into<crate::model::DefaultSnatStatus>,
18308 {
18309 self.desired_default_snat_status = v.map(|x| x.into());
18310 self
18311 }
18312
18313 /// Sets the value of [desired_release_channel][crate::model::ClusterUpdate::desired_release_channel].
18314 ///
18315 /// # Example
18316 /// ```ignore,no_run
18317 /// # use google_cloud_container_v1::model::ClusterUpdate;
18318 /// use google_cloud_container_v1::model::ReleaseChannel;
18319 /// let x = ClusterUpdate::new().set_desired_release_channel(ReleaseChannel::default()/* use setters */);
18320 /// ```
18321 pub fn set_desired_release_channel<T>(mut self, v: T) -> Self
18322 where
18323 T: std::convert::Into<crate::model::ReleaseChannel>,
18324 {
18325 self.desired_release_channel = std::option::Option::Some(v.into());
18326 self
18327 }
18328
18329 /// Sets or clears the value of [desired_release_channel][crate::model::ClusterUpdate::desired_release_channel].
18330 ///
18331 /// # Example
18332 /// ```ignore,no_run
18333 /// # use google_cloud_container_v1::model::ClusterUpdate;
18334 /// use google_cloud_container_v1::model::ReleaseChannel;
18335 /// let x = ClusterUpdate::new().set_or_clear_desired_release_channel(Some(ReleaseChannel::default()/* use setters */));
18336 /// let x = ClusterUpdate::new().set_or_clear_desired_release_channel(None::<ReleaseChannel>);
18337 /// ```
18338 pub fn set_or_clear_desired_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
18339 where
18340 T: std::convert::Into<crate::model::ReleaseChannel>,
18341 {
18342 self.desired_release_channel = v.map(|x| x.into());
18343 self
18344 }
18345
18346 /// Sets the value of [desired_l4ilb_subsetting_config][crate::model::ClusterUpdate::desired_l4ilb_subsetting_config].
18347 ///
18348 /// # Example
18349 /// ```ignore,no_run
18350 /// # use google_cloud_container_v1::model::ClusterUpdate;
18351 /// use google_cloud_container_v1::model::ILBSubsettingConfig;
18352 /// let x = ClusterUpdate::new().set_desired_l4ilb_subsetting_config(ILBSubsettingConfig::default()/* use setters */);
18353 /// ```
18354 pub fn set_desired_l4ilb_subsetting_config<T>(mut self, v: T) -> Self
18355 where
18356 T: std::convert::Into<crate::model::ILBSubsettingConfig>,
18357 {
18358 self.desired_l4ilb_subsetting_config = std::option::Option::Some(v.into());
18359 self
18360 }
18361
18362 /// Sets or clears the value of [desired_l4ilb_subsetting_config][crate::model::ClusterUpdate::desired_l4ilb_subsetting_config].
18363 ///
18364 /// # Example
18365 /// ```ignore,no_run
18366 /// # use google_cloud_container_v1::model::ClusterUpdate;
18367 /// use google_cloud_container_v1::model::ILBSubsettingConfig;
18368 /// let x = ClusterUpdate::new().set_or_clear_desired_l4ilb_subsetting_config(Some(ILBSubsettingConfig::default()/* use setters */));
18369 /// let x = ClusterUpdate::new().set_or_clear_desired_l4ilb_subsetting_config(None::<ILBSubsettingConfig>);
18370 /// ```
18371 pub fn set_or_clear_desired_l4ilb_subsetting_config<T>(
18372 mut self,
18373 v: std::option::Option<T>,
18374 ) -> Self
18375 where
18376 T: std::convert::Into<crate::model::ILBSubsettingConfig>,
18377 {
18378 self.desired_l4ilb_subsetting_config = v.map(|x| x.into());
18379 self
18380 }
18381
18382 /// Sets the value of [desired_datapath_provider][crate::model::ClusterUpdate::desired_datapath_provider].
18383 ///
18384 /// # Example
18385 /// ```ignore,no_run
18386 /// # use google_cloud_container_v1::model::ClusterUpdate;
18387 /// use google_cloud_container_v1::model::DatapathProvider;
18388 /// let x0 = ClusterUpdate::new().set_desired_datapath_provider(DatapathProvider::LegacyDatapath);
18389 /// let x1 = ClusterUpdate::new().set_desired_datapath_provider(DatapathProvider::AdvancedDatapath);
18390 /// ```
18391 pub fn set_desired_datapath_provider<T: std::convert::Into<crate::model::DatapathProvider>>(
18392 mut self,
18393 v: T,
18394 ) -> Self {
18395 self.desired_datapath_provider = v.into();
18396 self
18397 }
18398
18399 /// Sets the value of [desired_private_ipv6_google_access][crate::model::ClusterUpdate::desired_private_ipv6_google_access].
18400 ///
18401 /// # Example
18402 /// ```ignore,no_run
18403 /// # use google_cloud_container_v1::model::ClusterUpdate;
18404 /// use google_cloud_container_v1::model::PrivateIPv6GoogleAccess;
18405 /// let x0 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessDisabled);
18406 /// let x1 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessToGoogle);
18407 /// let x2 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessBidirectional);
18408 /// ```
18409 pub fn set_desired_private_ipv6_google_access<
18410 T: std::convert::Into<crate::model::PrivateIPv6GoogleAccess>,
18411 >(
18412 mut self,
18413 v: T,
18414 ) -> Self {
18415 self.desired_private_ipv6_google_access = v.into();
18416 self
18417 }
18418
18419 /// Sets the value of [desired_notification_config][crate::model::ClusterUpdate::desired_notification_config].
18420 ///
18421 /// # Example
18422 /// ```ignore,no_run
18423 /// # use google_cloud_container_v1::model::ClusterUpdate;
18424 /// use google_cloud_container_v1::model::NotificationConfig;
18425 /// let x = ClusterUpdate::new().set_desired_notification_config(NotificationConfig::default()/* use setters */);
18426 /// ```
18427 pub fn set_desired_notification_config<T>(mut self, v: T) -> Self
18428 where
18429 T: std::convert::Into<crate::model::NotificationConfig>,
18430 {
18431 self.desired_notification_config = std::option::Option::Some(v.into());
18432 self
18433 }
18434
18435 /// Sets or clears the value of [desired_notification_config][crate::model::ClusterUpdate::desired_notification_config].
18436 ///
18437 /// # Example
18438 /// ```ignore,no_run
18439 /// # use google_cloud_container_v1::model::ClusterUpdate;
18440 /// use google_cloud_container_v1::model::NotificationConfig;
18441 /// let x = ClusterUpdate::new().set_or_clear_desired_notification_config(Some(NotificationConfig::default()/* use setters */));
18442 /// let x = ClusterUpdate::new().set_or_clear_desired_notification_config(None::<NotificationConfig>);
18443 /// ```
18444 pub fn set_or_clear_desired_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
18445 where
18446 T: std::convert::Into<crate::model::NotificationConfig>,
18447 {
18448 self.desired_notification_config = v.map(|x| x.into());
18449 self
18450 }
18451
18452 /// Sets the value of [desired_authenticator_groups_config][crate::model::ClusterUpdate::desired_authenticator_groups_config].
18453 ///
18454 /// # Example
18455 /// ```ignore,no_run
18456 /// # use google_cloud_container_v1::model::ClusterUpdate;
18457 /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
18458 /// let x = ClusterUpdate::new().set_desired_authenticator_groups_config(AuthenticatorGroupsConfig::default()/* use setters */);
18459 /// ```
18460 pub fn set_desired_authenticator_groups_config<T>(mut self, v: T) -> Self
18461 where
18462 T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
18463 {
18464 self.desired_authenticator_groups_config = std::option::Option::Some(v.into());
18465 self
18466 }
18467
18468 /// Sets or clears the value of [desired_authenticator_groups_config][crate::model::ClusterUpdate::desired_authenticator_groups_config].
18469 ///
18470 /// # Example
18471 /// ```ignore,no_run
18472 /// # use google_cloud_container_v1::model::ClusterUpdate;
18473 /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
18474 /// let x = ClusterUpdate::new().set_or_clear_desired_authenticator_groups_config(Some(AuthenticatorGroupsConfig::default()/* use setters */));
18475 /// let x = ClusterUpdate::new().set_or_clear_desired_authenticator_groups_config(None::<AuthenticatorGroupsConfig>);
18476 /// ```
18477 pub fn set_or_clear_desired_authenticator_groups_config<T>(
18478 mut self,
18479 v: std::option::Option<T>,
18480 ) -> Self
18481 where
18482 T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
18483 {
18484 self.desired_authenticator_groups_config = v.map(|x| x.into());
18485 self
18486 }
18487
18488 /// Sets the value of [desired_logging_config][crate::model::ClusterUpdate::desired_logging_config].
18489 ///
18490 /// # Example
18491 /// ```ignore,no_run
18492 /// # use google_cloud_container_v1::model::ClusterUpdate;
18493 /// use google_cloud_container_v1::model::LoggingConfig;
18494 /// let x = ClusterUpdate::new().set_desired_logging_config(LoggingConfig::default()/* use setters */);
18495 /// ```
18496 pub fn set_desired_logging_config<T>(mut self, v: T) -> Self
18497 where
18498 T: std::convert::Into<crate::model::LoggingConfig>,
18499 {
18500 self.desired_logging_config = std::option::Option::Some(v.into());
18501 self
18502 }
18503
18504 /// Sets or clears the value of [desired_logging_config][crate::model::ClusterUpdate::desired_logging_config].
18505 ///
18506 /// # Example
18507 /// ```ignore,no_run
18508 /// # use google_cloud_container_v1::model::ClusterUpdate;
18509 /// use google_cloud_container_v1::model::LoggingConfig;
18510 /// let x = ClusterUpdate::new().set_or_clear_desired_logging_config(Some(LoggingConfig::default()/* use setters */));
18511 /// let x = ClusterUpdate::new().set_or_clear_desired_logging_config(None::<LoggingConfig>);
18512 /// ```
18513 pub fn set_or_clear_desired_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
18514 where
18515 T: std::convert::Into<crate::model::LoggingConfig>,
18516 {
18517 self.desired_logging_config = v.map(|x| x.into());
18518 self
18519 }
18520
18521 /// Sets the value of [desired_monitoring_config][crate::model::ClusterUpdate::desired_monitoring_config].
18522 ///
18523 /// # Example
18524 /// ```ignore,no_run
18525 /// # use google_cloud_container_v1::model::ClusterUpdate;
18526 /// use google_cloud_container_v1::model::MonitoringConfig;
18527 /// let x = ClusterUpdate::new().set_desired_monitoring_config(MonitoringConfig::default()/* use setters */);
18528 /// ```
18529 pub fn set_desired_monitoring_config<T>(mut self, v: T) -> Self
18530 where
18531 T: std::convert::Into<crate::model::MonitoringConfig>,
18532 {
18533 self.desired_monitoring_config = std::option::Option::Some(v.into());
18534 self
18535 }
18536
18537 /// Sets or clears the value of [desired_monitoring_config][crate::model::ClusterUpdate::desired_monitoring_config].
18538 ///
18539 /// # Example
18540 /// ```ignore,no_run
18541 /// # use google_cloud_container_v1::model::ClusterUpdate;
18542 /// use google_cloud_container_v1::model::MonitoringConfig;
18543 /// let x = ClusterUpdate::new().set_or_clear_desired_monitoring_config(Some(MonitoringConfig::default()/* use setters */));
18544 /// let x = ClusterUpdate::new().set_or_clear_desired_monitoring_config(None::<MonitoringConfig>);
18545 /// ```
18546 pub fn set_or_clear_desired_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
18547 where
18548 T: std::convert::Into<crate::model::MonitoringConfig>,
18549 {
18550 self.desired_monitoring_config = v.map(|x| x.into());
18551 self
18552 }
18553
18554 /// Sets the value of [desired_identity_service_config][crate::model::ClusterUpdate::desired_identity_service_config].
18555 ///
18556 /// # Example
18557 /// ```ignore,no_run
18558 /// # use google_cloud_container_v1::model::ClusterUpdate;
18559 /// use google_cloud_container_v1::model::IdentityServiceConfig;
18560 /// let x = ClusterUpdate::new().set_desired_identity_service_config(IdentityServiceConfig::default()/* use setters */);
18561 /// ```
18562 pub fn set_desired_identity_service_config<T>(mut self, v: T) -> Self
18563 where
18564 T: std::convert::Into<crate::model::IdentityServiceConfig>,
18565 {
18566 self.desired_identity_service_config = std::option::Option::Some(v.into());
18567 self
18568 }
18569
18570 /// Sets or clears the value of [desired_identity_service_config][crate::model::ClusterUpdate::desired_identity_service_config].
18571 ///
18572 /// # Example
18573 /// ```ignore,no_run
18574 /// # use google_cloud_container_v1::model::ClusterUpdate;
18575 /// use google_cloud_container_v1::model::IdentityServiceConfig;
18576 /// let x = ClusterUpdate::new().set_or_clear_desired_identity_service_config(Some(IdentityServiceConfig::default()/* use setters */));
18577 /// let x = ClusterUpdate::new().set_or_clear_desired_identity_service_config(None::<IdentityServiceConfig>);
18578 /// ```
18579 pub fn set_or_clear_desired_identity_service_config<T>(
18580 mut self,
18581 v: std::option::Option<T>,
18582 ) -> Self
18583 where
18584 T: std::convert::Into<crate::model::IdentityServiceConfig>,
18585 {
18586 self.desired_identity_service_config = v.map(|x| x.into());
18587 self
18588 }
18589
18590 /// Sets the value of [desired_service_external_ips_config][crate::model::ClusterUpdate::desired_service_external_ips_config].
18591 ///
18592 /// # Example
18593 /// ```ignore,no_run
18594 /// # use google_cloud_container_v1::model::ClusterUpdate;
18595 /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
18596 /// let x = ClusterUpdate::new().set_desired_service_external_ips_config(ServiceExternalIPsConfig::default()/* use setters */);
18597 /// ```
18598 pub fn set_desired_service_external_ips_config<T>(mut self, v: T) -> Self
18599 where
18600 T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
18601 {
18602 self.desired_service_external_ips_config = std::option::Option::Some(v.into());
18603 self
18604 }
18605
18606 /// Sets or clears the value of [desired_service_external_ips_config][crate::model::ClusterUpdate::desired_service_external_ips_config].
18607 ///
18608 /// # Example
18609 /// ```ignore,no_run
18610 /// # use google_cloud_container_v1::model::ClusterUpdate;
18611 /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
18612 /// let x = ClusterUpdate::new().set_or_clear_desired_service_external_ips_config(Some(ServiceExternalIPsConfig::default()/* use setters */));
18613 /// let x = ClusterUpdate::new().set_or_clear_desired_service_external_ips_config(None::<ServiceExternalIPsConfig>);
18614 /// ```
18615 pub fn set_or_clear_desired_service_external_ips_config<T>(
18616 mut self,
18617 v: std::option::Option<T>,
18618 ) -> Self
18619 where
18620 T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
18621 {
18622 self.desired_service_external_ips_config = v.map(|x| x.into());
18623 self
18624 }
18625
18626 /// Sets the value of [desired_enable_private_endpoint][crate::model::ClusterUpdate::desired_enable_private_endpoint].
18627 ///
18628 /// # Example
18629 /// ```ignore,no_run
18630 /// # use google_cloud_container_v1::model::ClusterUpdate;
18631 /// let x = ClusterUpdate::new().set_desired_enable_private_endpoint(true);
18632 /// ```
18633 #[deprecated]
18634 pub fn set_desired_enable_private_endpoint<T>(mut self, v: T) -> Self
18635 where
18636 T: std::convert::Into<bool>,
18637 {
18638 self.desired_enable_private_endpoint = std::option::Option::Some(v.into());
18639 self
18640 }
18641
18642 /// Sets or clears the value of [desired_enable_private_endpoint][crate::model::ClusterUpdate::desired_enable_private_endpoint].
18643 ///
18644 /// # Example
18645 /// ```ignore,no_run
18646 /// # use google_cloud_container_v1::model::ClusterUpdate;
18647 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_private_endpoint(Some(false));
18648 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_private_endpoint(None::<bool>);
18649 /// ```
18650 #[deprecated]
18651 pub fn set_or_clear_desired_enable_private_endpoint<T>(
18652 mut self,
18653 v: std::option::Option<T>,
18654 ) -> Self
18655 where
18656 T: std::convert::Into<bool>,
18657 {
18658 self.desired_enable_private_endpoint = v.map(|x| x.into());
18659 self
18660 }
18661
18662 /// Sets the value of [desired_default_enable_private_nodes][crate::model::ClusterUpdate::desired_default_enable_private_nodes].
18663 ///
18664 /// # Example
18665 /// ```ignore,no_run
18666 /// # use google_cloud_container_v1::model::ClusterUpdate;
18667 /// let x = ClusterUpdate::new().set_desired_default_enable_private_nodes(true);
18668 /// ```
18669 pub fn set_desired_default_enable_private_nodes<T>(mut self, v: T) -> Self
18670 where
18671 T: std::convert::Into<bool>,
18672 {
18673 self.desired_default_enable_private_nodes = std::option::Option::Some(v.into());
18674 self
18675 }
18676
18677 /// Sets or clears the value of [desired_default_enable_private_nodes][crate::model::ClusterUpdate::desired_default_enable_private_nodes].
18678 ///
18679 /// # Example
18680 /// ```ignore,no_run
18681 /// # use google_cloud_container_v1::model::ClusterUpdate;
18682 /// let x = ClusterUpdate::new().set_or_clear_desired_default_enable_private_nodes(Some(false));
18683 /// let x = ClusterUpdate::new().set_or_clear_desired_default_enable_private_nodes(None::<bool>);
18684 /// ```
18685 pub fn set_or_clear_desired_default_enable_private_nodes<T>(
18686 mut self,
18687 v: std::option::Option<T>,
18688 ) -> Self
18689 where
18690 T: std::convert::Into<bool>,
18691 {
18692 self.desired_default_enable_private_nodes = v.map(|x| x.into());
18693 self
18694 }
18695
18696 /// Sets the value of [desired_control_plane_endpoints_config][crate::model::ClusterUpdate::desired_control_plane_endpoints_config].
18697 ///
18698 /// # Example
18699 /// ```ignore,no_run
18700 /// # use google_cloud_container_v1::model::ClusterUpdate;
18701 /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
18702 /// let x = ClusterUpdate::new().set_desired_control_plane_endpoints_config(ControlPlaneEndpointsConfig::default()/* use setters */);
18703 /// ```
18704 pub fn set_desired_control_plane_endpoints_config<T>(mut self, v: T) -> Self
18705 where
18706 T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
18707 {
18708 self.desired_control_plane_endpoints_config = std::option::Option::Some(v.into());
18709 self
18710 }
18711
18712 /// Sets or clears the value of [desired_control_plane_endpoints_config][crate::model::ClusterUpdate::desired_control_plane_endpoints_config].
18713 ///
18714 /// # Example
18715 /// ```ignore,no_run
18716 /// # use google_cloud_container_v1::model::ClusterUpdate;
18717 /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
18718 /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_endpoints_config(Some(ControlPlaneEndpointsConfig::default()/* use setters */));
18719 /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_endpoints_config(None::<ControlPlaneEndpointsConfig>);
18720 /// ```
18721 pub fn set_or_clear_desired_control_plane_endpoints_config<T>(
18722 mut self,
18723 v: std::option::Option<T>,
18724 ) -> Self
18725 where
18726 T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
18727 {
18728 self.desired_control_plane_endpoints_config = v.map(|x| x.into());
18729 self
18730 }
18731
18732 /// Sets the value of [desired_master_version][crate::model::ClusterUpdate::desired_master_version].
18733 ///
18734 /// # Example
18735 /// ```ignore,no_run
18736 /// # use google_cloud_container_v1::model::ClusterUpdate;
18737 /// let x = ClusterUpdate::new().set_desired_master_version("example");
18738 /// ```
18739 pub fn set_desired_master_version<T: std::convert::Into<std::string::String>>(
18740 mut self,
18741 v: T,
18742 ) -> Self {
18743 self.desired_master_version = v.into();
18744 self
18745 }
18746
18747 /// Sets the value of [desired_gcfs_config][crate::model::ClusterUpdate::desired_gcfs_config].
18748 ///
18749 /// # Example
18750 /// ```ignore,no_run
18751 /// # use google_cloud_container_v1::model::ClusterUpdate;
18752 /// use google_cloud_container_v1::model::GcfsConfig;
18753 /// let x = ClusterUpdate::new().set_desired_gcfs_config(GcfsConfig::default()/* use setters */);
18754 /// ```
18755 pub fn set_desired_gcfs_config<T>(mut self, v: T) -> Self
18756 where
18757 T: std::convert::Into<crate::model::GcfsConfig>,
18758 {
18759 self.desired_gcfs_config = std::option::Option::Some(v.into());
18760 self
18761 }
18762
18763 /// Sets or clears the value of [desired_gcfs_config][crate::model::ClusterUpdate::desired_gcfs_config].
18764 ///
18765 /// # Example
18766 /// ```ignore,no_run
18767 /// # use google_cloud_container_v1::model::ClusterUpdate;
18768 /// use google_cloud_container_v1::model::GcfsConfig;
18769 /// let x = ClusterUpdate::new().set_or_clear_desired_gcfs_config(Some(GcfsConfig::default()/* use setters */));
18770 /// let x = ClusterUpdate::new().set_or_clear_desired_gcfs_config(None::<GcfsConfig>);
18771 /// ```
18772 pub fn set_or_clear_desired_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
18773 where
18774 T: std::convert::Into<crate::model::GcfsConfig>,
18775 {
18776 self.desired_gcfs_config = v.map(|x| x.into());
18777 self
18778 }
18779
18780 /// Sets the value of [desired_node_pool_auto_config_network_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_network_tags].
18781 ///
18782 /// # Example
18783 /// ```ignore,no_run
18784 /// # use google_cloud_container_v1::model::ClusterUpdate;
18785 /// use google_cloud_container_v1::model::NetworkTags;
18786 /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_network_tags(NetworkTags::default()/* use setters */);
18787 /// ```
18788 pub fn set_desired_node_pool_auto_config_network_tags<T>(mut self, v: T) -> Self
18789 where
18790 T: std::convert::Into<crate::model::NetworkTags>,
18791 {
18792 self.desired_node_pool_auto_config_network_tags = std::option::Option::Some(v.into());
18793 self
18794 }
18795
18796 /// Sets or clears the value of [desired_node_pool_auto_config_network_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_network_tags].
18797 ///
18798 /// # Example
18799 /// ```ignore,no_run
18800 /// # use google_cloud_container_v1::model::ClusterUpdate;
18801 /// use google_cloud_container_v1::model::NetworkTags;
18802 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_network_tags(Some(NetworkTags::default()/* use setters */));
18803 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_network_tags(None::<NetworkTags>);
18804 /// ```
18805 pub fn set_or_clear_desired_node_pool_auto_config_network_tags<T>(
18806 mut self,
18807 v: std::option::Option<T>,
18808 ) -> Self
18809 where
18810 T: std::convert::Into<crate::model::NetworkTags>,
18811 {
18812 self.desired_node_pool_auto_config_network_tags = v.map(|x| x.into());
18813 self
18814 }
18815
18816 /// Sets the value of [desired_pod_autoscaling][crate::model::ClusterUpdate::desired_pod_autoscaling].
18817 ///
18818 /// # Example
18819 /// ```ignore,no_run
18820 /// # use google_cloud_container_v1::model::ClusterUpdate;
18821 /// use google_cloud_container_v1::model::PodAutoscaling;
18822 /// let x = ClusterUpdate::new().set_desired_pod_autoscaling(PodAutoscaling::default()/* use setters */);
18823 /// ```
18824 pub fn set_desired_pod_autoscaling<T>(mut self, v: T) -> Self
18825 where
18826 T: std::convert::Into<crate::model::PodAutoscaling>,
18827 {
18828 self.desired_pod_autoscaling = std::option::Option::Some(v.into());
18829 self
18830 }
18831
18832 /// Sets or clears the value of [desired_pod_autoscaling][crate::model::ClusterUpdate::desired_pod_autoscaling].
18833 ///
18834 /// # Example
18835 /// ```ignore,no_run
18836 /// # use google_cloud_container_v1::model::ClusterUpdate;
18837 /// use google_cloud_container_v1::model::PodAutoscaling;
18838 /// let x = ClusterUpdate::new().set_or_clear_desired_pod_autoscaling(Some(PodAutoscaling::default()/* use setters */));
18839 /// let x = ClusterUpdate::new().set_or_clear_desired_pod_autoscaling(None::<PodAutoscaling>);
18840 /// ```
18841 pub fn set_or_clear_desired_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
18842 where
18843 T: std::convert::Into<crate::model::PodAutoscaling>,
18844 {
18845 self.desired_pod_autoscaling = v.map(|x| x.into());
18846 self
18847 }
18848
18849 /// Sets the value of [desired_gateway_api_config][crate::model::ClusterUpdate::desired_gateway_api_config].
18850 ///
18851 /// # Example
18852 /// ```ignore,no_run
18853 /// # use google_cloud_container_v1::model::ClusterUpdate;
18854 /// use google_cloud_container_v1::model::GatewayAPIConfig;
18855 /// let x = ClusterUpdate::new().set_desired_gateway_api_config(GatewayAPIConfig::default()/* use setters */);
18856 /// ```
18857 pub fn set_desired_gateway_api_config<T>(mut self, v: T) -> Self
18858 where
18859 T: std::convert::Into<crate::model::GatewayAPIConfig>,
18860 {
18861 self.desired_gateway_api_config = std::option::Option::Some(v.into());
18862 self
18863 }
18864
18865 /// Sets or clears the value of [desired_gateway_api_config][crate::model::ClusterUpdate::desired_gateway_api_config].
18866 ///
18867 /// # Example
18868 /// ```ignore,no_run
18869 /// # use google_cloud_container_v1::model::ClusterUpdate;
18870 /// use google_cloud_container_v1::model::GatewayAPIConfig;
18871 /// let x = ClusterUpdate::new().set_or_clear_desired_gateway_api_config(Some(GatewayAPIConfig::default()/* use setters */));
18872 /// let x = ClusterUpdate::new().set_or_clear_desired_gateway_api_config(None::<GatewayAPIConfig>);
18873 /// ```
18874 pub fn set_or_clear_desired_gateway_api_config<T>(mut self, v: std::option::Option<T>) -> Self
18875 where
18876 T: std::convert::Into<crate::model::GatewayAPIConfig>,
18877 {
18878 self.desired_gateway_api_config = v.map(|x| x.into());
18879 self
18880 }
18881
18882 /// Sets the value of [etag][crate::model::ClusterUpdate::etag].
18883 ///
18884 /// # Example
18885 /// ```ignore,no_run
18886 /// # use google_cloud_container_v1::model::ClusterUpdate;
18887 /// let x = ClusterUpdate::new().set_etag("example");
18888 /// ```
18889 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18890 self.etag = v.into();
18891 self
18892 }
18893
18894 /// Sets the value of [desired_node_pool_logging_config][crate::model::ClusterUpdate::desired_node_pool_logging_config].
18895 ///
18896 /// # Example
18897 /// ```ignore,no_run
18898 /// # use google_cloud_container_v1::model::ClusterUpdate;
18899 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
18900 /// let x = ClusterUpdate::new().set_desired_node_pool_logging_config(NodePoolLoggingConfig::default()/* use setters */);
18901 /// ```
18902 pub fn set_desired_node_pool_logging_config<T>(mut self, v: T) -> Self
18903 where
18904 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
18905 {
18906 self.desired_node_pool_logging_config = std::option::Option::Some(v.into());
18907 self
18908 }
18909
18910 /// Sets or clears the value of [desired_node_pool_logging_config][crate::model::ClusterUpdate::desired_node_pool_logging_config].
18911 ///
18912 /// # Example
18913 /// ```ignore,no_run
18914 /// # use google_cloud_container_v1::model::ClusterUpdate;
18915 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
18916 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
18917 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_logging_config(None::<NodePoolLoggingConfig>);
18918 /// ```
18919 pub fn set_or_clear_desired_node_pool_logging_config<T>(
18920 mut self,
18921 v: std::option::Option<T>,
18922 ) -> Self
18923 where
18924 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
18925 {
18926 self.desired_node_pool_logging_config = v.map(|x| x.into());
18927 self
18928 }
18929
18930 /// Sets the value of [desired_fleet][crate::model::ClusterUpdate::desired_fleet].
18931 ///
18932 /// # Example
18933 /// ```ignore,no_run
18934 /// # use google_cloud_container_v1::model::ClusterUpdate;
18935 /// use google_cloud_container_v1::model::Fleet;
18936 /// let x = ClusterUpdate::new().set_desired_fleet(Fleet::default()/* use setters */);
18937 /// ```
18938 pub fn set_desired_fleet<T>(mut self, v: T) -> Self
18939 where
18940 T: std::convert::Into<crate::model::Fleet>,
18941 {
18942 self.desired_fleet = std::option::Option::Some(v.into());
18943 self
18944 }
18945
18946 /// Sets or clears the value of [desired_fleet][crate::model::ClusterUpdate::desired_fleet].
18947 ///
18948 /// # Example
18949 /// ```ignore,no_run
18950 /// # use google_cloud_container_v1::model::ClusterUpdate;
18951 /// use google_cloud_container_v1::model::Fleet;
18952 /// let x = ClusterUpdate::new().set_or_clear_desired_fleet(Some(Fleet::default()/* use setters */));
18953 /// let x = ClusterUpdate::new().set_or_clear_desired_fleet(None::<Fleet>);
18954 /// ```
18955 pub fn set_or_clear_desired_fleet<T>(mut self, v: std::option::Option<T>) -> Self
18956 where
18957 T: std::convert::Into<crate::model::Fleet>,
18958 {
18959 self.desired_fleet = v.map(|x| x.into());
18960 self
18961 }
18962
18963 /// Sets the value of [desired_stack_type][crate::model::ClusterUpdate::desired_stack_type].
18964 ///
18965 /// # Example
18966 /// ```ignore,no_run
18967 /// # use google_cloud_container_v1::model::ClusterUpdate;
18968 /// use google_cloud_container_v1::model::StackType;
18969 /// let x0 = ClusterUpdate::new().set_desired_stack_type(StackType::Ipv4);
18970 /// let x1 = ClusterUpdate::new().set_desired_stack_type(StackType::Ipv4Ipv6);
18971 /// ```
18972 pub fn set_desired_stack_type<T: std::convert::Into<crate::model::StackType>>(
18973 mut self,
18974 v: T,
18975 ) -> Self {
18976 self.desired_stack_type = v.into();
18977 self
18978 }
18979
18980 /// Sets the value of [additional_pod_ranges_config][crate::model::ClusterUpdate::additional_pod_ranges_config].
18981 ///
18982 /// # Example
18983 /// ```ignore,no_run
18984 /// # use google_cloud_container_v1::model::ClusterUpdate;
18985 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
18986 /// let x = ClusterUpdate::new().set_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
18987 /// ```
18988 pub fn set_additional_pod_ranges_config<T>(mut self, v: T) -> Self
18989 where
18990 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
18991 {
18992 self.additional_pod_ranges_config = std::option::Option::Some(v.into());
18993 self
18994 }
18995
18996 /// Sets or clears the value of [additional_pod_ranges_config][crate::model::ClusterUpdate::additional_pod_ranges_config].
18997 ///
18998 /// # Example
18999 /// ```ignore,no_run
19000 /// # use google_cloud_container_v1::model::ClusterUpdate;
19001 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
19002 /// let x = ClusterUpdate::new().set_or_clear_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
19003 /// let x = ClusterUpdate::new().set_or_clear_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
19004 /// ```
19005 pub fn set_or_clear_additional_pod_ranges_config<T>(mut self, v: std::option::Option<T>) -> Self
19006 where
19007 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
19008 {
19009 self.additional_pod_ranges_config = v.map(|x| x.into());
19010 self
19011 }
19012
19013 /// Sets the value of [removed_additional_pod_ranges_config][crate::model::ClusterUpdate::removed_additional_pod_ranges_config].
19014 ///
19015 /// # Example
19016 /// ```ignore,no_run
19017 /// # use google_cloud_container_v1::model::ClusterUpdate;
19018 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
19019 /// let x = ClusterUpdate::new().set_removed_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
19020 /// ```
19021 pub fn set_removed_additional_pod_ranges_config<T>(mut self, v: T) -> Self
19022 where
19023 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
19024 {
19025 self.removed_additional_pod_ranges_config = std::option::Option::Some(v.into());
19026 self
19027 }
19028
19029 /// Sets or clears the value of [removed_additional_pod_ranges_config][crate::model::ClusterUpdate::removed_additional_pod_ranges_config].
19030 ///
19031 /// # Example
19032 /// ```ignore,no_run
19033 /// # use google_cloud_container_v1::model::ClusterUpdate;
19034 /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
19035 /// let x = ClusterUpdate::new().set_or_clear_removed_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
19036 /// let x = ClusterUpdate::new().set_or_clear_removed_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
19037 /// ```
19038 pub fn set_or_clear_removed_additional_pod_ranges_config<T>(
19039 mut self,
19040 v: std::option::Option<T>,
19041 ) -> Self
19042 where
19043 T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
19044 {
19045 self.removed_additional_pod_ranges_config = v.map(|x| x.into());
19046 self
19047 }
19048
19049 /// Sets the value of [enable_k8s_beta_apis][crate::model::ClusterUpdate::enable_k8s_beta_apis].
19050 ///
19051 /// # Example
19052 /// ```ignore,no_run
19053 /// # use google_cloud_container_v1::model::ClusterUpdate;
19054 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
19055 /// let x = ClusterUpdate::new().set_enable_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
19056 /// ```
19057 pub fn set_enable_k8s_beta_apis<T>(mut self, v: T) -> Self
19058 where
19059 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
19060 {
19061 self.enable_k8s_beta_apis = std::option::Option::Some(v.into());
19062 self
19063 }
19064
19065 /// Sets or clears the value of [enable_k8s_beta_apis][crate::model::ClusterUpdate::enable_k8s_beta_apis].
19066 ///
19067 /// # Example
19068 /// ```ignore,no_run
19069 /// # use google_cloud_container_v1::model::ClusterUpdate;
19070 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
19071 /// let x = ClusterUpdate::new().set_or_clear_enable_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
19072 /// let x = ClusterUpdate::new().set_or_clear_enable_k8s_beta_apis(None::<K8sBetaAPIConfig>);
19073 /// ```
19074 pub fn set_or_clear_enable_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
19075 where
19076 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
19077 {
19078 self.enable_k8s_beta_apis = v.map(|x| x.into());
19079 self
19080 }
19081
19082 /// Sets the value of [desired_security_posture_config][crate::model::ClusterUpdate::desired_security_posture_config].
19083 ///
19084 /// # Example
19085 /// ```ignore,no_run
19086 /// # use google_cloud_container_v1::model::ClusterUpdate;
19087 /// use google_cloud_container_v1::model::SecurityPostureConfig;
19088 /// let x = ClusterUpdate::new().set_desired_security_posture_config(SecurityPostureConfig::default()/* use setters */);
19089 /// ```
19090 pub fn set_desired_security_posture_config<T>(mut self, v: T) -> Self
19091 where
19092 T: std::convert::Into<crate::model::SecurityPostureConfig>,
19093 {
19094 self.desired_security_posture_config = std::option::Option::Some(v.into());
19095 self
19096 }
19097
19098 /// Sets or clears the value of [desired_security_posture_config][crate::model::ClusterUpdate::desired_security_posture_config].
19099 ///
19100 /// # Example
19101 /// ```ignore,no_run
19102 /// # use google_cloud_container_v1::model::ClusterUpdate;
19103 /// use google_cloud_container_v1::model::SecurityPostureConfig;
19104 /// let x = ClusterUpdate::new().set_or_clear_desired_security_posture_config(Some(SecurityPostureConfig::default()/* use setters */));
19105 /// let x = ClusterUpdate::new().set_or_clear_desired_security_posture_config(None::<SecurityPostureConfig>);
19106 /// ```
19107 pub fn set_or_clear_desired_security_posture_config<T>(
19108 mut self,
19109 v: std::option::Option<T>,
19110 ) -> Self
19111 where
19112 T: std::convert::Into<crate::model::SecurityPostureConfig>,
19113 {
19114 self.desired_security_posture_config = v.map(|x| x.into());
19115 self
19116 }
19117
19118 /// Sets the value of [desired_network_performance_config][crate::model::ClusterUpdate::desired_network_performance_config].
19119 ///
19120 /// # Example
19121 /// ```ignore,no_run
19122 /// # use google_cloud_container_v1::model::ClusterUpdate;
19123 /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
19124 /// let x = ClusterUpdate::new().set_desired_network_performance_config(ClusterNetworkPerformanceConfig::default()/* use setters */);
19125 /// ```
19126 pub fn set_desired_network_performance_config<T>(mut self, v: T) -> Self
19127 where
19128 T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
19129 {
19130 self.desired_network_performance_config = std::option::Option::Some(v.into());
19131 self
19132 }
19133
19134 /// Sets or clears the value of [desired_network_performance_config][crate::model::ClusterUpdate::desired_network_performance_config].
19135 ///
19136 /// # Example
19137 /// ```ignore,no_run
19138 /// # use google_cloud_container_v1::model::ClusterUpdate;
19139 /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
19140 /// let x = ClusterUpdate::new().set_or_clear_desired_network_performance_config(Some(ClusterNetworkPerformanceConfig::default()/* use setters */));
19141 /// let x = ClusterUpdate::new().set_or_clear_desired_network_performance_config(None::<ClusterNetworkPerformanceConfig>);
19142 /// ```
19143 pub fn set_or_clear_desired_network_performance_config<T>(
19144 mut self,
19145 v: std::option::Option<T>,
19146 ) -> Self
19147 where
19148 T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
19149 {
19150 self.desired_network_performance_config = v.map(|x| x.into());
19151 self
19152 }
19153
19154 /// Sets the value of [desired_enable_fqdn_network_policy][crate::model::ClusterUpdate::desired_enable_fqdn_network_policy].
19155 ///
19156 /// # Example
19157 /// ```ignore,no_run
19158 /// # use google_cloud_container_v1::model::ClusterUpdate;
19159 /// let x = ClusterUpdate::new().set_desired_enable_fqdn_network_policy(true);
19160 /// ```
19161 pub fn set_desired_enable_fqdn_network_policy<T>(mut self, v: T) -> Self
19162 where
19163 T: std::convert::Into<bool>,
19164 {
19165 self.desired_enable_fqdn_network_policy = std::option::Option::Some(v.into());
19166 self
19167 }
19168
19169 /// Sets or clears the value of [desired_enable_fqdn_network_policy][crate::model::ClusterUpdate::desired_enable_fqdn_network_policy].
19170 ///
19171 /// # Example
19172 /// ```ignore,no_run
19173 /// # use google_cloud_container_v1::model::ClusterUpdate;
19174 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_fqdn_network_policy(Some(false));
19175 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_fqdn_network_policy(None::<bool>);
19176 /// ```
19177 pub fn set_or_clear_desired_enable_fqdn_network_policy<T>(
19178 mut self,
19179 v: std::option::Option<T>,
19180 ) -> Self
19181 where
19182 T: std::convert::Into<bool>,
19183 {
19184 self.desired_enable_fqdn_network_policy = v.map(|x| x.into());
19185 self
19186 }
19187
19188 /// Sets the value of [desired_autopilot_workload_policy_config][crate::model::ClusterUpdate::desired_autopilot_workload_policy_config].
19189 ///
19190 /// # Example
19191 /// ```ignore,no_run
19192 /// # use google_cloud_container_v1::model::ClusterUpdate;
19193 /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
19194 /// let x = ClusterUpdate::new().set_desired_autopilot_workload_policy_config(WorkloadPolicyConfig::default()/* use setters */);
19195 /// ```
19196 pub fn set_desired_autopilot_workload_policy_config<T>(mut self, v: T) -> Self
19197 where
19198 T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
19199 {
19200 self.desired_autopilot_workload_policy_config = std::option::Option::Some(v.into());
19201 self
19202 }
19203
19204 /// Sets or clears the value of [desired_autopilot_workload_policy_config][crate::model::ClusterUpdate::desired_autopilot_workload_policy_config].
19205 ///
19206 /// # Example
19207 /// ```ignore,no_run
19208 /// # use google_cloud_container_v1::model::ClusterUpdate;
19209 /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
19210 /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_workload_policy_config(Some(WorkloadPolicyConfig::default()/* use setters */));
19211 /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_workload_policy_config(None::<WorkloadPolicyConfig>);
19212 /// ```
19213 pub fn set_or_clear_desired_autopilot_workload_policy_config<T>(
19214 mut self,
19215 v: std::option::Option<T>,
19216 ) -> Self
19217 where
19218 T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
19219 {
19220 self.desired_autopilot_workload_policy_config = v.map(|x| x.into());
19221 self
19222 }
19223
19224 /// Sets the value of [desired_k8s_beta_apis][crate::model::ClusterUpdate::desired_k8s_beta_apis].
19225 ///
19226 /// # Example
19227 /// ```ignore,no_run
19228 /// # use google_cloud_container_v1::model::ClusterUpdate;
19229 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
19230 /// let x = ClusterUpdate::new().set_desired_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
19231 /// ```
19232 pub fn set_desired_k8s_beta_apis<T>(mut self, v: T) -> Self
19233 where
19234 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
19235 {
19236 self.desired_k8s_beta_apis = std::option::Option::Some(v.into());
19237 self
19238 }
19239
19240 /// Sets or clears the value of [desired_k8s_beta_apis][crate::model::ClusterUpdate::desired_k8s_beta_apis].
19241 ///
19242 /// # Example
19243 /// ```ignore,no_run
19244 /// # use google_cloud_container_v1::model::ClusterUpdate;
19245 /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
19246 /// let x = ClusterUpdate::new().set_or_clear_desired_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
19247 /// let x = ClusterUpdate::new().set_or_clear_desired_k8s_beta_apis(None::<K8sBetaAPIConfig>);
19248 /// ```
19249 pub fn set_or_clear_desired_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
19250 where
19251 T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
19252 {
19253 self.desired_k8s_beta_apis = v.map(|x| x.into());
19254 self
19255 }
19256
19257 /// Sets the value of [desired_containerd_config][crate::model::ClusterUpdate::desired_containerd_config].
19258 ///
19259 /// # Example
19260 /// ```ignore,no_run
19261 /// # use google_cloud_container_v1::model::ClusterUpdate;
19262 /// use google_cloud_container_v1::model::ContainerdConfig;
19263 /// let x = ClusterUpdate::new().set_desired_containerd_config(ContainerdConfig::default()/* use setters */);
19264 /// ```
19265 pub fn set_desired_containerd_config<T>(mut self, v: T) -> Self
19266 where
19267 T: std::convert::Into<crate::model::ContainerdConfig>,
19268 {
19269 self.desired_containerd_config = std::option::Option::Some(v.into());
19270 self
19271 }
19272
19273 /// Sets or clears the value of [desired_containerd_config][crate::model::ClusterUpdate::desired_containerd_config].
19274 ///
19275 /// # Example
19276 /// ```ignore,no_run
19277 /// # use google_cloud_container_v1::model::ClusterUpdate;
19278 /// use google_cloud_container_v1::model::ContainerdConfig;
19279 /// let x = ClusterUpdate::new().set_or_clear_desired_containerd_config(Some(ContainerdConfig::default()/* use setters */));
19280 /// let x = ClusterUpdate::new().set_or_clear_desired_containerd_config(None::<ContainerdConfig>);
19281 /// ```
19282 pub fn set_or_clear_desired_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
19283 where
19284 T: std::convert::Into<crate::model::ContainerdConfig>,
19285 {
19286 self.desired_containerd_config = v.map(|x| x.into());
19287 self
19288 }
19289
19290 /// Sets the value of [desired_enable_multi_networking][crate::model::ClusterUpdate::desired_enable_multi_networking].
19291 ///
19292 /// # Example
19293 /// ```ignore,no_run
19294 /// # use google_cloud_container_v1::model::ClusterUpdate;
19295 /// let x = ClusterUpdate::new().set_desired_enable_multi_networking(true);
19296 /// ```
19297 pub fn set_desired_enable_multi_networking<T>(mut self, v: T) -> Self
19298 where
19299 T: std::convert::Into<bool>,
19300 {
19301 self.desired_enable_multi_networking = std::option::Option::Some(v.into());
19302 self
19303 }
19304
19305 /// Sets or clears the value of [desired_enable_multi_networking][crate::model::ClusterUpdate::desired_enable_multi_networking].
19306 ///
19307 /// # Example
19308 /// ```ignore,no_run
19309 /// # use google_cloud_container_v1::model::ClusterUpdate;
19310 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_multi_networking(Some(false));
19311 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_multi_networking(None::<bool>);
19312 /// ```
19313 pub fn set_or_clear_desired_enable_multi_networking<T>(
19314 mut self,
19315 v: std::option::Option<T>,
19316 ) -> Self
19317 where
19318 T: std::convert::Into<bool>,
19319 {
19320 self.desired_enable_multi_networking = v.map(|x| x.into());
19321 self
19322 }
19323
19324 /// Sets the value of [desired_node_pool_auto_config_resource_manager_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_resource_manager_tags].
19325 ///
19326 /// # Example
19327 /// ```ignore,no_run
19328 /// # use google_cloud_container_v1::model::ClusterUpdate;
19329 /// use google_cloud_container_v1::model::ResourceManagerTags;
19330 /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
19331 /// ```
19332 pub fn set_desired_node_pool_auto_config_resource_manager_tags<T>(mut self, v: T) -> Self
19333 where
19334 T: std::convert::Into<crate::model::ResourceManagerTags>,
19335 {
19336 self.desired_node_pool_auto_config_resource_manager_tags =
19337 std::option::Option::Some(v.into());
19338 self
19339 }
19340
19341 /// Sets or clears the value of [desired_node_pool_auto_config_resource_manager_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_resource_manager_tags].
19342 ///
19343 /// # Example
19344 /// ```ignore,no_run
19345 /// # use google_cloud_container_v1::model::ClusterUpdate;
19346 /// use google_cloud_container_v1::model::ResourceManagerTags;
19347 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
19348 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_resource_manager_tags(None::<ResourceManagerTags>);
19349 /// ```
19350 pub fn set_or_clear_desired_node_pool_auto_config_resource_manager_tags<T>(
19351 mut self,
19352 v: std::option::Option<T>,
19353 ) -> Self
19354 where
19355 T: std::convert::Into<crate::model::ResourceManagerTags>,
19356 {
19357 self.desired_node_pool_auto_config_resource_manager_tags = v.map(|x| x.into());
19358 self
19359 }
19360
19361 /// Sets the value of [desired_in_transit_encryption_config][crate::model::ClusterUpdate::desired_in_transit_encryption_config].
19362 ///
19363 /// # Example
19364 /// ```ignore,no_run
19365 /// # use google_cloud_container_v1::model::ClusterUpdate;
19366 /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
19367 /// let x0 = ClusterUpdate::new().set_desired_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionDisabled);
19368 /// let x1 = ClusterUpdate::new().set_desired_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent);
19369 /// ```
19370 pub fn set_desired_in_transit_encryption_config<T>(mut self, v: T) -> Self
19371 where
19372 T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
19373 {
19374 self.desired_in_transit_encryption_config = std::option::Option::Some(v.into());
19375 self
19376 }
19377
19378 /// Sets or clears the value of [desired_in_transit_encryption_config][crate::model::ClusterUpdate::desired_in_transit_encryption_config].
19379 ///
19380 /// # Example
19381 /// ```ignore,no_run
19382 /// # use google_cloud_container_v1::model::ClusterUpdate;
19383 /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
19384 /// let x0 = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionDisabled));
19385 /// let x1 = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent));
19386 /// let x_none = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(None::<InTransitEncryptionConfig>);
19387 /// ```
19388 pub fn set_or_clear_desired_in_transit_encryption_config<T>(
19389 mut self,
19390 v: std::option::Option<T>,
19391 ) -> Self
19392 where
19393 T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
19394 {
19395 self.desired_in_transit_encryption_config = v.map(|x| x.into());
19396 self
19397 }
19398
19399 /// Sets the value of [desired_enable_cilium_clusterwide_network_policy][crate::model::ClusterUpdate::desired_enable_cilium_clusterwide_network_policy].
19400 ///
19401 /// # Example
19402 /// ```ignore,no_run
19403 /// # use google_cloud_container_v1::model::ClusterUpdate;
19404 /// let x = ClusterUpdate::new().set_desired_enable_cilium_clusterwide_network_policy(true);
19405 /// ```
19406 pub fn set_desired_enable_cilium_clusterwide_network_policy<T>(mut self, v: T) -> Self
19407 where
19408 T: std::convert::Into<bool>,
19409 {
19410 self.desired_enable_cilium_clusterwide_network_policy = std::option::Option::Some(v.into());
19411 self
19412 }
19413
19414 /// Sets or clears the value of [desired_enable_cilium_clusterwide_network_policy][crate::model::ClusterUpdate::desired_enable_cilium_clusterwide_network_policy].
19415 ///
19416 /// # Example
19417 /// ```ignore,no_run
19418 /// # use google_cloud_container_v1::model::ClusterUpdate;
19419 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_cilium_clusterwide_network_policy(Some(false));
19420 /// let x = ClusterUpdate::new().set_or_clear_desired_enable_cilium_clusterwide_network_policy(None::<bool>);
19421 /// ```
19422 pub fn set_or_clear_desired_enable_cilium_clusterwide_network_policy<T>(
19423 mut self,
19424 v: std::option::Option<T>,
19425 ) -> Self
19426 where
19427 T: std::convert::Into<bool>,
19428 {
19429 self.desired_enable_cilium_clusterwide_network_policy = v.map(|x| x.into());
19430 self
19431 }
19432
19433 /// Sets the value of [desired_secret_manager_config][crate::model::ClusterUpdate::desired_secret_manager_config].
19434 ///
19435 /// # Example
19436 /// ```ignore,no_run
19437 /// # use google_cloud_container_v1::model::ClusterUpdate;
19438 /// use google_cloud_container_v1::model::SecretManagerConfig;
19439 /// let x = ClusterUpdate::new().set_desired_secret_manager_config(SecretManagerConfig::default()/* use setters */);
19440 /// ```
19441 pub fn set_desired_secret_manager_config<T>(mut self, v: T) -> Self
19442 where
19443 T: std::convert::Into<crate::model::SecretManagerConfig>,
19444 {
19445 self.desired_secret_manager_config = std::option::Option::Some(v.into());
19446 self
19447 }
19448
19449 /// Sets or clears the value of [desired_secret_manager_config][crate::model::ClusterUpdate::desired_secret_manager_config].
19450 ///
19451 /// # Example
19452 /// ```ignore,no_run
19453 /// # use google_cloud_container_v1::model::ClusterUpdate;
19454 /// use google_cloud_container_v1::model::SecretManagerConfig;
19455 /// let x = ClusterUpdate::new().set_or_clear_desired_secret_manager_config(Some(SecretManagerConfig::default()/* use setters */));
19456 /// let x = ClusterUpdate::new().set_or_clear_desired_secret_manager_config(None::<SecretManagerConfig>);
19457 /// ```
19458 pub fn set_or_clear_desired_secret_manager_config<T>(
19459 mut self,
19460 v: std::option::Option<T>,
19461 ) -> Self
19462 where
19463 T: std::convert::Into<crate::model::SecretManagerConfig>,
19464 {
19465 self.desired_secret_manager_config = v.map(|x| x.into());
19466 self
19467 }
19468
19469 /// Sets the value of [desired_compliance_posture_config][crate::model::ClusterUpdate::desired_compliance_posture_config].
19470 ///
19471 /// # Example
19472 /// ```ignore,no_run
19473 /// # use google_cloud_container_v1::model::ClusterUpdate;
19474 /// use google_cloud_container_v1::model::CompliancePostureConfig;
19475 /// let x = ClusterUpdate::new().set_desired_compliance_posture_config(CompliancePostureConfig::default()/* use setters */);
19476 /// ```
19477 #[deprecated]
19478 pub fn set_desired_compliance_posture_config<T>(mut self, v: T) -> Self
19479 where
19480 T: std::convert::Into<crate::model::CompliancePostureConfig>,
19481 {
19482 self.desired_compliance_posture_config = std::option::Option::Some(v.into());
19483 self
19484 }
19485
19486 /// Sets or clears the value of [desired_compliance_posture_config][crate::model::ClusterUpdate::desired_compliance_posture_config].
19487 ///
19488 /// # Example
19489 /// ```ignore,no_run
19490 /// # use google_cloud_container_v1::model::ClusterUpdate;
19491 /// use google_cloud_container_v1::model::CompliancePostureConfig;
19492 /// let x = ClusterUpdate::new().set_or_clear_desired_compliance_posture_config(Some(CompliancePostureConfig::default()/* use setters */));
19493 /// let x = ClusterUpdate::new().set_or_clear_desired_compliance_posture_config(None::<CompliancePostureConfig>);
19494 /// ```
19495 #[deprecated]
19496 pub fn set_or_clear_desired_compliance_posture_config<T>(
19497 mut self,
19498 v: std::option::Option<T>,
19499 ) -> Self
19500 where
19501 T: std::convert::Into<crate::model::CompliancePostureConfig>,
19502 {
19503 self.desired_compliance_posture_config = v.map(|x| x.into());
19504 self
19505 }
19506
19507 /// Sets the value of [desired_node_kubelet_config][crate::model::ClusterUpdate::desired_node_kubelet_config].
19508 ///
19509 /// # Example
19510 /// ```ignore,no_run
19511 /// # use google_cloud_container_v1::model::ClusterUpdate;
19512 /// use google_cloud_container_v1::model::NodeKubeletConfig;
19513 /// let x = ClusterUpdate::new().set_desired_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
19514 /// ```
19515 pub fn set_desired_node_kubelet_config<T>(mut self, v: T) -> Self
19516 where
19517 T: std::convert::Into<crate::model::NodeKubeletConfig>,
19518 {
19519 self.desired_node_kubelet_config = std::option::Option::Some(v.into());
19520 self
19521 }
19522
19523 /// Sets or clears the value of [desired_node_kubelet_config][crate::model::ClusterUpdate::desired_node_kubelet_config].
19524 ///
19525 /// # Example
19526 /// ```ignore,no_run
19527 /// # use google_cloud_container_v1::model::ClusterUpdate;
19528 /// use google_cloud_container_v1::model::NodeKubeletConfig;
19529 /// let x = ClusterUpdate::new().set_or_clear_desired_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
19530 /// let x = ClusterUpdate::new().set_or_clear_desired_node_kubelet_config(None::<NodeKubeletConfig>);
19531 /// ```
19532 pub fn set_or_clear_desired_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
19533 where
19534 T: std::convert::Into<crate::model::NodeKubeletConfig>,
19535 {
19536 self.desired_node_kubelet_config = v.map(|x| x.into());
19537 self
19538 }
19539
19540 /// Sets the value of [desired_node_pool_auto_config_kubelet_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_kubelet_config].
19541 ///
19542 /// # Example
19543 /// ```ignore,no_run
19544 /// # use google_cloud_container_v1::model::ClusterUpdate;
19545 /// use google_cloud_container_v1::model::NodeKubeletConfig;
19546 /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_kubelet_config(NodeKubeletConfig::default()/* use setters */);
19547 /// ```
19548 pub fn set_desired_node_pool_auto_config_kubelet_config<T>(mut self, v: T) -> Self
19549 where
19550 T: std::convert::Into<crate::model::NodeKubeletConfig>,
19551 {
19552 self.desired_node_pool_auto_config_kubelet_config = std::option::Option::Some(v.into());
19553 self
19554 }
19555
19556 /// Sets or clears the value of [desired_node_pool_auto_config_kubelet_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_kubelet_config].
19557 ///
19558 /// # Example
19559 /// ```ignore,no_run
19560 /// # use google_cloud_container_v1::model::ClusterUpdate;
19561 /// use google_cloud_container_v1::model::NodeKubeletConfig;
19562 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
19563 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_kubelet_config(None::<NodeKubeletConfig>);
19564 /// ```
19565 pub fn set_or_clear_desired_node_pool_auto_config_kubelet_config<T>(
19566 mut self,
19567 v: std::option::Option<T>,
19568 ) -> Self
19569 where
19570 T: std::convert::Into<crate::model::NodeKubeletConfig>,
19571 {
19572 self.desired_node_pool_auto_config_kubelet_config = v.map(|x| x.into());
19573 self
19574 }
19575
19576 /// Sets the value of [user_managed_keys_config][crate::model::ClusterUpdate::user_managed_keys_config].
19577 ///
19578 /// # Example
19579 /// ```ignore,no_run
19580 /// # use google_cloud_container_v1::model::ClusterUpdate;
19581 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
19582 /// let x = ClusterUpdate::new().set_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
19583 /// ```
19584 #[deprecated]
19585 pub fn set_user_managed_keys_config<T>(mut self, v: T) -> Self
19586 where
19587 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
19588 {
19589 self.user_managed_keys_config = std::option::Option::Some(v.into());
19590 self
19591 }
19592
19593 /// Sets or clears the value of [user_managed_keys_config][crate::model::ClusterUpdate::user_managed_keys_config].
19594 ///
19595 /// # Example
19596 /// ```ignore,no_run
19597 /// # use google_cloud_container_v1::model::ClusterUpdate;
19598 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
19599 /// let x = ClusterUpdate::new().set_or_clear_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
19600 /// let x = ClusterUpdate::new().set_or_clear_user_managed_keys_config(None::<UserManagedKeysConfig>);
19601 /// ```
19602 #[deprecated]
19603 pub fn set_or_clear_user_managed_keys_config<T>(mut self, v: std::option::Option<T>) -> Self
19604 where
19605 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
19606 {
19607 self.user_managed_keys_config = v.map(|x| x.into());
19608 self
19609 }
19610
19611 /// Sets the value of [desired_rbac_binding_config][crate::model::ClusterUpdate::desired_rbac_binding_config].
19612 ///
19613 /// # Example
19614 /// ```ignore,no_run
19615 /// # use google_cloud_container_v1::model::ClusterUpdate;
19616 /// use google_cloud_container_v1::model::RBACBindingConfig;
19617 /// let x = ClusterUpdate::new().set_desired_rbac_binding_config(RBACBindingConfig::default()/* use setters */);
19618 /// ```
19619 pub fn set_desired_rbac_binding_config<T>(mut self, v: T) -> Self
19620 where
19621 T: std::convert::Into<crate::model::RBACBindingConfig>,
19622 {
19623 self.desired_rbac_binding_config = std::option::Option::Some(v.into());
19624 self
19625 }
19626
19627 /// Sets or clears the value of [desired_rbac_binding_config][crate::model::ClusterUpdate::desired_rbac_binding_config].
19628 ///
19629 /// # Example
19630 /// ```ignore,no_run
19631 /// # use google_cloud_container_v1::model::ClusterUpdate;
19632 /// use google_cloud_container_v1::model::RBACBindingConfig;
19633 /// let x = ClusterUpdate::new().set_or_clear_desired_rbac_binding_config(Some(RBACBindingConfig::default()/* use setters */));
19634 /// let x = ClusterUpdate::new().set_or_clear_desired_rbac_binding_config(None::<RBACBindingConfig>);
19635 /// ```
19636 pub fn set_or_clear_desired_rbac_binding_config<T>(mut self, v: std::option::Option<T>) -> Self
19637 where
19638 T: std::convert::Into<crate::model::RBACBindingConfig>,
19639 {
19640 self.desired_rbac_binding_config = v.map(|x| x.into());
19641 self
19642 }
19643
19644 /// Sets the value of [desired_additional_ip_ranges_config][crate::model::ClusterUpdate::desired_additional_ip_ranges_config].
19645 ///
19646 /// # Example
19647 /// ```ignore,no_run
19648 /// # use google_cloud_container_v1::model::ClusterUpdate;
19649 /// use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
19650 /// let x = ClusterUpdate::new().set_desired_additional_ip_ranges_config(DesiredAdditionalIPRangesConfig::default()/* use setters */);
19651 /// ```
19652 pub fn set_desired_additional_ip_ranges_config<T>(mut self, v: T) -> Self
19653 where
19654 T: std::convert::Into<crate::model::DesiredAdditionalIPRangesConfig>,
19655 {
19656 self.desired_additional_ip_ranges_config = std::option::Option::Some(v.into());
19657 self
19658 }
19659
19660 /// Sets or clears the value of [desired_additional_ip_ranges_config][crate::model::ClusterUpdate::desired_additional_ip_ranges_config].
19661 ///
19662 /// # Example
19663 /// ```ignore,no_run
19664 /// # use google_cloud_container_v1::model::ClusterUpdate;
19665 /// use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
19666 /// let x = ClusterUpdate::new().set_or_clear_desired_additional_ip_ranges_config(Some(DesiredAdditionalIPRangesConfig::default()/* use setters */));
19667 /// let x = ClusterUpdate::new().set_or_clear_desired_additional_ip_ranges_config(None::<DesiredAdditionalIPRangesConfig>);
19668 /// ```
19669 pub fn set_or_clear_desired_additional_ip_ranges_config<T>(
19670 mut self,
19671 v: std::option::Option<T>,
19672 ) -> Self
19673 where
19674 T: std::convert::Into<crate::model::DesiredAdditionalIPRangesConfig>,
19675 {
19676 self.desired_additional_ip_ranges_config = v.map(|x| x.into());
19677 self
19678 }
19679
19680 /// Sets the value of [desired_enterprise_config][crate::model::ClusterUpdate::desired_enterprise_config].
19681 ///
19682 /// # Example
19683 /// ```ignore,no_run
19684 /// # use google_cloud_container_v1::model::ClusterUpdate;
19685 /// use google_cloud_container_v1::model::DesiredEnterpriseConfig;
19686 /// let x = ClusterUpdate::new().set_desired_enterprise_config(DesiredEnterpriseConfig::default()/* use setters */);
19687 /// ```
19688 #[deprecated]
19689 pub fn set_desired_enterprise_config<T>(mut self, v: T) -> Self
19690 where
19691 T: std::convert::Into<crate::model::DesiredEnterpriseConfig>,
19692 {
19693 self.desired_enterprise_config = std::option::Option::Some(v.into());
19694 self
19695 }
19696
19697 /// Sets or clears the value of [desired_enterprise_config][crate::model::ClusterUpdate::desired_enterprise_config].
19698 ///
19699 /// # Example
19700 /// ```ignore,no_run
19701 /// # use google_cloud_container_v1::model::ClusterUpdate;
19702 /// use google_cloud_container_v1::model::DesiredEnterpriseConfig;
19703 /// let x = ClusterUpdate::new().set_or_clear_desired_enterprise_config(Some(DesiredEnterpriseConfig::default()/* use setters */));
19704 /// let x = ClusterUpdate::new().set_or_clear_desired_enterprise_config(None::<DesiredEnterpriseConfig>);
19705 /// ```
19706 #[deprecated]
19707 pub fn set_or_clear_desired_enterprise_config<T>(mut self, v: std::option::Option<T>) -> Self
19708 where
19709 T: std::convert::Into<crate::model::DesiredEnterpriseConfig>,
19710 {
19711 self.desired_enterprise_config = v.map(|x| x.into());
19712 self
19713 }
19714
19715 /// Sets the value of [desired_auto_ipam_config][crate::model::ClusterUpdate::desired_auto_ipam_config].
19716 ///
19717 /// # Example
19718 /// ```ignore,no_run
19719 /// # use google_cloud_container_v1::model::ClusterUpdate;
19720 /// use google_cloud_container_v1::model::AutoIpamConfig;
19721 /// let x = ClusterUpdate::new().set_desired_auto_ipam_config(AutoIpamConfig::default()/* use setters */);
19722 /// ```
19723 pub fn set_desired_auto_ipam_config<T>(mut self, v: T) -> Self
19724 where
19725 T: std::convert::Into<crate::model::AutoIpamConfig>,
19726 {
19727 self.desired_auto_ipam_config = std::option::Option::Some(v.into());
19728 self
19729 }
19730
19731 /// Sets or clears the value of [desired_auto_ipam_config][crate::model::ClusterUpdate::desired_auto_ipam_config].
19732 ///
19733 /// # Example
19734 /// ```ignore,no_run
19735 /// # use google_cloud_container_v1::model::ClusterUpdate;
19736 /// use google_cloud_container_v1::model::AutoIpamConfig;
19737 /// let x = ClusterUpdate::new().set_or_clear_desired_auto_ipam_config(Some(AutoIpamConfig::default()/* use setters */));
19738 /// let x = ClusterUpdate::new().set_or_clear_desired_auto_ipam_config(None::<AutoIpamConfig>);
19739 /// ```
19740 pub fn set_or_clear_desired_auto_ipam_config<T>(mut self, v: std::option::Option<T>) -> Self
19741 where
19742 T: std::convert::Into<crate::model::AutoIpamConfig>,
19743 {
19744 self.desired_auto_ipam_config = v.map(|x| x.into());
19745 self
19746 }
19747
19748 /// Sets the value of [desired_disable_l4_lb_firewall_reconciliation][crate::model::ClusterUpdate::desired_disable_l4_lb_firewall_reconciliation].
19749 ///
19750 /// # Example
19751 /// ```ignore,no_run
19752 /// # use google_cloud_container_v1::model::ClusterUpdate;
19753 /// let x = ClusterUpdate::new().set_desired_disable_l4_lb_firewall_reconciliation(true);
19754 /// ```
19755 pub fn set_desired_disable_l4_lb_firewall_reconciliation<T>(mut self, v: T) -> Self
19756 where
19757 T: std::convert::Into<bool>,
19758 {
19759 self.desired_disable_l4_lb_firewall_reconciliation = std::option::Option::Some(v.into());
19760 self
19761 }
19762
19763 /// Sets or clears the value of [desired_disable_l4_lb_firewall_reconciliation][crate::model::ClusterUpdate::desired_disable_l4_lb_firewall_reconciliation].
19764 ///
19765 /// # Example
19766 /// ```ignore,no_run
19767 /// # use google_cloud_container_v1::model::ClusterUpdate;
19768 /// let x = ClusterUpdate::new().set_or_clear_desired_disable_l4_lb_firewall_reconciliation(Some(false));
19769 /// let x = ClusterUpdate::new().set_or_clear_desired_disable_l4_lb_firewall_reconciliation(None::<bool>);
19770 /// ```
19771 pub fn set_or_clear_desired_disable_l4_lb_firewall_reconciliation<T>(
19772 mut self,
19773 v: std::option::Option<T>,
19774 ) -> Self
19775 where
19776 T: std::convert::Into<bool>,
19777 {
19778 self.desired_disable_l4_lb_firewall_reconciliation = v.map(|x| x.into());
19779 self
19780 }
19781
19782 /// Sets the value of [desired_node_pool_auto_config_linux_node_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_linux_node_config].
19783 ///
19784 /// # Example
19785 /// ```ignore,no_run
19786 /// # use google_cloud_container_v1::model::ClusterUpdate;
19787 /// use google_cloud_container_v1::model::LinuxNodeConfig;
19788 /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_linux_node_config(LinuxNodeConfig::default()/* use setters */);
19789 /// ```
19790 pub fn set_desired_node_pool_auto_config_linux_node_config<T>(mut self, v: T) -> Self
19791 where
19792 T: std::convert::Into<crate::model::LinuxNodeConfig>,
19793 {
19794 self.desired_node_pool_auto_config_linux_node_config = std::option::Option::Some(v.into());
19795 self
19796 }
19797
19798 /// Sets or clears the value of [desired_node_pool_auto_config_linux_node_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_linux_node_config].
19799 ///
19800 /// # Example
19801 /// ```ignore,no_run
19802 /// # use google_cloud_container_v1::model::ClusterUpdate;
19803 /// use google_cloud_container_v1::model::LinuxNodeConfig;
19804 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
19805 /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_linux_node_config(None::<LinuxNodeConfig>);
19806 /// ```
19807 pub fn set_or_clear_desired_node_pool_auto_config_linux_node_config<T>(
19808 mut self,
19809 v: std::option::Option<T>,
19810 ) -> Self
19811 where
19812 T: std::convert::Into<crate::model::LinuxNodeConfig>,
19813 {
19814 self.desired_node_pool_auto_config_linux_node_config = v.map(|x| x.into());
19815 self
19816 }
19817
19818 /// Sets the value of [desired_user_managed_keys_config][crate::model::ClusterUpdate::desired_user_managed_keys_config].
19819 ///
19820 /// # Example
19821 /// ```ignore,no_run
19822 /// # use google_cloud_container_v1::model::ClusterUpdate;
19823 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
19824 /// let x = ClusterUpdate::new().set_desired_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
19825 /// ```
19826 pub fn set_desired_user_managed_keys_config<T>(mut self, v: T) -> Self
19827 where
19828 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
19829 {
19830 self.desired_user_managed_keys_config = std::option::Option::Some(v.into());
19831 self
19832 }
19833
19834 /// Sets or clears the value of [desired_user_managed_keys_config][crate::model::ClusterUpdate::desired_user_managed_keys_config].
19835 ///
19836 /// # Example
19837 /// ```ignore,no_run
19838 /// # use google_cloud_container_v1::model::ClusterUpdate;
19839 /// use google_cloud_container_v1::model::UserManagedKeysConfig;
19840 /// let x = ClusterUpdate::new().set_or_clear_desired_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
19841 /// let x = ClusterUpdate::new().set_or_clear_desired_user_managed_keys_config(None::<UserManagedKeysConfig>);
19842 /// ```
19843 pub fn set_or_clear_desired_user_managed_keys_config<T>(
19844 mut self,
19845 v: std::option::Option<T>,
19846 ) -> Self
19847 where
19848 T: std::convert::Into<crate::model::UserManagedKeysConfig>,
19849 {
19850 self.desired_user_managed_keys_config = v.map(|x| x.into());
19851 self
19852 }
19853
19854 /// Sets the value of [desired_anonymous_authentication_config][crate::model::ClusterUpdate::desired_anonymous_authentication_config].
19855 ///
19856 /// # Example
19857 /// ```ignore,no_run
19858 /// # use google_cloud_container_v1::model::ClusterUpdate;
19859 /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
19860 /// let x = ClusterUpdate::new().set_desired_anonymous_authentication_config(AnonymousAuthenticationConfig::default()/* use setters */);
19861 /// ```
19862 pub fn set_desired_anonymous_authentication_config<T>(mut self, v: T) -> Self
19863 where
19864 T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
19865 {
19866 self.desired_anonymous_authentication_config = std::option::Option::Some(v.into());
19867 self
19868 }
19869
19870 /// Sets or clears the value of [desired_anonymous_authentication_config][crate::model::ClusterUpdate::desired_anonymous_authentication_config].
19871 ///
19872 /// # Example
19873 /// ```ignore,no_run
19874 /// # use google_cloud_container_v1::model::ClusterUpdate;
19875 /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
19876 /// let x = ClusterUpdate::new().set_or_clear_desired_anonymous_authentication_config(Some(AnonymousAuthenticationConfig::default()/* use setters */));
19877 /// let x = ClusterUpdate::new().set_or_clear_desired_anonymous_authentication_config(None::<AnonymousAuthenticationConfig>);
19878 /// ```
19879 pub fn set_or_clear_desired_anonymous_authentication_config<T>(
19880 mut self,
19881 v: std::option::Option<T>,
19882 ) -> Self
19883 where
19884 T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
19885 {
19886 self.desired_anonymous_authentication_config = v.map(|x| x.into());
19887 self
19888 }
19889
19890 /// Sets the value of [gke_auto_upgrade_config][crate::model::ClusterUpdate::gke_auto_upgrade_config].
19891 ///
19892 /// # Example
19893 /// ```ignore,no_run
19894 /// # use google_cloud_container_v1::model::ClusterUpdate;
19895 /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
19896 /// let x = ClusterUpdate::new().set_gke_auto_upgrade_config(GkeAutoUpgradeConfig::default()/* use setters */);
19897 /// ```
19898 pub fn set_gke_auto_upgrade_config<T>(mut self, v: T) -> Self
19899 where
19900 T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
19901 {
19902 self.gke_auto_upgrade_config = std::option::Option::Some(v.into());
19903 self
19904 }
19905
19906 /// Sets or clears the value of [gke_auto_upgrade_config][crate::model::ClusterUpdate::gke_auto_upgrade_config].
19907 ///
19908 /// # Example
19909 /// ```ignore,no_run
19910 /// # use google_cloud_container_v1::model::ClusterUpdate;
19911 /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
19912 /// let x = ClusterUpdate::new().set_or_clear_gke_auto_upgrade_config(Some(GkeAutoUpgradeConfig::default()/* use setters */));
19913 /// let x = ClusterUpdate::new().set_or_clear_gke_auto_upgrade_config(None::<GkeAutoUpgradeConfig>);
19914 /// ```
19915 pub fn set_or_clear_gke_auto_upgrade_config<T>(mut self, v: std::option::Option<T>) -> Self
19916 where
19917 T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
19918 {
19919 self.gke_auto_upgrade_config = v.map(|x| x.into());
19920 self
19921 }
19922
19923 /// Sets the value of [desired_network_tier_config][crate::model::ClusterUpdate::desired_network_tier_config].
19924 ///
19925 /// # Example
19926 /// ```ignore,no_run
19927 /// # use google_cloud_container_v1::model::ClusterUpdate;
19928 /// use google_cloud_container_v1::model::NetworkTierConfig;
19929 /// let x = ClusterUpdate::new().set_desired_network_tier_config(NetworkTierConfig::default()/* use setters */);
19930 /// ```
19931 pub fn set_desired_network_tier_config<T>(mut self, v: T) -> Self
19932 where
19933 T: std::convert::Into<crate::model::NetworkTierConfig>,
19934 {
19935 self.desired_network_tier_config = std::option::Option::Some(v.into());
19936 self
19937 }
19938
19939 /// Sets or clears the value of [desired_network_tier_config][crate::model::ClusterUpdate::desired_network_tier_config].
19940 ///
19941 /// # Example
19942 /// ```ignore,no_run
19943 /// # use google_cloud_container_v1::model::ClusterUpdate;
19944 /// use google_cloud_container_v1::model::NetworkTierConfig;
19945 /// let x = ClusterUpdate::new().set_or_clear_desired_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
19946 /// let x = ClusterUpdate::new().set_or_clear_desired_network_tier_config(None::<NetworkTierConfig>);
19947 /// ```
19948 pub fn set_or_clear_desired_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
19949 where
19950 T: std::convert::Into<crate::model::NetworkTierConfig>,
19951 {
19952 self.desired_network_tier_config = v.map(|x| x.into());
19953 self
19954 }
19955
19956 /// Sets the value of [desired_secret_sync_config][crate::model::ClusterUpdate::desired_secret_sync_config].
19957 ///
19958 /// # Example
19959 /// ```ignore,no_run
19960 /// # use google_cloud_container_v1::model::ClusterUpdate;
19961 /// use google_cloud_container_v1::model::SecretSyncConfig;
19962 /// let x = ClusterUpdate::new().set_desired_secret_sync_config(SecretSyncConfig::default()/* use setters */);
19963 /// ```
19964 pub fn set_desired_secret_sync_config<T>(mut self, v: T) -> Self
19965 where
19966 T: std::convert::Into<crate::model::SecretSyncConfig>,
19967 {
19968 self.desired_secret_sync_config = std::option::Option::Some(v.into());
19969 self
19970 }
19971
19972 /// Sets or clears the value of [desired_secret_sync_config][crate::model::ClusterUpdate::desired_secret_sync_config].
19973 ///
19974 /// # Example
19975 /// ```ignore,no_run
19976 /// # use google_cloud_container_v1::model::ClusterUpdate;
19977 /// use google_cloud_container_v1::model::SecretSyncConfig;
19978 /// let x = ClusterUpdate::new().set_or_clear_desired_secret_sync_config(Some(SecretSyncConfig::default()/* use setters */));
19979 /// let x = ClusterUpdate::new().set_or_clear_desired_secret_sync_config(None::<SecretSyncConfig>);
19980 /// ```
19981 pub fn set_or_clear_desired_secret_sync_config<T>(mut self, v: std::option::Option<T>) -> Self
19982 where
19983 T: std::convert::Into<crate::model::SecretSyncConfig>,
19984 {
19985 self.desired_secret_sync_config = v.map(|x| x.into());
19986 self
19987 }
19988
19989 /// Sets the value of [desired_privileged_admission_config][crate::model::ClusterUpdate::desired_privileged_admission_config].
19990 ///
19991 /// # Example
19992 /// ```ignore,no_run
19993 /// # use google_cloud_container_v1::model::ClusterUpdate;
19994 /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
19995 /// let x = ClusterUpdate::new().set_desired_privileged_admission_config(PrivilegedAdmissionConfig::default()/* use setters */);
19996 /// ```
19997 pub fn set_desired_privileged_admission_config<T>(mut self, v: T) -> Self
19998 where
19999 T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
20000 {
20001 self.desired_privileged_admission_config = std::option::Option::Some(v.into());
20002 self
20003 }
20004
20005 /// Sets or clears the value of [desired_privileged_admission_config][crate::model::ClusterUpdate::desired_privileged_admission_config].
20006 ///
20007 /// # Example
20008 /// ```ignore,no_run
20009 /// # use google_cloud_container_v1::model::ClusterUpdate;
20010 /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
20011 /// let x = ClusterUpdate::new().set_or_clear_desired_privileged_admission_config(Some(PrivilegedAdmissionConfig::default()/* use setters */));
20012 /// let x = ClusterUpdate::new().set_or_clear_desired_privileged_admission_config(None::<PrivilegedAdmissionConfig>);
20013 /// ```
20014 pub fn set_or_clear_desired_privileged_admission_config<T>(
20015 mut self,
20016 v: std::option::Option<T>,
20017 ) -> Self
20018 where
20019 T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
20020 {
20021 self.desired_privileged_admission_config = v.map(|x| x.into());
20022 self
20023 }
20024
20025 /// Sets the value of [desired_control_plane_egress][crate::model::ClusterUpdate::desired_control_plane_egress].
20026 ///
20027 /// # Example
20028 /// ```ignore,no_run
20029 /// # use google_cloud_container_v1::model::ClusterUpdate;
20030 /// use google_cloud_container_v1::model::ControlPlaneEgress;
20031 /// let x = ClusterUpdate::new().set_desired_control_plane_egress(ControlPlaneEgress::default()/* use setters */);
20032 /// ```
20033 pub fn set_desired_control_plane_egress<T>(mut self, v: T) -> Self
20034 where
20035 T: std::convert::Into<crate::model::ControlPlaneEgress>,
20036 {
20037 self.desired_control_plane_egress = std::option::Option::Some(v.into());
20038 self
20039 }
20040
20041 /// Sets or clears the value of [desired_control_plane_egress][crate::model::ClusterUpdate::desired_control_plane_egress].
20042 ///
20043 /// # Example
20044 /// ```ignore,no_run
20045 /// # use google_cloud_container_v1::model::ClusterUpdate;
20046 /// use google_cloud_container_v1::model::ControlPlaneEgress;
20047 /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_egress(Some(ControlPlaneEgress::default()/* use setters */));
20048 /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_egress(None::<ControlPlaneEgress>);
20049 /// ```
20050 pub fn set_or_clear_desired_control_plane_egress<T>(mut self, v: std::option::Option<T>) -> Self
20051 where
20052 T: std::convert::Into<crate::model::ControlPlaneEgress>,
20053 {
20054 self.desired_control_plane_egress = v.map(|x| x.into());
20055 self
20056 }
20057
20058 /// Sets the value of [desired_managed_opentelemetry_config][crate::model::ClusterUpdate::desired_managed_opentelemetry_config].
20059 ///
20060 /// # Example
20061 /// ```ignore,no_run
20062 /// # use google_cloud_container_v1::model::ClusterUpdate;
20063 /// use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
20064 /// let x = ClusterUpdate::new().set_desired_managed_opentelemetry_config(ManagedOpenTelemetryConfig::default()/* use setters */);
20065 /// ```
20066 pub fn set_desired_managed_opentelemetry_config<T>(mut self, v: T) -> Self
20067 where
20068 T: std::convert::Into<crate::model::ManagedOpenTelemetryConfig>,
20069 {
20070 self.desired_managed_opentelemetry_config = std::option::Option::Some(v.into());
20071 self
20072 }
20073
20074 /// Sets or clears the value of [desired_managed_opentelemetry_config][crate::model::ClusterUpdate::desired_managed_opentelemetry_config].
20075 ///
20076 /// # Example
20077 /// ```ignore,no_run
20078 /// # use google_cloud_container_v1::model::ClusterUpdate;
20079 /// use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
20080 /// let x = ClusterUpdate::new().set_or_clear_desired_managed_opentelemetry_config(Some(ManagedOpenTelemetryConfig::default()/* use setters */));
20081 /// let x = ClusterUpdate::new().set_or_clear_desired_managed_opentelemetry_config(None::<ManagedOpenTelemetryConfig>);
20082 /// ```
20083 pub fn set_or_clear_desired_managed_opentelemetry_config<T>(
20084 mut self,
20085 v: std::option::Option<T>,
20086 ) -> Self
20087 where
20088 T: std::convert::Into<crate::model::ManagedOpenTelemetryConfig>,
20089 {
20090 self.desired_managed_opentelemetry_config = v.map(|x| x.into());
20091 self
20092 }
20093
20094 /// Sets the value of [desired_autopilot_cluster_policy_config][crate::model::ClusterUpdate::desired_autopilot_cluster_policy_config].
20095 ///
20096 /// # Example
20097 /// ```ignore,no_run
20098 /// # use google_cloud_container_v1::model::ClusterUpdate;
20099 /// use google_cloud_container_v1::model::ClusterPolicyConfig;
20100 /// let x = ClusterUpdate::new().set_desired_autopilot_cluster_policy_config(ClusterPolicyConfig::default()/* use setters */);
20101 /// ```
20102 pub fn set_desired_autopilot_cluster_policy_config<T>(mut self, v: T) -> Self
20103 where
20104 T: std::convert::Into<crate::model::ClusterPolicyConfig>,
20105 {
20106 self.desired_autopilot_cluster_policy_config = std::option::Option::Some(v.into());
20107 self
20108 }
20109
20110 /// Sets or clears the value of [desired_autopilot_cluster_policy_config][crate::model::ClusterUpdate::desired_autopilot_cluster_policy_config].
20111 ///
20112 /// # Example
20113 /// ```ignore,no_run
20114 /// # use google_cloud_container_v1::model::ClusterUpdate;
20115 /// use google_cloud_container_v1::model::ClusterPolicyConfig;
20116 /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_cluster_policy_config(Some(ClusterPolicyConfig::default()/* use setters */));
20117 /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_cluster_policy_config(None::<ClusterPolicyConfig>);
20118 /// ```
20119 pub fn set_or_clear_desired_autopilot_cluster_policy_config<T>(
20120 mut self,
20121 v: std::option::Option<T>,
20122 ) -> Self
20123 where
20124 T: std::convert::Into<crate::model::ClusterPolicyConfig>,
20125 {
20126 self.desired_autopilot_cluster_policy_config = v.map(|x| x.into());
20127 self
20128 }
20129
20130 /// Sets the value of [desired_managed_machine_learning_diagnostics_config][crate::model::ClusterUpdate::desired_managed_machine_learning_diagnostics_config].
20131 ///
20132 /// # Example
20133 /// ```ignore,no_run
20134 /// # use google_cloud_container_v1::model::ClusterUpdate;
20135 /// use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
20136 /// let x = ClusterUpdate::new().set_desired_managed_machine_learning_diagnostics_config(ManagedMachineLearningDiagnosticsConfig::default()/* use setters */);
20137 /// ```
20138 pub fn set_desired_managed_machine_learning_diagnostics_config<T>(mut self, v: T) -> Self
20139 where
20140 T: std::convert::Into<crate::model::ManagedMachineLearningDiagnosticsConfig>,
20141 {
20142 self.desired_managed_machine_learning_diagnostics_config =
20143 std::option::Option::Some(v.into());
20144 self
20145 }
20146
20147 /// Sets or clears the value of [desired_managed_machine_learning_diagnostics_config][crate::model::ClusterUpdate::desired_managed_machine_learning_diagnostics_config].
20148 ///
20149 /// # Example
20150 /// ```ignore,no_run
20151 /// # use google_cloud_container_v1::model::ClusterUpdate;
20152 /// use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
20153 /// let x = ClusterUpdate::new().set_or_clear_desired_managed_machine_learning_diagnostics_config(Some(ManagedMachineLearningDiagnosticsConfig::default()/* use setters */));
20154 /// let x = ClusterUpdate::new().set_or_clear_desired_managed_machine_learning_diagnostics_config(None::<ManagedMachineLearningDiagnosticsConfig>);
20155 /// ```
20156 pub fn set_or_clear_desired_managed_machine_learning_diagnostics_config<T>(
20157 mut self,
20158 v: std::option::Option<T>,
20159 ) -> Self
20160 where
20161 T: std::convert::Into<crate::model::ManagedMachineLearningDiagnosticsConfig>,
20162 {
20163 self.desired_managed_machine_learning_diagnostics_config = v.map(|x| x.into());
20164 self
20165 }
20166
20167 /// Sets the value of [desired_node_creation_config][crate::model::ClusterUpdate::desired_node_creation_config].
20168 ///
20169 /// # Example
20170 /// ```ignore,no_run
20171 /// # use google_cloud_container_v1::model::ClusterUpdate;
20172 /// use google_cloud_container_v1::model::NodeCreationConfig;
20173 /// let x = ClusterUpdate::new().set_desired_node_creation_config(NodeCreationConfig::default()/* use setters */);
20174 /// ```
20175 pub fn set_desired_node_creation_config<T>(mut self, v: T) -> Self
20176 where
20177 T: std::convert::Into<crate::model::NodeCreationConfig>,
20178 {
20179 self.desired_node_creation_config = std::option::Option::Some(v.into());
20180 self
20181 }
20182
20183 /// Sets or clears the value of [desired_node_creation_config][crate::model::ClusterUpdate::desired_node_creation_config].
20184 ///
20185 /// # Example
20186 /// ```ignore,no_run
20187 /// # use google_cloud_container_v1::model::ClusterUpdate;
20188 /// use google_cloud_container_v1::model::NodeCreationConfig;
20189 /// let x = ClusterUpdate::new().set_or_clear_desired_node_creation_config(Some(NodeCreationConfig::default()/* use setters */));
20190 /// let x = ClusterUpdate::new().set_or_clear_desired_node_creation_config(None::<NodeCreationConfig>);
20191 /// ```
20192 pub fn set_or_clear_desired_node_creation_config<T>(mut self, v: std::option::Option<T>) -> Self
20193 where
20194 T: std::convert::Into<crate::model::NodeCreationConfig>,
20195 {
20196 self.desired_node_creation_config = v.map(|x| x.into());
20197 self
20198 }
20199}
20200
20201impl wkt::message::Message for ClusterUpdate {
20202 fn typename() -> &'static str {
20203 "type.googleapis.com/google.container.v1.ClusterUpdate"
20204 }
20205}
20206
20207/// AdditionalPodRangesConfig is the configuration for additional pod secondary
20208/// ranges supporting the ClusterUpdate message.
20209#[derive(Clone, Default, PartialEq)]
20210#[non_exhaustive]
20211pub struct AdditionalPodRangesConfig {
20212 /// Name for pod secondary ipv4 range which has the actual range defined ahead.
20213 pub pod_range_names: std::vec::Vec<std::string::String>,
20214
20215 /// Output only. Information for additional pod range.
20216 pub pod_range_info: std::vec::Vec<crate::model::RangeInfo>,
20217
20218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20219}
20220
20221impl AdditionalPodRangesConfig {
20222 /// Creates a new default instance.
20223 pub fn new() -> Self {
20224 std::default::Default::default()
20225 }
20226
20227 /// Sets the value of [pod_range_names][crate::model::AdditionalPodRangesConfig::pod_range_names].
20228 ///
20229 /// # Example
20230 /// ```ignore,no_run
20231 /// # use google_cloud_container_v1::model::AdditionalPodRangesConfig;
20232 /// let x = AdditionalPodRangesConfig::new().set_pod_range_names(["a", "b", "c"]);
20233 /// ```
20234 pub fn set_pod_range_names<T, V>(mut self, v: T) -> Self
20235 where
20236 T: std::iter::IntoIterator<Item = V>,
20237 V: std::convert::Into<std::string::String>,
20238 {
20239 use std::iter::Iterator;
20240 self.pod_range_names = v.into_iter().map(|i| i.into()).collect();
20241 self
20242 }
20243
20244 /// Sets the value of [pod_range_info][crate::model::AdditionalPodRangesConfig::pod_range_info].
20245 ///
20246 /// # Example
20247 /// ```ignore,no_run
20248 /// # use google_cloud_container_v1::model::AdditionalPodRangesConfig;
20249 /// use google_cloud_container_v1::model::RangeInfo;
20250 /// let x = AdditionalPodRangesConfig::new()
20251 /// .set_pod_range_info([
20252 /// RangeInfo::default()/* use setters */,
20253 /// RangeInfo::default()/* use (different) setters */,
20254 /// ]);
20255 /// ```
20256 pub fn set_pod_range_info<T, V>(mut self, v: T) -> Self
20257 where
20258 T: std::iter::IntoIterator<Item = V>,
20259 V: std::convert::Into<crate::model::RangeInfo>,
20260 {
20261 use std::iter::Iterator;
20262 self.pod_range_info = v.into_iter().map(|i| i.into()).collect();
20263 self
20264 }
20265}
20266
20267impl wkt::message::Message for AdditionalPodRangesConfig {
20268 fn typename() -> &'static str {
20269 "type.googleapis.com/google.container.v1.AdditionalPodRangesConfig"
20270 }
20271}
20272
20273/// AdditionalIPRangesConfig is the configuration for individual additional
20274/// subnetwork attached to the cluster
20275#[derive(Clone, Default, PartialEq)]
20276#[non_exhaustive]
20277pub struct AdditionalIPRangesConfig {
20278 /// Name of the subnetwork. This can be the full path of the subnetwork or
20279 /// just the name.
20280 /// Example1: my-subnet
20281 /// Example2: projects/gke-project/regions/us-central1/subnetworks/my-subnet
20282 pub subnetwork: std::string::String,
20283
20284 /// List of secondary ranges names within this subnetwork that can be used for
20285 /// pod IPs.
20286 /// Example1: gke-pod-range1
20287 /// Example2: gke-pod-range1,gke-pod-range2
20288 pub pod_ipv4_range_names: std::vec::Vec<std::string::String>,
20289
20290 /// Draining status of the additional subnet.
20291 pub status: crate::model::additional_ip_ranges_config::Status,
20292
20293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20294}
20295
20296impl AdditionalIPRangesConfig {
20297 /// Creates a new default instance.
20298 pub fn new() -> Self {
20299 std::default::Default::default()
20300 }
20301
20302 /// Sets the value of [subnetwork][crate::model::AdditionalIPRangesConfig::subnetwork].
20303 ///
20304 /// # Example
20305 /// ```ignore,no_run
20306 /// # use google_cloud_container_v1::model::AdditionalIPRangesConfig;
20307 /// let x = AdditionalIPRangesConfig::new().set_subnetwork("example");
20308 /// ```
20309 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20310 self.subnetwork = v.into();
20311 self
20312 }
20313
20314 /// Sets the value of [pod_ipv4_range_names][crate::model::AdditionalIPRangesConfig::pod_ipv4_range_names].
20315 ///
20316 /// # Example
20317 /// ```ignore,no_run
20318 /// # use google_cloud_container_v1::model::AdditionalIPRangesConfig;
20319 /// let x = AdditionalIPRangesConfig::new().set_pod_ipv4_range_names(["a", "b", "c"]);
20320 /// ```
20321 pub fn set_pod_ipv4_range_names<T, V>(mut self, v: T) -> Self
20322 where
20323 T: std::iter::IntoIterator<Item = V>,
20324 V: std::convert::Into<std::string::String>,
20325 {
20326 use std::iter::Iterator;
20327 self.pod_ipv4_range_names = v.into_iter().map(|i| i.into()).collect();
20328 self
20329 }
20330
20331 /// Sets the value of [status][crate::model::AdditionalIPRangesConfig::status].
20332 ///
20333 /// # Example
20334 /// ```ignore,no_run
20335 /// # use google_cloud_container_v1::model::AdditionalIPRangesConfig;
20336 /// use google_cloud_container_v1::model::additional_ip_ranges_config::Status;
20337 /// let x0 = AdditionalIPRangesConfig::new().set_status(Status::Active);
20338 /// let x1 = AdditionalIPRangesConfig::new().set_status(Status::Draining);
20339 /// ```
20340 pub fn set_status<T: std::convert::Into<crate::model::additional_ip_ranges_config::Status>>(
20341 mut self,
20342 v: T,
20343 ) -> Self {
20344 self.status = v.into();
20345 self
20346 }
20347}
20348
20349impl wkt::message::Message for AdditionalIPRangesConfig {
20350 fn typename() -> &'static str {
20351 "type.googleapis.com/google.container.v1.AdditionalIPRangesConfig"
20352 }
20353}
20354
20355/// Defines additional types related to [AdditionalIPRangesConfig].
20356pub mod additional_ip_ranges_config {
20357 #[allow(unused_imports)]
20358 use super::*;
20359
20360 /// Additional subnet with DRAINING status will not be selected during new node
20361 /// pool creation. To undrain the draining status, update the cluster to set
20362 /// the subnet to ACTIVE status. To remove the additional subnet, use the
20363 /// update cluster API to remove the subnet from the
20364 /// desired_additional_ip_ranges list. IP ranges can be removed regardless of
20365 /// its status, as long as no node pools are using them.
20366 ///
20367 /// # Working with unknown values
20368 ///
20369 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20370 /// additional enum variants at any time. Adding new variants is not considered
20371 /// a breaking change. Applications should write their code in anticipation of:
20372 ///
20373 /// - New values appearing in future releases of the client library, **and**
20374 /// - New values received dynamically, without application changes.
20375 ///
20376 /// Please consult the [Working with enums] section in the user guide for some
20377 /// guidelines.
20378 ///
20379 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20380 #[derive(Clone, Debug, PartialEq)]
20381 #[non_exhaustive]
20382 pub enum Status {
20383 /// Not set, same as ACTIVE.
20384 Unspecified,
20385 /// ACTIVE status indicates that the subnet is available for new node pool
20386 /// creation.
20387 Active,
20388 /// DRAINING status indicates that the subnet is not used for new node pool
20389 /// creation.
20390 Draining,
20391 /// If set, the enum was initialized with an unknown value.
20392 ///
20393 /// Applications can examine the value using [Status::value] or
20394 /// [Status::name].
20395 UnknownValue(status::UnknownValue),
20396 }
20397
20398 #[doc(hidden)]
20399 pub mod status {
20400 #[allow(unused_imports)]
20401 use super::*;
20402 #[derive(Clone, Debug, PartialEq)]
20403 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20404 }
20405
20406 impl Status {
20407 /// Gets the enum value.
20408 ///
20409 /// Returns `None` if the enum contains an unknown value deserialized from
20410 /// the string representation of enums.
20411 pub fn value(&self) -> std::option::Option<i32> {
20412 match self {
20413 Self::Unspecified => std::option::Option::Some(0),
20414 Self::Active => std::option::Option::Some(1),
20415 Self::Draining => std::option::Option::Some(2),
20416 Self::UnknownValue(u) => u.0.value(),
20417 }
20418 }
20419
20420 /// Gets the enum value as a string.
20421 ///
20422 /// Returns `None` if the enum contains an unknown value deserialized from
20423 /// the integer representation of enums.
20424 pub fn name(&self) -> std::option::Option<&str> {
20425 match self {
20426 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
20427 Self::Active => std::option::Option::Some("ACTIVE"),
20428 Self::Draining => std::option::Option::Some("DRAINING"),
20429 Self::UnknownValue(u) => u.0.name(),
20430 }
20431 }
20432 }
20433
20434 impl std::default::Default for Status {
20435 fn default() -> Self {
20436 use std::convert::From;
20437 Self::from(0)
20438 }
20439 }
20440
20441 impl std::fmt::Display for Status {
20442 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20443 wkt::internal::display_enum(f, self.name(), self.value())
20444 }
20445 }
20446
20447 impl std::convert::From<i32> for Status {
20448 fn from(value: i32) -> Self {
20449 match value {
20450 0 => Self::Unspecified,
20451 1 => Self::Active,
20452 2 => Self::Draining,
20453 _ => Self::UnknownValue(status::UnknownValue(
20454 wkt::internal::UnknownEnumValue::Integer(value),
20455 )),
20456 }
20457 }
20458 }
20459
20460 impl std::convert::From<&str> for Status {
20461 fn from(value: &str) -> Self {
20462 use std::string::ToString;
20463 match value {
20464 "STATUS_UNSPECIFIED" => Self::Unspecified,
20465 "ACTIVE" => Self::Active,
20466 "DRAINING" => Self::Draining,
20467 _ => Self::UnknownValue(status::UnknownValue(
20468 wkt::internal::UnknownEnumValue::String(value.to_string()),
20469 )),
20470 }
20471 }
20472 }
20473
20474 impl serde::ser::Serialize for Status {
20475 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20476 where
20477 S: serde::Serializer,
20478 {
20479 match self {
20480 Self::Unspecified => serializer.serialize_i32(0),
20481 Self::Active => serializer.serialize_i32(1),
20482 Self::Draining => serializer.serialize_i32(2),
20483 Self::UnknownValue(u) => u.0.serialize(serializer),
20484 }
20485 }
20486 }
20487
20488 impl<'de> serde::de::Deserialize<'de> for Status {
20489 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20490 where
20491 D: serde::Deserializer<'de>,
20492 {
20493 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
20494 ".google.container.v1.AdditionalIPRangesConfig.Status",
20495 ))
20496 }
20497 }
20498}
20499
20500/// DesiredAdditionalIPRangesConfig is a wrapper used for cluster update
20501/// operation and contains multiple AdditionalIPRangesConfigs.
20502#[derive(Clone, Default, PartialEq)]
20503#[non_exhaustive]
20504pub struct DesiredAdditionalIPRangesConfig {
20505 /// List of additional IP ranges configs where each AdditionalIPRangesConfig
20506 /// corresponds to one subnetwork's IP ranges
20507 pub additional_ip_ranges_configs: std::vec::Vec<crate::model::AdditionalIPRangesConfig>,
20508
20509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20510}
20511
20512impl DesiredAdditionalIPRangesConfig {
20513 /// Creates a new default instance.
20514 pub fn new() -> Self {
20515 std::default::Default::default()
20516 }
20517
20518 /// Sets the value of [additional_ip_ranges_configs][crate::model::DesiredAdditionalIPRangesConfig::additional_ip_ranges_configs].
20519 ///
20520 /// # Example
20521 /// ```ignore,no_run
20522 /// # use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
20523 /// use google_cloud_container_v1::model::AdditionalIPRangesConfig;
20524 /// let x = DesiredAdditionalIPRangesConfig::new()
20525 /// .set_additional_ip_ranges_configs([
20526 /// AdditionalIPRangesConfig::default()/* use setters */,
20527 /// AdditionalIPRangesConfig::default()/* use (different) setters */,
20528 /// ]);
20529 /// ```
20530 pub fn set_additional_ip_ranges_configs<T, V>(mut self, v: T) -> Self
20531 where
20532 T: std::iter::IntoIterator<Item = V>,
20533 V: std::convert::Into<crate::model::AdditionalIPRangesConfig>,
20534 {
20535 use std::iter::Iterator;
20536 self.additional_ip_ranges_configs = v.into_iter().map(|i| i.into()).collect();
20537 self
20538 }
20539}
20540
20541impl wkt::message::Message for DesiredAdditionalIPRangesConfig {
20542 fn typename() -> &'static str {
20543 "type.googleapis.com/google.container.v1.DesiredAdditionalIPRangesConfig"
20544 }
20545}
20546
20547/// AutoIpamConfig contains all information related to Auto IPAM
20548#[derive(Clone, Default, PartialEq)]
20549#[non_exhaustive]
20550pub struct AutoIpamConfig {
20551 /// The flag that enables Auto IPAM on this cluster
20552 pub enabled: std::option::Option<bool>,
20553
20554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20555}
20556
20557impl AutoIpamConfig {
20558 /// Creates a new default instance.
20559 pub fn new() -> Self {
20560 std::default::Default::default()
20561 }
20562
20563 /// Sets the value of [enabled][crate::model::AutoIpamConfig::enabled].
20564 ///
20565 /// # Example
20566 /// ```ignore,no_run
20567 /// # use google_cloud_container_v1::model::AutoIpamConfig;
20568 /// let x = AutoIpamConfig::new().set_enabled(true);
20569 /// ```
20570 pub fn set_enabled<T>(mut self, v: T) -> Self
20571 where
20572 T: std::convert::Into<bool>,
20573 {
20574 self.enabled = std::option::Option::Some(v.into());
20575 self
20576 }
20577
20578 /// Sets or clears the value of [enabled][crate::model::AutoIpamConfig::enabled].
20579 ///
20580 /// # Example
20581 /// ```ignore,no_run
20582 /// # use google_cloud_container_v1::model::AutoIpamConfig;
20583 /// let x = AutoIpamConfig::new().set_or_clear_enabled(Some(false));
20584 /// let x = AutoIpamConfig::new().set_or_clear_enabled(None::<bool>);
20585 /// ```
20586 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
20587 where
20588 T: std::convert::Into<bool>,
20589 {
20590 self.enabled = v.map(|x| x.into());
20591 self
20592 }
20593}
20594
20595impl wkt::message::Message for AutoIpamConfig {
20596 fn typename() -> &'static str {
20597 "type.googleapis.com/google.container.v1.AutoIpamConfig"
20598 }
20599}
20600
20601/// RangeInfo contains the range name and the range utilization by this cluster.
20602#[derive(Clone, Default, PartialEq)]
20603#[non_exhaustive]
20604pub struct RangeInfo {
20605 /// Output only. Name of a range.
20606 pub range_name: std::string::String,
20607
20608 /// Output only. The utilization of the range.
20609 pub utilization: f64,
20610
20611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20612}
20613
20614impl RangeInfo {
20615 /// Creates a new default instance.
20616 pub fn new() -> Self {
20617 std::default::Default::default()
20618 }
20619
20620 /// Sets the value of [range_name][crate::model::RangeInfo::range_name].
20621 ///
20622 /// # Example
20623 /// ```ignore,no_run
20624 /// # use google_cloud_container_v1::model::RangeInfo;
20625 /// let x = RangeInfo::new().set_range_name("example");
20626 /// ```
20627 pub fn set_range_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20628 self.range_name = v.into();
20629 self
20630 }
20631
20632 /// Sets the value of [utilization][crate::model::RangeInfo::utilization].
20633 ///
20634 /// # Example
20635 /// ```ignore,no_run
20636 /// # use google_cloud_container_v1::model::RangeInfo;
20637 /// let x = RangeInfo::new().set_utilization(42.0);
20638 /// ```
20639 pub fn set_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
20640 self.utilization = v.into();
20641 self
20642 }
20643}
20644
20645impl wkt::message::Message for RangeInfo {
20646 fn typename() -> &'static str {
20647 "type.googleapis.com/google.container.v1.RangeInfo"
20648 }
20649}
20650
20651/// DesiredEnterpriseConfig is a wrapper used for updating enterprise_config.
20652///
20653/// Deprecated: GKE Enterprise features are now available without an Enterprise
20654/// tier.
20655#[derive(Clone, Default, PartialEq)]
20656#[non_exhaustive]
20657#[deprecated]
20658pub struct DesiredEnterpriseConfig {
20659 /// desired_tier specifies the desired tier of the cluster.
20660 pub desired_tier: crate::model::enterprise_config::ClusterTier,
20661
20662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20663}
20664
20665impl DesiredEnterpriseConfig {
20666 /// Creates a new default instance.
20667 pub fn new() -> Self {
20668 std::default::Default::default()
20669 }
20670
20671 /// Sets the value of [desired_tier][crate::model::DesiredEnterpriseConfig::desired_tier].
20672 ///
20673 /// # Example
20674 /// ```ignore,no_run
20675 /// # use google_cloud_container_v1::model::DesiredEnterpriseConfig;
20676 /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
20677 /// let x0 = DesiredEnterpriseConfig::new().set_desired_tier(ClusterTier::Standard);
20678 /// let x1 = DesiredEnterpriseConfig::new().set_desired_tier(ClusterTier::Enterprise);
20679 /// ```
20680 pub fn set_desired_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
20681 mut self,
20682 v: T,
20683 ) -> Self {
20684 self.desired_tier = v.into();
20685 self
20686 }
20687}
20688
20689impl wkt::message::Message for DesiredEnterpriseConfig {
20690 fn typename() -> &'static str {
20691 "type.googleapis.com/google.container.v1.DesiredEnterpriseConfig"
20692 }
20693}
20694
20695/// This operation resource represents operations that may have happened or are
20696/// happening on the cluster. All fields are output only.
20697#[derive(Clone, Default, PartialEq)]
20698#[non_exhaustive]
20699pub struct Operation {
20700 /// Output only. The server-assigned ID for the operation.
20701 pub name: std::string::String,
20702
20703 /// Output only. The name of the Google Compute Engine
20704 /// [zone](https://cloud.google.com/compute/docs/zones#available)
20705 /// in which the operation is taking place. This field is deprecated, use
20706 /// location instead.
20707 #[deprecated]
20708 pub zone: std::string::String,
20709
20710 /// Output only. The operation type.
20711 pub operation_type: crate::model::operation::Type,
20712
20713 /// Output only. The current status of the operation.
20714 pub status: crate::model::operation::Status,
20715
20716 /// Output only. Detailed operation progress, if available.
20717 pub detail: std::string::String,
20718
20719 /// Output only. If an error has occurred, a textual description of the error.
20720 /// Deprecated. Use the field error instead.
20721 #[deprecated]
20722 pub status_message: std::string::String,
20723
20724 /// Output only. Server-defined URI for the operation. Example:
20725 /// `<https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123>`.
20726 pub self_link: std::string::String,
20727
20728 /// Output only. Server-defined URI for the target of the operation. The format
20729 /// of this is a URI to the resource being modified (such as a cluster, node
20730 /// pool, or node). For node pool repairs, there may be multiple nodes being
20731 /// repaired, but only one will be the target.
20732 ///
20733 /// Examples:
20734 ///
20735 ///
20736 /// ##
20737 ///
20738 /// `<https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster>`
20739 ///
20740 /// ##
20741 ///
20742 /// `<https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np>`
20743 ///
20744 /// `<https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node>`
20745 pub target_link: std::string::String,
20746
20747 /// Output only. The name of the Google Compute Engine
20748 /// [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
20749 /// or
20750 /// [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
20751 /// in which the cluster resides.
20752 pub location: std::string::String,
20753
20754 /// Output only. The time the operation started, in
20755 /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
20756 pub start_time: std::string::String,
20757
20758 /// Output only. The time the operation completed, in
20759 /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
20760 pub end_time: std::string::String,
20761
20762 /// Output only. Progress information for an operation.
20763 pub progress: std::option::Option<crate::model::OperationProgress>,
20764
20765 /// Which conditions caused the current cluster state.
20766 /// Deprecated. Use field error instead.
20767 #[deprecated]
20768 pub cluster_conditions: std::vec::Vec<crate::model::StatusCondition>,
20769
20770 /// Which conditions caused the current node pool state.
20771 /// Deprecated. Use field error instead.
20772 #[deprecated]
20773 pub nodepool_conditions: std::vec::Vec<crate::model::StatusCondition>,
20774
20775 /// The error result of the operation in case of failure.
20776 pub error: std::option::Option<google_cloud_rpc::model::Status>,
20777
20778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20779}
20780
20781impl Operation {
20782 /// Creates a new default instance.
20783 pub fn new() -> Self {
20784 std::default::Default::default()
20785 }
20786
20787 /// Sets the value of [name][crate::model::Operation::name].
20788 ///
20789 /// # Example
20790 /// ```ignore,no_run
20791 /// # use google_cloud_container_v1::model::Operation;
20792 /// let x = Operation::new().set_name("example");
20793 /// ```
20794 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20795 self.name = v.into();
20796 self
20797 }
20798
20799 /// Sets the value of [zone][crate::model::Operation::zone].
20800 ///
20801 /// # Example
20802 /// ```ignore,no_run
20803 /// # use google_cloud_container_v1::model::Operation;
20804 /// let x = Operation::new().set_zone("example");
20805 /// ```
20806 #[deprecated]
20807 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20808 self.zone = v.into();
20809 self
20810 }
20811
20812 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
20813 ///
20814 /// # Example
20815 /// ```ignore,no_run
20816 /// # use google_cloud_container_v1::model::Operation;
20817 /// use google_cloud_container_v1::model::operation::Type;
20818 /// let x0 = Operation::new().set_operation_type(Type::CreateCluster);
20819 /// let x1 = Operation::new().set_operation_type(Type::DeleteCluster);
20820 /// let x2 = Operation::new().set_operation_type(Type::UpgradeMaster);
20821 /// ```
20822 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::Type>>(
20823 mut self,
20824 v: T,
20825 ) -> Self {
20826 self.operation_type = v.into();
20827 self
20828 }
20829
20830 /// Sets the value of [status][crate::model::Operation::status].
20831 ///
20832 /// # Example
20833 /// ```ignore,no_run
20834 /// # use google_cloud_container_v1::model::Operation;
20835 /// use google_cloud_container_v1::model::operation::Status;
20836 /// let x0 = Operation::new().set_status(Status::Pending);
20837 /// let x1 = Operation::new().set_status(Status::Running);
20838 /// let x2 = Operation::new().set_status(Status::Done);
20839 /// ```
20840 pub fn set_status<T: std::convert::Into<crate::model::operation::Status>>(
20841 mut self,
20842 v: T,
20843 ) -> Self {
20844 self.status = v.into();
20845 self
20846 }
20847
20848 /// Sets the value of [detail][crate::model::Operation::detail].
20849 ///
20850 /// # Example
20851 /// ```ignore,no_run
20852 /// # use google_cloud_container_v1::model::Operation;
20853 /// let x = Operation::new().set_detail("example");
20854 /// ```
20855 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20856 self.detail = v.into();
20857 self
20858 }
20859
20860 /// Sets the value of [status_message][crate::model::Operation::status_message].
20861 ///
20862 /// # Example
20863 /// ```ignore,no_run
20864 /// # use google_cloud_container_v1::model::Operation;
20865 /// let x = Operation::new().set_status_message("example");
20866 /// ```
20867 #[deprecated]
20868 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20869 self.status_message = v.into();
20870 self
20871 }
20872
20873 /// Sets the value of [self_link][crate::model::Operation::self_link].
20874 ///
20875 /// # Example
20876 /// ```ignore,no_run
20877 /// # use google_cloud_container_v1::model::Operation;
20878 /// let x = Operation::new().set_self_link("example");
20879 /// ```
20880 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20881 self.self_link = v.into();
20882 self
20883 }
20884
20885 /// Sets the value of [target_link][crate::model::Operation::target_link].
20886 ///
20887 /// # Example
20888 /// ```ignore,no_run
20889 /// # use google_cloud_container_v1::model::Operation;
20890 /// let x = Operation::new().set_target_link("example");
20891 /// ```
20892 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20893 self.target_link = v.into();
20894 self
20895 }
20896
20897 /// Sets the value of [location][crate::model::Operation::location].
20898 ///
20899 /// # Example
20900 /// ```ignore,no_run
20901 /// # use google_cloud_container_v1::model::Operation;
20902 /// let x = Operation::new().set_location("example");
20903 /// ```
20904 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20905 self.location = v.into();
20906 self
20907 }
20908
20909 /// Sets the value of [start_time][crate::model::Operation::start_time].
20910 ///
20911 /// # Example
20912 /// ```ignore,no_run
20913 /// # use google_cloud_container_v1::model::Operation;
20914 /// let x = Operation::new().set_start_time("example");
20915 /// ```
20916 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20917 self.start_time = v.into();
20918 self
20919 }
20920
20921 /// Sets the value of [end_time][crate::model::Operation::end_time].
20922 ///
20923 /// # Example
20924 /// ```ignore,no_run
20925 /// # use google_cloud_container_v1::model::Operation;
20926 /// let x = Operation::new().set_end_time("example");
20927 /// ```
20928 pub fn set_end_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20929 self.end_time = v.into();
20930 self
20931 }
20932
20933 /// Sets the value of [progress][crate::model::Operation::progress].
20934 ///
20935 /// # Example
20936 /// ```ignore,no_run
20937 /// # use google_cloud_container_v1::model::Operation;
20938 /// use google_cloud_container_v1::model::OperationProgress;
20939 /// let x = Operation::new().set_progress(OperationProgress::default()/* use setters */);
20940 /// ```
20941 pub fn set_progress<T>(mut self, v: T) -> Self
20942 where
20943 T: std::convert::Into<crate::model::OperationProgress>,
20944 {
20945 self.progress = std::option::Option::Some(v.into());
20946 self
20947 }
20948
20949 /// Sets or clears the value of [progress][crate::model::Operation::progress].
20950 ///
20951 /// # Example
20952 /// ```ignore,no_run
20953 /// # use google_cloud_container_v1::model::Operation;
20954 /// use google_cloud_container_v1::model::OperationProgress;
20955 /// let x = Operation::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
20956 /// let x = Operation::new().set_or_clear_progress(None::<OperationProgress>);
20957 /// ```
20958 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
20959 where
20960 T: std::convert::Into<crate::model::OperationProgress>,
20961 {
20962 self.progress = v.map(|x| x.into());
20963 self
20964 }
20965
20966 /// Sets the value of [cluster_conditions][crate::model::Operation::cluster_conditions].
20967 ///
20968 /// # Example
20969 /// ```ignore,no_run
20970 /// # use google_cloud_container_v1::model::Operation;
20971 /// use google_cloud_container_v1::model::StatusCondition;
20972 /// let x = Operation::new()
20973 /// .set_cluster_conditions([
20974 /// StatusCondition::default()/* use setters */,
20975 /// StatusCondition::default()/* use (different) setters */,
20976 /// ]);
20977 /// ```
20978 #[deprecated]
20979 pub fn set_cluster_conditions<T, V>(mut self, v: T) -> Self
20980 where
20981 T: std::iter::IntoIterator<Item = V>,
20982 V: std::convert::Into<crate::model::StatusCondition>,
20983 {
20984 use std::iter::Iterator;
20985 self.cluster_conditions = v.into_iter().map(|i| i.into()).collect();
20986 self
20987 }
20988
20989 /// Sets the value of [nodepool_conditions][crate::model::Operation::nodepool_conditions].
20990 ///
20991 /// # Example
20992 /// ```ignore,no_run
20993 /// # use google_cloud_container_v1::model::Operation;
20994 /// use google_cloud_container_v1::model::StatusCondition;
20995 /// let x = Operation::new()
20996 /// .set_nodepool_conditions([
20997 /// StatusCondition::default()/* use setters */,
20998 /// StatusCondition::default()/* use (different) setters */,
20999 /// ]);
21000 /// ```
21001 #[deprecated]
21002 pub fn set_nodepool_conditions<T, V>(mut self, v: T) -> Self
21003 where
21004 T: std::iter::IntoIterator<Item = V>,
21005 V: std::convert::Into<crate::model::StatusCondition>,
21006 {
21007 use std::iter::Iterator;
21008 self.nodepool_conditions = v.into_iter().map(|i| i.into()).collect();
21009 self
21010 }
21011
21012 /// Sets the value of [error][crate::model::Operation::error].
21013 ///
21014 /// # Example
21015 /// ```ignore,no_run
21016 /// # use google_cloud_container_v1::model::Operation;
21017 /// use google_cloud_rpc::model::Status;
21018 /// let x = Operation::new().set_error(Status::default()/* use setters */);
21019 /// ```
21020 pub fn set_error<T>(mut self, v: T) -> Self
21021 where
21022 T: std::convert::Into<google_cloud_rpc::model::Status>,
21023 {
21024 self.error = std::option::Option::Some(v.into());
21025 self
21026 }
21027
21028 /// Sets or clears the value of [error][crate::model::Operation::error].
21029 ///
21030 /// # Example
21031 /// ```ignore,no_run
21032 /// # use google_cloud_container_v1::model::Operation;
21033 /// use google_cloud_rpc::model::Status;
21034 /// let x = Operation::new().set_or_clear_error(Some(Status::default()/* use setters */));
21035 /// let x = Operation::new().set_or_clear_error(None::<Status>);
21036 /// ```
21037 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
21038 where
21039 T: std::convert::Into<google_cloud_rpc::model::Status>,
21040 {
21041 self.error = v.map(|x| x.into());
21042 self
21043 }
21044}
21045
21046impl wkt::message::Message for Operation {
21047 fn typename() -> &'static str {
21048 "type.googleapis.com/google.container.v1.Operation"
21049 }
21050}
21051
21052/// Defines additional types related to [Operation].
21053pub mod operation {
21054 #[allow(unused_imports)]
21055 use super::*;
21056
21057 /// Current status of the operation.
21058 ///
21059 /// # Working with unknown values
21060 ///
21061 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21062 /// additional enum variants at any time. Adding new variants is not considered
21063 /// a breaking change. Applications should write their code in anticipation of:
21064 ///
21065 /// - New values appearing in future releases of the client library, **and**
21066 /// - New values received dynamically, without application changes.
21067 ///
21068 /// Please consult the [Working with enums] section in the user guide for some
21069 /// guidelines.
21070 ///
21071 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21072 #[derive(Clone, Debug, PartialEq)]
21073 #[non_exhaustive]
21074 pub enum Status {
21075 /// Not set.
21076 Unspecified,
21077 /// The operation has been created.
21078 Pending,
21079 /// The operation is currently running.
21080 Running,
21081 /// The operation is done, either cancelled or completed.
21082 Done,
21083 /// The operation is aborting.
21084 Aborting,
21085 /// If set, the enum was initialized with an unknown value.
21086 ///
21087 /// Applications can examine the value using [Status::value] or
21088 /// [Status::name].
21089 UnknownValue(status::UnknownValue),
21090 }
21091
21092 #[doc(hidden)]
21093 pub mod status {
21094 #[allow(unused_imports)]
21095 use super::*;
21096 #[derive(Clone, Debug, PartialEq)]
21097 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21098 }
21099
21100 impl Status {
21101 /// Gets the enum value.
21102 ///
21103 /// Returns `None` if the enum contains an unknown value deserialized from
21104 /// the string representation of enums.
21105 pub fn value(&self) -> std::option::Option<i32> {
21106 match self {
21107 Self::Unspecified => std::option::Option::Some(0),
21108 Self::Pending => std::option::Option::Some(1),
21109 Self::Running => std::option::Option::Some(2),
21110 Self::Done => std::option::Option::Some(3),
21111 Self::Aborting => std::option::Option::Some(4),
21112 Self::UnknownValue(u) => u.0.value(),
21113 }
21114 }
21115
21116 /// Gets the enum value as a string.
21117 ///
21118 /// Returns `None` if the enum contains an unknown value deserialized from
21119 /// the integer representation of enums.
21120 pub fn name(&self) -> std::option::Option<&str> {
21121 match self {
21122 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
21123 Self::Pending => std::option::Option::Some("PENDING"),
21124 Self::Running => std::option::Option::Some("RUNNING"),
21125 Self::Done => std::option::Option::Some("DONE"),
21126 Self::Aborting => std::option::Option::Some("ABORTING"),
21127 Self::UnknownValue(u) => u.0.name(),
21128 }
21129 }
21130 }
21131
21132 impl std::default::Default for Status {
21133 fn default() -> Self {
21134 use std::convert::From;
21135 Self::from(0)
21136 }
21137 }
21138
21139 impl std::fmt::Display for Status {
21140 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21141 wkt::internal::display_enum(f, self.name(), self.value())
21142 }
21143 }
21144
21145 impl std::convert::From<i32> for Status {
21146 fn from(value: i32) -> Self {
21147 match value {
21148 0 => Self::Unspecified,
21149 1 => Self::Pending,
21150 2 => Self::Running,
21151 3 => Self::Done,
21152 4 => Self::Aborting,
21153 _ => Self::UnknownValue(status::UnknownValue(
21154 wkt::internal::UnknownEnumValue::Integer(value),
21155 )),
21156 }
21157 }
21158 }
21159
21160 impl std::convert::From<&str> for Status {
21161 fn from(value: &str) -> Self {
21162 use std::string::ToString;
21163 match value {
21164 "STATUS_UNSPECIFIED" => Self::Unspecified,
21165 "PENDING" => Self::Pending,
21166 "RUNNING" => Self::Running,
21167 "DONE" => Self::Done,
21168 "ABORTING" => Self::Aborting,
21169 _ => Self::UnknownValue(status::UnknownValue(
21170 wkt::internal::UnknownEnumValue::String(value.to_string()),
21171 )),
21172 }
21173 }
21174 }
21175
21176 impl serde::ser::Serialize for Status {
21177 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21178 where
21179 S: serde::Serializer,
21180 {
21181 match self {
21182 Self::Unspecified => serializer.serialize_i32(0),
21183 Self::Pending => serializer.serialize_i32(1),
21184 Self::Running => serializer.serialize_i32(2),
21185 Self::Done => serializer.serialize_i32(3),
21186 Self::Aborting => serializer.serialize_i32(4),
21187 Self::UnknownValue(u) => u.0.serialize(serializer),
21188 }
21189 }
21190 }
21191
21192 impl<'de> serde::de::Deserialize<'de> for Status {
21193 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21194 where
21195 D: serde::Deserializer<'de>,
21196 {
21197 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
21198 ".google.container.v1.Operation.Status",
21199 ))
21200 }
21201 }
21202
21203 /// Operation type categorizes the operation.
21204 ///
21205 /// # Working with unknown values
21206 ///
21207 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21208 /// additional enum variants at any time. Adding new variants is not considered
21209 /// a breaking change. Applications should write their code in anticipation of:
21210 ///
21211 /// - New values appearing in future releases of the client library, **and**
21212 /// - New values received dynamically, without application changes.
21213 ///
21214 /// Please consult the [Working with enums] section in the user guide for some
21215 /// guidelines.
21216 ///
21217 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21218 #[derive(Clone, Debug, PartialEq)]
21219 #[non_exhaustive]
21220 pub enum Type {
21221 /// Not set.
21222 Unspecified,
21223 /// The cluster is being created. The cluster should be assumed to be
21224 /// unusable until the operation finishes.
21225 ///
21226 /// In the event of the operation failing, the cluster will enter the
21227 /// [ERROR state][google.container.v1.Cluster.Status.ERROR] and eventually be
21228 /// deleted.
21229 ///
21230 /// [google.container.v1.Cluster.Status.ERROR]: crate::model::cluster::Status::Error
21231 CreateCluster,
21232 /// The cluster is being deleted. The cluster should be assumed to be
21233 /// unusable as soon as this operation starts.
21234 ///
21235 /// In the event of the operation failing, the cluster will enter the
21236 /// [ERROR state][google.container.v1.Cluster.Status.ERROR] and the deletion
21237 /// will be automatically retried until completed.
21238 ///
21239 /// [google.container.v1.Cluster.Status.ERROR]: crate::model::cluster::Status::Error
21240 DeleteCluster,
21241 /// The [cluster
21242 /// version][google.container.v1.ClusterUpdate.desired_master_version] is
21243 /// being updated. Note that this includes "upgrades" to the same version,
21244 /// which are simply a recreation. This also includes
21245 /// [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically).
21246 /// For more details, see [documentation on cluster
21247 /// upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades).
21248 ///
21249 /// [google.container.v1.ClusterUpdate.desired_master_version]: crate::model::ClusterUpdate::desired_master_version
21250 UpgradeMaster,
21251 /// A node pool is being updated. Despite calling this an "upgrade", this
21252 /// includes most forms of updates to node pools. This also includes
21253 /// [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades).
21254 ///
21255 /// This operation sets the
21256 /// [progress][google.container.v1.Operation.progress] field and may be
21257 /// [canceled][google.container.v1.ClusterManager.CancelOperation].
21258 ///
21259 /// The upgrade strategy depends on [node pool
21260 /// configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies).
21261 /// The nodes are generally still usable during this operation.
21262 ///
21263 /// [google.container.v1.ClusterManager.CancelOperation]: crate::client::ClusterManager::cancel_operation
21264 /// [google.container.v1.Operation.progress]: crate::model::Operation::progress
21265 UpgradeNodes,
21266 /// A problem has been detected with the control plane and is being repaired.
21267 /// This operation type is initiated by GKE. For more details, see
21268 /// [documentation on
21269 /// repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
21270 RepairCluster,
21271 /// The cluster is being updated. This is a broad category of operations and
21272 /// includes operations that only change metadata as well as those that must
21273 /// recreate the entire cluster. If the control plane must be recreated, this
21274 /// will cause temporary downtime for zonal clusters.
21275 ///
21276 /// Some features require recreating the nodes as well. Those will be
21277 /// recreated as separate operations and the update may not be completely
21278 /// functional until the node pools recreations finish. Node recreations will
21279 /// generally follow [maintenance
21280 /// policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions).
21281 ///
21282 /// Some GKE-initiated operations use this type. This includes certain types
21283 /// of auto-upgrades and incident mitigations.
21284 UpdateCluster,
21285 /// A node pool is being created. The node pool should be assumed to be
21286 /// unusable until this operation finishes. In the event of an error, the
21287 /// node pool may be partially created.
21288 ///
21289 /// If enabled, [node
21290 /// autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning)
21291 /// may have automatically initiated such operations.
21292 CreateNodePool,
21293 /// The node pool is being deleted. The node pool should be assumed to be
21294 /// unusable as soon as this operation starts.
21295 DeleteNodePool,
21296 /// The node pool's [manamagent][google.container.v1.NodePool.management]
21297 /// field is being updated. These operations only update metadata and may be
21298 /// concurrent with most other operations.
21299 ///
21300 /// [google.container.v1.NodePool.management]: crate::model::NodePool::management
21301 SetNodePoolManagement,
21302 /// A problem has been detected with nodes and [they are being
21303 /// repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair).
21304 /// This operation type is initiated by GKE, typically automatically. This
21305 /// operation may be concurrent with other operations and there may be
21306 /// multiple repairs occurring on the same node pool.
21307 AutoRepairNodes,
21308 /// Unused. Automatic node upgrade uses
21309 /// [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES].
21310 ///
21311 /// [google.container.v1.Operation.Type.UPGRADE_NODES]: crate::model::operation::Type::UpgradeNodes
21312 #[deprecated]
21313 AutoUpgradeNodes,
21314 /// Unused. Updating labels uses
21315 /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
21316 ///
21317 /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
21318 #[deprecated]
21319 SetLabels,
21320 /// Unused. Updating master auth uses
21321 /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
21322 ///
21323 /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
21324 #[deprecated]
21325 SetMasterAuth,
21326 /// The node pool is being resized. With the exception of resizing to or from
21327 /// size zero, the node pool is generally usable during this operation.
21328 SetNodePoolSize,
21329 /// Unused. Updating network policy uses
21330 /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
21331 ///
21332 /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
21333 #[deprecated]
21334 SetNetworkPolicy,
21335 /// Unused. Updating maintenance policy uses
21336 /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
21337 ///
21338 /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
21339 #[deprecated]
21340 SetMaintenancePolicy,
21341 /// The control plane is being resized. This operation type is initiated by
21342 /// GKE. These operations are often performed preemptively to ensure that the
21343 /// control plane has sufficient resources and is not typically an indication
21344 /// of issues. For more details, see
21345 /// [documentation on
21346 /// resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
21347 ResizeCluster,
21348 /// Fleet features of GKE Enterprise are being upgraded. The cluster should
21349 /// be assumed to be blocked for other upgrades until the operation finishes.
21350 FleetFeatureUpgrade,
21351 /// If set, the enum was initialized with an unknown value.
21352 ///
21353 /// Applications can examine the value using [Type::value] or
21354 /// [Type::name].
21355 UnknownValue(r#type::UnknownValue),
21356 }
21357
21358 #[doc(hidden)]
21359 pub mod r#type {
21360 #[allow(unused_imports)]
21361 use super::*;
21362 #[derive(Clone, Debug, PartialEq)]
21363 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21364 }
21365
21366 impl Type {
21367 /// Gets the enum value.
21368 ///
21369 /// Returns `None` if the enum contains an unknown value deserialized from
21370 /// the string representation of enums.
21371 pub fn value(&self) -> std::option::Option<i32> {
21372 match self {
21373 Self::Unspecified => std::option::Option::Some(0),
21374 Self::CreateCluster => std::option::Option::Some(1),
21375 Self::DeleteCluster => std::option::Option::Some(2),
21376 Self::UpgradeMaster => std::option::Option::Some(3),
21377 Self::UpgradeNodes => std::option::Option::Some(4),
21378 Self::RepairCluster => std::option::Option::Some(5),
21379 Self::UpdateCluster => std::option::Option::Some(6),
21380 Self::CreateNodePool => std::option::Option::Some(7),
21381 Self::DeleteNodePool => std::option::Option::Some(8),
21382 Self::SetNodePoolManagement => std::option::Option::Some(9),
21383 Self::AutoRepairNodes => std::option::Option::Some(10),
21384 Self::AutoUpgradeNodes => std::option::Option::Some(11),
21385 Self::SetLabels => std::option::Option::Some(12),
21386 Self::SetMasterAuth => std::option::Option::Some(13),
21387 Self::SetNodePoolSize => std::option::Option::Some(14),
21388 Self::SetNetworkPolicy => std::option::Option::Some(15),
21389 Self::SetMaintenancePolicy => std::option::Option::Some(16),
21390 Self::ResizeCluster => std::option::Option::Some(18),
21391 Self::FleetFeatureUpgrade => std::option::Option::Some(19),
21392 Self::UnknownValue(u) => u.0.value(),
21393 }
21394 }
21395
21396 /// Gets the enum value as a string.
21397 ///
21398 /// Returns `None` if the enum contains an unknown value deserialized from
21399 /// the integer representation of enums.
21400 pub fn name(&self) -> std::option::Option<&str> {
21401 match self {
21402 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
21403 Self::CreateCluster => std::option::Option::Some("CREATE_CLUSTER"),
21404 Self::DeleteCluster => std::option::Option::Some("DELETE_CLUSTER"),
21405 Self::UpgradeMaster => std::option::Option::Some("UPGRADE_MASTER"),
21406 Self::UpgradeNodes => std::option::Option::Some("UPGRADE_NODES"),
21407 Self::RepairCluster => std::option::Option::Some("REPAIR_CLUSTER"),
21408 Self::UpdateCluster => std::option::Option::Some("UPDATE_CLUSTER"),
21409 Self::CreateNodePool => std::option::Option::Some("CREATE_NODE_POOL"),
21410 Self::DeleteNodePool => std::option::Option::Some("DELETE_NODE_POOL"),
21411 Self::SetNodePoolManagement => {
21412 std::option::Option::Some("SET_NODE_POOL_MANAGEMENT")
21413 }
21414 Self::AutoRepairNodes => std::option::Option::Some("AUTO_REPAIR_NODES"),
21415 Self::AutoUpgradeNodes => std::option::Option::Some("AUTO_UPGRADE_NODES"),
21416 Self::SetLabels => std::option::Option::Some("SET_LABELS"),
21417 Self::SetMasterAuth => std::option::Option::Some("SET_MASTER_AUTH"),
21418 Self::SetNodePoolSize => std::option::Option::Some("SET_NODE_POOL_SIZE"),
21419 Self::SetNetworkPolicy => std::option::Option::Some("SET_NETWORK_POLICY"),
21420 Self::SetMaintenancePolicy => std::option::Option::Some("SET_MAINTENANCE_POLICY"),
21421 Self::ResizeCluster => std::option::Option::Some("RESIZE_CLUSTER"),
21422 Self::FleetFeatureUpgrade => std::option::Option::Some("FLEET_FEATURE_UPGRADE"),
21423 Self::UnknownValue(u) => u.0.name(),
21424 }
21425 }
21426 }
21427
21428 impl std::default::Default for Type {
21429 fn default() -> Self {
21430 use std::convert::From;
21431 Self::from(0)
21432 }
21433 }
21434
21435 impl std::fmt::Display for Type {
21436 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21437 wkt::internal::display_enum(f, self.name(), self.value())
21438 }
21439 }
21440
21441 impl std::convert::From<i32> for Type {
21442 fn from(value: i32) -> Self {
21443 match value {
21444 0 => Self::Unspecified,
21445 1 => Self::CreateCluster,
21446 2 => Self::DeleteCluster,
21447 3 => Self::UpgradeMaster,
21448 4 => Self::UpgradeNodes,
21449 5 => Self::RepairCluster,
21450 6 => Self::UpdateCluster,
21451 7 => Self::CreateNodePool,
21452 8 => Self::DeleteNodePool,
21453 9 => Self::SetNodePoolManagement,
21454 10 => Self::AutoRepairNodes,
21455 11 => Self::AutoUpgradeNodes,
21456 12 => Self::SetLabels,
21457 13 => Self::SetMasterAuth,
21458 14 => Self::SetNodePoolSize,
21459 15 => Self::SetNetworkPolicy,
21460 16 => Self::SetMaintenancePolicy,
21461 18 => Self::ResizeCluster,
21462 19 => Self::FleetFeatureUpgrade,
21463 _ => Self::UnknownValue(r#type::UnknownValue(
21464 wkt::internal::UnknownEnumValue::Integer(value),
21465 )),
21466 }
21467 }
21468 }
21469
21470 impl std::convert::From<&str> for Type {
21471 fn from(value: &str) -> Self {
21472 use std::string::ToString;
21473 match value {
21474 "TYPE_UNSPECIFIED" => Self::Unspecified,
21475 "CREATE_CLUSTER" => Self::CreateCluster,
21476 "DELETE_CLUSTER" => Self::DeleteCluster,
21477 "UPGRADE_MASTER" => Self::UpgradeMaster,
21478 "UPGRADE_NODES" => Self::UpgradeNodes,
21479 "REPAIR_CLUSTER" => Self::RepairCluster,
21480 "UPDATE_CLUSTER" => Self::UpdateCluster,
21481 "CREATE_NODE_POOL" => Self::CreateNodePool,
21482 "DELETE_NODE_POOL" => Self::DeleteNodePool,
21483 "SET_NODE_POOL_MANAGEMENT" => Self::SetNodePoolManagement,
21484 "AUTO_REPAIR_NODES" => Self::AutoRepairNodes,
21485 "AUTO_UPGRADE_NODES" => Self::AutoUpgradeNodes,
21486 "SET_LABELS" => Self::SetLabels,
21487 "SET_MASTER_AUTH" => Self::SetMasterAuth,
21488 "SET_NODE_POOL_SIZE" => Self::SetNodePoolSize,
21489 "SET_NETWORK_POLICY" => Self::SetNetworkPolicy,
21490 "SET_MAINTENANCE_POLICY" => Self::SetMaintenancePolicy,
21491 "RESIZE_CLUSTER" => Self::ResizeCluster,
21492 "FLEET_FEATURE_UPGRADE" => Self::FleetFeatureUpgrade,
21493 _ => Self::UnknownValue(r#type::UnknownValue(
21494 wkt::internal::UnknownEnumValue::String(value.to_string()),
21495 )),
21496 }
21497 }
21498 }
21499
21500 impl serde::ser::Serialize for Type {
21501 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21502 where
21503 S: serde::Serializer,
21504 {
21505 match self {
21506 Self::Unspecified => serializer.serialize_i32(0),
21507 Self::CreateCluster => serializer.serialize_i32(1),
21508 Self::DeleteCluster => serializer.serialize_i32(2),
21509 Self::UpgradeMaster => serializer.serialize_i32(3),
21510 Self::UpgradeNodes => serializer.serialize_i32(4),
21511 Self::RepairCluster => serializer.serialize_i32(5),
21512 Self::UpdateCluster => serializer.serialize_i32(6),
21513 Self::CreateNodePool => serializer.serialize_i32(7),
21514 Self::DeleteNodePool => serializer.serialize_i32(8),
21515 Self::SetNodePoolManagement => serializer.serialize_i32(9),
21516 Self::AutoRepairNodes => serializer.serialize_i32(10),
21517 Self::AutoUpgradeNodes => serializer.serialize_i32(11),
21518 Self::SetLabels => serializer.serialize_i32(12),
21519 Self::SetMasterAuth => serializer.serialize_i32(13),
21520 Self::SetNodePoolSize => serializer.serialize_i32(14),
21521 Self::SetNetworkPolicy => serializer.serialize_i32(15),
21522 Self::SetMaintenancePolicy => serializer.serialize_i32(16),
21523 Self::ResizeCluster => serializer.serialize_i32(18),
21524 Self::FleetFeatureUpgrade => serializer.serialize_i32(19),
21525 Self::UnknownValue(u) => u.0.serialize(serializer),
21526 }
21527 }
21528 }
21529
21530 impl<'de> serde::de::Deserialize<'de> for Type {
21531 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21532 where
21533 D: serde::Deserializer<'de>,
21534 {
21535 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
21536 ".google.container.v1.Operation.Type",
21537 ))
21538 }
21539 }
21540}
21541
21542/// Information about operation (or operation stage) progress.
21543#[derive(Clone, Default, PartialEq)]
21544#[non_exhaustive]
21545pub struct OperationProgress {
21546 /// A non-parameterized string describing an operation stage.
21547 /// Unset for single-stage operations.
21548 pub name: std::string::String,
21549
21550 /// Status of an operation stage.
21551 /// Unset for single-stage operations.
21552 pub status: crate::model::operation::Status,
21553
21554 /// Progress metric bundle, for example:
21555 /// metrics: [{name: "nodes done", int_value: 15},
21556 /// {name: "nodes total", int_value: 32}]
21557 /// or
21558 /// metrics: [{name: "progress", double_value: 0.56},
21559 /// {name: "progress scale", double_value: 1.0}]
21560 pub metrics: std::vec::Vec<crate::model::operation_progress::Metric>,
21561
21562 /// Substages of an operation or a stage.
21563 pub stages: std::vec::Vec<crate::model::OperationProgress>,
21564
21565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21566}
21567
21568impl OperationProgress {
21569 /// Creates a new default instance.
21570 pub fn new() -> Self {
21571 std::default::Default::default()
21572 }
21573
21574 /// Sets the value of [name][crate::model::OperationProgress::name].
21575 ///
21576 /// # Example
21577 /// ```ignore,no_run
21578 /// # use google_cloud_container_v1::model::OperationProgress;
21579 /// let x = OperationProgress::new().set_name("example");
21580 /// ```
21581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21582 self.name = v.into();
21583 self
21584 }
21585
21586 /// Sets the value of [status][crate::model::OperationProgress::status].
21587 ///
21588 /// # Example
21589 /// ```ignore,no_run
21590 /// # use google_cloud_container_v1::model::OperationProgress;
21591 /// use google_cloud_container_v1::model::operation::Status;
21592 /// let x0 = OperationProgress::new().set_status(Status::Pending);
21593 /// let x1 = OperationProgress::new().set_status(Status::Running);
21594 /// let x2 = OperationProgress::new().set_status(Status::Done);
21595 /// ```
21596 pub fn set_status<T: std::convert::Into<crate::model::operation::Status>>(
21597 mut self,
21598 v: T,
21599 ) -> Self {
21600 self.status = v.into();
21601 self
21602 }
21603
21604 /// Sets the value of [metrics][crate::model::OperationProgress::metrics].
21605 ///
21606 /// # Example
21607 /// ```ignore,no_run
21608 /// # use google_cloud_container_v1::model::OperationProgress;
21609 /// use google_cloud_container_v1::model::operation_progress::Metric;
21610 /// let x = OperationProgress::new()
21611 /// .set_metrics([
21612 /// Metric::default()/* use setters */,
21613 /// Metric::default()/* use (different) setters */,
21614 /// ]);
21615 /// ```
21616 pub fn set_metrics<T, V>(mut self, v: T) -> Self
21617 where
21618 T: std::iter::IntoIterator<Item = V>,
21619 V: std::convert::Into<crate::model::operation_progress::Metric>,
21620 {
21621 use std::iter::Iterator;
21622 self.metrics = v.into_iter().map(|i| i.into()).collect();
21623 self
21624 }
21625
21626 /// Sets the value of [stages][crate::model::OperationProgress::stages].
21627 ///
21628 /// # Example
21629 /// ```ignore,no_run
21630 /// # use google_cloud_container_v1::model::OperationProgress;
21631 /// let x = OperationProgress::new()
21632 /// .set_stages([
21633 /// OperationProgress::default()/* use setters */,
21634 /// OperationProgress::default()/* use (different) setters */,
21635 /// ]);
21636 /// ```
21637 pub fn set_stages<T, V>(mut self, v: T) -> Self
21638 where
21639 T: std::iter::IntoIterator<Item = V>,
21640 V: std::convert::Into<crate::model::OperationProgress>,
21641 {
21642 use std::iter::Iterator;
21643 self.stages = v.into_iter().map(|i| i.into()).collect();
21644 self
21645 }
21646}
21647
21648impl wkt::message::Message for OperationProgress {
21649 fn typename() -> &'static str {
21650 "type.googleapis.com/google.container.v1.OperationProgress"
21651 }
21652}
21653
21654/// Defines additional types related to [OperationProgress].
21655pub mod operation_progress {
21656 #[allow(unused_imports)]
21657 use super::*;
21658
21659 /// Progress metric is (string, int|float|string) pair.
21660 #[derive(Clone, Default, PartialEq)]
21661 #[non_exhaustive]
21662 pub struct Metric {
21663 /// Required. Metric name, e.g., "nodes total", "percent done".
21664 pub name: std::string::String,
21665
21666 /// Strictly one of the values is required.
21667 pub value: std::option::Option<crate::model::operation_progress::metric::Value>,
21668
21669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21670 }
21671
21672 impl Metric {
21673 /// Creates a new default instance.
21674 pub fn new() -> Self {
21675 std::default::Default::default()
21676 }
21677
21678 /// Sets the value of [name][crate::model::operation_progress::Metric::name].
21679 ///
21680 /// # Example
21681 /// ```ignore,no_run
21682 /// # use google_cloud_container_v1::model::operation_progress::Metric;
21683 /// let x = Metric::new().set_name("example");
21684 /// ```
21685 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21686 self.name = v.into();
21687 self
21688 }
21689
21690 /// Sets the value of [value][crate::model::operation_progress::Metric::value].
21691 ///
21692 /// Note that all the setters affecting `value` are mutually
21693 /// exclusive.
21694 ///
21695 /// # Example
21696 /// ```ignore,no_run
21697 /// # use google_cloud_container_v1::model::operation_progress::Metric;
21698 /// use google_cloud_container_v1::model::operation_progress::metric::Value;
21699 /// let x = Metric::new().set_value(Some(Value::IntValue(42)));
21700 /// ```
21701 pub fn set_value<
21702 T: std::convert::Into<
21703 std::option::Option<crate::model::operation_progress::metric::Value>,
21704 >,
21705 >(
21706 mut self,
21707 v: T,
21708 ) -> Self {
21709 self.value = v.into();
21710 self
21711 }
21712
21713 /// The value of [value][crate::model::operation_progress::Metric::value]
21714 /// if it holds a `IntValue`, `None` if the field is not set or
21715 /// holds a different branch.
21716 pub fn int_value(&self) -> std::option::Option<&i64> {
21717 #[allow(unreachable_patterns)]
21718 self.value.as_ref().and_then(|v| match v {
21719 crate::model::operation_progress::metric::Value::IntValue(v) => {
21720 std::option::Option::Some(v)
21721 }
21722 _ => std::option::Option::None,
21723 })
21724 }
21725
21726 /// Sets the value of [value][crate::model::operation_progress::Metric::value]
21727 /// to hold a `IntValue`.
21728 ///
21729 /// Note that all the setters affecting `value` are
21730 /// mutually exclusive.
21731 ///
21732 /// # Example
21733 /// ```ignore,no_run
21734 /// # use google_cloud_container_v1::model::operation_progress::Metric;
21735 /// let x = Metric::new().set_int_value(42);
21736 /// assert!(x.int_value().is_some());
21737 /// assert!(x.double_value().is_none());
21738 /// assert!(x.string_value().is_none());
21739 /// ```
21740 pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21741 self.value = std::option::Option::Some(
21742 crate::model::operation_progress::metric::Value::IntValue(v.into()),
21743 );
21744 self
21745 }
21746
21747 /// The value of [value][crate::model::operation_progress::Metric::value]
21748 /// if it holds a `DoubleValue`, `None` if the field is not set or
21749 /// holds a different branch.
21750 pub fn double_value(&self) -> std::option::Option<&f64> {
21751 #[allow(unreachable_patterns)]
21752 self.value.as_ref().and_then(|v| match v {
21753 crate::model::operation_progress::metric::Value::DoubleValue(v) => {
21754 std::option::Option::Some(v)
21755 }
21756 _ => std::option::Option::None,
21757 })
21758 }
21759
21760 /// Sets the value of [value][crate::model::operation_progress::Metric::value]
21761 /// to hold a `DoubleValue`.
21762 ///
21763 /// Note that all the setters affecting `value` are
21764 /// mutually exclusive.
21765 ///
21766 /// # Example
21767 /// ```ignore,no_run
21768 /// # use google_cloud_container_v1::model::operation_progress::Metric;
21769 /// let x = Metric::new().set_double_value(42.0);
21770 /// assert!(x.double_value().is_some());
21771 /// assert!(x.int_value().is_none());
21772 /// assert!(x.string_value().is_none());
21773 /// ```
21774 pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21775 self.value = std::option::Option::Some(
21776 crate::model::operation_progress::metric::Value::DoubleValue(v.into()),
21777 );
21778 self
21779 }
21780
21781 /// The value of [value][crate::model::operation_progress::Metric::value]
21782 /// if it holds a `StringValue`, `None` if the field is not set or
21783 /// holds a different branch.
21784 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
21785 #[allow(unreachable_patterns)]
21786 self.value.as_ref().and_then(|v| match v {
21787 crate::model::operation_progress::metric::Value::StringValue(v) => {
21788 std::option::Option::Some(v)
21789 }
21790 _ => std::option::Option::None,
21791 })
21792 }
21793
21794 /// Sets the value of [value][crate::model::operation_progress::Metric::value]
21795 /// to hold a `StringValue`.
21796 ///
21797 /// Note that all the setters affecting `value` are
21798 /// mutually exclusive.
21799 ///
21800 /// # Example
21801 /// ```ignore,no_run
21802 /// # use google_cloud_container_v1::model::operation_progress::Metric;
21803 /// let x = Metric::new().set_string_value("example");
21804 /// assert!(x.string_value().is_some());
21805 /// assert!(x.int_value().is_none());
21806 /// assert!(x.double_value().is_none());
21807 /// ```
21808 pub fn set_string_value<T: std::convert::Into<std::string::String>>(
21809 mut self,
21810 v: T,
21811 ) -> Self {
21812 self.value = std::option::Option::Some(
21813 crate::model::operation_progress::metric::Value::StringValue(v.into()),
21814 );
21815 self
21816 }
21817 }
21818
21819 impl wkt::message::Message for Metric {
21820 fn typename() -> &'static str {
21821 "type.googleapis.com/google.container.v1.OperationProgress.Metric"
21822 }
21823 }
21824
21825 /// Defines additional types related to [Metric].
21826 pub mod metric {
21827 #[allow(unused_imports)]
21828 use super::*;
21829
21830 /// Strictly one of the values is required.
21831 #[derive(Clone, Debug, PartialEq)]
21832 #[non_exhaustive]
21833 pub enum Value {
21834 /// For metrics with integer value.
21835 IntValue(i64),
21836 /// For metrics with floating point value.
21837 DoubleValue(f64),
21838 /// For metrics with custom values (ratios, visual progress, etc.).
21839 StringValue(std::string::String),
21840 }
21841 }
21842}
21843
21844/// CreateClusterRequest creates a cluster.
21845#[derive(Clone, Default, PartialEq)]
21846#[non_exhaustive]
21847pub struct CreateClusterRequest {
21848 /// Deprecated. The Google Developers Console [project ID or project
21849 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21850 /// This field has been deprecated and replaced by the parent field.
21851 #[deprecated]
21852 pub project_id: std::string::String,
21853
21854 /// Deprecated. The name of the Google Compute Engine
21855 /// [zone](https://cloud.google.com/compute/docs/zones#available)
21856 /// in which the cluster resides. This field has been deprecated and replaced
21857 /// by the parent field.
21858 #[deprecated]
21859 pub zone: std::string::String,
21860
21861 /// Required. A [cluster
21862 /// resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters)
21863 pub cluster: std::option::Option<crate::model::Cluster>,
21864
21865 /// The parent (project and location) where the cluster will be created.
21866 /// Specified in the format `projects/*/locations/*`.
21867 pub parent: std::string::String,
21868
21869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21870}
21871
21872impl CreateClusterRequest {
21873 /// Creates a new default instance.
21874 pub fn new() -> Self {
21875 std::default::Default::default()
21876 }
21877
21878 /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
21879 ///
21880 /// # Example
21881 /// ```ignore,no_run
21882 /// # use google_cloud_container_v1::model::CreateClusterRequest;
21883 /// let x = CreateClusterRequest::new().set_project_id("example");
21884 /// ```
21885 #[deprecated]
21886 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21887 self.project_id = v.into();
21888 self
21889 }
21890
21891 /// Sets the value of [zone][crate::model::CreateClusterRequest::zone].
21892 ///
21893 /// # Example
21894 /// ```ignore,no_run
21895 /// # use google_cloud_container_v1::model::CreateClusterRequest;
21896 /// let x = CreateClusterRequest::new().set_zone("example");
21897 /// ```
21898 #[deprecated]
21899 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21900 self.zone = v.into();
21901 self
21902 }
21903
21904 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
21905 ///
21906 /// # Example
21907 /// ```ignore,no_run
21908 /// # use google_cloud_container_v1::model::CreateClusterRequest;
21909 /// use google_cloud_container_v1::model::Cluster;
21910 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
21911 /// ```
21912 pub fn set_cluster<T>(mut self, v: T) -> Self
21913 where
21914 T: std::convert::Into<crate::model::Cluster>,
21915 {
21916 self.cluster = std::option::Option::Some(v.into());
21917 self
21918 }
21919
21920 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
21921 ///
21922 /// # Example
21923 /// ```ignore,no_run
21924 /// # use google_cloud_container_v1::model::CreateClusterRequest;
21925 /// use google_cloud_container_v1::model::Cluster;
21926 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
21927 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
21928 /// ```
21929 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
21930 where
21931 T: std::convert::Into<crate::model::Cluster>,
21932 {
21933 self.cluster = v.map(|x| x.into());
21934 self
21935 }
21936
21937 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
21938 ///
21939 /// # Example
21940 /// ```ignore,no_run
21941 /// # use google_cloud_container_v1::model::CreateClusterRequest;
21942 /// let x = CreateClusterRequest::new().set_parent("example");
21943 /// ```
21944 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21945 self.parent = v.into();
21946 self
21947 }
21948}
21949
21950impl wkt::message::Message for CreateClusterRequest {
21951 fn typename() -> &'static str {
21952 "type.googleapis.com/google.container.v1.CreateClusterRequest"
21953 }
21954}
21955
21956/// GetClusterRequest gets the settings of a cluster.
21957#[derive(Clone, Default, PartialEq)]
21958#[non_exhaustive]
21959pub struct GetClusterRequest {
21960 /// Deprecated. The Google Developers Console [project ID or project
21961 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21962 /// This field has been deprecated and replaced by the name field.
21963 #[deprecated]
21964 pub project_id: std::string::String,
21965
21966 /// Deprecated. The name of the Google Compute Engine
21967 /// [zone](https://cloud.google.com/compute/docs/zones#available)
21968 /// in which the cluster resides. This field has been deprecated and replaced
21969 /// by the name field.
21970 #[deprecated]
21971 pub zone: std::string::String,
21972
21973 /// Deprecated. The name of the cluster to retrieve.
21974 /// This field has been deprecated and replaced by the name field.
21975 #[deprecated]
21976 pub cluster_id: std::string::String,
21977
21978 /// The name (project, location, cluster) of the cluster to retrieve.
21979 /// Specified in the format `projects/*/locations/*/clusters/*`.
21980 pub name: std::string::String,
21981
21982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21983}
21984
21985impl GetClusterRequest {
21986 /// Creates a new default instance.
21987 pub fn new() -> Self {
21988 std::default::Default::default()
21989 }
21990
21991 /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
21992 ///
21993 /// # Example
21994 /// ```ignore,no_run
21995 /// # use google_cloud_container_v1::model::GetClusterRequest;
21996 /// let x = GetClusterRequest::new().set_project_id("example");
21997 /// ```
21998 #[deprecated]
21999 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22000 self.project_id = v.into();
22001 self
22002 }
22003
22004 /// Sets the value of [zone][crate::model::GetClusterRequest::zone].
22005 ///
22006 /// # Example
22007 /// ```ignore,no_run
22008 /// # use google_cloud_container_v1::model::GetClusterRequest;
22009 /// let x = GetClusterRequest::new().set_zone("example");
22010 /// ```
22011 #[deprecated]
22012 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22013 self.zone = v.into();
22014 self
22015 }
22016
22017 /// Sets the value of [cluster_id][crate::model::GetClusterRequest::cluster_id].
22018 ///
22019 /// # Example
22020 /// ```ignore,no_run
22021 /// # use google_cloud_container_v1::model::GetClusterRequest;
22022 /// let x = GetClusterRequest::new().set_cluster_id("example");
22023 /// ```
22024 #[deprecated]
22025 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22026 self.cluster_id = v.into();
22027 self
22028 }
22029
22030 /// Sets the value of [name][crate::model::GetClusterRequest::name].
22031 ///
22032 /// # Example
22033 /// ```ignore,no_run
22034 /// # use google_cloud_container_v1::model::GetClusterRequest;
22035 /// let x = GetClusterRequest::new().set_name("example");
22036 /// ```
22037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22038 self.name = v.into();
22039 self
22040 }
22041}
22042
22043impl wkt::message::Message for GetClusterRequest {
22044 fn typename() -> &'static str {
22045 "type.googleapis.com/google.container.v1.GetClusterRequest"
22046 }
22047}
22048
22049/// UpdateClusterRequest updates the settings of a cluster.
22050#[derive(Clone, Default, PartialEq)]
22051#[non_exhaustive]
22052pub struct UpdateClusterRequest {
22053 /// Deprecated. The Google Developers Console [project ID or project
22054 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
22055 /// This field has been deprecated and replaced by the name field.
22056 #[deprecated]
22057 pub project_id: std::string::String,
22058
22059 /// Deprecated. The name of the Google Compute Engine
22060 /// [zone](https://cloud.google.com/compute/docs/zones#available)
22061 /// in which the cluster resides. This field has been deprecated and replaced
22062 /// by the name field.
22063 #[deprecated]
22064 pub zone: std::string::String,
22065
22066 /// Deprecated. The name of the cluster to upgrade.
22067 /// This field has been deprecated and replaced by the name field.
22068 #[deprecated]
22069 pub cluster_id: std::string::String,
22070
22071 /// Required. A description of the update.
22072 pub update: std::option::Option<crate::model::ClusterUpdate>,
22073
22074 /// The name (project, location, cluster) of the cluster to update.
22075 /// Specified in the format `projects/*/locations/*/clusters/*`.
22076 pub name: std::string::String,
22077
22078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22079}
22080
22081impl UpdateClusterRequest {
22082 /// Creates a new default instance.
22083 pub fn new() -> Self {
22084 std::default::Default::default()
22085 }
22086
22087 /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
22088 ///
22089 /// # Example
22090 /// ```ignore,no_run
22091 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22092 /// let x = UpdateClusterRequest::new().set_project_id("example");
22093 /// ```
22094 #[deprecated]
22095 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22096 self.project_id = v.into();
22097 self
22098 }
22099
22100 /// Sets the value of [zone][crate::model::UpdateClusterRequest::zone].
22101 ///
22102 /// # Example
22103 /// ```ignore,no_run
22104 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22105 /// let x = UpdateClusterRequest::new().set_zone("example");
22106 /// ```
22107 #[deprecated]
22108 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22109 self.zone = v.into();
22110 self
22111 }
22112
22113 /// Sets the value of [cluster_id][crate::model::UpdateClusterRequest::cluster_id].
22114 ///
22115 /// # Example
22116 /// ```ignore,no_run
22117 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22118 /// let x = UpdateClusterRequest::new().set_cluster_id("example");
22119 /// ```
22120 #[deprecated]
22121 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22122 self.cluster_id = v.into();
22123 self
22124 }
22125
22126 /// Sets the value of [update][crate::model::UpdateClusterRequest::update].
22127 ///
22128 /// # Example
22129 /// ```ignore,no_run
22130 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22131 /// use google_cloud_container_v1::model::ClusterUpdate;
22132 /// let x = UpdateClusterRequest::new().set_update(ClusterUpdate::default()/* use setters */);
22133 /// ```
22134 pub fn set_update<T>(mut self, v: T) -> Self
22135 where
22136 T: std::convert::Into<crate::model::ClusterUpdate>,
22137 {
22138 self.update = std::option::Option::Some(v.into());
22139 self
22140 }
22141
22142 /// Sets or clears the value of [update][crate::model::UpdateClusterRequest::update].
22143 ///
22144 /// # Example
22145 /// ```ignore,no_run
22146 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22147 /// use google_cloud_container_v1::model::ClusterUpdate;
22148 /// let x = UpdateClusterRequest::new().set_or_clear_update(Some(ClusterUpdate::default()/* use setters */));
22149 /// let x = UpdateClusterRequest::new().set_or_clear_update(None::<ClusterUpdate>);
22150 /// ```
22151 pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
22152 where
22153 T: std::convert::Into<crate::model::ClusterUpdate>,
22154 {
22155 self.update = v.map(|x| x.into());
22156 self
22157 }
22158
22159 /// Sets the value of [name][crate::model::UpdateClusterRequest::name].
22160 ///
22161 /// # Example
22162 /// ```ignore,no_run
22163 /// # use google_cloud_container_v1::model::UpdateClusterRequest;
22164 /// let x = UpdateClusterRequest::new().set_name("example");
22165 /// ```
22166 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22167 self.name = v.into();
22168 self
22169 }
22170}
22171
22172impl wkt::message::Message for UpdateClusterRequest {
22173 fn typename() -> &'static str {
22174 "type.googleapis.com/google.container.v1.UpdateClusterRequest"
22175 }
22176}
22177
22178/// UpdateNodePoolRequests update a node pool's image and/or version.
22179#[derive(Clone, Default, PartialEq)]
22180#[non_exhaustive]
22181pub struct UpdateNodePoolRequest {
22182 /// Deprecated. The Google Developers Console [project ID or project
22183 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
22184 /// This field has been deprecated and replaced by the name field.
22185 #[deprecated]
22186 pub project_id: std::string::String,
22187
22188 /// Deprecated. The name of the Google Compute Engine
22189 /// [zone](https://cloud.google.com/compute/docs/zones#available)
22190 /// in which the cluster resides. This field has been deprecated and replaced
22191 /// by the name field.
22192 #[deprecated]
22193 pub zone: std::string::String,
22194
22195 /// Deprecated. The name of the cluster to upgrade.
22196 /// This field has been deprecated and replaced by the name field.
22197 #[deprecated]
22198 pub cluster_id: std::string::String,
22199
22200 /// Deprecated. The name of the node pool to upgrade.
22201 /// This field has been deprecated and replaced by the name field.
22202 #[deprecated]
22203 pub node_pool_id: std::string::String,
22204
22205 /// Required. The Kubernetes version to change the nodes to (typically an
22206 /// upgrade).
22207 ///
22208 /// Users may specify either explicit versions offered by Kubernetes Engine or
22209 /// version aliases, which have the following behavior:
22210 ///
22211 /// - "latest": picks the highest valid Kubernetes version
22212 /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
22213 /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
22214 /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
22215 /// - "-": picks the Kubernetes master version
22216 pub node_version: std::string::String,
22217
22218 /// Required. The desired image type for the node pool. Please see
22219 /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
22220 /// for available image types.
22221 pub image_type: std::string::String,
22222
22223 /// The name (project, location, cluster, node pool) of the node pool to
22224 /// update. Specified in the format
22225 /// `projects/*/locations/*/clusters/*/nodePools/*`.
22226 pub name: std::string::String,
22227
22228 /// The desired name of the image name to use for this node.
22229 /// This is used to create clusters using a custom image.
22230 pub image: std::string::String,
22231
22232 /// The project containing the desired image to use for this node pool.
22233 /// This is used to create clusters using a custom image.
22234 pub image_project: std::string::String,
22235
22236 /// The desired list of Google Compute Engine
22237 /// [zones](https://cloud.google.com/compute/docs/zones#available)
22238 /// in which the node pool's nodes should be located. Changing the locations
22239 /// for a node pool will result in nodes being either created or removed from
22240 /// the node pool, depending on whether locations are being added or removed.
22241 ///
22242 /// Warning: It is recommended to update node pool locations in a standalone
22243 /// API call. Do not combine a location update with changes to other fields
22244 /// (such as `tags`, `labels`, `taints`, etc.) in the same request.
22245 /// Otherwise, the API performs a structural modification where changes to
22246 /// other fields will only apply to newly created nodes and will not be
22247 /// applied to existing nodes in the node pool. To ensure all nodes are updated
22248 /// consistently, use a separate API call for location changes.
22249 pub locations: std::vec::Vec<std::string::String>,
22250
22251 /// The desired workload metadata config for the node pool.
22252 pub workload_metadata_config: std::option::Option<crate::model::WorkloadMetadataConfig>,
22253
22254 /// Upgrade settings control disruption and speed of the upgrade.
22255 pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
22256
22257 /// The desired network tags to be applied to all nodes in the node pool.
22258 /// If this field is not present, the tags will not be changed. Otherwise,
22259 /// the existing network tags will be *replaced* with the provided tags.
22260 pub tags: std::option::Option<crate::model::NetworkTags>,
22261
22262 /// The desired node taints to be applied to all nodes in the node pool.
22263 /// If this field is not present, the taints will not be changed. Otherwise,
22264 /// the existing node taints will be *replaced* with the provided taints.
22265 pub taints: std::option::Option<crate::model::NodeTaints>,
22266
22267 /// The desired node labels to be applied to all nodes in the node pool.
22268 /// If this field is not present, the labels will not be changed. Otherwise,
22269 /// the existing node labels will be *replaced* with the provided labels.
22270 pub labels: std::option::Option<crate::model::NodeLabels>,
22271
22272 /// Parameters that can be configured on Linux nodes.
22273 pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
22274
22275 /// Node kubelet configs.
22276 pub kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
22277
22278 /// Node network config.
22279 pub node_network_config: std::option::Option<crate::model::NodeNetworkConfig>,
22280
22281 /// GCFS config.
22282 pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
22283
22284 /// Confidential nodes config.
22285 /// All the nodes in the node pool will be Confidential VM once enabled.
22286 pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
22287
22288 /// Enable or disable gvnic on the node pool.
22289 pub gvnic: std::option::Option<crate::model::VirtualNIC>,
22290
22291 /// The current etag of the node pool.
22292 /// If an etag is provided and does not match the current etag of the node
22293 /// pool, update will be blocked and an ABORTED error will be returned.
22294 pub etag: std::string::String,
22295
22296 /// Enable or disable NCCL fast socket for the node pool.
22297 pub fast_socket: std::option::Option<crate::model::FastSocket>,
22298
22299 /// Logging configuration.
22300 pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
22301
22302 /// The resource labels for the node pool to use to annotate any related
22303 /// Google Compute Engine resources.
22304 pub resource_labels: std::option::Option<crate::model::ResourceLabels>,
22305
22306 /// Parameters that can be configured on Windows nodes.
22307 pub windows_node_config: std::option::Option<crate::model::WindowsNodeConfig>,
22308
22309 /// A list of hardware accelerators to be attached to each node.
22310 /// See
22311 /// <https://cloud.google.com/compute/docs/gpus>
22312 /// for more information about support for GPUs.
22313 pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
22314
22315 /// Optional. The desired [Google Compute Engine machine
22316 /// type](https://cloud.google.com/compute/docs/machine-types)
22317 /// for nodes in the node pool. Initiates an upgrade operation that migrates
22318 /// the nodes in the node pool to the specified machine type.
22319 pub machine_type: std::string::String,
22320
22321 /// Optional. The desired disk type (e.g. 'pd-standard', 'pd-ssd' or
22322 /// 'pd-balanced') for nodes in the node pool.
22323 /// Initiates an upgrade operation that migrates the nodes in the
22324 /// node pool to the specified disk type.
22325 pub disk_type: std::string::String,
22326
22327 /// Optional. The desired disk size for nodes in the node pool specified in GB.
22328 /// The smallest allowed disk size is 10GB.
22329 /// Initiates an upgrade operation that migrates the nodes in the
22330 /// node pool to the specified disk size.
22331 pub disk_size_gb: i64,
22332
22333 /// Desired resource manager tag keys and values to be attached to the nodes
22334 /// for managing Compute Engine firewalls using Network Firewall Policies.
22335 /// Existing tags will be replaced with new values.
22336 pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
22337
22338 /// The desired containerd config for nodes in the node pool.
22339 /// Initiates an upgrade operation that recreates the nodes with the new
22340 /// config.
22341 pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
22342
22343 /// Specifies the configuration of queued provisioning.
22344 pub queued_provisioning: std::option::Option<crate::model::node_pool::QueuedProvisioning>,
22345
22346 /// List of Storage Pools where boot disks are provisioned.
22347 /// Existing Storage Pools will be replaced with storage-pools.
22348 pub storage_pools: std::vec::Vec<std::string::String>,
22349
22350 /// The maximum duration for the nodes to exist.
22351 /// If unspecified, the nodes can exist indefinitely.
22352 pub max_run_duration: std::option::Option<wkt::Duration>,
22353
22354 /// Flex Start flag for enabling Flex Start VM.
22355 pub flex_start: std::option::Option<bool>,
22356
22357 /// The desired boot disk config for nodes in the node pool.
22358 /// Initiates an upgrade operation that migrates the nodes in the
22359 /// node pool to the specified boot disk config.
22360 pub boot_disk: std::option::Option<crate::model::BootDisk>,
22361
22362 /// The desired node drain configuration for nodes in the node pool.
22363 pub node_drain_config: std::option::Option<crate::model::node_pool::NodeDrainConfig>,
22364
22365 /// Consolidation delay defines duration after which the Cluster Autoscaler can
22366 /// scale down underutilized nodes. If not set, nodes are scaled down by
22367 /// default behavior, i.e. according to the chosen autoscaling profile.
22368 pub consolidation_delay: std::option::Option<wkt::Duration>,
22369
22370 /// The taint configuration for the node pool.
22371 pub taint_config: std::option::Option<crate::model::TaintConfig>,
22372
22373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22374}
22375
22376impl UpdateNodePoolRequest {
22377 /// Creates a new default instance.
22378 pub fn new() -> Self {
22379 std::default::Default::default()
22380 }
22381
22382 /// Sets the value of [project_id][crate::model::UpdateNodePoolRequest::project_id].
22383 ///
22384 /// # Example
22385 /// ```ignore,no_run
22386 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22387 /// let x = UpdateNodePoolRequest::new().set_project_id("example");
22388 /// ```
22389 #[deprecated]
22390 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22391 self.project_id = v.into();
22392 self
22393 }
22394
22395 /// Sets the value of [zone][crate::model::UpdateNodePoolRequest::zone].
22396 ///
22397 /// # Example
22398 /// ```ignore,no_run
22399 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22400 /// let x = UpdateNodePoolRequest::new().set_zone("example");
22401 /// ```
22402 #[deprecated]
22403 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22404 self.zone = v.into();
22405 self
22406 }
22407
22408 /// Sets the value of [cluster_id][crate::model::UpdateNodePoolRequest::cluster_id].
22409 ///
22410 /// # Example
22411 /// ```ignore,no_run
22412 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22413 /// let x = UpdateNodePoolRequest::new().set_cluster_id("example");
22414 /// ```
22415 #[deprecated]
22416 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22417 self.cluster_id = v.into();
22418 self
22419 }
22420
22421 /// Sets the value of [node_pool_id][crate::model::UpdateNodePoolRequest::node_pool_id].
22422 ///
22423 /// # Example
22424 /// ```ignore,no_run
22425 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22426 /// let x = UpdateNodePoolRequest::new().set_node_pool_id("example");
22427 /// ```
22428 #[deprecated]
22429 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22430 self.node_pool_id = v.into();
22431 self
22432 }
22433
22434 /// Sets the value of [node_version][crate::model::UpdateNodePoolRequest::node_version].
22435 ///
22436 /// # Example
22437 /// ```ignore,no_run
22438 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22439 /// let x = UpdateNodePoolRequest::new().set_node_version("example");
22440 /// ```
22441 pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22442 self.node_version = v.into();
22443 self
22444 }
22445
22446 /// Sets the value of [image_type][crate::model::UpdateNodePoolRequest::image_type].
22447 ///
22448 /// # Example
22449 /// ```ignore,no_run
22450 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22451 /// let x = UpdateNodePoolRequest::new().set_image_type("example");
22452 /// ```
22453 pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22454 self.image_type = v.into();
22455 self
22456 }
22457
22458 /// Sets the value of [name][crate::model::UpdateNodePoolRequest::name].
22459 ///
22460 /// # Example
22461 /// ```ignore,no_run
22462 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22463 /// let x = UpdateNodePoolRequest::new().set_name("example");
22464 /// ```
22465 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22466 self.name = v.into();
22467 self
22468 }
22469
22470 /// Sets the value of [image][crate::model::UpdateNodePoolRequest::image].
22471 ///
22472 /// # Example
22473 /// ```ignore,no_run
22474 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22475 /// let x = UpdateNodePoolRequest::new().set_image("example");
22476 /// ```
22477 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22478 self.image = v.into();
22479 self
22480 }
22481
22482 /// Sets the value of [image_project][crate::model::UpdateNodePoolRequest::image_project].
22483 ///
22484 /// # Example
22485 /// ```ignore,no_run
22486 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22487 /// let x = UpdateNodePoolRequest::new().set_image_project("example");
22488 /// ```
22489 pub fn set_image_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22490 self.image_project = v.into();
22491 self
22492 }
22493
22494 /// Sets the value of [locations][crate::model::UpdateNodePoolRequest::locations].
22495 ///
22496 /// # Example
22497 /// ```ignore,no_run
22498 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22499 /// let x = UpdateNodePoolRequest::new().set_locations(["a", "b", "c"]);
22500 /// ```
22501 pub fn set_locations<T, V>(mut self, v: T) -> Self
22502 where
22503 T: std::iter::IntoIterator<Item = V>,
22504 V: std::convert::Into<std::string::String>,
22505 {
22506 use std::iter::Iterator;
22507 self.locations = v.into_iter().map(|i| i.into()).collect();
22508 self
22509 }
22510
22511 /// Sets the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
22512 ///
22513 /// # Example
22514 /// ```ignore,no_run
22515 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22516 /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
22517 /// let x = UpdateNodePoolRequest::new().set_workload_metadata_config(WorkloadMetadataConfig::default()/* use setters */);
22518 /// ```
22519 pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
22520 where
22521 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
22522 {
22523 self.workload_metadata_config = std::option::Option::Some(v.into());
22524 self
22525 }
22526
22527 /// Sets or clears the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
22528 ///
22529 /// # Example
22530 /// ```ignore,no_run
22531 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22532 /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
22533 /// let x = UpdateNodePoolRequest::new().set_or_clear_workload_metadata_config(Some(WorkloadMetadataConfig::default()/* use setters */));
22534 /// let x = UpdateNodePoolRequest::new().set_or_clear_workload_metadata_config(None::<WorkloadMetadataConfig>);
22535 /// ```
22536 pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
22537 where
22538 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
22539 {
22540 self.workload_metadata_config = v.map(|x| x.into());
22541 self
22542 }
22543
22544 /// Sets the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
22545 ///
22546 /// # Example
22547 /// ```ignore,no_run
22548 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22549 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22550 /// let x = UpdateNodePoolRequest::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
22551 /// ```
22552 pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
22553 where
22554 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
22555 {
22556 self.upgrade_settings = std::option::Option::Some(v.into());
22557 self
22558 }
22559
22560 /// Sets or clears the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
22561 ///
22562 /// # Example
22563 /// ```ignore,no_run
22564 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22565 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22566 /// let x = UpdateNodePoolRequest::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
22567 /// let x = UpdateNodePoolRequest::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
22568 /// ```
22569 pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
22570 where
22571 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
22572 {
22573 self.upgrade_settings = v.map(|x| x.into());
22574 self
22575 }
22576
22577 /// Sets the value of [tags][crate::model::UpdateNodePoolRequest::tags].
22578 ///
22579 /// # Example
22580 /// ```ignore,no_run
22581 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22582 /// use google_cloud_container_v1::model::NetworkTags;
22583 /// let x = UpdateNodePoolRequest::new().set_tags(NetworkTags::default()/* use setters */);
22584 /// ```
22585 pub fn set_tags<T>(mut self, v: T) -> Self
22586 where
22587 T: std::convert::Into<crate::model::NetworkTags>,
22588 {
22589 self.tags = std::option::Option::Some(v.into());
22590 self
22591 }
22592
22593 /// Sets or clears the value of [tags][crate::model::UpdateNodePoolRequest::tags].
22594 ///
22595 /// # Example
22596 /// ```ignore,no_run
22597 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22598 /// use google_cloud_container_v1::model::NetworkTags;
22599 /// let x = UpdateNodePoolRequest::new().set_or_clear_tags(Some(NetworkTags::default()/* use setters */));
22600 /// let x = UpdateNodePoolRequest::new().set_or_clear_tags(None::<NetworkTags>);
22601 /// ```
22602 pub fn set_or_clear_tags<T>(mut self, v: std::option::Option<T>) -> Self
22603 where
22604 T: std::convert::Into<crate::model::NetworkTags>,
22605 {
22606 self.tags = v.map(|x| x.into());
22607 self
22608 }
22609
22610 /// Sets the value of [taints][crate::model::UpdateNodePoolRequest::taints].
22611 ///
22612 /// # Example
22613 /// ```ignore,no_run
22614 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22615 /// use google_cloud_container_v1::model::NodeTaints;
22616 /// let x = UpdateNodePoolRequest::new().set_taints(NodeTaints::default()/* use setters */);
22617 /// ```
22618 pub fn set_taints<T>(mut self, v: T) -> Self
22619 where
22620 T: std::convert::Into<crate::model::NodeTaints>,
22621 {
22622 self.taints = std::option::Option::Some(v.into());
22623 self
22624 }
22625
22626 /// Sets or clears the value of [taints][crate::model::UpdateNodePoolRequest::taints].
22627 ///
22628 /// # Example
22629 /// ```ignore,no_run
22630 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22631 /// use google_cloud_container_v1::model::NodeTaints;
22632 /// let x = UpdateNodePoolRequest::new().set_or_clear_taints(Some(NodeTaints::default()/* use setters */));
22633 /// let x = UpdateNodePoolRequest::new().set_or_clear_taints(None::<NodeTaints>);
22634 /// ```
22635 pub fn set_or_clear_taints<T>(mut self, v: std::option::Option<T>) -> Self
22636 where
22637 T: std::convert::Into<crate::model::NodeTaints>,
22638 {
22639 self.taints = v.map(|x| x.into());
22640 self
22641 }
22642
22643 /// Sets the value of [labels][crate::model::UpdateNodePoolRequest::labels].
22644 ///
22645 /// # Example
22646 /// ```ignore,no_run
22647 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22648 /// use google_cloud_container_v1::model::NodeLabels;
22649 /// let x = UpdateNodePoolRequest::new().set_labels(NodeLabels::default()/* use setters */);
22650 /// ```
22651 pub fn set_labels<T>(mut self, v: T) -> Self
22652 where
22653 T: std::convert::Into<crate::model::NodeLabels>,
22654 {
22655 self.labels = std::option::Option::Some(v.into());
22656 self
22657 }
22658
22659 /// Sets or clears the value of [labels][crate::model::UpdateNodePoolRequest::labels].
22660 ///
22661 /// # Example
22662 /// ```ignore,no_run
22663 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22664 /// use google_cloud_container_v1::model::NodeLabels;
22665 /// let x = UpdateNodePoolRequest::new().set_or_clear_labels(Some(NodeLabels::default()/* use setters */));
22666 /// let x = UpdateNodePoolRequest::new().set_or_clear_labels(None::<NodeLabels>);
22667 /// ```
22668 pub fn set_or_clear_labels<T>(mut self, v: std::option::Option<T>) -> Self
22669 where
22670 T: std::convert::Into<crate::model::NodeLabels>,
22671 {
22672 self.labels = v.map(|x| x.into());
22673 self
22674 }
22675
22676 /// Sets the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
22677 ///
22678 /// # Example
22679 /// ```ignore,no_run
22680 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22681 /// use google_cloud_container_v1::model::LinuxNodeConfig;
22682 /// let x = UpdateNodePoolRequest::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
22683 /// ```
22684 pub fn set_linux_node_config<T>(mut self, v: T) -> Self
22685 where
22686 T: std::convert::Into<crate::model::LinuxNodeConfig>,
22687 {
22688 self.linux_node_config = std::option::Option::Some(v.into());
22689 self
22690 }
22691
22692 /// Sets or clears the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
22693 ///
22694 /// # Example
22695 /// ```ignore,no_run
22696 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22697 /// use google_cloud_container_v1::model::LinuxNodeConfig;
22698 /// let x = UpdateNodePoolRequest::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
22699 /// let x = UpdateNodePoolRequest::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
22700 /// ```
22701 pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
22702 where
22703 T: std::convert::Into<crate::model::LinuxNodeConfig>,
22704 {
22705 self.linux_node_config = v.map(|x| x.into());
22706 self
22707 }
22708
22709 /// Sets the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
22710 ///
22711 /// # Example
22712 /// ```ignore,no_run
22713 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22714 /// use google_cloud_container_v1::model::NodeKubeletConfig;
22715 /// let x = UpdateNodePoolRequest::new().set_kubelet_config(NodeKubeletConfig::default()/* use setters */);
22716 /// ```
22717 pub fn set_kubelet_config<T>(mut self, v: T) -> Self
22718 where
22719 T: std::convert::Into<crate::model::NodeKubeletConfig>,
22720 {
22721 self.kubelet_config = std::option::Option::Some(v.into());
22722 self
22723 }
22724
22725 /// Sets or clears the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
22726 ///
22727 /// # Example
22728 /// ```ignore,no_run
22729 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22730 /// use google_cloud_container_v1::model::NodeKubeletConfig;
22731 /// let x = UpdateNodePoolRequest::new().set_or_clear_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
22732 /// let x = UpdateNodePoolRequest::new().set_or_clear_kubelet_config(None::<NodeKubeletConfig>);
22733 /// ```
22734 pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
22735 where
22736 T: std::convert::Into<crate::model::NodeKubeletConfig>,
22737 {
22738 self.kubelet_config = v.map(|x| x.into());
22739 self
22740 }
22741
22742 /// Sets the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
22743 ///
22744 /// # Example
22745 /// ```ignore,no_run
22746 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22747 /// use google_cloud_container_v1::model::NodeNetworkConfig;
22748 /// let x = UpdateNodePoolRequest::new().set_node_network_config(NodeNetworkConfig::default()/* use setters */);
22749 /// ```
22750 pub fn set_node_network_config<T>(mut self, v: T) -> Self
22751 where
22752 T: std::convert::Into<crate::model::NodeNetworkConfig>,
22753 {
22754 self.node_network_config = std::option::Option::Some(v.into());
22755 self
22756 }
22757
22758 /// Sets or clears the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
22759 ///
22760 /// # Example
22761 /// ```ignore,no_run
22762 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22763 /// use google_cloud_container_v1::model::NodeNetworkConfig;
22764 /// let x = UpdateNodePoolRequest::new().set_or_clear_node_network_config(Some(NodeNetworkConfig::default()/* use setters */));
22765 /// let x = UpdateNodePoolRequest::new().set_or_clear_node_network_config(None::<NodeNetworkConfig>);
22766 /// ```
22767 pub fn set_or_clear_node_network_config<T>(mut self, v: std::option::Option<T>) -> Self
22768 where
22769 T: std::convert::Into<crate::model::NodeNetworkConfig>,
22770 {
22771 self.node_network_config = v.map(|x| x.into());
22772 self
22773 }
22774
22775 /// Sets the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
22776 ///
22777 /// # Example
22778 /// ```ignore,no_run
22779 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22780 /// use google_cloud_container_v1::model::GcfsConfig;
22781 /// let x = UpdateNodePoolRequest::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
22782 /// ```
22783 pub fn set_gcfs_config<T>(mut self, v: T) -> Self
22784 where
22785 T: std::convert::Into<crate::model::GcfsConfig>,
22786 {
22787 self.gcfs_config = std::option::Option::Some(v.into());
22788 self
22789 }
22790
22791 /// Sets or clears the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
22792 ///
22793 /// # Example
22794 /// ```ignore,no_run
22795 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22796 /// use google_cloud_container_v1::model::GcfsConfig;
22797 /// let x = UpdateNodePoolRequest::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
22798 /// let x = UpdateNodePoolRequest::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
22799 /// ```
22800 pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
22801 where
22802 T: std::convert::Into<crate::model::GcfsConfig>,
22803 {
22804 self.gcfs_config = v.map(|x| x.into());
22805 self
22806 }
22807
22808 /// Sets the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
22809 ///
22810 /// # Example
22811 /// ```ignore,no_run
22812 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22813 /// use google_cloud_container_v1::model::ConfidentialNodes;
22814 /// let x = UpdateNodePoolRequest::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
22815 /// ```
22816 pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
22817 where
22818 T: std::convert::Into<crate::model::ConfidentialNodes>,
22819 {
22820 self.confidential_nodes = std::option::Option::Some(v.into());
22821 self
22822 }
22823
22824 /// Sets or clears the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
22825 ///
22826 /// # Example
22827 /// ```ignore,no_run
22828 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22829 /// use google_cloud_container_v1::model::ConfidentialNodes;
22830 /// let x = UpdateNodePoolRequest::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
22831 /// let x = UpdateNodePoolRequest::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
22832 /// ```
22833 pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
22834 where
22835 T: std::convert::Into<crate::model::ConfidentialNodes>,
22836 {
22837 self.confidential_nodes = v.map(|x| x.into());
22838 self
22839 }
22840
22841 /// Sets the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
22842 ///
22843 /// # Example
22844 /// ```ignore,no_run
22845 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22846 /// use google_cloud_container_v1::model::VirtualNIC;
22847 /// let x = UpdateNodePoolRequest::new().set_gvnic(VirtualNIC::default()/* use setters */);
22848 /// ```
22849 pub fn set_gvnic<T>(mut self, v: T) -> Self
22850 where
22851 T: std::convert::Into<crate::model::VirtualNIC>,
22852 {
22853 self.gvnic = std::option::Option::Some(v.into());
22854 self
22855 }
22856
22857 /// Sets or clears the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
22858 ///
22859 /// # Example
22860 /// ```ignore,no_run
22861 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22862 /// use google_cloud_container_v1::model::VirtualNIC;
22863 /// let x = UpdateNodePoolRequest::new().set_or_clear_gvnic(Some(VirtualNIC::default()/* use setters */));
22864 /// let x = UpdateNodePoolRequest::new().set_or_clear_gvnic(None::<VirtualNIC>);
22865 /// ```
22866 pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
22867 where
22868 T: std::convert::Into<crate::model::VirtualNIC>,
22869 {
22870 self.gvnic = v.map(|x| x.into());
22871 self
22872 }
22873
22874 /// Sets the value of [etag][crate::model::UpdateNodePoolRequest::etag].
22875 ///
22876 /// # Example
22877 /// ```ignore,no_run
22878 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22879 /// let x = UpdateNodePoolRequest::new().set_etag("example");
22880 /// ```
22881 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22882 self.etag = v.into();
22883 self
22884 }
22885
22886 /// Sets the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
22887 ///
22888 /// # Example
22889 /// ```ignore,no_run
22890 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22891 /// use google_cloud_container_v1::model::FastSocket;
22892 /// let x = UpdateNodePoolRequest::new().set_fast_socket(FastSocket::default()/* use setters */);
22893 /// ```
22894 pub fn set_fast_socket<T>(mut self, v: T) -> Self
22895 where
22896 T: std::convert::Into<crate::model::FastSocket>,
22897 {
22898 self.fast_socket = std::option::Option::Some(v.into());
22899 self
22900 }
22901
22902 /// Sets or clears the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
22903 ///
22904 /// # Example
22905 /// ```ignore,no_run
22906 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22907 /// use google_cloud_container_v1::model::FastSocket;
22908 /// let x = UpdateNodePoolRequest::new().set_or_clear_fast_socket(Some(FastSocket::default()/* use setters */));
22909 /// let x = UpdateNodePoolRequest::new().set_or_clear_fast_socket(None::<FastSocket>);
22910 /// ```
22911 pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
22912 where
22913 T: std::convert::Into<crate::model::FastSocket>,
22914 {
22915 self.fast_socket = v.map(|x| x.into());
22916 self
22917 }
22918
22919 /// Sets the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
22920 ///
22921 /// # Example
22922 /// ```ignore,no_run
22923 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22924 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
22925 /// let x = UpdateNodePoolRequest::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
22926 /// ```
22927 pub fn set_logging_config<T>(mut self, v: T) -> Self
22928 where
22929 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
22930 {
22931 self.logging_config = std::option::Option::Some(v.into());
22932 self
22933 }
22934
22935 /// Sets or clears the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
22936 ///
22937 /// # Example
22938 /// ```ignore,no_run
22939 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22940 /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
22941 /// let x = UpdateNodePoolRequest::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
22942 /// let x = UpdateNodePoolRequest::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
22943 /// ```
22944 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
22945 where
22946 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
22947 {
22948 self.logging_config = v.map(|x| x.into());
22949 self
22950 }
22951
22952 /// Sets the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
22953 ///
22954 /// # Example
22955 /// ```ignore,no_run
22956 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22957 /// use google_cloud_container_v1::model::ResourceLabels;
22958 /// let x = UpdateNodePoolRequest::new().set_resource_labels(ResourceLabels::default()/* use setters */);
22959 /// ```
22960 pub fn set_resource_labels<T>(mut self, v: T) -> Self
22961 where
22962 T: std::convert::Into<crate::model::ResourceLabels>,
22963 {
22964 self.resource_labels = std::option::Option::Some(v.into());
22965 self
22966 }
22967
22968 /// Sets or clears the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
22969 ///
22970 /// # Example
22971 /// ```ignore,no_run
22972 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22973 /// use google_cloud_container_v1::model::ResourceLabels;
22974 /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_labels(Some(ResourceLabels::default()/* use setters */));
22975 /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_labels(None::<ResourceLabels>);
22976 /// ```
22977 pub fn set_or_clear_resource_labels<T>(mut self, v: std::option::Option<T>) -> Self
22978 where
22979 T: std::convert::Into<crate::model::ResourceLabels>,
22980 {
22981 self.resource_labels = v.map(|x| x.into());
22982 self
22983 }
22984
22985 /// Sets the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
22986 ///
22987 /// # Example
22988 /// ```ignore,no_run
22989 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
22990 /// use google_cloud_container_v1::model::WindowsNodeConfig;
22991 /// let x = UpdateNodePoolRequest::new().set_windows_node_config(WindowsNodeConfig::default()/* use setters */);
22992 /// ```
22993 pub fn set_windows_node_config<T>(mut self, v: T) -> Self
22994 where
22995 T: std::convert::Into<crate::model::WindowsNodeConfig>,
22996 {
22997 self.windows_node_config = std::option::Option::Some(v.into());
22998 self
22999 }
23000
23001 /// Sets or clears the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
23002 ///
23003 /// # Example
23004 /// ```ignore,no_run
23005 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23006 /// use google_cloud_container_v1::model::WindowsNodeConfig;
23007 /// let x = UpdateNodePoolRequest::new().set_or_clear_windows_node_config(Some(WindowsNodeConfig::default()/* use setters */));
23008 /// let x = UpdateNodePoolRequest::new().set_or_clear_windows_node_config(None::<WindowsNodeConfig>);
23009 /// ```
23010 pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
23011 where
23012 T: std::convert::Into<crate::model::WindowsNodeConfig>,
23013 {
23014 self.windows_node_config = v.map(|x| x.into());
23015 self
23016 }
23017
23018 /// Sets the value of [accelerators][crate::model::UpdateNodePoolRequest::accelerators].
23019 ///
23020 /// # Example
23021 /// ```ignore,no_run
23022 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23023 /// use google_cloud_container_v1::model::AcceleratorConfig;
23024 /// let x = UpdateNodePoolRequest::new()
23025 /// .set_accelerators([
23026 /// AcceleratorConfig::default()/* use setters */,
23027 /// AcceleratorConfig::default()/* use (different) setters */,
23028 /// ]);
23029 /// ```
23030 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
23031 where
23032 T: std::iter::IntoIterator<Item = V>,
23033 V: std::convert::Into<crate::model::AcceleratorConfig>,
23034 {
23035 use std::iter::Iterator;
23036 self.accelerators = v.into_iter().map(|i| i.into()).collect();
23037 self
23038 }
23039
23040 /// Sets the value of [machine_type][crate::model::UpdateNodePoolRequest::machine_type].
23041 ///
23042 /// # Example
23043 /// ```ignore,no_run
23044 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23045 /// let x = UpdateNodePoolRequest::new().set_machine_type("example");
23046 /// ```
23047 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23048 self.machine_type = v.into();
23049 self
23050 }
23051
23052 /// Sets the value of [disk_type][crate::model::UpdateNodePoolRequest::disk_type].
23053 ///
23054 /// # Example
23055 /// ```ignore,no_run
23056 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23057 /// let x = UpdateNodePoolRequest::new().set_disk_type("example");
23058 /// ```
23059 pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23060 self.disk_type = v.into();
23061 self
23062 }
23063
23064 /// Sets the value of [disk_size_gb][crate::model::UpdateNodePoolRequest::disk_size_gb].
23065 ///
23066 /// # Example
23067 /// ```ignore,no_run
23068 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23069 /// let x = UpdateNodePoolRequest::new().set_disk_size_gb(42);
23070 /// ```
23071 pub fn set_disk_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
23072 self.disk_size_gb = v.into();
23073 self
23074 }
23075
23076 /// Sets the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
23077 ///
23078 /// # Example
23079 /// ```ignore,no_run
23080 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23081 /// use google_cloud_container_v1::model::ResourceManagerTags;
23082 /// let x = UpdateNodePoolRequest::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
23083 /// ```
23084 pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
23085 where
23086 T: std::convert::Into<crate::model::ResourceManagerTags>,
23087 {
23088 self.resource_manager_tags = std::option::Option::Some(v.into());
23089 self
23090 }
23091
23092 /// Sets or clears the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
23093 ///
23094 /// # Example
23095 /// ```ignore,no_run
23096 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23097 /// use google_cloud_container_v1::model::ResourceManagerTags;
23098 /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
23099 /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
23100 /// ```
23101 pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
23102 where
23103 T: std::convert::Into<crate::model::ResourceManagerTags>,
23104 {
23105 self.resource_manager_tags = v.map(|x| x.into());
23106 self
23107 }
23108
23109 /// Sets the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
23110 ///
23111 /// # Example
23112 /// ```ignore,no_run
23113 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23114 /// use google_cloud_container_v1::model::ContainerdConfig;
23115 /// let x = UpdateNodePoolRequest::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
23116 /// ```
23117 pub fn set_containerd_config<T>(mut self, v: T) -> Self
23118 where
23119 T: std::convert::Into<crate::model::ContainerdConfig>,
23120 {
23121 self.containerd_config = std::option::Option::Some(v.into());
23122 self
23123 }
23124
23125 /// Sets or clears the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
23126 ///
23127 /// # Example
23128 /// ```ignore,no_run
23129 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23130 /// use google_cloud_container_v1::model::ContainerdConfig;
23131 /// let x = UpdateNodePoolRequest::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
23132 /// let x = UpdateNodePoolRequest::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
23133 /// ```
23134 pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
23135 where
23136 T: std::convert::Into<crate::model::ContainerdConfig>,
23137 {
23138 self.containerd_config = v.map(|x| x.into());
23139 self
23140 }
23141
23142 /// Sets the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
23143 ///
23144 /// # Example
23145 /// ```ignore,no_run
23146 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23147 /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
23148 /// let x = UpdateNodePoolRequest::new().set_queued_provisioning(QueuedProvisioning::default()/* use setters */);
23149 /// ```
23150 pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
23151 where
23152 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
23153 {
23154 self.queued_provisioning = std::option::Option::Some(v.into());
23155 self
23156 }
23157
23158 /// Sets or clears the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
23159 ///
23160 /// # Example
23161 /// ```ignore,no_run
23162 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23163 /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
23164 /// let x = UpdateNodePoolRequest::new().set_or_clear_queued_provisioning(Some(QueuedProvisioning::default()/* use setters */));
23165 /// let x = UpdateNodePoolRequest::new().set_or_clear_queued_provisioning(None::<QueuedProvisioning>);
23166 /// ```
23167 pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
23168 where
23169 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
23170 {
23171 self.queued_provisioning = v.map(|x| x.into());
23172 self
23173 }
23174
23175 /// Sets the value of [storage_pools][crate::model::UpdateNodePoolRequest::storage_pools].
23176 ///
23177 /// # Example
23178 /// ```ignore,no_run
23179 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23180 /// let x = UpdateNodePoolRequest::new().set_storage_pools(["a", "b", "c"]);
23181 /// ```
23182 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
23183 where
23184 T: std::iter::IntoIterator<Item = V>,
23185 V: std::convert::Into<std::string::String>,
23186 {
23187 use std::iter::Iterator;
23188 self.storage_pools = v.into_iter().map(|i| i.into()).collect();
23189 self
23190 }
23191
23192 /// Sets the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
23193 ///
23194 /// # Example
23195 /// ```ignore,no_run
23196 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23197 /// use wkt::Duration;
23198 /// let x = UpdateNodePoolRequest::new().set_max_run_duration(Duration::default()/* use setters */);
23199 /// ```
23200 pub fn set_max_run_duration<T>(mut self, v: T) -> Self
23201 where
23202 T: std::convert::Into<wkt::Duration>,
23203 {
23204 self.max_run_duration = std::option::Option::Some(v.into());
23205 self
23206 }
23207
23208 /// Sets or clears the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
23209 ///
23210 /// # Example
23211 /// ```ignore,no_run
23212 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23213 /// use wkt::Duration;
23214 /// let x = UpdateNodePoolRequest::new().set_or_clear_max_run_duration(Some(Duration::default()/* use setters */));
23215 /// let x = UpdateNodePoolRequest::new().set_or_clear_max_run_duration(None::<Duration>);
23216 /// ```
23217 pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
23218 where
23219 T: std::convert::Into<wkt::Duration>,
23220 {
23221 self.max_run_duration = v.map(|x| x.into());
23222 self
23223 }
23224
23225 /// Sets the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
23226 ///
23227 /// # Example
23228 /// ```ignore,no_run
23229 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23230 /// let x = UpdateNodePoolRequest::new().set_flex_start(true);
23231 /// ```
23232 pub fn set_flex_start<T>(mut self, v: T) -> Self
23233 where
23234 T: std::convert::Into<bool>,
23235 {
23236 self.flex_start = std::option::Option::Some(v.into());
23237 self
23238 }
23239
23240 /// Sets or clears the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
23241 ///
23242 /// # Example
23243 /// ```ignore,no_run
23244 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23245 /// let x = UpdateNodePoolRequest::new().set_or_clear_flex_start(Some(false));
23246 /// let x = UpdateNodePoolRequest::new().set_or_clear_flex_start(None::<bool>);
23247 /// ```
23248 pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
23249 where
23250 T: std::convert::Into<bool>,
23251 {
23252 self.flex_start = v.map(|x| x.into());
23253 self
23254 }
23255
23256 /// Sets the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
23257 ///
23258 /// # Example
23259 /// ```ignore,no_run
23260 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23261 /// use google_cloud_container_v1::model::BootDisk;
23262 /// let x = UpdateNodePoolRequest::new().set_boot_disk(BootDisk::default()/* use setters */);
23263 /// ```
23264 pub fn set_boot_disk<T>(mut self, v: T) -> Self
23265 where
23266 T: std::convert::Into<crate::model::BootDisk>,
23267 {
23268 self.boot_disk = std::option::Option::Some(v.into());
23269 self
23270 }
23271
23272 /// Sets or clears the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
23273 ///
23274 /// # Example
23275 /// ```ignore,no_run
23276 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23277 /// use google_cloud_container_v1::model::BootDisk;
23278 /// let x = UpdateNodePoolRequest::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
23279 /// let x = UpdateNodePoolRequest::new().set_or_clear_boot_disk(None::<BootDisk>);
23280 /// ```
23281 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
23282 where
23283 T: std::convert::Into<crate::model::BootDisk>,
23284 {
23285 self.boot_disk = v.map(|x| x.into());
23286 self
23287 }
23288
23289 /// Sets the value of [node_drain_config][crate::model::UpdateNodePoolRequest::node_drain_config].
23290 ///
23291 /// # Example
23292 /// ```ignore,no_run
23293 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23294 /// use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
23295 /// let x = UpdateNodePoolRequest::new().set_node_drain_config(NodeDrainConfig::default()/* use setters */);
23296 /// ```
23297 pub fn set_node_drain_config<T>(mut self, v: T) -> Self
23298 where
23299 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
23300 {
23301 self.node_drain_config = std::option::Option::Some(v.into());
23302 self
23303 }
23304
23305 /// Sets or clears the value of [node_drain_config][crate::model::UpdateNodePoolRequest::node_drain_config].
23306 ///
23307 /// # Example
23308 /// ```ignore,no_run
23309 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23310 /// use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
23311 /// let x = UpdateNodePoolRequest::new().set_or_clear_node_drain_config(Some(NodeDrainConfig::default()/* use setters */));
23312 /// let x = UpdateNodePoolRequest::new().set_or_clear_node_drain_config(None::<NodeDrainConfig>);
23313 /// ```
23314 pub fn set_or_clear_node_drain_config<T>(mut self, v: std::option::Option<T>) -> Self
23315 where
23316 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
23317 {
23318 self.node_drain_config = v.map(|x| x.into());
23319 self
23320 }
23321
23322 /// Sets the value of [consolidation_delay][crate::model::UpdateNodePoolRequest::consolidation_delay].
23323 ///
23324 /// # Example
23325 /// ```ignore,no_run
23326 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23327 /// use wkt::Duration;
23328 /// let x = UpdateNodePoolRequest::new().set_consolidation_delay(Duration::default()/* use setters */);
23329 /// ```
23330 pub fn set_consolidation_delay<T>(mut self, v: T) -> Self
23331 where
23332 T: std::convert::Into<wkt::Duration>,
23333 {
23334 self.consolidation_delay = std::option::Option::Some(v.into());
23335 self
23336 }
23337
23338 /// Sets or clears the value of [consolidation_delay][crate::model::UpdateNodePoolRequest::consolidation_delay].
23339 ///
23340 /// # Example
23341 /// ```ignore,no_run
23342 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23343 /// use wkt::Duration;
23344 /// let x = UpdateNodePoolRequest::new().set_or_clear_consolidation_delay(Some(Duration::default()/* use setters */));
23345 /// let x = UpdateNodePoolRequest::new().set_or_clear_consolidation_delay(None::<Duration>);
23346 /// ```
23347 pub fn set_or_clear_consolidation_delay<T>(mut self, v: std::option::Option<T>) -> Self
23348 where
23349 T: std::convert::Into<wkt::Duration>,
23350 {
23351 self.consolidation_delay = v.map(|x| x.into());
23352 self
23353 }
23354
23355 /// Sets the value of [taint_config][crate::model::UpdateNodePoolRequest::taint_config].
23356 ///
23357 /// # Example
23358 /// ```ignore,no_run
23359 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23360 /// use google_cloud_container_v1::model::TaintConfig;
23361 /// let x = UpdateNodePoolRequest::new().set_taint_config(TaintConfig::default()/* use setters */);
23362 /// ```
23363 pub fn set_taint_config<T>(mut self, v: T) -> Self
23364 where
23365 T: std::convert::Into<crate::model::TaintConfig>,
23366 {
23367 self.taint_config = std::option::Option::Some(v.into());
23368 self
23369 }
23370
23371 /// Sets or clears the value of [taint_config][crate::model::UpdateNodePoolRequest::taint_config].
23372 ///
23373 /// # Example
23374 /// ```ignore,no_run
23375 /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
23376 /// use google_cloud_container_v1::model::TaintConfig;
23377 /// let x = UpdateNodePoolRequest::new().set_or_clear_taint_config(Some(TaintConfig::default()/* use setters */));
23378 /// let x = UpdateNodePoolRequest::new().set_or_clear_taint_config(None::<TaintConfig>);
23379 /// ```
23380 pub fn set_or_clear_taint_config<T>(mut self, v: std::option::Option<T>) -> Self
23381 where
23382 T: std::convert::Into<crate::model::TaintConfig>,
23383 {
23384 self.taint_config = v.map(|x| x.into());
23385 self
23386 }
23387}
23388
23389impl wkt::message::Message for UpdateNodePoolRequest {
23390 fn typename() -> &'static str {
23391 "type.googleapis.com/google.container.v1.UpdateNodePoolRequest"
23392 }
23393}
23394
23395/// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool.
23396#[derive(Clone, Default, PartialEq)]
23397#[non_exhaustive]
23398pub struct SetNodePoolAutoscalingRequest {
23399 /// Deprecated. The Google Developers Console [project ID or project
23400 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
23401 /// This field has been deprecated and replaced by the name field.
23402 #[deprecated]
23403 pub project_id: std::string::String,
23404
23405 /// Deprecated. The name of the Google Compute Engine
23406 /// [zone](https://cloud.google.com/compute/docs/zones#available)
23407 /// in which the cluster resides. This field has been deprecated and replaced
23408 /// by the name field.
23409 #[deprecated]
23410 pub zone: std::string::String,
23411
23412 /// Deprecated. The name of the cluster to upgrade.
23413 /// This field has been deprecated and replaced by the name field.
23414 #[deprecated]
23415 pub cluster_id: std::string::String,
23416
23417 /// Deprecated. The name of the node pool to upgrade.
23418 /// This field has been deprecated and replaced by the name field.
23419 #[deprecated]
23420 pub node_pool_id: std::string::String,
23421
23422 /// Required. Autoscaling configuration for the node pool.
23423 pub autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
23424
23425 /// The name (project, location, cluster, node pool) of the node pool to set
23426 /// autoscaler settings. Specified in the format
23427 /// `projects/*/locations/*/clusters/*/nodePools/*`.
23428 pub name: std::string::String,
23429
23430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23431}
23432
23433impl SetNodePoolAutoscalingRequest {
23434 /// Creates a new default instance.
23435 pub fn new() -> Self {
23436 std::default::Default::default()
23437 }
23438
23439 /// Sets the value of [project_id][crate::model::SetNodePoolAutoscalingRequest::project_id].
23440 ///
23441 /// # Example
23442 /// ```ignore,no_run
23443 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23444 /// let x = SetNodePoolAutoscalingRequest::new().set_project_id("example");
23445 /// ```
23446 #[deprecated]
23447 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23448 self.project_id = v.into();
23449 self
23450 }
23451
23452 /// Sets the value of [zone][crate::model::SetNodePoolAutoscalingRequest::zone].
23453 ///
23454 /// # Example
23455 /// ```ignore,no_run
23456 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23457 /// let x = SetNodePoolAutoscalingRequest::new().set_zone("example");
23458 /// ```
23459 #[deprecated]
23460 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23461 self.zone = v.into();
23462 self
23463 }
23464
23465 /// Sets the value of [cluster_id][crate::model::SetNodePoolAutoscalingRequest::cluster_id].
23466 ///
23467 /// # Example
23468 /// ```ignore,no_run
23469 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23470 /// let x = SetNodePoolAutoscalingRequest::new().set_cluster_id("example");
23471 /// ```
23472 #[deprecated]
23473 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23474 self.cluster_id = v.into();
23475 self
23476 }
23477
23478 /// Sets the value of [node_pool_id][crate::model::SetNodePoolAutoscalingRequest::node_pool_id].
23479 ///
23480 /// # Example
23481 /// ```ignore,no_run
23482 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23483 /// let x = SetNodePoolAutoscalingRequest::new().set_node_pool_id("example");
23484 /// ```
23485 #[deprecated]
23486 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23487 self.node_pool_id = v.into();
23488 self
23489 }
23490
23491 /// Sets the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
23492 ///
23493 /// # Example
23494 /// ```ignore,no_run
23495 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23496 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
23497 /// let x = SetNodePoolAutoscalingRequest::new().set_autoscaling(NodePoolAutoscaling::default()/* use setters */);
23498 /// ```
23499 pub fn set_autoscaling<T>(mut self, v: T) -> Self
23500 where
23501 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
23502 {
23503 self.autoscaling = std::option::Option::Some(v.into());
23504 self
23505 }
23506
23507 /// Sets or clears the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
23508 ///
23509 /// # Example
23510 /// ```ignore,no_run
23511 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23512 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
23513 /// let x = SetNodePoolAutoscalingRequest::new().set_or_clear_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
23514 /// let x = SetNodePoolAutoscalingRequest::new().set_or_clear_autoscaling(None::<NodePoolAutoscaling>);
23515 /// ```
23516 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
23517 where
23518 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
23519 {
23520 self.autoscaling = v.map(|x| x.into());
23521 self
23522 }
23523
23524 /// Sets the value of [name][crate::model::SetNodePoolAutoscalingRequest::name].
23525 ///
23526 /// # Example
23527 /// ```ignore,no_run
23528 /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
23529 /// let x = SetNodePoolAutoscalingRequest::new().set_name("example");
23530 /// ```
23531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23532 self.name = v.into();
23533 self
23534 }
23535}
23536
23537impl wkt::message::Message for SetNodePoolAutoscalingRequest {
23538 fn typename() -> &'static str {
23539 "type.googleapis.com/google.container.v1.SetNodePoolAutoscalingRequest"
23540 }
23541}
23542
23543/// SetLoggingServiceRequest sets the logging service of a cluster.
23544#[derive(Clone, Default, PartialEq)]
23545#[non_exhaustive]
23546pub struct SetLoggingServiceRequest {
23547 /// Deprecated. The Google Developers Console [project ID or project
23548 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
23549 /// This field has been deprecated and replaced by the name field.
23550 #[deprecated]
23551 pub project_id: std::string::String,
23552
23553 /// Deprecated. The name of the Google Compute Engine
23554 /// [zone](https://cloud.google.com/compute/docs/zones#available)
23555 /// in which the cluster resides. This field has been deprecated and replaced
23556 /// by the name field.
23557 #[deprecated]
23558 pub zone: std::string::String,
23559
23560 /// Deprecated. The name of the cluster to upgrade.
23561 /// This field has been deprecated and replaced by the name field.
23562 #[deprecated]
23563 pub cluster_id: std::string::String,
23564
23565 /// Required. The logging service the cluster should use to write logs.
23566 /// Currently available options:
23567 ///
23568 /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
23569 /// service with a Kubernetes-native resource model
23570 /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
23571 /// available as of GKE 1.15).
23572 /// * `none` - no logs will be exported from the cluster.
23573 ///
23574 /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
23575 /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
23576 pub logging_service: std::string::String,
23577
23578 /// The name (project, location, cluster) of the cluster to set logging.
23579 /// Specified in the format `projects/*/locations/*/clusters/*`.
23580 pub name: std::string::String,
23581
23582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23583}
23584
23585impl SetLoggingServiceRequest {
23586 /// Creates a new default instance.
23587 pub fn new() -> Self {
23588 std::default::Default::default()
23589 }
23590
23591 /// Sets the value of [project_id][crate::model::SetLoggingServiceRequest::project_id].
23592 ///
23593 /// # Example
23594 /// ```ignore,no_run
23595 /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
23596 /// let x = SetLoggingServiceRequest::new().set_project_id("example");
23597 /// ```
23598 #[deprecated]
23599 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23600 self.project_id = v.into();
23601 self
23602 }
23603
23604 /// Sets the value of [zone][crate::model::SetLoggingServiceRequest::zone].
23605 ///
23606 /// # Example
23607 /// ```ignore,no_run
23608 /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
23609 /// let x = SetLoggingServiceRequest::new().set_zone("example");
23610 /// ```
23611 #[deprecated]
23612 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23613 self.zone = v.into();
23614 self
23615 }
23616
23617 /// Sets the value of [cluster_id][crate::model::SetLoggingServiceRequest::cluster_id].
23618 ///
23619 /// # Example
23620 /// ```ignore,no_run
23621 /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
23622 /// let x = SetLoggingServiceRequest::new().set_cluster_id("example");
23623 /// ```
23624 #[deprecated]
23625 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23626 self.cluster_id = v.into();
23627 self
23628 }
23629
23630 /// Sets the value of [logging_service][crate::model::SetLoggingServiceRequest::logging_service].
23631 ///
23632 /// # Example
23633 /// ```ignore,no_run
23634 /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
23635 /// let x = SetLoggingServiceRequest::new().set_logging_service("example");
23636 /// ```
23637 pub fn set_logging_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23638 self.logging_service = v.into();
23639 self
23640 }
23641
23642 /// Sets the value of [name][crate::model::SetLoggingServiceRequest::name].
23643 ///
23644 /// # Example
23645 /// ```ignore,no_run
23646 /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
23647 /// let x = SetLoggingServiceRequest::new().set_name("example");
23648 /// ```
23649 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23650 self.name = v.into();
23651 self
23652 }
23653}
23654
23655impl wkt::message::Message for SetLoggingServiceRequest {
23656 fn typename() -> &'static str {
23657 "type.googleapis.com/google.container.v1.SetLoggingServiceRequest"
23658 }
23659}
23660
23661/// SetMonitoringServiceRequest sets the monitoring service of a cluster.
23662#[derive(Clone, Default, PartialEq)]
23663#[non_exhaustive]
23664pub struct SetMonitoringServiceRequest {
23665 /// Deprecated. The Google Developers Console [project ID or project
23666 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
23667 /// This field has been deprecated and replaced by the name field.
23668 #[deprecated]
23669 pub project_id: std::string::String,
23670
23671 /// Deprecated. The name of the Google Compute Engine
23672 /// [zone](https://cloud.google.com/compute/docs/zones#available)
23673 /// in which the cluster resides. This field has been deprecated and replaced
23674 /// by the name field.
23675 #[deprecated]
23676 pub zone: std::string::String,
23677
23678 /// Deprecated. The name of the cluster to upgrade.
23679 /// This field has been deprecated and replaced by the name field.
23680 #[deprecated]
23681 pub cluster_id: std::string::String,
23682
23683 /// Required. The monitoring service the cluster should use to write metrics.
23684 /// Currently available options:
23685 ///
23686 /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
23687 /// service with a Kubernetes-native resource model
23688 /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
23689 /// longer available as of GKE 1.15).
23690 /// * `none` - No metrics will be exported from the cluster.
23691 ///
23692 /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
23693 /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
23694 pub monitoring_service: std::string::String,
23695
23696 /// The name (project, location, cluster) of the cluster to set monitoring.
23697 /// Specified in the format `projects/*/locations/*/clusters/*`.
23698 pub name: std::string::String,
23699
23700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23701}
23702
23703impl SetMonitoringServiceRequest {
23704 /// Creates a new default instance.
23705 pub fn new() -> Self {
23706 std::default::Default::default()
23707 }
23708
23709 /// Sets the value of [project_id][crate::model::SetMonitoringServiceRequest::project_id].
23710 ///
23711 /// # Example
23712 /// ```ignore,no_run
23713 /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
23714 /// let x = SetMonitoringServiceRequest::new().set_project_id("example");
23715 /// ```
23716 #[deprecated]
23717 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23718 self.project_id = v.into();
23719 self
23720 }
23721
23722 /// Sets the value of [zone][crate::model::SetMonitoringServiceRequest::zone].
23723 ///
23724 /// # Example
23725 /// ```ignore,no_run
23726 /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
23727 /// let x = SetMonitoringServiceRequest::new().set_zone("example");
23728 /// ```
23729 #[deprecated]
23730 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23731 self.zone = v.into();
23732 self
23733 }
23734
23735 /// Sets the value of [cluster_id][crate::model::SetMonitoringServiceRequest::cluster_id].
23736 ///
23737 /// # Example
23738 /// ```ignore,no_run
23739 /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
23740 /// let x = SetMonitoringServiceRequest::new().set_cluster_id("example");
23741 /// ```
23742 #[deprecated]
23743 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23744 self.cluster_id = v.into();
23745 self
23746 }
23747
23748 /// Sets the value of [monitoring_service][crate::model::SetMonitoringServiceRequest::monitoring_service].
23749 ///
23750 /// # Example
23751 /// ```ignore,no_run
23752 /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
23753 /// let x = SetMonitoringServiceRequest::new().set_monitoring_service("example");
23754 /// ```
23755 pub fn set_monitoring_service<T: std::convert::Into<std::string::String>>(
23756 mut self,
23757 v: T,
23758 ) -> Self {
23759 self.monitoring_service = v.into();
23760 self
23761 }
23762
23763 /// Sets the value of [name][crate::model::SetMonitoringServiceRequest::name].
23764 ///
23765 /// # Example
23766 /// ```ignore,no_run
23767 /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
23768 /// let x = SetMonitoringServiceRequest::new().set_name("example");
23769 /// ```
23770 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23771 self.name = v.into();
23772 self
23773 }
23774}
23775
23776impl wkt::message::Message for SetMonitoringServiceRequest {
23777 fn typename() -> &'static str {
23778 "type.googleapis.com/google.container.v1.SetMonitoringServiceRequest"
23779 }
23780}
23781
23782/// SetAddonsConfigRequest sets the addons associated with the cluster.
23783#[derive(Clone, Default, PartialEq)]
23784#[non_exhaustive]
23785pub struct SetAddonsConfigRequest {
23786 /// Deprecated. The Google Developers Console [project ID or project
23787 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
23788 /// This field has been deprecated and replaced by the name field.
23789 #[deprecated]
23790 pub project_id: std::string::String,
23791
23792 /// Deprecated. The name of the Google Compute Engine
23793 /// [zone](https://cloud.google.com/compute/docs/zones#available)
23794 /// in which the cluster resides. This field has been deprecated and replaced
23795 /// by the name field.
23796 #[deprecated]
23797 pub zone: std::string::String,
23798
23799 /// Deprecated. The name of the cluster to upgrade.
23800 /// This field has been deprecated and replaced by the name field.
23801 #[deprecated]
23802 pub cluster_id: std::string::String,
23803
23804 /// Required. The desired configurations for the various addons available to
23805 /// run in the cluster.
23806 pub addons_config: std::option::Option<crate::model::AddonsConfig>,
23807
23808 /// The name (project, location, cluster) of the cluster to set addons.
23809 /// Specified in the format `projects/*/locations/*/clusters/*`.
23810 pub name: std::string::String,
23811
23812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23813}
23814
23815impl SetAddonsConfigRequest {
23816 /// Creates a new default instance.
23817 pub fn new() -> Self {
23818 std::default::Default::default()
23819 }
23820
23821 /// Sets the value of [project_id][crate::model::SetAddonsConfigRequest::project_id].
23822 ///
23823 /// # Example
23824 /// ```ignore,no_run
23825 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23826 /// let x = SetAddonsConfigRequest::new().set_project_id("example");
23827 /// ```
23828 #[deprecated]
23829 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23830 self.project_id = v.into();
23831 self
23832 }
23833
23834 /// Sets the value of [zone][crate::model::SetAddonsConfigRequest::zone].
23835 ///
23836 /// # Example
23837 /// ```ignore,no_run
23838 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23839 /// let x = SetAddonsConfigRequest::new().set_zone("example");
23840 /// ```
23841 #[deprecated]
23842 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23843 self.zone = v.into();
23844 self
23845 }
23846
23847 /// Sets the value of [cluster_id][crate::model::SetAddonsConfigRequest::cluster_id].
23848 ///
23849 /// # Example
23850 /// ```ignore,no_run
23851 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23852 /// let x = SetAddonsConfigRequest::new().set_cluster_id("example");
23853 /// ```
23854 #[deprecated]
23855 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23856 self.cluster_id = v.into();
23857 self
23858 }
23859
23860 /// Sets the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
23861 ///
23862 /// # Example
23863 /// ```ignore,no_run
23864 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23865 /// use google_cloud_container_v1::model::AddonsConfig;
23866 /// let x = SetAddonsConfigRequest::new().set_addons_config(AddonsConfig::default()/* use setters */);
23867 /// ```
23868 pub fn set_addons_config<T>(mut self, v: T) -> Self
23869 where
23870 T: std::convert::Into<crate::model::AddonsConfig>,
23871 {
23872 self.addons_config = std::option::Option::Some(v.into());
23873 self
23874 }
23875
23876 /// Sets or clears the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
23877 ///
23878 /// # Example
23879 /// ```ignore,no_run
23880 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23881 /// use google_cloud_container_v1::model::AddonsConfig;
23882 /// let x = SetAddonsConfigRequest::new().set_or_clear_addons_config(Some(AddonsConfig::default()/* use setters */));
23883 /// let x = SetAddonsConfigRequest::new().set_or_clear_addons_config(None::<AddonsConfig>);
23884 /// ```
23885 pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
23886 where
23887 T: std::convert::Into<crate::model::AddonsConfig>,
23888 {
23889 self.addons_config = v.map(|x| x.into());
23890 self
23891 }
23892
23893 /// Sets the value of [name][crate::model::SetAddonsConfigRequest::name].
23894 ///
23895 /// # Example
23896 /// ```ignore,no_run
23897 /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
23898 /// let x = SetAddonsConfigRequest::new().set_name("example");
23899 /// ```
23900 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23901 self.name = v.into();
23902 self
23903 }
23904}
23905
23906impl wkt::message::Message for SetAddonsConfigRequest {
23907 fn typename() -> &'static str {
23908 "type.googleapis.com/google.container.v1.SetAddonsConfigRequest"
23909 }
23910}
23911
23912/// SetLocationsRequest sets the locations of the cluster.
23913#[derive(Clone, Default, PartialEq)]
23914#[non_exhaustive]
23915pub struct SetLocationsRequest {
23916 /// Deprecated. The Google Developers Console [project ID or project
23917 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
23918 /// This field has been deprecated and replaced by the name field.
23919 #[deprecated]
23920 pub project_id: std::string::String,
23921
23922 /// Deprecated. The name of the Google Compute Engine
23923 /// [zone](https://cloud.google.com/compute/docs/zones#available)
23924 /// in which the cluster resides. This field has been deprecated and replaced
23925 /// by the name field.
23926 #[deprecated]
23927 pub zone: std::string::String,
23928
23929 /// Deprecated. The name of the cluster to upgrade.
23930 /// This field has been deprecated and replaced by the name field.
23931 #[deprecated]
23932 pub cluster_id: std::string::String,
23933
23934 /// Required. The desired list of Google Compute Engine
23935 /// [zones](https://cloud.google.com/compute/docs/zones#available)
23936 /// in which the cluster's nodes should be located. Changing the locations a
23937 /// cluster is in will result in nodes being either created or removed from the
23938 /// cluster, depending on whether locations are being added or removed.
23939 ///
23940 /// This list must always include the cluster's primary zone.
23941 pub locations: std::vec::Vec<std::string::String>,
23942
23943 /// The name (project, location, cluster) of the cluster to set locations.
23944 /// Specified in the format `projects/*/locations/*/clusters/*`.
23945 pub name: std::string::String,
23946
23947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23948}
23949
23950impl SetLocationsRequest {
23951 /// Creates a new default instance.
23952 pub fn new() -> Self {
23953 std::default::Default::default()
23954 }
23955
23956 /// Sets the value of [project_id][crate::model::SetLocationsRequest::project_id].
23957 ///
23958 /// # Example
23959 /// ```ignore,no_run
23960 /// # use google_cloud_container_v1::model::SetLocationsRequest;
23961 /// let x = SetLocationsRequest::new().set_project_id("example");
23962 /// ```
23963 #[deprecated]
23964 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23965 self.project_id = v.into();
23966 self
23967 }
23968
23969 /// Sets the value of [zone][crate::model::SetLocationsRequest::zone].
23970 ///
23971 /// # Example
23972 /// ```ignore,no_run
23973 /// # use google_cloud_container_v1::model::SetLocationsRequest;
23974 /// let x = SetLocationsRequest::new().set_zone("example");
23975 /// ```
23976 #[deprecated]
23977 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23978 self.zone = v.into();
23979 self
23980 }
23981
23982 /// Sets the value of [cluster_id][crate::model::SetLocationsRequest::cluster_id].
23983 ///
23984 /// # Example
23985 /// ```ignore,no_run
23986 /// # use google_cloud_container_v1::model::SetLocationsRequest;
23987 /// let x = SetLocationsRequest::new().set_cluster_id("example");
23988 /// ```
23989 #[deprecated]
23990 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23991 self.cluster_id = v.into();
23992 self
23993 }
23994
23995 /// Sets the value of [locations][crate::model::SetLocationsRequest::locations].
23996 ///
23997 /// # Example
23998 /// ```ignore,no_run
23999 /// # use google_cloud_container_v1::model::SetLocationsRequest;
24000 /// let x = SetLocationsRequest::new().set_locations(["a", "b", "c"]);
24001 /// ```
24002 pub fn set_locations<T, V>(mut self, v: T) -> Self
24003 where
24004 T: std::iter::IntoIterator<Item = V>,
24005 V: std::convert::Into<std::string::String>,
24006 {
24007 use std::iter::Iterator;
24008 self.locations = v.into_iter().map(|i| i.into()).collect();
24009 self
24010 }
24011
24012 /// Sets the value of [name][crate::model::SetLocationsRequest::name].
24013 ///
24014 /// # Example
24015 /// ```ignore,no_run
24016 /// # use google_cloud_container_v1::model::SetLocationsRequest;
24017 /// let x = SetLocationsRequest::new().set_name("example");
24018 /// ```
24019 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24020 self.name = v.into();
24021 self
24022 }
24023}
24024
24025impl wkt::message::Message for SetLocationsRequest {
24026 fn typename() -> &'static str {
24027 "type.googleapis.com/google.container.v1.SetLocationsRequest"
24028 }
24029}
24030
24031/// UpdateMasterRequest updates the master of the cluster.
24032#[derive(Clone, Default, PartialEq)]
24033#[non_exhaustive]
24034pub struct UpdateMasterRequest {
24035 /// Deprecated. The Google Developers Console [project ID or project
24036 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24037 /// This field has been deprecated and replaced by the name field.
24038 #[deprecated]
24039 pub project_id: std::string::String,
24040
24041 /// Deprecated. The name of the Google Compute Engine
24042 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24043 /// in which the cluster resides. This field has been deprecated and replaced
24044 /// by the name field.
24045 #[deprecated]
24046 pub zone: std::string::String,
24047
24048 /// Deprecated. The name of the cluster to upgrade.
24049 /// This field has been deprecated and replaced by the name field.
24050 #[deprecated]
24051 pub cluster_id: std::string::String,
24052
24053 /// Required. The Kubernetes version to change the master to.
24054 ///
24055 /// Users may specify either explicit versions offered by Kubernetes Engine or
24056 /// version aliases, which have the following behavior:
24057 ///
24058 /// - "latest": picks the highest valid Kubernetes version
24059 /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
24060 /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
24061 /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
24062 /// - "-": picks the default Kubernetes version
24063 pub master_version: std::string::String,
24064
24065 /// The name (project, location, cluster) of the cluster to update.
24066 /// Specified in the format `projects/*/locations/*/clusters/*`.
24067 pub name: std::string::String,
24068
24069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24070}
24071
24072impl UpdateMasterRequest {
24073 /// Creates a new default instance.
24074 pub fn new() -> Self {
24075 std::default::Default::default()
24076 }
24077
24078 /// Sets the value of [project_id][crate::model::UpdateMasterRequest::project_id].
24079 ///
24080 /// # Example
24081 /// ```ignore,no_run
24082 /// # use google_cloud_container_v1::model::UpdateMasterRequest;
24083 /// let x = UpdateMasterRequest::new().set_project_id("example");
24084 /// ```
24085 #[deprecated]
24086 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24087 self.project_id = v.into();
24088 self
24089 }
24090
24091 /// Sets the value of [zone][crate::model::UpdateMasterRequest::zone].
24092 ///
24093 /// # Example
24094 /// ```ignore,no_run
24095 /// # use google_cloud_container_v1::model::UpdateMasterRequest;
24096 /// let x = UpdateMasterRequest::new().set_zone("example");
24097 /// ```
24098 #[deprecated]
24099 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24100 self.zone = v.into();
24101 self
24102 }
24103
24104 /// Sets the value of [cluster_id][crate::model::UpdateMasterRequest::cluster_id].
24105 ///
24106 /// # Example
24107 /// ```ignore,no_run
24108 /// # use google_cloud_container_v1::model::UpdateMasterRequest;
24109 /// let x = UpdateMasterRequest::new().set_cluster_id("example");
24110 /// ```
24111 #[deprecated]
24112 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24113 self.cluster_id = v.into();
24114 self
24115 }
24116
24117 /// Sets the value of [master_version][crate::model::UpdateMasterRequest::master_version].
24118 ///
24119 /// # Example
24120 /// ```ignore,no_run
24121 /// # use google_cloud_container_v1::model::UpdateMasterRequest;
24122 /// let x = UpdateMasterRequest::new().set_master_version("example");
24123 /// ```
24124 pub fn set_master_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24125 self.master_version = v.into();
24126 self
24127 }
24128
24129 /// Sets the value of [name][crate::model::UpdateMasterRequest::name].
24130 ///
24131 /// # Example
24132 /// ```ignore,no_run
24133 /// # use google_cloud_container_v1::model::UpdateMasterRequest;
24134 /// let x = UpdateMasterRequest::new().set_name("example");
24135 /// ```
24136 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24137 self.name = v.into();
24138 self
24139 }
24140}
24141
24142impl wkt::message::Message for UpdateMasterRequest {
24143 fn typename() -> &'static str {
24144 "type.googleapis.com/google.container.v1.UpdateMasterRequest"
24145 }
24146}
24147
24148/// SetMasterAuthRequest updates the admin password of a cluster.
24149#[derive(Clone, Default, PartialEq)]
24150#[non_exhaustive]
24151pub struct SetMasterAuthRequest {
24152 /// Deprecated. The Google Developers Console [project ID or project
24153 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24154 /// This field has been deprecated and replaced by the name field.
24155 #[deprecated]
24156 pub project_id: std::string::String,
24157
24158 /// Deprecated. The name of the Google Compute Engine
24159 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24160 /// in which the cluster resides. This field has been deprecated and replaced
24161 /// by the name field.
24162 #[deprecated]
24163 pub zone: std::string::String,
24164
24165 /// Deprecated. The name of the cluster to upgrade.
24166 /// This field has been deprecated and replaced by the name field.
24167 #[deprecated]
24168 pub cluster_id: std::string::String,
24169
24170 /// Required. The exact form of action to be taken on the master auth.
24171 pub action: crate::model::set_master_auth_request::Action,
24172
24173 /// Required. A description of the update.
24174 pub update: std::option::Option<crate::model::MasterAuth>,
24175
24176 /// The name (project, location, cluster) of the cluster to set auth.
24177 /// Specified in the format `projects/*/locations/*/clusters/*`.
24178 pub name: std::string::String,
24179
24180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24181}
24182
24183impl SetMasterAuthRequest {
24184 /// Creates a new default instance.
24185 pub fn new() -> Self {
24186 std::default::Default::default()
24187 }
24188
24189 /// Sets the value of [project_id][crate::model::SetMasterAuthRequest::project_id].
24190 ///
24191 /// # Example
24192 /// ```ignore,no_run
24193 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24194 /// let x = SetMasterAuthRequest::new().set_project_id("example");
24195 /// ```
24196 #[deprecated]
24197 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24198 self.project_id = v.into();
24199 self
24200 }
24201
24202 /// Sets the value of [zone][crate::model::SetMasterAuthRequest::zone].
24203 ///
24204 /// # Example
24205 /// ```ignore,no_run
24206 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24207 /// let x = SetMasterAuthRequest::new().set_zone("example");
24208 /// ```
24209 #[deprecated]
24210 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24211 self.zone = v.into();
24212 self
24213 }
24214
24215 /// Sets the value of [cluster_id][crate::model::SetMasterAuthRequest::cluster_id].
24216 ///
24217 /// # Example
24218 /// ```ignore,no_run
24219 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24220 /// let x = SetMasterAuthRequest::new().set_cluster_id("example");
24221 /// ```
24222 #[deprecated]
24223 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24224 self.cluster_id = v.into();
24225 self
24226 }
24227
24228 /// Sets the value of [action][crate::model::SetMasterAuthRequest::action].
24229 ///
24230 /// # Example
24231 /// ```ignore,no_run
24232 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24233 /// use google_cloud_container_v1::model::set_master_auth_request::Action;
24234 /// let x0 = SetMasterAuthRequest::new().set_action(Action::SetPassword);
24235 /// let x1 = SetMasterAuthRequest::new().set_action(Action::GeneratePassword);
24236 /// let x2 = SetMasterAuthRequest::new().set_action(Action::SetUsername);
24237 /// ```
24238 pub fn set_action<T: std::convert::Into<crate::model::set_master_auth_request::Action>>(
24239 mut self,
24240 v: T,
24241 ) -> Self {
24242 self.action = v.into();
24243 self
24244 }
24245
24246 /// Sets the value of [update][crate::model::SetMasterAuthRequest::update].
24247 ///
24248 /// # Example
24249 /// ```ignore,no_run
24250 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24251 /// use google_cloud_container_v1::model::MasterAuth;
24252 /// let x = SetMasterAuthRequest::new().set_update(MasterAuth::default()/* use setters */);
24253 /// ```
24254 pub fn set_update<T>(mut self, v: T) -> Self
24255 where
24256 T: std::convert::Into<crate::model::MasterAuth>,
24257 {
24258 self.update = std::option::Option::Some(v.into());
24259 self
24260 }
24261
24262 /// Sets or clears the value of [update][crate::model::SetMasterAuthRequest::update].
24263 ///
24264 /// # Example
24265 /// ```ignore,no_run
24266 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24267 /// use google_cloud_container_v1::model::MasterAuth;
24268 /// let x = SetMasterAuthRequest::new().set_or_clear_update(Some(MasterAuth::default()/* use setters */));
24269 /// let x = SetMasterAuthRequest::new().set_or_clear_update(None::<MasterAuth>);
24270 /// ```
24271 pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
24272 where
24273 T: std::convert::Into<crate::model::MasterAuth>,
24274 {
24275 self.update = v.map(|x| x.into());
24276 self
24277 }
24278
24279 /// Sets the value of [name][crate::model::SetMasterAuthRequest::name].
24280 ///
24281 /// # Example
24282 /// ```ignore,no_run
24283 /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
24284 /// let x = SetMasterAuthRequest::new().set_name("example");
24285 /// ```
24286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24287 self.name = v.into();
24288 self
24289 }
24290}
24291
24292impl wkt::message::Message for SetMasterAuthRequest {
24293 fn typename() -> &'static str {
24294 "type.googleapis.com/google.container.v1.SetMasterAuthRequest"
24295 }
24296}
24297
24298/// Defines additional types related to [SetMasterAuthRequest].
24299pub mod set_master_auth_request {
24300 #[allow(unused_imports)]
24301 use super::*;
24302
24303 /// Operation type: what type update to perform.
24304 ///
24305 /// # Working with unknown values
24306 ///
24307 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24308 /// additional enum variants at any time. Adding new variants is not considered
24309 /// a breaking change. Applications should write their code in anticipation of:
24310 ///
24311 /// - New values appearing in future releases of the client library, **and**
24312 /// - New values received dynamically, without application changes.
24313 ///
24314 /// Please consult the [Working with enums] section in the user guide for some
24315 /// guidelines.
24316 ///
24317 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24318 #[derive(Clone, Debug, PartialEq)]
24319 #[non_exhaustive]
24320 pub enum Action {
24321 /// Operation is unknown and will error out.
24322 Unknown,
24323 /// Set the password to a user generated value.
24324 SetPassword,
24325 /// Generate a new password and set it to that.
24326 GeneratePassword,
24327 /// Set the username. If an empty username is provided, basic authentication
24328 /// is disabled for the cluster. If a non-empty username is provided, basic
24329 /// authentication is enabled, with either a provided password or a generated
24330 /// one.
24331 SetUsername,
24332 /// If set, the enum was initialized with an unknown value.
24333 ///
24334 /// Applications can examine the value using [Action::value] or
24335 /// [Action::name].
24336 UnknownValue(action::UnknownValue),
24337 }
24338
24339 #[doc(hidden)]
24340 pub mod action {
24341 #[allow(unused_imports)]
24342 use super::*;
24343 #[derive(Clone, Debug, PartialEq)]
24344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24345 }
24346
24347 impl Action {
24348 /// Gets the enum value.
24349 ///
24350 /// Returns `None` if the enum contains an unknown value deserialized from
24351 /// the string representation of enums.
24352 pub fn value(&self) -> std::option::Option<i32> {
24353 match self {
24354 Self::Unknown => std::option::Option::Some(0),
24355 Self::SetPassword => std::option::Option::Some(1),
24356 Self::GeneratePassword => std::option::Option::Some(2),
24357 Self::SetUsername => std::option::Option::Some(3),
24358 Self::UnknownValue(u) => u.0.value(),
24359 }
24360 }
24361
24362 /// Gets the enum value as a string.
24363 ///
24364 /// Returns `None` if the enum contains an unknown value deserialized from
24365 /// the integer representation of enums.
24366 pub fn name(&self) -> std::option::Option<&str> {
24367 match self {
24368 Self::Unknown => std::option::Option::Some("UNKNOWN"),
24369 Self::SetPassword => std::option::Option::Some("SET_PASSWORD"),
24370 Self::GeneratePassword => std::option::Option::Some("GENERATE_PASSWORD"),
24371 Self::SetUsername => std::option::Option::Some("SET_USERNAME"),
24372 Self::UnknownValue(u) => u.0.name(),
24373 }
24374 }
24375 }
24376
24377 impl std::default::Default for Action {
24378 fn default() -> Self {
24379 use std::convert::From;
24380 Self::from(0)
24381 }
24382 }
24383
24384 impl std::fmt::Display for Action {
24385 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24386 wkt::internal::display_enum(f, self.name(), self.value())
24387 }
24388 }
24389
24390 impl std::convert::From<i32> for Action {
24391 fn from(value: i32) -> Self {
24392 match value {
24393 0 => Self::Unknown,
24394 1 => Self::SetPassword,
24395 2 => Self::GeneratePassword,
24396 3 => Self::SetUsername,
24397 _ => Self::UnknownValue(action::UnknownValue(
24398 wkt::internal::UnknownEnumValue::Integer(value),
24399 )),
24400 }
24401 }
24402 }
24403
24404 impl std::convert::From<&str> for Action {
24405 fn from(value: &str) -> Self {
24406 use std::string::ToString;
24407 match value {
24408 "UNKNOWN" => Self::Unknown,
24409 "SET_PASSWORD" => Self::SetPassword,
24410 "GENERATE_PASSWORD" => Self::GeneratePassword,
24411 "SET_USERNAME" => Self::SetUsername,
24412 _ => Self::UnknownValue(action::UnknownValue(
24413 wkt::internal::UnknownEnumValue::String(value.to_string()),
24414 )),
24415 }
24416 }
24417 }
24418
24419 impl serde::ser::Serialize for Action {
24420 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24421 where
24422 S: serde::Serializer,
24423 {
24424 match self {
24425 Self::Unknown => serializer.serialize_i32(0),
24426 Self::SetPassword => serializer.serialize_i32(1),
24427 Self::GeneratePassword => serializer.serialize_i32(2),
24428 Self::SetUsername => serializer.serialize_i32(3),
24429 Self::UnknownValue(u) => u.0.serialize(serializer),
24430 }
24431 }
24432 }
24433
24434 impl<'de> serde::de::Deserialize<'de> for Action {
24435 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24436 where
24437 D: serde::Deserializer<'de>,
24438 {
24439 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
24440 ".google.container.v1.SetMasterAuthRequest.Action",
24441 ))
24442 }
24443 }
24444}
24445
24446/// DeleteClusterRequest deletes a cluster.
24447#[derive(Clone, Default, PartialEq)]
24448#[non_exhaustive]
24449pub struct DeleteClusterRequest {
24450 /// Deprecated. The Google Developers Console [project ID or project
24451 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24452 /// This field has been deprecated and replaced by the name field.
24453 #[deprecated]
24454 pub project_id: std::string::String,
24455
24456 /// Deprecated. The name of the Google Compute Engine
24457 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24458 /// in which the cluster resides. This field has been deprecated and replaced
24459 /// by the name field.
24460 #[deprecated]
24461 pub zone: std::string::String,
24462
24463 /// Deprecated. The name of the cluster to delete.
24464 /// This field has been deprecated and replaced by the name field.
24465 #[deprecated]
24466 pub cluster_id: std::string::String,
24467
24468 /// The name (project, location, cluster) of the cluster to delete.
24469 /// Specified in the format `projects/*/locations/*/clusters/*`.
24470 pub name: std::string::String,
24471
24472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24473}
24474
24475impl DeleteClusterRequest {
24476 /// Creates a new default instance.
24477 pub fn new() -> Self {
24478 std::default::Default::default()
24479 }
24480
24481 /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
24482 ///
24483 /// # Example
24484 /// ```ignore,no_run
24485 /// # use google_cloud_container_v1::model::DeleteClusterRequest;
24486 /// let x = DeleteClusterRequest::new().set_project_id("example");
24487 /// ```
24488 #[deprecated]
24489 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24490 self.project_id = v.into();
24491 self
24492 }
24493
24494 /// Sets the value of [zone][crate::model::DeleteClusterRequest::zone].
24495 ///
24496 /// # Example
24497 /// ```ignore,no_run
24498 /// # use google_cloud_container_v1::model::DeleteClusterRequest;
24499 /// let x = DeleteClusterRequest::new().set_zone("example");
24500 /// ```
24501 #[deprecated]
24502 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24503 self.zone = v.into();
24504 self
24505 }
24506
24507 /// Sets the value of [cluster_id][crate::model::DeleteClusterRequest::cluster_id].
24508 ///
24509 /// # Example
24510 /// ```ignore,no_run
24511 /// # use google_cloud_container_v1::model::DeleteClusterRequest;
24512 /// let x = DeleteClusterRequest::new().set_cluster_id("example");
24513 /// ```
24514 #[deprecated]
24515 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24516 self.cluster_id = v.into();
24517 self
24518 }
24519
24520 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
24521 ///
24522 /// # Example
24523 /// ```ignore,no_run
24524 /// # use google_cloud_container_v1::model::DeleteClusterRequest;
24525 /// let x = DeleteClusterRequest::new().set_name("example");
24526 /// ```
24527 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24528 self.name = v.into();
24529 self
24530 }
24531}
24532
24533impl wkt::message::Message for DeleteClusterRequest {
24534 fn typename() -> &'static str {
24535 "type.googleapis.com/google.container.v1.DeleteClusterRequest"
24536 }
24537}
24538
24539/// ListClustersRequest lists clusters.
24540#[derive(Clone, Default, PartialEq)]
24541#[non_exhaustive]
24542pub struct ListClustersRequest {
24543 /// Deprecated. The Google Developers Console [project ID or project
24544 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24545 /// This field has been deprecated and replaced by the parent field.
24546 #[deprecated]
24547 pub project_id: std::string::String,
24548
24549 /// Deprecated. The name of the Google Compute Engine
24550 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24551 /// in which the cluster resides, or "-" for all zones. This field has been
24552 /// deprecated and replaced by the parent field.
24553 #[deprecated]
24554 pub zone: std::string::String,
24555
24556 /// The parent (project and location) where the clusters will be listed.
24557 /// Specified in the format `projects/*/locations/*`.
24558 /// Location "-" matches all zones and all regions.
24559 pub parent: std::string::String,
24560
24561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24562}
24563
24564impl ListClustersRequest {
24565 /// Creates a new default instance.
24566 pub fn new() -> Self {
24567 std::default::Default::default()
24568 }
24569
24570 /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
24571 ///
24572 /// # Example
24573 /// ```ignore,no_run
24574 /// # use google_cloud_container_v1::model::ListClustersRequest;
24575 /// let x = ListClustersRequest::new().set_project_id("example");
24576 /// ```
24577 #[deprecated]
24578 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24579 self.project_id = v.into();
24580 self
24581 }
24582
24583 /// Sets the value of [zone][crate::model::ListClustersRequest::zone].
24584 ///
24585 /// # Example
24586 /// ```ignore,no_run
24587 /// # use google_cloud_container_v1::model::ListClustersRequest;
24588 /// let x = ListClustersRequest::new().set_zone("example");
24589 /// ```
24590 #[deprecated]
24591 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24592 self.zone = v.into();
24593 self
24594 }
24595
24596 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
24597 ///
24598 /// # Example
24599 /// ```ignore,no_run
24600 /// # use google_cloud_container_v1::model::ListClustersRequest;
24601 /// let x = ListClustersRequest::new().set_parent("example");
24602 /// ```
24603 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24604 self.parent = v.into();
24605 self
24606 }
24607}
24608
24609impl wkt::message::Message for ListClustersRequest {
24610 fn typename() -> &'static str {
24611 "type.googleapis.com/google.container.v1.ListClustersRequest"
24612 }
24613}
24614
24615/// ListClustersResponse is the result of ListClustersRequest.
24616#[derive(Clone, Default, PartialEq)]
24617#[non_exhaustive]
24618pub struct ListClustersResponse {
24619 /// A list of clusters in the project in the specified zone, or
24620 /// across all ones.
24621 pub clusters: std::vec::Vec<crate::model::Cluster>,
24622
24623 /// If any zones are listed here, the list of clusters returned
24624 /// may be missing those zones.
24625 pub missing_zones: std::vec::Vec<std::string::String>,
24626
24627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24628}
24629
24630impl ListClustersResponse {
24631 /// Creates a new default instance.
24632 pub fn new() -> Self {
24633 std::default::Default::default()
24634 }
24635
24636 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
24637 ///
24638 /// # Example
24639 /// ```ignore,no_run
24640 /// # use google_cloud_container_v1::model::ListClustersResponse;
24641 /// use google_cloud_container_v1::model::Cluster;
24642 /// let x = ListClustersResponse::new()
24643 /// .set_clusters([
24644 /// Cluster::default()/* use setters */,
24645 /// Cluster::default()/* use (different) setters */,
24646 /// ]);
24647 /// ```
24648 pub fn set_clusters<T, V>(mut self, v: T) -> Self
24649 where
24650 T: std::iter::IntoIterator<Item = V>,
24651 V: std::convert::Into<crate::model::Cluster>,
24652 {
24653 use std::iter::Iterator;
24654 self.clusters = v.into_iter().map(|i| i.into()).collect();
24655 self
24656 }
24657
24658 /// Sets the value of [missing_zones][crate::model::ListClustersResponse::missing_zones].
24659 ///
24660 /// # Example
24661 /// ```ignore,no_run
24662 /// # use google_cloud_container_v1::model::ListClustersResponse;
24663 /// let x = ListClustersResponse::new().set_missing_zones(["a", "b", "c"]);
24664 /// ```
24665 pub fn set_missing_zones<T, V>(mut self, v: T) -> Self
24666 where
24667 T: std::iter::IntoIterator<Item = V>,
24668 V: std::convert::Into<std::string::String>,
24669 {
24670 use std::iter::Iterator;
24671 self.missing_zones = v.into_iter().map(|i| i.into()).collect();
24672 self
24673 }
24674}
24675
24676impl wkt::message::Message for ListClustersResponse {
24677 fn typename() -> &'static str {
24678 "type.googleapis.com/google.container.v1.ListClustersResponse"
24679 }
24680}
24681
24682/// GetOperationRequest gets a single operation.
24683#[derive(Clone, Default, PartialEq)]
24684#[non_exhaustive]
24685pub struct GetOperationRequest {
24686 /// Deprecated. The Google Developers Console [project ID or project
24687 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24688 /// This field has been deprecated and replaced by the name field.
24689 #[deprecated]
24690 pub project_id: std::string::String,
24691
24692 /// Deprecated. The name of the Google Compute Engine
24693 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24694 /// in which the cluster resides. This field has been deprecated and replaced
24695 /// by the name field.
24696 #[deprecated]
24697 pub zone: std::string::String,
24698
24699 /// Deprecated. The server-assigned `name` of the operation.
24700 /// This field has been deprecated and replaced by the name field.
24701 #[deprecated]
24702 pub operation_id: std::string::String,
24703
24704 /// The name (project, location, operation id) of the operation to get.
24705 /// Specified in the format `projects/*/locations/*/operations/*`.
24706 pub name: std::string::String,
24707
24708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24709}
24710
24711impl GetOperationRequest {
24712 /// Creates a new default instance.
24713 pub fn new() -> Self {
24714 std::default::Default::default()
24715 }
24716
24717 /// Sets the value of [project_id][crate::model::GetOperationRequest::project_id].
24718 ///
24719 /// # Example
24720 /// ```ignore,no_run
24721 /// # use google_cloud_container_v1::model::GetOperationRequest;
24722 /// let x = GetOperationRequest::new().set_project_id("example");
24723 /// ```
24724 #[deprecated]
24725 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24726 self.project_id = v.into();
24727 self
24728 }
24729
24730 /// Sets the value of [zone][crate::model::GetOperationRequest::zone].
24731 ///
24732 /// # Example
24733 /// ```ignore,no_run
24734 /// # use google_cloud_container_v1::model::GetOperationRequest;
24735 /// let x = GetOperationRequest::new().set_zone("example");
24736 /// ```
24737 #[deprecated]
24738 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24739 self.zone = v.into();
24740 self
24741 }
24742
24743 /// Sets the value of [operation_id][crate::model::GetOperationRequest::operation_id].
24744 ///
24745 /// # Example
24746 /// ```ignore,no_run
24747 /// # use google_cloud_container_v1::model::GetOperationRequest;
24748 /// let x = GetOperationRequest::new().set_operation_id("example");
24749 /// ```
24750 #[deprecated]
24751 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24752 self.operation_id = v.into();
24753 self
24754 }
24755
24756 /// Sets the value of [name][crate::model::GetOperationRequest::name].
24757 ///
24758 /// # Example
24759 /// ```ignore,no_run
24760 /// # use google_cloud_container_v1::model::GetOperationRequest;
24761 /// let x = GetOperationRequest::new().set_name("example");
24762 /// ```
24763 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24764 self.name = v.into();
24765 self
24766 }
24767}
24768
24769impl wkt::message::Message for GetOperationRequest {
24770 fn typename() -> &'static str {
24771 "type.googleapis.com/google.container.v1.GetOperationRequest"
24772 }
24773}
24774
24775/// ListOperationsRequest lists operations.
24776#[derive(Clone, Default, PartialEq)]
24777#[non_exhaustive]
24778pub struct ListOperationsRequest {
24779 /// Deprecated. The Google Developers Console [project ID or project
24780 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24781 /// This field has been deprecated and replaced by the parent field.
24782 #[deprecated]
24783 pub project_id: std::string::String,
24784
24785 /// Deprecated. The name of the Google Compute Engine
24786 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24787 /// to return operations for, or `-` for all zones. This field has been
24788 /// deprecated and replaced by the parent field.
24789 #[deprecated]
24790 pub zone: std::string::String,
24791
24792 /// The parent (project and location) where the operations will be listed.
24793 /// Specified in the format `projects/*/locations/*`.
24794 /// Location "-" matches all zones and all regions.
24795 pub parent: std::string::String,
24796
24797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24798}
24799
24800impl ListOperationsRequest {
24801 /// Creates a new default instance.
24802 pub fn new() -> Self {
24803 std::default::Default::default()
24804 }
24805
24806 /// Sets the value of [project_id][crate::model::ListOperationsRequest::project_id].
24807 ///
24808 /// # Example
24809 /// ```ignore,no_run
24810 /// # use google_cloud_container_v1::model::ListOperationsRequest;
24811 /// let x = ListOperationsRequest::new().set_project_id("example");
24812 /// ```
24813 #[deprecated]
24814 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24815 self.project_id = v.into();
24816 self
24817 }
24818
24819 /// Sets the value of [zone][crate::model::ListOperationsRequest::zone].
24820 ///
24821 /// # Example
24822 /// ```ignore,no_run
24823 /// # use google_cloud_container_v1::model::ListOperationsRequest;
24824 /// let x = ListOperationsRequest::new().set_zone("example");
24825 /// ```
24826 #[deprecated]
24827 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24828 self.zone = v.into();
24829 self
24830 }
24831
24832 /// Sets the value of [parent][crate::model::ListOperationsRequest::parent].
24833 ///
24834 /// # Example
24835 /// ```ignore,no_run
24836 /// # use google_cloud_container_v1::model::ListOperationsRequest;
24837 /// let x = ListOperationsRequest::new().set_parent("example");
24838 /// ```
24839 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24840 self.parent = v.into();
24841 self
24842 }
24843}
24844
24845impl wkt::message::Message for ListOperationsRequest {
24846 fn typename() -> &'static str {
24847 "type.googleapis.com/google.container.v1.ListOperationsRequest"
24848 }
24849}
24850
24851/// CancelOperationRequest cancels a single operation.
24852#[derive(Clone, Default, PartialEq)]
24853#[non_exhaustive]
24854pub struct CancelOperationRequest {
24855 /// Deprecated. The Google Developers Console [project ID or project
24856 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24857 /// This field has been deprecated and replaced by the name field.
24858 #[deprecated]
24859 pub project_id: std::string::String,
24860
24861 /// Deprecated. The name of the Google Compute Engine
24862 /// [zone](https://cloud.google.com/compute/docs/zones#available)
24863 /// in which the operation resides. This field has been deprecated and replaced
24864 /// by the name field.
24865 #[deprecated]
24866 pub zone: std::string::String,
24867
24868 /// Deprecated. The server-assigned `name` of the operation.
24869 /// This field has been deprecated and replaced by the name field.
24870 #[deprecated]
24871 pub operation_id: std::string::String,
24872
24873 /// The name (project, location, operation id) of the operation to cancel.
24874 /// Specified in the format `projects/*/locations/*/operations/*`.
24875 pub name: std::string::String,
24876
24877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24878}
24879
24880impl CancelOperationRequest {
24881 /// Creates a new default instance.
24882 pub fn new() -> Self {
24883 std::default::Default::default()
24884 }
24885
24886 /// Sets the value of [project_id][crate::model::CancelOperationRequest::project_id].
24887 ///
24888 /// # Example
24889 /// ```ignore,no_run
24890 /// # use google_cloud_container_v1::model::CancelOperationRequest;
24891 /// let x = CancelOperationRequest::new().set_project_id("example");
24892 /// ```
24893 #[deprecated]
24894 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24895 self.project_id = v.into();
24896 self
24897 }
24898
24899 /// Sets the value of [zone][crate::model::CancelOperationRequest::zone].
24900 ///
24901 /// # Example
24902 /// ```ignore,no_run
24903 /// # use google_cloud_container_v1::model::CancelOperationRequest;
24904 /// let x = CancelOperationRequest::new().set_zone("example");
24905 /// ```
24906 #[deprecated]
24907 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24908 self.zone = v.into();
24909 self
24910 }
24911
24912 /// Sets the value of [operation_id][crate::model::CancelOperationRequest::operation_id].
24913 ///
24914 /// # Example
24915 /// ```ignore,no_run
24916 /// # use google_cloud_container_v1::model::CancelOperationRequest;
24917 /// let x = CancelOperationRequest::new().set_operation_id("example");
24918 /// ```
24919 #[deprecated]
24920 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24921 self.operation_id = v.into();
24922 self
24923 }
24924
24925 /// Sets the value of [name][crate::model::CancelOperationRequest::name].
24926 ///
24927 /// # Example
24928 /// ```ignore,no_run
24929 /// # use google_cloud_container_v1::model::CancelOperationRequest;
24930 /// let x = CancelOperationRequest::new().set_name("example");
24931 /// ```
24932 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24933 self.name = v.into();
24934 self
24935 }
24936}
24937
24938impl wkt::message::Message for CancelOperationRequest {
24939 fn typename() -> &'static str {
24940 "type.googleapis.com/google.container.v1.CancelOperationRequest"
24941 }
24942}
24943
24944/// ListOperationsResponse is the result of ListOperationsRequest.
24945#[derive(Clone, Default, PartialEq)]
24946#[non_exhaustive]
24947pub struct ListOperationsResponse {
24948 /// A list of operations in the project in the specified zone.
24949 pub operations: std::vec::Vec<crate::model::Operation>,
24950
24951 /// If any zones are listed here, the list of operations returned
24952 /// may be missing the operations from those zones.
24953 pub missing_zones: std::vec::Vec<std::string::String>,
24954
24955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24956}
24957
24958impl ListOperationsResponse {
24959 /// Creates a new default instance.
24960 pub fn new() -> Self {
24961 std::default::Default::default()
24962 }
24963
24964 /// Sets the value of [operations][crate::model::ListOperationsResponse::operations].
24965 ///
24966 /// # Example
24967 /// ```ignore,no_run
24968 /// # use google_cloud_container_v1::model::ListOperationsResponse;
24969 /// use google_cloud_container_v1::model::Operation;
24970 /// let x = ListOperationsResponse::new()
24971 /// .set_operations([
24972 /// Operation::default()/* use setters */,
24973 /// Operation::default()/* use (different) setters */,
24974 /// ]);
24975 /// ```
24976 pub fn set_operations<T, V>(mut self, v: T) -> Self
24977 where
24978 T: std::iter::IntoIterator<Item = V>,
24979 V: std::convert::Into<crate::model::Operation>,
24980 {
24981 use std::iter::Iterator;
24982 self.operations = v.into_iter().map(|i| i.into()).collect();
24983 self
24984 }
24985
24986 /// Sets the value of [missing_zones][crate::model::ListOperationsResponse::missing_zones].
24987 ///
24988 /// # Example
24989 /// ```ignore,no_run
24990 /// # use google_cloud_container_v1::model::ListOperationsResponse;
24991 /// let x = ListOperationsResponse::new().set_missing_zones(["a", "b", "c"]);
24992 /// ```
24993 pub fn set_missing_zones<T, V>(mut self, v: T) -> Self
24994 where
24995 T: std::iter::IntoIterator<Item = V>,
24996 V: std::convert::Into<std::string::String>,
24997 {
24998 use std::iter::Iterator;
24999 self.missing_zones = v.into_iter().map(|i| i.into()).collect();
25000 self
25001 }
25002}
25003
25004impl wkt::message::Message for ListOperationsResponse {
25005 fn typename() -> &'static str {
25006 "type.googleapis.com/google.container.v1.ListOperationsResponse"
25007 }
25008}
25009
25010/// Gets the current Kubernetes Engine service configuration.
25011#[derive(Clone, Default, PartialEq)]
25012#[non_exhaustive]
25013pub struct GetServerConfigRequest {
25014 /// Deprecated. The Google Developers Console [project ID or project
25015 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25016 /// This field has been deprecated and replaced by the name field.
25017 #[deprecated]
25018 pub project_id: std::string::String,
25019
25020 /// Deprecated. The name of the Google Compute Engine
25021 /// [zone](https://cloud.google.com/compute/docs/zones#available)
25022 /// to return operations for. This field has been deprecated and replaced by
25023 /// the name field.
25024 #[deprecated]
25025 pub zone: std::string::String,
25026
25027 /// The name (project and location) of the server config to get,
25028 /// specified in the format `projects/*/locations/*`.
25029 pub name: std::string::String,
25030
25031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25032}
25033
25034impl GetServerConfigRequest {
25035 /// Creates a new default instance.
25036 pub fn new() -> Self {
25037 std::default::Default::default()
25038 }
25039
25040 /// Sets the value of [project_id][crate::model::GetServerConfigRequest::project_id].
25041 ///
25042 /// # Example
25043 /// ```ignore,no_run
25044 /// # use google_cloud_container_v1::model::GetServerConfigRequest;
25045 /// let x = GetServerConfigRequest::new().set_project_id("example");
25046 /// ```
25047 #[deprecated]
25048 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25049 self.project_id = v.into();
25050 self
25051 }
25052
25053 /// Sets the value of [zone][crate::model::GetServerConfigRequest::zone].
25054 ///
25055 /// # Example
25056 /// ```ignore,no_run
25057 /// # use google_cloud_container_v1::model::GetServerConfigRequest;
25058 /// let x = GetServerConfigRequest::new().set_zone("example");
25059 /// ```
25060 #[deprecated]
25061 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25062 self.zone = v.into();
25063 self
25064 }
25065
25066 /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
25067 ///
25068 /// # Example
25069 /// ```ignore,no_run
25070 /// # use google_cloud_container_v1::model::GetServerConfigRequest;
25071 /// let x = GetServerConfigRequest::new().set_name("example");
25072 /// ```
25073 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25074 self.name = v.into();
25075 self
25076 }
25077}
25078
25079impl wkt::message::Message for GetServerConfigRequest {
25080 fn typename() -> &'static str {
25081 "type.googleapis.com/google.container.v1.GetServerConfigRequest"
25082 }
25083}
25084
25085/// Kubernetes Engine service configuration.
25086#[derive(Clone, Default, PartialEq)]
25087#[non_exhaustive]
25088pub struct ServerConfig {
25089 /// Version of Kubernetes the service deploys by default.
25090 pub default_cluster_version: std::string::String,
25091
25092 /// List of valid node upgrade target versions, in descending order.
25093 pub valid_node_versions: std::vec::Vec<std::string::String>,
25094
25095 /// Default image type.
25096 pub default_image_type: std::string::String,
25097
25098 /// List of valid image types.
25099 pub valid_image_types: std::vec::Vec<std::string::String>,
25100
25101 /// List of valid master versions, in descending order.
25102 pub valid_master_versions: std::vec::Vec<std::string::String>,
25103
25104 /// List of release channel configurations.
25105 pub channels: std::vec::Vec<crate::model::server_config::ReleaseChannelConfig>,
25106
25107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25108}
25109
25110impl ServerConfig {
25111 /// Creates a new default instance.
25112 pub fn new() -> Self {
25113 std::default::Default::default()
25114 }
25115
25116 /// Sets the value of [default_cluster_version][crate::model::ServerConfig::default_cluster_version].
25117 ///
25118 /// # Example
25119 /// ```ignore,no_run
25120 /// # use google_cloud_container_v1::model::ServerConfig;
25121 /// let x = ServerConfig::new().set_default_cluster_version("example");
25122 /// ```
25123 pub fn set_default_cluster_version<T: std::convert::Into<std::string::String>>(
25124 mut self,
25125 v: T,
25126 ) -> Self {
25127 self.default_cluster_version = v.into();
25128 self
25129 }
25130
25131 /// Sets the value of [valid_node_versions][crate::model::ServerConfig::valid_node_versions].
25132 ///
25133 /// # Example
25134 /// ```ignore,no_run
25135 /// # use google_cloud_container_v1::model::ServerConfig;
25136 /// let x = ServerConfig::new().set_valid_node_versions(["a", "b", "c"]);
25137 /// ```
25138 pub fn set_valid_node_versions<T, V>(mut self, v: T) -> Self
25139 where
25140 T: std::iter::IntoIterator<Item = V>,
25141 V: std::convert::Into<std::string::String>,
25142 {
25143 use std::iter::Iterator;
25144 self.valid_node_versions = v.into_iter().map(|i| i.into()).collect();
25145 self
25146 }
25147
25148 /// Sets the value of [default_image_type][crate::model::ServerConfig::default_image_type].
25149 ///
25150 /// # Example
25151 /// ```ignore,no_run
25152 /// # use google_cloud_container_v1::model::ServerConfig;
25153 /// let x = ServerConfig::new().set_default_image_type("example");
25154 /// ```
25155 pub fn set_default_image_type<T: std::convert::Into<std::string::String>>(
25156 mut self,
25157 v: T,
25158 ) -> Self {
25159 self.default_image_type = v.into();
25160 self
25161 }
25162
25163 /// Sets the value of [valid_image_types][crate::model::ServerConfig::valid_image_types].
25164 ///
25165 /// # Example
25166 /// ```ignore,no_run
25167 /// # use google_cloud_container_v1::model::ServerConfig;
25168 /// let x = ServerConfig::new().set_valid_image_types(["a", "b", "c"]);
25169 /// ```
25170 pub fn set_valid_image_types<T, V>(mut self, v: T) -> Self
25171 where
25172 T: std::iter::IntoIterator<Item = V>,
25173 V: std::convert::Into<std::string::String>,
25174 {
25175 use std::iter::Iterator;
25176 self.valid_image_types = v.into_iter().map(|i| i.into()).collect();
25177 self
25178 }
25179
25180 /// Sets the value of [valid_master_versions][crate::model::ServerConfig::valid_master_versions].
25181 ///
25182 /// # Example
25183 /// ```ignore,no_run
25184 /// # use google_cloud_container_v1::model::ServerConfig;
25185 /// let x = ServerConfig::new().set_valid_master_versions(["a", "b", "c"]);
25186 /// ```
25187 pub fn set_valid_master_versions<T, V>(mut self, v: T) -> Self
25188 where
25189 T: std::iter::IntoIterator<Item = V>,
25190 V: std::convert::Into<std::string::String>,
25191 {
25192 use std::iter::Iterator;
25193 self.valid_master_versions = v.into_iter().map(|i| i.into()).collect();
25194 self
25195 }
25196
25197 /// Sets the value of [channels][crate::model::ServerConfig::channels].
25198 ///
25199 /// # Example
25200 /// ```ignore,no_run
25201 /// # use google_cloud_container_v1::model::ServerConfig;
25202 /// use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
25203 /// let x = ServerConfig::new()
25204 /// .set_channels([
25205 /// ReleaseChannelConfig::default()/* use setters */,
25206 /// ReleaseChannelConfig::default()/* use (different) setters */,
25207 /// ]);
25208 /// ```
25209 pub fn set_channels<T, V>(mut self, v: T) -> Self
25210 where
25211 T: std::iter::IntoIterator<Item = V>,
25212 V: std::convert::Into<crate::model::server_config::ReleaseChannelConfig>,
25213 {
25214 use std::iter::Iterator;
25215 self.channels = v.into_iter().map(|i| i.into()).collect();
25216 self
25217 }
25218}
25219
25220impl wkt::message::Message for ServerConfig {
25221 fn typename() -> &'static str {
25222 "type.googleapis.com/google.container.v1.ServerConfig"
25223 }
25224}
25225
25226/// Defines additional types related to [ServerConfig].
25227pub mod server_config {
25228 #[allow(unused_imports)]
25229 use super::*;
25230
25231 /// ReleaseChannelConfig exposes configuration for a release channel.
25232 #[derive(Clone, Default, PartialEq)]
25233 #[non_exhaustive]
25234 pub struct ReleaseChannelConfig {
25235 /// The release channel this configuration applies to.
25236 pub channel: crate::model::release_channel::Channel,
25237
25238 /// The default version for newly created clusters on the channel.
25239 pub default_version: std::string::String,
25240
25241 /// List of valid versions for the channel.
25242 pub valid_versions: std::vec::Vec<std::string::String>,
25243
25244 /// The auto upgrade target version for clusters on the channel.
25245 pub upgrade_target_version: std::string::String,
25246
25247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25248 }
25249
25250 impl ReleaseChannelConfig {
25251 /// Creates a new default instance.
25252 pub fn new() -> Self {
25253 std::default::Default::default()
25254 }
25255
25256 /// Sets the value of [channel][crate::model::server_config::ReleaseChannelConfig::channel].
25257 ///
25258 /// # Example
25259 /// ```ignore,no_run
25260 /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
25261 /// use google_cloud_container_v1::model::release_channel::Channel;
25262 /// let x0 = ReleaseChannelConfig::new().set_channel(Channel::Rapid);
25263 /// let x1 = ReleaseChannelConfig::new().set_channel(Channel::Regular);
25264 /// let x2 = ReleaseChannelConfig::new().set_channel(Channel::Stable);
25265 /// ```
25266 pub fn set_channel<T: std::convert::Into<crate::model::release_channel::Channel>>(
25267 mut self,
25268 v: T,
25269 ) -> Self {
25270 self.channel = v.into();
25271 self
25272 }
25273
25274 /// Sets the value of [default_version][crate::model::server_config::ReleaseChannelConfig::default_version].
25275 ///
25276 /// # Example
25277 /// ```ignore,no_run
25278 /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
25279 /// let x = ReleaseChannelConfig::new().set_default_version("example");
25280 /// ```
25281 pub fn set_default_version<T: std::convert::Into<std::string::String>>(
25282 mut self,
25283 v: T,
25284 ) -> Self {
25285 self.default_version = v.into();
25286 self
25287 }
25288
25289 /// Sets the value of [valid_versions][crate::model::server_config::ReleaseChannelConfig::valid_versions].
25290 ///
25291 /// # Example
25292 /// ```ignore,no_run
25293 /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
25294 /// let x = ReleaseChannelConfig::new().set_valid_versions(["a", "b", "c"]);
25295 /// ```
25296 pub fn set_valid_versions<T, V>(mut self, v: T) -> Self
25297 where
25298 T: std::iter::IntoIterator<Item = V>,
25299 V: std::convert::Into<std::string::String>,
25300 {
25301 use std::iter::Iterator;
25302 self.valid_versions = v.into_iter().map(|i| i.into()).collect();
25303 self
25304 }
25305
25306 /// Sets the value of [upgrade_target_version][crate::model::server_config::ReleaseChannelConfig::upgrade_target_version].
25307 ///
25308 /// # Example
25309 /// ```ignore,no_run
25310 /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
25311 /// let x = ReleaseChannelConfig::new().set_upgrade_target_version("example");
25312 /// ```
25313 pub fn set_upgrade_target_version<T: std::convert::Into<std::string::String>>(
25314 mut self,
25315 v: T,
25316 ) -> Self {
25317 self.upgrade_target_version = v.into();
25318 self
25319 }
25320 }
25321
25322 impl wkt::message::Message for ReleaseChannelConfig {
25323 fn typename() -> &'static str {
25324 "type.googleapis.com/google.container.v1.ServerConfig.ReleaseChannelConfig"
25325 }
25326 }
25327}
25328
25329/// CreateNodePoolRequest creates a node pool for a cluster.
25330#[derive(Clone, Default, PartialEq)]
25331#[non_exhaustive]
25332pub struct CreateNodePoolRequest {
25333 /// Deprecated. The Google Developers Console [project ID or project
25334 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25335 /// This field has been deprecated and replaced by the parent field.
25336 #[deprecated]
25337 pub project_id: std::string::String,
25338
25339 /// Deprecated. The name of the Google Compute Engine
25340 /// [zone](https://cloud.google.com/compute/docs/zones#available)
25341 /// in which the cluster resides. This field has been deprecated and replaced
25342 /// by the parent field.
25343 #[deprecated]
25344 pub zone: std::string::String,
25345
25346 /// Deprecated. The name of the cluster.
25347 /// This field has been deprecated and replaced by the parent field.
25348 #[deprecated]
25349 pub cluster_id: std::string::String,
25350
25351 /// Required. The node pool to create.
25352 pub node_pool: std::option::Option<crate::model::NodePool>,
25353
25354 /// The parent (project, location, cluster name) where the node pool will be
25355 /// created. Specified in the format
25356 /// `projects/*/locations/*/clusters/*`.
25357 pub parent: std::string::String,
25358
25359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25360}
25361
25362impl CreateNodePoolRequest {
25363 /// Creates a new default instance.
25364 pub fn new() -> Self {
25365 std::default::Default::default()
25366 }
25367
25368 /// Sets the value of [project_id][crate::model::CreateNodePoolRequest::project_id].
25369 ///
25370 /// # Example
25371 /// ```ignore,no_run
25372 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25373 /// let x = CreateNodePoolRequest::new().set_project_id("example");
25374 /// ```
25375 #[deprecated]
25376 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25377 self.project_id = v.into();
25378 self
25379 }
25380
25381 /// Sets the value of [zone][crate::model::CreateNodePoolRequest::zone].
25382 ///
25383 /// # Example
25384 /// ```ignore,no_run
25385 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25386 /// let x = CreateNodePoolRequest::new().set_zone("example");
25387 /// ```
25388 #[deprecated]
25389 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25390 self.zone = v.into();
25391 self
25392 }
25393
25394 /// Sets the value of [cluster_id][crate::model::CreateNodePoolRequest::cluster_id].
25395 ///
25396 /// # Example
25397 /// ```ignore,no_run
25398 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25399 /// let x = CreateNodePoolRequest::new().set_cluster_id("example");
25400 /// ```
25401 #[deprecated]
25402 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25403 self.cluster_id = v.into();
25404 self
25405 }
25406
25407 /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
25408 ///
25409 /// # Example
25410 /// ```ignore,no_run
25411 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25412 /// use google_cloud_container_v1::model::NodePool;
25413 /// let x = CreateNodePoolRequest::new().set_node_pool(NodePool::default()/* use setters */);
25414 /// ```
25415 pub fn set_node_pool<T>(mut self, v: T) -> Self
25416 where
25417 T: std::convert::Into<crate::model::NodePool>,
25418 {
25419 self.node_pool = std::option::Option::Some(v.into());
25420 self
25421 }
25422
25423 /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
25424 ///
25425 /// # Example
25426 /// ```ignore,no_run
25427 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25428 /// use google_cloud_container_v1::model::NodePool;
25429 /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(Some(NodePool::default()/* use setters */));
25430 /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(None::<NodePool>);
25431 /// ```
25432 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
25433 where
25434 T: std::convert::Into<crate::model::NodePool>,
25435 {
25436 self.node_pool = v.map(|x| x.into());
25437 self
25438 }
25439
25440 /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
25441 ///
25442 /// # Example
25443 /// ```ignore,no_run
25444 /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
25445 /// let x = CreateNodePoolRequest::new().set_parent("example");
25446 /// ```
25447 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25448 self.parent = v.into();
25449 self
25450 }
25451}
25452
25453impl wkt::message::Message for CreateNodePoolRequest {
25454 fn typename() -> &'static str {
25455 "type.googleapis.com/google.container.v1.CreateNodePoolRequest"
25456 }
25457}
25458
25459/// DeleteNodePoolRequest deletes a node pool for a cluster.
25460#[derive(Clone, Default, PartialEq)]
25461#[non_exhaustive]
25462pub struct DeleteNodePoolRequest {
25463 /// Deprecated. The Google Developers Console [project ID or project
25464 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25465 /// This field has been deprecated and replaced by the name field.
25466 #[deprecated]
25467 pub project_id: std::string::String,
25468
25469 /// Deprecated. The name of the Google Compute Engine
25470 /// [zone](https://cloud.google.com/compute/docs/zones#available)
25471 /// in which the cluster resides. This field has been deprecated and replaced
25472 /// by the name field.
25473 #[deprecated]
25474 pub zone: std::string::String,
25475
25476 /// Deprecated. The name of the cluster.
25477 /// This field has been deprecated and replaced by the name field.
25478 #[deprecated]
25479 pub cluster_id: std::string::String,
25480
25481 /// Deprecated. The name of the node pool to delete.
25482 /// This field has been deprecated and replaced by the name field.
25483 #[deprecated]
25484 pub node_pool_id: std::string::String,
25485
25486 /// The name (project, location, cluster, node pool id) of the node pool to
25487 /// delete. Specified in the format
25488 /// `projects/*/locations/*/clusters/*/nodePools/*`.
25489 pub name: std::string::String,
25490
25491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25492}
25493
25494impl DeleteNodePoolRequest {
25495 /// Creates a new default instance.
25496 pub fn new() -> Self {
25497 std::default::Default::default()
25498 }
25499
25500 /// Sets the value of [project_id][crate::model::DeleteNodePoolRequest::project_id].
25501 ///
25502 /// # Example
25503 /// ```ignore,no_run
25504 /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
25505 /// let x = DeleteNodePoolRequest::new().set_project_id("example");
25506 /// ```
25507 #[deprecated]
25508 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25509 self.project_id = v.into();
25510 self
25511 }
25512
25513 /// Sets the value of [zone][crate::model::DeleteNodePoolRequest::zone].
25514 ///
25515 /// # Example
25516 /// ```ignore,no_run
25517 /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
25518 /// let x = DeleteNodePoolRequest::new().set_zone("example");
25519 /// ```
25520 #[deprecated]
25521 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25522 self.zone = v.into();
25523 self
25524 }
25525
25526 /// Sets the value of [cluster_id][crate::model::DeleteNodePoolRequest::cluster_id].
25527 ///
25528 /// # Example
25529 /// ```ignore,no_run
25530 /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
25531 /// let x = DeleteNodePoolRequest::new().set_cluster_id("example");
25532 /// ```
25533 #[deprecated]
25534 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25535 self.cluster_id = v.into();
25536 self
25537 }
25538
25539 /// Sets the value of [node_pool_id][crate::model::DeleteNodePoolRequest::node_pool_id].
25540 ///
25541 /// # Example
25542 /// ```ignore,no_run
25543 /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
25544 /// let x = DeleteNodePoolRequest::new().set_node_pool_id("example");
25545 /// ```
25546 #[deprecated]
25547 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25548 self.node_pool_id = v.into();
25549 self
25550 }
25551
25552 /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
25553 ///
25554 /// # Example
25555 /// ```ignore,no_run
25556 /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
25557 /// let x = DeleteNodePoolRequest::new().set_name("example");
25558 /// ```
25559 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25560 self.name = v.into();
25561 self
25562 }
25563}
25564
25565impl wkt::message::Message for DeleteNodePoolRequest {
25566 fn typename() -> &'static str {
25567 "type.googleapis.com/google.container.v1.DeleteNodePoolRequest"
25568 }
25569}
25570
25571/// ListNodePoolsRequest lists the node pool(s) for a cluster.
25572#[derive(Clone, Default, PartialEq)]
25573#[non_exhaustive]
25574pub struct ListNodePoolsRequest {
25575 /// Deprecated. The Google Developers Console [project ID or project
25576 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25577 /// This field has been deprecated and replaced by the parent field.
25578 #[deprecated]
25579 pub project_id: std::string::String,
25580
25581 /// Deprecated. The name of the Google Compute Engine
25582 /// [zone](https://cloud.google.com/compute/docs/zones#available)
25583 /// in which the cluster resides. This field has been deprecated and replaced
25584 /// by the parent field.
25585 #[deprecated]
25586 pub zone: std::string::String,
25587
25588 /// Deprecated. The name of the cluster.
25589 /// This field has been deprecated and replaced by the parent field.
25590 #[deprecated]
25591 pub cluster_id: std::string::String,
25592
25593 /// The parent (project, location, cluster name) where the node pools will be
25594 /// listed. Specified in the format `projects/*/locations/*/clusters/*`.
25595 pub parent: std::string::String,
25596
25597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25598}
25599
25600impl ListNodePoolsRequest {
25601 /// Creates a new default instance.
25602 pub fn new() -> Self {
25603 std::default::Default::default()
25604 }
25605
25606 /// Sets the value of [project_id][crate::model::ListNodePoolsRequest::project_id].
25607 ///
25608 /// # Example
25609 /// ```ignore,no_run
25610 /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
25611 /// let x = ListNodePoolsRequest::new().set_project_id("example");
25612 /// ```
25613 #[deprecated]
25614 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25615 self.project_id = v.into();
25616 self
25617 }
25618
25619 /// Sets the value of [zone][crate::model::ListNodePoolsRequest::zone].
25620 ///
25621 /// # Example
25622 /// ```ignore,no_run
25623 /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
25624 /// let x = ListNodePoolsRequest::new().set_zone("example");
25625 /// ```
25626 #[deprecated]
25627 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25628 self.zone = v.into();
25629 self
25630 }
25631
25632 /// Sets the value of [cluster_id][crate::model::ListNodePoolsRequest::cluster_id].
25633 ///
25634 /// # Example
25635 /// ```ignore,no_run
25636 /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
25637 /// let x = ListNodePoolsRequest::new().set_cluster_id("example");
25638 /// ```
25639 #[deprecated]
25640 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25641 self.cluster_id = v.into();
25642 self
25643 }
25644
25645 /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
25646 ///
25647 /// # Example
25648 /// ```ignore,no_run
25649 /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
25650 /// let x = ListNodePoolsRequest::new().set_parent("example");
25651 /// ```
25652 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25653 self.parent = v.into();
25654 self
25655 }
25656}
25657
25658impl wkt::message::Message for ListNodePoolsRequest {
25659 fn typename() -> &'static str {
25660 "type.googleapis.com/google.container.v1.ListNodePoolsRequest"
25661 }
25662}
25663
25664/// GetNodePoolRequest retrieves a node pool for a cluster.
25665#[derive(Clone, Default, PartialEq)]
25666#[non_exhaustive]
25667pub struct GetNodePoolRequest {
25668 /// Deprecated. The Google Developers Console [project ID or project
25669 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25670 /// This field has been deprecated and replaced by the name field.
25671 #[deprecated]
25672 pub project_id: std::string::String,
25673
25674 /// Deprecated. The name of the Google Compute Engine
25675 /// [zone](https://cloud.google.com/compute/docs/zones#available)
25676 /// in which the cluster resides. This field has been deprecated and replaced
25677 /// by the name field.
25678 #[deprecated]
25679 pub zone: std::string::String,
25680
25681 /// Deprecated. The name of the cluster.
25682 /// This field has been deprecated and replaced by the name field.
25683 #[deprecated]
25684 pub cluster_id: std::string::String,
25685
25686 /// Deprecated. The name of the node pool.
25687 /// This field has been deprecated and replaced by the name field.
25688 #[deprecated]
25689 pub node_pool_id: std::string::String,
25690
25691 /// The name (project, location, cluster, node pool id) of the node pool to
25692 /// get. Specified in the format
25693 /// `projects/*/locations/*/clusters/*/nodePools/*`.
25694 pub name: std::string::String,
25695
25696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25697}
25698
25699impl GetNodePoolRequest {
25700 /// Creates a new default instance.
25701 pub fn new() -> Self {
25702 std::default::Default::default()
25703 }
25704
25705 /// Sets the value of [project_id][crate::model::GetNodePoolRequest::project_id].
25706 ///
25707 /// # Example
25708 /// ```ignore,no_run
25709 /// # use google_cloud_container_v1::model::GetNodePoolRequest;
25710 /// let x = GetNodePoolRequest::new().set_project_id("example");
25711 /// ```
25712 #[deprecated]
25713 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25714 self.project_id = v.into();
25715 self
25716 }
25717
25718 /// Sets the value of [zone][crate::model::GetNodePoolRequest::zone].
25719 ///
25720 /// # Example
25721 /// ```ignore,no_run
25722 /// # use google_cloud_container_v1::model::GetNodePoolRequest;
25723 /// let x = GetNodePoolRequest::new().set_zone("example");
25724 /// ```
25725 #[deprecated]
25726 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25727 self.zone = v.into();
25728 self
25729 }
25730
25731 /// Sets the value of [cluster_id][crate::model::GetNodePoolRequest::cluster_id].
25732 ///
25733 /// # Example
25734 /// ```ignore,no_run
25735 /// # use google_cloud_container_v1::model::GetNodePoolRequest;
25736 /// let x = GetNodePoolRequest::new().set_cluster_id("example");
25737 /// ```
25738 #[deprecated]
25739 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25740 self.cluster_id = v.into();
25741 self
25742 }
25743
25744 /// Sets the value of [node_pool_id][crate::model::GetNodePoolRequest::node_pool_id].
25745 ///
25746 /// # Example
25747 /// ```ignore,no_run
25748 /// # use google_cloud_container_v1::model::GetNodePoolRequest;
25749 /// let x = GetNodePoolRequest::new().set_node_pool_id("example");
25750 /// ```
25751 #[deprecated]
25752 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25753 self.node_pool_id = v.into();
25754 self
25755 }
25756
25757 /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
25758 ///
25759 /// # Example
25760 /// ```ignore,no_run
25761 /// # use google_cloud_container_v1::model::GetNodePoolRequest;
25762 /// let x = GetNodePoolRequest::new().set_name("example");
25763 /// ```
25764 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25765 self.name = v.into();
25766 self
25767 }
25768}
25769
25770impl wkt::message::Message for GetNodePoolRequest {
25771 fn typename() -> &'static str {
25772 "type.googleapis.com/google.container.v1.GetNodePoolRequest"
25773 }
25774}
25775
25776/// Settings for blue-green upgrade.
25777#[derive(Clone, Default, PartialEq)]
25778#[non_exhaustive]
25779pub struct BlueGreenSettings {
25780 /// Time needed after draining entire blue pool. After this period, blue pool
25781 /// will be cleaned up.
25782 pub node_pool_soak_duration: std::option::Option<wkt::Duration>,
25783
25784 /// The rollout policy controls the general rollout progress of blue-green.
25785 pub rollout_policy: std::option::Option<crate::model::blue_green_settings::RolloutPolicy>,
25786
25787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25788}
25789
25790impl BlueGreenSettings {
25791 /// Creates a new default instance.
25792 pub fn new() -> Self {
25793 std::default::Default::default()
25794 }
25795
25796 /// Sets the value of [node_pool_soak_duration][crate::model::BlueGreenSettings::node_pool_soak_duration].
25797 ///
25798 /// # Example
25799 /// ```ignore,no_run
25800 /// # use google_cloud_container_v1::model::BlueGreenSettings;
25801 /// use wkt::Duration;
25802 /// let x = BlueGreenSettings::new().set_node_pool_soak_duration(Duration::default()/* use setters */);
25803 /// ```
25804 pub fn set_node_pool_soak_duration<T>(mut self, v: T) -> Self
25805 where
25806 T: std::convert::Into<wkt::Duration>,
25807 {
25808 self.node_pool_soak_duration = std::option::Option::Some(v.into());
25809 self
25810 }
25811
25812 /// Sets or clears the value of [node_pool_soak_duration][crate::model::BlueGreenSettings::node_pool_soak_duration].
25813 ///
25814 /// # Example
25815 /// ```ignore,no_run
25816 /// # use google_cloud_container_v1::model::BlueGreenSettings;
25817 /// use wkt::Duration;
25818 /// let x = BlueGreenSettings::new().set_or_clear_node_pool_soak_duration(Some(Duration::default()/* use setters */));
25819 /// let x = BlueGreenSettings::new().set_or_clear_node_pool_soak_duration(None::<Duration>);
25820 /// ```
25821 pub fn set_or_clear_node_pool_soak_duration<T>(mut self, v: std::option::Option<T>) -> Self
25822 where
25823 T: std::convert::Into<wkt::Duration>,
25824 {
25825 self.node_pool_soak_duration = v.map(|x| x.into());
25826 self
25827 }
25828
25829 /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy].
25830 ///
25831 /// Note that all the setters affecting `rollout_policy` are mutually
25832 /// exclusive.
25833 ///
25834 /// # Example
25835 /// ```ignore,no_run
25836 /// # use google_cloud_container_v1::model::BlueGreenSettings;
25837 /// use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
25838 /// let x = BlueGreenSettings::new().set_rollout_policy(Some(
25839 /// google_cloud_container_v1::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(StandardRolloutPolicy::default().into())));
25840 /// ```
25841 pub fn set_rollout_policy<
25842 T: std::convert::Into<std::option::Option<crate::model::blue_green_settings::RolloutPolicy>>,
25843 >(
25844 mut self,
25845 v: T,
25846 ) -> Self {
25847 self.rollout_policy = v.into();
25848 self
25849 }
25850
25851 /// The value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
25852 /// if it holds a `StandardRolloutPolicy`, `None` if the field is not set or
25853 /// holds a different branch.
25854 pub fn standard_rollout_policy(
25855 &self,
25856 ) -> std::option::Option<
25857 &std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
25858 > {
25859 #[allow(unreachable_patterns)]
25860 self.rollout_policy.as_ref().and_then(|v| match v {
25861 crate::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(v) => {
25862 std::option::Option::Some(v)
25863 }
25864 _ => std::option::Option::None,
25865 })
25866 }
25867
25868 /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
25869 /// to hold a `StandardRolloutPolicy`.
25870 ///
25871 /// Note that all the setters affecting `rollout_policy` are
25872 /// mutually exclusive.
25873 ///
25874 /// # Example
25875 /// ```ignore,no_run
25876 /// # use google_cloud_container_v1::model::BlueGreenSettings;
25877 /// use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
25878 /// let x = BlueGreenSettings::new().set_standard_rollout_policy(StandardRolloutPolicy::default()/* use setters */);
25879 /// assert!(x.standard_rollout_policy().is_some());
25880 /// assert!(x.autoscaled_rollout_policy().is_none());
25881 /// ```
25882 pub fn set_standard_rollout_policy<
25883 T: std::convert::Into<
25884 std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
25885 >,
25886 >(
25887 mut self,
25888 v: T,
25889 ) -> Self {
25890 self.rollout_policy = std::option::Option::Some(
25891 crate::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(v.into()),
25892 );
25893 self
25894 }
25895
25896 /// The value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
25897 /// if it holds a `AutoscaledRolloutPolicy`, `None` if the field is not set or
25898 /// holds a different branch.
25899 pub fn autoscaled_rollout_policy(
25900 &self,
25901 ) -> std::option::Option<
25902 &std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
25903 > {
25904 #[allow(unreachable_patterns)]
25905 self.rollout_policy.as_ref().and_then(|v| match v {
25906 crate::model::blue_green_settings::RolloutPolicy::AutoscaledRolloutPolicy(v) => {
25907 std::option::Option::Some(v)
25908 }
25909 _ => std::option::Option::None,
25910 })
25911 }
25912
25913 /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
25914 /// to hold a `AutoscaledRolloutPolicy`.
25915 ///
25916 /// Note that all the setters affecting `rollout_policy` are
25917 /// mutually exclusive.
25918 ///
25919 /// # Example
25920 /// ```ignore,no_run
25921 /// # use google_cloud_container_v1::model::BlueGreenSettings;
25922 /// use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
25923 /// let x = BlueGreenSettings::new().set_autoscaled_rollout_policy(AutoscaledRolloutPolicy::default()/* use setters */);
25924 /// assert!(x.autoscaled_rollout_policy().is_some());
25925 /// assert!(x.standard_rollout_policy().is_none());
25926 /// ```
25927 pub fn set_autoscaled_rollout_policy<
25928 T: std::convert::Into<
25929 std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
25930 >,
25931 >(
25932 mut self,
25933 v: T,
25934 ) -> Self {
25935 self.rollout_policy = std::option::Option::Some(
25936 crate::model::blue_green_settings::RolloutPolicy::AutoscaledRolloutPolicy(v.into()),
25937 );
25938 self
25939 }
25940}
25941
25942impl wkt::message::Message for BlueGreenSettings {
25943 fn typename() -> &'static str {
25944 "type.googleapis.com/google.container.v1.BlueGreenSettings"
25945 }
25946}
25947
25948/// Defines additional types related to [BlueGreenSettings].
25949pub mod blue_green_settings {
25950 #[allow(unused_imports)]
25951 use super::*;
25952
25953 /// Standard rollout policy is the default policy for blue-green.
25954 #[derive(Clone, Default, PartialEq)]
25955 #[non_exhaustive]
25956 pub struct StandardRolloutPolicy {
25957 /// Soak time after each batch gets drained. Default to zero.
25958 pub batch_soak_duration: std::option::Option<wkt::Duration>,
25959
25960 /// Blue pool size to drain in a batch.
25961 pub update_batch_size: std::option::Option<
25962 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize,
25963 >,
25964
25965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25966 }
25967
25968 impl StandardRolloutPolicy {
25969 /// Creates a new default instance.
25970 pub fn new() -> Self {
25971 std::default::Default::default()
25972 }
25973
25974 /// Sets the value of [batch_soak_duration][crate::model::blue_green_settings::StandardRolloutPolicy::batch_soak_duration].
25975 ///
25976 /// # Example
25977 /// ```ignore,no_run
25978 /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
25979 /// use wkt::Duration;
25980 /// let x = StandardRolloutPolicy::new().set_batch_soak_duration(Duration::default()/* use setters */);
25981 /// ```
25982 pub fn set_batch_soak_duration<T>(mut self, v: T) -> Self
25983 where
25984 T: std::convert::Into<wkt::Duration>,
25985 {
25986 self.batch_soak_duration = std::option::Option::Some(v.into());
25987 self
25988 }
25989
25990 /// Sets or clears the value of [batch_soak_duration][crate::model::blue_green_settings::StandardRolloutPolicy::batch_soak_duration].
25991 ///
25992 /// # Example
25993 /// ```ignore,no_run
25994 /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
25995 /// use wkt::Duration;
25996 /// let x = StandardRolloutPolicy::new().set_or_clear_batch_soak_duration(Some(Duration::default()/* use setters */));
25997 /// let x = StandardRolloutPolicy::new().set_or_clear_batch_soak_duration(None::<Duration>);
25998 /// ```
25999 pub fn set_or_clear_batch_soak_duration<T>(mut self, v: std::option::Option<T>) -> Self
26000 where
26001 T: std::convert::Into<wkt::Duration>,
26002 {
26003 self.batch_soak_duration = v.map(|x| x.into());
26004 self
26005 }
26006
26007 /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size].
26008 ///
26009 /// Note that all the setters affecting `update_batch_size` are mutually
26010 /// exclusive.
26011 ///
26012 /// # Example
26013 /// ```ignore,no_run
26014 /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
26015 /// use google_cloud_container_v1::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize;
26016 /// let x = StandardRolloutPolicy::new().set_update_batch_size(Some(UpdateBatchSize::BatchPercentage(42.0)));
26017 /// ```
26018 pub fn set_update_batch_size<
26019 T: std::convert::Into<
26020 std::option::Option<
26021 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize,
26022 >,
26023 >,
26024 >(
26025 mut self,
26026 v: T,
26027 ) -> Self {
26028 self.update_batch_size = v.into();
26029 self
26030 }
26031
26032 /// The value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
26033 /// if it holds a `BatchPercentage`, `None` if the field is not set or
26034 /// holds a different branch.
26035 pub fn batch_percentage(&self) -> std::option::Option<&f32> {
26036 #[allow(unreachable_patterns)]
26037 self.update_batch_size.as_ref().and_then(|v| match v {
26038 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchPercentage(v) => std::option::Option::Some(v),
26039 _ => std::option::Option::None,
26040 })
26041 }
26042
26043 /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
26044 /// to hold a `BatchPercentage`.
26045 ///
26046 /// Note that all the setters affecting `update_batch_size` are
26047 /// mutually exclusive.
26048 ///
26049 /// # Example
26050 /// ```ignore,no_run
26051 /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
26052 /// let x = StandardRolloutPolicy::new().set_batch_percentage(42.0);
26053 /// assert!(x.batch_percentage().is_some());
26054 /// assert!(x.batch_node_count().is_none());
26055 /// ```
26056 pub fn set_batch_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
26057 self.update_batch_size = std::option::Option::Some(
26058 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchPercentage(
26059 v.into()
26060 )
26061 );
26062 self
26063 }
26064
26065 /// The value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
26066 /// if it holds a `BatchNodeCount`, `None` if the field is not set or
26067 /// holds a different branch.
26068 pub fn batch_node_count(&self) -> std::option::Option<&i32> {
26069 #[allow(unreachable_patterns)]
26070 self.update_batch_size.as_ref().and_then(|v| match v {
26071 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchNodeCount(v) => std::option::Option::Some(v),
26072 _ => std::option::Option::None,
26073 })
26074 }
26075
26076 /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
26077 /// to hold a `BatchNodeCount`.
26078 ///
26079 /// Note that all the setters affecting `update_batch_size` are
26080 /// mutually exclusive.
26081 ///
26082 /// # Example
26083 /// ```ignore,no_run
26084 /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
26085 /// let x = StandardRolloutPolicy::new().set_batch_node_count(42);
26086 /// assert!(x.batch_node_count().is_some());
26087 /// assert!(x.batch_percentage().is_none());
26088 /// ```
26089 pub fn set_batch_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26090 self.update_batch_size = std::option::Option::Some(
26091 crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchNodeCount(
26092 v.into()
26093 )
26094 );
26095 self
26096 }
26097 }
26098
26099 impl wkt::message::Message for StandardRolloutPolicy {
26100 fn typename() -> &'static str {
26101 "type.googleapis.com/google.container.v1.BlueGreenSettings.StandardRolloutPolicy"
26102 }
26103 }
26104
26105 /// Defines additional types related to [StandardRolloutPolicy].
26106 pub mod standard_rollout_policy {
26107 #[allow(unused_imports)]
26108 use super::*;
26109
26110 /// Blue pool size to drain in a batch.
26111 #[derive(Clone, Debug, PartialEq)]
26112 #[non_exhaustive]
26113 pub enum UpdateBatchSize {
26114 /// Percentage of the blue pool nodes to drain in a batch.
26115 /// The range of this field should be (0.0, 1.0].
26116 BatchPercentage(f32),
26117 /// Number of blue nodes to drain in a batch.
26118 BatchNodeCount(i32),
26119 }
26120 }
26121
26122 /// Autoscaled rollout policy utilizes the cluster autoscaler during
26123 /// blue-green upgrade to scale both the blue and green pools.
26124 #[derive(Clone, Default, PartialEq)]
26125 #[non_exhaustive]
26126 pub struct AutoscaledRolloutPolicy {
26127 /// Optional. Time to wait after cordoning the blue pool before draining the
26128 /// nodes. Defaults to 3 days. The value can be set between 0 and 7 days,
26129 /// inclusive.
26130 pub wait_for_drain_duration: std::option::Option<wkt::Duration>,
26131
26132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26133 }
26134
26135 impl AutoscaledRolloutPolicy {
26136 /// Creates a new default instance.
26137 pub fn new() -> Self {
26138 std::default::Default::default()
26139 }
26140
26141 /// Sets the value of [wait_for_drain_duration][crate::model::blue_green_settings::AutoscaledRolloutPolicy::wait_for_drain_duration].
26142 ///
26143 /// # Example
26144 /// ```ignore,no_run
26145 /// # use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
26146 /// use wkt::Duration;
26147 /// let x = AutoscaledRolloutPolicy::new().set_wait_for_drain_duration(Duration::default()/* use setters */);
26148 /// ```
26149 pub fn set_wait_for_drain_duration<T>(mut self, v: T) -> Self
26150 where
26151 T: std::convert::Into<wkt::Duration>,
26152 {
26153 self.wait_for_drain_duration = std::option::Option::Some(v.into());
26154 self
26155 }
26156
26157 /// Sets or clears the value of [wait_for_drain_duration][crate::model::blue_green_settings::AutoscaledRolloutPolicy::wait_for_drain_duration].
26158 ///
26159 /// # Example
26160 /// ```ignore,no_run
26161 /// # use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
26162 /// use wkt::Duration;
26163 /// let x = AutoscaledRolloutPolicy::new().set_or_clear_wait_for_drain_duration(Some(Duration::default()/* use setters */));
26164 /// let x = AutoscaledRolloutPolicy::new().set_or_clear_wait_for_drain_duration(None::<Duration>);
26165 /// ```
26166 pub fn set_or_clear_wait_for_drain_duration<T>(mut self, v: std::option::Option<T>) -> Self
26167 where
26168 T: std::convert::Into<wkt::Duration>,
26169 {
26170 self.wait_for_drain_duration = v.map(|x| x.into());
26171 self
26172 }
26173 }
26174
26175 impl wkt::message::Message for AutoscaledRolloutPolicy {
26176 fn typename() -> &'static str {
26177 "type.googleapis.com/google.container.v1.BlueGreenSettings.AutoscaledRolloutPolicy"
26178 }
26179 }
26180
26181 /// The rollout policy controls the general rollout progress of blue-green.
26182 #[derive(Clone, Debug, PartialEq)]
26183 #[non_exhaustive]
26184 pub enum RolloutPolicy {
26185 /// Standard policy for the blue-green upgrade.
26186 StandardRolloutPolicy(
26187 std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
26188 ),
26189 /// Autoscaled policy for cluster autoscaler enabled blue-green upgrade.
26190 AutoscaledRolloutPolicy(
26191 std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
26192 ),
26193 }
26194}
26195
26196/// NodePool contains the name and configuration for a cluster's node pool.
26197/// Node pools are a set of nodes (i.e. VM's), with a common configuration and
26198/// specification, under the control of the cluster master. They may have a set
26199/// of Kubernetes labels applied to them, which may be used to reference them
26200/// during pod scheduling. They may also be resized up or down, to accommodate
26201/// the workload.
26202#[derive(Clone, Default, PartialEq)]
26203#[non_exhaustive]
26204pub struct NodePool {
26205 /// The name of the node pool.
26206 pub name: std::string::String,
26207
26208 /// The node configuration of the pool.
26209 pub config: std::option::Option<crate::model::NodeConfig>,
26210
26211 /// The initial node count for the pool. You must ensure that your
26212 /// Compute Engine [resource
26213 /// quota](https://cloud.google.com/compute/quotas)
26214 /// is sufficient for this number of instances. You must also have available
26215 /// firewall and routes quota.
26216 pub initial_node_count: i32,
26217
26218 /// The list of Google Compute Engine
26219 /// [zones](https://cloud.google.com/compute/docs/zones#available)
26220 /// in which the NodePool's nodes should be located.
26221 ///
26222 /// If this value is unspecified during node pool creation, the
26223 /// [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations)
26224 /// value will be used, instead.
26225 ///
26226 /// Warning: changing node pool locations will result in nodes being added
26227 /// and/or removed.
26228 pub locations: std::vec::Vec<std::string::String>,
26229
26230 /// Networking configuration for this NodePool. If specified, it overrides the
26231 /// cluster-level defaults.
26232 pub network_config: std::option::Option<crate::model::NodeNetworkConfig>,
26233
26234 /// Output only. Server-defined URL for the resource.
26235 pub self_link: std::string::String,
26236
26237 /// The version of Kubernetes running on this NodePool's nodes. If unspecified,
26238 /// it defaults as described
26239 /// [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version).
26240 pub version: std::string::String,
26241
26242 /// Output only. The resource URLs of the [managed instance
26243 /// groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances)
26244 /// associated with this node pool.
26245 /// During the node pool blue-green upgrade operation, the URLs contain both
26246 /// blue and green resources.
26247 pub instance_group_urls: std::vec::Vec<std::string::String>,
26248
26249 /// Output only. The status of the nodes in this pool instance.
26250 pub status: crate::model::node_pool::Status,
26251
26252 /// Output only. Deprecated. Use conditions instead.
26253 /// Additional information about the current status of this
26254 /// node pool instance, if available.
26255 #[deprecated]
26256 pub status_message: std::string::String,
26257
26258 /// Autoscaler configuration for this NodePool. Autoscaler is enabled
26259 /// only if a valid configuration is present.
26260 pub autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
26261
26262 /// NodeManagement configuration for this NodePool.
26263 pub management: std::option::Option<crate::model::NodeManagement>,
26264
26265 /// The constraint on the maximum number of pods that can be run
26266 /// simultaneously on a node in the node pool.
26267 pub max_pods_constraint: std::option::Option<crate::model::MaxPodsConstraint>,
26268
26269 /// Which conditions caused the current node pool state.
26270 pub conditions: std::vec::Vec<crate::model::StatusCondition>,
26271
26272 /// Output only. The pod CIDR block size per node in this node pool.
26273 pub pod_ipv4_cidr_size: i32,
26274
26275 /// Upgrade settings control disruption and speed of the upgrade.
26276 pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
26277
26278 /// Specifies the node placement policy.
26279 pub placement_policy: std::option::Option<crate::model::node_pool::PlacementPolicy>,
26280
26281 /// Output only. Update info contains relevant information during a node
26282 /// pool update.
26283 pub update_info: std::option::Option<crate::model::node_pool::UpdateInfo>,
26284
26285 /// This checksum is computed by the server based on the value of node pool
26286 /// fields, and may be sent on update requests to ensure the client has an
26287 /// up-to-date value before proceeding.
26288 pub etag: std::string::String,
26289
26290 /// Specifies the configuration of queued provisioning.
26291 pub queued_provisioning: std::option::Option<crate::model::node_pool::QueuedProvisioning>,
26292
26293 /// Enable best effort provisioning for nodes
26294 pub best_effort_provisioning: std::option::Option<crate::model::BestEffortProvisioning>,
26295
26296 /// Specifies the node drain configuration for this node pool.
26297 pub node_drain_config: std::option::Option<crate::model::node_pool::NodeDrainConfig>,
26298
26299 /// Optional. Specifies the maintenance policy for the node pool.
26300 pub maintenance_policy: std::option::Option<crate::model::node_pool::NodePoolMaintenancePolicy>,
26301
26302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26303}
26304
26305impl NodePool {
26306 /// Creates a new default instance.
26307 pub fn new() -> Self {
26308 std::default::Default::default()
26309 }
26310
26311 /// Sets the value of [name][crate::model::NodePool::name].
26312 ///
26313 /// # Example
26314 /// ```ignore,no_run
26315 /// # use google_cloud_container_v1::model::NodePool;
26316 /// let x = NodePool::new().set_name("example");
26317 /// ```
26318 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26319 self.name = v.into();
26320 self
26321 }
26322
26323 /// Sets the value of [config][crate::model::NodePool::config].
26324 ///
26325 /// # Example
26326 /// ```ignore,no_run
26327 /// # use google_cloud_container_v1::model::NodePool;
26328 /// use google_cloud_container_v1::model::NodeConfig;
26329 /// let x = NodePool::new().set_config(NodeConfig::default()/* use setters */);
26330 /// ```
26331 pub fn set_config<T>(mut self, v: T) -> Self
26332 where
26333 T: std::convert::Into<crate::model::NodeConfig>,
26334 {
26335 self.config = std::option::Option::Some(v.into());
26336 self
26337 }
26338
26339 /// Sets or clears the value of [config][crate::model::NodePool::config].
26340 ///
26341 /// # Example
26342 /// ```ignore,no_run
26343 /// # use google_cloud_container_v1::model::NodePool;
26344 /// use google_cloud_container_v1::model::NodeConfig;
26345 /// let x = NodePool::new().set_or_clear_config(Some(NodeConfig::default()/* use setters */));
26346 /// let x = NodePool::new().set_or_clear_config(None::<NodeConfig>);
26347 /// ```
26348 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
26349 where
26350 T: std::convert::Into<crate::model::NodeConfig>,
26351 {
26352 self.config = v.map(|x| x.into());
26353 self
26354 }
26355
26356 /// Sets the value of [initial_node_count][crate::model::NodePool::initial_node_count].
26357 ///
26358 /// # Example
26359 /// ```ignore,no_run
26360 /// # use google_cloud_container_v1::model::NodePool;
26361 /// let x = NodePool::new().set_initial_node_count(42);
26362 /// ```
26363 pub fn set_initial_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26364 self.initial_node_count = v.into();
26365 self
26366 }
26367
26368 /// Sets the value of [locations][crate::model::NodePool::locations].
26369 ///
26370 /// # Example
26371 /// ```ignore,no_run
26372 /// # use google_cloud_container_v1::model::NodePool;
26373 /// let x = NodePool::new().set_locations(["a", "b", "c"]);
26374 /// ```
26375 pub fn set_locations<T, V>(mut self, v: T) -> Self
26376 where
26377 T: std::iter::IntoIterator<Item = V>,
26378 V: std::convert::Into<std::string::String>,
26379 {
26380 use std::iter::Iterator;
26381 self.locations = v.into_iter().map(|i| i.into()).collect();
26382 self
26383 }
26384
26385 /// Sets the value of [network_config][crate::model::NodePool::network_config].
26386 ///
26387 /// # Example
26388 /// ```ignore,no_run
26389 /// # use google_cloud_container_v1::model::NodePool;
26390 /// use google_cloud_container_v1::model::NodeNetworkConfig;
26391 /// let x = NodePool::new().set_network_config(NodeNetworkConfig::default()/* use setters */);
26392 /// ```
26393 pub fn set_network_config<T>(mut self, v: T) -> Self
26394 where
26395 T: std::convert::Into<crate::model::NodeNetworkConfig>,
26396 {
26397 self.network_config = std::option::Option::Some(v.into());
26398 self
26399 }
26400
26401 /// Sets or clears the value of [network_config][crate::model::NodePool::network_config].
26402 ///
26403 /// # Example
26404 /// ```ignore,no_run
26405 /// # use google_cloud_container_v1::model::NodePool;
26406 /// use google_cloud_container_v1::model::NodeNetworkConfig;
26407 /// let x = NodePool::new().set_or_clear_network_config(Some(NodeNetworkConfig::default()/* use setters */));
26408 /// let x = NodePool::new().set_or_clear_network_config(None::<NodeNetworkConfig>);
26409 /// ```
26410 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
26411 where
26412 T: std::convert::Into<crate::model::NodeNetworkConfig>,
26413 {
26414 self.network_config = v.map(|x| x.into());
26415 self
26416 }
26417
26418 /// Sets the value of [self_link][crate::model::NodePool::self_link].
26419 ///
26420 /// # Example
26421 /// ```ignore,no_run
26422 /// # use google_cloud_container_v1::model::NodePool;
26423 /// let x = NodePool::new().set_self_link("example");
26424 /// ```
26425 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26426 self.self_link = v.into();
26427 self
26428 }
26429
26430 /// Sets the value of [version][crate::model::NodePool::version].
26431 ///
26432 /// # Example
26433 /// ```ignore,no_run
26434 /// # use google_cloud_container_v1::model::NodePool;
26435 /// let x = NodePool::new().set_version("example");
26436 /// ```
26437 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26438 self.version = v.into();
26439 self
26440 }
26441
26442 /// Sets the value of [instance_group_urls][crate::model::NodePool::instance_group_urls].
26443 ///
26444 /// # Example
26445 /// ```ignore,no_run
26446 /// # use google_cloud_container_v1::model::NodePool;
26447 /// let x = NodePool::new().set_instance_group_urls(["a", "b", "c"]);
26448 /// ```
26449 pub fn set_instance_group_urls<T, V>(mut self, v: T) -> Self
26450 where
26451 T: std::iter::IntoIterator<Item = V>,
26452 V: std::convert::Into<std::string::String>,
26453 {
26454 use std::iter::Iterator;
26455 self.instance_group_urls = v.into_iter().map(|i| i.into()).collect();
26456 self
26457 }
26458
26459 /// Sets the value of [status][crate::model::NodePool::status].
26460 ///
26461 /// # Example
26462 /// ```ignore,no_run
26463 /// # use google_cloud_container_v1::model::NodePool;
26464 /// use google_cloud_container_v1::model::node_pool::Status;
26465 /// let x0 = NodePool::new().set_status(Status::Provisioning);
26466 /// let x1 = NodePool::new().set_status(Status::Running);
26467 /// let x2 = NodePool::new().set_status(Status::RunningWithError);
26468 /// ```
26469 pub fn set_status<T: std::convert::Into<crate::model::node_pool::Status>>(
26470 mut self,
26471 v: T,
26472 ) -> Self {
26473 self.status = v.into();
26474 self
26475 }
26476
26477 /// Sets the value of [status_message][crate::model::NodePool::status_message].
26478 ///
26479 /// # Example
26480 /// ```ignore,no_run
26481 /// # use google_cloud_container_v1::model::NodePool;
26482 /// let x = NodePool::new().set_status_message("example");
26483 /// ```
26484 #[deprecated]
26485 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26486 self.status_message = v.into();
26487 self
26488 }
26489
26490 /// Sets the value of [autoscaling][crate::model::NodePool::autoscaling].
26491 ///
26492 /// # Example
26493 /// ```ignore,no_run
26494 /// # use google_cloud_container_v1::model::NodePool;
26495 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
26496 /// let x = NodePool::new().set_autoscaling(NodePoolAutoscaling::default()/* use setters */);
26497 /// ```
26498 pub fn set_autoscaling<T>(mut self, v: T) -> Self
26499 where
26500 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
26501 {
26502 self.autoscaling = std::option::Option::Some(v.into());
26503 self
26504 }
26505
26506 /// Sets or clears the value of [autoscaling][crate::model::NodePool::autoscaling].
26507 ///
26508 /// # Example
26509 /// ```ignore,no_run
26510 /// # use google_cloud_container_v1::model::NodePool;
26511 /// use google_cloud_container_v1::model::NodePoolAutoscaling;
26512 /// let x = NodePool::new().set_or_clear_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
26513 /// let x = NodePool::new().set_or_clear_autoscaling(None::<NodePoolAutoscaling>);
26514 /// ```
26515 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
26516 where
26517 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
26518 {
26519 self.autoscaling = v.map(|x| x.into());
26520 self
26521 }
26522
26523 /// Sets the value of [management][crate::model::NodePool::management].
26524 ///
26525 /// # Example
26526 /// ```ignore,no_run
26527 /// # use google_cloud_container_v1::model::NodePool;
26528 /// use google_cloud_container_v1::model::NodeManagement;
26529 /// let x = NodePool::new().set_management(NodeManagement::default()/* use setters */);
26530 /// ```
26531 pub fn set_management<T>(mut self, v: T) -> Self
26532 where
26533 T: std::convert::Into<crate::model::NodeManagement>,
26534 {
26535 self.management = std::option::Option::Some(v.into());
26536 self
26537 }
26538
26539 /// Sets or clears the value of [management][crate::model::NodePool::management].
26540 ///
26541 /// # Example
26542 /// ```ignore,no_run
26543 /// # use google_cloud_container_v1::model::NodePool;
26544 /// use google_cloud_container_v1::model::NodeManagement;
26545 /// let x = NodePool::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
26546 /// let x = NodePool::new().set_or_clear_management(None::<NodeManagement>);
26547 /// ```
26548 pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
26549 where
26550 T: std::convert::Into<crate::model::NodeManagement>,
26551 {
26552 self.management = v.map(|x| x.into());
26553 self
26554 }
26555
26556 /// Sets the value of [max_pods_constraint][crate::model::NodePool::max_pods_constraint].
26557 ///
26558 /// # Example
26559 /// ```ignore,no_run
26560 /// # use google_cloud_container_v1::model::NodePool;
26561 /// use google_cloud_container_v1::model::MaxPodsConstraint;
26562 /// let x = NodePool::new().set_max_pods_constraint(MaxPodsConstraint::default()/* use setters */);
26563 /// ```
26564 pub fn set_max_pods_constraint<T>(mut self, v: T) -> Self
26565 where
26566 T: std::convert::Into<crate::model::MaxPodsConstraint>,
26567 {
26568 self.max_pods_constraint = std::option::Option::Some(v.into());
26569 self
26570 }
26571
26572 /// Sets or clears the value of [max_pods_constraint][crate::model::NodePool::max_pods_constraint].
26573 ///
26574 /// # Example
26575 /// ```ignore,no_run
26576 /// # use google_cloud_container_v1::model::NodePool;
26577 /// use google_cloud_container_v1::model::MaxPodsConstraint;
26578 /// let x = NodePool::new().set_or_clear_max_pods_constraint(Some(MaxPodsConstraint::default()/* use setters */));
26579 /// let x = NodePool::new().set_or_clear_max_pods_constraint(None::<MaxPodsConstraint>);
26580 /// ```
26581 pub fn set_or_clear_max_pods_constraint<T>(mut self, v: std::option::Option<T>) -> Self
26582 where
26583 T: std::convert::Into<crate::model::MaxPodsConstraint>,
26584 {
26585 self.max_pods_constraint = v.map(|x| x.into());
26586 self
26587 }
26588
26589 /// Sets the value of [conditions][crate::model::NodePool::conditions].
26590 ///
26591 /// # Example
26592 /// ```ignore,no_run
26593 /// # use google_cloud_container_v1::model::NodePool;
26594 /// use google_cloud_container_v1::model::StatusCondition;
26595 /// let x = NodePool::new()
26596 /// .set_conditions([
26597 /// StatusCondition::default()/* use setters */,
26598 /// StatusCondition::default()/* use (different) setters */,
26599 /// ]);
26600 /// ```
26601 pub fn set_conditions<T, V>(mut self, v: T) -> Self
26602 where
26603 T: std::iter::IntoIterator<Item = V>,
26604 V: std::convert::Into<crate::model::StatusCondition>,
26605 {
26606 use std::iter::Iterator;
26607 self.conditions = v.into_iter().map(|i| i.into()).collect();
26608 self
26609 }
26610
26611 /// Sets the value of [pod_ipv4_cidr_size][crate::model::NodePool::pod_ipv4_cidr_size].
26612 ///
26613 /// # Example
26614 /// ```ignore,no_run
26615 /// # use google_cloud_container_v1::model::NodePool;
26616 /// let x = NodePool::new().set_pod_ipv4_cidr_size(42);
26617 /// ```
26618 pub fn set_pod_ipv4_cidr_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26619 self.pod_ipv4_cidr_size = v.into();
26620 self
26621 }
26622
26623 /// Sets the value of [upgrade_settings][crate::model::NodePool::upgrade_settings].
26624 ///
26625 /// # Example
26626 /// ```ignore,no_run
26627 /// # use google_cloud_container_v1::model::NodePool;
26628 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
26629 /// let x = NodePool::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
26630 /// ```
26631 pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
26632 where
26633 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
26634 {
26635 self.upgrade_settings = std::option::Option::Some(v.into());
26636 self
26637 }
26638
26639 /// Sets or clears the value of [upgrade_settings][crate::model::NodePool::upgrade_settings].
26640 ///
26641 /// # Example
26642 /// ```ignore,no_run
26643 /// # use google_cloud_container_v1::model::NodePool;
26644 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
26645 /// let x = NodePool::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
26646 /// let x = NodePool::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
26647 /// ```
26648 pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
26649 where
26650 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
26651 {
26652 self.upgrade_settings = v.map(|x| x.into());
26653 self
26654 }
26655
26656 /// Sets the value of [placement_policy][crate::model::NodePool::placement_policy].
26657 ///
26658 /// # Example
26659 /// ```ignore,no_run
26660 /// # use google_cloud_container_v1::model::NodePool;
26661 /// use google_cloud_container_v1::model::node_pool::PlacementPolicy;
26662 /// let x = NodePool::new().set_placement_policy(PlacementPolicy::default()/* use setters */);
26663 /// ```
26664 pub fn set_placement_policy<T>(mut self, v: T) -> Self
26665 where
26666 T: std::convert::Into<crate::model::node_pool::PlacementPolicy>,
26667 {
26668 self.placement_policy = std::option::Option::Some(v.into());
26669 self
26670 }
26671
26672 /// Sets or clears the value of [placement_policy][crate::model::NodePool::placement_policy].
26673 ///
26674 /// # Example
26675 /// ```ignore,no_run
26676 /// # use google_cloud_container_v1::model::NodePool;
26677 /// use google_cloud_container_v1::model::node_pool::PlacementPolicy;
26678 /// let x = NodePool::new().set_or_clear_placement_policy(Some(PlacementPolicy::default()/* use setters */));
26679 /// let x = NodePool::new().set_or_clear_placement_policy(None::<PlacementPolicy>);
26680 /// ```
26681 pub fn set_or_clear_placement_policy<T>(mut self, v: std::option::Option<T>) -> Self
26682 where
26683 T: std::convert::Into<crate::model::node_pool::PlacementPolicy>,
26684 {
26685 self.placement_policy = v.map(|x| x.into());
26686 self
26687 }
26688
26689 /// Sets the value of [update_info][crate::model::NodePool::update_info].
26690 ///
26691 /// # Example
26692 /// ```ignore,no_run
26693 /// # use google_cloud_container_v1::model::NodePool;
26694 /// use google_cloud_container_v1::model::node_pool::UpdateInfo;
26695 /// let x = NodePool::new().set_update_info(UpdateInfo::default()/* use setters */);
26696 /// ```
26697 pub fn set_update_info<T>(mut self, v: T) -> Self
26698 where
26699 T: std::convert::Into<crate::model::node_pool::UpdateInfo>,
26700 {
26701 self.update_info = std::option::Option::Some(v.into());
26702 self
26703 }
26704
26705 /// Sets or clears the value of [update_info][crate::model::NodePool::update_info].
26706 ///
26707 /// # Example
26708 /// ```ignore,no_run
26709 /// # use google_cloud_container_v1::model::NodePool;
26710 /// use google_cloud_container_v1::model::node_pool::UpdateInfo;
26711 /// let x = NodePool::new().set_or_clear_update_info(Some(UpdateInfo::default()/* use setters */));
26712 /// let x = NodePool::new().set_or_clear_update_info(None::<UpdateInfo>);
26713 /// ```
26714 pub fn set_or_clear_update_info<T>(mut self, v: std::option::Option<T>) -> Self
26715 where
26716 T: std::convert::Into<crate::model::node_pool::UpdateInfo>,
26717 {
26718 self.update_info = v.map(|x| x.into());
26719 self
26720 }
26721
26722 /// Sets the value of [etag][crate::model::NodePool::etag].
26723 ///
26724 /// # Example
26725 /// ```ignore,no_run
26726 /// # use google_cloud_container_v1::model::NodePool;
26727 /// let x = NodePool::new().set_etag("example");
26728 /// ```
26729 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26730 self.etag = v.into();
26731 self
26732 }
26733
26734 /// Sets the value of [queued_provisioning][crate::model::NodePool::queued_provisioning].
26735 ///
26736 /// # Example
26737 /// ```ignore,no_run
26738 /// # use google_cloud_container_v1::model::NodePool;
26739 /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
26740 /// let x = NodePool::new().set_queued_provisioning(QueuedProvisioning::default()/* use setters */);
26741 /// ```
26742 pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
26743 where
26744 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
26745 {
26746 self.queued_provisioning = std::option::Option::Some(v.into());
26747 self
26748 }
26749
26750 /// Sets or clears the value of [queued_provisioning][crate::model::NodePool::queued_provisioning].
26751 ///
26752 /// # Example
26753 /// ```ignore,no_run
26754 /// # use google_cloud_container_v1::model::NodePool;
26755 /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
26756 /// let x = NodePool::new().set_or_clear_queued_provisioning(Some(QueuedProvisioning::default()/* use setters */));
26757 /// let x = NodePool::new().set_or_clear_queued_provisioning(None::<QueuedProvisioning>);
26758 /// ```
26759 pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
26760 where
26761 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
26762 {
26763 self.queued_provisioning = v.map(|x| x.into());
26764 self
26765 }
26766
26767 /// Sets the value of [best_effort_provisioning][crate::model::NodePool::best_effort_provisioning].
26768 ///
26769 /// # Example
26770 /// ```ignore,no_run
26771 /// # use google_cloud_container_v1::model::NodePool;
26772 /// use google_cloud_container_v1::model::BestEffortProvisioning;
26773 /// let x = NodePool::new().set_best_effort_provisioning(BestEffortProvisioning::default()/* use setters */);
26774 /// ```
26775 pub fn set_best_effort_provisioning<T>(mut self, v: T) -> Self
26776 where
26777 T: std::convert::Into<crate::model::BestEffortProvisioning>,
26778 {
26779 self.best_effort_provisioning = std::option::Option::Some(v.into());
26780 self
26781 }
26782
26783 /// Sets or clears the value of [best_effort_provisioning][crate::model::NodePool::best_effort_provisioning].
26784 ///
26785 /// # Example
26786 /// ```ignore,no_run
26787 /// # use google_cloud_container_v1::model::NodePool;
26788 /// use google_cloud_container_v1::model::BestEffortProvisioning;
26789 /// let x = NodePool::new().set_or_clear_best_effort_provisioning(Some(BestEffortProvisioning::default()/* use setters */));
26790 /// let x = NodePool::new().set_or_clear_best_effort_provisioning(None::<BestEffortProvisioning>);
26791 /// ```
26792 pub fn set_or_clear_best_effort_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
26793 where
26794 T: std::convert::Into<crate::model::BestEffortProvisioning>,
26795 {
26796 self.best_effort_provisioning = v.map(|x| x.into());
26797 self
26798 }
26799
26800 /// Sets the value of [node_drain_config][crate::model::NodePool::node_drain_config].
26801 ///
26802 /// # Example
26803 /// ```ignore,no_run
26804 /// # use google_cloud_container_v1::model::NodePool;
26805 /// use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
26806 /// let x = NodePool::new().set_node_drain_config(NodeDrainConfig::default()/* use setters */);
26807 /// ```
26808 pub fn set_node_drain_config<T>(mut self, v: T) -> Self
26809 where
26810 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
26811 {
26812 self.node_drain_config = std::option::Option::Some(v.into());
26813 self
26814 }
26815
26816 /// Sets or clears the value of [node_drain_config][crate::model::NodePool::node_drain_config].
26817 ///
26818 /// # Example
26819 /// ```ignore,no_run
26820 /// # use google_cloud_container_v1::model::NodePool;
26821 /// use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
26822 /// let x = NodePool::new().set_or_clear_node_drain_config(Some(NodeDrainConfig::default()/* use setters */));
26823 /// let x = NodePool::new().set_or_clear_node_drain_config(None::<NodeDrainConfig>);
26824 /// ```
26825 pub fn set_or_clear_node_drain_config<T>(mut self, v: std::option::Option<T>) -> Self
26826 where
26827 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
26828 {
26829 self.node_drain_config = v.map(|x| x.into());
26830 self
26831 }
26832
26833 /// Sets the value of [maintenance_policy][crate::model::NodePool::maintenance_policy].
26834 ///
26835 /// # Example
26836 /// ```ignore,no_run
26837 /// # use google_cloud_container_v1::model::NodePool;
26838 /// use google_cloud_container_v1::model::node_pool::NodePoolMaintenancePolicy;
26839 /// let x = NodePool::new().set_maintenance_policy(NodePoolMaintenancePolicy::default()/* use setters */);
26840 /// ```
26841 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
26842 where
26843 T: std::convert::Into<crate::model::node_pool::NodePoolMaintenancePolicy>,
26844 {
26845 self.maintenance_policy = std::option::Option::Some(v.into());
26846 self
26847 }
26848
26849 /// Sets or clears the value of [maintenance_policy][crate::model::NodePool::maintenance_policy].
26850 ///
26851 /// # Example
26852 /// ```ignore,no_run
26853 /// # use google_cloud_container_v1::model::NodePool;
26854 /// use google_cloud_container_v1::model::node_pool::NodePoolMaintenancePolicy;
26855 /// let x = NodePool::new().set_or_clear_maintenance_policy(Some(NodePoolMaintenancePolicy::default()/* use setters */));
26856 /// let x = NodePool::new().set_or_clear_maintenance_policy(None::<NodePoolMaintenancePolicy>);
26857 /// ```
26858 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
26859 where
26860 T: std::convert::Into<crate::model::node_pool::NodePoolMaintenancePolicy>,
26861 {
26862 self.maintenance_policy = v.map(|x| x.into());
26863 self
26864 }
26865}
26866
26867impl wkt::message::Message for NodePool {
26868 fn typename() -> &'static str {
26869 "type.googleapis.com/google.container.v1.NodePool"
26870 }
26871}
26872
26873/// Defines additional types related to [NodePool].
26874pub mod node_pool {
26875 #[allow(unused_imports)]
26876 use super::*;
26877
26878 /// These upgrade settings control the level of parallelism and the level of
26879 /// disruption caused by an upgrade.
26880 ///
26881 /// maxUnavailable controls the number of nodes that can be simultaneously
26882 /// unavailable.
26883 ///
26884 /// maxSurge controls the number of additional nodes that can be added to the
26885 /// node pool temporarily for the time of the upgrade to increase the number of
26886 /// available nodes.
26887 ///
26888 /// (maxUnavailable + maxSurge) determines the level of parallelism (how many
26889 /// nodes are being upgraded at the same time).
26890 ///
26891 /// Note: upgrades inevitably introduce some disruption since workloads need to
26892 /// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0,
26893 /// this holds true. (Disruption stays within the limits of
26894 /// PodDisruptionBudget, if it is configured.)
26895 ///
26896 /// Consider a hypothetical node pool with 5 nodes having maxSurge=2,
26897 /// maxUnavailable=1. This means the upgrade process upgrades 3 nodes
26898 /// simultaneously. It creates 2 additional (upgraded) nodes, then it brings
26899 /// down 3 old (not yet upgraded) nodes at the same time. This ensures that
26900 /// there are always at least 4 nodes available.
26901 ///
26902 /// These upgrade settings configure the upgrade strategy for the node pool.
26903 /// Use strategy to switch between the strategies applied to the node pool.
26904 ///
26905 /// If the strategy is ROLLING, use max_surge and max_unavailable to control
26906 /// the level of parallelism and the level of disruption caused by upgrade.
26907 ///
26908 /// 1. maxSurge controls the number of additional nodes that can be added to
26909 /// the node pool temporarily for the time of the upgrade to increase the
26910 /// number of available nodes.
26911 /// 1. maxUnavailable controls the number of nodes that can be simultaneously
26912 /// unavailable.
26913 /// 1. (maxUnavailable + maxSurge) determines the level of parallelism (how
26914 /// many nodes are being upgraded at the same time).
26915 ///
26916 /// If the strategy is BLUE_GREEN, use blue_green_settings to configure the
26917 /// blue-green upgrade related settings.
26918 ///
26919 /// 1. standard_rollout_policy is the default policy. The policy is used to
26920 /// control the way blue pool gets drained. The draining is executed in the
26921 /// batch mode. The batch size could be specified as either percentage of the
26922 /// node pool size or the number of nodes. batch_soak_duration is the soak
26923 /// time after each batch gets drained.
26924 /// 1. node_pool_soak_duration is the soak time after all blue nodes are
26925 /// drained. After this period, the blue pool nodes will be deleted.
26926 #[derive(Clone, Default, PartialEq)]
26927 #[non_exhaustive]
26928 pub struct UpgradeSettings {
26929 /// The maximum number of nodes that can be created beyond the current size
26930 /// of the node pool during the upgrade process.
26931 pub max_surge: i32,
26932
26933 /// The maximum number of nodes that can be simultaneously unavailable during
26934 /// the upgrade process. A node is considered available if its status is
26935 /// Ready.
26936 pub max_unavailable: i32,
26937
26938 /// Update strategy of the node pool.
26939 pub strategy: std::option::Option<crate::model::NodePoolUpdateStrategy>,
26940
26941 /// Settings for blue-green upgrade strategy.
26942 pub blue_green_settings: std::option::Option<crate::model::BlueGreenSettings>,
26943
26944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26945 }
26946
26947 impl UpgradeSettings {
26948 /// Creates a new default instance.
26949 pub fn new() -> Self {
26950 std::default::Default::default()
26951 }
26952
26953 /// Sets the value of [max_surge][crate::model::node_pool::UpgradeSettings::max_surge].
26954 ///
26955 /// # Example
26956 /// ```ignore,no_run
26957 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
26958 /// let x = UpgradeSettings::new().set_max_surge(42);
26959 /// ```
26960 pub fn set_max_surge<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26961 self.max_surge = v.into();
26962 self
26963 }
26964
26965 /// Sets the value of [max_unavailable][crate::model::node_pool::UpgradeSettings::max_unavailable].
26966 ///
26967 /// # Example
26968 /// ```ignore,no_run
26969 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
26970 /// let x = UpgradeSettings::new().set_max_unavailable(42);
26971 /// ```
26972 pub fn set_max_unavailable<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26973 self.max_unavailable = v.into();
26974 self
26975 }
26976
26977 /// Sets the value of [strategy][crate::model::node_pool::UpgradeSettings::strategy].
26978 ///
26979 /// # Example
26980 /// ```ignore,no_run
26981 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
26982 /// use google_cloud_container_v1::model::NodePoolUpdateStrategy;
26983 /// let x0 = UpgradeSettings::new().set_strategy(NodePoolUpdateStrategy::BlueGreen);
26984 /// let x1 = UpgradeSettings::new().set_strategy(NodePoolUpdateStrategy::Surge);
26985 /// let x2 = UpgradeSettings::new().set_strategy(NodePoolUpdateStrategy::ShortLived);
26986 /// ```
26987 pub fn set_strategy<T>(mut self, v: T) -> Self
26988 where
26989 T: std::convert::Into<crate::model::NodePoolUpdateStrategy>,
26990 {
26991 self.strategy = std::option::Option::Some(v.into());
26992 self
26993 }
26994
26995 /// Sets or clears the value of [strategy][crate::model::node_pool::UpgradeSettings::strategy].
26996 ///
26997 /// # Example
26998 /// ```ignore,no_run
26999 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
27000 /// use google_cloud_container_v1::model::NodePoolUpdateStrategy;
27001 /// let x0 = UpgradeSettings::new().set_or_clear_strategy(Some(NodePoolUpdateStrategy::BlueGreen));
27002 /// let x1 = UpgradeSettings::new().set_or_clear_strategy(Some(NodePoolUpdateStrategy::Surge));
27003 /// let x2 = UpgradeSettings::new().set_or_clear_strategy(Some(NodePoolUpdateStrategy::ShortLived));
27004 /// let x_none = UpgradeSettings::new().set_or_clear_strategy(None::<NodePoolUpdateStrategy>);
27005 /// ```
27006 pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
27007 where
27008 T: std::convert::Into<crate::model::NodePoolUpdateStrategy>,
27009 {
27010 self.strategy = v.map(|x| x.into());
27011 self
27012 }
27013
27014 /// Sets the value of [blue_green_settings][crate::model::node_pool::UpgradeSettings::blue_green_settings].
27015 ///
27016 /// # Example
27017 /// ```ignore,no_run
27018 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
27019 /// use google_cloud_container_v1::model::BlueGreenSettings;
27020 /// let x = UpgradeSettings::new().set_blue_green_settings(BlueGreenSettings::default()/* use setters */);
27021 /// ```
27022 pub fn set_blue_green_settings<T>(mut self, v: T) -> Self
27023 where
27024 T: std::convert::Into<crate::model::BlueGreenSettings>,
27025 {
27026 self.blue_green_settings = std::option::Option::Some(v.into());
27027 self
27028 }
27029
27030 /// Sets or clears the value of [blue_green_settings][crate::model::node_pool::UpgradeSettings::blue_green_settings].
27031 ///
27032 /// # Example
27033 /// ```ignore,no_run
27034 /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
27035 /// use google_cloud_container_v1::model::BlueGreenSettings;
27036 /// let x = UpgradeSettings::new().set_or_clear_blue_green_settings(Some(BlueGreenSettings::default()/* use setters */));
27037 /// let x = UpgradeSettings::new().set_or_clear_blue_green_settings(None::<BlueGreenSettings>);
27038 /// ```
27039 pub fn set_or_clear_blue_green_settings<T>(mut self, v: std::option::Option<T>) -> Self
27040 where
27041 T: std::convert::Into<crate::model::BlueGreenSettings>,
27042 {
27043 self.blue_green_settings = v.map(|x| x.into());
27044 self
27045 }
27046 }
27047
27048 impl wkt::message::Message for UpgradeSettings {
27049 fn typename() -> &'static str {
27050 "type.googleapis.com/google.container.v1.NodePool.UpgradeSettings"
27051 }
27052 }
27053
27054 /// UpdateInfo contains resource (instance groups, etc), status and other
27055 /// intermediate information relevant to a node pool upgrade.
27056 #[derive(Clone, Default, PartialEq)]
27057 #[non_exhaustive]
27058 pub struct UpdateInfo {
27059 /// Information of a blue-green upgrade.
27060 pub blue_green_info:
27061 std::option::Option<crate::model::node_pool::update_info::BlueGreenInfo>,
27062
27063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27064 }
27065
27066 impl UpdateInfo {
27067 /// Creates a new default instance.
27068 pub fn new() -> Self {
27069 std::default::Default::default()
27070 }
27071
27072 /// Sets the value of [blue_green_info][crate::model::node_pool::UpdateInfo::blue_green_info].
27073 ///
27074 /// # Example
27075 /// ```ignore,no_run
27076 /// # use google_cloud_container_v1::model::node_pool::UpdateInfo;
27077 /// use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27078 /// let x = UpdateInfo::new().set_blue_green_info(BlueGreenInfo::default()/* use setters */);
27079 /// ```
27080 pub fn set_blue_green_info<T>(mut self, v: T) -> Self
27081 where
27082 T: std::convert::Into<crate::model::node_pool::update_info::BlueGreenInfo>,
27083 {
27084 self.blue_green_info = std::option::Option::Some(v.into());
27085 self
27086 }
27087
27088 /// Sets or clears the value of [blue_green_info][crate::model::node_pool::UpdateInfo::blue_green_info].
27089 ///
27090 /// # Example
27091 /// ```ignore,no_run
27092 /// # use google_cloud_container_v1::model::node_pool::UpdateInfo;
27093 /// use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27094 /// let x = UpdateInfo::new().set_or_clear_blue_green_info(Some(BlueGreenInfo::default()/* use setters */));
27095 /// let x = UpdateInfo::new().set_or_clear_blue_green_info(None::<BlueGreenInfo>);
27096 /// ```
27097 pub fn set_or_clear_blue_green_info<T>(mut self, v: std::option::Option<T>) -> Self
27098 where
27099 T: std::convert::Into<crate::model::node_pool::update_info::BlueGreenInfo>,
27100 {
27101 self.blue_green_info = v.map(|x| x.into());
27102 self
27103 }
27104 }
27105
27106 impl wkt::message::Message for UpdateInfo {
27107 fn typename() -> &'static str {
27108 "type.googleapis.com/google.container.v1.NodePool.UpdateInfo"
27109 }
27110 }
27111
27112 /// Defines additional types related to [UpdateInfo].
27113 pub mod update_info {
27114 #[allow(unused_imports)]
27115 use super::*;
27116
27117 /// Information relevant to blue-green upgrade.
27118 #[derive(Clone, Default, PartialEq)]
27119 #[non_exhaustive]
27120 pub struct BlueGreenInfo {
27121 /// Current blue-green upgrade phase.
27122 pub phase: crate::model::node_pool::update_info::blue_green_info::Phase,
27123
27124 /// The resource URLs of the [managed instance groups]
27125 /// (/compute/docs/instance-groups/creating-groups-of-managed-instances)
27126 /// associated with blue pool.
27127 pub blue_instance_group_urls: std::vec::Vec<std::string::String>,
27128
27129 /// The resource URLs of the [managed instance groups]
27130 /// (/compute/docs/instance-groups/creating-groups-of-managed-instances)
27131 /// associated with green pool.
27132 pub green_instance_group_urls: std::vec::Vec<std::string::String>,
27133
27134 /// Time to start deleting blue pool to complete blue-green upgrade,
27135 /// in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
27136 pub blue_pool_deletion_start_time: std::string::String,
27137
27138 /// Version of green pool.
27139 pub green_pool_version: std::string::String,
27140
27141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27142 }
27143
27144 impl BlueGreenInfo {
27145 /// Creates a new default instance.
27146 pub fn new() -> Self {
27147 std::default::Default::default()
27148 }
27149
27150 /// Sets the value of [phase][crate::model::node_pool::update_info::BlueGreenInfo::phase].
27151 ///
27152 /// # Example
27153 /// ```ignore,no_run
27154 /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27155 /// use google_cloud_container_v1::model::node_pool::update_info::blue_green_info::Phase;
27156 /// let x0 = BlueGreenInfo::new().set_phase(Phase::UpdateStarted);
27157 /// let x1 = BlueGreenInfo::new().set_phase(Phase::CreatingGreenPool);
27158 /// let x2 = BlueGreenInfo::new().set_phase(Phase::CordoningBluePool);
27159 /// ```
27160 pub fn set_phase<
27161 T: std::convert::Into<crate::model::node_pool::update_info::blue_green_info::Phase>,
27162 >(
27163 mut self,
27164 v: T,
27165 ) -> Self {
27166 self.phase = v.into();
27167 self
27168 }
27169
27170 /// Sets the value of [blue_instance_group_urls][crate::model::node_pool::update_info::BlueGreenInfo::blue_instance_group_urls].
27171 ///
27172 /// # Example
27173 /// ```ignore,no_run
27174 /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27175 /// let x = BlueGreenInfo::new().set_blue_instance_group_urls(["a", "b", "c"]);
27176 /// ```
27177 pub fn set_blue_instance_group_urls<T, V>(mut self, v: T) -> Self
27178 where
27179 T: std::iter::IntoIterator<Item = V>,
27180 V: std::convert::Into<std::string::String>,
27181 {
27182 use std::iter::Iterator;
27183 self.blue_instance_group_urls = v.into_iter().map(|i| i.into()).collect();
27184 self
27185 }
27186
27187 /// Sets the value of [green_instance_group_urls][crate::model::node_pool::update_info::BlueGreenInfo::green_instance_group_urls].
27188 ///
27189 /// # Example
27190 /// ```ignore,no_run
27191 /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27192 /// let x = BlueGreenInfo::new().set_green_instance_group_urls(["a", "b", "c"]);
27193 /// ```
27194 pub fn set_green_instance_group_urls<T, V>(mut self, v: T) -> Self
27195 where
27196 T: std::iter::IntoIterator<Item = V>,
27197 V: std::convert::Into<std::string::String>,
27198 {
27199 use std::iter::Iterator;
27200 self.green_instance_group_urls = v.into_iter().map(|i| i.into()).collect();
27201 self
27202 }
27203
27204 /// Sets the value of [blue_pool_deletion_start_time][crate::model::node_pool::update_info::BlueGreenInfo::blue_pool_deletion_start_time].
27205 ///
27206 /// # Example
27207 /// ```ignore,no_run
27208 /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27209 /// let x = BlueGreenInfo::new().set_blue_pool_deletion_start_time("example");
27210 /// ```
27211 pub fn set_blue_pool_deletion_start_time<T: std::convert::Into<std::string::String>>(
27212 mut self,
27213 v: T,
27214 ) -> Self {
27215 self.blue_pool_deletion_start_time = v.into();
27216 self
27217 }
27218
27219 /// Sets the value of [green_pool_version][crate::model::node_pool::update_info::BlueGreenInfo::green_pool_version].
27220 ///
27221 /// # Example
27222 /// ```ignore,no_run
27223 /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
27224 /// let x = BlueGreenInfo::new().set_green_pool_version("example");
27225 /// ```
27226 pub fn set_green_pool_version<T: std::convert::Into<std::string::String>>(
27227 mut self,
27228 v: T,
27229 ) -> Self {
27230 self.green_pool_version = v.into();
27231 self
27232 }
27233 }
27234
27235 impl wkt::message::Message for BlueGreenInfo {
27236 fn typename() -> &'static str {
27237 "type.googleapis.com/google.container.v1.NodePool.UpdateInfo.BlueGreenInfo"
27238 }
27239 }
27240
27241 /// Defines additional types related to [BlueGreenInfo].
27242 pub mod blue_green_info {
27243 #[allow(unused_imports)]
27244 use super::*;
27245
27246 /// Phase represents the different stages blue-green upgrade is running in.
27247 ///
27248 /// # Working with unknown values
27249 ///
27250 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27251 /// additional enum variants at any time. Adding new variants is not considered
27252 /// a breaking change. Applications should write their code in anticipation of:
27253 ///
27254 /// - New values appearing in future releases of the client library, **and**
27255 /// - New values received dynamically, without application changes.
27256 ///
27257 /// Please consult the [Working with enums] section in the user guide for some
27258 /// guidelines.
27259 ///
27260 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27261 #[derive(Clone, Debug, PartialEq)]
27262 #[non_exhaustive]
27263 pub enum Phase {
27264 /// Unspecified phase.
27265 Unspecified,
27266 /// blue-green upgrade has been initiated.
27267 UpdateStarted,
27268 /// Start creating green pool nodes.
27269 CreatingGreenPool,
27270 /// Start cordoning blue pool nodes.
27271 CordoningBluePool,
27272 /// Start draining blue pool nodes.
27273 DrainingBluePool,
27274 /// Start soaking time after draining entire blue pool.
27275 NodePoolSoaking,
27276 /// Start deleting blue nodes.
27277 DeletingBluePool,
27278 /// Rollback has been initiated.
27279 RollbackStarted,
27280 /// If set, the enum was initialized with an unknown value.
27281 ///
27282 /// Applications can examine the value using [Phase::value] or
27283 /// [Phase::name].
27284 UnknownValue(phase::UnknownValue),
27285 }
27286
27287 #[doc(hidden)]
27288 pub mod phase {
27289 #[allow(unused_imports)]
27290 use super::*;
27291 #[derive(Clone, Debug, PartialEq)]
27292 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27293 }
27294
27295 impl Phase {
27296 /// Gets the enum value.
27297 ///
27298 /// Returns `None` if the enum contains an unknown value deserialized from
27299 /// the string representation of enums.
27300 pub fn value(&self) -> std::option::Option<i32> {
27301 match self {
27302 Self::Unspecified => std::option::Option::Some(0),
27303 Self::UpdateStarted => std::option::Option::Some(1),
27304 Self::CreatingGreenPool => std::option::Option::Some(2),
27305 Self::CordoningBluePool => std::option::Option::Some(3),
27306 Self::DrainingBluePool => std::option::Option::Some(4),
27307 Self::NodePoolSoaking => std::option::Option::Some(5),
27308 Self::DeletingBluePool => std::option::Option::Some(6),
27309 Self::RollbackStarted => std::option::Option::Some(7),
27310 Self::UnknownValue(u) => u.0.value(),
27311 }
27312 }
27313
27314 /// Gets the enum value as a string.
27315 ///
27316 /// Returns `None` if the enum contains an unknown value deserialized from
27317 /// the integer representation of enums.
27318 pub fn name(&self) -> std::option::Option<&str> {
27319 match self {
27320 Self::Unspecified => std::option::Option::Some("PHASE_UNSPECIFIED"),
27321 Self::UpdateStarted => std::option::Option::Some("UPDATE_STARTED"),
27322 Self::CreatingGreenPool => std::option::Option::Some("CREATING_GREEN_POOL"),
27323 Self::CordoningBluePool => std::option::Option::Some("CORDONING_BLUE_POOL"),
27324 Self::DrainingBluePool => std::option::Option::Some("DRAINING_BLUE_POOL"),
27325 Self::NodePoolSoaking => std::option::Option::Some("NODE_POOL_SOAKING"),
27326 Self::DeletingBluePool => std::option::Option::Some("DELETING_BLUE_POOL"),
27327 Self::RollbackStarted => std::option::Option::Some("ROLLBACK_STARTED"),
27328 Self::UnknownValue(u) => u.0.name(),
27329 }
27330 }
27331 }
27332
27333 impl std::default::Default for Phase {
27334 fn default() -> Self {
27335 use std::convert::From;
27336 Self::from(0)
27337 }
27338 }
27339
27340 impl std::fmt::Display for Phase {
27341 fn fmt(
27342 &self,
27343 f: &mut std::fmt::Formatter<'_>,
27344 ) -> std::result::Result<(), std::fmt::Error> {
27345 wkt::internal::display_enum(f, self.name(), self.value())
27346 }
27347 }
27348
27349 impl std::convert::From<i32> for Phase {
27350 fn from(value: i32) -> Self {
27351 match value {
27352 0 => Self::Unspecified,
27353 1 => Self::UpdateStarted,
27354 2 => Self::CreatingGreenPool,
27355 3 => Self::CordoningBluePool,
27356 4 => Self::DrainingBluePool,
27357 5 => Self::NodePoolSoaking,
27358 6 => Self::DeletingBluePool,
27359 7 => Self::RollbackStarted,
27360 _ => Self::UnknownValue(phase::UnknownValue(
27361 wkt::internal::UnknownEnumValue::Integer(value),
27362 )),
27363 }
27364 }
27365 }
27366
27367 impl std::convert::From<&str> for Phase {
27368 fn from(value: &str) -> Self {
27369 use std::string::ToString;
27370 match value {
27371 "PHASE_UNSPECIFIED" => Self::Unspecified,
27372 "UPDATE_STARTED" => Self::UpdateStarted,
27373 "CREATING_GREEN_POOL" => Self::CreatingGreenPool,
27374 "CORDONING_BLUE_POOL" => Self::CordoningBluePool,
27375 "DRAINING_BLUE_POOL" => Self::DrainingBluePool,
27376 "NODE_POOL_SOAKING" => Self::NodePoolSoaking,
27377 "DELETING_BLUE_POOL" => Self::DeletingBluePool,
27378 "ROLLBACK_STARTED" => Self::RollbackStarted,
27379 _ => Self::UnknownValue(phase::UnknownValue(
27380 wkt::internal::UnknownEnumValue::String(value.to_string()),
27381 )),
27382 }
27383 }
27384 }
27385
27386 impl serde::ser::Serialize for Phase {
27387 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27388 where
27389 S: serde::Serializer,
27390 {
27391 match self {
27392 Self::Unspecified => serializer.serialize_i32(0),
27393 Self::UpdateStarted => serializer.serialize_i32(1),
27394 Self::CreatingGreenPool => serializer.serialize_i32(2),
27395 Self::CordoningBluePool => serializer.serialize_i32(3),
27396 Self::DrainingBluePool => serializer.serialize_i32(4),
27397 Self::NodePoolSoaking => serializer.serialize_i32(5),
27398 Self::DeletingBluePool => serializer.serialize_i32(6),
27399 Self::RollbackStarted => serializer.serialize_i32(7),
27400 Self::UnknownValue(u) => u.0.serialize(serializer),
27401 }
27402 }
27403 }
27404
27405 impl<'de> serde::de::Deserialize<'de> for Phase {
27406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27407 where
27408 D: serde::Deserializer<'de>,
27409 {
27410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Phase>::new(
27411 ".google.container.v1.NodePool.UpdateInfo.BlueGreenInfo.Phase",
27412 ))
27413 }
27414 }
27415 }
27416 }
27417
27418 /// PlacementPolicy defines the placement policy used by the node pool.
27419 #[derive(Clone, Default, PartialEq)]
27420 #[non_exhaustive]
27421 pub struct PlacementPolicy {
27422 /// The type of placement.
27423 pub r#type: crate::model::node_pool::placement_policy::Type,
27424
27425 /// Optional. TPU placement topology for pod slice node pool.
27426 /// <https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies>
27427 pub tpu_topology: std::string::String,
27428
27429 /// If set, refers to the name of a custom resource policy supplied by the
27430 /// user. The resource policy must be in the same project and region as the
27431 /// node pool. If not found, InvalidArgument error is returned.
27432 pub policy_name: std::string::String,
27433
27434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27435 }
27436
27437 impl PlacementPolicy {
27438 /// Creates a new default instance.
27439 pub fn new() -> Self {
27440 std::default::Default::default()
27441 }
27442
27443 /// Sets the value of [r#type][crate::model::node_pool::PlacementPolicy::type].
27444 ///
27445 /// # Example
27446 /// ```ignore,no_run
27447 /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
27448 /// use google_cloud_container_v1::model::node_pool::placement_policy::Type;
27449 /// let x0 = PlacementPolicy::new().set_type(Type::Compact);
27450 /// ```
27451 pub fn set_type<T: std::convert::Into<crate::model::node_pool::placement_policy::Type>>(
27452 mut self,
27453 v: T,
27454 ) -> Self {
27455 self.r#type = v.into();
27456 self
27457 }
27458
27459 /// Sets the value of [tpu_topology][crate::model::node_pool::PlacementPolicy::tpu_topology].
27460 ///
27461 /// # Example
27462 /// ```ignore,no_run
27463 /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
27464 /// let x = PlacementPolicy::new().set_tpu_topology("example");
27465 /// ```
27466 pub fn set_tpu_topology<T: std::convert::Into<std::string::String>>(
27467 mut self,
27468 v: T,
27469 ) -> Self {
27470 self.tpu_topology = v.into();
27471 self
27472 }
27473
27474 /// Sets the value of [policy_name][crate::model::node_pool::PlacementPolicy::policy_name].
27475 ///
27476 /// # Example
27477 /// ```ignore,no_run
27478 /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
27479 /// let x = PlacementPolicy::new().set_policy_name("example");
27480 /// ```
27481 pub fn set_policy_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27482 self.policy_name = v.into();
27483 self
27484 }
27485 }
27486
27487 impl wkt::message::Message for PlacementPolicy {
27488 fn typename() -> &'static str {
27489 "type.googleapis.com/google.container.v1.NodePool.PlacementPolicy"
27490 }
27491 }
27492
27493 /// Defines additional types related to [PlacementPolicy].
27494 pub mod placement_policy {
27495 #[allow(unused_imports)]
27496 use super::*;
27497
27498 /// Type defines the type of placement policy.
27499 ///
27500 /// # Working with unknown values
27501 ///
27502 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27503 /// additional enum variants at any time. Adding new variants is not considered
27504 /// a breaking change. Applications should write their code in anticipation of:
27505 ///
27506 /// - New values appearing in future releases of the client library, **and**
27507 /// - New values received dynamically, without application changes.
27508 ///
27509 /// Please consult the [Working with enums] section in the user guide for some
27510 /// guidelines.
27511 ///
27512 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27513 #[derive(Clone, Debug, PartialEq)]
27514 #[non_exhaustive]
27515 pub enum Type {
27516 /// TYPE_UNSPECIFIED specifies no requirements on nodes
27517 /// placement.
27518 Unspecified,
27519 /// COMPACT specifies node placement in the same availability domain to
27520 /// ensure low communication latency.
27521 Compact,
27522 /// If set, the enum was initialized with an unknown value.
27523 ///
27524 /// Applications can examine the value using [Type::value] or
27525 /// [Type::name].
27526 UnknownValue(r#type::UnknownValue),
27527 }
27528
27529 #[doc(hidden)]
27530 pub mod r#type {
27531 #[allow(unused_imports)]
27532 use super::*;
27533 #[derive(Clone, Debug, PartialEq)]
27534 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27535 }
27536
27537 impl Type {
27538 /// Gets the enum value.
27539 ///
27540 /// Returns `None` if the enum contains an unknown value deserialized from
27541 /// the string representation of enums.
27542 pub fn value(&self) -> std::option::Option<i32> {
27543 match self {
27544 Self::Unspecified => std::option::Option::Some(0),
27545 Self::Compact => std::option::Option::Some(1),
27546 Self::UnknownValue(u) => u.0.value(),
27547 }
27548 }
27549
27550 /// Gets the enum value as a string.
27551 ///
27552 /// Returns `None` if the enum contains an unknown value deserialized from
27553 /// the integer representation of enums.
27554 pub fn name(&self) -> std::option::Option<&str> {
27555 match self {
27556 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
27557 Self::Compact => std::option::Option::Some("COMPACT"),
27558 Self::UnknownValue(u) => u.0.name(),
27559 }
27560 }
27561 }
27562
27563 impl std::default::Default for Type {
27564 fn default() -> Self {
27565 use std::convert::From;
27566 Self::from(0)
27567 }
27568 }
27569
27570 impl std::fmt::Display for Type {
27571 fn fmt(
27572 &self,
27573 f: &mut std::fmt::Formatter<'_>,
27574 ) -> std::result::Result<(), std::fmt::Error> {
27575 wkt::internal::display_enum(f, self.name(), self.value())
27576 }
27577 }
27578
27579 impl std::convert::From<i32> for Type {
27580 fn from(value: i32) -> Self {
27581 match value {
27582 0 => Self::Unspecified,
27583 1 => Self::Compact,
27584 _ => Self::UnknownValue(r#type::UnknownValue(
27585 wkt::internal::UnknownEnumValue::Integer(value),
27586 )),
27587 }
27588 }
27589 }
27590
27591 impl std::convert::From<&str> for Type {
27592 fn from(value: &str) -> Self {
27593 use std::string::ToString;
27594 match value {
27595 "TYPE_UNSPECIFIED" => Self::Unspecified,
27596 "COMPACT" => Self::Compact,
27597 _ => Self::UnknownValue(r#type::UnknownValue(
27598 wkt::internal::UnknownEnumValue::String(value.to_string()),
27599 )),
27600 }
27601 }
27602 }
27603
27604 impl serde::ser::Serialize for Type {
27605 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27606 where
27607 S: serde::Serializer,
27608 {
27609 match self {
27610 Self::Unspecified => serializer.serialize_i32(0),
27611 Self::Compact => serializer.serialize_i32(1),
27612 Self::UnknownValue(u) => u.0.serialize(serializer),
27613 }
27614 }
27615 }
27616
27617 impl<'de> serde::de::Deserialize<'de> for Type {
27618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27619 where
27620 D: serde::Deserializer<'de>,
27621 {
27622 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
27623 ".google.container.v1.NodePool.PlacementPolicy.Type",
27624 ))
27625 }
27626 }
27627 }
27628
27629 /// QueuedProvisioning defines the queued provisioning used by the node pool.
27630 #[derive(Clone, Default, PartialEq)]
27631 #[non_exhaustive]
27632 pub struct QueuedProvisioning {
27633 /// Denotes that this node pool is QRM specific, meaning nodes can be only
27634 /// obtained through queuing via the Cluster Autoscaler ProvisioningRequest
27635 /// API.
27636 pub enabled: bool,
27637
27638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27639 }
27640
27641 impl QueuedProvisioning {
27642 /// Creates a new default instance.
27643 pub fn new() -> Self {
27644 std::default::Default::default()
27645 }
27646
27647 /// Sets the value of [enabled][crate::model::node_pool::QueuedProvisioning::enabled].
27648 ///
27649 /// # Example
27650 /// ```ignore,no_run
27651 /// # use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
27652 /// let x = QueuedProvisioning::new().set_enabled(true);
27653 /// ```
27654 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
27655 self.enabled = v.into();
27656 self
27657 }
27658 }
27659
27660 impl wkt::message::Message for QueuedProvisioning {
27661 fn typename() -> &'static str {
27662 "type.googleapis.com/google.container.v1.NodePool.QueuedProvisioning"
27663 }
27664 }
27665
27666 /// NodeDrainConfig contains the node drain related configurations for this
27667 /// node pool.
27668 #[derive(Clone, Default, PartialEq)]
27669 #[non_exhaustive]
27670 pub struct NodeDrainConfig {
27671 /// The duration of the PDB timeout period for node drain.
27672 pub pdb_timeout_duration: std::option::Option<wkt::Duration>,
27673
27674 /// The duration of the grace termination period for node drain.
27675 pub grace_termination_duration: std::option::Option<wkt::Duration>,
27676
27677 /// Whether to respect PDB during node pool deletion.
27678 pub respect_pdb_during_node_pool_deletion: std::option::Option<bool>,
27679
27680 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27681 }
27682
27683 impl NodeDrainConfig {
27684 /// Creates a new default instance.
27685 pub fn new() -> Self {
27686 std::default::Default::default()
27687 }
27688
27689 /// Sets the value of [pdb_timeout_duration][crate::model::node_pool::NodeDrainConfig::pdb_timeout_duration].
27690 ///
27691 /// # Example
27692 /// ```ignore,no_run
27693 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27694 /// use wkt::Duration;
27695 /// let x = NodeDrainConfig::new().set_pdb_timeout_duration(Duration::default()/* use setters */);
27696 /// ```
27697 pub fn set_pdb_timeout_duration<T>(mut self, v: T) -> Self
27698 where
27699 T: std::convert::Into<wkt::Duration>,
27700 {
27701 self.pdb_timeout_duration = std::option::Option::Some(v.into());
27702 self
27703 }
27704
27705 /// Sets or clears the value of [pdb_timeout_duration][crate::model::node_pool::NodeDrainConfig::pdb_timeout_duration].
27706 ///
27707 /// # Example
27708 /// ```ignore,no_run
27709 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27710 /// use wkt::Duration;
27711 /// let x = NodeDrainConfig::new().set_or_clear_pdb_timeout_duration(Some(Duration::default()/* use setters */));
27712 /// let x = NodeDrainConfig::new().set_or_clear_pdb_timeout_duration(None::<Duration>);
27713 /// ```
27714 pub fn set_or_clear_pdb_timeout_duration<T>(mut self, v: std::option::Option<T>) -> Self
27715 where
27716 T: std::convert::Into<wkt::Duration>,
27717 {
27718 self.pdb_timeout_duration = v.map(|x| x.into());
27719 self
27720 }
27721
27722 /// Sets the value of [grace_termination_duration][crate::model::node_pool::NodeDrainConfig::grace_termination_duration].
27723 ///
27724 /// # Example
27725 /// ```ignore,no_run
27726 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27727 /// use wkt::Duration;
27728 /// let x = NodeDrainConfig::new().set_grace_termination_duration(Duration::default()/* use setters */);
27729 /// ```
27730 pub fn set_grace_termination_duration<T>(mut self, v: T) -> Self
27731 where
27732 T: std::convert::Into<wkt::Duration>,
27733 {
27734 self.grace_termination_duration = std::option::Option::Some(v.into());
27735 self
27736 }
27737
27738 /// Sets or clears the value of [grace_termination_duration][crate::model::node_pool::NodeDrainConfig::grace_termination_duration].
27739 ///
27740 /// # Example
27741 /// ```ignore,no_run
27742 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27743 /// use wkt::Duration;
27744 /// let x = NodeDrainConfig::new().set_or_clear_grace_termination_duration(Some(Duration::default()/* use setters */));
27745 /// let x = NodeDrainConfig::new().set_or_clear_grace_termination_duration(None::<Duration>);
27746 /// ```
27747 pub fn set_or_clear_grace_termination_duration<T>(
27748 mut self,
27749 v: std::option::Option<T>,
27750 ) -> Self
27751 where
27752 T: std::convert::Into<wkt::Duration>,
27753 {
27754 self.grace_termination_duration = v.map(|x| x.into());
27755 self
27756 }
27757
27758 /// Sets the value of [respect_pdb_during_node_pool_deletion][crate::model::node_pool::NodeDrainConfig::respect_pdb_during_node_pool_deletion].
27759 ///
27760 /// # Example
27761 /// ```ignore,no_run
27762 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27763 /// let x = NodeDrainConfig::new().set_respect_pdb_during_node_pool_deletion(true);
27764 /// ```
27765 pub fn set_respect_pdb_during_node_pool_deletion<T>(mut self, v: T) -> Self
27766 where
27767 T: std::convert::Into<bool>,
27768 {
27769 self.respect_pdb_during_node_pool_deletion = std::option::Option::Some(v.into());
27770 self
27771 }
27772
27773 /// Sets or clears the value of [respect_pdb_during_node_pool_deletion][crate::model::node_pool::NodeDrainConfig::respect_pdb_during_node_pool_deletion].
27774 ///
27775 /// # Example
27776 /// ```ignore,no_run
27777 /// # use google_cloud_container_v1::model::node_pool::NodeDrainConfig;
27778 /// let x = NodeDrainConfig::new().set_or_clear_respect_pdb_during_node_pool_deletion(Some(false));
27779 /// let x = NodeDrainConfig::new().set_or_clear_respect_pdb_during_node_pool_deletion(None::<bool>);
27780 /// ```
27781 pub fn set_or_clear_respect_pdb_during_node_pool_deletion<T>(
27782 mut self,
27783 v: std::option::Option<T>,
27784 ) -> Self
27785 where
27786 T: std::convert::Into<bool>,
27787 {
27788 self.respect_pdb_during_node_pool_deletion = v.map(|x| x.into());
27789 self
27790 }
27791 }
27792
27793 impl wkt::message::Message for NodeDrainConfig {
27794 fn typename() -> &'static str {
27795 "type.googleapis.com/google.container.v1.NodePool.NodeDrainConfig"
27796 }
27797 }
27798
27799 /// Defines the maintenance exclusion for the node pool.
27800 #[derive(Clone, Default, PartialEq)]
27801 #[non_exhaustive]
27802 pub struct ExclusionUntilEndOfSupport {
27803 /// Optional. Indicates whether the exclusion is enabled.
27804 pub enabled: bool,
27805
27806 /// Output only. The start time of the maintenance exclusion. It is output
27807 /// only. It is the exclusion creation time.
27808 pub start_time: std::option::Option<wkt::Timestamp>,
27809
27810 /// Output only. The end time of the maintenance exclusion. It is output
27811 /// only. It is the cluster control plane version's end of support time, or
27812 /// end of extended support time when the cluster is on extended support
27813 /// channel.
27814 pub end_time: std::option::Option<wkt::Timestamp>,
27815
27816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27817 }
27818
27819 impl ExclusionUntilEndOfSupport {
27820 /// Creates a new default instance.
27821 pub fn new() -> Self {
27822 std::default::Default::default()
27823 }
27824
27825 /// Sets the value of [enabled][crate::model::node_pool::ExclusionUntilEndOfSupport::enabled].
27826 ///
27827 /// # Example
27828 /// ```ignore,no_run
27829 /// # use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27830 /// let x = ExclusionUntilEndOfSupport::new().set_enabled(true);
27831 /// ```
27832 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
27833 self.enabled = v.into();
27834 self
27835 }
27836
27837 /// Sets the value of [start_time][crate::model::node_pool::ExclusionUntilEndOfSupport::start_time].
27838 ///
27839 /// # Example
27840 /// ```ignore,no_run
27841 /// # use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27842 /// use wkt::Timestamp;
27843 /// let x = ExclusionUntilEndOfSupport::new().set_start_time(Timestamp::default()/* use setters */);
27844 /// ```
27845 pub fn set_start_time<T>(mut self, v: T) -> Self
27846 where
27847 T: std::convert::Into<wkt::Timestamp>,
27848 {
27849 self.start_time = std::option::Option::Some(v.into());
27850 self
27851 }
27852
27853 /// Sets or clears the value of [start_time][crate::model::node_pool::ExclusionUntilEndOfSupport::start_time].
27854 ///
27855 /// # Example
27856 /// ```ignore,no_run
27857 /// # use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27858 /// use wkt::Timestamp;
27859 /// let x = ExclusionUntilEndOfSupport::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
27860 /// let x = ExclusionUntilEndOfSupport::new().set_or_clear_start_time(None::<Timestamp>);
27861 /// ```
27862 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
27863 where
27864 T: std::convert::Into<wkt::Timestamp>,
27865 {
27866 self.start_time = v.map(|x| x.into());
27867 self
27868 }
27869
27870 /// Sets the value of [end_time][crate::model::node_pool::ExclusionUntilEndOfSupport::end_time].
27871 ///
27872 /// # Example
27873 /// ```ignore,no_run
27874 /// # use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27875 /// use wkt::Timestamp;
27876 /// let x = ExclusionUntilEndOfSupport::new().set_end_time(Timestamp::default()/* use setters */);
27877 /// ```
27878 pub fn set_end_time<T>(mut self, v: T) -> Self
27879 where
27880 T: std::convert::Into<wkt::Timestamp>,
27881 {
27882 self.end_time = std::option::Option::Some(v.into());
27883 self
27884 }
27885
27886 /// Sets or clears the value of [end_time][crate::model::node_pool::ExclusionUntilEndOfSupport::end_time].
27887 ///
27888 /// # Example
27889 /// ```ignore,no_run
27890 /// # use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27891 /// use wkt::Timestamp;
27892 /// let x = ExclusionUntilEndOfSupport::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
27893 /// let x = ExclusionUntilEndOfSupport::new().set_or_clear_end_time(None::<Timestamp>);
27894 /// ```
27895 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
27896 where
27897 T: std::convert::Into<wkt::Timestamp>,
27898 {
27899 self.end_time = v.map(|x| x.into());
27900 self
27901 }
27902 }
27903
27904 impl wkt::message::Message for ExclusionUntilEndOfSupport {
27905 fn typename() -> &'static str {
27906 "type.googleapis.com/google.container.v1.NodePool.ExclusionUntilEndOfSupport"
27907 }
27908 }
27909
27910 /// Defines the maintenance policy for the node pool.
27911 #[derive(Clone, Default, PartialEq)]
27912 #[non_exhaustive]
27913 pub struct NodePoolMaintenancePolicy {
27914 /// Optional. The exclusion until end of support for the node pool.
27915 pub exclusion_until_end_of_support:
27916 std::option::Option<crate::model::node_pool::ExclusionUntilEndOfSupport>,
27917
27918 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27919 }
27920
27921 impl NodePoolMaintenancePolicy {
27922 /// Creates a new default instance.
27923 pub fn new() -> Self {
27924 std::default::Default::default()
27925 }
27926
27927 /// Sets the value of [exclusion_until_end_of_support][crate::model::node_pool::NodePoolMaintenancePolicy::exclusion_until_end_of_support].
27928 ///
27929 /// # Example
27930 /// ```ignore,no_run
27931 /// # use google_cloud_container_v1::model::node_pool::NodePoolMaintenancePolicy;
27932 /// use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27933 /// let x = NodePoolMaintenancePolicy::new().set_exclusion_until_end_of_support(ExclusionUntilEndOfSupport::default()/* use setters */);
27934 /// ```
27935 pub fn set_exclusion_until_end_of_support<T>(mut self, v: T) -> Self
27936 where
27937 T: std::convert::Into<crate::model::node_pool::ExclusionUntilEndOfSupport>,
27938 {
27939 self.exclusion_until_end_of_support = std::option::Option::Some(v.into());
27940 self
27941 }
27942
27943 /// Sets or clears the value of [exclusion_until_end_of_support][crate::model::node_pool::NodePoolMaintenancePolicy::exclusion_until_end_of_support].
27944 ///
27945 /// # Example
27946 /// ```ignore,no_run
27947 /// # use google_cloud_container_v1::model::node_pool::NodePoolMaintenancePolicy;
27948 /// use google_cloud_container_v1::model::node_pool::ExclusionUntilEndOfSupport;
27949 /// let x = NodePoolMaintenancePolicy::new().set_or_clear_exclusion_until_end_of_support(Some(ExclusionUntilEndOfSupport::default()/* use setters */));
27950 /// let x = NodePoolMaintenancePolicy::new().set_or_clear_exclusion_until_end_of_support(None::<ExclusionUntilEndOfSupport>);
27951 /// ```
27952 pub fn set_or_clear_exclusion_until_end_of_support<T>(
27953 mut self,
27954 v: std::option::Option<T>,
27955 ) -> Self
27956 where
27957 T: std::convert::Into<crate::model::node_pool::ExclusionUntilEndOfSupport>,
27958 {
27959 self.exclusion_until_end_of_support = v.map(|x| x.into());
27960 self
27961 }
27962 }
27963
27964 impl wkt::message::Message for NodePoolMaintenancePolicy {
27965 fn typename() -> &'static str {
27966 "type.googleapis.com/google.container.v1.NodePool.NodePoolMaintenancePolicy"
27967 }
27968 }
27969
27970 /// The current status of the node pool instance.
27971 ///
27972 /// # Working with unknown values
27973 ///
27974 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27975 /// additional enum variants at any time. Adding new variants is not considered
27976 /// a breaking change. Applications should write their code in anticipation of:
27977 ///
27978 /// - New values appearing in future releases of the client library, **and**
27979 /// - New values received dynamically, without application changes.
27980 ///
27981 /// Please consult the [Working with enums] section in the user guide for some
27982 /// guidelines.
27983 ///
27984 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27985 #[derive(Clone, Debug, PartialEq)]
27986 #[non_exhaustive]
27987 pub enum Status {
27988 /// Not set.
27989 Unspecified,
27990 /// The PROVISIONING state indicates the node pool is being created.
27991 Provisioning,
27992 /// The RUNNING state indicates the node pool has been created
27993 /// and is fully usable.
27994 Running,
27995 /// The RUNNING_WITH_ERROR state indicates the node pool has been created
27996 /// and is partially usable. Some error state has occurred and some
27997 /// functionality may be impaired. Customer may need to reissue a request
27998 /// or trigger a new update.
27999 RunningWithError,
28000 /// The RECONCILING state indicates that some work is actively being done on
28001 /// the node pool, such as upgrading node software. Details can
28002 /// be found in the `statusMessage` field.
28003 Reconciling,
28004 /// The STOPPING state indicates the node pool is being deleted.
28005 Stopping,
28006 /// The ERROR state indicates the node pool may be unusable. Details
28007 /// can be found in the `statusMessage` field.
28008 Error,
28009 /// If set, the enum was initialized with an unknown value.
28010 ///
28011 /// Applications can examine the value using [Status::value] or
28012 /// [Status::name].
28013 UnknownValue(status::UnknownValue),
28014 }
28015
28016 #[doc(hidden)]
28017 pub mod status {
28018 #[allow(unused_imports)]
28019 use super::*;
28020 #[derive(Clone, Debug, PartialEq)]
28021 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28022 }
28023
28024 impl Status {
28025 /// Gets the enum value.
28026 ///
28027 /// Returns `None` if the enum contains an unknown value deserialized from
28028 /// the string representation of enums.
28029 pub fn value(&self) -> std::option::Option<i32> {
28030 match self {
28031 Self::Unspecified => std::option::Option::Some(0),
28032 Self::Provisioning => std::option::Option::Some(1),
28033 Self::Running => std::option::Option::Some(2),
28034 Self::RunningWithError => std::option::Option::Some(3),
28035 Self::Reconciling => std::option::Option::Some(4),
28036 Self::Stopping => std::option::Option::Some(5),
28037 Self::Error => std::option::Option::Some(6),
28038 Self::UnknownValue(u) => u.0.value(),
28039 }
28040 }
28041
28042 /// Gets the enum value as a string.
28043 ///
28044 /// Returns `None` if the enum contains an unknown value deserialized from
28045 /// the integer representation of enums.
28046 pub fn name(&self) -> std::option::Option<&str> {
28047 match self {
28048 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
28049 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
28050 Self::Running => std::option::Option::Some("RUNNING"),
28051 Self::RunningWithError => std::option::Option::Some("RUNNING_WITH_ERROR"),
28052 Self::Reconciling => std::option::Option::Some("RECONCILING"),
28053 Self::Stopping => std::option::Option::Some("STOPPING"),
28054 Self::Error => std::option::Option::Some("ERROR"),
28055 Self::UnknownValue(u) => u.0.name(),
28056 }
28057 }
28058 }
28059
28060 impl std::default::Default for Status {
28061 fn default() -> Self {
28062 use std::convert::From;
28063 Self::from(0)
28064 }
28065 }
28066
28067 impl std::fmt::Display for Status {
28068 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28069 wkt::internal::display_enum(f, self.name(), self.value())
28070 }
28071 }
28072
28073 impl std::convert::From<i32> for Status {
28074 fn from(value: i32) -> Self {
28075 match value {
28076 0 => Self::Unspecified,
28077 1 => Self::Provisioning,
28078 2 => Self::Running,
28079 3 => Self::RunningWithError,
28080 4 => Self::Reconciling,
28081 5 => Self::Stopping,
28082 6 => Self::Error,
28083 _ => Self::UnknownValue(status::UnknownValue(
28084 wkt::internal::UnknownEnumValue::Integer(value),
28085 )),
28086 }
28087 }
28088 }
28089
28090 impl std::convert::From<&str> for Status {
28091 fn from(value: &str) -> Self {
28092 use std::string::ToString;
28093 match value {
28094 "STATUS_UNSPECIFIED" => Self::Unspecified,
28095 "PROVISIONING" => Self::Provisioning,
28096 "RUNNING" => Self::Running,
28097 "RUNNING_WITH_ERROR" => Self::RunningWithError,
28098 "RECONCILING" => Self::Reconciling,
28099 "STOPPING" => Self::Stopping,
28100 "ERROR" => Self::Error,
28101 _ => Self::UnknownValue(status::UnknownValue(
28102 wkt::internal::UnknownEnumValue::String(value.to_string()),
28103 )),
28104 }
28105 }
28106 }
28107
28108 impl serde::ser::Serialize for Status {
28109 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28110 where
28111 S: serde::Serializer,
28112 {
28113 match self {
28114 Self::Unspecified => serializer.serialize_i32(0),
28115 Self::Provisioning => serializer.serialize_i32(1),
28116 Self::Running => serializer.serialize_i32(2),
28117 Self::RunningWithError => serializer.serialize_i32(3),
28118 Self::Reconciling => serializer.serialize_i32(4),
28119 Self::Stopping => serializer.serialize_i32(5),
28120 Self::Error => serializer.serialize_i32(6),
28121 Self::UnknownValue(u) => u.0.serialize(serializer),
28122 }
28123 }
28124 }
28125
28126 impl<'de> serde::de::Deserialize<'de> for Status {
28127 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28128 where
28129 D: serde::Deserializer<'de>,
28130 {
28131 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
28132 ".google.container.v1.NodePool.Status",
28133 ))
28134 }
28135 }
28136}
28137
28138/// NodeManagement defines the set of node management services turned on for the
28139/// node pool.
28140#[derive(Clone, Default, PartialEq)]
28141#[non_exhaustive]
28142pub struct NodeManagement {
28143 /// A flag that specifies whether node auto-upgrade is enabled for the node
28144 /// pool. If enabled, node auto-upgrade helps keep the nodes in your node pool
28145 /// up to date with the latest release version of Kubernetes.
28146 pub auto_upgrade: bool,
28147
28148 /// A flag that specifies whether the node auto-repair is enabled for the node
28149 /// pool. If enabled, the nodes in this node pool will be monitored and, if
28150 /// they fail health checks too many times, an automatic repair action will be
28151 /// triggered.
28152 pub auto_repair: bool,
28153
28154 /// Specifies the Auto Upgrade knobs for the node pool.
28155 pub upgrade_options: std::option::Option<crate::model::AutoUpgradeOptions>,
28156
28157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28158}
28159
28160impl NodeManagement {
28161 /// Creates a new default instance.
28162 pub fn new() -> Self {
28163 std::default::Default::default()
28164 }
28165
28166 /// Sets the value of [auto_upgrade][crate::model::NodeManagement::auto_upgrade].
28167 ///
28168 /// # Example
28169 /// ```ignore,no_run
28170 /// # use google_cloud_container_v1::model::NodeManagement;
28171 /// let x = NodeManagement::new().set_auto_upgrade(true);
28172 /// ```
28173 pub fn set_auto_upgrade<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28174 self.auto_upgrade = v.into();
28175 self
28176 }
28177
28178 /// Sets the value of [auto_repair][crate::model::NodeManagement::auto_repair].
28179 ///
28180 /// # Example
28181 /// ```ignore,no_run
28182 /// # use google_cloud_container_v1::model::NodeManagement;
28183 /// let x = NodeManagement::new().set_auto_repair(true);
28184 /// ```
28185 pub fn set_auto_repair<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28186 self.auto_repair = v.into();
28187 self
28188 }
28189
28190 /// Sets the value of [upgrade_options][crate::model::NodeManagement::upgrade_options].
28191 ///
28192 /// # Example
28193 /// ```ignore,no_run
28194 /// # use google_cloud_container_v1::model::NodeManagement;
28195 /// use google_cloud_container_v1::model::AutoUpgradeOptions;
28196 /// let x = NodeManagement::new().set_upgrade_options(AutoUpgradeOptions::default()/* use setters */);
28197 /// ```
28198 pub fn set_upgrade_options<T>(mut self, v: T) -> Self
28199 where
28200 T: std::convert::Into<crate::model::AutoUpgradeOptions>,
28201 {
28202 self.upgrade_options = std::option::Option::Some(v.into());
28203 self
28204 }
28205
28206 /// Sets or clears the value of [upgrade_options][crate::model::NodeManagement::upgrade_options].
28207 ///
28208 /// # Example
28209 /// ```ignore,no_run
28210 /// # use google_cloud_container_v1::model::NodeManagement;
28211 /// use google_cloud_container_v1::model::AutoUpgradeOptions;
28212 /// let x = NodeManagement::new().set_or_clear_upgrade_options(Some(AutoUpgradeOptions::default()/* use setters */));
28213 /// let x = NodeManagement::new().set_or_clear_upgrade_options(None::<AutoUpgradeOptions>);
28214 /// ```
28215 pub fn set_or_clear_upgrade_options<T>(mut self, v: std::option::Option<T>) -> Self
28216 where
28217 T: std::convert::Into<crate::model::AutoUpgradeOptions>,
28218 {
28219 self.upgrade_options = v.map(|x| x.into());
28220 self
28221 }
28222}
28223
28224impl wkt::message::Message for NodeManagement {
28225 fn typename() -> &'static str {
28226 "type.googleapis.com/google.container.v1.NodeManagement"
28227 }
28228}
28229
28230/// Best effort provisioning.
28231#[derive(Clone, Default, PartialEq)]
28232#[non_exhaustive]
28233pub struct BestEffortProvisioning {
28234 /// When this is enabled, cluster/node pool creations will ignore non-fatal
28235 /// errors like stockout to best provision as many nodes as possible right now
28236 /// and eventually bring up all target number of nodes
28237 pub enabled: bool,
28238
28239 /// Minimum number of nodes to be provisioned to be considered as succeeded,
28240 /// and the rest of nodes will be provisioned gradually and eventually when
28241 /// stockout issue has been resolved.
28242 pub min_provision_nodes: i32,
28243
28244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28245}
28246
28247impl BestEffortProvisioning {
28248 /// Creates a new default instance.
28249 pub fn new() -> Self {
28250 std::default::Default::default()
28251 }
28252
28253 /// Sets the value of [enabled][crate::model::BestEffortProvisioning::enabled].
28254 ///
28255 /// # Example
28256 /// ```ignore,no_run
28257 /// # use google_cloud_container_v1::model::BestEffortProvisioning;
28258 /// let x = BestEffortProvisioning::new().set_enabled(true);
28259 /// ```
28260 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28261 self.enabled = v.into();
28262 self
28263 }
28264
28265 /// Sets the value of [min_provision_nodes][crate::model::BestEffortProvisioning::min_provision_nodes].
28266 ///
28267 /// # Example
28268 /// ```ignore,no_run
28269 /// # use google_cloud_container_v1::model::BestEffortProvisioning;
28270 /// let x = BestEffortProvisioning::new().set_min_provision_nodes(42);
28271 /// ```
28272 pub fn set_min_provision_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28273 self.min_provision_nodes = v.into();
28274 self
28275 }
28276}
28277
28278impl wkt::message::Message for BestEffortProvisioning {
28279 fn typename() -> &'static str {
28280 "type.googleapis.com/google.container.v1.BestEffortProvisioning"
28281 }
28282}
28283
28284/// AutoUpgradeOptions defines the set of options for the user to control how
28285/// the Auto Upgrades will proceed.
28286#[derive(Clone, Default, PartialEq)]
28287#[non_exhaustive]
28288pub struct AutoUpgradeOptions {
28289 /// Output only. This field is set when upgrades are about to commence
28290 /// with the approximate start time for the upgrades, in
28291 /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
28292 pub auto_upgrade_start_time: std::string::String,
28293
28294 /// Output only. This field is set when upgrades are about to commence
28295 /// with the description of the upgrade.
28296 pub description: std::string::String,
28297
28298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28299}
28300
28301impl AutoUpgradeOptions {
28302 /// Creates a new default instance.
28303 pub fn new() -> Self {
28304 std::default::Default::default()
28305 }
28306
28307 /// Sets the value of [auto_upgrade_start_time][crate::model::AutoUpgradeOptions::auto_upgrade_start_time].
28308 ///
28309 /// # Example
28310 /// ```ignore,no_run
28311 /// # use google_cloud_container_v1::model::AutoUpgradeOptions;
28312 /// let x = AutoUpgradeOptions::new().set_auto_upgrade_start_time("example");
28313 /// ```
28314 pub fn set_auto_upgrade_start_time<T: std::convert::Into<std::string::String>>(
28315 mut self,
28316 v: T,
28317 ) -> Self {
28318 self.auto_upgrade_start_time = v.into();
28319 self
28320 }
28321
28322 /// Sets the value of [description][crate::model::AutoUpgradeOptions::description].
28323 ///
28324 /// # Example
28325 /// ```ignore,no_run
28326 /// # use google_cloud_container_v1::model::AutoUpgradeOptions;
28327 /// let x = AutoUpgradeOptions::new().set_description("example");
28328 /// ```
28329 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28330 self.description = v.into();
28331 self
28332 }
28333}
28334
28335impl wkt::message::Message for AutoUpgradeOptions {
28336 fn typename() -> &'static str {
28337 "type.googleapis.com/google.container.v1.AutoUpgradeOptions"
28338 }
28339}
28340
28341/// MaintenancePolicy defines the maintenance policy to be used for the cluster.
28342#[derive(Clone, Default, PartialEq)]
28343#[non_exhaustive]
28344pub struct MaintenancePolicy {
28345 /// Specifies the maintenance window in which maintenance may be performed.
28346 pub window: std::option::Option<crate::model::MaintenanceWindow>,
28347
28348 /// A hash identifying the version of this policy, so that updates to fields of
28349 /// the policy won't accidentally undo intermediate changes (and so that users
28350 /// of the API unaware of some fields won't accidentally remove other fields).
28351 /// Make a `get()` request to the cluster to get the current
28352 /// resource version and include it with requests to set the policy.
28353 pub resource_version: std::string::String,
28354
28355 /// Optional. The upgrade disruption budget for the cluster control plane.
28356 pub disruption_budget: std::option::Option<crate::model::DisruptionBudget>,
28357
28358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28359}
28360
28361impl MaintenancePolicy {
28362 /// Creates a new default instance.
28363 pub fn new() -> Self {
28364 std::default::Default::default()
28365 }
28366
28367 /// Sets the value of [window][crate::model::MaintenancePolicy::window].
28368 ///
28369 /// # Example
28370 /// ```ignore,no_run
28371 /// # use google_cloud_container_v1::model::MaintenancePolicy;
28372 /// use google_cloud_container_v1::model::MaintenanceWindow;
28373 /// let x = MaintenancePolicy::new().set_window(MaintenanceWindow::default()/* use setters */);
28374 /// ```
28375 pub fn set_window<T>(mut self, v: T) -> Self
28376 where
28377 T: std::convert::Into<crate::model::MaintenanceWindow>,
28378 {
28379 self.window = std::option::Option::Some(v.into());
28380 self
28381 }
28382
28383 /// Sets or clears the value of [window][crate::model::MaintenancePolicy::window].
28384 ///
28385 /// # Example
28386 /// ```ignore,no_run
28387 /// # use google_cloud_container_v1::model::MaintenancePolicy;
28388 /// use google_cloud_container_v1::model::MaintenanceWindow;
28389 /// let x = MaintenancePolicy::new().set_or_clear_window(Some(MaintenanceWindow::default()/* use setters */));
28390 /// let x = MaintenancePolicy::new().set_or_clear_window(None::<MaintenanceWindow>);
28391 /// ```
28392 pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
28393 where
28394 T: std::convert::Into<crate::model::MaintenanceWindow>,
28395 {
28396 self.window = v.map(|x| x.into());
28397 self
28398 }
28399
28400 /// Sets the value of [resource_version][crate::model::MaintenancePolicy::resource_version].
28401 ///
28402 /// # Example
28403 /// ```ignore,no_run
28404 /// # use google_cloud_container_v1::model::MaintenancePolicy;
28405 /// let x = MaintenancePolicy::new().set_resource_version("example");
28406 /// ```
28407 pub fn set_resource_version<T: std::convert::Into<std::string::String>>(
28408 mut self,
28409 v: T,
28410 ) -> Self {
28411 self.resource_version = v.into();
28412 self
28413 }
28414
28415 /// Sets the value of [disruption_budget][crate::model::MaintenancePolicy::disruption_budget].
28416 ///
28417 /// # Example
28418 /// ```ignore,no_run
28419 /// # use google_cloud_container_v1::model::MaintenancePolicy;
28420 /// use google_cloud_container_v1::model::DisruptionBudget;
28421 /// let x = MaintenancePolicy::new().set_disruption_budget(DisruptionBudget::default()/* use setters */);
28422 /// ```
28423 pub fn set_disruption_budget<T>(mut self, v: T) -> Self
28424 where
28425 T: std::convert::Into<crate::model::DisruptionBudget>,
28426 {
28427 self.disruption_budget = std::option::Option::Some(v.into());
28428 self
28429 }
28430
28431 /// Sets or clears the value of [disruption_budget][crate::model::MaintenancePolicy::disruption_budget].
28432 ///
28433 /// # Example
28434 /// ```ignore,no_run
28435 /// # use google_cloud_container_v1::model::MaintenancePolicy;
28436 /// use google_cloud_container_v1::model::DisruptionBudget;
28437 /// let x = MaintenancePolicy::new().set_or_clear_disruption_budget(Some(DisruptionBudget::default()/* use setters */));
28438 /// let x = MaintenancePolicy::new().set_or_clear_disruption_budget(None::<DisruptionBudget>);
28439 /// ```
28440 pub fn set_or_clear_disruption_budget<T>(mut self, v: std::option::Option<T>) -> Self
28441 where
28442 T: std::convert::Into<crate::model::DisruptionBudget>,
28443 {
28444 self.disruption_budget = v.map(|x| x.into());
28445 self
28446 }
28447}
28448
28449impl wkt::message::Message for MaintenancePolicy {
28450 fn typename() -> &'static str {
28451 "type.googleapis.com/google.container.v1.MaintenancePolicy"
28452 }
28453}
28454
28455/// DisruptionBudget defines the upgrade disruption budget for the cluster
28456/// control plane.
28457#[derive(Clone, Default, PartialEq)]
28458#[non_exhaustive]
28459pub struct DisruptionBudget {
28460 /// Optional. The minimum duration between two minor version upgrades of the
28461 /// control plane.
28462 pub minor_version_disruption_interval: std::option::Option<wkt::Duration>,
28463
28464 /// Optional. The minimum duration between two patch version upgrades of the
28465 /// control plane.
28466 pub patch_version_disruption_interval: std::option::Option<wkt::Duration>,
28467
28468 /// Output only. The last time a minor version upgrade was performed on the
28469 /// control plane.
28470 pub last_minor_version_disruption_time: std::option::Option<wkt::Timestamp>,
28471
28472 /// Output only. The last time a disruption was performed on the control plane.
28473 pub last_disruption_time: std::option::Option<wkt::Timestamp>,
28474
28475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28476}
28477
28478impl DisruptionBudget {
28479 /// Creates a new default instance.
28480 pub fn new() -> Self {
28481 std::default::Default::default()
28482 }
28483
28484 /// Sets the value of [minor_version_disruption_interval][crate::model::DisruptionBudget::minor_version_disruption_interval].
28485 ///
28486 /// # Example
28487 /// ```ignore,no_run
28488 /// # use google_cloud_container_v1::model::DisruptionBudget;
28489 /// use wkt::Duration;
28490 /// let x = DisruptionBudget::new().set_minor_version_disruption_interval(Duration::default()/* use setters */);
28491 /// ```
28492 pub fn set_minor_version_disruption_interval<T>(mut self, v: T) -> Self
28493 where
28494 T: std::convert::Into<wkt::Duration>,
28495 {
28496 self.minor_version_disruption_interval = std::option::Option::Some(v.into());
28497 self
28498 }
28499
28500 /// Sets or clears the value of [minor_version_disruption_interval][crate::model::DisruptionBudget::minor_version_disruption_interval].
28501 ///
28502 /// # Example
28503 /// ```ignore,no_run
28504 /// # use google_cloud_container_v1::model::DisruptionBudget;
28505 /// use wkt::Duration;
28506 /// let x = DisruptionBudget::new().set_or_clear_minor_version_disruption_interval(Some(Duration::default()/* use setters */));
28507 /// let x = DisruptionBudget::new().set_or_clear_minor_version_disruption_interval(None::<Duration>);
28508 /// ```
28509 pub fn set_or_clear_minor_version_disruption_interval<T>(
28510 mut self,
28511 v: std::option::Option<T>,
28512 ) -> Self
28513 where
28514 T: std::convert::Into<wkt::Duration>,
28515 {
28516 self.minor_version_disruption_interval = v.map(|x| x.into());
28517 self
28518 }
28519
28520 /// Sets the value of [patch_version_disruption_interval][crate::model::DisruptionBudget::patch_version_disruption_interval].
28521 ///
28522 /// # Example
28523 /// ```ignore,no_run
28524 /// # use google_cloud_container_v1::model::DisruptionBudget;
28525 /// use wkt::Duration;
28526 /// let x = DisruptionBudget::new().set_patch_version_disruption_interval(Duration::default()/* use setters */);
28527 /// ```
28528 pub fn set_patch_version_disruption_interval<T>(mut self, v: T) -> Self
28529 where
28530 T: std::convert::Into<wkt::Duration>,
28531 {
28532 self.patch_version_disruption_interval = std::option::Option::Some(v.into());
28533 self
28534 }
28535
28536 /// Sets or clears the value of [patch_version_disruption_interval][crate::model::DisruptionBudget::patch_version_disruption_interval].
28537 ///
28538 /// # Example
28539 /// ```ignore,no_run
28540 /// # use google_cloud_container_v1::model::DisruptionBudget;
28541 /// use wkt::Duration;
28542 /// let x = DisruptionBudget::new().set_or_clear_patch_version_disruption_interval(Some(Duration::default()/* use setters */));
28543 /// let x = DisruptionBudget::new().set_or_clear_patch_version_disruption_interval(None::<Duration>);
28544 /// ```
28545 pub fn set_or_clear_patch_version_disruption_interval<T>(
28546 mut self,
28547 v: std::option::Option<T>,
28548 ) -> Self
28549 where
28550 T: std::convert::Into<wkt::Duration>,
28551 {
28552 self.patch_version_disruption_interval = v.map(|x| x.into());
28553 self
28554 }
28555
28556 /// Sets the value of [last_minor_version_disruption_time][crate::model::DisruptionBudget::last_minor_version_disruption_time].
28557 ///
28558 /// # Example
28559 /// ```ignore,no_run
28560 /// # use google_cloud_container_v1::model::DisruptionBudget;
28561 /// use wkt::Timestamp;
28562 /// let x = DisruptionBudget::new().set_last_minor_version_disruption_time(Timestamp::default()/* use setters */);
28563 /// ```
28564 pub fn set_last_minor_version_disruption_time<T>(mut self, v: T) -> Self
28565 where
28566 T: std::convert::Into<wkt::Timestamp>,
28567 {
28568 self.last_minor_version_disruption_time = std::option::Option::Some(v.into());
28569 self
28570 }
28571
28572 /// Sets or clears the value of [last_minor_version_disruption_time][crate::model::DisruptionBudget::last_minor_version_disruption_time].
28573 ///
28574 /// # Example
28575 /// ```ignore,no_run
28576 /// # use google_cloud_container_v1::model::DisruptionBudget;
28577 /// use wkt::Timestamp;
28578 /// let x = DisruptionBudget::new().set_or_clear_last_minor_version_disruption_time(Some(Timestamp::default()/* use setters */));
28579 /// let x = DisruptionBudget::new().set_or_clear_last_minor_version_disruption_time(None::<Timestamp>);
28580 /// ```
28581 pub fn set_or_clear_last_minor_version_disruption_time<T>(
28582 mut self,
28583 v: std::option::Option<T>,
28584 ) -> Self
28585 where
28586 T: std::convert::Into<wkt::Timestamp>,
28587 {
28588 self.last_minor_version_disruption_time = v.map(|x| x.into());
28589 self
28590 }
28591
28592 /// Sets the value of [last_disruption_time][crate::model::DisruptionBudget::last_disruption_time].
28593 ///
28594 /// # Example
28595 /// ```ignore,no_run
28596 /// # use google_cloud_container_v1::model::DisruptionBudget;
28597 /// use wkt::Timestamp;
28598 /// let x = DisruptionBudget::new().set_last_disruption_time(Timestamp::default()/* use setters */);
28599 /// ```
28600 pub fn set_last_disruption_time<T>(mut self, v: T) -> Self
28601 where
28602 T: std::convert::Into<wkt::Timestamp>,
28603 {
28604 self.last_disruption_time = std::option::Option::Some(v.into());
28605 self
28606 }
28607
28608 /// Sets or clears the value of [last_disruption_time][crate::model::DisruptionBudget::last_disruption_time].
28609 ///
28610 /// # Example
28611 /// ```ignore,no_run
28612 /// # use google_cloud_container_v1::model::DisruptionBudget;
28613 /// use wkt::Timestamp;
28614 /// let x = DisruptionBudget::new().set_or_clear_last_disruption_time(Some(Timestamp::default()/* use setters */));
28615 /// let x = DisruptionBudget::new().set_or_clear_last_disruption_time(None::<Timestamp>);
28616 /// ```
28617 pub fn set_or_clear_last_disruption_time<T>(mut self, v: std::option::Option<T>) -> Self
28618 where
28619 T: std::convert::Into<wkt::Timestamp>,
28620 {
28621 self.last_disruption_time = v.map(|x| x.into());
28622 self
28623 }
28624}
28625
28626impl wkt::message::Message for DisruptionBudget {
28627 fn typename() -> &'static str {
28628 "type.googleapis.com/google.container.v1.DisruptionBudget"
28629 }
28630}
28631
28632/// MaintenanceWindow defines the maintenance window to be used for the cluster.
28633#[derive(Clone, Default, PartialEq)]
28634#[non_exhaustive]
28635pub struct MaintenanceWindow {
28636 /// Exceptions to maintenance window. Non-emergency maintenance should not
28637 /// occur in these windows.
28638 pub maintenance_exclusions:
28639 std::collections::HashMap<std::string::String, crate::model::TimeWindow>,
28640
28641 #[allow(missing_docs)]
28642 pub policy: std::option::Option<crate::model::maintenance_window::Policy>,
28643
28644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28645}
28646
28647impl MaintenanceWindow {
28648 /// Creates a new default instance.
28649 pub fn new() -> Self {
28650 std::default::Default::default()
28651 }
28652
28653 /// Sets the value of [maintenance_exclusions][crate::model::MaintenanceWindow::maintenance_exclusions].
28654 ///
28655 /// # Example
28656 /// ```ignore,no_run
28657 /// # use google_cloud_container_v1::model::MaintenanceWindow;
28658 /// use google_cloud_container_v1::model::TimeWindow;
28659 /// let x = MaintenanceWindow::new().set_maintenance_exclusions([
28660 /// ("key0", TimeWindow::default()/* use setters */),
28661 /// ("key1", TimeWindow::default()/* use (different) setters */),
28662 /// ]);
28663 /// ```
28664 pub fn set_maintenance_exclusions<T, K, V>(mut self, v: T) -> Self
28665 where
28666 T: std::iter::IntoIterator<Item = (K, V)>,
28667 K: std::convert::Into<std::string::String>,
28668 V: std::convert::Into<crate::model::TimeWindow>,
28669 {
28670 use std::iter::Iterator;
28671 self.maintenance_exclusions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
28672 self
28673 }
28674
28675 /// Sets the value of [policy][crate::model::MaintenanceWindow::policy].
28676 ///
28677 /// Note that all the setters affecting `policy` are mutually
28678 /// exclusive.
28679 ///
28680 /// # Example
28681 /// ```ignore,no_run
28682 /// # use google_cloud_container_v1::model::MaintenanceWindow;
28683 /// use google_cloud_container_v1::model::DailyMaintenanceWindow;
28684 /// let x = MaintenanceWindow::new().set_policy(Some(
28685 /// google_cloud_container_v1::model::maintenance_window::Policy::DailyMaintenanceWindow(DailyMaintenanceWindow::default().into())));
28686 /// ```
28687 pub fn set_policy<
28688 T: std::convert::Into<std::option::Option<crate::model::maintenance_window::Policy>>,
28689 >(
28690 mut self,
28691 v: T,
28692 ) -> Self {
28693 self.policy = v.into();
28694 self
28695 }
28696
28697 /// The value of [policy][crate::model::MaintenanceWindow::policy]
28698 /// if it holds a `DailyMaintenanceWindow`, `None` if the field is not set or
28699 /// holds a different branch.
28700 pub fn daily_maintenance_window(
28701 &self,
28702 ) -> std::option::Option<&std::boxed::Box<crate::model::DailyMaintenanceWindow>> {
28703 #[allow(unreachable_patterns)]
28704 self.policy.as_ref().and_then(|v| match v {
28705 crate::model::maintenance_window::Policy::DailyMaintenanceWindow(v) => {
28706 std::option::Option::Some(v)
28707 }
28708 _ => std::option::Option::None,
28709 })
28710 }
28711
28712 /// Sets the value of [policy][crate::model::MaintenanceWindow::policy]
28713 /// to hold a `DailyMaintenanceWindow`.
28714 ///
28715 /// Note that all the setters affecting `policy` are
28716 /// mutually exclusive.
28717 ///
28718 /// # Example
28719 /// ```ignore,no_run
28720 /// # use google_cloud_container_v1::model::MaintenanceWindow;
28721 /// use google_cloud_container_v1::model::DailyMaintenanceWindow;
28722 /// let x = MaintenanceWindow::new().set_daily_maintenance_window(DailyMaintenanceWindow::default()/* use setters */);
28723 /// assert!(x.daily_maintenance_window().is_some());
28724 /// assert!(x.recurring_window().is_none());
28725 /// assert!(x.recurring_maintenance_window().is_none());
28726 /// ```
28727 pub fn set_daily_maintenance_window<
28728 T: std::convert::Into<std::boxed::Box<crate::model::DailyMaintenanceWindow>>,
28729 >(
28730 mut self,
28731 v: T,
28732 ) -> Self {
28733 self.policy = std::option::Option::Some(
28734 crate::model::maintenance_window::Policy::DailyMaintenanceWindow(v.into()),
28735 );
28736 self
28737 }
28738
28739 /// The value of [policy][crate::model::MaintenanceWindow::policy]
28740 /// if it holds a `RecurringWindow`, `None` if the field is not set or
28741 /// holds a different branch.
28742 pub fn recurring_window(
28743 &self,
28744 ) -> std::option::Option<&std::boxed::Box<crate::model::RecurringTimeWindow>> {
28745 #[allow(unreachable_patterns)]
28746 self.policy.as_ref().and_then(|v| match v {
28747 crate::model::maintenance_window::Policy::RecurringWindow(v) => {
28748 std::option::Option::Some(v)
28749 }
28750 _ => std::option::Option::None,
28751 })
28752 }
28753
28754 /// Sets the value of [policy][crate::model::MaintenanceWindow::policy]
28755 /// to hold a `RecurringWindow`.
28756 ///
28757 /// Note that all the setters affecting `policy` are
28758 /// mutually exclusive.
28759 ///
28760 /// # Example
28761 /// ```ignore,no_run
28762 /// # use google_cloud_container_v1::model::MaintenanceWindow;
28763 /// use google_cloud_container_v1::model::RecurringTimeWindow;
28764 /// let x = MaintenanceWindow::new().set_recurring_window(RecurringTimeWindow::default()/* use setters */);
28765 /// assert!(x.recurring_window().is_some());
28766 /// assert!(x.daily_maintenance_window().is_none());
28767 /// assert!(x.recurring_maintenance_window().is_none());
28768 /// ```
28769 pub fn set_recurring_window<
28770 T: std::convert::Into<std::boxed::Box<crate::model::RecurringTimeWindow>>,
28771 >(
28772 mut self,
28773 v: T,
28774 ) -> Self {
28775 self.policy = std::option::Option::Some(
28776 crate::model::maintenance_window::Policy::RecurringWindow(v.into()),
28777 );
28778 self
28779 }
28780
28781 /// The value of [policy][crate::model::MaintenanceWindow::policy]
28782 /// if it holds a `RecurringMaintenanceWindow`, `None` if the field is not set or
28783 /// holds a different branch.
28784 pub fn recurring_maintenance_window(
28785 &self,
28786 ) -> std::option::Option<&std::boxed::Box<crate::model::RecurringMaintenanceWindow>> {
28787 #[allow(unreachable_patterns)]
28788 self.policy.as_ref().and_then(|v| match v {
28789 crate::model::maintenance_window::Policy::RecurringMaintenanceWindow(v) => {
28790 std::option::Option::Some(v)
28791 }
28792 _ => std::option::Option::None,
28793 })
28794 }
28795
28796 /// Sets the value of [policy][crate::model::MaintenanceWindow::policy]
28797 /// to hold a `RecurringMaintenanceWindow`.
28798 ///
28799 /// Note that all the setters affecting `policy` are
28800 /// mutually exclusive.
28801 ///
28802 /// # Example
28803 /// ```ignore,no_run
28804 /// # use google_cloud_container_v1::model::MaintenanceWindow;
28805 /// use google_cloud_container_v1::model::RecurringMaintenanceWindow;
28806 /// let x = MaintenanceWindow::new().set_recurring_maintenance_window(RecurringMaintenanceWindow::default()/* use setters */);
28807 /// assert!(x.recurring_maintenance_window().is_some());
28808 /// assert!(x.daily_maintenance_window().is_none());
28809 /// assert!(x.recurring_window().is_none());
28810 /// ```
28811 pub fn set_recurring_maintenance_window<
28812 T: std::convert::Into<std::boxed::Box<crate::model::RecurringMaintenanceWindow>>,
28813 >(
28814 mut self,
28815 v: T,
28816 ) -> Self {
28817 self.policy = std::option::Option::Some(
28818 crate::model::maintenance_window::Policy::RecurringMaintenanceWindow(v.into()),
28819 );
28820 self
28821 }
28822}
28823
28824impl wkt::message::Message for MaintenanceWindow {
28825 fn typename() -> &'static str {
28826 "type.googleapis.com/google.container.v1.MaintenanceWindow"
28827 }
28828}
28829
28830/// Defines additional types related to [MaintenanceWindow].
28831pub mod maintenance_window {
28832 #[allow(unused_imports)]
28833 use super::*;
28834
28835 #[allow(missing_docs)]
28836 #[derive(Clone, Debug, PartialEq)]
28837 #[non_exhaustive]
28838 pub enum Policy {
28839 /// DailyMaintenanceWindow specifies a daily maintenance operation window.
28840 DailyMaintenanceWindow(std::boxed::Box<crate::model::DailyMaintenanceWindow>),
28841 /// RecurringWindow specifies some number of recurring time periods for
28842 /// maintenance to occur. The time windows may be overlapping. If no
28843 /// maintenance windows are set, maintenance can occur at any time.
28844 RecurringWindow(std::boxed::Box<crate::model::RecurringTimeWindow>),
28845 /// RecurringMaintenanceWindow specifies some number of recurring time
28846 /// periods for maintenance to occur. The time windows may be overlapping.
28847 /// If no maintenance windows are set, maintenance can occur at any time.
28848 /// Alternative to RecurringWindow, with renamed fields.
28849 RecurringMaintenanceWindow(std::boxed::Box<crate::model::RecurringMaintenanceWindow>),
28850 }
28851}
28852
28853/// Represents an arbitrary window of time.
28854#[derive(Clone, Default, PartialEq)]
28855#[non_exhaustive]
28856pub struct TimeWindow {
28857 /// The time that the window first starts.
28858 pub start_time: std::option::Option<wkt::Timestamp>,
28859
28860 /// The time that the window ends. The end time should take place after the
28861 /// start time.
28862 pub end_time: std::option::Option<wkt::Timestamp>,
28863
28864 #[allow(missing_docs)]
28865 pub options: std::option::Option<crate::model::time_window::Options>,
28866
28867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28868}
28869
28870impl TimeWindow {
28871 /// Creates a new default instance.
28872 pub fn new() -> Self {
28873 std::default::Default::default()
28874 }
28875
28876 /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
28877 ///
28878 /// # Example
28879 /// ```ignore,no_run
28880 /// # use google_cloud_container_v1::model::TimeWindow;
28881 /// use wkt::Timestamp;
28882 /// let x = TimeWindow::new().set_start_time(Timestamp::default()/* use setters */);
28883 /// ```
28884 pub fn set_start_time<T>(mut self, v: T) -> Self
28885 where
28886 T: std::convert::Into<wkt::Timestamp>,
28887 {
28888 self.start_time = std::option::Option::Some(v.into());
28889 self
28890 }
28891
28892 /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
28893 ///
28894 /// # Example
28895 /// ```ignore,no_run
28896 /// # use google_cloud_container_v1::model::TimeWindow;
28897 /// use wkt::Timestamp;
28898 /// let x = TimeWindow::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
28899 /// let x = TimeWindow::new().set_or_clear_start_time(None::<Timestamp>);
28900 /// ```
28901 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
28902 where
28903 T: std::convert::Into<wkt::Timestamp>,
28904 {
28905 self.start_time = v.map(|x| x.into());
28906 self
28907 }
28908
28909 /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
28910 ///
28911 /// # Example
28912 /// ```ignore,no_run
28913 /// # use google_cloud_container_v1::model::TimeWindow;
28914 /// use wkt::Timestamp;
28915 /// let x = TimeWindow::new().set_end_time(Timestamp::default()/* use setters */);
28916 /// ```
28917 pub fn set_end_time<T>(mut self, v: T) -> Self
28918 where
28919 T: std::convert::Into<wkt::Timestamp>,
28920 {
28921 self.end_time = std::option::Option::Some(v.into());
28922 self
28923 }
28924
28925 /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
28926 ///
28927 /// # Example
28928 /// ```ignore,no_run
28929 /// # use google_cloud_container_v1::model::TimeWindow;
28930 /// use wkt::Timestamp;
28931 /// let x = TimeWindow::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
28932 /// let x = TimeWindow::new().set_or_clear_end_time(None::<Timestamp>);
28933 /// ```
28934 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
28935 where
28936 T: std::convert::Into<wkt::Timestamp>,
28937 {
28938 self.end_time = v.map(|x| x.into());
28939 self
28940 }
28941
28942 /// Sets the value of [options][crate::model::TimeWindow::options].
28943 ///
28944 /// Note that all the setters affecting `options` are mutually
28945 /// exclusive.
28946 ///
28947 /// # Example
28948 /// ```ignore,no_run
28949 /// # use google_cloud_container_v1::model::TimeWindow;
28950 /// use google_cloud_container_v1::model::MaintenanceExclusionOptions;
28951 /// let x = TimeWindow::new().set_options(Some(
28952 /// google_cloud_container_v1::model::time_window::Options::MaintenanceExclusionOptions(MaintenanceExclusionOptions::default().into())));
28953 /// ```
28954 pub fn set_options<
28955 T: std::convert::Into<std::option::Option<crate::model::time_window::Options>>,
28956 >(
28957 mut self,
28958 v: T,
28959 ) -> Self {
28960 self.options = v.into();
28961 self
28962 }
28963
28964 /// The value of [options][crate::model::TimeWindow::options]
28965 /// if it holds a `MaintenanceExclusionOptions`, `None` if the field is not set or
28966 /// holds a different branch.
28967 pub fn maintenance_exclusion_options(
28968 &self,
28969 ) -> std::option::Option<&std::boxed::Box<crate::model::MaintenanceExclusionOptions>> {
28970 #[allow(unreachable_patterns)]
28971 self.options.as_ref().and_then(|v| match v {
28972 crate::model::time_window::Options::MaintenanceExclusionOptions(v) => {
28973 std::option::Option::Some(v)
28974 }
28975 _ => std::option::Option::None,
28976 })
28977 }
28978
28979 /// Sets the value of [options][crate::model::TimeWindow::options]
28980 /// to hold a `MaintenanceExclusionOptions`.
28981 ///
28982 /// Note that all the setters affecting `options` are
28983 /// mutually exclusive.
28984 ///
28985 /// # Example
28986 /// ```ignore,no_run
28987 /// # use google_cloud_container_v1::model::TimeWindow;
28988 /// use google_cloud_container_v1::model::MaintenanceExclusionOptions;
28989 /// let x = TimeWindow::new().set_maintenance_exclusion_options(MaintenanceExclusionOptions::default()/* use setters */);
28990 /// assert!(x.maintenance_exclusion_options().is_some());
28991 /// ```
28992 pub fn set_maintenance_exclusion_options<
28993 T: std::convert::Into<std::boxed::Box<crate::model::MaintenanceExclusionOptions>>,
28994 >(
28995 mut self,
28996 v: T,
28997 ) -> Self {
28998 self.options = std::option::Option::Some(
28999 crate::model::time_window::Options::MaintenanceExclusionOptions(v.into()),
29000 );
29001 self
29002 }
29003}
29004
29005impl wkt::message::Message for TimeWindow {
29006 fn typename() -> &'static str {
29007 "type.googleapis.com/google.container.v1.TimeWindow"
29008 }
29009}
29010
29011/// Defines additional types related to [TimeWindow].
29012pub mod time_window {
29013 #[allow(unused_imports)]
29014 use super::*;
29015
29016 #[allow(missing_docs)]
29017 #[derive(Clone, Debug, PartialEq)]
29018 #[non_exhaustive]
29019 pub enum Options {
29020 /// MaintenanceExclusionOptions provides maintenance exclusion related
29021 /// options.
29022 MaintenanceExclusionOptions(std::boxed::Box<crate::model::MaintenanceExclusionOptions>),
29023 }
29024}
29025
29026/// Represents the Maintenance exclusion option.
29027#[derive(Clone, Default, PartialEq)]
29028#[non_exhaustive]
29029pub struct MaintenanceExclusionOptions {
29030 /// Scope specifies the upgrade scope which upgrades are blocked by the
29031 /// exclusion.
29032 pub scope: crate::model::maintenance_exclusion_options::Scope,
29033
29034 /// EndTimeBehavior specifies the behavior of the exclusion end time.
29035 pub end_time_behavior: crate::model::maintenance_exclusion_options::EndTimeBehavior,
29036
29037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29038}
29039
29040impl MaintenanceExclusionOptions {
29041 /// Creates a new default instance.
29042 pub fn new() -> Self {
29043 std::default::Default::default()
29044 }
29045
29046 /// Sets the value of [scope][crate::model::MaintenanceExclusionOptions::scope].
29047 ///
29048 /// # Example
29049 /// ```ignore,no_run
29050 /// # use google_cloud_container_v1::model::MaintenanceExclusionOptions;
29051 /// use google_cloud_container_v1::model::maintenance_exclusion_options::Scope;
29052 /// let x0 = MaintenanceExclusionOptions::new().set_scope(Scope::NoMinorUpgrades);
29053 /// let x1 = MaintenanceExclusionOptions::new().set_scope(Scope::NoMinorOrNodeUpgrades);
29054 /// ```
29055 pub fn set_scope<T: std::convert::Into<crate::model::maintenance_exclusion_options::Scope>>(
29056 mut self,
29057 v: T,
29058 ) -> Self {
29059 self.scope = v.into();
29060 self
29061 }
29062
29063 /// Sets the value of [end_time_behavior][crate::model::MaintenanceExclusionOptions::end_time_behavior].
29064 ///
29065 /// # Example
29066 /// ```ignore,no_run
29067 /// # use google_cloud_container_v1::model::MaintenanceExclusionOptions;
29068 /// use google_cloud_container_v1::model::maintenance_exclusion_options::EndTimeBehavior;
29069 /// let x0 = MaintenanceExclusionOptions::new().set_end_time_behavior(EndTimeBehavior::UntilEndOfSupport);
29070 /// ```
29071 pub fn set_end_time_behavior<
29072 T: std::convert::Into<crate::model::maintenance_exclusion_options::EndTimeBehavior>,
29073 >(
29074 mut self,
29075 v: T,
29076 ) -> Self {
29077 self.end_time_behavior = v.into();
29078 self
29079 }
29080}
29081
29082impl wkt::message::Message for MaintenanceExclusionOptions {
29083 fn typename() -> &'static str {
29084 "type.googleapis.com/google.container.v1.MaintenanceExclusionOptions"
29085 }
29086}
29087
29088/// Defines additional types related to [MaintenanceExclusionOptions].
29089pub mod maintenance_exclusion_options {
29090 #[allow(unused_imports)]
29091 use super::*;
29092
29093 /// Scope of exclusion.
29094 ///
29095 /// # Working with unknown values
29096 ///
29097 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29098 /// additional enum variants at any time. Adding new variants is not considered
29099 /// a breaking change. Applications should write their code in anticipation of:
29100 ///
29101 /// - New values appearing in future releases of the client library, **and**
29102 /// - New values received dynamically, without application changes.
29103 ///
29104 /// Please consult the [Working with enums] section in the user guide for some
29105 /// guidelines.
29106 ///
29107 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29108 #[derive(Clone, Debug, PartialEq)]
29109 #[non_exhaustive]
29110 pub enum Scope {
29111 /// NO_UPGRADES excludes all upgrades, including patch upgrades and minor
29112 /// upgrades across control planes and nodes. This is the default exclusion
29113 /// behavior.
29114 NoUpgrades,
29115 /// NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only
29116 /// patches are allowed.
29117 NoMinorUpgrades,
29118 /// NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster,
29119 /// and also exclude all node pool upgrades. Only control
29120 /// plane patches are allowed.
29121 NoMinorOrNodeUpgrades,
29122 /// If set, the enum was initialized with an unknown value.
29123 ///
29124 /// Applications can examine the value using [Scope::value] or
29125 /// [Scope::name].
29126 UnknownValue(scope::UnknownValue),
29127 }
29128
29129 #[doc(hidden)]
29130 pub mod scope {
29131 #[allow(unused_imports)]
29132 use super::*;
29133 #[derive(Clone, Debug, PartialEq)]
29134 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29135 }
29136
29137 impl Scope {
29138 /// Gets the enum value.
29139 ///
29140 /// Returns `None` if the enum contains an unknown value deserialized from
29141 /// the string representation of enums.
29142 pub fn value(&self) -> std::option::Option<i32> {
29143 match self {
29144 Self::NoUpgrades => std::option::Option::Some(0),
29145 Self::NoMinorUpgrades => std::option::Option::Some(1),
29146 Self::NoMinorOrNodeUpgrades => std::option::Option::Some(2),
29147 Self::UnknownValue(u) => u.0.value(),
29148 }
29149 }
29150
29151 /// Gets the enum value as a string.
29152 ///
29153 /// Returns `None` if the enum contains an unknown value deserialized from
29154 /// the integer representation of enums.
29155 pub fn name(&self) -> std::option::Option<&str> {
29156 match self {
29157 Self::NoUpgrades => std::option::Option::Some("NO_UPGRADES"),
29158 Self::NoMinorUpgrades => std::option::Option::Some("NO_MINOR_UPGRADES"),
29159 Self::NoMinorOrNodeUpgrades => {
29160 std::option::Option::Some("NO_MINOR_OR_NODE_UPGRADES")
29161 }
29162 Self::UnknownValue(u) => u.0.name(),
29163 }
29164 }
29165 }
29166
29167 impl std::default::Default for Scope {
29168 fn default() -> Self {
29169 use std::convert::From;
29170 Self::from(0)
29171 }
29172 }
29173
29174 impl std::fmt::Display for Scope {
29175 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29176 wkt::internal::display_enum(f, self.name(), self.value())
29177 }
29178 }
29179
29180 impl std::convert::From<i32> for Scope {
29181 fn from(value: i32) -> Self {
29182 match value {
29183 0 => Self::NoUpgrades,
29184 1 => Self::NoMinorUpgrades,
29185 2 => Self::NoMinorOrNodeUpgrades,
29186 _ => Self::UnknownValue(scope::UnknownValue(
29187 wkt::internal::UnknownEnumValue::Integer(value),
29188 )),
29189 }
29190 }
29191 }
29192
29193 impl std::convert::From<&str> for Scope {
29194 fn from(value: &str) -> Self {
29195 use std::string::ToString;
29196 match value {
29197 "NO_UPGRADES" => Self::NoUpgrades,
29198 "NO_MINOR_UPGRADES" => Self::NoMinorUpgrades,
29199 "NO_MINOR_OR_NODE_UPGRADES" => Self::NoMinorOrNodeUpgrades,
29200 _ => Self::UnknownValue(scope::UnknownValue(
29201 wkt::internal::UnknownEnumValue::String(value.to_string()),
29202 )),
29203 }
29204 }
29205 }
29206
29207 impl serde::ser::Serialize for Scope {
29208 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29209 where
29210 S: serde::Serializer,
29211 {
29212 match self {
29213 Self::NoUpgrades => serializer.serialize_i32(0),
29214 Self::NoMinorUpgrades => serializer.serialize_i32(1),
29215 Self::NoMinorOrNodeUpgrades => serializer.serialize_i32(2),
29216 Self::UnknownValue(u) => u.0.serialize(serializer),
29217 }
29218 }
29219 }
29220
29221 impl<'de> serde::de::Deserialize<'de> for Scope {
29222 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29223 where
29224 D: serde::Deserializer<'de>,
29225 {
29226 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
29227 ".google.container.v1.MaintenanceExclusionOptions.Scope",
29228 ))
29229 }
29230 }
29231
29232 /// EndTimeBehavior specifies the behavior of the exclusion end time.
29233 ///
29234 /// # Working with unknown values
29235 ///
29236 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29237 /// additional enum variants at any time. Adding new variants is not considered
29238 /// a breaking change. Applications should write their code in anticipation of:
29239 ///
29240 /// - New values appearing in future releases of the client library, **and**
29241 /// - New values received dynamically, without application changes.
29242 ///
29243 /// Please consult the [Working with enums] section in the user guide for some
29244 /// guidelines.
29245 ///
29246 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29247 #[derive(Clone, Debug, PartialEq)]
29248 #[non_exhaustive]
29249 pub enum EndTimeBehavior {
29250 /// END_TIME_BEHAVIOR_UNSPECIFIED is the default behavior, which is fixed
29251 /// end time.
29252 Unspecified,
29253 /// UNTIL_END_OF_SUPPORT means the exclusion will be in effect until the end
29254 /// of the support of the cluster's current version.
29255 UntilEndOfSupport,
29256 /// If set, the enum was initialized with an unknown value.
29257 ///
29258 /// Applications can examine the value using [EndTimeBehavior::value] or
29259 /// [EndTimeBehavior::name].
29260 UnknownValue(end_time_behavior::UnknownValue),
29261 }
29262
29263 #[doc(hidden)]
29264 pub mod end_time_behavior {
29265 #[allow(unused_imports)]
29266 use super::*;
29267 #[derive(Clone, Debug, PartialEq)]
29268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29269 }
29270
29271 impl EndTimeBehavior {
29272 /// Gets the enum value.
29273 ///
29274 /// Returns `None` if the enum contains an unknown value deserialized from
29275 /// the string representation of enums.
29276 pub fn value(&self) -> std::option::Option<i32> {
29277 match self {
29278 Self::Unspecified => std::option::Option::Some(0),
29279 Self::UntilEndOfSupport => std::option::Option::Some(1),
29280 Self::UnknownValue(u) => u.0.value(),
29281 }
29282 }
29283
29284 /// Gets the enum value as a string.
29285 ///
29286 /// Returns `None` if the enum contains an unknown value deserialized from
29287 /// the integer representation of enums.
29288 pub fn name(&self) -> std::option::Option<&str> {
29289 match self {
29290 Self::Unspecified => std::option::Option::Some("END_TIME_BEHAVIOR_UNSPECIFIED"),
29291 Self::UntilEndOfSupport => std::option::Option::Some("UNTIL_END_OF_SUPPORT"),
29292 Self::UnknownValue(u) => u.0.name(),
29293 }
29294 }
29295 }
29296
29297 impl std::default::Default for EndTimeBehavior {
29298 fn default() -> Self {
29299 use std::convert::From;
29300 Self::from(0)
29301 }
29302 }
29303
29304 impl std::fmt::Display for EndTimeBehavior {
29305 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29306 wkt::internal::display_enum(f, self.name(), self.value())
29307 }
29308 }
29309
29310 impl std::convert::From<i32> for EndTimeBehavior {
29311 fn from(value: i32) -> Self {
29312 match value {
29313 0 => Self::Unspecified,
29314 1 => Self::UntilEndOfSupport,
29315 _ => Self::UnknownValue(end_time_behavior::UnknownValue(
29316 wkt::internal::UnknownEnumValue::Integer(value),
29317 )),
29318 }
29319 }
29320 }
29321
29322 impl std::convert::From<&str> for EndTimeBehavior {
29323 fn from(value: &str) -> Self {
29324 use std::string::ToString;
29325 match value {
29326 "END_TIME_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
29327 "UNTIL_END_OF_SUPPORT" => Self::UntilEndOfSupport,
29328 _ => Self::UnknownValue(end_time_behavior::UnknownValue(
29329 wkt::internal::UnknownEnumValue::String(value.to_string()),
29330 )),
29331 }
29332 }
29333 }
29334
29335 impl serde::ser::Serialize for EndTimeBehavior {
29336 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29337 where
29338 S: serde::Serializer,
29339 {
29340 match self {
29341 Self::Unspecified => serializer.serialize_i32(0),
29342 Self::UntilEndOfSupport => serializer.serialize_i32(1),
29343 Self::UnknownValue(u) => u.0.serialize(serializer),
29344 }
29345 }
29346 }
29347
29348 impl<'de> serde::de::Deserialize<'de> for EndTimeBehavior {
29349 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29350 where
29351 D: serde::Deserializer<'de>,
29352 {
29353 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EndTimeBehavior>::new(
29354 ".google.container.v1.MaintenanceExclusionOptions.EndTimeBehavior",
29355 ))
29356 }
29357 }
29358}
29359
29360/// Represents an arbitrary window of time that recurs.
29361#[derive(Clone, Default, PartialEq)]
29362#[non_exhaustive]
29363pub struct RecurringTimeWindow {
29364 /// The window of the first recurrence.
29365 pub window: std::option::Option<crate::model::TimeWindow>,
29366
29367 /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
29368 /// this window recurs. They go on for the span of time between the start and
29369 /// end time.
29370 ///
29371 /// For example, to have something repeat every weekday, you'd use:
29372 /// `FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR`
29373 ///
29374 /// To repeat some window daily (equivalent to the DailyMaintenanceWindow):
29375 /// `FREQ=DAILY`
29376 ///
29377 /// For the first weekend of every month:
29378 /// `FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU`
29379 ///
29380 /// This specifies how frequently the window starts. Eg, if you wanted to have
29381 /// a 9-5 UTC-4 window every weekday, you'd use something like:
29382 ///
29383 /// ```norust
29384 /// start time = 2019-01-01T09:00:00-0400
29385 /// end time = 2019-01-01T17:00:00-0400
29386 /// recurrence = FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
29387 /// ```
29388 ///
29389 /// Windows can span multiple days. Eg, to make the window encompass every
29390 /// weekend from midnight Saturday till the last minute of Sunday UTC:
29391 ///
29392 /// ```norust
29393 /// start time = 2019-01-05T00:00:00Z
29394 /// end time = 2019-01-07T23:59:00Z
29395 /// recurrence = FREQ=WEEKLY;BYDAY=SA
29396 /// ```
29397 ///
29398 /// Note the start and end time's specific dates are largely arbitrary except
29399 /// to specify duration of the window and when it first starts.
29400 /// The FREQ values of HOURLY, MINUTELY, and SECONDLY are not supported.
29401 pub recurrence: std::string::String,
29402
29403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29404}
29405
29406impl RecurringTimeWindow {
29407 /// Creates a new default instance.
29408 pub fn new() -> Self {
29409 std::default::Default::default()
29410 }
29411
29412 /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
29413 ///
29414 /// # Example
29415 /// ```ignore,no_run
29416 /// # use google_cloud_container_v1::model::RecurringTimeWindow;
29417 /// use google_cloud_container_v1::model::TimeWindow;
29418 /// let x = RecurringTimeWindow::new().set_window(TimeWindow::default()/* use setters */);
29419 /// ```
29420 pub fn set_window<T>(mut self, v: T) -> Self
29421 where
29422 T: std::convert::Into<crate::model::TimeWindow>,
29423 {
29424 self.window = std::option::Option::Some(v.into());
29425 self
29426 }
29427
29428 /// Sets or clears the value of [window][crate::model::RecurringTimeWindow::window].
29429 ///
29430 /// # Example
29431 /// ```ignore,no_run
29432 /// # use google_cloud_container_v1::model::RecurringTimeWindow;
29433 /// use google_cloud_container_v1::model::TimeWindow;
29434 /// let x = RecurringTimeWindow::new().set_or_clear_window(Some(TimeWindow::default()/* use setters */));
29435 /// let x = RecurringTimeWindow::new().set_or_clear_window(None::<TimeWindow>);
29436 /// ```
29437 pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
29438 where
29439 T: std::convert::Into<crate::model::TimeWindow>,
29440 {
29441 self.window = v.map(|x| x.into());
29442 self
29443 }
29444
29445 /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
29446 ///
29447 /// # Example
29448 /// ```ignore,no_run
29449 /// # use google_cloud_container_v1::model::RecurringTimeWindow;
29450 /// let x = RecurringTimeWindow::new().set_recurrence("example");
29451 /// ```
29452 pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29453 self.recurrence = v.into();
29454 self
29455 }
29456}
29457
29458impl wkt::message::Message for RecurringTimeWindow {
29459 fn typename() -> &'static str {
29460 "type.googleapis.com/google.container.v1.RecurringTimeWindow"
29461 }
29462}
29463
29464/// Represents an arbitrary window of time that recurs.
29465/// Will replace RecurringTimeWindow.
29466#[derive(Clone, Default, PartialEq)]
29467#[non_exhaustive]
29468pub struct RecurringMaintenanceWindow {
29469 /// Optional. Specifies the date before which will not be scheduled.
29470 /// Depending on the recurrence, this may be the date the first window appears.
29471 /// Days are measured in the UTC timezone. This setting must be used when
29472 /// INTERVAL>1 or FREQ=WEEKLY/MONTHLY and no BYDAY specified.
29473 pub delay_until: std::option::Option<google_cloud_type::model::Date>,
29474
29475 /// Required. Start time of the window on days that it is scheduled,
29476 /// assuming UTC timezone.
29477 pub window_start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
29478
29479 /// Required. Duration of the window.
29480 pub window_duration: std::option::Option<wkt::Duration>,
29481
29482 /// Required. An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>)
29483 /// for how this window recurs.
29484 ///
29485 /// For example, to have something repeat every weekday, you'd use:
29486 /// `FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR`
29487 ///
29488 /// To repeat some window daily (equivalent to the DailyMaintenanceWindow):
29489 /// `FREQ=DAILY`
29490 ///
29491 /// For the first weekend of every month:
29492 /// `FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU`
29493 ///
29494 /// The FREQ values of HOURLY, MINUTELY, and SECONDLY are not supported.
29495 pub recurrence: std::string::String,
29496
29497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29498}
29499
29500impl RecurringMaintenanceWindow {
29501 /// Creates a new default instance.
29502 pub fn new() -> Self {
29503 std::default::Default::default()
29504 }
29505
29506 /// Sets the value of [delay_until][crate::model::RecurringMaintenanceWindow::delay_until].
29507 ///
29508 /// # Example
29509 /// ```ignore,no_run
29510 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29511 /// use google_cloud_type::model::Date;
29512 /// let x = RecurringMaintenanceWindow::new().set_delay_until(Date::default()/* use setters */);
29513 /// ```
29514 pub fn set_delay_until<T>(mut self, v: T) -> Self
29515 where
29516 T: std::convert::Into<google_cloud_type::model::Date>,
29517 {
29518 self.delay_until = std::option::Option::Some(v.into());
29519 self
29520 }
29521
29522 /// Sets or clears the value of [delay_until][crate::model::RecurringMaintenanceWindow::delay_until].
29523 ///
29524 /// # Example
29525 /// ```ignore,no_run
29526 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29527 /// use google_cloud_type::model::Date;
29528 /// let x = RecurringMaintenanceWindow::new().set_or_clear_delay_until(Some(Date::default()/* use setters */));
29529 /// let x = RecurringMaintenanceWindow::new().set_or_clear_delay_until(None::<Date>);
29530 /// ```
29531 pub fn set_or_clear_delay_until<T>(mut self, v: std::option::Option<T>) -> Self
29532 where
29533 T: std::convert::Into<google_cloud_type::model::Date>,
29534 {
29535 self.delay_until = v.map(|x| x.into());
29536 self
29537 }
29538
29539 /// Sets the value of [window_start_time][crate::model::RecurringMaintenanceWindow::window_start_time].
29540 ///
29541 /// # Example
29542 /// ```ignore,no_run
29543 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29544 /// use google_cloud_type::model::TimeOfDay;
29545 /// let x = RecurringMaintenanceWindow::new().set_window_start_time(TimeOfDay::default()/* use setters */);
29546 /// ```
29547 pub fn set_window_start_time<T>(mut self, v: T) -> Self
29548 where
29549 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
29550 {
29551 self.window_start_time = std::option::Option::Some(v.into());
29552 self
29553 }
29554
29555 /// Sets or clears the value of [window_start_time][crate::model::RecurringMaintenanceWindow::window_start_time].
29556 ///
29557 /// # Example
29558 /// ```ignore,no_run
29559 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29560 /// use google_cloud_type::model::TimeOfDay;
29561 /// let x = RecurringMaintenanceWindow::new().set_or_clear_window_start_time(Some(TimeOfDay::default()/* use setters */));
29562 /// let x = RecurringMaintenanceWindow::new().set_or_clear_window_start_time(None::<TimeOfDay>);
29563 /// ```
29564 pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
29565 where
29566 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
29567 {
29568 self.window_start_time = v.map(|x| x.into());
29569 self
29570 }
29571
29572 /// Sets the value of [window_duration][crate::model::RecurringMaintenanceWindow::window_duration].
29573 ///
29574 /// # Example
29575 /// ```ignore,no_run
29576 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29577 /// use wkt::Duration;
29578 /// let x = RecurringMaintenanceWindow::new().set_window_duration(Duration::default()/* use setters */);
29579 /// ```
29580 pub fn set_window_duration<T>(mut self, v: T) -> Self
29581 where
29582 T: std::convert::Into<wkt::Duration>,
29583 {
29584 self.window_duration = std::option::Option::Some(v.into());
29585 self
29586 }
29587
29588 /// Sets or clears the value of [window_duration][crate::model::RecurringMaintenanceWindow::window_duration].
29589 ///
29590 /// # Example
29591 /// ```ignore,no_run
29592 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29593 /// use wkt::Duration;
29594 /// let x = RecurringMaintenanceWindow::new().set_or_clear_window_duration(Some(Duration::default()/* use setters */));
29595 /// let x = RecurringMaintenanceWindow::new().set_or_clear_window_duration(None::<Duration>);
29596 /// ```
29597 pub fn set_or_clear_window_duration<T>(mut self, v: std::option::Option<T>) -> Self
29598 where
29599 T: std::convert::Into<wkt::Duration>,
29600 {
29601 self.window_duration = v.map(|x| x.into());
29602 self
29603 }
29604
29605 /// Sets the value of [recurrence][crate::model::RecurringMaintenanceWindow::recurrence].
29606 ///
29607 /// # Example
29608 /// ```ignore,no_run
29609 /// # use google_cloud_container_v1::model::RecurringMaintenanceWindow;
29610 /// let x = RecurringMaintenanceWindow::new().set_recurrence("example");
29611 /// ```
29612 pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29613 self.recurrence = v.into();
29614 self
29615 }
29616}
29617
29618impl wkt::message::Message for RecurringMaintenanceWindow {
29619 fn typename() -> &'static str {
29620 "type.googleapis.com/google.container.v1.RecurringMaintenanceWindow"
29621 }
29622}
29623
29624/// Time window specified for daily maintenance operations.
29625#[derive(Clone, Default, PartialEq)]
29626#[non_exhaustive]
29627pub struct DailyMaintenanceWindow {
29628 /// Time within the maintenance window to start the maintenance operations.
29629 /// Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
29630 /// format "HH:MM", where HH : [00-23] and MM : [00-59] GMT.
29631 pub start_time: std::string::String,
29632
29633 /// Output only. Duration of the time window, automatically chosen to be
29634 /// smallest possible in the given scenario.
29635 /// Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
29636 /// format "PTnHnMnS".
29637 pub duration: std::string::String,
29638
29639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29640}
29641
29642impl DailyMaintenanceWindow {
29643 /// Creates a new default instance.
29644 pub fn new() -> Self {
29645 std::default::Default::default()
29646 }
29647
29648 /// Sets the value of [start_time][crate::model::DailyMaintenanceWindow::start_time].
29649 ///
29650 /// # Example
29651 /// ```ignore,no_run
29652 /// # use google_cloud_container_v1::model::DailyMaintenanceWindow;
29653 /// let x = DailyMaintenanceWindow::new().set_start_time("example");
29654 /// ```
29655 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29656 self.start_time = v.into();
29657 self
29658 }
29659
29660 /// Sets the value of [duration][crate::model::DailyMaintenanceWindow::duration].
29661 ///
29662 /// # Example
29663 /// ```ignore,no_run
29664 /// # use google_cloud_container_v1::model::DailyMaintenanceWindow;
29665 /// let x = DailyMaintenanceWindow::new().set_duration("example");
29666 /// ```
29667 pub fn set_duration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29668 self.duration = v.into();
29669 self
29670 }
29671}
29672
29673impl wkt::message::Message for DailyMaintenanceWindow {
29674 fn typename() -> &'static str {
29675 "type.googleapis.com/google.container.v1.DailyMaintenanceWindow"
29676 }
29677}
29678
29679/// SetNodePoolManagementRequest sets the node management properties of a node
29680/// pool.
29681#[derive(Clone, Default, PartialEq)]
29682#[non_exhaustive]
29683pub struct SetNodePoolManagementRequest {
29684 /// Deprecated. The Google Developers Console [project ID or project
29685 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
29686 /// This field has been deprecated and replaced by the name field.
29687 #[deprecated]
29688 pub project_id: std::string::String,
29689
29690 /// Deprecated. The name of the Google Compute Engine
29691 /// [zone](https://cloud.google.com/compute/docs/zones#available)
29692 /// in which the cluster resides. This field has been deprecated and replaced
29693 /// by the name field.
29694 #[deprecated]
29695 pub zone: std::string::String,
29696
29697 /// Deprecated. The name of the cluster to update.
29698 /// This field has been deprecated and replaced by the name field.
29699 #[deprecated]
29700 pub cluster_id: std::string::String,
29701
29702 /// Deprecated. The name of the node pool to update.
29703 /// This field has been deprecated and replaced by the name field.
29704 #[deprecated]
29705 pub node_pool_id: std::string::String,
29706
29707 /// Required. NodeManagement configuration for the node pool.
29708 pub management: std::option::Option<crate::model::NodeManagement>,
29709
29710 /// The name (project, location, cluster, node pool id) of the node pool to set
29711 /// management properties. Specified in the format
29712 /// `projects/*/locations/*/clusters/*/nodePools/*`.
29713 pub name: std::string::String,
29714
29715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29716}
29717
29718impl SetNodePoolManagementRequest {
29719 /// Creates a new default instance.
29720 pub fn new() -> Self {
29721 std::default::Default::default()
29722 }
29723
29724 /// Sets the value of [project_id][crate::model::SetNodePoolManagementRequest::project_id].
29725 ///
29726 /// # Example
29727 /// ```ignore,no_run
29728 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29729 /// let x = SetNodePoolManagementRequest::new().set_project_id("example");
29730 /// ```
29731 #[deprecated]
29732 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29733 self.project_id = v.into();
29734 self
29735 }
29736
29737 /// Sets the value of [zone][crate::model::SetNodePoolManagementRequest::zone].
29738 ///
29739 /// # Example
29740 /// ```ignore,no_run
29741 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29742 /// let x = SetNodePoolManagementRequest::new().set_zone("example");
29743 /// ```
29744 #[deprecated]
29745 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29746 self.zone = v.into();
29747 self
29748 }
29749
29750 /// Sets the value of [cluster_id][crate::model::SetNodePoolManagementRequest::cluster_id].
29751 ///
29752 /// # Example
29753 /// ```ignore,no_run
29754 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29755 /// let x = SetNodePoolManagementRequest::new().set_cluster_id("example");
29756 /// ```
29757 #[deprecated]
29758 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29759 self.cluster_id = v.into();
29760 self
29761 }
29762
29763 /// Sets the value of [node_pool_id][crate::model::SetNodePoolManagementRequest::node_pool_id].
29764 ///
29765 /// # Example
29766 /// ```ignore,no_run
29767 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29768 /// let x = SetNodePoolManagementRequest::new().set_node_pool_id("example");
29769 /// ```
29770 #[deprecated]
29771 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29772 self.node_pool_id = v.into();
29773 self
29774 }
29775
29776 /// Sets the value of [management][crate::model::SetNodePoolManagementRequest::management].
29777 ///
29778 /// # Example
29779 /// ```ignore,no_run
29780 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29781 /// use google_cloud_container_v1::model::NodeManagement;
29782 /// let x = SetNodePoolManagementRequest::new().set_management(NodeManagement::default()/* use setters */);
29783 /// ```
29784 pub fn set_management<T>(mut self, v: T) -> Self
29785 where
29786 T: std::convert::Into<crate::model::NodeManagement>,
29787 {
29788 self.management = std::option::Option::Some(v.into());
29789 self
29790 }
29791
29792 /// Sets or clears the value of [management][crate::model::SetNodePoolManagementRequest::management].
29793 ///
29794 /// # Example
29795 /// ```ignore,no_run
29796 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29797 /// use google_cloud_container_v1::model::NodeManagement;
29798 /// let x = SetNodePoolManagementRequest::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
29799 /// let x = SetNodePoolManagementRequest::new().set_or_clear_management(None::<NodeManagement>);
29800 /// ```
29801 pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
29802 where
29803 T: std::convert::Into<crate::model::NodeManagement>,
29804 {
29805 self.management = v.map(|x| x.into());
29806 self
29807 }
29808
29809 /// Sets the value of [name][crate::model::SetNodePoolManagementRequest::name].
29810 ///
29811 /// # Example
29812 /// ```ignore,no_run
29813 /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
29814 /// let x = SetNodePoolManagementRequest::new().set_name("example");
29815 /// ```
29816 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29817 self.name = v.into();
29818 self
29819 }
29820}
29821
29822impl wkt::message::Message for SetNodePoolManagementRequest {
29823 fn typename() -> &'static str {
29824 "type.googleapis.com/google.container.v1.SetNodePoolManagementRequest"
29825 }
29826}
29827
29828/// SetNodePoolSizeRequest sets the size of a node pool.
29829#[derive(Clone, Default, PartialEq)]
29830#[non_exhaustive]
29831pub struct SetNodePoolSizeRequest {
29832 /// Deprecated. The Google Developers Console [project ID or project
29833 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
29834 /// This field has been deprecated and replaced by the name field.
29835 #[deprecated]
29836 pub project_id: std::string::String,
29837
29838 /// Deprecated. The name of the Google Compute Engine
29839 /// [zone](https://cloud.google.com/compute/docs/zones#available)
29840 /// in which the cluster resides. This field has been deprecated and replaced
29841 /// by the name field.
29842 #[deprecated]
29843 pub zone: std::string::String,
29844
29845 /// Deprecated. The name of the cluster to update.
29846 /// This field has been deprecated and replaced by the name field.
29847 #[deprecated]
29848 pub cluster_id: std::string::String,
29849
29850 /// Deprecated. The name of the node pool to update.
29851 /// This field has been deprecated and replaced by the name field.
29852 #[deprecated]
29853 pub node_pool_id: std::string::String,
29854
29855 /// Required. The desired node count for the pool.
29856 pub node_count: i32,
29857
29858 /// The name (project, location, cluster, node pool id) of the node pool to set
29859 /// size.
29860 /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
29861 pub name: std::string::String,
29862
29863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29864}
29865
29866impl SetNodePoolSizeRequest {
29867 /// Creates a new default instance.
29868 pub fn new() -> Self {
29869 std::default::Default::default()
29870 }
29871
29872 /// Sets the value of [project_id][crate::model::SetNodePoolSizeRequest::project_id].
29873 ///
29874 /// # Example
29875 /// ```ignore,no_run
29876 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29877 /// let x = SetNodePoolSizeRequest::new().set_project_id("example");
29878 /// ```
29879 #[deprecated]
29880 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29881 self.project_id = v.into();
29882 self
29883 }
29884
29885 /// Sets the value of [zone][crate::model::SetNodePoolSizeRequest::zone].
29886 ///
29887 /// # Example
29888 /// ```ignore,no_run
29889 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29890 /// let x = SetNodePoolSizeRequest::new().set_zone("example");
29891 /// ```
29892 #[deprecated]
29893 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29894 self.zone = v.into();
29895 self
29896 }
29897
29898 /// Sets the value of [cluster_id][crate::model::SetNodePoolSizeRequest::cluster_id].
29899 ///
29900 /// # Example
29901 /// ```ignore,no_run
29902 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29903 /// let x = SetNodePoolSizeRequest::new().set_cluster_id("example");
29904 /// ```
29905 #[deprecated]
29906 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29907 self.cluster_id = v.into();
29908 self
29909 }
29910
29911 /// Sets the value of [node_pool_id][crate::model::SetNodePoolSizeRequest::node_pool_id].
29912 ///
29913 /// # Example
29914 /// ```ignore,no_run
29915 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29916 /// let x = SetNodePoolSizeRequest::new().set_node_pool_id("example");
29917 /// ```
29918 #[deprecated]
29919 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29920 self.node_pool_id = v.into();
29921 self
29922 }
29923
29924 /// Sets the value of [node_count][crate::model::SetNodePoolSizeRequest::node_count].
29925 ///
29926 /// # Example
29927 /// ```ignore,no_run
29928 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29929 /// let x = SetNodePoolSizeRequest::new().set_node_count(42);
29930 /// ```
29931 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
29932 self.node_count = v.into();
29933 self
29934 }
29935
29936 /// Sets the value of [name][crate::model::SetNodePoolSizeRequest::name].
29937 ///
29938 /// # Example
29939 /// ```ignore,no_run
29940 /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
29941 /// let x = SetNodePoolSizeRequest::new().set_name("example");
29942 /// ```
29943 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29944 self.name = v.into();
29945 self
29946 }
29947}
29948
29949impl wkt::message::Message for SetNodePoolSizeRequest {
29950 fn typename() -> &'static str {
29951 "type.googleapis.com/google.container.v1.SetNodePoolSizeRequest"
29952 }
29953}
29954
29955/// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete
29956/// upgrade.
29957#[derive(Clone, Default, PartialEq)]
29958#[non_exhaustive]
29959pub struct CompleteNodePoolUpgradeRequest {
29960 /// The name (project, location, cluster, node pool id) of the node pool to
29961 /// complete upgrade.
29962 /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
29963 pub name: std::string::String,
29964
29965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29966}
29967
29968impl CompleteNodePoolUpgradeRequest {
29969 /// Creates a new default instance.
29970 pub fn new() -> Self {
29971 std::default::Default::default()
29972 }
29973
29974 /// Sets the value of [name][crate::model::CompleteNodePoolUpgradeRequest::name].
29975 ///
29976 /// # Example
29977 /// ```ignore,no_run
29978 /// # use google_cloud_container_v1::model::CompleteNodePoolUpgradeRequest;
29979 /// let x = CompleteNodePoolUpgradeRequest::new().set_name("example");
29980 /// ```
29981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29982 self.name = v.into();
29983 self
29984 }
29985}
29986
29987impl wkt::message::Message for CompleteNodePoolUpgradeRequest {
29988 fn typename() -> &'static str {
29989 "type.googleapis.com/google.container.v1.CompleteNodePoolUpgradeRequest"
29990 }
29991}
29992
29993/// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed
29994/// NodePool upgrade. This will be an no-op if the last upgrade successfully
29995/// completed.
29996#[derive(Clone, Default, PartialEq)]
29997#[non_exhaustive]
29998pub struct RollbackNodePoolUpgradeRequest {
29999 /// Deprecated. The Google Developers Console [project ID or project
30000 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
30001 /// This field has been deprecated and replaced by the name field.
30002 #[deprecated]
30003 pub project_id: std::string::String,
30004
30005 /// Deprecated. The name of the Google Compute Engine
30006 /// [zone](https://cloud.google.com/compute/docs/zones#available)
30007 /// in which the cluster resides. This field has been deprecated and replaced
30008 /// by the name field.
30009 #[deprecated]
30010 pub zone: std::string::String,
30011
30012 /// Deprecated. The name of the cluster to rollback.
30013 /// This field has been deprecated and replaced by the name field.
30014 #[deprecated]
30015 pub cluster_id: std::string::String,
30016
30017 /// Deprecated. The name of the node pool to rollback.
30018 /// This field has been deprecated and replaced by the name field.
30019 #[deprecated]
30020 pub node_pool_id: std::string::String,
30021
30022 /// The name (project, location, cluster, node pool id) of the node poll to
30023 /// rollback upgrade.
30024 /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
30025 pub name: std::string::String,
30026
30027 /// Option for rollback to ignore the PodDisruptionBudget.
30028 /// Default value is false.
30029 pub respect_pdb: bool,
30030
30031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30032}
30033
30034impl RollbackNodePoolUpgradeRequest {
30035 /// Creates a new default instance.
30036 pub fn new() -> Self {
30037 std::default::Default::default()
30038 }
30039
30040 /// Sets the value of [project_id][crate::model::RollbackNodePoolUpgradeRequest::project_id].
30041 ///
30042 /// # Example
30043 /// ```ignore,no_run
30044 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30045 /// let x = RollbackNodePoolUpgradeRequest::new().set_project_id("example");
30046 /// ```
30047 #[deprecated]
30048 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30049 self.project_id = v.into();
30050 self
30051 }
30052
30053 /// Sets the value of [zone][crate::model::RollbackNodePoolUpgradeRequest::zone].
30054 ///
30055 /// # Example
30056 /// ```ignore,no_run
30057 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30058 /// let x = RollbackNodePoolUpgradeRequest::new().set_zone("example");
30059 /// ```
30060 #[deprecated]
30061 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30062 self.zone = v.into();
30063 self
30064 }
30065
30066 /// Sets the value of [cluster_id][crate::model::RollbackNodePoolUpgradeRequest::cluster_id].
30067 ///
30068 /// # Example
30069 /// ```ignore,no_run
30070 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30071 /// let x = RollbackNodePoolUpgradeRequest::new().set_cluster_id("example");
30072 /// ```
30073 #[deprecated]
30074 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30075 self.cluster_id = v.into();
30076 self
30077 }
30078
30079 /// Sets the value of [node_pool_id][crate::model::RollbackNodePoolUpgradeRequest::node_pool_id].
30080 ///
30081 /// # Example
30082 /// ```ignore,no_run
30083 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30084 /// let x = RollbackNodePoolUpgradeRequest::new().set_node_pool_id("example");
30085 /// ```
30086 #[deprecated]
30087 pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30088 self.node_pool_id = v.into();
30089 self
30090 }
30091
30092 /// Sets the value of [name][crate::model::RollbackNodePoolUpgradeRequest::name].
30093 ///
30094 /// # Example
30095 /// ```ignore,no_run
30096 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30097 /// let x = RollbackNodePoolUpgradeRequest::new().set_name("example");
30098 /// ```
30099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30100 self.name = v.into();
30101 self
30102 }
30103
30104 /// Sets the value of [respect_pdb][crate::model::RollbackNodePoolUpgradeRequest::respect_pdb].
30105 ///
30106 /// # Example
30107 /// ```ignore,no_run
30108 /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
30109 /// let x = RollbackNodePoolUpgradeRequest::new().set_respect_pdb(true);
30110 /// ```
30111 pub fn set_respect_pdb<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30112 self.respect_pdb = v.into();
30113 self
30114 }
30115}
30116
30117impl wkt::message::Message for RollbackNodePoolUpgradeRequest {
30118 fn typename() -> &'static str {
30119 "type.googleapis.com/google.container.v1.RollbackNodePoolUpgradeRequest"
30120 }
30121}
30122
30123/// ListNodePoolsResponse is the result of ListNodePoolsRequest.
30124#[derive(Clone, Default, PartialEq)]
30125#[non_exhaustive]
30126pub struct ListNodePoolsResponse {
30127 /// A list of node pools for a cluster.
30128 pub node_pools: std::vec::Vec<crate::model::NodePool>,
30129
30130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30131}
30132
30133impl ListNodePoolsResponse {
30134 /// Creates a new default instance.
30135 pub fn new() -> Self {
30136 std::default::Default::default()
30137 }
30138
30139 /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
30140 ///
30141 /// # Example
30142 /// ```ignore,no_run
30143 /// # use google_cloud_container_v1::model::ListNodePoolsResponse;
30144 /// use google_cloud_container_v1::model::NodePool;
30145 /// let x = ListNodePoolsResponse::new()
30146 /// .set_node_pools([
30147 /// NodePool::default()/* use setters */,
30148 /// NodePool::default()/* use (different) setters */,
30149 /// ]);
30150 /// ```
30151 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
30152 where
30153 T: std::iter::IntoIterator<Item = V>,
30154 V: std::convert::Into<crate::model::NodePool>,
30155 {
30156 use std::iter::Iterator;
30157 self.node_pools = v.into_iter().map(|i| i.into()).collect();
30158 self
30159 }
30160}
30161
30162impl wkt::message::Message for ListNodePoolsResponse {
30163 fn typename() -> &'static str {
30164 "type.googleapis.com/google.container.v1.ListNodePoolsResponse"
30165 }
30166}
30167
30168/// ClusterAutoscaling contains global, per-cluster information
30169/// required by Cluster Autoscaler to automatically adjust
30170/// the size of the cluster and create/delete
30171/// node pools based on the current needs.
30172#[derive(Clone, Default, PartialEq)]
30173#[non_exhaustive]
30174pub struct ClusterAutoscaling {
30175 /// Enables automatic node pool creation and deletion.
30176 pub enable_node_autoprovisioning: bool,
30177
30178 /// Contains global constraints regarding minimum and maximum
30179 /// amount of resources in the cluster.
30180 pub resource_limits: std::vec::Vec<crate::model::ResourceLimit>,
30181
30182 /// Defines autoscaling behaviour.
30183 pub autoscaling_profile: crate::model::cluster_autoscaling::AutoscalingProfile,
30184
30185 /// AutoprovisioningNodePoolDefaults contains defaults for a node pool
30186 /// created by NAP.
30187 pub autoprovisioning_node_pool_defaults:
30188 std::option::Option<crate::model::AutoprovisioningNodePoolDefaults>,
30189
30190 /// The list of Google Compute Engine
30191 /// [zones](https://cloud.google.com/compute/docs/zones#available)
30192 /// in which the NodePool's nodes can be created by NAP.
30193 pub autoprovisioning_locations: std::vec::Vec<std::string::String>,
30194
30195 /// Default compute class is a configuration for default compute class.
30196 pub default_compute_class_config: std::option::Option<crate::model::DefaultComputeClassConfig>,
30197
30198 /// Autopilot general profile for the cluster, which defines the
30199 /// configuration for the cluster.
30200 pub autopilot_general_profile: crate::model::cluster_autoscaling::AutopilotGeneralProfile,
30201
30202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30203}
30204
30205impl ClusterAutoscaling {
30206 /// Creates a new default instance.
30207 pub fn new() -> Self {
30208 std::default::Default::default()
30209 }
30210
30211 /// Sets the value of [enable_node_autoprovisioning][crate::model::ClusterAutoscaling::enable_node_autoprovisioning].
30212 ///
30213 /// # Example
30214 /// ```ignore,no_run
30215 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30216 /// let x = ClusterAutoscaling::new().set_enable_node_autoprovisioning(true);
30217 /// ```
30218 pub fn set_enable_node_autoprovisioning<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30219 self.enable_node_autoprovisioning = v.into();
30220 self
30221 }
30222
30223 /// Sets the value of [resource_limits][crate::model::ClusterAutoscaling::resource_limits].
30224 ///
30225 /// # Example
30226 /// ```ignore,no_run
30227 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30228 /// use google_cloud_container_v1::model::ResourceLimit;
30229 /// let x = ClusterAutoscaling::new()
30230 /// .set_resource_limits([
30231 /// ResourceLimit::default()/* use setters */,
30232 /// ResourceLimit::default()/* use (different) setters */,
30233 /// ]);
30234 /// ```
30235 pub fn set_resource_limits<T, V>(mut self, v: T) -> Self
30236 where
30237 T: std::iter::IntoIterator<Item = V>,
30238 V: std::convert::Into<crate::model::ResourceLimit>,
30239 {
30240 use std::iter::Iterator;
30241 self.resource_limits = v.into_iter().map(|i| i.into()).collect();
30242 self
30243 }
30244
30245 /// Sets the value of [autoscaling_profile][crate::model::ClusterAutoscaling::autoscaling_profile].
30246 ///
30247 /// # Example
30248 /// ```ignore,no_run
30249 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30250 /// use google_cloud_container_v1::model::cluster_autoscaling::AutoscalingProfile;
30251 /// let x0 = ClusterAutoscaling::new().set_autoscaling_profile(AutoscalingProfile::OptimizeUtilization);
30252 /// let x1 = ClusterAutoscaling::new().set_autoscaling_profile(AutoscalingProfile::Balanced);
30253 /// ```
30254 pub fn set_autoscaling_profile<
30255 T: std::convert::Into<crate::model::cluster_autoscaling::AutoscalingProfile>,
30256 >(
30257 mut self,
30258 v: T,
30259 ) -> Self {
30260 self.autoscaling_profile = v.into();
30261 self
30262 }
30263
30264 /// Sets the value of [autoprovisioning_node_pool_defaults][crate::model::ClusterAutoscaling::autoprovisioning_node_pool_defaults].
30265 ///
30266 /// # Example
30267 /// ```ignore,no_run
30268 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30269 /// use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30270 /// let x = ClusterAutoscaling::new().set_autoprovisioning_node_pool_defaults(AutoprovisioningNodePoolDefaults::default()/* use setters */);
30271 /// ```
30272 pub fn set_autoprovisioning_node_pool_defaults<T>(mut self, v: T) -> Self
30273 where
30274 T: std::convert::Into<crate::model::AutoprovisioningNodePoolDefaults>,
30275 {
30276 self.autoprovisioning_node_pool_defaults = std::option::Option::Some(v.into());
30277 self
30278 }
30279
30280 /// Sets or clears the value of [autoprovisioning_node_pool_defaults][crate::model::ClusterAutoscaling::autoprovisioning_node_pool_defaults].
30281 ///
30282 /// # Example
30283 /// ```ignore,no_run
30284 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30285 /// use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30286 /// let x = ClusterAutoscaling::new().set_or_clear_autoprovisioning_node_pool_defaults(Some(AutoprovisioningNodePoolDefaults::default()/* use setters */));
30287 /// let x = ClusterAutoscaling::new().set_or_clear_autoprovisioning_node_pool_defaults(None::<AutoprovisioningNodePoolDefaults>);
30288 /// ```
30289 pub fn set_or_clear_autoprovisioning_node_pool_defaults<T>(
30290 mut self,
30291 v: std::option::Option<T>,
30292 ) -> Self
30293 where
30294 T: std::convert::Into<crate::model::AutoprovisioningNodePoolDefaults>,
30295 {
30296 self.autoprovisioning_node_pool_defaults = v.map(|x| x.into());
30297 self
30298 }
30299
30300 /// Sets the value of [autoprovisioning_locations][crate::model::ClusterAutoscaling::autoprovisioning_locations].
30301 ///
30302 /// # Example
30303 /// ```ignore,no_run
30304 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30305 /// let x = ClusterAutoscaling::new().set_autoprovisioning_locations(["a", "b", "c"]);
30306 /// ```
30307 pub fn set_autoprovisioning_locations<T, V>(mut self, v: T) -> Self
30308 where
30309 T: std::iter::IntoIterator<Item = V>,
30310 V: std::convert::Into<std::string::String>,
30311 {
30312 use std::iter::Iterator;
30313 self.autoprovisioning_locations = v.into_iter().map(|i| i.into()).collect();
30314 self
30315 }
30316
30317 /// Sets the value of [default_compute_class_config][crate::model::ClusterAutoscaling::default_compute_class_config].
30318 ///
30319 /// # Example
30320 /// ```ignore,no_run
30321 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30322 /// use google_cloud_container_v1::model::DefaultComputeClassConfig;
30323 /// let x = ClusterAutoscaling::new().set_default_compute_class_config(DefaultComputeClassConfig::default()/* use setters */);
30324 /// ```
30325 pub fn set_default_compute_class_config<T>(mut self, v: T) -> Self
30326 where
30327 T: std::convert::Into<crate::model::DefaultComputeClassConfig>,
30328 {
30329 self.default_compute_class_config = std::option::Option::Some(v.into());
30330 self
30331 }
30332
30333 /// Sets or clears the value of [default_compute_class_config][crate::model::ClusterAutoscaling::default_compute_class_config].
30334 ///
30335 /// # Example
30336 /// ```ignore,no_run
30337 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30338 /// use google_cloud_container_v1::model::DefaultComputeClassConfig;
30339 /// let x = ClusterAutoscaling::new().set_or_clear_default_compute_class_config(Some(DefaultComputeClassConfig::default()/* use setters */));
30340 /// let x = ClusterAutoscaling::new().set_or_clear_default_compute_class_config(None::<DefaultComputeClassConfig>);
30341 /// ```
30342 pub fn set_or_clear_default_compute_class_config<T>(mut self, v: std::option::Option<T>) -> Self
30343 where
30344 T: std::convert::Into<crate::model::DefaultComputeClassConfig>,
30345 {
30346 self.default_compute_class_config = v.map(|x| x.into());
30347 self
30348 }
30349
30350 /// Sets the value of [autopilot_general_profile][crate::model::ClusterAutoscaling::autopilot_general_profile].
30351 ///
30352 /// # Example
30353 /// ```ignore,no_run
30354 /// # use google_cloud_container_v1::model::ClusterAutoscaling;
30355 /// use google_cloud_container_v1::model::cluster_autoscaling::AutopilotGeneralProfile;
30356 /// let x0 = ClusterAutoscaling::new().set_autopilot_general_profile(AutopilotGeneralProfile::NoPerformance);
30357 /// let x1 = ClusterAutoscaling::new().set_autopilot_general_profile(AutopilotGeneralProfile::None);
30358 /// ```
30359 pub fn set_autopilot_general_profile<
30360 T: std::convert::Into<crate::model::cluster_autoscaling::AutopilotGeneralProfile>,
30361 >(
30362 mut self,
30363 v: T,
30364 ) -> Self {
30365 self.autopilot_general_profile = v.into();
30366 self
30367 }
30368}
30369
30370impl wkt::message::Message for ClusterAutoscaling {
30371 fn typename() -> &'static str {
30372 "type.googleapis.com/google.container.v1.ClusterAutoscaling"
30373 }
30374}
30375
30376/// Defines additional types related to [ClusterAutoscaling].
30377pub mod cluster_autoscaling {
30378 #[allow(unused_imports)]
30379 use super::*;
30380
30381 /// Defines possible options for autoscaling_profile field.
30382 ///
30383 /// # Working with unknown values
30384 ///
30385 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30386 /// additional enum variants at any time. Adding new variants is not considered
30387 /// a breaking change. Applications should write their code in anticipation of:
30388 ///
30389 /// - New values appearing in future releases of the client library, **and**
30390 /// - New values received dynamically, without application changes.
30391 ///
30392 /// Please consult the [Working with enums] section in the user guide for some
30393 /// guidelines.
30394 ///
30395 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30396 #[derive(Clone, Debug, PartialEq)]
30397 #[non_exhaustive]
30398 pub enum AutoscalingProfile {
30399 /// No change to autoscaling configuration.
30400 ProfileUnspecified,
30401 /// Prioritize optimizing utilization of resources.
30402 OptimizeUtilization,
30403 /// Use default (balanced) autoscaling configuration.
30404 Balanced,
30405 /// If set, the enum was initialized with an unknown value.
30406 ///
30407 /// Applications can examine the value using [AutoscalingProfile::value] or
30408 /// [AutoscalingProfile::name].
30409 UnknownValue(autoscaling_profile::UnknownValue),
30410 }
30411
30412 #[doc(hidden)]
30413 pub mod autoscaling_profile {
30414 #[allow(unused_imports)]
30415 use super::*;
30416 #[derive(Clone, Debug, PartialEq)]
30417 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30418 }
30419
30420 impl AutoscalingProfile {
30421 /// Gets the enum value.
30422 ///
30423 /// Returns `None` if the enum contains an unknown value deserialized from
30424 /// the string representation of enums.
30425 pub fn value(&self) -> std::option::Option<i32> {
30426 match self {
30427 Self::ProfileUnspecified => std::option::Option::Some(0),
30428 Self::OptimizeUtilization => std::option::Option::Some(1),
30429 Self::Balanced => std::option::Option::Some(2),
30430 Self::UnknownValue(u) => u.0.value(),
30431 }
30432 }
30433
30434 /// Gets the enum value as a string.
30435 ///
30436 /// Returns `None` if the enum contains an unknown value deserialized from
30437 /// the integer representation of enums.
30438 pub fn name(&self) -> std::option::Option<&str> {
30439 match self {
30440 Self::ProfileUnspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
30441 Self::OptimizeUtilization => std::option::Option::Some("OPTIMIZE_UTILIZATION"),
30442 Self::Balanced => std::option::Option::Some("BALANCED"),
30443 Self::UnknownValue(u) => u.0.name(),
30444 }
30445 }
30446 }
30447
30448 impl std::default::Default for AutoscalingProfile {
30449 fn default() -> Self {
30450 use std::convert::From;
30451 Self::from(0)
30452 }
30453 }
30454
30455 impl std::fmt::Display for AutoscalingProfile {
30456 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30457 wkt::internal::display_enum(f, self.name(), self.value())
30458 }
30459 }
30460
30461 impl std::convert::From<i32> for AutoscalingProfile {
30462 fn from(value: i32) -> Self {
30463 match value {
30464 0 => Self::ProfileUnspecified,
30465 1 => Self::OptimizeUtilization,
30466 2 => Self::Balanced,
30467 _ => Self::UnknownValue(autoscaling_profile::UnknownValue(
30468 wkt::internal::UnknownEnumValue::Integer(value),
30469 )),
30470 }
30471 }
30472 }
30473
30474 impl std::convert::From<&str> for AutoscalingProfile {
30475 fn from(value: &str) -> Self {
30476 use std::string::ToString;
30477 match value {
30478 "PROFILE_UNSPECIFIED" => Self::ProfileUnspecified,
30479 "OPTIMIZE_UTILIZATION" => Self::OptimizeUtilization,
30480 "BALANCED" => Self::Balanced,
30481 _ => Self::UnknownValue(autoscaling_profile::UnknownValue(
30482 wkt::internal::UnknownEnumValue::String(value.to_string()),
30483 )),
30484 }
30485 }
30486 }
30487
30488 impl serde::ser::Serialize for AutoscalingProfile {
30489 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30490 where
30491 S: serde::Serializer,
30492 {
30493 match self {
30494 Self::ProfileUnspecified => serializer.serialize_i32(0),
30495 Self::OptimizeUtilization => serializer.serialize_i32(1),
30496 Self::Balanced => serializer.serialize_i32(2),
30497 Self::UnknownValue(u) => u.0.serialize(serializer),
30498 }
30499 }
30500 }
30501
30502 impl<'de> serde::de::Deserialize<'de> for AutoscalingProfile {
30503 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30504 where
30505 D: serde::Deserializer<'de>,
30506 {
30507 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoscalingProfile>::new(
30508 ".google.container.v1.ClusterAutoscaling.AutoscalingProfile",
30509 ))
30510 }
30511 }
30512
30513 /// Defines possible options for Autopilot general profile.
30514 ///
30515 /// # Working with unknown values
30516 ///
30517 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30518 /// additional enum variants at any time. Adding new variants is not considered
30519 /// a breaking change. Applications should write their code in anticipation of:
30520 ///
30521 /// - New values appearing in future releases of the client library, **and**
30522 /// - New values received dynamically, without application changes.
30523 ///
30524 /// Please consult the [Working with enums] section in the user guide for some
30525 /// guidelines.
30526 ///
30527 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30528 #[derive(Clone, Debug, PartialEq)]
30529 #[non_exhaustive]
30530 pub enum AutopilotGeneralProfile {
30531 /// Use default configuration.
30532 Unspecified,
30533 /// Avoid extra IP consumption.
30534 NoPerformance,
30535 /// Use default configuration.
30536 None,
30537 /// If set, the enum was initialized with an unknown value.
30538 ///
30539 /// Applications can examine the value using [AutopilotGeneralProfile::value] or
30540 /// [AutopilotGeneralProfile::name].
30541 UnknownValue(autopilot_general_profile::UnknownValue),
30542 }
30543
30544 #[doc(hidden)]
30545 pub mod autopilot_general_profile {
30546 #[allow(unused_imports)]
30547 use super::*;
30548 #[derive(Clone, Debug, PartialEq)]
30549 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30550 }
30551
30552 impl AutopilotGeneralProfile {
30553 /// Gets the enum value.
30554 ///
30555 /// Returns `None` if the enum contains an unknown value deserialized from
30556 /// the string representation of enums.
30557 pub fn value(&self) -> std::option::Option<i32> {
30558 match self {
30559 Self::Unspecified => std::option::Option::Some(0),
30560 Self::NoPerformance => std::option::Option::Some(1),
30561 Self::None => std::option::Option::Some(2),
30562 Self::UnknownValue(u) => u.0.value(),
30563 }
30564 }
30565
30566 /// Gets the enum value as a string.
30567 ///
30568 /// Returns `None` if the enum contains an unknown value deserialized from
30569 /// the integer representation of enums.
30570 pub fn name(&self) -> std::option::Option<&str> {
30571 match self {
30572 Self::Unspecified => {
30573 std::option::Option::Some("AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED")
30574 }
30575 Self::NoPerformance => std::option::Option::Some("NO_PERFORMANCE"),
30576 Self::None => std::option::Option::Some("NONE"),
30577 Self::UnknownValue(u) => u.0.name(),
30578 }
30579 }
30580 }
30581
30582 impl std::default::Default for AutopilotGeneralProfile {
30583 fn default() -> Self {
30584 use std::convert::From;
30585 Self::from(0)
30586 }
30587 }
30588
30589 impl std::fmt::Display for AutopilotGeneralProfile {
30590 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30591 wkt::internal::display_enum(f, self.name(), self.value())
30592 }
30593 }
30594
30595 impl std::convert::From<i32> for AutopilotGeneralProfile {
30596 fn from(value: i32) -> Self {
30597 match value {
30598 0 => Self::Unspecified,
30599 1 => Self::NoPerformance,
30600 2 => Self::None,
30601 _ => Self::UnknownValue(autopilot_general_profile::UnknownValue(
30602 wkt::internal::UnknownEnumValue::Integer(value),
30603 )),
30604 }
30605 }
30606 }
30607
30608 impl std::convert::From<&str> for AutopilotGeneralProfile {
30609 fn from(value: &str) -> Self {
30610 use std::string::ToString;
30611 match value {
30612 "AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED" => Self::Unspecified,
30613 "NO_PERFORMANCE" => Self::NoPerformance,
30614 "NONE" => Self::None,
30615 _ => Self::UnknownValue(autopilot_general_profile::UnknownValue(
30616 wkt::internal::UnknownEnumValue::String(value.to_string()),
30617 )),
30618 }
30619 }
30620 }
30621
30622 impl serde::ser::Serialize for AutopilotGeneralProfile {
30623 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30624 where
30625 S: serde::Serializer,
30626 {
30627 match self {
30628 Self::Unspecified => serializer.serialize_i32(0),
30629 Self::NoPerformance => serializer.serialize_i32(1),
30630 Self::None => serializer.serialize_i32(2),
30631 Self::UnknownValue(u) => u.0.serialize(serializer),
30632 }
30633 }
30634 }
30635
30636 impl<'de> serde::de::Deserialize<'de> for AutopilotGeneralProfile {
30637 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30638 where
30639 D: serde::Deserializer<'de>,
30640 {
30641 deserializer.deserialize_any(
30642 wkt::internal::EnumVisitor::<AutopilotGeneralProfile>::new(
30643 ".google.container.v1.ClusterAutoscaling.AutopilotGeneralProfile",
30644 ),
30645 )
30646 }
30647 }
30648}
30649
30650/// AutoprovisioningNodePoolDefaults contains defaults for a node pool created
30651/// by NAP.
30652#[derive(Clone, Default, PartialEq)]
30653#[non_exhaustive]
30654pub struct AutoprovisioningNodePoolDefaults {
30655 /// Scopes that are used by NAP when creating node pools.
30656 pub oauth_scopes: std::vec::Vec<std::string::String>,
30657
30658 /// The Google Cloud Platform Service Account to be used by the node VMs.
30659 pub service_account: std::string::String,
30660
30661 /// Specifies the upgrade settings for NAP created node pools
30662 pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
30663
30664 /// Specifies the node management options for NAP created node-pools.
30665 pub management: std::option::Option<crate::model::NodeManagement>,
30666
30667 /// Deprecated. Minimum CPU platform to be used for NAP created node pools.
30668 /// The instance may be scheduled on the specified or newer CPU platform.
30669 /// Applicable values are the friendly names of CPU platforms, such as
30670 /// minCpuPlatform: Intel Haswell or
30671 /// minCpuPlatform: Intel Sandy Bridge. For more
30672 /// information, read [how to specify min CPU
30673 /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
30674 /// This field is deprecated, min_cpu_platform should be specified using
30675 /// `cloud.google.com/requested-min-cpu-platform` label selector on the pod.
30676 /// To unset the min cpu platform field pass "automatic"
30677 /// as field value.
30678 #[deprecated]
30679 pub min_cpu_platform: std::string::String,
30680
30681 /// Size of the disk attached to each node, specified in GB.
30682 /// The smallest allowed disk size is 10GB.
30683 ///
30684 /// If unspecified, the default disk size is 100GB.
30685 pub disk_size_gb: i32,
30686
30687 /// Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or
30688 /// 'pd-balanced')
30689 ///
30690 /// If unspecified, the default disk type is 'pd-standard'
30691 pub disk_type: std::string::String,
30692
30693 /// Shielded Instance options.
30694 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
30695
30696 /// The Customer Managed Encryption Key used to encrypt the boot disk attached
30697 /// to each node in the node pool. This should be of the form
30698 /// projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
30699 /// For more information about protecting resources with Cloud KMS Keys please
30700 /// see:
30701 /// <https://cloud.google.com/compute/docs/disks/customer-managed-encryption>
30702 pub boot_disk_kms_key: std::string::String,
30703
30704 /// The image type to use for NAP created node. Please see
30705 /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
30706 /// for available image types.
30707 pub image_type: std::string::String,
30708
30709 /// DEPRECATED. Use NodePoolAutoConfig.NodeKubeletConfig instead.
30710 pub insecure_kubelet_readonly_port_enabled: std::option::Option<bool>,
30711
30712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30713}
30714
30715impl AutoprovisioningNodePoolDefaults {
30716 /// Creates a new default instance.
30717 pub fn new() -> Self {
30718 std::default::Default::default()
30719 }
30720
30721 /// Sets the value of [oauth_scopes][crate::model::AutoprovisioningNodePoolDefaults::oauth_scopes].
30722 ///
30723 /// # Example
30724 /// ```ignore,no_run
30725 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30726 /// let x = AutoprovisioningNodePoolDefaults::new().set_oauth_scopes(["a", "b", "c"]);
30727 /// ```
30728 pub fn set_oauth_scopes<T, V>(mut self, v: T) -> Self
30729 where
30730 T: std::iter::IntoIterator<Item = V>,
30731 V: std::convert::Into<std::string::String>,
30732 {
30733 use std::iter::Iterator;
30734 self.oauth_scopes = v.into_iter().map(|i| i.into()).collect();
30735 self
30736 }
30737
30738 /// Sets the value of [service_account][crate::model::AutoprovisioningNodePoolDefaults::service_account].
30739 ///
30740 /// # Example
30741 /// ```ignore,no_run
30742 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30743 /// let x = AutoprovisioningNodePoolDefaults::new().set_service_account("example");
30744 /// ```
30745 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30746 self.service_account = v.into();
30747 self
30748 }
30749
30750 /// Sets the value of [upgrade_settings][crate::model::AutoprovisioningNodePoolDefaults::upgrade_settings].
30751 ///
30752 /// # Example
30753 /// ```ignore,no_run
30754 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30755 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
30756 /// let x = AutoprovisioningNodePoolDefaults::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
30757 /// ```
30758 pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
30759 where
30760 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
30761 {
30762 self.upgrade_settings = std::option::Option::Some(v.into());
30763 self
30764 }
30765
30766 /// Sets or clears the value of [upgrade_settings][crate::model::AutoprovisioningNodePoolDefaults::upgrade_settings].
30767 ///
30768 /// # Example
30769 /// ```ignore,no_run
30770 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30771 /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
30772 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
30773 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
30774 /// ```
30775 pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
30776 where
30777 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
30778 {
30779 self.upgrade_settings = v.map(|x| x.into());
30780 self
30781 }
30782
30783 /// Sets the value of [management][crate::model::AutoprovisioningNodePoolDefaults::management].
30784 ///
30785 /// # Example
30786 /// ```ignore,no_run
30787 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30788 /// use google_cloud_container_v1::model::NodeManagement;
30789 /// let x = AutoprovisioningNodePoolDefaults::new().set_management(NodeManagement::default()/* use setters */);
30790 /// ```
30791 pub fn set_management<T>(mut self, v: T) -> Self
30792 where
30793 T: std::convert::Into<crate::model::NodeManagement>,
30794 {
30795 self.management = std::option::Option::Some(v.into());
30796 self
30797 }
30798
30799 /// Sets or clears the value of [management][crate::model::AutoprovisioningNodePoolDefaults::management].
30800 ///
30801 /// # Example
30802 /// ```ignore,no_run
30803 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30804 /// use google_cloud_container_v1::model::NodeManagement;
30805 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
30806 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_management(None::<NodeManagement>);
30807 /// ```
30808 pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
30809 where
30810 T: std::convert::Into<crate::model::NodeManagement>,
30811 {
30812 self.management = v.map(|x| x.into());
30813 self
30814 }
30815
30816 /// Sets the value of [min_cpu_platform][crate::model::AutoprovisioningNodePoolDefaults::min_cpu_platform].
30817 ///
30818 /// # Example
30819 /// ```ignore,no_run
30820 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30821 /// let x = AutoprovisioningNodePoolDefaults::new().set_min_cpu_platform("example");
30822 /// ```
30823 #[deprecated]
30824 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
30825 mut self,
30826 v: T,
30827 ) -> Self {
30828 self.min_cpu_platform = v.into();
30829 self
30830 }
30831
30832 /// Sets the value of [disk_size_gb][crate::model::AutoprovisioningNodePoolDefaults::disk_size_gb].
30833 ///
30834 /// # Example
30835 /// ```ignore,no_run
30836 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30837 /// let x = AutoprovisioningNodePoolDefaults::new().set_disk_size_gb(42);
30838 /// ```
30839 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
30840 self.disk_size_gb = v.into();
30841 self
30842 }
30843
30844 /// Sets the value of [disk_type][crate::model::AutoprovisioningNodePoolDefaults::disk_type].
30845 ///
30846 /// # Example
30847 /// ```ignore,no_run
30848 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30849 /// let x = AutoprovisioningNodePoolDefaults::new().set_disk_type("example");
30850 /// ```
30851 pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30852 self.disk_type = v.into();
30853 self
30854 }
30855
30856 /// Sets the value of [shielded_instance_config][crate::model::AutoprovisioningNodePoolDefaults::shielded_instance_config].
30857 ///
30858 /// # Example
30859 /// ```ignore,no_run
30860 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30861 /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
30862 /// let x = AutoprovisioningNodePoolDefaults::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
30863 /// ```
30864 pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
30865 where
30866 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
30867 {
30868 self.shielded_instance_config = std::option::Option::Some(v.into());
30869 self
30870 }
30871
30872 /// Sets or clears the value of [shielded_instance_config][crate::model::AutoprovisioningNodePoolDefaults::shielded_instance_config].
30873 ///
30874 /// # Example
30875 /// ```ignore,no_run
30876 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30877 /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
30878 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
30879 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
30880 /// ```
30881 pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
30882 where
30883 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
30884 {
30885 self.shielded_instance_config = v.map(|x| x.into());
30886 self
30887 }
30888
30889 /// Sets the value of [boot_disk_kms_key][crate::model::AutoprovisioningNodePoolDefaults::boot_disk_kms_key].
30890 ///
30891 /// # Example
30892 /// ```ignore,no_run
30893 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30894 /// let x = AutoprovisioningNodePoolDefaults::new().set_boot_disk_kms_key("example");
30895 /// ```
30896 pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
30897 mut self,
30898 v: T,
30899 ) -> Self {
30900 self.boot_disk_kms_key = v.into();
30901 self
30902 }
30903
30904 /// Sets the value of [image_type][crate::model::AutoprovisioningNodePoolDefaults::image_type].
30905 ///
30906 /// # Example
30907 /// ```ignore,no_run
30908 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30909 /// let x = AutoprovisioningNodePoolDefaults::new().set_image_type("example");
30910 /// ```
30911 pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30912 self.image_type = v.into();
30913 self
30914 }
30915
30916 /// Sets the value of [insecure_kubelet_readonly_port_enabled][crate::model::AutoprovisioningNodePoolDefaults::insecure_kubelet_readonly_port_enabled].
30917 ///
30918 /// # Example
30919 /// ```ignore,no_run
30920 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30921 /// let x = AutoprovisioningNodePoolDefaults::new().set_insecure_kubelet_readonly_port_enabled(true);
30922 /// ```
30923 pub fn set_insecure_kubelet_readonly_port_enabled<T>(mut self, v: T) -> Self
30924 where
30925 T: std::convert::Into<bool>,
30926 {
30927 self.insecure_kubelet_readonly_port_enabled = std::option::Option::Some(v.into());
30928 self
30929 }
30930
30931 /// Sets or clears the value of [insecure_kubelet_readonly_port_enabled][crate::model::AutoprovisioningNodePoolDefaults::insecure_kubelet_readonly_port_enabled].
30932 ///
30933 /// # Example
30934 /// ```ignore,no_run
30935 /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
30936 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_insecure_kubelet_readonly_port_enabled(Some(false));
30937 /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_insecure_kubelet_readonly_port_enabled(None::<bool>);
30938 /// ```
30939 pub fn set_or_clear_insecure_kubelet_readonly_port_enabled<T>(
30940 mut self,
30941 v: std::option::Option<T>,
30942 ) -> Self
30943 where
30944 T: std::convert::Into<bool>,
30945 {
30946 self.insecure_kubelet_readonly_port_enabled = v.map(|x| x.into());
30947 self
30948 }
30949}
30950
30951impl wkt::message::Message for AutoprovisioningNodePoolDefaults {
30952 fn typename() -> &'static str {
30953 "type.googleapis.com/google.container.v1.AutoprovisioningNodePoolDefaults"
30954 }
30955}
30956
30957/// Contains information about amount of some resource in the cluster.
30958/// For memory, value should be in GB.
30959#[derive(Clone, Default, PartialEq)]
30960#[non_exhaustive]
30961pub struct ResourceLimit {
30962 /// Resource name "cpu", "memory" or gpu-specific string.
30963 pub resource_type: std::string::String,
30964
30965 /// Minimum amount of the resource in the cluster.
30966 pub minimum: i64,
30967
30968 /// Maximum amount of the resource in the cluster.
30969 pub maximum: i64,
30970
30971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30972}
30973
30974impl ResourceLimit {
30975 /// Creates a new default instance.
30976 pub fn new() -> Self {
30977 std::default::Default::default()
30978 }
30979
30980 /// Sets the value of [resource_type][crate::model::ResourceLimit::resource_type].
30981 ///
30982 /// # Example
30983 /// ```ignore,no_run
30984 /// # use google_cloud_container_v1::model::ResourceLimit;
30985 /// let x = ResourceLimit::new().set_resource_type("example");
30986 /// ```
30987 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30988 self.resource_type = v.into();
30989 self
30990 }
30991
30992 /// Sets the value of [minimum][crate::model::ResourceLimit::minimum].
30993 ///
30994 /// # Example
30995 /// ```ignore,no_run
30996 /// # use google_cloud_container_v1::model::ResourceLimit;
30997 /// let x = ResourceLimit::new().set_minimum(42);
30998 /// ```
30999 pub fn set_minimum<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31000 self.minimum = v.into();
31001 self
31002 }
31003
31004 /// Sets the value of [maximum][crate::model::ResourceLimit::maximum].
31005 ///
31006 /// # Example
31007 /// ```ignore,no_run
31008 /// # use google_cloud_container_v1::model::ResourceLimit;
31009 /// let x = ResourceLimit::new().set_maximum(42);
31010 /// ```
31011 pub fn set_maximum<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31012 self.maximum = v.into();
31013 self
31014 }
31015}
31016
31017impl wkt::message::Message for ResourceLimit {
31018 fn typename() -> &'static str {
31019 "type.googleapis.com/google.container.v1.ResourceLimit"
31020 }
31021}
31022
31023/// DefaultComputeClassConfig defines default compute class
31024/// configuration.
31025#[derive(Clone, Default, PartialEq)]
31026#[non_exhaustive]
31027pub struct DefaultComputeClassConfig {
31028 /// Enables default compute class.
31029 pub enabled: bool,
31030
31031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31032}
31033
31034impl DefaultComputeClassConfig {
31035 /// Creates a new default instance.
31036 pub fn new() -> Self {
31037 std::default::Default::default()
31038 }
31039
31040 /// Sets the value of [enabled][crate::model::DefaultComputeClassConfig::enabled].
31041 ///
31042 /// # Example
31043 /// ```ignore,no_run
31044 /// # use google_cloud_container_v1::model::DefaultComputeClassConfig;
31045 /// let x = DefaultComputeClassConfig::new().set_enabled(true);
31046 /// ```
31047 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31048 self.enabled = v.into();
31049 self
31050 }
31051}
31052
31053impl wkt::message::Message for DefaultComputeClassConfig {
31054 fn typename() -> &'static str {
31055 "type.googleapis.com/google.container.v1.DefaultComputeClassConfig"
31056 }
31057}
31058
31059/// NodePoolAutoscaling contains information required by cluster autoscaler to
31060/// adjust the size of the node pool to the current cluster usage.
31061#[derive(Clone, Default, PartialEq)]
31062#[non_exhaustive]
31063pub struct NodePoolAutoscaling {
31064 /// Is autoscaling enabled for this node pool.
31065 pub enabled: bool,
31066
31067 /// Minimum number of nodes for one location in the node pool. Must be greater
31068 /// than or equal to 0 and less than or equal to max_node_count.
31069 pub min_node_count: i32,
31070
31071 /// Maximum number of nodes for one location in the node pool. Must be >=
31072 /// min_node_count. There has to be enough quota to scale up the cluster.
31073 pub max_node_count: i32,
31074
31075 /// Can this node pool be deleted automatically.
31076 pub autoprovisioned: bool,
31077
31078 /// Location policy used when scaling up a node pool.
31079 pub location_policy: crate::model::node_pool_autoscaling::LocationPolicy,
31080
31081 /// Minimum number of nodes in the node pool. Must be greater than or equal
31082 /// to 0 and less than or equal to total_max_node_count.
31083 /// The total_*_node_count fields are mutually exclusive with the *_node_count
31084 /// fields.
31085 pub total_min_node_count: i32,
31086
31087 /// Maximum number of nodes in the node pool. Must be greater than or equal to
31088 /// total_min_node_count. There has to be enough quota to scale up the cluster.
31089 /// The total_*_node_count fields are mutually exclusive with the *_node_count
31090 /// fields.
31091 pub total_max_node_count: i32,
31092
31093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31094}
31095
31096impl NodePoolAutoscaling {
31097 /// Creates a new default instance.
31098 pub fn new() -> Self {
31099 std::default::Default::default()
31100 }
31101
31102 /// Sets the value of [enabled][crate::model::NodePoolAutoscaling::enabled].
31103 ///
31104 /// # Example
31105 /// ```ignore,no_run
31106 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31107 /// let x = NodePoolAutoscaling::new().set_enabled(true);
31108 /// ```
31109 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31110 self.enabled = v.into();
31111 self
31112 }
31113
31114 /// Sets the value of [min_node_count][crate::model::NodePoolAutoscaling::min_node_count].
31115 ///
31116 /// # Example
31117 /// ```ignore,no_run
31118 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31119 /// let x = NodePoolAutoscaling::new().set_min_node_count(42);
31120 /// ```
31121 pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31122 self.min_node_count = v.into();
31123 self
31124 }
31125
31126 /// Sets the value of [max_node_count][crate::model::NodePoolAutoscaling::max_node_count].
31127 ///
31128 /// # Example
31129 /// ```ignore,no_run
31130 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31131 /// let x = NodePoolAutoscaling::new().set_max_node_count(42);
31132 /// ```
31133 pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31134 self.max_node_count = v.into();
31135 self
31136 }
31137
31138 /// Sets the value of [autoprovisioned][crate::model::NodePoolAutoscaling::autoprovisioned].
31139 ///
31140 /// # Example
31141 /// ```ignore,no_run
31142 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31143 /// let x = NodePoolAutoscaling::new().set_autoprovisioned(true);
31144 /// ```
31145 pub fn set_autoprovisioned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31146 self.autoprovisioned = v.into();
31147 self
31148 }
31149
31150 /// Sets the value of [location_policy][crate::model::NodePoolAutoscaling::location_policy].
31151 ///
31152 /// # Example
31153 /// ```ignore,no_run
31154 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31155 /// use google_cloud_container_v1::model::node_pool_autoscaling::LocationPolicy;
31156 /// let x0 = NodePoolAutoscaling::new().set_location_policy(LocationPolicy::Balanced);
31157 /// let x1 = NodePoolAutoscaling::new().set_location_policy(LocationPolicy::Any);
31158 /// ```
31159 pub fn set_location_policy<
31160 T: std::convert::Into<crate::model::node_pool_autoscaling::LocationPolicy>,
31161 >(
31162 mut self,
31163 v: T,
31164 ) -> Self {
31165 self.location_policy = v.into();
31166 self
31167 }
31168
31169 /// Sets the value of [total_min_node_count][crate::model::NodePoolAutoscaling::total_min_node_count].
31170 ///
31171 /// # Example
31172 /// ```ignore,no_run
31173 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31174 /// let x = NodePoolAutoscaling::new().set_total_min_node_count(42);
31175 /// ```
31176 pub fn set_total_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31177 self.total_min_node_count = v.into();
31178 self
31179 }
31180
31181 /// Sets the value of [total_max_node_count][crate::model::NodePoolAutoscaling::total_max_node_count].
31182 ///
31183 /// # Example
31184 /// ```ignore,no_run
31185 /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
31186 /// let x = NodePoolAutoscaling::new().set_total_max_node_count(42);
31187 /// ```
31188 pub fn set_total_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31189 self.total_max_node_count = v.into();
31190 self
31191 }
31192}
31193
31194impl wkt::message::Message for NodePoolAutoscaling {
31195 fn typename() -> &'static str {
31196 "type.googleapis.com/google.container.v1.NodePoolAutoscaling"
31197 }
31198}
31199
31200/// Defines additional types related to [NodePoolAutoscaling].
31201pub mod node_pool_autoscaling {
31202 #[allow(unused_imports)]
31203 use super::*;
31204
31205 /// Location policy specifies how zones are picked when scaling up the
31206 /// node pool.
31207 ///
31208 /// # Working with unknown values
31209 ///
31210 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31211 /// additional enum variants at any time. Adding new variants is not considered
31212 /// a breaking change. Applications should write their code in anticipation of:
31213 ///
31214 /// - New values appearing in future releases of the client library, **and**
31215 /// - New values received dynamically, without application changes.
31216 ///
31217 /// Please consult the [Working with enums] section in the user guide for some
31218 /// guidelines.
31219 ///
31220 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31221 #[derive(Clone, Debug, PartialEq)]
31222 #[non_exhaustive]
31223 pub enum LocationPolicy {
31224 /// Not set.
31225 Unspecified,
31226 /// BALANCED is a best effort policy that aims to balance the sizes of
31227 /// different zones.
31228 Balanced,
31229 /// ANY policy picks zones that have the highest capacity available.
31230 Any,
31231 /// If set, the enum was initialized with an unknown value.
31232 ///
31233 /// Applications can examine the value using [LocationPolicy::value] or
31234 /// [LocationPolicy::name].
31235 UnknownValue(location_policy::UnknownValue),
31236 }
31237
31238 #[doc(hidden)]
31239 pub mod location_policy {
31240 #[allow(unused_imports)]
31241 use super::*;
31242 #[derive(Clone, Debug, PartialEq)]
31243 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31244 }
31245
31246 impl LocationPolicy {
31247 /// Gets the enum value.
31248 ///
31249 /// Returns `None` if the enum contains an unknown value deserialized from
31250 /// the string representation of enums.
31251 pub fn value(&self) -> std::option::Option<i32> {
31252 match self {
31253 Self::Unspecified => std::option::Option::Some(0),
31254 Self::Balanced => std::option::Option::Some(1),
31255 Self::Any => std::option::Option::Some(2),
31256 Self::UnknownValue(u) => u.0.value(),
31257 }
31258 }
31259
31260 /// Gets the enum value as a string.
31261 ///
31262 /// Returns `None` if the enum contains an unknown value deserialized from
31263 /// the integer representation of enums.
31264 pub fn name(&self) -> std::option::Option<&str> {
31265 match self {
31266 Self::Unspecified => std::option::Option::Some("LOCATION_POLICY_UNSPECIFIED"),
31267 Self::Balanced => std::option::Option::Some("BALANCED"),
31268 Self::Any => std::option::Option::Some("ANY"),
31269 Self::UnknownValue(u) => u.0.name(),
31270 }
31271 }
31272 }
31273
31274 impl std::default::Default for LocationPolicy {
31275 fn default() -> Self {
31276 use std::convert::From;
31277 Self::from(0)
31278 }
31279 }
31280
31281 impl std::fmt::Display for LocationPolicy {
31282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31283 wkt::internal::display_enum(f, self.name(), self.value())
31284 }
31285 }
31286
31287 impl std::convert::From<i32> for LocationPolicy {
31288 fn from(value: i32) -> Self {
31289 match value {
31290 0 => Self::Unspecified,
31291 1 => Self::Balanced,
31292 2 => Self::Any,
31293 _ => Self::UnknownValue(location_policy::UnknownValue(
31294 wkt::internal::UnknownEnumValue::Integer(value),
31295 )),
31296 }
31297 }
31298 }
31299
31300 impl std::convert::From<&str> for LocationPolicy {
31301 fn from(value: &str) -> Self {
31302 use std::string::ToString;
31303 match value {
31304 "LOCATION_POLICY_UNSPECIFIED" => Self::Unspecified,
31305 "BALANCED" => Self::Balanced,
31306 "ANY" => Self::Any,
31307 _ => Self::UnknownValue(location_policy::UnknownValue(
31308 wkt::internal::UnknownEnumValue::String(value.to_string()),
31309 )),
31310 }
31311 }
31312 }
31313
31314 impl serde::ser::Serialize for LocationPolicy {
31315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31316 where
31317 S: serde::Serializer,
31318 {
31319 match self {
31320 Self::Unspecified => serializer.serialize_i32(0),
31321 Self::Balanced => serializer.serialize_i32(1),
31322 Self::Any => serializer.serialize_i32(2),
31323 Self::UnknownValue(u) => u.0.serialize(serializer),
31324 }
31325 }
31326 }
31327
31328 impl<'de> serde::de::Deserialize<'de> for LocationPolicy {
31329 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31330 where
31331 D: serde::Deserializer<'de>,
31332 {
31333 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationPolicy>::new(
31334 ".google.container.v1.NodePoolAutoscaling.LocationPolicy",
31335 ))
31336 }
31337 }
31338}
31339
31340/// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container
31341/// Engine cluster, which will in turn set them for Google Compute Engine
31342/// resources used by that cluster
31343#[derive(Clone, Default, PartialEq)]
31344#[non_exhaustive]
31345pub struct SetLabelsRequest {
31346 /// Deprecated. The Google Developers Console [project ID or project
31347 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
31348 /// This field has been deprecated and replaced by the name field.
31349 #[deprecated]
31350 pub project_id: std::string::String,
31351
31352 /// Deprecated. The name of the Google Compute Engine
31353 /// [zone](https://cloud.google.com/compute/docs/zones#available)
31354 /// in which the cluster resides. This field has been deprecated and replaced
31355 /// by the name field.
31356 #[deprecated]
31357 pub zone: std::string::String,
31358
31359 /// Deprecated. The name of the cluster.
31360 /// This field has been deprecated and replaced by the name field.
31361 #[deprecated]
31362 pub cluster_id: std::string::String,
31363
31364 /// Required. The labels to set for that cluster.
31365 pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
31366
31367 /// Required. The fingerprint of the previous set of labels for this resource,
31368 /// used to detect conflicts. The fingerprint is initially generated by
31369 /// Kubernetes Engine and changes after every request to modify or update
31370 /// labels. You must always provide an up-to-date fingerprint hash when
31371 /// updating or changing labels. Make a `get()` request to the
31372 /// resource to get the latest fingerprint.
31373 pub label_fingerprint: std::string::String,
31374
31375 /// The name (project, location, cluster name) of the cluster to set labels.
31376 /// Specified in the format `projects/*/locations/*/clusters/*`.
31377 pub name: std::string::String,
31378
31379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31380}
31381
31382impl SetLabelsRequest {
31383 /// Creates a new default instance.
31384 pub fn new() -> Self {
31385 std::default::Default::default()
31386 }
31387
31388 /// Sets the value of [project_id][crate::model::SetLabelsRequest::project_id].
31389 ///
31390 /// # Example
31391 /// ```ignore,no_run
31392 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31393 /// let x = SetLabelsRequest::new().set_project_id("example");
31394 /// ```
31395 #[deprecated]
31396 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31397 self.project_id = v.into();
31398 self
31399 }
31400
31401 /// Sets the value of [zone][crate::model::SetLabelsRequest::zone].
31402 ///
31403 /// # Example
31404 /// ```ignore,no_run
31405 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31406 /// let x = SetLabelsRequest::new().set_zone("example");
31407 /// ```
31408 #[deprecated]
31409 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31410 self.zone = v.into();
31411 self
31412 }
31413
31414 /// Sets the value of [cluster_id][crate::model::SetLabelsRequest::cluster_id].
31415 ///
31416 /// # Example
31417 /// ```ignore,no_run
31418 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31419 /// let x = SetLabelsRequest::new().set_cluster_id("example");
31420 /// ```
31421 #[deprecated]
31422 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31423 self.cluster_id = v.into();
31424 self
31425 }
31426
31427 /// Sets the value of [resource_labels][crate::model::SetLabelsRequest::resource_labels].
31428 ///
31429 /// # Example
31430 /// ```ignore,no_run
31431 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31432 /// let x = SetLabelsRequest::new().set_resource_labels([
31433 /// ("key0", "abc"),
31434 /// ("key1", "xyz"),
31435 /// ]);
31436 /// ```
31437 pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
31438 where
31439 T: std::iter::IntoIterator<Item = (K, V)>,
31440 K: std::convert::Into<std::string::String>,
31441 V: std::convert::Into<std::string::String>,
31442 {
31443 use std::iter::Iterator;
31444 self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
31445 self
31446 }
31447
31448 /// Sets the value of [label_fingerprint][crate::model::SetLabelsRequest::label_fingerprint].
31449 ///
31450 /// # Example
31451 /// ```ignore,no_run
31452 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31453 /// let x = SetLabelsRequest::new().set_label_fingerprint("example");
31454 /// ```
31455 pub fn set_label_fingerprint<T: std::convert::Into<std::string::String>>(
31456 mut self,
31457 v: T,
31458 ) -> Self {
31459 self.label_fingerprint = v.into();
31460 self
31461 }
31462
31463 /// Sets the value of [name][crate::model::SetLabelsRequest::name].
31464 ///
31465 /// # Example
31466 /// ```ignore,no_run
31467 /// # use google_cloud_container_v1::model::SetLabelsRequest;
31468 /// let x = SetLabelsRequest::new().set_name("example");
31469 /// ```
31470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31471 self.name = v.into();
31472 self
31473 }
31474}
31475
31476impl wkt::message::Message for SetLabelsRequest {
31477 fn typename() -> &'static str {
31478 "type.googleapis.com/google.container.v1.SetLabelsRequest"
31479 }
31480}
31481
31482/// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for
31483/// a cluster.
31484#[derive(Clone, Default, PartialEq)]
31485#[non_exhaustive]
31486pub struct SetLegacyAbacRequest {
31487 /// Deprecated. The Google Developers Console [project ID or project
31488 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
31489 /// This field has been deprecated and replaced by the name field.
31490 #[deprecated]
31491 pub project_id: std::string::String,
31492
31493 /// Deprecated. The name of the Google Compute Engine
31494 /// [zone](https://cloud.google.com/compute/docs/zones#available)
31495 /// in which the cluster resides. This field has been deprecated and replaced
31496 /// by the name field.
31497 #[deprecated]
31498 pub zone: std::string::String,
31499
31500 /// Deprecated. The name of the cluster to update.
31501 /// This field has been deprecated and replaced by the name field.
31502 #[deprecated]
31503 pub cluster_id: std::string::String,
31504
31505 /// Required. Whether ABAC authorization will be enabled in the cluster.
31506 pub enabled: bool,
31507
31508 /// The name (project, location, cluster name) of the cluster to set legacy
31509 /// abac. Specified in the format `projects/*/locations/*/clusters/*`.
31510 pub name: std::string::String,
31511
31512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31513}
31514
31515impl SetLegacyAbacRequest {
31516 /// Creates a new default instance.
31517 pub fn new() -> Self {
31518 std::default::Default::default()
31519 }
31520
31521 /// Sets the value of [project_id][crate::model::SetLegacyAbacRequest::project_id].
31522 ///
31523 /// # Example
31524 /// ```ignore,no_run
31525 /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
31526 /// let x = SetLegacyAbacRequest::new().set_project_id("example");
31527 /// ```
31528 #[deprecated]
31529 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31530 self.project_id = v.into();
31531 self
31532 }
31533
31534 /// Sets the value of [zone][crate::model::SetLegacyAbacRequest::zone].
31535 ///
31536 /// # Example
31537 /// ```ignore,no_run
31538 /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
31539 /// let x = SetLegacyAbacRequest::new().set_zone("example");
31540 /// ```
31541 #[deprecated]
31542 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31543 self.zone = v.into();
31544 self
31545 }
31546
31547 /// Sets the value of [cluster_id][crate::model::SetLegacyAbacRequest::cluster_id].
31548 ///
31549 /// # Example
31550 /// ```ignore,no_run
31551 /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
31552 /// let x = SetLegacyAbacRequest::new().set_cluster_id("example");
31553 /// ```
31554 #[deprecated]
31555 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31556 self.cluster_id = v.into();
31557 self
31558 }
31559
31560 /// Sets the value of [enabled][crate::model::SetLegacyAbacRequest::enabled].
31561 ///
31562 /// # Example
31563 /// ```ignore,no_run
31564 /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
31565 /// let x = SetLegacyAbacRequest::new().set_enabled(true);
31566 /// ```
31567 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31568 self.enabled = v.into();
31569 self
31570 }
31571
31572 /// Sets the value of [name][crate::model::SetLegacyAbacRequest::name].
31573 ///
31574 /// # Example
31575 /// ```ignore,no_run
31576 /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
31577 /// let x = SetLegacyAbacRequest::new().set_name("example");
31578 /// ```
31579 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31580 self.name = v.into();
31581 self
31582 }
31583}
31584
31585impl wkt::message::Message for SetLegacyAbacRequest {
31586 fn typename() -> &'static str {
31587 "type.googleapis.com/google.container.v1.SetLegacyAbacRequest"
31588 }
31589}
31590
31591/// StartIPRotationRequest creates a new IP for the cluster and then performs
31592/// a node upgrade on each node pool to point to the new IP.
31593#[derive(Clone, Default, PartialEq)]
31594#[non_exhaustive]
31595pub struct StartIPRotationRequest {
31596 /// Deprecated. The Google Developers Console [project ID or project
31597 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
31598 /// This field has been deprecated and replaced by the name field.
31599 #[deprecated]
31600 pub project_id: std::string::String,
31601
31602 /// Deprecated. The name of the Google Compute Engine
31603 /// [zone](https://cloud.google.com/compute/docs/zones#available)
31604 /// in which the cluster resides. This field has been deprecated and replaced
31605 /// by the name field.
31606 #[deprecated]
31607 pub zone: std::string::String,
31608
31609 /// Deprecated. The name of the cluster.
31610 /// This field has been deprecated and replaced by the name field.
31611 #[deprecated]
31612 pub cluster_id: std::string::String,
31613
31614 /// The name (project, location, cluster name) of the cluster to start IP
31615 /// rotation. Specified in the format `projects/*/locations/*/clusters/*`.
31616 pub name: std::string::String,
31617
31618 /// Whether to rotate credentials during IP rotation.
31619 pub rotate_credentials: bool,
31620
31621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31622}
31623
31624impl StartIPRotationRequest {
31625 /// Creates a new default instance.
31626 pub fn new() -> Self {
31627 std::default::Default::default()
31628 }
31629
31630 /// Sets the value of [project_id][crate::model::StartIPRotationRequest::project_id].
31631 ///
31632 /// # Example
31633 /// ```ignore,no_run
31634 /// # use google_cloud_container_v1::model::StartIPRotationRequest;
31635 /// let x = StartIPRotationRequest::new().set_project_id("example");
31636 /// ```
31637 #[deprecated]
31638 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31639 self.project_id = v.into();
31640 self
31641 }
31642
31643 /// Sets the value of [zone][crate::model::StartIPRotationRequest::zone].
31644 ///
31645 /// # Example
31646 /// ```ignore,no_run
31647 /// # use google_cloud_container_v1::model::StartIPRotationRequest;
31648 /// let x = StartIPRotationRequest::new().set_zone("example");
31649 /// ```
31650 #[deprecated]
31651 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31652 self.zone = v.into();
31653 self
31654 }
31655
31656 /// Sets the value of [cluster_id][crate::model::StartIPRotationRequest::cluster_id].
31657 ///
31658 /// # Example
31659 /// ```ignore,no_run
31660 /// # use google_cloud_container_v1::model::StartIPRotationRequest;
31661 /// let x = StartIPRotationRequest::new().set_cluster_id("example");
31662 /// ```
31663 #[deprecated]
31664 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31665 self.cluster_id = v.into();
31666 self
31667 }
31668
31669 /// Sets the value of [name][crate::model::StartIPRotationRequest::name].
31670 ///
31671 /// # Example
31672 /// ```ignore,no_run
31673 /// # use google_cloud_container_v1::model::StartIPRotationRequest;
31674 /// let x = StartIPRotationRequest::new().set_name("example");
31675 /// ```
31676 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31677 self.name = v.into();
31678 self
31679 }
31680
31681 /// Sets the value of [rotate_credentials][crate::model::StartIPRotationRequest::rotate_credentials].
31682 ///
31683 /// # Example
31684 /// ```ignore,no_run
31685 /// # use google_cloud_container_v1::model::StartIPRotationRequest;
31686 /// let x = StartIPRotationRequest::new().set_rotate_credentials(true);
31687 /// ```
31688 pub fn set_rotate_credentials<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31689 self.rotate_credentials = v.into();
31690 self
31691 }
31692}
31693
31694impl wkt::message::Message for StartIPRotationRequest {
31695 fn typename() -> &'static str {
31696 "type.googleapis.com/google.container.v1.StartIPRotationRequest"
31697 }
31698}
31699
31700/// CompleteIPRotationRequest moves the cluster master back into single-IP mode.
31701#[derive(Clone, Default, PartialEq)]
31702#[non_exhaustive]
31703pub struct CompleteIPRotationRequest {
31704 /// Deprecated. The Google Developers Console [project ID or project
31705 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
31706 /// This field has been deprecated and replaced by the name field.
31707 #[deprecated]
31708 pub project_id: std::string::String,
31709
31710 /// Deprecated. The name of the Google Compute Engine
31711 /// [zone](https://cloud.google.com/compute/docs/zones#available)
31712 /// in which the cluster resides. This field has been deprecated and replaced
31713 /// by the name field.
31714 #[deprecated]
31715 pub zone: std::string::String,
31716
31717 /// Deprecated. The name of the cluster.
31718 /// This field has been deprecated and replaced by the name field.
31719 #[deprecated]
31720 pub cluster_id: std::string::String,
31721
31722 /// The name (project, location, cluster name) of the cluster to complete IP
31723 /// rotation. Specified in the format `projects/*/locations/*/clusters/*`.
31724 pub name: std::string::String,
31725
31726 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31727}
31728
31729impl CompleteIPRotationRequest {
31730 /// Creates a new default instance.
31731 pub fn new() -> Self {
31732 std::default::Default::default()
31733 }
31734
31735 /// Sets the value of [project_id][crate::model::CompleteIPRotationRequest::project_id].
31736 ///
31737 /// # Example
31738 /// ```ignore,no_run
31739 /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
31740 /// let x = CompleteIPRotationRequest::new().set_project_id("example");
31741 /// ```
31742 #[deprecated]
31743 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31744 self.project_id = v.into();
31745 self
31746 }
31747
31748 /// Sets the value of [zone][crate::model::CompleteIPRotationRequest::zone].
31749 ///
31750 /// # Example
31751 /// ```ignore,no_run
31752 /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
31753 /// let x = CompleteIPRotationRequest::new().set_zone("example");
31754 /// ```
31755 #[deprecated]
31756 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31757 self.zone = v.into();
31758 self
31759 }
31760
31761 /// Sets the value of [cluster_id][crate::model::CompleteIPRotationRequest::cluster_id].
31762 ///
31763 /// # Example
31764 /// ```ignore,no_run
31765 /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
31766 /// let x = CompleteIPRotationRequest::new().set_cluster_id("example");
31767 /// ```
31768 #[deprecated]
31769 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31770 self.cluster_id = v.into();
31771 self
31772 }
31773
31774 /// Sets the value of [name][crate::model::CompleteIPRotationRequest::name].
31775 ///
31776 /// # Example
31777 /// ```ignore,no_run
31778 /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
31779 /// let x = CompleteIPRotationRequest::new().set_name("example");
31780 /// ```
31781 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31782 self.name = v.into();
31783 self
31784 }
31785}
31786
31787impl wkt::message::Message for CompleteIPRotationRequest {
31788 fn typename() -> &'static str {
31789 "type.googleapis.com/google.container.v1.CompleteIPRotationRequest"
31790 }
31791}
31792
31793/// AcceleratorConfig represents a Hardware Accelerator request.
31794#[derive(Clone, Default, PartialEq)]
31795#[non_exhaustive]
31796pub struct AcceleratorConfig {
31797 /// The number of the accelerator cards exposed to an instance.
31798 pub accelerator_count: i64,
31799
31800 /// The accelerator type resource name. List of supported accelerators
31801 /// [here](https://cloud.google.com/compute/docs/gpus)
31802 pub accelerator_type: std::string::String,
31803
31804 /// Size of partitions to create on the GPU. Valid values are described in the
31805 /// NVIDIA [mig user
31806 /// guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning).
31807 pub gpu_partition_size: std::string::String,
31808
31809 /// The configuration for GPU sharing options.
31810 pub gpu_sharing_config: std::option::Option<crate::model::GPUSharingConfig>,
31811
31812 /// The configuration for auto installation of GPU driver.
31813 pub gpu_driver_installation_config:
31814 std::option::Option<crate::model::GPUDriverInstallationConfig>,
31815
31816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31817}
31818
31819impl AcceleratorConfig {
31820 /// Creates a new default instance.
31821 pub fn new() -> Self {
31822 std::default::Default::default()
31823 }
31824
31825 /// Sets the value of [accelerator_count][crate::model::AcceleratorConfig::accelerator_count].
31826 ///
31827 /// # Example
31828 /// ```ignore,no_run
31829 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31830 /// let x = AcceleratorConfig::new().set_accelerator_count(42);
31831 /// ```
31832 pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31833 self.accelerator_count = v.into();
31834 self
31835 }
31836
31837 /// Sets the value of [accelerator_type][crate::model::AcceleratorConfig::accelerator_type].
31838 ///
31839 /// # Example
31840 /// ```ignore,no_run
31841 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31842 /// let x = AcceleratorConfig::new().set_accelerator_type("example");
31843 /// ```
31844 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
31845 mut self,
31846 v: T,
31847 ) -> Self {
31848 self.accelerator_type = v.into();
31849 self
31850 }
31851
31852 /// Sets the value of [gpu_partition_size][crate::model::AcceleratorConfig::gpu_partition_size].
31853 ///
31854 /// # Example
31855 /// ```ignore,no_run
31856 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31857 /// let x = AcceleratorConfig::new().set_gpu_partition_size("example");
31858 /// ```
31859 pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
31860 mut self,
31861 v: T,
31862 ) -> Self {
31863 self.gpu_partition_size = v.into();
31864 self
31865 }
31866
31867 /// Sets the value of [gpu_sharing_config][crate::model::AcceleratorConfig::gpu_sharing_config].
31868 ///
31869 /// # Example
31870 /// ```ignore,no_run
31871 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31872 /// use google_cloud_container_v1::model::GPUSharingConfig;
31873 /// let x = AcceleratorConfig::new().set_gpu_sharing_config(GPUSharingConfig::default()/* use setters */);
31874 /// ```
31875 pub fn set_gpu_sharing_config<T>(mut self, v: T) -> Self
31876 where
31877 T: std::convert::Into<crate::model::GPUSharingConfig>,
31878 {
31879 self.gpu_sharing_config = std::option::Option::Some(v.into());
31880 self
31881 }
31882
31883 /// Sets or clears the value of [gpu_sharing_config][crate::model::AcceleratorConfig::gpu_sharing_config].
31884 ///
31885 /// # Example
31886 /// ```ignore,no_run
31887 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31888 /// use google_cloud_container_v1::model::GPUSharingConfig;
31889 /// let x = AcceleratorConfig::new().set_or_clear_gpu_sharing_config(Some(GPUSharingConfig::default()/* use setters */));
31890 /// let x = AcceleratorConfig::new().set_or_clear_gpu_sharing_config(None::<GPUSharingConfig>);
31891 /// ```
31892 pub fn set_or_clear_gpu_sharing_config<T>(mut self, v: std::option::Option<T>) -> Self
31893 where
31894 T: std::convert::Into<crate::model::GPUSharingConfig>,
31895 {
31896 self.gpu_sharing_config = v.map(|x| x.into());
31897 self
31898 }
31899
31900 /// Sets the value of [gpu_driver_installation_config][crate::model::AcceleratorConfig::gpu_driver_installation_config].
31901 ///
31902 /// # Example
31903 /// ```ignore,no_run
31904 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31905 /// use google_cloud_container_v1::model::GPUDriverInstallationConfig;
31906 /// let x = AcceleratorConfig::new().set_gpu_driver_installation_config(GPUDriverInstallationConfig::default()/* use setters */);
31907 /// ```
31908 pub fn set_gpu_driver_installation_config<T>(mut self, v: T) -> Self
31909 where
31910 T: std::convert::Into<crate::model::GPUDriverInstallationConfig>,
31911 {
31912 self.gpu_driver_installation_config = std::option::Option::Some(v.into());
31913 self
31914 }
31915
31916 /// Sets or clears the value of [gpu_driver_installation_config][crate::model::AcceleratorConfig::gpu_driver_installation_config].
31917 ///
31918 /// # Example
31919 /// ```ignore,no_run
31920 /// # use google_cloud_container_v1::model::AcceleratorConfig;
31921 /// use google_cloud_container_v1::model::GPUDriverInstallationConfig;
31922 /// let x = AcceleratorConfig::new().set_or_clear_gpu_driver_installation_config(Some(GPUDriverInstallationConfig::default()/* use setters */));
31923 /// let x = AcceleratorConfig::new().set_or_clear_gpu_driver_installation_config(None::<GPUDriverInstallationConfig>);
31924 /// ```
31925 pub fn set_or_clear_gpu_driver_installation_config<T>(
31926 mut self,
31927 v: std::option::Option<T>,
31928 ) -> Self
31929 where
31930 T: std::convert::Into<crate::model::GPUDriverInstallationConfig>,
31931 {
31932 self.gpu_driver_installation_config = v.map(|x| x.into());
31933 self
31934 }
31935}
31936
31937impl wkt::message::Message for AcceleratorConfig {
31938 fn typename() -> &'static str {
31939 "type.googleapis.com/google.container.v1.AcceleratorConfig"
31940 }
31941}
31942
31943/// GPUSharingConfig represents the GPU sharing configuration for Hardware
31944/// Accelerators.
31945#[derive(Clone, Default, PartialEq)]
31946#[non_exhaustive]
31947pub struct GPUSharingConfig {
31948 /// The max number of containers that can share a physical GPU.
31949 pub max_shared_clients_per_gpu: i64,
31950
31951 /// The type of GPU sharing strategy to enable on the GPU node.
31952 pub gpu_sharing_strategy:
31953 std::option::Option<crate::model::gpu_sharing_config::GPUSharingStrategy>,
31954
31955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31956}
31957
31958impl GPUSharingConfig {
31959 /// Creates a new default instance.
31960 pub fn new() -> Self {
31961 std::default::Default::default()
31962 }
31963
31964 /// Sets the value of [max_shared_clients_per_gpu][crate::model::GPUSharingConfig::max_shared_clients_per_gpu].
31965 ///
31966 /// # Example
31967 /// ```ignore,no_run
31968 /// # use google_cloud_container_v1::model::GPUSharingConfig;
31969 /// let x = GPUSharingConfig::new().set_max_shared_clients_per_gpu(42);
31970 /// ```
31971 pub fn set_max_shared_clients_per_gpu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31972 self.max_shared_clients_per_gpu = v.into();
31973 self
31974 }
31975
31976 /// Sets the value of [gpu_sharing_strategy][crate::model::GPUSharingConfig::gpu_sharing_strategy].
31977 ///
31978 /// # Example
31979 /// ```ignore,no_run
31980 /// # use google_cloud_container_v1::model::GPUSharingConfig;
31981 /// use google_cloud_container_v1::model::gpu_sharing_config::GPUSharingStrategy;
31982 /// let x0 = GPUSharingConfig::new().set_gpu_sharing_strategy(GPUSharingStrategy::TimeSharing);
31983 /// let x1 = GPUSharingConfig::new().set_gpu_sharing_strategy(GPUSharingStrategy::Mps);
31984 /// ```
31985 pub fn set_gpu_sharing_strategy<T>(mut self, v: T) -> Self
31986 where
31987 T: std::convert::Into<crate::model::gpu_sharing_config::GPUSharingStrategy>,
31988 {
31989 self.gpu_sharing_strategy = std::option::Option::Some(v.into());
31990 self
31991 }
31992
31993 /// Sets or clears the value of [gpu_sharing_strategy][crate::model::GPUSharingConfig::gpu_sharing_strategy].
31994 ///
31995 /// # Example
31996 /// ```ignore,no_run
31997 /// # use google_cloud_container_v1::model::GPUSharingConfig;
31998 /// use google_cloud_container_v1::model::gpu_sharing_config::GPUSharingStrategy;
31999 /// let x0 = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(Some(GPUSharingStrategy::TimeSharing));
32000 /// let x1 = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(Some(GPUSharingStrategy::Mps));
32001 /// let x_none = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(None::<GPUSharingStrategy>);
32002 /// ```
32003 pub fn set_or_clear_gpu_sharing_strategy<T>(mut self, v: std::option::Option<T>) -> Self
32004 where
32005 T: std::convert::Into<crate::model::gpu_sharing_config::GPUSharingStrategy>,
32006 {
32007 self.gpu_sharing_strategy = v.map(|x| x.into());
32008 self
32009 }
32010}
32011
32012impl wkt::message::Message for GPUSharingConfig {
32013 fn typename() -> &'static str {
32014 "type.googleapis.com/google.container.v1.GPUSharingConfig"
32015 }
32016}
32017
32018/// Defines additional types related to [GPUSharingConfig].
32019pub mod gpu_sharing_config {
32020 #[allow(unused_imports)]
32021 use super::*;
32022
32023 /// The type of GPU sharing strategy currently provided.
32024 ///
32025 /// # Working with unknown values
32026 ///
32027 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32028 /// additional enum variants at any time. Adding new variants is not considered
32029 /// a breaking change. Applications should write their code in anticipation of:
32030 ///
32031 /// - New values appearing in future releases of the client library, **and**
32032 /// - New values received dynamically, without application changes.
32033 ///
32034 /// Please consult the [Working with enums] section in the user guide for some
32035 /// guidelines.
32036 ///
32037 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32038 #[derive(Clone, Debug, PartialEq)]
32039 #[non_exhaustive]
32040 pub enum GPUSharingStrategy {
32041 /// Default value.
32042 Unspecified,
32043 /// GPUs are time-shared between containers.
32044 TimeSharing,
32045 /// GPUs are shared between containers with NVIDIA MPS.
32046 Mps,
32047 /// If set, the enum was initialized with an unknown value.
32048 ///
32049 /// Applications can examine the value using [GPUSharingStrategy::value] or
32050 /// [GPUSharingStrategy::name].
32051 UnknownValue(gpu_sharing_strategy::UnknownValue),
32052 }
32053
32054 #[doc(hidden)]
32055 pub mod gpu_sharing_strategy {
32056 #[allow(unused_imports)]
32057 use super::*;
32058 #[derive(Clone, Debug, PartialEq)]
32059 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32060 }
32061
32062 impl GPUSharingStrategy {
32063 /// Gets the enum value.
32064 ///
32065 /// Returns `None` if the enum contains an unknown value deserialized from
32066 /// the string representation of enums.
32067 pub fn value(&self) -> std::option::Option<i32> {
32068 match self {
32069 Self::Unspecified => std::option::Option::Some(0),
32070 Self::TimeSharing => std::option::Option::Some(1),
32071 Self::Mps => std::option::Option::Some(2),
32072 Self::UnknownValue(u) => u.0.value(),
32073 }
32074 }
32075
32076 /// Gets the enum value as a string.
32077 ///
32078 /// Returns `None` if the enum contains an unknown value deserialized from
32079 /// the integer representation of enums.
32080 pub fn name(&self) -> std::option::Option<&str> {
32081 match self {
32082 Self::Unspecified => std::option::Option::Some("GPU_SHARING_STRATEGY_UNSPECIFIED"),
32083 Self::TimeSharing => std::option::Option::Some("TIME_SHARING"),
32084 Self::Mps => std::option::Option::Some("MPS"),
32085 Self::UnknownValue(u) => u.0.name(),
32086 }
32087 }
32088 }
32089
32090 impl std::default::Default for GPUSharingStrategy {
32091 fn default() -> Self {
32092 use std::convert::From;
32093 Self::from(0)
32094 }
32095 }
32096
32097 impl std::fmt::Display for GPUSharingStrategy {
32098 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32099 wkt::internal::display_enum(f, self.name(), self.value())
32100 }
32101 }
32102
32103 impl std::convert::From<i32> for GPUSharingStrategy {
32104 fn from(value: i32) -> Self {
32105 match value {
32106 0 => Self::Unspecified,
32107 1 => Self::TimeSharing,
32108 2 => Self::Mps,
32109 _ => Self::UnknownValue(gpu_sharing_strategy::UnknownValue(
32110 wkt::internal::UnknownEnumValue::Integer(value),
32111 )),
32112 }
32113 }
32114 }
32115
32116 impl std::convert::From<&str> for GPUSharingStrategy {
32117 fn from(value: &str) -> Self {
32118 use std::string::ToString;
32119 match value {
32120 "GPU_SHARING_STRATEGY_UNSPECIFIED" => Self::Unspecified,
32121 "TIME_SHARING" => Self::TimeSharing,
32122 "MPS" => Self::Mps,
32123 _ => Self::UnknownValue(gpu_sharing_strategy::UnknownValue(
32124 wkt::internal::UnknownEnumValue::String(value.to_string()),
32125 )),
32126 }
32127 }
32128 }
32129
32130 impl serde::ser::Serialize for GPUSharingStrategy {
32131 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32132 where
32133 S: serde::Serializer,
32134 {
32135 match self {
32136 Self::Unspecified => serializer.serialize_i32(0),
32137 Self::TimeSharing => serializer.serialize_i32(1),
32138 Self::Mps => serializer.serialize_i32(2),
32139 Self::UnknownValue(u) => u.0.serialize(serializer),
32140 }
32141 }
32142 }
32143
32144 impl<'de> serde::de::Deserialize<'de> for GPUSharingStrategy {
32145 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32146 where
32147 D: serde::Deserializer<'de>,
32148 {
32149 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GPUSharingStrategy>::new(
32150 ".google.container.v1.GPUSharingConfig.GPUSharingStrategy",
32151 ))
32152 }
32153 }
32154}
32155
32156/// GPUDriverInstallationConfig specifies the version of GPU driver to be auto
32157/// installed.
32158#[derive(Clone, Default, PartialEq)]
32159#[non_exhaustive]
32160pub struct GPUDriverInstallationConfig {
32161 /// Mode for how the GPU driver is installed.
32162 pub gpu_driver_version:
32163 std::option::Option<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
32164
32165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32166}
32167
32168impl GPUDriverInstallationConfig {
32169 /// Creates a new default instance.
32170 pub fn new() -> Self {
32171 std::default::Default::default()
32172 }
32173
32174 /// Sets the value of [gpu_driver_version][crate::model::GPUDriverInstallationConfig::gpu_driver_version].
32175 ///
32176 /// # Example
32177 /// ```ignore,no_run
32178 /// # use google_cloud_container_v1::model::GPUDriverInstallationConfig;
32179 /// use google_cloud_container_v1::model::gpu_driver_installation_config::GPUDriverVersion;
32180 /// let x0 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::InstallationDisabled);
32181 /// let x1 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::Default);
32182 /// let x2 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::Latest);
32183 /// ```
32184 pub fn set_gpu_driver_version<T>(mut self, v: T) -> Self
32185 where
32186 T: std::convert::Into<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
32187 {
32188 self.gpu_driver_version = std::option::Option::Some(v.into());
32189 self
32190 }
32191
32192 /// Sets or clears the value of [gpu_driver_version][crate::model::GPUDriverInstallationConfig::gpu_driver_version].
32193 ///
32194 /// # Example
32195 /// ```ignore,no_run
32196 /// # use google_cloud_container_v1::model::GPUDriverInstallationConfig;
32197 /// use google_cloud_container_v1::model::gpu_driver_installation_config::GPUDriverVersion;
32198 /// let x0 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::InstallationDisabled));
32199 /// let x1 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::Default));
32200 /// let x2 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::Latest));
32201 /// let x_none = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(None::<GPUDriverVersion>);
32202 /// ```
32203 pub fn set_or_clear_gpu_driver_version<T>(mut self, v: std::option::Option<T>) -> Self
32204 where
32205 T: std::convert::Into<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
32206 {
32207 self.gpu_driver_version = v.map(|x| x.into());
32208 self
32209 }
32210}
32211
32212impl wkt::message::Message for GPUDriverInstallationConfig {
32213 fn typename() -> &'static str {
32214 "type.googleapis.com/google.container.v1.GPUDriverInstallationConfig"
32215 }
32216}
32217
32218/// Defines additional types related to [GPUDriverInstallationConfig].
32219pub mod gpu_driver_installation_config {
32220 #[allow(unused_imports)]
32221 use super::*;
32222
32223 /// The GPU driver version to install.
32224 ///
32225 /// # Working with unknown values
32226 ///
32227 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32228 /// additional enum variants at any time. Adding new variants is not considered
32229 /// a breaking change. Applications should write their code in anticipation of:
32230 ///
32231 /// - New values appearing in future releases of the client library, **and**
32232 /// - New values received dynamically, without application changes.
32233 ///
32234 /// Please consult the [Working with enums] section in the user guide for some
32235 /// guidelines.
32236 ///
32237 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32238 #[derive(Clone, Debug, PartialEq)]
32239 #[non_exhaustive]
32240 pub enum GPUDriverVersion {
32241 /// Default value is to not install any GPU driver.
32242 Unspecified,
32243 /// Disable GPU driver auto installation and needs manual installation
32244 InstallationDisabled,
32245 /// "Default" GPU driver in COS and Ubuntu.
32246 Default,
32247 /// "Latest" GPU driver in COS.
32248 Latest,
32249 /// If set, the enum was initialized with an unknown value.
32250 ///
32251 /// Applications can examine the value using [GPUDriverVersion::value] or
32252 /// [GPUDriverVersion::name].
32253 UnknownValue(gpu_driver_version::UnknownValue),
32254 }
32255
32256 #[doc(hidden)]
32257 pub mod gpu_driver_version {
32258 #[allow(unused_imports)]
32259 use super::*;
32260 #[derive(Clone, Debug, PartialEq)]
32261 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32262 }
32263
32264 impl GPUDriverVersion {
32265 /// Gets the enum value.
32266 ///
32267 /// Returns `None` if the enum contains an unknown value deserialized from
32268 /// the string representation of enums.
32269 pub fn value(&self) -> std::option::Option<i32> {
32270 match self {
32271 Self::Unspecified => std::option::Option::Some(0),
32272 Self::InstallationDisabled => std::option::Option::Some(1),
32273 Self::Default => std::option::Option::Some(2),
32274 Self::Latest => std::option::Option::Some(3),
32275 Self::UnknownValue(u) => u.0.value(),
32276 }
32277 }
32278
32279 /// Gets the enum value as a string.
32280 ///
32281 /// Returns `None` if the enum contains an unknown value deserialized from
32282 /// the integer representation of enums.
32283 pub fn name(&self) -> std::option::Option<&str> {
32284 match self {
32285 Self::Unspecified => std::option::Option::Some("GPU_DRIVER_VERSION_UNSPECIFIED"),
32286 Self::InstallationDisabled => std::option::Option::Some("INSTALLATION_DISABLED"),
32287 Self::Default => std::option::Option::Some("DEFAULT"),
32288 Self::Latest => std::option::Option::Some("LATEST"),
32289 Self::UnknownValue(u) => u.0.name(),
32290 }
32291 }
32292 }
32293
32294 impl std::default::Default for GPUDriverVersion {
32295 fn default() -> Self {
32296 use std::convert::From;
32297 Self::from(0)
32298 }
32299 }
32300
32301 impl std::fmt::Display for GPUDriverVersion {
32302 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32303 wkt::internal::display_enum(f, self.name(), self.value())
32304 }
32305 }
32306
32307 impl std::convert::From<i32> for GPUDriverVersion {
32308 fn from(value: i32) -> Self {
32309 match value {
32310 0 => Self::Unspecified,
32311 1 => Self::InstallationDisabled,
32312 2 => Self::Default,
32313 3 => Self::Latest,
32314 _ => Self::UnknownValue(gpu_driver_version::UnknownValue(
32315 wkt::internal::UnknownEnumValue::Integer(value),
32316 )),
32317 }
32318 }
32319 }
32320
32321 impl std::convert::From<&str> for GPUDriverVersion {
32322 fn from(value: &str) -> Self {
32323 use std::string::ToString;
32324 match value {
32325 "GPU_DRIVER_VERSION_UNSPECIFIED" => Self::Unspecified,
32326 "INSTALLATION_DISABLED" => Self::InstallationDisabled,
32327 "DEFAULT" => Self::Default,
32328 "LATEST" => Self::Latest,
32329 _ => Self::UnknownValue(gpu_driver_version::UnknownValue(
32330 wkt::internal::UnknownEnumValue::String(value.to_string()),
32331 )),
32332 }
32333 }
32334 }
32335
32336 impl serde::ser::Serialize for GPUDriverVersion {
32337 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32338 where
32339 S: serde::Serializer,
32340 {
32341 match self {
32342 Self::Unspecified => serializer.serialize_i32(0),
32343 Self::InstallationDisabled => serializer.serialize_i32(1),
32344 Self::Default => serializer.serialize_i32(2),
32345 Self::Latest => serializer.serialize_i32(3),
32346 Self::UnknownValue(u) => u.0.serialize(serializer),
32347 }
32348 }
32349 }
32350
32351 impl<'de> serde::de::Deserialize<'de> for GPUDriverVersion {
32352 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32353 where
32354 D: serde::Deserializer<'de>,
32355 {
32356 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GPUDriverVersion>::new(
32357 ".google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion",
32358 ))
32359 }
32360 }
32361}
32362
32363/// WorkloadMetadataConfig defines the metadata configuration to expose to
32364/// workloads on the node pool.
32365#[derive(Clone, Default, PartialEq)]
32366#[non_exhaustive]
32367pub struct WorkloadMetadataConfig {
32368 /// Mode is the configuration for how to expose metadata to workloads running
32369 /// on the node pool.
32370 pub mode: crate::model::workload_metadata_config::Mode,
32371
32372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32373}
32374
32375impl WorkloadMetadataConfig {
32376 /// Creates a new default instance.
32377 pub fn new() -> Self {
32378 std::default::Default::default()
32379 }
32380
32381 /// Sets the value of [mode][crate::model::WorkloadMetadataConfig::mode].
32382 ///
32383 /// # Example
32384 /// ```ignore,no_run
32385 /// # use google_cloud_container_v1::model::WorkloadMetadataConfig;
32386 /// use google_cloud_container_v1::model::workload_metadata_config::Mode;
32387 /// let x0 = WorkloadMetadataConfig::new().set_mode(Mode::GceMetadata);
32388 /// let x1 = WorkloadMetadataConfig::new().set_mode(Mode::GkeMetadata);
32389 /// ```
32390 pub fn set_mode<T: std::convert::Into<crate::model::workload_metadata_config::Mode>>(
32391 mut self,
32392 v: T,
32393 ) -> Self {
32394 self.mode = v.into();
32395 self
32396 }
32397}
32398
32399impl wkt::message::Message for WorkloadMetadataConfig {
32400 fn typename() -> &'static str {
32401 "type.googleapis.com/google.container.v1.WorkloadMetadataConfig"
32402 }
32403}
32404
32405/// Defines additional types related to [WorkloadMetadataConfig].
32406pub mod workload_metadata_config {
32407 #[allow(unused_imports)]
32408 use super::*;
32409
32410 /// Mode is the configuration for how to expose metadata to workloads running
32411 /// on the node.
32412 ///
32413 /// # Working with unknown values
32414 ///
32415 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32416 /// additional enum variants at any time. Adding new variants is not considered
32417 /// a breaking change. Applications should write their code in anticipation of:
32418 ///
32419 /// - New values appearing in future releases of the client library, **and**
32420 /// - New values received dynamically, without application changes.
32421 ///
32422 /// Please consult the [Working with enums] section in the user guide for some
32423 /// guidelines.
32424 ///
32425 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32426 #[derive(Clone, Debug, PartialEq)]
32427 #[non_exhaustive]
32428 pub enum Mode {
32429 /// Not set.
32430 Unspecified,
32431 /// Expose all Compute Engine metadata to pods.
32432 GceMetadata,
32433 /// Run the GKE Metadata Server on this node. The GKE Metadata Server exposes
32434 /// a metadata API to workloads that is compatible with the V1 Compute
32435 /// Metadata APIs exposed by the Compute Engine and App Engine Metadata
32436 /// Servers. This feature can only be enabled if Workload Identity is enabled
32437 /// at the cluster level.
32438 GkeMetadata,
32439 /// If set, the enum was initialized with an unknown value.
32440 ///
32441 /// Applications can examine the value using [Mode::value] or
32442 /// [Mode::name].
32443 UnknownValue(mode::UnknownValue),
32444 }
32445
32446 #[doc(hidden)]
32447 pub mod mode {
32448 #[allow(unused_imports)]
32449 use super::*;
32450 #[derive(Clone, Debug, PartialEq)]
32451 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32452 }
32453
32454 impl Mode {
32455 /// Gets the enum value.
32456 ///
32457 /// Returns `None` if the enum contains an unknown value deserialized from
32458 /// the string representation of enums.
32459 pub fn value(&self) -> std::option::Option<i32> {
32460 match self {
32461 Self::Unspecified => std::option::Option::Some(0),
32462 Self::GceMetadata => std::option::Option::Some(1),
32463 Self::GkeMetadata => std::option::Option::Some(2),
32464 Self::UnknownValue(u) => u.0.value(),
32465 }
32466 }
32467
32468 /// Gets the enum value as a string.
32469 ///
32470 /// Returns `None` if the enum contains an unknown value deserialized from
32471 /// the integer representation of enums.
32472 pub fn name(&self) -> std::option::Option<&str> {
32473 match self {
32474 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
32475 Self::GceMetadata => std::option::Option::Some("GCE_METADATA"),
32476 Self::GkeMetadata => std::option::Option::Some("GKE_METADATA"),
32477 Self::UnknownValue(u) => u.0.name(),
32478 }
32479 }
32480 }
32481
32482 impl std::default::Default for Mode {
32483 fn default() -> Self {
32484 use std::convert::From;
32485 Self::from(0)
32486 }
32487 }
32488
32489 impl std::fmt::Display for Mode {
32490 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32491 wkt::internal::display_enum(f, self.name(), self.value())
32492 }
32493 }
32494
32495 impl std::convert::From<i32> for Mode {
32496 fn from(value: i32) -> Self {
32497 match value {
32498 0 => Self::Unspecified,
32499 1 => Self::GceMetadata,
32500 2 => Self::GkeMetadata,
32501 _ => Self::UnknownValue(mode::UnknownValue(
32502 wkt::internal::UnknownEnumValue::Integer(value),
32503 )),
32504 }
32505 }
32506 }
32507
32508 impl std::convert::From<&str> for Mode {
32509 fn from(value: &str) -> Self {
32510 use std::string::ToString;
32511 match value {
32512 "MODE_UNSPECIFIED" => Self::Unspecified,
32513 "GCE_METADATA" => Self::GceMetadata,
32514 "GKE_METADATA" => Self::GkeMetadata,
32515 _ => Self::UnknownValue(mode::UnknownValue(
32516 wkt::internal::UnknownEnumValue::String(value.to_string()),
32517 )),
32518 }
32519 }
32520 }
32521
32522 impl serde::ser::Serialize for Mode {
32523 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32524 where
32525 S: serde::Serializer,
32526 {
32527 match self {
32528 Self::Unspecified => serializer.serialize_i32(0),
32529 Self::GceMetadata => serializer.serialize_i32(1),
32530 Self::GkeMetadata => serializer.serialize_i32(2),
32531 Self::UnknownValue(u) => u.0.serialize(serializer),
32532 }
32533 }
32534 }
32535
32536 impl<'de> serde::de::Deserialize<'de> for Mode {
32537 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32538 where
32539 D: serde::Deserializer<'de>,
32540 {
32541 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
32542 ".google.container.v1.WorkloadMetadataConfig.Mode",
32543 ))
32544 }
32545 }
32546}
32547
32548/// SetNetworkPolicyRequest enables/disables network policy for a cluster.
32549#[derive(Clone, Default, PartialEq)]
32550#[non_exhaustive]
32551pub struct SetNetworkPolicyRequest {
32552 /// Deprecated. The Google Developers Console [project ID or project
32553 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
32554 /// This field has been deprecated and replaced by the name field.
32555 #[deprecated]
32556 pub project_id: std::string::String,
32557
32558 /// Deprecated. The name of the Google Compute Engine
32559 /// [zone](https://cloud.google.com/compute/docs/zones#available)
32560 /// in which the cluster resides. This field has been deprecated and replaced
32561 /// by the name field.
32562 #[deprecated]
32563 pub zone: std::string::String,
32564
32565 /// Deprecated. The name of the cluster.
32566 /// This field has been deprecated and replaced by the name field.
32567 #[deprecated]
32568 pub cluster_id: std::string::String,
32569
32570 /// Required. Configuration options for the NetworkPolicy feature.
32571 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
32572
32573 /// The name (project, location, cluster name) of the cluster to set networking
32574 /// policy. Specified in the format `projects/*/locations/*/clusters/*`.
32575 pub name: std::string::String,
32576
32577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32578}
32579
32580impl SetNetworkPolicyRequest {
32581 /// Creates a new default instance.
32582 pub fn new() -> Self {
32583 std::default::Default::default()
32584 }
32585
32586 /// Sets the value of [project_id][crate::model::SetNetworkPolicyRequest::project_id].
32587 ///
32588 /// # Example
32589 /// ```ignore,no_run
32590 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32591 /// let x = SetNetworkPolicyRequest::new().set_project_id("example");
32592 /// ```
32593 #[deprecated]
32594 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32595 self.project_id = v.into();
32596 self
32597 }
32598
32599 /// Sets the value of [zone][crate::model::SetNetworkPolicyRequest::zone].
32600 ///
32601 /// # Example
32602 /// ```ignore,no_run
32603 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32604 /// let x = SetNetworkPolicyRequest::new().set_zone("example");
32605 /// ```
32606 #[deprecated]
32607 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32608 self.zone = v.into();
32609 self
32610 }
32611
32612 /// Sets the value of [cluster_id][crate::model::SetNetworkPolicyRequest::cluster_id].
32613 ///
32614 /// # Example
32615 /// ```ignore,no_run
32616 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32617 /// let x = SetNetworkPolicyRequest::new().set_cluster_id("example");
32618 /// ```
32619 #[deprecated]
32620 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32621 self.cluster_id = v.into();
32622 self
32623 }
32624
32625 /// Sets the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
32626 ///
32627 /// # Example
32628 /// ```ignore,no_run
32629 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32630 /// use google_cloud_container_v1::model::NetworkPolicy;
32631 /// let x = SetNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
32632 /// ```
32633 pub fn set_network_policy<T>(mut self, v: T) -> Self
32634 where
32635 T: std::convert::Into<crate::model::NetworkPolicy>,
32636 {
32637 self.network_policy = std::option::Option::Some(v.into());
32638 self
32639 }
32640
32641 /// Sets or clears the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
32642 ///
32643 /// # Example
32644 /// ```ignore,no_run
32645 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32646 /// use google_cloud_container_v1::model::NetworkPolicy;
32647 /// let x = SetNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
32648 /// let x = SetNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
32649 /// ```
32650 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
32651 where
32652 T: std::convert::Into<crate::model::NetworkPolicy>,
32653 {
32654 self.network_policy = v.map(|x| x.into());
32655 self
32656 }
32657
32658 /// Sets the value of [name][crate::model::SetNetworkPolicyRequest::name].
32659 ///
32660 /// # Example
32661 /// ```ignore,no_run
32662 /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
32663 /// let x = SetNetworkPolicyRequest::new().set_name("example");
32664 /// ```
32665 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32666 self.name = v.into();
32667 self
32668 }
32669}
32670
32671impl wkt::message::Message for SetNetworkPolicyRequest {
32672 fn typename() -> &'static str {
32673 "type.googleapis.com/google.container.v1.SetNetworkPolicyRequest"
32674 }
32675}
32676
32677/// SetMaintenancePolicyRequest sets the maintenance policy for a cluster.
32678#[derive(Clone, Default, PartialEq)]
32679#[non_exhaustive]
32680pub struct SetMaintenancePolicyRequest {
32681 /// Required. The Google Developers Console [project ID or project
32682 /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
32683 pub project_id: std::string::String,
32684
32685 /// Required. The name of the Google Compute Engine
32686 /// [zone](https://cloud.google.com/compute/docs/zones#available)
32687 /// in which the cluster resides.
32688 pub zone: std::string::String,
32689
32690 /// Required. The name of the cluster to update.
32691 pub cluster_id: std::string::String,
32692
32693 /// Required. The maintenance policy to be set for the cluster. An empty field
32694 /// clears the existing maintenance policy.
32695 pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
32696
32697 /// The name (project, location, cluster name) of the cluster to set
32698 /// maintenance policy.
32699 /// Specified in the format `projects/*/locations/*/clusters/*`.
32700 pub name: std::string::String,
32701
32702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32703}
32704
32705impl SetMaintenancePolicyRequest {
32706 /// Creates a new default instance.
32707 pub fn new() -> Self {
32708 std::default::Default::default()
32709 }
32710
32711 /// Sets the value of [project_id][crate::model::SetMaintenancePolicyRequest::project_id].
32712 ///
32713 /// # Example
32714 /// ```ignore,no_run
32715 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32716 /// let x = SetMaintenancePolicyRequest::new().set_project_id("example");
32717 /// ```
32718 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32719 self.project_id = v.into();
32720 self
32721 }
32722
32723 /// Sets the value of [zone][crate::model::SetMaintenancePolicyRequest::zone].
32724 ///
32725 /// # Example
32726 /// ```ignore,no_run
32727 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32728 /// let x = SetMaintenancePolicyRequest::new().set_zone("example");
32729 /// ```
32730 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32731 self.zone = v.into();
32732 self
32733 }
32734
32735 /// Sets the value of [cluster_id][crate::model::SetMaintenancePolicyRequest::cluster_id].
32736 ///
32737 /// # Example
32738 /// ```ignore,no_run
32739 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32740 /// let x = SetMaintenancePolicyRequest::new().set_cluster_id("example");
32741 /// ```
32742 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32743 self.cluster_id = v.into();
32744 self
32745 }
32746
32747 /// Sets the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
32748 ///
32749 /// # Example
32750 /// ```ignore,no_run
32751 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32752 /// use google_cloud_container_v1::model::MaintenancePolicy;
32753 /// let x = SetMaintenancePolicyRequest::new().set_maintenance_policy(MaintenancePolicy::default()/* use setters */);
32754 /// ```
32755 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
32756 where
32757 T: std::convert::Into<crate::model::MaintenancePolicy>,
32758 {
32759 self.maintenance_policy = std::option::Option::Some(v.into());
32760 self
32761 }
32762
32763 /// Sets or clears the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
32764 ///
32765 /// # Example
32766 /// ```ignore,no_run
32767 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32768 /// use google_cloud_container_v1::model::MaintenancePolicy;
32769 /// let x = SetMaintenancePolicyRequest::new().set_or_clear_maintenance_policy(Some(MaintenancePolicy::default()/* use setters */));
32770 /// let x = SetMaintenancePolicyRequest::new().set_or_clear_maintenance_policy(None::<MaintenancePolicy>);
32771 /// ```
32772 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
32773 where
32774 T: std::convert::Into<crate::model::MaintenancePolicy>,
32775 {
32776 self.maintenance_policy = v.map(|x| x.into());
32777 self
32778 }
32779
32780 /// Sets the value of [name][crate::model::SetMaintenancePolicyRequest::name].
32781 ///
32782 /// # Example
32783 /// ```ignore,no_run
32784 /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
32785 /// let x = SetMaintenancePolicyRequest::new().set_name("example");
32786 /// ```
32787 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32788 self.name = v.into();
32789 self
32790 }
32791}
32792
32793impl wkt::message::Message for SetMaintenancePolicyRequest {
32794 fn typename() -> &'static str {
32795 "type.googleapis.com/google.container.v1.SetMaintenancePolicyRequest"
32796 }
32797}
32798
32799/// StatusCondition describes why a cluster or a node pool has a certain status
32800/// (e.g., ERROR or DEGRADED).
32801#[derive(Clone, Default, PartialEq)]
32802#[non_exhaustive]
32803pub struct StatusCondition {
32804 /// Machine-friendly representation of the condition
32805 /// Deprecated. Use canonical_code instead.
32806 #[deprecated]
32807 pub code: crate::model::status_condition::Code,
32808
32809 /// Human-friendly representation of the condition
32810 pub message: std::string::String,
32811
32812 /// Canonical code of the condition.
32813 pub canonical_code: google_cloud_rpc::model::Code,
32814
32815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32816}
32817
32818impl StatusCondition {
32819 /// Creates a new default instance.
32820 pub fn new() -> Self {
32821 std::default::Default::default()
32822 }
32823
32824 /// Sets the value of [code][crate::model::StatusCondition::code].
32825 ///
32826 /// # Example
32827 /// ```ignore,no_run
32828 /// # use google_cloud_container_v1::model::StatusCondition;
32829 /// use google_cloud_container_v1::model::status_condition::Code;
32830 /// let x0 = StatusCondition::new().set_code(Code::GceStockout);
32831 /// let x1 = StatusCondition::new().set_code(Code::GkeServiceAccountDeleted);
32832 /// let x2 = StatusCondition::new().set_code(Code::GceQuotaExceeded);
32833 /// ```
32834 #[deprecated]
32835 pub fn set_code<T: std::convert::Into<crate::model::status_condition::Code>>(
32836 mut self,
32837 v: T,
32838 ) -> Self {
32839 self.code = v.into();
32840 self
32841 }
32842
32843 /// Sets the value of [message][crate::model::StatusCondition::message].
32844 ///
32845 /// # Example
32846 /// ```ignore,no_run
32847 /// # use google_cloud_container_v1::model::StatusCondition;
32848 /// let x = StatusCondition::new().set_message("example");
32849 /// ```
32850 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32851 self.message = v.into();
32852 self
32853 }
32854
32855 /// Sets the value of [canonical_code][crate::model::StatusCondition::canonical_code].
32856 ///
32857 /// # Example
32858 /// ```ignore,no_run
32859 /// # use google_cloud_container_v1::model::StatusCondition;
32860 /// use google_cloud_rpc::model::Code;
32861 /// let x0 = StatusCondition::new().set_canonical_code(Code::Cancelled);
32862 /// let x1 = StatusCondition::new().set_canonical_code(Code::Unknown);
32863 /// let x2 = StatusCondition::new().set_canonical_code(Code::InvalidArgument);
32864 /// ```
32865 pub fn set_canonical_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
32866 mut self,
32867 v: T,
32868 ) -> Self {
32869 self.canonical_code = v.into();
32870 self
32871 }
32872}
32873
32874impl wkt::message::Message for StatusCondition {
32875 fn typename() -> &'static str {
32876 "type.googleapis.com/google.container.v1.StatusCondition"
32877 }
32878}
32879
32880/// Defines additional types related to [StatusCondition].
32881pub mod status_condition {
32882 #[allow(unused_imports)]
32883 use super::*;
32884
32885 /// Code for each condition
32886 ///
32887 /// # Working with unknown values
32888 ///
32889 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32890 /// additional enum variants at any time. Adding new variants is not considered
32891 /// a breaking change. Applications should write their code in anticipation of:
32892 ///
32893 /// - New values appearing in future releases of the client library, **and**
32894 /// - New values received dynamically, without application changes.
32895 ///
32896 /// Please consult the [Working with enums] section in the user guide for some
32897 /// guidelines.
32898 ///
32899 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32900 #[derive(Clone, Debug, PartialEq)]
32901 #[non_exhaustive]
32902 pub enum Code {
32903 /// UNKNOWN indicates a generic condition.
32904 Unknown,
32905 /// GCE_STOCKOUT indicates that Google Compute Engine resources are
32906 /// temporarily unavailable.
32907 GceStockout,
32908 /// GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot
32909 /// service account.
32910 GkeServiceAccountDeleted,
32911 /// Google Compute Engine quota was exceeded.
32912 GceQuotaExceeded,
32913 /// Cluster state was manually changed by an SRE due to a system logic error.
32914 SetByOperator,
32915 /// Unable to perform an encrypt operation against the CloudKMS key used for
32916 /// etcd level encryption.
32917 CloudKmsKeyError,
32918 /// Cluster CA is expiring soon.
32919 CaExpiring,
32920 /// Node service account is missing permissions.
32921 NodeServiceAccountMissingPermissions,
32922 /// Cloud KMS key version used for etcd level encryption has been destroyed.
32923 /// This is a permanent error.
32924 CloudKmsKeyDestroyed,
32925 /// If set, the enum was initialized with an unknown value.
32926 ///
32927 /// Applications can examine the value using [Code::value] or
32928 /// [Code::name].
32929 UnknownValue(code::UnknownValue),
32930 }
32931
32932 #[doc(hidden)]
32933 pub mod code {
32934 #[allow(unused_imports)]
32935 use super::*;
32936 #[derive(Clone, Debug, PartialEq)]
32937 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32938 }
32939
32940 impl Code {
32941 /// Gets the enum value.
32942 ///
32943 /// Returns `None` if the enum contains an unknown value deserialized from
32944 /// the string representation of enums.
32945 pub fn value(&self) -> std::option::Option<i32> {
32946 match self {
32947 Self::Unknown => std::option::Option::Some(0),
32948 Self::GceStockout => std::option::Option::Some(1),
32949 Self::GkeServiceAccountDeleted => std::option::Option::Some(2),
32950 Self::GceQuotaExceeded => std::option::Option::Some(3),
32951 Self::SetByOperator => std::option::Option::Some(4),
32952 Self::CloudKmsKeyError => std::option::Option::Some(7),
32953 Self::CaExpiring => std::option::Option::Some(9),
32954 Self::NodeServiceAccountMissingPermissions => std::option::Option::Some(10),
32955 Self::CloudKmsKeyDestroyed => std::option::Option::Some(11),
32956 Self::UnknownValue(u) => u.0.value(),
32957 }
32958 }
32959
32960 /// Gets the enum value as a string.
32961 ///
32962 /// Returns `None` if the enum contains an unknown value deserialized from
32963 /// the integer representation of enums.
32964 pub fn name(&self) -> std::option::Option<&str> {
32965 match self {
32966 Self::Unknown => std::option::Option::Some("UNKNOWN"),
32967 Self::GceStockout => std::option::Option::Some("GCE_STOCKOUT"),
32968 Self::GkeServiceAccountDeleted => {
32969 std::option::Option::Some("GKE_SERVICE_ACCOUNT_DELETED")
32970 }
32971 Self::GceQuotaExceeded => std::option::Option::Some("GCE_QUOTA_EXCEEDED"),
32972 Self::SetByOperator => std::option::Option::Some("SET_BY_OPERATOR"),
32973 Self::CloudKmsKeyError => std::option::Option::Some("CLOUD_KMS_KEY_ERROR"),
32974 Self::CaExpiring => std::option::Option::Some("CA_EXPIRING"),
32975 Self::NodeServiceAccountMissingPermissions => {
32976 std::option::Option::Some("NODE_SERVICE_ACCOUNT_MISSING_PERMISSIONS")
32977 }
32978 Self::CloudKmsKeyDestroyed => std::option::Option::Some("CLOUD_KMS_KEY_DESTROYED"),
32979 Self::UnknownValue(u) => u.0.name(),
32980 }
32981 }
32982 }
32983
32984 impl std::default::Default for Code {
32985 fn default() -> Self {
32986 use std::convert::From;
32987 Self::from(0)
32988 }
32989 }
32990
32991 impl std::fmt::Display for Code {
32992 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32993 wkt::internal::display_enum(f, self.name(), self.value())
32994 }
32995 }
32996
32997 impl std::convert::From<i32> for Code {
32998 fn from(value: i32) -> Self {
32999 match value {
33000 0 => Self::Unknown,
33001 1 => Self::GceStockout,
33002 2 => Self::GkeServiceAccountDeleted,
33003 3 => Self::GceQuotaExceeded,
33004 4 => Self::SetByOperator,
33005 7 => Self::CloudKmsKeyError,
33006 9 => Self::CaExpiring,
33007 10 => Self::NodeServiceAccountMissingPermissions,
33008 11 => Self::CloudKmsKeyDestroyed,
33009 _ => Self::UnknownValue(code::UnknownValue(
33010 wkt::internal::UnknownEnumValue::Integer(value),
33011 )),
33012 }
33013 }
33014 }
33015
33016 impl std::convert::From<&str> for Code {
33017 fn from(value: &str) -> Self {
33018 use std::string::ToString;
33019 match value {
33020 "UNKNOWN" => Self::Unknown,
33021 "GCE_STOCKOUT" => Self::GceStockout,
33022 "GKE_SERVICE_ACCOUNT_DELETED" => Self::GkeServiceAccountDeleted,
33023 "GCE_QUOTA_EXCEEDED" => Self::GceQuotaExceeded,
33024 "SET_BY_OPERATOR" => Self::SetByOperator,
33025 "CLOUD_KMS_KEY_ERROR" => Self::CloudKmsKeyError,
33026 "CA_EXPIRING" => Self::CaExpiring,
33027 "NODE_SERVICE_ACCOUNT_MISSING_PERMISSIONS" => {
33028 Self::NodeServiceAccountMissingPermissions
33029 }
33030 "CLOUD_KMS_KEY_DESTROYED" => Self::CloudKmsKeyDestroyed,
33031 _ => Self::UnknownValue(code::UnknownValue(
33032 wkt::internal::UnknownEnumValue::String(value.to_string()),
33033 )),
33034 }
33035 }
33036 }
33037
33038 impl serde::ser::Serialize for Code {
33039 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33040 where
33041 S: serde::Serializer,
33042 {
33043 match self {
33044 Self::Unknown => serializer.serialize_i32(0),
33045 Self::GceStockout => serializer.serialize_i32(1),
33046 Self::GkeServiceAccountDeleted => serializer.serialize_i32(2),
33047 Self::GceQuotaExceeded => serializer.serialize_i32(3),
33048 Self::SetByOperator => serializer.serialize_i32(4),
33049 Self::CloudKmsKeyError => serializer.serialize_i32(7),
33050 Self::CaExpiring => serializer.serialize_i32(9),
33051 Self::NodeServiceAccountMissingPermissions => serializer.serialize_i32(10),
33052 Self::CloudKmsKeyDestroyed => serializer.serialize_i32(11),
33053 Self::UnknownValue(u) => u.0.serialize(serializer),
33054 }
33055 }
33056 }
33057
33058 impl<'de> serde::de::Deserialize<'de> for Code {
33059 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33060 where
33061 D: serde::Deserializer<'de>,
33062 {
33063 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
33064 ".google.container.v1.StatusCondition.Code",
33065 ))
33066 }
33067 }
33068}
33069
33070/// NetworkConfig reports the relative names of network & subnetwork.
33071#[derive(Clone, Default, PartialEq)]
33072#[non_exhaustive]
33073pub struct NetworkConfig {
33074 /// Output only. The relative name of the Google Compute Engine
33075 /// [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks)
33076 /// to which the cluster is connected. Example:
33077 /// projects/my-project/global/networks/my-network
33078 pub network: std::string::String,
33079
33080 /// Output only. The relative name of the Google Compute Engine
33081 /// [subnetwork](https://cloud.google.com/compute/docs/vpc)
33082 /// to which the cluster is connected. Example:
33083 /// projects/my-project/regions/us-central1/subnetworks/my-subnet
33084 pub subnetwork: std::string::String,
33085
33086 /// Whether Intra-node visibility is enabled for this cluster.
33087 /// This makes same node pod to pod traffic visible for VPC network.
33088 pub enable_intra_node_visibility: bool,
33089
33090 /// Whether the cluster disables default in-node sNAT rules. In-node sNAT rules
33091 /// will be disabled when default_snat_status is disabled. When disabled is set
33092 /// to false, default IP masquerade rules will be applied to the nodes to
33093 /// prevent sNAT on cluster internal traffic.
33094 pub default_snat_status: std::option::Option<crate::model::DefaultSnatStatus>,
33095
33096 /// Whether L4ILB Subsetting is enabled for this cluster.
33097 pub enable_l4ilb_subsetting: bool,
33098
33099 /// The desired datapath provider for this cluster. By default, uses the
33100 /// IPTables-based kube-proxy implementation.
33101 pub datapath_provider: crate::model::DatapathProvider,
33102
33103 /// The desired state of IPv6 connectivity to Google Services.
33104 /// By default, no private IPv6 access to or from Google Services (all access
33105 /// will be via IPv4)
33106 pub private_ipv6_google_access: crate::model::PrivateIPv6GoogleAccess,
33107
33108 /// DNSConfig contains clusterDNS config for this cluster.
33109 pub dns_config: std::option::Option<crate::model::DNSConfig>,
33110
33111 /// ServiceExternalIPsConfig specifies if services with externalIPs field are
33112 /// blocked or not.
33113 pub service_external_ips_config: std::option::Option<crate::model::ServiceExternalIPsConfig>,
33114
33115 /// GatewayAPIConfig contains the desired config of Gateway API on this
33116 /// cluster.
33117 pub gateway_api_config: std::option::Option<crate::model::GatewayAPIConfig>,
33118
33119 /// Whether multi-networking is enabled for this cluster.
33120 pub enable_multi_networking: bool,
33121
33122 /// Network bandwidth tier configuration.
33123 pub network_performance_config:
33124 std::option::Option<crate::model::network_config::ClusterNetworkPerformanceConfig>,
33125
33126 /// Whether FQDN Network Policy is enabled on this cluster.
33127 pub enable_fqdn_network_policy: std::option::Option<bool>,
33128
33129 /// Specify the details of in-transit encryption.
33130 /// Now named inter-node transparent encryption.
33131 pub in_transit_encryption_config: std::option::Option<crate::model::InTransitEncryptionConfig>,
33132
33133 /// Whether CiliumClusterwideNetworkPolicy is enabled on this cluster.
33134 pub enable_cilium_clusterwide_network_policy: std::option::Option<bool>,
33135
33136 /// Controls whether by default nodes have private IP addresses only.
33137 /// It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][]
33138 /// and this field at the same time.
33139 /// To update the default setting, use
33140 /// [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes]
33141 pub default_enable_private_nodes: std::option::Option<bool>,
33142
33143 /// Optional. DataplaneV2Config specifies the DPv2 configuration.
33144 pub dataplane_v2_config: std::option::Option<crate::model::DataplaneV2Config>,
33145
33146 /// Disable L4 load balancer VPC firewalls to enable firewall policies.
33147 pub disable_l4_lb_firewall_reconciliation: std::option::Option<bool>,
33148
33149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33150}
33151
33152impl NetworkConfig {
33153 /// Creates a new default instance.
33154 pub fn new() -> Self {
33155 std::default::Default::default()
33156 }
33157
33158 /// Sets the value of [network][crate::model::NetworkConfig::network].
33159 ///
33160 /// # Example
33161 /// ```ignore,no_run
33162 /// # use google_cloud_container_v1::model::NetworkConfig;
33163 /// let x = NetworkConfig::new().set_network("example");
33164 /// ```
33165 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33166 self.network = v.into();
33167 self
33168 }
33169
33170 /// Sets the value of [subnetwork][crate::model::NetworkConfig::subnetwork].
33171 ///
33172 /// # Example
33173 /// ```ignore,no_run
33174 /// # use google_cloud_container_v1::model::NetworkConfig;
33175 /// let x = NetworkConfig::new().set_subnetwork("example");
33176 /// ```
33177 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33178 self.subnetwork = v.into();
33179 self
33180 }
33181
33182 /// Sets the value of [enable_intra_node_visibility][crate::model::NetworkConfig::enable_intra_node_visibility].
33183 ///
33184 /// # Example
33185 /// ```ignore,no_run
33186 /// # use google_cloud_container_v1::model::NetworkConfig;
33187 /// let x = NetworkConfig::new().set_enable_intra_node_visibility(true);
33188 /// ```
33189 pub fn set_enable_intra_node_visibility<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33190 self.enable_intra_node_visibility = v.into();
33191 self
33192 }
33193
33194 /// Sets the value of [default_snat_status][crate::model::NetworkConfig::default_snat_status].
33195 ///
33196 /// # Example
33197 /// ```ignore,no_run
33198 /// # use google_cloud_container_v1::model::NetworkConfig;
33199 /// use google_cloud_container_v1::model::DefaultSnatStatus;
33200 /// let x = NetworkConfig::new().set_default_snat_status(DefaultSnatStatus::default()/* use setters */);
33201 /// ```
33202 pub fn set_default_snat_status<T>(mut self, v: T) -> Self
33203 where
33204 T: std::convert::Into<crate::model::DefaultSnatStatus>,
33205 {
33206 self.default_snat_status = std::option::Option::Some(v.into());
33207 self
33208 }
33209
33210 /// Sets or clears the value of [default_snat_status][crate::model::NetworkConfig::default_snat_status].
33211 ///
33212 /// # Example
33213 /// ```ignore,no_run
33214 /// # use google_cloud_container_v1::model::NetworkConfig;
33215 /// use google_cloud_container_v1::model::DefaultSnatStatus;
33216 /// let x = NetworkConfig::new().set_or_clear_default_snat_status(Some(DefaultSnatStatus::default()/* use setters */));
33217 /// let x = NetworkConfig::new().set_or_clear_default_snat_status(None::<DefaultSnatStatus>);
33218 /// ```
33219 pub fn set_or_clear_default_snat_status<T>(mut self, v: std::option::Option<T>) -> Self
33220 where
33221 T: std::convert::Into<crate::model::DefaultSnatStatus>,
33222 {
33223 self.default_snat_status = v.map(|x| x.into());
33224 self
33225 }
33226
33227 /// Sets the value of [enable_l4ilb_subsetting][crate::model::NetworkConfig::enable_l4ilb_subsetting].
33228 ///
33229 /// # Example
33230 /// ```ignore,no_run
33231 /// # use google_cloud_container_v1::model::NetworkConfig;
33232 /// let x = NetworkConfig::new().set_enable_l4ilb_subsetting(true);
33233 /// ```
33234 pub fn set_enable_l4ilb_subsetting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33235 self.enable_l4ilb_subsetting = v.into();
33236 self
33237 }
33238
33239 /// Sets the value of [datapath_provider][crate::model::NetworkConfig::datapath_provider].
33240 ///
33241 /// # Example
33242 /// ```ignore,no_run
33243 /// # use google_cloud_container_v1::model::NetworkConfig;
33244 /// use google_cloud_container_v1::model::DatapathProvider;
33245 /// let x0 = NetworkConfig::new().set_datapath_provider(DatapathProvider::LegacyDatapath);
33246 /// let x1 = NetworkConfig::new().set_datapath_provider(DatapathProvider::AdvancedDatapath);
33247 /// ```
33248 pub fn set_datapath_provider<T: std::convert::Into<crate::model::DatapathProvider>>(
33249 mut self,
33250 v: T,
33251 ) -> Self {
33252 self.datapath_provider = v.into();
33253 self
33254 }
33255
33256 /// Sets the value of [private_ipv6_google_access][crate::model::NetworkConfig::private_ipv6_google_access].
33257 ///
33258 /// # Example
33259 /// ```ignore,no_run
33260 /// # use google_cloud_container_v1::model::NetworkConfig;
33261 /// use google_cloud_container_v1::model::PrivateIPv6GoogleAccess;
33262 /// let x0 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessDisabled);
33263 /// let x1 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessToGoogle);
33264 /// let x2 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessBidirectional);
33265 /// ```
33266 pub fn set_private_ipv6_google_access<
33267 T: std::convert::Into<crate::model::PrivateIPv6GoogleAccess>,
33268 >(
33269 mut self,
33270 v: T,
33271 ) -> Self {
33272 self.private_ipv6_google_access = v.into();
33273 self
33274 }
33275
33276 /// Sets the value of [dns_config][crate::model::NetworkConfig::dns_config].
33277 ///
33278 /// # Example
33279 /// ```ignore,no_run
33280 /// # use google_cloud_container_v1::model::NetworkConfig;
33281 /// use google_cloud_container_v1::model::DNSConfig;
33282 /// let x = NetworkConfig::new().set_dns_config(DNSConfig::default()/* use setters */);
33283 /// ```
33284 pub fn set_dns_config<T>(mut self, v: T) -> Self
33285 where
33286 T: std::convert::Into<crate::model::DNSConfig>,
33287 {
33288 self.dns_config = std::option::Option::Some(v.into());
33289 self
33290 }
33291
33292 /// Sets or clears the value of [dns_config][crate::model::NetworkConfig::dns_config].
33293 ///
33294 /// # Example
33295 /// ```ignore,no_run
33296 /// # use google_cloud_container_v1::model::NetworkConfig;
33297 /// use google_cloud_container_v1::model::DNSConfig;
33298 /// let x = NetworkConfig::new().set_or_clear_dns_config(Some(DNSConfig::default()/* use setters */));
33299 /// let x = NetworkConfig::new().set_or_clear_dns_config(None::<DNSConfig>);
33300 /// ```
33301 pub fn set_or_clear_dns_config<T>(mut self, v: std::option::Option<T>) -> Self
33302 where
33303 T: std::convert::Into<crate::model::DNSConfig>,
33304 {
33305 self.dns_config = v.map(|x| x.into());
33306 self
33307 }
33308
33309 /// Sets the value of [service_external_ips_config][crate::model::NetworkConfig::service_external_ips_config].
33310 ///
33311 /// # Example
33312 /// ```ignore,no_run
33313 /// # use google_cloud_container_v1::model::NetworkConfig;
33314 /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
33315 /// let x = NetworkConfig::new().set_service_external_ips_config(ServiceExternalIPsConfig::default()/* use setters */);
33316 /// ```
33317 pub fn set_service_external_ips_config<T>(mut self, v: T) -> Self
33318 where
33319 T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
33320 {
33321 self.service_external_ips_config = std::option::Option::Some(v.into());
33322 self
33323 }
33324
33325 /// Sets or clears the value of [service_external_ips_config][crate::model::NetworkConfig::service_external_ips_config].
33326 ///
33327 /// # Example
33328 /// ```ignore,no_run
33329 /// # use google_cloud_container_v1::model::NetworkConfig;
33330 /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
33331 /// let x = NetworkConfig::new().set_or_clear_service_external_ips_config(Some(ServiceExternalIPsConfig::default()/* use setters */));
33332 /// let x = NetworkConfig::new().set_or_clear_service_external_ips_config(None::<ServiceExternalIPsConfig>);
33333 /// ```
33334 pub fn set_or_clear_service_external_ips_config<T>(mut self, v: std::option::Option<T>) -> Self
33335 where
33336 T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
33337 {
33338 self.service_external_ips_config = v.map(|x| x.into());
33339 self
33340 }
33341
33342 /// Sets the value of [gateway_api_config][crate::model::NetworkConfig::gateway_api_config].
33343 ///
33344 /// # Example
33345 /// ```ignore,no_run
33346 /// # use google_cloud_container_v1::model::NetworkConfig;
33347 /// use google_cloud_container_v1::model::GatewayAPIConfig;
33348 /// let x = NetworkConfig::new().set_gateway_api_config(GatewayAPIConfig::default()/* use setters */);
33349 /// ```
33350 pub fn set_gateway_api_config<T>(mut self, v: T) -> Self
33351 where
33352 T: std::convert::Into<crate::model::GatewayAPIConfig>,
33353 {
33354 self.gateway_api_config = std::option::Option::Some(v.into());
33355 self
33356 }
33357
33358 /// Sets or clears the value of [gateway_api_config][crate::model::NetworkConfig::gateway_api_config].
33359 ///
33360 /// # Example
33361 /// ```ignore,no_run
33362 /// # use google_cloud_container_v1::model::NetworkConfig;
33363 /// use google_cloud_container_v1::model::GatewayAPIConfig;
33364 /// let x = NetworkConfig::new().set_or_clear_gateway_api_config(Some(GatewayAPIConfig::default()/* use setters */));
33365 /// let x = NetworkConfig::new().set_or_clear_gateway_api_config(None::<GatewayAPIConfig>);
33366 /// ```
33367 pub fn set_or_clear_gateway_api_config<T>(mut self, v: std::option::Option<T>) -> Self
33368 where
33369 T: std::convert::Into<crate::model::GatewayAPIConfig>,
33370 {
33371 self.gateway_api_config = v.map(|x| x.into());
33372 self
33373 }
33374
33375 /// Sets the value of [enable_multi_networking][crate::model::NetworkConfig::enable_multi_networking].
33376 ///
33377 /// # Example
33378 /// ```ignore,no_run
33379 /// # use google_cloud_container_v1::model::NetworkConfig;
33380 /// let x = NetworkConfig::new().set_enable_multi_networking(true);
33381 /// ```
33382 pub fn set_enable_multi_networking<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33383 self.enable_multi_networking = v.into();
33384 self
33385 }
33386
33387 /// Sets the value of [network_performance_config][crate::model::NetworkConfig::network_performance_config].
33388 ///
33389 /// # Example
33390 /// ```ignore,no_run
33391 /// # use google_cloud_container_v1::model::NetworkConfig;
33392 /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
33393 /// let x = NetworkConfig::new().set_network_performance_config(ClusterNetworkPerformanceConfig::default()/* use setters */);
33394 /// ```
33395 pub fn set_network_performance_config<T>(mut self, v: T) -> Self
33396 where
33397 T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
33398 {
33399 self.network_performance_config = std::option::Option::Some(v.into());
33400 self
33401 }
33402
33403 /// Sets or clears the value of [network_performance_config][crate::model::NetworkConfig::network_performance_config].
33404 ///
33405 /// # Example
33406 /// ```ignore,no_run
33407 /// # use google_cloud_container_v1::model::NetworkConfig;
33408 /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
33409 /// let x = NetworkConfig::new().set_or_clear_network_performance_config(Some(ClusterNetworkPerformanceConfig::default()/* use setters */));
33410 /// let x = NetworkConfig::new().set_or_clear_network_performance_config(None::<ClusterNetworkPerformanceConfig>);
33411 /// ```
33412 pub fn set_or_clear_network_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
33413 where
33414 T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
33415 {
33416 self.network_performance_config = v.map(|x| x.into());
33417 self
33418 }
33419
33420 /// Sets the value of [enable_fqdn_network_policy][crate::model::NetworkConfig::enable_fqdn_network_policy].
33421 ///
33422 /// # Example
33423 /// ```ignore,no_run
33424 /// # use google_cloud_container_v1::model::NetworkConfig;
33425 /// let x = NetworkConfig::new().set_enable_fqdn_network_policy(true);
33426 /// ```
33427 pub fn set_enable_fqdn_network_policy<T>(mut self, v: T) -> Self
33428 where
33429 T: std::convert::Into<bool>,
33430 {
33431 self.enable_fqdn_network_policy = std::option::Option::Some(v.into());
33432 self
33433 }
33434
33435 /// Sets or clears the value of [enable_fqdn_network_policy][crate::model::NetworkConfig::enable_fqdn_network_policy].
33436 ///
33437 /// # Example
33438 /// ```ignore,no_run
33439 /// # use google_cloud_container_v1::model::NetworkConfig;
33440 /// let x = NetworkConfig::new().set_or_clear_enable_fqdn_network_policy(Some(false));
33441 /// let x = NetworkConfig::new().set_or_clear_enable_fqdn_network_policy(None::<bool>);
33442 /// ```
33443 pub fn set_or_clear_enable_fqdn_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
33444 where
33445 T: std::convert::Into<bool>,
33446 {
33447 self.enable_fqdn_network_policy = v.map(|x| x.into());
33448 self
33449 }
33450
33451 /// Sets the value of [in_transit_encryption_config][crate::model::NetworkConfig::in_transit_encryption_config].
33452 ///
33453 /// # Example
33454 /// ```ignore,no_run
33455 /// # use google_cloud_container_v1::model::NetworkConfig;
33456 /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
33457 /// let x0 = NetworkConfig::new().set_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionDisabled);
33458 /// let x1 = NetworkConfig::new().set_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent);
33459 /// ```
33460 pub fn set_in_transit_encryption_config<T>(mut self, v: T) -> Self
33461 where
33462 T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
33463 {
33464 self.in_transit_encryption_config = std::option::Option::Some(v.into());
33465 self
33466 }
33467
33468 /// Sets or clears the value of [in_transit_encryption_config][crate::model::NetworkConfig::in_transit_encryption_config].
33469 ///
33470 /// # Example
33471 /// ```ignore,no_run
33472 /// # use google_cloud_container_v1::model::NetworkConfig;
33473 /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
33474 /// let x0 = NetworkConfig::new().set_or_clear_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionDisabled));
33475 /// let x1 = NetworkConfig::new().set_or_clear_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent));
33476 /// let x_none = NetworkConfig::new().set_or_clear_in_transit_encryption_config(None::<InTransitEncryptionConfig>);
33477 /// ```
33478 pub fn set_or_clear_in_transit_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
33479 where
33480 T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
33481 {
33482 self.in_transit_encryption_config = v.map(|x| x.into());
33483 self
33484 }
33485
33486 /// Sets the value of [enable_cilium_clusterwide_network_policy][crate::model::NetworkConfig::enable_cilium_clusterwide_network_policy].
33487 ///
33488 /// # Example
33489 /// ```ignore,no_run
33490 /// # use google_cloud_container_v1::model::NetworkConfig;
33491 /// let x = NetworkConfig::new().set_enable_cilium_clusterwide_network_policy(true);
33492 /// ```
33493 pub fn set_enable_cilium_clusterwide_network_policy<T>(mut self, v: T) -> Self
33494 where
33495 T: std::convert::Into<bool>,
33496 {
33497 self.enable_cilium_clusterwide_network_policy = std::option::Option::Some(v.into());
33498 self
33499 }
33500
33501 /// Sets or clears the value of [enable_cilium_clusterwide_network_policy][crate::model::NetworkConfig::enable_cilium_clusterwide_network_policy].
33502 ///
33503 /// # Example
33504 /// ```ignore,no_run
33505 /// # use google_cloud_container_v1::model::NetworkConfig;
33506 /// let x = NetworkConfig::new().set_or_clear_enable_cilium_clusterwide_network_policy(Some(false));
33507 /// let x = NetworkConfig::new().set_or_clear_enable_cilium_clusterwide_network_policy(None::<bool>);
33508 /// ```
33509 pub fn set_or_clear_enable_cilium_clusterwide_network_policy<T>(
33510 mut self,
33511 v: std::option::Option<T>,
33512 ) -> Self
33513 where
33514 T: std::convert::Into<bool>,
33515 {
33516 self.enable_cilium_clusterwide_network_policy = v.map(|x| x.into());
33517 self
33518 }
33519
33520 /// Sets the value of [default_enable_private_nodes][crate::model::NetworkConfig::default_enable_private_nodes].
33521 ///
33522 /// # Example
33523 /// ```ignore,no_run
33524 /// # use google_cloud_container_v1::model::NetworkConfig;
33525 /// let x = NetworkConfig::new().set_default_enable_private_nodes(true);
33526 /// ```
33527 pub fn set_default_enable_private_nodes<T>(mut self, v: T) -> Self
33528 where
33529 T: std::convert::Into<bool>,
33530 {
33531 self.default_enable_private_nodes = std::option::Option::Some(v.into());
33532 self
33533 }
33534
33535 /// Sets or clears the value of [default_enable_private_nodes][crate::model::NetworkConfig::default_enable_private_nodes].
33536 ///
33537 /// # Example
33538 /// ```ignore,no_run
33539 /// # use google_cloud_container_v1::model::NetworkConfig;
33540 /// let x = NetworkConfig::new().set_or_clear_default_enable_private_nodes(Some(false));
33541 /// let x = NetworkConfig::new().set_or_clear_default_enable_private_nodes(None::<bool>);
33542 /// ```
33543 pub fn set_or_clear_default_enable_private_nodes<T>(mut self, v: std::option::Option<T>) -> Self
33544 where
33545 T: std::convert::Into<bool>,
33546 {
33547 self.default_enable_private_nodes = v.map(|x| x.into());
33548 self
33549 }
33550
33551 /// Sets the value of [dataplane_v2_config][crate::model::NetworkConfig::dataplane_v2_config].
33552 ///
33553 /// # Example
33554 /// ```ignore,no_run
33555 /// # use google_cloud_container_v1::model::NetworkConfig;
33556 /// use google_cloud_container_v1::model::DataplaneV2Config;
33557 /// let x = NetworkConfig::new().set_dataplane_v2_config(DataplaneV2Config::default()/* use setters */);
33558 /// ```
33559 pub fn set_dataplane_v2_config<T>(mut self, v: T) -> Self
33560 where
33561 T: std::convert::Into<crate::model::DataplaneV2Config>,
33562 {
33563 self.dataplane_v2_config = std::option::Option::Some(v.into());
33564 self
33565 }
33566
33567 /// Sets or clears the value of [dataplane_v2_config][crate::model::NetworkConfig::dataplane_v2_config].
33568 ///
33569 /// # Example
33570 /// ```ignore,no_run
33571 /// # use google_cloud_container_v1::model::NetworkConfig;
33572 /// use google_cloud_container_v1::model::DataplaneV2Config;
33573 /// let x = NetworkConfig::new().set_or_clear_dataplane_v2_config(Some(DataplaneV2Config::default()/* use setters */));
33574 /// let x = NetworkConfig::new().set_or_clear_dataplane_v2_config(None::<DataplaneV2Config>);
33575 /// ```
33576 pub fn set_or_clear_dataplane_v2_config<T>(mut self, v: std::option::Option<T>) -> Self
33577 where
33578 T: std::convert::Into<crate::model::DataplaneV2Config>,
33579 {
33580 self.dataplane_v2_config = v.map(|x| x.into());
33581 self
33582 }
33583
33584 /// Sets the value of [disable_l4_lb_firewall_reconciliation][crate::model::NetworkConfig::disable_l4_lb_firewall_reconciliation].
33585 ///
33586 /// # Example
33587 /// ```ignore,no_run
33588 /// # use google_cloud_container_v1::model::NetworkConfig;
33589 /// let x = NetworkConfig::new().set_disable_l4_lb_firewall_reconciliation(true);
33590 /// ```
33591 pub fn set_disable_l4_lb_firewall_reconciliation<T>(mut self, v: T) -> Self
33592 where
33593 T: std::convert::Into<bool>,
33594 {
33595 self.disable_l4_lb_firewall_reconciliation = std::option::Option::Some(v.into());
33596 self
33597 }
33598
33599 /// Sets or clears the value of [disable_l4_lb_firewall_reconciliation][crate::model::NetworkConfig::disable_l4_lb_firewall_reconciliation].
33600 ///
33601 /// # Example
33602 /// ```ignore,no_run
33603 /// # use google_cloud_container_v1::model::NetworkConfig;
33604 /// let x = NetworkConfig::new().set_or_clear_disable_l4_lb_firewall_reconciliation(Some(false));
33605 /// let x = NetworkConfig::new().set_or_clear_disable_l4_lb_firewall_reconciliation(None::<bool>);
33606 /// ```
33607 pub fn set_or_clear_disable_l4_lb_firewall_reconciliation<T>(
33608 mut self,
33609 v: std::option::Option<T>,
33610 ) -> Self
33611 where
33612 T: std::convert::Into<bool>,
33613 {
33614 self.disable_l4_lb_firewall_reconciliation = v.map(|x| x.into());
33615 self
33616 }
33617}
33618
33619impl wkt::message::Message for NetworkConfig {
33620 fn typename() -> &'static str {
33621 "type.googleapis.com/google.container.v1.NetworkConfig"
33622 }
33623}
33624
33625/// Defines additional types related to [NetworkConfig].
33626pub mod network_config {
33627 #[allow(unused_imports)]
33628 use super::*;
33629
33630 /// Configuration of network bandwidth tiers
33631 #[derive(Clone, Default, PartialEq)]
33632 #[non_exhaustive]
33633 pub struct ClusterNetworkPerformanceConfig {
33634 /// Specifies the total network bandwidth tier for NodePools in the cluster.
33635 pub total_egress_bandwidth_tier: std::option::Option<
33636 crate::model::network_config::cluster_network_performance_config::Tier,
33637 >,
33638
33639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33640 }
33641
33642 impl ClusterNetworkPerformanceConfig {
33643 /// Creates a new default instance.
33644 pub fn new() -> Self {
33645 std::default::Default::default()
33646 }
33647
33648 /// Sets the value of [total_egress_bandwidth_tier][crate::model::network_config::ClusterNetworkPerformanceConfig::total_egress_bandwidth_tier].
33649 ///
33650 /// # Example
33651 /// ```ignore,no_run
33652 /// # use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
33653 /// use google_cloud_container_v1::model::network_config::cluster_network_performance_config::Tier;
33654 /// let x0 = ClusterNetworkPerformanceConfig::new().set_total_egress_bandwidth_tier(Tier::Tier1);
33655 /// ```
33656 pub fn set_total_egress_bandwidth_tier<T>(mut self, v: T) -> Self
33657 where
33658 T: std::convert::Into<
33659 crate::model::network_config::cluster_network_performance_config::Tier,
33660 >,
33661 {
33662 self.total_egress_bandwidth_tier = std::option::Option::Some(v.into());
33663 self
33664 }
33665
33666 /// Sets or clears the value of [total_egress_bandwidth_tier][crate::model::network_config::ClusterNetworkPerformanceConfig::total_egress_bandwidth_tier].
33667 ///
33668 /// # Example
33669 /// ```ignore,no_run
33670 /// # use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
33671 /// use google_cloud_container_v1::model::network_config::cluster_network_performance_config::Tier;
33672 /// let x0 = ClusterNetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(Some(Tier::Tier1));
33673 /// let x_none = ClusterNetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(None::<Tier>);
33674 /// ```
33675 pub fn set_or_clear_total_egress_bandwidth_tier<T>(
33676 mut self,
33677 v: std::option::Option<T>,
33678 ) -> Self
33679 where
33680 T: std::convert::Into<
33681 crate::model::network_config::cluster_network_performance_config::Tier,
33682 >,
33683 {
33684 self.total_egress_bandwidth_tier = v.map(|x| x.into());
33685 self
33686 }
33687 }
33688
33689 impl wkt::message::Message for ClusterNetworkPerformanceConfig {
33690 fn typename() -> &'static str {
33691 "type.googleapis.com/google.container.v1.NetworkConfig.ClusterNetworkPerformanceConfig"
33692 }
33693 }
33694
33695 /// Defines additional types related to [ClusterNetworkPerformanceConfig].
33696 pub mod cluster_network_performance_config {
33697 #[allow(unused_imports)]
33698 use super::*;
33699
33700 /// Node network tier
33701 ///
33702 /// # Working with unknown values
33703 ///
33704 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33705 /// additional enum variants at any time. Adding new variants is not considered
33706 /// a breaking change. Applications should write their code in anticipation of:
33707 ///
33708 /// - New values appearing in future releases of the client library, **and**
33709 /// - New values received dynamically, without application changes.
33710 ///
33711 /// Please consult the [Working with enums] section in the user guide for some
33712 /// guidelines.
33713 ///
33714 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33715 #[derive(Clone, Debug, PartialEq)]
33716 #[non_exhaustive]
33717 pub enum Tier {
33718 /// Default value
33719 Unspecified,
33720 /// Higher bandwidth, actual values based on VM size.
33721 Tier1,
33722 /// If set, the enum was initialized with an unknown value.
33723 ///
33724 /// Applications can examine the value using [Tier::value] or
33725 /// [Tier::name].
33726 UnknownValue(tier::UnknownValue),
33727 }
33728
33729 #[doc(hidden)]
33730 pub mod tier {
33731 #[allow(unused_imports)]
33732 use super::*;
33733 #[derive(Clone, Debug, PartialEq)]
33734 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33735 }
33736
33737 impl Tier {
33738 /// Gets the enum value.
33739 ///
33740 /// Returns `None` if the enum contains an unknown value deserialized from
33741 /// the string representation of enums.
33742 pub fn value(&self) -> std::option::Option<i32> {
33743 match self {
33744 Self::Unspecified => std::option::Option::Some(0),
33745 Self::Tier1 => std::option::Option::Some(1),
33746 Self::UnknownValue(u) => u.0.value(),
33747 }
33748 }
33749
33750 /// Gets the enum value as a string.
33751 ///
33752 /// Returns `None` if the enum contains an unknown value deserialized from
33753 /// the integer representation of enums.
33754 pub fn name(&self) -> std::option::Option<&str> {
33755 match self {
33756 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
33757 Self::Tier1 => std::option::Option::Some("TIER_1"),
33758 Self::UnknownValue(u) => u.0.name(),
33759 }
33760 }
33761 }
33762
33763 impl std::default::Default for Tier {
33764 fn default() -> Self {
33765 use std::convert::From;
33766 Self::from(0)
33767 }
33768 }
33769
33770 impl std::fmt::Display for Tier {
33771 fn fmt(
33772 &self,
33773 f: &mut std::fmt::Formatter<'_>,
33774 ) -> std::result::Result<(), std::fmt::Error> {
33775 wkt::internal::display_enum(f, self.name(), self.value())
33776 }
33777 }
33778
33779 impl std::convert::From<i32> for Tier {
33780 fn from(value: i32) -> Self {
33781 match value {
33782 0 => Self::Unspecified,
33783 1 => Self::Tier1,
33784 _ => Self::UnknownValue(tier::UnknownValue(
33785 wkt::internal::UnknownEnumValue::Integer(value),
33786 )),
33787 }
33788 }
33789 }
33790
33791 impl std::convert::From<&str> for Tier {
33792 fn from(value: &str) -> Self {
33793 use std::string::ToString;
33794 match value {
33795 "TIER_UNSPECIFIED" => Self::Unspecified,
33796 "TIER_1" => Self::Tier1,
33797 _ => Self::UnknownValue(tier::UnknownValue(
33798 wkt::internal::UnknownEnumValue::String(value.to_string()),
33799 )),
33800 }
33801 }
33802 }
33803
33804 impl serde::ser::Serialize for Tier {
33805 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33806 where
33807 S: serde::Serializer,
33808 {
33809 match self {
33810 Self::Unspecified => serializer.serialize_i32(0),
33811 Self::Tier1 => serializer.serialize_i32(1),
33812 Self::UnknownValue(u) => u.0.serialize(serializer),
33813 }
33814 }
33815 }
33816
33817 impl<'de> serde::de::Deserialize<'de> for Tier {
33818 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33819 where
33820 D: serde::Deserializer<'de>,
33821 {
33822 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
33823 ".google.container.v1.NetworkConfig.ClusterNetworkPerformanceConfig.Tier",
33824 ))
33825 }
33826 }
33827 }
33828}
33829
33830/// GatewayAPIConfig contains the desired config of Gateway API on this cluster.
33831#[derive(Clone, Default, PartialEq)]
33832#[non_exhaustive]
33833pub struct GatewayAPIConfig {
33834 /// The Gateway API release channel to use for Gateway API.
33835 pub channel: crate::model::gateway_api_config::Channel,
33836
33837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33838}
33839
33840impl GatewayAPIConfig {
33841 /// Creates a new default instance.
33842 pub fn new() -> Self {
33843 std::default::Default::default()
33844 }
33845
33846 /// Sets the value of [channel][crate::model::GatewayAPIConfig::channel].
33847 ///
33848 /// # Example
33849 /// ```ignore,no_run
33850 /// # use google_cloud_container_v1::model::GatewayAPIConfig;
33851 /// use google_cloud_container_v1::model::gateway_api_config::Channel;
33852 /// let x0 = GatewayAPIConfig::new().set_channel(Channel::Disabled);
33853 /// let x1 = GatewayAPIConfig::new().set_channel(Channel::Standard);
33854 /// ```
33855 pub fn set_channel<T: std::convert::Into<crate::model::gateway_api_config::Channel>>(
33856 mut self,
33857 v: T,
33858 ) -> Self {
33859 self.channel = v.into();
33860 self
33861 }
33862}
33863
33864impl wkt::message::Message for GatewayAPIConfig {
33865 fn typename() -> &'static str {
33866 "type.googleapis.com/google.container.v1.GatewayAPIConfig"
33867 }
33868}
33869
33870/// Defines additional types related to [GatewayAPIConfig].
33871pub mod gateway_api_config {
33872 #[allow(unused_imports)]
33873 use super::*;
33874
33875 /// Channel describes if/how Gateway API should be installed and implemented in
33876 /// a cluster.
33877 ///
33878 /// # Working with unknown values
33879 ///
33880 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33881 /// additional enum variants at any time. Adding new variants is not considered
33882 /// a breaking change. Applications should write their code in anticipation of:
33883 ///
33884 /// - New values appearing in future releases of the client library, **and**
33885 /// - New values received dynamically, without application changes.
33886 ///
33887 /// Please consult the [Working with enums] section in the user guide for some
33888 /// guidelines.
33889 ///
33890 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33891 #[derive(Clone, Debug, PartialEq)]
33892 #[non_exhaustive]
33893 pub enum Channel {
33894 /// Default value.
33895 Unspecified,
33896 /// Gateway API support is disabled
33897 Disabled,
33898 /// Deprecated: use CHANNEL_STANDARD instead.
33899 /// Gateway API support is enabled, experimental CRDs are installed
33900 #[deprecated]
33901 Experimental,
33902 /// Gateway API support is enabled, standard CRDs are installed
33903 Standard,
33904 /// If set, the enum was initialized with an unknown value.
33905 ///
33906 /// Applications can examine the value using [Channel::value] or
33907 /// [Channel::name].
33908 UnknownValue(channel::UnknownValue),
33909 }
33910
33911 #[doc(hidden)]
33912 pub mod channel {
33913 #[allow(unused_imports)]
33914 use super::*;
33915 #[derive(Clone, Debug, PartialEq)]
33916 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33917 }
33918
33919 impl Channel {
33920 /// Gets the enum value.
33921 ///
33922 /// Returns `None` if the enum contains an unknown value deserialized from
33923 /// the string representation of enums.
33924 pub fn value(&self) -> std::option::Option<i32> {
33925 match self {
33926 Self::Unspecified => std::option::Option::Some(0),
33927 Self::Disabled => std::option::Option::Some(1),
33928 Self::Experimental => std::option::Option::Some(3),
33929 Self::Standard => std::option::Option::Some(4),
33930 Self::UnknownValue(u) => u.0.value(),
33931 }
33932 }
33933
33934 /// Gets the enum value as a string.
33935 ///
33936 /// Returns `None` if the enum contains an unknown value deserialized from
33937 /// the integer representation of enums.
33938 pub fn name(&self) -> std::option::Option<&str> {
33939 match self {
33940 Self::Unspecified => std::option::Option::Some("CHANNEL_UNSPECIFIED"),
33941 Self::Disabled => std::option::Option::Some("CHANNEL_DISABLED"),
33942 Self::Experimental => std::option::Option::Some("CHANNEL_EXPERIMENTAL"),
33943 Self::Standard => std::option::Option::Some("CHANNEL_STANDARD"),
33944 Self::UnknownValue(u) => u.0.name(),
33945 }
33946 }
33947 }
33948
33949 impl std::default::Default for Channel {
33950 fn default() -> Self {
33951 use std::convert::From;
33952 Self::from(0)
33953 }
33954 }
33955
33956 impl std::fmt::Display for Channel {
33957 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33958 wkt::internal::display_enum(f, self.name(), self.value())
33959 }
33960 }
33961
33962 impl std::convert::From<i32> for Channel {
33963 fn from(value: i32) -> Self {
33964 match value {
33965 0 => Self::Unspecified,
33966 1 => Self::Disabled,
33967 3 => Self::Experimental,
33968 4 => Self::Standard,
33969 _ => Self::UnknownValue(channel::UnknownValue(
33970 wkt::internal::UnknownEnumValue::Integer(value),
33971 )),
33972 }
33973 }
33974 }
33975
33976 impl std::convert::From<&str> for Channel {
33977 fn from(value: &str) -> Self {
33978 use std::string::ToString;
33979 match value {
33980 "CHANNEL_UNSPECIFIED" => Self::Unspecified,
33981 "CHANNEL_DISABLED" => Self::Disabled,
33982 "CHANNEL_EXPERIMENTAL" => Self::Experimental,
33983 "CHANNEL_STANDARD" => Self::Standard,
33984 _ => Self::UnknownValue(channel::UnknownValue(
33985 wkt::internal::UnknownEnumValue::String(value.to_string()),
33986 )),
33987 }
33988 }
33989 }
33990
33991 impl serde::ser::Serialize for Channel {
33992 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33993 where
33994 S: serde::Serializer,
33995 {
33996 match self {
33997 Self::Unspecified => serializer.serialize_i32(0),
33998 Self::Disabled => serializer.serialize_i32(1),
33999 Self::Experimental => serializer.serialize_i32(3),
34000 Self::Standard => serializer.serialize_i32(4),
34001 Self::UnknownValue(u) => u.0.serialize(serializer),
34002 }
34003 }
34004 }
34005
34006 impl<'de> serde::de::Deserialize<'de> for Channel {
34007 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34008 where
34009 D: serde::Deserializer<'de>,
34010 {
34011 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Channel>::new(
34012 ".google.container.v1.GatewayAPIConfig.Channel",
34013 ))
34014 }
34015 }
34016}
34017
34018/// Config to block services with externalIPs field.
34019#[derive(Clone, Default, PartialEq)]
34020#[non_exhaustive]
34021pub struct ServiceExternalIPsConfig {
34022 /// Whether Services with ExternalIPs field are allowed or not.
34023 pub enabled: bool,
34024
34025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34026}
34027
34028impl ServiceExternalIPsConfig {
34029 /// Creates a new default instance.
34030 pub fn new() -> Self {
34031 std::default::Default::default()
34032 }
34033
34034 /// Sets the value of [enabled][crate::model::ServiceExternalIPsConfig::enabled].
34035 ///
34036 /// # Example
34037 /// ```ignore,no_run
34038 /// # use google_cloud_container_v1::model::ServiceExternalIPsConfig;
34039 /// let x = ServiceExternalIPsConfig::new().set_enabled(true);
34040 /// ```
34041 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
34042 self.enabled = v.into();
34043 self
34044 }
34045}
34046
34047impl wkt::message::Message for ServiceExternalIPsConfig {
34048 fn typename() -> &'static str {
34049 "type.googleapis.com/google.container.v1.ServiceExternalIPsConfig"
34050 }
34051}
34052
34053/// GetOpenIDConfigRequest gets the OIDC discovery document for the
34054/// cluster. See the OpenID Connect Discovery 1.0 specification for details.
34055#[derive(Clone, Default, PartialEq)]
34056#[non_exhaustive]
34057pub struct GetOpenIDConfigRequest {
34058 /// The cluster (project, location, cluster name) to get the discovery document
34059 /// for. Specified in the format `projects/*/locations/*/clusters/*`.
34060 pub parent: std::string::String,
34061
34062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34063}
34064
34065impl GetOpenIDConfigRequest {
34066 /// Creates a new default instance.
34067 pub fn new() -> Self {
34068 std::default::Default::default()
34069 }
34070
34071 /// Sets the value of [parent][crate::model::GetOpenIDConfigRequest::parent].
34072 ///
34073 /// # Example
34074 /// ```ignore,no_run
34075 /// # use google_cloud_container_v1::model::GetOpenIDConfigRequest;
34076 /// let x = GetOpenIDConfigRequest::new().set_parent("example");
34077 /// ```
34078 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34079 self.parent = v.into();
34080 self
34081 }
34082}
34083
34084impl wkt::message::Message for GetOpenIDConfigRequest {
34085 fn typename() -> &'static str {
34086 "type.googleapis.com/google.container.v1.GetOpenIDConfigRequest"
34087 }
34088}
34089
34090/// GetOpenIDConfigResponse is an OIDC discovery document for the cluster.
34091/// See the OpenID Connect Discovery 1.0 specification for details.
34092#[derive(Clone, Default, PartialEq)]
34093#[non_exhaustive]
34094pub struct GetOpenIDConfigResponse {
34095 /// OIDC Issuer.
34096 pub issuer: std::string::String,
34097
34098 /// JSON Web Key uri.
34099 pub jwks_uri: std::string::String,
34100
34101 /// Supported response types.
34102 pub response_types_supported: std::vec::Vec<std::string::String>,
34103
34104 /// Supported subject types.
34105 pub subject_types_supported: std::vec::Vec<std::string::String>,
34106
34107 /// supported ID Token signing Algorithms.
34108 pub id_token_signing_alg_values_supported: std::vec::Vec<std::string::String>,
34109
34110 /// Supported claims.
34111 pub claims_supported: std::vec::Vec<std::string::String>,
34112
34113 /// Supported grant types.
34114 pub grant_types: std::vec::Vec<std::string::String>,
34115
34116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34117}
34118
34119impl GetOpenIDConfigResponse {
34120 /// Creates a new default instance.
34121 pub fn new() -> Self {
34122 std::default::Default::default()
34123 }
34124
34125 /// Sets the value of [issuer][crate::model::GetOpenIDConfigResponse::issuer].
34126 ///
34127 /// # Example
34128 /// ```ignore,no_run
34129 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34130 /// let x = GetOpenIDConfigResponse::new().set_issuer("example");
34131 /// ```
34132 pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34133 self.issuer = v.into();
34134 self
34135 }
34136
34137 /// Sets the value of [jwks_uri][crate::model::GetOpenIDConfigResponse::jwks_uri].
34138 ///
34139 /// # Example
34140 /// ```ignore,no_run
34141 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34142 /// let x = GetOpenIDConfigResponse::new().set_jwks_uri("example");
34143 /// ```
34144 pub fn set_jwks_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34145 self.jwks_uri = v.into();
34146 self
34147 }
34148
34149 /// Sets the value of [response_types_supported][crate::model::GetOpenIDConfigResponse::response_types_supported].
34150 ///
34151 /// # Example
34152 /// ```ignore,no_run
34153 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34154 /// let x = GetOpenIDConfigResponse::new().set_response_types_supported(["a", "b", "c"]);
34155 /// ```
34156 pub fn set_response_types_supported<T, V>(mut self, v: T) -> Self
34157 where
34158 T: std::iter::IntoIterator<Item = V>,
34159 V: std::convert::Into<std::string::String>,
34160 {
34161 use std::iter::Iterator;
34162 self.response_types_supported = v.into_iter().map(|i| i.into()).collect();
34163 self
34164 }
34165
34166 /// Sets the value of [subject_types_supported][crate::model::GetOpenIDConfigResponse::subject_types_supported].
34167 ///
34168 /// # Example
34169 /// ```ignore,no_run
34170 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34171 /// let x = GetOpenIDConfigResponse::new().set_subject_types_supported(["a", "b", "c"]);
34172 /// ```
34173 pub fn set_subject_types_supported<T, V>(mut self, v: T) -> Self
34174 where
34175 T: std::iter::IntoIterator<Item = V>,
34176 V: std::convert::Into<std::string::String>,
34177 {
34178 use std::iter::Iterator;
34179 self.subject_types_supported = v.into_iter().map(|i| i.into()).collect();
34180 self
34181 }
34182
34183 /// Sets the value of [id_token_signing_alg_values_supported][crate::model::GetOpenIDConfigResponse::id_token_signing_alg_values_supported].
34184 ///
34185 /// # Example
34186 /// ```ignore,no_run
34187 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34188 /// let x = GetOpenIDConfigResponse::new().set_id_token_signing_alg_values_supported(["a", "b", "c"]);
34189 /// ```
34190 pub fn set_id_token_signing_alg_values_supported<T, V>(mut self, v: T) -> Self
34191 where
34192 T: std::iter::IntoIterator<Item = V>,
34193 V: std::convert::Into<std::string::String>,
34194 {
34195 use std::iter::Iterator;
34196 self.id_token_signing_alg_values_supported = v.into_iter().map(|i| i.into()).collect();
34197 self
34198 }
34199
34200 /// Sets the value of [claims_supported][crate::model::GetOpenIDConfigResponse::claims_supported].
34201 ///
34202 /// # Example
34203 /// ```ignore,no_run
34204 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34205 /// let x = GetOpenIDConfigResponse::new().set_claims_supported(["a", "b", "c"]);
34206 /// ```
34207 pub fn set_claims_supported<T, V>(mut self, v: T) -> Self
34208 where
34209 T: std::iter::IntoIterator<Item = V>,
34210 V: std::convert::Into<std::string::String>,
34211 {
34212 use std::iter::Iterator;
34213 self.claims_supported = v.into_iter().map(|i| i.into()).collect();
34214 self
34215 }
34216
34217 /// Sets the value of [grant_types][crate::model::GetOpenIDConfigResponse::grant_types].
34218 ///
34219 /// # Example
34220 /// ```ignore,no_run
34221 /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
34222 /// let x = GetOpenIDConfigResponse::new().set_grant_types(["a", "b", "c"]);
34223 /// ```
34224 pub fn set_grant_types<T, V>(mut self, v: T) -> Self
34225 where
34226 T: std::iter::IntoIterator<Item = V>,
34227 V: std::convert::Into<std::string::String>,
34228 {
34229 use std::iter::Iterator;
34230 self.grant_types = v.into_iter().map(|i| i.into()).collect();
34231 self
34232 }
34233}
34234
34235impl wkt::message::Message for GetOpenIDConfigResponse {
34236 fn typename() -> &'static str {
34237 "type.googleapis.com/google.container.v1.GetOpenIDConfigResponse"
34238 }
34239}
34240
34241/// GetJSONWebKeysRequest gets the public component of the keys used by the
34242/// cluster to sign token requests. This will be the jwks_uri for the discover
34243/// document returned by getOpenIDConfig. See the OpenID Connect
34244/// Discovery 1.0 specification for details.
34245#[derive(Clone, Default, PartialEq)]
34246#[non_exhaustive]
34247pub struct GetJSONWebKeysRequest {
34248 /// The cluster (project, location, cluster name) to get keys for. Specified in
34249 /// the format `projects/*/locations/*/clusters/*`.
34250 pub parent: std::string::String,
34251
34252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34253}
34254
34255impl GetJSONWebKeysRequest {
34256 /// Creates a new default instance.
34257 pub fn new() -> Self {
34258 std::default::Default::default()
34259 }
34260
34261 /// Sets the value of [parent][crate::model::GetJSONWebKeysRequest::parent].
34262 ///
34263 /// # Example
34264 /// ```ignore,no_run
34265 /// # use google_cloud_container_v1::model::GetJSONWebKeysRequest;
34266 /// let x = GetJSONWebKeysRequest::new().set_parent("example");
34267 /// ```
34268 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34269 self.parent = v.into();
34270 self
34271 }
34272}
34273
34274impl wkt::message::Message for GetJSONWebKeysRequest {
34275 fn typename() -> &'static str {
34276 "type.googleapis.com/google.container.v1.GetJSONWebKeysRequest"
34277 }
34278}
34279
34280/// Jwk is a JSON Web Key as specified in RFC 7517
34281#[derive(Clone, Default, PartialEq)]
34282#[non_exhaustive]
34283pub struct Jwk {
34284 /// Key Type.
34285 pub kty: std::string::String,
34286
34287 /// Algorithm.
34288 pub alg: std::string::String,
34289
34290 /// Permitted uses for the public keys.
34291 pub r#use: std::string::String,
34292
34293 /// Key ID.
34294 pub kid: std::string::String,
34295
34296 /// Used for RSA keys.
34297 pub n: std::string::String,
34298
34299 /// Used for RSA keys.
34300 pub e: std::string::String,
34301
34302 /// Used for ECDSA keys.
34303 pub x: std::string::String,
34304
34305 /// Used for ECDSA keys.
34306 pub y: std::string::String,
34307
34308 /// Used for ECDSA keys.
34309 pub crv: std::string::String,
34310
34311 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34312}
34313
34314impl Jwk {
34315 /// Creates a new default instance.
34316 pub fn new() -> Self {
34317 std::default::Default::default()
34318 }
34319
34320 /// Sets the value of [kty][crate::model::Jwk::kty].
34321 ///
34322 /// # Example
34323 /// ```ignore,no_run
34324 /// # use google_cloud_container_v1::model::Jwk;
34325 /// let x = Jwk::new().set_kty("example");
34326 /// ```
34327 pub fn set_kty<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34328 self.kty = v.into();
34329 self
34330 }
34331
34332 /// Sets the value of [alg][crate::model::Jwk::alg].
34333 ///
34334 /// # Example
34335 /// ```ignore,no_run
34336 /// # use google_cloud_container_v1::model::Jwk;
34337 /// let x = Jwk::new().set_alg("example");
34338 /// ```
34339 pub fn set_alg<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34340 self.alg = v.into();
34341 self
34342 }
34343
34344 /// Sets the value of [r#use][crate::model::Jwk::use].
34345 ///
34346 /// # Example
34347 /// ```ignore,no_run
34348 /// # use google_cloud_container_v1::model::Jwk;
34349 /// let x = Jwk::new().set_use("example");
34350 /// ```
34351 pub fn set_use<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34352 self.r#use = v.into();
34353 self
34354 }
34355
34356 /// Sets the value of [kid][crate::model::Jwk::kid].
34357 ///
34358 /// # Example
34359 /// ```ignore,no_run
34360 /// # use google_cloud_container_v1::model::Jwk;
34361 /// let x = Jwk::new().set_kid("example");
34362 /// ```
34363 pub fn set_kid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34364 self.kid = v.into();
34365 self
34366 }
34367
34368 /// Sets the value of [n][crate::model::Jwk::n].
34369 ///
34370 /// # Example
34371 /// ```ignore,no_run
34372 /// # use google_cloud_container_v1::model::Jwk;
34373 /// let x = Jwk::new().set_n("example");
34374 /// ```
34375 pub fn set_n<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34376 self.n = v.into();
34377 self
34378 }
34379
34380 /// Sets the value of [e][crate::model::Jwk::e].
34381 ///
34382 /// # Example
34383 /// ```ignore,no_run
34384 /// # use google_cloud_container_v1::model::Jwk;
34385 /// let x = Jwk::new().set_e("example");
34386 /// ```
34387 pub fn set_e<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34388 self.e = v.into();
34389 self
34390 }
34391
34392 /// Sets the value of [x][crate::model::Jwk::x].
34393 ///
34394 /// # Example
34395 /// ```ignore,no_run
34396 /// # use google_cloud_container_v1::model::Jwk;
34397 /// let x = Jwk::new().set_x("example");
34398 /// ```
34399 pub fn set_x<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34400 self.x = v.into();
34401 self
34402 }
34403
34404 /// Sets the value of [y][crate::model::Jwk::y].
34405 ///
34406 /// # Example
34407 /// ```ignore,no_run
34408 /// # use google_cloud_container_v1::model::Jwk;
34409 /// let x = Jwk::new().set_y("example");
34410 /// ```
34411 pub fn set_y<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34412 self.y = v.into();
34413 self
34414 }
34415
34416 /// Sets the value of [crv][crate::model::Jwk::crv].
34417 ///
34418 /// # Example
34419 /// ```ignore,no_run
34420 /// # use google_cloud_container_v1::model::Jwk;
34421 /// let x = Jwk::new().set_crv("example");
34422 /// ```
34423 pub fn set_crv<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34424 self.crv = v.into();
34425 self
34426 }
34427}
34428
34429impl wkt::message::Message for Jwk {
34430 fn typename() -> &'static str {
34431 "type.googleapis.com/google.container.v1.Jwk"
34432 }
34433}
34434
34435/// GetJSONWebKeysResponse is a valid JSON Web Key Set as specified in rfc 7517
34436#[derive(Clone, Default, PartialEq)]
34437#[non_exhaustive]
34438pub struct GetJSONWebKeysResponse {
34439 /// The public component of the keys used by the cluster to sign token
34440 /// requests.
34441 pub keys: std::vec::Vec<crate::model::Jwk>,
34442
34443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34444}
34445
34446impl GetJSONWebKeysResponse {
34447 /// Creates a new default instance.
34448 pub fn new() -> Self {
34449 std::default::Default::default()
34450 }
34451
34452 /// Sets the value of [keys][crate::model::GetJSONWebKeysResponse::keys].
34453 ///
34454 /// # Example
34455 /// ```ignore,no_run
34456 /// # use google_cloud_container_v1::model::GetJSONWebKeysResponse;
34457 /// use google_cloud_container_v1::model::Jwk;
34458 /// let x = GetJSONWebKeysResponse::new()
34459 /// .set_keys([
34460 /// Jwk::default()/* use setters */,
34461 /// Jwk::default()/* use (different) setters */,
34462 /// ]);
34463 /// ```
34464 pub fn set_keys<T, V>(mut self, v: T) -> Self
34465 where
34466 T: std::iter::IntoIterator<Item = V>,
34467 V: std::convert::Into<crate::model::Jwk>,
34468 {
34469 use std::iter::Iterator;
34470 self.keys = v.into_iter().map(|i| i.into()).collect();
34471 self
34472 }
34473}
34474
34475impl wkt::message::Message for GetJSONWebKeysResponse {
34476 fn typename() -> &'static str {
34477 "type.googleapis.com/google.container.v1.GetJSONWebKeysResponse"
34478 }
34479}
34480
34481/// CheckAutopilotCompatibilityRequest requests getting the blockers for the
34482/// given operation in the cluster.
34483#[derive(Clone, Default, PartialEq)]
34484#[non_exhaustive]
34485pub struct CheckAutopilotCompatibilityRequest {
34486 /// The name (project, location, cluster) of the cluster to retrieve.
34487 /// Specified in the format `projects/*/locations/*/clusters/*`.
34488 pub name: std::string::String,
34489
34490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34491}
34492
34493impl CheckAutopilotCompatibilityRequest {
34494 /// Creates a new default instance.
34495 pub fn new() -> Self {
34496 std::default::Default::default()
34497 }
34498
34499 /// Sets the value of [name][crate::model::CheckAutopilotCompatibilityRequest::name].
34500 ///
34501 /// # Example
34502 /// ```ignore,no_run
34503 /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityRequest;
34504 /// let x = CheckAutopilotCompatibilityRequest::new().set_name("example");
34505 /// ```
34506 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34507 self.name = v.into();
34508 self
34509 }
34510}
34511
34512impl wkt::message::Message for CheckAutopilotCompatibilityRequest {
34513 fn typename() -> &'static str {
34514 "type.googleapis.com/google.container.v1.CheckAutopilotCompatibilityRequest"
34515 }
34516}
34517
34518/// AutopilotCompatibilityIssue contains information about a specific
34519/// compatibility issue with Autopilot mode.
34520#[derive(Clone, Default, PartialEq)]
34521#[non_exhaustive]
34522pub struct AutopilotCompatibilityIssue {
34523 /// The last time when this issue was observed.
34524 pub last_observation: std::option::Option<wkt::Timestamp>,
34525
34526 /// The constraint type of the issue.
34527 pub constraint_type: std::string::String,
34528
34529 /// The incompatibility type of this issue.
34530 pub incompatibility_type: crate::model::autopilot_compatibility_issue::IssueType,
34531
34532 /// The name of the resources which are subject to this issue.
34533 pub subjects: std::vec::Vec<std::string::String>,
34534
34535 /// A URL to a public documentation, which addresses resolving this issue.
34536 pub documentation_url: std::string::String,
34537
34538 /// The description of the issue.
34539 pub description: std::string::String,
34540
34541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34542}
34543
34544impl AutopilotCompatibilityIssue {
34545 /// Creates a new default instance.
34546 pub fn new() -> Self {
34547 std::default::Default::default()
34548 }
34549
34550 /// Sets the value of [last_observation][crate::model::AutopilotCompatibilityIssue::last_observation].
34551 ///
34552 /// # Example
34553 /// ```ignore,no_run
34554 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34555 /// use wkt::Timestamp;
34556 /// let x = AutopilotCompatibilityIssue::new().set_last_observation(Timestamp::default()/* use setters */);
34557 /// ```
34558 pub fn set_last_observation<T>(mut self, v: T) -> Self
34559 where
34560 T: std::convert::Into<wkt::Timestamp>,
34561 {
34562 self.last_observation = std::option::Option::Some(v.into());
34563 self
34564 }
34565
34566 /// Sets or clears the value of [last_observation][crate::model::AutopilotCompatibilityIssue::last_observation].
34567 ///
34568 /// # Example
34569 /// ```ignore,no_run
34570 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34571 /// use wkt::Timestamp;
34572 /// let x = AutopilotCompatibilityIssue::new().set_or_clear_last_observation(Some(Timestamp::default()/* use setters */));
34573 /// let x = AutopilotCompatibilityIssue::new().set_or_clear_last_observation(None::<Timestamp>);
34574 /// ```
34575 pub fn set_or_clear_last_observation<T>(mut self, v: std::option::Option<T>) -> Self
34576 where
34577 T: std::convert::Into<wkt::Timestamp>,
34578 {
34579 self.last_observation = v.map(|x| x.into());
34580 self
34581 }
34582
34583 /// Sets the value of [constraint_type][crate::model::AutopilotCompatibilityIssue::constraint_type].
34584 ///
34585 /// # Example
34586 /// ```ignore,no_run
34587 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34588 /// let x = AutopilotCompatibilityIssue::new().set_constraint_type("example");
34589 /// ```
34590 pub fn set_constraint_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34591 self.constraint_type = v.into();
34592 self
34593 }
34594
34595 /// Sets the value of [incompatibility_type][crate::model::AutopilotCompatibilityIssue::incompatibility_type].
34596 ///
34597 /// # Example
34598 /// ```ignore,no_run
34599 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34600 /// use google_cloud_container_v1::model::autopilot_compatibility_issue::IssueType;
34601 /// let x0 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::Incompatibility);
34602 /// let x1 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::AdditionalConfigRequired);
34603 /// let x2 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::PassedWithOptionalConfig);
34604 /// ```
34605 pub fn set_incompatibility_type<
34606 T: std::convert::Into<crate::model::autopilot_compatibility_issue::IssueType>,
34607 >(
34608 mut self,
34609 v: T,
34610 ) -> Self {
34611 self.incompatibility_type = v.into();
34612 self
34613 }
34614
34615 /// Sets the value of [subjects][crate::model::AutopilotCompatibilityIssue::subjects].
34616 ///
34617 /// # Example
34618 /// ```ignore,no_run
34619 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34620 /// let x = AutopilotCompatibilityIssue::new().set_subjects(["a", "b", "c"]);
34621 /// ```
34622 pub fn set_subjects<T, V>(mut self, v: T) -> Self
34623 where
34624 T: std::iter::IntoIterator<Item = V>,
34625 V: std::convert::Into<std::string::String>,
34626 {
34627 use std::iter::Iterator;
34628 self.subjects = v.into_iter().map(|i| i.into()).collect();
34629 self
34630 }
34631
34632 /// Sets the value of [documentation_url][crate::model::AutopilotCompatibilityIssue::documentation_url].
34633 ///
34634 /// # Example
34635 /// ```ignore,no_run
34636 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34637 /// let x = AutopilotCompatibilityIssue::new().set_documentation_url("example");
34638 /// ```
34639 pub fn set_documentation_url<T: std::convert::Into<std::string::String>>(
34640 mut self,
34641 v: T,
34642 ) -> Self {
34643 self.documentation_url = v.into();
34644 self
34645 }
34646
34647 /// Sets the value of [description][crate::model::AutopilotCompatibilityIssue::description].
34648 ///
34649 /// # Example
34650 /// ```ignore,no_run
34651 /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34652 /// let x = AutopilotCompatibilityIssue::new().set_description("example");
34653 /// ```
34654 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34655 self.description = v.into();
34656 self
34657 }
34658}
34659
34660impl wkt::message::Message for AutopilotCompatibilityIssue {
34661 fn typename() -> &'static str {
34662 "type.googleapis.com/google.container.v1.AutopilotCompatibilityIssue"
34663 }
34664}
34665
34666/// Defines additional types related to [AutopilotCompatibilityIssue].
34667pub mod autopilot_compatibility_issue {
34668 #[allow(unused_imports)]
34669 use super::*;
34670
34671 /// The type of the reported issue.
34672 ///
34673 /// # Working with unknown values
34674 ///
34675 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34676 /// additional enum variants at any time. Adding new variants is not considered
34677 /// a breaking change. Applications should write their code in anticipation of:
34678 ///
34679 /// - New values appearing in future releases of the client library, **and**
34680 /// - New values received dynamically, without application changes.
34681 ///
34682 /// Please consult the [Working with enums] section in the user guide for some
34683 /// guidelines.
34684 ///
34685 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34686 #[derive(Clone, Debug, PartialEq)]
34687 #[non_exhaustive]
34688 pub enum IssueType {
34689 /// Default value, should not be used.
34690 Unspecified,
34691 /// Indicates that the issue is a known incompatibility between the
34692 /// cluster and Autopilot mode.
34693 Incompatibility,
34694 /// Indicates the issue is an incompatibility if customers take no further
34695 /// action to resolve.
34696 AdditionalConfigRequired,
34697 /// Indicates the issue is not an incompatibility, but depending on the
34698 /// workloads business logic, there is a potential that they won't work on
34699 /// Autopilot.
34700 PassedWithOptionalConfig,
34701 /// If set, the enum was initialized with an unknown value.
34702 ///
34703 /// Applications can examine the value using [IssueType::value] or
34704 /// [IssueType::name].
34705 UnknownValue(issue_type::UnknownValue),
34706 }
34707
34708 #[doc(hidden)]
34709 pub mod issue_type {
34710 #[allow(unused_imports)]
34711 use super::*;
34712 #[derive(Clone, Debug, PartialEq)]
34713 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34714 }
34715
34716 impl IssueType {
34717 /// Gets the enum value.
34718 ///
34719 /// Returns `None` if the enum contains an unknown value deserialized from
34720 /// the string representation of enums.
34721 pub fn value(&self) -> std::option::Option<i32> {
34722 match self {
34723 Self::Unspecified => std::option::Option::Some(0),
34724 Self::Incompatibility => std::option::Option::Some(1),
34725 Self::AdditionalConfigRequired => std::option::Option::Some(2),
34726 Self::PassedWithOptionalConfig => std::option::Option::Some(3),
34727 Self::UnknownValue(u) => u.0.value(),
34728 }
34729 }
34730
34731 /// Gets the enum value as a string.
34732 ///
34733 /// Returns `None` if the enum contains an unknown value deserialized from
34734 /// the integer representation of enums.
34735 pub fn name(&self) -> std::option::Option<&str> {
34736 match self {
34737 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
34738 Self::Incompatibility => std::option::Option::Some("INCOMPATIBILITY"),
34739 Self::AdditionalConfigRequired => {
34740 std::option::Option::Some("ADDITIONAL_CONFIG_REQUIRED")
34741 }
34742 Self::PassedWithOptionalConfig => {
34743 std::option::Option::Some("PASSED_WITH_OPTIONAL_CONFIG")
34744 }
34745 Self::UnknownValue(u) => u.0.name(),
34746 }
34747 }
34748 }
34749
34750 impl std::default::Default for IssueType {
34751 fn default() -> Self {
34752 use std::convert::From;
34753 Self::from(0)
34754 }
34755 }
34756
34757 impl std::fmt::Display for IssueType {
34758 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34759 wkt::internal::display_enum(f, self.name(), self.value())
34760 }
34761 }
34762
34763 impl std::convert::From<i32> for IssueType {
34764 fn from(value: i32) -> Self {
34765 match value {
34766 0 => Self::Unspecified,
34767 1 => Self::Incompatibility,
34768 2 => Self::AdditionalConfigRequired,
34769 3 => Self::PassedWithOptionalConfig,
34770 _ => Self::UnknownValue(issue_type::UnknownValue(
34771 wkt::internal::UnknownEnumValue::Integer(value),
34772 )),
34773 }
34774 }
34775 }
34776
34777 impl std::convert::From<&str> for IssueType {
34778 fn from(value: &str) -> Self {
34779 use std::string::ToString;
34780 match value {
34781 "UNSPECIFIED" => Self::Unspecified,
34782 "INCOMPATIBILITY" => Self::Incompatibility,
34783 "ADDITIONAL_CONFIG_REQUIRED" => Self::AdditionalConfigRequired,
34784 "PASSED_WITH_OPTIONAL_CONFIG" => Self::PassedWithOptionalConfig,
34785 _ => Self::UnknownValue(issue_type::UnknownValue(
34786 wkt::internal::UnknownEnumValue::String(value.to_string()),
34787 )),
34788 }
34789 }
34790 }
34791
34792 impl serde::ser::Serialize for IssueType {
34793 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34794 where
34795 S: serde::Serializer,
34796 {
34797 match self {
34798 Self::Unspecified => serializer.serialize_i32(0),
34799 Self::Incompatibility => serializer.serialize_i32(1),
34800 Self::AdditionalConfigRequired => serializer.serialize_i32(2),
34801 Self::PassedWithOptionalConfig => serializer.serialize_i32(3),
34802 Self::UnknownValue(u) => u.0.serialize(serializer),
34803 }
34804 }
34805 }
34806
34807 impl<'de> serde::de::Deserialize<'de> for IssueType {
34808 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34809 where
34810 D: serde::Deserializer<'de>,
34811 {
34812 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueType>::new(
34813 ".google.container.v1.AutopilotCompatibilityIssue.IssueType",
34814 ))
34815 }
34816 }
34817}
34818
34819/// CheckAutopilotCompatibilityResponse has a list of compatibility issues.
34820#[derive(Clone, Default, PartialEq)]
34821#[non_exhaustive]
34822pub struct CheckAutopilotCompatibilityResponse {
34823 /// The list of issues for the given operation.
34824 pub issues: std::vec::Vec<crate::model::AutopilotCompatibilityIssue>,
34825
34826 /// The summary of the autopilot compatibility response.
34827 pub summary: std::string::String,
34828
34829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34830}
34831
34832impl CheckAutopilotCompatibilityResponse {
34833 /// Creates a new default instance.
34834 pub fn new() -> Self {
34835 std::default::Default::default()
34836 }
34837
34838 /// Sets the value of [issues][crate::model::CheckAutopilotCompatibilityResponse::issues].
34839 ///
34840 /// # Example
34841 /// ```ignore,no_run
34842 /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityResponse;
34843 /// use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
34844 /// let x = CheckAutopilotCompatibilityResponse::new()
34845 /// .set_issues([
34846 /// AutopilotCompatibilityIssue::default()/* use setters */,
34847 /// AutopilotCompatibilityIssue::default()/* use (different) setters */,
34848 /// ]);
34849 /// ```
34850 pub fn set_issues<T, V>(mut self, v: T) -> Self
34851 where
34852 T: std::iter::IntoIterator<Item = V>,
34853 V: std::convert::Into<crate::model::AutopilotCompatibilityIssue>,
34854 {
34855 use std::iter::Iterator;
34856 self.issues = v.into_iter().map(|i| i.into()).collect();
34857 self
34858 }
34859
34860 /// Sets the value of [summary][crate::model::CheckAutopilotCompatibilityResponse::summary].
34861 ///
34862 /// # Example
34863 /// ```ignore,no_run
34864 /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityResponse;
34865 /// let x = CheckAutopilotCompatibilityResponse::new().set_summary("example");
34866 /// ```
34867 pub fn set_summary<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34868 self.summary = v.into();
34869 self
34870 }
34871}
34872
34873impl wkt::message::Message for CheckAutopilotCompatibilityResponse {
34874 fn typename() -> &'static str {
34875 "type.googleapis.com/google.container.v1.CheckAutopilotCompatibilityResponse"
34876 }
34877}
34878
34879/// ReleaseChannel indicates which release channel a cluster is
34880/// subscribed to. Release channels are arranged in order of risk.
34881///
34882/// When a cluster is subscribed to a release channel, Google maintains
34883/// both the master version and the node version. Node auto-upgrade
34884/// defaults to true and cannot be disabled.
34885#[derive(Clone, Default, PartialEq)]
34886#[non_exhaustive]
34887pub struct ReleaseChannel {
34888 /// channel specifies which release channel the cluster is subscribed to.
34889 pub channel: crate::model::release_channel::Channel,
34890
34891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34892}
34893
34894impl ReleaseChannel {
34895 /// Creates a new default instance.
34896 pub fn new() -> Self {
34897 std::default::Default::default()
34898 }
34899
34900 /// Sets the value of [channel][crate::model::ReleaseChannel::channel].
34901 ///
34902 /// # Example
34903 /// ```ignore,no_run
34904 /// # use google_cloud_container_v1::model::ReleaseChannel;
34905 /// use google_cloud_container_v1::model::release_channel::Channel;
34906 /// let x0 = ReleaseChannel::new().set_channel(Channel::Rapid);
34907 /// let x1 = ReleaseChannel::new().set_channel(Channel::Regular);
34908 /// let x2 = ReleaseChannel::new().set_channel(Channel::Stable);
34909 /// ```
34910 pub fn set_channel<T: std::convert::Into<crate::model::release_channel::Channel>>(
34911 mut self,
34912 v: T,
34913 ) -> Self {
34914 self.channel = v.into();
34915 self
34916 }
34917}
34918
34919impl wkt::message::Message for ReleaseChannel {
34920 fn typename() -> &'static str {
34921 "type.googleapis.com/google.container.v1.ReleaseChannel"
34922 }
34923}
34924
34925/// Defines additional types related to [ReleaseChannel].
34926pub mod release_channel {
34927 #[allow(unused_imports)]
34928 use super::*;
34929
34930 /// Possible values for 'channel'.
34931 ///
34932 /// # Working with unknown values
34933 ///
34934 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34935 /// additional enum variants at any time. Adding new variants is not considered
34936 /// a breaking change. Applications should write their code in anticipation of:
34937 ///
34938 /// - New values appearing in future releases of the client library, **and**
34939 /// - New values received dynamically, without application changes.
34940 ///
34941 /// Please consult the [Working with enums] section in the user guide for some
34942 /// guidelines.
34943 ///
34944 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34945 #[derive(Clone, Debug, PartialEq)]
34946 #[non_exhaustive]
34947 pub enum Channel {
34948 /// No channel specified.
34949 Unspecified,
34950 /// RAPID channel is offered on an early access basis for customers who want
34951 /// to test new releases.
34952 ///
34953 /// WARNING: Versions available in the RAPID Channel may be subject to
34954 /// unresolved issues with no known workaround and are not subject to any
34955 /// SLAs.
34956 Rapid,
34957 /// Clusters subscribed to REGULAR receive versions that are considered GA
34958 /// quality. REGULAR is intended for production users who want to take
34959 /// advantage of new features.
34960 Regular,
34961 /// Clusters subscribed to STABLE receive versions that are known to be
34962 /// stable and reliable in production.
34963 Stable,
34964 /// Clusters subscribed to EXTENDED receive extended support and availability
34965 /// for versions which are known to be stable and reliable in production.
34966 Extended,
34967 /// If set, the enum was initialized with an unknown value.
34968 ///
34969 /// Applications can examine the value using [Channel::value] or
34970 /// [Channel::name].
34971 UnknownValue(channel::UnknownValue),
34972 }
34973
34974 #[doc(hidden)]
34975 pub mod channel {
34976 #[allow(unused_imports)]
34977 use super::*;
34978 #[derive(Clone, Debug, PartialEq)]
34979 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34980 }
34981
34982 impl Channel {
34983 /// Gets the enum value.
34984 ///
34985 /// Returns `None` if the enum contains an unknown value deserialized from
34986 /// the string representation of enums.
34987 pub fn value(&self) -> std::option::Option<i32> {
34988 match self {
34989 Self::Unspecified => std::option::Option::Some(0),
34990 Self::Rapid => std::option::Option::Some(1),
34991 Self::Regular => std::option::Option::Some(2),
34992 Self::Stable => std::option::Option::Some(3),
34993 Self::Extended => std::option::Option::Some(4),
34994 Self::UnknownValue(u) => u.0.value(),
34995 }
34996 }
34997
34998 /// Gets the enum value as a string.
34999 ///
35000 /// Returns `None` if the enum contains an unknown value deserialized from
35001 /// the integer representation of enums.
35002 pub fn name(&self) -> std::option::Option<&str> {
35003 match self {
35004 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
35005 Self::Rapid => std::option::Option::Some("RAPID"),
35006 Self::Regular => std::option::Option::Some("REGULAR"),
35007 Self::Stable => std::option::Option::Some("STABLE"),
35008 Self::Extended => std::option::Option::Some("EXTENDED"),
35009 Self::UnknownValue(u) => u.0.name(),
35010 }
35011 }
35012 }
35013
35014 impl std::default::Default for Channel {
35015 fn default() -> Self {
35016 use std::convert::From;
35017 Self::from(0)
35018 }
35019 }
35020
35021 impl std::fmt::Display for Channel {
35022 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35023 wkt::internal::display_enum(f, self.name(), self.value())
35024 }
35025 }
35026
35027 impl std::convert::From<i32> for Channel {
35028 fn from(value: i32) -> Self {
35029 match value {
35030 0 => Self::Unspecified,
35031 1 => Self::Rapid,
35032 2 => Self::Regular,
35033 3 => Self::Stable,
35034 4 => Self::Extended,
35035 _ => Self::UnknownValue(channel::UnknownValue(
35036 wkt::internal::UnknownEnumValue::Integer(value),
35037 )),
35038 }
35039 }
35040 }
35041
35042 impl std::convert::From<&str> for Channel {
35043 fn from(value: &str) -> Self {
35044 use std::string::ToString;
35045 match value {
35046 "UNSPECIFIED" => Self::Unspecified,
35047 "RAPID" => Self::Rapid,
35048 "REGULAR" => Self::Regular,
35049 "STABLE" => Self::Stable,
35050 "EXTENDED" => Self::Extended,
35051 _ => Self::UnknownValue(channel::UnknownValue(
35052 wkt::internal::UnknownEnumValue::String(value.to_string()),
35053 )),
35054 }
35055 }
35056 }
35057
35058 impl serde::ser::Serialize for Channel {
35059 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35060 where
35061 S: serde::Serializer,
35062 {
35063 match self {
35064 Self::Unspecified => serializer.serialize_i32(0),
35065 Self::Rapid => serializer.serialize_i32(1),
35066 Self::Regular => serializer.serialize_i32(2),
35067 Self::Stable => serializer.serialize_i32(3),
35068 Self::Extended => serializer.serialize_i32(4),
35069 Self::UnknownValue(u) => u.0.serialize(serializer),
35070 }
35071 }
35072 }
35073
35074 impl<'de> serde::de::Deserialize<'de> for Channel {
35075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35076 where
35077 D: serde::Deserializer<'de>,
35078 {
35079 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Channel>::new(
35080 ".google.container.v1.ReleaseChannel.Channel",
35081 ))
35082 }
35083 }
35084}
35085
35086/// Configuration for fine-grained cost management feature.
35087#[derive(Clone, Default, PartialEq)]
35088#[non_exhaustive]
35089pub struct CostManagementConfig {
35090 /// Whether the feature is enabled or not.
35091 pub enabled: bool,
35092
35093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35094}
35095
35096impl CostManagementConfig {
35097 /// Creates a new default instance.
35098 pub fn new() -> Self {
35099 std::default::Default::default()
35100 }
35101
35102 /// Sets the value of [enabled][crate::model::CostManagementConfig::enabled].
35103 ///
35104 /// # Example
35105 /// ```ignore,no_run
35106 /// # use google_cloud_container_v1::model::CostManagementConfig;
35107 /// let x = CostManagementConfig::new().set_enabled(true);
35108 /// ```
35109 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35110 self.enabled = v.into();
35111 self
35112 }
35113}
35114
35115impl wkt::message::Message for CostManagementConfig {
35116 fn typename() -> &'static str {
35117 "type.googleapis.com/google.container.v1.CostManagementConfig"
35118 }
35119}
35120
35121/// IntraNodeVisibilityConfig contains the desired config of the intra-node
35122/// visibility on this cluster.
35123#[derive(Clone, Default, PartialEq)]
35124#[non_exhaustive]
35125pub struct IntraNodeVisibilityConfig {
35126 /// Enables intra node visibility for this cluster.
35127 pub enabled: bool,
35128
35129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35130}
35131
35132impl IntraNodeVisibilityConfig {
35133 /// Creates a new default instance.
35134 pub fn new() -> Self {
35135 std::default::Default::default()
35136 }
35137
35138 /// Sets the value of [enabled][crate::model::IntraNodeVisibilityConfig::enabled].
35139 ///
35140 /// # Example
35141 /// ```ignore,no_run
35142 /// # use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
35143 /// let x = IntraNodeVisibilityConfig::new().set_enabled(true);
35144 /// ```
35145 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35146 self.enabled = v.into();
35147 self
35148 }
35149}
35150
35151impl wkt::message::Message for IntraNodeVisibilityConfig {
35152 fn typename() -> &'static str {
35153 "type.googleapis.com/google.container.v1.IntraNodeVisibilityConfig"
35154 }
35155}
35156
35157/// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer
35158/// subsetting on this cluster.
35159#[derive(Clone, Default, PartialEq)]
35160#[non_exhaustive]
35161pub struct ILBSubsettingConfig {
35162 /// Enables l4 ILB subsetting for this cluster.
35163 pub enabled: bool,
35164
35165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35166}
35167
35168impl ILBSubsettingConfig {
35169 /// Creates a new default instance.
35170 pub fn new() -> Self {
35171 std::default::Default::default()
35172 }
35173
35174 /// Sets the value of [enabled][crate::model::ILBSubsettingConfig::enabled].
35175 ///
35176 /// # Example
35177 /// ```ignore,no_run
35178 /// # use google_cloud_container_v1::model::ILBSubsettingConfig;
35179 /// let x = ILBSubsettingConfig::new().set_enabled(true);
35180 /// ```
35181 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35182 self.enabled = v.into();
35183 self
35184 }
35185}
35186
35187impl wkt::message::Message for ILBSubsettingConfig {
35188 fn typename() -> &'static str {
35189 "type.googleapis.com/google.container.v1.ILBSubsettingConfig"
35190 }
35191}
35192
35193/// DNSConfig contains the desired set of options for configuring clusterDNS.
35194#[derive(Clone, Default, PartialEq)]
35195#[non_exhaustive]
35196pub struct DNSConfig {
35197 /// cluster_dns indicates which in-cluster DNS provider should be used.
35198 pub cluster_dns: crate::model::dns_config::Provider,
35199
35200 /// cluster_dns_scope indicates the scope of access to cluster DNS records.
35201 pub cluster_dns_scope: crate::model::dns_config::DNSScope,
35202
35203 /// cluster_dns_domain is the suffix used for all cluster service records.
35204 pub cluster_dns_domain: std::string::String,
35205
35206 /// Optional. The domain used in Additive VPC scope.
35207 pub additive_vpc_scope_dns_domain: std::string::String,
35208
35209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35210}
35211
35212impl DNSConfig {
35213 /// Creates a new default instance.
35214 pub fn new() -> Self {
35215 std::default::Default::default()
35216 }
35217
35218 /// Sets the value of [cluster_dns][crate::model::DNSConfig::cluster_dns].
35219 ///
35220 /// # Example
35221 /// ```ignore,no_run
35222 /// # use google_cloud_container_v1::model::DNSConfig;
35223 /// use google_cloud_container_v1::model::dns_config::Provider;
35224 /// let x0 = DNSConfig::new().set_cluster_dns(Provider::PlatformDefault);
35225 /// let x1 = DNSConfig::new().set_cluster_dns(Provider::CloudDns);
35226 /// let x2 = DNSConfig::new().set_cluster_dns(Provider::KubeDns);
35227 /// ```
35228 pub fn set_cluster_dns<T: std::convert::Into<crate::model::dns_config::Provider>>(
35229 mut self,
35230 v: T,
35231 ) -> Self {
35232 self.cluster_dns = v.into();
35233 self
35234 }
35235
35236 /// Sets the value of [cluster_dns_scope][crate::model::DNSConfig::cluster_dns_scope].
35237 ///
35238 /// # Example
35239 /// ```ignore,no_run
35240 /// # use google_cloud_container_v1::model::DNSConfig;
35241 /// use google_cloud_container_v1::model::dns_config::DNSScope;
35242 /// let x0 = DNSConfig::new().set_cluster_dns_scope(DNSScope::ClusterScope);
35243 /// let x1 = DNSConfig::new().set_cluster_dns_scope(DNSScope::VpcScope);
35244 /// ```
35245 pub fn set_cluster_dns_scope<T: std::convert::Into<crate::model::dns_config::DNSScope>>(
35246 mut self,
35247 v: T,
35248 ) -> Self {
35249 self.cluster_dns_scope = v.into();
35250 self
35251 }
35252
35253 /// Sets the value of [cluster_dns_domain][crate::model::DNSConfig::cluster_dns_domain].
35254 ///
35255 /// # Example
35256 /// ```ignore,no_run
35257 /// # use google_cloud_container_v1::model::DNSConfig;
35258 /// let x = DNSConfig::new().set_cluster_dns_domain("example");
35259 /// ```
35260 pub fn set_cluster_dns_domain<T: std::convert::Into<std::string::String>>(
35261 mut self,
35262 v: T,
35263 ) -> Self {
35264 self.cluster_dns_domain = v.into();
35265 self
35266 }
35267
35268 /// Sets the value of [additive_vpc_scope_dns_domain][crate::model::DNSConfig::additive_vpc_scope_dns_domain].
35269 ///
35270 /// # Example
35271 /// ```ignore,no_run
35272 /// # use google_cloud_container_v1::model::DNSConfig;
35273 /// let x = DNSConfig::new().set_additive_vpc_scope_dns_domain("example");
35274 /// ```
35275 pub fn set_additive_vpc_scope_dns_domain<T: std::convert::Into<std::string::String>>(
35276 mut self,
35277 v: T,
35278 ) -> Self {
35279 self.additive_vpc_scope_dns_domain = v.into();
35280 self
35281 }
35282}
35283
35284impl wkt::message::Message for DNSConfig {
35285 fn typename() -> &'static str {
35286 "type.googleapis.com/google.container.v1.DNSConfig"
35287 }
35288}
35289
35290/// Defines additional types related to [DNSConfig].
35291pub mod dns_config {
35292 #[allow(unused_imports)]
35293 use super::*;
35294
35295 /// Provider lists the various in-cluster DNS providers.
35296 ///
35297 /// # Working with unknown values
35298 ///
35299 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35300 /// additional enum variants at any time. Adding new variants is not considered
35301 /// a breaking change. Applications should write their code in anticipation of:
35302 ///
35303 /// - New values appearing in future releases of the client library, **and**
35304 /// - New values received dynamically, without application changes.
35305 ///
35306 /// Please consult the [Working with enums] section in the user guide for some
35307 /// guidelines.
35308 ///
35309 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35310 #[derive(Clone, Debug, PartialEq)]
35311 #[non_exhaustive]
35312 pub enum Provider {
35313 /// Default value
35314 Unspecified,
35315 /// Use GKE default DNS provider(kube-dns) for DNS resolution.
35316 PlatformDefault,
35317 /// Use CloudDNS for DNS resolution.
35318 CloudDns,
35319 /// Use KubeDNS for DNS resolution.
35320 KubeDns,
35321 /// If set, the enum was initialized with an unknown value.
35322 ///
35323 /// Applications can examine the value using [Provider::value] or
35324 /// [Provider::name].
35325 UnknownValue(provider::UnknownValue),
35326 }
35327
35328 #[doc(hidden)]
35329 pub mod provider {
35330 #[allow(unused_imports)]
35331 use super::*;
35332 #[derive(Clone, Debug, PartialEq)]
35333 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35334 }
35335
35336 impl Provider {
35337 /// Gets the enum value.
35338 ///
35339 /// Returns `None` if the enum contains an unknown value deserialized from
35340 /// the string representation of enums.
35341 pub fn value(&self) -> std::option::Option<i32> {
35342 match self {
35343 Self::Unspecified => std::option::Option::Some(0),
35344 Self::PlatformDefault => std::option::Option::Some(1),
35345 Self::CloudDns => std::option::Option::Some(2),
35346 Self::KubeDns => std::option::Option::Some(3),
35347 Self::UnknownValue(u) => u.0.value(),
35348 }
35349 }
35350
35351 /// Gets the enum value as a string.
35352 ///
35353 /// Returns `None` if the enum contains an unknown value deserialized from
35354 /// the integer representation of enums.
35355 pub fn name(&self) -> std::option::Option<&str> {
35356 match self {
35357 Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
35358 Self::PlatformDefault => std::option::Option::Some("PLATFORM_DEFAULT"),
35359 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
35360 Self::KubeDns => std::option::Option::Some("KUBE_DNS"),
35361 Self::UnknownValue(u) => u.0.name(),
35362 }
35363 }
35364 }
35365
35366 impl std::default::Default for Provider {
35367 fn default() -> Self {
35368 use std::convert::From;
35369 Self::from(0)
35370 }
35371 }
35372
35373 impl std::fmt::Display for Provider {
35374 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35375 wkt::internal::display_enum(f, self.name(), self.value())
35376 }
35377 }
35378
35379 impl std::convert::From<i32> for Provider {
35380 fn from(value: i32) -> Self {
35381 match value {
35382 0 => Self::Unspecified,
35383 1 => Self::PlatformDefault,
35384 2 => Self::CloudDns,
35385 3 => Self::KubeDns,
35386 _ => Self::UnknownValue(provider::UnknownValue(
35387 wkt::internal::UnknownEnumValue::Integer(value),
35388 )),
35389 }
35390 }
35391 }
35392
35393 impl std::convert::From<&str> for Provider {
35394 fn from(value: &str) -> Self {
35395 use std::string::ToString;
35396 match value {
35397 "PROVIDER_UNSPECIFIED" => Self::Unspecified,
35398 "PLATFORM_DEFAULT" => Self::PlatformDefault,
35399 "CLOUD_DNS" => Self::CloudDns,
35400 "KUBE_DNS" => Self::KubeDns,
35401 _ => Self::UnknownValue(provider::UnknownValue(
35402 wkt::internal::UnknownEnumValue::String(value.to_string()),
35403 )),
35404 }
35405 }
35406 }
35407
35408 impl serde::ser::Serialize for Provider {
35409 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35410 where
35411 S: serde::Serializer,
35412 {
35413 match self {
35414 Self::Unspecified => serializer.serialize_i32(0),
35415 Self::PlatformDefault => serializer.serialize_i32(1),
35416 Self::CloudDns => serializer.serialize_i32(2),
35417 Self::KubeDns => serializer.serialize_i32(3),
35418 Self::UnknownValue(u) => u.0.serialize(serializer),
35419 }
35420 }
35421 }
35422
35423 impl<'de> serde::de::Deserialize<'de> for Provider {
35424 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35425 where
35426 D: serde::Deserializer<'de>,
35427 {
35428 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
35429 ".google.container.v1.DNSConfig.Provider",
35430 ))
35431 }
35432 }
35433
35434 /// DNSScope lists the various scopes of access to cluster DNS records.
35435 ///
35436 /// # Working with unknown values
35437 ///
35438 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35439 /// additional enum variants at any time. Adding new variants is not considered
35440 /// a breaking change. Applications should write their code in anticipation of:
35441 ///
35442 /// - New values appearing in future releases of the client library, **and**
35443 /// - New values received dynamically, without application changes.
35444 ///
35445 /// Please consult the [Working with enums] section in the user guide for some
35446 /// guidelines.
35447 ///
35448 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35449 #[derive(Clone, Debug, PartialEq)]
35450 #[non_exhaustive]
35451 pub enum DNSScope {
35452 /// Default value, will be inferred as cluster scope.
35453 Unspecified,
35454 /// DNS records are accessible from within the cluster.
35455 ClusterScope,
35456 /// DNS records are accessible from within the VPC.
35457 VpcScope,
35458 /// If set, the enum was initialized with an unknown value.
35459 ///
35460 /// Applications can examine the value using [DNSScope::value] or
35461 /// [DNSScope::name].
35462 UnknownValue(dns_scope::UnknownValue),
35463 }
35464
35465 #[doc(hidden)]
35466 pub mod dns_scope {
35467 #[allow(unused_imports)]
35468 use super::*;
35469 #[derive(Clone, Debug, PartialEq)]
35470 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35471 }
35472
35473 impl DNSScope {
35474 /// Gets the enum value.
35475 ///
35476 /// Returns `None` if the enum contains an unknown value deserialized from
35477 /// the string representation of enums.
35478 pub fn value(&self) -> std::option::Option<i32> {
35479 match self {
35480 Self::Unspecified => std::option::Option::Some(0),
35481 Self::ClusterScope => std::option::Option::Some(1),
35482 Self::VpcScope => std::option::Option::Some(2),
35483 Self::UnknownValue(u) => u.0.value(),
35484 }
35485 }
35486
35487 /// Gets the enum value as a string.
35488 ///
35489 /// Returns `None` if the enum contains an unknown value deserialized from
35490 /// the integer representation of enums.
35491 pub fn name(&self) -> std::option::Option<&str> {
35492 match self {
35493 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
35494 Self::ClusterScope => std::option::Option::Some("CLUSTER_SCOPE"),
35495 Self::VpcScope => std::option::Option::Some("VPC_SCOPE"),
35496 Self::UnknownValue(u) => u.0.name(),
35497 }
35498 }
35499 }
35500
35501 impl std::default::Default for DNSScope {
35502 fn default() -> Self {
35503 use std::convert::From;
35504 Self::from(0)
35505 }
35506 }
35507
35508 impl std::fmt::Display for DNSScope {
35509 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35510 wkt::internal::display_enum(f, self.name(), self.value())
35511 }
35512 }
35513
35514 impl std::convert::From<i32> for DNSScope {
35515 fn from(value: i32) -> Self {
35516 match value {
35517 0 => Self::Unspecified,
35518 1 => Self::ClusterScope,
35519 2 => Self::VpcScope,
35520 _ => Self::UnknownValue(dns_scope::UnknownValue(
35521 wkt::internal::UnknownEnumValue::Integer(value),
35522 )),
35523 }
35524 }
35525 }
35526
35527 impl std::convert::From<&str> for DNSScope {
35528 fn from(value: &str) -> Self {
35529 use std::string::ToString;
35530 match value {
35531 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
35532 "CLUSTER_SCOPE" => Self::ClusterScope,
35533 "VPC_SCOPE" => Self::VpcScope,
35534 _ => Self::UnknownValue(dns_scope::UnknownValue(
35535 wkt::internal::UnknownEnumValue::String(value.to_string()),
35536 )),
35537 }
35538 }
35539 }
35540
35541 impl serde::ser::Serialize for DNSScope {
35542 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35543 where
35544 S: serde::Serializer,
35545 {
35546 match self {
35547 Self::Unspecified => serializer.serialize_i32(0),
35548 Self::ClusterScope => serializer.serialize_i32(1),
35549 Self::VpcScope => serializer.serialize_i32(2),
35550 Self::UnknownValue(u) => u.0.serialize(serializer),
35551 }
35552 }
35553 }
35554
35555 impl<'de> serde::de::Deserialize<'de> for DNSScope {
35556 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35557 where
35558 D: serde::Deserializer<'de>,
35559 {
35560 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DNSScope>::new(
35561 ".google.container.v1.DNSConfig.DNSScope",
35562 ))
35563 }
35564 }
35565}
35566
35567/// Constraints applied to pods.
35568#[derive(Clone, Default, PartialEq)]
35569#[non_exhaustive]
35570pub struct MaxPodsConstraint {
35571 /// Constraint enforced on the max num of pods per node.
35572 pub max_pods_per_node: i64,
35573
35574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35575}
35576
35577impl MaxPodsConstraint {
35578 /// Creates a new default instance.
35579 pub fn new() -> Self {
35580 std::default::Default::default()
35581 }
35582
35583 /// Sets the value of [max_pods_per_node][crate::model::MaxPodsConstraint::max_pods_per_node].
35584 ///
35585 /// # Example
35586 /// ```ignore,no_run
35587 /// # use google_cloud_container_v1::model::MaxPodsConstraint;
35588 /// let x = MaxPodsConstraint::new().set_max_pods_per_node(42);
35589 /// ```
35590 pub fn set_max_pods_per_node<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
35591 self.max_pods_per_node = v.into();
35592 self
35593 }
35594}
35595
35596impl wkt::message::Message for MaxPodsConstraint {
35597 fn typename() -> &'static str {
35598 "type.googleapis.com/google.container.v1.MaxPodsConstraint"
35599 }
35600}
35601
35602/// Configuration for the use of Kubernetes Service Accounts in IAM policies.
35603#[derive(Clone, Default, PartialEq)]
35604#[non_exhaustive]
35605pub struct WorkloadIdentityConfig {
35606 /// The workload pool to attach all Kubernetes service accounts to.
35607 pub workload_pool: std::string::String,
35608
35609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35610}
35611
35612impl WorkloadIdentityConfig {
35613 /// Creates a new default instance.
35614 pub fn new() -> Self {
35615 std::default::Default::default()
35616 }
35617
35618 /// Sets the value of [workload_pool][crate::model::WorkloadIdentityConfig::workload_pool].
35619 ///
35620 /// # Example
35621 /// ```ignore,no_run
35622 /// # use google_cloud_container_v1::model::WorkloadIdentityConfig;
35623 /// let x = WorkloadIdentityConfig::new().set_workload_pool("example");
35624 /// ```
35625 pub fn set_workload_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35626 self.workload_pool = v.into();
35627 self
35628 }
35629}
35630
35631impl wkt::message::Message for WorkloadIdentityConfig {
35632 fn typename() -> &'static str {
35633 "type.googleapis.com/google.container.v1.WorkloadIdentityConfig"
35634 }
35635}
35636
35637/// IdentityServiceConfig is configuration for Identity Service which allows
35638/// customers to use external identity providers with the K8S API
35639#[derive(Clone, Default, PartialEq)]
35640#[non_exhaustive]
35641pub struct IdentityServiceConfig {
35642 /// Whether to enable the Identity Service component
35643 pub enabled: bool,
35644
35645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35646}
35647
35648impl IdentityServiceConfig {
35649 /// Creates a new default instance.
35650 pub fn new() -> Self {
35651 std::default::Default::default()
35652 }
35653
35654 /// Sets the value of [enabled][crate::model::IdentityServiceConfig::enabled].
35655 ///
35656 /// # Example
35657 /// ```ignore,no_run
35658 /// # use google_cloud_container_v1::model::IdentityServiceConfig;
35659 /// let x = IdentityServiceConfig::new().set_enabled(true);
35660 /// ```
35661 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35662 self.enabled = v.into();
35663 self
35664 }
35665}
35666
35667impl wkt::message::Message for IdentityServiceConfig {
35668 fn typename() -> &'static str {
35669 "type.googleapis.com/google.container.v1.IdentityServiceConfig"
35670 }
35671}
35672
35673/// Configuration for issuance of mTLS keys and certificates to Kubernetes pods.
35674#[derive(Clone, Default, PartialEq)]
35675#[non_exhaustive]
35676pub struct MeshCertificates {
35677 /// enable_certificates controls issuance of workload mTLS certificates.
35678 ///
35679 /// If set, the GKE Workload Identity Certificates controller and node agent
35680 /// will be deployed in the cluster, which can then be configured by creating a
35681 /// WorkloadCertificateConfig Custom Resource.
35682 ///
35683 /// Requires Workload Identity
35684 /// ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool]
35685 /// must be non-empty).
35686 ///
35687 /// [google.container.v1.WorkloadIdentityConfig.workload_pool]: crate::model::WorkloadIdentityConfig::workload_pool
35688 pub enable_certificates: std::option::Option<wkt::BoolValue>,
35689
35690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35691}
35692
35693impl MeshCertificates {
35694 /// Creates a new default instance.
35695 pub fn new() -> Self {
35696 std::default::Default::default()
35697 }
35698
35699 /// Sets the value of [enable_certificates][crate::model::MeshCertificates::enable_certificates].
35700 ///
35701 /// # Example
35702 /// ```ignore,no_run
35703 /// # use google_cloud_container_v1::model::MeshCertificates;
35704 /// use wkt::BoolValue;
35705 /// let x = MeshCertificates::new().set_enable_certificates(BoolValue::default()/* use setters */);
35706 /// ```
35707 pub fn set_enable_certificates<T>(mut self, v: T) -> Self
35708 where
35709 T: std::convert::Into<wkt::BoolValue>,
35710 {
35711 self.enable_certificates = std::option::Option::Some(v.into());
35712 self
35713 }
35714
35715 /// Sets or clears the value of [enable_certificates][crate::model::MeshCertificates::enable_certificates].
35716 ///
35717 /// # Example
35718 /// ```ignore,no_run
35719 /// # use google_cloud_container_v1::model::MeshCertificates;
35720 /// use wkt::BoolValue;
35721 /// let x = MeshCertificates::new().set_or_clear_enable_certificates(Some(BoolValue::default()/* use setters */));
35722 /// let x = MeshCertificates::new().set_or_clear_enable_certificates(None::<BoolValue>);
35723 /// ```
35724 pub fn set_or_clear_enable_certificates<T>(mut self, v: std::option::Option<T>) -> Self
35725 where
35726 T: std::convert::Into<wkt::BoolValue>,
35727 {
35728 self.enable_certificates = v.map(|x| x.into());
35729 self
35730 }
35731}
35732
35733impl wkt::message::Message for MeshCertificates {
35734 fn typename() -> &'static str {
35735 "type.googleapis.com/google.container.v1.MeshCertificates"
35736 }
35737}
35738
35739/// Configuration of etcd encryption.
35740#[derive(Clone, Default, PartialEq)]
35741#[non_exhaustive]
35742pub struct DatabaseEncryption {
35743 /// Name of CloudKMS key to use for the encryption of secrets in etcd.
35744 /// Ex. projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key
35745 pub key_name: std::string::String,
35746
35747 /// The desired state of etcd encryption.
35748 pub state: crate::model::database_encryption::State,
35749
35750 /// Output only. The current state of etcd encryption.
35751 pub current_state: std::option::Option<crate::model::database_encryption::CurrentState>,
35752
35753 /// Output only. Keys in use by the cluster for decrypting
35754 /// existing objects, in addition to the key in `key_name`.
35755 ///
35756 /// Each item is a CloudKMS key resource.
35757 pub decryption_keys: std::vec::Vec<std::string::String>,
35758
35759 /// Output only. Records errors seen during DatabaseEncryption update
35760 /// operations.
35761 pub last_operation_errors: std::vec::Vec<crate::model::database_encryption::OperationError>,
35762
35763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35764}
35765
35766impl DatabaseEncryption {
35767 /// Creates a new default instance.
35768 pub fn new() -> Self {
35769 std::default::Default::default()
35770 }
35771
35772 /// Sets the value of [key_name][crate::model::DatabaseEncryption::key_name].
35773 ///
35774 /// # Example
35775 /// ```ignore,no_run
35776 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35777 /// let x = DatabaseEncryption::new().set_key_name("example");
35778 /// ```
35779 pub fn set_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35780 self.key_name = v.into();
35781 self
35782 }
35783
35784 /// Sets the value of [state][crate::model::DatabaseEncryption::state].
35785 ///
35786 /// # Example
35787 /// ```ignore,no_run
35788 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35789 /// use google_cloud_container_v1::model::database_encryption::State;
35790 /// let x0 = DatabaseEncryption::new().set_state(State::Encrypted);
35791 /// let x1 = DatabaseEncryption::new().set_state(State::Decrypted);
35792 /// let x2 = DatabaseEncryption::new().set_state(State::AllObjectsEncryptionEnabled);
35793 /// ```
35794 pub fn set_state<T: std::convert::Into<crate::model::database_encryption::State>>(
35795 mut self,
35796 v: T,
35797 ) -> Self {
35798 self.state = v.into();
35799 self
35800 }
35801
35802 /// Sets the value of [current_state][crate::model::DatabaseEncryption::current_state].
35803 ///
35804 /// # Example
35805 /// ```ignore,no_run
35806 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35807 /// use google_cloud_container_v1::model::database_encryption::CurrentState;
35808 /// let x0 = DatabaseEncryption::new().set_current_state(CurrentState::Encrypted);
35809 /// let x1 = DatabaseEncryption::new().set_current_state(CurrentState::Decrypted);
35810 /// let x2 = DatabaseEncryption::new().set_current_state(CurrentState::EncryptionPending);
35811 /// ```
35812 pub fn set_current_state<T>(mut self, v: T) -> Self
35813 where
35814 T: std::convert::Into<crate::model::database_encryption::CurrentState>,
35815 {
35816 self.current_state = std::option::Option::Some(v.into());
35817 self
35818 }
35819
35820 /// Sets or clears the value of [current_state][crate::model::DatabaseEncryption::current_state].
35821 ///
35822 /// # Example
35823 /// ```ignore,no_run
35824 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35825 /// use google_cloud_container_v1::model::database_encryption::CurrentState;
35826 /// let x0 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::Encrypted));
35827 /// let x1 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::Decrypted));
35828 /// let x2 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::EncryptionPending));
35829 /// let x_none = DatabaseEncryption::new().set_or_clear_current_state(None::<CurrentState>);
35830 /// ```
35831 pub fn set_or_clear_current_state<T>(mut self, v: std::option::Option<T>) -> Self
35832 where
35833 T: std::convert::Into<crate::model::database_encryption::CurrentState>,
35834 {
35835 self.current_state = v.map(|x| x.into());
35836 self
35837 }
35838
35839 /// Sets the value of [decryption_keys][crate::model::DatabaseEncryption::decryption_keys].
35840 ///
35841 /// # Example
35842 /// ```ignore,no_run
35843 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35844 /// let x = DatabaseEncryption::new().set_decryption_keys(["a", "b", "c"]);
35845 /// ```
35846 pub fn set_decryption_keys<T, V>(mut self, v: T) -> Self
35847 where
35848 T: std::iter::IntoIterator<Item = V>,
35849 V: std::convert::Into<std::string::String>,
35850 {
35851 use std::iter::Iterator;
35852 self.decryption_keys = v.into_iter().map(|i| i.into()).collect();
35853 self
35854 }
35855
35856 /// Sets the value of [last_operation_errors][crate::model::DatabaseEncryption::last_operation_errors].
35857 ///
35858 /// # Example
35859 /// ```ignore,no_run
35860 /// # use google_cloud_container_v1::model::DatabaseEncryption;
35861 /// use google_cloud_container_v1::model::database_encryption::OperationError;
35862 /// let x = DatabaseEncryption::new()
35863 /// .set_last_operation_errors([
35864 /// OperationError::default()/* use setters */,
35865 /// OperationError::default()/* use (different) setters */,
35866 /// ]);
35867 /// ```
35868 pub fn set_last_operation_errors<T, V>(mut self, v: T) -> Self
35869 where
35870 T: std::iter::IntoIterator<Item = V>,
35871 V: std::convert::Into<crate::model::database_encryption::OperationError>,
35872 {
35873 use std::iter::Iterator;
35874 self.last_operation_errors = v.into_iter().map(|i| i.into()).collect();
35875 self
35876 }
35877}
35878
35879impl wkt::message::Message for DatabaseEncryption {
35880 fn typename() -> &'static str {
35881 "type.googleapis.com/google.container.v1.DatabaseEncryption"
35882 }
35883}
35884
35885/// Defines additional types related to [DatabaseEncryption].
35886pub mod database_encryption {
35887 #[allow(unused_imports)]
35888 use super::*;
35889
35890 /// OperationError records errors seen from CloudKMS keys
35891 /// encountered during updates to DatabaseEncryption configuration.
35892 #[derive(Clone, Default, PartialEq)]
35893 #[non_exhaustive]
35894 pub struct OperationError {
35895 /// CloudKMS key resource that had the error.
35896 pub key_name: std::string::String,
35897
35898 /// Description of the error seen during the operation.
35899 pub error_message: std::string::String,
35900
35901 /// Time when the CloudKMS error was seen.
35902 pub timestamp: std::option::Option<wkt::Timestamp>,
35903
35904 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35905 }
35906
35907 impl OperationError {
35908 /// Creates a new default instance.
35909 pub fn new() -> Self {
35910 std::default::Default::default()
35911 }
35912
35913 /// Sets the value of [key_name][crate::model::database_encryption::OperationError::key_name].
35914 ///
35915 /// # Example
35916 /// ```ignore,no_run
35917 /// # use google_cloud_container_v1::model::database_encryption::OperationError;
35918 /// let x = OperationError::new().set_key_name("example");
35919 /// ```
35920 pub fn set_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35921 self.key_name = v.into();
35922 self
35923 }
35924
35925 /// Sets the value of [error_message][crate::model::database_encryption::OperationError::error_message].
35926 ///
35927 /// # Example
35928 /// ```ignore,no_run
35929 /// # use google_cloud_container_v1::model::database_encryption::OperationError;
35930 /// let x = OperationError::new().set_error_message("example");
35931 /// ```
35932 pub fn set_error_message<T: std::convert::Into<std::string::String>>(
35933 mut self,
35934 v: T,
35935 ) -> Self {
35936 self.error_message = v.into();
35937 self
35938 }
35939
35940 /// Sets the value of [timestamp][crate::model::database_encryption::OperationError::timestamp].
35941 ///
35942 /// # Example
35943 /// ```ignore,no_run
35944 /// # use google_cloud_container_v1::model::database_encryption::OperationError;
35945 /// use wkt::Timestamp;
35946 /// let x = OperationError::new().set_timestamp(Timestamp::default()/* use setters */);
35947 /// ```
35948 pub fn set_timestamp<T>(mut self, v: T) -> Self
35949 where
35950 T: std::convert::Into<wkt::Timestamp>,
35951 {
35952 self.timestamp = std::option::Option::Some(v.into());
35953 self
35954 }
35955
35956 /// Sets or clears the value of [timestamp][crate::model::database_encryption::OperationError::timestamp].
35957 ///
35958 /// # Example
35959 /// ```ignore,no_run
35960 /// # use google_cloud_container_v1::model::database_encryption::OperationError;
35961 /// use wkt::Timestamp;
35962 /// let x = OperationError::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
35963 /// let x = OperationError::new().set_or_clear_timestamp(None::<Timestamp>);
35964 /// ```
35965 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
35966 where
35967 T: std::convert::Into<wkt::Timestamp>,
35968 {
35969 self.timestamp = v.map(|x| x.into());
35970 self
35971 }
35972 }
35973
35974 impl wkt::message::Message for OperationError {
35975 fn typename() -> &'static str {
35976 "type.googleapis.com/google.container.v1.DatabaseEncryption.OperationError"
35977 }
35978 }
35979
35980 /// State of etcd encryption.
35981 ///
35982 /// # Working with unknown values
35983 ///
35984 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35985 /// additional enum variants at any time. Adding new variants is not considered
35986 /// a breaking change. Applications should write their code in anticipation of:
35987 ///
35988 /// - New values appearing in future releases of the client library, **and**
35989 /// - New values received dynamically, without application changes.
35990 ///
35991 /// Please consult the [Working with enums] section in the user guide for some
35992 /// guidelines.
35993 ///
35994 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35995 #[derive(Clone, Debug, PartialEq)]
35996 #[non_exhaustive]
35997 pub enum State {
35998 /// Should never be set
35999 Unknown,
36000 /// Secrets in etcd are encrypted.
36001 Encrypted,
36002 /// Secrets in etcd are stored in plain text (at etcd level) - this is
36003 /// unrelated to Compute Engine level full disk encryption.
36004 Decrypted,
36005 /// Encryption of all objects in the storage is enabled. There is no
36006 /// guarantee that all objects in the storage are encrypted, but eventually
36007 /// they will be.
36008 AllObjectsEncryptionEnabled,
36009 /// If set, the enum was initialized with an unknown value.
36010 ///
36011 /// Applications can examine the value using [State::value] or
36012 /// [State::name].
36013 UnknownValue(state::UnknownValue),
36014 }
36015
36016 #[doc(hidden)]
36017 pub mod state {
36018 #[allow(unused_imports)]
36019 use super::*;
36020 #[derive(Clone, Debug, PartialEq)]
36021 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36022 }
36023
36024 impl State {
36025 /// Gets the enum value.
36026 ///
36027 /// Returns `None` if the enum contains an unknown value deserialized from
36028 /// the string representation of enums.
36029 pub fn value(&self) -> std::option::Option<i32> {
36030 match self {
36031 Self::Unknown => std::option::Option::Some(0),
36032 Self::Encrypted => std::option::Option::Some(1),
36033 Self::Decrypted => std::option::Option::Some(2),
36034 Self::AllObjectsEncryptionEnabled => std::option::Option::Some(3),
36035 Self::UnknownValue(u) => u.0.value(),
36036 }
36037 }
36038
36039 /// Gets the enum value as a string.
36040 ///
36041 /// Returns `None` if the enum contains an unknown value deserialized from
36042 /// the integer representation of enums.
36043 pub fn name(&self) -> std::option::Option<&str> {
36044 match self {
36045 Self::Unknown => std::option::Option::Some("UNKNOWN"),
36046 Self::Encrypted => std::option::Option::Some("ENCRYPTED"),
36047 Self::Decrypted => std::option::Option::Some("DECRYPTED"),
36048 Self::AllObjectsEncryptionEnabled => {
36049 std::option::Option::Some("ALL_OBJECTS_ENCRYPTION_ENABLED")
36050 }
36051 Self::UnknownValue(u) => u.0.name(),
36052 }
36053 }
36054 }
36055
36056 impl std::default::Default for State {
36057 fn default() -> Self {
36058 use std::convert::From;
36059 Self::from(0)
36060 }
36061 }
36062
36063 impl std::fmt::Display for State {
36064 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36065 wkt::internal::display_enum(f, self.name(), self.value())
36066 }
36067 }
36068
36069 impl std::convert::From<i32> for State {
36070 fn from(value: i32) -> Self {
36071 match value {
36072 0 => Self::Unknown,
36073 1 => Self::Encrypted,
36074 2 => Self::Decrypted,
36075 3 => Self::AllObjectsEncryptionEnabled,
36076 _ => Self::UnknownValue(state::UnknownValue(
36077 wkt::internal::UnknownEnumValue::Integer(value),
36078 )),
36079 }
36080 }
36081 }
36082
36083 impl std::convert::From<&str> for State {
36084 fn from(value: &str) -> Self {
36085 use std::string::ToString;
36086 match value {
36087 "UNKNOWN" => Self::Unknown,
36088 "ENCRYPTED" => Self::Encrypted,
36089 "DECRYPTED" => Self::Decrypted,
36090 "ALL_OBJECTS_ENCRYPTION_ENABLED" => Self::AllObjectsEncryptionEnabled,
36091 _ => Self::UnknownValue(state::UnknownValue(
36092 wkt::internal::UnknownEnumValue::String(value.to_string()),
36093 )),
36094 }
36095 }
36096 }
36097
36098 impl serde::ser::Serialize for State {
36099 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36100 where
36101 S: serde::Serializer,
36102 {
36103 match self {
36104 Self::Unknown => serializer.serialize_i32(0),
36105 Self::Encrypted => serializer.serialize_i32(1),
36106 Self::Decrypted => serializer.serialize_i32(2),
36107 Self::AllObjectsEncryptionEnabled => serializer.serialize_i32(3),
36108 Self::UnknownValue(u) => u.0.serialize(serializer),
36109 }
36110 }
36111 }
36112
36113 impl<'de> serde::de::Deserialize<'de> for State {
36114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36115 where
36116 D: serde::Deserializer<'de>,
36117 {
36118 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
36119 ".google.container.v1.DatabaseEncryption.State",
36120 ))
36121 }
36122 }
36123
36124 /// Current State of etcd encryption.
36125 ///
36126 /// # Working with unknown values
36127 ///
36128 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36129 /// additional enum variants at any time. Adding new variants is not considered
36130 /// a breaking change. Applications should write their code in anticipation of:
36131 ///
36132 /// - New values appearing in future releases of the client library, **and**
36133 /// - New values received dynamically, without application changes.
36134 ///
36135 /// Please consult the [Working with enums] section in the user guide for some
36136 /// guidelines.
36137 ///
36138 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36139 #[derive(Clone, Debug, PartialEq)]
36140 #[non_exhaustive]
36141 pub enum CurrentState {
36142 /// Should never be set
36143 Unspecified,
36144 /// Secrets in etcd are encrypted.
36145 Encrypted,
36146 /// Secrets in etcd are stored in plain text (at etcd level) - this is
36147 /// unrelated to Compute Engine level full disk encryption.
36148 Decrypted,
36149 /// Encryption (or re-encryption with a different CloudKMS key)
36150 /// of Secrets is in progress.
36151 EncryptionPending,
36152 /// Encryption (or re-encryption with a different CloudKMS key) of Secrets in
36153 /// etcd encountered an error.
36154 EncryptionError,
36155 /// De-crypting Secrets to plain text in etcd is in progress.
36156 DecryptionPending,
36157 /// De-crypting Secrets to plain text in etcd encountered an error.
36158 DecryptionError,
36159 /// Encryption of all objects in the storage is enabled.
36160 /// It does not guarantee that all objects in the storage are encrypted,
36161 /// but eventually they will be.
36162 AllObjectsEncryptionEnabled,
36163 /// Enablement of the encryption of all objects in storage is pending.
36164 AllObjectsEncryptionPending,
36165 /// Enabling encryption of all objects in storage encountered an error.
36166 AllObjectsEncryptionError,
36167 /// If set, the enum was initialized with an unknown value.
36168 ///
36169 /// Applications can examine the value using [CurrentState::value] or
36170 /// [CurrentState::name].
36171 UnknownValue(current_state::UnknownValue),
36172 }
36173
36174 #[doc(hidden)]
36175 pub mod current_state {
36176 #[allow(unused_imports)]
36177 use super::*;
36178 #[derive(Clone, Debug, PartialEq)]
36179 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36180 }
36181
36182 impl CurrentState {
36183 /// Gets the enum value.
36184 ///
36185 /// Returns `None` if the enum contains an unknown value deserialized from
36186 /// the string representation of enums.
36187 pub fn value(&self) -> std::option::Option<i32> {
36188 match self {
36189 Self::Unspecified => std::option::Option::Some(0),
36190 Self::Encrypted => std::option::Option::Some(7),
36191 Self::Decrypted => std::option::Option::Some(2),
36192 Self::EncryptionPending => std::option::Option::Some(3),
36193 Self::EncryptionError => std::option::Option::Some(4),
36194 Self::DecryptionPending => std::option::Option::Some(5),
36195 Self::DecryptionError => std::option::Option::Some(6),
36196 Self::AllObjectsEncryptionEnabled => std::option::Option::Some(8),
36197 Self::AllObjectsEncryptionPending => std::option::Option::Some(9),
36198 Self::AllObjectsEncryptionError => std::option::Option::Some(10),
36199 Self::UnknownValue(u) => u.0.value(),
36200 }
36201 }
36202
36203 /// Gets the enum value as a string.
36204 ///
36205 /// Returns `None` if the enum contains an unknown value deserialized from
36206 /// the integer representation of enums.
36207 pub fn name(&self) -> std::option::Option<&str> {
36208 match self {
36209 Self::Unspecified => std::option::Option::Some("CURRENT_STATE_UNSPECIFIED"),
36210 Self::Encrypted => std::option::Option::Some("CURRENT_STATE_ENCRYPTED"),
36211 Self::Decrypted => std::option::Option::Some("CURRENT_STATE_DECRYPTED"),
36212 Self::EncryptionPending => {
36213 std::option::Option::Some("CURRENT_STATE_ENCRYPTION_PENDING")
36214 }
36215 Self::EncryptionError => {
36216 std::option::Option::Some("CURRENT_STATE_ENCRYPTION_ERROR")
36217 }
36218 Self::DecryptionPending => {
36219 std::option::Option::Some("CURRENT_STATE_DECRYPTION_PENDING")
36220 }
36221 Self::DecryptionError => {
36222 std::option::Option::Some("CURRENT_STATE_DECRYPTION_ERROR")
36223 }
36224 Self::AllObjectsEncryptionEnabled => {
36225 std::option::Option::Some("CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_ENABLED")
36226 }
36227 Self::AllObjectsEncryptionPending => {
36228 std::option::Option::Some("CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_PENDING")
36229 }
36230 Self::AllObjectsEncryptionError => {
36231 std::option::Option::Some("CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_ERROR")
36232 }
36233 Self::UnknownValue(u) => u.0.name(),
36234 }
36235 }
36236 }
36237
36238 impl std::default::Default for CurrentState {
36239 fn default() -> Self {
36240 use std::convert::From;
36241 Self::from(0)
36242 }
36243 }
36244
36245 impl std::fmt::Display for CurrentState {
36246 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36247 wkt::internal::display_enum(f, self.name(), self.value())
36248 }
36249 }
36250
36251 impl std::convert::From<i32> for CurrentState {
36252 fn from(value: i32) -> Self {
36253 match value {
36254 0 => Self::Unspecified,
36255 2 => Self::Decrypted,
36256 3 => Self::EncryptionPending,
36257 4 => Self::EncryptionError,
36258 5 => Self::DecryptionPending,
36259 6 => Self::DecryptionError,
36260 7 => Self::Encrypted,
36261 8 => Self::AllObjectsEncryptionEnabled,
36262 9 => Self::AllObjectsEncryptionPending,
36263 10 => Self::AllObjectsEncryptionError,
36264 _ => Self::UnknownValue(current_state::UnknownValue(
36265 wkt::internal::UnknownEnumValue::Integer(value),
36266 )),
36267 }
36268 }
36269 }
36270
36271 impl std::convert::From<&str> for CurrentState {
36272 fn from(value: &str) -> Self {
36273 use std::string::ToString;
36274 match value {
36275 "CURRENT_STATE_UNSPECIFIED" => Self::Unspecified,
36276 "CURRENT_STATE_ENCRYPTED" => Self::Encrypted,
36277 "CURRENT_STATE_DECRYPTED" => Self::Decrypted,
36278 "CURRENT_STATE_ENCRYPTION_PENDING" => Self::EncryptionPending,
36279 "CURRENT_STATE_ENCRYPTION_ERROR" => Self::EncryptionError,
36280 "CURRENT_STATE_DECRYPTION_PENDING" => Self::DecryptionPending,
36281 "CURRENT_STATE_DECRYPTION_ERROR" => Self::DecryptionError,
36282 "CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_ENABLED" => Self::AllObjectsEncryptionEnabled,
36283 "CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_PENDING" => Self::AllObjectsEncryptionPending,
36284 "CURRENT_STATE_ALL_OBJECTS_ENCRYPTION_ERROR" => Self::AllObjectsEncryptionError,
36285 _ => Self::UnknownValue(current_state::UnknownValue(
36286 wkt::internal::UnknownEnumValue::String(value.to_string()),
36287 )),
36288 }
36289 }
36290 }
36291
36292 impl serde::ser::Serialize for CurrentState {
36293 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36294 where
36295 S: serde::Serializer,
36296 {
36297 match self {
36298 Self::Unspecified => serializer.serialize_i32(0),
36299 Self::Encrypted => serializer.serialize_i32(7),
36300 Self::Decrypted => serializer.serialize_i32(2),
36301 Self::EncryptionPending => serializer.serialize_i32(3),
36302 Self::EncryptionError => serializer.serialize_i32(4),
36303 Self::DecryptionPending => serializer.serialize_i32(5),
36304 Self::DecryptionError => serializer.serialize_i32(6),
36305 Self::AllObjectsEncryptionEnabled => serializer.serialize_i32(8),
36306 Self::AllObjectsEncryptionPending => serializer.serialize_i32(9),
36307 Self::AllObjectsEncryptionError => serializer.serialize_i32(10),
36308 Self::UnknownValue(u) => u.0.serialize(serializer),
36309 }
36310 }
36311 }
36312
36313 impl<'de> serde::de::Deserialize<'de> for CurrentState {
36314 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36315 where
36316 D: serde::Deserializer<'de>,
36317 {
36318 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurrentState>::new(
36319 ".google.container.v1.DatabaseEncryption.CurrentState",
36320 ))
36321 }
36322 }
36323}
36324
36325/// ListUsableSubnetworksRequest requests the list of usable subnetworks
36326/// available to a user for creating clusters.
36327#[derive(Clone, Default, PartialEq)]
36328#[non_exhaustive]
36329pub struct ListUsableSubnetworksRequest {
36330 /// The parent project where subnetworks are usable.
36331 /// Specified in the format `projects/*`.
36332 pub parent: std::string::String,
36333
36334 /// Filtering currently only supports equality on the networkProjectId and must
36335 /// be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId`
36336 /// is the project which owns the listed subnetworks. This defaults to the
36337 /// parent project ID.
36338 pub filter: std::string::String,
36339
36340 /// The max number of results per page that should be returned. If the number
36341 /// of available results is larger than `page_size`, a `next_page_token` is
36342 /// returned which can be used to get the next page of results in subsequent
36343 /// requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
36344 pub page_size: i32,
36345
36346 /// Specifies a page token to use. Set this to the nextPageToken returned by
36347 /// previous list requests to get the next page of results.
36348 pub page_token: std::string::String,
36349
36350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36351}
36352
36353impl ListUsableSubnetworksRequest {
36354 /// Creates a new default instance.
36355 pub fn new() -> Self {
36356 std::default::Default::default()
36357 }
36358
36359 /// Sets the value of [parent][crate::model::ListUsableSubnetworksRequest::parent].
36360 ///
36361 /// # Example
36362 /// ```ignore,no_run
36363 /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
36364 /// let x = ListUsableSubnetworksRequest::new().set_parent("example");
36365 /// ```
36366 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36367 self.parent = v.into();
36368 self
36369 }
36370
36371 /// Sets the value of [filter][crate::model::ListUsableSubnetworksRequest::filter].
36372 ///
36373 /// # Example
36374 /// ```ignore,no_run
36375 /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
36376 /// let x = ListUsableSubnetworksRequest::new().set_filter("example");
36377 /// ```
36378 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36379 self.filter = v.into();
36380 self
36381 }
36382
36383 /// Sets the value of [page_size][crate::model::ListUsableSubnetworksRequest::page_size].
36384 ///
36385 /// # Example
36386 /// ```ignore,no_run
36387 /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
36388 /// let x = ListUsableSubnetworksRequest::new().set_page_size(42);
36389 /// ```
36390 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
36391 self.page_size = v.into();
36392 self
36393 }
36394
36395 /// Sets the value of [page_token][crate::model::ListUsableSubnetworksRequest::page_token].
36396 ///
36397 /// # Example
36398 /// ```ignore,no_run
36399 /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
36400 /// let x = ListUsableSubnetworksRequest::new().set_page_token("example");
36401 /// ```
36402 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36403 self.page_token = v.into();
36404 self
36405 }
36406}
36407
36408impl wkt::message::Message for ListUsableSubnetworksRequest {
36409 fn typename() -> &'static str {
36410 "type.googleapis.com/google.container.v1.ListUsableSubnetworksRequest"
36411 }
36412}
36413
36414/// ListUsableSubnetworksResponse is the response of
36415/// ListUsableSubnetworksRequest.
36416#[derive(Clone, Default, PartialEq)]
36417#[non_exhaustive]
36418pub struct ListUsableSubnetworksResponse {
36419 /// A list of usable subnetworks in the specified network project.
36420 pub subnetworks: std::vec::Vec<crate::model::UsableSubnetwork>,
36421
36422 /// This token allows you to get the next page of results for list requests.
36423 /// If the number of results is larger than `page_size`, use the
36424 /// `next_page_token` as a value for the query parameter `page_token` in the
36425 /// next request. The value will become empty when there are no more pages.
36426 pub next_page_token: std::string::String,
36427
36428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36429}
36430
36431impl ListUsableSubnetworksResponse {
36432 /// Creates a new default instance.
36433 pub fn new() -> Self {
36434 std::default::Default::default()
36435 }
36436
36437 /// Sets the value of [subnetworks][crate::model::ListUsableSubnetworksResponse::subnetworks].
36438 ///
36439 /// # Example
36440 /// ```ignore,no_run
36441 /// # use google_cloud_container_v1::model::ListUsableSubnetworksResponse;
36442 /// use google_cloud_container_v1::model::UsableSubnetwork;
36443 /// let x = ListUsableSubnetworksResponse::new()
36444 /// .set_subnetworks([
36445 /// UsableSubnetwork::default()/* use setters */,
36446 /// UsableSubnetwork::default()/* use (different) setters */,
36447 /// ]);
36448 /// ```
36449 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
36450 where
36451 T: std::iter::IntoIterator<Item = V>,
36452 V: std::convert::Into<crate::model::UsableSubnetwork>,
36453 {
36454 use std::iter::Iterator;
36455 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
36456 self
36457 }
36458
36459 /// Sets the value of [next_page_token][crate::model::ListUsableSubnetworksResponse::next_page_token].
36460 ///
36461 /// # Example
36462 /// ```ignore,no_run
36463 /// # use google_cloud_container_v1::model::ListUsableSubnetworksResponse;
36464 /// let x = ListUsableSubnetworksResponse::new().set_next_page_token("example");
36465 /// ```
36466 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36467 self.next_page_token = v.into();
36468 self
36469 }
36470}
36471
36472impl wkt::message::Message for ListUsableSubnetworksResponse {
36473 fn typename() -> &'static str {
36474 "type.googleapis.com/google.container.v1.ListUsableSubnetworksResponse"
36475 }
36476}
36477
36478#[doc(hidden)]
36479impl google_cloud_gax::paginator::internal::PageableResponse for ListUsableSubnetworksResponse {
36480 type PageItem = crate::model::UsableSubnetwork;
36481
36482 fn items(self) -> std::vec::Vec<Self::PageItem> {
36483 self.subnetworks
36484 }
36485
36486 fn next_page_token(&self) -> std::string::String {
36487 use std::clone::Clone;
36488 self.next_page_token.clone()
36489 }
36490}
36491
36492/// Secondary IP range of a usable subnetwork.
36493#[derive(Clone, Default, PartialEq)]
36494#[non_exhaustive]
36495pub struct UsableSubnetworkSecondaryRange {
36496 /// The name associated with this subnetwork secondary range, used when adding
36497 /// an alias IP range to a VM instance.
36498 pub range_name: std::string::String,
36499
36500 /// The range of IP addresses belonging to this subnetwork secondary range.
36501 pub ip_cidr_range: std::string::String,
36502
36503 /// This field is to determine the status of the secondary range programmably.
36504 pub status: crate::model::usable_subnetwork_secondary_range::Status,
36505
36506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36507}
36508
36509impl UsableSubnetworkSecondaryRange {
36510 /// Creates a new default instance.
36511 pub fn new() -> Self {
36512 std::default::Default::default()
36513 }
36514
36515 /// Sets the value of [range_name][crate::model::UsableSubnetworkSecondaryRange::range_name].
36516 ///
36517 /// # Example
36518 /// ```ignore,no_run
36519 /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
36520 /// let x = UsableSubnetworkSecondaryRange::new().set_range_name("example");
36521 /// ```
36522 pub fn set_range_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36523 self.range_name = v.into();
36524 self
36525 }
36526
36527 /// Sets the value of [ip_cidr_range][crate::model::UsableSubnetworkSecondaryRange::ip_cidr_range].
36528 ///
36529 /// # Example
36530 /// ```ignore,no_run
36531 /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
36532 /// let x = UsableSubnetworkSecondaryRange::new().set_ip_cidr_range("example");
36533 /// ```
36534 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36535 self.ip_cidr_range = v.into();
36536 self
36537 }
36538
36539 /// Sets the value of [status][crate::model::UsableSubnetworkSecondaryRange::status].
36540 ///
36541 /// # Example
36542 /// ```ignore,no_run
36543 /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
36544 /// use google_cloud_container_v1::model::usable_subnetwork_secondary_range::Status;
36545 /// let x0 = UsableSubnetworkSecondaryRange::new().set_status(Status::Unused);
36546 /// let x1 = UsableSubnetworkSecondaryRange::new().set_status(Status::InUseService);
36547 /// let x2 = UsableSubnetworkSecondaryRange::new().set_status(Status::InUseShareablePod);
36548 /// ```
36549 pub fn set_status<
36550 T: std::convert::Into<crate::model::usable_subnetwork_secondary_range::Status>,
36551 >(
36552 mut self,
36553 v: T,
36554 ) -> Self {
36555 self.status = v.into();
36556 self
36557 }
36558}
36559
36560impl wkt::message::Message for UsableSubnetworkSecondaryRange {
36561 fn typename() -> &'static str {
36562 "type.googleapis.com/google.container.v1.UsableSubnetworkSecondaryRange"
36563 }
36564}
36565
36566/// Defines additional types related to [UsableSubnetworkSecondaryRange].
36567pub mod usable_subnetwork_secondary_range {
36568 #[allow(unused_imports)]
36569 use super::*;
36570
36571 /// Status shows the current usage of a secondary IP range.
36572 ///
36573 /// # Working with unknown values
36574 ///
36575 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36576 /// additional enum variants at any time. Adding new variants is not considered
36577 /// a breaking change. Applications should write their code in anticipation of:
36578 ///
36579 /// - New values appearing in future releases of the client library, **and**
36580 /// - New values received dynamically, without application changes.
36581 ///
36582 /// Please consult the [Working with enums] section in the user guide for some
36583 /// guidelines.
36584 ///
36585 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36586 #[derive(Clone, Debug, PartialEq)]
36587 #[non_exhaustive]
36588 pub enum Status {
36589 /// UNKNOWN is the zero value of the Status enum. It's not a valid status.
36590 Unknown,
36591 /// UNUSED denotes that this range is unclaimed by any cluster.
36592 Unused,
36593 /// IN_USE_SERVICE denotes that this range is claimed by cluster(s) for
36594 /// services. User-managed services range can be shared between clusters
36595 /// within the same subnetwork.
36596 InUseService,
36597 /// IN_USE_SHAREABLE_POD denotes this range was created by the network admin
36598 /// and is currently claimed by a cluster for pods. It can only be used by
36599 /// other clusters as a pod range.
36600 InUseShareablePod,
36601 /// IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed
36602 /// for pods. It cannot be used for other clusters.
36603 InUseManagedPod,
36604 /// If set, the enum was initialized with an unknown value.
36605 ///
36606 /// Applications can examine the value using [Status::value] or
36607 /// [Status::name].
36608 UnknownValue(status::UnknownValue),
36609 }
36610
36611 #[doc(hidden)]
36612 pub mod status {
36613 #[allow(unused_imports)]
36614 use super::*;
36615 #[derive(Clone, Debug, PartialEq)]
36616 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36617 }
36618
36619 impl Status {
36620 /// Gets the enum value.
36621 ///
36622 /// Returns `None` if the enum contains an unknown value deserialized from
36623 /// the string representation of enums.
36624 pub fn value(&self) -> std::option::Option<i32> {
36625 match self {
36626 Self::Unknown => std::option::Option::Some(0),
36627 Self::Unused => std::option::Option::Some(1),
36628 Self::InUseService => std::option::Option::Some(2),
36629 Self::InUseShareablePod => std::option::Option::Some(3),
36630 Self::InUseManagedPod => std::option::Option::Some(4),
36631 Self::UnknownValue(u) => u.0.value(),
36632 }
36633 }
36634
36635 /// Gets the enum value as a string.
36636 ///
36637 /// Returns `None` if the enum contains an unknown value deserialized from
36638 /// the integer representation of enums.
36639 pub fn name(&self) -> std::option::Option<&str> {
36640 match self {
36641 Self::Unknown => std::option::Option::Some("UNKNOWN"),
36642 Self::Unused => std::option::Option::Some("UNUSED"),
36643 Self::InUseService => std::option::Option::Some("IN_USE_SERVICE"),
36644 Self::InUseShareablePod => std::option::Option::Some("IN_USE_SHAREABLE_POD"),
36645 Self::InUseManagedPod => std::option::Option::Some("IN_USE_MANAGED_POD"),
36646 Self::UnknownValue(u) => u.0.name(),
36647 }
36648 }
36649 }
36650
36651 impl std::default::Default for Status {
36652 fn default() -> Self {
36653 use std::convert::From;
36654 Self::from(0)
36655 }
36656 }
36657
36658 impl std::fmt::Display for Status {
36659 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36660 wkt::internal::display_enum(f, self.name(), self.value())
36661 }
36662 }
36663
36664 impl std::convert::From<i32> for Status {
36665 fn from(value: i32) -> Self {
36666 match value {
36667 0 => Self::Unknown,
36668 1 => Self::Unused,
36669 2 => Self::InUseService,
36670 3 => Self::InUseShareablePod,
36671 4 => Self::InUseManagedPod,
36672 _ => Self::UnknownValue(status::UnknownValue(
36673 wkt::internal::UnknownEnumValue::Integer(value),
36674 )),
36675 }
36676 }
36677 }
36678
36679 impl std::convert::From<&str> for Status {
36680 fn from(value: &str) -> Self {
36681 use std::string::ToString;
36682 match value {
36683 "UNKNOWN" => Self::Unknown,
36684 "UNUSED" => Self::Unused,
36685 "IN_USE_SERVICE" => Self::InUseService,
36686 "IN_USE_SHAREABLE_POD" => Self::InUseShareablePod,
36687 "IN_USE_MANAGED_POD" => Self::InUseManagedPod,
36688 _ => Self::UnknownValue(status::UnknownValue(
36689 wkt::internal::UnknownEnumValue::String(value.to_string()),
36690 )),
36691 }
36692 }
36693 }
36694
36695 impl serde::ser::Serialize for Status {
36696 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36697 where
36698 S: serde::Serializer,
36699 {
36700 match self {
36701 Self::Unknown => serializer.serialize_i32(0),
36702 Self::Unused => serializer.serialize_i32(1),
36703 Self::InUseService => serializer.serialize_i32(2),
36704 Self::InUseShareablePod => serializer.serialize_i32(3),
36705 Self::InUseManagedPod => serializer.serialize_i32(4),
36706 Self::UnknownValue(u) => u.0.serialize(serializer),
36707 }
36708 }
36709 }
36710
36711 impl<'de> serde::de::Deserialize<'de> for Status {
36712 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36713 where
36714 D: serde::Deserializer<'de>,
36715 {
36716 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
36717 ".google.container.v1.UsableSubnetworkSecondaryRange.Status",
36718 ))
36719 }
36720 }
36721}
36722
36723/// UsableSubnetwork resource returns the subnetwork name, its associated network
36724/// and the primary CIDR range.
36725#[derive(Clone, Default, PartialEq)]
36726#[non_exhaustive]
36727pub struct UsableSubnetwork {
36728 /// Subnetwork Name.
36729 /// Example: projects/my-project/regions/us-central1/subnetworks/my-subnet
36730 pub subnetwork: std::string::String,
36731
36732 /// Network Name.
36733 /// Example: projects/my-project/global/networks/my-network
36734 pub network: std::string::String,
36735
36736 /// The range of internal addresses that are owned by this subnetwork.
36737 pub ip_cidr_range: std::string::String,
36738
36739 /// Secondary IP ranges.
36740 pub secondary_ip_ranges: std::vec::Vec<crate::model::UsableSubnetworkSecondaryRange>,
36741
36742 /// A human readable status message representing the reasons for cases where
36743 /// the caller cannot use the secondary ranges under the subnet. For example if
36744 /// the secondary_ip_ranges is empty due to a permission issue, an insufficient
36745 /// permission message will be given by status_message.
36746 pub status_message: std::string::String,
36747
36748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36749}
36750
36751impl UsableSubnetwork {
36752 /// Creates a new default instance.
36753 pub fn new() -> Self {
36754 std::default::Default::default()
36755 }
36756
36757 /// Sets the value of [subnetwork][crate::model::UsableSubnetwork::subnetwork].
36758 ///
36759 /// # Example
36760 /// ```ignore,no_run
36761 /// # use google_cloud_container_v1::model::UsableSubnetwork;
36762 /// let x = UsableSubnetwork::new().set_subnetwork("example");
36763 /// ```
36764 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36765 self.subnetwork = v.into();
36766 self
36767 }
36768
36769 /// Sets the value of [network][crate::model::UsableSubnetwork::network].
36770 ///
36771 /// # Example
36772 /// ```ignore,no_run
36773 /// # use google_cloud_container_v1::model::UsableSubnetwork;
36774 /// let x = UsableSubnetwork::new().set_network("example");
36775 /// ```
36776 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36777 self.network = v.into();
36778 self
36779 }
36780
36781 /// Sets the value of [ip_cidr_range][crate::model::UsableSubnetwork::ip_cidr_range].
36782 ///
36783 /// # Example
36784 /// ```ignore,no_run
36785 /// # use google_cloud_container_v1::model::UsableSubnetwork;
36786 /// let x = UsableSubnetwork::new().set_ip_cidr_range("example");
36787 /// ```
36788 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36789 self.ip_cidr_range = v.into();
36790 self
36791 }
36792
36793 /// Sets the value of [secondary_ip_ranges][crate::model::UsableSubnetwork::secondary_ip_ranges].
36794 ///
36795 /// # Example
36796 /// ```ignore,no_run
36797 /// # use google_cloud_container_v1::model::UsableSubnetwork;
36798 /// use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
36799 /// let x = UsableSubnetwork::new()
36800 /// .set_secondary_ip_ranges([
36801 /// UsableSubnetworkSecondaryRange::default()/* use setters */,
36802 /// UsableSubnetworkSecondaryRange::default()/* use (different) setters */,
36803 /// ]);
36804 /// ```
36805 pub fn set_secondary_ip_ranges<T, V>(mut self, v: T) -> Self
36806 where
36807 T: std::iter::IntoIterator<Item = V>,
36808 V: std::convert::Into<crate::model::UsableSubnetworkSecondaryRange>,
36809 {
36810 use std::iter::Iterator;
36811 self.secondary_ip_ranges = v.into_iter().map(|i| i.into()).collect();
36812 self
36813 }
36814
36815 /// Sets the value of [status_message][crate::model::UsableSubnetwork::status_message].
36816 ///
36817 /// # Example
36818 /// ```ignore,no_run
36819 /// # use google_cloud_container_v1::model::UsableSubnetwork;
36820 /// let x = UsableSubnetwork::new().set_status_message("example");
36821 /// ```
36822 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36823 self.status_message = v.into();
36824 self
36825 }
36826}
36827
36828impl wkt::message::Message for UsableSubnetwork {
36829 fn typename() -> &'static str {
36830 "type.googleapis.com/google.container.v1.UsableSubnetwork"
36831 }
36832}
36833
36834/// Configuration for exporting cluster resource usages.
36835#[derive(Clone, Default, PartialEq)]
36836#[non_exhaustive]
36837pub struct ResourceUsageExportConfig {
36838 /// Configuration to use BigQuery as usage export destination.
36839 pub bigquery_destination:
36840 std::option::Option<crate::model::resource_usage_export_config::BigQueryDestination>,
36841
36842 /// Whether to enable network egress metering for this cluster. If enabled, a
36843 /// daemonset will be created in the cluster to meter network egress traffic.
36844 pub enable_network_egress_metering: bool,
36845
36846 /// Configuration to enable resource consumption metering.
36847 pub consumption_metering_config:
36848 std::option::Option<crate::model::resource_usage_export_config::ConsumptionMeteringConfig>,
36849
36850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36851}
36852
36853impl ResourceUsageExportConfig {
36854 /// Creates a new default instance.
36855 pub fn new() -> Self {
36856 std::default::Default::default()
36857 }
36858
36859 /// Sets the value of [bigquery_destination][crate::model::ResourceUsageExportConfig::bigquery_destination].
36860 ///
36861 /// # Example
36862 /// ```ignore,no_run
36863 /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
36864 /// use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
36865 /// let x = ResourceUsageExportConfig::new().set_bigquery_destination(BigQueryDestination::default()/* use setters */);
36866 /// ```
36867 pub fn set_bigquery_destination<T>(mut self, v: T) -> Self
36868 where
36869 T: std::convert::Into<crate::model::resource_usage_export_config::BigQueryDestination>,
36870 {
36871 self.bigquery_destination = std::option::Option::Some(v.into());
36872 self
36873 }
36874
36875 /// Sets or clears the value of [bigquery_destination][crate::model::ResourceUsageExportConfig::bigquery_destination].
36876 ///
36877 /// # Example
36878 /// ```ignore,no_run
36879 /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
36880 /// use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
36881 /// let x = ResourceUsageExportConfig::new().set_or_clear_bigquery_destination(Some(BigQueryDestination::default()/* use setters */));
36882 /// let x = ResourceUsageExportConfig::new().set_or_clear_bigquery_destination(None::<BigQueryDestination>);
36883 /// ```
36884 pub fn set_or_clear_bigquery_destination<T>(mut self, v: std::option::Option<T>) -> Self
36885 where
36886 T: std::convert::Into<crate::model::resource_usage_export_config::BigQueryDestination>,
36887 {
36888 self.bigquery_destination = v.map(|x| x.into());
36889 self
36890 }
36891
36892 /// Sets the value of [enable_network_egress_metering][crate::model::ResourceUsageExportConfig::enable_network_egress_metering].
36893 ///
36894 /// # Example
36895 /// ```ignore,no_run
36896 /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
36897 /// let x = ResourceUsageExportConfig::new().set_enable_network_egress_metering(true);
36898 /// ```
36899 pub fn set_enable_network_egress_metering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
36900 self.enable_network_egress_metering = v.into();
36901 self
36902 }
36903
36904 /// Sets the value of [consumption_metering_config][crate::model::ResourceUsageExportConfig::consumption_metering_config].
36905 ///
36906 /// # Example
36907 /// ```ignore,no_run
36908 /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
36909 /// use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
36910 /// let x = ResourceUsageExportConfig::new().set_consumption_metering_config(ConsumptionMeteringConfig::default()/* use setters */);
36911 /// ```
36912 pub fn set_consumption_metering_config<T>(mut self, v: T) -> Self
36913 where
36914 T: std::convert::Into<
36915 crate::model::resource_usage_export_config::ConsumptionMeteringConfig,
36916 >,
36917 {
36918 self.consumption_metering_config = std::option::Option::Some(v.into());
36919 self
36920 }
36921
36922 /// Sets or clears the value of [consumption_metering_config][crate::model::ResourceUsageExportConfig::consumption_metering_config].
36923 ///
36924 /// # Example
36925 /// ```ignore,no_run
36926 /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
36927 /// use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
36928 /// let x = ResourceUsageExportConfig::new().set_or_clear_consumption_metering_config(Some(ConsumptionMeteringConfig::default()/* use setters */));
36929 /// let x = ResourceUsageExportConfig::new().set_or_clear_consumption_metering_config(None::<ConsumptionMeteringConfig>);
36930 /// ```
36931 pub fn set_or_clear_consumption_metering_config<T>(mut self, v: std::option::Option<T>) -> Self
36932 where
36933 T: std::convert::Into<
36934 crate::model::resource_usage_export_config::ConsumptionMeteringConfig,
36935 >,
36936 {
36937 self.consumption_metering_config = v.map(|x| x.into());
36938 self
36939 }
36940}
36941
36942impl wkt::message::Message for ResourceUsageExportConfig {
36943 fn typename() -> &'static str {
36944 "type.googleapis.com/google.container.v1.ResourceUsageExportConfig"
36945 }
36946}
36947
36948/// Defines additional types related to [ResourceUsageExportConfig].
36949pub mod resource_usage_export_config {
36950 #[allow(unused_imports)]
36951 use super::*;
36952
36953 /// Parameters for using BigQuery as the destination of resource usage export.
36954 #[derive(Clone, Default, PartialEq)]
36955 #[non_exhaustive]
36956 pub struct BigQueryDestination {
36957 /// The ID of a BigQuery Dataset.
36958 pub dataset_id: std::string::String,
36959
36960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36961 }
36962
36963 impl BigQueryDestination {
36964 /// Creates a new default instance.
36965 pub fn new() -> Self {
36966 std::default::Default::default()
36967 }
36968
36969 /// Sets the value of [dataset_id][crate::model::resource_usage_export_config::BigQueryDestination::dataset_id].
36970 ///
36971 /// # Example
36972 /// ```ignore,no_run
36973 /// # use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
36974 /// let x = BigQueryDestination::new().set_dataset_id("example");
36975 /// ```
36976 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36977 self.dataset_id = v.into();
36978 self
36979 }
36980 }
36981
36982 impl wkt::message::Message for BigQueryDestination {
36983 fn typename() -> &'static str {
36984 "type.googleapis.com/google.container.v1.ResourceUsageExportConfig.BigQueryDestination"
36985 }
36986 }
36987
36988 /// Parameters for controlling consumption metering.
36989 #[derive(Clone, Default, PartialEq)]
36990 #[non_exhaustive]
36991 pub struct ConsumptionMeteringConfig {
36992 /// Whether to enable consumption metering for this cluster. If enabled, a
36993 /// second BigQuery table will be created to hold resource consumption
36994 /// records.
36995 pub enabled: bool,
36996
36997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36998 }
36999
37000 impl ConsumptionMeteringConfig {
37001 /// Creates a new default instance.
37002 pub fn new() -> Self {
37003 std::default::Default::default()
37004 }
37005
37006 /// Sets the value of [enabled][crate::model::resource_usage_export_config::ConsumptionMeteringConfig::enabled].
37007 ///
37008 /// # Example
37009 /// ```ignore,no_run
37010 /// # use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
37011 /// let x = ConsumptionMeteringConfig::new().set_enabled(true);
37012 /// ```
37013 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37014 self.enabled = v.into();
37015 self
37016 }
37017 }
37018
37019 impl wkt::message::Message for ConsumptionMeteringConfig {
37020 fn typename() -> &'static str {
37021 "type.googleapis.com/google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig"
37022 }
37023 }
37024}
37025
37026/// VerticalPodAutoscaling contains global, per-cluster information
37027/// required by Vertical Pod Autoscaler to automatically adjust
37028/// the resources of pods controlled by it.
37029#[derive(Clone, Default, PartialEq)]
37030#[non_exhaustive]
37031pub struct VerticalPodAutoscaling {
37032 /// Enables vertical pod autoscaling.
37033 pub enabled: bool,
37034
37035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37036}
37037
37038impl VerticalPodAutoscaling {
37039 /// Creates a new default instance.
37040 pub fn new() -> Self {
37041 std::default::Default::default()
37042 }
37043
37044 /// Sets the value of [enabled][crate::model::VerticalPodAutoscaling::enabled].
37045 ///
37046 /// # Example
37047 /// ```ignore,no_run
37048 /// # use google_cloud_container_v1::model::VerticalPodAutoscaling;
37049 /// let x = VerticalPodAutoscaling::new().set_enabled(true);
37050 /// ```
37051 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37052 self.enabled = v.into();
37053 self
37054 }
37055}
37056
37057impl wkt::message::Message for VerticalPodAutoscaling {
37058 fn typename() -> &'static str {
37059 "type.googleapis.com/google.container.v1.VerticalPodAutoscaling"
37060 }
37061}
37062
37063/// DefaultSnatStatus contains the desired state of whether default sNAT should
37064/// be disabled on the cluster.
37065#[derive(Clone, Default, PartialEq)]
37066#[non_exhaustive]
37067pub struct DefaultSnatStatus {
37068 /// Disables cluster default sNAT rules.
37069 pub disabled: bool,
37070
37071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37072}
37073
37074impl DefaultSnatStatus {
37075 /// Creates a new default instance.
37076 pub fn new() -> Self {
37077 std::default::Default::default()
37078 }
37079
37080 /// Sets the value of [disabled][crate::model::DefaultSnatStatus::disabled].
37081 ///
37082 /// # Example
37083 /// ```ignore,no_run
37084 /// # use google_cloud_container_v1::model::DefaultSnatStatus;
37085 /// let x = DefaultSnatStatus::new().set_disabled(true);
37086 /// ```
37087 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37088 self.disabled = v.into();
37089 self
37090 }
37091}
37092
37093impl wkt::message::Message for DefaultSnatStatus {
37094 fn typename() -> &'static str {
37095 "type.googleapis.com/google.container.v1.DefaultSnatStatus"
37096 }
37097}
37098
37099/// Configuration of Shielded Nodes feature.
37100#[derive(Clone, Default, PartialEq)]
37101#[non_exhaustive]
37102pub struct ShieldedNodes {
37103 /// Whether Shielded Nodes features are enabled on all nodes in this cluster.
37104 pub enabled: bool,
37105
37106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37107}
37108
37109impl ShieldedNodes {
37110 /// Creates a new default instance.
37111 pub fn new() -> Self {
37112 std::default::Default::default()
37113 }
37114
37115 /// Sets the value of [enabled][crate::model::ShieldedNodes::enabled].
37116 ///
37117 /// # Example
37118 /// ```ignore,no_run
37119 /// # use google_cloud_container_v1::model::ShieldedNodes;
37120 /// let x = ShieldedNodes::new().set_enabled(true);
37121 /// ```
37122 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37123 self.enabled = v.into();
37124 self
37125 }
37126}
37127
37128impl wkt::message::Message for ShieldedNodes {
37129 fn typename() -> &'static str {
37130 "type.googleapis.com/google.container.v1.ShieldedNodes"
37131 }
37132}
37133
37134/// Configuration of gVNIC feature.
37135#[derive(Clone, Default, PartialEq)]
37136#[non_exhaustive]
37137pub struct VirtualNIC {
37138 /// Whether gVNIC features are enabled in the node pool.
37139 pub enabled: bool,
37140
37141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37142}
37143
37144impl VirtualNIC {
37145 /// Creates a new default instance.
37146 pub fn new() -> Self {
37147 std::default::Default::default()
37148 }
37149
37150 /// Sets the value of [enabled][crate::model::VirtualNIC::enabled].
37151 ///
37152 /// # Example
37153 /// ```ignore,no_run
37154 /// # use google_cloud_container_v1::model::VirtualNIC;
37155 /// let x = VirtualNIC::new().set_enabled(true);
37156 /// ```
37157 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37158 self.enabled = v.into();
37159 self
37160 }
37161}
37162
37163impl wkt::message::Message for VirtualNIC {
37164 fn typename() -> &'static str {
37165 "type.googleapis.com/google.container.v1.VirtualNIC"
37166 }
37167}
37168
37169/// Configuration of Fast Socket feature.
37170#[derive(Clone, Default, PartialEq)]
37171#[non_exhaustive]
37172pub struct FastSocket {
37173 /// Whether Fast Socket features are enabled in the node pool.
37174 pub enabled: bool,
37175
37176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37177}
37178
37179impl FastSocket {
37180 /// Creates a new default instance.
37181 pub fn new() -> Self {
37182 std::default::Default::default()
37183 }
37184
37185 /// Sets the value of [enabled][crate::model::FastSocket::enabled].
37186 ///
37187 /// # Example
37188 /// ```ignore,no_run
37189 /// # use google_cloud_container_v1::model::FastSocket;
37190 /// let x = FastSocket::new().set_enabled(true);
37191 /// ```
37192 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37193 self.enabled = v.into();
37194 self
37195 }
37196}
37197
37198impl wkt::message::Message for FastSocket {
37199 fn typename() -> &'static str {
37200 "type.googleapis.com/google.container.v1.FastSocket"
37201 }
37202}
37203
37204/// GPUDirectConfig specifies the GPU direct strategy on the node pool.
37205#[derive(Clone, Default, PartialEq)]
37206#[non_exhaustive]
37207pub struct GPUDirectConfig {
37208 /// The type of GPU direct strategy to enable on the node pool.
37209 pub gpu_direct_strategy:
37210 std::option::Option<crate::model::gpu_direct_config::GPUDirectStrategy>,
37211
37212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37213}
37214
37215impl GPUDirectConfig {
37216 /// Creates a new default instance.
37217 pub fn new() -> Self {
37218 std::default::Default::default()
37219 }
37220
37221 /// Sets the value of [gpu_direct_strategy][crate::model::GPUDirectConfig::gpu_direct_strategy].
37222 ///
37223 /// # Example
37224 /// ```ignore,no_run
37225 /// # use google_cloud_container_v1::model::GPUDirectConfig;
37226 /// use google_cloud_container_v1::model::gpu_direct_config::GPUDirectStrategy;
37227 /// let x0 = GPUDirectConfig::new().set_gpu_direct_strategy(GPUDirectStrategy::Rdma);
37228 /// ```
37229 pub fn set_gpu_direct_strategy<T>(mut self, v: T) -> Self
37230 where
37231 T: std::convert::Into<crate::model::gpu_direct_config::GPUDirectStrategy>,
37232 {
37233 self.gpu_direct_strategy = std::option::Option::Some(v.into());
37234 self
37235 }
37236
37237 /// Sets or clears the value of [gpu_direct_strategy][crate::model::GPUDirectConfig::gpu_direct_strategy].
37238 ///
37239 /// # Example
37240 /// ```ignore,no_run
37241 /// # use google_cloud_container_v1::model::GPUDirectConfig;
37242 /// use google_cloud_container_v1::model::gpu_direct_config::GPUDirectStrategy;
37243 /// let x0 = GPUDirectConfig::new().set_or_clear_gpu_direct_strategy(Some(GPUDirectStrategy::Rdma));
37244 /// let x_none = GPUDirectConfig::new().set_or_clear_gpu_direct_strategy(None::<GPUDirectStrategy>);
37245 /// ```
37246 pub fn set_or_clear_gpu_direct_strategy<T>(mut self, v: std::option::Option<T>) -> Self
37247 where
37248 T: std::convert::Into<crate::model::gpu_direct_config::GPUDirectStrategy>,
37249 {
37250 self.gpu_direct_strategy = v.map(|x| x.into());
37251 self
37252 }
37253}
37254
37255impl wkt::message::Message for GPUDirectConfig {
37256 fn typename() -> &'static str {
37257 "type.googleapis.com/google.container.v1.GPUDirectConfig"
37258 }
37259}
37260
37261/// Defines additional types related to [GPUDirectConfig].
37262pub mod gpu_direct_config {
37263 #[allow(unused_imports)]
37264 use super::*;
37265
37266 /// Option for GPU direct Strategies
37267 ///
37268 /// # Working with unknown values
37269 ///
37270 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37271 /// additional enum variants at any time. Adding new variants is not considered
37272 /// a breaking change. Applications should write their code in anticipation of:
37273 ///
37274 /// - New values appearing in future releases of the client library, **and**
37275 /// - New values received dynamically, without application changes.
37276 ///
37277 /// Please consult the [Working with enums] section in the user guide for some
37278 /// guidelines.
37279 ///
37280 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37281 #[derive(Clone, Debug, PartialEq)]
37282 #[non_exhaustive]
37283 pub enum GPUDirectStrategy {
37284 /// Default value. No GPU Direct strategy is enabled on the node.
37285 Unspecified,
37286 /// GPUDirect-RDMA on A3 Ultra, and A4 machine types
37287 Rdma,
37288 /// If set, the enum was initialized with an unknown value.
37289 ///
37290 /// Applications can examine the value using [GPUDirectStrategy::value] or
37291 /// [GPUDirectStrategy::name].
37292 UnknownValue(gpu_direct_strategy::UnknownValue),
37293 }
37294
37295 #[doc(hidden)]
37296 pub mod gpu_direct_strategy {
37297 #[allow(unused_imports)]
37298 use super::*;
37299 #[derive(Clone, Debug, PartialEq)]
37300 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37301 }
37302
37303 impl GPUDirectStrategy {
37304 /// Gets the enum value.
37305 ///
37306 /// Returns `None` if the enum contains an unknown value deserialized from
37307 /// the string representation of enums.
37308 pub fn value(&self) -> std::option::Option<i32> {
37309 match self {
37310 Self::Unspecified => std::option::Option::Some(0),
37311 Self::Rdma => std::option::Option::Some(2),
37312 Self::UnknownValue(u) => u.0.value(),
37313 }
37314 }
37315
37316 /// Gets the enum value as a string.
37317 ///
37318 /// Returns `None` if the enum contains an unknown value deserialized from
37319 /// the integer representation of enums.
37320 pub fn name(&self) -> std::option::Option<&str> {
37321 match self {
37322 Self::Unspecified => std::option::Option::Some("GPU_DIRECT_STRATEGY_UNSPECIFIED"),
37323 Self::Rdma => std::option::Option::Some("RDMA"),
37324 Self::UnknownValue(u) => u.0.name(),
37325 }
37326 }
37327 }
37328
37329 impl std::default::Default for GPUDirectStrategy {
37330 fn default() -> Self {
37331 use std::convert::From;
37332 Self::from(0)
37333 }
37334 }
37335
37336 impl std::fmt::Display for GPUDirectStrategy {
37337 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37338 wkt::internal::display_enum(f, self.name(), self.value())
37339 }
37340 }
37341
37342 impl std::convert::From<i32> for GPUDirectStrategy {
37343 fn from(value: i32) -> Self {
37344 match value {
37345 0 => Self::Unspecified,
37346 2 => Self::Rdma,
37347 _ => Self::UnknownValue(gpu_direct_strategy::UnknownValue(
37348 wkt::internal::UnknownEnumValue::Integer(value),
37349 )),
37350 }
37351 }
37352 }
37353
37354 impl std::convert::From<&str> for GPUDirectStrategy {
37355 fn from(value: &str) -> Self {
37356 use std::string::ToString;
37357 match value {
37358 "GPU_DIRECT_STRATEGY_UNSPECIFIED" => Self::Unspecified,
37359 "RDMA" => Self::Rdma,
37360 _ => Self::UnknownValue(gpu_direct_strategy::UnknownValue(
37361 wkt::internal::UnknownEnumValue::String(value.to_string()),
37362 )),
37363 }
37364 }
37365 }
37366
37367 impl serde::ser::Serialize for GPUDirectStrategy {
37368 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37369 where
37370 S: serde::Serializer,
37371 {
37372 match self {
37373 Self::Unspecified => serializer.serialize_i32(0),
37374 Self::Rdma => serializer.serialize_i32(2),
37375 Self::UnknownValue(u) => u.0.serialize(serializer),
37376 }
37377 }
37378 }
37379
37380 impl<'de> serde::de::Deserialize<'de> for GPUDirectStrategy {
37381 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37382 where
37383 D: serde::Deserializer<'de>,
37384 {
37385 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GPUDirectStrategy>::new(
37386 ".google.container.v1.GPUDirectConfig.GPUDirectStrategy",
37387 ))
37388 }
37389 }
37390}
37391
37392/// NotificationConfig is the configuration of notifications.
37393#[derive(Clone, Default, PartialEq)]
37394#[non_exhaustive]
37395pub struct NotificationConfig {
37396 /// Notification config for Pub/Sub.
37397 pub pubsub: std::option::Option<crate::model::notification_config::PubSub>,
37398
37399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37400}
37401
37402impl NotificationConfig {
37403 /// Creates a new default instance.
37404 pub fn new() -> Self {
37405 std::default::Default::default()
37406 }
37407
37408 /// Sets the value of [pubsub][crate::model::NotificationConfig::pubsub].
37409 ///
37410 /// # Example
37411 /// ```ignore,no_run
37412 /// # use google_cloud_container_v1::model::NotificationConfig;
37413 /// use google_cloud_container_v1::model::notification_config::PubSub;
37414 /// let x = NotificationConfig::new().set_pubsub(PubSub::default()/* use setters */);
37415 /// ```
37416 pub fn set_pubsub<T>(mut self, v: T) -> Self
37417 where
37418 T: std::convert::Into<crate::model::notification_config::PubSub>,
37419 {
37420 self.pubsub = std::option::Option::Some(v.into());
37421 self
37422 }
37423
37424 /// Sets or clears the value of [pubsub][crate::model::NotificationConfig::pubsub].
37425 ///
37426 /// # Example
37427 /// ```ignore,no_run
37428 /// # use google_cloud_container_v1::model::NotificationConfig;
37429 /// use google_cloud_container_v1::model::notification_config::PubSub;
37430 /// let x = NotificationConfig::new().set_or_clear_pubsub(Some(PubSub::default()/* use setters */));
37431 /// let x = NotificationConfig::new().set_or_clear_pubsub(None::<PubSub>);
37432 /// ```
37433 pub fn set_or_clear_pubsub<T>(mut self, v: std::option::Option<T>) -> Self
37434 where
37435 T: std::convert::Into<crate::model::notification_config::PubSub>,
37436 {
37437 self.pubsub = v.map(|x| x.into());
37438 self
37439 }
37440}
37441
37442impl wkt::message::Message for NotificationConfig {
37443 fn typename() -> &'static str {
37444 "type.googleapis.com/google.container.v1.NotificationConfig"
37445 }
37446}
37447
37448/// Defines additional types related to [NotificationConfig].
37449pub mod notification_config {
37450 #[allow(unused_imports)]
37451 use super::*;
37452
37453 /// Pub/Sub specific notification config.
37454 #[derive(Clone, Default, PartialEq)]
37455 #[non_exhaustive]
37456 pub struct PubSub {
37457 /// Enable notifications for Pub/Sub.
37458 pub enabled: bool,
37459
37460 /// The desired Pub/Sub topic to which notifications will be
37461 /// sent by GKE. Format is `projects/{project}/topics/{topic}`.
37462 pub topic: std::string::String,
37463
37464 /// Allows filtering to one or more specific event types. If no filter is
37465 /// specified, or if a filter is specified with no event types, all event
37466 /// types will be sent
37467 pub filter: std::option::Option<crate::model::notification_config::Filter>,
37468
37469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37470 }
37471
37472 impl PubSub {
37473 /// Creates a new default instance.
37474 pub fn new() -> Self {
37475 std::default::Default::default()
37476 }
37477
37478 /// Sets the value of [enabled][crate::model::notification_config::PubSub::enabled].
37479 ///
37480 /// # Example
37481 /// ```ignore,no_run
37482 /// # use google_cloud_container_v1::model::notification_config::PubSub;
37483 /// let x = PubSub::new().set_enabled(true);
37484 /// ```
37485 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37486 self.enabled = v.into();
37487 self
37488 }
37489
37490 /// Sets the value of [topic][crate::model::notification_config::PubSub::topic].
37491 ///
37492 /// # Example
37493 /// ```ignore,no_run
37494 /// # use google_cloud_container_v1::model::notification_config::PubSub;
37495 /// let x = PubSub::new().set_topic("example");
37496 /// ```
37497 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37498 self.topic = v.into();
37499 self
37500 }
37501
37502 /// Sets the value of [filter][crate::model::notification_config::PubSub::filter].
37503 ///
37504 /// # Example
37505 /// ```ignore,no_run
37506 /// # use google_cloud_container_v1::model::notification_config::PubSub;
37507 /// use google_cloud_container_v1::model::notification_config::Filter;
37508 /// let x = PubSub::new().set_filter(Filter::default()/* use setters */);
37509 /// ```
37510 pub fn set_filter<T>(mut self, v: T) -> Self
37511 where
37512 T: std::convert::Into<crate::model::notification_config::Filter>,
37513 {
37514 self.filter = std::option::Option::Some(v.into());
37515 self
37516 }
37517
37518 /// Sets or clears the value of [filter][crate::model::notification_config::PubSub::filter].
37519 ///
37520 /// # Example
37521 /// ```ignore,no_run
37522 /// # use google_cloud_container_v1::model::notification_config::PubSub;
37523 /// use google_cloud_container_v1::model::notification_config::Filter;
37524 /// let x = PubSub::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
37525 /// let x = PubSub::new().set_or_clear_filter(None::<Filter>);
37526 /// ```
37527 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
37528 where
37529 T: std::convert::Into<crate::model::notification_config::Filter>,
37530 {
37531 self.filter = v.map(|x| x.into());
37532 self
37533 }
37534 }
37535
37536 impl wkt::message::Message for PubSub {
37537 fn typename() -> &'static str {
37538 "type.googleapis.com/google.container.v1.NotificationConfig.PubSub"
37539 }
37540 }
37541
37542 /// Allows filtering to one or more specific event types. If event types are
37543 /// present, those and only those event types will be transmitted to the
37544 /// cluster. Other types will be skipped. If no filter is specified, or no
37545 /// event types are present, all event types will be sent
37546 #[derive(Clone, Default, PartialEq)]
37547 #[non_exhaustive]
37548 pub struct Filter {
37549 /// Event types to allowlist.
37550 pub event_type: std::vec::Vec<crate::model::notification_config::EventType>,
37551
37552 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37553 }
37554
37555 impl Filter {
37556 /// Creates a new default instance.
37557 pub fn new() -> Self {
37558 std::default::Default::default()
37559 }
37560
37561 /// Sets the value of [event_type][crate::model::notification_config::Filter::event_type].
37562 ///
37563 /// # Example
37564 /// ```ignore,no_run
37565 /// # use google_cloud_container_v1::model::notification_config::Filter;
37566 /// use google_cloud_container_v1::model::notification_config::EventType;
37567 /// let x = Filter::new().set_event_type([
37568 /// EventType::UpgradeAvailableEvent,
37569 /// EventType::UpgradeEvent,
37570 /// EventType::SecurityBulletinEvent,
37571 /// ]);
37572 /// ```
37573 pub fn set_event_type<T, V>(mut self, v: T) -> Self
37574 where
37575 T: std::iter::IntoIterator<Item = V>,
37576 V: std::convert::Into<crate::model::notification_config::EventType>,
37577 {
37578 use std::iter::Iterator;
37579 self.event_type = v.into_iter().map(|i| i.into()).collect();
37580 self
37581 }
37582 }
37583
37584 impl wkt::message::Message for Filter {
37585 fn typename() -> &'static str {
37586 "type.googleapis.com/google.container.v1.NotificationConfig.Filter"
37587 }
37588 }
37589
37590 /// Types of notifications currently supported. Can be used to filter what
37591 /// notifications are sent.
37592 ///
37593 /// # Working with unknown values
37594 ///
37595 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37596 /// additional enum variants at any time. Adding new variants is not considered
37597 /// a breaking change. Applications should write their code in anticipation of:
37598 ///
37599 /// - New values appearing in future releases of the client library, **and**
37600 /// - New values received dynamically, without application changes.
37601 ///
37602 /// Please consult the [Working with enums] section in the user guide for some
37603 /// guidelines.
37604 ///
37605 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37606 #[derive(Clone, Debug, PartialEq)]
37607 #[non_exhaustive]
37608 pub enum EventType {
37609 /// Not set, will be ignored.
37610 Unspecified,
37611 /// Corresponds with UpgradeAvailableEvent.
37612 UpgradeAvailableEvent,
37613 /// Corresponds with UpgradeEvent.
37614 UpgradeEvent,
37615 /// Corresponds with SecurityBulletinEvent.
37616 SecurityBulletinEvent,
37617 /// Corresponds with UpgradeInfoEvent.
37618 UpgradeInfoEvent,
37619 /// If set, the enum was initialized with an unknown value.
37620 ///
37621 /// Applications can examine the value using [EventType::value] or
37622 /// [EventType::name].
37623 UnknownValue(event_type::UnknownValue),
37624 }
37625
37626 #[doc(hidden)]
37627 pub mod event_type {
37628 #[allow(unused_imports)]
37629 use super::*;
37630 #[derive(Clone, Debug, PartialEq)]
37631 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37632 }
37633
37634 impl EventType {
37635 /// Gets the enum value.
37636 ///
37637 /// Returns `None` if the enum contains an unknown value deserialized from
37638 /// the string representation of enums.
37639 pub fn value(&self) -> std::option::Option<i32> {
37640 match self {
37641 Self::Unspecified => std::option::Option::Some(0),
37642 Self::UpgradeAvailableEvent => std::option::Option::Some(1),
37643 Self::UpgradeEvent => std::option::Option::Some(2),
37644 Self::SecurityBulletinEvent => std::option::Option::Some(3),
37645 Self::UpgradeInfoEvent => std::option::Option::Some(4),
37646 Self::UnknownValue(u) => u.0.value(),
37647 }
37648 }
37649
37650 /// Gets the enum value as a string.
37651 ///
37652 /// Returns `None` if the enum contains an unknown value deserialized from
37653 /// the integer representation of enums.
37654 pub fn name(&self) -> std::option::Option<&str> {
37655 match self {
37656 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
37657 Self::UpgradeAvailableEvent => std::option::Option::Some("UPGRADE_AVAILABLE_EVENT"),
37658 Self::UpgradeEvent => std::option::Option::Some("UPGRADE_EVENT"),
37659 Self::SecurityBulletinEvent => std::option::Option::Some("SECURITY_BULLETIN_EVENT"),
37660 Self::UpgradeInfoEvent => std::option::Option::Some("UPGRADE_INFO_EVENT"),
37661 Self::UnknownValue(u) => u.0.name(),
37662 }
37663 }
37664 }
37665
37666 impl std::default::Default for EventType {
37667 fn default() -> Self {
37668 use std::convert::From;
37669 Self::from(0)
37670 }
37671 }
37672
37673 impl std::fmt::Display for EventType {
37674 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37675 wkt::internal::display_enum(f, self.name(), self.value())
37676 }
37677 }
37678
37679 impl std::convert::From<i32> for EventType {
37680 fn from(value: i32) -> Self {
37681 match value {
37682 0 => Self::Unspecified,
37683 1 => Self::UpgradeAvailableEvent,
37684 2 => Self::UpgradeEvent,
37685 3 => Self::SecurityBulletinEvent,
37686 4 => Self::UpgradeInfoEvent,
37687 _ => Self::UnknownValue(event_type::UnknownValue(
37688 wkt::internal::UnknownEnumValue::Integer(value),
37689 )),
37690 }
37691 }
37692 }
37693
37694 impl std::convert::From<&str> for EventType {
37695 fn from(value: &str) -> Self {
37696 use std::string::ToString;
37697 match value {
37698 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
37699 "UPGRADE_AVAILABLE_EVENT" => Self::UpgradeAvailableEvent,
37700 "UPGRADE_EVENT" => Self::UpgradeEvent,
37701 "SECURITY_BULLETIN_EVENT" => Self::SecurityBulletinEvent,
37702 "UPGRADE_INFO_EVENT" => Self::UpgradeInfoEvent,
37703 _ => Self::UnknownValue(event_type::UnknownValue(
37704 wkt::internal::UnknownEnumValue::String(value.to_string()),
37705 )),
37706 }
37707 }
37708 }
37709
37710 impl serde::ser::Serialize for EventType {
37711 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37712 where
37713 S: serde::Serializer,
37714 {
37715 match self {
37716 Self::Unspecified => serializer.serialize_i32(0),
37717 Self::UpgradeAvailableEvent => serializer.serialize_i32(1),
37718 Self::UpgradeEvent => serializer.serialize_i32(2),
37719 Self::SecurityBulletinEvent => serializer.serialize_i32(3),
37720 Self::UpgradeInfoEvent => serializer.serialize_i32(4),
37721 Self::UnknownValue(u) => u.0.serialize(serializer),
37722 }
37723 }
37724 }
37725
37726 impl<'de> serde::de::Deserialize<'de> for EventType {
37727 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37728 where
37729 D: serde::Deserializer<'de>,
37730 {
37731 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
37732 ".google.container.v1.NotificationConfig.EventType",
37733 ))
37734 }
37735 }
37736}
37737
37738/// ConfidentialNodes is configuration for the confidential nodes feature, which
37739/// makes nodes run on confidential VMs.
37740#[derive(Clone, Default, PartialEq)]
37741#[non_exhaustive]
37742pub struct ConfidentialNodes {
37743 /// Whether Confidential Nodes feature is enabled.
37744 pub enabled: bool,
37745
37746 /// Defines the type of technology used by the confidential node.
37747 pub confidential_instance_type: crate::model::confidential_nodes::ConfidentialInstanceType,
37748
37749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37750}
37751
37752impl ConfidentialNodes {
37753 /// Creates a new default instance.
37754 pub fn new() -> Self {
37755 std::default::Default::default()
37756 }
37757
37758 /// Sets the value of [enabled][crate::model::ConfidentialNodes::enabled].
37759 ///
37760 /// # Example
37761 /// ```ignore,no_run
37762 /// # use google_cloud_container_v1::model::ConfidentialNodes;
37763 /// let x = ConfidentialNodes::new().set_enabled(true);
37764 /// ```
37765 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
37766 self.enabled = v.into();
37767 self
37768 }
37769
37770 /// Sets the value of [confidential_instance_type][crate::model::ConfidentialNodes::confidential_instance_type].
37771 ///
37772 /// # Example
37773 /// ```ignore,no_run
37774 /// # use google_cloud_container_v1::model::ConfidentialNodes;
37775 /// use google_cloud_container_v1::model::confidential_nodes::ConfidentialInstanceType;
37776 /// let x0 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::Sev);
37777 /// let x1 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::SevSnp);
37778 /// let x2 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::Tdx);
37779 /// ```
37780 pub fn set_confidential_instance_type<
37781 T: std::convert::Into<crate::model::confidential_nodes::ConfidentialInstanceType>,
37782 >(
37783 mut self,
37784 v: T,
37785 ) -> Self {
37786 self.confidential_instance_type = v.into();
37787 self
37788 }
37789}
37790
37791impl wkt::message::Message for ConfidentialNodes {
37792 fn typename() -> &'static str {
37793 "type.googleapis.com/google.container.v1.ConfidentialNodes"
37794 }
37795}
37796
37797/// Defines additional types related to [ConfidentialNodes].
37798pub mod confidential_nodes {
37799 #[allow(unused_imports)]
37800 use super::*;
37801
37802 /// The type of technology used by the confidential node.
37803 ///
37804 /// # Working with unknown values
37805 ///
37806 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37807 /// additional enum variants at any time. Adding new variants is not considered
37808 /// a breaking change. Applications should write their code in anticipation of:
37809 ///
37810 /// - New values appearing in future releases of the client library, **and**
37811 /// - New values received dynamically, without application changes.
37812 ///
37813 /// Please consult the [Working with enums] section in the user guide for some
37814 /// guidelines.
37815 ///
37816 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37817 #[derive(Clone, Debug, PartialEq)]
37818 #[non_exhaustive]
37819 pub enum ConfidentialInstanceType {
37820 /// No type specified. Do not use this value.
37821 Unspecified,
37822 /// AMD Secure Encrypted Virtualization.
37823 Sev,
37824 /// AMD Secure Encrypted Virtualization - Secure Nested Paging.
37825 SevSnp,
37826 /// Intel Trust Domain eXtension.
37827 Tdx,
37828 /// If set, the enum was initialized with an unknown value.
37829 ///
37830 /// Applications can examine the value using [ConfidentialInstanceType::value] or
37831 /// [ConfidentialInstanceType::name].
37832 UnknownValue(confidential_instance_type::UnknownValue),
37833 }
37834
37835 #[doc(hidden)]
37836 pub mod confidential_instance_type {
37837 #[allow(unused_imports)]
37838 use super::*;
37839 #[derive(Clone, Debug, PartialEq)]
37840 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37841 }
37842
37843 impl ConfidentialInstanceType {
37844 /// Gets the enum value.
37845 ///
37846 /// Returns `None` if the enum contains an unknown value deserialized from
37847 /// the string representation of enums.
37848 pub fn value(&self) -> std::option::Option<i32> {
37849 match self {
37850 Self::Unspecified => std::option::Option::Some(0),
37851 Self::Sev => std::option::Option::Some(1),
37852 Self::SevSnp => std::option::Option::Some(2),
37853 Self::Tdx => std::option::Option::Some(3),
37854 Self::UnknownValue(u) => u.0.value(),
37855 }
37856 }
37857
37858 /// Gets the enum value as a string.
37859 ///
37860 /// Returns `None` if the enum contains an unknown value deserialized from
37861 /// the integer representation of enums.
37862 pub fn name(&self) -> std::option::Option<&str> {
37863 match self {
37864 Self::Unspecified => {
37865 std::option::Option::Some("CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED")
37866 }
37867 Self::Sev => std::option::Option::Some("SEV"),
37868 Self::SevSnp => std::option::Option::Some("SEV_SNP"),
37869 Self::Tdx => std::option::Option::Some("TDX"),
37870 Self::UnknownValue(u) => u.0.name(),
37871 }
37872 }
37873 }
37874
37875 impl std::default::Default for ConfidentialInstanceType {
37876 fn default() -> Self {
37877 use std::convert::From;
37878 Self::from(0)
37879 }
37880 }
37881
37882 impl std::fmt::Display for ConfidentialInstanceType {
37883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37884 wkt::internal::display_enum(f, self.name(), self.value())
37885 }
37886 }
37887
37888 impl std::convert::From<i32> for ConfidentialInstanceType {
37889 fn from(value: i32) -> Self {
37890 match value {
37891 0 => Self::Unspecified,
37892 1 => Self::Sev,
37893 2 => Self::SevSnp,
37894 3 => Self::Tdx,
37895 _ => Self::UnknownValue(confidential_instance_type::UnknownValue(
37896 wkt::internal::UnknownEnumValue::Integer(value),
37897 )),
37898 }
37899 }
37900 }
37901
37902 impl std::convert::From<&str> for ConfidentialInstanceType {
37903 fn from(value: &str) -> Self {
37904 use std::string::ToString;
37905 match value {
37906 "CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
37907 "SEV" => Self::Sev,
37908 "SEV_SNP" => Self::SevSnp,
37909 "TDX" => Self::Tdx,
37910 _ => Self::UnknownValue(confidential_instance_type::UnknownValue(
37911 wkt::internal::UnknownEnumValue::String(value.to_string()),
37912 )),
37913 }
37914 }
37915 }
37916
37917 impl serde::ser::Serialize for ConfidentialInstanceType {
37918 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37919 where
37920 S: serde::Serializer,
37921 {
37922 match self {
37923 Self::Unspecified => serializer.serialize_i32(0),
37924 Self::Sev => serializer.serialize_i32(1),
37925 Self::SevSnp => serializer.serialize_i32(2),
37926 Self::Tdx => serializer.serialize_i32(3),
37927 Self::UnknownValue(u) => u.0.serialize(serializer),
37928 }
37929 }
37930 }
37931
37932 impl<'de> serde::de::Deserialize<'de> for ConfidentialInstanceType {
37933 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37934 where
37935 D: serde::Deserializer<'de>,
37936 {
37937 deserializer.deserialize_any(
37938 wkt::internal::EnumVisitor::<ConfidentialInstanceType>::new(
37939 ".google.container.v1.ConfidentialNodes.ConfidentialInstanceType",
37940 ),
37941 )
37942 }
37943 }
37944}
37945
37946/// UpgradeEvent is a notification sent to customers by the cluster server when
37947/// a resource is upgrading.
37948#[derive(Clone, Default, PartialEq)]
37949#[non_exhaustive]
37950pub struct UpgradeEvent {
37951 /// The resource type that is upgrading.
37952 pub resource_type: crate::model::UpgradeResourceType,
37953
37954 /// The operation associated with this upgrade.
37955 pub operation: std::string::String,
37956
37957 /// The time when the operation was started.
37958 pub operation_start_time: std::option::Option<wkt::Timestamp>,
37959
37960 /// The current version before the upgrade.
37961 pub current_version: std::string::String,
37962
37963 /// The target version for the upgrade.
37964 pub target_version: std::string::String,
37965
37966 /// Optional relative path to the resource. For example in node pool upgrades,
37967 /// the relative path of the node pool.
37968 pub resource: std::string::String,
37969
37970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37971}
37972
37973impl UpgradeEvent {
37974 /// Creates a new default instance.
37975 pub fn new() -> Self {
37976 std::default::Default::default()
37977 }
37978
37979 /// Sets the value of [resource_type][crate::model::UpgradeEvent::resource_type].
37980 ///
37981 /// # Example
37982 /// ```ignore,no_run
37983 /// # use google_cloud_container_v1::model::UpgradeEvent;
37984 /// use google_cloud_container_v1::model::UpgradeResourceType;
37985 /// let x0 = UpgradeEvent::new().set_resource_type(UpgradeResourceType::Master);
37986 /// let x1 = UpgradeEvent::new().set_resource_type(UpgradeResourceType::NodePool);
37987 /// ```
37988 pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
37989 mut self,
37990 v: T,
37991 ) -> Self {
37992 self.resource_type = v.into();
37993 self
37994 }
37995
37996 /// Sets the value of [operation][crate::model::UpgradeEvent::operation].
37997 ///
37998 /// # Example
37999 /// ```ignore,no_run
38000 /// # use google_cloud_container_v1::model::UpgradeEvent;
38001 /// let x = UpgradeEvent::new().set_operation("example");
38002 /// ```
38003 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38004 self.operation = v.into();
38005 self
38006 }
38007
38008 /// Sets the value of [operation_start_time][crate::model::UpgradeEvent::operation_start_time].
38009 ///
38010 /// # Example
38011 /// ```ignore,no_run
38012 /// # use google_cloud_container_v1::model::UpgradeEvent;
38013 /// use wkt::Timestamp;
38014 /// let x = UpgradeEvent::new().set_operation_start_time(Timestamp::default()/* use setters */);
38015 /// ```
38016 pub fn set_operation_start_time<T>(mut self, v: T) -> Self
38017 where
38018 T: std::convert::Into<wkt::Timestamp>,
38019 {
38020 self.operation_start_time = std::option::Option::Some(v.into());
38021 self
38022 }
38023
38024 /// Sets or clears the value of [operation_start_time][crate::model::UpgradeEvent::operation_start_time].
38025 ///
38026 /// # Example
38027 /// ```ignore,no_run
38028 /// # use google_cloud_container_v1::model::UpgradeEvent;
38029 /// use wkt::Timestamp;
38030 /// let x = UpgradeEvent::new().set_or_clear_operation_start_time(Some(Timestamp::default()/* use setters */));
38031 /// let x = UpgradeEvent::new().set_or_clear_operation_start_time(None::<Timestamp>);
38032 /// ```
38033 pub fn set_or_clear_operation_start_time<T>(mut self, v: std::option::Option<T>) -> Self
38034 where
38035 T: std::convert::Into<wkt::Timestamp>,
38036 {
38037 self.operation_start_time = v.map(|x| x.into());
38038 self
38039 }
38040
38041 /// Sets the value of [current_version][crate::model::UpgradeEvent::current_version].
38042 ///
38043 /// # Example
38044 /// ```ignore,no_run
38045 /// # use google_cloud_container_v1::model::UpgradeEvent;
38046 /// let x = UpgradeEvent::new().set_current_version("example");
38047 /// ```
38048 pub fn set_current_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38049 self.current_version = v.into();
38050 self
38051 }
38052
38053 /// Sets the value of [target_version][crate::model::UpgradeEvent::target_version].
38054 ///
38055 /// # Example
38056 /// ```ignore,no_run
38057 /// # use google_cloud_container_v1::model::UpgradeEvent;
38058 /// let x = UpgradeEvent::new().set_target_version("example");
38059 /// ```
38060 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38061 self.target_version = v.into();
38062 self
38063 }
38064
38065 /// Sets the value of [resource][crate::model::UpgradeEvent::resource].
38066 ///
38067 /// # Example
38068 /// ```ignore,no_run
38069 /// # use google_cloud_container_v1::model::UpgradeEvent;
38070 /// let x = UpgradeEvent::new().set_resource("example");
38071 /// ```
38072 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38073 self.resource = v.into();
38074 self
38075 }
38076}
38077
38078impl wkt::message::Message for UpgradeEvent {
38079 fn typename() -> &'static str {
38080 "type.googleapis.com/google.container.v1.UpgradeEvent"
38081 }
38082}
38083
38084/// UpgradeInfoEvent is a notification sent to customers about the upgrade
38085/// information of a resource.
38086#[derive(Clone, Default, PartialEq)]
38087#[non_exhaustive]
38088pub struct UpgradeInfoEvent {
38089 /// The resource type associated with the upgrade.
38090 pub resource_type: crate::model::UpgradeResourceType,
38091
38092 /// The operation associated with this upgrade.
38093 pub operation: std::string::String,
38094
38095 /// The time when the operation was started.
38096 pub start_time: std::option::Option<wkt::Timestamp>,
38097
38098 /// The time when the operation ended.
38099 pub end_time: std::option::Option<wkt::Timestamp>,
38100
38101 /// The current version before the upgrade.
38102 pub current_version: std::string::String,
38103
38104 /// The target version for the upgrade.
38105 pub target_version: std::string::String,
38106
38107 /// Optional relative path to the resource. For example in node pool upgrades,
38108 /// the relative path of the node pool.
38109 pub resource: std::string::String,
38110
38111 /// Output only. The state of the upgrade.
38112 pub state: crate::model::upgrade_info_event::State,
38113
38114 /// The end of standard support timestamp.
38115 pub standard_support_end_time: std::option::Option<wkt::Timestamp>,
38116
38117 /// The end of extended support timestamp.
38118 pub extended_support_end_time: std::option::Option<wkt::Timestamp>,
38119
38120 /// A brief description of the event.
38121 pub description: std::string::String,
38122
38123 /// The type of the event.
38124 pub event_type: crate::model::upgrade_info_event::EventType,
38125
38126 /// The information about the disruption event. This field is only populated
38127 /// when event_type is DISRUPTION_EVENT.
38128 pub disruption_event: std::option::Option<crate::model::DisruptionEvent>,
38129
38130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38131}
38132
38133impl UpgradeInfoEvent {
38134 /// Creates a new default instance.
38135 pub fn new() -> Self {
38136 std::default::Default::default()
38137 }
38138
38139 /// Sets the value of [resource_type][crate::model::UpgradeInfoEvent::resource_type].
38140 ///
38141 /// # Example
38142 /// ```ignore,no_run
38143 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38144 /// use google_cloud_container_v1::model::UpgradeResourceType;
38145 /// let x0 = UpgradeInfoEvent::new().set_resource_type(UpgradeResourceType::Master);
38146 /// let x1 = UpgradeInfoEvent::new().set_resource_type(UpgradeResourceType::NodePool);
38147 /// ```
38148 pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
38149 mut self,
38150 v: T,
38151 ) -> Self {
38152 self.resource_type = v.into();
38153 self
38154 }
38155
38156 /// Sets the value of [operation][crate::model::UpgradeInfoEvent::operation].
38157 ///
38158 /// # Example
38159 /// ```ignore,no_run
38160 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38161 /// let x = UpgradeInfoEvent::new().set_operation("example");
38162 /// ```
38163 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38164 self.operation = v.into();
38165 self
38166 }
38167
38168 /// Sets the value of [start_time][crate::model::UpgradeInfoEvent::start_time].
38169 ///
38170 /// # Example
38171 /// ```ignore,no_run
38172 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38173 /// use wkt::Timestamp;
38174 /// let x = UpgradeInfoEvent::new().set_start_time(Timestamp::default()/* use setters */);
38175 /// ```
38176 pub fn set_start_time<T>(mut self, v: T) -> Self
38177 where
38178 T: std::convert::Into<wkt::Timestamp>,
38179 {
38180 self.start_time = std::option::Option::Some(v.into());
38181 self
38182 }
38183
38184 /// Sets or clears the value of [start_time][crate::model::UpgradeInfoEvent::start_time].
38185 ///
38186 /// # Example
38187 /// ```ignore,no_run
38188 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38189 /// use wkt::Timestamp;
38190 /// let x = UpgradeInfoEvent::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
38191 /// let x = UpgradeInfoEvent::new().set_or_clear_start_time(None::<Timestamp>);
38192 /// ```
38193 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
38194 where
38195 T: std::convert::Into<wkt::Timestamp>,
38196 {
38197 self.start_time = v.map(|x| x.into());
38198 self
38199 }
38200
38201 /// Sets the value of [end_time][crate::model::UpgradeInfoEvent::end_time].
38202 ///
38203 /// # Example
38204 /// ```ignore,no_run
38205 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38206 /// use wkt::Timestamp;
38207 /// let x = UpgradeInfoEvent::new().set_end_time(Timestamp::default()/* use setters */);
38208 /// ```
38209 pub fn set_end_time<T>(mut self, v: T) -> Self
38210 where
38211 T: std::convert::Into<wkt::Timestamp>,
38212 {
38213 self.end_time = std::option::Option::Some(v.into());
38214 self
38215 }
38216
38217 /// Sets or clears the value of [end_time][crate::model::UpgradeInfoEvent::end_time].
38218 ///
38219 /// # Example
38220 /// ```ignore,no_run
38221 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38222 /// use wkt::Timestamp;
38223 /// let x = UpgradeInfoEvent::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
38224 /// let x = UpgradeInfoEvent::new().set_or_clear_end_time(None::<Timestamp>);
38225 /// ```
38226 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
38227 where
38228 T: std::convert::Into<wkt::Timestamp>,
38229 {
38230 self.end_time = v.map(|x| x.into());
38231 self
38232 }
38233
38234 /// Sets the value of [current_version][crate::model::UpgradeInfoEvent::current_version].
38235 ///
38236 /// # Example
38237 /// ```ignore,no_run
38238 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38239 /// let x = UpgradeInfoEvent::new().set_current_version("example");
38240 /// ```
38241 pub fn set_current_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38242 self.current_version = v.into();
38243 self
38244 }
38245
38246 /// Sets the value of [target_version][crate::model::UpgradeInfoEvent::target_version].
38247 ///
38248 /// # Example
38249 /// ```ignore,no_run
38250 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38251 /// let x = UpgradeInfoEvent::new().set_target_version("example");
38252 /// ```
38253 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38254 self.target_version = v.into();
38255 self
38256 }
38257
38258 /// Sets the value of [resource][crate::model::UpgradeInfoEvent::resource].
38259 ///
38260 /// # Example
38261 /// ```ignore,no_run
38262 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38263 /// let x = UpgradeInfoEvent::new().set_resource("example");
38264 /// ```
38265 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38266 self.resource = v.into();
38267 self
38268 }
38269
38270 /// Sets the value of [state][crate::model::UpgradeInfoEvent::state].
38271 ///
38272 /// # Example
38273 /// ```ignore,no_run
38274 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38275 /// use google_cloud_container_v1::model::upgrade_info_event::State;
38276 /// let x0 = UpgradeInfoEvent::new().set_state(State::Scheduled);
38277 /// let x1 = UpgradeInfoEvent::new().set_state(State::Started);
38278 /// let x2 = UpgradeInfoEvent::new().set_state(State::Succeeded);
38279 /// ```
38280 pub fn set_state<T: std::convert::Into<crate::model::upgrade_info_event::State>>(
38281 mut self,
38282 v: T,
38283 ) -> Self {
38284 self.state = v.into();
38285 self
38286 }
38287
38288 /// Sets the value of [standard_support_end_time][crate::model::UpgradeInfoEvent::standard_support_end_time].
38289 ///
38290 /// # Example
38291 /// ```ignore,no_run
38292 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38293 /// use wkt::Timestamp;
38294 /// let x = UpgradeInfoEvent::new().set_standard_support_end_time(Timestamp::default()/* use setters */);
38295 /// ```
38296 pub fn set_standard_support_end_time<T>(mut self, v: T) -> Self
38297 where
38298 T: std::convert::Into<wkt::Timestamp>,
38299 {
38300 self.standard_support_end_time = std::option::Option::Some(v.into());
38301 self
38302 }
38303
38304 /// Sets or clears the value of [standard_support_end_time][crate::model::UpgradeInfoEvent::standard_support_end_time].
38305 ///
38306 /// # Example
38307 /// ```ignore,no_run
38308 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38309 /// use wkt::Timestamp;
38310 /// let x = UpgradeInfoEvent::new().set_or_clear_standard_support_end_time(Some(Timestamp::default()/* use setters */));
38311 /// let x = UpgradeInfoEvent::new().set_or_clear_standard_support_end_time(None::<Timestamp>);
38312 /// ```
38313 pub fn set_or_clear_standard_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
38314 where
38315 T: std::convert::Into<wkt::Timestamp>,
38316 {
38317 self.standard_support_end_time = v.map(|x| x.into());
38318 self
38319 }
38320
38321 /// Sets the value of [extended_support_end_time][crate::model::UpgradeInfoEvent::extended_support_end_time].
38322 ///
38323 /// # Example
38324 /// ```ignore,no_run
38325 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38326 /// use wkt::Timestamp;
38327 /// let x = UpgradeInfoEvent::new().set_extended_support_end_time(Timestamp::default()/* use setters */);
38328 /// ```
38329 pub fn set_extended_support_end_time<T>(mut self, v: T) -> Self
38330 where
38331 T: std::convert::Into<wkt::Timestamp>,
38332 {
38333 self.extended_support_end_time = std::option::Option::Some(v.into());
38334 self
38335 }
38336
38337 /// Sets or clears the value of [extended_support_end_time][crate::model::UpgradeInfoEvent::extended_support_end_time].
38338 ///
38339 /// # Example
38340 /// ```ignore,no_run
38341 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38342 /// use wkt::Timestamp;
38343 /// let x = UpgradeInfoEvent::new().set_or_clear_extended_support_end_time(Some(Timestamp::default()/* use setters */));
38344 /// let x = UpgradeInfoEvent::new().set_or_clear_extended_support_end_time(None::<Timestamp>);
38345 /// ```
38346 pub fn set_or_clear_extended_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
38347 where
38348 T: std::convert::Into<wkt::Timestamp>,
38349 {
38350 self.extended_support_end_time = v.map(|x| x.into());
38351 self
38352 }
38353
38354 /// Sets the value of [description][crate::model::UpgradeInfoEvent::description].
38355 ///
38356 /// # Example
38357 /// ```ignore,no_run
38358 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38359 /// let x = UpgradeInfoEvent::new().set_description("example");
38360 /// ```
38361 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38362 self.description = v.into();
38363 self
38364 }
38365
38366 /// Sets the value of [event_type][crate::model::UpgradeInfoEvent::event_type].
38367 ///
38368 /// # Example
38369 /// ```ignore,no_run
38370 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38371 /// use google_cloud_container_v1::model::upgrade_info_event::EventType;
38372 /// let x0 = UpgradeInfoEvent::new().set_event_type(EventType::EndOfSupport);
38373 /// let x1 = UpgradeInfoEvent::new().set_event_type(EventType::CosMilestoneVersionUpdate);
38374 /// let x2 = UpgradeInfoEvent::new().set_event_type(EventType::UpgradeLifecycle);
38375 /// ```
38376 pub fn set_event_type<T: std::convert::Into<crate::model::upgrade_info_event::EventType>>(
38377 mut self,
38378 v: T,
38379 ) -> Self {
38380 self.event_type = v.into();
38381 self
38382 }
38383
38384 /// Sets the value of [disruption_event][crate::model::UpgradeInfoEvent::disruption_event].
38385 ///
38386 /// # Example
38387 /// ```ignore,no_run
38388 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38389 /// use google_cloud_container_v1::model::DisruptionEvent;
38390 /// let x = UpgradeInfoEvent::new().set_disruption_event(DisruptionEvent::default()/* use setters */);
38391 /// ```
38392 pub fn set_disruption_event<T>(mut self, v: T) -> Self
38393 where
38394 T: std::convert::Into<crate::model::DisruptionEvent>,
38395 {
38396 self.disruption_event = std::option::Option::Some(v.into());
38397 self
38398 }
38399
38400 /// Sets or clears the value of [disruption_event][crate::model::UpgradeInfoEvent::disruption_event].
38401 ///
38402 /// # Example
38403 /// ```ignore,no_run
38404 /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
38405 /// use google_cloud_container_v1::model::DisruptionEvent;
38406 /// let x = UpgradeInfoEvent::new().set_or_clear_disruption_event(Some(DisruptionEvent::default()/* use setters */));
38407 /// let x = UpgradeInfoEvent::new().set_or_clear_disruption_event(None::<DisruptionEvent>);
38408 /// ```
38409 pub fn set_or_clear_disruption_event<T>(mut self, v: std::option::Option<T>) -> Self
38410 where
38411 T: std::convert::Into<crate::model::DisruptionEvent>,
38412 {
38413 self.disruption_event = v.map(|x| x.into());
38414 self
38415 }
38416}
38417
38418impl wkt::message::Message for UpgradeInfoEvent {
38419 fn typename() -> &'static str {
38420 "type.googleapis.com/google.container.v1.UpgradeInfoEvent"
38421 }
38422}
38423
38424/// Defines additional types related to [UpgradeInfoEvent].
38425pub mod upgrade_info_event {
38426 #[allow(unused_imports)]
38427 use super::*;
38428
38429 /// The state of the upgrade.
38430 ///
38431 /// # Working with unknown values
38432 ///
38433 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38434 /// additional enum variants at any time. Adding new variants is not considered
38435 /// a breaking change. Applications should write their code in anticipation of:
38436 ///
38437 /// - New values appearing in future releases of the client library, **and**
38438 /// - New values received dynamically, without application changes.
38439 ///
38440 /// Please consult the [Working with enums] section in the user guide for some
38441 /// guidelines.
38442 ///
38443 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
38444 #[derive(Clone, Debug, PartialEq)]
38445 #[non_exhaustive]
38446 pub enum State {
38447 /// STATE_UNSPECIFIED indicates the state is unspecified.
38448 Unspecified,
38449 /// SCHEDULED indicates the upgrade was scheduled.
38450 Scheduled,
38451 /// STARTED indicates the upgrade has started.
38452 Started,
38453 /// SUCCEEDED indicates the upgrade has completed successfully.
38454 Succeeded,
38455 /// FAILED indicates the upgrade has failed.
38456 Failed,
38457 /// CANCELED indicates the upgrade has canceled.
38458 Canceled,
38459 /// If set, the enum was initialized with an unknown value.
38460 ///
38461 /// Applications can examine the value using [State::value] or
38462 /// [State::name].
38463 UnknownValue(state::UnknownValue),
38464 }
38465
38466 #[doc(hidden)]
38467 pub mod state {
38468 #[allow(unused_imports)]
38469 use super::*;
38470 #[derive(Clone, Debug, PartialEq)]
38471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38472 }
38473
38474 impl State {
38475 /// Gets the enum value.
38476 ///
38477 /// Returns `None` if the enum contains an unknown value deserialized from
38478 /// the string representation of enums.
38479 pub fn value(&self) -> std::option::Option<i32> {
38480 match self {
38481 Self::Unspecified => std::option::Option::Some(0),
38482 Self::Scheduled => std::option::Option::Some(1),
38483 Self::Started => std::option::Option::Some(3),
38484 Self::Succeeded => std::option::Option::Some(4),
38485 Self::Failed => std::option::Option::Some(5),
38486 Self::Canceled => std::option::Option::Some(6),
38487 Self::UnknownValue(u) => u.0.value(),
38488 }
38489 }
38490
38491 /// Gets the enum value as a string.
38492 ///
38493 /// Returns `None` if the enum contains an unknown value deserialized from
38494 /// the integer representation of enums.
38495 pub fn name(&self) -> std::option::Option<&str> {
38496 match self {
38497 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
38498 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
38499 Self::Started => std::option::Option::Some("STARTED"),
38500 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
38501 Self::Failed => std::option::Option::Some("FAILED"),
38502 Self::Canceled => std::option::Option::Some("CANCELED"),
38503 Self::UnknownValue(u) => u.0.name(),
38504 }
38505 }
38506 }
38507
38508 impl std::default::Default for State {
38509 fn default() -> Self {
38510 use std::convert::From;
38511 Self::from(0)
38512 }
38513 }
38514
38515 impl std::fmt::Display for State {
38516 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38517 wkt::internal::display_enum(f, self.name(), self.value())
38518 }
38519 }
38520
38521 impl std::convert::From<i32> for State {
38522 fn from(value: i32) -> Self {
38523 match value {
38524 0 => Self::Unspecified,
38525 1 => Self::Scheduled,
38526 3 => Self::Started,
38527 4 => Self::Succeeded,
38528 5 => Self::Failed,
38529 6 => Self::Canceled,
38530 _ => Self::UnknownValue(state::UnknownValue(
38531 wkt::internal::UnknownEnumValue::Integer(value),
38532 )),
38533 }
38534 }
38535 }
38536
38537 impl std::convert::From<&str> for State {
38538 fn from(value: &str) -> Self {
38539 use std::string::ToString;
38540 match value {
38541 "STATE_UNSPECIFIED" => Self::Unspecified,
38542 "SCHEDULED" => Self::Scheduled,
38543 "STARTED" => Self::Started,
38544 "SUCCEEDED" => Self::Succeeded,
38545 "FAILED" => Self::Failed,
38546 "CANCELED" => Self::Canceled,
38547 _ => Self::UnknownValue(state::UnknownValue(
38548 wkt::internal::UnknownEnumValue::String(value.to_string()),
38549 )),
38550 }
38551 }
38552 }
38553
38554 impl serde::ser::Serialize for State {
38555 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38556 where
38557 S: serde::Serializer,
38558 {
38559 match self {
38560 Self::Unspecified => serializer.serialize_i32(0),
38561 Self::Scheduled => serializer.serialize_i32(1),
38562 Self::Started => serializer.serialize_i32(3),
38563 Self::Succeeded => serializer.serialize_i32(4),
38564 Self::Failed => serializer.serialize_i32(5),
38565 Self::Canceled => serializer.serialize_i32(6),
38566 Self::UnknownValue(u) => u.0.serialize(serializer),
38567 }
38568 }
38569 }
38570
38571 impl<'de> serde::de::Deserialize<'de> for State {
38572 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38573 where
38574 D: serde::Deserializer<'de>,
38575 {
38576 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
38577 ".google.container.v1.UpgradeInfoEvent.State",
38578 ))
38579 }
38580 }
38581
38582 /// The type of the event.
38583 ///
38584 /// # Working with unknown values
38585 ///
38586 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38587 /// additional enum variants at any time. Adding new variants is not considered
38588 /// a breaking change. Applications should write their code in anticipation of:
38589 ///
38590 /// - New values appearing in future releases of the client library, **and**
38591 /// - New values received dynamically, without application changes.
38592 ///
38593 /// Please consult the [Working with enums] section in the user guide for some
38594 /// guidelines.
38595 ///
38596 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
38597 #[derive(Clone, Debug, PartialEq)]
38598 #[non_exhaustive]
38599 pub enum EventType {
38600 /// EVENT_TYPE_UNSPECIFIED indicates the event type is unspecified.
38601 Unspecified,
38602 /// END_OF_SUPPORT indicates GKE version reaches end of support, check
38603 /// standard_support_end_time and extended_support_end_time for more details.
38604 EndOfSupport,
38605 /// COS_MILESTONE_VERSION_UPDATE indicates that the COS node image will
38606 /// update COS milestone version for new patch versions starting with
38607 /// the one in the description.
38608 CosMilestoneVersionUpdate,
38609 /// UPGRADE_LIFECYCLE indicates the event is about the upgrade lifecycle.
38610 UpgradeLifecycle,
38611 /// DISRUPTION_EVENT indicates the event is about the disruption.
38612 DisruptionEvent,
38613 /// If set, the enum was initialized with an unknown value.
38614 ///
38615 /// Applications can examine the value using [EventType::value] or
38616 /// [EventType::name].
38617 UnknownValue(event_type::UnknownValue),
38618 }
38619
38620 #[doc(hidden)]
38621 pub mod event_type {
38622 #[allow(unused_imports)]
38623 use super::*;
38624 #[derive(Clone, Debug, PartialEq)]
38625 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38626 }
38627
38628 impl EventType {
38629 /// Gets the enum value.
38630 ///
38631 /// Returns `None` if the enum contains an unknown value deserialized from
38632 /// the string representation of enums.
38633 pub fn value(&self) -> std::option::Option<i32> {
38634 match self {
38635 Self::Unspecified => std::option::Option::Some(0),
38636 Self::EndOfSupport => std::option::Option::Some(1),
38637 Self::CosMilestoneVersionUpdate => std::option::Option::Some(2),
38638 Self::UpgradeLifecycle => std::option::Option::Some(3),
38639 Self::DisruptionEvent => std::option::Option::Some(4),
38640 Self::UnknownValue(u) => u.0.value(),
38641 }
38642 }
38643
38644 /// Gets the enum value as a string.
38645 ///
38646 /// Returns `None` if the enum contains an unknown value deserialized from
38647 /// the integer representation of enums.
38648 pub fn name(&self) -> std::option::Option<&str> {
38649 match self {
38650 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
38651 Self::EndOfSupport => std::option::Option::Some("END_OF_SUPPORT"),
38652 Self::CosMilestoneVersionUpdate => {
38653 std::option::Option::Some("COS_MILESTONE_VERSION_UPDATE")
38654 }
38655 Self::UpgradeLifecycle => std::option::Option::Some("UPGRADE_LIFECYCLE"),
38656 Self::DisruptionEvent => std::option::Option::Some("DISRUPTION_EVENT"),
38657 Self::UnknownValue(u) => u.0.name(),
38658 }
38659 }
38660 }
38661
38662 impl std::default::Default for EventType {
38663 fn default() -> Self {
38664 use std::convert::From;
38665 Self::from(0)
38666 }
38667 }
38668
38669 impl std::fmt::Display for EventType {
38670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38671 wkt::internal::display_enum(f, self.name(), self.value())
38672 }
38673 }
38674
38675 impl std::convert::From<i32> for EventType {
38676 fn from(value: i32) -> Self {
38677 match value {
38678 0 => Self::Unspecified,
38679 1 => Self::EndOfSupport,
38680 2 => Self::CosMilestoneVersionUpdate,
38681 3 => Self::UpgradeLifecycle,
38682 4 => Self::DisruptionEvent,
38683 _ => Self::UnknownValue(event_type::UnknownValue(
38684 wkt::internal::UnknownEnumValue::Integer(value),
38685 )),
38686 }
38687 }
38688 }
38689
38690 impl std::convert::From<&str> for EventType {
38691 fn from(value: &str) -> Self {
38692 use std::string::ToString;
38693 match value {
38694 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
38695 "END_OF_SUPPORT" => Self::EndOfSupport,
38696 "COS_MILESTONE_VERSION_UPDATE" => Self::CosMilestoneVersionUpdate,
38697 "UPGRADE_LIFECYCLE" => Self::UpgradeLifecycle,
38698 "DISRUPTION_EVENT" => Self::DisruptionEvent,
38699 _ => Self::UnknownValue(event_type::UnknownValue(
38700 wkt::internal::UnknownEnumValue::String(value.to_string()),
38701 )),
38702 }
38703 }
38704 }
38705
38706 impl serde::ser::Serialize for EventType {
38707 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38708 where
38709 S: serde::Serializer,
38710 {
38711 match self {
38712 Self::Unspecified => serializer.serialize_i32(0),
38713 Self::EndOfSupport => serializer.serialize_i32(1),
38714 Self::CosMilestoneVersionUpdate => serializer.serialize_i32(2),
38715 Self::UpgradeLifecycle => serializer.serialize_i32(3),
38716 Self::DisruptionEvent => serializer.serialize_i32(4),
38717 Self::UnknownValue(u) => u.0.serialize(serializer),
38718 }
38719 }
38720 }
38721
38722 impl<'de> serde::de::Deserialize<'de> for EventType {
38723 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38724 where
38725 D: serde::Deserializer<'de>,
38726 {
38727 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
38728 ".google.container.v1.UpgradeInfoEvent.EventType",
38729 ))
38730 }
38731 }
38732}
38733
38734/// DisruptionEvent is a notification sent to customers about the disruption
38735/// event of a resource.
38736#[derive(Clone, Default, PartialEq)]
38737#[non_exhaustive]
38738pub struct DisruptionEvent {
38739 /// The type of the disruption event.
38740 pub disruption_type: crate::model::disruption_event::DisruptionType,
38741
38742 /// The node whose drain is blocked by PDB. This field is set for both
38743 /// POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event.
38744 pub pdb_blocked_node: std::string::String,
38745
38746 /// The pods whose evictions are blocked by PDB. This field is set for
38747 /// both POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event.
38748 pub pdb_blocked_pod: std::vec::Vec<crate::model::disruption_event::PdbBlockedPod>,
38749
38750 /// The timeout in seconds for which the node drain is blocked by PDB.
38751 /// After this timeout, pods are forcefully evicted.
38752 /// This field is only populated when event_type is
38753 /// POD_PDB_VIOLATION.
38754 pub pdb_violation_timeout: std::option::Option<wkt::Duration>,
38755
38756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38757}
38758
38759impl DisruptionEvent {
38760 /// Creates a new default instance.
38761 pub fn new() -> Self {
38762 std::default::Default::default()
38763 }
38764
38765 /// Sets the value of [disruption_type][crate::model::DisruptionEvent::disruption_type].
38766 ///
38767 /// # Example
38768 /// ```ignore,no_run
38769 /// # use google_cloud_container_v1::model::DisruptionEvent;
38770 /// use google_cloud_container_v1::model::disruption_event::DisruptionType;
38771 /// let x0 = DisruptionEvent::new().set_disruption_type(DisruptionType::PodNotEnoughPdb);
38772 /// let x1 = DisruptionEvent::new().set_disruption_type(DisruptionType::PodPdbViolation);
38773 /// ```
38774 pub fn set_disruption_type<
38775 T: std::convert::Into<crate::model::disruption_event::DisruptionType>,
38776 >(
38777 mut self,
38778 v: T,
38779 ) -> Self {
38780 self.disruption_type = v.into();
38781 self
38782 }
38783
38784 /// Sets the value of [pdb_blocked_node][crate::model::DisruptionEvent::pdb_blocked_node].
38785 ///
38786 /// # Example
38787 /// ```ignore,no_run
38788 /// # use google_cloud_container_v1::model::DisruptionEvent;
38789 /// let x = DisruptionEvent::new().set_pdb_blocked_node("example");
38790 /// ```
38791 pub fn set_pdb_blocked_node<T: std::convert::Into<std::string::String>>(
38792 mut self,
38793 v: T,
38794 ) -> Self {
38795 self.pdb_blocked_node = v.into();
38796 self
38797 }
38798
38799 /// Sets the value of [pdb_blocked_pod][crate::model::DisruptionEvent::pdb_blocked_pod].
38800 ///
38801 /// # Example
38802 /// ```ignore,no_run
38803 /// # use google_cloud_container_v1::model::DisruptionEvent;
38804 /// use google_cloud_container_v1::model::disruption_event::PdbBlockedPod;
38805 /// let x = DisruptionEvent::new()
38806 /// .set_pdb_blocked_pod([
38807 /// PdbBlockedPod::default()/* use setters */,
38808 /// PdbBlockedPod::default()/* use (different) setters */,
38809 /// ]);
38810 /// ```
38811 pub fn set_pdb_blocked_pod<T, V>(mut self, v: T) -> Self
38812 where
38813 T: std::iter::IntoIterator<Item = V>,
38814 V: std::convert::Into<crate::model::disruption_event::PdbBlockedPod>,
38815 {
38816 use std::iter::Iterator;
38817 self.pdb_blocked_pod = v.into_iter().map(|i| i.into()).collect();
38818 self
38819 }
38820
38821 /// Sets the value of [pdb_violation_timeout][crate::model::DisruptionEvent::pdb_violation_timeout].
38822 ///
38823 /// # Example
38824 /// ```ignore,no_run
38825 /// # use google_cloud_container_v1::model::DisruptionEvent;
38826 /// use wkt::Duration;
38827 /// let x = DisruptionEvent::new().set_pdb_violation_timeout(Duration::default()/* use setters */);
38828 /// ```
38829 pub fn set_pdb_violation_timeout<T>(mut self, v: T) -> Self
38830 where
38831 T: std::convert::Into<wkt::Duration>,
38832 {
38833 self.pdb_violation_timeout = std::option::Option::Some(v.into());
38834 self
38835 }
38836
38837 /// Sets or clears the value of [pdb_violation_timeout][crate::model::DisruptionEvent::pdb_violation_timeout].
38838 ///
38839 /// # Example
38840 /// ```ignore,no_run
38841 /// # use google_cloud_container_v1::model::DisruptionEvent;
38842 /// use wkt::Duration;
38843 /// let x = DisruptionEvent::new().set_or_clear_pdb_violation_timeout(Some(Duration::default()/* use setters */));
38844 /// let x = DisruptionEvent::new().set_or_clear_pdb_violation_timeout(None::<Duration>);
38845 /// ```
38846 pub fn set_or_clear_pdb_violation_timeout<T>(mut self, v: std::option::Option<T>) -> Self
38847 where
38848 T: std::convert::Into<wkt::Duration>,
38849 {
38850 self.pdb_violation_timeout = v.map(|x| x.into());
38851 self
38852 }
38853}
38854
38855impl wkt::message::Message for DisruptionEvent {
38856 fn typename() -> &'static str {
38857 "type.googleapis.com/google.container.v1.DisruptionEvent"
38858 }
38859}
38860
38861/// Defines additional types related to [DisruptionEvent].
38862pub mod disruption_event {
38863 #[allow(unused_imports)]
38864 use super::*;
38865
38866 /// The namespace/name of the pod whose eviction is blocked by PDB.
38867 #[derive(Clone, Default, PartialEq)]
38868 #[non_exhaustive]
38869 pub struct PdbBlockedPod {
38870 /// The namespace of the pod.
38871 pub namespace: std::string::String,
38872
38873 /// The name of the pod.
38874 pub name: std::string::String,
38875
38876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38877 }
38878
38879 impl PdbBlockedPod {
38880 /// Creates a new default instance.
38881 pub fn new() -> Self {
38882 std::default::Default::default()
38883 }
38884
38885 /// Sets the value of [namespace][crate::model::disruption_event::PdbBlockedPod::namespace].
38886 ///
38887 /// # Example
38888 /// ```ignore,no_run
38889 /// # use google_cloud_container_v1::model::disruption_event::PdbBlockedPod;
38890 /// let x = PdbBlockedPod::new().set_namespace("example");
38891 /// ```
38892 pub fn set_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38893 self.namespace = v.into();
38894 self
38895 }
38896
38897 /// Sets the value of [name][crate::model::disruption_event::PdbBlockedPod::name].
38898 ///
38899 /// # Example
38900 /// ```ignore,no_run
38901 /// # use google_cloud_container_v1::model::disruption_event::PdbBlockedPod;
38902 /// let x = PdbBlockedPod::new().set_name("example");
38903 /// ```
38904 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38905 self.name = v.into();
38906 self
38907 }
38908 }
38909
38910 impl wkt::message::Message for PdbBlockedPod {
38911 fn typename() -> &'static str {
38912 "type.googleapis.com/google.container.v1.DisruptionEvent.PdbBlockedPod"
38913 }
38914 }
38915
38916 /// The type of the disruption event.
38917 ///
38918 /// # Working with unknown values
38919 ///
38920 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38921 /// additional enum variants at any time. Adding new variants is not considered
38922 /// a breaking change. Applications should write their code in anticipation of:
38923 ///
38924 /// - New values appearing in future releases of the client library, **and**
38925 /// - New values received dynamically, without application changes.
38926 ///
38927 /// Please consult the [Working with enums] section in the user guide for some
38928 /// guidelines.
38929 ///
38930 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
38931 #[derive(Clone, Debug, PartialEq)]
38932 #[non_exhaustive]
38933 pub enum DisruptionType {
38934 /// DISRUPTION_TYPE_UNSPECIFIED indicates the disruption type is unspecified.
38935 Unspecified,
38936 /// POD_NOT_ENOUGH_PDB indicates there are still running pods
38937 /// on the node during node drain because their evictions are blocked by PDB.
38938 PodNotEnoughPdb,
38939 /// POD_PDB_VIOLATION indicates that there are force pod
38940 /// evictions during node drain which violate the PDB.
38941 PodPdbViolation,
38942 /// If set, the enum was initialized with an unknown value.
38943 ///
38944 /// Applications can examine the value using [DisruptionType::value] or
38945 /// [DisruptionType::name].
38946 UnknownValue(disruption_type::UnknownValue),
38947 }
38948
38949 #[doc(hidden)]
38950 pub mod disruption_type {
38951 #[allow(unused_imports)]
38952 use super::*;
38953 #[derive(Clone, Debug, PartialEq)]
38954 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38955 }
38956
38957 impl DisruptionType {
38958 /// Gets the enum value.
38959 ///
38960 /// Returns `None` if the enum contains an unknown value deserialized from
38961 /// the string representation of enums.
38962 pub fn value(&self) -> std::option::Option<i32> {
38963 match self {
38964 Self::Unspecified => std::option::Option::Some(0),
38965 Self::PodNotEnoughPdb => std::option::Option::Some(1),
38966 Self::PodPdbViolation => std::option::Option::Some(2),
38967 Self::UnknownValue(u) => u.0.value(),
38968 }
38969 }
38970
38971 /// Gets the enum value as a string.
38972 ///
38973 /// Returns `None` if the enum contains an unknown value deserialized from
38974 /// the integer representation of enums.
38975 pub fn name(&self) -> std::option::Option<&str> {
38976 match self {
38977 Self::Unspecified => std::option::Option::Some("DISRUPTION_TYPE_UNSPECIFIED"),
38978 Self::PodNotEnoughPdb => std::option::Option::Some("POD_NOT_ENOUGH_PDB"),
38979 Self::PodPdbViolation => std::option::Option::Some("POD_PDB_VIOLATION"),
38980 Self::UnknownValue(u) => u.0.name(),
38981 }
38982 }
38983 }
38984
38985 impl std::default::Default for DisruptionType {
38986 fn default() -> Self {
38987 use std::convert::From;
38988 Self::from(0)
38989 }
38990 }
38991
38992 impl std::fmt::Display for DisruptionType {
38993 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38994 wkt::internal::display_enum(f, self.name(), self.value())
38995 }
38996 }
38997
38998 impl std::convert::From<i32> for DisruptionType {
38999 fn from(value: i32) -> Self {
39000 match value {
39001 0 => Self::Unspecified,
39002 1 => Self::PodNotEnoughPdb,
39003 2 => Self::PodPdbViolation,
39004 _ => Self::UnknownValue(disruption_type::UnknownValue(
39005 wkt::internal::UnknownEnumValue::Integer(value),
39006 )),
39007 }
39008 }
39009 }
39010
39011 impl std::convert::From<&str> for DisruptionType {
39012 fn from(value: &str) -> Self {
39013 use std::string::ToString;
39014 match value {
39015 "DISRUPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
39016 "POD_NOT_ENOUGH_PDB" => Self::PodNotEnoughPdb,
39017 "POD_PDB_VIOLATION" => Self::PodPdbViolation,
39018 _ => Self::UnknownValue(disruption_type::UnknownValue(
39019 wkt::internal::UnknownEnumValue::String(value.to_string()),
39020 )),
39021 }
39022 }
39023 }
39024
39025 impl serde::ser::Serialize for DisruptionType {
39026 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39027 where
39028 S: serde::Serializer,
39029 {
39030 match self {
39031 Self::Unspecified => serializer.serialize_i32(0),
39032 Self::PodNotEnoughPdb => serializer.serialize_i32(1),
39033 Self::PodPdbViolation => serializer.serialize_i32(2),
39034 Self::UnknownValue(u) => u.0.serialize(serializer),
39035 }
39036 }
39037 }
39038
39039 impl<'de> serde::de::Deserialize<'de> for DisruptionType {
39040 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39041 where
39042 D: serde::Deserializer<'de>,
39043 {
39044 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DisruptionType>::new(
39045 ".google.container.v1.DisruptionEvent.DisruptionType",
39046 ))
39047 }
39048 }
39049}
39050
39051/// UpgradeAvailableEvent is a notification sent to customers when a new
39052/// available version is released.
39053#[derive(Clone, Default, PartialEq)]
39054#[non_exhaustive]
39055pub struct UpgradeAvailableEvent {
39056 /// The release version available for upgrade.
39057 pub version: std::string::String,
39058
39059 /// The resource type of the release version.
39060 pub resource_type: crate::model::UpgradeResourceType,
39061
39062 /// The release channel of the version. If empty, it means a non-channel
39063 /// release.
39064 pub release_channel: std::option::Option<crate::model::ReleaseChannel>,
39065
39066 /// Optional relative path to the resource. For example, the relative path of
39067 /// the node pool.
39068 pub resource: std::string::String,
39069
39070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39071}
39072
39073impl UpgradeAvailableEvent {
39074 /// Creates a new default instance.
39075 pub fn new() -> Self {
39076 std::default::Default::default()
39077 }
39078
39079 /// Sets the value of [version][crate::model::UpgradeAvailableEvent::version].
39080 ///
39081 /// # Example
39082 /// ```ignore,no_run
39083 /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
39084 /// let x = UpgradeAvailableEvent::new().set_version("example");
39085 /// ```
39086 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
39087 self.version = v.into();
39088 self
39089 }
39090
39091 /// Sets the value of [resource_type][crate::model::UpgradeAvailableEvent::resource_type].
39092 ///
39093 /// # Example
39094 /// ```ignore,no_run
39095 /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
39096 /// use google_cloud_container_v1::model::UpgradeResourceType;
39097 /// let x0 = UpgradeAvailableEvent::new().set_resource_type(UpgradeResourceType::Master);
39098 /// let x1 = UpgradeAvailableEvent::new().set_resource_type(UpgradeResourceType::NodePool);
39099 /// ```
39100 pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
39101 mut self,
39102 v: T,
39103 ) -> Self {
39104 self.resource_type = v.into();
39105 self
39106 }
39107
39108 /// Sets the value of [release_channel][crate::model::UpgradeAvailableEvent::release_channel].
39109 ///
39110 /// # Example
39111 /// ```ignore,no_run
39112 /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
39113 /// use google_cloud_container_v1::model::ReleaseChannel;
39114 /// let x = UpgradeAvailableEvent::new().set_release_channel(ReleaseChannel::default()/* use setters */);
39115 /// ```
39116 pub fn set_release_channel<T>(mut self, v: T) -> Self
39117 where
39118 T: std::convert::Into<crate::model::ReleaseChannel>,
39119 {
39120 self.release_channel = std::option::Option::Some(v.into());
39121 self
39122 }
39123
39124 /// Sets or clears the value of [release_channel][crate::model::UpgradeAvailableEvent::release_channel].
39125 ///
39126 /// # Example
39127 /// ```ignore,no_run
39128 /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
39129 /// use google_cloud_container_v1::model::ReleaseChannel;
39130 /// let x = UpgradeAvailableEvent::new().set_or_clear_release_channel(Some(ReleaseChannel::default()/* use setters */));
39131 /// let x = UpgradeAvailableEvent::new().set_or_clear_release_channel(None::<ReleaseChannel>);
39132 /// ```
39133 pub fn set_or_clear_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
39134 where
39135 T: std::convert::Into<crate::model::ReleaseChannel>,
39136 {
39137 self.release_channel = v.map(|x| x.into());
39138 self
39139 }
39140
39141 /// Sets the value of [resource][crate::model::UpgradeAvailableEvent::resource].
39142 ///
39143 /// # Example
39144 /// ```ignore,no_run
39145 /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
39146 /// let x = UpgradeAvailableEvent::new().set_resource("example");
39147 /// ```
39148 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
39149 self.resource = v.into();
39150 self
39151 }
39152}
39153
39154impl wkt::message::Message for UpgradeAvailableEvent {
39155 fn typename() -> &'static str {
39156 "type.googleapis.com/google.container.v1.UpgradeAvailableEvent"
39157 }
39158}
39159
39160/// SecurityBulletinEvent is a notification sent to customers when a security
39161/// bulletin has been posted that they are vulnerable to.
39162#[derive(Clone, Default, PartialEq)]
39163#[non_exhaustive]
39164pub struct SecurityBulletinEvent {
39165 /// The resource type (node/control plane) that has the vulnerability. Multiple
39166 /// notifications (1 notification per resource type) will be sent for a
39167 /// vulnerability that affects > 1 resource type.
39168 pub resource_type_affected: std::string::String,
39169
39170 /// The ID of the bulletin corresponding to the vulnerability.
39171 pub bulletin_id: std::string::String,
39172
39173 /// The CVEs associated with this bulletin.
39174 pub cve_ids: std::vec::Vec<std::string::String>,
39175
39176 /// The severity of this bulletin as it relates to GKE.
39177 pub severity: std::string::String,
39178
39179 /// The URI link to the bulletin on the website for more information.
39180 pub bulletin_uri: std::string::String,
39181
39182 /// A brief description of the bulletin. See the bulletin pointed to by the
39183 /// bulletin_uri field for an expanded description.
39184 pub brief_description: std::string::String,
39185
39186 /// The GKE minor versions affected by this vulnerability.
39187 pub affected_supported_minors: std::vec::Vec<std::string::String>,
39188
39189 /// The GKE versions where this vulnerability is patched.
39190 pub patched_versions: std::vec::Vec<std::string::String>,
39191
39192 /// This represents a version selected from the patched_versions field that
39193 /// the cluster receiving this notification should most likely want to upgrade
39194 /// to based on its current version. Note that if this notification is being
39195 /// received by a given cluster, it means that this version is currently
39196 /// available as an upgrade target in that cluster's location.
39197 pub suggested_upgrade_target: std::string::String,
39198
39199 /// If this field is specified, it means there are manual steps that the user
39200 /// must take to make their clusters safe.
39201 pub manual_steps_required: bool,
39202
39203 /// The GKE versions where this vulnerability is mitigated.
39204 pub mitigated_versions: std::vec::Vec<std::string::String>,
39205
39206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39207}
39208
39209impl SecurityBulletinEvent {
39210 /// Creates a new default instance.
39211 pub fn new() -> Self {
39212 std::default::Default::default()
39213 }
39214
39215 /// Sets the value of [resource_type_affected][crate::model::SecurityBulletinEvent::resource_type_affected].
39216 ///
39217 /// # Example
39218 /// ```ignore,no_run
39219 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39220 /// let x = SecurityBulletinEvent::new().set_resource_type_affected("example");
39221 /// ```
39222 pub fn set_resource_type_affected<T: std::convert::Into<std::string::String>>(
39223 mut self,
39224 v: T,
39225 ) -> Self {
39226 self.resource_type_affected = v.into();
39227 self
39228 }
39229
39230 /// Sets the value of [bulletin_id][crate::model::SecurityBulletinEvent::bulletin_id].
39231 ///
39232 /// # Example
39233 /// ```ignore,no_run
39234 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39235 /// let x = SecurityBulletinEvent::new().set_bulletin_id("example");
39236 /// ```
39237 pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
39238 self.bulletin_id = v.into();
39239 self
39240 }
39241
39242 /// Sets the value of [cve_ids][crate::model::SecurityBulletinEvent::cve_ids].
39243 ///
39244 /// # Example
39245 /// ```ignore,no_run
39246 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39247 /// let x = SecurityBulletinEvent::new().set_cve_ids(["a", "b", "c"]);
39248 /// ```
39249 pub fn set_cve_ids<T, V>(mut self, v: T) -> Self
39250 where
39251 T: std::iter::IntoIterator<Item = V>,
39252 V: std::convert::Into<std::string::String>,
39253 {
39254 use std::iter::Iterator;
39255 self.cve_ids = v.into_iter().map(|i| i.into()).collect();
39256 self
39257 }
39258
39259 /// Sets the value of [severity][crate::model::SecurityBulletinEvent::severity].
39260 ///
39261 /// # Example
39262 /// ```ignore,no_run
39263 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39264 /// let x = SecurityBulletinEvent::new().set_severity("example");
39265 /// ```
39266 pub fn set_severity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
39267 self.severity = v.into();
39268 self
39269 }
39270
39271 /// Sets the value of [bulletin_uri][crate::model::SecurityBulletinEvent::bulletin_uri].
39272 ///
39273 /// # Example
39274 /// ```ignore,no_run
39275 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39276 /// let x = SecurityBulletinEvent::new().set_bulletin_uri("example");
39277 /// ```
39278 pub fn set_bulletin_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
39279 self.bulletin_uri = v.into();
39280 self
39281 }
39282
39283 /// Sets the value of [brief_description][crate::model::SecurityBulletinEvent::brief_description].
39284 ///
39285 /// # Example
39286 /// ```ignore,no_run
39287 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39288 /// let x = SecurityBulletinEvent::new().set_brief_description("example");
39289 /// ```
39290 pub fn set_brief_description<T: std::convert::Into<std::string::String>>(
39291 mut self,
39292 v: T,
39293 ) -> Self {
39294 self.brief_description = v.into();
39295 self
39296 }
39297
39298 /// Sets the value of [affected_supported_minors][crate::model::SecurityBulletinEvent::affected_supported_minors].
39299 ///
39300 /// # Example
39301 /// ```ignore,no_run
39302 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39303 /// let x = SecurityBulletinEvent::new().set_affected_supported_minors(["a", "b", "c"]);
39304 /// ```
39305 pub fn set_affected_supported_minors<T, V>(mut self, v: T) -> Self
39306 where
39307 T: std::iter::IntoIterator<Item = V>,
39308 V: std::convert::Into<std::string::String>,
39309 {
39310 use std::iter::Iterator;
39311 self.affected_supported_minors = v.into_iter().map(|i| i.into()).collect();
39312 self
39313 }
39314
39315 /// Sets the value of [patched_versions][crate::model::SecurityBulletinEvent::patched_versions].
39316 ///
39317 /// # Example
39318 /// ```ignore,no_run
39319 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39320 /// let x = SecurityBulletinEvent::new().set_patched_versions(["a", "b", "c"]);
39321 /// ```
39322 pub fn set_patched_versions<T, V>(mut self, v: T) -> Self
39323 where
39324 T: std::iter::IntoIterator<Item = V>,
39325 V: std::convert::Into<std::string::String>,
39326 {
39327 use std::iter::Iterator;
39328 self.patched_versions = v.into_iter().map(|i| i.into()).collect();
39329 self
39330 }
39331
39332 /// Sets the value of [suggested_upgrade_target][crate::model::SecurityBulletinEvent::suggested_upgrade_target].
39333 ///
39334 /// # Example
39335 /// ```ignore,no_run
39336 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39337 /// let x = SecurityBulletinEvent::new().set_suggested_upgrade_target("example");
39338 /// ```
39339 pub fn set_suggested_upgrade_target<T: std::convert::Into<std::string::String>>(
39340 mut self,
39341 v: T,
39342 ) -> Self {
39343 self.suggested_upgrade_target = v.into();
39344 self
39345 }
39346
39347 /// Sets the value of [manual_steps_required][crate::model::SecurityBulletinEvent::manual_steps_required].
39348 ///
39349 /// # Example
39350 /// ```ignore,no_run
39351 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39352 /// let x = SecurityBulletinEvent::new().set_manual_steps_required(true);
39353 /// ```
39354 pub fn set_manual_steps_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
39355 self.manual_steps_required = v.into();
39356 self
39357 }
39358
39359 /// Sets the value of [mitigated_versions][crate::model::SecurityBulletinEvent::mitigated_versions].
39360 ///
39361 /// # Example
39362 /// ```ignore,no_run
39363 /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
39364 /// let x = SecurityBulletinEvent::new().set_mitigated_versions(["a", "b", "c"]);
39365 /// ```
39366 pub fn set_mitigated_versions<T, V>(mut self, v: T) -> Self
39367 where
39368 T: std::iter::IntoIterator<Item = V>,
39369 V: std::convert::Into<std::string::String>,
39370 {
39371 use std::iter::Iterator;
39372 self.mitigated_versions = v.into_iter().map(|i| i.into()).collect();
39373 self
39374 }
39375}
39376
39377impl wkt::message::Message for SecurityBulletinEvent {
39378 fn typename() -> &'static str {
39379 "type.googleapis.com/google.container.v1.SecurityBulletinEvent"
39380 }
39381}
39382
39383/// Autopilot is the configuration for Autopilot settings on the cluster.
39384#[derive(Clone, Default, PartialEq)]
39385#[non_exhaustive]
39386pub struct Autopilot {
39387 /// Enable Autopilot
39388 pub enabled: bool,
39389
39390 /// WorkloadPolicyConfig is the configuration related to GCW workload policy
39391 pub workload_policy_config: std::option::Option<crate::model::WorkloadPolicyConfig>,
39392
39393 /// PrivilegedAdmissionConfig is the configuration related to privileged
39394 /// admission control.
39395 pub privileged_admission_config: std::option::Option<crate::model::PrivilegedAdmissionConfig>,
39396
39397 /// ClusterPolicyConfig denotes cluster level policies that are enforced for
39398 /// the cluster.
39399 pub cluster_policy_config: std::option::Option<crate::model::ClusterPolicyConfig>,
39400
39401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39402}
39403
39404impl Autopilot {
39405 /// Creates a new default instance.
39406 pub fn new() -> Self {
39407 std::default::Default::default()
39408 }
39409
39410 /// Sets the value of [enabled][crate::model::Autopilot::enabled].
39411 ///
39412 /// # Example
39413 /// ```ignore,no_run
39414 /// # use google_cloud_container_v1::model::Autopilot;
39415 /// let x = Autopilot::new().set_enabled(true);
39416 /// ```
39417 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
39418 self.enabled = v.into();
39419 self
39420 }
39421
39422 /// Sets the value of [workload_policy_config][crate::model::Autopilot::workload_policy_config].
39423 ///
39424 /// # Example
39425 /// ```ignore,no_run
39426 /// # use google_cloud_container_v1::model::Autopilot;
39427 /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
39428 /// let x = Autopilot::new().set_workload_policy_config(WorkloadPolicyConfig::default()/* use setters */);
39429 /// ```
39430 pub fn set_workload_policy_config<T>(mut self, v: T) -> Self
39431 where
39432 T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
39433 {
39434 self.workload_policy_config = std::option::Option::Some(v.into());
39435 self
39436 }
39437
39438 /// Sets or clears the value of [workload_policy_config][crate::model::Autopilot::workload_policy_config].
39439 ///
39440 /// # Example
39441 /// ```ignore,no_run
39442 /// # use google_cloud_container_v1::model::Autopilot;
39443 /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
39444 /// let x = Autopilot::new().set_or_clear_workload_policy_config(Some(WorkloadPolicyConfig::default()/* use setters */));
39445 /// let x = Autopilot::new().set_or_clear_workload_policy_config(None::<WorkloadPolicyConfig>);
39446 /// ```
39447 pub fn set_or_clear_workload_policy_config<T>(mut self, v: std::option::Option<T>) -> Self
39448 where
39449 T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
39450 {
39451 self.workload_policy_config = v.map(|x| x.into());
39452 self
39453 }
39454
39455 /// Sets the value of [privileged_admission_config][crate::model::Autopilot::privileged_admission_config].
39456 ///
39457 /// # Example
39458 /// ```ignore,no_run
39459 /// # use google_cloud_container_v1::model::Autopilot;
39460 /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
39461 /// let x = Autopilot::new().set_privileged_admission_config(PrivilegedAdmissionConfig::default()/* use setters */);
39462 /// ```
39463 pub fn set_privileged_admission_config<T>(mut self, v: T) -> Self
39464 where
39465 T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
39466 {
39467 self.privileged_admission_config = std::option::Option::Some(v.into());
39468 self
39469 }
39470
39471 /// Sets or clears the value of [privileged_admission_config][crate::model::Autopilot::privileged_admission_config].
39472 ///
39473 /// # Example
39474 /// ```ignore,no_run
39475 /// # use google_cloud_container_v1::model::Autopilot;
39476 /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
39477 /// let x = Autopilot::new().set_or_clear_privileged_admission_config(Some(PrivilegedAdmissionConfig::default()/* use setters */));
39478 /// let x = Autopilot::new().set_or_clear_privileged_admission_config(None::<PrivilegedAdmissionConfig>);
39479 /// ```
39480 pub fn set_or_clear_privileged_admission_config<T>(mut self, v: std::option::Option<T>) -> Self
39481 where
39482 T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
39483 {
39484 self.privileged_admission_config = v.map(|x| x.into());
39485 self
39486 }
39487
39488 /// Sets the value of [cluster_policy_config][crate::model::Autopilot::cluster_policy_config].
39489 ///
39490 /// # Example
39491 /// ```ignore,no_run
39492 /// # use google_cloud_container_v1::model::Autopilot;
39493 /// use google_cloud_container_v1::model::ClusterPolicyConfig;
39494 /// let x = Autopilot::new().set_cluster_policy_config(ClusterPolicyConfig::default()/* use setters */);
39495 /// ```
39496 pub fn set_cluster_policy_config<T>(mut self, v: T) -> Self
39497 where
39498 T: std::convert::Into<crate::model::ClusterPolicyConfig>,
39499 {
39500 self.cluster_policy_config = std::option::Option::Some(v.into());
39501 self
39502 }
39503
39504 /// Sets or clears the value of [cluster_policy_config][crate::model::Autopilot::cluster_policy_config].
39505 ///
39506 /// # Example
39507 /// ```ignore,no_run
39508 /// # use google_cloud_container_v1::model::Autopilot;
39509 /// use google_cloud_container_v1::model::ClusterPolicyConfig;
39510 /// let x = Autopilot::new().set_or_clear_cluster_policy_config(Some(ClusterPolicyConfig::default()/* use setters */));
39511 /// let x = Autopilot::new().set_or_clear_cluster_policy_config(None::<ClusterPolicyConfig>);
39512 /// ```
39513 pub fn set_or_clear_cluster_policy_config<T>(mut self, v: std::option::Option<T>) -> Self
39514 where
39515 T: std::convert::Into<crate::model::ClusterPolicyConfig>,
39516 {
39517 self.cluster_policy_config = v.map(|x| x.into());
39518 self
39519 }
39520}
39521
39522impl wkt::message::Message for Autopilot {
39523 fn typename() -> &'static str {
39524 "type.googleapis.com/google.container.v1.Autopilot"
39525 }
39526}
39527
39528/// ClusterPolicyConfig stores the configuration for cluster wide policies.
39529#[derive(Clone, Default, PartialEq)]
39530#[non_exhaustive]
39531pub struct ClusterPolicyConfig {
39532 /// Denotes that preventing creation and mutation of resources in GKE
39533 /// managed namespaces and cluster-scoped GKE managed resources .
39534 pub no_system_mutation: std::option::Option<bool>,
39535
39536 /// Denotes preventing impersonation and CSRs for GKE System users.
39537 pub no_system_impersonation: std::option::Option<bool>,
39538
39539 /// Denotes preventing unsafe webhooks.
39540 pub no_unsafe_webhooks: std::option::Option<bool>,
39541
39542 /// Denotes preventing standard node pools and requiring only autopilot node
39543 /// pools.
39544 pub no_standard_node_pools: std::option::Option<bool>,
39545
39546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39547}
39548
39549impl ClusterPolicyConfig {
39550 /// Creates a new default instance.
39551 pub fn new() -> Self {
39552 std::default::Default::default()
39553 }
39554
39555 /// Sets the value of [no_system_mutation][crate::model::ClusterPolicyConfig::no_system_mutation].
39556 ///
39557 /// # Example
39558 /// ```ignore,no_run
39559 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39560 /// let x = ClusterPolicyConfig::new().set_no_system_mutation(true);
39561 /// ```
39562 pub fn set_no_system_mutation<T>(mut self, v: T) -> Self
39563 where
39564 T: std::convert::Into<bool>,
39565 {
39566 self.no_system_mutation = std::option::Option::Some(v.into());
39567 self
39568 }
39569
39570 /// Sets or clears the value of [no_system_mutation][crate::model::ClusterPolicyConfig::no_system_mutation].
39571 ///
39572 /// # Example
39573 /// ```ignore,no_run
39574 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39575 /// let x = ClusterPolicyConfig::new().set_or_clear_no_system_mutation(Some(false));
39576 /// let x = ClusterPolicyConfig::new().set_or_clear_no_system_mutation(None::<bool>);
39577 /// ```
39578 pub fn set_or_clear_no_system_mutation<T>(mut self, v: std::option::Option<T>) -> Self
39579 where
39580 T: std::convert::Into<bool>,
39581 {
39582 self.no_system_mutation = v.map(|x| x.into());
39583 self
39584 }
39585
39586 /// Sets the value of [no_system_impersonation][crate::model::ClusterPolicyConfig::no_system_impersonation].
39587 ///
39588 /// # Example
39589 /// ```ignore,no_run
39590 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39591 /// let x = ClusterPolicyConfig::new().set_no_system_impersonation(true);
39592 /// ```
39593 pub fn set_no_system_impersonation<T>(mut self, v: T) -> Self
39594 where
39595 T: std::convert::Into<bool>,
39596 {
39597 self.no_system_impersonation = std::option::Option::Some(v.into());
39598 self
39599 }
39600
39601 /// Sets or clears the value of [no_system_impersonation][crate::model::ClusterPolicyConfig::no_system_impersonation].
39602 ///
39603 /// # Example
39604 /// ```ignore,no_run
39605 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39606 /// let x = ClusterPolicyConfig::new().set_or_clear_no_system_impersonation(Some(false));
39607 /// let x = ClusterPolicyConfig::new().set_or_clear_no_system_impersonation(None::<bool>);
39608 /// ```
39609 pub fn set_or_clear_no_system_impersonation<T>(mut self, v: std::option::Option<T>) -> Self
39610 where
39611 T: std::convert::Into<bool>,
39612 {
39613 self.no_system_impersonation = v.map(|x| x.into());
39614 self
39615 }
39616
39617 /// Sets the value of [no_unsafe_webhooks][crate::model::ClusterPolicyConfig::no_unsafe_webhooks].
39618 ///
39619 /// # Example
39620 /// ```ignore,no_run
39621 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39622 /// let x = ClusterPolicyConfig::new().set_no_unsafe_webhooks(true);
39623 /// ```
39624 pub fn set_no_unsafe_webhooks<T>(mut self, v: T) -> Self
39625 where
39626 T: std::convert::Into<bool>,
39627 {
39628 self.no_unsafe_webhooks = std::option::Option::Some(v.into());
39629 self
39630 }
39631
39632 /// Sets or clears the value of [no_unsafe_webhooks][crate::model::ClusterPolicyConfig::no_unsafe_webhooks].
39633 ///
39634 /// # Example
39635 /// ```ignore,no_run
39636 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39637 /// let x = ClusterPolicyConfig::new().set_or_clear_no_unsafe_webhooks(Some(false));
39638 /// let x = ClusterPolicyConfig::new().set_or_clear_no_unsafe_webhooks(None::<bool>);
39639 /// ```
39640 pub fn set_or_clear_no_unsafe_webhooks<T>(mut self, v: std::option::Option<T>) -> Self
39641 where
39642 T: std::convert::Into<bool>,
39643 {
39644 self.no_unsafe_webhooks = v.map(|x| x.into());
39645 self
39646 }
39647
39648 /// Sets the value of [no_standard_node_pools][crate::model::ClusterPolicyConfig::no_standard_node_pools].
39649 ///
39650 /// # Example
39651 /// ```ignore,no_run
39652 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39653 /// let x = ClusterPolicyConfig::new().set_no_standard_node_pools(true);
39654 /// ```
39655 pub fn set_no_standard_node_pools<T>(mut self, v: T) -> Self
39656 where
39657 T: std::convert::Into<bool>,
39658 {
39659 self.no_standard_node_pools = std::option::Option::Some(v.into());
39660 self
39661 }
39662
39663 /// Sets or clears the value of [no_standard_node_pools][crate::model::ClusterPolicyConfig::no_standard_node_pools].
39664 ///
39665 /// # Example
39666 /// ```ignore,no_run
39667 /// # use google_cloud_container_v1::model::ClusterPolicyConfig;
39668 /// let x = ClusterPolicyConfig::new().set_or_clear_no_standard_node_pools(Some(false));
39669 /// let x = ClusterPolicyConfig::new().set_or_clear_no_standard_node_pools(None::<bool>);
39670 /// ```
39671 pub fn set_or_clear_no_standard_node_pools<T>(mut self, v: std::option::Option<T>) -> Self
39672 where
39673 T: std::convert::Into<bool>,
39674 {
39675 self.no_standard_node_pools = v.map(|x| x.into());
39676 self
39677 }
39678}
39679
39680impl wkt::message::Message for ClusterPolicyConfig {
39681 fn typename() -> &'static str {
39682 "type.googleapis.com/google.container.v1.ClusterPolicyConfig"
39683 }
39684}
39685
39686/// PrivilegedAdmissionConfig stores the list of authorized allowlist
39687/// paths for the cluster.
39688#[derive(Clone, Default, PartialEq)]
39689#[non_exhaustive]
39690pub struct PrivilegedAdmissionConfig {
39691 /// The customer allowlist Cloud Storage paths for the cluster. These paths are
39692 /// used with the `--autopilot-privileged-admission` flag to authorize
39693 /// privileged workloads in Autopilot clusters.
39694 ///
39695 /// Paths can be GKE-owned, in the format
39696 /// `gke://<partner_name>/<app_name>/<allowlist_path>`, or customer-owned, in
39697 /// the format `gs://<bucket_name>/<allowlist_path>`.
39698 ///
39699 /// Wildcards (`*`) are supported to authorize all allowlists under specific
39700 /// paths or directories. Example: `gs://my-bucket/*` will authorize all
39701 /// allowlists under the `my-bucket` bucket.
39702 pub allowlist_paths: std::vec::Vec<std::string::String>,
39703
39704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39705}
39706
39707impl PrivilegedAdmissionConfig {
39708 /// Creates a new default instance.
39709 pub fn new() -> Self {
39710 std::default::Default::default()
39711 }
39712
39713 /// Sets the value of [allowlist_paths][crate::model::PrivilegedAdmissionConfig::allowlist_paths].
39714 ///
39715 /// # Example
39716 /// ```ignore,no_run
39717 /// # use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
39718 /// let x = PrivilegedAdmissionConfig::new().set_allowlist_paths(["a", "b", "c"]);
39719 /// ```
39720 pub fn set_allowlist_paths<T, V>(mut self, v: T) -> Self
39721 where
39722 T: std::iter::IntoIterator<Item = V>,
39723 V: std::convert::Into<std::string::String>,
39724 {
39725 use std::iter::Iterator;
39726 self.allowlist_paths = v.into_iter().map(|i| i.into()).collect();
39727 self
39728 }
39729}
39730
39731impl wkt::message::Message for PrivilegedAdmissionConfig {
39732 fn typename() -> &'static str {
39733 "type.googleapis.com/google.container.v1.PrivilegedAdmissionConfig"
39734 }
39735}
39736
39737/// WorkloadPolicyConfig is the configuration related to GCW workload policy
39738#[derive(Clone, Default, PartialEq)]
39739#[non_exhaustive]
39740pub struct WorkloadPolicyConfig {
39741 /// If true, workloads can use NET_ADMIN capability.
39742 pub allow_net_admin: std::option::Option<bool>,
39743
39744 /// If true, enables the GCW Auditor that audits workloads on
39745 /// standard clusters.
39746 pub autopilot_compatibility_auditing_enabled: std::option::Option<bool>,
39747
39748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39749}
39750
39751impl WorkloadPolicyConfig {
39752 /// Creates a new default instance.
39753 pub fn new() -> Self {
39754 std::default::Default::default()
39755 }
39756
39757 /// Sets the value of [allow_net_admin][crate::model::WorkloadPolicyConfig::allow_net_admin].
39758 ///
39759 /// # Example
39760 /// ```ignore,no_run
39761 /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
39762 /// let x = WorkloadPolicyConfig::new().set_allow_net_admin(true);
39763 /// ```
39764 pub fn set_allow_net_admin<T>(mut self, v: T) -> Self
39765 where
39766 T: std::convert::Into<bool>,
39767 {
39768 self.allow_net_admin = std::option::Option::Some(v.into());
39769 self
39770 }
39771
39772 /// Sets or clears the value of [allow_net_admin][crate::model::WorkloadPolicyConfig::allow_net_admin].
39773 ///
39774 /// # Example
39775 /// ```ignore,no_run
39776 /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
39777 /// let x = WorkloadPolicyConfig::new().set_or_clear_allow_net_admin(Some(false));
39778 /// let x = WorkloadPolicyConfig::new().set_or_clear_allow_net_admin(None::<bool>);
39779 /// ```
39780 pub fn set_or_clear_allow_net_admin<T>(mut self, v: std::option::Option<T>) -> Self
39781 where
39782 T: std::convert::Into<bool>,
39783 {
39784 self.allow_net_admin = v.map(|x| x.into());
39785 self
39786 }
39787
39788 /// Sets the value of [autopilot_compatibility_auditing_enabled][crate::model::WorkloadPolicyConfig::autopilot_compatibility_auditing_enabled].
39789 ///
39790 /// # Example
39791 /// ```ignore,no_run
39792 /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
39793 /// let x = WorkloadPolicyConfig::new().set_autopilot_compatibility_auditing_enabled(true);
39794 /// ```
39795 pub fn set_autopilot_compatibility_auditing_enabled<T>(mut self, v: T) -> Self
39796 where
39797 T: std::convert::Into<bool>,
39798 {
39799 self.autopilot_compatibility_auditing_enabled = std::option::Option::Some(v.into());
39800 self
39801 }
39802
39803 /// Sets or clears the value of [autopilot_compatibility_auditing_enabled][crate::model::WorkloadPolicyConfig::autopilot_compatibility_auditing_enabled].
39804 ///
39805 /// # Example
39806 /// ```ignore,no_run
39807 /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
39808 /// let x = WorkloadPolicyConfig::new().set_or_clear_autopilot_compatibility_auditing_enabled(Some(false));
39809 /// let x = WorkloadPolicyConfig::new().set_or_clear_autopilot_compatibility_auditing_enabled(None::<bool>);
39810 /// ```
39811 pub fn set_or_clear_autopilot_compatibility_auditing_enabled<T>(
39812 mut self,
39813 v: std::option::Option<T>,
39814 ) -> Self
39815 where
39816 T: std::convert::Into<bool>,
39817 {
39818 self.autopilot_compatibility_auditing_enabled = v.map(|x| x.into());
39819 self
39820 }
39821}
39822
39823impl wkt::message::Message for WorkloadPolicyConfig {
39824 fn typename() -> &'static str {
39825 "type.googleapis.com/google.container.v1.WorkloadPolicyConfig"
39826 }
39827}
39828
39829/// LoggingConfig is cluster logging configuration.
39830#[derive(Clone, Default, PartialEq)]
39831#[non_exhaustive]
39832pub struct LoggingConfig {
39833 /// Logging components configuration
39834 pub component_config: std::option::Option<crate::model::LoggingComponentConfig>,
39835
39836 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39837}
39838
39839impl LoggingConfig {
39840 /// Creates a new default instance.
39841 pub fn new() -> Self {
39842 std::default::Default::default()
39843 }
39844
39845 /// Sets the value of [component_config][crate::model::LoggingConfig::component_config].
39846 ///
39847 /// # Example
39848 /// ```ignore,no_run
39849 /// # use google_cloud_container_v1::model::LoggingConfig;
39850 /// use google_cloud_container_v1::model::LoggingComponentConfig;
39851 /// let x = LoggingConfig::new().set_component_config(LoggingComponentConfig::default()/* use setters */);
39852 /// ```
39853 pub fn set_component_config<T>(mut self, v: T) -> Self
39854 where
39855 T: std::convert::Into<crate::model::LoggingComponentConfig>,
39856 {
39857 self.component_config = std::option::Option::Some(v.into());
39858 self
39859 }
39860
39861 /// Sets or clears the value of [component_config][crate::model::LoggingConfig::component_config].
39862 ///
39863 /// # Example
39864 /// ```ignore,no_run
39865 /// # use google_cloud_container_v1::model::LoggingConfig;
39866 /// use google_cloud_container_v1::model::LoggingComponentConfig;
39867 /// let x = LoggingConfig::new().set_or_clear_component_config(Some(LoggingComponentConfig::default()/* use setters */));
39868 /// let x = LoggingConfig::new().set_or_clear_component_config(None::<LoggingComponentConfig>);
39869 /// ```
39870 pub fn set_or_clear_component_config<T>(mut self, v: std::option::Option<T>) -> Self
39871 where
39872 T: std::convert::Into<crate::model::LoggingComponentConfig>,
39873 {
39874 self.component_config = v.map(|x| x.into());
39875 self
39876 }
39877}
39878
39879impl wkt::message::Message for LoggingConfig {
39880 fn typename() -> &'static str {
39881 "type.googleapis.com/google.container.v1.LoggingConfig"
39882 }
39883}
39884
39885/// LoggingComponentConfig is cluster logging component configuration.
39886#[derive(Clone, Default, PartialEq)]
39887#[non_exhaustive]
39888pub struct LoggingComponentConfig {
39889 /// Select components to collect logs. An empty set would disable all logging.
39890 pub enable_components: std::vec::Vec<crate::model::logging_component_config::Component>,
39891
39892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39893}
39894
39895impl LoggingComponentConfig {
39896 /// Creates a new default instance.
39897 pub fn new() -> Self {
39898 std::default::Default::default()
39899 }
39900
39901 /// Sets the value of [enable_components][crate::model::LoggingComponentConfig::enable_components].
39902 ///
39903 /// # Example
39904 /// ```ignore,no_run
39905 /// # use google_cloud_container_v1::model::LoggingComponentConfig;
39906 /// use google_cloud_container_v1::model::logging_component_config::Component;
39907 /// let x = LoggingComponentConfig::new().set_enable_components([
39908 /// Component::SystemComponents,
39909 /// Component::Workloads,
39910 /// Component::Apiserver,
39911 /// ]);
39912 /// ```
39913 pub fn set_enable_components<T, V>(mut self, v: T) -> Self
39914 where
39915 T: std::iter::IntoIterator<Item = V>,
39916 V: std::convert::Into<crate::model::logging_component_config::Component>,
39917 {
39918 use std::iter::Iterator;
39919 self.enable_components = v.into_iter().map(|i| i.into()).collect();
39920 self
39921 }
39922}
39923
39924impl wkt::message::Message for LoggingComponentConfig {
39925 fn typename() -> &'static str {
39926 "type.googleapis.com/google.container.v1.LoggingComponentConfig"
39927 }
39928}
39929
39930/// Defines additional types related to [LoggingComponentConfig].
39931pub mod logging_component_config {
39932 #[allow(unused_imports)]
39933 use super::*;
39934
39935 /// GKE components exposing logs
39936 ///
39937 /// # Working with unknown values
39938 ///
39939 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39940 /// additional enum variants at any time. Adding new variants is not considered
39941 /// a breaking change. Applications should write their code in anticipation of:
39942 ///
39943 /// - New values appearing in future releases of the client library, **and**
39944 /// - New values received dynamically, without application changes.
39945 ///
39946 /// Please consult the [Working with enums] section in the user guide for some
39947 /// guidelines.
39948 ///
39949 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
39950 #[derive(Clone, Debug, PartialEq)]
39951 #[non_exhaustive]
39952 pub enum Component {
39953 /// Default value. This shouldn't be used.
39954 Unspecified,
39955 /// system components
39956 SystemComponents,
39957 /// workloads
39958 Workloads,
39959 /// kube-apiserver
39960 Apiserver,
39961 /// kube-scheduler
39962 Scheduler,
39963 /// kube-controller-manager
39964 ControllerManager,
39965 /// kcp-sshd
39966 KcpSshd,
39967 /// kcp connection logs
39968 KcpConnection,
39969 /// horizontal pod autoscaler decision logs
39970 KcpHpa,
39971 /// If set, the enum was initialized with an unknown value.
39972 ///
39973 /// Applications can examine the value using [Component::value] or
39974 /// [Component::name].
39975 UnknownValue(component::UnknownValue),
39976 }
39977
39978 #[doc(hidden)]
39979 pub mod component {
39980 #[allow(unused_imports)]
39981 use super::*;
39982 #[derive(Clone, Debug, PartialEq)]
39983 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39984 }
39985
39986 impl Component {
39987 /// Gets the enum value.
39988 ///
39989 /// Returns `None` if the enum contains an unknown value deserialized from
39990 /// the string representation of enums.
39991 pub fn value(&self) -> std::option::Option<i32> {
39992 match self {
39993 Self::Unspecified => std::option::Option::Some(0),
39994 Self::SystemComponents => std::option::Option::Some(1),
39995 Self::Workloads => std::option::Option::Some(2),
39996 Self::Apiserver => std::option::Option::Some(3),
39997 Self::Scheduler => std::option::Option::Some(4),
39998 Self::ControllerManager => std::option::Option::Some(5),
39999 Self::KcpSshd => std::option::Option::Some(7),
40000 Self::KcpConnection => std::option::Option::Some(8),
40001 Self::KcpHpa => std::option::Option::Some(9),
40002 Self::UnknownValue(u) => u.0.value(),
40003 }
40004 }
40005
40006 /// Gets the enum value as a string.
40007 ///
40008 /// Returns `None` if the enum contains an unknown value deserialized from
40009 /// the integer representation of enums.
40010 pub fn name(&self) -> std::option::Option<&str> {
40011 match self {
40012 Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
40013 Self::SystemComponents => std::option::Option::Some("SYSTEM_COMPONENTS"),
40014 Self::Workloads => std::option::Option::Some("WORKLOADS"),
40015 Self::Apiserver => std::option::Option::Some("APISERVER"),
40016 Self::Scheduler => std::option::Option::Some("SCHEDULER"),
40017 Self::ControllerManager => std::option::Option::Some("CONTROLLER_MANAGER"),
40018 Self::KcpSshd => std::option::Option::Some("KCP_SSHD"),
40019 Self::KcpConnection => std::option::Option::Some("KCP_CONNECTION"),
40020 Self::KcpHpa => std::option::Option::Some("KCP_HPA"),
40021 Self::UnknownValue(u) => u.0.name(),
40022 }
40023 }
40024 }
40025
40026 impl std::default::Default for Component {
40027 fn default() -> Self {
40028 use std::convert::From;
40029 Self::from(0)
40030 }
40031 }
40032
40033 impl std::fmt::Display for Component {
40034 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
40035 wkt::internal::display_enum(f, self.name(), self.value())
40036 }
40037 }
40038
40039 impl std::convert::From<i32> for Component {
40040 fn from(value: i32) -> Self {
40041 match value {
40042 0 => Self::Unspecified,
40043 1 => Self::SystemComponents,
40044 2 => Self::Workloads,
40045 3 => Self::Apiserver,
40046 4 => Self::Scheduler,
40047 5 => Self::ControllerManager,
40048 7 => Self::KcpSshd,
40049 8 => Self::KcpConnection,
40050 9 => Self::KcpHpa,
40051 _ => Self::UnknownValue(component::UnknownValue(
40052 wkt::internal::UnknownEnumValue::Integer(value),
40053 )),
40054 }
40055 }
40056 }
40057
40058 impl std::convert::From<&str> for Component {
40059 fn from(value: &str) -> Self {
40060 use std::string::ToString;
40061 match value {
40062 "COMPONENT_UNSPECIFIED" => Self::Unspecified,
40063 "SYSTEM_COMPONENTS" => Self::SystemComponents,
40064 "WORKLOADS" => Self::Workloads,
40065 "APISERVER" => Self::Apiserver,
40066 "SCHEDULER" => Self::Scheduler,
40067 "CONTROLLER_MANAGER" => Self::ControllerManager,
40068 "KCP_SSHD" => Self::KcpSshd,
40069 "KCP_CONNECTION" => Self::KcpConnection,
40070 "KCP_HPA" => Self::KcpHpa,
40071 _ => Self::UnknownValue(component::UnknownValue(
40072 wkt::internal::UnknownEnumValue::String(value.to_string()),
40073 )),
40074 }
40075 }
40076 }
40077
40078 impl serde::ser::Serialize for Component {
40079 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
40080 where
40081 S: serde::Serializer,
40082 {
40083 match self {
40084 Self::Unspecified => serializer.serialize_i32(0),
40085 Self::SystemComponents => serializer.serialize_i32(1),
40086 Self::Workloads => serializer.serialize_i32(2),
40087 Self::Apiserver => serializer.serialize_i32(3),
40088 Self::Scheduler => serializer.serialize_i32(4),
40089 Self::ControllerManager => serializer.serialize_i32(5),
40090 Self::KcpSshd => serializer.serialize_i32(7),
40091 Self::KcpConnection => serializer.serialize_i32(8),
40092 Self::KcpHpa => serializer.serialize_i32(9),
40093 Self::UnknownValue(u) => u.0.serialize(serializer),
40094 }
40095 }
40096 }
40097
40098 impl<'de> serde::de::Deserialize<'de> for Component {
40099 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
40100 where
40101 D: serde::Deserializer<'de>,
40102 {
40103 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
40104 ".google.container.v1.LoggingComponentConfig.Component",
40105 ))
40106 }
40107 }
40108}
40109
40110/// RayClusterLoggingConfig specifies configuration of Ray logging.
40111#[derive(Clone, Default, PartialEq)]
40112#[non_exhaustive]
40113pub struct RayClusterLoggingConfig {
40114 /// Enable log collection for Ray clusters.
40115 pub enabled: bool,
40116
40117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40118}
40119
40120impl RayClusterLoggingConfig {
40121 /// Creates a new default instance.
40122 pub fn new() -> Self {
40123 std::default::Default::default()
40124 }
40125
40126 /// Sets the value of [enabled][crate::model::RayClusterLoggingConfig::enabled].
40127 ///
40128 /// # Example
40129 /// ```ignore,no_run
40130 /// # use google_cloud_container_v1::model::RayClusterLoggingConfig;
40131 /// let x = RayClusterLoggingConfig::new().set_enabled(true);
40132 /// ```
40133 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
40134 self.enabled = v.into();
40135 self
40136 }
40137}
40138
40139impl wkt::message::Message for RayClusterLoggingConfig {
40140 fn typename() -> &'static str {
40141 "type.googleapis.com/google.container.v1.RayClusterLoggingConfig"
40142 }
40143}
40144
40145/// MonitoringConfig is cluster monitoring configuration.
40146#[derive(Clone, Default, PartialEq)]
40147#[non_exhaustive]
40148pub struct MonitoringConfig {
40149 /// Monitoring components configuration
40150 pub component_config: std::option::Option<crate::model::MonitoringComponentConfig>,
40151
40152 /// Enable Google Cloud Managed Service for Prometheus
40153 /// in the cluster.
40154 pub managed_prometheus_config: std::option::Option<crate::model::ManagedPrometheusConfig>,
40155
40156 /// Configuration of Advanced Datapath Observability features.
40157 pub advanced_datapath_observability_config:
40158 std::option::Option<crate::model::AdvancedDatapathObservabilityConfig>,
40159
40160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40161}
40162
40163impl MonitoringConfig {
40164 /// Creates a new default instance.
40165 pub fn new() -> Self {
40166 std::default::Default::default()
40167 }
40168
40169 /// Sets the value of [component_config][crate::model::MonitoringConfig::component_config].
40170 ///
40171 /// # Example
40172 /// ```ignore,no_run
40173 /// # use google_cloud_container_v1::model::MonitoringConfig;
40174 /// use google_cloud_container_v1::model::MonitoringComponentConfig;
40175 /// let x = MonitoringConfig::new().set_component_config(MonitoringComponentConfig::default()/* use setters */);
40176 /// ```
40177 pub fn set_component_config<T>(mut self, v: T) -> Self
40178 where
40179 T: std::convert::Into<crate::model::MonitoringComponentConfig>,
40180 {
40181 self.component_config = std::option::Option::Some(v.into());
40182 self
40183 }
40184
40185 /// Sets or clears the value of [component_config][crate::model::MonitoringConfig::component_config].
40186 ///
40187 /// # Example
40188 /// ```ignore,no_run
40189 /// # use google_cloud_container_v1::model::MonitoringConfig;
40190 /// use google_cloud_container_v1::model::MonitoringComponentConfig;
40191 /// let x = MonitoringConfig::new().set_or_clear_component_config(Some(MonitoringComponentConfig::default()/* use setters */));
40192 /// let x = MonitoringConfig::new().set_or_clear_component_config(None::<MonitoringComponentConfig>);
40193 /// ```
40194 pub fn set_or_clear_component_config<T>(mut self, v: std::option::Option<T>) -> Self
40195 where
40196 T: std::convert::Into<crate::model::MonitoringComponentConfig>,
40197 {
40198 self.component_config = v.map(|x| x.into());
40199 self
40200 }
40201
40202 /// Sets the value of [managed_prometheus_config][crate::model::MonitoringConfig::managed_prometheus_config].
40203 ///
40204 /// # Example
40205 /// ```ignore,no_run
40206 /// # use google_cloud_container_v1::model::MonitoringConfig;
40207 /// use google_cloud_container_v1::model::ManagedPrometheusConfig;
40208 /// let x = MonitoringConfig::new().set_managed_prometheus_config(ManagedPrometheusConfig::default()/* use setters */);
40209 /// ```
40210 pub fn set_managed_prometheus_config<T>(mut self, v: T) -> Self
40211 where
40212 T: std::convert::Into<crate::model::ManagedPrometheusConfig>,
40213 {
40214 self.managed_prometheus_config = std::option::Option::Some(v.into());
40215 self
40216 }
40217
40218 /// Sets or clears the value of [managed_prometheus_config][crate::model::MonitoringConfig::managed_prometheus_config].
40219 ///
40220 /// # Example
40221 /// ```ignore,no_run
40222 /// # use google_cloud_container_v1::model::MonitoringConfig;
40223 /// use google_cloud_container_v1::model::ManagedPrometheusConfig;
40224 /// let x = MonitoringConfig::new().set_or_clear_managed_prometheus_config(Some(ManagedPrometheusConfig::default()/* use setters */));
40225 /// let x = MonitoringConfig::new().set_or_clear_managed_prometheus_config(None::<ManagedPrometheusConfig>);
40226 /// ```
40227 pub fn set_or_clear_managed_prometheus_config<T>(mut self, v: std::option::Option<T>) -> Self
40228 where
40229 T: std::convert::Into<crate::model::ManagedPrometheusConfig>,
40230 {
40231 self.managed_prometheus_config = v.map(|x| x.into());
40232 self
40233 }
40234
40235 /// Sets the value of [advanced_datapath_observability_config][crate::model::MonitoringConfig::advanced_datapath_observability_config].
40236 ///
40237 /// # Example
40238 /// ```ignore,no_run
40239 /// # use google_cloud_container_v1::model::MonitoringConfig;
40240 /// use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40241 /// let x = MonitoringConfig::new().set_advanced_datapath_observability_config(AdvancedDatapathObservabilityConfig::default()/* use setters */);
40242 /// ```
40243 pub fn set_advanced_datapath_observability_config<T>(mut self, v: T) -> Self
40244 where
40245 T: std::convert::Into<crate::model::AdvancedDatapathObservabilityConfig>,
40246 {
40247 self.advanced_datapath_observability_config = std::option::Option::Some(v.into());
40248 self
40249 }
40250
40251 /// Sets or clears the value of [advanced_datapath_observability_config][crate::model::MonitoringConfig::advanced_datapath_observability_config].
40252 ///
40253 /// # Example
40254 /// ```ignore,no_run
40255 /// # use google_cloud_container_v1::model::MonitoringConfig;
40256 /// use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40257 /// let x = MonitoringConfig::new().set_or_clear_advanced_datapath_observability_config(Some(AdvancedDatapathObservabilityConfig::default()/* use setters */));
40258 /// let x = MonitoringConfig::new().set_or_clear_advanced_datapath_observability_config(None::<AdvancedDatapathObservabilityConfig>);
40259 /// ```
40260 pub fn set_or_clear_advanced_datapath_observability_config<T>(
40261 mut self,
40262 v: std::option::Option<T>,
40263 ) -> Self
40264 where
40265 T: std::convert::Into<crate::model::AdvancedDatapathObservabilityConfig>,
40266 {
40267 self.advanced_datapath_observability_config = v.map(|x| x.into());
40268 self
40269 }
40270}
40271
40272impl wkt::message::Message for MonitoringConfig {
40273 fn typename() -> &'static str {
40274 "type.googleapis.com/google.container.v1.MonitoringConfig"
40275 }
40276}
40277
40278/// AdvancedDatapathObservabilityConfig specifies configuration of observability
40279/// features of advanced datapath.
40280#[derive(Clone, Default, PartialEq)]
40281#[non_exhaustive]
40282pub struct AdvancedDatapathObservabilityConfig {
40283 /// Expose flow metrics on nodes
40284 pub enable_metrics: bool,
40285
40286 /// Method used to make Relay available
40287 pub relay_mode: crate::model::advanced_datapath_observability_config::RelayMode,
40288
40289 /// Enable Relay component
40290 pub enable_relay: std::option::Option<bool>,
40291
40292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40293}
40294
40295impl AdvancedDatapathObservabilityConfig {
40296 /// Creates a new default instance.
40297 pub fn new() -> Self {
40298 std::default::Default::default()
40299 }
40300
40301 /// Sets the value of [enable_metrics][crate::model::AdvancedDatapathObservabilityConfig::enable_metrics].
40302 ///
40303 /// # Example
40304 /// ```ignore,no_run
40305 /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40306 /// let x = AdvancedDatapathObservabilityConfig::new().set_enable_metrics(true);
40307 /// ```
40308 pub fn set_enable_metrics<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
40309 self.enable_metrics = v.into();
40310 self
40311 }
40312
40313 /// Sets the value of [relay_mode][crate::model::AdvancedDatapathObservabilityConfig::relay_mode].
40314 ///
40315 /// # Example
40316 /// ```ignore,no_run
40317 /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40318 /// use google_cloud_container_v1::model::advanced_datapath_observability_config::RelayMode;
40319 /// let x0 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::Disabled);
40320 /// let x1 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::InternalVpcLb);
40321 /// let x2 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::ExternalLb);
40322 /// ```
40323 pub fn set_relay_mode<
40324 T: std::convert::Into<crate::model::advanced_datapath_observability_config::RelayMode>,
40325 >(
40326 mut self,
40327 v: T,
40328 ) -> Self {
40329 self.relay_mode = v.into();
40330 self
40331 }
40332
40333 /// Sets the value of [enable_relay][crate::model::AdvancedDatapathObservabilityConfig::enable_relay].
40334 ///
40335 /// # Example
40336 /// ```ignore,no_run
40337 /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40338 /// let x = AdvancedDatapathObservabilityConfig::new().set_enable_relay(true);
40339 /// ```
40340 pub fn set_enable_relay<T>(mut self, v: T) -> Self
40341 where
40342 T: std::convert::Into<bool>,
40343 {
40344 self.enable_relay = std::option::Option::Some(v.into());
40345 self
40346 }
40347
40348 /// Sets or clears the value of [enable_relay][crate::model::AdvancedDatapathObservabilityConfig::enable_relay].
40349 ///
40350 /// # Example
40351 /// ```ignore,no_run
40352 /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
40353 /// let x = AdvancedDatapathObservabilityConfig::new().set_or_clear_enable_relay(Some(false));
40354 /// let x = AdvancedDatapathObservabilityConfig::new().set_or_clear_enable_relay(None::<bool>);
40355 /// ```
40356 pub fn set_or_clear_enable_relay<T>(mut self, v: std::option::Option<T>) -> Self
40357 where
40358 T: std::convert::Into<bool>,
40359 {
40360 self.enable_relay = v.map(|x| x.into());
40361 self
40362 }
40363}
40364
40365impl wkt::message::Message for AdvancedDatapathObservabilityConfig {
40366 fn typename() -> &'static str {
40367 "type.googleapis.com/google.container.v1.AdvancedDatapathObservabilityConfig"
40368 }
40369}
40370
40371/// Defines additional types related to [AdvancedDatapathObservabilityConfig].
40372pub mod advanced_datapath_observability_config {
40373 #[allow(unused_imports)]
40374 use super::*;
40375
40376 /// Supported Relay modes
40377 ///
40378 /// # Working with unknown values
40379 ///
40380 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
40381 /// additional enum variants at any time. Adding new variants is not considered
40382 /// a breaking change. Applications should write their code in anticipation of:
40383 ///
40384 /// - New values appearing in future releases of the client library, **and**
40385 /// - New values received dynamically, without application changes.
40386 ///
40387 /// Please consult the [Working with enums] section in the user guide for some
40388 /// guidelines.
40389 ///
40390 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
40391 #[derive(Clone, Debug, PartialEq)]
40392 #[non_exhaustive]
40393 pub enum RelayMode {
40394 /// Default value. This shouldn't be used.
40395 Unspecified,
40396 /// disabled
40397 Disabled,
40398 /// exposed via internal load balancer
40399 InternalVpcLb,
40400 /// exposed via external load balancer
40401 ExternalLb,
40402 /// If set, the enum was initialized with an unknown value.
40403 ///
40404 /// Applications can examine the value using [RelayMode::value] or
40405 /// [RelayMode::name].
40406 UnknownValue(relay_mode::UnknownValue),
40407 }
40408
40409 #[doc(hidden)]
40410 pub mod relay_mode {
40411 #[allow(unused_imports)]
40412 use super::*;
40413 #[derive(Clone, Debug, PartialEq)]
40414 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
40415 }
40416
40417 impl RelayMode {
40418 /// Gets the enum value.
40419 ///
40420 /// Returns `None` if the enum contains an unknown value deserialized from
40421 /// the string representation of enums.
40422 pub fn value(&self) -> std::option::Option<i32> {
40423 match self {
40424 Self::Unspecified => std::option::Option::Some(0),
40425 Self::Disabled => std::option::Option::Some(1),
40426 Self::InternalVpcLb => std::option::Option::Some(3),
40427 Self::ExternalLb => std::option::Option::Some(4),
40428 Self::UnknownValue(u) => u.0.value(),
40429 }
40430 }
40431
40432 /// Gets the enum value as a string.
40433 ///
40434 /// Returns `None` if the enum contains an unknown value deserialized from
40435 /// the integer representation of enums.
40436 pub fn name(&self) -> std::option::Option<&str> {
40437 match self {
40438 Self::Unspecified => std::option::Option::Some("RELAY_MODE_UNSPECIFIED"),
40439 Self::Disabled => std::option::Option::Some("DISABLED"),
40440 Self::InternalVpcLb => std::option::Option::Some("INTERNAL_VPC_LB"),
40441 Self::ExternalLb => std::option::Option::Some("EXTERNAL_LB"),
40442 Self::UnknownValue(u) => u.0.name(),
40443 }
40444 }
40445 }
40446
40447 impl std::default::Default for RelayMode {
40448 fn default() -> Self {
40449 use std::convert::From;
40450 Self::from(0)
40451 }
40452 }
40453
40454 impl std::fmt::Display for RelayMode {
40455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
40456 wkt::internal::display_enum(f, self.name(), self.value())
40457 }
40458 }
40459
40460 impl std::convert::From<i32> for RelayMode {
40461 fn from(value: i32) -> Self {
40462 match value {
40463 0 => Self::Unspecified,
40464 1 => Self::Disabled,
40465 3 => Self::InternalVpcLb,
40466 4 => Self::ExternalLb,
40467 _ => Self::UnknownValue(relay_mode::UnknownValue(
40468 wkt::internal::UnknownEnumValue::Integer(value),
40469 )),
40470 }
40471 }
40472 }
40473
40474 impl std::convert::From<&str> for RelayMode {
40475 fn from(value: &str) -> Self {
40476 use std::string::ToString;
40477 match value {
40478 "RELAY_MODE_UNSPECIFIED" => Self::Unspecified,
40479 "DISABLED" => Self::Disabled,
40480 "INTERNAL_VPC_LB" => Self::InternalVpcLb,
40481 "EXTERNAL_LB" => Self::ExternalLb,
40482 _ => Self::UnknownValue(relay_mode::UnknownValue(
40483 wkt::internal::UnknownEnumValue::String(value.to_string()),
40484 )),
40485 }
40486 }
40487 }
40488
40489 impl serde::ser::Serialize for RelayMode {
40490 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
40491 where
40492 S: serde::Serializer,
40493 {
40494 match self {
40495 Self::Unspecified => serializer.serialize_i32(0),
40496 Self::Disabled => serializer.serialize_i32(1),
40497 Self::InternalVpcLb => serializer.serialize_i32(3),
40498 Self::ExternalLb => serializer.serialize_i32(4),
40499 Self::UnknownValue(u) => u.0.serialize(serializer),
40500 }
40501 }
40502 }
40503
40504 impl<'de> serde::de::Deserialize<'de> for RelayMode {
40505 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
40506 where
40507 D: serde::Deserializer<'de>,
40508 {
40509 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelayMode>::new(
40510 ".google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode",
40511 ))
40512 }
40513 }
40514}
40515
40516/// RayClusterMonitoringConfig specifies monitoring configuration for Ray
40517/// clusters.
40518#[derive(Clone, Default, PartialEq)]
40519#[non_exhaustive]
40520pub struct RayClusterMonitoringConfig {
40521 /// Enable metrics collection for Ray clusters.
40522 pub enabled: bool,
40523
40524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40525}
40526
40527impl RayClusterMonitoringConfig {
40528 /// Creates a new default instance.
40529 pub fn new() -> Self {
40530 std::default::Default::default()
40531 }
40532
40533 /// Sets the value of [enabled][crate::model::RayClusterMonitoringConfig::enabled].
40534 ///
40535 /// # Example
40536 /// ```ignore,no_run
40537 /// # use google_cloud_container_v1::model::RayClusterMonitoringConfig;
40538 /// let x = RayClusterMonitoringConfig::new().set_enabled(true);
40539 /// ```
40540 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
40541 self.enabled = v.into();
40542 self
40543 }
40544}
40545
40546impl wkt::message::Message for RayClusterMonitoringConfig {
40547 fn typename() -> &'static str {
40548 "type.googleapis.com/google.container.v1.RayClusterMonitoringConfig"
40549 }
40550}
40551
40552/// NodePoolLoggingConfig specifies logging configuration for node pools.
40553#[derive(Clone, Default, PartialEq)]
40554#[non_exhaustive]
40555pub struct NodePoolLoggingConfig {
40556 /// Logging variant configuration.
40557 pub variant_config: std::option::Option<crate::model::LoggingVariantConfig>,
40558
40559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40560}
40561
40562impl NodePoolLoggingConfig {
40563 /// Creates a new default instance.
40564 pub fn new() -> Self {
40565 std::default::Default::default()
40566 }
40567
40568 /// Sets the value of [variant_config][crate::model::NodePoolLoggingConfig::variant_config].
40569 ///
40570 /// # Example
40571 /// ```ignore,no_run
40572 /// # use google_cloud_container_v1::model::NodePoolLoggingConfig;
40573 /// use google_cloud_container_v1::model::LoggingVariantConfig;
40574 /// let x = NodePoolLoggingConfig::new().set_variant_config(LoggingVariantConfig::default()/* use setters */);
40575 /// ```
40576 pub fn set_variant_config<T>(mut self, v: T) -> Self
40577 where
40578 T: std::convert::Into<crate::model::LoggingVariantConfig>,
40579 {
40580 self.variant_config = std::option::Option::Some(v.into());
40581 self
40582 }
40583
40584 /// Sets or clears the value of [variant_config][crate::model::NodePoolLoggingConfig::variant_config].
40585 ///
40586 /// # Example
40587 /// ```ignore,no_run
40588 /// # use google_cloud_container_v1::model::NodePoolLoggingConfig;
40589 /// use google_cloud_container_v1::model::LoggingVariantConfig;
40590 /// let x = NodePoolLoggingConfig::new().set_or_clear_variant_config(Some(LoggingVariantConfig::default()/* use setters */));
40591 /// let x = NodePoolLoggingConfig::new().set_or_clear_variant_config(None::<LoggingVariantConfig>);
40592 /// ```
40593 pub fn set_or_clear_variant_config<T>(mut self, v: std::option::Option<T>) -> Self
40594 where
40595 T: std::convert::Into<crate::model::LoggingVariantConfig>,
40596 {
40597 self.variant_config = v.map(|x| x.into());
40598 self
40599 }
40600}
40601
40602impl wkt::message::Message for NodePoolLoggingConfig {
40603 fn typename() -> &'static str {
40604 "type.googleapis.com/google.container.v1.NodePoolLoggingConfig"
40605 }
40606}
40607
40608/// LoggingVariantConfig specifies the behaviour of the logging component.
40609#[derive(Clone, Default, PartialEq)]
40610#[non_exhaustive]
40611pub struct LoggingVariantConfig {
40612 /// Logging variant deployed on nodes.
40613 pub variant: crate::model::logging_variant_config::Variant,
40614
40615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40616}
40617
40618impl LoggingVariantConfig {
40619 /// Creates a new default instance.
40620 pub fn new() -> Self {
40621 std::default::Default::default()
40622 }
40623
40624 /// Sets the value of [variant][crate::model::LoggingVariantConfig::variant].
40625 ///
40626 /// # Example
40627 /// ```ignore,no_run
40628 /// # use google_cloud_container_v1::model::LoggingVariantConfig;
40629 /// use google_cloud_container_v1::model::logging_variant_config::Variant;
40630 /// let x0 = LoggingVariantConfig::new().set_variant(Variant::Default);
40631 /// let x1 = LoggingVariantConfig::new().set_variant(Variant::MaxThroughput);
40632 /// ```
40633 pub fn set_variant<T: std::convert::Into<crate::model::logging_variant_config::Variant>>(
40634 mut self,
40635 v: T,
40636 ) -> Self {
40637 self.variant = v.into();
40638 self
40639 }
40640}
40641
40642impl wkt::message::Message for LoggingVariantConfig {
40643 fn typename() -> &'static str {
40644 "type.googleapis.com/google.container.v1.LoggingVariantConfig"
40645 }
40646}
40647
40648/// Defines additional types related to [LoggingVariantConfig].
40649pub mod logging_variant_config {
40650 #[allow(unused_imports)]
40651 use super::*;
40652
40653 /// Logging component variants.
40654 ///
40655 /// # Working with unknown values
40656 ///
40657 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
40658 /// additional enum variants at any time. Adding new variants is not considered
40659 /// a breaking change. Applications should write their code in anticipation of:
40660 ///
40661 /// - New values appearing in future releases of the client library, **and**
40662 /// - New values received dynamically, without application changes.
40663 ///
40664 /// Please consult the [Working with enums] section in the user guide for some
40665 /// guidelines.
40666 ///
40667 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
40668 #[derive(Clone, Debug, PartialEq)]
40669 #[non_exhaustive]
40670 pub enum Variant {
40671 /// Default value. This shouldn't be used.
40672 Unspecified,
40673 /// default logging variant.
40674 Default,
40675 /// maximum logging throughput variant.
40676 MaxThroughput,
40677 /// If set, the enum was initialized with an unknown value.
40678 ///
40679 /// Applications can examine the value using [Variant::value] or
40680 /// [Variant::name].
40681 UnknownValue(variant::UnknownValue),
40682 }
40683
40684 #[doc(hidden)]
40685 pub mod variant {
40686 #[allow(unused_imports)]
40687 use super::*;
40688 #[derive(Clone, Debug, PartialEq)]
40689 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
40690 }
40691
40692 impl Variant {
40693 /// Gets the enum value.
40694 ///
40695 /// Returns `None` if the enum contains an unknown value deserialized from
40696 /// the string representation of enums.
40697 pub fn value(&self) -> std::option::Option<i32> {
40698 match self {
40699 Self::Unspecified => std::option::Option::Some(0),
40700 Self::Default => std::option::Option::Some(1),
40701 Self::MaxThroughput => std::option::Option::Some(2),
40702 Self::UnknownValue(u) => u.0.value(),
40703 }
40704 }
40705
40706 /// Gets the enum value as a string.
40707 ///
40708 /// Returns `None` if the enum contains an unknown value deserialized from
40709 /// the integer representation of enums.
40710 pub fn name(&self) -> std::option::Option<&str> {
40711 match self {
40712 Self::Unspecified => std::option::Option::Some("VARIANT_UNSPECIFIED"),
40713 Self::Default => std::option::Option::Some("DEFAULT"),
40714 Self::MaxThroughput => std::option::Option::Some("MAX_THROUGHPUT"),
40715 Self::UnknownValue(u) => u.0.name(),
40716 }
40717 }
40718 }
40719
40720 impl std::default::Default for Variant {
40721 fn default() -> Self {
40722 use std::convert::From;
40723 Self::from(0)
40724 }
40725 }
40726
40727 impl std::fmt::Display for Variant {
40728 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
40729 wkt::internal::display_enum(f, self.name(), self.value())
40730 }
40731 }
40732
40733 impl std::convert::From<i32> for Variant {
40734 fn from(value: i32) -> Self {
40735 match value {
40736 0 => Self::Unspecified,
40737 1 => Self::Default,
40738 2 => Self::MaxThroughput,
40739 _ => Self::UnknownValue(variant::UnknownValue(
40740 wkt::internal::UnknownEnumValue::Integer(value),
40741 )),
40742 }
40743 }
40744 }
40745
40746 impl std::convert::From<&str> for Variant {
40747 fn from(value: &str) -> Self {
40748 use std::string::ToString;
40749 match value {
40750 "VARIANT_UNSPECIFIED" => Self::Unspecified,
40751 "DEFAULT" => Self::Default,
40752 "MAX_THROUGHPUT" => Self::MaxThroughput,
40753 _ => Self::UnknownValue(variant::UnknownValue(
40754 wkt::internal::UnknownEnumValue::String(value.to_string()),
40755 )),
40756 }
40757 }
40758 }
40759
40760 impl serde::ser::Serialize for Variant {
40761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
40762 where
40763 S: serde::Serializer,
40764 {
40765 match self {
40766 Self::Unspecified => serializer.serialize_i32(0),
40767 Self::Default => serializer.serialize_i32(1),
40768 Self::MaxThroughput => serializer.serialize_i32(2),
40769 Self::UnknownValue(u) => u.0.serialize(serializer),
40770 }
40771 }
40772 }
40773
40774 impl<'de> serde::de::Deserialize<'de> for Variant {
40775 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
40776 where
40777 D: serde::Deserializer<'de>,
40778 {
40779 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Variant>::new(
40780 ".google.container.v1.LoggingVariantConfig.Variant",
40781 ))
40782 }
40783 }
40784}
40785
40786/// MonitoringComponentConfig is cluster monitoring component configuration.
40787#[derive(Clone, Default, PartialEq)]
40788#[non_exhaustive]
40789pub struct MonitoringComponentConfig {
40790 /// Select components to collect metrics. An empty set would disable all
40791 /// monitoring.
40792 pub enable_components: std::vec::Vec<crate::model::monitoring_component_config::Component>,
40793
40794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
40795}
40796
40797impl MonitoringComponentConfig {
40798 /// Creates a new default instance.
40799 pub fn new() -> Self {
40800 std::default::Default::default()
40801 }
40802
40803 /// Sets the value of [enable_components][crate::model::MonitoringComponentConfig::enable_components].
40804 ///
40805 /// # Example
40806 /// ```ignore,no_run
40807 /// # use google_cloud_container_v1::model::MonitoringComponentConfig;
40808 /// use google_cloud_container_v1::model::monitoring_component_config::Component;
40809 /// let x = MonitoringComponentConfig::new().set_enable_components([
40810 /// Component::SystemComponents,
40811 /// Component::Apiserver,
40812 /// Component::Scheduler,
40813 /// ]);
40814 /// ```
40815 pub fn set_enable_components<T, V>(mut self, v: T) -> Self
40816 where
40817 T: std::iter::IntoIterator<Item = V>,
40818 V: std::convert::Into<crate::model::monitoring_component_config::Component>,
40819 {
40820 use std::iter::Iterator;
40821 self.enable_components = v.into_iter().map(|i| i.into()).collect();
40822 self
40823 }
40824}
40825
40826impl wkt::message::Message for MonitoringComponentConfig {
40827 fn typename() -> &'static str {
40828 "type.googleapis.com/google.container.v1.MonitoringComponentConfig"
40829 }
40830}
40831
40832/// Defines additional types related to [MonitoringComponentConfig].
40833pub mod monitoring_component_config {
40834 #[allow(unused_imports)]
40835 use super::*;
40836
40837 /// GKE components exposing metrics
40838 ///
40839 /// # Working with unknown values
40840 ///
40841 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
40842 /// additional enum variants at any time. Adding new variants is not considered
40843 /// a breaking change. Applications should write their code in anticipation of:
40844 ///
40845 /// - New values appearing in future releases of the client library, **and**
40846 /// - New values received dynamically, without application changes.
40847 ///
40848 /// Please consult the [Working with enums] section in the user guide for some
40849 /// guidelines.
40850 ///
40851 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
40852 #[derive(Clone, Debug, PartialEq)]
40853 #[non_exhaustive]
40854 pub enum Component {
40855 /// Default value. This shouldn't be used.
40856 Unspecified,
40857 /// system components
40858 SystemComponents,
40859 /// kube-apiserver
40860 Apiserver,
40861 /// kube-scheduler
40862 Scheduler,
40863 /// kube-controller-manager
40864 ControllerManager,
40865 /// Storage
40866 Storage,
40867 /// Horizontal Pod Autoscaling
40868 Hpa,
40869 /// Pod
40870 Pod,
40871 /// DaemonSet
40872 Daemonset,
40873 /// Deployment
40874 Deployment,
40875 /// Statefulset
40876 Statefulset,
40877 /// CADVISOR
40878 Cadvisor,
40879 /// KUBELET
40880 Kubelet,
40881 /// NVIDIA Data Center GPU Manager (DCGM)
40882 Dcgm,
40883 /// JobSet
40884 Jobset,
40885 /// If set, the enum was initialized with an unknown value.
40886 ///
40887 /// Applications can examine the value using [Component::value] or
40888 /// [Component::name].
40889 UnknownValue(component::UnknownValue),
40890 }
40891
40892 #[doc(hidden)]
40893 pub mod component {
40894 #[allow(unused_imports)]
40895 use super::*;
40896 #[derive(Clone, Debug, PartialEq)]
40897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
40898 }
40899
40900 impl Component {
40901 /// Gets the enum value.
40902 ///
40903 /// Returns `None` if the enum contains an unknown value deserialized from
40904 /// the string representation of enums.
40905 pub fn value(&self) -> std::option::Option<i32> {
40906 match self {
40907 Self::Unspecified => std::option::Option::Some(0),
40908 Self::SystemComponents => std::option::Option::Some(1),
40909 Self::Apiserver => std::option::Option::Some(3),
40910 Self::Scheduler => std::option::Option::Some(4),
40911 Self::ControllerManager => std::option::Option::Some(5),
40912 Self::Storage => std::option::Option::Some(7),
40913 Self::Hpa => std::option::Option::Some(8),
40914 Self::Pod => std::option::Option::Some(9),
40915 Self::Daemonset => std::option::Option::Some(10),
40916 Self::Deployment => std::option::Option::Some(11),
40917 Self::Statefulset => std::option::Option::Some(12),
40918 Self::Cadvisor => std::option::Option::Some(13),
40919 Self::Kubelet => std::option::Option::Some(14),
40920 Self::Dcgm => std::option::Option::Some(15),
40921 Self::Jobset => std::option::Option::Some(16),
40922 Self::UnknownValue(u) => u.0.value(),
40923 }
40924 }
40925
40926 /// Gets the enum value as a string.
40927 ///
40928 /// Returns `None` if the enum contains an unknown value deserialized from
40929 /// the integer representation of enums.
40930 pub fn name(&self) -> std::option::Option<&str> {
40931 match self {
40932 Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
40933 Self::SystemComponents => std::option::Option::Some("SYSTEM_COMPONENTS"),
40934 Self::Apiserver => std::option::Option::Some("APISERVER"),
40935 Self::Scheduler => std::option::Option::Some("SCHEDULER"),
40936 Self::ControllerManager => std::option::Option::Some("CONTROLLER_MANAGER"),
40937 Self::Storage => std::option::Option::Some("STORAGE"),
40938 Self::Hpa => std::option::Option::Some("HPA"),
40939 Self::Pod => std::option::Option::Some("POD"),
40940 Self::Daemonset => std::option::Option::Some("DAEMONSET"),
40941 Self::Deployment => std::option::Option::Some("DEPLOYMENT"),
40942 Self::Statefulset => std::option::Option::Some("STATEFULSET"),
40943 Self::Cadvisor => std::option::Option::Some("CADVISOR"),
40944 Self::Kubelet => std::option::Option::Some("KUBELET"),
40945 Self::Dcgm => std::option::Option::Some("DCGM"),
40946 Self::Jobset => std::option::Option::Some("JOBSET"),
40947 Self::UnknownValue(u) => u.0.name(),
40948 }
40949 }
40950 }
40951
40952 impl std::default::Default for Component {
40953 fn default() -> Self {
40954 use std::convert::From;
40955 Self::from(0)
40956 }
40957 }
40958
40959 impl std::fmt::Display for Component {
40960 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
40961 wkt::internal::display_enum(f, self.name(), self.value())
40962 }
40963 }
40964
40965 impl std::convert::From<i32> for Component {
40966 fn from(value: i32) -> Self {
40967 match value {
40968 0 => Self::Unspecified,
40969 1 => Self::SystemComponents,
40970 3 => Self::Apiserver,
40971 4 => Self::Scheduler,
40972 5 => Self::ControllerManager,
40973 7 => Self::Storage,
40974 8 => Self::Hpa,
40975 9 => Self::Pod,
40976 10 => Self::Daemonset,
40977 11 => Self::Deployment,
40978 12 => Self::Statefulset,
40979 13 => Self::Cadvisor,
40980 14 => Self::Kubelet,
40981 15 => Self::Dcgm,
40982 16 => Self::Jobset,
40983 _ => Self::UnknownValue(component::UnknownValue(
40984 wkt::internal::UnknownEnumValue::Integer(value),
40985 )),
40986 }
40987 }
40988 }
40989
40990 impl std::convert::From<&str> for Component {
40991 fn from(value: &str) -> Self {
40992 use std::string::ToString;
40993 match value {
40994 "COMPONENT_UNSPECIFIED" => Self::Unspecified,
40995 "SYSTEM_COMPONENTS" => Self::SystemComponents,
40996 "APISERVER" => Self::Apiserver,
40997 "SCHEDULER" => Self::Scheduler,
40998 "CONTROLLER_MANAGER" => Self::ControllerManager,
40999 "STORAGE" => Self::Storage,
41000 "HPA" => Self::Hpa,
41001 "POD" => Self::Pod,
41002 "DAEMONSET" => Self::Daemonset,
41003 "DEPLOYMENT" => Self::Deployment,
41004 "STATEFULSET" => Self::Statefulset,
41005 "CADVISOR" => Self::Cadvisor,
41006 "KUBELET" => Self::Kubelet,
41007 "DCGM" => Self::Dcgm,
41008 "JOBSET" => Self::Jobset,
41009 _ => Self::UnknownValue(component::UnknownValue(
41010 wkt::internal::UnknownEnumValue::String(value.to_string()),
41011 )),
41012 }
41013 }
41014 }
41015
41016 impl serde::ser::Serialize for Component {
41017 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
41018 where
41019 S: serde::Serializer,
41020 {
41021 match self {
41022 Self::Unspecified => serializer.serialize_i32(0),
41023 Self::SystemComponents => serializer.serialize_i32(1),
41024 Self::Apiserver => serializer.serialize_i32(3),
41025 Self::Scheduler => serializer.serialize_i32(4),
41026 Self::ControllerManager => serializer.serialize_i32(5),
41027 Self::Storage => serializer.serialize_i32(7),
41028 Self::Hpa => serializer.serialize_i32(8),
41029 Self::Pod => serializer.serialize_i32(9),
41030 Self::Daemonset => serializer.serialize_i32(10),
41031 Self::Deployment => serializer.serialize_i32(11),
41032 Self::Statefulset => serializer.serialize_i32(12),
41033 Self::Cadvisor => serializer.serialize_i32(13),
41034 Self::Kubelet => serializer.serialize_i32(14),
41035 Self::Dcgm => serializer.serialize_i32(15),
41036 Self::Jobset => serializer.serialize_i32(16),
41037 Self::UnknownValue(u) => u.0.serialize(serializer),
41038 }
41039 }
41040 }
41041
41042 impl<'de> serde::de::Deserialize<'de> for Component {
41043 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
41044 where
41045 D: serde::Deserializer<'de>,
41046 {
41047 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
41048 ".google.container.v1.MonitoringComponentConfig.Component",
41049 ))
41050 }
41051 }
41052}
41053
41054/// DataplaneV2Config is the configuration for DPv2.
41055#[derive(Clone, Default, PartialEq)]
41056#[non_exhaustive]
41057pub struct DataplaneV2Config {
41058 /// Optional. Scalability mode for the cluster.
41059 pub scalability_mode: std::option::Option<crate::model::dataplane_v_2_config::ScalabilityMode>,
41060
41061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41062}
41063
41064impl DataplaneV2Config {
41065 /// Creates a new default instance.
41066 pub fn new() -> Self {
41067 std::default::Default::default()
41068 }
41069
41070 /// Sets the value of [scalability_mode][crate::model::DataplaneV2Config::scalability_mode].
41071 ///
41072 /// # Example
41073 /// ```ignore,no_run
41074 /// # use google_cloud_container_v1::model::DataplaneV2Config;
41075 /// use google_cloud_container_v1::model::dataplane_v_2_config::ScalabilityMode;
41076 /// let x0 = DataplaneV2Config::new().set_scalability_mode(ScalabilityMode::Disabled);
41077 /// let x1 = DataplaneV2Config::new().set_scalability_mode(ScalabilityMode::ScaleOptimized);
41078 /// ```
41079 pub fn set_scalability_mode<T>(mut self, v: T) -> Self
41080 where
41081 T: std::convert::Into<crate::model::dataplane_v_2_config::ScalabilityMode>,
41082 {
41083 self.scalability_mode = std::option::Option::Some(v.into());
41084 self
41085 }
41086
41087 /// Sets or clears the value of [scalability_mode][crate::model::DataplaneV2Config::scalability_mode].
41088 ///
41089 /// # Example
41090 /// ```ignore,no_run
41091 /// # use google_cloud_container_v1::model::DataplaneV2Config;
41092 /// use google_cloud_container_v1::model::dataplane_v_2_config::ScalabilityMode;
41093 /// let x0 = DataplaneV2Config::new().set_or_clear_scalability_mode(Some(ScalabilityMode::Disabled));
41094 /// let x1 = DataplaneV2Config::new().set_or_clear_scalability_mode(Some(ScalabilityMode::ScaleOptimized));
41095 /// let x_none = DataplaneV2Config::new().set_or_clear_scalability_mode(None::<ScalabilityMode>);
41096 /// ```
41097 pub fn set_or_clear_scalability_mode<T>(mut self, v: std::option::Option<T>) -> Self
41098 where
41099 T: std::convert::Into<crate::model::dataplane_v_2_config::ScalabilityMode>,
41100 {
41101 self.scalability_mode = v.map(|x| x.into());
41102 self
41103 }
41104}
41105
41106impl wkt::message::Message for DataplaneV2Config {
41107 fn typename() -> &'static str {
41108 "type.googleapis.com/google.container.v1.DataplaneV2Config"
41109 }
41110}
41111
41112/// Defines additional types related to [DataplaneV2Config].
41113pub mod dataplane_v_2_config {
41114 #[allow(unused_imports)]
41115 use super::*;
41116
41117 /// Options on how to scale the cluster.
41118 ///
41119 /// # Working with unknown values
41120 ///
41121 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
41122 /// additional enum variants at any time. Adding new variants is not considered
41123 /// a breaking change. Applications should write their code in anticipation of:
41124 ///
41125 /// - New values appearing in future releases of the client library, **and**
41126 /// - New values received dynamically, without application changes.
41127 ///
41128 /// Please consult the [Working with enums] section in the user guide for some
41129 /// guidelines.
41130 ///
41131 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
41132 #[derive(Clone, Debug, PartialEq)]
41133 #[non_exhaustive]
41134 pub enum ScalabilityMode {
41135 /// Default value.
41136 Unspecified,
41137 /// Disables the scale optimized mode for DPv2.
41138 Disabled,
41139 /// Enables the scale optimized mode for DPv2.
41140 ScaleOptimized,
41141 /// If set, the enum was initialized with an unknown value.
41142 ///
41143 /// Applications can examine the value using [ScalabilityMode::value] or
41144 /// [ScalabilityMode::name].
41145 UnknownValue(scalability_mode::UnknownValue),
41146 }
41147
41148 #[doc(hidden)]
41149 pub mod scalability_mode {
41150 #[allow(unused_imports)]
41151 use super::*;
41152 #[derive(Clone, Debug, PartialEq)]
41153 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
41154 }
41155
41156 impl ScalabilityMode {
41157 /// Gets the enum value.
41158 ///
41159 /// Returns `None` if the enum contains an unknown value deserialized from
41160 /// the string representation of enums.
41161 pub fn value(&self) -> std::option::Option<i32> {
41162 match self {
41163 Self::Unspecified => std::option::Option::Some(0),
41164 Self::Disabled => std::option::Option::Some(3),
41165 Self::ScaleOptimized => std::option::Option::Some(4),
41166 Self::UnknownValue(u) => u.0.value(),
41167 }
41168 }
41169
41170 /// Gets the enum value as a string.
41171 ///
41172 /// Returns `None` if the enum contains an unknown value deserialized from
41173 /// the integer representation of enums.
41174 pub fn name(&self) -> std::option::Option<&str> {
41175 match self {
41176 Self::Unspecified => std::option::Option::Some("SCALABILITY_MODE_UNSPECIFIED"),
41177 Self::Disabled => std::option::Option::Some("DISABLED"),
41178 Self::ScaleOptimized => std::option::Option::Some("SCALE_OPTIMIZED"),
41179 Self::UnknownValue(u) => u.0.name(),
41180 }
41181 }
41182 }
41183
41184 impl std::default::Default for ScalabilityMode {
41185 fn default() -> Self {
41186 use std::convert::From;
41187 Self::from(0)
41188 }
41189 }
41190
41191 impl std::fmt::Display for ScalabilityMode {
41192 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
41193 wkt::internal::display_enum(f, self.name(), self.value())
41194 }
41195 }
41196
41197 impl std::convert::From<i32> for ScalabilityMode {
41198 fn from(value: i32) -> Self {
41199 match value {
41200 0 => Self::Unspecified,
41201 3 => Self::Disabled,
41202 4 => Self::ScaleOptimized,
41203 _ => Self::UnknownValue(scalability_mode::UnknownValue(
41204 wkt::internal::UnknownEnumValue::Integer(value),
41205 )),
41206 }
41207 }
41208 }
41209
41210 impl std::convert::From<&str> for ScalabilityMode {
41211 fn from(value: &str) -> Self {
41212 use std::string::ToString;
41213 match value {
41214 "SCALABILITY_MODE_UNSPECIFIED" => Self::Unspecified,
41215 "DISABLED" => Self::Disabled,
41216 "SCALE_OPTIMIZED" => Self::ScaleOptimized,
41217 _ => Self::UnknownValue(scalability_mode::UnknownValue(
41218 wkt::internal::UnknownEnumValue::String(value.to_string()),
41219 )),
41220 }
41221 }
41222 }
41223
41224 impl serde::ser::Serialize for ScalabilityMode {
41225 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
41226 where
41227 S: serde::Serializer,
41228 {
41229 match self {
41230 Self::Unspecified => serializer.serialize_i32(0),
41231 Self::Disabled => serializer.serialize_i32(3),
41232 Self::ScaleOptimized => serializer.serialize_i32(4),
41233 Self::UnknownValue(u) => u.0.serialize(serializer),
41234 }
41235 }
41236 }
41237
41238 impl<'de> serde::de::Deserialize<'de> for ScalabilityMode {
41239 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
41240 where
41241 D: serde::Deserializer<'de>,
41242 {
41243 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScalabilityMode>::new(
41244 ".google.container.v1.DataplaneV2Config.ScalabilityMode",
41245 ))
41246 }
41247 }
41248}
41249
41250/// ManagedPrometheusConfig defines the configuration for
41251/// Google Cloud Managed Service for Prometheus.
41252#[derive(Clone, Default, PartialEq)]
41253#[non_exhaustive]
41254pub struct ManagedPrometheusConfig {
41255 /// Enable Managed Collection.
41256 pub enabled: bool,
41257
41258 /// GKE Workload Auto-Monitoring Configuration.
41259 pub auto_monitoring_config: std::option::Option<crate::model::AutoMonitoringConfig>,
41260
41261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41262}
41263
41264impl ManagedPrometheusConfig {
41265 /// Creates a new default instance.
41266 pub fn new() -> Self {
41267 std::default::Default::default()
41268 }
41269
41270 /// Sets the value of [enabled][crate::model::ManagedPrometheusConfig::enabled].
41271 ///
41272 /// # Example
41273 /// ```ignore,no_run
41274 /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
41275 /// let x = ManagedPrometheusConfig::new().set_enabled(true);
41276 /// ```
41277 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
41278 self.enabled = v.into();
41279 self
41280 }
41281
41282 /// Sets the value of [auto_monitoring_config][crate::model::ManagedPrometheusConfig::auto_monitoring_config].
41283 ///
41284 /// # Example
41285 /// ```ignore,no_run
41286 /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
41287 /// use google_cloud_container_v1::model::AutoMonitoringConfig;
41288 /// let x = ManagedPrometheusConfig::new().set_auto_monitoring_config(AutoMonitoringConfig::default()/* use setters */);
41289 /// ```
41290 pub fn set_auto_monitoring_config<T>(mut self, v: T) -> Self
41291 where
41292 T: std::convert::Into<crate::model::AutoMonitoringConfig>,
41293 {
41294 self.auto_monitoring_config = std::option::Option::Some(v.into());
41295 self
41296 }
41297
41298 /// Sets or clears the value of [auto_monitoring_config][crate::model::ManagedPrometheusConfig::auto_monitoring_config].
41299 ///
41300 /// # Example
41301 /// ```ignore,no_run
41302 /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
41303 /// use google_cloud_container_v1::model::AutoMonitoringConfig;
41304 /// let x = ManagedPrometheusConfig::new().set_or_clear_auto_monitoring_config(Some(AutoMonitoringConfig::default()/* use setters */));
41305 /// let x = ManagedPrometheusConfig::new().set_or_clear_auto_monitoring_config(None::<AutoMonitoringConfig>);
41306 /// ```
41307 pub fn set_or_clear_auto_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
41308 where
41309 T: std::convert::Into<crate::model::AutoMonitoringConfig>,
41310 {
41311 self.auto_monitoring_config = v.map(|x| x.into());
41312 self
41313 }
41314}
41315
41316impl wkt::message::Message for ManagedPrometheusConfig {
41317 fn typename() -> &'static str {
41318 "type.googleapis.com/google.container.v1.ManagedPrometheusConfig"
41319 }
41320}
41321
41322/// AutoMonitoringConfig defines the configuration for GKE Workload
41323/// Auto-Monitoring.
41324#[derive(Clone, Default, PartialEq)]
41325#[non_exhaustive]
41326pub struct AutoMonitoringConfig {
41327 /// Scope for GKE Workload Auto-Monitoring.
41328 pub scope: crate::model::auto_monitoring_config::Scope,
41329
41330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41331}
41332
41333impl AutoMonitoringConfig {
41334 /// Creates a new default instance.
41335 pub fn new() -> Self {
41336 std::default::Default::default()
41337 }
41338
41339 /// Sets the value of [scope][crate::model::AutoMonitoringConfig::scope].
41340 ///
41341 /// # Example
41342 /// ```ignore,no_run
41343 /// # use google_cloud_container_v1::model::AutoMonitoringConfig;
41344 /// use google_cloud_container_v1::model::auto_monitoring_config::Scope;
41345 /// let x0 = AutoMonitoringConfig::new().set_scope(Scope::All);
41346 /// let x1 = AutoMonitoringConfig::new().set_scope(Scope::None);
41347 /// ```
41348 pub fn set_scope<T: std::convert::Into<crate::model::auto_monitoring_config::Scope>>(
41349 mut self,
41350 v: T,
41351 ) -> Self {
41352 self.scope = v.into();
41353 self
41354 }
41355}
41356
41357impl wkt::message::Message for AutoMonitoringConfig {
41358 fn typename() -> &'static str {
41359 "type.googleapis.com/google.container.v1.AutoMonitoringConfig"
41360 }
41361}
41362
41363/// Defines additional types related to [AutoMonitoringConfig].
41364pub mod auto_monitoring_config {
41365 #[allow(unused_imports)]
41366 use super::*;
41367
41368 /// Scope for applications monitored by Auto-Monitoring
41369 ///
41370 /// # Working with unknown values
41371 ///
41372 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
41373 /// additional enum variants at any time. Adding new variants is not considered
41374 /// a breaking change. Applications should write their code in anticipation of:
41375 ///
41376 /// - New values appearing in future releases of the client library, **and**
41377 /// - New values received dynamically, without application changes.
41378 ///
41379 /// Please consult the [Working with enums] section in the user guide for some
41380 /// guidelines.
41381 ///
41382 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
41383 #[derive(Clone, Debug, PartialEq)]
41384 #[non_exhaustive]
41385 pub enum Scope {
41386 /// Not set.
41387 Unspecified,
41388 /// Auto-Monitoring is enabled for all supported applications.
41389 All,
41390 /// Disable Auto-Monitoring.
41391 None,
41392 /// If set, the enum was initialized with an unknown value.
41393 ///
41394 /// Applications can examine the value using [Scope::value] or
41395 /// [Scope::name].
41396 UnknownValue(scope::UnknownValue),
41397 }
41398
41399 #[doc(hidden)]
41400 pub mod scope {
41401 #[allow(unused_imports)]
41402 use super::*;
41403 #[derive(Clone, Debug, PartialEq)]
41404 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
41405 }
41406
41407 impl Scope {
41408 /// Gets the enum value.
41409 ///
41410 /// Returns `None` if the enum contains an unknown value deserialized from
41411 /// the string representation of enums.
41412 pub fn value(&self) -> std::option::Option<i32> {
41413 match self {
41414 Self::Unspecified => std::option::Option::Some(0),
41415 Self::All => std::option::Option::Some(1),
41416 Self::None => std::option::Option::Some(2),
41417 Self::UnknownValue(u) => u.0.value(),
41418 }
41419 }
41420
41421 /// Gets the enum value as a string.
41422 ///
41423 /// Returns `None` if the enum contains an unknown value deserialized from
41424 /// the integer representation of enums.
41425 pub fn name(&self) -> std::option::Option<&str> {
41426 match self {
41427 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
41428 Self::All => std::option::Option::Some("ALL"),
41429 Self::None => std::option::Option::Some("NONE"),
41430 Self::UnknownValue(u) => u.0.name(),
41431 }
41432 }
41433 }
41434
41435 impl std::default::Default for Scope {
41436 fn default() -> Self {
41437 use std::convert::From;
41438 Self::from(0)
41439 }
41440 }
41441
41442 impl std::fmt::Display for Scope {
41443 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
41444 wkt::internal::display_enum(f, self.name(), self.value())
41445 }
41446 }
41447
41448 impl std::convert::From<i32> for Scope {
41449 fn from(value: i32) -> Self {
41450 match value {
41451 0 => Self::Unspecified,
41452 1 => Self::All,
41453 2 => Self::None,
41454 _ => Self::UnknownValue(scope::UnknownValue(
41455 wkt::internal::UnknownEnumValue::Integer(value),
41456 )),
41457 }
41458 }
41459 }
41460
41461 impl std::convert::From<&str> for Scope {
41462 fn from(value: &str) -> Self {
41463 use std::string::ToString;
41464 match value {
41465 "SCOPE_UNSPECIFIED" => Self::Unspecified,
41466 "ALL" => Self::All,
41467 "NONE" => Self::None,
41468 _ => Self::UnknownValue(scope::UnknownValue(
41469 wkt::internal::UnknownEnumValue::String(value.to_string()),
41470 )),
41471 }
41472 }
41473 }
41474
41475 impl serde::ser::Serialize for Scope {
41476 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
41477 where
41478 S: serde::Serializer,
41479 {
41480 match self {
41481 Self::Unspecified => serializer.serialize_i32(0),
41482 Self::All => serializer.serialize_i32(1),
41483 Self::None => serializer.serialize_i32(2),
41484 Self::UnknownValue(u) => u.0.serialize(serializer),
41485 }
41486 }
41487 }
41488
41489 impl<'de> serde::de::Deserialize<'de> for Scope {
41490 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
41491 where
41492 D: serde::Deserializer<'de>,
41493 {
41494 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
41495 ".google.container.v1.AutoMonitoringConfig.Scope",
41496 ))
41497 }
41498 }
41499}
41500
41501/// PodAutoscaling is used for configuration of parameters
41502/// for workload autoscaling.
41503#[derive(Clone, Default, PartialEq)]
41504#[non_exhaustive]
41505pub struct PodAutoscaling {
41506 /// Selected Horizontal Pod Autoscaling profile.
41507 pub hpa_profile: std::option::Option<crate::model::pod_autoscaling::HPAProfile>,
41508
41509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41510}
41511
41512impl PodAutoscaling {
41513 /// Creates a new default instance.
41514 pub fn new() -> Self {
41515 std::default::Default::default()
41516 }
41517
41518 /// Sets the value of [hpa_profile][crate::model::PodAutoscaling::hpa_profile].
41519 ///
41520 /// # Example
41521 /// ```ignore,no_run
41522 /// # use google_cloud_container_v1::model::PodAutoscaling;
41523 /// use google_cloud_container_v1::model::pod_autoscaling::HPAProfile;
41524 /// let x0 = PodAutoscaling::new().set_hpa_profile(HPAProfile::None);
41525 /// let x1 = PodAutoscaling::new().set_hpa_profile(HPAProfile::Performance);
41526 /// ```
41527 pub fn set_hpa_profile<T>(mut self, v: T) -> Self
41528 where
41529 T: std::convert::Into<crate::model::pod_autoscaling::HPAProfile>,
41530 {
41531 self.hpa_profile = std::option::Option::Some(v.into());
41532 self
41533 }
41534
41535 /// Sets or clears the value of [hpa_profile][crate::model::PodAutoscaling::hpa_profile].
41536 ///
41537 /// # Example
41538 /// ```ignore,no_run
41539 /// # use google_cloud_container_v1::model::PodAutoscaling;
41540 /// use google_cloud_container_v1::model::pod_autoscaling::HPAProfile;
41541 /// let x0 = PodAutoscaling::new().set_or_clear_hpa_profile(Some(HPAProfile::None));
41542 /// let x1 = PodAutoscaling::new().set_or_clear_hpa_profile(Some(HPAProfile::Performance));
41543 /// let x_none = PodAutoscaling::new().set_or_clear_hpa_profile(None::<HPAProfile>);
41544 /// ```
41545 pub fn set_or_clear_hpa_profile<T>(mut self, v: std::option::Option<T>) -> Self
41546 where
41547 T: std::convert::Into<crate::model::pod_autoscaling::HPAProfile>,
41548 {
41549 self.hpa_profile = v.map(|x| x.into());
41550 self
41551 }
41552}
41553
41554impl wkt::message::Message for PodAutoscaling {
41555 fn typename() -> &'static str {
41556 "type.googleapis.com/google.container.v1.PodAutoscaling"
41557 }
41558}
41559
41560/// Defines additional types related to [PodAutoscaling].
41561pub mod pod_autoscaling {
41562 #[allow(unused_imports)]
41563 use super::*;
41564
41565 /// Possible types of Horizontal Pod Autoscaling profile.
41566 ///
41567 /// # Working with unknown values
41568 ///
41569 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
41570 /// additional enum variants at any time. Adding new variants is not considered
41571 /// a breaking change. Applications should write their code in anticipation of:
41572 ///
41573 /// - New values appearing in future releases of the client library, **and**
41574 /// - New values received dynamically, without application changes.
41575 ///
41576 /// Please consult the [Working with enums] section in the user guide for some
41577 /// guidelines.
41578 ///
41579 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
41580 #[derive(Clone, Debug, PartialEq)]
41581 #[non_exhaustive]
41582 pub enum HPAProfile {
41583 /// HPA_PROFILE_UNSPECIFIED is used when no custom HPA profile is set.
41584 Unspecified,
41585 /// Customers explicitly opt-out of HPA profiles.
41586 None,
41587 /// PERFORMANCE is used when customers opt-in to the performance HPA profile.
41588 /// In this profile we support a higher number of HPAs per cluster and faster
41589 /// metrics collection for workload autoscaling.
41590 Performance,
41591 /// If set, the enum was initialized with an unknown value.
41592 ///
41593 /// Applications can examine the value using [HPAProfile::value] or
41594 /// [HPAProfile::name].
41595 UnknownValue(hpa_profile::UnknownValue),
41596 }
41597
41598 #[doc(hidden)]
41599 pub mod hpa_profile {
41600 #[allow(unused_imports)]
41601 use super::*;
41602 #[derive(Clone, Debug, PartialEq)]
41603 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
41604 }
41605
41606 impl HPAProfile {
41607 /// Gets the enum value.
41608 ///
41609 /// Returns `None` if the enum contains an unknown value deserialized from
41610 /// the string representation of enums.
41611 pub fn value(&self) -> std::option::Option<i32> {
41612 match self {
41613 Self::Unspecified => std::option::Option::Some(0),
41614 Self::None => std::option::Option::Some(1),
41615 Self::Performance => std::option::Option::Some(2),
41616 Self::UnknownValue(u) => u.0.value(),
41617 }
41618 }
41619
41620 /// Gets the enum value as a string.
41621 ///
41622 /// Returns `None` if the enum contains an unknown value deserialized from
41623 /// the integer representation of enums.
41624 pub fn name(&self) -> std::option::Option<&str> {
41625 match self {
41626 Self::Unspecified => std::option::Option::Some("HPA_PROFILE_UNSPECIFIED"),
41627 Self::None => std::option::Option::Some("NONE"),
41628 Self::Performance => std::option::Option::Some("PERFORMANCE"),
41629 Self::UnknownValue(u) => u.0.name(),
41630 }
41631 }
41632 }
41633
41634 impl std::default::Default for HPAProfile {
41635 fn default() -> Self {
41636 use std::convert::From;
41637 Self::from(0)
41638 }
41639 }
41640
41641 impl std::fmt::Display for HPAProfile {
41642 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
41643 wkt::internal::display_enum(f, self.name(), self.value())
41644 }
41645 }
41646
41647 impl std::convert::From<i32> for HPAProfile {
41648 fn from(value: i32) -> Self {
41649 match value {
41650 0 => Self::Unspecified,
41651 1 => Self::None,
41652 2 => Self::Performance,
41653 _ => Self::UnknownValue(hpa_profile::UnknownValue(
41654 wkt::internal::UnknownEnumValue::Integer(value),
41655 )),
41656 }
41657 }
41658 }
41659
41660 impl std::convert::From<&str> for HPAProfile {
41661 fn from(value: &str) -> Self {
41662 use std::string::ToString;
41663 match value {
41664 "HPA_PROFILE_UNSPECIFIED" => Self::Unspecified,
41665 "NONE" => Self::None,
41666 "PERFORMANCE" => Self::Performance,
41667 _ => Self::UnknownValue(hpa_profile::UnknownValue(
41668 wkt::internal::UnknownEnumValue::String(value.to_string()),
41669 )),
41670 }
41671 }
41672 }
41673
41674 impl serde::ser::Serialize for HPAProfile {
41675 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
41676 where
41677 S: serde::Serializer,
41678 {
41679 match self {
41680 Self::Unspecified => serializer.serialize_i32(0),
41681 Self::None => serializer.serialize_i32(1),
41682 Self::Performance => serializer.serialize_i32(2),
41683 Self::UnknownValue(u) => u.0.serialize(serializer),
41684 }
41685 }
41686 }
41687
41688 impl<'de> serde::de::Deserialize<'de> for HPAProfile {
41689 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
41690 where
41691 D: serde::Deserializer<'de>,
41692 {
41693 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HPAProfile>::new(
41694 ".google.container.v1.PodAutoscaling.HPAProfile",
41695 ))
41696 }
41697 }
41698}
41699
41700/// Fleet is the fleet configuration for the cluster.
41701#[derive(Clone, Default, PartialEq)]
41702#[non_exhaustive]
41703pub struct Fleet {
41704 /// The Fleet host project(project ID or project number) where this cluster
41705 /// will be registered to. This field cannot be changed after the cluster has
41706 /// been registered.
41707 pub project: std::string::String,
41708
41709 /// Output only. The full resource name of the registered fleet membership of
41710 /// the cluster, in the format
41711 /// `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`.
41712 pub membership: std::string::String,
41713
41714 /// Output only. Whether the cluster has been registered through the fleet
41715 /// API.
41716 pub pre_registered: bool,
41717
41718 /// The type of the cluster's fleet membership.
41719 pub membership_type: crate::model::fleet::MembershipType,
41720
41721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41722}
41723
41724impl Fleet {
41725 /// Creates a new default instance.
41726 pub fn new() -> Self {
41727 std::default::Default::default()
41728 }
41729
41730 /// Sets the value of [project][crate::model::Fleet::project].
41731 ///
41732 /// # Example
41733 /// ```ignore,no_run
41734 /// # use google_cloud_container_v1::model::Fleet;
41735 /// let x = Fleet::new().set_project("example");
41736 /// ```
41737 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
41738 self.project = v.into();
41739 self
41740 }
41741
41742 /// Sets the value of [membership][crate::model::Fleet::membership].
41743 ///
41744 /// # Example
41745 /// ```ignore,no_run
41746 /// # use google_cloud_container_v1::model::Fleet;
41747 /// let x = Fleet::new().set_membership("example");
41748 /// ```
41749 pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
41750 self.membership = v.into();
41751 self
41752 }
41753
41754 /// Sets the value of [pre_registered][crate::model::Fleet::pre_registered].
41755 ///
41756 /// # Example
41757 /// ```ignore,no_run
41758 /// # use google_cloud_container_v1::model::Fleet;
41759 /// let x = Fleet::new().set_pre_registered(true);
41760 /// ```
41761 pub fn set_pre_registered<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
41762 self.pre_registered = v.into();
41763 self
41764 }
41765
41766 /// Sets the value of [membership_type][crate::model::Fleet::membership_type].
41767 ///
41768 /// # Example
41769 /// ```ignore,no_run
41770 /// # use google_cloud_container_v1::model::Fleet;
41771 /// use google_cloud_container_v1::model::fleet::MembershipType;
41772 /// let x0 = Fleet::new().set_membership_type(MembershipType::Lightweight);
41773 /// ```
41774 pub fn set_membership_type<T: std::convert::Into<crate::model::fleet::MembershipType>>(
41775 mut self,
41776 v: T,
41777 ) -> Self {
41778 self.membership_type = v.into();
41779 self
41780 }
41781}
41782
41783impl wkt::message::Message for Fleet {
41784 fn typename() -> &'static str {
41785 "type.googleapis.com/google.container.v1.Fleet"
41786 }
41787}
41788
41789/// Defines additional types related to [Fleet].
41790pub mod fleet {
41791 #[allow(unused_imports)]
41792 use super::*;
41793
41794 /// MembershipType describes if the membership supports all features or only
41795 /// lightweight compatible ones.
41796 ///
41797 /// # Working with unknown values
41798 ///
41799 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
41800 /// additional enum variants at any time. Adding new variants is not considered
41801 /// a breaking change. Applications should write their code in anticipation of:
41802 ///
41803 /// - New values appearing in future releases of the client library, **and**
41804 /// - New values received dynamically, without application changes.
41805 ///
41806 /// Please consult the [Working with enums] section in the user guide for some
41807 /// guidelines.
41808 ///
41809 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
41810 #[derive(Clone, Debug, PartialEq)]
41811 #[non_exhaustive]
41812 pub enum MembershipType {
41813 /// The MembershipType is not set.
41814 Unspecified,
41815 /// The membership supports only lightweight compatible features.
41816 Lightweight,
41817 /// If set, the enum was initialized with an unknown value.
41818 ///
41819 /// Applications can examine the value using [MembershipType::value] or
41820 /// [MembershipType::name].
41821 UnknownValue(membership_type::UnknownValue),
41822 }
41823
41824 #[doc(hidden)]
41825 pub mod membership_type {
41826 #[allow(unused_imports)]
41827 use super::*;
41828 #[derive(Clone, Debug, PartialEq)]
41829 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
41830 }
41831
41832 impl MembershipType {
41833 /// Gets the enum value.
41834 ///
41835 /// Returns `None` if the enum contains an unknown value deserialized from
41836 /// the string representation of enums.
41837 pub fn value(&self) -> std::option::Option<i32> {
41838 match self {
41839 Self::Unspecified => std::option::Option::Some(0),
41840 Self::Lightweight => std::option::Option::Some(1),
41841 Self::UnknownValue(u) => u.0.value(),
41842 }
41843 }
41844
41845 /// Gets the enum value as a string.
41846 ///
41847 /// Returns `None` if the enum contains an unknown value deserialized from
41848 /// the integer representation of enums.
41849 pub fn name(&self) -> std::option::Option<&str> {
41850 match self {
41851 Self::Unspecified => std::option::Option::Some("MEMBERSHIP_TYPE_UNSPECIFIED"),
41852 Self::Lightweight => std::option::Option::Some("LIGHTWEIGHT"),
41853 Self::UnknownValue(u) => u.0.name(),
41854 }
41855 }
41856 }
41857
41858 impl std::default::Default for MembershipType {
41859 fn default() -> Self {
41860 use std::convert::From;
41861 Self::from(0)
41862 }
41863 }
41864
41865 impl std::fmt::Display for MembershipType {
41866 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
41867 wkt::internal::display_enum(f, self.name(), self.value())
41868 }
41869 }
41870
41871 impl std::convert::From<i32> for MembershipType {
41872 fn from(value: i32) -> Self {
41873 match value {
41874 0 => Self::Unspecified,
41875 1 => Self::Lightweight,
41876 _ => Self::UnknownValue(membership_type::UnknownValue(
41877 wkt::internal::UnknownEnumValue::Integer(value),
41878 )),
41879 }
41880 }
41881 }
41882
41883 impl std::convert::From<&str> for MembershipType {
41884 fn from(value: &str) -> Self {
41885 use std::string::ToString;
41886 match value {
41887 "MEMBERSHIP_TYPE_UNSPECIFIED" => Self::Unspecified,
41888 "LIGHTWEIGHT" => Self::Lightweight,
41889 _ => Self::UnknownValue(membership_type::UnknownValue(
41890 wkt::internal::UnknownEnumValue::String(value.to_string()),
41891 )),
41892 }
41893 }
41894 }
41895
41896 impl serde::ser::Serialize for MembershipType {
41897 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
41898 where
41899 S: serde::Serializer,
41900 {
41901 match self {
41902 Self::Unspecified => serializer.serialize_i32(0),
41903 Self::Lightweight => serializer.serialize_i32(1),
41904 Self::UnknownValue(u) => u.0.serialize(serializer),
41905 }
41906 }
41907 }
41908
41909 impl<'de> serde::de::Deserialize<'de> for MembershipType {
41910 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
41911 where
41912 D: serde::Deserializer<'de>,
41913 {
41914 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MembershipType>::new(
41915 ".google.container.v1.Fleet.MembershipType",
41916 ))
41917 }
41918 }
41919}
41920
41921/// Configuration for all of the cluster's control plane endpoints.
41922#[derive(Clone, Default, PartialEq)]
41923#[non_exhaustive]
41924pub struct ControlPlaneEndpointsConfig {
41925 /// DNS endpoint configuration.
41926 pub dns_endpoint_config:
41927 std::option::Option<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
41928
41929 /// IP endpoints configuration.
41930 pub ip_endpoints_config:
41931 std::option::Option<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
41932
41933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41934}
41935
41936impl ControlPlaneEndpointsConfig {
41937 /// Creates a new default instance.
41938 pub fn new() -> Self {
41939 std::default::Default::default()
41940 }
41941
41942 /// Sets the value of [dns_endpoint_config][crate::model::ControlPlaneEndpointsConfig::dns_endpoint_config].
41943 ///
41944 /// # Example
41945 /// ```ignore,no_run
41946 /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
41947 /// use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
41948 /// let x = ControlPlaneEndpointsConfig::new().set_dns_endpoint_config(DNSEndpointConfig::default()/* use setters */);
41949 /// ```
41950 pub fn set_dns_endpoint_config<T>(mut self, v: T) -> Self
41951 where
41952 T: std::convert::Into<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
41953 {
41954 self.dns_endpoint_config = std::option::Option::Some(v.into());
41955 self
41956 }
41957
41958 /// Sets or clears the value of [dns_endpoint_config][crate::model::ControlPlaneEndpointsConfig::dns_endpoint_config].
41959 ///
41960 /// # Example
41961 /// ```ignore,no_run
41962 /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
41963 /// use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
41964 /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_dns_endpoint_config(Some(DNSEndpointConfig::default()/* use setters */));
41965 /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_dns_endpoint_config(None::<DNSEndpointConfig>);
41966 /// ```
41967 pub fn set_or_clear_dns_endpoint_config<T>(mut self, v: std::option::Option<T>) -> Self
41968 where
41969 T: std::convert::Into<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
41970 {
41971 self.dns_endpoint_config = v.map(|x| x.into());
41972 self
41973 }
41974
41975 /// Sets the value of [ip_endpoints_config][crate::model::ControlPlaneEndpointsConfig::ip_endpoints_config].
41976 ///
41977 /// # Example
41978 /// ```ignore,no_run
41979 /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
41980 /// use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
41981 /// let x = ControlPlaneEndpointsConfig::new().set_ip_endpoints_config(IPEndpointsConfig::default()/* use setters */);
41982 /// ```
41983 pub fn set_ip_endpoints_config<T>(mut self, v: T) -> Self
41984 where
41985 T: std::convert::Into<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
41986 {
41987 self.ip_endpoints_config = std::option::Option::Some(v.into());
41988 self
41989 }
41990
41991 /// Sets or clears the value of [ip_endpoints_config][crate::model::ControlPlaneEndpointsConfig::ip_endpoints_config].
41992 ///
41993 /// # Example
41994 /// ```ignore,no_run
41995 /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
41996 /// use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
41997 /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_ip_endpoints_config(Some(IPEndpointsConfig::default()/* use setters */));
41998 /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_ip_endpoints_config(None::<IPEndpointsConfig>);
41999 /// ```
42000 pub fn set_or_clear_ip_endpoints_config<T>(mut self, v: std::option::Option<T>) -> Self
42001 where
42002 T: std::convert::Into<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
42003 {
42004 self.ip_endpoints_config = v.map(|x| x.into());
42005 self
42006 }
42007}
42008
42009impl wkt::message::Message for ControlPlaneEndpointsConfig {
42010 fn typename() -> &'static str {
42011 "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig"
42012 }
42013}
42014
42015/// Defines additional types related to [ControlPlaneEndpointsConfig].
42016pub mod control_plane_endpoints_config {
42017 #[allow(unused_imports)]
42018 use super::*;
42019
42020 /// Describes the configuration of a DNS endpoint.
42021 #[derive(Clone, Default, PartialEq)]
42022 #[non_exhaustive]
42023 pub struct DNSEndpointConfig {
42024 /// Output only. The cluster's DNS endpoint configuration.
42025 /// A DNS format address. This is accessible from the public internet.
42026 /// Ex: uid.us-central1.gke.goog.
42027 /// Always present, but the behavior may change according to the value of
42028 /// [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic].
42029 ///
42030 /// [google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]: crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic
42031 pub endpoint: std::string::String,
42032
42033 /// Controls whether user traffic is allowed over this endpoint. Note that
42034 /// Google-managed services may still use the endpoint even if this is false.
42035 pub allow_external_traffic: std::option::Option<bool>,
42036
42037 /// Controls whether the k8s token auth is allowed via DNS.
42038 pub enable_k8s_tokens_via_dns: std::option::Option<bool>,
42039
42040 /// Controls whether the k8s certs auth is allowed via DNS.
42041 pub enable_k8s_certs_via_dns: std::option::Option<bool>,
42042
42043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42044 }
42045
42046 impl DNSEndpointConfig {
42047 /// Creates a new default instance.
42048 pub fn new() -> Self {
42049 std::default::Default::default()
42050 }
42051
42052 /// Sets the value of [endpoint][crate::model::control_plane_endpoints_config::DNSEndpointConfig::endpoint].
42053 ///
42054 /// # Example
42055 /// ```ignore,no_run
42056 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42057 /// let x = DNSEndpointConfig::new().set_endpoint("example");
42058 /// ```
42059 pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
42060 self.endpoint = v.into();
42061 self
42062 }
42063
42064 /// Sets the value of [allow_external_traffic][crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic].
42065 ///
42066 /// # Example
42067 /// ```ignore,no_run
42068 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42069 /// let x = DNSEndpointConfig::new().set_allow_external_traffic(true);
42070 /// ```
42071 pub fn set_allow_external_traffic<T>(mut self, v: T) -> Self
42072 where
42073 T: std::convert::Into<bool>,
42074 {
42075 self.allow_external_traffic = std::option::Option::Some(v.into());
42076 self
42077 }
42078
42079 /// Sets or clears the value of [allow_external_traffic][crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic].
42080 ///
42081 /// # Example
42082 /// ```ignore,no_run
42083 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42084 /// let x = DNSEndpointConfig::new().set_or_clear_allow_external_traffic(Some(false));
42085 /// let x = DNSEndpointConfig::new().set_or_clear_allow_external_traffic(None::<bool>);
42086 /// ```
42087 pub fn set_or_clear_allow_external_traffic<T>(mut self, v: std::option::Option<T>) -> Self
42088 where
42089 T: std::convert::Into<bool>,
42090 {
42091 self.allow_external_traffic = v.map(|x| x.into());
42092 self
42093 }
42094
42095 /// Sets the value of [enable_k8s_tokens_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_tokens_via_dns].
42096 ///
42097 /// # Example
42098 /// ```ignore,no_run
42099 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42100 /// let x = DNSEndpointConfig::new().set_enable_k8s_tokens_via_dns(true);
42101 /// ```
42102 pub fn set_enable_k8s_tokens_via_dns<T>(mut self, v: T) -> Self
42103 where
42104 T: std::convert::Into<bool>,
42105 {
42106 self.enable_k8s_tokens_via_dns = std::option::Option::Some(v.into());
42107 self
42108 }
42109
42110 /// Sets or clears the value of [enable_k8s_tokens_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_tokens_via_dns].
42111 ///
42112 /// # Example
42113 /// ```ignore,no_run
42114 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42115 /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_tokens_via_dns(Some(false));
42116 /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_tokens_via_dns(None::<bool>);
42117 /// ```
42118 pub fn set_or_clear_enable_k8s_tokens_via_dns<T>(
42119 mut self,
42120 v: std::option::Option<T>,
42121 ) -> Self
42122 where
42123 T: std::convert::Into<bool>,
42124 {
42125 self.enable_k8s_tokens_via_dns = v.map(|x| x.into());
42126 self
42127 }
42128
42129 /// Sets the value of [enable_k8s_certs_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_certs_via_dns].
42130 ///
42131 /// # Example
42132 /// ```ignore,no_run
42133 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42134 /// let x = DNSEndpointConfig::new().set_enable_k8s_certs_via_dns(true);
42135 /// ```
42136 pub fn set_enable_k8s_certs_via_dns<T>(mut self, v: T) -> Self
42137 where
42138 T: std::convert::Into<bool>,
42139 {
42140 self.enable_k8s_certs_via_dns = std::option::Option::Some(v.into());
42141 self
42142 }
42143
42144 /// Sets or clears the value of [enable_k8s_certs_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_certs_via_dns].
42145 ///
42146 /// # Example
42147 /// ```ignore,no_run
42148 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
42149 /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_certs_via_dns(Some(false));
42150 /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_certs_via_dns(None::<bool>);
42151 /// ```
42152 pub fn set_or_clear_enable_k8s_certs_via_dns<T>(mut self, v: std::option::Option<T>) -> Self
42153 where
42154 T: std::convert::Into<bool>,
42155 {
42156 self.enable_k8s_certs_via_dns = v.map(|x| x.into());
42157 self
42158 }
42159 }
42160
42161 impl wkt::message::Message for DNSEndpointConfig {
42162 fn typename() -> &'static str {
42163 "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig"
42164 }
42165 }
42166
42167 /// IP endpoints configuration.
42168 #[derive(Clone, Default, PartialEq)]
42169 #[non_exhaustive]
42170 pub struct IPEndpointsConfig {
42171 /// Controls whether to allow direct IP access.
42172 pub enabled: std::option::Option<bool>,
42173
42174 /// Controls whether the control plane allows access through a public IP.
42175 /// It is invalid to specify both
42176 /// [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same
42177 /// time.
42178 pub enable_public_endpoint: std::option::Option<bool>,
42179
42180 /// Controls whether the control plane's private endpoint is accessible from
42181 /// sources in other regions.
42182 /// It is invalid to specify both
42183 /// [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled]
42184 /// and this field at the same time.
42185 ///
42186 /// [google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled]: crate::model::PrivateClusterMasterGlobalAccessConfig::enabled
42187 pub global_access: std::option::Option<bool>,
42188
42189 /// Configuration of authorized networks. If enabled, restricts access to the
42190 /// control plane based on source IP.
42191 /// It is invalid to specify both
42192 /// [Cluster.masterAuthorizedNetworksConfig][] and this field at the same
42193 /// time.
42194 pub authorized_networks_config:
42195 std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
42196
42197 /// Output only. The external IP address of this cluster's control plane.
42198 /// Only populated if enabled.
42199 pub public_endpoint: std::string::String,
42200
42201 /// Output only. The internal IP address of this cluster's control plane.
42202 /// Only populated if enabled.
42203 pub private_endpoint: std::string::String,
42204
42205 /// Subnet to provision the master's private endpoint during cluster
42206 /// creation. Specified in projects/*/regions/*/subnetworks/* format. It is
42207 /// invalid to specify both
42208 /// [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the
42209 /// same time.
42210 pub private_endpoint_subnetwork: std::string::String,
42211
42212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42213 }
42214
42215 impl IPEndpointsConfig {
42216 /// Creates a new default instance.
42217 pub fn new() -> Self {
42218 std::default::Default::default()
42219 }
42220
42221 /// Sets the value of [enabled][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enabled].
42222 ///
42223 /// # Example
42224 /// ```ignore,no_run
42225 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42226 /// let x = IPEndpointsConfig::new().set_enabled(true);
42227 /// ```
42228 pub fn set_enabled<T>(mut self, v: T) -> Self
42229 where
42230 T: std::convert::Into<bool>,
42231 {
42232 self.enabled = std::option::Option::Some(v.into());
42233 self
42234 }
42235
42236 /// Sets or clears the value of [enabled][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enabled].
42237 ///
42238 /// # Example
42239 /// ```ignore,no_run
42240 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42241 /// let x = IPEndpointsConfig::new().set_or_clear_enabled(Some(false));
42242 /// let x = IPEndpointsConfig::new().set_or_clear_enabled(None::<bool>);
42243 /// ```
42244 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
42245 where
42246 T: std::convert::Into<bool>,
42247 {
42248 self.enabled = v.map(|x| x.into());
42249 self
42250 }
42251
42252 /// Sets the value of [enable_public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint].
42253 ///
42254 /// # Example
42255 /// ```ignore,no_run
42256 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42257 /// let x = IPEndpointsConfig::new().set_enable_public_endpoint(true);
42258 /// ```
42259 pub fn set_enable_public_endpoint<T>(mut self, v: T) -> Self
42260 where
42261 T: std::convert::Into<bool>,
42262 {
42263 self.enable_public_endpoint = std::option::Option::Some(v.into());
42264 self
42265 }
42266
42267 /// Sets or clears the value of [enable_public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint].
42268 ///
42269 /// # Example
42270 /// ```ignore,no_run
42271 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42272 /// let x = IPEndpointsConfig::new().set_or_clear_enable_public_endpoint(Some(false));
42273 /// let x = IPEndpointsConfig::new().set_or_clear_enable_public_endpoint(None::<bool>);
42274 /// ```
42275 pub fn set_or_clear_enable_public_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
42276 where
42277 T: std::convert::Into<bool>,
42278 {
42279 self.enable_public_endpoint = v.map(|x| x.into());
42280 self
42281 }
42282
42283 /// Sets the value of [global_access][crate::model::control_plane_endpoints_config::IPEndpointsConfig::global_access].
42284 ///
42285 /// # Example
42286 /// ```ignore,no_run
42287 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42288 /// let x = IPEndpointsConfig::new().set_global_access(true);
42289 /// ```
42290 pub fn set_global_access<T>(mut self, v: T) -> Self
42291 where
42292 T: std::convert::Into<bool>,
42293 {
42294 self.global_access = std::option::Option::Some(v.into());
42295 self
42296 }
42297
42298 /// Sets or clears the value of [global_access][crate::model::control_plane_endpoints_config::IPEndpointsConfig::global_access].
42299 ///
42300 /// # Example
42301 /// ```ignore,no_run
42302 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42303 /// let x = IPEndpointsConfig::new().set_or_clear_global_access(Some(false));
42304 /// let x = IPEndpointsConfig::new().set_or_clear_global_access(None::<bool>);
42305 /// ```
42306 pub fn set_or_clear_global_access<T>(mut self, v: std::option::Option<T>) -> Self
42307 where
42308 T: std::convert::Into<bool>,
42309 {
42310 self.global_access = v.map(|x| x.into());
42311 self
42312 }
42313
42314 /// Sets the value of [authorized_networks_config][crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config].
42315 ///
42316 /// # Example
42317 /// ```ignore,no_run
42318 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42319 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
42320 /// let x = IPEndpointsConfig::new().set_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
42321 /// ```
42322 pub fn set_authorized_networks_config<T>(mut self, v: T) -> Self
42323 where
42324 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
42325 {
42326 self.authorized_networks_config = std::option::Option::Some(v.into());
42327 self
42328 }
42329
42330 /// Sets or clears the value of [authorized_networks_config][crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config].
42331 ///
42332 /// # Example
42333 /// ```ignore,no_run
42334 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42335 /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
42336 /// let x = IPEndpointsConfig::new().set_or_clear_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
42337 /// let x = IPEndpointsConfig::new().set_or_clear_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
42338 /// ```
42339 pub fn set_or_clear_authorized_networks_config<T>(
42340 mut self,
42341 v: std::option::Option<T>,
42342 ) -> Self
42343 where
42344 T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
42345 {
42346 self.authorized_networks_config = v.map(|x| x.into());
42347 self
42348 }
42349
42350 /// Sets the value of [public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::public_endpoint].
42351 ///
42352 /// # Example
42353 /// ```ignore,no_run
42354 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42355 /// let x = IPEndpointsConfig::new().set_public_endpoint("example");
42356 /// ```
42357 pub fn set_public_endpoint<T: std::convert::Into<std::string::String>>(
42358 mut self,
42359 v: T,
42360 ) -> Self {
42361 self.public_endpoint = v.into();
42362 self
42363 }
42364
42365 /// Sets the value of [private_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint].
42366 ///
42367 /// # Example
42368 /// ```ignore,no_run
42369 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42370 /// let x = IPEndpointsConfig::new().set_private_endpoint("example");
42371 /// ```
42372 pub fn set_private_endpoint<T: std::convert::Into<std::string::String>>(
42373 mut self,
42374 v: T,
42375 ) -> Self {
42376 self.private_endpoint = v.into();
42377 self
42378 }
42379
42380 /// Sets the value of [private_endpoint_subnetwork][crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint_subnetwork].
42381 ///
42382 /// # Example
42383 /// ```ignore,no_run
42384 /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
42385 /// let x = IPEndpointsConfig::new().set_private_endpoint_subnetwork("example");
42386 /// ```
42387 pub fn set_private_endpoint_subnetwork<T: std::convert::Into<std::string::String>>(
42388 mut self,
42389 v: T,
42390 ) -> Self {
42391 self.private_endpoint_subnetwork = v.into();
42392 self
42393 }
42394 }
42395
42396 impl wkt::message::Message for IPEndpointsConfig {
42397 fn typename() -> &'static str {
42398 "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig"
42399 }
42400 }
42401}
42402
42403/// LocalNvmeSsdBlockConfig contains configuration for using raw-block local
42404/// NVMe SSDs
42405#[derive(Clone, Default, PartialEq)]
42406#[non_exhaustive]
42407pub struct LocalNvmeSsdBlockConfig {
42408 /// Number of local NVMe SSDs to use. The limit for this value is dependent
42409 /// upon the maximum number of disk available on a machine per zone. See:
42410 /// <https://cloud.google.com/compute/docs/disks/local-ssd>
42411 /// for more information.
42412 ///
42413 /// A zero (or unset) value has different meanings depending on machine type
42414 /// being used:
42415 ///
42416 /// 1. For pre-Gen3 machines, which support flexible numbers of local ssds,
42417 /// zero (or unset) means to disable using local SSDs as ephemeral storage.
42418 /// 1. For Gen3 machines which dictate a specific number of local ssds, zero
42419 /// (or unset) means to use the default number of local ssds that goes with
42420 /// that machine type. For example, for a c3-standard-8-lssd machine, 2 local
42421 /// ssds would be provisioned. For c3-standard-8 (which doesn't support local
42422 /// ssds), 0 will be provisioned. See
42423 /// <https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds>
42424 /// for more info.
42425 pub local_ssd_count: i32,
42426
42427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42428}
42429
42430impl LocalNvmeSsdBlockConfig {
42431 /// Creates a new default instance.
42432 pub fn new() -> Self {
42433 std::default::Default::default()
42434 }
42435
42436 /// Sets the value of [local_ssd_count][crate::model::LocalNvmeSsdBlockConfig::local_ssd_count].
42437 ///
42438 /// # Example
42439 /// ```ignore,no_run
42440 /// # use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
42441 /// let x = LocalNvmeSsdBlockConfig::new().set_local_ssd_count(42);
42442 /// ```
42443 pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
42444 self.local_ssd_count = v.into();
42445 self
42446 }
42447}
42448
42449impl wkt::message::Message for LocalNvmeSsdBlockConfig {
42450 fn typename() -> &'static str {
42451 "type.googleapis.com/google.container.v1.LocalNvmeSsdBlockConfig"
42452 }
42453}
42454
42455/// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral
42456/// storage using Local SSDs.
42457#[derive(Clone, Default, PartialEq)]
42458#[non_exhaustive]
42459pub struct EphemeralStorageLocalSsdConfig {
42460 /// Number of local SSDs to use to back ephemeral storage. Uses NVMe
42461 /// interfaces.
42462 ///
42463 /// A zero (or unset) value has different meanings depending on machine type
42464 /// being used:
42465 ///
42466 /// 1. For pre-Gen3 machines, which support flexible numbers of local ssds,
42467 /// zero (or unset) means to disable using local SSDs as ephemeral storage. The
42468 /// limit for this value is dependent upon the maximum number of disk
42469 /// available on a machine per zone. See:
42470 /// <https://cloud.google.com/compute/docs/disks/local-ssd>
42471 /// for more information.
42472 /// 1. For Gen3 machines which dictate a specific number of local ssds, zero
42473 /// (or unset) means to use the default number of local ssds that goes with
42474 /// that machine type. For example, for a c3-standard-8-lssd machine, 2 local
42475 /// ssds would be provisioned. For c3-standard-8 (which doesn't support local
42476 /// ssds), 0 will be provisioned. See
42477 /// <https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds>
42478 /// for more info.
42479 pub local_ssd_count: i32,
42480
42481 /// Number of local SSDs to use for GKE Data Cache.
42482 pub data_cache_count: i32,
42483
42484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42485}
42486
42487impl EphemeralStorageLocalSsdConfig {
42488 /// Creates a new default instance.
42489 pub fn new() -> Self {
42490 std::default::Default::default()
42491 }
42492
42493 /// Sets the value of [local_ssd_count][crate::model::EphemeralStorageLocalSsdConfig::local_ssd_count].
42494 ///
42495 /// # Example
42496 /// ```ignore,no_run
42497 /// # use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
42498 /// let x = EphemeralStorageLocalSsdConfig::new().set_local_ssd_count(42);
42499 /// ```
42500 pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
42501 self.local_ssd_count = v.into();
42502 self
42503 }
42504
42505 /// Sets the value of [data_cache_count][crate::model::EphemeralStorageLocalSsdConfig::data_cache_count].
42506 ///
42507 /// # Example
42508 /// ```ignore,no_run
42509 /// # use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
42510 /// let x = EphemeralStorageLocalSsdConfig::new().set_data_cache_count(42);
42511 /// ```
42512 pub fn set_data_cache_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
42513 self.data_cache_count = v.into();
42514 self
42515 }
42516}
42517
42518impl wkt::message::Message for EphemeralStorageLocalSsdConfig {
42519 fn typename() -> &'static str {
42520 "type.googleapis.com/google.container.v1.EphemeralStorageLocalSsdConfig"
42521 }
42522}
42523
42524/// A map of resource manager tag keys and values to be attached to the nodes
42525/// for managing Compute Engine firewalls using Network Firewall Policies.
42526/// Tags must be according to specifications in
42527/// <https://cloud.google.com/vpc/docs/tags-firewalls-overview#specifications>.
42528/// A maximum of 5 tag key-value pairs can be specified.
42529/// Existing tags will be replaced with new values.
42530#[derive(Clone, Default, PartialEq)]
42531#[non_exhaustive]
42532pub struct ResourceManagerTags {
42533 /// TagKeyValue must be in one of the following formats ([KEY]=[VALUE])
42534 ///
42535 /// 1. `tagKeys/{tag_key_id}=tagValues/{tag_value_id}`
42536 /// 1. `{org_id}/{tag_key_name}={tag_value_name}`
42537 /// 1. `{project_id}/{tag_key_name}={tag_value_name}`
42538 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
42539
42540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42541}
42542
42543impl ResourceManagerTags {
42544 /// Creates a new default instance.
42545 pub fn new() -> Self {
42546 std::default::Default::default()
42547 }
42548
42549 /// Sets the value of [tags][crate::model::ResourceManagerTags::tags].
42550 ///
42551 /// # Example
42552 /// ```ignore,no_run
42553 /// # use google_cloud_container_v1::model::ResourceManagerTags;
42554 /// let x = ResourceManagerTags::new().set_tags([
42555 /// ("key0", "abc"),
42556 /// ("key1", "xyz"),
42557 /// ]);
42558 /// ```
42559 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
42560 where
42561 T: std::iter::IntoIterator<Item = (K, V)>,
42562 K: std::convert::Into<std::string::String>,
42563 V: std::convert::Into<std::string::String>,
42564 {
42565 use std::iter::Iterator;
42566 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
42567 self
42568 }
42569}
42570
42571impl wkt::message::Message for ResourceManagerTags {
42572 fn typename() -> &'static str {
42573 "type.googleapis.com/google.container.v1.ResourceManagerTags"
42574 }
42575}
42576
42577/// EnterpriseConfig is the cluster enterprise configuration.
42578///
42579/// Deprecated: GKE Enterprise features are now available without an Enterprise
42580/// tier.
42581#[derive(Clone, Default, PartialEq)]
42582#[non_exhaustive]
42583#[deprecated]
42584pub struct EnterpriseConfig {
42585 /// Output only. cluster_tier indicates the effective tier of the cluster.
42586 pub cluster_tier: crate::model::enterprise_config::ClusterTier,
42587
42588 /// desired_tier specifies the desired tier of the cluster.
42589 pub desired_tier: crate::model::enterprise_config::ClusterTier,
42590
42591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42592}
42593
42594impl EnterpriseConfig {
42595 /// Creates a new default instance.
42596 pub fn new() -> Self {
42597 std::default::Default::default()
42598 }
42599
42600 /// Sets the value of [cluster_tier][crate::model::EnterpriseConfig::cluster_tier].
42601 ///
42602 /// # Example
42603 /// ```ignore,no_run
42604 /// # use google_cloud_container_v1::model::EnterpriseConfig;
42605 /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
42606 /// let x0 = EnterpriseConfig::new().set_cluster_tier(ClusterTier::Standard);
42607 /// let x1 = EnterpriseConfig::new().set_cluster_tier(ClusterTier::Enterprise);
42608 /// ```
42609 pub fn set_cluster_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
42610 mut self,
42611 v: T,
42612 ) -> Self {
42613 self.cluster_tier = v.into();
42614 self
42615 }
42616
42617 /// Sets the value of [desired_tier][crate::model::EnterpriseConfig::desired_tier].
42618 ///
42619 /// # Example
42620 /// ```ignore,no_run
42621 /// # use google_cloud_container_v1::model::EnterpriseConfig;
42622 /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
42623 /// let x0 = EnterpriseConfig::new().set_desired_tier(ClusterTier::Standard);
42624 /// let x1 = EnterpriseConfig::new().set_desired_tier(ClusterTier::Enterprise);
42625 /// ```
42626 pub fn set_desired_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
42627 mut self,
42628 v: T,
42629 ) -> Self {
42630 self.desired_tier = v.into();
42631 self
42632 }
42633}
42634
42635impl wkt::message::Message for EnterpriseConfig {
42636 fn typename() -> &'static str {
42637 "type.googleapis.com/google.container.v1.EnterpriseConfig"
42638 }
42639}
42640
42641/// Defines additional types related to [EnterpriseConfig].
42642pub mod enterprise_config {
42643 #[allow(unused_imports)]
42644 use super::*;
42645
42646 /// Premium tiers for GKE Cluster.
42647 ///
42648 /// Deprecated: GKE Enterprise features are now available without an Enterprise
42649 /// tier.
42650 ///
42651 /// # Working with unknown values
42652 ///
42653 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
42654 /// additional enum variants at any time. Adding new variants is not considered
42655 /// a breaking change. Applications should write their code in anticipation of:
42656 ///
42657 /// - New values appearing in future releases of the client library, **and**
42658 /// - New values received dynamically, without application changes.
42659 ///
42660 /// Please consult the [Working with enums] section in the user guide for some
42661 /// guidelines.
42662 ///
42663 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
42664 #[derive(Clone, Debug, PartialEq)]
42665 #[non_exhaustive]
42666 #[deprecated]
42667 pub enum ClusterTier {
42668 /// CLUSTER_TIER_UNSPECIFIED is when cluster_tier is not set.
42669 Unspecified,
42670 /// STANDARD indicates a standard GKE cluster.
42671 Standard,
42672 /// ENTERPRISE indicates a GKE Enterprise cluster.
42673 Enterprise,
42674 /// If set, the enum was initialized with an unknown value.
42675 ///
42676 /// Applications can examine the value using [ClusterTier::value] or
42677 /// [ClusterTier::name].
42678 UnknownValue(cluster_tier::UnknownValue),
42679 }
42680
42681 #[doc(hidden)]
42682 pub mod cluster_tier {
42683 #[allow(unused_imports)]
42684 use super::*;
42685 #[derive(Clone, Debug, PartialEq)]
42686 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
42687 }
42688
42689 impl ClusterTier {
42690 /// Gets the enum value.
42691 ///
42692 /// Returns `None` if the enum contains an unknown value deserialized from
42693 /// the string representation of enums.
42694 pub fn value(&self) -> std::option::Option<i32> {
42695 match self {
42696 Self::Unspecified => std::option::Option::Some(0),
42697 Self::Standard => std::option::Option::Some(1),
42698 Self::Enterprise => std::option::Option::Some(2),
42699 Self::UnknownValue(u) => u.0.value(),
42700 }
42701 }
42702
42703 /// Gets the enum value as a string.
42704 ///
42705 /// Returns `None` if the enum contains an unknown value deserialized from
42706 /// the integer representation of enums.
42707 pub fn name(&self) -> std::option::Option<&str> {
42708 match self {
42709 Self::Unspecified => std::option::Option::Some("CLUSTER_TIER_UNSPECIFIED"),
42710 Self::Standard => std::option::Option::Some("STANDARD"),
42711 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
42712 Self::UnknownValue(u) => u.0.name(),
42713 }
42714 }
42715 }
42716
42717 impl std::default::Default for ClusterTier {
42718 fn default() -> Self {
42719 use std::convert::From;
42720 Self::from(0)
42721 }
42722 }
42723
42724 impl std::fmt::Display for ClusterTier {
42725 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
42726 wkt::internal::display_enum(f, self.name(), self.value())
42727 }
42728 }
42729
42730 impl std::convert::From<i32> for ClusterTier {
42731 fn from(value: i32) -> Self {
42732 match value {
42733 0 => Self::Unspecified,
42734 1 => Self::Standard,
42735 2 => Self::Enterprise,
42736 _ => Self::UnknownValue(cluster_tier::UnknownValue(
42737 wkt::internal::UnknownEnumValue::Integer(value),
42738 )),
42739 }
42740 }
42741 }
42742
42743 impl std::convert::From<&str> for ClusterTier {
42744 fn from(value: &str) -> Self {
42745 use std::string::ToString;
42746 match value {
42747 "CLUSTER_TIER_UNSPECIFIED" => Self::Unspecified,
42748 "STANDARD" => Self::Standard,
42749 "ENTERPRISE" => Self::Enterprise,
42750 _ => Self::UnknownValue(cluster_tier::UnknownValue(
42751 wkt::internal::UnknownEnumValue::String(value.to_string()),
42752 )),
42753 }
42754 }
42755 }
42756
42757 impl serde::ser::Serialize for ClusterTier {
42758 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
42759 where
42760 S: serde::Serializer,
42761 {
42762 match self {
42763 Self::Unspecified => serializer.serialize_i32(0),
42764 Self::Standard => serializer.serialize_i32(1),
42765 Self::Enterprise => serializer.serialize_i32(2),
42766 Self::UnknownValue(u) => u.0.serialize(serializer),
42767 }
42768 }
42769 }
42770
42771 impl<'de> serde::de::Deserialize<'de> for ClusterTier {
42772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
42773 where
42774 D: serde::Deserializer<'de>,
42775 {
42776 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterTier>::new(
42777 ".google.container.v1.EnterpriseConfig.ClusterTier",
42778 ))
42779 }
42780 }
42781}
42782
42783/// SecretManagerConfig is config for secret manager enablement.
42784#[derive(Clone, Default, PartialEq)]
42785#[non_exhaustive]
42786pub struct SecretManagerConfig {
42787 /// Enable/Disable Secret Manager Config.
42788 pub enabled: std::option::Option<bool>,
42789
42790 /// Rotation config for secret manager.
42791 pub rotation_config: std::option::Option<crate::model::secret_manager_config::RotationConfig>,
42792
42793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42794}
42795
42796impl SecretManagerConfig {
42797 /// Creates a new default instance.
42798 pub fn new() -> Self {
42799 std::default::Default::default()
42800 }
42801
42802 /// Sets the value of [enabled][crate::model::SecretManagerConfig::enabled].
42803 ///
42804 /// # Example
42805 /// ```ignore,no_run
42806 /// # use google_cloud_container_v1::model::SecretManagerConfig;
42807 /// let x = SecretManagerConfig::new().set_enabled(true);
42808 /// ```
42809 pub fn set_enabled<T>(mut self, v: T) -> Self
42810 where
42811 T: std::convert::Into<bool>,
42812 {
42813 self.enabled = std::option::Option::Some(v.into());
42814 self
42815 }
42816
42817 /// Sets or clears the value of [enabled][crate::model::SecretManagerConfig::enabled].
42818 ///
42819 /// # Example
42820 /// ```ignore,no_run
42821 /// # use google_cloud_container_v1::model::SecretManagerConfig;
42822 /// let x = SecretManagerConfig::new().set_or_clear_enabled(Some(false));
42823 /// let x = SecretManagerConfig::new().set_or_clear_enabled(None::<bool>);
42824 /// ```
42825 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
42826 where
42827 T: std::convert::Into<bool>,
42828 {
42829 self.enabled = v.map(|x| x.into());
42830 self
42831 }
42832
42833 /// Sets the value of [rotation_config][crate::model::SecretManagerConfig::rotation_config].
42834 ///
42835 /// # Example
42836 /// ```ignore,no_run
42837 /// # use google_cloud_container_v1::model::SecretManagerConfig;
42838 /// use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42839 /// let x = SecretManagerConfig::new().set_rotation_config(RotationConfig::default()/* use setters */);
42840 /// ```
42841 pub fn set_rotation_config<T>(mut self, v: T) -> Self
42842 where
42843 T: std::convert::Into<crate::model::secret_manager_config::RotationConfig>,
42844 {
42845 self.rotation_config = std::option::Option::Some(v.into());
42846 self
42847 }
42848
42849 /// Sets or clears the value of [rotation_config][crate::model::SecretManagerConfig::rotation_config].
42850 ///
42851 /// # Example
42852 /// ```ignore,no_run
42853 /// # use google_cloud_container_v1::model::SecretManagerConfig;
42854 /// use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42855 /// let x = SecretManagerConfig::new().set_or_clear_rotation_config(Some(RotationConfig::default()/* use setters */));
42856 /// let x = SecretManagerConfig::new().set_or_clear_rotation_config(None::<RotationConfig>);
42857 /// ```
42858 pub fn set_or_clear_rotation_config<T>(mut self, v: std::option::Option<T>) -> Self
42859 where
42860 T: std::convert::Into<crate::model::secret_manager_config::RotationConfig>,
42861 {
42862 self.rotation_config = v.map(|x| x.into());
42863 self
42864 }
42865}
42866
42867impl wkt::message::Message for SecretManagerConfig {
42868 fn typename() -> &'static str {
42869 "type.googleapis.com/google.container.v1.SecretManagerConfig"
42870 }
42871}
42872
42873/// Defines additional types related to [SecretManagerConfig].
42874pub mod secret_manager_config {
42875 #[allow(unused_imports)]
42876 use super::*;
42877
42878 /// RotationConfig is config for secret manager auto rotation.
42879 #[derive(Clone, Default, PartialEq)]
42880 #[non_exhaustive]
42881 pub struct RotationConfig {
42882 /// Whether the rotation is enabled.
42883 pub enabled: std::option::Option<bool>,
42884
42885 /// The interval between two consecutive rotations. Default rotation interval
42886 /// is 2 minutes.
42887 pub rotation_interval: std::option::Option<wkt::Duration>,
42888
42889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42890 }
42891
42892 impl RotationConfig {
42893 /// Creates a new default instance.
42894 pub fn new() -> Self {
42895 std::default::Default::default()
42896 }
42897
42898 /// Sets the value of [enabled][crate::model::secret_manager_config::RotationConfig::enabled].
42899 ///
42900 /// # Example
42901 /// ```ignore,no_run
42902 /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42903 /// let x = RotationConfig::new().set_enabled(true);
42904 /// ```
42905 pub fn set_enabled<T>(mut self, v: T) -> Self
42906 where
42907 T: std::convert::Into<bool>,
42908 {
42909 self.enabled = std::option::Option::Some(v.into());
42910 self
42911 }
42912
42913 /// Sets or clears the value of [enabled][crate::model::secret_manager_config::RotationConfig::enabled].
42914 ///
42915 /// # Example
42916 /// ```ignore,no_run
42917 /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42918 /// let x = RotationConfig::new().set_or_clear_enabled(Some(false));
42919 /// let x = RotationConfig::new().set_or_clear_enabled(None::<bool>);
42920 /// ```
42921 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
42922 where
42923 T: std::convert::Into<bool>,
42924 {
42925 self.enabled = v.map(|x| x.into());
42926 self
42927 }
42928
42929 /// Sets the value of [rotation_interval][crate::model::secret_manager_config::RotationConfig::rotation_interval].
42930 ///
42931 /// # Example
42932 /// ```ignore,no_run
42933 /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42934 /// use wkt::Duration;
42935 /// let x = RotationConfig::new().set_rotation_interval(Duration::default()/* use setters */);
42936 /// ```
42937 pub fn set_rotation_interval<T>(mut self, v: T) -> Self
42938 where
42939 T: std::convert::Into<wkt::Duration>,
42940 {
42941 self.rotation_interval = std::option::Option::Some(v.into());
42942 self
42943 }
42944
42945 /// Sets or clears the value of [rotation_interval][crate::model::secret_manager_config::RotationConfig::rotation_interval].
42946 ///
42947 /// # Example
42948 /// ```ignore,no_run
42949 /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
42950 /// use wkt::Duration;
42951 /// let x = RotationConfig::new().set_or_clear_rotation_interval(Some(Duration::default()/* use setters */));
42952 /// let x = RotationConfig::new().set_or_clear_rotation_interval(None::<Duration>);
42953 /// ```
42954 pub fn set_or_clear_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
42955 where
42956 T: std::convert::Into<wkt::Duration>,
42957 {
42958 self.rotation_interval = v.map(|x| x.into());
42959 self
42960 }
42961 }
42962
42963 impl wkt::message::Message for RotationConfig {
42964 fn typename() -> &'static str {
42965 "type.googleapis.com/google.container.v1.SecretManagerConfig.RotationConfig"
42966 }
42967 }
42968}
42969
42970/// BootDisk specifies the boot disk configuration for node pools.
42971#[derive(Clone, Default, PartialEq)]
42972#[non_exhaustive]
42973pub struct BootDisk {
42974 /// Disk type of the boot disk.
42975 /// (i.e. Hyperdisk-Balanced, PD-Balanced, etc.)
42976 pub disk_type: std::string::String,
42977
42978 /// Disk size in GB. Replaces NodeConfig.disk_size_gb
42979 pub size_gb: i64,
42980
42981 /// For Hyperdisk-Balanced only, the provisioned IOPS config value.
42982 pub provisioned_iops: i64,
42983
42984 /// For Hyperdisk-Balanced only, the provisioned throughput config value.
42985 pub provisioned_throughput: i64,
42986
42987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
42988}
42989
42990impl BootDisk {
42991 /// Creates a new default instance.
42992 pub fn new() -> Self {
42993 std::default::Default::default()
42994 }
42995
42996 /// Sets the value of [disk_type][crate::model::BootDisk::disk_type].
42997 ///
42998 /// # Example
42999 /// ```ignore,no_run
43000 /// # use google_cloud_container_v1::model::BootDisk;
43001 /// let x = BootDisk::new().set_disk_type("example");
43002 /// ```
43003 pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
43004 self.disk_type = v.into();
43005 self
43006 }
43007
43008 /// Sets the value of [size_gb][crate::model::BootDisk::size_gb].
43009 ///
43010 /// # Example
43011 /// ```ignore,no_run
43012 /// # use google_cloud_container_v1::model::BootDisk;
43013 /// let x = BootDisk::new().set_size_gb(42);
43014 /// ```
43015 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
43016 self.size_gb = v.into();
43017 self
43018 }
43019
43020 /// Sets the value of [provisioned_iops][crate::model::BootDisk::provisioned_iops].
43021 ///
43022 /// # Example
43023 /// ```ignore,no_run
43024 /// # use google_cloud_container_v1::model::BootDisk;
43025 /// let x = BootDisk::new().set_provisioned_iops(42);
43026 /// ```
43027 pub fn set_provisioned_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
43028 self.provisioned_iops = v.into();
43029 self
43030 }
43031
43032 /// Sets the value of [provisioned_throughput][crate::model::BootDisk::provisioned_throughput].
43033 ///
43034 /// # Example
43035 /// ```ignore,no_run
43036 /// # use google_cloud_container_v1::model::BootDisk;
43037 /// let x = BootDisk::new().set_provisioned_throughput(42);
43038 /// ```
43039 pub fn set_provisioned_throughput<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
43040 self.provisioned_throughput = v.into();
43041 self
43042 }
43043}
43044
43045impl wkt::message::Message for BootDisk {
43046 fn typename() -> &'static str {
43047 "type.googleapis.com/google.container.v1.BootDisk"
43048 }
43049}
43050
43051/// SecondaryBootDisk represents a persistent disk attached to a node
43052/// with special configurations based on its mode.
43053#[derive(Clone, Default, PartialEq)]
43054#[non_exhaustive]
43055pub struct SecondaryBootDisk {
43056 /// Disk mode (container image cache, etc.)
43057 pub mode: crate::model::secondary_boot_disk::Mode,
43058
43059 /// Fully-qualified resource ID for an existing disk image.
43060 pub disk_image: std::string::String,
43061
43062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
43063}
43064
43065impl SecondaryBootDisk {
43066 /// Creates a new default instance.
43067 pub fn new() -> Self {
43068 std::default::Default::default()
43069 }
43070
43071 /// Sets the value of [mode][crate::model::SecondaryBootDisk::mode].
43072 ///
43073 /// # Example
43074 /// ```ignore,no_run
43075 /// # use google_cloud_container_v1::model::SecondaryBootDisk;
43076 /// use google_cloud_container_v1::model::secondary_boot_disk::Mode;
43077 /// let x0 = SecondaryBootDisk::new().set_mode(Mode::ContainerImageCache);
43078 /// ```
43079 pub fn set_mode<T: std::convert::Into<crate::model::secondary_boot_disk::Mode>>(
43080 mut self,
43081 v: T,
43082 ) -> Self {
43083 self.mode = v.into();
43084 self
43085 }
43086
43087 /// Sets the value of [disk_image][crate::model::SecondaryBootDisk::disk_image].
43088 ///
43089 /// # Example
43090 /// ```ignore,no_run
43091 /// # use google_cloud_container_v1::model::SecondaryBootDisk;
43092 /// let x = SecondaryBootDisk::new().set_disk_image("example");
43093 /// ```
43094 pub fn set_disk_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
43095 self.disk_image = v.into();
43096 self
43097 }
43098}
43099
43100impl wkt::message::Message for SecondaryBootDisk {
43101 fn typename() -> &'static str {
43102 "type.googleapis.com/google.container.v1.SecondaryBootDisk"
43103 }
43104}
43105
43106/// Defines additional types related to [SecondaryBootDisk].
43107pub mod secondary_boot_disk {
43108 #[allow(unused_imports)]
43109 use super::*;
43110
43111 /// Mode specifies how the secondary boot disk will be used.
43112 /// This triggers mode-specified logic in the control plane.
43113 ///
43114 /// # Working with unknown values
43115 ///
43116 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
43117 /// additional enum variants at any time. Adding new variants is not considered
43118 /// a breaking change. Applications should write their code in anticipation of:
43119 ///
43120 /// - New values appearing in future releases of the client library, **and**
43121 /// - New values received dynamically, without application changes.
43122 ///
43123 /// Please consult the [Working with enums] section in the user guide for some
43124 /// guidelines.
43125 ///
43126 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
43127 #[derive(Clone, Debug, PartialEq)]
43128 #[non_exhaustive]
43129 pub enum Mode {
43130 /// MODE_UNSPECIFIED is when mode is not set.
43131 Unspecified,
43132 /// CONTAINER_IMAGE_CACHE is for using the secondary boot disk as
43133 /// a container image cache.
43134 ContainerImageCache,
43135 /// If set, the enum was initialized with an unknown value.
43136 ///
43137 /// Applications can examine the value using [Mode::value] or
43138 /// [Mode::name].
43139 UnknownValue(mode::UnknownValue),
43140 }
43141
43142 #[doc(hidden)]
43143 pub mod mode {
43144 #[allow(unused_imports)]
43145 use super::*;
43146 #[derive(Clone, Debug, PartialEq)]
43147 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
43148 }
43149
43150 impl Mode {
43151 /// Gets the enum value.
43152 ///
43153 /// Returns `None` if the enum contains an unknown value deserialized from
43154 /// the string representation of enums.
43155 pub fn value(&self) -> std::option::Option<i32> {
43156 match self {
43157 Self::Unspecified => std::option::Option::Some(0),
43158 Self::ContainerImageCache => std::option::Option::Some(1),
43159 Self::UnknownValue(u) => u.0.value(),
43160 }
43161 }
43162
43163 /// Gets the enum value as a string.
43164 ///
43165 /// Returns `None` if the enum contains an unknown value deserialized from
43166 /// the integer representation of enums.
43167 pub fn name(&self) -> std::option::Option<&str> {
43168 match self {
43169 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
43170 Self::ContainerImageCache => std::option::Option::Some("CONTAINER_IMAGE_CACHE"),
43171 Self::UnknownValue(u) => u.0.name(),
43172 }
43173 }
43174 }
43175
43176 impl std::default::Default for Mode {
43177 fn default() -> Self {
43178 use std::convert::From;
43179 Self::from(0)
43180 }
43181 }
43182
43183 impl std::fmt::Display for Mode {
43184 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
43185 wkt::internal::display_enum(f, self.name(), self.value())
43186 }
43187 }
43188
43189 impl std::convert::From<i32> for Mode {
43190 fn from(value: i32) -> Self {
43191 match value {
43192 0 => Self::Unspecified,
43193 1 => Self::ContainerImageCache,
43194 _ => Self::UnknownValue(mode::UnknownValue(
43195 wkt::internal::UnknownEnumValue::Integer(value),
43196 )),
43197 }
43198 }
43199 }
43200
43201 impl std::convert::From<&str> for Mode {
43202 fn from(value: &str) -> Self {
43203 use std::string::ToString;
43204 match value {
43205 "MODE_UNSPECIFIED" => Self::Unspecified,
43206 "CONTAINER_IMAGE_CACHE" => Self::ContainerImageCache,
43207 _ => Self::UnknownValue(mode::UnknownValue(
43208 wkt::internal::UnknownEnumValue::String(value.to_string()),
43209 )),
43210 }
43211 }
43212 }
43213
43214 impl serde::ser::Serialize for Mode {
43215 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
43216 where
43217 S: serde::Serializer,
43218 {
43219 match self {
43220 Self::Unspecified => serializer.serialize_i32(0),
43221 Self::ContainerImageCache => serializer.serialize_i32(1),
43222 Self::UnknownValue(u) => u.0.serialize(serializer),
43223 }
43224 }
43225 }
43226
43227 impl<'de> serde::de::Deserialize<'de> for Mode {
43228 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
43229 where
43230 D: serde::Deserializer<'de>,
43231 {
43232 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
43233 ".google.container.v1.SecondaryBootDisk.Mode",
43234 ))
43235 }
43236 }
43237}
43238
43239/// SecondaryBootDiskUpdateStrategy is a placeholder which will be extended
43240/// in the future to define different options for updating secondary boot disks.
43241#[derive(Clone, Default, PartialEq)]
43242#[non_exhaustive]
43243pub struct SecondaryBootDiskUpdateStrategy {
43244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
43245}
43246
43247impl SecondaryBootDiskUpdateStrategy {
43248 /// Creates a new default instance.
43249 pub fn new() -> Self {
43250 std::default::Default::default()
43251 }
43252}
43253
43254impl wkt::message::Message for SecondaryBootDiskUpdateStrategy {
43255 fn typename() -> &'static str {
43256 "type.googleapis.com/google.container.v1.SecondaryBootDiskUpdateStrategy"
43257 }
43258}
43259
43260/// FetchClusterUpgradeInfoRequest fetches the upgrade information of a cluster.
43261#[derive(Clone, Default, PartialEq)]
43262#[non_exhaustive]
43263pub struct FetchClusterUpgradeInfoRequest {
43264 /// Required. The name (project, location, cluster) of the cluster to get.
43265 /// Specified in the format `projects/*/locations/*/clusters/*` or
43266 /// `projects/*/zones/*/clusters/*`.
43267 pub name: std::string::String,
43268
43269 /// API request version that initiates this operation.
43270 pub version: std::string::String,
43271
43272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
43273}
43274
43275impl FetchClusterUpgradeInfoRequest {
43276 /// Creates a new default instance.
43277 pub fn new() -> Self {
43278 std::default::Default::default()
43279 }
43280
43281 /// Sets the value of [name][crate::model::FetchClusterUpgradeInfoRequest::name].
43282 ///
43283 /// # Example
43284 /// ```ignore,no_run
43285 /// # use google_cloud_container_v1::model::FetchClusterUpgradeInfoRequest;
43286 /// let x = FetchClusterUpgradeInfoRequest::new().set_name("example");
43287 /// ```
43288 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
43289 self.name = v.into();
43290 self
43291 }
43292
43293 /// Sets the value of [version][crate::model::FetchClusterUpgradeInfoRequest::version].
43294 ///
43295 /// # Example
43296 /// ```ignore,no_run
43297 /// # use google_cloud_container_v1::model::FetchClusterUpgradeInfoRequest;
43298 /// let x = FetchClusterUpgradeInfoRequest::new().set_version("example");
43299 /// ```
43300 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
43301 self.version = v.into();
43302 self
43303 }
43304}
43305
43306impl wkt::message::Message for FetchClusterUpgradeInfoRequest {
43307 fn typename() -> &'static str {
43308 "type.googleapis.com/google.container.v1.FetchClusterUpgradeInfoRequest"
43309 }
43310}
43311
43312/// ClusterUpgradeInfo contains the upgrade information of a cluster.
43313#[derive(Clone, Default, PartialEq)]
43314#[non_exhaustive]
43315pub struct ClusterUpgradeInfo {
43316 /// minor_target_version indicates the target version for minor upgrade.
43317 pub minor_target_version: std::option::Option<std::string::String>,
43318
43319 /// patch_target_version indicates the target version for patch upgrade.
43320 pub patch_target_version: std::option::Option<std::string::String>,
43321
43322 /// The auto upgrade status.
43323 pub auto_upgrade_status: std::vec::Vec<crate::model::cluster_upgrade_info::AutoUpgradeStatus>,
43324
43325 /// The auto upgrade paused reason.
43326 pub paused_reason: std::vec::Vec<crate::model::cluster_upgrade_info::AutoUpgradePausedReason>,
43327
43328 /// The list of past auto upgrades.
43329 pub upgrade_details: std::vec::Vec<crate::model::UpgradeDetails>,
43330
43331 /// The cluster's current minor version's end of standard support timestamp.
43332 pub end_of_standard_support_timestamp: std::option::Option<std::string::String>,
43333
43334 /// The cluster's current minor version's end of extended support timestamp.
43335 pub end_of_extended_support_timestamp: std::option::Option<std::string::String>,
43336
43337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
43338}
43339
43340impl ClusterUpgradeInfo {
43341 /// Creates a new default instance.
43342 pub fn new() -> Self {
43343 std::default::Default::default()
43344 }
43345
43346 /// Sets the value of [minor_target_version][crate::model::ClusterUpgradeInfo::minor_target_version].
43347 ///
43348 /// # Example
43349 /// ```ignore,no_run
43350 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43351 /// let x = ClusterUpgradeInfo::new().set_minor_target_version("example");
43352 /// ```
43353 pub fn set_minor_target_version<T>(mut self, v: T) -> Self
43354 where
43355 T: std::convert::Into<std::string::String>,
43356 {
43357 self.minor_target_version = std::option::Option::Some(v.into());
43358 self
43359 }
43360
43361 /// Sets or clears the value of [minor_target_version][crate::model::ClusterUpgradeInfo::minor_target_version].
43362 ///
43363 /// # Example
43364 /// ```ignore,no_run
43365 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43366 /// let x = ClusterUpgradeInfo::new().set_or_clear_minor_target_version(Some("example"));
43367 /// let x = ClusterUpgradeInfo::new().set_or_clear_minor_target_version(None::<String>);
43368 /// ```
43369 pub fn set_or_clear_minor_target_version<T>(mut self, v: std::option::Option<T>) -> Self
43370 where
43371 T: std::convert::Into<std::string::String>,
43372 {
43373 self.minor_target_version = v.map(|x| x.into());
43374 self
43375 }
43376
43377 /// Sets the value of [patch_target_version][crate::model::ClusterUpgradeInfo::patch_target_version].
43378 ///
43379 /// # Example
43380 /// ```ignore,no_run
43381 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43382 /// let x = ClusterUpgradeInfo::new().set_patch_target_version("example");
43383 /// ```
43384 pub fn set_patch_target_version<T>(mut self, v: T) -> Self
43385 where
43386 T: std::convert::Into<std::string::String>,
43387 {
43388 self.patch_target_version = std::option::Option::Some(v.into());
43389 self
43390 }
43391
43392 /// Sets or clears the value of [patch_target_version][crate::model::ClusterUpgradeInfo::patch_target_version].
43393 ///
43394 /// # Example
43395 /// ```ignore,no_run
43396 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43397 /// let x = ClusterUpgradeInfo::new().set_or_clear_patch_target_version(Some("example"));
43398 /// let x = ClusterUpgradeInfo::new().set_or_clear_patch_target_version(None::<String>);
43399 /// ```
43400 pub fn set_or_clear_patch_target_version<T>(mut self, v: std::option::Option<T>) -> Self
43401 where
43402 T: std::convert::Into<std::string::String>,
43403 {
43404 self.patch_target_version = v.map(|x| x.into());
43405 self
43406 }
43407
43408 /// Sets the value of [auto_upgrade_status][crate::model::ClusterUpgradeInfo::auto_upgrade_status].
43409 ///
43410 /// # Example
43411 /// ```ignore,no_run
43412 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43413 /// use google_cloud_container_v1::model::cluster_upgrade_info::AutoUpgradeStatus;
43414 /// let x = ClusterUpgradeInfo::new().set_auto_upgrade_status([
43415 /// AutoUpgradeStatus::Active,
43416 /// AutoUpgradeStatus::MinorUpgradePaused,
43417 /// AutoUpgradeStatus::UpgradePaused,
43418 /// ]);
43419 /// ```
43420 pub fn set_auto_upgrade_status<T, V>(mut self, v: T) -> Self
43421 where
43422 T: std::iter::IntoIterator<Item = V>,
43423 V: std::convert::Into<crate::model::cluster_upgrade_info::AutoUpgradeStatus>,
43424 {
43425 use std::iter::Iterator;
43426 self.auto_upgrade_status = v.into_iter().map(|i| i.into()).collect();
43427 self
43428 }
43429
43430 /// Sets the value of [paused_reason][crate::model::ClusterUpgradeInfo::paused_reason].
43431 ///
43432 /// # Example
43433 /// ```ignore,no_run
43434 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43435 /// use google_cloud_container_v1::model::cluster_upgrade_info::AutoUpgradePausedReason;
43436 /// let x = ClusterUpgradeInfo::new().set_paused_reason([
43437 /// AutoUpgradePausedReason::MaintenanceWindow,
43438 /// AutoUpgradePausedReason::MaintenanceExclusionNoUpgrades,
43439 /// AutoUpgradePausedReason::MaintenanceExclusionNoMinorUpgrades,
43440 /// ]);
43441 /// ```
43442 pub fn set_paused_reason<T, V>(mut self, v: T) -> Self
43443 where
43444 T: std::iter::IntoIterator<Item = V>,
43445 V: std::convert::Into<crate::model::cluster_upgrade_info::AutoUpgradePausedReason>,
43446 {
43447 use std::iter::Iterator;
43448 self.paused_reason = v.into_iter().map(|i| i.into()).collect();
43449 self
43450 }
43451
43452 /// Sets the value of [upgrade_details][crate::model::ClusterUpgradeInfo::upgrade_details].
43453 ///
43454 /// # Example
43455 /// ```ignore,no_run
43456 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43457 /// use google_cloud_container_v1::model::UpgradeDetails;
43458 /// let x = ClusterUpgradeInfo::new()
43459 /// .set_upgrade_details([
43460 /// UpgradeDetails::default()/* use setters */,
43461 /// UpgradeDetails::default()/* use (different) setters */,
43462 /// ]);
43463 /// ```
43464 pub fn set_upgrade_details<T, V>(mut self, v: T) -> Self
43465 where
43466 T: std::iter::IntoIterator<Item = V>,
43467 V: std::convert::Into<crate::model::UpgradeDetails>,
43468 {
43469 use std::iter::Iterator;
43470 self.upgrade_details = v.into_iter().map(|i| i.into()).collect();
43471 self
43472 }
43473
43474 /// Sets the value of [end_of_standard_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_standard_support_timestamp].
43475 ///
43476 /// # Example
43477 /// ```ignore,no_run
43478 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43479 /// let x = ClusterUpgradeInfo::new().set_end_of_standard_support_timestamp("example");
43480 /// ```
43481 pub fn set_end_of_standard_support_timestamp<T>(mut self, v: T) -> Self
43482 where
43483 T: std::convert::Into<std::string::String>,
43484 {
43485 self.end_of_standard_support_timestamp = std::option::Option::Some(v.into());
43486 self
43487 }
43488
43489 /// Sets or clears the value of [end_of_standard_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_standard_support_timestamp].
43490 ///
43491 /// # Example
43492 /// ```ignore,no_run
43493 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43494 /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(Some("example"));
43495 /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(None::<String>);
43496 /// ```
43497 pub fn set_or_clear_end_of_standard_support_timestamp<T>(
43498 mut self,
43499 v: std::option::Option<T>,
43500 ) -> Self
43501 where
43502 T: std::convert::Into<std::string::String>,
43503 {
43504 self.end_of_standard_support_timestamp = v.map(|x| x.into());
43505 self
43506 }
43507
43508 /// Sets the value of [end_of_extended_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_extended_support_timestamp].
43509 ///
43510 /// # Example
43511 /// ```ignore,no_run
43512 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43513 /// let x = ClusterUpgradeInfo::new().set_end_of_extended_support_timestamp("example");
43514 /// ```
43515 pub fn set_end_of_extended_support_timestamp<T>(mut self, v: T) -> Self
43516 where
43517 T: std::convert::Into<std::string::String>,
43518 {
43519 self.end_of_extended_support_timestamp = std::option::Option::Some(v.into());
43520 self
43521 }
43522
43523 /// Sets or clears the value of [end_of_extended_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_extended_support_timestamp].
43524 ///
43525 /// # Example
43526 /// ```ignore,no_run
43527 /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
43528 /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(Some("example"));
43529 /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(None::<String>);
43530 /// ```
43531 pub fn set_or_clear_end_of_extended_support_timestamp<T>(
43532 mut self,
43533 v: std::option::Option<T>,
43534 ) -> Self
43535 where
43536 T: std::convert::Into<std::string::String>,
43537 {
43538 self.end_of_extended_support_timestamp = v.map(|x| x.into());
43539 self
43540 }
43541}
43542
43543impl wkt::message::Message for ClusterUpgradeInfo {
43544 fn typename() -> &'static str {
43545 "type.googleapis.com/google.container.v1.ClusterUpgradeInfo"
43546 }
43547}
43548
43549/// Defines additional types related to [ClusterUpgradeInfo].
43550pub mod cluster_upgrade_info {
43551 #[allow(unused_imports)]
43552 use super::*;
43553
43554 /// AutoUpgradeStatus indicates the status of auto upgrade.
43555 ///
43556 /// # Working with unknown values
43557 ///
43558 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
43559 /// additional enum variants at any time. Adding new variants is not considered
43560 /// a breaking change. Applications should write their code in anticipation of:
43561 ///
43562 /// - New values appearing in future releases of the client library, **and**
43563 /// - New values received dynamically, without application changes.
43564 ///
43565 /// Please consult the [Working with enums] section in the user guide for some
43566 /// guidelines.
43567 ///
43568 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
43569 #[derive(Clone, Debug, PartialEq)]
43570 #[non_exhaustive]
43571 pub enum AutoUpgradeStatus {
43572 /// UNKNOWN indicates an unknown status.
43573 Unknown,
43574 /// ACTIVE indicates an active status.
43575 Active,
43576 /// MINOR_UPGRADE_PAUSED indicates the minor version upgrade is
43577 /// paused.
43578 MinorUpgradePaused,
43579 /// UPGRADE_PAUSED indicates the upgrade is paused.
43580 UpgradePaused,
43581 /// If set, the enum was initialized with an unknown value.
43582 ///
43583 /// Applications can examine the value using [AutoUpgradeStatus::value] or
43584 /// [AutoUpgradeStatus::name].
43585 UnknownValue(auto_upgrade_status::UnknownValue),
43586 }
43587
43588 #[doc(hidden)]
43589 pub mod auto_upgrade_status {
43590 #[allow(unused_imports)]
43591 use super::*;
43592 #[derive(Clone, Debug, PartialEq)]
43593 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
43594 }
43595
43596 impl AutoUpgradeStatus {
43597 /// Gets the enum value.
43598 ///
43599 /// Returns `None` if the enum contains an unknown value deserialized from
43600 /// the string representation of enums.
43601 pub fn value(&self) -> std::option::Option<i32> {
43602 match self {
43603 Self::Unknown => std::option::Option::Some(0),
43604 Self::Active => std::option::Option::Some(1),
43605 Self::MinorUpgradePaused => std::option::Option::Some(4),
43606 Self::UpgradePaused => std::option::Option::Some(5),
43607 Self::UnknownValue(u) => u.0.value(),
43608 }
43609 }
43610
43611 /// Gets the enum value as a string.
43612 ///
43613 /// Returns `None` if the enum contains an unknown value deserialized from
43614 /// the integer representation of enums.
43615 pub fn name(&self) -> std::option::Option<&str> {
43616 match self {
43617 Self::Unknown => std::option::Option::Some("UNKNOWN"),
43618 Self::Active => std::option::Option::Some("ACTIVE"),
43619 Self::MinorUpgradePaused => std::option::Option::Some("MINOR_UPGRADE_PAUSED"),
43620 Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
43621 Self::UnknownValue(u) => u.0.name(),
43622 }
43623 }
43624 }
43625
43626 impl std::default::Default for AutoUpgradeStatus {
43627 fn default() -> Self {
43628 use std::convert::From;
43629 Self::from(0)
43630 }
43631 }
43632
43633 impl std::fmt::Display for AutoUpgradeStatus {
43634 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
43635 wkt::internal::display_enum(f, self.name(), self.value())
43636 }
43637 }
43638
43639 impl std::convert::From<i32> for AutoUpgradeStatus {
43640 fn from(value: i32) -> Self {
43641 match value {
43642 0 => Self::Unknown,
43643 1 => Self::Active,
43644 4 => Self::MinorUpgradePaused,
43645 5 => Self::UpgradePaused,
43646 _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
43647 wkt::internal::UnknownEnumValue::Integer(value),
43648 )),
43649 }
43650 }
43651 }
43652
43653 impl std::convert::From<&str> for AutoUpgradeStatus {
43654 fn from(value: &str) -> Self {
43655 use std::string::ToString;
43656 match value {
43657 "UNKNOWN" => Self::Unknown,
43658 "ACTIVE" => Self::Active,
43659 "MINOR_UPGRADE_PAUSED" => Self::MinorUpgradePaused,
43660 "UPGRADE_PAUSED" => Self::UpgradePaused,
43661 _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
43662 wkt::internal::UnknownEnumValue::String(value.to_string()),
43663 )),
43664 }
43665 }
43666 }
43667
43668 impl serde::ser::Serialize for AutoUpgradeStatus {
43669 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
43670 where
43671 S: serde::Serializer,
43672 {
43673 match self {
43674 Self::Unknown => serializer.serialize_i32(0),
43675 Self::Active => serializer.serialize_i32(1),
43676 Self::MinorUpgradePaused => serializer.serialize_i32(4),
43677 Self::UpgradePaused => serializer.serialize_i32(5),
43678 Self::UnknownValue(u) => u.0.serialize(serializer),
43679 }
43680 }
43681 }
43682
43683 impl<'de> serde::de::Deserialize<'de> for AutoUpgradeStatus {
43684 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
43685 where
43686 D: serde::Deserializer<'de>,
43687 {
43688 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoUpgradeStatus>::new(
43689 ".google.container.v1.ClusterUpgradeInfo.AutoUpgradeStatus",
43690 ))
43691 }
43692 }
43693
43694 /// AutoUpgradePausedReason indicates the reason for auto upgrade paused
43695 /// status.
43696 ///
43697 /// # Working with unknown values
43698 ///
43699 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
43700 /// additional enum variants at any time. Adding new variants is not considered
43701 /// a breaking change. Applications should write their code in anticipation of:
43702 ///
43703 /// - New values appearing in future releases of the client library, **and**
43704 /// - New values received dynamically, without application changes.
43705 ///
43706 /// Please consult the [Working with enums] section in the user guide for some
43707 /// guidelines.
43708 ///
43709 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
43710 #[derive(Clone, Debug, PartialEq)]
43711 #[non_exhaustive]
43712 pub enum AutoUpgradePausedReason {
43713 /// AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED indicates an unspecified reason.
43714 Unspecified,
43715 /// MAINTENANCE_WINDOW indicates the cluster is outside customer maintenance
43716 /// window.
43717 MaintenanceWindow,
43718 /// MAINTENANCE_EXCLUSION_NO_UPGRADES indicates the cluster is in a
43719 /// maintenance exclusion with scope NO_UPGRADES.
43720 MaintenanceExclusionNoUpgrades,
43721 /// MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES indicates the cluster is in a
43722 /// maintenance exclusion with scope NO_MINOR_UPGRADES.
43723 MaintenanceExclusionNoMinorUpgrades,
43724 /// CLUSTER_DISRUPTION_BUDGET indicates the cluster is outside the cluster
43725 /// disruption budget.
43726 ClusterDisruptionBudget,
43727 /// CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE indicates the cluster is outside
43728 /// the cluster disruption budget for minor version upgrade.
43729 ClusterDisruptionBudgetMinorUpgrade,
43730 /// SYSTEM_CONFIG indicates the cluster upgrade is paused by system config.
43731 SystemConfig,
43732 /// If set, the enum was initialized with an unknown value.
43733 ///
43734 /// Applications can examine the value using [AutoUpgradePausedReason::value] or
43735 /// [AutoUpgradePausedReason::name].
43736 UnknownValue(auto_upgrade_paused_reason::UnknownValue),
43737 }
43738
43739 #[doc(hidden)]
43740 pub mod auto_upgrade_paused_reason {
43741 #[allow(unused_imports)]
43742 use super::*;
43743 #[derive(Clone, Debug, PartialEq)]
43744 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
43745 }
43746
43747 impl AutoUpgradePausedReason {
43748 /// Gets the enum value.
43749 ///
43750 /// Returns `None` if the enum contains an unknown value deserialized from
43751 /// the string representation of enums.
43752 pub fn value(&self) -> std::option::Option<i32> {
43753 match self {
43754 Self::Unspecified => std::option::Option::Some(0),
43755 Self::MaintenanceWindow => std::option::Option::Some(1),
43756 Self::MaintenanceExclusionNoUpgrades => std::option::Option::Some(5),
43757 Self::MaintenanceExclusionNoMinorUpgrades => std::option::Option::Some(6),
43758 Self::ClusterDisruptionBudget => std::option::Option::Some(4),
43759 Self::ClusterDisruptionBudgetMinorUpgrade => std::option::Option::Some(7),
43760 Self::SystemConfig => std::option::Option::Some(8),
43761 Self::UnknownValue(u) => u.0.value(),
43762 }
43763 }
43764
43765 /// Gets the enum value as a string.
43766 ///
43767 /// Returns `None` if the enum contains an unknown value deserialized from
43768 /// the integer representation of enums.
43769 pub fn name(&self) -> std::option::Option<&str> {
43770 match self {
43771 Self::Unspecified => {
43772 std::option::Option::Some("AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED")
43773 }
43774 Self::MaintenanceWindow => std::option::Option::Some("MAINTENANCE_WINDOW"),
43775 Self::MaintenanceExclusionNoUpgrades => {
43776 std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_UPGRADES")
43777 }
43778 Self::MaintenanceExclusionNoMinorUpgrades => {
43779 std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES")
43780 }
43781 Self::ClusterDisruptionBudget => {
43782 std::option::Option::Some("CLUSTER_DISRUPTION_BUDGET")
43783 }
43784 Self::ClusterDisruptionBudgetMinorUpgrade => {
43785 std::option::Option::Some("CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE")
43786 }
43787 Self::SystemConfig => std::option::Option::Some("SYSTEM_CONFIG"),
43788 Self::UnknownValue(u) => u.0.name(),
43789 }
43790 }
43791 }
43792
43793 impl std::default::Default for AutoUpgradePausedReason {
43794 fn default() -> Self {
43795 use std::convert::From;
43796 Self::from(0)
43797 }
43798 }
43799
43800 impl std::fmt::Display for AutoUpgradePausedReason {
43801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
43802 wkt::internal::display_enum(f, self.name(), self.value())
43803 }
43804 }
43805
43806 impl std::convert::From<i32> for AutoUpgradePausedReason {
43807 fn from(value: i32) -> Self {
43808 match value {
43809 0 => Self::Unspecified,
43810 1 => Self::MaintenanceWindow,
43811 4 => Self::ClusterDisruptionBudget,
43812 5 => Self::MaintenanceExclusionNoUpgrades,
43813 6 => Self::MaintenanceExclusionNoMinorUpgrades,
43814 7 => Self::ClusterDisruptionBudgetMinorUpgrade,
43815 8 => Self::SystemConfig,
43816 _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
43817 wkt::internal::UnknownEnumValue::Integer(value),
43818 )),
43819 }
43820 }
43821 }
43822
43823 impl std::convert::From<&str> for AutoUpgradePausedReason {
43824 fn from(value: &str) -> Self {
43825 use std::string::ToString;
43826 match value {
43827 "AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED" => Self::Unspecified,
43828 "MAINTENANCE_WINDOW" => Self::MaintenanceWindow,
43829 "MAINTENANCE_EXCLUSION_NO_UPGRADES" => Self::MaintenanceExclusionNoUpgrades,
43830 "MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES" => {
43831 Self::MaintenanceExclusionNoMinorUpgrades
43832 }
43833 "CLUSTER_DISRUPTION_BUDGET" => Self::ClusterDisruptionBudget,
43834 "CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE" => {
43835 Self::ClusterDisruptionBudgetMinorUpgrade
43836 }
43837 "SYSTEM_CONFIG" => Self::SystemConfig,
43838 _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
43839 wkt::internal::UnknownEnumValue::String(value.to_string()),
43840 )),
43841 }
43842 }
43843 }
43844
43845 impl serde::ser::Serialize for AutoUpgradePausedReason {
43846 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
43847 where
43848 S: serde::Serializer,
43849 {
43850 match self {
43851 Self::Unspecified => serializer.serialize_i32(0),
43852 Self::MaintenanceWindow => serializer.serialize_i32(1),
43853 Self::MaintenanceExclusionNoUpgrades => serializer.serialize_i32(5),
43854 Self::MaintenanceExclusionNoMinorUpgrades => serializer.serialize_i32(6),
43855 Self::ClusterDisruptionBudget => serializer.serialize_i32(4),
43856 Self::ClusterDisruptionBudgetMinorUpgrade => serializer.serialize_i32(7),
43857 Self::SystemConfig => serializer.serialize_i32(8),
43858 Self::UnknownValue(u) => u.0.serialize(serializer),
43859 }
43860 }
43861 }
43862
43863 impl<'de> serde::de::Deserialize<'de> for AutoUpgradePausedReason {
43864 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
43865 where
43866 D: serde::Deserializer<'de>,
43867 {
43868 deserializer.deserialize_any(
43869 wkt::internal::EnumVisitor::<AutoUpgradePausedReason>::new(
43870 ".google.container.v1.ClusterUpgradeInfo.AutoUpgradePausedReason",
43871 ),
43872 )
43873 }
43874 }
43875}
43876
43877/// UpgradeDetails contains detailed information of each individual upgrade
43878/// operation.
43879#[derive(Clone, Default, PartialEq)]
43880#[non_exhaustive]
43881pub struct UpgradeDetails {
43882 /// Output only. The state of the upgrade.
43883 pub state: crate::model::upgrade_details::State,
43884
43885 /// The start timestamp of the upgrade.
43886 pub start_time: std::option::Option<wkt::Timestamp>,
43887
43888 /// The end timestamp of the upgrade.
43889 pub end_time: std::option::Option<wkt::Timestamp>,
43890
43891 /// The version before the upgrade.
43892 pub initial_version: std::string::String,
43893
43894 /// The version after the upgrade.
43895 pub target_version: std::string::String,
43896
43897 /// The start type of the upgrade.
43898 pub start_type: crate::model::upgrade_details::StartType,
43899
43900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
43901}
43902
43903impl UpgradeDetails {
43904 /// Creates a new default instance.
43905 pub fn new() -> Self {
43906 std::default::Default::default()
43907 }
43908
43909 /// Sets the value of [state][crate::model::UpgradeDetails::state].
43910 ///
43911 /// # Example
43912 /// ```ignore,no_run
43913 /// # use google_cloud_container_v1::model::UpgradeDetails;
43914 /// use google_cloud_container_v1::model::upgrade_details::State;
43915 /// let x0 = UpgradeDetails::new().set_state(State::Failed);
43916 /// let x1 = UpgradeDetails::new().set_state(State::Succeeded);
43917 /// let x2 = UpgradeDetails::new().set_state(State::Canceled);
43918 /// ```
43919 pub fn set_state<T: std::convert::Into<crate::model::upgrade_details::State>>(
43920 mut self,
43921 v: T,
43922 ) -> Self {
43923 self.state = v.into();
43924 self
43925 }
43926
43927 /// Sets the value of [start_time][crate::model::UpgradeDetails::start_time].
43928 ///
43929 /// # Example
43930 /// ```ignore,no_run
43931 /// # use google_cloud_container_v1::model::UpgradeDetails;
43932 /// use wkt::Timestamp;
43933 /// let x = UpgradeDetails::new().set_start_time(Timestamp::default()/* use setters */);
43934 /// ```
43935 pub fn set_start_time<T>(mut self, v: T) -> Self
43936 where
43937 T: std::convert::Into<wkt::Timestamp>,
43938 {
43939 self.start_time = std::option::Option::Some(v.into());
43940 self
43941 }
43942
43943 /// Sets or clears the value of [start_time][crate::model::UpgradeDetails::start_time].
43944 ///
43945 /// # Example
43946 /// ```ignore,no_run
43947 /// # use google_cloud_container_v1::model::UpgradeDetails;
43948 /// use wkt::Timestamp;
43949 /// let x = UpgradeDetails::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
43950 /// let x = UpgradeDetails::new().set_or_clear_start_time(None::<Timestamp>);
43951 /// ```
43952 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
43953 where
43954 T: std::convert::Into<wkt::Timestamp>,
43955 {
43956 self.start_time = v.map(|x| x.into());
43957 self
43958 }
43959
43960 /// Sets the value of [end_time][crate::model::UpgradeDetails::end_time].
43961 ///
43962 /// # Example
43963 /// ```ignore,no_run
43964 /// # use google_cloud_container_v1::model::UpgradeDetails;
43965 /// use wkt::Timestamp;
43966 /// let x = UpgradeDetails::new().set_end_time(Timestamp::default()/* use setters */);
43967 /// ```
43968 pub fn set_end_time<T>(mut self, v: T) -> Self
43969 where
43970 T: std::convert::Into<wkt::Timestamp>,
43971 {
43972 self.end_time = std::option::Option::Some(v.into());
43973 self
43974 }
43975
43976 /// Sets or clears the value of [end_time][crate::model::UpgradeDetails::end_time].
43977 ///
43978 /// # Example
43979 /// ```ignore,no_run
43980 /// # use google_cloud_container_v1::model::UpgradeDetails;
43981 /// use wkt::Timestamp;
43982 /// let x = UpgradeDetails::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
43983 /// let x = UpgradeDetails::new().set_or_clear_end_time(None::<Timestamp>);
43984 /// ```
43985 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
43986 where
43987 T: std::convert::Into<wkt::Timestamp>,
43988 {
43989 self.end_time = v.map(|x| x.into());
43990 self
43991 }
43992
43993 /// Sets the value of [initial_version][crate::model::UpgradeDetails::initial_version].
43994 ///
43995 /// # Example
43996 /// ```ignore,no_run
43997 /// # use google_cloud_container_v1::model::UpgradeDetails;
43998 /// let x = UpgradeDetails::new().set_initial_version("example");
43999 /// ```
44000 pub fn set_initial_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
44001 self.initial_version = v.into();
44002 self
44003 }
44004
44005 /// Sets the value of [target_version][crate::model::UpgradeDetails::target_version].
44006 ///
44007 /// # Example
44008 /// ```ignore,no_run
44009 /// # use google_cloud_container_v1::model::UpgradeDetails;
44010 /// let x = UpgradeDetails::new().set_target_version("example");
44011 /// ```
44012 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
44013 self.target_version = v.into();
44014 self
44015 }
44016
44017 /// Sets the value of [start_type][crate::model::UpgradeDetails::start_type].
44018 ///
44019 /// # Example
44020 /// ```ignore,no_run
44021 /// # use google_cloud_container_v1::model::UpgradeDetails;
44022 /// use google_cloud_container_v1::model::upgrade_details::StartType;
44023 /// let x0 = UpgradeDetails::new().set_start_type(StartType::Automatic);
44024 /// let x1 = UpgradeDetails::new().set_start_type(StartType::Manual);
44025 /// ```
44026 pub fn set_start_type<T: std::convert::Into<crate::model::upgrade_details::StartType>>(
44027 mut self,
44028 v: T,
44029 ) -> Self {
44030 self.start_type = v.into();
44031 self
44032 }
44033}
44034
44035impl wkt::message::Message for UpgradeDetails {
44036 fn typename() -> &'static str {
44037 "type.googleapis.com/google.container.v1.UpgradeDetails"
44038 }
44039}
44040
44041/// Defines additional types related to [UpgradeDetails].
44042pub mod upgrade_details {
44043 #[allow(unused_imports)]
44044 use super::*;
44045
44046 /// State indicates the state of the upgrade.
44047 ///
44048 /// # Working with unknown values
44049 ///
44050 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
44051 /// additional enum variants at any time. Adding new variants is not considered
44052 /// a breaking change. Applications should write their code in anticipation of:
44053 ///
44054 /// - New values appearing in future releases of the client library, **and**
44055 /// - New values received dynamically, without application changes.
44056 ///
44057 /// Please consult the [Working with enums] section in the user guide for some
44058 /// guidelines.
44059 ///
44060 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
44061 #[derive(Clone, Debug, PartialEq)]
44062 #[non_exhaustive]
44063 pub enum State {
44064 /// Upgrade state is unknown.
44065 Unknown,
44066 /// Upgrade has failed with an error.
44067 Failed,
44068 /// Upgrade has succeeded.
44069 Succeeded,
44070 /// Upgrade has been canceled.
44071 Canceled,
44072 /// Upgrade is running.
44073 Running,
44074 /// If set, the enum was initialized with an unknown value.
44075 ///
44076 /// Applications can examine the value using [State::value] or
44077 /// [State::name].
44078 UnknownValue(state::UnknownValue),
44079 }
44080
44081 #[doc(hidden)]
44082 pub mod state {
44083 #[allow(unused_imports)]
44084 use super::*;
44085 #[derive(Clone, Debug, PartialEq)]
44086 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
44087 }
44088
44089 impl State {
44090 /// Gets the enum value.
44091 ///
44092 /// Returns `None` if the enum contains an unknown value deserialized from
44093 /// the string representation of enums.
44094 pub fn value(&self) -> std::option::Option<i32> {
44095 match self {
44096 Self::Unknown => std::option::Option::Some(0),
44097 Self::Failed => std::option::Option::Some(1),
44098 Self::Succeeded => std::option::Option::Some(2),
44099 Self::Canceled => std::option::Option::Some(3),
44100 Self::Running => std::option::Option::Some(4),
44101 Self::UnknownValue(u) => u.0.value(),
44102 }
44103 }
44104
44105 /// Gets the enum value as a string.
44106 ///
44107 /// Returns `None` if the enum contains an unknown value deserialized from
44108 /// the integer representation of enums.
44109 pub fn name(&self) -> std::option::Option<&str> {
44110 match self {
44111 Self::Unknown => std::option::Option::Some("UNKNOWN"),
44112 Self::Failed => std::option::Option::Some("FAILED"),
44113 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
44114 Self::Canceled => std::option::Option::Some("CANCELED"),
44115 Self::Running => std::option::Option::Some("RUNNING"),
44116 Self::UnknownValue(u) => u.0.name(),
44117 }
44118 }
44119 }
44120
44121 impl std::default::Default for State {
44122 fn default() -> Self {
44123 use std::convert::From;
44124 Self::from(0)
44125 }
44126 }
44127
44128 impl std::fmt::Display for State {
44129 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
44130 wkt::internal::display_enum(f, self.name(), self.value())
44131 }
44132 }
44133
44134 impl std::convert::From<i32> for State {
44135 fn from(value: i32) -> Self {
44136 match value {
44137 0 => Self::Unknown,
44138 1 => Self::Failed,
44139 2 => Self::Succeeded,
44140 3 => Self::Canceled,
44141 4 => Self::Running,
44142 _ => Self::UnknownValue(state::UnknownValue(
44143 wkt::internal::UnknownEnumValue::Integer(value),
44144 )),
44145 }
44146 }
44147 }
44148
44149 impl std::convert::From<&str> for State {
44150 fn from(value: &str) -> Self {
44151 use std::string::ToString;
44152 match value {
44153 "UNKNOWN" => Self::Unknown,
44154 "FAILED" => Self::Failed,
44155 "SUCCEEDED" => Self::Succeeded,
44156 "CANCELED" => Self::Canceled,
44157 "RUNNING" => Self::Running,
44158 _ => Self::UnknownValue(state::UnknownValue(
44159 wkt::internal::UnknownEnumValue::String(value.to_string()),
44160 )),
44161 }
44162 }
44163 }
44164
44165 impl serde::ser::Serialize for State {
44166 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
44167 where
44168 S: serde::Serializer,
44169 {
44170 match self {
44171 Self::Unknown => serializer.serialize_i32(0),
44172 Self::Failed => serializer.serialize_i32(1),
44173 Self::Succeeded => serializer.serialize_i32(2),
44174 Self::Canceled => serializer.serialize_i32(3),
44175 Self::Running => serializer.serialize_i32(4),
44176 Self::UnknownValue(u) => u.0.serialize(serializer),
44177 }
44178 }
44179 }
44180
44181 impl<'de> serde::de::Deserialize<'de> for State {
44182 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
44183 where
44184 D: serde::Deserializer<'de>,
44185 {
44186 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
44187 ".google.container.v1.UpgradeDetails.State",
44188 ))
44189 }
44190 }
44191
44192 /// StartType indicates the type of starting the upgrade.
44193 ///
44194 /// # Working with unknown values
44195 ///
44196 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
44197 /// additional enum variants at any time. Adding new variants is not considered
44198 /// a breaking change. Applications should write their code in anticipation of:
44199 ///
44200 /// - New values appearing in future releases of the client library, **and**
44201 /// - New values received dynamically, without application changes.
44202 ///
44203 /// Please consult the [Working with enums] section in the user guide for some
44204 /// guidelines.
44205 ///
44206 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
44207 #[derive(Clone, Debug, PartialEq)]
44208 #[non_exhaustive]
44209 pub enum StartType {
44210 /// Upgrade start type is unspecified.
44211 Unspecified,
44212 /// Upgrade started automatically.
44213 Automatic,
44214 /// Upgrade started manually.
44215 Manual,
44216 /// If set, the enum was initialized with an unknown value.
44217 ///
44218 /// Applications can examine the value using [StartType::value] or
44219 /// [StartType::name].
44220 UnknownValue(start_type::UnknownValue),
44221 }
44222
44223 #[doc(hidden)]
44224 pub mod start_type {
44225 #[allow(unused_imports)]
44226 use super::*;
44227 #[derive(Clone, Debug, PartialEq)]
44228 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
44229 }
44230
44231 impl StartType {
44232 /// Gets the enum value.
44233 ///
44234 /// Returns `None` if the enum contains an unknown value deserialized from
44235 /// the string representation of enums.
44236 pub fn value(&self) -> std::option::Option<i32> {
44237 match self {
44238 Self::Unspecified => std::option::Option::Some(0),
44239 Self::Automatic => std::option::Option::Some(1),
44240 Self::Manual => std::option::Option::Some(2),
44241 Self::UnknownValue(u) => u.0.value(),
44242 }
44243 }
44244
44245 /// Gets the enum value as a string.
44246 ///
44247 /// Returns `None` if the enum contains an unknown value deserialized from
44248 /// the integer representation of enums.
44249 pub fn name(&self) -> std::option::Option<&str> {
44250 match self {
44251 Self::Unspecified => std::option::Option::Some("START_TYPE_UNSPECIFIED"),
44252 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
44253 Self::Manual => std::option::Option::Some("MANUAL"),
44254 Self::UnknownValue(u) => u.0.name(),
44255 }
44256 }
44257 }
44258
44259 impl std::default::Default for StartType {
44260 fn default() -> Self {
44261 use std::convert::From;
44262 Self::from(0)
44263 }
44264 }
44265
44266 impl std::fmt::Display for StartType {
44267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
44268 wkt::internal::display_enum(f, self.name(), self.value())
44269 }
44270 }
44271
44272 impl std::convert::From<i32> for StartType {
44273 fn from(value: i32) -> Self {
44274 match value {
44275 0 => Self::Unspecified,
44276 1 => Self::Automatic,
44277 2 => Self::Manual,
44278 _ => Self::UnknownValue(start_type::UnknownValue(
44279 wkt::internal::UnknownEnumValue::Integer(value),
44280 )),
44281 }
44282 }
44283 }
44284
44285 impl std::convert::From<&str> for StartType {
44286 fn from(value: &str) -> Self {
44287 use std::string::ToString;
44288 match value {
44289 "START_TYPE_UNSPECIFIED" => Self::Unspecified,
44290 "AUTOMATIC" => Self::Automatic,
44291 "MANUAL" => Self::Manual,
44292 _ => Self::UnknownValue(start_type::UnknownValue(
44293 wkt::internal::UnknownEnumValue::String(value.to_string()),
44294 )),
44295 }
44296 }
44297 }
44298
44299 impl serde::ser::Serialize for StartType {
44300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
44301 where
44302 S: serde::Serializer,
44303 {
44304 match self {
44305 Self::Unspecified => serializer.serialize_i32(0),
44306 Self::Automatic => serializer.serialize_i32(1),
44307 Self::Manual => serializer.serialize_i32(2),
44308 Self::UnknownValue(u) => u.0.serialize(serializer),
44309 }
44310 }
44311 }
44312
44313 impl<'de> serde::de::Deserialize<'de> for StartType {
44314 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
44315 where
44316 D: serde::Deserializer<'de>,
44317 {
44318 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StartType>::new(
44319 ".google.container.v1.UpgradeDetails.StartType",
44320 ))
44321 }
44322 }
44323}
44324
44325/// FetchNodePoolUpgradeInfoRequest fetches the upgrade information of a
44326/// node pool.
44327#[derive(Clone, Default, PartialEq)]
44328#[non_exhaustive]
44329pub struct FetchNodePoolUpgradeInfoRequest {
44330 /// Required. The name (project, location, cluster, node pool) of the node pool
44331 /// to get. Specified in the format
44332 /// `projects/*/locations/*/clusters/*/nodePools/*` or
44333 /// `projects/*/zones/*/clusters/*/nodePools/*`.
44334 pub name: std::string::String,
44335
44336 /// API request version that initiates this operation.
44337 pub version: std::string::String,
44338
44339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
44340}
44341
44342impl FetchNodePoolUpgradeInfoRequest {
44343 /// Creates a new default instance.
44344 pub fn new() -> Self {
44345 std::default::Default::default()
44346 }
44347
44348 /// Sets the value of [name][crate::model::FetchNodePoolUpgradeInfoRequest::name].
44349 ///
44350 /// # Example
44351 /// ```ignore,no_run
44352 /// # use google_cloud_container_v1::model::FetchNodePoolUpgradeInfoRequest;
44353 /// let x = FetchNodePoolUpgradeInfoRequest::new().set_name("example");
44354 /// ```
44355 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
44356 self.name = v.into();
44357 self
44358 }
44359
44360 /// Sets the value of [version][crate::model::FetchNodePoolUpgradeInfoRequest::version].
44361 ///
44362 /// # Example
44363 /// ```ignore,no_run
44364 /// # use google_cloud_container_v1::model::FetchNodePoolUpgradeInfoRequest;
44365 /// let x = FetchNodePoolUpgradeInfoRequest::new().set_version("example");
44366 /// ```
44367 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
44368 self.version = v.into();
44369 self
44370 }
44371}
44372
44373impl wkt::message::Message for FetchNodePoolUpgradeInfoRequest {
44374 fn typename() -> &'static str {
44375 "type.googleapis.com/google.container.v1.FetchNodePoolUpgradeInfoRequest"
44376 }
44377}
44378
44379/// NodePoolUpgradeInfo contains the upgrade information of a node pool.
44380#[derive(Clone, Default, PartialEq)]
44381#[non_exhaustive]
44382pub struct NodePoolUpgradeInfo {
44383 /// minor_target_version indicates the target version for minor upgrade.
44384 pub minor_target_version: std::option::Option<std::string::String>,
44385
44386 /// patch_target_version indicates the target version for patch upgrade.
44387 pub patch_target_version: std::option::Option<std::string::String>,
44388
44389 /// The auto upgrade status.
44390 pub auto_upgrade_status: std::vec::Vec<crate::model::node_pool_upgrade_info::AutoUpgradeStatus>,
44391
44392 /// The auto upgrade paused reason.
44393 pub paused_reason: std::vec::Vec<crate::model::node_pool_upgrade_info::AutoUpgradePausedReason>,
44394
44395 /// The list of past auto upgrades.
44396 pub upgrade_details: std::vec::Vec<crate::model::UpgradeDetails>,
44397
44398 /// The node pool's current minor version's end of standard support timestamp.
44399 pub end_of_standard_support_timestamp: std::option::Option<std::string::String>,
44400
44401 /// The node pool's current minor version's end of extended support timestamp.
44402 pub end_of_extended_support_timestamp: std::option::Option<std::string::String>,
44403
44404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
44405}
44406
44407impl NodePoolUpgradeInfo {
44408 /// Creates a new default instance.
44409 pub fn new() -> Self {
44410 std::default::Default::default()
44411 }
44412
44413 /// Sets the value of [minor_target_version][crate::model::NodePoolUpgradeInfo::minor_target_version].
44414 ///
44415 /// # Example
44416 /// ```ignore,no_run
44417 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44418 /// let x = NodePoolUpgradeInfo::new().set_minor_target_version("example");
44419 /// ```
44420 pub fn set_minor_target_version<T>(mut self, v: T) -> Self
44421 where
44422 T: std::convert::Into<std::string::String>,
44423 {
44424 self.minor_target_version = std::option::Option::Some(v.into());
44425 self
44426 }
44427
44428 /// Sets or clears the value of [minor_target_version][crate::model::NodePoolUpgradeInfo::minor_target_version].
44429 ///
44430 /// # Example
44431 /// ```ignore,no_run
44432 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44433 /// let x = NodePoolUpgradeInfo::new().set_or_clear_minor_target_version(Some("example"));
44434 /// let x = NodePoolUpgradeInfo::new().set_or_clear_minor_target_version(None::<String>);
44435 /// ```
44436 pub fn set_or_clear_minor_target_version<T>(mut self, v: std::option::Option<T>) -> Self
44437 where
44438 T: std::convert::Into<std::string::String>,
44439 {
44440 self.minor_target_version = v.map(|x| x.into());
44441 self
44442 }
44443
44444 /// Sets the value of [patch_target_version][crate::model::NodePoolUpgradeInfo::patch_target_version].
44445 ///
44446 /// # Example
44447 /// ```ignore,no_run
44448 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44449 /// let x = NodePoolUpgradeInfo::new().set_patch_target_version("example");
44450 /// ```
44451 pub fn set_patch_target_version<T>(mut self, v: T) -> Self
44452 where
44453 T: std::convert::Into<std::string::String>,
44454 {
44455 self.patch_target_version = std::option::Option::Some(v.into());
44456 self
44457 }
44458
44459 /// Sets or clears the value of [patch_target_version][crate::model::NodePoolUpgradeInfo::patch_target_version].
44460 ///
44461 /// # Example
44462 /// ```ignore,no_run
44463 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44464 /// let x = NodePoolUpgradeInfo::new().set_or_clear_patch_target_version(Some("example"));
44465 /// let x = NodePoolUpgradeInfo::new().set_or_clear_patch_target_version(None::<String>);
44466 /// ```
44467 pub fn set_or_clear_patch_target_version<T>(mut self, v: std::option::Option<T>) -> Self
44468 where
44469 T: std::convert::Into<std::string::String>,
44470 {
44471 self.patch_target_version = v.map(|x| x.into());
44472 self
44473 }
44474
44475 /// Sets the value of [auto_upgrade_status][crate::model::NodePoolUpgradeInfo::auto_upgrade_status].
44476 ///
44477 /// # Example
44478 /// ```ignore,no_run
44479 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44480 /// use google_cloud_container_v1::model::node_pool_upgrade_info::AutoUpgradeStatus;
44481 /// let x = NodePoolUpgradeInfo::new().set_auto_upgrade_status([
44482 /// AutoUpgradeStatus::Active,
44483 /// AutoUpgradeStatus::MinorUpgradePaused,
44484 /// AutoUpgradeStatus::UpgradePaused,
44485 /// ]);
44486 /// ```
44487 pub fn set_auto_upgrade_status<T, V>(mut self, v: T) -> Self
44488 where
44489 T: std::iter::IntoIterator<Item = V>,
44490 V: std::convert::Into<crate::model::node_pool_upgrade_info::AutoUpgradeStatus>,
44491 {
44492 use std::iter::Iterator;
44493 self.auto_upgrade_status = v.into_iter().map(|i| i.into()).collect();
44494 self
44495 }
44496
44497 /// Sets the value of [paused_reason][crate::model::NodePoolUpgradeInfo::paused_reason].
44498 ///
44499 /// # Example
44500 /// ```ignore,no_run
44501 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44502 /// use google_cloud_container_v1::model::node_pool_upgrade_info::AutoUpgradePausedReason;
44503 /// let x = NodePoolUpgradeInfo::new().set_paused_reason([
44504 /// AutoUpgradePausedReason::MaintenanceWindow,
44505 /// AutoUpgradePausedReason::MaintenanceExclusionNoUpgrades,
44506 /// AutoUpgradePausedReason::MaintenanceExclusionNoMinorUpgrades,
44507 /// ]);
44508 /// ```
44509 pub fn set_paused_reason<T, V>(mut self, v: T) -> Self
44510 where
44511 T: std::iter::IntoIterator<Item = V>,
44512 V: std::convert::Into<crate::model::node_pool_upgrade_info::AutoUpgradePausedReason>,
44513 {
44514 use std::iter::Iterator;
44515 self.paused_reason = v.into_iter().map(|i| i.into()).collect();
44516 self
44517 }
44518
44519 /// Sets the value of [upgrade_details][crate::model::NodePoolUpgradeInfo::upgrade_details].
44520 ///
44521 /// # Example
44522 /// ```ignore,no_run
44523 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44524 /// use google_cloud_container_v1::model::UpgradeDetails;
44525 /// let x = NodePoolUpgradeInfo::new()
44526 /// .set_upgrade_details([
44527 /// UpgradeDetails::default()/* use setters */,
44528 /// UpgradeDetails::default()/* use (different) setters */,
44529 /// ]);
44530 /// ```
44531 pub fn set_upgrade_details<T, V>(mut self, v: T) -> Self
44532 where
44533 T: std::iter::IntoIterator<Item = V>,
44534 V: std::convert::Into<crate::model::UpgradeDetails>,
44535 {
44536 use std::iter::Iterator;
44537 self.upgrade_details = v.into_iter().map(|i| i.into()).collect();
44538 self
44539 }
44540
44541 /// Sets the value of [end_of_standard_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_standard_support_timestamp].
44542 ///
44543 /// # Example
44544 /// ```ignore,no_run
44545 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44546 /// let x = NodePoolUpgradeInfo::new().set_end_of_standard_support_timestamp("example");
44547 /// ```
44548 pub fn set_end_of_standard_support_timestamp<T>(mut self, v: T) -> Self
44549 where
44550 T: std::convert::Into<std::string::String>,
44551 {
44552 self.end_of_standard_support_timestamp = std::option::Option::Some(v.into());
44553 self
44554 }
44555
44556 /// Sets or clears the value of [end_of_standard_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_standard_support_timestamp].
44557 ///
44558 /// # Example
44559 /// ```ignore,no_run
44560 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44561 /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(Some("example"));
44562 /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(None::<String>);
44563 /// ```
44564 pub fn set_or_clear_end_of_standard_support_timestamp<T>(
44565 mut self,
44566 v: std::option::Option<T>,
44567 ) -> Self
44568 where
44569 T: std::convert::Into<std::string::String>,
44570 {
44571 self.end_of_standard_support_timestamp = v.map(|x| x.into());
44572 self
44573 }
44574
44575 /// Sets the value of [end_of_extended_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_extended_support_timestamp].
44576 ///
44577 /// # Example
44578 /// ```ignore,no_run
44579 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44580 /// let x = NodePoolUpgradeInfo::new().set_end_of_extended_support_timestamp("example");
44581 /// ```
44582 pub fn set_end_of_extended_support_timestamp<T>(mut self, v: T) -> Self
44583 where
44584 T: std::convert::Into<std::string::String>,
44585 {
44586 self.end_of_extended_support_timestamp = std::option::Option::Some(v.into());
44587 self
44588 }
44589
44590 /// Sets or clears the value of [end_of_extended_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_extended_support_timestamp].
44591 ///
44592 /// # Example
44593 /// ```ignore,no_run
44594 /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
44595 /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(Some("example"));
44596 /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(None::<String>);
44597 /// ```
44598 pub fn set_or_clear_end_of_extended_support_timestamp<T>(
44599 mut self,
44600 v: std::option::Option<T>,
44601 ) -> Self
44602 where
44603 T: std::convert::Into<std::string::String>,
44604 {
44605 self.end_of_extended_support_timestamp = v.map(|x| x.into());
44606 self
44607 }
44608}
44609
44610impl wkt::message::Message for NodePoolUpgradeInfo {
44611 fn typename() -> &'static str {
44612 "type.googleapis.com/google.container.v1.NodePoolUpgradeInfo"
44613 }
44614}
44615
44616/// Defines additional types related to [NodePoolUpgradeInfo].
44617pub mod node_pool_upgrade_info {
44618 #[allow(unused_imports)]
44619 use super::*;
44620
44621 /// AutoUpgradeStatus indicates the status of auto upgrade.
44622 ///
44623 /// # Working with unknown values
44624 ///
44625 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
44626 /// additional enum variants at any time. Adding new variants is not considered
44627 /// a breaking change. Applications should write their code in anticipation of:
44628 ///
44629 /// - New values appearing in future releases of the client library, **and**
44630 /// - New values received dynamically, without application changes.
44631 ///
44632 /// Please consult the [Working with enums] section in the user guide for some
44633 /// guidelines.
44634 ///
44635 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
44636 #[derive(Clone, Debug, PartialEq)]
44637 #[non_exhaustive]
44638 pub enum AutoUpgradeStatus {
44639 /// UNKNOWN indicates an unknown status.
44640 Unknown,
44641 /// ACTIVE indicates an active status.
44642 Active,
44643 /// MINOR_UPGRADE_PAUSED indicates the minor version upgrade is
44644 /// paused.
44645 MinorUpgradePaused,
44646 /// UPGRADE_PAUSED indicates the upgrade is paused.
44647 UpgradePaused,
44648 /// If set, the enum was initialized with an unknown value.
44649 ///
44650 /// Applications can examine the value using [AutoUpgradeStatus::value] or
44651 /// [AutoUpgradeStatus::name].
44652 UnknownValue(auto_upgrade_status::UnknownValue),
44653 }
44654
44655 #[doc(hidden)]
44656 pub mod auto_upgrade_status {
44657 #[allow(unused_imports)]
44658 use super::*;
44659 #[derive(Clone, Debug, PartialEq)]
44660 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
44661 }
44662
44663 impl AutoUpgradeStatus {
44664 /// Gets the enum value.
44665 ///
44666 /// Returns `None` if the enum contains an unknown value deserialized from
44667 /// the string representation of enums.
44668 pub fn value(&self) -> std::option::Option<i32> {
44669 match self {
44670 Self::Unknown => std::option::Option::Some(0),
44671 Self::Active => std::option::Option::Some(1),
44672 Self::MinorUpgradePaused => std::option::Option::Some(2),
44673 Self::UpgradePaused => std::option::Option::Some(3),
44674 Self::UnknownValue(u) => u.0.value(),
44675 }
44676 }
44677
44678 /// Gets the enum value as a string.
44679 ///
44680 /// Returns `None` if the enum contains an unknown value deserialized from
44681 /// the integer representation of enums.
44682 pub fn name(&self) -> std::option::Option<&str> {
44683 match self {
44684 Self::Unknown => std::option::Option::Some("UNKNOWN"),
44685 Self::Active => std::option::Option::Some("ACTIVE"),
44686 Self::MinorUpgradePaused => std::option::Option::Some("MINOR_UPGRADE_PAUSED"),
44687 Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
44688 Self::UnknownValue(u) => u.0.name(),
44689 }
44690 }
44691 }
44692
44693 impl std::default::Default for AutoUpgradeStatus {
44694 fn default() -> Self {
44695 use std::convert::From;
44696 Self::from(0)
44697 }
44698 }
44699
44700 impl std::fmt::Display for AutoUpgradeStatus {
44701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
44702 wkt::internal::display_enum(f, self.name(), self.value())
44703 }
44704 }
44705
44706 impl std::convert::From<i32> for AutoUpgradeStatus {
44707 fn from(value: i32) -> Self {
44708 match value {
44709 0 => Self::Unknown,
44710 1 => Self::Active,
44711 2 => Self::MinorUpgradePaused,
44712 3 => Self::UpgradePaused,
44713 _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
44714 wkt::internal::UnknownEnumValue::Integer(value),
44715 )),
44716 }
44717 }
44718 }
44719
44720 impl std::convert::From<&str> for AutoUpgradeStatus {
44721 fn from(value: &str) -> Self {
44722 use std::string::ToString;
44723 match value {
44724 "UNKNOWN" => Self::Unknown,
44725 "ACTIVE" => Self::Active,
44726 "MINOR_UPGRADE_PAUSED" => Self::MinorUpgradePaused,
44727 "UPGRADE_PAUSED" => Self::UpgradePaused,
44728 _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
44729 wkt::internal::UnknownEnumValue::String(value.to_string()),
44730 )),
44731 }
44732 }
44733 }
44734
44735 impl serde::ser::Serialize for AutoUpgradeStatus {
44736 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
44737 where
44738 S: serde::Serializer,
44739 {
44740 match self {
44741 Self::Unknown => serializer.serialize_i32(0),
44742 Self::Active => serializer.serialize_i32(1),
44743 Self::MinorUpgradePaused => serializer.serialize_i32(2),
44744 Self::UpgradePaused => serializer.serialize_i32(3),
44745 Self::UnknownValue(u) => u.0.serialize(serializer),
44746 }
44747 }
44748 }
44749
44750 impl<'de> serde::de::Deserialize<'de> for AutoUpgradeStatus {
44751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
44752 where
44753 D: serde::Deserializer<'de>,
44754 {
44755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoUpgradeStatus>::new(
44756 ".google.container.v1.NodePoolUpgradeInfo.AutoUpgradeStatus",
44757 ))
44758 }
44759 }
44760
44761 /// AutoUpgradePausedReason indicates the reason for auto upgrade paused
44762 /// status.
44763 ///
44764 /// # Working with unknown values
44765 ///
44766 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
44767 /// additional enum variants at any time. Adding new variants is not considered
44768 /// a breaking change. Applications should write their code in anticipation of:
44769 ///
44770 /// - New values appearing in future releases of the client library, **and**
44771 /// - New values received dynamically, without application changes.
44772 ///
44773 /// Please consult the [Working with enums] section in the user guide for some
44774 /// guidelines.
44775 ///
44776 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
44777 #[derive(Clone, Debug, PartialEq)]
44778 #[non_exhaustive]
44779 pub enum AutoUpgradePausedReason {
44780 /// AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED indicates an unspecified reason.
44781 Unspecified,
44782 /// MAINTENANCE_WINDOW indicates the cluster is outside customer maintenance
44783 /// window.
44784 MaintenanceWindow,
44785 /// MAINTENANCE_EXCLUSION_NO_UPGRADES indicates the cluster is in a
44786 /// maintenance exclusion with scope NO_UPGRADES.
44787 MaintenanceExclusionNoUpgrades,
44788 /// MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES indicates the cluster is in a
44789 /// maintenance exclusion with scope NO_MINOR_UPGRADES.
44790 MaintenanceExclusionNoMinorUpgrades,
44791 /// SYSTEM_CONFIG indicates the cluster upgrade is paused by system config.
44792 SystemConfig,
44793 /// If set, the enum was initialized with an unknown value.
44794 ///
44795 /// Applications can examine the value using [AutoUpgradePausedReason::value] or
44796 /// [AutoUpgradePausedReason::name].
44797 UnknownValue(auto_upgrade_paused_reason::UnknownValue),
44798 }
44799
44800 #[doc(hidden)]
44801 pub mod auto_upgrade_paused_reason {
44802 #[allow(unused_imports)]
44803 use super::*;
44804 #[derive(Clone, Debug, PartialEq)]
44805 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
44806 }
44807
44808 impl AutoUpgradePausedReason {
44809 /// Gets the enum value.
44810 ///
44811 /// Returns `None` if the enum contains an unknown value deserialized from
44812 /// the string representation of enums.
44813 pub fn value(&self) -> std::option::Option<i32> {
44814 match self {
44815 Self::Unspecified => std::option::Option::Some(0),
44816 Self::MaintenanceWindow => std::option::Option::Some(1),
44817 Self::MaintenanceExclusionNoUpgrades => std::option::Option::Some(2),
44818 Self::MaintenanceExclusionNoMinorUpgrades => std::option::Option::Some(3),
44819 Self::SystemConfig => std::option::Option::Some(4),
44820 Self::UnknownValue(u) => u.0.value(),
44821 }
44822 }
44823
44824 /// Gets the enum value as a string.
44825 ///
44826 /// Returns `None` if the enum contains an unknown value deserialized from
44827 /// the integer representation of enums.
44828 pub fn name(&self) -> std::option::Option<&str> {
44829 match self {
44830 Self::Unspecified => {
44831 std::option::Option::Some("AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED")
44832 }
44833 Self::MaintenanceWindow => std::option::Option::Some("MAINTENANCE_WINDOW"),
44834 Self::MaintenanceExclusionNoUpgrades => {
44835 std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_UPGRADES")
44836 }
44837 Self::MaintenanceExclusionNoMinorUpgrades => {
44838 std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES")
44839 }
44840 Self::SystemConfig => std::option::Option::Some("SYSTEM_CONFIG"),
44841 Self::UnknownValue(u) => u.0.name(),
44842 }
44843 }
44844 }
44845
44846 impl std::default::Default for AutoUpgradePausedReason {
44847 fn default() -> Self {
44848 use std::convert::From;
44849 Self::from(0)
44850 }
44851 }
44852
44853 impl std::fmt::Display for AutoUpgradePausedReason {
44854 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
44855 wkt::internal::display_enum(f, self.name(), self.value())
44856 }
44857 }
44858
44859 impl std::convert::From<i32> for AutoUpgradePausedReason {
44860 fn from(value: i32) -> Self {
44861 match value {
44862 0 => Self::Unspecified,
44863 1 => Self::MaintenanceWindow,
44864 2 => Self::MaintenanceExclusionNoUpgrades,
44865 3 => Self::MaintenanceExclusionNoMinorUpgrades,
44866 4 => Self::SystemConfig,
44867 _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
44868 wkt::internal::UnknownEnumValue::Integer(value),
44869 )),
44870 }
44871 }
44872 }
44873
44874 impl std::convert::From<&str> for AutoUpgradePausedReason {
44875 fn from(value: &str) -> Self {
44876 use std::string::ToString;
44877 match value {
44878 "AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED" => Self::Unspecified,
44879 "MAINTENANCE_WINDOW" => Self::MaintenanceWindow,
44880 "MAINTENANCE_EXCLUSION_NO_UPGRADES" => Self::MaintenanceExclusionNoUpgrades,
44881 "MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES" => {
44882 Self::MaintenanceExclusionNoMinorUpgrades
44883 }
44884 "SYSTEM_CONFIG" => Self::SystemConfig,
44885 _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
44886 wkt::internal::UnknownEnumValue::String(value.to_string()),
44887 )),
44888 }
44889 }
44890 }
44891
44892 impl serde::ser::Serialize for AutoUpgradePausedReason {
44893 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
44894 where
44895 S: serde::Serializer,
44896 {
44897 match self {
44898 Self::Unspecified => serializer.serialize_i32(0),
44899 Self::MaintenanceWindow => serializer.serialize_i32(1),
44900 Self::MaintenanceExclusionNoUpgrades => serializer.serialize_i32(2),
44901 Self::MaintenanceExclusionNoMinorUpgrades => serializer.serialize_i32(3),
44902 Self::SystemConfig => serializer.serialize_i32(4),
44903 Self::UnknownValue(u) => u.0.serialize(serializer),
44904 }
44905 }
44906 }
44907
44908 impl<'de> serde::de::Deserialize<'de> for AutoUpgradePausedReason {
44909 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
44910 where
44911 D: serde::Deserializer<'de>,
44912 {
44913 deserializer.deserialize_any(
44914 wkt::internal::EnumVisitor::<AutoUpgradePausedReason>::new(
44915 ".google.container.v1.NodePoolUpgradeInfo.AutoUpgradePausedReason",
44916 ),
44917 )
44918 }
44919 }
44920}
44921
44922/// Configuration for scheduled upgrades on the cluster.
44923#[derive(Clone, Default, PartialEq)]
44924#[non_exhaustive]
44925pub struct ScheduleUpgradeConfig {
44926 /// Optional. Whether or not scheduled upgrades are enabled.
44927 pub enabled: bool,
44928
44929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
44930}
44931
44932impl ScheduleUpgradeConfig {
44933 /// Creates a new default instance.
44934 pub fn new() -> Self {
44935 std::default::Default::default()
44936 }
44937
44938 /// Sets the value of [enabled][crate::model::ScheduleUpgradeConfig::enabled].
44939 ///
44940 /// # Example
44941 /// ```ignore,no_run
44942 /// # use google_cloud_container_v1::model::ScheduleUpgradeConfig;
44943 /// let x = ScheduleUpgradeConfig::new().set_enabled(true);
44944 /// ```
44945 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
44946 self.enabled = v.into();
44947 self
44948 }
44949}
44950
44951impl wkt::message::Message for ScheduleUpgradeConfig {
44952 fn typename() -> &'static str {
44953 "type.googleapis.com/google.container.v1.ScheduleUpgradeConfig"
44954 }
44955}
44956
44957/// GkeAutoUpgradeConfig is the configuration for GKE auto upgrades.
44958#[derive(Clone, Default, PartialEq)]
44959#[non_exhaustive]
44960pub struct GkeAutoUpgradeConfig {
44961 /// PatchMode specifies how auto upgrade patch builds should be
44962 /// selected.
44963 pub patch_mode: crate::model::gke_auto_upgrade_config::PatchMode,
44964
44965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
44966}
44967
44968impl GkeAutoUpgradeConfig {
44969 /// Creates a new default instance.
44970 pub fn new() -> Self {
44971 std::default::Default::default()
44972 }
44973
44974 /// Sets the value of [patch_mode][crate::model::GkeAutoUpgradeConfig::patch_mode].
44975 ///
44976 /// # Example
44977 /// ```ignore,no_run
44978 /// # use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
44979 /// use google_cloud_container_v1::model::gke_auto_upgrade_config::PatchMode;
44980 /// let x0 = GkeAutoUpgradeConfig::new().set_patch_mode(PatchMode::Accelerated);
44981 /// ```
44982 pub fn set_patch_mode<
44983 T: std::convert::Into<crate::model::gke_auto_upgrade_config::PatchMode>,
44984 >(
44985 mut self,
44986 v: T,
44987 ) -> Self {
44988 self.patch_mode = v.into();
44989 self
44990 }
44991}
44992
44993impl wkt::message::Message for GkeAutoUpgradeConfig {
44994 fn typename() -> &'static str {
44995 "type.googleapis.com/google.container.v1.GkeAutoUpgradeConfig"
44996 }
44997}
44998
44999/// Defines additional types related to [GkeAutoUpgradeConfig].
45000pub mod gke_auto_upgrade_config {
45001 #[allow(unused_imports)]
45002 use super::*;
45003
45004 /// PatchMode specifies how auto upgrade patch builds should be
45005 /// selected.
45006 ///
45007 /// # Working with unknown values
45008 ///
45009 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
45010 /// additional enum variants at any time. Adding new variants is not considered
45011 /// a breaking change. Applications should write their code in anticipation of:
45012 ///
45013 /// - New values appearing in future releases of the client library, **and**
45014 /// - New values received dynamically, without application changes.
45015 ///
45016 /// Please consult the [Working with enums] section in the user guide for some
45017 /// guidelines.
45018 ///
45019 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
45020 #[derive(Clone, Debug, PartialEq)]
45021 #[non_exhaustive]
45022 pub enum PatchMode {
45023 /// PATCH_MODE_UNSPECIFIED defaults to using the upgrade target from the
45024 /// channel's patch upgrade targets as the upgrade target for the
45025 /// version.
45026 Unspecified,
45027 /// ACCELERATED denotes that the latest patch build in the channel should be
45028 /// used as the upgrade target for the version.
45029 Accelerated,
45030 /// If set, the enum was initialized with an unknown value.
45031 ///
45032 /// Applications can examine the value using [PatchMode::value] or
45033 /// [PatchMode::name].
45034 UnknownValue(patch_mode::UnknownValue),
45035 }
45036
45037 #[doc(hidden)]
45038 pub mod patch_mode {
45039 #[allow(unused_imports)]
45040 use super::*;
45041 #[derive(Clone, Debug, PartialEq)]
45042 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
45043 }
45044
45045 impl PatchMode {
45046 /// Gets the enum value.
45047 ///
45048 /// Returns `None` if the enum contains an unknown value deserialized from
45049 /// the string representation of enums.
45050 pub fn value(&self) -> std::option::Option<i32> {
45051 match self {
45052 Self::Unspecified => std::option::Option::Some(0),
45053 Self::Accelerated => std::option::Option::Some(1),
45054 Self::UnknownValue(u) => u.0.value(),
45055 }
45056 }
45057
45058 /// Gets the enum value as a string.
45059 ///
45060 /// Returns `None` if the enum contains an unknown value deserialized from
45061 /// the integer representation of enums.
45062 pub fn name(&self) -> std::option::Option<&str> {
45063 match self {
45064 Self::Unspecified => std::option::Option::Some("PATCH_MODE_UNSPECIFIED"),
45065 Self::Accelerated => std::option::Option::Some("ACCELERATED"),
45066 Self::UnknownValue(u) => u.0.name(),
45067 }
45068 }
45069 }
45070
45071 impl std::default::Default for PatchMode {
45072 fn default() -> Self {
45073 use std::convert::From;
45074 Self::from(0)
45075 }
45076 }
45077
45078 impl std::fmt::Display for PatchMode {
45079 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
45080 wkt::internal::display_enum(f, self.name(), self.value())
45081 }
45082 }
45083
45084 impl std::convert::From<i32> for PatchMode {
45085 fn from(value: i32) -> Self {
45086 match value {
45087 0 => Self::Unspecified,
45088 1 => Self::Accelerated,
45089 _ => Self::UnknownValue(patch_mode::UnknownValue(
45090 wkt::internal::UnknownEnumValue::Integer(value),
45091 )),
45092 }
45093 }
45094 }
45095
45096 impl std::convert::From<&str> for PatchMode {
45097 fn from(value: &str) -> Self {
45098 use std::string::ToString;
45099 match value {
45100 "PATCH_MODE_UNSPECIFIED" => Self::Unspecified,
45101 "ACCELERATED" => Self::Accelerated,
45102 _ => Self::UnknownValue(patch_mode::UnknownValue(
45103 wkt::internal::UnknownEnumValue::String(value.to_string()),
45104 )),
45105 }
45106 }
45107 }
45108
45109 impl serde::ser::Serialize for PatchMode {
45110 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
45111 where
45112 S: serde::Serializer,
45113 {
45114 match self {
45115 Self::Unspecified => serializer.serialize_i32(0),
45116 Self::Accelerated => serializer.serialize_i32(1),
45117 Self::UnknownValue(u) => u.0.serialize(serializer),
45118 }
45119 }
45120 }
45121
45122 impl<'de> serde::de::Deserialize<'de> for PatchMode {
45123 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
45124 where
45125 D: serde::Deserializer<'de>,
45126 {
45127 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PatchMode>::new(
45128 ".google.container.v1.GkeAutoUpgradeConfig.PatchMode",
45129 ))
45130 }
45131 }
45132}
45133
45134/// NetworkTierConfig contains network tier information.
45135#[derive(Clone, Default, PartialEq)]
45136#[non_exhaustive]
45137pub struct NetworkTierConfig {
45138 /// Network tier configuration.
45139 pub network_tier: crate::model::network_tier_config::NetworkTier,
45140
45141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45142}
45143
45144impl NetworkTierConfig {
45145 /// Creates a new default instance.
45146 pub fn new() -> Self {
45147 std::default::Default::default()
45148 }
45149
45150 /// Sets the value of [network_tier][crate::model::NetworkTierConfig::network_tier].
45151 ///
45152 /// # Example
45153 /// ```ignore,no_run
45154 /// # use google_cloud_container_v1::model::NetworkTierConfig;
45155 /// use google_cloud_container_v1::model::network_tier_config::NetworkTier;
45156 /// let x0 = NetworkTierConfig::new().set_network_tier(NetworkTier::Default);
45157 /// let x1 = NetworkTierConfig::new().set_network_tier(NetworkTier::Premium);
45158 /// let x2 = NetworkTierConfig::new().set_network_tier(NetworkTier::Standard);
45159 /// ```
45160 pub fn set_network_tier<
45161 T: std::convert::Into<crate::model::network_tier_config::NetworkTier>,
45162 >(
45163 mut self,
45164 v: T,
45165 ) -> Self {
45166 self.network_tier = v.into();
45167 self
45168 }
45169}
45170
45171impl wkt::message::Message for NetworkTierConfig {
45172 fn typename() -> &'static str {
45173 "type.googleapis.com/google.container.v1.NetworkTierConfig"
45174 }
45175}
45176
45177/// Defines additional types related to [NetworkTierConfig].
45178pub mod network_tier_config {
45179 #[allow(unused_imports)]
45180 use super::*;
45181
45182 /// Network tier configuration.
45183 ///
45184 /// # Working with unknown values
45185 ///
45186 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
45187 /// additional enum variants at any time. Adding new variants is not considered
45188 /// a breaking change. Applications should write their code in anticipation of:
45189 ///
45190 /// - New values appearing in future releases of the client library, **and**
45191 /// - New values received dynamically, without application changes.
45192 ///
45193 /// Please consult the [Working with enums] section in the user guide for some
45194 /// guidelines.
45195 ///
45196 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
45197 #[derive(Clone, Debug, PartialEq)]
45198 #[non_exhaustive]
45199 pub enum NetworkTier {
45200 /// By default, use project-level configuration. When unspecified, the
45201 /// behavior defaults to NETWORK_TIER_DEFAULT. For cluster updates, this
45202 /// implies no action (no-op).
45203 Unspecified,
45204 /// Default network tier. Use project-level configuration. User can specify
45205 /// this value, meaning they want to keep the same behaviour as before
45206 /// cluster level network tier configuration is introduced. This field
45207 /// ensures backward compatibility for the network tier of cluster resources,
45208 /// such as node pools and load balancers, for their external IP addresses.
45209 Default,
45210 /// Premium network tier.
45211 Premium,
45212 /// Standard network tier.
45213 Standard,
45214 /// If set, the enum was initialized with an unknown value.
45215 ///
45216 /// Applications can examine the value using [NetworkTier::value] or
45217 /// [NetworkTier::name].
45218 UnknownValue(network_tier::UnknownValue),
45219 }
45220
45221 #[doc(hidden)]
45222 pub mod network_tier {
45223 #[allow(unused_imports)]
45224 use super::*;
45225 #[derive(Clone, Debug, PartialEq)]
45226 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
45227 }
45228
45229 impl NetworkTier {
45230 /// Gets the enum value.
45231 ///
45232 /// Returns `None` if the enum contains an unknown value deserialized from
45233 /// the string representation of enums.
45234 pub fn value(&self) -> std::option::Option<i32> {
45235 match self {
45236 Self::Unspecified => std::option::Option::Some(0),
45237 Self::Default => std::option::Option::Some(1),
45238 Self::Premium => std::option::Option::Some(2),
45239 Self::Standard => std::option::Option::Some(3),
45240 Self::UnknownValue(u) => u.0.value(),
45241 }
45242 }
45243
45244 /// Gets the enum value as a string.
45245 ///
45246 /// Returns `None` if the enum contains an unknown value deserialized from
45247 /// the integer representation of enums.
45248 pub fn name(&self) -> std::option::Option<&str> {
45249 match self {
45250 Self::Unspecified => std::option::Option::Some("NETWORK_TIER_UNSPECIFIED"),
45251 Self::Default => std::option::Option::Some("NETWORK_TIER_DEFAULT"),
45252 Self::Premium => std::option::Option::Some("NETWORK_TIER_PREMIUM"),
45253 Self::Standard => std::option::Option::Some("NETWORK_TIER_STANDARD"),
45254 Self::UnknownValue(u) => u.0.name(),
45255 }
45256 }
45257 }
45258
45259 impl std::default::Default for NetworkTier {
45260 fn default() -> Self {
45261 use std::convert::From;
45262 Self::from(0)
45263 }
45264 }
45265
45266 impl std::fmt::Display for NetworkTier {
45267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
45268 wkt::internal::display_enum(f, self.name(), self.value())
45269 }
45270 }
45271
45272 impl std::convert::From<i32> for NetworkTier {
45273 fn from(value: i32) -> Self {
45274 match value {
45275 0 => Self::Unspecified,
45276 1 => Self::Default,
45277 2 => Self::Premium,
45278 3 => Self::Standard,
45279 _ => Self::UnknownValue(network_tier::UnknownValue(
45280 wkt::internal::UnknownEnumValue::Integer(value),
45281 )),
45282 }
45283 }
45284 }
45285
45286 impl std::convert::From<&str> for NetworkTier {
45287 fn from(value: &str) -> Self {
45288 use std::string::ToString;
45289 match value {
45290 "NETWORK_TIER_UNSPECIFIED" => Self::Unspecified,
45291 "NETWORK_TIER_DEFAULT" => Self::Default,
45292 "NETWORK_TIER_PREMIUM" => Self::Premium,
45293 "NETWORK_TIER_STANDARD" => Self::Standard,
45294 _ => Self::UnknownValue(network_tier::UnknownValue(
45295 wkt::internal::UnknownEnumValue::String(value.to_string()),
45296 )),
45297 }
45298 }
45299 }
45300
45301 impl serde::ser::Serialize for NetworkTier {
45302 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
45303 where
45304 S: serde::Serializer,
45305 {
45306 match self {
45307 Self::Unspecified => serializer.serialize_i32(0),
45308 Self::Default => serializer.serialize_i32(1),
45309 Self::Premium => serializer.serialize_i32(2),
45310 Self::Standard => serializer.serialize_i32(3),
45311 Self::UnknownValue(u) => u.0.serialize(serializer),
45312 }
45313 }
45314 }
45315
45316 impl<'de> serde::de::Deserialize<'de> for NetworkTier {
45317 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
45318 where
45319 D: serde::Deserializer<'de>,
45320 {
45321 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkTier>::new(
45322 ".google.container.v1.NetworkTierConfig.NetworkTier",
45323 ))
45324 }
45325 }
45326}
45327
45328/// Configuration for sync Secret Manager secrets as k8s secrets.
45329#[derive(Clone, Default, PartialEq)]
45330#[non_exhaustive]
45331pub struct SecretSyncConfig {
45332 /// Enable/Disable Secret Sync Config.
45333 pub enabled: std::option::Option<bool>,
45334
45335 /// Rotation config for secret manager.
45336 pub rotation_config: std::option::Option<crate::model::secret_sync_config::SyncRotationConfig>,
45337
45338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45339}
45340
45341impl SecretSyncConfig {
45342 /// Creates a new default instance.
45343 pub fn new() -> Self {
45344 std::default::Default::default()
45345 }
45346
45347 /// Sets the value of [enabled][crate::model::SecretSyncConfig::enabled].
45348 ///
45349 /// # Example
45350 /// ```ignore,no_run
45351 /// # use google_cloud_container_v1::model::SecretSyncConfig;
45352 /// let x = SecretSyncConfig::new().set_enabled(true);
45353 /// ```
45354 pub fn set_enabled<T>(mut self, v: T) -> Self
45355 where
45356 T: std::convert::Into<bool>,
45357 {
45358 self.enabled = std::option::Option::Some(v.into());
45359 self
45360 }
45361
45362 /// Sets or clears the value of [enabled][crate::model::SecretSyncConfig::enabled].
45363 ///
45364 /// # Example
45365 /// ```ignore,no_run
45366 /// # use google_cloud_container_v1::model::SecretSyncConfig;
45367 /// let x = SecretSyncConfig::new().set_or_clear_enabled(Some(false));
45368 /// let x = SecretSyncConfig::new().set_or_clear_enabled(None::<bool>);
45369 /// ```
45370 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
45371 where
45372 T: std::convert::Into<bool>,
45373 {
45374 self.enabled = v.map(|x| x.into());
45375 self
45376 }
45377
45378 /// Sets the value of [rotation_config][crate::model::SecretSyncConfig::rotation_config].
45379 ///
45380 /// # Example
45381 /// ```ignore,no_run
45382 /// # use google_cloud_container_v1::model::SecretSyncConfig;
45383 /// use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45384 /// let x = SecretSyncConfig::new().set_rotation_config(SyncRotationConfig::default()/* use setters */);
45385 /// ```
45386 pub fn set_rotation_config<T>(mut self, v: T) -> Self
45387 where
45388 T: std::convert::Into<crate::model::secret_sync_config::SyncRotationConfig>,
45389 {
45390 self.rotation_config = std::option::Option::Some(v.into());
45391 self
45392 }
45393
45394 /// Sets or clears the value of [rotation_config][crate::model::SecretSyncConfig::rotation_config].
45395 ///
45396 /// # Example
45397 /// ```ignore,no_run
45398 /// # use google_cloud_container_v1::model::SecretSyncConfig;
45399 /// use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45400 /// let x = SecretSyncConfig::new().set_or_clear_rotation_config(Some(SyncRotationConfig::default()/* use setters */));
45401 /// let x = SecretSyncConfig::new().set_or_clear_rotation_config(None::<SyncRotationConfig>);
45402 /// ```
45403 pub fn set_or_clear_rotation_config<T>(mut self, v: std::option::Option<T>) -> Self
45404 where
45405 T: std::convert::Into<crate::model::secret_sync_config::SyncRotationConfig>,
45406 {
45407 self.rotation_config = v.map(|x| x.into());
45408 self
45409 }
45410}
45411
45412impl wkt::message::Message for SecretSyncConfig {
45413 fn typename() -> &'static str {
45414 "type.googleapis.com/google.container.v1.SecretSyncConfig"
45415 }
45416}
45417
45418/// Defines additional types related to [SecretSyncConfig].
45419pub mod secret_sync_config {
45420 #[allow(unused_imports)]
45421 use super::*;
45422
45423 /// SyncRotationConfig is config for secret manager auto rotation.
45424 #[derive(Clone, Default, PartialEq)]
45425 #[non_exhaustive]
45426 pub struct SyncRotationConfig {
45427 /// Whether the rotation is enabled.
45428 pub enabled: std::option::Option<bool>,
45429
45430 /// The interval between two consecutive rotations. Default rotation interval
45431 /// is 2 minutes.
45432 pub rotation_interval: std::option::Option<wkt::Duration>,
45433
45434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45435 }
45436
45437 impl SyncRotationConfig {
45438 /// Creates a new default instance.
45439 pub fn new() -> Self {
45440 std::default::Default::default()
45441 }
45442
45443 /// Sets the value of [enabled][crate::model::secret_sync_config::SyncRotationConfig::enabled].
45444 ///
45445 /// # Example
45446 /// ```ignore,no_run
45447 /// # use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45448 /// let x = SyncRotationConfig::new().set_enabled(true);
45449 /// ```
45450 pub fn set_enabled<T>(mut self, v: T) -> Self
45451 where
45452 T: std::convert::Into<bool>,
45453 {
45454 self.enabled = std::option::Option::Some(v.into());
45455 self
45456 }
45457
45458 /// Sets or clears the value of [enabled][crate::model::secret_sync_config::SyncRotationConfig::enabled].
45459 ///
45460 /// # Example
45461 /// ```ignore,no_run
45462 /// # use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45463 /// let x = SyncRotationConfig::new().set_or_clear_enabled(Some(false));
45464 /// let x = SyncRotationConfig::new().set_or_clear_enabled(None::<bool>);
45465 /// ```
45466 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
45467 where
45468 T: std::convert::Into<bool>,
45469 {
45470 self.enabled = v.map(|x| x.into());
45471 self
45472 }
45473
45474 /// Sets the value of [rotation_interval][crate::model::secret_sync_config::SyncRotationConfig::rotation_interval].
45475 ///
45476 /// # Example
45477 /// ```ignore,no_run
45478 /// # use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45479 /// use wkt::Duration;
45480 /// let x = SyncRotationConfig::new().set_rotation_interval(Duration::default()/* use setters */);
45481 /// ```
45482 pub fn set_rotation_interval<T>(mut self, v: T) -> Self
45483 where
45484 T: std::convert::Into<wkt::Duration>,
45485 {
45486 self.rotation_interval = std::option::Option::Some(v.into());
45487 self
45488 }
45489
45490 /// Sets or clears the value of [rotation_interval][crate::model::secret_sync_config::SyncRotationConfig::rotation_interval].
45491 ///
45492 /// # Example
45493 /// ```ignore,no_run
45494 /// # use google_cloud_container_v1::model::secret_sync_config::SyncRotationConfig;
45495 /// use wkt::Duration;
45496 /// let x = SyncRotationConfig::new().set_or_clear_rotation_interval(Some(Duration::default()/* use setters */));
45497 /// let x = SyncRotationConfig::new().set_or_clear_rotation_interval(None::<Duration>);
45498 /// ```
45499 pub fn set_or_clear_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
45500 where
45501 T: std::convert::Into<wkt::Duration>,
45502 {
45503 self.rotation_interval = v.map(|x| x.into());
45504 self
45505 }
45506 }
45507
45508 impl wkt::message::Message for SyncRotationConfig {
45509 fn typename() -> &'static str {
45510 "type.googleapis.com/google.container.v1.SecretSyncConfig.SyncRotationConfig"
45511 }
45512 }
45513}
45514
45515/// ManagedOpenTelemetryConfig is the configuration for the GKE Managed
45516/// OpenTelemetry pipeline.
45517#[derive(Clone, Default, PartialEq)]
45518#[non_exhaustive]
45519pub struct ManagedOpenTelemetryConfig {
45520 /// Scope of the Managed OpenTelemetry pipeline.
45521 pub scope: std::option::Option<crate::model::managed_open_telemetry_config::Scope>,
45522
45523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45524}
45525
45526impl ManagedOpenTelemetryConfig {
45527 /// Creates a new default instance.
45528 pub fn new() -> Self {
45529 std::default::Default::default()
45530 }
45531
45532 /// Sets the value of [scope][crate::model::ManagedOpenTelemetryConfig::scope].
45533 ///
45534 /// # Example
45535 /// ```ignore,no_run
45536 /// # use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
45537 /// use google_cloud_container_v1::model::managed_open_telemetry_config::Scope;
45538 /// let x0 = ManagedOpenTelemetryConfig::new().set_scope(Scope::None);
45539 /// let x1 = ManagedOpenTelemetryConfig::new().set_scope(Scope::CollectionAndInstrumentationComponents);
45540 /// ```
45541 pub fn set_scope<T>(mut self, v: T) -> Self
45542 where
45543 T: std::convert::Into<crate::model::managed_open_telemetry_config::Scope>,
45544 {
45545 self.scope = std::option::Option::Some(v.into());
45546 self
45547 }
45548
45549 /// Sets or clears the value of [scope][crate::model::ManagedOpenTelemetryConfig::scope].
45550 ///
45551 /// # Example
45552 /// ```ignore,no_run
45553 /// # use google_cloud_container_v1::model::ManagedOpenTelemetryConfig;
45554 /// use google_cloud_container_v1::model::managed_open_telemetry_config::Scope;
45555 /// let x0 = ManagedOpenTelemetryConfig::new().set_or_clear_scope(Some(Scope::None));
45556 /// let x1 = ManagedOpenTelemetryConfig::new().set_or_clear_scope(Some(Scope::CollectionAndInstrumentationComponents));
45557 /// let x_none = ManagedOpenTelemetryConfig::new().set_or_clear_scope(None::<Scope>);
45558 /// ```
45559 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
45560 where
45561 T: std::convert::Into<crate::model::managed_open_telemetry_config::Scope>,
45562 {
45563 self.scope = v.map(|x| x.into());
45564 self
45565 }
45566}
45567
45568impl wkt::message::Message for ManagedOpenTelemetryConfig {
45569 fn typename() -> &'static str {
45570 "type.googleapis.com/google.container.v1.ManagedOpenTelemetryConfig"
45571 }
45572}
45573
45574/// Defines additional types related to [ManagedOpenTelemetryConfig].
45575pub mod managed_open_telemetry_config {
45576 #[allow(unused_imports)]
45577 use super::*;
45578
45579 /// Scope is the scope of the Managed OpenTelemetry pipeline.
45580 ///
45581 /// # Working with unknown values
45582 ///
45583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
45584 /// additional enum variants at any time. Adding new variants is not considered
45585 /// a breaking change. Applications should write their code in anticipation of:
45586 ///
45587 /// - New values appearing in future releases of the client library, **and**
45588 /// - New values received dynamically, without application changes.
45589 ///
45590 /// Please consult the [Working with enums] section in the user guide for some
45591 /// guidelines.
45592 ///
45593 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
45594 #[derive(Clone, Debug, PartialEq)]
45595 #[non_exhaustive]
45596 pub enum Scope {
45597 /// SCOPE_UNSPECIFIED is when the scope is not set.
45598 Unspecified,
45599 /// NONE is used to disable the Managed OpenTelemetry pipeline.
45600 None,
45601 /// COLLECTION_AND_INSTRUMENTATION_COMPONENTS is used to enable the Managed
45602 /// OpenTelemetry pipeline for collection and instrumentation components.
45603 CollectionAndInstrumentationComponents,
45604 /// If set, the enum was initialized with an unknown value.
45605 ///
45606 /// Applications can examine the value using [Scope::value] or
45607 /// [Scope::name].
45608 UnknownValue(scope::UnknownValue),
45609 }
45610
45611 #[doc(hidden)]
45612 pub mod scope {
45613 #[allow(unused_imports)]
45614 use super::*;
45615 #[derive(Clone, Debug, PartialEq)]
45616 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
45617 }
45618
45619 impl Scope {
45620 /// Gets the enum value.
45621 ///
45622 /// Returns `None` if the enum contains an unknown value deserialized from
45623 /// the string representation of enums.
45624 pub fn value(&self) -> std::option::Option<i32> {
45625 match self {
45626 Self::Unspecified => std::option::Option::Some(0),
45627 Self::None => std::option::Option::Some(1),
45628 Self::CollectionAndInstrumentationComponents => std::option::Option::Some(2),
45629 Self::UnknownValue(u) => u.0.value(),
45630 }
45631 }
45632
45633 /// Gets the enum value as a string.
45634 ///
45635 /// Returns `None` if the enum contains an unknown value deserialized from
45636 /// the integer representation of enums.
45637 pub fn name(&self) -> std::option::Option<&str> {
45638 match self {
45639 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
45640 Self::None => std::option::Option::Some("NONE"),
45641 Self::CollectionAndInstrumentationComponents => {
45642 std::option::Option::Some("COLLECTION_AND_INSTRUMENTATION_COMPONENTS")
45643 }
45644 Self::UnknownValue(u) => u.0.name(),
45645 }
45646 }
45647 }
45648
45649 impl std::default::Default for Scope {
45650 fn default() -> Self {
45651 use std::convert::From;
45652 Self::from(0)
45653 }
45654 }
45655
45656 impl std::fmt::Display for Scope {
45657 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
45658 wkt::internal::display_enum(f, self.name(), self.value())
45659 }
45660 }
45661
45662 impl std::convert::From<i32> for Scope {
45663 fn from(value: i32) -> Self {
45664 match value {
45665 0 => Self::Unspecified,
45666 1 => Self::None,
45667 2 => Self::CollectionAndInstrumentationComponents,
45668 _ => Self::UnknownValue(scope::UnknownValue(
45669 wkt::internal::UnknownEnumValue::Integer(value),
45670 )),
45671 }
45672 }
45673 }
45674
45675 impl std::convert::From<&str> for Scope {
45676 fn from(value: &str) -> Self {
45677 use std::string::ToString;
45678 match value {
45679 "SCOPE_UNSPECIFIED" => Self::Unspecified,
45680 "NONE" => Self::None,
45681 "COLLECTION_AND_INSTRUMENTATION_COMPONENTS" => {
45682 Self::CollectionAndInstrumentationComponents
45683 }
45684 _ => Self::UnknownValue(scope::UnknownValue(
45685 wkt::internal::UnknownEnumValue::String(value.to_string()),
45686 )),
45687 }
45688 }
45689 }
45690
45691 impl serde::ser::Serialize for Scope {
45692 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
45693 where
45694 S: serde::Serializer,
45695 {
45696 match self {
45697 Self::Unspecified => serializer.serialize_i32(0),
45698 Self::None => serializer.serialize_i32(1),
45699 Self::CollectionAndInstrumentationComponents => serializer.serialize_i32(2),
45700 Self::UnknownValue(u) => u.0.serialize(serializer),
45701 }
45702 }
45703 }
45704
45705 impl<'de> serde::de::Deserialize<'de> for Scope {
45706 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
45707 where
45708 D: serde::Deserializer<'de>,
45709 {
45710 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
45711 ".google.container.v1.ManagedOpenTelemetryConfig.Scope",
45712 ))
45713 }
45714 }
45715}
45716
45717/// ManagedMachineLearningDiagnosticsConfig is the configuration for the GKE
45718/// Managed Machine Learning Diagnostics pipeline.
45719#[derive(Clone, Default, PartialEq)]
45720#[non_exhaustive]
45721pub struct ManagedMachineLearningDiagnosticsConfig {
45722 /// Enable/Disable Managed Machine Learning Diagnostics.
45723 pub enabled: std::option::Option<bool>,
45724
45725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45726}
45727
45728impl ManagedMachineLearningDiagnosticsConfig {
45729 /// Creates a new default instance.
45730 pub fn new() -> Self {
45731 std::default::Default::default()
45732 }
45733
45734 /// Sets the value of [enabled][crate::model::ManagedMachineLearningDiagnosticsConfig::enabled].
45735 ///
45736 /// # Example
45737 /// ```ignore,no_run
45738 /// # use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
45739 /// let x = ManagedMachineLearningDiagnosticsConfig::new().set_enabled(true);
45740 /// ```
45741 pub fn set_enabled<T>(mut self, v: T) -> Self
45742 where
45743 T: std::convert::Into<bool>,
45744 {
45745 self.enabled = std::option::Option::Some(v.into());
45746 self
45747 }
45748
45749 /// Sets or clears the value of [enabled][crate::model::ManagedMachineLearningDiagnosticsConfig::enabled].
45750 ///
45751 /// # Example
45752 /// ```ignore,no_run
45753 /// # use google_cloud_container_v1::model::ManagedMachineLearningDiagnosticsConfig;
45754 /// let x = ManagedMachineLearningDiagnosticsConfig::new().set_or_clear_enabled(Some(false));
45755 /// let x = ManagedMachineLearningDiagnosticsConfig::new().set_or_clear_enabled(None::<bool>);
45756 /// ```
45757 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
45758 where
45759 T: std::convert::Into<bool>,
45760 {
45761 self.enabled = v.map(|x| x.into());
45762 self
45763 }
45764}
45765
45766impl wkt::message::Message for ManagedMachineLearningDiagnosticsConfig {
45767 fn typename() -> &'static str {
45768 "type.googleapis.com/google.container.v1.ManagedMachineLearningDiagnosticsConfig"
45769 }
45770}
45771
45772/// PodSnapshotConfig is the configuration for GKE Pod Snapshots feature.
45773#[derive(Clone, Default, PartialEq)]
45774#[non_exhaustive]
45775pub struct PodSnapshotConfig {
45776 /// Whether or not the Pod Snapshots feature is enabled.
45777 pub enabled: bool,
45778
45779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
45780}
45781
45782impl PodSnapshotConfig {
45783 /// Creates a new default instance.
45784 pub fn new() -> Self {
45785 std::default::Default::default()
45786 }
45787
45788 /// Sets the value of [enabled][crate::model::PodSnapshotConfig::enabled].
45789 ///
45790 /// # Example
45791 /// ```ignore,no_run
45792 /// # use google_cloud_container_v1::model::PodSnapshotConfig;
45793 /// let x = PodSnapshotConfig::new().set_enabled(true);
45794 /// ```
45795 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
45796 self.enabled = v.into();
45797 self
45798 }
45799}
45800
45801impl wkt::message::Message for PodSnapshotConfig {
45802 fn typename() -> &'static str {
45803 "type.googleapis.com/google.container.v1.PodSnapshotConfig"
45804 }
45805}
45806
45807/// PrivateIPv6GoogleAccess controls whether and how the pods can communicate
45808/// with Google Services through gRPC over IPv6.
45809///
45810/// # Working with unknown values
45811///
45812/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
45813/// additional enum variants at any time. Adding new variants is not considered
45814/// a breaking change. Applications should write their code in anticipation of:
45815///
45816/// - New values appearing in future releases of the client library, **and**
45817/// - New values received dynamically, without application changes.
45818///
45819/// Please consult the [Working with enums] section in the user guide for some
45820/// guidelines.
45821///
45822/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
45823#[derive(Clone, Debug, PartialEq)]
45824#[non_exhaustive]
45825pub enum PrivateIPv6GoogleAccess {
45826 /// Default value. Same as DISABLED
45827 PrivateIpv6GoogleAccessUnspecified,
45828 /// No private access to or from Google Services
45829 PrivateIpv6GoogleAccessDisabled,
45830 /// Enables private IPv6 access to Google Services from GKE
45831 PrivateIpv6GoogleAccessToGoogle,
45832 /// Enables private IPv6 access to and from Google Services
45833 PrivateIpv6GoogleAccessBidirectional,
45834 /// If set, the enum was initialized with an unknown value.
45835 ///
45836 /// Applications can examine the value using [PrivateIPv6GoogleAccess::value] or
45837 /// [PrivateIPv6GoogleAccess::name].
45838 UnknownValue(private_i_pv_6_google_access::UnknownValue),
45839}
45840
45841#[doc(hidden)]
45842pub mod private_i_pv_6_google_access {
45843 #[allow(unused_imports)]
45844 use super::*;
45845 #[derive(Clone, Debug, PartialEq)]
45846 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
45847}
45848
45849impl PrivateIPv6GoogleAccess {
45850 /// Gets the enum value.
45851 ///
45852 /// Returns `None` if the enum contains an unknown value deserialized from
45853 /// the string representation of enums.
45854 pub fn value(&self) -> std::option::Option<i32> {
45855 match self {
45856 Self::PrivateIpv6GoogleAccessUnspecified => std::option::Option::Some(0),
45857 Self::PrivateIpv6GoogleAccessDisabled => std::option::Option::Some(1),
45858 Self::PrivateIpv6GoogleAccessToGoogle => std::option::Option::Some(2),
45859 Self::PrivateIpv6GoogleAccessBidirectional => std::option::Option::Some(3),
45860 Self::UnknownValue(u) => u.0.value(),
45861 }
45862 }
45863
45864 /// Gets the enum value as a string.
45865 ///
45866 /// Returns `None` if the enum contains an unknown value deserialized from
45867 /// the integer representation of enums.
45868 pub fn name(&self) -> std::option::Option<&str> {
45869 match self {
45870 Self::PrivateIpv6GoogleAccessUnspecified => {
45871 std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED")
45872 }
45873 Self::PrivateIpv6GoogleAccessDisabled => {
45874 std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED")
45875 }
45876 Self::PrivateIpv6GoogleAccessToGoogle => {
45877 std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE")
45878 }
45879 Self::PrivateIpv6GoogleAccessBidirectional => {
45880 std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL")
45881 }
45882 Self::UnknownValue(u) => u.0.name(),
45883 }
45884 }
45885}
45886
45887impl std::default::Default for PrivateIPv6GoogleAccess {
45888 fn default() -> Self {
45889 use std::convert::From;
45890 Self::from(0)
45891 }
45892}
45893
45894impl std::fmt::Display for PrivateIPv6GoogleAccess {
45895 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
45896 wkt::internal::display_enum(f, self.name(), self.value())
45897 }
45898}
45899
45900impl std::convert::From<i32> for PrivateIPv6GoogleAccess {
45901 fn from(value: i32) -> Self {
45902 match value {
45903 0 => Self::PrivateIpv6GoogleAccessUnspecified,
45904 1 => Self::PrivateIpv6GoogleAccessDisabled,
45905 2 => Self::PrivateIpv6GoogleAccessToGoogle,
45906 3 => Self::PrivateIpv6GoogleAccessBidirectional,
45907 _ => Self::UnknownValue(private_i_pv_6_google_access::UnknownValue(
45908 wkt::internal::UnknownEnumValue::Integer(value),
45909 )),
45910 }
45911 }
45912}
45913
45914impl std::convert::From<&str> for PrivateIPv6GoogleAccess {
45915 fn from(value: &str) -> Self {
45916 use std::string::ToString;
45917 match value {
45918 "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => Self::PrivateIpv6GoogleAccessUnspecified,
45919 "PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED" => Self::PrivateIpv6GoogleAccessDisabled,
45920 "PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE" => Self::PrivateIpv6GoogleAccessToGoogle,
45921 "PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL" => {
45922 Self::PrivateIpv6GoogleAccessBidirectional
45923 }
45924 _ => Self::UnknownValue(private_i_pv_6_google_access::UnknownValue(
45925 wkt::internal::UnknownEnumValue::String(value.to_string()),
45926 )),
45927 }
45928 }
45929}
45930
45931impl serde::ser::Serialize for PrivateIPv6GoogleAccess {
45932 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
45933 where
45934 S: serde::Serializer,
45935 {
45936 match self {
45937 Self::PrivateIpv6GoogleAccessUnspecified => serializer.serialize_i32(0),
45938 Self::PrivateIpv6GoogleAccessDisabled => serializer.serialize_i32(1),
45939 Self::PrivateIpv6GoogleAccessToGoogle => serializer.serialize_i32(2),
45940 Self::PrivateIpv6GoogleAccessBidirectional => serializer.serialize_i32(3),
45941 Self::UnknownValue(u) => u.0.serialize(serializer),
45942 }
45943 }
45944}
45945
45946impl<'de> serde::de::Deserialize<'de> for PrivateIPv6GoogleAccess {
45947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
45948 where
45949 D: serde::Deserializer<'de>,
45950 {
45951 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivateIPv6GoogleAccess>::new(
45952 ".google.container.v1.PrivateIPv6GoogleAccess",
45953 ))
45954 }
45955}
45956
45957/// UpgradeResourceType is the resource type that is upgrading. It is used
45958/// in upgrade notifications.
45959///
45960/// # Working with unknown values
45961///
45962/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
45963/// additional enum variants at any time. Adding new variants is not considered
45964/// a breaking change. Applications should write their code in anticipation of:
45965///
45966/// - New values appearing in future releases of the client library, **and**
45967/// - New values received dynamically, without application changes.
45968///
45969/// Please consult the [Working with enums] section in the user guide for some
45970/// guidelines.
45971///
45972/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
45973#[derive(Clone, Debug, PartialEq)]
45974#[non_exhaustive]
45975pub enum UpgradeResourceType {
45976 /// Default value. This shouldn't be used.
45977 Unspecified,
45978 /// Master / control plane
45979 Master,
45980 /// Node pool
45981 NodePool,
45982 /// If set, the enum was initialized with an unknown value.
45983 ///
45984 /// Applications can examine the value using [UpgradeResourceType::value] or
45985 /// [UpgradeResourceType::name].
45986 UnknownValue(upgrade_resource_type::UnknownValue),
45987}
45988
45989#[doc(hidden)]
45990pub mod upgrade_resource_type {
45991 #[allow(unused_imports)]
45992 use super::*;
45993 #[derive(Clone, Debug, PartialEq)]
45994 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
45995}
45996
45997impl UpgradeResourceType {
45998 /// Gets the enum value.
45999 ///
46000 /// Returns `None` if the enum contains an unknown value deserialized from
46001 /// the string representation of enums.
46002 pub fn value(&self) -> std::option::Option<i32> {
46003 match self {
46004 Self::Unspecified => std::option::Option::Some(0),
46005 Self::Master => std::option::Option::Some(1),
46006 Self::NodePool => std::option::Option::Some(2),
46007 Self::UnknownValue(u) => u.0.value(),
46008 }
46009 }
46010
46011 /// Gets the enum value as a string.
46012 ///
46013 /// Returns `None` if the enum contains an unknown value deserialized from
46014 /// the integer representation of enums.
46015 pub fn name(&self) -> std::option::Option<&str> {
46016 match self {
46017 Self::Unspecified => std::option::Option::Some("UPGRADE_RESOURCE_TYPE_UNSPECIFIED"),
46018 Self::Master => std::option::Option::Some("MASTER"),
46019 Self::NodePool => std::option::Option::Some("NODE_POOL"),
46020 Self::UnknownValue(u) => u.0.name(),
46021 }
46022 }
46023}
46024
46025impl std::default::Default for UpgradeResourceType {
46026 fn default() -> Self {
46027 use std::convert::From;
46028 Self::from(0)
46029 }
46030}
46031
46032impl std::fmt::Display for UpgradeResourceType {
46033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46034 wkt::internal::display_enum(f, self.name(), self.value())
46035 }
46036}
46037
46038impl std::convert::From<i32> for UpgradeResourceType {
46039 fn from(value: i32) -> Self {
46040 match value {
46041 0 => Self::Unspecified,
46042 1 => Self::Master,
46043 2 => Self::NodePool,
46044 _ => Self::UnknownValue(upgrade_resource_type::UnknownValue(
46045 wkt::internal::UnknownEnumValue::Integer(value),
46046 )),
46047 }
46048 }
46049}
46050
46051impl std::convert::From<&str> for UpgradeResourceType {
46052 fn from(value: &str) -> Self {
46053 use std::string::ToString;
46054 match value {
46055 "UPGRADE_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
46056 "MASTER" => Self::Master,
46057 "NODE_POOL" => Self::NodePool,
46058 _ => Self::UnknownValue(upgrade_resource_type::UnknownValue(
46059 wkt::internal::UnknownEnumValue::String(value.to_string()),
46060 )),
46061 }
46062 }
46063}
46064
46065impl serde::ser::Serialize for UpgradeResourceType {
46066 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46067 where
46068 S: serde::Serializer,
46069 {
46070 match self {
46071 Self::Unspecified => serializer.serialize_i32(0),
46072 Self::Master => serializer.serialize_i32(1),
46073 Self::NodePool => serializer.serialize_i32(2),
46074 Self::UnknownValue(u) => u.0.serialize(serializer),
46075 }
46076 }
46077}
46078
46079impl<'de> serde::de::Deserialize<'de> for UpgradeResourceType {
46080 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46081 where
46082 D: serde::Deserializer<'de>,
46083 {
46084 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UpgradeResourceType>::new(
46085 ".google.container.v1.UpgradeResourceType",
46086 ))
46087 }
46088}
46089
46090/// The datapath provider selects the implementation of the Kubernetes networking
46091/// model for service resolution and network policy enforcement.
46092///
46093/// # Working with unknown values
46094///
46095/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
46096/// additional enum variants at any time. Adding new variants is not considered
46097/// a breaking change. Applications should write their code in anticipation of:
46098///
46099/// - New values appearing in future releases of the client library, **and**
46100/// - New values received dynamically, without application changes.
46101///
46102/// Please consult the [Working with enums] section in the user guide for some
46103/// guidelines.
46104///
46105/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
46106#[derive(Clone, Debug, PartialEq)]
46107#[non_exhaustive]
46108pub enum DatapathProvider {
46109 /// Default value.
46110 Unspecified,
46111 /// Use the IPTables implementation based on kube-proxy.
46112 LegacyDatapath,
46113 /// Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE
46114 /// Dataplane V2
46115 /// documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2)
46116 /// for more.
46117 AdvancedDatapath,
46118 /// If set, the enum was initialized with an unknown value.
46119 ///
46120 /// Applications can examine the value using [DatapathProvider::value] or
46121 /// [DatapathProvider::name].
46122 UnknownValue(datapath_provider::UnknownValue),
46123}
46124
46125#[doc(hidden)]
46126pub mod datapath_provider {
46127 #[allow(unused_imports)]
46128 use super::*;
46129 #[derive(Clone, Debug, PartialEq)]
46130 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
46131}
46132
46133impl DatapathProvider {
46134 /// Gets the enum value.
46135 ///
46136 /// Returns `None` if the enum contains an unknown value deserialized from
46137 /// the string representation of enums.
46138 pub fn value(&self) -> std::option::Option<i32> {
46139 match self {
46140 Self::Unspecified => std::option::Option::Some(0),
46141 Self::LegacyDatapath => std::option::Option::Some(1),
46142 Self::AdvancedDatapath => std::option::Option::Some(2),
46143 Self::UnknownValue(u) => u.0.value(),
46144 }
46145 }
46146
46147 /// Gets the enum value as a string.
46148 ///
46149 /// Returns `None` if the enum contains an unknown value deserialized from
46150 /// the integer representation of enums.
46151 pub fn name(&self) -> std::option::Option<&str> {
46152 match self {
46153 Self::Unspecified => std::option::Option::Some("DATAPATH_PROVIDER_UNSPECIFIED"),
46154 Self::LegacyDatapath => std::option::Option::Some("LEGACY_DATAPATH"),
46155 Self::AdvancedDatapath => std::option::Option::Some("ADVANCED_DATAPATH"),
46156 Self::UnknownValue(u) => u.0.name(),
46157 }
46158 }
46159}
46160
46161impl std::default::Default for DatapathProvider {
46162 fn default() -> Self {
46163 use std::convert::From;
46164 Self::from(0)
46165 }
46166}
46167
46168impl std::fmt::Display for DatapathProvider {
46169 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46170 wkt::internal::display_enum(f, self.name(), self.value())
46171 }
46172}
46173
46174impl std::convert::From<i32> for DatapathProvider {
46175 fn from(value: i32) -> Self {
46176 match value {
46177 0 => Self::Unspecified,
46178 1 => Self::LegacyDatapath,
46179 2 => Self::AdvancedDatapath,
46180 _ => Self::UnknownValue(datapath_provider::UnknownValue(
46181 wkt::internal::UnknownEnumValue::Integer(value),
46182 )),
46183 }
46184 }
46185}
46186
46187impl std::convert::From<&str> for DatapathProvider {
46188 fn from(value: &str) -> Self {
46189 use std::string::ToString;
46190 match value {
46191 "DATAPATH_PROVIDER_UNSPECIFIED" => Self::Unspecified,
46192 "LEGACY_DATAPATH" => Self::LegacyDatapath,
46193 "ADVANCED_DATAPATH" => Self::AdvancedDatapath,
46194 _ => Self::UnknownValue(datapath_provider::UnknownValue(
46195 wkt::internal::UnknownEnumValue::String(value.to_string()),
46196 )),
46197 }
46198 }
46199}
46200
46201impl serde::ser::Serialize for DatapathProvider {
46202 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46203 where
46204 S: serde::Serializer,
46205 {
46206 match self {
46207 Self::Unspecified => serializer.serialize_i32(0),
46208 Self::LegacyDatapath => serializer.serialize_i32(1),
46209 Self::AdvancedDatapath => serializer.serialize_i32(2),
46210 Self::UnknownValue(u) => u.0.serialize(serializer),
46211 }
46212 }
46213}
46214
46215impl<'de> serde::de::Deserialize<'de> for DatapathProvider {
46216 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46217 where
46218 D: serde::Deserializer<'de>,
46219 {
46220 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatapathProvider>::new(
46221 ".google.container.v1.DatapathProvider",
46222 ))
46223 }
46224}
46225
46226/// Strategy used for node pool update.
46227///
46228/// # Working with unknown values
46229///
46230/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
46231/// additional enum variants at any time. Adding new variants is not considered
46232/// a breaking change. Applications should write their code in anticipation of:
46233///
46234/// - New values appearing in future releases of the client library, **and**
46235/// - New values received dynamically, without application changes.
46236///
46237/// Please consult the [Working with enums] section in the user guide for some
46238/// guidelines.
46239///
46240/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
46241#[derive(Clone, Debug, PartialEq)]
46242#[non_exhaustive]
46243pub enum NodePoolUpdateStrategy {
46244 /// Default value if unset. GKE internally defaults the update strategy to
46245 /// SURGE for unspecified strategies.
46246 Unspecified,
46247 /// blue-green upgrade.
46248 BlueGreen,
46249 /// SURGE is the traditional way of upgrade a node pool.
46250 /// max_surge and max_unavailable determines the level of upgrade parallelism.
46251 Surge,
46252 /// SHORT_LIVED is the dedicated upgrade strategy for
46253 /// QueuedProvisioning and flex start node pools scaled up only by enqueueing
46254 /// to the Dynamic Workload Scheduler (DWS).
46255 ShortLived,
46256 /// If set, the enum was initialized with an unknown value.
46257 ///
46258 /// Applications can examine the value using [NodePoolUpdateStrategy::value] or
46259 /// [NodePoolUpdateStrategy::name].
46260 UnknownValue(node_pool_update_strategy::UnknownValue),
46261}
46262
46263#[doc(hidden)]
46264pub mod node_pool_update_strategy {
46265 #[allow(unused_imports)]
46266 use super::*;
46267 #[derive(Clone, Debug, PartialEq)]
46268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
46269}
46270
46271impl NodePoolUpdateStrategy {
46272 /// Gets the enum value.
46273 ///
46274 /// Returns `None` if the enum contains an unknown value deserialized from
46275 /// the string representation of enums.
46276 pub fn value(&self) -> std::option::Option<i32> {
46277 match self {
46278 Self::Unspecified => std::option::Option::Some(0),
46279 Self::BlueGreen => std::option::Option::Some(2),
46280 Self::Surge => std::option::Option::Some(3),
46281 Self::ShortLived => std::option::Option::Some(5),
46282 Self::UnknownValue(u) => u.0.value(),
46283 }
46284 }
46285
46286 /// Gets the enum value as a string.
46287 ///
46288 /// Returns `None` if the enum contains an unknown value deserialized from
46289 /// the integer representation of enums.
46290 pub fn name(&self) -> std::option::Option<&str> {
46291 match self {
46292 Self::Unspecified => std::option::Option::Some("NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED"),
46293 Self::BlueGreen => std::option::Option::Some("BLUE_GREEN"),
46294 Self::Surge => std::option::Option::Some("SURGE"),
46295 Self::ShortLived => std::option::Option::Some("SHORT_LIVED"),
46296 Self::UnknownValue(u) => u.0.name(),
46297 }
46298 }
46299}
46300
46301impl std::default::Default for NodePoolUpdateStrategy {
46302 fn default() -> Self {
46303 use std::convert::From;
46304 Self::from(0)
46305 }
46306}
46307
46308impl std::fmt::Display for NodePoolUpdateStrategy {
46309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46310 wkt::internal::display_enum(f, self.name(), self.value())
46311 }
46312}
46313
46314impl std::convert::From<i32> for NodePoolUpdateStrategy {
46315 fn from(value: i32) -> Self {
46316 match value {
46317 0 => Self::Unspecified,
46318 2 => Self::BlueGreen,
46319 3 => Self::Surge,
46320 5 => Self::ShortLived,
46321 _ => Self::UnknownValue(node_pool_update_strategy::UnknownValue(
46322 wkt::internal::UnknownEnumValue::Integer(value),
46323 )),
46324 }
46325 }
46326}
46327
46328impl std::convert::From<&str> for NodePoolUpdateStrategy {
46329 fn from(value: &str) -> Self {
46330 use std::string::ToString;
46331 match value {
46332 "NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED" => Self::Unspecified,
46333 "BLUE_GREEN" => Self::BlueGreen,
46334 "SURGE" => Self::Surge,
46335 "SHORT_LIVED" => Self::ShortLived,
46336 _ => Self::UnknownValue(node_pool_update_strategy::UnknownValue(
46337 wkt::internal::UnknownEnumValue::String(value.to_string()),
46338 )),
46339 }
46340 }
46341}
46342
46343impl serde::ser::Serialize for NodePoolUpdateStrategy {
46344 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46345 where
46346 S: serde::Serializer,
46347 {
46348 match self {
46349 Self::Unspecified => serializer.serialize_i32(0),
46350 Self::BlueGreen => serializer.serialize_i32(2),
46351 Self::Surge => serializer.serialize_i32(3),
46352 Self::ShortLived => serializer.serialize_i32(5),
46353 Self::UnknownValue(u) => u.0.serialize(serializer),
46354 }
46355 }
46356}
46357
46358impl<'de> serde::de::Deserialize<'de> for NodePoolUpdateStrategy {
46359 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46360 where
46361 D: serde::Deserializer<'de>,
46362 {
46363 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodePoolUpdateStrategy>::new(
46364 ".google.container.v1.NodePoolUpdateStrategy",
46365 ))
46366 }
46367}
46368
46369/// Possible values for IP stack type
46370///
46371/// # Working with unknown values
46372///
46373/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
46374/// additional enum variants at any time. Adding new variants is not considered
46375/// a breaking change. Applications should write their code in anticipation of:
46376///
46377/// - New values appearing in future releases of the client library, **and**
46378/// - New values received dynamically, without application changes.
46379///
46380/// Please consult the [Working with enums] section in the user guide for some
46381/// guidelines.
46382///
46383/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
46384#[derive(Clone, Debug, PartialEq)]
46385#[non_exhaustive]
46386pub enum StackType {
46387 /// Default value, will be defaulted as IPV4 only
46388 Unspecified,
46389 /// Cluster is IPV4 only
46390 Ipv4,
46391 /// Cluster can use both IPv4 and IPv6
46392 Ipv4Ipv6,
46393 /// If set, the enum was initialized with an unknown value.
46394 ///
46395 /// Applications can examine the value using [StackType::value] or
46396 /// [StackType::name].
46397 UnknownValue(stack_type::UnknownValue),
46398}
46399
46400#[doc(hidden)]
46401pub mod stack_type {
46402 #[allow(unused_imports)]
46403 use super::*;
46404 #[derive(Clone, Debug, PartialEq)]
46405 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
46406}
46407
46408impl StackType {
46409 /// Gets the enum value.
46410 ///
46411 /// Returns `None` if the enum contains an unknown value deserialized from
46412 /// the string representation of enums.
46413 pub fn value(&self) -> std::option::Option<i32> {
46414 match self {
46415 Self::Unspecified => std::option::Option::Some(0),
46416 Self::Ipv4 => std::option::Option::Some(1),
46417 Self::Ipv4Ipv6 => std::option::Option::Some(2),
46418 Self::UnknownValue(u) => u.0.value(),
46419 }
46420 }
46421
46422 /// Gets the enum value as a string.
46423 ///
46424 /// Returns `None` if the enum contains an unknown value deserialized from
46425 /// the integer representation of enums.
46426 pub fn name(&self) -> std::option::Option<&str> {
46427 match self {
46428 Self::Unspecified => std::option::Option::Some("STACK_TYPE_UNSPECIFIED"),
46429 Self::Ipv4 => std::option::Option::Some("IPV4"),
46430 Self::Ipv4Ipv6 => std::option::Option::Some("IPV4_IPV6"),
46431 Self::UnknownValue(u) => u.0.name(),
46432 }
46433 }
46434}
46435
46436impl std::default::Default for StackType {
46437 fn default() -> Self {
46438 use std::convert::From;
46439 Self::from(0)
46440 }
46441}
46442
46443impl std::fmt::Display for StackType {
46444 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46445 wkt::internal::display_enum(f, self.name(), self.value())
46446 }
46447}
46448
46449impl std::convert::From<i32> for StackType {
46450 fn from(value: i32) -> Self {
46451 match value {
46452 0 => Self::Unspecified,
46453 1 => Self::Ipv4,
46454 2 => Self::Ipv4Ipv6,
46455 _ => Self::UnknownValue(stack_type::UnknownValue(
46456 wkt::internal::UnknownEnumValue::Integer(value),
46457 )),
46458 }
46459 }
46460}
46461
46462impl std::convert::From<&str> for StackType {
46463 fn from(value: &str) -> Self {
46464 use std::string::ToString;
46465 match value {
46466 "STACK_TYPE_UNSPECIFIED" => Self::Unspecified,
46467 "IPV4" => Self::Ipv4,
46468 "IPV4_IPV6" => Self::Ipv4Ipv6,
46469 _ => Self::UnknownValue(stack_type::UnknownValue(
46470 wkt::internal::UnknownEnumValue::String(value.to_string()),
46471 )),
46472 }
46473 }
46474}
46475
46476impl serde::ser::Serialize for StackType {
46477 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46478 where
46479 S: serde::Serializer,
46480 {
46481 match self {
46482 Self::Unspecified => serializer.serialize_i32(0),
46483 Self::Ipv4 => serializer.serialize_i32(1),
46484 Self::Ipv4Ipv6 => serializer.serialize_i32(2),
46485 Self::UnknownValue(u) => u.0.serialize(serializer),
46486 }
46487 }
46488}
46489
46490impl<'de> serde::de::Deserialize<'de> for StackType {
46491 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46492 where
46493 D: serde::Deserializer<'de>,
46494 {
46495 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StackType>::new(
46496 ".google.container.v1.StackType",
46497 ))
46498 }
46499}
46500
46501/// Possible values for IPv6 access type
46502///
46503/// # Working with unknown values
46504///
46505/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
46506/// additional enum variants at any time. Adding new variants is not considered
46507/// a breaking change. Applications should write their code in anticipation of:
46508///
46509/// - New values appearing in future releases of the client library, **and**
46510/// - New values received dynamically, without application changes.
46511///
46512/// Please consult the [Working with enums] section in the user guide for some
46513/// guidelines.
46514///
46515/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
46516#[derive(Clone, Debug, PartialEq)]
46517#[non_exhaustive]
46518pub enum IPv6AccessType {
46519 /// Default value, will be defaulted as type external.
46520 Ipv6AccessTypeUnspecified,
46521 /// Access type internal (all v6 addresses are internal IPs)
46522 Internal,
46523 /// Access type external (all v6 addresses are external IPs)
46524 External,
46525 /// If set, the enum was initialized with an unknown value.
46526 ///
46527 /// Applications can examine the value using [IPv6AccessType::value] or
46528 /// [IPv6AccessType::name].
46529 UnknownValue(i_pv_6_access_type::UnknownValue),
46530}
46531
46532#[doc(hidden)]
46533pub mod i_pv_6_access_type {
46534 #[allow(unused_imports)]
46535 use super::*;
46536 #[derive(Clone, Debug, PartialEq)]
46537 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
46538}
46539
46540impl IPv6AccessType {
46541 /// Gets the enum value.
46542 ///
46543 /// Returns `None` if the enum contains an unknown value deserialized from
46544 /// the string representation of enums.
46545 pub fn value(&self) -> std::option::Option<i32> {
46546 match self {
46547 Self::Ipv6AccessTypeUnspecified => std::option::Option::Some(0),
46548 Self::Internal => std::option::Option::Some(1),
46549 Self::External => std::option::Option::Some(2),
46550 Self::UnknownValue(u) => u.0.value(),
46551 }
46552 }
46553
46554 /// Gets the enum value as a string.
46555 ///
46556 /// Returns `None` if the enum contains an unknown value deserialized from
46557 /// the integer representation of enums.
46558 pub fn name(&self) -> std::option::Option<&str> {
46559 match self {
46560 Self::Ipv6AccessTypeUnspecified => {
46561 std::option::Option::Some("IPV6_ACCESS_TYPE_UNSPECIFIED")
46562 }
46563 Self::Internal => std::option::Option::Some("INTERNAL"),
46564 Self::External => std::option::Option::Some("EXTERNAL"),
46565 Self::UnknownValue(u) => u.0.name(),
46566 }
46567 }
46568}
46569
46570impl std::default::Default for IPv6AccessType {
46571 fn default() -> Self {
46572 use std::convert::From;
46573 Self::from(0)
46574 }
46575}
46576
46577impl std::fmt::Display for IPv6AccessType {
46578 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46579 wkt::internal::display_enum(f, self.name(), self.value())
46580 }
46581}
46582
46583impl std::convert::From<i32> for IPv6AccessType {
46584 fn from(value: i32) -> Self {
46585 match value {
46586 0 => Self::Ipv6AccessTypeUnspecified,
46587 1 => Self::Internal,
46588 2 => Self::External,
46589 _ => Self::UnknownValue(i_pv_6_access_type::UnknownValue(
46590 wkt::internal::UnknownEnumValue::Integer(value),
46591 )),
46592 }
46593 }
46594}
46595
46596impl std::convert::From<&str> for IPv6AccessType {
46597 fn from(value: &str) -> Self {
46598 use std::string::ToString;
46599 match value {
46600 "IPV6_ACCESS_TYPE_UNSPECIFIED" => Self::Ipv6AccessTypeUnspecified,
46601 "INTERNAL" => Self::Internal,
46602 "EXTERNAL" => Self::External,
46603 _ => Self::UnknownValue(i_pv_6_access_type::UnknownValue(
46604 wkt::internal::UnknownEnumValue::String(value.to_string()),
46605 )),
46606 }
46607 }
46608}
46609
46610impl serde::ser::Serialize for IPv6AccessType {
46611 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46612 where
46613 S: serde::Serializer,
46614 {
46615 match self {
46616 Self::Ipv6AccessTypeUnspecified => serializer.serialize_i32(0),
46617 Self::Internal => serializer.serialize_i32(1),
46618 Self::External => serializer.serialize_i32(2),
46619 Self::UnknownValue(u) => u.0.serialize(serializer),
46620 }
46621 }
46622}
46623
46624impl<'de> serde::de::Deserialize<'de> for IPv6AccessType {
46625 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46626 where
46627 D: serde::Deserializer<'de>,
46628 {
46629 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPv6AccessType>::new(
46630 ".google.container.v1.IPv6AccessType",
46631 ))
46632 }
46633}
46634
46635/// Options for in-transit encryption.
46636///
46637/// # Working with unknown values
46638///
46639/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
46640/// additional enum variants at any time. Adding new variants is not considered
46641/// a breaking change. Applications should write their code in anticipation of:
46642///
46643/// - New values appearing in future releases of the client library, **and**
46644/// - New values received dynamically, without application changes.
46645///
46646/// Please consult the [Working with enums] section in the user guide for some
46647/// guidelines.
46648///
46649/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
46650#[derive(Clone, Debug, PartialEq)]
46651#[non_exhaustive]
46652pub enum InTransitEncryptionConfig {
46653 /// Unspecified, will be inferred as default -
46654 /// IN_TRANSIT_ENCRYPTION_UNSPECIFIED.
46655 Unspecified,
46656 /// In-transit encryption is disabled.
46657 InTransitEncryptionDisabled,
46658 /// Data in-transit is encrypted using inter-node transparent encryption.
46659 InTransitEncryptionInterNodeTransparent,
46660 /// If set, the enum was initialized with an unknown value.
46661 ///
46662 /// Applications can examine the value using [InTransitEncryptionConfig::value] or
46663 /// [InTransitEncryptionConfig::name].
46664 UnknownValue(in_transit_encryption_config::UnknownValue),
46665}
46666
46667#[doc(hidden)]
46668pub mod in_transit_encryption_config {
46669 #[allow(unused_imports)]
46670 use super::*;
46671 #[derive(Clone, Debug, PartialEq)]
46672 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
46673}
46674
46675impl InTransitEncryptionConfig {
46676 /// Gets the enum value.
46677 ///
46678 /// Returns `None` if the enum contains an unknown value deserialized from
46679 /// the string representation of enums.
46680 pub fn value(&self) -> std::option::Option<i32> {
46681 match self {
46682 Self::Unspecified => std::option::Option::Some(0),
46683 Self::InTransitEncryptionDisabled => std::option::Option::Some(1),
46684 Self::InTransitEncryptionInterNodeTransparent => std::option::Option::Some(2),
46685 Self::UnknownValue(u) => u.0.value(),
46686 }
46687 }
46688
46689 /// Gets the enum value as a string.
46690 ///
46691 /// Returns `None` if the enum contains an unknown value deserialized from
46692 /// the integer representation of enums.
46693 pub fn name(&self) -> std::option::Option<&str> {
46694 match self {
46695 Self::Unspecified => {
46696 std::option::Option::Some("IN_TRANSIT_ENCRYPTION_CONFIG_UNSPECIFIED")
46697 }
46698 Self::InTransitEncryptionDisabled => {
46699 std::option::Option::Some("IN_TRANSIT_ENCRYPTION_DISABLED")
46700 }
46701 Self::InTransitEncryptionInterNodeTransparent => {
46702 std::option::Option::Some("IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT")
46703 }
46704 Self::UnknownValue(u) => u.0.name(),
46705 }
46706 }
46707}
46708
46709impl std::default::Default for InTransitEncryptionConfig {
46710 fn default() -> Self {
46711 use std::convert::From;
46712 Self::from(0)
46713 }
46714}
46715
46716impl std::fmt::Display for InTransitEncryptionConfig {
46717 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
46718 wkt::internal::display_enum(f, self.name(), self.value())
46719 }
46720}
46721
46722impl std::convert::From<i32> for InTransitEncryptionConfig {
46723 fn from(value: i32) -> Self {
46724 match value {
46725 0 => Self::Unspecified,
46726 1 => Self::InTransitEncryptionDisabled,
46727 2 => Self::InTransitEncryptionInterNodeTransparent,
46728 _ => Self::UnknownValue(in_transit_encryption_config::UnknownValue(
46729 wkt::internal::UnknownEnumValue::Integer(value),
46730 )),
46731 }
46732 }
46733}
46734
46735impl std::convert::From<&str> for InTransitEncryptionConfig {
46736 fn from(value: &str) -> Self {
46737 use std::string::ToString;
46738 match value {
46739 "IN_TRANSIT_ENCRYPTION_CONFIG_UNSPECIFIED" => Self::Unspecified,
46740 "IN_TRANSIT_ENCRYPTION_DISABLED" => Self::InTransitEncryptionDisabled,
46741 "IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT" => {
46742 Self::InTransitEncryptionInterNodeTransparent
46743 }
46744 _ => Self::UnknownValue(in_transit_encryption_config::UnknownValue(
46745 wkt::internal::UnknownEnumValue::String(value.to_string()),
46746 )),
46747 }
46748 }
46749}
46750
46751impl serde::ser::Serialize for InTransitEncryptionConfig {
46752 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
46753 where
46754 S: serde::Serializer,
46755 {
46756 match self {
46757 Self::Unspecified => serializer.serialize_i32(0),
46758 Self::InTransitEncryptionDisabled => serializer.serialize_i32(1),
46759 Self::InTransitEncryptionInterNodeTransparent => serializer.serialize_i32(2),
46760 Self::UnknownValue(u) => u.0.serialize(serializer),
46761 }
46762 }
46763}
46764
46765impl<'de> serde::de::Deserialize<'de> for InTransitEncryptionConfig {
46766 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
46767 where
46768 D: serde::Deserializer<'de>,
46769 {
46770 deserializer.deserialize_any(
46771 wkt::internal::EnumVisitor::<InTransitEncryptionConfig>::new(
46772 ".google.container.v1.InTransitEncryptionConfig",
46773 ),
46774 )
46775 }
46776}