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::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate reqwest;
26extern crate rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Parameters that can be configured on Linux nodes.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct LinuxNodeConfig {
42    /// The Linux kernel parameters to be applied to the nodes and all pods running
43    /// on the nodes.
44    ///
45    /// The following parameters are supported.
46    ///
47    /// net.core.busy_poll
48    /// net.core.busy_read
49    /// net.core.netdev_max_backlog
50    /// net.core.rmem_max
51    /// net.core.rmem_default
52    /// net.core.wmem_default
53    /// net.core.wmem_max
54    /// net.core.optmem_max
55    /// net.core.somaxconn
56    /// net.ipv4.tcp_rmem
57    /// net.ipv4.tcp_wmem
58    /// net.ipv4.tcp_tw_reuse
59    /// net.ipv4.tcp_max_orphans
60    /// net.netfilter.nf_conntrack_max
61    /// net.netfilter.nf_conntrack_buckets
62    /// net.netfilter.nf_conntrack_tcp_timeout_close_wait
63    /// net.netfilter.nf_conntrack_tcp_timeout_time_wait
64    /// net.netfilter.nf_conntrack_tcp_timeout_established
65    /// net.netfilter.nf_conntrack_acct
66    /// kernel.shmmni
67    /// kernel.shmmax
68    /// kernel.shmall
69    /// fs.aio-max-nr
70    /// fs.file-max
71    /// fs.inotify.max_user_instances
72    /// fs.inotify.max_user_watches
73    /// fs.nr_open
74    /// vm.dirty_background_ratio
75    /// vm.dirty_expire_centisecs
76    /// vm.dirty_ratio
77    /// vm.dirty_writeback_centisecs
78    /// vm.max_map_count
79    /// vm.overcommit_memory
80    /// vm.overcommit_ratio
81    /// vm.vfs_cache_pressure
82    /// vm.swappiness
83    /// vm.watermark_scale_factor
84    /// vm.min_free_kbytes
85    pub sysctls: std::collections::HashMap<std::string::String, std::string::String>,
86
87    /// cgroup_mode specifies the cgroup mode to be used on the node.
88    pub cgroup_mode: crate::model::linux_node_config::CgroupMode,
89
90    /// Optional. Amounts for 2M and 1G hugepages
91    pub hugepages: std::option::Option<crate::model::linux_node_config::HugepagesConfig>,
92
93    /// Optional. Transparent hugepage support for anonymous memory can be entirely
94    /// disabled (mostly for debugging purposes) or only enabled inside
95    /// MADV_HUGEPAGE regions (to avoid the risk of consuming more memory
96    /// resources) or enabled system wide.
97    ///
98    /// See <https://docs.kernel.org/admin-guide/mm/transhuge.html>
99    /// for more details.
100    pub transparent_hugepage_enabled: crate::model::linux_node_config::TransparentHugepageEnabled,
101
102    /// Optional. Defines the transparent hugepage defrag configuration on the
103    /// node. VM hugepage allocation can be managed by either limiting
104    /// defragmentation for delayed allocation or skipping it entirely for
105    /// immediate allocation only.
106    ///
107    /// See <https://docs.kernel.org/admin-guide/mm/transhuge.html>
108    /// for more details.
109    pub transparent_hugepage_defrag: crate::model::linux_node_config::TransparentHugepageDefrag,
110
111    /// Optional. Configuration for kernel module loading on nodes.
112    /// When enabled, the node pool will be provisioned with a Container-Optimized
113    /// OS image that enforces kernel module signature verification.
114    pub node_kernel_module_loading:
115        std::option::Option<crate::model::linux_node_config::NodeKernelModuleLoading>,
116
117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl LinuxNodeConfig {
121    pub fn new() -> Self {
122        std::default::Default::default()
123    }
124
125    /// Sets the value of [sysctls][crate::model::LinuxNodeConfig::sysctls].
126    ///
127    /// # Example
128    /// ```ignore,no_run
129    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
130    /// let x = LinuxNodeConfig::new().set_sysctls([
131    ///     ("key0", "abc"),
132    ///     ("key1", "xyz"),
133    /// ]);
134    /// ```
135    pub fn set_sysctls<T, K, V>(mut self, v: T) -> Self
136    where
137        T: std::iter::IntoIterator<Item = (K, V)>,
138        K: std::convert::Into<std::string::String>,
139        V: std::convert::Into<std::string::String>,
140    {
141        use std::iter::Iterator;
142        self.sysctls = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
143        self
144    }
145
146    /// Sets the value of [cgroup_mode][crate::model::LinuxNodeConfig::cgroup_mode].
147    ///
148    /// # Example
149    /// ```ignore,no_run
150    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
151    /// use google_cloud_container_v1::model::linux_node_config::CgroupMode;
152    /// let x0 = LinuxNodeConfig::new().set_cgroup_mode(CgroupMode::V1);
153    /// let x1 = LinuxNodeConfig::new().set_cgroup_mode(CgroupMode::V2);
154    /// ```
155    pub fn set_cgroup_mode<T: std::convert::Into<crate::model::linux_node_config::CgroupMode>>(
156        mut self,
157        v: T,
158    ) -> Self {
159        self.cgroup_mode = v.into();
160        self
161    }
162
163    /// Sets the value of [hugepages][crate::model::LinuxNodeConfig::hugepages].
164    ///
165    /// # Example
166    /// ```ignore,no_run
167    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
168    /// use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
169    /// let x = LinuxNodeConfig::new().set_hugepages(HugepagesConfig::default()/* use setters */);
170    /// ```
171    pub fn set_hugepages<T>(mut self, v: T) -> Self
172    where
173        T: std::convert::Into<crate::model::linux_node_config::HugepagesConfig>,
174    {
175        self.hugepages = std::option::Option::Some(v.into());
176        self
177    }
178
179    /// Sets or clears the value of [hugepages][crate::model::LinuxNodeConfig::hugepages].
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::HugepagesConfig;
185    /// let x = LinuxNodeConfig::new().set_or_clear_hugepages(Some(HugepagesConfig::default()/* use setters */));
186    /// let x = LinuxNodeConfig::new().set_or_clear_hugepages(None::<HugepagesConfig>);
187    /// ```
188    pub fn set_or_clear_hugepages<T>(mut self, v: std::option::Option<T>) -> Self
189    where
190        T: std::convert::Into<crate::model::linux_node_config::HugepagesConfig>,
191    {
192        self.hugepages = v.map(|x| x.into());
193        self
194    }
195
196    /// Sets the value of [transparent_hugepage_enabled][crate::model::LinuxNodeConfig::transparent_hugepage_enabled].
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::TransparentHugepageEnabled;
202    /// let x0 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Always);
203    /// let x1 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Madvise);
204    /// let x2 = LinuxNodeConfig::new().set_transparent_hugepage_enabled(TransparentHugepageEnabled::Never);
205    /// ```
206    pub fn set_transparent_hugepage_enabled<
207        T: std::convert::Into<crate::model::linux_node_config::TransparentHugepageEnabled>,
208    >(
209        mut self,
210        v: T,
211    ) -> Self {
212        self.transparent_hugepage_enabled = v.into();
213        self
214    }
215
216    /// Sets the value of [transparent_hugepage_defrag][crate::model::LinuxNodeConfig::transparent_hugepage_defrag].
217    ///
218    /// # Example
219    /// ```ignore,no_run
220    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
221    /// use google_cloud_container_v1::model::linux_node_config::TransparentHugepageDefrag;
222    /// let x0 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::Always);
223    /// let x1 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::Defer);
224    /// let x2 = LinuxNodeConfig::new().set_transparent_hugepage_defrag(TransparentHugepageDefrag::DeferWithMadvise);
225    /// ```
226    pub fn set_transparent_hugepage_defrag<
227        T: std::convert::Into<crate::model::linux_node_config::TransparentHugepageDefrag>,
228    >(
229        mut self,
230        v: T,
231    ) -> Self {
232        self.transparent_hugepage_defrag = v.into();
233        self
234    }
235
236    /// Sets the value of [node_kernel_module_loading][crate::model::LinuxNodeConfig::node_kernel_module_loading].
237    ///
238    /// # Example
239    /// ```ignore,no_run
240    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
241    /// use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
242    /// let x = LinuxNodeConfig::new().set_node_kernel_module_loading(NodeKernelModuleLoading::default()/* use setters */);
243    /// ```
244    pub fn set_node_kernel_module_loading<T>(mut self, v: T) -> Self
245    where
246        T: std::convert::Into<crate::model::linux_node_config::NodeKernelModuleLoading>,
247    {
248        self.node_kernel_module_loading = std::option::Option::Some(v.into());
249        self
250    }
251
252    /// Sets or clears the value of [node_kernel_module_loading][crate::model::LinuxNodeConfig::node_kernel_module_loading].
253    ///
254    /// # Example
255    /// ```ignore,no_run
256    /// # use google_cloud_container_v1::model::LinuxNodeConfig;
257    /// use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
258    /// let x = LinuxNodeConfig::new().set_or_clear_node_kernel_module_loading(Some(NodeKernelModuleLoading::default()/* use setters */));
259    /// let x = LinuxNodeConfig::new().set_or_clear_node_kernel_module_loading(None::<NodeKernelModuleLoading>);
260    /// ```
261    pub fn set_or_clear_node_kernel_module_loading<T>(mut self, v: std::option::Option<T>) -> Self
262    where
263        T: std::convert::Into<crate::model::linux_node_config::NodeKernelModuleLoading>,
264    {
265        self.node_kernel_module_loading = v.map(|x| x.into());
266        self
267    }
268}
269
270impl wkt::message::Message for LinuxNodeConfig {
271    fn typename() -> &'static str {
272        "type.googleapis.com/google.container.v1.LinuxNodeConfig"
273    }
274}
275
276/// Defines additional types related to [LinuxNodeConfig].
277pub mod linux_node_config {
278    #[allow(unused_imports)]
279    use super::*;
280
281    /// Hugepages amount in both 2m and 1g size
282    #[derive(Clone, Default, PartialEq)]
283    #[non_exhaustive]
284    pub struct HugepagesConfig {
285        /// Optional. Amount of 2M hugepages
286        pub hugepage_size2m: std::option::Option<i32>,
287
288        /// Optional. Amount of 1G hugepages
289        pub hugepage_size1g: std::option::Option<i32>,
290
291        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
292    }
293
294    impl HugepagesConfig {
295        pub fn new() -> Self {
296            std::default::Default::default()
297        }
298
299        /// Sets the value of [hugepage_size2m][crate::model::linux_node_config::HugepagesConfig::hugepage_size2m].
300        ///
301        /// # Example
302        /// ```ignore,no_run
303        /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
304        /// let x = HugepagesConfig::new().set_hugepage_size2m(42);
305        /// ```
306        pub fn set_hugepage_size2m<T>(mut self, v: T) -> Self
307        where
308            T: std::convert::Into<i32>,
309        {
310            self.hugepage_size2m = std::option::Option::Some(v.into());
311            self
312        }
313
314        /// Sets or clears the value of [hugepage_size2m][crate::model::linux_node_config::HugepagesConfig::hugepage_size2m].
315        ///
316        /// # Example
317        /// ```ignore,no_run
318        /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
319        /// let x = HugepagesConfig::new().set_or_clear_hugepage_size2m(Some(42));
320        /// let x = HugepagesConfig::new().set_or_clear_hugepage_size2m(None::<i32>);
321        /// ```
322        pub fn set_or_clear_hugepage_size2m<T>(mut self, v: std::option::Option<T>) -> Self
323        where
324            T: std::convert::Into<i32>,
325        {
326            self.hugepage_size2m = v.map(|x| x.into());
327            self
328        }
329
330        /// Sets the value of [hugepage_size1g][crate::model::linux_node_config::HugepagesConfig::hugepage_size1g].
331        ///
332        /// # Example
333        /// ```ignore,no_run
334        /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
335        /// let x = HugepagesConfig::new().set_hugepage_size1g(42);
336        /// ```
337        pub fn set_hugepage_size1g<T>(mut self, v: T) -> Self
338        where
339            T: std::convert::Into<i32>,
340        {
341            self.hugepage_size1g = std::option::Option::Some(v.into());
342            self
343        }
344
345        /// Sets or clears the value of [hugepage_size1g][crate::model::linux_node_config::HugepagesConfig::hugepage_size1g].
346        ///
347        /// # Example
348        /// ```ignore,no_run
349        /// # use google_cloud_container_v1::model::linux_node_config::HugepagesConfig;
350        /// let x = HugepagesConfig::new().set_or_clear_hugepage_size1g(Some(42));
351        /// let x = HugepagesConfig::new().set_or_clear_hugepage_size1g(None::<i32>);
352        /// ```
353        pub fn set_or_clear_hugepage_size1g<T>(mut self, v: std::option::Option<T>) -> Self
354        where
355            T: std::convert::Into<i32>,
356        {
357            self.hugepage_size1g = v.map(|x| x.into());
358            self
359        }
360    }
361
362    impl wkt::message::Message for HugepagesConfig {
363        fn typename() -> &'static str {
364            "type.googleapis.com/google.container.v1.LinuxNodeConfig.HugepagesConfig"
365        }
366    }
367
368    /// Configuration for kernel module loading on nodes.
369    #[derive(Clone, Default, PartialEq)]
370    #[non_exhaustive]
371    pub struct NodeKernelModuleLoading {
372        /// Set the node module loading policy for nodes in the node pool.
373        pub policy: crate::model::linux_node_config::node_kernel_module_loading::Policy,
374
375        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
376    }
377
378    impl NodeKernelModuleLoading {
379        pub fn new() -> Self {
380            std::default::Default::default()
381        }
382
383        /// Sets the value of [policy][crate::model::linux_node_config::NodeKernelModuleLoading::policy].
384        ///
385        /// # Example
386        /// ```ignore,no_run
387        /// # use google_cloud_container_v1::model::linux_node_config::NodeKernelModuleLoading;
388        /// use google_cloud_container_v1::model::linux_node_config::node_kernel_module_loading::Policy;
389        /// let x0 = NodeKernelModuleLoading::new().set_policy(Policy::EnforceSignedModules);
390        /// let x1 = NodeKernelModuleLoading::new().set_policy(Policy::DoNotEnforceSignedModules);
391        /// ```
392        pub fn set_policy<
393            T: std::convert::Into<crate::model::linux_node_config::node_kernel_module_loading::Policy>,
394        >(
395            mut self,
396            v: T,
397        ) -> Self {
398            self.policy = v.into();
399            self
400        }
401    }
402
403    impl wkt::message::Message for NodeKernelModuleLoading {
404        fn typename() -> &'static str {
405            "type.googleapis.com/google.container.v1.LinuxNodeConfig.NodeKernelModuleLoading"
406        }
407    }
408
409    /// Defines additional types related to [NodeKernelModuleLoading].
410    pub mod node_kernel_module_loading {
411        #[allow(unused_imports)]
412        use super::*;
413
414        /// Defines the kernel module loading policy for nodes in the nodepool.
415        ///
416        /// # Working with unknown values
417        ///
418        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
419        /// additional enum variants at any time. Adding new variants is not considered
420        /// a breaking change. Applications should write their code in anticipation of:
421        ///
422        /// - New values appearing in future releases of the client library, **and**
423        /// - New values received dynamically, without application changes.
424        ///
425        /// Please consult the [Working with enums] section in the user guide for some
426        /// guidelines.
427        ///
428        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
429        #[derive(Clone, Debug, PartialEq)]
430        #[non_exhaustive]
431        pub enum Policy {
432            /// Default behavior. GKE selects the image based on node type.
433            /// For CPU and TPU nodes, the image will not allow loading external
434            /// kernel modules.
435            /// For GPU nodes, the image will allow loading any module, whether it
436            /// is signed or not.
437            Unspecified,
438            /// Enforced signature verification: Node pools will use a
439            /// Container-Optimized OS image configured to allow loading of
440            /// *Google-signed* external kernel modules.
441            /// Loadpin is enabled but configured to exclude modules, and kernel
442            /// module signature checking is enforced.
443            EnforceSignedModules,
444            /// Mirrors existing DEFAULT behavior:
445            /// For CPU and TPU nodes, the image will not allow loading external
446            /// kernel modules.
447            /// For GPU nodes, the image will allow loading any module, whether it
448            /// is signed or not.
449            DoNotEnforceSignedModules,
450            /// If set, the enum was initialized with an unknown value.
451            ///
452            /// Applications can examine the value using [Policy::value] or
453            /// [Policy::name].
454            UnknownValue(policy::UnknownValue),
455        }
456
457        #[doc(hidden)]
458        pub mod policy {
459            #[allow(unused_imports)]
460            use super::*;
461            #[derive(Clone, Debug, PartialEq)]
462            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
463        }
464
465        impl Policy {
466            /// Gets the enum value.
467            ///
468            /// Returns `None` if the enum contains an unknown value deserialized from
469            /// the string representation of enums.
470            pub fn value(&self) -> std::option::Option<i32> {
471                match self {
472                    Self::Unspecified => std::option::Option::Some(0),
473                    Self::EnforceSignedModules => std::option::Option::Some(1),
474                    Self::DoNotEnforceSignedModules => std::option::Option::Some(2),
475                    Self::UnknownValue(u) => u.0.value(),
476                }
477            }
478
479            /// Gets the enum value as a string.
480            ///
481            /// Returns `None` if the enum contains an unknown value deserialized from
482            /// the integer representation of enums.
483            pub fn name(&self) -> std::option::Option<&str> {
484                match self {
485                    Self::Unspecified => std::option::Option::Some("POLICY_UNSPECIFIED"),
486                    Self::EnforceSignedModules => {
487                        std::option::Option::Some("ENFORCE_SIGNED_MODULES")
488                    }
489                    Self::DoNotEnforceSignedModules => {
490                        std::option::Option::Some("DO_NOT_ENFORCE_SIGNED_MODULES")
491                    }
492                    Self::UnknownValue(u) => u.0.name(),
493                }
494            }
495        }
496
497        impl std::default::Default for Policy {
498            fn default() -> Self {
499                use std::convert::From;
500                Self::from(0)
501            }
502        }
503
504        impl std::fmt::Display for Policy {
505            fn fmt(
506                &self,
507                f: &mut std::fmt::Formatter<'_>,
508            ) -> std::result::Result<(), std::fmt::Error> {
509                wkt::internal::display_enum(f, self.name(), self.value())
510            }
511        }
512
513        impl std::convert::From<i32> for Policy {
514            fn from(value: i32) -> Self {
515                match value {
516                    0 => Self::Unspecified,
517                    1 => Self::EnforceSignedModules,
518                    2 => Self::DoNotEnforceSignedModules,
519                    _ => Self::UnknownValue(policy::UnknownValue(
520                        wkt::internal::UnknownEnumValue::Integer(value),
521                    )),
522                }
523            }
524        }
525
526        impl std::convert::From<&str> for Policy {
527            fn from(value: &str) -> Self {
528                use std::string::ToString;
529                match value {
530                    "POLICY_UNSPECIFIED" => Self::Unspecified,
531                    "ENFORCE_SIGNED_MODULES" => Self::EnforceSignedModules,
532                    "DO_NOT_ENFORCE_SIGNED_MODULES" => Self::DoNotEnforceSignedModules,
533                    _ => Self::UnknownValue(policy::UnknownValue(
534                        wkt::internal::UnknownEnumValue::String(value.to_string()),
535                    )),
536                }
537            }
538        }
539
540        impl serde::ser::Serialize for Policy {
541            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
542            where
543                S: serde::Serializer,
544            {
545                match self {
546                    Self::Unspecified => serializer.serialize_i32(0),
547                    Self::EnforceSignedModules => serializer.serialize_i32(1),
548                    Self::DoNotEnforceSignedModules => serializer.serialize_i32(2),
549                    Self::UnknownValue(u) => u.0.serialize(serializer),
550                }
551            }
552        }
553
554        impl<'de> serde::de::Deserialize<'de> for Policy {
555            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
556            where
557                D: serde::Deserializer<'de>,
558            {
559                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Policy>::new(
560                    ".google.container.v1.LinuxNodeConfig.NodeKernelModuleLoading.Policy",
561                ))
562            }
563        }
564    }
565
566    /// Possible cgroup modes that can be used.
567    ///
568    /// # Working with unknown values
569    ///
570    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
571    /// additional enum variants at any time. Adding new variants is not considered
572    /// a breaking change. Applications should write their code in anticipation of:
573    ///
574    /// - New values appearing in future releases of the client library, **and**
575    /// - New values received dynamically, without application changes.
576    ///
577    /// Please consult the [Working with enums] section in the user guide for some
578    /// guidelines.
579    ///
580    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
581    #[derive(Clone, Debug, PartialEq)]
582    #[non_exhaustive]
583    pub enum CgroupMode {
584        /// CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used.
585        /// The default for the GKE node OS image will be used.
586        Unspecified,
587        /// CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on
588        /// the node image.
589        V1,
590        /// CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on
591        /// the node image.
592        V2,
593        /// If set, the enum was initialized with an unknown value.
594        ///
595        /// Applications can examine the value using [CgroupMode::value] or
596        /// [CgroupMode::name].
597        UnknownValue(cgroup_mode::UnknownValue),
598    }
599
600    #[doc(hidden)]
601    pub mod cgroup_mode {
602        #[allow(unused_imports)]
603        use super::*;
604        #[derive(Clone, Debug, PartialEq)]
605        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
606    }
607
608    impl CgroupMode {
609        /// Gets the enum value.
610        ///
611        /// Returns `None` if the enum contains an unknown value deserialized from
612        /// the string representation of enums.
613        pub fn value(&self) -> std::option::Option<i32> {
614            match self {
615                Self::Unspecified => std::option::Option::Some(0),
616                Self::V1 => std::option::Option::Some(1),
617                Self::V2 => std::option::Option::Some(2),
618                Self::UnknownValue(u) => u.0.value(),
619            }
620        }
621
622        /// Gets the enum value as a string.
623        ///
624        /// Returns `None` if the enum contains an unknown value deserialized from
625        /// the integer representation of enums.
626        pub fn name(&self) -> std::option::Option<&str> {
627            match self {
628                Self::Unspecified => std::option::Option::Some("CGROUP_MODE_UNSPECIFIED"),
629                Self::V1 => std::option::Option::Some("CGROUP_MODE_V1"),
630                Self::V2 => std::option::Option::Some("CGROUP_MODE_V2"),
631                Self::UnknownValue(u) => u.0.name(),
632            }
633        }
634    }
635
636    impl std::default::Default for CgroupMode {
637        fn default() -> Self {
638            use std::convert::From;
639            Self::from(0)
640        }
641    }
642
643    impl std::fmt::Display for CgroupMode {
644        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
645            wkt::internal::display_enum(f, self.name(), self.value())
646        }
647    }
648
649    impl std::convert::From<i32> for CgroupMode {
650        fn from(value: i32) -> Self {
651            match value {
652                0 => Self::Unspecified,
653                1 => Self::V1,
654                2 => Self::V2,
655                _ => Self::UnknownValue(cgroup_mode::UnknownValue(
656                    wkt::internal::UnknownEnumValue::Integer(value),
657                )),
658            }
659        }
660    }
661
662    impl std::convert::From<&str> for CgroupMode {
663        fn from(value: &str) -> Self {
664            use std::string::ToString;
665            match value {
666                "CGROUP_MODE_UNSPECIFIED" => Self::Unspecified,
667                "CGROUP_MODE_V1" => Self::V1,
668                "CGROUP_MODE_V2" => Self::V2,
669                _ => Self::UnknownValue(cgroup_mode::UnknownValue(
670                    wkt::internal::UnknownEnumValue::String(value.to_string()),
671                )),
672            }
673        }
674    }
675
676    impl serde::ser::Serialize for CgroupMode {
677        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
678        where
679            S: serde::Serializer,
680        {
681            match self {
682                Self::Unspecified => serializer.serialize_i32(0),
683                Self::V1 => serializer.serialize_i32(1),
684                Self::V2 => serializer.serialize_i32(2),
685                Self::UnknownValue(u) => u.0.serialize(serializer),
686            }
687        }
688    }
689
690    impl<'de> serde::de::Deserialize<'de> for CgroupMode {
691        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
692        where
693            D: serde::Deserializer<'de>,
694        {
695            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CgroupMode>::new(
696                ".google.container.v1.LinuxNodeConfig.CgroupMode",
697            ))
698        }
699    }
700
701    /// Possible values for transparent hugepage enabled support.
702    ///
703    /// # Working with unknown values
704    ///
705    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
706    /// additional enum variants at any time. Adding new variants is not considered
707    /// a breaking change. Applications should write their code in anticipation of:
708    ///
709    /// - New values appearing in future releases of the client library, **and**
710    /// - New values received dynamically, without application changes.
711    ///
712    /// Please consult the [Working with enums] section in the user guide for some
713    /// guidelines.
714    ///
715    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
716    #[derive(Clone, Debug, PartialEq)]
717    #[non_exhaustive]
718    pub enum TransparentHugepageEnabled {
719        /// Default value. GKE will not modify the kernel configuration.
720        Unspecified,
721        /// Transparent hugepage support for anonymous memory is enabled system wide.
722        Always,
723        /// Transparent hugepage support for anonymous memory is enabled inside
724        /// MADV_HUGEPAGE regions. This is the default kernel configuration.
725        Madvise,
726        /// Transparent hugepage support for anonymous memory is disabled.
727        Never,
728        /// If set, the enum was initialized with an unknown value.
729        ///
730        /// Applications can examine the value using [TransparentHugepageEnabled::value] or
731        /// [TransparentHugepageEnabled::name].
732        UnknownValue(transparent_hugepage_enabled::UnknownValue),
733    }
734
735    #[doc(hidden)]
736    pub mod transparent_hugepage_enabled {
737        #[allow(unused_imports)]
738        use super::*;
739        #[derive(Clone, Debug, PartialEq)]
740        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
741    }
742
743    impl TransparentHugepageEnabled {
744        /// Gets the enum value.
745        ///
746        /// Returns `None` if the enum contains an unknown value deserialized from
747        /// the string representation of enums.
748        pub fn value(&self) -> std::option::Option<i32> {
749            match self {
750                Self::Unspecified => std::option::Option::Some(0),
751                Self::Always => std::option::Option::Some(1),
752                Self::Madvise => std::option::Option::Some(2),
753                Self::Never => std::option::Option::Some(3),
754                Self::UnknownValue(u) => u.0.value(),
755            }
756        }
757
758        /// Gets the enum value as a string.
759        ///
760        /// Returns `None` if the enum contains an unknown value deserialized from
761        /// the integer representation of enums.
762        pub fn name(&self) -> std::option::Option<&str> {
763            match self {
764                Self::Unspecified => {
765                    std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_UNSPECIFIED")
766                }
767                Self::Always => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_ALWAYS"),
768                Self::Madvise => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_MADVISE"),
769                Self::Never => std::option::Option::Some("TRANSPARENT_HUGEPAGE_ENABLED_NEVER"),
770                Self::UnknownValue(u) => u.0.name(),
771            }
772        }
773    }
774
775    impl std::default::Default for TransparentHugepageEnabled {
776        fn default() -> Self {
777            use std::convert::From;
778            Self::from(0)
779        }
780    }
781
782    impl std::fmt::Display for TransparentHugepageEnabled {
783        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
784            wkt::internal::display_enum(f, self.name(), self.value())
785        }
786    }
787
788    impl std::convert::From<i32> for TransparentHugepageEnabled {
789        fn from(value: i32) -> Self {
790            match value {
791                0 => Self::Unspecified,
792                1 => Self::Always,
793                2 => Self::Madvise,
794                3 => Self::Never,
795                _ => Self::UnknownValue(transparent_hugepage_enabled::UnknownValue(
796                    wkt::internal::UnknownEnumValue::Integer(value),
797                )),
798            }
799        }
800    }
801
802    impl std::convert::From<&str> for TransparentHugepageEnabled {
803        fn from(value: &str) -> Self {
804            use std::string::ToString;
805            match value {
806                "TRANSPARENT_HUGEPAGE_ENABLED_UNSPECIFIED" => Self::Unspecified,
807                "TRANSPARENT_HUGEPAGE_ENABLED_ALWAYS" => Self::Always,
808                "TRANSPARENT_HUGEPAGE_ENABLED_MADVISE" => Self::Madvise,
809                "TRANSPARENT_HUGEPAGE_ENABLED_NEVER" => Self::Never,
810                _ => Self::UnknownValue(transparent_hugepage_enabled::UnknownValue(
811                    wkt::internal::UnknownEnumValue::String(value.to_string()),
812                )),
813            }
814        }
815    }
816
817    impl serde::ser::Serialize for TransparentHugepageEnabled {
818        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
819        where
820            S: serde::Serializer,
821        {
822            match self {
823                Self::Unspecified => serializer.serialize_i32(0),
824                Self::Always => serializer.serialize_i32(1),
825                Self::Madvise => serializer.serialize_i32(2),
826                Self::Never => serializer.serialize_i32(3),
827                Self::UnknownValue(u) => u.0.serialize(serializer),
828            }
829        }
830    }
831
832    impl<'de> serde::de::Deserialize<'de> for TransparentHugepageEnabled {
833        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
834        where
835            D: serde::Deserializer<'de>,
836        {
837            deserializer.deserialize_any(
838                wkt::internal::EnumVisitor::<TransparentHugepageEnabled>::new(
839                    ".google.container.v1.LinuxNodeConfig.TransparentHugepageEnabled",
840                ),
841            )
842        }
843    }
844
845    /// Possible values for transparent hugepage defrag support.
846    ///
847    /// # Working with unknown values
848    ///
849    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
850    /// additional enum variants at any time. Adding new variants is not considered
851    /// a breaking change. Applications should write their code in anticipation of:
852    ///
853    /// - New values appearing in future releases of the client library, **and**
854    /// - New values received dynamically, without application changes.
855    ///
856    /// Please consult the [Working with enums] section in the user guide for some
857    /// guidelines.
858    ///
859    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
860    #[derive(Clone, Debug, PartialEq)]
861    #[non_exhaustive]
862    pub enum TransparentHugepageDefrag {
863        /// Default value. GKE will not modify the kernel configuration.
864        Unspecified,
865        /// It means that an application requesting THP will stall on allocation
866        /// failure and directly reclaim pages and compact memory in an effort to
867        /// allocate a THP immediately.
868        Always,
869        /// It means that an application will wake kswapd in the background to
870        /// reclaim pages and wake kcompactd to compact memory so that THP is
871        /// available in the near future. It's the responsibility of khugepaged to
872        /// then install the THP pages later.
873        Defer,
874        /// It means that an application will enter direct reclaim and compaction
875        /// like always, but only for regions that have used madvise(MADV_HUGEPAGE);
876        /// all other regions will wake kswapd in the background to reclaim pages and
877        /// wake kcompactd to compact memory so that THP is available in the near
878        /// future.
879        DeferWithMadvise,
880        /// It means that an application will enter direct reclaim like always but
881        /// only for regions that are have used madvise(MADV_HUGEPAGE). This is the
882        /// default kernel configuration.
883        Madvise,
884        /// It means that an application will never enter direct reclaim or
885        /// compaction.
886        Never,
887        /// If set, the enum was initialized with an unknown value.
888        ///
889        /// Applications can examine the value using [TransparentHugepageDefrag::value] or
890        /// [TransparentHugepageDefrag::name].
891        UnknownValue(transparent_hugepage_defrag::UnknownValue),
892    }
893
894    #[doc(hidden)]
895    pub mod transparent_hugepage_defrag {
896        #[allow(unused_imports)]
897        use super::*;
898        #[derive(Clone, Debug, PartialEq)]
899        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
900    }
901
902    impl TransparentHugepageDefrag {
903        /// Gets the enum value.
904        ///
905        /// Returns `None` if the enum contains an unknown value deserialized from
906        /// the string representation of enums.
907        pub fn value(&self) -> std::option::Option<i32> {
908            match self {
909                Self::Unspecified => std::option::Option::Some(0),
910                Self::Always => std::option::Option::Some(1),
911                Self::Defer => std::option::Option::Some(2),
912                Self::DeferWithMadvise => std::option::Option::Some(3),
913                Self::Madvise => std::option::Option::Some(4),
914                Self::Never => std::option::Option::Some(5),
915                Self::UnknownValue(u) => u.0.value(),
916            }
917        }
918
919        /// Gets the enum value as a string.
920        ///
921        /// Returns `None` if the enum contains an unknown value deserialized from
922        /// the integer representation of enums.
923        pub fn name(&self) -> std::option::Option<&str> {
924            match self {
925                Self::Unspecified => {
926                    std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_UNSPECIFIED")
927                }
928                Self::Always => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_ALWAYS"),
929                Self::Defer => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_DEFER"),
930                Self::DeferWithMadvise => {
931                    std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_DEFER_WITH_MADVISE")
932                }
933                Self::Madvise => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_MADVISE"),
934                Self::Never => std::option::Option::Some("TRANSPARENT_HUGEPAGE_DEFRAG_NEVER"),
935                Self::UnknownValue(u) => u.0.name(),
936            }
937        }
938    }
939
940    impl std::default::Default for TransparentHugepageDefrag {
941        fn default() -> Self {
942            use std::convert::From;
943            Self::from(0)
944        }
945    }
946
947    impl std::fmt::Display for TransparentHugepageDefrag {
948        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
949            wkt::internal::display_enum(f, self.name(), self.value())
950        }
951    }
952
953    impl std::convert::From<i32> for TransparentHugepageDefrag {
954        fn from(value: i32) -> Self {
955            match value {
956                0 => Self::Unspecified,
957                1 => Self::Always,
958                2 => Self::Defer,
959                3 => Self::DeferWithMadvise,
960                4 => Self::Madvise,
961                5 => Self::Never,
962                _ => Self::UnknownValue(transparent_hugepage_defrag::UnknownValue(
963                    wkt::internal::UnknownEnumValue::Integer(value),
964                )),
965            }
966        }
967    }
968
969    impl std::convert::From<&str> for TransparentHugepageDefrag {
970        fn from(value: &str) -> Self {
971            use std::string::ToString;
972            match value {
973                "TRANSPARENT_HUGEPAGE_DEFRAG_UNSPECIFIED" => Self::Unspecified,
974                "TRANSPARENT_HUGEPAGE_DEFRAG_ALWAYS" => Self::Always,
975                "TRANSPARENT_HUGEPAGE_DEFRAG_DEFER" => Self::Defer,
976                "TRANSPARENT_HUGEPAGE_DEFRAG_DEFER_WITH_MADVISE" => Self::DeferWithMadvise,
977                "TRANSPARENT_HUGEPAGE_DEFRAG_MADVISE" => Self::Madvise,
978                "TRANSPARENT_HUGEPAGE_DEFRAG_NEVER" => Self::Never,
979                _ => Self::UnknownValue(transparent_hugepage_defrag::UnknownValue(
980                    wkt::internal::UnknownEnumValue::String(value.to_string()),
981                )),
982            }
983        }
984    }
985
986    impl serde::ser::Serialize for TransparentHugepageDefrag {
987        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
988        where
989            S: serde::Serializer,
990        {
991            match self {
992                Self::Unspecified => serializer.serialize_i32(0),
993                Self::Always => serializer.serialize_i32(1),
994                Self::Defer => serializer.serialize_i32(2),
995                Self::DeferWithMadvise => serializer.serialize_i32(3),
996                Self::Madvise => serializer.serialize_i32(4),
997                Self::Never => serializer.serialize_i32(5),
998                Self::UnknownValue(u) => u.0.serialize(serializer),
999            }
1000        }
1001    }
1002
1003    impl<'de> serde::de::Deserialize<'de> for TransparentHugepageDefrag {
1004        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1005        where
1006            D: serde::Deserializer<'de>,
1007        {
1008            deserializer.deserialize_any(
1009                wkt::internal::EnumVisitor::<TransparentHugepageDefrag>::new(
1010                    ".google.container.v1.LinuxNodeConfig.TransparentHugepageDefrag",
1011                ),
1012            )
1013        }
1014    }
1015}
1016
1017/// Parameters that can be configured on Windows nodes.
1018/// Windows Node Config that define the parameters that will be used to
1019/// configure the Windows node pool settings.
1020#[derive(Clone, Default, PartialEq)]
1021#[non_exhaustive]
1022pub struct WindowsNodeConfig {
1023    /// OSVersion specifies the Windows node config to be used on the node.
1024    pub os_version: crate::model::windows_node_config::OSVersion,
1025
1026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1027}
1028
1029impl WindowsNodeConfig {
1030    pub fn new() -> Self {
1031        std::default::Default::default()
1032    }
1033
1034    /// Sets the value of [os_version][crate::model::WindowsNodeConfig::os_version].
1035    ///
1036    /// # Example
1037    /// ```ignore,no_run
1038    /// # use google_cloud_container_v1::model::WindowsNodeConfig;
1039    /// use google_cloud_container_v1::model::windows_node_config::OSVersion;
1040    /// let x0 = WindowsNodeConfig::new().set_os_version(OSVersion::Ltsc2019);
1041    /// let x1 = WindowsNodeConfig::new().set_os_version(OSVersion::Ltsc2022);
1042    /// ```
1043    pub fn set_os_version<T: std::convert::Into<crate::model::windows_node_config::OSVersion>>(
1044        mut self,
1045        v: T,
1046    ) -> Self {
1047        self.os_version = v.into();
1048        self
1049    }
1050}
1051
1052impl wkt::message::Message for WindowsNodeConfig {
1053    fn typename() -> &'static str {
1054        "type.googleapis.com/google.container.v1.WindowsNodeConfig"
1055    }
1056}
1057
1058/// Defines additional types related to [WindowsNodeConfig].
1059pub mod windows_node_config {
1060    #[allow(unused_imports)]
1061    use super::*;
1062
1063    /// Possible OS version that can be used.
1064    ///
1065    /// # Working with unknown values
1066    ///
1067    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1068    /// additional enum variants at any time. Adding new variants is not considered
1069    /// a breaking change. Applications should write their code in anticipation of:
1070    ///
1071    /// - New values appearing in future releases of the client library, **and**
1072    /// - New values received dynamically, without application changes.
1073    ///
1074    /// Please consult the [Working with enums] section in the user guide for some
1075    /// guidelines.
1076    ///
1077    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1078    #[derive(Clone, Debug, PartialEq)]
1079    #[non_exhaustive]
1080    pub enum OSVersion {
1081        /// When OSVersion is not specified.
1082        Unspecified,
1083        /// LTSC2019 specifies to use LTSC2019 as the Windows Servercore Base Image.
1084        Ltsc2019,
1085        /// LTSC2022 specifies to use LTSC2022 as the Windows Servercore Base Image.
1086        Ltsc2022,
1087        /// If set, the enum was initialized with an unknown value.
1088        ///
1089        /// Applications can examine the value using [OSVersion::value] or
1090        /// [OSVersion::name].
1091        UnknownValue(os_version::UnknownValue),
1092    }
1093
1094    #[doc(hidden)]
1095    pub mod os_version {
1096        #[allow(unused_imports)]
1097        use super::*;
1098        #[derive(Clone, Debug, PartialEq)]
1099        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1100    }
1101
1102    impl OSVersion {
1103        /// Gets the enum value.
1104        ///
1105        /// Returns `None` if the enum contains an unknown value deserialized from
1106        /// the string representation of enums.
1107        pub fn value(&self) -> std::option::Option<i32> {
1108            match self {
1109                Self::Unspecified => std::option::Option::Some(0),
1110                Self::Ltsc2019 => std::option::Option::Some(1),
1111                Self::Ltsc2022 => std::option::Option::Some(2),
1112                Self::UnknownValue(u) => u.0.value(),
1113            }
1114        }
1115
1116        /// Gets the enum value as a string.
1117        ///
1118        /// Returns `None` if the enum contains an unknown value deserialized from
1119        /// the integer representation of enums.
1120        pub fn name(&self) -> std::option::Option<&str> {
1121            match self {
1122                Self::Unspecified => std::option::Option::Some("OS_VERSION_UNSPECIFIED"),
1123                Self::Ltsc2019 => std::option::Option::Some("OS_VERSION_LTSC2019"),
1124                Self::Ltsc2022 => std::option::Option::Some("OS_VERSION_LTSC2022"),
1125                Self::UnknownValue(u) => u.0.name(),
1126            }
1127        }
1128    }
1129
1130    impl std::default::Default for OSVersion {
1131        fn default() -> Self {
1132            use std::convert::From;
1133            Self::from(0)
1134        }
1135    }
1136
1137    impl std::fmt::Display for OSVersion {
1138        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1139            wkt::internal::display_enum(f, self.name(), self.value())
1140        }
1141    }
1142
1143    impl std::convert::From<i32> for OSVersion {
1144        fn from(value: i32) -> Self {
1145            match value {
1146                0 => Self::Unspecified,
1147                1 => Self::Ltsc2019,
1148                2 => Self::Ltsc2022,
1149                _ => Self::UnknownValue(os_version::UnknownValue(
1150                    wkt::internal::UnknownEnumValue::Integer(value),
1151                )),
1152            }
1153        }
1154    }
1155
1156    impl std::convert::From<&str> for OSVersion {
1157        fn from(value: &str) -> Self {
1158            use std::string::ToString;
1159            match value {
1160                "OS_VERSION_UNSPECIFIED" => Self::Unspecified,
1161                "OS_VERSION_LTSC2019" => Self::Ltsc2019,
1162                "OS_VERSION_LTSC2022" => Self::Ltsc2022,
1163                _ => Self::UnknownValue(os_version::UnknownValue(
1164                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1165                )),
1166            }
1167        }
1168    }
1169
1170    impl serde::ser::Serialize for OSVersion {
1171        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1172        where
1173            S: serde::Serializer,
1174        {
1175            match self {
1176                Self::Unspecified => serializer.serialize_i32(0),
1177                Self::Ltsc2019 => serializer.serialize_i32(1),
1178                Self::Ltsc2022 => serializer.serialize_i32(2),
1179                Self::UnknownValue(u) => u.0.serialize(serializer),
1180            }
1181        }
1182    }
1183
1184    impl<'de> serde::de::Deserialize<'de> for OSVersion {
1185        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1186        where
1187            D: serde::Deserializer<'de>,
1188        {
1189            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OSVersion>::new(
1190                ".google.container.v1.WindowsNodeConfig.OSVersion",
1191            ))
1192        }
1193    }
1194}
1195
1196/// Node kubelet configs.
1197#[derive(Clone, Default, PartialEq)]
1198#[non_exhaustive]
1199pub struct NodeKubeletConfig {
1200    /// Control the CPU management policy on the node.
1201    /// See
1202    /// <https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/>
1203    ///
1204    /// The following values are allowed.
1205    ///
1206    /// * "none": the default, which represents the existing scheduling behavior.
1207    /// * "static": allows pods with certain resource characteristics to be granted
1208    ///   increased CPU affinity and exclusivity on the node.
1209    ///   The default value is 'none' if unspecified.
1210    pub cpu_manager_policy: std::string::String,
1211
1212    /// Optional. Controls Topology Manager configuration on the node.
1213    /// For more information, see:
1214    /// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/>
1215    pub topology_manager: std::option::Option<crate::model::TopologyManager>,
1216
1217    /// Optional. Controls NUMA-aware Memory Manager configuration on the
1218    /// node. For more information, see:
1219    /// <https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/>
1220    pub memory_manager: std::option::Option<crate::model::MemoryManager>,
1221
1222    /// Enable CPU CFS quota enforcement for containers that specify CPU limits.
1223    ///
1224    /// This option is enabled by default which makes kubelet use CFS quota
1225    /// (<https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt>) to
1226    /// enforce container CPU limits. Otherwise, CPU limits will not be enforced at
1227    /// all.
1228    ///
1229    /// Disable this option to mitigate CPU throttling problems while still having
1230    /// your pods to be in Guaranteed QoS class by specifying the CPU limits.
1231    ///
1232    /// The default value is 'true' if unspecified.
1233    pub cpu_cfs_quota: std::option::Option<wkt::BoolValue>,
1234
1235    /// Set the CPU CFS quota period value 'cpu.cfs_period_us'.
1236    ///
1237    /// The string must be a sequence of decimal numbers, each with optional
1238    /// fraction and a unit suffix, such as "300ms".
1239    /// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
1240    /// The value must be a positive duration between 1ms and 1 second, inclusive.
1241    pub cpu_cfs_quota_period: std::string::String,
1242
1243    /// Set the Pod PID limits. See
1244    /// <https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits>
1245    ///
1246    /// Controls the maximum number of processes allowed to run in a pod. The value
1247    /// must be greater than or equal to 1024 and less than 4194304.
1248    pub pod_pids_limit: i64,
1249
1250    /// Enable or disable Kubelet read only port.
1251    pub insecure_kubelet_readonly_port_enabled: std::option::Option<bool>,
1252
1253    /// Optional. Defines the percent of disk usage before which image garbage
1254    /// collection is never run. Lowest disk usage to garbage collect to. The
1255    /// percent is calculated as this field value out of 100.
1256    ///
1257    /// The value must be between 10 and 85, inclusive and smaller than
1258    /// image_gc_high_threshold_percent.
1259    ///
1260    /// The default value is 80 if unspecified.
1261    pub image_gc_low_threshold_percent: i32,
1262
1263    /// Optional. Defines the percent of disk usage after which image garbage
1264    /// collection is always run. The percent is calculated as this field value out
1265    /// of 100.
1266    ///
1267    /// The value must be between 10 and 85, inclusive and greater than
1268    /// image_gc_low_threshold_percent.
1269    ///
1270    /// The default value is 85 if unspecified.
1271    pub image_gc_high_threshold_percent: i32,
1272
1273    /// Optional. Defines the minimum age for an unused image before it is garbage
1274    /// collected.
1275    ///
1276    /// The string must be a sequence of decimal numbers, each with optional
1277    /// fraction and a unit suffix, such as "300s", "1.5h", and "2h45m". Valid time
1278    /// units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
1279    ///
1280    /// The value must be a positive duration less than or equal to 2 minutes.
1281    ///
1282    /// The default value is "2m0s" if unspecified.
1283    pub image_minimum_gc_age: std::string::String,
1284
1285    /// Optional. Defines the maximum age an image can be unused before it is
1286    /// garbage collected. The string must be a sequence of decimal numbers, each
1287    /// with optional fraction and a unit suffix, such as "300s", "1.5h", and
1288    /// "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
1289    ///
1290    /// The value must be a positive duration greater than image_minimum_gc_age
1291    /// or "0s".
1292    ///
1293    /// The default value is "0s" if unspecified, which disables this field,
1294    /// meaning images won't be garbage collected based on being unused for too
1295    /// long.
1296    pub image_maximum_gc_age: std::string::String,
1297
1298    /// Optional. Defines the maximum size of the container log file before it is
1299    /// rotated. See
1300    /// <https://kubernetes.io/docs/concepts/cluster-administration/logging/#log-rotation>
1301    ///
1302    /// Valid format is positive number + unit, e.g. 100Ki, 10Mi. Valid units are
1303    /// Ki, Mi, Gi.
1304    /// The value must be between 10Mi and 500Mi, inclusive.
1305    ///
1306    /// Note that the total container log size (container_log_max_size *
1307    /// container_log_max_files) cannot exceed 1% of the total
1308    /// storage of the node, to avoid disk pressure caused by log files.
1309    ///
1310    /// The default value is 10Mi if unspecified.
1311    pub container_log_max_size: std::string::String,
1312
1313    /// Optional. Defines the maximum number of container log files that can be
1314    /// present for a container. See
1315    /// <https://kubernetes.io/docs/concepts/cluster-administration/logging/#log-rotation>
1316    ///
1317    /// The value must be an integer between 2 and 10, inclusive.
1318    /// The default value is 5 if unspecified.
1319    pub container_log_max_files: i32,
1320
1321    /// Optional. Defines a comma-separated allowlist of unsafe sysctls or sysctl
1322    /// patterns (ending in `*`).
1323    ///
1324    /// The unsafe namespaced sysctl groups are `kernel.shm*`, `kernel.msg*`,
1325    /// `kernel.sem`, `fs.mqueue.*`, and `net.*`. Leaving this allowlist empty
1326    /// means they cannot be set on Pods.
1327    ///
1328    /// To allow certain sysctls or sysctl patterns to be set on Pods, list them
1329    /// separated by commas.
1330    /// For example: `kernel.msg*,net.ipv4.route.min_pmtu`.
1331    ///
1332    /// See <https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/>
1333    /// for more details.
1334    pub allowed_unsafe_sysctls: std::vec::Vec<std::string::String>,
1335
1336    /// Optional. eviction_soft is a map of signal names to quantities that defines
1337    /// soft eviction thresholds. Each signal is compared to its corresponding
1338    /// threshold to determine if a pod eviction should occur.
1339    pub eviction_soft: std::option::Option<crate::model::EvictionSignals>,
1340
1341    /// Optional. eviction_soft_grace_period is a map of signal names to quantities
1342    /// that defines grace periods for each soft eviction signal. The grace period
1343    /// is the amount of time that a pod must be under pressure before an eviction
1344    /// occurs.
1345    pub eviction_soft_grace_period: std::option::Option<crate::model::EvictionGracePeriod>,
1346
1347    /// Optional. eviction_minimum_reclaim is a map of signal names to quantities
1348    /// that defines minimum reclaims, which describe the minimum amount of a given
1349    /// resource the kubelet will reclaim when performing a pod eviction while that
1350    /// resource is under pressure.
1351    pub eviction_minimum_reclaim: std::option::Option<crate::model::EvictionMinimumReclaim>,
1352
1353    /// Optional. eviction_max_pod_grace_period_seconds is the maximum allowed
1354    /// grace period (in seconds) to use when terminating pods in response to a
1355    /// soft eviction threshold being met. This value effectively caps the Pod's
1356    /// terminationGracePeriodSeconds value during soft evictions. Default: 0.
1357    /// Range: [0, 300].
1358    pub eviction_max_pod_grace_period_seconds: i32,
1359
1360    /// Optional. Defines the maximum number of image pulls in parallel.
1361    /// The range is 2 to 5, inclusive.
1362    /// The default value is 2 or 3 depending on the disk type.
1363    ///
1364    /// See
1365    /// <https://kubernetes.io/docs/concepts/containers/images/#maximum-parallel-image-pulls>
1366    /// for more details.
1367    pub max_parallel_image_pulls: i32,
1368
1369    /// Optional. Defines whether to enable single process OOM killer.
1370    /// If true, will prevent the memory.oom.group flag from being set for
1371    /// container cgroups in cgroups v2. This causes processes in the container to
1372    /// be OOM killed individually instead of as a group.
1373    pub single_process_oom_kill: std::option::Option<bool>,
1374
1375    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1376}
1377
1378impl NodeKubeletConfig {
1379    pub fn new() -> Self {
1380        std::default::Default::default()
1381    }
1382
1383    /// Sets the value of [cpu_manager_policy][crate::model::NodeKubeletConfig::cpu_manager_policy].
1384    ///
1385    /// # Example
1386    /// ```ignore,no_run
1387    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1388    /// let x = NodeKubeletConfig::new().set_cpu_manager_policy("example");
1389    /// ```
1390    pub fn set_cpu_manager_policy<T: std::convert::Into<std::string::String>>(
1391        mut self,
1392        v: T,
1393    ) -> Self {
1394        self.cpu_manager_policy = v.into();
1395        self
1396    }
1397
1398    /// Sets the value of [topology_manager][crate::model::NodeKubeletConfig::topology_manager].
1399    ///
1400    /// # Example
1401    /// ```ignore,no_run
1402    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1403    /// use google_cloud_container_v1::model::TopologyManager;
1404    /// let x = NodeKubeletConfig::new().set_topology_manager(TopologyManager::default()/* use setters */);
1405    /// ```
1406    pub fn set_topology_manager<T>(mut self, v: T) -> Self
1407    where
1408        T: std::convert::Into<crate::model::TopologyManager>,
1409    {
1410        self.topology_manager = std::option::Option::Some(v.into());
1411        self
1412    }
1413
1414    /// Sets or clears the value of [topology_manager][crate::model::NodeKubeletConfig::topology_manager].
1415    ///
1416    /// # Example
1417    /// ```ignore,no_run
1418    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1419    /// use google_cloud_container_v1::model::TopologyManager;
1420    /// let x = NodeKubeletConfig::new().set_or_clear_topology_manager(Some(TopologyManager::default()/* use setters */));
1421    /// let x = NodeKubeletConfig::new().set_or_clear_topology_manager(None::<TopologyManager>);
1422    /// ```
1423    pub fn set_or_clear_topology_manager<T>(mut self, v: std::option::Option<T>) -> Self
1424    where
1425        T: std::convert::Into<crate::model::TopologyManager>,
1426    {
1427        self.topology_manager = v.map(|x| x.into());
1428        self
1429    }
1430
1431    /// Sets the value of [memory_manager][crate::model::NodeKubeletConfig::memory_manager].
1432    ///
1433    /// # Example
1434    /// ```ignore,no_run
1435    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1436    /// use google_cloud_container_v1::model::MemoryManager;
1437    /// let x = NodeKubeletConfig::new().set_memory_manager(MemoryManager::default()/* use setters */);
1438    /// ```
1439    pub fn set_memory_manager<T>(mut self, v: T) -> Self
1440    where
1441        T: std::convert::Into<crate::model::MemoryManager>,
1442    {
1443        self.memory_manager = std::option::Option::Some(v.into());
1444        self
1445    }
1446
1447    /// Sets or clears the value of [memory_manager][crate::model::NodeKubeletConfig::memory_manager].
1448    ///
1449    /// # Example
1450    /// ```ignore,no_run
1451    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1452    /// use google_cloud_container_v1::model::MemoryManager;
1453    /// let x = NodeKubeletConfig::new().set_or_clear_memory_manager(Some(MemoryManager::default()/* use setters */));
1454    /// let x = NodeKubeletConfig::new().set_or_clear_memory_manager(None::<MemoryManager>);
1455    /// ```
1456    pub fn set_or_clear_memory_manager<T>(mut self, v: std::option::Option<T>) -> Self
1457    where
1458        T: std::convert::Into<crate::model::MemoryManager>,
1459    {
1460        self.memory_manager = v.map(|x| x.into());
1461        self
1462    }
1463
1464    /// Sets the value of [cpu_cfs_quota][crate::model::NodeKubeletConfig::cpu_cfs_quota].
1465    ///
1466    /// # Example
1467    /// ```ignore,no_run
1468    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1469    /// use wkt::BoolValue;
1470    /// let x = NodeKubeletConfig::new().set_cpu_cfs_quota(BoolValue::default()/* use setters */);
1471    /// ```
1472    pub fn set_cpu_cfs_quota<T>(mut self, v: T) -> Self
1473    where
1474        T: std::convert::Into<wkt::BoolValue>,
1475    {
1476        self.cpu_cfs_quota = std::option::Option::Some(v.into());
1477        self
1478    }
1479
1480    /// Sets or clears the value of [cpu_cfs_quota][crate::model::NodeKubeletConfig::cpu_cfs_quota].
1481    ///
1482    /// # Example
1483    /// ```ignore,no_run
1484    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1485    /// use wkt::BoolValue;
1486    /// let x = NodeKubeletConfig::new().set_or_clear_cpu_cfs_quota(Some(BoolValue::default()/* use setters */));
1487    /// let x = NodeKubeletConfig::new().set_or_clear_cpu_cfs_quota(None::<BoolValue>);
1488    /// ```
1489    pub fn set_or_clear_cpu_cfs_quota<T>(mut self, v: std::option::Option<T>) -> Self
1490    where
1491        T: std::convert::Into<wkt::BoolValue>,
1492    {
1493        self.cpu_cfs_quota = v.map(|x| x.into());
1494        self
1495    }
1496
1497    /// Sets the value of [cpu_cfs_quota_period][crate::model::NodeKubeletConfig::cpu_cfs_quota_period].
1498    ///
1499    /// # Example
1500    /// ```ignore,no_run
1501    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1502    /// let x = NodeKubeletConfig::new().set_cpu_cfs_quota_period("example");
1503    /// ```
1504    pub fn set_cpu_cfs_quota_period<T: std::convert::Into<std::string::String>>(
1505        mut self,
1506        v: T,
1507    ) -> Self {
1508        self.cpu_cfs_quota_period = v.into();
1509        self
1510    }
1511
1512    /// Sets the value of [pod_pids_limit][crate::model::NodeKubeletConfig::pod_pids_limit].
1513    ///
1514    /// # Example
1515    /// ```ignore,no_run
1516    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1517    /// let x = NodeKubeletConfig::new().set_pod_pids_limit(42);
1518    /// ```
1519    pub fn set_pod_pids_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1520        self.pod_pids_limit = v.into();
1521        self
1522    }
1523
1524    /// Sets the value of [insecure_kubelet_readonly_port_enabled][crate::model::NodeKubeletConfig::insecure_kubelet_readonly_port_enabled].
1525    ///
1526    /// # Example
1527    /// ```ignore,no_run
1528    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1529    /// let x = NodeKubeletConfig::new().set_insecure_kubelet_readonly_port_enabled(true);
1530    /// ```
1531    pub fn set_insecure_kubelet_readonly_port_enabled<T>(mut self, v: T) -> Self
1532    where
1533        T: std::convert::Into<bool>,
1534    {
1535        self.insecure_kubelet_readonly_port_enabled = std::option::Option::Some(v.into());
1536        self
1537    }
1538
1539    /// Sets or clears the value of [insecure_kubelet_readonly_port_enabled][crate::model::NodeKubeletConfig::insecure_kubelet_readonly_port_enabled].
1540    ///
1541    /// # Example
1542    /// ```ignore,no_run
1543    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1544    /// let x = NodeKubeletConfig::new().set_or_clear_insecure_kubelet_readonly_port_enabled(Some(false));
1545    /// let x = NodeKubeletConfig::new().set_or_clear_insecure_kubelet_readonly_port_enabled(None::<bool>);
1546    /// ```
1547    pub fn set_or_clear_insecure_kubelet_readonly_port_enabled<T>(
1548        mut self,
1549        v: std::option::Option<T>,
1550    ) -> Self
1551    where
1552        T: std::convert::Into<bool>,
1553    {
1554        self.insecure_kubelet_readonly_port_enabled = v.map(|x| x.into());
1555        self
1556    }
1557
1558    /// Sets the value of [image_gc_low_threshold_percent][crate::model::NodeKubeletConfig::image_gc_low_threshold_percent].
1559    ///
1560    /// # Example
1561    /// ```ignore,no_run
1562    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1563    /// let x = NodeKubeletConfig::new().set_image_gc_low_threshold_percent(42);
1564    /// ```
1565    pub fn set_image_gc_low_threshold_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1566        self.image_gc_low_threshold_percent = v.into();
1567        self
1568    }
1569
1570    /// Sets the value of [image_gc_high_threshold_percent][crate::model::NodeKubeletConfig::image_gc_high_threshold_percent].
1571    ///
1572    /// # Example
1573    /// ```ignore,no_run
1574    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1575    /// let x = NodeKubeletConfig::new().set_image_gc_high_threshold_percent(42);
1576    /// ```
1577    pub fn set_image_gc_high_threshold_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1578        self.image_gc_high_threshold_percent = v.into();
1579        self
1580    }
1581
1582    /// Sets the value of [image_minimum_gc_age][crate::model::NodeKubeletConfig::image_minimum_gc_age].
1583    ///
1584    /// # Example
1585    /// ```ignore,no_run
1586    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1587    /// let x = NodeKubeletConfig::new().set_image_minimum_gc_age("example");
1588    /// ```
1589    pub fn set_image_minimum_gc_age<T: std::convert::Into<std::string::String>>(
1590        mut self,
1591        v: T,
1592    ) -> Self {
1593        self.image_minimum_gc_age = v.into();
1594        self
1595    }
1596
1597    /// Sets the value of [image_maximum_gc_age][crate::model::NodeKubeletConfig::image_maximum_gc_age].
1598    ///
1599    /// # Example
1600    /// ```ignore,no_run
1601    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1602    /// let x = NodeKubeletConfig::new().set_image_maximum_gc_age("example");
1603    /// ```
1604    pub fn set_image_maximum_gc_age<T: std::convert::Into<std::string::String>>(
1605        mut self,
1606        v: T,
1607    ) -> Self {
1608        self.image_maximum_gc_age = v.into();
1609        self
1610    }
1611
1612    /// Sets the value of [container_log_max_size][crate::model::NodeKubeletConfig::container_log_max_size].
1613    ///
1614    /// # Example
1615    /// ```ignore,no_run
1616    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1617    /// let x = NodeKubeletConfig::new().set_container_log_max_size("example");
1618    /// ```
1619    pub fn set_container_log_max_size<T: std::convert::Into<std::string::String>>(
1620        mut self,
1621        v: T,
1622    ) -> Self {
1623        self.container_log_max_size = v.into();
1624        self
1625    }
1626
1627    /// Sets the value of [container_log_max_files][crate::model::NodeKubeletConfig::container_log_max_files].
1628    ///
1629    /// # Example
1630    /// ```ignore,no_run
1631    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1632    /// let x = NodeKubeletConfig::new().set_container_log_max_files(42);
1633    /// ```
1634    pub fn set_container_log_max_files<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1635        self.container_log_max_files = v.into();
1636        self
1637    }
1638
1639    /// Sets the value of [allowed_unsafe_sysctls][crate::model::NodeKubeletConfig::allowed_unsafe_sysctls].
1640    ///
1641    /// # Example
1642    /// ```ignore,no_run
1643    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1644    /// let x = NodeKubeletConfig::new().set_allowed_unsafe_sysctls(["a", "b", "c"]);
1645    /// ```
1646    pub fn set_allowed_unsafe_sysctls<T, V>(mut self, v: T) -> Self
1647    where
1648        T: std::iter::IntoIterator<Item = V>,
1649        V: std::convert::Into<std::string::String>,
1650    {
1651        use std::iter::Iterator;
1652        self.allowed_unsafe_sysctls = v.into_iter().map(|i| i.into()).collect();
1653        self
1654    }
1655
1656    /// Sets the value of [eviction_soft][crate::model::NodeKubeletConfig::eviction_soft].
1657    ///
1658    /// # Example
1659    /// ```ignore,no_run
1660    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1661    /// use google_cloud_container_v1::model::EvictionSignals;
1662    /// let x = NodeKubeletConfig::new().set_eviction_soft(EvictionSignals::default()/* use setters */);
1663    /// ```
1664    pub fn set_eviction_soft<T>(mut self, v: T) -> Self
1665    where
1666        T: std::convert::Into<crate::model::EvictionSignals>,
1667    {
1668        self.eviction_soft = std::option::Option::Some(v.into());
1669        self
1670    }
1671
1672    /// Sets or clears the value of [eviction_soft][crate::model::NodeKubeletConfig::eviction_soft].
1673    ///
1674    /// # Example
1675    /// ```ignore,no_run
1676    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1677    /// use google_cloud_container_v1::model::EvictionSignals;
1678    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft(Some(EvictionSignals::default()/* use setters */));
1679    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft(None::<EvictionSignals>);
1680    /// ```
1681    pub fn set_or_clear_eviction_soft<T>(mut self, v: std::option::Option<T>) -> Self
1682    where
1683        T: std::convert::Into<crate::model::EvictionSignals>,
1684    {
1685        self.eviction_soft = v.map(|x| x.into());
1686        self
1687    }
1688
1689    /// Sets the value of [eviction_soft_grace_period][crate::model::NodeKubeletConfig::eviction_soft_grace_period].
1690    ///
1691    /// # Example
1692    /// ```ignore,no_run
1693    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1694    /// use google_cloud_container_v1::model::EvictionGracePeriod;
1695    /// let x = NodeKubeletConfig::new().set_eviction_soft_grace_period(EvictionGracePeriod::default()/* use setters */);
1696    /// ```
1697    pub fn set_eviction_soft_grace_period<T>(mut self, v: T) -> Self
1698    where
1699        T: std::convert::Into<crate::model::EvictionGracePeriod>,
1700    {
1701        self.eviction_soft_grace_period = std::option::Option::Some(v.into());
1702        self
1703    }
1704
1705    /// Sets or clears the value of [eviction_soft_grace_period][crate::model::NodeKubeletConfig::eviction_soft_grace_period].
1706    ///
1707    /// # Example
1708    /// ```ignore,no_run
1709    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1710    /// use google_cloud_container_v1::model::EvictionGracePeriod;
1711    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft_grace_period(Some(EvictionGracePeriod::default()/* use setters */));
1712    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_soft_grace_period(None::<EvictionGracePeriod>);
1713    /// ```
1714    pub fn set_or_clear_eviction_soft_grace_period<T>(mut self, v: std::option::Option<T>) -> Self
1715    where
1716        T: std::convert::Into<crate::model::EvictionGracePeriod>,
1717    {
1718        self.eviction_soft_grace_period = v.map(|x| x.into());
1719        self
1720    }
1721
1722    /// Sets the value of [eviction_minimum_reclaim][crate::model::NodeKubeletConfig::eviction_minimum_reclaim].
1723    ///
1724    /// # Example
1725    /// ```ignore,no_run
1726    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1727    /// use google_cloud_container_v1::model::EvictionMinimumReclaim;
1728    /// let x = NodeKubeletConfig::new().set_eviction_minimum_reclaim(EvictionMinimumReclaim::default()/* use setters */);
1729    /// ```
1730    pub fn set_eviction_minimum_reclaim<T>(mut self, v: T) -> Self
1731    where
1732        T: std::convert::Into<crate::model::EvictionMinimumReclaim>,
1733    {
1734        self.eviction_minimum_reclaim = std::option::Option::Some(v.into());
1735        self
1736    }
1737
1738    /// Sets or clears the value of [eviction_minimum_reclaim][crate::model::NodeKubeletConfig::eviction_minimum_reclaim].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1743    /// use google_cloud_container_v1::model::EvictionMinimumReclaim;
1744    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_minimum_reclaim(Some(EvictionMinimumReclaim::default()/* use setters */));
1745    /// let x = NodeKubeletConfig::new().set_or_clear_eviction_minimum_reclaim(None::<EvictionMinimumReclaim>);
1746    /// ```
1747    pub fn set_or_clear_eviction_minimum_reclaim<T>(mut self, v: std::option::Option<T>) -> Self
1748    where
1749        T: std::convert::Into<crate::model::EvictionMinimumReclaim>,
1750    {
1751        self.eviction_minimum_reclaim = v.map(|x| x.into());
1752        self
1753    }
1754
1755    /// Sets the value of [eviction_max_pod_grace_period_seconds][crate::model::NodeKubeletConfig::eviction_max_pod_grace_period_seconds].
1756    ///
1757    /// # Example
1758    /// ```ignore,no_run
1759    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1760    /// let x = NodeKubeletConfig::new().set_eviction_max_pod_grace_period_seconds(42);
1761    /// ```
1762    pub fn set_eviction_max_pod_grace_period_seconds<T: std::convert::Into<i32>>(
1763        mut self,
1764        v: T,
1765    ) -> Self {
1766        self.eviction_max_pod_grace_period_seconds = v.into();
1767        self
1768    }
1769
1770    /// Sets the value of [max_parallel_image_pulls][crate::model::NodeKubeletConfig::max_parallel_image_pulls].
1771    ///
1772    /// # Example
1773    /// ```ignore,no_run
1774    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1775    /// let x = NodeKubeletConfig::new().set_max_parallel_image_pulls(42);
1776    /// ```
1777    pub fn set_max_parallel_image_pulls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1778        self.max_parallel_image_pulls = v.into();
1779        self
1780    }
1781
1782    /// Sets the value of [single_process_oom_kill][crate::model::NodeKubeletConfig::single_process_oom_kill].
1783    ///
1784    /// # Example
1785    /// ```ignore,no_run
1786    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1787    /// let x = NodeKubeletConfig::new().set_single_process_oom_kill(true);
1788    /// ```
1789    pub fn set_single_process_oom_kill<T>(mut self, v: T) -> Self
1790    where
1791        T: std::convert::Into<bool>,
1792    {
1793        self.single_process_oom_kill = std::option::Option::Some(v.into());
1794        self
1795    }
1796
1797    /// Sets or clears the value of [single_process_oom_kill][crate::model::NodeKubeletConfig::single_process_oom_kill].
1798    ///
1799    /// # Example
1800    /// ```ignore,no_run
1801    /// # use google_cloud_container_v1::model::NodeKubeletConfig;
1802    /// let x = NodeKubeletConfig::new().set_or_clear_single_process_oom_kill(Some(false));
1803    /// let x = NodeKubeletConfig::new().set_or_clear_single_process_oom_kill(None::<bool>);
1804    /// ```
1805    pub fn set_or_clear_single_process_oom_kill<T>(mut self, v: std::option::Option<T>) -> Self
1806    where
1807        T: std::convert::Into<bool>,
1808    {
1809        self.single_process_oom_kill = v.map(|x| x.into());
1810        self
1811    }
1812}
1813
1814impl wkt::message::Message for NodeKubeletConfig {
1815    fn typename() -> &'static str {
1816        "type.googleapis.com/google.container.v1.NodeKubeletConfig"
1817    }
1818}
1819
1820/// TopologyManager defines the configuration options for Topology Manager
1821/// feature. See
1822/// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/>
1823#[derive(Clone, Default, PartialEq)]
1824#[non_exhaustive]
1825pub struct TopologyManager {
1826    /// Configures the strategy for resource alignment.
1827    /// Allowed values are:
1828    ///
1829    /// * none: the default policy, and does not perform any topology alignment.
1830    /// * restricted: the topology manager stores the preferred NUMA node affinity
1831    ///   for the container, and will reject the pod if the affinity if not
1832    ///   preferred.
1833    /// * best-effort: the topology manager stores the preferred NUMA node affinity
1834    ///   for the container. If the affinity is not preferred, the topology manager
1835    ///   will admit the pod to the node anyway.
1836    /// * single-numa-node: the topology manager determines if the single NUMA node
1837    ///   affinity is possible. If it is, Topology Manager will store this and the
1838    ///   Hint Providers can then use this information when making the resource
1839    ///   allocation decision. If, however, this is not possible then the
1840    ///   Topology Manager will reject the pod from the node. This will result in a
1841    ///   pod in a Terminated state with a pod admission failure.
1842    ///
1843    /// The default policy value is 'none' if unspecified.
1844    /// Details about each strategy can be found
1845    /// [here](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/#topology-manager-policies).
1846    pub policy: std::string::String,
1847
1848    /// The Topology Manager aligns resources in following scopes:
1849    ///
1850    /// * container
1851    /// * pod
1852    ///
1853    /// The default scope is 'container' if unspecified.
1854    /// See
1855    /// <https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/#topology-manager-scopes>
1856    pub scope: std::string::String,
1857
1858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859}
1860
1861impl TopologyManager {
1862    pub fn new() -> Self {
1863        std::default::Default::default()
1864    }
1865
1866    /// Sets the value of [policy][crate::model::TopologyManager::policy].
1867    ///
1868    /// # Example
1869    /// ```ignore,no_run
1870    /// # use google_cloud_container_v1::model::TopologyManager;
1871    /// let x = TopologyManager::new().set_policy("example");
1872    /// ```
1873    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1874        self.policy = v.into();
1875        self
1876    }
1877
1878    /// Sets the value of [scope][crate::model::TopologyManager::scope].
1879    ///
1880    /// # Example
1881    /// ```ignore,no_run
1882    /// # use google_cloud_container_v1::model::TopologyManager;
1883    /// let x = TopologyManager::new().set_scope("example");
1884    /// ```
1885    pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886        self.scope = v.into();
1887        self
1888    }
1889}
1890
1891impl wkt::message::Message for TopologyManager {
1892    fn typename() -> &'static str {
1893        "type.googleapis.com/google.container.v1.TopologyManager"
1894    }
1895}
1896
1897/// The option enables the Kubernetes NUMA-aware Memory Manager feature.
1898/// Detailed description about the feature can be found
1899/// [here](https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/).
1900#[derive(Clone, Default, PartialEq)]
1901#[non_exhaustive]
1902pub struct MemoryManager {
1903    /// Controls the memory management policy on the Node.
1904    /// See
1905    /// <https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/#policies>
1906    ///
1907    /// The following values are allowed.
1908    ///
1909    /// * "none"
1910    /// * "static"
1911    ///   The default value is 'none' if unspecified.
1912    pub policy: std::string::String,
1913
1914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1915}
1916
1917impl MemoryManager {
1918    pub fn new() -> Self {
1919        std::default::Default::default()
1920    }
1921
1922    /// Sets the value of [policy][crate::model::MemoryManager::policy].
1923    ///
1924    /// # Example
1925    /// ```ignore,no_run
1926    /// # use google_cloud_container_v1::model::MemoryManager;
1927    /// let x = MemoryManager::new().set_policy("example");
1928    /// ```
1929    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1930        self.policy = v.into();
1931        self
1932    }
1933}
1934
1935impl wkt::message::Message for MemoryManager {
1936    fn typename() -> &'static str {
1937        "type.googleapis.com/google.container.v1.MemoryManager"
1938    }
1939}
1940
1941/// Eviction signals are the current state of a particular resource at a specific
1942/// point in time. The kubelet uses eviction signals to make eviction decisions
1943/// by comparing the signals to eviction thresholds, which are the minimum amount
1944/// of the resource that should be available on the node.
1945#[derive(Clone, Default, PartialEq)]
1946#[non_exhaustive]
1947pub struct EvictionSignals {
1948    /// Optional. Memory available (i.e. capacity - workingSet), in bytes. Defines
1949    /// the amount of "memory.available" signal in kubelet. Default is unset, if
1950    /// not specified in the kubelet config. Format: positive number + unit, e.g.
1951    /// 100Ki, 10Mi, 5Gi. Valid units are Ki, Mi, Gi. Must be >= 100Mi and <= 50%
1952    /// of the node's memory. See
1953    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1954    pub memory_available: std::string::String,
1955
1956    /// Optional. Amount of storage available on filesystem that kubelet uses for
1957    /// volumes, daemon logs, etc. Defines the amount of "nodefs.available" signal
1958    /// in kubelet. Default is unset, if not specified in the kubelet config. It
1959    /// takses percentage value for now. Sample format: "30%". Must be >= 10% and
1960    /// <= 50%. See
1961    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1962    pub nodefs_available: std::string::String,
1963
1964    /// Optional. Amount of inodes available on filesystem that kubelet uses for
1965    /// volumes, daemon logs, etc. Defines the amount of "nodefs.inodesFree" signal
1966    /// in kubelet. Default is unset, if not specified in the kubelet config. Linux
1967    /// only. It takses percentage value for now. Sample format: "30%". Must be >=
1968    /// 5% and <= 50%. See
1969    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1970    pub nodefs_inodes_free: std::string::String,
1971
1972    /// Optional. Amount of storage available on filesystem that container runtime
1973    /// uses for storing images layers. If the container filesystem and image
1974    /// filesystem are not separate, then imagefs can store both image layers and
1975    /// writeable layers. Defines the amount of "imagefs.available" signal in
1976    /// kubelet. Default is unset, if not specified in the kubelet config. It
1977    /// takses percentage value for now. Sample format: "30%". Must be >= 15% and
1978    /// <= 50%. See
1979    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1980    pub imagefs_available: std::string::String,
1981
1982    /// Optional. Amount of inodes available on filesystem that container runtime
1983    /// uses for storing images layers. Defines the amount of "imagefs.inodesFree"
1984    /// signal in kubelet. Default is unset, if not specified in the kubelet
1985    /// config. Linux only. It takses percentage value for now. Sample format:
1986    /// "30%". Must be >= 5% and <= 50%. See
1987    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1988    pub imagefs_inodes_free: std::string::String,
1989
1990    /// Optional. Amount of PID available for pod allocation. Defines the amount of
1991    /// "pid.available" signal in kubelet. Default is unset, if not specified in
1992    /// the kubelet config. It takses percentage value for now. Sample format:
1993    /// "30%". Must be >= 10% and <= 50%. See
1994    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
1995    pub pid_available: std::string::String,
1996
1997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1998}
1999
2000impl EvictionSignals {
2001    pub fn new() -> Self {
2002        std::default::Default::default()
2003    }
2004
2005    /// Sets the value of [memory_available][crate::model::EvictionSignals::memory_available].
2006    ///
2007    /// # Example
2008    /// ```ignore,no_run
2009    /// # use google_cloud_container_v1::model::EvictionSignals;
2010    /// let x = EvictionSignals::new().set_memory_available("example");
2011    /// ```
2012    pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
2013        mut self,
2014        v: T,
2015    ) -> Self {
2016        self.memory_available = v.into();
2017        self
2018    }
2019
2020    /// Sets the value of [nodefs_available][crate::model::EvictionSignals::nodefs_available].
2021    ///
2022    /// # Example
2023    /// ```ignore,no_run
2024    /// # use google_cloud_container_v1::model::EvictionSignals;
2025    /// let x = EvictionSignals::new().set_nodefs_available("example");
2026    /// ```
2027    pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
2028        mut self,
2029        v: T,
2030    ) -> Self {
2031        self.nodefs_available = v.into();
2032        self
2033    }
2034
2035    /// Sets the value of [nodefs_inodes_free][crate::model::EvictionSignals::nodefs_inodes_free].
2036    ///
2037    /// # Example
2038    /// ```ignore,no_run
2039    /// # use google_cloud_container_v1::model::EvictionSignals;
2040    /// let x = EvictionSignals::new().set_nodefs_inodes_free("example");
2041    /// ```
2042    pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
2043        mut self,
2044        v: T,
2045    ) -> Self {
2046        self.nodefs_inodes_free = v.into();
2047        self
2048    }
2049
2050    /// Sets the value of [imagefs_available][crate::model::EvictionSignals::imagefs_available].
2051    ///
2052    /// # Example
2053    /// ```ignore,no_run
2054    /// # use google_cloud_container_v1::model::EvictionSignals;
2055    /// let x = EvictionSignals::new().set_imagefs_available("example");
2056    /// ```
2057    pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
2058        mut self,
2059        v: T,
2060    ) -> Self {
2061        self.imagefs_available = v.into();
2062        self
2063    }
2064
2065    /// Sets the value of [imagefs_inodes_free][crate::model::EvictionSignals::imagefs_inodes_free].
2066    ///
2067    /// # Example
2068    /// ```ignore,no_run
2069    /// # use google_cloud_container_v1::model::EvictionSignals;
2070    /// let x = EvictionSignals::new().set_imagefs_inodes_free("example");
2071    /// ```
2072    pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
2073        mut self,
2074        v: T,
2075    ) -> Self {
2076        self.imagefs_inodes_free = v.into();
2077        self
2078    }
2079
2080    /// Sets the value of [pid_available][crate::model::EvictionSignals::pid_available].
2081    ///
2082    /// # Example
2083    /// ```ignore,no_run
2084    /// # use google_cloud_container_v1::model::EvictionSignals;
2085    /// let x = EvictionSignals::new().set_pid_available("example");
2086    /// ```
2087    pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2088        self.pid_available = v.into();
2089        self
2090    }
2091}
2092
2093impl wkt::message::Message for EvictionSignals {
2094    fn typename() -> &'static str {
2095        "type.googleapis.com/google.container.v1.EvictionSignals"
2096    }
2097}
2098
2099/// Eviction grace periods are grace periods for each eviction signal.
2100#[derive(Clone, Default, PartialEq)]
2101#[non_exhaustive]
2102pub struct EvictionGracePeriod {
2103    /// Optional. Grace period for eviction due to memory available signal. Sample
2104    /// format: "10s". Must be >= 0. See
2105    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2106    pub memory_available: std::string::String,
2107
2108    /// Optional. Grace period for eviction due to nodefs available signal. Sample
2109    /// format: "10s". Must be >= 0. See
2110    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2111    pub nodefs_available: std::string::String,
2112
2113    /// Optional. Grace period for eviction due to nodefs inodes free signal.
2114    /// Sample format: "10s". Must be >= 0. See
2115    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2116    pub nodefs_inodes_free: std::string::String,
2117
2118    /// Optional. Grace period for eviction due to imagefs available signal. Sample
2119    /// format: "10s". Must be >= 0. See
2120    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2121    pub imagefs_available: std::string::String,
2122
2123    /// Optional. Grace period for eviction due to imagefs inodes free signal.
2124    /// Sample format: "10s". Must be >= 0. See
2125    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2126    pub imagefs_inodes_free: std::string::String,
2127
2128    /// Optional. Grace period for eviction due to pid available signal. Sample
2129    /// format: "10s". Must be >= 0. See
2130    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2131    pub pid_available: std::string::String,
2132
2133    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2134}
2135
2136impl EvictionGracePeriod {
2137    pub fn new() -> Self {
2138        std::default::Default::default()
2139    }
2140
2141    /// Sets the value of [memory_available][crate::model::EvictionGracePeriod::memory_available].
2142    ///
2143    /// # Example
2144    /// ```ignore,no_run
2145    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2146    /// let x = EvictionGracePeriod::new().set_memory_available("example");
2147    /// ```
2148    pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
2149        mut self,
2150        v: T,
2151    ) -> Self {
2152        self.memory_available = v.into();
2153        self
2154    }
2155
2156    /// Sets the value of [nodefs_available][crate::model::EvictionGracePeriod::nodefs_available].
2157    ///
2158    /// # Example
2159    /// ```ignore,no_run
2160    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2161    /// let x = EvictionGracePeriod::new().set_nodefs_available("example");
2162    /// ```
2163    pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
2164        mut self,
2165        v: T,
2166    ) -> Self {
2167        self.nodefs_available = v.into();
2168        self
2169    }
2170
2171    /// Sets the value of [nodefs_inodes_free][crate::model::EvictionGracePeriod::nodefs_inodes_free].
2172    ///
2173    /// # Example
2174    /// ```ignore,no_run
2175    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2176    /// let x = EvictionGracePeriod::new().set_nodefs_inodes_free("example");
2177    /// ```
2178    pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
2179        mut self,
2180        v: T,
2181    ) -> Self {
2182        self.nodefs_inodes_free = v.into();
2183        self
2184    }
2185
2186    /// Sets the value of [imagefs_available][crate::model::EvictionGracePeriod::imagefs_available].
2187    ///
2188    /// # Example
2189    /// ```ignore,no_run
2190    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2191    /// let x = EvictionGracePeriod::new().set_imagefs_available("example");
2192    /// ```
2193    pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
2194        mut self,
2195        v: T,
2196    ) -> Self {
2197        self.imagefs_available = v.into();
2198        self
2199    }
2200
2201    /// Sets the value of [imagefs_inodes_free][crate::model::EvictionGracePeriod::imagefs_inodes_free].
2202    ///
2203    /// # Example
2204    /// ```ignore,no_run
2205    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2206    /// let x = EvictionGracePeriod::new().set_imagefs_inodes_free("example");
2207    /// ```
2208    pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
2209        mut self,
2210        v: T,
2211    ) -> Self {
2212        self.imagefs_inodes_free = v.into();
2213        self
2214    }
2215
2216    /// Sets the value of [pid_available][crate::model::EvictionGracePeriod::pid_available].
2217    ///
2218    /// # Example
2219    /// ```ignore,no_run
2220    /// # use google_cloud_container_v1::model::EvictionGracePeriod;
2221    /// let x = EvictionGracePeriod::new().set_pid_available("example");
2222    /// ```
2223    pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2224        self.pid_available = v.into();
2225        self
2226    }
2227}
2228
2229impl wkt::message::Message for EvictionGracePeriod {
2230    fn typename() -> &'static str {
2231        "type.googleapis.com/google.container.v1.EvictionGracePeriod"
2232    }
2233}
2234
2235/// Eviction minimum reclaims are the resource amounts of minimum reclaims for
2236/// each eviction signal.
2237#[derive(Clone, Default, PartialEq)]
2238#[non_exhaustive]
2239pub struct EvictionMinimumReclaim {
2240    /// Optional. Minimum reclaim for eviction due to memory available signal. Only
2241    /// take percentage value for now. Sample format: "10%". Must be <=10%. See
2242    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2243    pub memory_available: std::string::String,
2244
2245    /// Optional. Minimum reclaim for eviction due to nodefs available signal. Only
2246    /// take percentage value for now. Sample format: "10%". Must be <=10%. See
2247    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2248    pub nodefs_available: std::string::String,
2249
2250    /// Optional. Minimum reclaim for eviction due to nodefs inodes free signal.
2251    /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
2252    /// See
2253    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2254    pub nodefs_inodes_free: std::string::String,
2255
2256    /// Optional. Minimum reclaim for eviction due to imagefs available signal.
2257    /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
2258    /// See
2259    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2260    pub imagefs_available: std::string::String,
2261
2262    /// Optional. Minimum reclaim for eviction due to imagefs inodes free signal.
2263    /// Only take percentage value for now. Sample format: "10%". Must be <=10%.
2264    /// See
2265    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2266    pub imagefs_inodes_free: std::string::String,
2267
2268    /// Optional. Minimum reclaim for eviction due to pid available signal. Only
2269    /// take percentage value for now. Sample format: "10%". Must be <=10%. See
2270    /// <https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals>
2271    pub pid_available: std::string::String,
2272
2273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2274}
2275
2276impl EvictionMinimumReclaim {
2277    pub fn new() -> Self {
2278        std::default::Default::default()
2279    }
2280
2281    /// Sets the value of [memory_available][crate::model::EvictionMinimumReclaim::memory_available].
2282    ///
2283    /// # Example
2284    /// ```ignore,no_run
2285    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2286    /// let x = EvictionMinimumReclaim::new().set_memory_available("example");
2287    /// ```
2288    pub fn set_memory_available<T: std::convert::Into<std::string::String>>(
2289        mut self,
2290        v: T,
2291    ) -> Self {
2292        self.memory_available = v.into();
2293        self
2294    }
2295
2296    /// Sets the value of [nodefs_available][crate::model::EvictionMinimumReclaim::nodefs_available].
2297    ///
2298    /// # Example
2299    /// ```ignore,no_run
2300    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2301    /// let x = EvictionMinimumReclaim::new().set_nodefs_available("example");
2302    /// ```
2303    pub fn set_nodefs_available<T: std::convert::Into<std::string::String>>(
2304        mut self,
2305        v: T,
2306    ) -> Self {
2307        self.nodefs_available = v.into();
2308        self
2309    }
2310
2311    /// Sets the value of [nodefs_inodes_free][crate::model::EvictionMinimumReclaim::nodefs_inodes_free].
2312    ///
2313    /// # Example
2314    /// ```ignore,no_run
2315    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2316    /// let x = EvictionMinimumReclaim::new().set_nodefs_inodes_free("example");
2317    /// ```
2318    pub fn set_nodefs_inodes_free<T: std::convert::Into<std::string::String>>(
2319        mut self,
2320        v: T,
2321    ) -> Self {
2322        self.nodefs_inodes_free = v.into();
2323        self
2324    }
2325
2326    /// Sets the value of [imagefs_available][crate::model::EvictionMinimumReclaim::imagefs_available].
2327    ///
2328    /// # Example
2329    /// ```ignore,no_run
2330    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2331    /// let x = EvictionMinimumReclaim::new().set_imagefs_available("example");
2332    /// ```
2333    pub fn set_imagefs_available<T: std::convert::Into<std::string::String>>(
2334        mut self,
2335        v: T,
2336    ) -> Self {
2337        self.imagefs_available = v.into();
2338        self
2339    }
2340
2341    /// Sets the value of [imagefs_inodes_free][crate::model::EvictionMinimumReclaim::imagefs_inodes_free].
2342    ///
2343    /// # Example
2344    /// ```ignore,no_run
2345    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2346    /// let x = EvictionMinimumReclaim::new().set_imagefs_inodes_free("example");
2347    /// ```
2348    pub fn set_imagefs_inodes_free<T: std::convert::Into<std::string::String>>(
2349        mut self,
2350        v: T,
2351    ) -> Self {
2352        self.imagefs_inodes_free = v.into();
2353        self
2354    }
2355
2356    /// Sets the value of [pid_available][crate::model::EvictionMinimumReclaim::pid_available].
2357    ///
2358    /// # Example
2359    /// ```ignore,no_run
2360    /// # use google_cloud_container_v1::model::EvictionMinimumReclaim;
2361    /// let x = EvictionMinimumReclaim::new().set_pid_available("example");
2362    /// ```
2363    pub fn set_pid_available<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2364        self.pid_available = v.into();
2365        self
2366    }
2367}
2368
2369impl wkt::message::Message for EvictionMinimumReclaim {
2370    fn typename() -> &'static str {
2371        "type.googleapis.com/google.container.v1.EvictionMinimumReclaim"
2372    }
2373}
2374
2375/// Parameters that describe the nodes in a cluster.
2376///
2377/// GKE Autopilot clusters do not
2378/// recognize parameters in `NodeConfig`. Use
2379/// [AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults]
2380/// instead.
2381///
2382/// [google.container.v1.AutoprovisioningNodePoolDefaults]: crate::model::AutoprovisioningNodePoolDefaults
2383#[derive(Clone, Default, PartialEq)]
2384#[non_exhaustive]
2385pub struct NodeConfig {
2386    /// The name of a Google Compute Engine [machine
2387    /// type](https://cloud.google.com/compute/docs/machine-types)
2388    ///
2389    /// If unspecified, the default machine type is `e2-medium`.
2390    pub machine_type: std::string::String,
2391
2392    /// Size of the disk attached to each node, specified in GB.
2393    /// The smallest allowed disk size is 10GB.
2394    ///
2395    /// If unspecified, the default disk size is 100GB.
2396    pub disk_size_gb: i32,
2397
2398    /// The set of Google API scopes to be made available on all of the
2399    /// node VMs under the "default" service account.
2400    ///
2401    /// The following scopes are recommended, but not required, and by default are
2402    /// not included:
2403    ///
2404    /// * `<https://www.googleapis.com/auth/compute>` is required for mounting
2405    ///   persistent storage on your nodes.
2406    /// * `<https://www.googleapis.com/auth/devstorage.read_only>` is required for
2407    ///   communicating with **gcr.io**
2408    ///   (the [Artifact Registry](https://cloud.google.com/artifact-registry/)).
2409    ///
2410    /// If unspecified, no scopes are added, unless Cloud Logging or Cloud
2411    /// Monitoring are enabled, in which case their required scopes will be added.
2412    pub oauth_scopes: std::vec::Vec<std::string::String>,
2413
2414    /// The Google Cloud Platform Service Account to be used by the node VMs.
2415    /// Specify the email address of the Service Account; otherwise, if no Service
2416    /// Account is specified, the "default" service account is used.
2417    pub service_account: std::string::String,
2418
2419    /// The metadata key/value pairs assigned to instances in the cluster.
2420    ///
2421    /// Keys must conform to the regexp `[a-zA-Z0-9-_]+` and be less than 128 bytes
2422    /// in length. These are reflected as part of a URL in the metadata server.
2423    /// Additionally, to avoid ambiguity, keys must not conflict with any other
2424    /// metadata keys for the project or be one of the reserved keys:
2425    ///
2426    /// - "cluster-location"
2427    /// - "cluster-name"
2428    /// - "cluster-uid"
2429    /// - "configure-sh"
2430    /// - "containerd-configure-sh"
2431    /// - "enable-os-login"
2432    /// - "gci-ensure-gke-docker"
2433    /// - "gci-metrics-enabled"
2434    /// - "gci-update-strategy"
2435    /// - "instance-template"
2436    /// - "kube-env"
2437    /// - "startup-script"
2438    /// - "user-data"
2439    /// - "disable-address-manager"
2440    /// - "windows-startup-script-ps1"
2441    /// - "common-psm1"
2442    /// - "k8s-node-setup-psm1"
2443    /// - "install-ssh-psm1"
2444    /// - "user-profile-psm1"
2445    ///
2446    /// Values are free-form strings, and only have meaning as interpreted by
2447    /// the image running in the instance. The only restriction placed on them is
2448    /// that each value's size must be less than or equal to 32 KB.
2449    ///
2450    /// The total size of all keys and values must be less than 512 KB.
2451    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
2452
2453    /// The image type to use for this node. Note that for a given image type,
2454    /// the latest version of it will be used. Please see
2455    /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
2456    /// for available image types.
2457    pub image_type: std::string::String,
2458
2459    /// The map of Kubernetes labels (key/value pairs) to be applied to each node.
2460    /// These will added in addition to any default label(s) that
2461    /// Kubernetes may apply to the node.
2462    /// In case of conflict in label keys, the applied set may differ depending on
2463    /// the Kubernetes version -- it's best to assume the behavior is undefined
2464    /// and conflicts should be avoided.
2465    /// For more information, including usage and the valid values, see:
2466    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/>
2467    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2468
2469    /// The number of local SSD disks to be attached to the node.
2470    ///
2471    /// The limit for this value is dependent upon the maximum number of
2472    /// disks available on a machine per zone. See:
2473    /// <https://cloud.google.com/compute/docs/disks/local-ssd>
2474    /// for more information.
2475    pub local_ssd_count: i32,
2476
2477    /// The list of instance tags applied to all nodes. Tags are used to identify
2478    /// valid sources or targets for network firewalls and are specified by
2479    /// the client during cluster or node pool creation. Each tag within the list
2480    /// must comply with RFC1035.
2481    pub tags: std::vec::Vec<std::string::String>,
2482
2483    /// Whether the nodes are created as preemptible VM instances. See:
2484    /// <https://cloud.google.com/compute/docs/instances/preemptible>
2485    /// for more information about preemptible VM instances.
2486    pub preemptible: bool,
2487
2488    /// A list of hardware accelerators to be attached to each node.
2489    /// See
2490    /// <https://cloud.google.com/compute/docs/gpus>
2491    /// for more information about support for GPUs.
2492    pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
2493
2494    /// Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or
2495    /// 'pd-balanced')
2496    ///
2497    /// If unspecified, the default disk type is 'pd-standard'
2498    pub disk_type: std::string::String,
2499
2500    /// Minimum CPU platform to be used by this instance. The instance may be
2501    /// scheduled on the specified or newer CPU platform. Applicable values are the
2502    /// friendly names of CPU platforms, such as
2503    /// `minCpuPlatform: "Intel Haswell"` or
2504    /// `minCpuPlatform: "Intel Sandy Bridge"`. For more
2505    /// information, read [how to specify min CPU
2506    /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
2507    pub min_cpu_platform: std::string::String,
2508
2509    /// The workload metadata configuration for this node.
2510    pub workload_metadata_config: std::option::Option<crate::model::WorkloadMetadataConfig>,
2511
2512    /// List of kubernetes taints to be applied to each node.
2513    ///
2514    /// For more information, including usage and the valid values, see:
2515    /// <https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/>
2516    pub taints: std::vec::Vec<crate::model::NodeTaint>,
2517
2518    /// Sandbox configuration for this node.
2519    pub sandbox_config: std::option::Option<crate::model::SandboxConfig>,
2520
2521    /// Setting this field will assign instances of this
2522    /// pool to run on the specified node group. This is useful for running
2523    /// workloads on [sole tenant
2524    /// nodes](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes).
2525    pub node_group: std::string::String,
2526
2527    /// The optional reservation affinity. Setting this field will apply
2528    /// the specified [Zonal Compute
2529    /// Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
2530    /// to this node pool.
2531    pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
2532
2533    /// Shielded Instance options.
2534    pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
2535
2536    /// Parameters that can be configured on Linux nodes.
2537    pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
2538
2539    /// Node kubelet configs.
2540    pub kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
2541
2542    /// The Customer Managed Encryption Key used to encrypt the boot disk attached
2543    /// to each node in the node pool. This should be of the form
2544    /// projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
2545    /// For more information about protecting resources with Cloud KMS Keys please
2546    /// see:
2547    /// <https://cloud.google.com/compute/docs/disks/customer-managed-encryption>
2548    pub boot_disk_kms_key: std::string::String,
2549
2550    /// Google Container File System (image streaming) configs.
2551    pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
2552
2553    /// Advanced features for the Compute Engine VM.
2554    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
2555
2556    /// Enable or disable gvnic in the node pool.
2557    pub gvnic: std::option::Option<crate::model::VirtualNIC>,
2558
2559    /// Spot flag for enabling Spot VM, which is a rebrand of
2560    /// the existing preemptible flag.
2561    pub spot: bool,
2562
2563    /// Confidential nodes config.
2564    /// All the nodes in the node pool will be Confidential VM once enabled.
2565    pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
2566
2567    /// Enable or disable NCCL fast socket for the node pool.
2568    pub fast_socket: std::option::Option<crate::model::FastSocket>,
2569
2570    /// The resource labels for the node pool to use to annotate any related
2571    /// Google Compute Engine resources.
2572    pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
2573
2574    /// Logging configuration.
2575    pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
2576
2577    /// Parameters that can be configured on Windows nodes.
2578    pub windows_node_config: std::option::Option<crate::model::WindowsNodeConfig>,
2579
2580    /// Parameters for using raw-block Local NVMe SSDs.
2581    pub local_nvme_ssd_block_config: std::option::Option<crate::model::LocalNvmeSsdBlockConfig>,
2582
2583    /// Parameters for the node ephemeral storage using Local SSDs.
2584    /// If unspecified, ephemeral storage is backed by the boot disk.
2585    pub ephemeral_storage_local_ssd_config:
2586        std::option::Option<crate::model::EphemeralStorageLocalSsdConfig>,
2587
2588    /// Parameters for node pools to be backed by shared sole tenant node groups.
2589    pub sole_tenant_config: std::option::Option<crate::model::SoleTenantConfig>,
2590
2591    /// Parameters for containerd customization.
2592    pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
2593
2594    /// A map of resource manager tag keys and values to be attached to the nodes.
2595    pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
2596
2597    /// Optional. Reserved for future use.
2598    pub enable_confidential_storage: bool,
2599
2600    /// List of secondary boot disks attached to the nodes.
2601    pub secondary_boot_disks: std::vec::Vec<crate::model::SecondaryBootDisk>,
2602
2603    /// List of Storage Pools where boot disks are provisioned.
2604    pub storage_pools: std::vec::Vec<std::string::String>,
2605
2606    /// Secondary boot disk update strategy.
2607    pub secondary_boot_disk_update_strategy:
2608        std::option::Option<crate::model::SecondaryBootDiskUpdateStrategy>,
2609
2610    /// The maximum duration for the nodes to exist.
2611    /// If unspecified, the nodes can exist indefinitely.
2612    pub max_run_duration: std::option::Option<wkt::Duration>,
2613
2614    /// Specifies which method should be used for encrypting the
2615    /// Local SSDs attached to the node.
2616    pub local_ssd_encryption_mode:
2617        std::option::Option<crate::model::node_config::LocalSsdEncryptionMode>,
2618
2619    /// Output only. effective_cgroup_mode is the cgroup mode actually used by the
2620    /// node pool. It is determined by the cgroup mode specified in the
2621    /// LinuxNodeConfig or the default cgroup mode based on the cluster creation
2622    /// version.
2623    pub effective_cgroup_mode: crate::model::node_config::EffectiveCgroupMode,
2624
2625    /// Flex Start flag for enabling Flex Start VM.
2626    pub flex_start: std::option::Option<bool>,
2627
2628    /// The boot disk configuration for the node pool.
2629    pub boot_disk: std::option::Option<crate::model::BootDisk>,
2630
2631    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2632}
2633
2634impl NodeConfig {
2635    pub fn new() -> Self {
2636        std::default::Default::default()
2637    }
2638
2639    /// Sets the value of [machine_type][crate::model::NodeConfig::machine_type].
2640    ///
2641    /// # Example
2642    /// ```ignore,no_run
2643    /// # use google_cloud_container_v1::model::NodeConfig;
2644    /// let x = NodeConfig::new().set_machine_type("example");
2645    /// ```
2646    pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2647        self.machine_type = v.into();
2648        self
2649    }
2650
2651    /// Sets the value of [disk_size_gb][crate::model::NodeConfig::disk_size_gb].
2652    ///
2653    /// # Example
2654    /// ```ignore,no_run
2655    /// # use google_cloud_container_v1::model::NodeConfig;
2656    /// let x = NodeConfig::new().set_disk_size_gb(42);
2657    /// ```
2658    pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2659        self.disk_size_gb = v.into();
2660        self
2661    }
2662
2663    /// Sets the value of [oauth_scopes][crate::model::NodeConfig::oauth_scopes].
2664    ///
2665    /// # Example
2666    /// ```ignore,no_run
2667    /// # use google_cloud_container_v1::model::NodeConfig;
2668    /// let x = NodeConfig::new().set_oauth_scopes(["a", "b", "c"]);
2669    /// ```
2670    pub fn set_oauth_scopes<T, V>(mut self, v: T) -> Self
2671    where
2672        T: std::iter::IntoIterator<Item = V>,
2673        V: std::convert::Into<std::string::String>,
2674    {
2675        use std::iter::Iterator;
2676        self.oauth_scopes = v.into_iter().map(|i| i.into()).collect();
2677        self
2678    }
2679
2680    /// Sets the value of [service_account][crate::model::NodeConfig::service_account].
2681    ///
2682    /// # Example
2683    /// ```ignore,no_run
2684    /// # use google_cloud_container_v1::model::NodeConfig;
2685    /// let x = NodeConfig::new().set_service_account("example");
2686    /// ```
2687    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688        self.service_account = v.into();
2689        self
2690    }
2691
2692    /// Sets the value of [metadata][crate::model::NodeConfig::metadata].
2693    ///
2694    /// # Example
2695    /// ```ignore,no_run
2696    /// # use google_cloud_container_v1::model::NodeConfig;
2697    /// let x = NodeConfig::new().set_metadata([
2698    ///     ("key0", "abc"),
2699    ///     ("key1", "xyz"),
2700    /// ]);
2701    /// ```
2702    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
2703    where
2704        T: std::iter::IntoIterator<Item = (K, V)>,
2705        K: std::convert::Into<std::string::String>,
2706        V: std::convert::Into<std::string::String>,
2707    {
2708        use std::iter::Iterator;
2709        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2710        self
2711    }
2712
2713    /// Sets the value of [image_type][crate::model::NodeConfig::image_type].
2714    ///
2715    /// # Example
2716    /// ```ignore,no_run
2717    /// # use google_cloud_container_v1::model::NodeConfig;
2718    /// let x = NodeConfig::new().set_image_type("example");
2719    /// ```
2720    pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2721        self.image_type = v.into();
2722        self
2723    }
2724
2725    /// Sets the value of [labels][crate::model::NodeConfig::labels].
2726    ///
2727    /// # Example
2728    /// ```ignore,no_run
2729    /// # use google_cloud_container_v1::model::NodeConfig;
2730    /// let x = NodeConfig::new().set_labels([
2731    ///     ("key0", "abc"),
2732    ///     ("key1", "xyz"),
2733    /// ]);
2734    /// ```
2735    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2736    where
2737        T: std::iter::IntoIterator<Item = (K, V)>,
2738        K: std::convert::Into<std::string::String>,
2739        V: std::convert::Into<std::string::String>,
2740    {
2741        use std::iter::Iterator;
2742        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2743        self
2744    }
2745
2746    /// Sets the value of [local_ssd_count][crate::model::NodeConfig::local_ssd_count].
2747    ///
2748    /// # Example
2749    /// ```ignore,no_run
2750    /// # use google_cloud_container_v1::model::NodeConfig;
2751    /// let x = NodeConfig::new().set_local_ssd_count(42);
2752    /// ```
2753    pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2754        self.local_ssd_count = v.into();
2755        self
2756    }
2757
2758    /// Sets the value of [tags][crate::model::NodeConfig::tags].
2759    ///
2760    /// # Example
2761    /// ```ignore,no_run
2762    /// # use google_cloud_container_v1::model::NodeConfig;
2763    /// let x = NodeConfig::new().set_tags(["a", "b", "c"]);
2764    /// ```
2765    pub fn set_tags<T, V>(mut self, v: T) -> Self
2766    where
2767        T: std::iter::IntoIterator<Item = V>,
2768        V: std::convert::Into<std::string::String>,
2769    {
2770        use std::iter::Iterator;
2771        self.tags = v.into_iter().map(|i| i.into()).collect();
2772        self
2773    }
2774
2775    /// Sets the value of [preemptible][crate::model::NodeConfig::preemptible].
2776    ///
2777    /// # Example
2778    /// ```ignore,no_run
2779    /// # use google_cloud_container_v1::model::NodeConfig;
2780    /// let x = NodeConfig::new().set_preemptible(true);
2781    /// ```
2782    pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2783        self.preemptible = v.into();
2784        self
2785    }
2786
2787    /// Sets the value of [accelerators][crate::model::NodeConfig::accelerators].
2788    ///
2789    /// # Example
2790    /// ```ignore,no_run
2791    /// # use google_cloud_container_v1::model::NodeConfig;
2792    /// use google_cloud_container_v1::model::AcceleratorConfig;
2793    /// let x = NodeConfig::new()
2794    ///     .set_accelerators([
2795    ///         AcceleratorConfig::default()/* use setters */,
2796    ///         AcceleratorConfig::default()/* use (different) setters */,
2797    ///     ]);
2798    /// ```
2799    pub fn set_accelerators<T, V>(mut self, v: T) -> Self
2800    where
2801        T: std::iter::IntoIterator<Item = V>,
2802        V: std::convert::Into<crate::model::AcceleratorConfig>,
2803    {
2804        use std::iter::Iterator;
2805        self.accelerators = v.into_iter().map(|i| i.into()).collect();
2806        self
2807    }
2808
2809    /// Sets the value of [disk_type][crate::model::NodeConfig::disk_type].
2810    ///
2811    /// # Example
2812    /// ```ignore,no_run
2813    /// # use google_cloud_container_v1::model::NodeConfig;
2814    /// let x = NodeConfig::new().set_disk_type("example");
2815    /// ```
2816    pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2817        self.disk_type = v.into();
2818        self
2819    }
2820
2821    /// Sets the value of [min_cpu_platform][crate::model::NodeConfig::min_cpu_platform].
2822    ///
2823    /// # Example
2824    /// ```ignore,no_run
2825    /// # use google_cloud_container_v1::model::NodeConfig;
2826    /// let x = NodeConfig::new().set_min_cpu_platform("example");
2827    /// ```
2828    pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
2829        mut self,
2830        v: T,
2831    ) -> Self {
2832        self.min_cpu_platform = v.into();
2833        self
2834    }
2835
2836    /// Sets the value of [workload_metadata_config][crate::model::NodeConfig::workload_metadata_config].
2837    ///
2838    /// # Example
2839    /// ```ignore,no_run
2840    /// # use google_cloud_container_v1::model::NodeConfig;
2841    /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
2842    /// let x = NodeConfig::new().set_workload_metadata_config(WorkloadMetadataConfig::default()/* use setters */);
2843    /// ```
2844    pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
2845    where
2846        T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
2847    {
2848        self.workload_metadata_config = std::option::Option::Some(v.into());
2849        self
2850    }
2851
2852    /// Sets or clears the value of [workload_metadata_config][crate::model::NodeConfig::workload_metadata_config].
2853    ///
2854    /// # Example
2855    /// ```ignore,no_run
2856    /// # use google_cloud_container_v1::model::NodeConfig;
2857    /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
2858    /// let x = NodeConfig::new().set_or_clear_workload_metadata_config(Some(WorkloadMetadataConfig::default()/* use setters */));
2859    /// let x = NodeConfig::new().set_or_clear_workload_metadata_config(None::<WorkloadMetadataConfig>);
2860    /// ```
2861    pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
2862    where
2863        T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
2864    {
2865        self.workload_metadata_config = v.map(|x| x.into());
2866        self
2867    }
2868
2869    /// Sets the value of [taints][crate::model::NodeConfig::taints].
2870    ///
2871    /// # Example
2872    /// ```ignore,no_run
2873    /// # use google_cloud_container_v1::model::NodeConfig;
2874    /// use google_cloud_container_v1::model::NodeTaint;
2875    /// let x = NodeConfig::new()
2876    ///     .set_taints([
2877    ///         NodeTaint::default()/* use setters */,
2878    ///         NodeTaint::default()/* use (different) setters */,
2879    ///     ]);
2880    /// ```
2881    pub fn set_taints<T, V>(mut self, v: T) -> Self
2882    where
2883        T: std::iter::IntoIterator<Item = V>,
2884        V: std::convert::Into<crate::model::NodeTaint>,
2885    {
2886        use std::iter::Iterator;
2887        self.taints = v.into_iter().map(|i| i.into()).collect();
2888        self
2889    }
2890
2891    /// Sets the value of [sandbox_config][crate::model::NodeConfig::sandbox_config].
2892    ///
2893    /// # Example
2894    /// ```ignore,no_run
2895    /// # use google_cloud_container_v1::model::NodeConfig;
2896    /// use google_cloud_container_v1::model::SandboxConfig;
2897    /// let x = NodeConfig::new().set_sandbox_config(SandboxConfig::default()/* use setters */);
2898    /// ```
2899    pub fn set_sandbox_config<T>(mut self, v: T) -> Self
2900    where
2901        T: std::convert::Into<crate::model::SandboxConfig>,
2902    {
2903        self.sandbox_config = std::option::Option::Some(v.into());
2904        self
2905    }
2906
2907    /// Sets or clears the value of [sandbox_config][crate::model::NodeConfig::sandbox_config].
2908    ///
2909    /// # Example
2910    /// ```ignore,no_run
2911    /// # use google_cloud_container_v1::model::NodeConfig;
2912    /// use google_cloud_container_v1::model::SandboxConfig;
2913    /// let x = NodeConfig::new().set_or_clear_sandbox_config(Some(SandboxConfig::default()/* use setters */));
2914    /// let x = NodeConfig::new().set_or_clear_sandbox_config(None::<SandboxConfig>);
2915    /// ```
2916    pub fn set_or_clear_sandbox_config<T>(mut self, v: std::option::Option<T>) -> Self
2917    where
2918        T: std::convert::Into<crate::model::SandboxConfig>,
2919    {
2920        self.sandbox_config = v.map(|x| x.into());
2921        self
2922    }
2923
2924    /// Sets the value of [node_group][crate::model::NodeConfig::node_group].
2925    ///
2926    /// # Example
2927    /// ```ignore,no_run
2928    /// # use google_cloud_container_v1::model::NodeConfig;
2929    /// let x = NodeConfig::new().set_node_group("example");
2930    /// ```
2931    pub fn set_node_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2932        self.node_group = v.into();
2933        self
2934    }
2935
2936    /// Sets the value of [reservation_affinity][crate::model::NodeConfig::reservation_affinity].
2937    ///
2938    /// # Example
2939    /// ```ignore,no_run
2940    /// # use google_cloud_container_v1::model::NodeConfig;
2941    /// use google_cloud_container_v1::model::ReservationAffinity;
2942    /// let x = NodeConfig::new().set_reservation_affinity(ReservationAffinity::default()/* use setters */);
2943    /// ```
2944    pub fn set_reservation_affinity<T>(mut self, v: T) -> Self
2945    where
2946        T: std::convert::Into<crate::model::ReservationAffinity>,
2947    {
2948        self.reservation_affinity = std::option::Option::Some(v.into());
2949        self
2950    }
2951
2952    /// Sets or clears the value of [reservation_affinity][crate::model::NodeConfig::reservation_affinity].
2953    ///
2954    /// # Example
2955    /// ```ignore,no_run
2956    /// # use google_cloud_container_v1::model::NodeConfig;
2957    /// use google_cloud_container_v1::model::ReservationAffinity;
2958    /// let x = NodeConfig::new().set_or_clear_reservation_affinity(Some(ReservationAffinity::default()/* use setters */));
2959    /// let x = NodeConfig::new().set_or_clear_reservation_affinity(None::<ReservationAffinity>);
2960    /// ```
2961    pub fn set_or_clear_reservation_affinity<T>(mut self, v: std::option::Option<T>) -> Self
2962    where
2963        T: std::convert::Into<crate::model::ReservationAffinity>,
2964    {
2965        self.reservation_affinity = v.map(|x| x.into());
2966        self
2967    }
2968
2969    /// Sets the value of [shielded_instance_config][crate::model::NodeConfig::shielded_instance_config].
2970    ///
2971    /// # Example
2972    /// ```ignore,no_run
2973    /// # use google_cloud_container_v1::model::NodeConfig;
2974    /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
2975    /// let x = NodeConfig::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
2976    /// ```
2977    pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
2978    where
2979        T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
2980    {
2981        self.shielded_instance_config = std::option::Option::Some(v.into());
2982        self
2983    }
2984
2985    /// Sets or clears the value of [shielded_instance_config][crate::model::NodeConfig::shielded_instance_config].
2986    ///
2987    /// # Example
2988    /// ```ignore,no_run
2989    /// # use google_cloud_container_v1::model::NodeConfig;
2990    /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
2991    /// let x = NodeConfig::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
2992    /// let x = NodeConfig::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
2993    /// ```
2994    pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
2995    where
2996        T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
2997    {
2998        self.shielded_instance_config = v.map(|x| x.into());
2999        self
3000    }
3001
3002    /// Sets the value of [linux_node_config][crate::model::NodeConfig::linux_node_config].
3003    ///
3004    /// # Example
3005    /// ```ignore,no_run
3006    /// # use google_cloud_container_v1::model::NodeConfig;
3007    /// use google_cloud_container_v1::model::LinuxNodeConfig;
3008    /// let x = NodeConfig::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
3009    /// ```
3010    pub fn set_linux_node_config<T>(mut self, v: T) -> Self
3011    where
3012        T: std::convert::Into<crate::model::LinuxNodeConfig>,
3013    {
3014        self.linux_node_config = std::option::Option::Some(v.into());
3015        self
3016    }
3017
3018    /// Sets or clears the value of [linux_node_config][crate::model::NodeConfig::linux_node_config].
3019    ///
3020    /// # Example
3021    /// ```ignore,no_run
3022    /// # use google_cloud_container_v1::model::NodeConfig;
3023    /// use google_cloud_container_v1::model::LinuxNodeConfig;
3024    /// let x = NodeConfig::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
3025    /// let x = NodeConfig::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
3026    /// ```
3027    pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
3028    where
3029        T: std::convert::Into<crate::model::LinuxNodeConfig>,
3030    {
3031        self.linux_node_config = v.map(|x| x.into());
3032        self
3033    }
3034
3035    /// Sets the value of [kubelet_config][crate::model::NodeConfig::kubelet_config].
3036    ///
3037    /// # Example
3038    /// ```ignore,no_run
3039    /// # use google_cloud_container_v1::model::NodeConfig;
3040    /// use google_cloud_container_v1::model::NodeKubeletConfig;
3041    /// let x = NodeConfig::new().set_kubelet_config(NodeKubeletConfig::default()/* use setters */);
3042    /// ```
3043    pub fn set_kubelet_config<T>(mut self, v: T) -> Self
3044    where
3045        T: std::convert::Into<crate::model::NodeKubeletConfig>,
3046    {
3047        self.kubelet_config = std::option::Option::Some(v.into());
3048        self
3049    }
3050
3051    /// Sets or clears the value of [kubelet_config][crate::model::NodeConfig::kubelet_config].
3052    ///
3053    /// # Example
3054    /// ```ignore,no_run
3055    /// # use google_cloud_container_v1::model::NodeConfig;
3056    /// use google_cloud_container_v1::model::NodeKubeletConfig;
3057    /// let x = NodeConfig::new().set_or_clear_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
3058    /// let x = NodeConfig::new().set_or_clear_kubelet_config(None::<NodeKubeletConfig>);
3059    /// ```
3060    pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
3061    where
3062        T: std::convert::Into<crate::model::NodeKubeletConfig>,
3063    {
3064        self.kubelet_config = v.map(|x| x.into());
3065        self
3066    }
3067
3068    /// Sets the value of [boot_disk_kms_key][crate::model::NodeConfig::boot_disk_kms_key].
3069    ///
3070    /// # Example
3071    /// ```ignore,no_run
3072    /// # use google_cloud_container_v1::model::NodeConfig;
3073    /// let x = NodeConfig::new().set_boot_disk_kms_key("example");
3074    /// ```
3075    pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
3076        mut self,
3077        v: T,
3078    ) -> Self {
3079        self.boot_disk_kms_key = v.into();
3080        self
3081    }
3082
3083    /// Sets the value of [gcfs_config][crate::model::NodeConfig::gcfs_config].
3084    ///
3085    /// # Example
3086    /// ```ignore,no_run
3087    /// # use google_cloud_container_v1::model::NodeConfig;
3088    /// use google_cloud_container_v1::model::GcfsConfig;
3089    /// let x = NodeConfig::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
3090    /// ```
3091    pub fn set_gcfs_config<T>(mut self, v: T) -> Self
3092    where
3093        T: std::convert::Into<crate::model::GcfsConfig>,
3094    {
3095        self.gcfs_config = std::option::Option::Some(v.into());
3096        self
3097    }
3098
3099    /// Sets or clears the value of [gcfs_config][crate::model::NodeConfig::gcfs_config].
3100    ///
3101    /// # Example
3102    /// ```ignore,no_run
3103    /// # use google_cloud_container_v1::model::NodeConfig;
3104    /// use google_cloud_container_v1::model::GcfsConfig;
3105    /// let x = NodeConfig::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
3106    /// let x = NodeConfig::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
3107    /// ```
3108    pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
3109    where
3110        T: std::convert::Into<crate::model::GcfsConfig>,
3111    {
3112        self.gcfs_config = v.map(|x| x.into());
3113        self
3114    }
3115
3116    /// Sets the value of [advanced_machine_features][crate::model::NodeConfig::advanced_machine_features].
3117    ///
3118    /// # Example
3119    /// ```ignore,no_run
3120    /// # use google_cloud_container_v1::model::NodeConfig;
3121    /// use google_cloud_container_v1::model::AdvancedMachineFeatures;
3122    /// let x = NodeConfig::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
3123    /// ```
3124    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
3125    where
3126        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
3127    {
3128        self.advanced_machine_features = std::option::Option::Some(v.into());
3129        self
3130    }
3131
3132    /// Sets or clears the value of [advanced_machine_features][crate::model::NodeConfig::advanced_machine_features].
3133    ///
3134    /// # Example
3135    /// ```ignore,no_run
3136    /// # use google_cloud_container_v1::model::NodeConfig;
3137    /// use google_cloud_container_v1::model::AdvancedMachineFeatures;
3138    /// let x = NodeConfig::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
3139    /// let x = NodeConfig::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
3140    /// ```
3141    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
3142    where
3143        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
3144    {
3145        self.advanced_machine_features = v.map(|x| x.into());
3146        self
3147    }
3148
3149    /// Sets the value of [gvnic][crate::model::NodeConfig::gvnic].
3150    ///
3151    /// # Example
3152    /// ```ignore,no_run
3153    /// # use google_cloud_container_v1::model::NodeConfig;
3154    /// use google_cloud_container_v1::model::VirtualNIC;
3155    /// let x = NodeConfig::new().set_gvnic(VirtualNIC::default()/* use setters */);
3156    /// ```
3157    pub fn set_gvnic<T>(mut self, v: T) -> Self
3158    where
3159        T: std::convert::Into<crate::model::VirtualNIC>,
3160    {
3161        self.gvnic = std::option::Option::Some(v.into());
3162        self
3163    }
3164
3165    /// Sets or clears the value of [gvnic][crate::model::NodeConfig::gvnic].
3166    ///
3167    /// # Example
3168    /// ```ignore,no_run
3169    /// # use google_cloud_container_v1::model::NodeConfig;
3170    /// use google_cloud_container_v1::model::VirtualNIC;
3171    /// let x = NodeConfig::new().set_or_clear_gvnic(Some(VirtualNIC::default()/* use setters */));
3172    /// let x = NodeConfig::new().set_or_clear_gvnic(None::<VirtualNIC>);
3173    /// ```
3174    pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
3175    where
3176        T: std::convert::Into<crate::model::VirtualNIC>,
3177    {
3178        self.gvnic = v.map(|x| x.into());
3179        self
3180    }
3181
3182    /// Sets the value of [spot][crate::model::NodeConfig::spot].
3183    ///
3184    /// # Example
3185    /// ```ignore,no_run
3186    /// # use google_cloud_container_v1::model::NodeConfig;
3187    /// let x = NodeConfig::new().set_spot(true);
3188    /// ```
3189    pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3190        self.spot = v.into();
3191        self
3192    }
3193
3194    /// Sets the value of [confidential_nodes][crate::model::NodeConfig::confidential_nodes].
3195    ///
3196    /// # Example
3197    /// ```ignore,no_run
3198    /// # use google_cloud_container_v1::model::NodeConfig;
3199    /// use google_cloud_container_v1::model::ConfidentialNodes;
3200    /// let x = NodeConfig::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
3201    /// ```
3202    pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
3203    where
3204        T: std::convert::Into<crate::model::ConfidentialNodes>,
3205    {
3206        self.confidential_nodes = std::option::Option::Some(v.into());
3207        self
3208    }
3209
3210    /// Sets or clears the value of [confidential_nodes][crate::model::NodeConfig::confidential_nodes].
3211    ///
3212    /// # Example
3213    /// ```ignore,no_run
3214    /// # use google_cloud_container_v1::model::NodeConfig;
3215    /// use google_cloud_container_v1::model::ConfidentialNodes;
3216    /// let x = NodeConfig::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
3217    /// let x = NodeConfig::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
3218    /// ```
3219    pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
3220    where
3221        T: std::convert::Into<crate::model::ConfidentialNodes>,
3222    {
3223        self.confidential_nodes = v.map(|x| x.into());
3224        self
3225    }
3226
3227    /// Sets the value of [fast_socket][crate::model::NodeConfig::fast_socket].
3228    ///
3229    /// # Example
3230    /// ```ignore,no_run
3231    /// # use google_cloud_container_v1::model::NodeConfig;
3232    /// use google_cloud_container_v1::model::FastSocket;
3233    /// let x = NodeConfig::new().set_fast_socket(FastSocket::default()/* use setters */);
3234    /// ```
3235    pub fn set_fast_socket<T>(mut self, v: T) -> Self
3236    where
3237        T: std::convert::Into<crate::model::FastSocket>,
3238    {
3239        self.fast_socket = std::option::Option::Some(v.into());
3240        self
3241    }
3242
3243    /// Sets or clears the value of [fast_socket][crate::model::NodeConfig::fast_socket].
3244    ///
3245    /// # Example
3246    /// ```ignore,no_run
3247    /// # use google_cloud_container_v1::model::NodeConfig;
3248    /// use google_cloud_container_v1::model::FastSocket;
3249    /// let x = NodeConfig::new().set_or_clear_fast_socket(Some(FastSocket::default()/* use setters */));
3250    /// let x = NodeConfig::new().set_or_clear_fast_socket(None::<FastSocket>);
3251    /// ```
3252    pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
3253    where
3254        T: std::convert::Into<crate::model::FastSocket>,
3255    {
3256        self.fast_socket = v.map(|x| x.into());
3257        self
3258    }
3259
3260    /// Sets the value of [resource_labels][crate::model::NodeConfig::resource_labels].
3261    ///
3262    /// # Example
3263    /// ```ignore,no_run
3264    /// # use google_cloud_container_v1::model::NodeConfig;
3265    /// let x = NodeConfig::new().set_resource_labels([
3266    ///     ("key0", "abc"),
3267    ///     ("key1", "xyz"),
3268    /// ]);
3269    /// ```
3270    pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
3271    where
3272        T: std::iter::IntoIterator<Item = (K, V)>,
3273        K: std::convert::Into<std::string::String>,
3274        V: std::convert::Into<std::string::String>,
3275    {
3276        use std::iter::Iterator;
3277        self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3278        self
3279    }
3280
3281    /// Sets the value of [logging_config][crate::model::NodeConfig::logging_config].
3282    ///
3283    /// # Example
3284    /// ```ignore,no_run
3285    /// # use google_cloud_container_v1::model::NodeConfig;
3286    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
3287    /// let x = NodeConfig::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
3288    /// ```
3289    pub fn set_logging_config<T>(mut self, v: T) -> Self
3290    where
3291        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
3292    {
3293        self.logging_config = std::option::Option::Some(v.into());
3294        self
3295    }
3296
3297    /// Sets or clears the value of [logging_config][crate::model::NodeConfig::logging_config].
3298    ///
3299    /// # Example
3300    /// ```ignore,no_run
3301    /// # use google_cloud_container_v1::model::NodeConfig;
3302    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
3303    /// let x = NodeConfig::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
3304    /// let x = NodeConfig::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
3305    /// ```
3306    pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
3307    where
3308        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
3309    {
3310        self.logging_config = v.map(|x| x.into());
3311        self
3312    }
3313
3314    /// Sets the value of [windows_node_config][crate::model::NodeConfig::windows_node_config].
3315    ///
3316    /// # Example
3317    /// ```ignore,no_run
3318    /// # use google_cloud_container_v1::model::NodeConfig;
3319    /// use google_cloud_container_v1::model::WindowsNodeConfig;
3320    /// let x = NodeConfig::new().set_windows_node_config(WindowsNodeConfig::default()/* use setters */);
3321    /// ```
3322    pub fn set_windows_node_config<T>(mut self, v: T) -> Self
3323    where
3324        T: std::convert::Into<crate::model::WindowsNodeConfig>,
3325    {
3326        self.windows_node_config = std::option::Option::Some(v.into());
3327        self
3328    }
3329
3330    /// Sets or clears the value of [windows_node_config][crate::model::NodeConfig::windows_node_config].
3331    ///
3332    /// # Example
3333    /// ```ignore,no_run
3334    /// # use google_cloud_container_v1::model::NodeConfig;
3335    /// use google_cloud_container_v1::model::WindowsNodeConfig;
3336    /// let x = NodeConfig::new().set_or_clear_windows_node_config(Some(WindowsNodeConfig::default()/* use setters */));
3337    /// let x = NodeConfig::new().set_or_clear_windows_node_config(None::<WindowsNodeConfig>);
3338    /// ```
3339    pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
3340    where
3341        T: std::convert::Into<crate::model::WindowsNodeConfig>,
3342    {
3343        self.windows_node_config = v.map(|x| x.into());
3344        self
3345    }
3346
3347    /// Sets the value of [local_nvme_ssd_block_config][crate::model::NodeConfig::local_nvme_ssd_block_config].
3348    ///
3349    /// # Example
3350    /// ```ignore,no_run
3351    /// # use google_cloud_container_v1::model::NodeConfig;
3352    /// use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
3353    /// let x = NodeConfig::new().set_local_nvme_ssd_block_config(LocalNvmeSsdBlockConfig::default()/* use setters */);
3354    /// ```
3355    pub fn set_local_nvme_ssd_block_config<T>(mut self, v: T) -> Self
3356    where
3357        T: std::convert::Into<crate::model::LocalNvmeSsdBlockConfig>,
3358    {
3359        self.local_nvme_ssd_block_config = std::option::Option::Some(v.into());
3360        self
3361    }
3362
3363    /// Sets or clears the value of [local_nvme_ssd_block_config][crate::model::NodeConfig::local_nvme_ssd_block_config].
3364    ///
3365    /// # Example
3366    /// ```ignore,no_run
3367    /// # use google_cloud_container_v1::model::NodeConfig;
3368    /// use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
3369    /// let x = NodeConfig::new().set_or_clear_local_nvme_ssd_block_config(Some(LocalNvmeSsdBlockConfig::default()/* use setters */));
3370    /// let x = NodeConfig::new().set_or_clear_local_nvme_ssd_block_config(None::<LocalNvmeSsdBlockConfig>);
3371    /// ```
3372    pub fn set_or_clear_local_nvme_ssd_block_config<T>(mut self, v: std::option::Option<T>) -> Self
3373    where
3374        T: std::convert::Into<crate::model::LocalNvmeSsdBlockConfig>,
3375    {
3376        self.local_nvme_ssd_block_config = v.map(|x| x.into());
3377        self
3378    }
3379
3380    /// Sets the value of [ephemeral_storage_local_ssd_config][crate::model::NodeConfig::ephemeral_storage_local_ssd_config].
3381    ///
3382    /// # Example
3383    /// ```ignore,no_run
3384    /// # use google_cloud_container_v1::model::NodeConfig;
3385    /// use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
3386    /// let x = NodeConfig::new().set_ephemeral_storage_local_ssd_config(EphemeralStorageLocalSsdConfig::default()/* use setters */);
3387    /// ```
3388    pub fn set_ephemeral_storage_local_ssd_config<T>(mut self, v: T) -> Self
3389    where
3390        T: std::convert::Into<crate::model::EphemeralStorageLocalSsdConfig>,
3391    {
3392        self.ephemeral_storage_local_ssd_config = std::option::Option::Some(v.into());
3393        self
3394    }
3395
3396    /// Sets or clears the value of [ephemeral_storage_local_ssd_config][crate::model::NodeConfig::ephemeral_storage_local_ssd_config].
3397    ///
3398    /// # Example
3399    /// ```ignore,no_run
3400    /// # use google_cloud_container_v1::model::NodeConfig;
3401    /// use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
3402    /// let x = NodeConfig::new().set_or_clear_ephemeral_storage_local_ssd_config(Some(EphemeralStorageLocalSsdConfig::default()/* use setters */));
3403    /// let x = NodeConfig::new().set_or_clear_ephemeral_storage_local_ssd_config(None::<EphemeralStorageLocalSsdConfig>);
3404    /// ```
3405    pub fn set_or_clear_ephemeral_storage_local_ssd_config<T>(
3406        mut self,
3407        v: std::option::Option<T>,
3408    ) -> Self
3409    where
3410        T: std::convert::Into<crate::model::EphemeralStorageLocalSsdConfig>,
3411    {
3412        self.ephemeral_storage_local_ssd_config = v.map(|x| x.into());
3413        self
3414    }
3415
3416    /// Sets the value of [sole_tenant_config][crate::model::NodeConfig::sole_tenant_config].
3417    ///
3418    /// # Example
3419    /// ```ignore,no_run
3420    /// # use google_cloud_container_v1::model::NodeConfig;
3421    /// use google_cloud_container_v1::model::SoleTenantConfig;
3422    /// let x = NodeConfig::new().set_sole_tenant_config(SoleTenantConfig::default()/* use setters */);
3423    /// ```
3424    pub fn set_sole_tenant_config<T>(mut self, v: T) -> Self
3425    where
3426        T: std::convert::Into<crate::model::SoleTenantConfig>,
3427    {
3428        self.sole_tenant_config = std::option::Option::Some(v.into());
3429        self
3430    }
3431
3432    /// Sets or clears the value of [sole_tenant_config][crate::model::NodeConfig::sole_tenant_config].
3433    ///
3434    /// # Example
3435    /// ```ignore,no_run
3436    /// # use google_cloud_container_v1::model::NodeConfig;
3437    /// use google_cloud_container_v1::model::SoleTenantConfig;
3438    /// let x = NodeConfig::new().set_or_clear_sole_tenant_config(Some(SoleTenantConfig::default()/* use setters */));
3439    /// let x = NodeConfig::new().set_or_clear_sole_tenant_config(None::<SoleTenantConfig>);
3440    /// ```
3441    pub fn set_or_clear_sole_tenant_config<T>(mut self, v: std::option::Option<T>) -> Self
3442    where
3443        T: std::convert::Into<crate::model::SoleTenantConfig>,
3444    {
3445        self.sole_tenant_config = v.map(|x| x.into());
3446        self
3447    }
3448
3449    /// Sets the value of [containerd_config][crate::model::NodeConfig::containerd_config].
3450    ///
3451    /// # Example
3452    /// ```ignore,no_run
3453    /// # use google_cloud_container_v1::model::NodeConfig;
3454    /// use google_cloud_container_v1::model::ContainerdConfig;
3455    /// let x = NodeConfig::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
3456    /// ```
3457    pub fn set_containerd_config<T>(mut self, v: T) -> Self
3458    where
3459        T: std::convert::Into<crate::model::ContainerdConfig>,
3460    {
3461        self.containerd_config = std::option::Option::Some(v.into());
3462        self
3463    }
3464
3465    /// Sets or clears the value of [containerd_config][crate::model::NodeConfig::containerd_config].
3466    ///
3467    /// # Example
3468    /// ```ignore,no_run
3469    /// # use google_cloud_container_v1::model::NodeConfig;
3470    /// use google_cloud_container_v1::model::ContainerdConfig;
3471    /// let x = NodeConfig::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
3472    /// let x = NodeConfig::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
3473    /// ```
3474    pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
3475    where
3476        T: std::convert::Into<crate::model::ContainerdConfig>,
3477    {
3478        self.containerd_config = v.map(|x| x.into());
3479        self
3480    }
3481
3482    /// Sets the value of [resource_manager_tags][crate::model::NodeConfig::resource_manager_tags].
3483    ///
3484    /// # Example
3485    /// ```ignore,no_run
3486    /// # use google_cloud_container_v1::model::NodeConfig;
3487    /// use google_cloud_container_v1::model::ResourceManagerTags;
3488    /// let x = NodeConfig::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
3489    /// ```
3490    pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
3491    where
3492        T: std::convert::Into<crate::model::ResourceManagerTags>,
3493    {
3494        self.resource_manager_tags = std::option::Option::Some(v.into());
3495        self
3496    }
3497
3498    /// Sets or clears the value of [resource_manager_tags][crate::model::NodeConfig::resource_manager_tags].
3499    ///
3500    /// # Example
3501    /// ```ignore,no_run
3502    /// # use google_cloud_container_v1::model::NodeConfig;
3503    /// use google_cloud_container_v1::model::ResourceManagerTags;
3504    /// let x = NodeConfig::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
3505    /// let x = NodeConfig::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
3506    /// ```
3507    pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
3508    where
3509        T: std::convert::Into<crate::model::ResourceManagerTags>,
3510    {
3511        self.resource_manager_tags = v.map(|x| x.into());
3512        self
3513    }
3514
3515    /// Sets the value of [enable_confidential_storage][crate::model::NodeConfig::enable_confidential_storage].
3516    ///
3517    /// # Example
3518    /// ```ignore,no_run
3519    /// # use google_cloud_container_v1::model::NodeConfig;
3520    /// let x = NodeConfig::new().set_enable_confidential_storage(true);
3521    /// ```
3522    pub fn set_enable_confidential_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3523        self.enable_confidential_storage = v.into();
3524        self
3525    }
3526
3527    /// Sets the value of [secondary_boot_disks][crate::model::NodeConfig::secondary_boot_disks].
3528    ///
3529    /// # Example
3530    /// ```ignore,no_run
3531    /// # use google_cloud_container_v1::model::NodeConfig;
3532    /// use google_cloud_container_v1::model::SecondaryBootDisk;
3533    /// let x = NodeConfig::new()
3534    ///     .set_secondary_boot_disks([
3535    ///         SecondaryBootDisk::default()/* use setters */,
3536    ///         SecondaryBootDisk::default()/* use (different) setters */,
3537    ///     ]);
3538    /// ```
3539    pub fn set_secondary_boot_disks<T, V>(mut self, v: T) -> Self
3540    where
3541        T: std::iter::IntoIterator<Item = V>,
3542        V: std::convert::Into<crate::model::SecondaryBootDisk>,
3543    {
3544        use std::iter::Iterator;
3545        self.secondary_boot_disks = v.into_iter().map(|i| i.into()).collect();
3546        self
3547    }
3548
3549    /// Sets the value of [storage_pools][crate::model::NodeConfig::storage_pools].
3550    ///
3551    /// # Example
3552    /// ```ignore,no_run
3553    /// # use google_cloud_container_v1::model::NodeConfig;
3554    /// let x = NodeConfig::new().set_storage_pools(["a", "b", "c"]);
3555    /// ```
3556    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
3557    where
3558        T: std::iter::IntoIterator<Item = V>,
3559        V: std::convert::Into<std::string::String>,
3560    {
3561        use std::iter::Iterator;
3562        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
3563        self
3564    }
3565
3566    /// Sets the value of [secondary_boot_disk_update_strategy][crate::model::NodeConfig::secondary_boot_disk_update_strategy].
3567    ///
3568    /// # Example
3569    /// ```ignore,no_run
3570    /// # use google_cloud_container_v1::model::NodeConfig;
3571    /// use google_cloud_container_v1::model::SecondaryBootDiskUpdateStrategy;
3572    /// let x = NodeConfig::new().set_secondary_boot_disk_update_strategy(SecondaryBootDiskUpdateStrategy::default()/* use setters */);
3573    /// ```
3574    pub fn set_secondary_boot_disk_update_strategy<T>(mut self, v: T) -> Self
3575    where
3576        T: std::convert::Into<crate::model::SecondaryBootDiskUpdateStrategy>,
3577    {
3578        self.secondary_boot_disk_update_strategy = std::option::Option::Some(v.into());
3579        self
3580    }
3581
3582    /// Sets or clears the value of [secondary_boot_disk_update_strategy][crate::model::NodeConfig::secondary_boot_disk_update_strategy].
3583    ///
3584    /// # Example
3585    /// ```ignore,no_run
3586    /// # use google_cloud_container_v1::model::NodeConfig;
3587    /// use google_cloud_container_v1::model::SecondaryBootDiskUpdateStrategy;
3588    /// let x = NodeConfig::new().set_or_clear_secondary_boot_disk_update_strategy(Some(SecondaryBootDiskUpdateStrategy::default()/* use setters */));
3589    /// let x = NodeConfig::new().set_or_clear_secondary_boot_disk_update_strategy(None::<SecondaryBootDiskUpdateStrategy>);
3590    /// ```
3591    pub fn set_or_clear_secondary_boot_disk_update_strategy<T>(
3592        mut self,
3593        v: std::option::Option<T>,
3594    ) -> Self
3595    where
3596        T: std::convert::Into<crate::model::SecondaryBootDiskUpdateStrategy>,
3597    {
3598        self.secondary_boot_disk_update_strategy = v.map(|x| x.into());
3599        self
3600    }
3601
3602    /// Sets the value of [max_run_duration][crate::model::NodeConfig::max_run_duration].
3603    ///
3604    /// # Example
3605    /// ```ignore,no_run
3606    /// # use google_cloud_container_v1::model::NodeConfig;
3607    /// use wkt::Duration;
3608    /// let x = NodeConfig::new().set_max_run_duration(Duration::default()/* use setters */);
3609    /// ```
3610    pub fn set_max_run_duration<T>(mut self, v: T) -> Self
3611    where
3612        T: std::convert::Into<wkt::Duration>,
3613    {
3614        self.max_run_duration = std::option::Option::Some(v.into());
3615        self
3616    }
3617
3618    /// Sets or clears the value of [max_run_duration][crate::model::NodeConfig::max_run_duration].
3619    ///
3620    /// # Example
3621    /// ```ignore,no_run
3622    /// # use google_cloud_container_v1::model::NodeConfig;
3623    /// use wkt::Duration;
3624    /// let x = NodeConfig::new().set_or_clear_max_run_duration(Some(Duration::default()/* use setters */));
3625    /// let x = NodeConfig::new().set_or_clear_max_run_duration(None::<Duration>);
3626    /// ```
3627    pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
3628    where
3629        T: std::convert::Into<wkt::Duration>,
3630    {
3631        self.max_run_duration = v.map(|x| x.into());
3632        self
3633    }
3634
3635    /// Sets the value of [local_ssd_encryption_mode][crate::model::NodeConfig::local_ssd_encryption_mode].
3636    ///
3637    /// # Example
3638    /// ```ignore,no_run
3639    /// # use google_cloud_container_v1::model::NodeConfig;
3640    /// use google_cloud_container_v1::model::node_config::LocalSsdEncryptionMode;
3641    /// let x0 = NodeConfig::new().set_local_ssd_encryption_mode(LocalSsdEncryptionMode::StandardEncryption);
3642    /// let x1 = NodeConfig::new().set_local_ssd_encryption_mode(LocalSsdEncryptionMode::EphemeralKeyEncryption);
3643    /// ```
3644    pub fn set_local_ssd_encryption_mode<T>(mut self, v: T) -> Self
3645    where
3646        T: std::convert::Into<crate::model::node_config::LocalSsdEncryptionMode>,
3647    {
3648        self.local_ssd_encryption_mode = std::option::Option::Some(v.into());
3649        self
3650    }
3651
3652    /// Sets or clears the value of [local_ssd_encryption_mode][crate::model::NodeConfig::local_ssd_encryption_mode].
3653    ///
3654    /// # Example
3655    /// ```ignore,no_run
3656    /// # use google_cloud_container_v1::model::NodeConfig;
3657    /// use google_cloud_container_v1::model::node_config::LocalSsdEncryptionMode;
3658    /// let x0 = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(Some(LocalSsdEncryptionMode::StandardEncryption));
3659    /// let x1 = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(Some(LocalSsdEncryptionMode::EphemeralKeyEncryption));
3660    /// let x_none = NodeConfig::new().set_or_clear_local_ssd_encryption_mode(None::<LocalSsdEncryptionMode>);
3661    /// ```
3662    pub fn set_or_clear_local_ssd_encryption_mode<T>(mut self, v: std::option::Option<T>) -> Self
3663    where
3664        T: std::convert::Into<crate::model::node_config::LocalSsdEncryptionMode>,
3665    {
3666        self.local_ssd_encryption_mode = v.map(|x| x.into());
3667        self
3668    }
3669
3670    /// Sets the value of [effective_cgroup_mode][crate::model::NodeConfig::effective_cgroup_mode].
3671    ///
3672    /// # Example
3673    /// ```ignore,no_run
3674    /// # use google_cloud_container_v1::model::NodeConfig;
3675    /// use google_cloud_container_v1::model::node_config::EffectiveCgroupMode;
3676    /// let x0 = NodeConfig::new().set_effective_cgroup_mode(EffectiveCgroupMode::V1);
3677    /// let x1 = NodeConfig::new().set_effective_cgroup_mode(EffectiveCgroupMode::V2);
3678    /// ```
3679    pub fn set_effective_cgroup_mode<
3680        T: std::convert::Into<crate::model::node_config::EffectiveCgroupMode>,
3681    >(
3682        mut self,
3683        v: T,
3684    ) -> Self {
3685        self.effective_cgroup_mode = v.into();
3686        self
3687    }
3688
3689    /// Sets the value of [flex_start][crate::model::NodeConfig::flex_start].
3690    ///
3691    /// # Example
3692    /// ```ignore,no_run
3693    /// # use google_cloud_container_v1::model::NodeConfig;
3694    /// let x = NodeConfig::new().set_flex_start(true);
3695    /// ```
3696    pub fn set_flex_start<T>(mut self, v: T) -> Self
3697    where
3698        T: std::convert::Into<bool>,
3699    {
3700        self.flex_start = std::option::Option::Some(v.into());
3701        self
3702    }
3703
3704    /// Sets or clears the value of [flex_start][crate::model::NodeConfig::flex_start].
3705    ///
3706    /// # Example
3707    /// ```ignore,no_run
3708    /// # use google_cloud_container_v1::model::NodeConfig;
3709    /// let x = NodeConfig::new().set_or_clear_flex_start(Some(false));
3710    /// let x = NodeConfig::new().set_or_clear_flex_start(None::<bool>);
3711    /// ```
3712    pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
3713    where
3714        T: std::convert::Into<bool>,
3715    {
3716        self.flex_start = v.map(|x| x.into());
3717        self
3718    }
3719
3720    /// Sets the value of [boot_disk][crate::model::NodeConfig::boot_disk].
3721    ///
3722    /// # Example
3723    /// ```ignore,no_run
3724    /// # use google_cloud_container_v1::model::NodeConfig;
3725    /// use google_cloud_container_v1::model::BootDisk;
3726    /// let x = NodeConfig::new().set_boot_disk(BootDisk::default()/* use setters */);
3727    /// ```
3728    pub fn set_boot_disk<T>(mut self, v: T) -> Self
3729    where
3730        T: std::convert::Into<crate::model::BootDisk>,
3731    {
3732        self.boot_disk = std::option::Option::Some(v.into());
3733        self
3734    }
3735
3736    /// Sets or clears the value of [boot_disk][crate::model::NodeConfig::boot_disk].
3737    ///
3738    /// # Example
3739    /// ```ignore,no_run
3740    /// # use google_cloud_container_v1::model::NodeConfig;
3741    /// use google_cloud_container_v1::model::BootDisk;
3742    /// let x = NodeConfig::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
3743    /// let x = NodeConfig::new().set_or_clear_boot_disk(None::<BootDisk>);
3744    /// ```
3745    pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
3746    where
3747        T: std::convert::Into<crate::model::BootDisk>,
3748    {
3749        self.boot_disk = v.map(|x| x.into());
3750        self
3751    }
3752}
3753
3754impl wkt::message::Message for NodeConfig {
3755    fn typename() -> &'static str {
3756        "type.googleapis.com/google.container.v1.NodeConfig"
3757    }
3758}
3759
3760/// Defines additional types related to [NodeConfig].
3761pub mod node_config {
3762    #[allow(unused_imports)]
3763    use super::*;
3764
3765    /// LocalSsdEncryptionMode specifies the method used for encrypting the Local
3766    /// SSDs attached to the node.
3767    ///
3768    /// # Working with unknown values
3769    ///
3770    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3771    /// additional enum variants at any time. Adding new variants is not considered
3772    /// a breaking change. Applications should write their code in anticipation of:
3773    ///
3774    /// - New values appearing in future releases of the client library, **and**
3775    /// - New values received dynamically, without application changes.
3776    ///
3777    /// Please consult the [Working with enums] section in the user guide for some
3778    /// guidelines.
3779    ///
3780    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3781    #[derive(Clone, Debug, PartialEq)]
3782    #[non_exhaustive]
3783    pub enum LocalSsdEncryptionMode {
3784        /// The given node will be encrypted using keys managed by Google
3785        /// infrastructure and the keys will be deleted when the node is
3786        /// deleted.
3787        Unspecified,
3788        /// The given node will be encrypted using keys managed by Google
3789        /// infrastructure and the keys will be deleted when the node is
3790        /// deleted.
3791        StandardEncryption,
3792        /// The given node will opt-in for using ephemeral key for
3793        /// encryption of Local SSDs.
3794        /// The Local SSDs will not be able to recover data in case of node
3795        /// crash.
3796        EphemeralKeyEncryption,
3797        /// If set, the enum was initialized with an unknown value.
3798        ///
3799        /// Applications can examine the value using [LocalSsdEncryptionMode::value] or
3800        /// [LocalSsdEncryptionMode::name].
3801        UnknownValue(local_ssd_encryption_mode::UnknownValue),
3802    }
3803
3804    #[doc(hidden)]
3805    pub mod local_ssd_encryption_mode {
3806        #[allow(unused_imports)]
3807        use super::*;
3808        #[derive(Clone, Debug, PartialEq)]
3809        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3810    }
3811
3812    impl LocalSsdEncryptionMode {
3813        /// Gets the enum value.
3814        ///
3815        /// Returns `None` if the enum contains an unknown value deserialized from
3816        /// the string representation of enums.
3817        pub fn value(&self) -> std::option::Option<i32> {
3818            match self {
3819                Self::Unspecified => std::option::Option::Some(0),
3820                Self::StandardEncryption => std::option::Option::Some(1),
3821                Self::EphemeralKeyEncryption => std::option::Option::Some(2),
3822                Self::UnknownValue(u) => u.0.value(),
3823            }
3824        }
3825
3826        /// Gets the enum value as a string.
3827        ///
3828        /// Returns `None` if the enum contains an unknown value deserialized from
3829        /// the integer representation of enums.
3830        pub fn name(&self) -> std::option::Option<&str> {
3831            match self {
3832                Self::Unspecified => {
3833                    std::option::Option::Some("LOCAL_SSD_ENCRYPTION_MODE_UNSPECIFIED")
3834                }
3835                Self::StandardEncryption => std::option::Option::Some("STANDARD_ENCRYPTION"),
3836                Self::EphemeralKeyEncryption => {
3837                    std::option::Option::Some("EPHEMERAL_KEY_ENCRYPTION")
3838                }
3839                Self::UnknownValue(u) => u.0.name(),
3840            }
3841        }
3842    }
3843
3844    impl std::default::Default for LocalSsdEncryptionMode {
3845        fn default() -> Self {
3846            use std::convert::From;
3847            Self::from(0)
3848        }
3849    }
3850
3851    impl std::fmt::Display for LocalSsdEncryptionMode {
3852        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3853            wkt::internal::display_enum(f, self.name(), self.value())
3854        }
3855    }
3856
3857    impl std::convert::From<i32> for LocalSsdEncryptionMode {
3858        fn from(value: i32) -> Self {
3859            match value {
3860                0 => Self::Unspecified,
3861                1 => Self::StandardEncryption,
3862                2 => Self::EphemeralKeyEncryption,
3863                _ => Self::UnknownValue(local_ssd_encryption_mode::UnknownValue(
3864                    wkt::internal::UnknownEnumValue::Integer(value),
3865                )),
3866            }
3867        }
3868    }
3869
3870    impl std::convert::From<&str> for LocalSsdEncryptionMode {
3871        fn from(value: &str) -> Self {
3872            use std::string::ToString;
3873            match value {
3874                "LOCAL_SSD_ENCRYPTION_MODE_UNSPECIFIED" => Self::Unspecified,
3875                "STANDARD_ENCRYPTION" => Self::StandardEncryption,
3876                "EPHEMERAL_KEY_ENCRYPTION" => Self::EphemeralKeyEncryption,
3877                _ => Self::UnknownValue(local_ssd_encryption_mode::UnknownValue(
3878                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3879                )),
3880            }
3881        }
3882    }
3883
3884    impl serde::ser::Serialize for LocalSsdEncryptionMode {
3885        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3886        where
3887            S: serde::Serializer,
3888        {
3889            match self {
3890                Self::Unspecified => serializer.serialize_i32(0),
3891                Self::StandardEncryption => serializer.serialize_i32(1),
3892                Self::EphemeralKeyEncryption => serializer.serialize_i32(2),
3893                Self::UnknownValue(u) => u.0.serialize(serializer),
3894            }
3895        }
3896    }
3897
3898    impl<'de> serde::de::Deserialize<'de> for LocalSsdEncryptionMode {
3899        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3900        where
3901            D: serde::Deserializer<'de>,
3902        {
3903            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocalSsdEncryptionMode>::new(
3904                ".google.container.v1.NodeConfig.LocalSsdEncryptionMode",
3905            ))
3906        }
3907    }
3908
3909    /// Possible effective cgroup modes for the node.
3910    ///
3911    /// # Working with unknown values
3912    ///
3913    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3914    /// additional enum variants at any time. Adding new variants is not considered
3915    /// a breaking change. Applications should write their code in anticipation of:
3916    ///
3917    /// - New values appearing in future releases of the client library, **and**
3918    /// - New values received dynamically, without application changes.
3919    ///
3920    /// Please consult the [Working with enums] section in the user guide for some
3921    /// guidelines.
3922    ///
3923    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3924    #[derive(Clone, Debug, PartialEq)]
3925    #[non_exhaustive]
3926    pub enum EffectiveCgroupMode {
3927        /// EFFECTIVE_CGROUP_MODE_UNSPECIFIED means the cgroup configuration for the
3928        /// node pool is unspecified, i.e. the node pool is a Windows node pool.
3929        Unspecified,
3930        /// CGROUP_MODE_V1 means the node pool is configured to use cgroupv1 for the
3931        /// cgroup configuration.
3932        V1,
3933        /// CGROUP_MODE_V2 means the node pool is configured to use cgroupv2 for the
3934        /// cgroup configuration.
3935        V2,
3936        /// If set, the enum was initialized with an unknown value.
3937        ///
3938        /// Applications can examine the value using [EffectiveCgroupMode::value] or
3939        /// [EffectiveCgroupMode::name].
3940        UnknownValue(effective_cgroup_mode::UnknownValue),
3941    }
3942
3943    #[doc(hidden)]
3944    pub mod effective_cgroup_mode {
3945        #[allow(unused_imports)]
3946        use super::*;
3947        #[derive(Clone, Debug, PartialEq)]
3948        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3949    }
3950
3951    impl EffectiveCgroupMode {
3952        /// Gets the enum value.
3953        ///
3954        /// Returns `None` if the enum contains an unknown value deserialized from
3955        /// the string representation of enums.
3956        pub fn value(&self) -> std::option::Option<i32> {
3957            match self {
3958                Self::Unspecified => std::option::Option::Some(0),
3959                Self::V1 => std::option::Option::Some(1),
3960                Self::V2 => std::option::Option::Some(2),
3961                Self::UnknownValue(u) => u.0.value(),
3962            }
3963        }
3964
3965        /// Gets the enum value as a string.
3966        ///
3967        /// Returns `None` if the enum contains an unknown value deserialized from
3968        /// the integer representation of enums.
3969        pub fn name(&self) -> std::option::Option<&str> {
3970            match self {
3971                Self::Unspecified => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_UNSPECIFIED"),
3972                Self::V1 => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_V1"),
3973                Self::V2 => std::option::Option::Some("EFFECTIVE_CGROUP_MODE_V2"),
3974                Self::UnknownValue(u) => u.0.name(),
3975            }
3976        }
3977    }
3978
3979    impl std::default::Default for EffectiveCgroupMode {
3980        fn default() -> Self {
3981            use std::convert::From;
3982            Self::from(0)
3983        }
3984    }
3985
3986    impl std::fmt::Display for EffectiveCgroupMode {
3987        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3988            wkt::internal::display_enum(f, self.name(), self.value())
3989        }
3990    }
3991
3992    impl std::convert::From<i32> for EffectiveCgroupMode {
3993        fn from(value: i32) -> Self {
3994            match value {
3995                0 => Self::Unspecified,
3996                1 => Self::V1,
3997                2 => Self::V2,
3998                _ => Self::UnknownValue(effective_cgroup_mode::UnknownValue(
3999                    wkt::internal::UnknownEnumValue::Integer(value),
4000                )),
4001            }
4002        }
4003    }
4004
4005    impl std::convert::From<&str> for EffectiveCgroupMode {
4006        fn from(value: &str) -> Self {
4007            use std::string::ToString;
4008            match value {
4009                "EFFECTIVE_CGROUP_MODE_UNSPECIFIED" => Self::Unspecified,
4010                "EFFECTIVE_CGROUP_MODE_V1" => Self::V1,
4011                "EFFECTIVE_CGROUP_MODE_V2" => Self::V2,
4012                _ => Self::UnknownValue(effective_cgroup_mode::UnknownValue(
4013                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4014                )),
4015            }
4016        }
4017    }
4018
4019    impl serde::ser::Serialize for EffectiveCgroupMode {
4020        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4021        where
4022            S: serde::Serializer,
4023        {
4024            match self {
4025                Self::Unspecified => serializer.serialize_i32(0),
4026                Self::V1 => serializer.serialize_i32(1),
4027                Self::V2 => serializer.serialize_i32(2),
4028                Self::UnknownValue(u) => u.0.serialize(serializer),
4029            }
4030        }
4031    }
4032
4033    impl<'de> serde::de::Deserialize<'de> for EffectiveCgroupMode {
4034        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4035        where
4036            D: serde::Deserializer<'de>,
4037        {
4038            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveCgroupMode>::new(
4039                ".google.container.v1.NodeConfig.EffectiveCgroupMode",
4040            ))
4041        }
4042    }
4043}
4044
4045/// Specifies options for controlling advanced machine features.
4046#[derive(Clone, Default, PartialEq)]
4047#[non_exhaustive]
4048pub struct AdvancedMachineFeatures {
4049    /// The number of threads per physical core. To disable simultaneous
4050    /// multithreading (SMT) set this to 1. If unset, the maximum number of threads
4051    /// supported per core by the underlying processor is assumed.
4052    pub threads_per_core: std::option::Option<i64>,
4053
4054    /// Whether or not to enable nested virtualization (defaults to false).
4055    pub enable_nested_virtualization: std::option::Option<bool>,
4056
4057    /// Type of Performance Monitoring Unit (PMU) requested on node pool instances.
4058    /// If unset, PMU will not be available to the node.
4059    pub performance_monitoring_unit:
4060        std::option::Option<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
4061
4062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4063}
4064
4065impl AdvancedMachineFeatures {
4066    pub fn new() -> Self {
4067        std::default::Default::default()
4068    }
4069
4070    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
4071    ///
4072    /// # Example
4073    /// ```ignore,no_run
4074    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4075    /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
4076    /// ```
4077    pub fn set_threads_per_core<T>(mut self, v: T) -> Self
4078    where
4079        T: std::convert::Into<i64>,
4080    {
4081        self.threads_per_core = std::option::Option::Some(v.into());
4082        self
4083    }
4084
4085    /// Sets or clears the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
4086    ///
4087    /// # Example
4088    /// ```ignore,no_run
4089    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4090    /// let x = AdvancedMachineFeatures::new().set_or_clear_threads_per_core(Some(42));
4091    /// let x = AdvancedMachineFeatures::new().set_or_clear_threads_per_core(None::<i32>);
4092    /// ```
4093    pub fn set_or_clear_threads_per_core<T>(mut self, v: std::option::Option<T>) -> Self
4094    where
4095        T: std::convert::Into<i64>,
4096    {
4097        self.threads_per_core = v.map(|x| x.into());
4098        self
4099    }
4100
4101    /// Sets the value of [enable_nested_virtualization][crate::model::AdvancedMachineFeatures::enable_nested_virtualization].
4102    ///
4103    /// # Example
4104    /// ```ignore,no_run
4105    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4106    /// let x = AdvancedMachineFeatures::new().set_enable_nested_virtualization(true);
4107    /// ```
4108    pub fn set_enable_nested_virtualization<T>(mut self, v: T) -> Self
4109    where
4110        T: std::convert::Into<bool>,
4111    {
4112        self.enable_nested_virtualization = std::option::Option::Some(v.into());
4113        self
4114    }
4115
4116    /// Sets or clears the value of [enable_nested_virtualization][crate::model::AdvancedMachineFeatures::enable_nested_virtualization].
4117    ///
4118    /// # Example
4119    /// ```ignore,no_run
4120    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4121    /// let x = AdvancedMachineFeatures::new().set_or_clear_enable_nested_virtualization(Some(false));
4122    /// let x = AdvancedMachineFeatures::new().set_or_clear_enable_nested_virtualization(None::<bool>);
4123    /// ```
4124    pub fn set_or_clear_enable_nested_virtualization<T>(mut self, v: std::option::Option<T>) -> Self
4125    where
4126        T: std::convert::Into<bool>,
4127    {
4128        self.enable_nested_virtualization = v.map(|x| x.into());
4129        self
4130    }
4131
4132    /// Sets the value of [performance_monitoring_unit][crate::model::AdvancedMachineFeatures::performance_monitoring_unit].
4133    ///
4134    /// # Example
4135    /// ```ignore,no_run
4136    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4137    /// use google_cloud_container_v1::model::advanced_machine_features::PerformanceMonitoringUnit;
4138    /// let x0 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Architectural);
4139    /// let x1 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Standard);
4140    /// let x2 = AdvancedMachineFeatures::new().set_performance_monitoring_unit(PerformanceMonitoringUnit::Enhanced);
4141    /// ```
4142    pub fn set_performance_monitoring_unit<T>(mut self, v: T) -> Self
4143    where
4144        T: std::convert::Into<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
4145    {
4146        self.performance_monitoring_unit = std::option::Option::Some(v.into());
4147        self
4148    }
4149
4150    /// Sets or clears the value of [performance_monitoring_unit][crate::model::AdvancedMachineFeatures::performance_monitoring_unit].
4151    ///
4152    /// # Example
4153    /// ```ignore,no_run
4154    /// # use google_cloud_container_v1::model::AdvancedMachineFeatures;
4155    /// use google_cloud_container_v1::model::advanced_machine_features::PerformanceMonitoringUnit;
4156    /// let x0 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Architectural));
4157    /// let x1 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Standard));
4158    /// let x2 = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(Some(PerformanceMonitoringUnit::Enhanced));
4159    /// let x_none = AdvancedMachineFeatures::new().set_or_clear_performance_monitoring_unit(None::<PerformanceMonitoringUnit>);
4160    /// ```
4161    pub fn set_or_clear_performance_monitoring_unit<T>(mut self, v: std::option::Option<T>) -> Self
4162    where
4163        T: std::convert::Into<crate::model::advanced_machine_features::PerformanceMonitoringUnit>,
4164    {
4165        self.performance_monitoring_unit = v.map(|x| x.into());
4166        self
4167    }
4168}
4169
4170impl wkt::message::Message for AdvancedMachineFeatures {
4171    fn typename() -> &'static str {
4172        "type.googleapis.com/google.container.v1.AdvancedMachineFeatures"
4173    }
4174}
4175
4176/// Defines additional types related to [AdvancedMachineFeatures].
4177pub mod advanced_machine_features {
4178    #[allow(unused_imports)]
4179    use super::*;
4180
4181    /// Level of PMU access.
4182    ///
4183    /// # Working with unknown values
4184    ///
4185    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4186    /// additional enum variants at any time. Adding new variants is not considered
4187    /// a breaking change. Applications should write their code in anticipation of:
4188    ///
4189    /// - New values appearing in future releases of the client library, **and**
4190    /// - New values received dynamically, without application changes.
4191    ///
4192    /// Please consult the [Working with enums] section in the user guide for some
4193    /// guidelines.
4194    ///
4195    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4196    #[derive(Clone, Debug, PartialEq)]
4197    #[non_exhaustive]
4198    pub enum PerformanceMonitoringUnit {
4199        /// PMU not enabled.
4200        Unspecified,
4201        /// Architecturally defined non-LLC events.
4202        Architectural,
4203        /// Most documented core/L2 events.
4204        Standard,
4205        /// Most documented core/L2 and LLC events.
4206        Enhanced,
4207        /// If set, the enum was initialized with an unknown value.
4208        ///
4209        /// Applications can examine the value using [PerformanceMonitoringUnit::value] or
4210        /// [PerformanceMonitoringUnit::name].
4211        UnknownValue(performance_monitoring_unit::UnknownValue),
4212    }
4213
4214    #[doc(hidden)]
4215    pub mod performance_monitoring_unit {
4216        #[allow(unused_imports)]
4217        use super::*;
4218        #[derive(Clone, Debug, PartialEq)]
4219        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4220    }
4221
4222    impl PerformanceMonitoringUnit {
4223        /// Gets the enum value.
4224        ///
4225        /// Returns `None` if the enum contains an unknown value deserialized from
4226        /// the string representation of enums.
4227        pub fn value(&self) -> std::option::Option<i32> {
4228            match self {
4229                Self::Unspecified => std::option::Option::Some(0),
4230                Self::Architectural => std::option::Option::Some(1),
4231                Self::Standard => std::option::Option::Some(2),
4232                Self::Enhanced => std::option::Option::Some(3),
4233                Self::UnknownValue(u) => u.0.value(),
4234            }
4235        }
4236
4237        /// Gets the enum value as a string.
4238        ///
4239        /// Returns `None` if the enum contains an unknown value deserialized from
4240        /// the integer representation of enums.
4241        pub fn name(&self) -> std::option::Option<&str> {
4242            match self {
4243                Self::Unspecified => {
4244                    std::option::Option::Some("PERFORMANCE_MONITORING_UNIT_UNSPECIFIED")
4245                }
4246                Self::Architectural => std::option::Option::Some("ARCHITECTURAL"),
4247                Self::Standard => std::option::Option::Some("STANDARD"),
4248                Self::Enhanced => std::option::Option::Some("ENHANCED"),
4249                Self::UnknownValue(u) => u.0.name(),
4250            }
4251        }
4252    }
4253
4254    impl std::default::Default for PerformanceMonitoringUnit {
4255        fn default() -> Self {
4256            use std::convert::From;
4257            Self::from(0)
4258        }
4259    }
4260
4261    impl std::fmt::Display for PerformanceMonitoringUnit {
4262        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4263            wkt::internal::display_enum(f, self.name(), self.value())
4264        }
4265    }
4266
4267    impl std::convert::From<i32> for PerformanceMonitoringUnit {
4268        fn from(value: i32) -> Self {
4269            match value {
4270                0 => Self::Unspecified,
4271                1 => Self::Architectural,
4272                2 => Self::Standard,
4273                3 => Self::Enhanced,
4274                _ => Self::UnknownValue(performance_monitoring_unit::UnknownValue(
4275                    wkt::internal::UnknownEnumValue::Integer(value),
4276                )),
4277            }
4278        }
4279    }
4280
4281    impl std::convert::From<&str> for PerformanceMonitoringUnit {
4282        fn from(value: &str) -> Self {
4283            use std::string::ToString;
4284            match value {
4285                "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED" => Self::Unspecified,
4286                "ARCHITECTURAL" => Self::Architectural,
4287                "STANDARD" => Self::Standard,
4288                "ENHANCED" => Self::Enhanced,
4289                _ => Self::UnknownValue(performance_monitoring_unit::UnknownValue(
4290                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4291                )),
4292            }
4293        }
4294    }
4295
4296    impl serde::ser::Serialize for PerformanceMonitoringUnit {
4297        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4298        where
4299            S: serde::Serializer,
4300        {
4301            match self {
4302                Self::Unspecified => serializer.serialize_i32(0),
4303                Self::Architectural => serializer.serialize_i32(1),
4304                Self::Standard => serializer.serialize_i32(2),
4305                Self::Enhanced => serializer.serialize_i32(3),
4306                Self::UnknownValue(u) => u.0.serialize(serializer),
4307            }
4308        }
4309    }
4310
4311    impl<'de> serde::de::Deserialize<'de> for PerformanceMonitoringUnit {
4312        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4313        where
4314            D: serde::Deserializer<'de>,
4315        {
4316            deserializer.deserialize_any(
4317                wkt::internal::EnumVisitor::<PerformanceMonitoringUnit>::new(
4318                    ".google.container.v1.AdvancedMachineFeatures.PerformanceMonitoringUnit",
4319                ),
4320            )
4321        }
4322    }
4323}
4324
4325/// Parameters for node pool-level network config.
4326#[derive(Clone, Default, PartialEq)]
4327#[non_exhaustive]
4328pub struct NodeNetworkConfig {
4329    /// Input only. Whether to create a new range for pod IPs in this node pool.
4330    /// Defaults are provided for `pod_range` and `pod_ipv4_cidr_block` if they
4331    /// are not specified.
4332    ///
4333    /// If neither `create_pod_range` or `pod_range` are specified, the
4334    /// cluster-level default (`ip_allocation_policy.cluster_ipv4_cidr_block`) is
4335    /// used.
4336    ///
4337    /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
4338    ///
4339    /// This field cannot be changed after the node pool has been created.
4340    pub create_pod_range: bool,
4341
4342    /// The ID of the secondary range for pod IPs.
4343    /// If `create_pod_range` is true, this ID is used for the new range.
4344    /// If `create_pod_range` is false, uses an existing secondary range with this
4345    /// ID.
4346    ///
4347    /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
4348    ///
4349    /// This field cannot be changed after the node pool has been created.
4350    pub pod_range: std::string::String,
4351
4352    /// The IP address range for pod IPs in this node pool.
4353    ///
4354    /// Only applicable if `create_pod_range` is true.
4355    ///
4356    /// Set to blank to have a range chosen with the default size.
4357    ///
4358    /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
4359    /// netmask.
4360    ///
4361    /// Set to a
4362    /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
4363    /// notation (e.g. `10.96.0.0/14`) to pick a specific range to use.
4364    ///
4365    /// Only applicable if `ip_allocation_policy.use_ip_aliases` is true.
4366    ///
4367    /// This field cannot be changed after the node pool has been created.
4368    pub pod_ipv4_cidr_block: std::string::String,
4369
4370    /// Whether nodes have internal IP addresses only.
4371    /// If enable_private_nodes is not specified, then the value is derived from
4372    /// [Cluster.NetworkConfig.default_enable_private_nodes][]
4373    pub enable_private_nodes: std::option::Option<bool>,
4374
4375    /// Network bandwidth tier configuration.
4376    pub network_performance_config:
4377        std::option::Option<crate::model::node_network_config::NetworkPerformanceConfig>,
4378
4379    /// [PRIVATE FIELD]
4380    /// Pod CIDR size overprovisioning config for the nodepool.
4381    ///
4382    /// Pod CIDR size per node depends on max_pods_per_node. By default, the value
4383    /// of max_pods_per_node is rounded off to next power of 2 and we then double
4384    /// that to get the size of pod CIDR block per node.
4385    /// Example: max_pods_per_node of 30 would result in 64 IPs (/26).
4386    ///
4387    /// This config can disable the doubling of IPs (we still round off to next
4388    /// power of 2)
4389    /// Example: max_pods_per_node of 30 will result in 32 IPs (/27) when
4390    /// overprovisioning is disabled.
4391    pub pod_cidr_overprovision_config:
4392        std::option::Option<crate::model::PodCIDROverprovisionConfig>,
4393
4394    /// We specify the additional node networks for this node pool using this list.
4395    /// Each node network corresponds to an additional interface
4396    pub additional_node_network_configs: std::vec::Vec<crate::model::AdditionalNodeNetworkConfig>,
4397
4398    /// We specify the additional pod networks for this node pool using this list.
4399    /// Each pod network corresponds to an additional alias IP range for the node
4400    pub additional_pod_network_configs: std::vec::Vec<crate::model::AdditionalPodNetworkConfig>,
4401
4402    /// Output only. The utilization of the IPv4 range for the pod.
4403    /// The ratio is Usage/[Total number of IPs in the secondary range],
4404    /// Usage=numNodes*numZones*podIPsPerNode.
4405    pub pod_ipv4_range_utilization: f64,
4406
4407    /// Output only. The subnetwork path for the node pool.
4408    /// Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}
4409    /// If the cluster is associated with multiple subnetworks, the subnetwork for
4410    /// the node pool is picked based on the IP utilization during node pool
4411    /// creation and is immutable.
4412    pub subnetwork: std::string::String,
4413
4414    /// Output only. The network tier configuration for the node pool inherits from
4415    /// the cluster-level configuration and remains immutable throughout the node
4416    /// pool's lifecycle, including during upgrades.
4417    pub network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
4418
4419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4420}
4421
4422impl NodeNetworkConfig {
4423    pub fn new() -> Self {
4424        std::default::Default::default()
4425    }
4426
4427    /// Sets the value of [create_pod_range][crate::model::NodeNetworkConfig::create_pod_range].
4428    ///
4429    /// # Example
4430    /// ```ignore,no_run
4431    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4432    /// let x = NodeNetworkConfig::new().set_create_pod_range(true);
4433    /// ```
4434    pub fn set_create_pod_range<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4435        self.create_pod_range = v.into();
4436        self
4437    }
4438
4439    /// Sets the value of [pod_range][crate::model::NodeNetworkConfig::pod_range].
4440    ///
4441    /// # Example
4442    /// ```ignore,no_run
4443    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4444    /// let x = NodeNetworkConfig::new().set_pod_range("example");
4445    /// ```
4446    pub fn set_pod_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4447        self.pod_range = v.into();
4448        self
4449    }
4450
4451    /// Sets the value of [pod_ipv4_cidr_block][crate::model::NodeNetworkConfig::pod_ipv4_cidr_block].
4452    ///
4453    /// # Example
4454    /// ```ignore,no_run
4455    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4456    /// let x = NodeNetworkConfig::new().set_pod_ipv4_cidr_block("example");
4457    /// ```
4458    pub fn set_pod_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
4459        mut self,
4460        v: T,
4461    ) -> Self {
4462        self.pod_ipv4_cidr_block = v.into();
4463        self
4464    }
4465
4466    /// Sets the value of [enable_private_nodes][crate::model::NodeNetworkConfig::enable_private_nodes].
4467    ///
4468    /// # Example
4469    /// ```ignore,no_run
4470    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4471    /// let x = NodeNetworkConfig::new().set_enable_private_nodes(true);
4472    /// ```
4473    pub fn set_enable_private_nodes<T>(mut self, v: T) -> Self
4474    where
4475        T: std::convert::Into<bool>,
4476    {
4477        self.enable_private_nodes = std::option::Option::Some(v.into());
4478        self
4479    }
4480
4481    /// Sets or clears the value of [enable_private_nodes][crate::model::NodeNetworkConfig::enable_private_nodes].
4482    ///
4483    /// # Example
4484    /// ```ignore,no_run
4485    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4486    /// let x = NodeNetworkConfig::new().set_or_clear_enable_private_nodes(Some(false));
4487    /// let x = NodeNetworkConfig::new().set_or_clear_enable_private_nodes(None::<bool>);
4488    /// ```
4489    pub fn set_or_clear_enable_private_nodes<T>(mut self, v: std::option::Option<T>) -> Self
4490    where
4491        T: std::convert::Into<bool>,
4492    {
4493        self.enable_private_nodes = v.map(|x| x.into());
4494        self
4495    }
4496
4497    /// Sets the value of [network_performance_config][crate::model::NodeNetworkConfig::network_performance_config].
4498    ///
4499    /// # Example
4500    /// ```ignore,no_run
4501    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4502    /// use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
4503    /// let x = NodeNetworkConfig::new().set_network_performance_config(NetworkPerformanceConfig::default()/* use setters */);
4504    /// ```
4505    pub fn set_network_performance_config<T>(mut self, v: T) -> Self
4506    where
4507        T: std::convert::Into<crate::model::node_network_config::NetworkPerformanceConfig>,
4508    {
4509        self.network_performance_config = std::option::Option::Some(v.into());
4510        self
4511    }
4512
4513    /// Sets or clears the value of [network_performance_config][crate::model::NodeNetworkConfig::network_performance_config].
4514    ///
4515    /// # Example
4516    /// ```ignore,no_run
4517    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4518    /// use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
4519    /// let x = NodeNetworkConfig::new().set_or_clear_network_performance_config(Some(NetworkPerformanceConfig::default()/* use setters */));
4520    /// let x = NodeNetworkConfig::new().set_or_clear_network_performance_config(None::<NetworkPerformanceConfig>);
4521    /// ```
4522    pub fn set_or_clear_network_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
4523    where
4524        T: std::convert::Into<crate::model::node_network_config::NetworkPerformanceConfig>,
4525    {
4526        self.network_performance_config = v.map(|x| x.into());
4527        self
4528    }
4529
4530    /// Sets the value of [pod_cidr_overprovision_config][crate::model::NodeNetworkConfig::pod_cidr_overprovision_config].
4531    ///
4532    /// # Example
4533    /// ```ignore,no_run
4534    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4535    /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
4536    /// let x = NodeNetworkConfig::new().set_pod_cidr_overprovision_config(PodCIDROverprovisionConfig::default()/* use setters */);
4537    /// ```
4538    pub fn set_pod_cidr_overprovision_config<T>(mut self, v: T) -> Self
4539    where
4540        T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
4541    {
4542        self.pod_cidr_overprovision_config = std::option::Option::Some(v.into());
4543        self
4544    }
4545
4546    /// Sets or clears the value of [pod_cidr_overprovision_config][crate::model::NodeNetworkConfig::pod_cidr_overprovision_config].
4547    ///
4548    /// # Example
4549    /// ```ignore,no_run
4550    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4551    /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
4552    /// let x = NodeNetworkConfig::new().set_or_clear_pod_cidr_overprovision_config(Some(PodCIDROverprovisionConfig::default()/* use setters */));
4553    /// let x = NodeNetworkConfig::new().set_or_clear_pod_cidr_overprovision_config(None::<PodCIDROverprovisionConfig>);
4554    /// ```
4555    pub fn set_or_clear_pod_cidr_overprovision_config<T>(
4556        mut self,
4557        v: std::option::Option<T>,
4558    ) -> Self
4559    where
4560        T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
4561    {
4562        self.pod_cidr_overprovision_config = v.map(|x| x.into());
4563        self
4564    }
4565
4566    /// Sets the value of [additional_node_network_configs][crate::model::NodeNetworkConfig::additional_node_network_configs].
4567    ///
4568    /// # Example
4569    /// ```ignore,no_run
4570    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4571    /// use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
4572    /// let x = NodeNetworkConfig::new()
4573    ///     .set_additional_node_network_configs([
4574    ///         AdditionalNodeNetworkConfig::default()/* use setters */,
4575    ///         AdditionalNodeNetworkConfig::default()/* use (different) setters */,
4576    ///     ]);
4577    /// ```
4578    pub fn set_additional_node_network_configs<T, V>(mut self, v: T) -> Self
4579    where
4580        T: std::iter::IntoIterator<Item = V>,
4581        V: std::convert::Into<crate::model::AdditionalNodeNetworkConfig>,
4582    {
4583        use std::iter::Iterator;
4584        self.additional_node_network_configs = v.into_iter().map(|i| i.into()).collect();
4585        self
4586    }
4587
4588    /// Sets the value of [additional_pod_network_configs][crate::model::NodeNetworkConfig::additional_pod_network_configs].
4589    ///
4590    /// # Example
4591    /// ```ignore,no_run
4592    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4593    /// use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
4594    /// let x = NodeNetworkConfig::new()
4595    ///     .set_additional_pod_network_configs([
4596    ///         AdditionalPodNetworkConfig::default()/* use setters */,
4597    ///         AdditionalPodNetworkConfig::default()/* use (different) setters */,
4598    ///     ]);
4599    /// ```
4600    pub fn set_additional_pod_network_configs<T, V>(mut self, v: T) -> Self
4601    where
4602        T: std::iter::IntoIterator<Item = V>,
4603        V: std::convert::Into<crate::model::AdditionalPodNetworkConfig>,
4604    {
4605        use std::iter::Iterator;
4606        self.additional_pod_network_configs = v.into_iter().map(|i| i.into()).collect();
4607        self
4608    }
4609
4610    /// Sets the value of [pod_ipv4_range_utilization][crate::model::NodeNetworkConfig::pod_ipv4_range_utilization].
4611    ///
4612    /// # Example
4613    /// ```ignore,no_run
4614    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4615    /// let x = NodeNetworkConfig::new().set_pod_ipv4_range_utilization(42.0);
4616    /// ```
4617    pub fn set_pod_ipv4_range_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4618        self.pod_ipv4_range_utilization = v.into();
4619        self
4620    }
4621
4622    /// Sets the value of [subnetwork][crate::model::NodeNetworkConfig::subnetwork].
4623    ///
4624    /// # Example
4625    /// ```ignore,no_run
4626    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4627    /// let x = NodeNetworkConfig::new().set_subnetwork("example");
4628    /// ```
4629    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4630        self.subnetwork = v.into();
4631        self
4632    }
4633
4634    /// Sets the value of [network_tier_config][crate::model::NodeNetworkConfig::network_tier_config].
4635    ///
4636    /// # Example
4637    /// ```ignore,no_run
4638    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4639    /// use google_cloud_container_v1::model::NetworkTierConfig;
4640    /// let x = NodeNetworkConfig::new().set_network_tier_config(NetworkTierConfig::default()/* use setters */);
4641    /// ```
4642    pub fn set_network_tier_config<T>(mut self, v: T) -> Self
4643    where
4644        T: std::convert::Into<crate::model::NetworkTierConfig>,
4645    {
4646        self.network_tier_config = std::option::Option::Some(v.into());
4647        self
4648    }
4649
4650    /// Sets or clears the value of [network_tier_config][crate::model::NodeNetworkConfig::network_tier_config].
4651    ///
4652    /// # Example
4653    /// ```ignore,no_run
4654    /// # use google_cloud_container_v1::model::NodeNetworkConfig;
4655    /// use google_cloud_container_v1::model::NetworkTierConfig;
4656    /// let x = NodeNetworkConfig::new().set_or_clear_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
4657    /// let x = NodeNetworkConfig::new().set_or_clear_network_tier_config(None::<NetworkTierConfig>);
4658    /// ```
4659    pub fn set_or_clear_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
4660    where
4661        T: std::convert::Into<crate::model::NetworkTierConfig>,
4662    {
4663        self.network_tier_config = v.map(|x| x.into());
4664        self
4665    }
4666}
4667
4668impl wkt::message::Message for NodeNetworkConfig {
4669    fn typename() -> &'static str {
4670        "type.googleapis.com/google.container.v1.NodeNetworkConfig"
4671    }
4672}
4673
4674/// Defines additional types related to [NodeNetworkConfig].
4675pub mod node_network_config {
4676    #[allow(unused_imports)]
4677    use super::*;
4678
4679    /// Configuration of all network bandwidth tiers
4680    #[derive(Clone, Default, PartialEq)]
4681    #[non_exhaustive]
4682    pub struct NetworkPerformanceConfig {
4683        /// Specifies the total network bandwidth tier for the NodePool.
4684        pub total_egress_bandwidth_tier: std::option::Option<
4685            crate::model::node_network_config::network_performance_config::Tier,
4686        >,
4687
4688        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4689    }
4690
4691    impl NetworkPerformanceConfig {
4692        pub fn new() -> Self {
4693            std::default::Default::default()
4694        }
4695
4696        /// Sets the value of [total_egress_bandwidth_tier][crate::model::node_network_config::NetworkPerformanceConfig::total_egress_bandwidth_tier].
4697        ///
4698        /// # Example
4699        /// ```ignore,no_run
4700        /// # use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
4701        /// use google_cloud_container_v1::model::node_network_config::network_performance_config::Tier;
4702        /// let x0 = NetworkPerformanceConfig::new().set_total_egress_bandwidth_tier(Tier::Tier1);
4703        /// ```
4704        pub fn set_total_egress_bandwidth_tier<T>(mut self, v: T) -> Self
4705        where
4706            T: std::convert::Into<
4707                    crate::model::node_network_config::network_performance_config::Tier,
4708                >,
4709        {
4710            self.total_egress_bandwidth_tier = std::option::Option::Some(v.into());
4711            self
4712        }
4713
4714        /// Sets or clears the value of [total_egress_bandwidth_tier][crate::model::node_network_config::NetworkPerformanceConfig::total_egress_bandwidth_tier].
4715        ///
4716        /// # Example
4717        /// ```ignore,no_run
4718        /// # use google_cloud_container_v1::model::node_network_config::NetworkPerformanceConfig;
4719        /// use google_cloud_container_v1::model::node_network_config::network_performance_config::Tier;
4720        /// let x0 = NetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(Some(Tier::Tier1));
4721        /// let x_none = NetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(None::<Tier>);
4722        /// ```
4723        pub fn set_or_clear_total_egress_bandwidth_tier<T>(
4724            mut self,
4725            v: std::option::Option<T>,
4726        ) -> Self
4727        where
4728            T: std::convert::Into<
4729                    crate::model::node_network_config::network_performance_config::Tier,
4730                >,
4731        {
4732            self.total_egress_bandwidth_tier = v.map(|x| x.into());
4733            self
4734        }
4735    }
4736
4737    impl wkt::message::Message for NetworkPerformanceConfig {
4738        fn typename() -> &'static str {
4739            "type.googleapis.com/google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig"
4740        }
4741    }
4742
4743    /// Defines additional types related to [NetworkPerformanceConfig].
4744    pub mod network_performance_config {
4745        #[allow(unused_imports)]
4746        use super::*;
4747
4748        /// Node network tier
4749        ///
4750        /// # Working with unknown values
4751        ///
4752        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4753        /// additional enum variants at any time. Adding new variants is not considered
4754        /// a breaking change. Applications should write their code in anticipation of:
4755        ///
4756        /// - New values appearing in future releases of the client library, **and**
4757        /// - New values received dynamically, without application changes.
4758        ///
4759        /// Please consult the [Working with enums] section in the user guide for some
4760        /// guidelines.
4761        ///
4762        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4763        #[derive(Clone, Debug, PartialEq)]
4764        #[non_exhaustive]
4765        pub enum Tier {
4766            /// Default value
4767            Unspecified,
4768            /// Higher bandwidth, actual values based on VM size.
4769            Tier1,
4770            /// If set, the enum was initialized with an unknown value.
4771            ///
4772            /// Applications can examine the value using [Tier::value] or
4773            /// [Tier::name].
4774            UnknownValue(tier::UnknownValue),
4775        }
4776
4777        #[doc(hidden)]
4778        pub mod tier {
4779            #[allow(unused_imports)]
4780            use super::*;
4781            #[derive(Clone, Debug, PartialEq)]
4782            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4783        }
4784
4785        impl Tier {
4786            /// Gets the enum value.
4787            ///
4788            /// Returns `None` if the enum contains an unknown value deserialized from
4789            /// the string representation of enums.
4790            pub fn value(&self) -> std::option::Option<i32> {
4791                match self {
4792                    Self::Unspecified => std::option::Option::Some(0),
4793                    Self::Tier1 => std::option::Option::Some(1),
4794                    Self::UnknownValue(u) => u.0.value(),
4795                }
4796            }
4797
4798            /// Gets the enum value as a string.
4799            ///
4800            /// Returns `None` if the enum contains an unknown value deserialized from
4801            /// the integer representation of enums.
4802            pub fn name(&self) -> std::option::Option<&str> {
4803                match self {
4804                    Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
4805                    Self::Tier1 => std::option::Option::Some("TIER_1"),
4806                    Self::UnknownValue(u) => u.0.name(),
4807                }
4808            }
4809        }
4810
4811        impl std::default::Default for Tier {
4812            fn default() -> Self {
4813                use std::convert::From;
4814                Self::from(0)
4815            }
4816        }
4817
4818        impl std::fmt::Display for Tier {
4819            fn fmt(
4820                &self,
4821                f: &mut std::fmt::Formatter<'_>,
4822            ) -> std::result::Result<(), std::fmt::Error> {
4823                wkt::internal::display_enum(f, self.name(), self.value())
4824            }
4825        }
4826
4827        impl std::convert::From<i32> for Tier {
4828            fn from(value: i32) -> Self {
4829                match value {
4830                    0 => Self::Unspecified,
4831                    1 => Self::Tier1,
4832                    _ => Self::UnknownValue(tier::UnknownValue(
4833                        wkt::internal::UnknownEnumValue::Integer(value),
4834                    )),
4835                }
4836            }
4837        }
4838
4839        impl std::convert::From<&str> for Tier {
4840            fn from(value: &str) -> Self {
4841                use std::string::ToString;
4842                match value {
4843                    "TIER_UNSPECIFIED" => Self::Unspecified,
4844                    "TIER_1" => Self::Tier1,
4845                    _ => Self::UnknownValue(tier::UnknownValue(
4846                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4847                    )),
4848                }
4849            }
4850        }
4851
4852        impl serde::ser::Serialize for Tier {
4853            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4854            where
4855                S: serde::Serializer,
4856            {
4857                match self {
4858                    Self::Unspecified => serializer.serialize_i32(0),
4859                    Self::Tier1 => serializer.serialize_i32(1),
4860                    Self::UnknownValue(u) => u.0.serialize(serializer),
4861                }
4862            }
4863        }
4864
4865        impl<'de> serde::de::Deserialize<'de> for Tier {
4866            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4867            where
4868                D: serde::Deserializer<'de>,
4869            {
4870                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
4871                    ".google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig.Tier",
4872                ))
4873            }
4874        }
4875    }
4876}
4877
4878/// AdditionalNodeNetworkConfig is the configuration for additional node networks
4879/// within the NodeNetworkConfig message
4880#[derive(Clone, Default, PartialEq)]
4881#[non_exhaustive]
4882pub struct AdditionalNodeNetworkConfig {
4883    /// Name of the VPC where the additional interface belongs
4884    pub network: std::string::String,
4885
4886    /// Name of the subnetwork where the additional interface belongs
4887    pub subnetwork: std::string::String,
4888
4889    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4890}
4891
4892impl AdditionalNodeNetworkConfig {
4893    pub fn new() -> Self {
4894        std::default::Default::default()
4895    }
4896
4897    /// Sets the value of [network][crate::model::AdditionalNodeNetworkConfig::network].
4898    ///
4899    /// # Example
4900    /// ```ignore,no_run
4901    /// # use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
4902    /// let x = AdditionalNodeNetworkConfig::new().set_network("example");
4903    /// ```
4904    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4905        self.network = v.into();
4906        self
4907    }
4908
4909    /// Sets the value of [subnetwork][crate::model::AdditionalNodeNetworkConfig::subnetwork].
4910    ///
4911    /// # Example
4912    /// ```ignore,no_run
4913    /// # use google_cloud_container_v1::model::AdditionalNodeNetworkConfig;
4914    /// let x = AdditionalNodeNetworkConfig::new().set_subnetwork("example");
4915    /// ```
4916    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4917        self.subnetwork = v.into();
4918        self
4919    }
4920}
4921
4922impl wkt::message::Message for AdditionalNodeNetworkConfig {
4923    fn typename() -> &'static str {
4924        "type.googleapis.com/google.container.v1.AdditionalNodeNetworkConfig"
4925    }
4926}
4927
4928/// AdditionalPodNetworkConfig is the configuration for additional pod networks
4929/// within the NodeNetworkConfig message
4930#[derive(Clone, Default, PartialEq)]
4931#[non_exhaustive]
4932pub struct AdditionalPodNetworkConfig {
4933    /// Name of the subnetwork where the additional pod network belongs.
4934    pub subnetwork: std::string::String,
4935
4936    /// The name of the secondary range on the subnet which provides IP address for
4937    /// this pod range.
4938    pub secondary_pod_range: std::string::String,
4939
4940    /// The maximum number of pods per node which use this pod network.
4941    pub max_pods_per_node: std::option::Option<crate::model::MaxPodsConstraint>,
4942
4943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4944}
4945
4946impl AdditionalPodNetworkConfig {
4947    pub fn new() -> Self {
4948        std::default::Default::default()
4949    }
4950
4951    /// Sets the value of [subnetwork][crate::model::AdditionalPodNetworkConfig::subnetwork].
4952    ///
4953    /// # Example
4954    /// ```ignore,no_run
4955    /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
4956    /// let x = AdditionalPodNetworkConfig::new().set_subnetwork("example");
4957    /// ```
4958    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4959        self.subnetwork = v.into();
4960        self
4961    }
4962
4963    /// Sets the value of [secondary_pod_range][crate::model::AdditionalPodNetworkConfig::secondary_pod_range].
4964    ///
4965    /// # Example
4966    /// ```ignore,no_run
4967    /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
4968    /// let x = AdditionalPodNetworkConfig::new().set_secondary_pod_range("example");
4969    /// ```
4970    pub fn set_secondary_pod_range<T: std::convert::Into<std::string::String>>(
4971        mut self,
4972        v: T,
4973    ) -> Self {
4974        self.secondary_pod_range = v.into();
4975        self
4976    }
4977
4978    /// Sets the value of [max_pods_per_node][crate::model::AdditionalPodNetworkConfig::max_pods_per_node].
4979    ///
4980    /// # Example
4981    /// ```ignore,no_run
4982    /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
4983    /// use google_cloud_container_v1::model::MaxPodsConstraint;
4984    /// let x = AdditionalPodNetworkConfig::new().set_max_pods_per_node(MaxPodsConstraint::default()/* use setters */);
4985    /// ```
4986    pub fn set_max_pods_per_node<T>(mut self, v: T) -> Self
4987    where
4988        T: std::convert::Into<crate::model::MaxPodsConstraint>,
4989    {
4990        self.max_pods_per_node = std::option::Option::Some(v.into());
4991        self
4992    }
4993
4994    /// Sets or clears the value of [max_pods_per_node][crate::model::AdditionalPodNetworkConfig::max_pods_per_node].
4995    ///
4996    /// # Example
4997    /// ```ignore,no_run
4998    /// # use google_cloud_container_v1::model::AdditionalPodNetworkConfig;
4999    /// use google_cloud_container_v1::model::MaxPodsConstraint;
5000    /// let x = AdditionalPodNetworkConfig::new().set_or_clear_max_pods_per_node(Some(MaxPodsConstraint::default()/* use setters */));
5001    /// let x = AdditionalPodNetworkConfig::new().set_or_clear_max_pods_per_node(None::<MaxPodsConstraint>);
5002    /// ```
5003    pub fn set_or_clear_max_pods_per_node<T>(mut self, v: std::option::Option<T>) -> Self
5004    where
5005        T: std::convert::Into<crate::model::MaxPodsConstraint>,
5006    {
5007        self.max_pods_per_node = v.map(|x| x.into());
5008        self
5009    }
5010}
5011
5012impl wkt::message::Message for AdditionalPodNetworkConfig {
5013    fn typename() -> &'static str {
5014        "type.googleapis.com/google.container.v1.AdditionalPodNetworkConfig"
5015    }
5016}
5017
5018/// A set of Shielded Instance options.
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct ShieldedInstanceConfig {
5022    /// Defines whether the instance has Secure Boot enabled.
5023    ///
5024    /// Secure Boot helps ensure that the system only runs authentic software by
5025    /// verifying the digital signature of all boot components, and halting the
5026    /// boot process if signature verification fails.
5027    pub enable_secure_boot: bool,
5028
5029    /// Defines whether the instance has integrity monitoring enabled.
5030    ///
5031    /// Enables monitoring and attestation of the boot integrity of the instance.
5032    /// The attestation is performed against the integrity policy baseline. This
5033    /// baseline is initially derived from the implicitly trusted boot image when
5034    /// the instance is created.
5035    pub enable_integrity_monitoring: bool,
5036
5037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5038}
5039
5040impl ShieldedInstanceConfig {
5041    pub fn new() -> Self {
5042        std::default::Default::default()
5043    }
5044
5045    /// Sets the value of [enable_secure_boot][crate::model::ShieldedInstanceConfig::enable_secure_boot].
5046    ///
5047    /// # Example
5048    /// ```ignore,no_run
5049    /// # use google_cloud_container_v1::model::ShieldedInstanceConfig;
5050    /// let x = ShieldedInstanceConfig::new().set_enable_secure_boot(true);
5051    /// ```
5052    pub fn set_enable_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5053        self.enable_secure_boot = v.into();
5054        self
5055    }
5056
5057    /// Sets the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
5058    ///
5059    /// # Example
5060    /// ```ignore,no_run
5061    /// # use google_cloud_container_v1::model::ShieldedInstanceConfig;
5062    /// let x = ShieldedInstanceConfig::new().set_enable_integrity_monitoring(true);
5063    /// ```
5064    pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5065        self.enable_integrity_monitoring = v.into();
5066        self
5067    }
5068}
5069
5070impl wkt::message::Message for ShieldedInstanceConfig {
5071    fn typename() -> &'static str {
5072        "type.googleapis.com/google.container.v1.ShieldedInstanceConfig"
5073    }
5074}
5075
5076/// SandboxConfig contains configurations of the sandbox to use for the node.
5077#[derive(Clone, Default, PartialEq)]
5078#[non_exhaustive]
5079pub struct SandboxConfig {
5080    /// Type of the sandbox to use for the node.
5081    pub r#type: crate::model::sandbox_config::Type,
5082
5083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5084}
5085
5086impl SandboxConfig {
5087    pub fn new() -> Self {
5088        std::default::Default::default()
5089    }
5090
5091    /// Sets the value of [r#type][crate::model::SandboxConfig::type].
5092    ///
5093    /// # Example
5094    /// ```ignore,no_run
5095    /// # use google_cloud_container_v1::model::SandboxConfig;
5096    /// use google_cloud_container_v1::model::sandbox_config::Type;
5097    /// let x0 = SandboxConfig::new().set_type(Type::Gvisor);
5098    /// ```
5099    pub fn set_type<T: std::convert::Into<crate::model::sandbox_config::Type>>(
5100        mut self,
5101        v: T,
5102    ) -> Self {
5103        self.r#type = v.into();
5104        self
5105    }
5106}
5107
5108impl wkt::message::Message for SandboxConfig {
5109    fn typename() -> &'static str {
5110        "type.googleapis.com/google.container.v1.SandboxConfig"
5111    }
5112}
5113
5114/// Defines additional types related to [SandboxConfig].
5115pub mod sandbox_config {
5116    #[allow(unused_imports)]
5117    use super::*;
5118
5119    /// Possible types of sandboxes.
5120    ///
5121    /// # Working with unknown values
5122    ///
5123    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5124    /// additional enum variants at any time. Adding new variants is not considered
5125    /// a breaking change. Applications should write their code in anticipation of:
5126    ///
5127    /// - New values appearing in future releases of the client library, **and**
5128    /// - New values received dynamically, without application changes.
5129    ///
5130    /// Please consult the [Working with enums] section in the user guide for some
5131    /// guidelines.
5132    ///
5133    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5134    #[derive(Clone, Debug, PartialEq)]
5135    #[non_exhaustive]
5136    pub enum Type {
5137        /// Default value. This should not be used.
5138        Unspecified,
5139        /// Run sandbox using gvisor.
5140        Gvisor,
5141        /// If set, the enum was initialized with an unknown value.
5142        ///
5143        /// Applications can examine the value using [Type::value] or
5144        /// [Type::name].
5145        UnknownValue(r#type::UnknownValue),
5146    }
5147
5148    #[doc(hidden)]
5149    pub mod r#type {
5150        #[allow(unused_imports)]
5151        use super::*;
5152        #[derive(Clone, Debug, PartialEq)]
5153        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5154    }
5155
5156    impl Type {
5157        /// Gets the enum value.
5158        ///
5159        /// Returns `None` if the enum contains an unknown value deserialized from
5160        /// the string representation of enums.
5161        pub fn value(&self) -> std::option::Option<i32> {
5162            match self {
5163                Self::Unspecified => std::option::Option::Some(0),
5164                Self::Gvisor => std::option::Option::Some(1),
5165                Self::UnknownValue(u) => u.0.value(),
5166            }
5167        }
5168
5169        /// Gets the enum value as a string.
5170        ///
5171        /// Returns `None` if the enum contains an unknown value deserialized from
5172        /// the integer representation of enums.
5173        pub fn name(&self) -> std::option::Option<&str> {
5174            match self {
5175                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
5176                Self::Gvisor => std::option::Option::Some("GVISOR"),
5177                Self::UnknownValue(u) => u.0.name(),
5178            }
5179        }
5180    }
5181
5182    impl std::default::Default for Type {
5183        fn default() -> Self {
5184            use std::convert::From;
5185            Self::from(0)
5186        }
5187    }
5188
5189    impl std::fmt::Display for Type {
5190        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5191            wkt::internal::display_enum(f, self.name(), self.value())
5192        }
5193    }
5194
5195    impl std::convert::From<i32> for Type {
5196        fn from(value: i32) -> Self {
5197            match value {
5198                0 => Self::Unspecified,
5199                1 => Self::Gvisor,
5200                _ => Self::UnknownValue(r#type::UnknownValue(
5201                    wkt::internal::UnknownEnumValue::Integer(value),
5202                )),
5203            }
5204        }
5205    }
5206
5207    impl std::convert::From<&str> for Type {
5208        fn from(value: &str) -> Self {
5209            use std::string::ToString;
5210            match value {
5211                "UNSPECIFIED" => Self::Unspecified,
5212                "GVISOR" => Self::Gvisor,
5213                _ => Self::UnknownValue(r#type::UnknownValue(
5214                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5215                )),
5216            }
5217        }
5218    }
5219
5220    impl serde::ser::Serialize for Type {
5221        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5222        where
5223            S: serde::Serializer,
5224        {
5225            match self {
5226                Self::Unspecified => serializer.serialize_i32(0),
5227                Self::Gvisor => serializer.serialize_i32(1),
5228                Self::UnknownValue(u) => u.0.serialize(serializer),
5229            }
5230        }
5231    }
5232
5233    impl<'de> serde::de::Deserialize<'de> for Type {
5234        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5235        where
5236            D: serde::Deserializer<'de>,
5237        {
5238            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5239                ".google.container.v1.SandboxConfig.Type",
5240            ))
5241        }
5242    }
5243}
5244
5245/// GcfsConfig contains configurations of Google Container File System
5246/// (image streaming).
5247#[derive(Clone, Default, PartialEq)]
5248#[non_exhaustive]
5249pub struct GcfsConfig {
5250    /// Whether to use GCFS.
5251    pub enabled: bool,
5252
5253    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5254}
5255
5256impl GcfsConfig {
5257    pub fn new() -> Self {
5258        std::default::Default::default()
5259    }
5260
5261    /// Sets the value of [enabled][crate::model::GcfsConfig::enabled].
5262    ///
5263    /// # Example
5264    /// ```ignore,no_run
5265    /// # use google_cloud_container_v1::model::GcfsConfig;
5266    /// let x = GcfsConfig::new().set_enabled(true);
5267    /// ```
5268    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5269        self.enabled = v.into();
5270        self
5271    }
5272}
5273
5274impl wkt::message::Message for GcfsConfig {
5275    fn typename() -> &'static str {
5276        "type.googleapis.com/google.container.v1.GcfsConfig"
5277    }
5278}
5279
5280/// [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
5281/// is the configuration of desired reservation which instances could take
5282/// capacity from.
5283#[derive(Clone, Default, PartialEq)]
5284#[non_exhaustive]
5285pub struct ReservationAffinity {
5286    /// Corresponds to the type of reservation consumption.
5287    pub consume_reservation_type: crate::model::reservation_affinity::Type,
5288
5289    /// Corresponds to the label key of a reservation resource. To target a
5290    /// SPECIFIC_RESERVATION by name, specify
5291    /// "compute.googleapis.com/reservation-name" as the key and specify the name
5292    /// of your reservation as its value.
5293    pub key: std::string::String,
5294
5295    /// Corresponds to the label value(s) of reservation resource(s).
5296    pub values: std::vec::Vec<std::string::String>,
5297
5298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5299}
5300
5301impl ReservationAffinity {
5302    pub fn new() -> Self {
5303        std::default::Default::default()
5304    }
5305
5306    /// Sets the value of [consume_reservation_type][crate::model::ReservationAffinity::consume_reservation_type].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_container_v1::model::ReservationAffinity;
5311    /// use google_cloud_container_v1::model::reservation_affinity::Type;
5312    /// let x0 = ReservationAffinity::new().set_consume_reservation_type(Type::NoReservation);
5313    /// let x1 = ReservationAffinity::new().set_consume_reservation_type(Type::AnyReservation);
5314    /// let x2 = ReservationAffinity::new().set_consume_reservation_type(Type::SpecificReservation);
5315    /// ```
5316    pub fn set_consume_reservation_type<
5317        T: std::convert::Into<crate::model::reservation_affinity::Type>,
5318    >(
5319        mut self,
5320        v: T,
5321    ) -> Self {
5322        self.consume_reservation_type = v.into();
5323        self
5324    }
5325
5326    /// Sets the value of [key][crate::model::ReservationAffinity::key].
5327    ///
5328    /// # Example
5329    /// ```ignore,no_run
5330    /// # use google_cloud_container_v1::model::ReservationAffinity;
5331    /// let x = ReservationAffinity::new().set_key("example");
5332    /// ```
5333    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334        self.key = v.into();
5335        self
5336    }
5337
5338    /// Sets the value of [values][crate::model::ReservationAffinity::values].
5339    ///
5340    /// # Example
5341    /// ```ignore,no_run
5342    /// # use google_cloud_container_v1::model::ReservationAffinity;
5343    /// let x = ReservationAffinity::new().set_values(["a", "b", "c"]);
5344    /// ```
5345    pub fn set_values<T, V>(mut self, v: T) -> Self
5346    where
5347        T: std::iter::IntoIterator<Item = V>,
5348        V: std::convert::Into<std::string::String>,
5349    {
5350        use std::iter::Iterator;
5351        self.values = v.into_iter().map(|i| i.into()).collect();
5352        self
5353    }
5354}
5355
5356impl wkt::message::Message for ReservationAffinity {
5357    fn typename() -> &'static str {
5358        "type.googleapis.com/google.container.v1.ReservationAffinity"
5359    }
5360}
5361
5362/// Defines additional types related to [ReservationAffinity].
5363pub mod reservation_affinity {
5364    #[allow(unused_imports)]
5365    use super::*;
5366
5367    /// Indicates whether to consume capacity from a reservation or not.
5368    ///
5369    /// # Working with unknown values
5370    ///
5371    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5372    /// additional enum variants at any time. Adding new variants is not considered
5373    /// a breaking change. Applications should write their code in anticipation of:
5374    ///
5375    /// - New values appearing in future releases of the client library, **and**
5376    /// - New values received dynamically, without application changes.
5377    ///
5378    /// Please consult the [Working with enums] section in the user guide for some
5379    /// guidelines.
5380    ///
5381    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5382    #[derive(Clone, Debug, PartialEq)]
5383    #[non_exhaustive]
5384    pub enum Type {
5385        /// Default value. This should not be used.
5386        Unspecified,
5387        /// Do not consume from any reserved capacity.
5388        NoReservation,
5389        /// Consume any reservation available.
5390        AnyReservation,
5391        /// Must consume from a specific reservation. Must specify key value fields
5392        /// for specifying the reservations.
5393        SpecificReservation,
5394        /// If set, the enum was initialized with an unknown value.
5395        ///
5396        /// Applications can examine the value using [Type::value] or
5397        /// [Type::name].
5398        UnknownValue(r#type::UnknownValue),
5399    }
5400
5401    #[doc(hidden)]
5402    pub mod r#type {
5403        #[allow(unused_imports)]
5404        use super::*;
5405        #[derive(Clone, Debug, PartialEq)]
5406        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5407    }
5408
5409    impl Type {
5410        /// Gets the enum value.
5411        ///
5412        /// Returns `None` if the enum contains an unknown value deserialized from
5413        /// the string representation of enums.
5414        pub fn value(&self) -> std::option::Option<i32> {
5415            match self {
5416                Self::Unspecified => std::option::Option::Some(0),
5417                Self::NoReservation => std::option::Option::Some(1),
5418                Self::AnyReservation => std::option::Option::Some(2),
5419                Self::SpecificReservation => std::option::Option::Some(3),
5420                Self::UnknownValue(u) => u.0.value(),
5421            }
5422        }
5423
5424        /// Gets the enum value as a string.
5425        ///
5426        /// Returns `None` if the enum contains an unknown value deserialized from
5427        /// the integer representation of enums.
5428        pub fn name(&self) -> std::option::Option<&str> {
5429            match self {
5430                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
5431                Self::NoReservation => std::option::Option::Some("NO_RESERVATION"),
5432                Self::AnyReservation => std::option::Option::Some("ANY_RESERVATION"),
5433                Self::SpecificReservation => std::option::Option::Some("SPECIFIC_RESERVATION"),
5434                Self::UnknownValue(u) => u.0.name(),
5435            }
5436        }
5437    }
5438
5439    impl std::default::Default for Type {
5440        fn default() -> Self {
5441            use std::convert::From;
5442            Self::from(0)
5443        }
5444    }
5445
5446    impl std::fmt::Display for Type {
5447        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5448            wkt::internal::display_enum(f, self.name(), self.value())
5449        }
5450    }
5451
5452    impl std::convert::From<i32> for Type {
5453        fn from(value: i32) -> Self {
5454            match value {
5455                0 => Self::Unspecified,
5456                1 => Self::NoReservation,
5457                2 => Self::AnyReservation,
5458                3 => Self::SpecificReservation,
5459                _ => Self::UnknownValue(r#type::UnknownValue(
5460                    wkt::internal::UnknownEnumValue::Integer(value),
5461                )),
5462            }
5463        }
5464    }
5465
5466    impl std::convert::From<&str> for Type {
5467        fn from(value: &str) -> Self {
5468            use std::string::ToString;
5469            match value {
5470                "UNSPECIFIED" => Self::Unspecified,
5471                "NO_RESERVATION" => Self::NoReservation,
5472                "ANY_RESERVATION" => Self::AnyReservation,
5473                "SPECIFIC_RESERVATION" => Self::SpecificReservation,
5474                _ => Self::UnknownValue(r#type::UnknownValue(
5475                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5476                )),
5477            }
5478        }
5479    }
5480
5481    impl serde::ser::Serialize for Type {
5482        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5483        where
5484            S: serde::Serializer,
5485        {
5486            match self {
5487                Self::Unspecified => serializer.serialize_i32(0),
5488                Self::NoReservation => serializer.serialize_i32(1),
5489                Self::AnyReservation => serializer.serialize_i32(2),
5490                Self::SpecificReservation => serializer.serialize_i32(3),
5491                Self::UnknownValue(u) => u.0.serialize(serializer),
5492            }
5493        }
5494    }
5495
5496    impl<'de> serde::de::Deserialize<'de> for Type {
5497        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5498        where
5499            D: serde::Deserializer<'de>,
5500        {
5501            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5502                ".google.container.v1.ReservationAffinity.Type",
5503            ))
5504        }
5505    }
5506}
5507
5508/// SoleTenantConfig contains the NodeAffinities to specify what shared sole
5509/// tenant node groups should back the node pool.
5510#[derive(Clone, Default, PartialEq)]
5511#[non_exhaustive]
5512pub struct SoleTenantConfig {
5513    /// NodeAffinities used to match to a shared sole tenant node group.
5514    pub node_affinities: std::vec::Vec<crate::model::sole_tenant_config::NodeAffinity>,
5515
5516    /// Optional. The minimum number of virtual CPUs this instance will consume
5517    /// when running on a sole-tenant node. This field can only be set if the node
5518    /// pool is created in a shared sole-tenant node group.
5519    pub min_node_cpus: std::option::Option<i32>,
5520
5521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5522}
5523
5524impl SoleTenantConfig {
5525    pub fn new() -> Self {
5526        std::default::Default::default()
5527    }
5528
5529    /// Sets the value of [node_affinities][crate::model::SoleTenantConfig::node_affinities].
5530    ///
5531    /// # Example
5532    /// ```ignore,no_run
5533    /// # use google_cloud_container_v1::model::SoleTenantConfig;
5534    /// use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
5535    /// let x = SoleTenantConfig::new()
5536    ///     .set_node_affinities([
5537    ///         NodeAffinity::default()/* use setters */,
5538    ///         NodeAffinity::default()/* use (different) setters */,
5539    ///     ]);
5540    /// ```
5541    pub fn set_node_affinities<T, V>(mut self, v: T) -> Self
5542    where
5543        T: std::iter::IntoIterator<Item = V>,
5544        V: std::convert::Into<crate::model::sole_tenant_config::NodeAffinity>,
5545    {
5546        use std::iter::Iterator;
5547        self.node_affinities = v.into_iter().map(|i| i.into()).collect();
5548        self
5549    }
5550
5551    /// Sets the value of [min_node_cpus][crate::model::SoleTenantConfig::min_node_cpus].
5552    ///
5553    /// # Example
5554    /// ```ignore,no_run
5555    /// # use google_cloud_container_v1::model::SoleTenantConfig;
5556    /// let x = SoleTenantConfig::new().set_min_node_cpus(42);
5557    /// ```
5558    pub fn set_min_node_cpus<T>(mut self, v: T) -> Self
5559    where
5560        T: std::convert::Into<i32>,
5561    {
5562        self.min_node_cpus = std::option::Option::Some(v.into());
5563        self
5564    }
5565
5566    /// Sets or clears the value of [min_node_cpus][crate::model::SoleTenantConfig::min_node_cpus].
5567    ///
5568    /// # Example
5569    /// ```ignore,no_run
5570    /// # use google_cloud_container_v1::model::SoleTenantConfig;
5571    /// let x = SoleTenantConfig::new().set_or_clear_min_node_cpus(Some(42));
5572    /// let x = SoleTenantConfig::new().set_or_clear_min_node_cpus(None::<i32>);
5573    /// ```
5574    pub fn set_or_clear_min_node_cpus<T>(mut self, v: std::option::Option<T>) -> Self
5575    where
5576        T: std::convert::Into<i32>,
5577    {
5578        self.min_node_cpus = v.map(|x| x.into());
5579        self
5580    }
5581}
5582
5583impl wkt::message::Message for SoleTenantConfig {
5584    fn typename() -> &'static str {
5585        "type.googleapis.com/google.container.v1.SoleTenantConfig"
5586    }
5587}
5588
5589/// Defines additional types related to [SoleTenantConfig].
5590pub mod sole_tenant_config {
5591    #[allow(unused_imports)]
5592    use super::*;
5593
5594    /// Specifies the NodeAffinity key, values, and affinity operator according to
5595    /// [shared sole tenant node group
5596    /// affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity).
5597    #[derive(Clone, Default, PartialEq)]
5598    #[non_exhaustive]
5599    pub struct NodeAffinity {
5600        /// Key for NodeAffinity.
5601        pub key: std::string::String,
5602
5603        /// Operator for NodeAffinity.
5604        pub operator: crate::model::sole_tenant_config::node_affinity::Operator,
5605
5606        /// Values for NodeAffinity.
5607        pub values: std::vec::Vec<std::string::String>,
5608
5609        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5610    }
5611
5612    impl NodeAffinity {
5613        pub fn new() -> Self {
5614            std::default::Default::default()
5615        }
5616
5617        /// Sets the value of [key][crate::model::sole_tenant_config::NodeAffinity::key].
5618        ///
5619        /// # Example
5620        /// ```ignore,no_run
5621        /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
5622        /// let x = NodeAffinity::new().set_key("example");
5623        /// ```
5624        pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625            self.key = v.into();
5626            self
5627        }
5628
5629        /// Sets the value of [operator][crate::model::sole_tenant_config::NodeAffinity::operator].
5630        ///
5631        /// # Example
5632        /// ```ignore,no_run
5633        /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
5634        /// use google_cloud_container_v1::model::sole_tenant_config::node_affinity::Operator;
5635        /// let x0 = NodeAffinity::new().set_operator(Operator::In);
5636        /// let x1 = NodeAffinity::new().set_operator(Operator::NotIn);
5637        /// ```
5638        pub fn set_operator<
5639            T: std::convert::Into<crate::model::sole_tenant_config::node_affinity::Operator>,
5640        >(
5641            mut self,
5642            v: T,
5643        ) -> Self {
5644            self.operator = v.into();
5645            self
5646        }
5647
5648        /// Sets the value of [values][crate::model::sole_tenant_config::NodeAffinity::values].
5649        ///
5650        /// # Example
5651        /// ```ignore,no_run
5652        /// # use google_cloud_container_v1::model::sole_tenant_config::NodeAffinity;
5653        /// let x = NodeAffinity::new().set_values(["a", "b", "c"]);
5654        /// ```
5655        pub fn set_values<T, V>(mut self, v: T) -> Self
5656        where
5657            T: std::iter::IntoIterator<Item = V>,
5658            V: std::convert::Into<std::string::String>,
5659        {
5660            use std::iter::Iterator;
5661            self.values = v.into_iter().map(|i| i.into()).collect();
5662            self
5663        }
5664    }
5665
5666    impl wkt::message::Message for NodeAffinity {
5667        fn typename() -> &'static str {
5668            "type.googleapis.com/google.container.v1.SoleTenantConfig.NodeAffinity"
5669        }
5670    }
5671
5672    /// Defines additional types related to [NodeAffinity].
5673    pub mod node_affinity {
5674        #[allow(unused_imports)]
5675        use super::*;
5676
5677        /// Operator allows user to specify affinity or anti-affinity for the
5678        /// given key values.
5679        ///
5680        /// # Working with unknown values
5681        ///
5682        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5683        /// additional enum variants at any time. Adding new variants is not considered
5684        /// a breaking change. Applications should write their code in anticipation of:
5685        ///
5686        /// - New values appearing in future releases of the client library, **and**
5687        /// - New values received dynamically, without application changes.
5688        ///
5689        /// Please consult the [Working with enums] section in the user guide for some
5690        /// guidelines.
5691        ///
5692        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5693        #[derive(Clone, Debug, PartialEq)]
5694        #[non_exhaustive]
5695        pub enum Operator {
5696            /// Invalid or unspecified affinity operator.
5697            Unspecified,
5698            /// Affinity operator.
5699            In,
5700            /// Anti-affinity operator.
5701            NotIn,
5702            /// If set, the enum was initialized with an unknown value.
5703            ///
5704            /// Applications can examine the value using [Operator::value] or
5705            /// [Operator::name].
5706            UnknownValue(operator::UnknownValue),
5707        }
5708
5709        #[doc(hidden)]
5710        pub mod operator {
5711            #[allow(unused_imports)]
5712            use super::*;
5713            #[derive(Clone, Debug, PartialEq)]
5714            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5715        }
5716
5717        impl Operator {
5718            /// Gets the enum value.
5719            ///
5720            /// Returns `None` if the enum contains an unknown value deserialized from
5721            /// the string representation of enums.
5722            pub fn value(&self) -> std::option::Option<i32> {
5723                match self {
5724                    Self::Unspecified => std::option::Option::Some(0),
5725                    Self::In => std::option::Option::Some(1),
5726                    Self::NotIn => std::option::Option::Some(2),
5727                    Self::UnknownValue(u) => u.0.value(),
5728                }
5729            }
5730
5731            /// Gets the enum value as a string.
5732            ///
5733            /// Returns `None` if the enum contains an unknown value deserialized from
5734            /// the integer representation of enums.
5735            pub fn name(&self) -> std::option::Option<&str> {
5736                match self {
5737                    Self::Unspecified => std::option::Option::Some("OPERATOR_UNSPECIFIED"),
5738                    Self::In => std::option::Option::Some("IN"),
5739                    Self::NotIn => std::option::Option::Some("NOT_IN"),
5740                    Self::UnknownValue(u) => u.0.name(),
5741                }
5742            }
5743        }
5744
5745        impl std::default::Default for Operator {
5746            fn default() -> Self {
5747                use std::convert::From;
5748                Self::from(0)
5749            }
5750        }
5751
5752        impl std::fmt::Display for Operator {
5753            fn fmt(
5754                &self,
5755                f: &mut std::fmt::Formatter<'_>,
5756            ) -> std::result::Result<(), std::fmt::Error> {
5757                wkt::internal::display_enum(f, self.name(), self.value())
5758            }
5759        }
5760
5761        impl std::convert::From<i32> for Operator {
5762            fn from(value: i32) -> Self {
5763                match value {
5764                    0 => Self::Unspecified,
5765                    1 => Self::In,
5766                    2 => Self::NotIn,
5767                    _ => Self::UnknownValue(operator::UnknownValue(
5768                        wkt::internal::UnknownEnumValue::Integer(value),
5769                    )),
5770                }
5771            }
5772        }
5773
5774        impl std::convert::From<&str> for Operator {
5775            fn from(value: &str) -> Self {
5776                use std::string::ToString;
5777                match value {
5778                    "OPERATOR_UNSPECIFIED" => Self::Unspecified,
5779                    "IN" => Self::In,
5780                    "NOT_IN" => Self::NotIn,
5781                    _ => Self::UnknownValue(operator::UnknownValue(
5782                        wkt::internal::UnknownEnumValue::String(value.to_string()),
5783                    )),
5784                }
5785            }
5786        }
5787
5788        impl serde::ser::Serialize for Operator {
5789            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5790            where
5791                S: serde::Serializer,
5792            {
5793                match self {
5794                    Self::Unspecified => serializer.serialize_i32(0),
5795                    Self::In => serializer.serialize_i32(1),
5796                    Self::NotIn => serializer.serialize_i32(2),
5797                    Self::UnknownValue(u) => u.0.serialize(serializer),
5798                }
5799            }
5800        }
5801
5802        impl<'de> serde::de::Deserialize<'de> for Operator {
5803            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5804            where
5805                D: serde::Deserializer<'de>,
5806            {
5807                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operator>::new(
5808                    ".google.container.v1.SoleTenantConfig.NodeAffinity.Operator",
5809                ))
5810            }
5811        }
5812    }
5813}
5814
5815/// ContainerdConfig contains configuration to customize containerd.
5816#[derive(Clone, Default, PartialEq)]
5817#[non_exhaustive]
5818pub struct ContainerdConfig {
5819    /// PrivateRegistryAccessConfig is used to configure access configuration
5820    /// for private container registries.
5821    pub private_registry_access_config:
5822        std::option::Option<crate::model::containerd_config::PrivateRegistryAccessConfig>,
5823
5824    /// Optional. WritableCgroups defines writable cgroups configuration for the
5825    /// node pool.
5826    pub writable_cgroups: std::option::Option<crate::model::containerd_config::WritableCgroups>,
5827
5828    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5829}
5830
5831impl ContainerdConfig {
5832    pub fn new() -> Self {
5833        std::default::Default::default()
5834    }
5835
5836    /// Sets the value of [private_registry_access_config][crate::model::ContainerdConfig::private_registry_access_config].
5837    ///
5838    /// # Example
5839    /// ```ignore,no_run
5840    /// # use google_cloud_container_v1::model::ContainerdConfig;
5841    /// use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
5842    /// let x = ContainerdConfig::new().set_private_registry_access_config(PrivateRegistryAccessConfig::default()/* use setters */);
5843    /// ```
5844    pub fn set_private_registry_access_config<T>(mut self, v: T) -> Self
5845    where
5846        T: std::convert::Into<crate::model::containerd_config::PrivateRegistryAccessConfig>,
5847    {
5848        self.private_registry_access_config = std::option::Option::Some(v.into());
5849        self
5850    }
5851
5852    /// Sets or clears the value of [private_registry_access_config][crate::model::ContainerdConfig::private_registry_access_config].
5853    ///
5854    /// # Example
5855    /// ```ignore,no_run
5856    /// # use google_cloud_container_v1::model::ContainerdConfig;
5857    /// use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
5858    /// let x = ContainerdConfig::new().set_or_clear_private_registry_access_config(Some(PrivateRegistryAccessConfig::default()/* use setters */));
5859    /// let x = ContainerdConfig::new().set_or_clear_private_registry_access_config(None::<PrivateRegistryAccessConfig>);
5860    /// ```
5861    pub fn set_or_clear_private_registry_access_config<T>(
5862        mut self,
5863        v: std::option::Option<T>,
5864    ) -> Self
5865    where
5866        T: std::convert::Into<crate::model::containerd_config::PrivateRegistryAccessConfig>,
5867    {
5868        self.private_registry_access_config = v.map(|x| x.into());
5869        self
5870    }
5871
5872    /// Sets the value of [writable_cgroups][crate::model::ContainerdConfig::writable_cgroups].
5873    ///
5874    /// # Example
5875    /// ```ignore,no_run
5876    /// # use google_cloud_container_v1::model::ContainerdConfig;
5877    /// use google_cloud_container_v1::model::containerd_config::WritableCgroups;
5878    /// let x = ContainerdConfig::new().set_writable_cgroups(WritableCgroups::default()/* use setters */);
5879    /// ```
5880    pub fn set_writable_cgroups<T>(mut self, v: T) -> Self
5881    where
5882        T: std::convert::Into<crate::model::containerd_config::WritableCgroups>,
5883    {
5884        self.writable_cgroups = std::option::Option::Some(v.into());
5885        self
5886    }
5887
5888    /// Sets or clears the value of [writable_cgroups][crate::model::ContainerdConfig::writable_cgroups].
5889    ///
5890    /// # Example
5891    /// ```ignore,no_run
5892    /// # use google_cloud_container_v1::model::ContainerdConfig;
5893    /// use google_cloud_container_v1::model::containerd_config::WritableCgroups;
5894    /// let x = ContainerdConfig::new().set_or_clear_writable_cgroups(Some(WritableCgroups::default()/* use setters */));
5895    /// let x = ContainerdConfig::new().set_or_clear_writable_cgroups(None::<WritableCgroups>);
5896    /// ```
5897    pub fn set_or_clear_writable_cgroups<T>(mut self, v: std::option::Option<T>) -> Self
5898    where
5899        T: std::convert::Into<crate::model::containerd_config::WritableCgroups>,
5900    {
5901        self.writable_cgroups = v.map(|x| x.into());
5902        self
5903    }
5904}
5905
5906impl wkt::message::Message for ContainerdConfig {
5907    fn typename() -> &'static str {
5908        "type.googleapis.com/google.container.v1.ContainerdConfig"
5909    }
5910}
5911
5912/// Defines additional types related to [ContainerdConfig].
5913pub mod containerd_config {
5914    #[allow(unused_imports)]
5915    use super::*;
5916
5917    /// PrivateRegistryAccessConfig contains access configuration for
5918    /// private container registries.
5919    #[derive(Clone, Default, PartialEq)]
5920    #[non_exhaustive]
5921    pub struct PrivateRegistryAccessConfig {
5922
5923        /// Private registry access is enabled.
5924        pub enabled: bool,
5925
5926        /// Private registry access configuration.
5927        pub certificate_authority_domain_config: std::vec::Vec<crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig>,
5928
5929        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930    }
5931
5932    impl PrivateRegistryAccessConfig {
5933        pub fn new() -> Self {
5934            std::default::Default::default()
5935        }
5936
5937        /// Sets the value of [enabled][crate::model::containerd_config::PrivateRegistryAccessConfig::enabled].
5938        ///
5939        /// # Example
5940        /// ```ignore,no_run
5941        /// # use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
5942        /// let x = PrivateRegistryAccessConfig::new().set_enabled(true);
5943        /// ```
5944        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5945            self.enabled = v.into();
5946            self
5947        }
5948
5949        /// Sets the value of [certificate_authority_domain_config][crate::model::containerd_config::PrivateRegistryAccessConfig::certificate_authority_domain_config].
5950        ///
5951        /// # Example
5952        /// ```ignore,no_run
5953        /// # use google_cloud_container_v1::model::containerd_config::PrivateRegistryAccessConfig;
5954        /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
5955        /// let x = PrivateRegistryAccessConfig::new()
5956        ///     .set_certificate_authority_domain_config([
5957        ///         CertificateAuthorityDomainConfig::default()/* use setters */,
5958        ///         CertificateAuthorityDomainConfig::default()/* use (different) setters */,
5959        ///     ]);
5960        /// ```
5961        pub fn set_certificate_authority_domain_config<T, V>(mut self, v: T) -> Self
5962        where
5963            T: std::iter::IntoIterator<Item = V>,
5964            V: std::convert::Into<crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig>
5965        {
5966            use std::iter::Iterator;
5967            self.certificate_authority_domain_config = v.into_iter().map(|i| i.into()).collect();
5968            self
5969        }
5970    }
5971
5972    impl wkt::message::Message for PrivateRegistryAccessConfig {
5973        fn typename() -> &'static str {
5974            "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig"
5975        }
5976    }
5977
5978    /// Defines additional types related to [PrivateRegistryAccessConfig].
5979    pub mod private_registry_access_config {
5980        #[allow(unused_imports)]
5981        use super::*;
5982
5983        /// CertificateAuthorityDomainConfig configures one or more fully qualified
5984        /// domain names (FQDN) to a specific certificate.
5985        #[derive(Clone, Default, PartialEq)]
5986        #[non_exhaustive]
5987        pub struct CertificateAuthorityDomainConfig {
5988
5989            /// List of fully qualified domain names (FQDN).
5990            /// Specifying port is supported.
5991            /// Wildcards are NOT supported.
5992            /// Examples:
5993            ///
5994            /// - my.customdomain.com
5995            /// - 10.0.1.2:5000
5996            pub fqdns: std::vec::Vec<std::string::String>,
5997
5998            /// Certificate access config. The following are supported:
5999            ///
6000            /// - GCPSecretManagerCertificateConfig
6001            pub certificate_config: std::option::Option<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig>,
6002
6003            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6004        }
6005
6006        impl CertificateAuthorityDomainConfig {
6007            pub fn new() -> Self {
6008                std::default::Default::default()
6009            }
6010
6011            /// Sets the value of [fqdns][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::fqdns].
6012            ///
6013            /// # Example
6014            /// ```ignore,no_run
6015            /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
6016            /// let x = CertificateAuthorityDomainConfig::new().set_fqdns(["a", "b", "c"]);
6017            /// ```
6018            pub fn set_fqdns<T, V>(mut self, v: T) -> Self
6019            where
6020                T: std::iter::IntoIterator<Item = V>,
6021                V: std::convert::Into<std::string::String>,
6022            {
6023                use std::iter::Iterator;
6024                self.fqdns = v.into_iter().map(|i| i.into()).collect();
6025                self
6026            }
6027
6028            /// Sets the value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config].
6029            ///
6030            /// Note that all the setters affecting `certificate_config` are mutually
6031            /// exclusive.
6032            ///
6033            /// # Example
6034            /// ```ignore,no_run
6035            /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
6036            /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
6037            /// let x = CertificateAuthorityDomainConfig::new().set_certificate_config(Some(
6038            ///     google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(GCPSecretManagerCertificateConfig::default().into())));
6039            /// ```
6040            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
6041            {
6042                self.certificate_config = v.into();
6043                self
6044            }
6045
6046            /// The value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config]
6047            /// if it holds a `GcpSecretManagerCertificateConfig`, `None` if the field is not set or
6048            /// holds a different branch.
6049            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>>{
6050                #[allow(unreachable_patterns)]
6051                self.certificate_config.as_ref().and_then(|v| match v {
6052                    crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(v) => std::option::Option::Some(v),
6053                    _ => std::option::Option::None,
6054                })
6055            }
6056
6057            /// Sets the value of [certificate_config][crate::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig::certificate_config]
6058            /// to hold a `GcpSecretManagerCertificateConfig`.
6059            ///
6060            /// Note that all the setters affecting `certificate_config` are
6061            /// mutually exclusive.
6062            ///
6063            /// # Example
6064            /// ```ignore,no_run
6065            /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::CertificateAuthorityDomainConfig;
6066            /// use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
6067            /// let x = CertificateAuthorityDomainConfig::new().set_gcp_secret_manager_certificate_config(GCPSecretManagerCertificateConfig::default()/* use setters */);
6068            /// assert!(x.gcp_secret_manager_certificate_config().is_some());
6069            /// ```
6070            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{
6071                self.certificate_config = std::option::Option::Some(
6072                    crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::CertificateConfig::GcpSecretManagerCertificateConfig(
6073                        v.into()
6074                    )
6075                );
6076                self
6077            }
6078        }
6079
6080        impl wkt::message::Message for CertificateAuthorityDomainConfig {
6081            fn typename() -> &'static str {
6082                "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig"
6083            }
6084        }
6085
6086        /// Defines additional types related to [CertificateAuthorityDomainConfig].
6087        pub mod certificate_authority_domain_config {
6088            #[allow(unused_imports)]
6089            use super::*;
6090
6091            /// GCPSecretManagerCertificateConfig configures a secret from
6092            /// [Secret Manager](https://cloud.google.com/secret-manager).
6093            #[derive(Clone, Default, PartialEq)]
6094            #[non_exhaustive]
6095            pub struct GCPSecretManagerCertificateConfig {
6096                /// Secret URI, in the form
6097                /// "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION".
6098                /// Version can be fixed (e.g. "2") or "latest"
6099                pub secret_uri: std::string::String,
6100
6101                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6102            }
6103
6104            impl GCPSecretManagerCertificateConfig {
6105                pub fn new() -> Self {
6106                    std::default::Default::default()
6107                }
6108
6109                /// Sets the value of [secret_uri][crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig::secret_uri].
6110                ///
6111                /// # Example
6112                /// ```ignore,no_run
6113                /// # use google_cloud_container_v1::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig;
6114                /// let x = GCPSecretManagerCertificateConfig::new().set_secret_uri("example");
6115                /// ```
6116                pub fn set_secret_uri<T: std::convert::Into<std::string::String>>(
6117                    mut self,
6118                    v: T,
6119                ) -> Self {
6120                    self.secret_uri = v.into();
6121                    self
6122                }
6123            }
6124
6125            impl wkt::message::Message for GCPSecretManagerCertificateConfig {
6126                fn typename() -> &'static str {
6127                    "type.googleapis.com/google.container.v1.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig"
6128                }
6129            }
6130
6131            /// Certificate access config. The following are supported:
6132            ///
6133            /// - GCPSecretManagerCertificateConfig
6134            #[derive(Clone, Debug, PartialEq)]
6135            #[non_exhaustive]
6136            pub enum CertificateConfig {
6137                /// Google Secret Manager (GCP) certificate configuration.
6138                GcpSecretManagerCertificateConfig(std::boxed::Box<crate::model::containerd_config::private_registry_access_config::certificate_authority_domain_config::GCPSecretManagerCertificateConfig>),
6139            }
6140        }
6141    }
6142
6143    /// Defines writable cgroups configuration.
6144    #[derive(Clone, Default, PartialEq)]
6145    #[non_exhaustive]
6146    pub struct WritableCgroups {
6147        /// Optional. Whether writable cgroups is enabled.
6148        pub enabled: bool,
6149
6150        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6151    }
6152
6153    impl WritableCgroups {
6154        pub fn new() -> Self {
6155            std::default::Default::default()
6156        }
6157
6158        /// Sets the value of [enabled][crate::model::containerd_config::WritableCgroups::enabled].
6159        ///
6160        /// # Example
6161        /// ```ignore,no_run
6162        /// # use google_cloud_container_v1::model::containerd_config::WritableCgroups;
6163        /// let x = WritableCgroups::new().set_enabled(true);
6164        /// ```
6165        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6166            self.enabled = v.into();
6167            self
6168        }
6169    }
6170
6171    impl wkt::message::Message for WritableCgroups {
6172        fn typename() -> &'static str {
6173            "type.googleapis.com/google.container.v1.ContainerdConfig.WritableCgroups"
6174        }
6175    }
6176}
6177
6178/// Kubernetes taint is composed of three fields: key, value, and effect. Effect
6179/// can only be one of three types:  NoSchedule, PreferNoSchedule or NoExecute.
6180///
6181/// See
6182/// [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration)
6183/// for more information, including usage and the valid values.
6184#[derive(Clone, Default, PartialEq)]
6185#[non_exhaustive]
6186pub struct NodeTaint {
6187    /// Key for taint.
6188    pub key: std::string::String,
6189
6190    /// Value for taint.
6191    pub value: std::string::String,
6192
6193    /// Effect for taint.
6194    pub effect: crate::model::node_taint::Effect,
6195
6196    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6197}
6198
6199impl NodeTaint {
6200    pub fn new() -> Self {
6201        std::default::Default::default()
6202    }
6203
6204    /// Sets the value of [key][crate::model::NodeTaint::key].
6205    ///
6206    /// # Example
6207    /// ```ignore,no_run
6208    /// # use google_cloud_container_v1::model::NodeTaint;
6209    /// let x = NodeTaint::new().set_key("example");
6210    /// ```
6211    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212        self.key = v.into();
6213        self
6214    }
6215
6216    /// Sets the value of [value][crate::model::NodeTaint::value].
6217    ///
6218    /// # Example
6219    /// ```ignore,no_run
6220    /// # use google_cloud_container_v1::model::NodeTaint;
6221    /// let x = NodeTaint::new().set_value("example");
6222    /// ```
6223    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224        self.value = v.into();
6225        self
6226    }
6227
6228    /// Sets the value of [effect][crate::model::NodeTaint::effect].
6229    ///
6230    /// # Example
6231    /// ```ignore,no_run
6232    /// # use google_cloud_container_v1::model::NodeTaint;
6233    /// use google_cloud_container_v1::model::node_taint::Effect;
6234    /// let x0 = NodeTaint::new().set_effect(Effect::NoSchedule);
6235    /// let x1 = NodeTaint::new().set_effect(Effect::PreferNoSchedule);
6236    /// let x2 = NodeTaint::new().set_effect(Effect::NoExecute);
6237    /// ```
6238    pub fn set_effect<T: std::convert::Into<crate::model::node_taint::Effect>>(
6239        mut self,
6240        v: T,
6241    ) -> Self {
6242        self.effect = v.into();
6243        self
6244    }
6245}
6246
6247impl wkt::message::Message for NodeTaint {
6248    fn typename() -> &'static str {
6249        "type.googleapis.com/google.container.v1.NodeTaint"
6250    }
6251}
6252
6253/// Defines additional types related to [NodeTaint].
6254pub mod node_taint {
6255    #[allow(unused_imports)]
6256    use super::*;
6257
6258    /// Possible values for Effect in taint.
6259    ///
6260    /// # Working with unknown values
6261    ///
6262    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6263    /// additional enum variants at any time. Adding new variants is not considered
6264    /// a breaking change. Applications should write their code in anticipation of:
6265    ///
6266    /// - New values appearing in future releases of the client library, **and**
6267    /// - New values received dynamically, without application changes.
6268    ///
6269    /// Please consult the [Working with enums] section in the user guide for some
6270    /// guidelines.
6271    ///
6272    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6273    #[derive(Clone, Debug, PartialEq)]
6274    #[non_exhaustive]
6275    pub enum Effect {
6276        /// Not set
6277        Unspecified,
6278        /// NoSchedule
6279        NoSchedule,
6280        /// PreferNoSchedule
6281        PreferNoSchedule,
6282        /// NoExecute
6283        NoExecute,
6284        /// If set, the enum was initialized with an unknown value.
6285        ///
6286        /// Applications can examine the value using [Effect::value] or
6287        /// [Effect::name].
6288        UnknownValue(effect::UnknownValue),
6289    }
6290
6291    #[doc(hidden)]
6292    pub mod effect {
6293        #[allow(unused_imports)]
6294        use super::*;
6295        #[derive(Clone, Debug, PartialEq)]
6296        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6297    }
6298
6299    impl Effect {
6300        /// Gets the enum value.
6301        ///
6302        /// Returns `None` if the enum contains an unknown value deserialized from
6303        /// the string representation of enums.
6304        pub fn value(&self) -> std::option::Option<i32> {
6305            match self {
6306                Self::Unspecified => std::option::Option::Some(0),
6307                Self::NoSchedule => std::option::Option::Some(1),
6308                Self::PreferNoSchedule => std::option::Option::Some(2),
6309                Self::NoExecute => std::option::Option::Some(3),
6310                Self::UnknownValue(u) => u.0.value(),
6311            }
6312        }
6313
6314        /// Gets the enum value as a string.
6315        ///
6316        /// Returns `None` if the enum contains an unknown value deserialized from
6317        /// the integer representation of enums.
6318        pub fn name(&self) -> std::option::Option<&str> {
6319            match self {
6320                Self::Unspecified => std::option::Option::Some("EFFECT_UNSPECIFIED"),
6321                Self::NoSchedule => std::option::Option::Some("NO_SCHEDULE"),
6322                Self::PreferNoSchedule => std::option::Option::Some("PREFER_NO_SCHEDULE"),
6323                Self::NoExecute => std::option::Option::Some("NO_EXECUTE"),
6324                Self::UnknownValue(u) => u.0.name(),
6325            }
6326        }
6327    }
6328
6329    impl std::default::Default for Effect {
6330        fn default() -> Self {
6331            use std::convert::From;
6332            Self::from(0)
6333        }
6334    }
6335
6336    impl std::fmt::Display for Effect {
6337        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6338            wkt::internal::display_enum(f, self.name(), self.value())
6339        }
6340    }
6341
6342    impl std::convert::From<i32> for Effect {
6343        fn from(value: i32) -> Self {
6344            match value {
6345                0 => Self::Unspecified,
6346                1 => Self::NoSchedule,
6347                2 => Self::PreferNoSchedule,
6348                3 => Self::NoExecute,
6349                _ => Self::UnknownValue(effect::UnknownValue(
6350                    wkt::internal::UnknownEnumValue::Integer(value),
6351                )),
6352            }
6353        }
6354    }
6355
6356    impl std::convert::From<&str> for Effect {
6357        fn from(value: &str) -> Self {
6358            use std::string::ToString;
6359            match value {
6360                "EFFECT_UNSPECIFIED" => Self::Unspecified,
6361                "NO_SCHEDULE" => Self::NoSchedule,
6362                "PREFER_NO_SCHEDULE" => Self::PreferNoSchedule,
6363                "NO_EXECUTE" => Self::NoExecute,
6364                _ => Self::UnknownValue(effect::UnknownValue(
6365                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6366                )),
6367            }
6368        }
6369    }
6370
6371    impl serde::ser::Serialize for Effect {
6372        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6373        where
6374            S: serde::Serializer,
6375        {
6376            match self {
6377                Self::Unspecified => serializer.serialize_i32(0),
6378                Self::NoSchedule => serializer.serialize_i32(1),
6379                Self::PreferNoSchedule => serializer.serialize_i32(2),
6380                Self::NoExecute => serializer.serialize_i32(3),
6381                Self::UnknownValue(u) => u.0.serialize(serializer),
6382            }
6383        }
6384    }
6385
6386    impl<'de> serde::de::Deserialize<'de> for Effect {
6387        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6388        where
6389            D: serde::Deserializer<'de>,
6390        {
6391            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Effect>::new(
6392                ".google.container.v1.NodeTaint.Effect",
6393            ))
6394        }
6395    }
6396}
6397
6398/// Collection of Kubernetes [node
6399/// taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration).
6400#[derive(Clone, Default, PartialEq)]
6401#[non_exhaustive]
6402pub struct NodeTaints {
6403    /// List of node taints.
6404    pub taints: std::vec::Vec<crate::model::NodeTaint>,
6405
6406    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6407}
6408
6409impl NodeTaints {
6410    pub fn new() -> Self {
6411        std::default::Default::default()
6412    }
6413
6414    /// Sets the value of [taints][crate::model::NodeTaints::taints].
6415    ///
6416    /// # Example
6417    /// ```ignore,no_run
6418    /// # use google_cloud_container_v1::model::NodeTaints;
6419    /// use google_cloud_container_v1::model::NodeTaint;
6420    /// let x = NodeTaints::new()
6421    ///     .set_taints([
6422    ///         NodeTaint::default()/* use setters */,
6423    ///         NodeTaint::default()/* use (different) setters */,
6424    ///     ]);
6425    /// ```
6426    pub fn set_taints<T, V>(mut self, v: T) -> Self
6427    where
6428        T: std::iter::IntoIterator<Item = V>,
6429        V: std::convert::Into<crate::model::NodeTaint>,
6430    {
6431        use std::iter::Iterator;
6432        self.taints = v.into_iter().map(|i| i.into()).collect();
6433        self
6434    }
6435}
6436
6437impl wkt::message::Message for NodeTaints {
6438    fn typename() -> &'static str {
6439        "type.googleapis.com/google.container.v1.NodeTaints"
6440    }
6441}
6442
6443/// Collection of node-level [Kubernetes
6444/// labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels).
6445#[derive(Clone, Default, PartialEq)]
6446#[non_exhaustive]
6447pub struct NodeLabels {
6448    /// Map of node label keys and node label values.
6449    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6450
6451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6452}
6453
6454impl NodeLabels {
6455    pub fn new() -> Self {
6456        std::default::Default::default()
6457    }
6458
6459    /// Sets the value of [labels][crate::model::NodeLabels::labels].
6460    ///
6461    /// # Example
6462    /// ```ignore,no_run
6463    /// # use google_cloud_container_v1::model::NodeLabels;
6464    /// let x = NodeLabels::new().set_labels([
6465    ///     ("key0", "abc"),
6466    ///     ("key1", "xyz"),
6467    /// ]);
6468    /// ```
6469    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6470    where
6471        T: std::iter::IntoIterator<Item = (K, V)>,
6472        K: std::convert::Into<std::string::String>,
6473        V: std::convert::Into<std::string::String>,
6474    {
6475        use std::iter::Iterator;
6476        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6477        self
6478    }
6479}
6480
6481impl wkt::message::Message for NodeLabels {
6482    fn typename() -> &'static str {
6483        "type.googleapis.com/google.container.v1.NodeLabels"
6484    }
6485}
6486
6487/// Collection of [Resource Manager
6488/// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels).
6489#[derive(Clone, Default, PartialEq)]
6490#[non_exhaustive]
6491pub struct ResourceLabels {
6492    /// Map of node label keys and node label values.
6493    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6494
6495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6496}
6497
6498impl ResourceLabels {
6499    pub fn new() -> Self {
6500        std::default::Default::default()
6501    }
6502
6503    /// Sets the value of [labels][crate::model::ResourceLabels::labels].
6504    ///
6505    /// # Example
6506    /// ```ignore,no_run
6507    /// # use google_cloud_container_v1::model::ResourceLabels;
6508    /// let x = ResourceLabels::new().set_labels([
6509    ///     ("key0", "abc"),
6510    ///     ("key1", "xyz"),
6511    /// ]);
6512    /// ```
6513    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6514    where
6515        T: std::iter::IntoIterator<Item = (K, V)>,
6516        K: std::convert::Into<std::string::String>,
6517        V: std::convert::Into<std::string::String>,
6518    {
6519        use std::iter::Iterator;
6520        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6521        self
6522    }
6523}
6524
6525impl wkt::message::Message for ResourceLabels {
6526    fn typename() -> &'static str {
6527        "type.googleapis.com/google.container.v1.ResourceLabels"
6528    }
6529}
6530
6531/// Collection of Compute Engine network tags that can be applied to a node's
6532/// underlying VM instance.
6533#[derive(Clone, Default, PartialEq)]
6534#[non_exhaustive]
6535pub struct NetworkTags {
6536    /// List of network tags.
6537    pub tags: std::vec::Vec<std::string::String>,
6538
6539    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6540}
6541
6542impl NetworkTags {
6543    pub fn new() -> Self {
6544        std::default::Default::default()
6545    }
6546
6547    /// Sets the value of [tags][crate::model::NetworkTags::tags].
6548    ///
6549    /// # Example
6550    /// ```ignore,no_run
6551    /// # use google_cloud_container_v1::model::NetworkTags;
6552    /// let x = NetworkTags::new().set_tags(["a", "b", "c"]);
6553    /// ```
6554    pub fn set_tags<T, V>(mut self, v: T) -> Self
6555    where
6556        T: std::iter::IntoIterator<Item = V>,
6557        V: std::convert::Into<std::string::String>,
6558    {
6559        use std::iter::Iterator;
6560        self.tags = v.into_iter().map(|i| i.into()).collect();
6561        self
6562    }
6563}
6564
6565impl wkt::message::Message for NetworkTags {
6566    fn typename() -> &'static str {
6567        "type.googleapis.com/google.container.v1.NetworkTags"
6568    }
6569}
6570
6571/// The authentication information for accessing the master endpoint.
6572/// Authentication can be done using HTTP basic auth or using client
6573/// certificates.
6574#[derive(Clone, Default, PartialEq)]
6575#[non_exhaustive]
6576pub struct MasterAuth {
6577    /// The username to use for HTTP basic authentication to the master endpoint.
6578    /// For clusters v1.6.0 and later, basic authentication can be disabled by
6579    /// leaving username unspecified (or setting it to the empty string).
6580    ///
6581    /// Warning: basic authentication is deprecated, and will be removed in GKE
6582    /// control plane versions 1.19 and newer. For a list of recommended
6583    /// authentication methods, see:
6584    /// <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>
6585    #[deprecated]
6586    pub username: std::string::String,
6587
6588    /// The password to use for HTTP basic authentication to the master endpoint.
6589    /// Because the master endpoint is open to the Internet, you should create a
6590    /// strong password.  If a password is provided for cluster creation, username
6591    /// must be non-empty.
6592    ///
6593    /// Warning: basic authentication is deprecated, and will be removed in GKE
6594    /// control plane versions 1.19 and newer. For a list of recommended
6595    /// authentication methods, see:
6596    /// <https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication>
6597    #[deprecated]
6598    pub password: std::string::String,
6599
6600    /// Configuration for client certificate authentication on the cluster. For
6601    /// clusters before v1.12, if no configuration is specified, a client
6602    /// certificate is issued.
6603    pub client_certificate_config: std::option::Option<crate::model::ClientCertificateConfig>,
6604
6605    /// Output only. Base64-encoded public certificate that is the root of
6606    /// trust for the cluster.
6607    pub cluster_ca_certificate: std::string::String,
6608
6609    /// Output only. Base64-encoded public certificate used by clients to
6610    /// authenticate to the cluster endpoint. Issued only if
6611    /// client_certificate_config is set.
6612    pub client_certificate: std::string::String,
6613
6614    /// Output only. Base64-encoded private key used by clients to authenticate
6615    /// to the cluster endpoint.
6616    pub client_key: std::string::String,
6617
6618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6619}
6620
6621impl MasterAuth {
6622    pub fn new() -> Self {
6623        std::default::Default::default()
6624    }
6625
6626    /// Sets the value of [username][crate::model::MasterAuth::username].
6627    ///
6628    /// # Example
6629    /// ```ignore,no_run
6630    /// # use google_cloud_container_v1::model::MasterAuth;
6631    /// let x = MasterAuth::new().set_username("example");
6632    /// ```
6633    #[deprecated]
6634    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6635        self.username = v.into();
6636        self
6637    }
6638
6639    /// Sets the value of [password][crate::model::MasterAuth::password].
6640    ///
6641    /// # Example
6642    /// ```ignore,no_run
6643    /// # use google_cloud_container_v1::model::MasterAuth;
6644    /// let x = MasterAuth::new().set_password("example");
6645    /// ```
6646    #[deprecated]
6647    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6648        self.password = v.into();
6649        self
6650    }
6651
6652    /// Sets the value of [client_certificate_config][crate::model::MasterAuth::client_certificate_config].
6653    ///
6654    /// # Example
6655    /// ```ignore,no_run
6656    /// # use google_cloud_container_v1::model::MasterAuth;
6657    /// use google_cloud_container_v1::model::ClientCertificateConfig;
6658    /// let x = MasterAuth::new().set_client_certificate_config(ClientCertificateConfig::default()/* use setters */);
6659    /// ```
6660    pub fn set_client_certificate_config<T>(mut self, v: T) -> Self
6661    where
6662        T: std::convert::Into<crate::model::ClientCertificateConfig>,
6663    {
6664        self.client_certificate_config = std::option::Option::Some(v.into());
6665        self
6666    }
6667
6668    /// Sets or clears the value of [client_certificate_config][crate::model::MasterAuth::client_certificate_config].
6669    ///
6670    /// # Example
6671    /// ```ignore,no_run
6672    /// # use google_cloud_container_v1::model::MasterAuth;
6673    /// use google_cloud_container_v1::model::ClientCertificateConfig;
6674    /// let x = MasterAuth::new().set_or_clear_client_certificate_config(Some(ClientCertificateConfig::default()/* use setters */));
6675    /// let x = MasterAuth::new().set_or_clear_client_certificate_config(None::<ClientCertificateConfig>);
6676    /// ```
6677    pub fn set_or_clear_client_certificate_config<T>(mut self, v: std::option::Option<T>) -> Self
6678    where
6679        T: std::convert::Into<crate::model::ClientCertificateConfig>,
6680    {
6681        self.client_certificate_config = v.map(|x| x.into());
6682        self
6683    }
6684
6685    /// Sets the value of [cluster_ca_certificate][crate::model::MasterAuth::cluster_ca_certificate].
6686    ///
6687    /// # Example
6688    /// ```ignore,no_run
6689    /// # use google_cloud_container_v1::model::MasterAuth;
6690    /// let x = MasterAuth::new().set_cluster_ca_certificate("example");
6691    /// ```
6692    pub fn set_cluster_ca_certificate<T: std::convert::Into<std::string::String>>(
6693        mut self,
6694        v: T,
6695    ) -> Self {
6696        self.cluster_ca_certificate = v.into();
6697        self
6698    }
6699
6700    /// Sets the value of [client_certificate][crate::model::MasterAuth::client_certificate].
6701    ///
6702    /// # Example
6703    /// ```ignore,no_run
6704    /// # use google_cloud_container_v1::model::MasterAuth;
6705    /// let x = MasterAuth::new().set_client_certificate("example");
6706    /// ```
6707    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6708        mut self,
6709        v: T,
6710    ) -> Self {
6711        self.client_certificate = v.into();
6712        self
6713    }
6714
6715    /// Sets the value of [client_key][crate::model::MasterAuth::client_key].
6716    ///
6717    /// # Example
6718    /// ```ignore,no_run
6719    /// # use google_cloud_container_v1::model::MasterAuth;
6720    /// let x = MasterAuth::new().set_client_key("example");
6721    /// ```
6722    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6723        self.client_key = v.into();
6724        self
6725    }
6726}
6727
6728impl wkt::message::Message for MasterAuth {
6729    fn typename() -> &'static str {
6730        "type.googleapis.com/google.container.v1.MasterAuth"
6731    }
6732}
6733
6734/// Configuration for client certificates on the cluster.
6735#[derive(Clone, Default, PartialEq)]
6736#[non_exhaustive]
6737pub struct ClientCertificateConfig {
6738    /// Issue a client certificate.
6739    pub issue_client_certificate: bool,
6740
6741    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6742}
6743
6744impl ClientCertificateConfig {
6745    pub fn new() -> Self {
6746        std::default::Default::default()
6747    }
6748
6749    /// Sets the value of [issue_client_certificate][crate::model::ClientCertificateConfig::issue_client_certificate].
6750    ///
6751    /// # Example
6752    /// ```ignore,no_run
6753    /// # use google_cloud_container_v1::model::ClientCertificateConfig;
6754    /// let x = ClientCertificateConfig::new().set_issue_client_certificate(true);
6755    /// ```
6756    pub fn set_issue_client_certificate<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6757        self.issue_client_certificate = v.into();
6758        self
6759    }
6760}
6761
6762impl wkt::message::Message for ClientCertificateConfig {
6763    fn typename() -> &'static str {
6764        "type.googleapis.com/google.container.v1.ClientCertificateConfig"
6765    }
6766}
6767
6768/// Configuration for the addons that can be automatically spun up in the
6769/// cluster, enabling additional functionality.
6770#[derive(Clone, Default, PartialEq)]
6771#[non_exhaustive]
6772pub struct AddonsConfig {
6773    /// Configuration for the HTTP (L7) load balancing controller addon, which
6774    /// makes it easy to set up HTTP load balancers for services in a cluster.
6775    pub http_load_balancing: std::option::Option<crate::model::HttpLoadBalancing>,
6776
6777    /// Configuration for the horizontal pod autoscaling feature, which
6778    /// increases or decreases the number of replica pods a replication controller
6779    /// has based on the resource usage of the existing pods.
6780    pub horizontal_pod_autoscaling: std::option::Option<crate::model::HorizontalPodAutoscaling>,
6781
6782    /// Configuration for the Kubernetes Dashboard.
6783    /// This addon is deprecated, and will be disabled in 1.15. It is recommended
6784    /// to use the Cloud Console to manage and monitor your Kubernetes clusters,
6785    /// workloads and applications. For more information, see:
6786    /// <https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards>
6787    #[deprecated]
6788    pub kubernetes_dashboard: std::option::Option<crate::model::KubernetesDashboard>,
6789
6790    /// Configuration for NetworkPolicy. This only tracks whether the addon
6791    /// is enabled or not on the Master, it does not track whether network policy
6792    /// is enabled for the nodes.
6793    pub network_policy_config: std::option::Option<crate::model::NetworkPolicyConfig>,
6794
6795    /// Configuration for the Cloud Run addon, which allows the user to use a
6796    /// managed Knative service.
6797    pub cloud_run_config: std::option::Option<crate::model::CloudRunConfig>,
6798
6799    /// Configuration for NodeLocalDNS, a dns cache running on cluster nodes
6800    pub dns_cache_config: std::option::Option<crate::model::DnsCacheConfig>,
6801
6802    /// Configuration for the ConfigConnector add-on, a Kubernetes
6803    /// extension to manage hosted Google Cloud services through the Kubernetes
6804    /// API.
6805    pub config_connector_config: std::option::Option<crate::model::ConfigConnectorConfig>,
6806
6807    /// Configuration for the Compute Engine Persistent Disk CSI driver.
6808    pub gce_persistent_disk_csi_driver_config:
6809        std::option::Option<crate::model::GcePersistentDiskCsiDriverConfig>,
6810
6811    /// Configuration for the Filestore CSI driver.
6812    pub gcp_filestore_csi_driver_config:
6813        std::option::Option<crate::model::GcpFilestoreCsiDriverConfig>,
6814
6815    /// Configuration for the Backup for GKE agent addon.
6816    pub gke_backup_agent_config: std::option::Option<crate::model::GkeBackupAgentConfig>,
6817
6818    /// Configuration for the Cloud Storage Fuse CSI driver.
6819    pub gcs_fuse_csi_driver_config: std::option::Option<crate::model::GcsFuseCsiDriverConfig>,
6820
6821    /// Optional. Configuration for the StatefulHA add-on.
6822    pub stateful_ha_config: std::option::Option<crate::model::StatefulHAConfig>,
6823
6824    /// Configuration for the Cloud Storage Parallelstore CSI driver.
6825    pub parallelstore_csi_driver_config:
6826        std::option::Option<crate::model::ParallelstoreCsiDriverConfig>,
6827
6828    /// Optional. Configuration for Ray Operator addon.
6829    pub ray_operator_config: std::option::Option<crate::model::RayOperatorConfig>,
6830
6831    /// Configuration for the High Scale Checkpointing add-on.
6832    pub high_scale_checkpointing_config:
6833        std::option::Option<crate::model::HighScaleCheckpointingConfig>,
6834
6835    /// Configuration for the Lustre CSI driver.
6836    pub lustre_csi_driver_config: std::option::Option<crate::model::LustreCsiDriverConfig>,
6837
6838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6839}
6840
6841impl AddonsConfig {
6842    pub fn new() -> Self {
6843        std::default::Default::default()
6844    }
6845
6846    /// Sets the value of [http_load_balancing][crate::model::AddonsConfig::http_load_balancing].
6847    ///
6848    /// # Example
6849    /// ```ignore,no_run
6850    /// # use google_cloud_container_v1::model::AddonsConfig;
6851    /// use google_cloud_container_v1::model::HttpLoadBalancing;
6852    /// let x = AddonsConfig::new().set_http_load_balancing(HttpLoadBalancing::default()/* use setters */);
6853    /// ```
6854    pub fn set_http_load_balancing<T>(mut self, v: T) -> Self
6855    where
6856        T: std::convert::Into<crate::model::HttpLoadBalancing>,
6857    {
6858        self.http_load_balancing = std::option::Option::Some(v.into());
6859        self
6860    }
6861
6862    /// Sets or clears the value of [http_load_balancing][crate::model::AddonsConfig::http_load_balancing].
6863    ///
6864    /// # Example
6865    /// ```ignore,no_run
6866    /// # use google_cloud_container_v1::model::AddonsConfig;
6867    /// use google_cloud_container_v1::model::HttpLoadBalancing;
6868    /// let x = AddonsConfig::new().set_or_clear_http_load_balancing(Some(HttpLoadBalancing::default()/* use setters */));
6869    /// let x = AddonsConfig::new().set_or_clear_http_load_balancing(None::<HttpLoadBalancing>);
6870    /// ```
6871    pub fn set_or_clear_http_load_balancing<T>(mut self, v: std::option::Option<T>) -> Self
6872    where
6873        T: std::convert::Into<crate::model::HttpLoadBalancing>,
6874    {
6875        self.http_load_balancing = v.map(|x| x.into());
6876        self
6877    }
6878
6879    /// Sets the value of [horizontal_pod_autoscaling][crate::model::AddonsConfig::horizontal_pod_autoscaling].
6880    ///
6881    /// # Example
6882    /// ```ignore,no_run
6883    /// # use google_cloud_container_v1::model::AddonsConfig;
6884    /// use google_cloud_container_v1::model::HorizontalPodAutoscaling;
6885    /// let x = AddonsConfig::new().set_horizontal_pod_autoscaling(HorizontalPodAutoscaling::default()/* use setters */);
6886    /// ```
6887    pub fn set_horizontal_pod_autoscaling<T>(mut self, v: T) -> Self
6888    where
6889        T: std::convert::Into<crate::model::HorizontalPodAutoscaling>,
6890    {
6891        self.horizontal_pod_autoscaling = std::option::Option::Some(v.into());
6892        self
6893    }
6894
6895    /// Sets or clears the value of [horizontal_pod_autoscaling][crate::model::AddonsConfig::horizontal_pod_autoscaling].
6896    ///
6897    /// # Example
6898    /// ```ignore,no_run
6899    /// # use google_cloud_container_v1::model::AddonsConfig;
6900    /// use google_cloud_container_v1::model::HorizontalPodAutoscaling;
6901    /// let x = AddonsConfig::new().set_or_clear_horizontal_pod_autoscaling(Some(HorizontalPodAutoscaling::default()/* use setters */));
6902    /// let x = AddonsConfig::new().set_or_clear_horizontal_pod_autoscaling(None::<HorizontalPodAutoscaling>);
6903    /// ```
6904    pub fn set_or_clear_horizontal_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
6905    where
6906        T: std::convert::Into<crate::model::HorizontalPodAutoscaling>,
6907    {
6908        self.horizontal_pod_autoscaling = v.map(|x| x.into());
6909        self
6910    }
6911
6912    /// Sets the value of [kubernetes_dashboard][crate::model::AddonsConfig::kubernetes_dashboard].
6913    ///
6914    /// # Example
6915    /// ```ignore,no_run
6916    /// # use google_cloud_container_v1::model::AddonsConfig;
6917    /// use google_cloud_container_v1::model::KubernetesDashboard;
6918    /// let x = AddonsConfig::new().set_kubernetes_dashboard(KubernetesDashboard::default()/* use setters */);
6919    /// ```
6920    #[deprecated]
6921    pub fn set_kubernetes_dashboard<T>(mut self, v: T) -> Self
6922    where
6923        T: std::convert::Into<crate::model::KubernetesDashboard>,
6924    {
6925        self.kubernetes_dashboard = std::option::Option::Some(v.into());
6926        self
6927    }
6928
6929    /// Sets or clears the value of [kubernetes_dashboard][crate::model::AddonsConfig::kubernetes_dashboard].
6930    ///
6931    /// # Example
6932    /// ```ignore,no_run
6933    /// # use google_cloud_container_v1::model::AddonsConfig;
6934    /// use google_cloud_container_v1::model::KubernetesDashboard;
6935    /// let x = AddonsConfig::new().set_or_clear_kubernetes_dashboard(Some(KubernetesDashboard::default()/* use setters */));
6936    /// let x = AddonsConfig::new().set_or_clear_kubernetes_dashboard(None::<KubernetesDashboard>);
6937    /// ```
6938    #[deprecated]
6939    pub fn set_or_clear_kubernetes_dashboard<T>(mut self, v: std::option::Option<T>) -> Self
6940    where
6941        T: std::convert::Into<crate::model::KubernetesDashboard>,
6942    {
6943        self.kubernetes_dashboard = v.map(|x| x.into());
6944        self
6945    }
6946
6947    /// Sets the value of [network_policy_config][crate::model::AddonsConfig::network_policy_config].
6948    ///
6949    /// # Example
6950    /// ```ignore,no_run
6951    /// # use google_cloud_container_v1::model::AddonsConfig;
6952    /// use google_cloud_container_v1::model::NetworkPolicyConfig;
6953    /// let x = AddonsConfig::new().set_network_policy_config(NetworkPolicyConfig::default()/* use setters */);
6954    /// ```
6955    pub fn set_network_policy_config<T>(mut self, v: T) -> Self
6956    where
6957        T: std::convert::Into<crate::model::NetworkPolicyConfig>,
6958    {
6959        self.network_policy_config = std::option::Option::Some(v.into());
6960        self
6961    }
6962
6963    /// Sets or clears the value of [network_policy_config][crate::model::AddonsConfig::network_policy_config].
6964    ///
6965    /// # Example
6966    /// ```ignore,no_run
6967    /// # use google_cloud_container_v1::model::AddonsConfig;
6968    /// use google_cloud_container_v1::model::NetworkPolicyConfig;
6969    /// let x = AddonsConfig::new().set_or_clear_network_policy_config(Some(NetworkPolicyConfig::default()/* use setters */));
6970    /// let x = AddonsConfig::new().set_or_clear_network_policy_config(None::<NetworkPolicyConfig>);
6971    /// ```
6972    pub fn set_or_clear_network_policy_config<T>(mut self, v: std::option::Option<T>) -> Self
6973    where
6974        T: std::convert::Into<crate::model::NetworkPolicyConfig>,
6975    {
6976        self.network_policy_config = v.map(|x| x.into());
6977        self
6978    }
6979
6980    /// Sets the value of [cloud_run_config][crate::model::AddonsConfig::cloud_run_config].
6981    ///
6982    /// # Example
6983    /// ```ignore,no_run
6984    /// # use google_cloud_container_v1::model::AddonsConfig;
6985    /// use google_cloud_container_v1::model::CloudRunConfig;
6986    /// let x = AddonsConfig::new().set_cloud_run_config(CloudRunConfig::default()/* use setters */);
6987    /// ```
6988    pub fn set_cloud_run_config<T>(mut self, v: T) -> Self
6989    where
6990        T: std::convert::Into<crate::model::CloudRunConfig>,
6991    {
6992        self.cloud_run_config = std::option::Option::Some(v.into());
6993        self
6994    }
6995
6996    /// Sets or clears the value of [cloud_run_config][crate::model::AddonsConfig::cloud_run_config].
6997    ///
6998    /// # Example
6999    /// ```ignore,no_run
7000    /// # use google_cloud_container_v1::model::AddonsConfig;
7001    /// use google_cloud_container_v1::model::CloudRunConfig;
7002    /// let x = AddonsConfig::new().set_or_clear_cloud_run_config(Some(CloudRunConfig::default()/* use setters */));
7003    /// let x = AddonsConfig::new().set_or_clear_cloud_run_config(None::<CloudRunConfig>);
7004    /// ```
7005    pub fn set_or_clear_cloud_run_config<T>(mut self, v: std::option::Option<T>) -> Self
7006    where
7007        T: std::convert::Into<crate::model::CloudRunConfig>,
7008    {
7009        self.cloud_run_config = v.map(|x| x.into());
7010        self
7011    }
7012
7013    /// Sets the value of [dns_cache_config][crate::model::AddonsConfig::dns_cache_config].
7014    ///
7015    /// # Example
7016    /// ```ignore,no_run
7017    /// # use google_cloud_container_v1::model::AddonsConfig;
7018    /// use google_cloud_container_v1::model::DnsCacheConfig;
7019    /// let x = AddonsConfig::new().set_dns_cache_config(DnsCacheConfig::default()/* use setters */);
7020    /// ```
7021    pub fn set_dns_cache_config<T>(mut self, v: T) -> Self
7022    where
7023        T: std::convert::Into<crate::model::DnsCacheConfig>,
7024    {
7025        self.dns_cache_config = std::option::Option::Some(v.into());
7026        self
7027    }
7028
7029    /// Sets or clears the value of [dns_cache_config][crate::model::AddonsConfig::dns_cache_config].
7030    ///
7031    /// # Example
7032    /// ```ignore,no_run
7033    /// # use google_cloud_container_v1::model::AddonsConfig;
7034    /// use google_cloud_container_v1::model::DnsCacheConfig;
7035    /// let x = AddonsConfig::new().set_or_clear_dns_cache_config(Some(DnsCacheConfig::default()/* use setters */));
7036    /// let x = AddonsConfig::new().set_or_clear_dns_cache_config(None::<DnsCacheConfig>);
7037    /// ```
7038    pub fn set_or_clear_dns_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
7039    where
7040        T: std::convert::Into<crate::model::DnsCacheConfig>,
7041    {
7042        self.dns_cache_config = v.map(|x| x.into());
7043        self
7044    }
7045
7046    /// Sets the value of [config_connector_config][crate::model::AddonsConfig::config_connector_config].
7047    ///
7048    /// # Example
7049    /// ```ignore,no_run
7050    /// # use google_cloud_container_v1::model::AddonsConfig;
7051    /// use google_cloud_container_v1::model::ConfigConnectorConfig;
7052    /// let x = AddonsConfig::new().set_config_connector_config(ConfigConnectorConfig::default()/* use setters */);
7053    /// ```
7054    pub fn set_config_connector_config<T>(mut self, v: T) -> Self
7055    where
7056        T: std::convert::Into<crate::model::ConfigConnectorConfig>,
7057    {
7058        self.config_connector_config = std::option::Option::Some(v.into());
7059        self
7060    }
7061
7062    /// Sets or clears the value of [config_connector_config][crate::model::AddonsConfig::config_connector_config].
7063    ///
7064    /// # Example
7065    /// ```ignore,no_run
7066    /// # use google_cloud_container_v1::model::AddonsConfig;
7067    /// use google_cloud_container_v1::model::ConfigConnectorConfig;
7068    /// let x = AddonsConfig::new().set_or_clear_config_connector_config(Some(ConfigConnectorConfig::default()/* use setters */));
7069    /// let x = AddonsConfig::new().set_or_clear_config_connector_config(None::<ConfigConnectorConfig>);
7070    /// ```
7071    pub fn set_or_clear_config_connector_config<T>(mut self, v: std::option::Option<T>) -> Self
7072    where
7073        T: std::convert::Into<crate::model::ConfigConnectorConfig>,
7074    {
7075        self.config_connector_config = v.map(|x| x.into());
7076        self
7077    }
7078
7079    /// Sets the value of [gce_persistent_disk_csi_driver_config][crate::model::AddonsConfig::gce_persistent_disk_csi_driver_config].
7080    ///
7081    /// # Example
7082    /// ```ignore,no_run
7083    /// # use google_cloud_container_v1::model::AddonsConfig;
7084    /// use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
7085    /// let x = AddonsConfig::new().set_gce_persistent_disk_csi_driver_config(GcePersistentDiskCsiDriverConfig::default()/* use setters */);
7086    /// ```
7087    pub fn set_gce_persistent_disk_csi_driver_config<T>(mut self, v: T) -> Self
7088    where
7089        T: std::convert::Into<crate::model::GcePersistentDiskCsiDriverConfig>,
7090    {
7091        self.gce_persistent_disk_csi_driver_config = std::option::Option::Some(v.into());
7092        self
7093    }
7094
7095    /// Sets or clears the value of [gce_persistent_disk_csi_driver_config][crate::model::AddonsConfig::gce_persistent_disk_csi_driver_config].
7096    ///
7097    /// # Example
7098    /// ```ignore,no_run
7099    /// # use google_cloud_container_v1::model::AddonsConfig;
7100    /// use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
7101    /// let x = AddonsConfig::new().set_or_clear_gce_persistent_disk_csi_driver_config(Some(GcePersistentDiskCsiDriverConfig::default()/* use setters */));
7102    /// let x = AddonsConfig::new().set_or_clear_gce_persistent_disk_csi_driver_config(None::<GcePersistentDiskCsiDriverConfig>);
7103    /// ```
7104    pub fn set_or_clear_gce_persistent_disk_csi_driver_config<T>(
7105        mut self,
7106        v: std::option::Option<T>,
7107    ) -> Self
7108    where
7109        T: std::convert::Into<crate::model::GcePersistentDiskCsiDriverConfig>,
7110    {
7111        self.gce_persistent_disk_csi_driver_config = v.map(|x| x.into());
7112        self
7113    }
7114
7115    /// Sets the value of [gcp_filestore_csi_driver_config][crate::model::AddonsConfig::gcp_filestore_csi_driver_config].
7116    ///
7117    /// # Example
7118    /// ```ignore,no_run
7119    /// # use google_cloud_container_v1::model::AddonsConfig;
7120    /// use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
7121    /// let x = AddonsConfig::new().set_gcp_filestore_csi_driver_config(GcpFilestoreCsiDriverConfig::default()/* use setters */);
7122    /// ```
7123    pub fn set_gcp_filestore_csi_driver_config<T>(mut self, v: T) -> Self
7124    where
7125        T: std::convert::Into<crate::model::GcpFilestoreCsiDriverConfig>,
7126    {
7127        self.gcp_filestore_csi_driver_config = std::option::Option::Some(v.into());
7128        self
7129    }
7130
7131    /// Sets or clears the value of [gcp_filestore_csi_driver_config][crate::model::AddonsConfig::gcp_filestore_csi_driver_config].
7132    ///
7133    /// # Example
7134    /// ```ignore,no_run
7135    /// # use google_cloud_container_v1::model::AddonsConfig;
7136    /// use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
7137    /// let x = AddonsConfig::new().set_or_clear_gcp_filestore_csi_driver_config(Some(GcpFilestoreCsiDriverConfig::default()/* use setters */));
7138    /// let x = AddonsConfig::new().set_or_clear_gcp_filestore_csi_driver_config(None::<GcpFilestoreCsiDriverConfig>);
7139    /// ```
7140    pub fn set_or_clear_gcp_filestore_csi_driver_config<T>(
7141        mut self,
7142        v: std::option::Option<T>,
7143    ) -> Self
7144    where
7145        T: std::convert::Into<crate::model::GcpFilestoreCsiDriverConfig>,
7146    {
7147        self.gcp_filestore_csi_driver_config = v.map(|x| x.into());
7148        self
7149    }
7150
7151    /// Sets the value of [gke_backup_agent_config][crate::model::AddonsConfig::gke_backup_agent_config].
7152    ///
7153    /// # Example
7154    /// ```ignore,no_run
7155    /// # use google_cloud_container_v1::model::AddonsConfig;
7156    /// use google_cloud_container_v1::model::GkeBackupAgentConfig;
7157    /// let x = AddonsConfig::new().set_gke_backup_agent_config(GkeBackupAgentConfig::default()/* use setters */);
7158    /// ```
7159    pub fn set_gke_backup_agent_config<T>(mut self, v: T) -> Self
7160    where
7161        T: std::convert::Into<crate::model::GkeBackupAgentConfig>,
7162    {
7163        self.gke_backup_agent_config = std::option::Option::Some(v.into());
7164        self
7165    }
7166
7167    /// Sets or clears the value of [gke_backup_agent_config][crate::model::AddonsConfig::gke_backup_agent_config].
7168    ///
7169    /// # Example
7170    /// ```ignore,no_run
7171    /// # use google_cloud_container_v1::model::AddonsConfig;
7172    /// use google_cloud_container_v1::model::GkeBackupAgentConfig;
7173    /// let x = AddonsConfig::new().set_or_clear_gke_backup_agent_config(Some(GkeBackupAgentConfig::default()/* use setters */));
7174    /// let x = AddonsConfig::new().set_or_clear_gke_backup_agent_config(None::<GkeBackupAgentConfig>);
7175    /// ```
7176    pub fn set_or_clear_gke_backup_agent_config<T>(mut self, v: std::option::Option<T>) -> Self
7177    where
7178        T: std::convert::Into<crate::model::GkeBackupAgentConfig>,
7179    {
7180        self.gke_backup_agent_config = v.map(|x| x.into());
7181        self
7182    }
7183
7184    /// Sets the value of [gcs_fuse_csi_driver_config][crate::model::AddonsConfig::gcs_fuse_csi_driver_config].
7185    ///
7186    /// # Example
7187    /// ```ignore,no_run
7188    /// # use google_cloud_container_v1::model::AddonsConfig;
7189    /// use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
7190    /// let x = AddonsConfig::new().set_gcs_fuse_csi_driver_config(GcsFuseCsiDriverConfig::default()/* use setters */);
7191    /// ```
7192    pub fn set_gcs_fuse_csi_driver_config<T>(mut self, v: T) -> Self
7193    where
7194        T: std::convert::Into<crate::model::GcsFuseCsiDriverConfig>,
7195    {
7196        self.gcs_fuse_csi_driver_config = std::option::Option::Some(v.into());
7197        self
7198    }
7199
7200    /// Sets or clears the value of [gcs_fuse_csi_driver_config][crate::model::AddonsConfig::gcs_fuse_csi_driver_config].
7201    ///
7202    /// # Example
7203    /// ```ignore,no_run
7204    /// # use google_cloud_container_v1::model::AddonsConfig;
7205    /// use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
7206    /// let x = AddonsConfig::new().set_or_clear_gcs_fuse_csi_driver_config(Some(GcsFuseCsiDriverConfig::default()/* use setters */));
7207    /// let x = AddonsConfig::new().set_or_clear_gcs_fuse_csi_driver_config(None::<GcsFuseCsiDriverConfig>);
7208    /// ```
7209    pub fn set_or_clear_gcs_fuse_csi_driver_config<T>(mut self, v: std::option::Option<T>) -> Self
7210    where
7211        T: std::convert::Into<crate::model::GcsFuseCsiDriverConfig>,
7212    {
7213        self.gcs_fuse_csi_driver_config = v.map(|x| x.into());
7214        self
7215    }
7216
7217    /// Sets the value of [stateful_ha_config][crate::model::AddonsConfig::stateful_ha_config].
7218    ///
7219    /// # Example
7220    /// ```ignore,no_run
7221    /// # use google_cloud_container_v1::model::AddonsConfig;
7222    /// use google_cloud_container_v1::model::StatefulHAConfig;
7223    /// let x = AddonsConfig::new().set_stateful_ha_config(StatefulHAConfig::default()/* use setters */);
7224    /// ```
7225    pub fn set_stateful_ha_config<T>(mut self, v: T) -> Self
7226    where
7227        T: std::convert::Into<crate::model::StatefulHAConfig>,
7228    {
7229        self.stateful_ha_config = std::option::Option::Some(v.into());
7230        self
7231    }
7232
7233    /// Sets or clears the value of [stateful_ha_config][crate::model::AddonsConfig::stateful_ha_config].
7234    ///
7235    /// # Example
7236    /// ```ignore,no_run
7237    /// # use google_cloud_container_v1::model::AddonsConfig;
7238    /// use google_cloud_container_v1::model::StatefulHAConfig;
7239    /// let x = AddonsConfig::new().set_or_clear_stateful_ha_config(Some(StatefulHAConfig::default()/* use setters */));
7240    /// let x = AddonsConfig::new().set_or_clear_stateful_ha_config(None::<StatefulHAConfig>);
7241    /// ```
7242    pub fn set_or_clear_stateful_ha_config<T>(mut self, v: std::option::Option<T>) -> Self
7243    where
7244        T: std::convert::Into<crate::model::StatefulHAConfig>,
7245    {
7246        self.stateful_ha_config = v.map(|x| x.into());
7247        self
7248    }
7249
7250    /// Sets the value of [parallelstore_csi_driver_config][crate::model::AddonsConfig::parallelstore_csi_driver_config].
7251    ///
7252    /// # Example
7253    /// ```ignore,no_run
7254    /// # use google_cloud_container_v1::model::AddonsConfig;
7255    /// use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
7256    /// let x = AddonsConfig::new().set_parallelstore_csi_driver_config(ParallelstoreCsiDriverConfig::default()/* use setters */);
7257    /// ```
7258    pub fn set_parallelstore_csi_driver_config<T>(mut self, v: T) -> Self
7259    where
7260        T: std::convert::Into<crate::model::ParallelstoreCsiDriverConfig>,
7261    {
7262        self.parallelstore_csi_driver_config = std::option::Option::Some(v.into());
7263        self
7264    }
7265
7266    /// Sets or clears the value of [parallelstore_csi_driver_config][crate::model::AddonsConfig::parallelstore_csi_driver_config].
7267    ///
7268    /// # Example
7269    /// ```ignore,no_run
7270    /// # use google_cloud_container_v1::model::AddonsConfig;
7271    /// use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
7272    /// let x = AddonsConfig::new().set_or_clear_parallelstore_csi_driver_config(Some(ParallelstoreCsiDriverConfig::default()/* use setters */));
7273    /// let x = AddonsConfig::new().set_or_clear_parallelstore_csi_driver_config(None::<ParallelstoreCsiDriverConfig>);
7274    /// ```
7275    pub fn set_or_clear_parallelstore_csi_driver_config<T>(
7276        mut self,
7277        v: std::option::Option<T>,
7278    ) -> Self
7279    where
7280        T: std::convert::Into<crate::model::ParallelstoreCsiDriverConfig>,
7281    {
7282        self.parallelstore_csi_driver_config = v.map(|x| x.into());
7283        self
7284    }
7285
7286    /// Sets the value of [ray_operator_config][crate::model::AddonsConfig::ray_operator_config].
7287    ///
7288    /// # Example
7289    /// ```ignore,no_run
7290    /// # use google_cloud_container_v1::model::AddonsConfig;
7291    /// use google_cloud_container_v1::model::RayOperatorConfig;
7292    /// let x = AddonsConfig::new().set_ray_operator_config(RayOperatorConfig::default()/* use setters */);
7293    /// ```
7294    pub fn set_ray_operator_config<T>(mut self, v: T) -> Self
7295    where
7296        T: std::convert::Into<crate::model::RayOperatorConfig>,
7297    {
7298        self.ray_operator_config = std::option::Option::Some(v.into());
7299        self
7300    }
7301
7302    /// Sets or clears the value of [ray_operator_config][crate::model::AddonsConfig::ray_operator_config].
7303    ///
7304    /// # Example
7305    /// ```ignore,no_run
7306    /// # use google_cloud_container_v1::model::AddonsConfig;
7307    /// use google_cloud_container_v1::model::RayOperatorConfig;
7308    /// let x = AddonsConfig::new().set_or_clear_ray_operator_config(Some(RayOperatorConfig::default()/* use setters */));
7309    /// let x = AddonsConfig::new().set_or_clear_ray_operator_config(None::<RayOperatorConfig>);
7310    /// ```
7311    pub fn set_or_clear_ray_operator_config<T>(mut self, v: std::option::Option<T>) -> Self
7312    where
7313        T: std::convert::Into<crate::model::RayOperatorConfig>,
7314    {
7315        self.ray_operator_config = v.map(|x| x.into());
7316        self
7317    }
7318
7319    /// Sets the value of [high_scale_checkpointing_config][crate::model::AddonsConfig::high_scale_checkpointing_config].
7320    ///
7321    /// # Example
7322    /// ```ignore,no_run
7323    /// # use google_cloud_container_v1::model::AddonsConfig;
7324    /// use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
7325    /// let x = AddonsConfig::new().set_high_scale_checkpointing_config(HighScaleCheckpointingConfig::default()/* use setters */);
7326    /// ```
7327    pub fn set_high_scale_checkpointing_config<T>(mut self, v: T) -> Self
7328    where
7329        T: std::convert::Into<crate::model::HighScaleCheckpointingConfig>,
7330    {
7331        self.high_scale_checkpointing_config = std::option::Option::Some(v.into());
7332        self
7333    }
7334
7335    /// Sets or clears the value of [high_scale_checkpointing_config][crate::model::AddonsConfig::high_scale_checkpointing_config].
7336    ///
7337    /// # Example
7338    /// ```ignore,no_run
7339    /// # use google_cloud_container_v1::model::AddonsConfig;
7340    /// use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
7341    /// let x = AddonsConfig::new().set_or_clear_high_scale_checkpointing_config(Some(HighScaleCheckpointingConfig::default()/* use setters */));
7342    /// let x = AddonsConfig::new().set_or_clear_high_scale_checkpointing_config(None::<HighScaleCheckpointingConfig>);
7343    /// ```
7344    pub fn set_or_clear_high_scale_checkpointing_config<T>(
7345        mut self,
7346        v: std::option::Option<T>,
7347    ) -> Self
7348    where
7349        T: std::convert::Into<crate::model::HighScaleCheckpointingConfig>,
7350    {
7351        self.high_scale_checkpointing_config = v.map(|x| x.into());
7352        self
7353    }
7354
7355    /// Sets the value of [lustre_csi_driver_config][crate::model::AddonsConfig::lustre_csi_driver_config].
7356    ///
7357    /// # Example
7358    /// ```ignore,no_run
7359    /// # use google_cloud_container_v1::model::AddonsConfig;
7360    /// use google_cloud_container_v1::model::LustreCsiDriverConfig;
7361    /// let x = AddonsConfig::new().set_lustre_csi_driver_config(LustreCsiDriverConfig::default()/* use setters */);
7362    /// ```
7363    pub fn set_lustre_csi_driver_config<T>(mut self, v: T) -> Self
7364    where
7365        T: std::convert::Into<crate::model::LustreCsiDriverConfig>,
7366    {
7367        self.lustre_csi_driver_config = std::option::Option::Some(v.into());
7368        self
7369    }
7370
7371    /// Sets or clears the value of [lustre_csi_driver_config][crate::model::AddonsConfig::lustre_csi_driver_config].
7372    ///
7373    /// # Example
7374    /// ```ignore,no_run
7375    /// # use google_cloud_container_v1::model::AddonsConfig;
7376    /// use google_cloud_container_v1::model::LustreCsiDriverConfig;
7377    /// let x = AddonsConfig::new().set_or_clear_lustre_csi_driver_config(Some(LustreCsiDriverConfig::default()/* use setters */));
7378    /// let x = AddonsConfig::new().set_or_clear_lustre_csi_driver_config(None::<LustreCsiDriverConfig>);
7379    /// ```
7380    pub fn set_or_clear_lustre_csi_driver_config<T>(mut self, v: std::option::Option<T>) -> Self
7381    where
7382        T: std::convert::Into<crate::model::LustreCsiDriverConfig>,
7383    {
7384        self.lustre_csi_driver_config = v.map(|x| x.into());
7385        self
7386    }
7387}
7388
7389impl wkt::message::Message for AddonsConfig {
7390    fn typename() -> &'static str {
7391        "type.googleapis.com/google.container.v1.AddonsConfig"
7392    }
7393}
7394
7395/// Configuration options for the HTTP (L7) load balancing controller addon,
7396/// which makes it easy to set up HTTP load balancers for services in a cluster.
7397#[derive(Clone, Default, PartialEq)]
7398#[non_exhaustive]
7399pub struct HttpLoadBalancing {
7400    /// Whether the HTTP Load Balancing controller is enabled in the cluster.
7401    /// When enabled, it runs a small pod in the cluster that manages the load
7402    /// balancers.
7403    pub disabled: bool,
7404
7405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7406}
7407
7408impl HttpLoadBalancing {
7409    pub fn new() -> Self {
7410        std::default::Default::default()
7411    }
7412
7413    /// Sets the value of [disabled][crate::model::HttpLoadBalancing::disabled].
7414    ///
7415    /// # Example
7416    /// ```ignore,no_run
7417    /// # use google_cloud_container_v1::model::HttpLoadBalancing;
7418    /// let x = HttpLoadBalancing::new().set_disabled(true);
7419    /// ```
7420    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7421        self.disabled = v.into();
7422        self
7423    }
7424}
7425
7426impl wkt::message::Message for HttpLoadBalancing {
7427    fn typename() -> &'static str {
7428        "type.googleapis.com/google.container.v1.HttpLoadBalancing"
7429    }
7430}
7431
7432/// Configuration options for the horizontal pod autoscaling feature, which
7433/// increases or decreases the number of replica pods a replication controller
7434/// has based on the resource usage of the existing pods.
7435#[derive(Clone, Default, PartialEq)]
7436#[non_exhaustive]
7437pub struct HorizontalPodAutoscaling {
7438    /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster.
7439    /// When enabled, it ensures that metrics are collected into Stackdriver
7440    /// Monitoring.
7441    pub disabled: bool,
7442
7443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7444}
7445
7446impl HorizontalPodAutoscaling {
7447    pub fn new() -> Self {
7448        std::default::Default::default()
7449    }
7450
7451    /// Sets the value of [disabled][crate::model::HorizontalPodAutoscaling::disabled].
7452    ///
7453    /// # Example
7454    /// ```ignore,no_run
7455    /// # use google_cloud_container_v1::model::HorizontalPodAutoscaling;
7456    /// let x = HorizontalPodAutoscaling::new().set_disabled(true);
7457    /// ```
7458    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7459        self.disabled = v.into();
7460        self
7461    }
7462}
7463
7464impl wkt::message::Message for HorizontalPodAutoscaling {
7465    fn typename() -> &'static str {
7466        "type.googleapis.com/google.container.v1.HorizontalPodAutoscaling"
7467    }
7468}
7469
7470/// Configuration for the Kubernetes Dashboard.
7471#[derive(Clone, Default, PartialEq)]
7472#[non_exhaustive]
7473pub struct KubernetesDashboard {
7474    /// Whether the Kubernetes Dashboard is enabled for this cluster.
7475    pub disabled: bool,
7476
7477    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7478}
7479
7480impl KubernetesDashboard {
7481    pub fn new() -> Self {
7482        std::default::Default::default()
7483    }
7484
7485    /// Sets the value of [disabled][crate::model::KubernetesDashboard::disabled].
7486    ///
7487    /// # Example
7488    /// ```ignore,no_run
7489    /// # use google_cloud_container_v1::model::KubernetesDashboard;
7490    /// let x = KubernetesDashboard::new().set_disabled(true);
7491    /// ```
7492    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7493        self.disabled = v.into();
7494        self
7495    }
7496}
7497
7498impl wkt::message::Message for KubernetesDashboard {
7499    fn typename() -> &'static str {
7500        "type.googleapis.com/google.container.v1.KubernetesDashboard"
7501    }
7502}
7503
7504/// Configuration for NetworkPolicy. This only tracks whether the addon
7505/// is enabled or not on the Master, it does not track whether network policy
7506/// is enabled for the nodes.
7507#[derive(Clone, Default, PartialEq)]
7508#[non_exhaustive]
7509pub struct NetworkPolicyConfig {
7510    /// Whether NetworkPolicy is enabled for this cluster.
7511    pub disabled: bool,
7512
7513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7514}
7515
7516impl NetworkPolicyConfig {
7517    pub fn new() -> Self {
7518        std::default::Default::default()
7519    }
7520
7521    /// Sets the value of [disabled][crate::model::NetworkPolicyConfig::disabled].
7522    ///
7523    /// # Example
7524    /// ```ignore,no_run
7525    /// # use google_cloud_container_v1::model::NetworkPolicyConfig;
7526    /// let x = NetworkPolicyConfig::new().set_disabled(true);
7527    /// ```
7528    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7529        self.disabled = v.into();
7530        self
7531    }
7532}
7533
7534impl wkt::message::Message for NetworkPolicyConfig {
7535    fn typename() -> &'static str {
7536        "type.googleapis.com/google.container.v1.NetworkPolicyConfig"
7537    }
7538}
7539
7540/// Configuration for NodeLocal DNSCache
7541#[derive(Clone, Default, PartialEq)]
7542#[non_exhaustive]
7543pub struct DnsCacheConfig {
7544    /// Whether NodeLocal DNSCache is enabled for this cluster.
7545    pub enabled: bool,
7546
7547    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7548}
7549
7550impl DnsCacheConfig {
7551    pub fn new() -> Self {
7552        std::default::Default::default()
7553    }
7554
7555    /// Sets the value of [enabled][crate::model::DnsCacheConfig::enabled].
7556    ///
7557    /// # Example
7558    /// ```ignore,no_run
7559    /// # use google_cloud_container_v1::model::DnsCacheConfig;
7560    /// let x = DnsCacheConfig::new().set_enabled(true);
7561    /// ```
7562    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7563        self.enabled = v.into();
7564        self
7565    }
7566}
7567
7568impl wkt::message::Message for DnsCacheConfig {
7569    fn typename() -> &'static str {
7570        "type.googleapis.com/google.container.v1.DnsCacheConfig"
7571    }
7572}
7573
7574/// Configuration for controlling master global access settings.
7575#[derive(Clone, Default, PartialEq)]
7576#[non_exhaustive]
7577pub struct PrivateClusterMasterGlobalAccessConfig {
7578    /// Whenever master is accessible globally or not.
7579    pub enabled: bool,
7580
7581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7582}
7583
7584impl PrivateClusterMasterGlobalAccessConfig {
7585    pub fn new() -> Self {
7586        std::default::Default::default()
7587    }
7588
7589    /// Sets the value of [enabled][crate::model::PrivateClusterMasterGlobalAccessConfig::enabled].
7590    ///
7591    /// # Example
7592    /// ```ignore,no_run
7593    /// # use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
7594    /// let x = PrivateClusterMasterGlobalAccessConfig::new().set_enabled(true);
7595    /// ```
7596    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7597        self.enabled = v.into();
7598        self
7599    }
7600}
7601
7602impl wkt::message::Message for PrivateClusterMasterGlobalAccessConfig {
7603    fn typename() -> &'static str {
7604        "type.googleapis.com/google.container.v1.PrivateClusterMasterGlobalAccessConfig"
7605    }
7606}
7607
7608/// Configuration options for private clusters.
7609#[derive(Clone, Default, PartialEq)]
7610#[non_exhaustive]
7611pub struct PrivateClusterConfig {
7612    /// Whether nodes have internal IP addresses only. If enabled, all nodes are
7613    /// given only RFC 1918 private addresses and communicate with the master via
7614    /// private networking.
7615    ///
7616    /// Deprecated: Use
7617    /// [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes]
7618    /// instead.
7619    ///
7620    /// [google.container.v1.NetworkConfig.default_enable_private_nodes]: crate::model::NetworkConfig::default_enable_private_nodes
7621    #[deprecated]
7622    pub enable_private_nodes: bool,
7623
7624    /// Whether the master's internal IP address is used as the cluster endpoint.
7625    ///
7626    /// Deprecated: Use
7627    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint]
7628    /// instead. Note that the value of enable_public_endpoint is reversed: if
7629    /// enable_private_endpoint is false, then enable_public_endpoint will be true.
7630    ///
7631    /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint
7632    #[deprecated]
7633    pub enable_private_endpoint: bool,
7634
7635    /// The IP range in CIDR notation to use for the hosted master network. This
7636    /// range will be used for assigning internal IP addresses to the master or
7637    /// set of masters, as well as the ILB VIP. This range must not overlap with
7638    /// any other ranges in use within the cluster's network.
7639    pub master_ipv4_cidr_block: std::string::String,
7640
7641    /// Output only. The internal IP address of this cluster's master endpoint.
7642    ///
7643    /// Deprecated: Use
7644    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint]
7645    /// instead.
7646    ///
7647    /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint
7648    #[deprecated]
7649    pub private_endpoint: std::string::String,
7650
7651    /// Output only. The external IP address of this cluster's master endpoint.
7652    ///
7653    /// Deprecated:Use
7654    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint]
7655    /// instead.
7656    ///
7657    /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::public_endpoint
7658    #[deprecated]
7659    pub public_endpoint: std::string::String,
7660
7661    /// Output only. The peering name in the customer VPC used by this cluster.
7662    pub peering_name: std::string::String,
7663
7664    /// Controls master global access settings.
7665    ///
7666    /// Deprecated: Use
7667    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][]
7668    /// instead.
7669    #[deprecated]
7670    pub master_global_access_config:
7671        std::option::Option<crate::model::PrivateClusterMasterGlobalAccessConfig>,
7672
7673    /// Subnet to provision the master's private endpoint during cluster creation.
7674    /// Specified in projects/*/regions/*/subnetworks/* format.
7675    ///
7676    /// Deprecated: Use
7677    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork]
7678    /// instead.
7679    ///
7680    /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint_subnetwork
7681    #[deprecated]
7682    pub private_endpoint_subnetwork: std::string::String,
7683
7684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7685}
7686
7687impl PrivateClusterConfig {
7688    pub fn new() -> Self {
7689        std::default::Default::default()
7690    }
7691
7692    /// Sets the value of [enable_private_nodes][crate::model::PrivateClusterConfig::enable_private_nodes].
7693    ///
7694    /// # Example
7695    /// ```ignore,no_run
7696    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7697    /// let x = PrivateClusterConfig::new().set_enable_private_nodes(true);
7698    /// ```
7699    #[deprecated]
7700    pub fn set_enable_private_nodes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7701        self.enable_private_nodes = v.into();
7702        self
7703    }
7704
7705    /// Sets the value of [enable_private_endpoint][crate::model::PrivateClusterConfig::enable_private_endpoint].
7706    ///
7707    /// # Example
7708    /// ```ignore,no_run
7709    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7710    /// let x = PrivateClusterConfig::new().set_enable_private_endpoint(true);
7711    /// ```
7712    #[deprecated]
7713    pub fn set_enable_private_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7714        self.enable_private_endpoint = v.into();
7715        self
7716    }
7717
7718    /// Sets the value of [master_ipv4_cidr_block][crate::model::PrivateClusterConfig::master_ipv4_cidr_block].
7719    ///
7720    /// # Example
7721    /// ```ignore,no_run
7722    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7723    /// let x = PrivateClusterConfig::new().set_master_ipv4_cidr_block("example");
7724    /// ```
7725    pub fn set_master_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
7726        mut self,
7727        v: T,
7728    ) -> Self {
7729        self.master_ipv4_cidr_block = v.into();
7730        self
7731    }
7732
7733    /// Sets the value of [private_endpoint][crate::model::PrivateClusterConfig::private_endpoint].
7734    ///
7735    /// # Example
7736    /// ```ignore,no_run
7737    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7738    /// let x = PrivateClusterConfig::new().set_private_endpoint("example");
7739    /// ```
7740    #[deprecated]
7741    pub fn set_private_endpoint<T: std::convert::Into<std::string::String>>(
7742        mut self,
7743        v: T,
7744    ) -> Self {
7745        self.private_endpoint = v.into();
7746        self
7747    }
7748
7749    /// Sets the value of [public_endpoint][crate::model::PrivateClusterConfig::public_endpoint].
7750    ///
7751    /// # Example
7752    /// ```ignore,no_run
7753    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7754    /// let x = PrivateClusterConfig::new().set_public_endpoint("example");
7755    /// ```
7756    #[deprecated]
7757    pub fn set_public_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7758        self.public_endpoint = v.into();
7759        self
7760    }
7761
7762    /// Sets the value of [peering_name][crate::model::PrivateClusterConfig::peering_name].
7763    ///
7764    /// # Example
7765    /// ```ignore,no_run
7766    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7767    /// let x = PrivateClusterConfig::new().set_peering_name("example");
7768    /// ```
7769    pub fn set_peering_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7770        self.peering_name = v.into();
7771        self
7772    }
7773
7774    /// Sets the value of [master_global_access_config][crate::model::PrivateClusterConfig::master_global_access_config].
7775    ///
7776    /// # Example
7777    /// ```ignore,no_run
7778    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7779    /// use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
7780    /// let x = PrivateClusterConfig::new().set_master_global_access_config(PrivateClusterMasterGlobalAccessConfig::default()/* use setters */);
7781    /// ```
7782    #[deprecated]
7783    pub fn set_master_global_access_config<T>(mut self, v: T) -> Self
7784    where
7785        T: std::convert::Into<crate::model::PrivateClusterMasterGlobalAccessConfig>,
7786    {
7787        self.master_global_access_config = std::option::Option::Some(v.into());
7788        self
7789    }
7790
7791    /// Sets or clears the value of [master_global_access_config][crate::model::PrivateClusterConfig::master_global_access_config].
7792    ///
7793    /// # Example
7794    /// ```ignore,no_run
7795    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7796    /// use google_cloud_container_v1::model::PrivateClusterMasterGlobalAccessConfig;
7797    /// let x = PrivateClusterConfig::new().set_or_clear_master_global_access_config(Some(PrivateClusterMasterGlobalAccessConfig::default()/* use setters */));
7798    /// let x = PrivateClusterConfig::new().set_or_clear_master_global_access_config(None::<PrivateClusterMasterGlobalAccessConfig>);
7799    /// ```
7800    #[deprecated]
7801    pub fn set_or_clear_master_global_access_config<T>(mut self, v: std::option::Option<T>) -> Self
7802    where
7803        T: std::convert::Into<crate::model::PrivateClusterMasterGlobalAccessConfig>,
7804    {
7805        self.master_global_access_config = v.map(|x| x.into());
7806        self
7807    }
7808
7809    /// Sets the value of [private_endpoint_subnetwork][crate::model::PrivateClusterConfig::private_endpoint_subnetwork].
7810    ///
7811    /// # Example
7812    /// ```ignore,no_run
7813    /// # use google_cloud_container_v1::model::PrivateClusterConfig;
7814    /// let x = PrivateClusterConfig::new().set_private_endpoint_subnetwork("example");
7815    /// ```
7816    #[deprecated]
7817    pub fn set_private_endpoint_subnetwork<T: std::convert::Into<std::string::String>>(
7818        mut self,
7819        v: T,
7820    ) -> Self {
7821        self.private_endpoint_subnetwork = v.into();
7822        self
7823    }
7824}
7825
7826impl wkt::message::Message for PrivateClusterConfig {
7827    fn typename() -> &'static str {
7828        "type.googleapis.com/google.container.v1.PrivateClusterConfig"
7829    }
7830}
7831
7832/// Configuration for returning group information from authenticators.
7833#[derive(Clone, Default, PartialEq)]
7834#[non_exhaustive]
7835pub struct AuthenticatorGroupsConfig {
7836    /// Whether this cluster should return group membership lookups
7837    /// during authentication using a group of security groups.
7838    pub enabled: bool,
7839
7840    /// The name of the security group-of-groups to be used. Only relevant
7841    /// if enabled = true.
7842    pub security_group: std::string::String,
7843
7844    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7845}
7846
7847impl AuthenticatorGroupsConfig {
7848    pub fn new() -> Self {
7849        std::default::Default::default()
7850    }
7851
7852    /// Sets the value of [enabled][crate::model::AuthenticatorGroupsConfig::enabled].
7853    ///
7854    /// # Example
7855    /// ```ignore,no_run
7856    /// # use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
7857    /// let x = AuthenticatorGroupsConfig::new().set_enabled(true);
7858    /// ```
7859    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7860        self.enabled = v.into();
7861        self
7862    }
7863
7864    /// Sets the value of [security_group][crate::model::AuthenticatorGroupsConfig::security_group].
7865    ///
7866    /// # Example
7867    /// ```ignore,no_run
7868    /// # use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
7869    /// let x = AuthenticatorGroupsConfig::new().set_security_group("example");
7870    /// ```
7871    pub fn set_security_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7872        self.security_group = v.into();
7873        self
7874    }
7875}
7876
7877impl wkt::message::Message for AuthenticatorGroupsConfig {
7878    fn typename() -> &'static str {
7879        "type.googleapis.com/google.container.v1.AuthenticatorGroupsConfig"
7880    }
7881}
7882
7883/// Configuration options for the Cloud Run feature.
7884#[derive(Clone, Default, PartialEq)]
7885#[non_exhaustive]
7886pub struct CloudRunConfig {
7887    /// Whether Cloud Run addon is enabled for this cluster.
7888    pub disabled: bool,
7889
7890    /// Which load balancer type is installed for Cloud Run.
7891    pub load_balancer_type: crate::model::cloud_run_config::LoadBalancerType,
7892
7893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7894}
7895
7896impl CloudRunConfig {
7897    pub fn new() -> Self {
7898        std::default::Default::default()
7899    }
7900
7901    /// Sets the value of [disabled][crate::model::CloudRunConfig::disabled].
7902    ///
7903    /// # Example
7904    /// ```ignore,no_run
7905    /// # use google_cloud_container_v1::model::CloudRunConfig;
7906    /// let x = CloudRunConfig::new().set_disabled(true);
7907    /// ```
7908    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7909        self.disabled = v.into();
7910        self
7911    }
7912
7913    /// Sets the value of [load_balancer_type][crate::model::CloudRunConfig::load_balancer_type].
7914    ///
7915    /// # Example
7916    /// ```ignore,no_run
7917    /// # use google_cloud_container_v1::model::CloudRunConfig;
7918    /// use google_cloud_container_v1::model::cloud_run_config::LoadBalancerType;
7919    /// let x0 = CloudRunConfig::new().set_load_balancer_type(LoadBalancerType::External);
7920    /// let x1 = CloudRunConfig::new().set_load_balancer_type(LoadBalancerType::Internal);
7921    /// ```
7922    pub fn set_load_balancer_type<
7923        T: std::convert::Into<crate::model::cloud_run_config::LoadBalancerType>,
7924    >(
7925        mut self,
7926        v: T,
7927    ) -> Self {
7928        self.load_balancer_type = v.into();
7929        self
7930    }
7931}
7932
7933impl wkt::message::Message for CloudRunConfig {
7934    fn typename() -> &'static str {
7935        "type.googleapis.com/google.container.v1.CloudRunConfig"
7936    }
7937}
7938
7939/// Defines additional types related to [CloudRunConfig].
7940pub mod cloud_run_config {
7941    #[allow(unused_imports)]
7942    use super::*;
7943
7944    /// Load balancer type of ingress service of Cloud Run.
7945    ///
7946    /// # Working with unknown values
7947    ///
7948    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7949    /// additional enum variants at any time. Adding new variants is not considered
7950    /// a breaking change. Applications should write their code in anticipation of:
7951    ///
7952    /// - New values appearing in future releases of the client library, **and**
7953    /// - New values received dynamically, without application changes.
7954    ///
7955    /// Please consult the [Working with enums] section in the user guide for some
7956    /// guidelines.
7957    ///
7958    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7959    #[derive(Clone, Debug, PartialEq)]
7960    #[non_exhaustive]
7961    pub enum LoadBalancerType {
7962        /// Load balancer type for Cloud Run is unspecified.
7963        Unspecified,
7964        /// Install external load balancer for Cloud Run.
7965        External,
7966        /// Install internal load balancer for Cloud Run.
7967        Internal,
7968        /// If set, the enum was initialized with an unknown value.
7969        ///
7970        /// Applications can examine the value using [LoadBalancerType::value] or
7971        /// [LoadBalancerType::name].
7972        UnknownValue(load_balancer_type::UnknownValue),
7973    }
7974
7975    #[doc(hidden)]
7976    pub mod load_balancer_type {
7977        #[allow(unused_imports)]
7978        use super::*;
7979        #[derive(Clone, Debug, PartialEq)]
7980        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7981    }
7982
7983    impl LoadBalancerType {
7984        /// Gets the enum value.
7985        ///
7986        /// Returns `None` if the enum contains an unknown value deserialized from
7987        /// the string representation of enums.
7988        pub fn value(&self) -> std::option::Option<i32> {
7989            match self {
7990                Self::Unspecified => std::option::Option::Some(0),
7991                Self::External => std::option::Option::Some(1),
7992                Self::Internal => std::option::Option::Some(2),
7993                Self::UnknownValue(u) => u.0.value(),
7994            }
7995        }
7996
7997        /// Gets the enum value as a string.
7998        ///
7999        /// Returns `None` if the enum contains an unknown value deserialized from
8000        /// the integer representation of enums.
8001        pub fn name(&self) -> std::option::Option<&str> {
8002            match self {
8003                Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
8004                Self::External => std::option::Option::Some("LOAD_BALANCER_TYPE_EXTERNAL"),
8005                Self::Internal => std::option::Option::Some("LOAD_BALANCER_TYPE_INTERNAL"),
8006                Self::UnknownValue(u) => u.0.name(),
8007            }
8008        }
8009    }
8010
8011    impl std::default::Default for LoadBalancerType {
8012        fn default() -> Self {
8013            use std::convert::From;
8014            Self::from(0)
8015        }
8016    }
8017
8018    impl std::fmt::Display for LoadBalancerType {
8019        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8020            wkt::internal::display_enum(f, self.name(), self.value())
8021        }
8022    }
8023
8024    impl std::convert::From<i32> for LoadBalancerType {
8025        fn from(value: i32) -> Self {
8026            match value {
8027                0 => Self::Unspecified,
8028                1 => Self::External,
8029                2 => Self::Internal,
8030                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
8031                    wkt::internal::UnknownEnumValue::Integer(value),
8032                )),
8033            }
8034        }
8035    }
8036
8037    impl std::convert::From<&str> for LoadBalancerType {
8038        fn from(value: &str) -> Self {
8039            use std::string::ToString;
8040            match value {
8041                "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
8042                "LOAD_BALANCER_TYPE_EXTERNAL" => Self::External,
8043                "LOAD_BALANCER_TYPE_INTERNAL" => Self::Internal,
8044                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
8045                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8046                )),
8047            }
8048        }
8049    }
8050
8051    impl serde::ser::Serialize for LoadBalancerType {
8052        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8053        where
8054            S: serde::Serializer,
8055        {
8056            match self {
8057                Self::Unspecified => serializer.serialize_i32(0),
8058                Self::External => serializer.serialize_i32(1),
8059                Self::Internal => serializer.serialize_i32(2),
8060                Self::UnknownValue(u) => u.0.serialize(serializer),
8061            }
8062        }
8063    }
8064
8065    impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
8066        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8067        where
8068            D: serde::Deserializer<'de>,
8069        {
8070            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
8071                ".google.container.v1.CloudRunConfig.LoadBalancerType",
8072            ))
8073        }
8074    }
8075}
8076
8077/// Configuration options for the Config Connector add-on.
8078#[derive(Clone, Default, PartialEq)]
8079#[non_exhaustive]
8080pub struct ConfigConnectorConfig {
8081    /// Whether Cloud Connector is enabled for this cluster.
8082    pub enabled: bool,
8083
8084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8085}
8086
8087impl ConfigConnectorConfig {
8088    pub fn new() -> Self {
8089        std::default::Default::default()
8090    }
8091
8092    /// Sets the value of [enabled][crate::model::ConfigConnectorConfig::enabled].
8093    ///
8094    /// # Example
8095    /// ```ignore,no_run
8096    /// # use google_cloud_container_v1::model::ConfigConnectorConfig;
8097    /// let x = ConfigConnectorConfig::new().set_enabled(true);
8098    /// ```
8099    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8100        self.enabled = v.into();
8101        self
8102    }
8103}
8104
8105impl wkt::message::Message for ConfigConnectorConfig {
8106    fn typename() -> &'static str {
8107        "type.googleapis.com/google.container.v1.ConfigConnectorConfig"
8108    }
8109}
8110
8111/// Configuration for the Compute Engine PD CSI driver.
8112#[derive(Clone, Default, PartialEq)]
8113#[non_exhaustive]
8114pub struct GcePersistentDiskCsiDriverConfig {
8115    /// Whether the Compute Engine PD CSI driver is enabled for this cluster.
8116    pub enabled: bool,
8117
8118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8119}
8120
8121impl GcePersistentDiskCsiDriverConfig {
8122    pub fn new() -> Self {
8123        std::default::Default::default()
8124    }
8125
8126    /// Sets the value of [enabled][crate::model::GcePersistentDiskCsiDriverConfig::enabled].
8127    ///
8128    /// # Example
8129    /// ```ignore,no_run
8130    /// # use google_cloud_container_v1::model::GcePersistentDiskCsiDriverConfig;
8131    /// let x = GcePersistentDiskCsiDriverConfig::new().set_enabled(true);
8132    /// ```
8133    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8134        self.enabled = v.into();
8135        self
8136    }
8137}
8138
8139impl wkt::message::Message for GcePersistentDiskCsiDriverConfig {
8140    fn typename() -> &'static str {
8141        "type.googleapis.com/google.container.v1.GcePersistentDiskCsiDriverConfig"
8142    }
8143}
8144
8145/// Configuration for the Filestore CSI driver.
8146#[derive(Clone, Default, PartialEq)]
8147#[non_exhaustive]
8148pub struct GcpFilestoreCsiDriverConfig {
8149    /// Whether the Filestore CSI driver is enabled for this cluster.
8150    pub enabled: bool,
8151
8152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8153}
8154
8155impl GcpFilestoreCsiDriverConfig {
8156    pub fn new() -> Self {
8157        std::default::Default::default()
8158    }
8159
8160    /// Sets the value of [enabled][crate::model::GcpFilestoreCsiDriverConfig::enabled].
8161    ///
8162    /// # Example
8163    /// ```ignore,no_run
8164    /// # use google_cloud_container_v1::model::GcpFilestoreCsiDriverConfig;
8165    /// let x = GcpFilestoreCsiDriverConfig::new().set_enabled(true);
8166    /// ```
8167    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8168        self.enabled = v.into();
8169        self
8170    }
8171}
8172
8173impl wkt::message::Message for GcpFilestoreCsiDriverConfig {
8174    fn typename() -> &'static str {
8175        "type.googleapis.com/google.container.v1.GcpFilestoreCsiDriverConfig"
8176    }
8177}
8178
8179/// Configuration for the Cloud Storage Fuse CSI driver.
8180#[derive(Clone, Default, PartialEq)]
8181#[non_exhaustive]
8182pub struct GcsFuseCsiDriverConfig {
8183    /// Whether the Cloud Storage Fuse CSI driver is enabled for this cluster.
8184    pub enabled: bool,
8185
8186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8187}
8188
8189impl GcsFuseCsiDriverConfig {
8190    pub fn new() -> Self {
8191        std::default::Default::default()
8192    }
8193
8194    /// Sets the value of [enabled][crate::model::GcsFuseCsiDriverConfig::enabled].
8195    ///
8196    /// # Example
8197    /// ```ignore,no_run
8198    /// # use google_cloud_container_v1::model::GcsFuseCsiDriverConfig;
8199    /// let x = GcsFuseCsiDriverConfig::new().set_enabled(true);
8200    /// ```
8201    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8202        self.enabled = v.into();
8203        self
8204    }
8205}
8206
8207impl wkt::message::Message for GcsFuseCsiDriverConfig {
8208    fn typename() -> &'static str {
8209        "type.googleapis.com/google.container.v1.GcsFuseCsiDriverConfig"
8210    }
8211}
8212
8213/// Configuration for the Cloud Storage Parallelstore CSI driver.
8214#[derive(Clone, Default, PartialEq)]
8215#[non_exhaustive]
8216pub struct ParallelstoreCsiDriverConfig {
8217    /// Whether the Cloud Storage Parallelstore CSI driver is enabled for this
8218    /// cluster.
8219    pub enabled: bool,
8220
8221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8222}
8223
8224impl ParallelstoreCsiDriverConfig {
8225    pub fn new() -> Self {
8226        std::default::Default::default()
8227    }
8228
8229    /// Sets the value of [enabled][crate::model::ParallelstoreCsiDriverConfig::enabled].
8230    ///
8231    /// # Example
8232    /// ```ignore,no_run
8233    /// # use google_cloud_container_v1::model::ParallelstoreCsiDriverConfig;
8234    /// let x = ParallelstoreCsiDriverConfig::new().set_enabled(true);
8235    /// ```
8236    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8237        self.enabled = v.into();
8238        self
8239    }
8240}
8241
8242impl wkt::message::Message for ParallelstoreCsiDriverConfig {
8243    fn typename() -> &'static str {
8244        "type.googleapis.com/google.container.v1.ParallelstoreCsiDriverConfig"
8245    }
8246}
8247
8248/// Configuration for the High Scale Checkpointing.
8249#[derive(Clone, Default, PartialEq)]
8250#[non_exhaustive]
8251pub struct HighScaleCheckpointingConfig {
8252    /// Whether the High Scale Checkpointing is enabled for this
8253    /// cluster.
8254    pub enabled: bool,
8255
8256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8257}
8258
8259impl HighScaleCheckpointingConfig {
8260    pub fn new() -> Self {
8261        std::default::Default::default()
8262    }
8263
8264    /// Sets the value of [enabled][crate::model::HighScaleCheckpointingConfig::enabled].
8265    ///
8266    /// # Example
8267    /// ```ignore,no_run
8268    /// # use google_cloud_container_v1::model::HighScaleCheckpointingConfig;
8269    /// let x = HighScaleCheckpointingConfig::new().set_enabled(true);
8270    /// ```
8271    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8272        self.enabled = v.into();
8273        self
8274    }
8275}
8276
8277impl wkt::message::Message for HighScaleCheckpointingConfig {
8278    fn typename() -> &'static str {
8279        "type.googleapis.com/google.container.v1.HighScaleCheckpointingConfig"
8280    }
8281}
8282
8283/// Configuration for the Lustre CSI driver.
8284#[derive(Clone, Default, PartialEq)]
8285#[non_exhaustive]
8286pub struct LustreCsiDriverConfig {
8287    /// Whether the Lustre CSI driver is enabled for this cluster.
8288    pub enabled: bool,
8289
8290    /// If set to true, the Lustre CSI driver will install Lustre kernel modules
8291    /// using port 6988.
8292    /// This serves as a workaround for a port conflict with the
8293    /// gke-metadata-server. This field is required ONLY under the following
8294    /// conditions:
8295    ///
8296    /// 1. The GKE node version is older than 1.33.2-gke.4655000.
8297    /// 1. You're connecting to a Lustre instance that has the
8298    ///    'gke-support-enabled' flag.
8299    ///    Deprecated: This flag is no longer required as of GKE node version
8300    ///    1.33.2-gke.4655000, unless you are connecting to a Lustre instance
8301    ///    that has the `gke-support-enabled` flag.
8302    #[deprecated]
8303    pub enable_legacy_lustre_port: bool,
8304
8305    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8306}
8307
8308impl LustreCsiDriverConfig {
8309    pub fn new() -> Self {
8310        std::default::Default::default()
8311    }
8312
8313    /// Sets the value of [enabled][crate::model::LustreCsiDriverConfig::enabled].
8314    ///
8315    /// # Example
8316    /// ```ignore,no_run
8317    /// # use google_cloud_container_v1::model::LustreCsiDriverConfig;
8318    /// let x = LustreCsiDriverConfig::new().set_enabled(true);
8319    /// ```
8320    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8321        self.enabled = v.into();
8322        self
8323    }
8324
8325    /// Sets the value of [enable_legacy_lustre_port][crate::model::LustreCsiDriverConfig::enable_legacy_lustre_port].
8326    ///
8327    /// # Example
8328    /// ```ignore,no_run
8329    /// # use google_cloud_container_v1::model::LustreCsiDriverConfig;
8330    /// let x = LustreCsiDriverConfig::new().set_enable_legacy_lustre_port(true);
8331    /// ```
8332    #[deprecated]
8333    pub fn set_enable_legacy_lustre_port<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8334        self.enable_legacy_lustre_port = v.into();
8335        self
8336    }
8337}
8338
8339impl wkt::message::Message for LustreCsiDriverConfig {
8340    fn typename() -> &'static str {
8341        "type.googleapis.com/google.container.v1.LustreCsiDriverConfig"
8342    }
8343}
8344
8345/// Configuration options for the Ray Operator add-on.
8346#[derive(Clone, Default, PartialEq)]
8347#[non_exhaustive]
8348pub struct RayOperatorConfig {
8349    /// Whether the Ray Operator addon is enabled for this cluster.
8350    pub enabled: bool,
8351
8352    /// Optional. Logging configuration for Ray clusters.
8353    pub ray_cluster_logging_config: std::option::Option<crate::model::RayClusterLoggingConfig>,
8354
8355    /// Optional. Monitoring configuration for Ray clusters.
8356    pub ray_cluster_monitoring_config:
8357        std::option::Option<crate::model::RayClusterMonitoringConfig>,
8358
8359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8360}
8361
8362impl RayOperatorConfig {
8363    pub fn new() -> Self {
8364        std::default::Default::default()
8365    }
8366
8367    /// Sets the value of [enabled][crate::model::RayOperatorConfig::enabled].
8368    ///
8369    /// # Example
8370    /// ```ignore,no_run
8371    /// # use google_cloud_container_v1::model::RayOperatorConfig;
8372    /// let x = RayOperatorConfig::new().set_enabled(true);
8373    /// ```
8374    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8375        self.enabled = v.into();
8376        self
8377    }
8378
8379    /// Sets the value of [ray_cluster_logging_config][crate::model::RayOperatorConfig::ray_cluster_logging_config].
8380    ///
8381    /// # Example
8382    /// ```ignore,no_run
8383    /// # use google_cloud_container_v1::model::RayOperatorConfig;
8384    /// use google_cloud_container_v1::model::RayClusterLoggingConfig;
8385    /// let x = RayOperatorConfig::new().set_ray_cluster_logging_config(RayClusterLoggingConfig::default()/* use setters */);
8386    /// ```
8387    pub fn set_ray_cluster_logging_config<T>(mut self, v: T) -> Self
8388    where
8389        T: std::convert::Into<crate::model::RayClusterLoggingConfig>,
8390    {
8391        self.ray_cluster_logging_config = std::option::Option::Some(v.into());
8392        self
8393    }
8394
8395    /// Sets or clears the value of [ray_cluster_logging_config][crate::model::RayOperatorConfig::ray_cluster_logging_config].
8396    ///
8397    /// # Example
8398    /// ```ignore,no_run
8399    /// # use google_cloud_container_v1::model::RayOperatorConfig;
8400    /// use google_cloud_container_v1::model::RayClusterLoggingConfig;
8401    /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_logging_config(Some(RayClusterLoggingConfig::default()/* use setters */));
8402    /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_logging_config(None::<RayClusterLoggingConfig>);
8403    /// ```
8404    pub fn set_or_clear_ray_cluster_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
8405    where
8406        T: std::convert::Into<crate::model::RayClusterLoggingConfig>,
8407    {
8408        self.ray_cluster_logging_config = v.map(|x| x.into());
8409        self
8410    }
8411
8412    /// Sets the value of [ray_cluster_monitoring_config][crate::model::RayOperatorConfig::ray_cluster_monitoring_config].
8413    ///
8414    /// # Example
8415    /// ```ignore,no_run
8416    /// # use google_cloud_container_v1::model::RayOperatorConfig;
8417    /// use google_cloud_container_v1::model::RayClusterMonitoringConfig;
8418    /// let x = RayOperatorConfig::new().set_ray_cluster_monitoring_config(RayClusterMonitoringConfig::default()/* use setters */);
8419    /// ```
8420    pub fn set_ray_cluster_monitoring_config<T>(mut self, v: T) -> Self
8421    where
8422        T: std::convert::Into<crate::model::RayClusterMonitoringConfig>,
8423    {
8424        self.ray_cluster_monitoring_config = std::option::Option::Some(v.into());
8425        self
8426    }
8427
8428    /// Sets or clears the value of [ray_cluster_monitoring_config][crate::model::RayOperatorConfig::ray_cluster_monitoring_config].
8429    ///
8430    /// # Example
8431    /// ```ignore,no_run
8432    /// # use google_cloud_container_v1::model::RayOperatorConfig;
8433    /// use google_cloud_container_v1::model::RayClusterMonitoringConfig;
8434    /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_monitoring_config(Some(RayClusterMonitoringConfig::default()/* use setters */));
8435    /// let x = RayOperatorConfig::new().set_or_clear_ray_cluster_monitoring_config(None::<RayClusterMonitoringConfig>);
8436    /// ```
8437    pub fn set_or_clear_ray_cluster_monitoring_config<T>(
8438        mut self,
8439        v: std::option::Option<T>,
8440    ) -> Self
8441    where
8442        T: std::convert::Into<crate::model::RayClusterMonitoringConfig>,
8443    {
8444        self.ray_cluster_monitoring_config = v.map(|x| x.into());
8445        self
8446    }
8447}
8448
8449impl wkt::message::Message for RayOperatorConfig {
8450    fn typename() -> &'static str {
8451        "type.googleapis.com/google.container.v1.RayOperatorConfig"
8452    }
8453}
8454
8455/// Configuration for the Backup for GKE Agent.
8456#[derive(Clone, Default, PartialEq)]
8457#[non_exhaustive]
8458pub struct GkeBackupAgentConfig {
8459    /// Whether the Backup for GKE agent is enabled for this cluster.
8460    pub enabled: bool,
8461
8462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8463}
8464
8465impl GkeBackupAgentConfig {
8466    pub fn new() -> Self {
8467        std::default::Default::default()
8468    }
8469
8470    /// Sets the value of [enabled][crate::model::GkeBackupAgentConfig::enabled].
8471    ///
8472    /// # Example
8473    /// ```ignore,no_run
8474    /// # use google_cloud_container_v1::model::GkeBackupAgentConfig;
8475    /// let x = GkeBackupAgentConfig::new().set_enabled(true);
8476    /// ```
8477    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8478        self.enabled = v.into();
8479        self
8480    }
8481}
8482
8483impl wkt::message::Message for GkeBackupAgentConfig {
8484    fn typename() -> &'static str {
8485        "type.googleapis.com/google.container.v1.GkeBackupAgentConfig"
8486    }
8487}
8488
8489/// Configuration for the Stateful HA add-on.
8490#[derive(Clone, Default, PartialEq)]
8491#[non_exhaustive]
8492pub struct StatefulHAConfig {
8493    /// Whether the Stateful HA add-on is enabled for this cluster.
8494    pub enabled: bool,
8495
8496    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8497}
8498
8499impl StatefulHAConfig {
8500    pub fn new() -> Self {
8501        std::default::Default::default()
8502    }
8503
8504    /// Sets the value of [enabled][crate::model::StatefulHAConfig::enabled].
8505    ///
8506    /// # Example
8507    /// ```ignore,no_run
8508    /// # use google_cloud_container_v1::model::StatefulHAConfig;
8509    /// let x = StatefulHAConfig::new().set_enabled(true);
8510    /// ```
8511    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8512        self.enabled = v.into();
8513        self
8514    }
8515}
8516
8517impl wkt::message::Message for StatefulHAConfig {
8518    fn typename() -> &'static str {
8519        "type.googleapis.com/google.container.v1.StatefulHAConfig"
8520    }
8521}
8522
8523/// Configuration options for the master authorized networks feature. Enabled
8524/// master authorized networks will disallow all external traffic to access
8525/// Kubernetes master through HTTPS except traffic from the given CIDR blocks,
8526/// Google Compute Engine Public IPs and Google Prod IPs.
8527#[derive(Clone, Default, PartialEq)]
8528#[non_exhaustive]
8529pub struct MasterAuthorizedNetworksConfig {
8530    /// Whether or not master authorized networks is enabled.
8531    pub enabled: bool,
8532
8533    /// cidr_blocks define up to 50 external networks that could access
8534    /// Kubernetes master through HTTPS.
8535    pub cidr_blocks: std::vec::Vec<crate::model::master_authorized_networks_config::CidrBlock>,
8536
8537    /// Whether master is accessible via Google Compute Engine Public IP addresses.
8538    pub gcp_public_cidrs_access_enabled: std::option::Option<bool>,
8539
8540    /// Whether master authorized networks is enforced on private endpoint or not.
8541    pub private_endpoint_enforcement_enabled: std::option::Option<bool>,
8542
8543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8544}
8545
8546impl MasterAuthorizedNetworksConfig {
8547    pub fn new() -> Self {
8548        std::default::Default::default()
8549    }
8550
8551    /// Sets the value of [enabled][crate::model::MasterAuthorizedNetworksConfig::enabled].
8552    ///
8553    /// # Example
8554    /// ```ignore,no_run
8555    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8556    /// let x = MasterAuthorizedNetworksConfig::new().set_enabled(true);
8557    /// ```
8558    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8559        self.enabled = v.into();
8560        self
8561    }
8562
8563    /// Sets the value of [cidr_blocks][crate::model::MasterAuthorizedNetworksConfig::cidr_blocks].
8564    ///
8565    /// # Example
8566    /// ```ignore,no_run
8567    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8568    /// use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
8569    /// let x = MasterAuthorizedNetworksConfig::new()
8570    ///     .set_cidr_blocks([
8571    ///         CidrBlock::default()/* use setters */,
8572    ///         CidrBlock::default()/* use (different) setters */,
8573    ///     ]);
8574    /// ```
8575    pub fn set_cidr_blocks<T, V>(mut self, v: T) -> Self
8576    where
8577        T: std::iter::IntoIterator<Item = V>,
8578        V: std::convert::Into<crate::model::master_authorized_networks_config::CidrBlock>,
8579    {
8580        use std::iter::Iterator;
8581        self.cidr_blocks = v.into_iter().map(|i| i.into()).collect();
8582        self
8583    }
8584
8585    /// Sets the value of [gcp_public_cidrs_access_enabled][crate::model::MasterAuthorizedNetworksConfig::gcp_public_cidrs_access_enabled].
8586    ///
8587    /// # Example
8588    /// ```ignore,no_run
8589    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8590    /// let x = MasterAuthorizedNetworksConfig::new().set_gcp_public_cidrs_access_enabled(true);
8591    /// ```
8592    pub fn set_gcp_public_cidrs_access_enabled<T>(mut self, v: T) -> Self
8593    where
8594        T: std::convert::Into<bool>,
8595    {
8596        self.gcp_public_cidrs_access_enabled = std::option::Option::Some(v.into());
8597        self
8598    }
8599
8600    /// Sets or clears the value of [gcp_public_cidrs_access_enabled][crate::model::MasterAuthorizedNetworksConfig::gcp_public_cidrs_access_enabled].
8601    ///
8602    /// # Example
8603    /// ```ignore,no_run
8604    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8605    /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_gcp_public_cidrs_access_enabled(Some(false));
8606    /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_gcp_public_cidrs_access_enabled(None::<bool>);
8607    /// ```
8608    pub fn set_or_clear_gcp_public_cidrs_access_enabled<T>(
8609        mut self,
8610        v: std::option::Option<T>,
8611    ) -> Self
8612    where
8613        T: std::convert::Into<bool>,
8614    {
8615        self.gcp_public_cidrs_access_enabled = v.map(|x| x.into());
8616        self
8617    }
8618
8619    /// Sets the value of [private_endpoint_enforcement_enabled][crate::model::MasterAuthorizedNetworksConfig::private_endpoint_enforcement_enabled].
8620    ///
8621    /// # Example
8622    /// ```ignore,no_run
8623    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8624    /// let x = MasterAuthorizedNetworksConfig::new().set_private_endpoint_enforcement_enabled(true);
8625    /// ```
8626    pub fn set_private_endpoint_enforcement_enabled<T>(mut self, v: T) -> Self
8627    where
8628        T: std::convert::Into<bool>,
8629    {
8630        self.private_endpoint_enforcement_enabled = std::option::Option::Some(v.into());
8631        self
8632    }
8633
8634    /// Sets or clears the value of [private_endpoint_enforcement_enabled][crate::model::MasterAuthorizedNetworksConfig::private_endpoint_enforcement_enabled].
8635    ///
8636    /// # Example
8637    /// ```ignore,no_run
8638    /// # use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
8639    /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_private_endpoint_enforcement_enabled(Some(false));
8640    /// let x = MasterAuthorizedNetworksConfig::new().set_or_clear_private_endpoint_enforcement_enabled(None::<bool>);
8641    /// ```
8642    pub fn set_or_clear_private_endpoint_enforcement_enabled<T>(
8643        mut self,
8644        v: std::option::Option<T>,
8645    ) -> Self
8646    where
8647        T: std::convert::Into<bool>,
8648    {
8649        self.private_endpoint_enforcement_enabled = v.map(|x| x.into());
8650        self
8651    }
8652}
8653
8654impl wkt::message::Message for MasterAuthorizedNetworksConfig {
8655    fn typename() -> &'static str {
8656        "type.googleapis.com/google.container.v1.MasterAuthorizedNetworksConfig"
8657    }
8658}
8659
8660/// Defines additional types related to [MasterAuthorizedNetworksConfig].
8661pub mod master_authorized_networks_config {
8662    #[allow(unused_imports)]
8663    use super::*;
8664
8665    /// CidrBlock contains an optional name and one CIDR block.
8666    #[derive(Clone, Default, PartialEq)]
8667    #[non_exhaustive]
8668    pub struct CidrBlock {
8669        /// display_name is an optional field for users to identify CIDR blocks.
8670        pub display_name: std::string::String,
8671
8672        /// cidr_block must be specified in CIDR notation.
8673        pub cidr_block: std::string::String,
8674
8675        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8676    }
8677
8678    impl CidrBlock {
8679        pub fn new() -> Self {
8680            std::default::Default::default()
8681        }
8682
8683        /// Sets the value of [display_name][crate::model::master_authorized_networks_config::CidrBlock::display_name].
8684        ///
8685        /// # Example
8686        /// ```ignore,no_run
8687        /// # use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
8688        /// let x = CidrBlock::new().set_display_name("example");
8689        /// ```
8690        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
8691            mut self,
8692            v: T,
8693        ) -> Self {
8694            self.display_name = v.into();
8695            self
8696        }
8697
8698        /// Sets the value of [cidr_block][crate::model::master_authorized_networks_config::CidrBlock::cidr_block].
8699        ///
8700        /// # Example
8701        /// ```ignore,no_run
8702        /// # use google_cloud_container_v1::model::master_authorized_networks_config::CidrBlock;
8703        /// let x = CidrBlock::new().set_cidr_block("example");
8704        /// ```
8705        pub fn set_cidr_block<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8706            self.cidr_block = v.into();
8707            self
8708        }
8709    }
8710
8711    impl wkt::message::Message for CidrBlock {
8712        fn typename() -> &'static str {
8713            "type.googleapis.com/google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock"
8714        }
8715    }
8716}
8717
8718/// Configuration for the legacy Attribute Based Access Control authorization
8719/// mode.
8720#[derive(Clone, Default, PartialEq)]
8721#[non_exhaustive]
8722pub struct LegacyAbac {
8723    /// Whether the ABAC authorizer is enabled for this cluster. When enabled,
8724    /// identities in the system, including service accounts, nodes, and
8725    /// controllers, will have statically granted permissions beyond those
8726    /// provided by the RBAC configuration or IAM.
8727    pub enabled: bool,
8728
8729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8730}
8731
8732impl LegacyAbac {
8733    pub fn new() -> Self {
8734        std::default::Default::default()
8735    }
8736
8737    /// Sets the value of [enabled][crate::model::LegacyAbac::enabled].
8738    ///
8739    /// # Example
8740    /// ```ignore,no_run
8741    /// # use google_cloud_container_v1::model::LegacyAbac;
8742    /// let x = LegacyAbac::new().set_enabled(true);
8743    /// ```
8744    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8745        self.enabled = v.into();
8746        self
8747    }
8748}
8749
8750impl wkt::message::Message for LegacyAbac {
8751    fn typename() -> &'static str {
8752        "type.googleapis.com/google.container.v1.LegacyAbac"
8753    }
8754}
8755
8756/// Configuration options for the NetworkPolicy feature.
8757/// <https://kubernetes.io/docs/concepts/services-networking/networkpolicies/>
8758#[derive(Clone, Default, PartialEq)]
8759#[non_exhaustive]
8760pub struct NetworkPolicy {
8761    /// The selected network policy provider.
8762    pub provider: crate::model::network_policy::Provider,
8763
8764    /// Whether network policy is enabled on the cluster.
8765    pub enabled: bool,
8766
8767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8768}
8769
8770impl NetworkPolicy {
8771    pub fn new() -> Self {
8772        std::default::Default::default()
8773    }
8774
8775    /// Sets the value of [provider][crate::model::NetworkPolicy::provider].
8776    ///
8777    /// # Example
8778    /// ```ignore,no_run
8779    /// # use google_cloud_container_v1::model::NetworkPolicy;
8780    /// use google_cloud_container_v1::model::network_policy::Provider;
8781    /// let x0 = NetworkPolicy::new().set_provider(Provider::Calico);
8782    /// ```
8783    pub fn set_provider<T: std::convert::Into<crate::model::network_policy::Provider>>(
8784        mut self,
8785        v: T,
8786    ) -> Self {
8787        self.provider = v.into();
8788        self
8789    }
8790
8791    /// Sets the value of [enabled][crate::model::NetworkPolicy::enabled].
8792    ///
8793    /// # Example
8794    /// ```ignore,no_run
8795    /// # use google_cloud_container_v1::model::NetworkPolicy;
8796    /// let x = NetworkPolicy::new().set_enabled(true);
8797    /// ```
8798    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8799        self.enabled = v.into();
8800        self
8801    }
8802}
8803
8804impl wkt::message::Message for NetworkPolicy {
8805    fn typename() -> &'static str {
8806        "type.googleapis.com/google.container.v1.NetworkPolicy"
8807    }
8808}
8809
8810/// Defines additional types related to [NetworkPolicy].
8811pub mod network_policy {
8812    #[allow(unused_imports)]
8813    use super::*;
8814
8815    /// Allowed Network Policy providers.
8816    ///
8817    /// # Working with unknown values
8818    ///
8819    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8820    /// additional enum variants at any time. Adding new variants is not considered
8821    /// a breaking change. Applications should write their code in anticipation of:
8822    ///
8823    /// - New values appearing in future releases of the client library, **and**
8824    /// - New values received dynamically, without application changes.
8825    ///
8826    /// Please consult the [Working with enums] section in the user guide for some
8827    /// guidelines.
8828    ///
8829    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8830    #[derive(Clone, Debug, PartialEq)]
8831    #[non_exhaustive]
8832    pub enum Provider {
8833        /// Not set
8834        Unspecified,
8835        /// Tigera (Calico Felix).
8836        Calico,
8837        /// If set, the enum was initialized with an unknown value.
8838        ///
8839        /// Applications can examine the value using [Provider::value] or
8840        /// [Provider::name].
8841        UnknownValue(provider::UnknownValue),
8842    }
8843
8844    #[doc(hidden)]
8845    pub mod provider {
8846        #[allow(unused_imports)]
8847        use super::*;
8848        #[derive(Clone, Debug, PartialEq)]
8849        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8850    }
8851
8852    impl Provider {
8853        /// Gets the enum value.
8854        ///
8855        /// Returns `None` if the enum contains an unknown value deserialized from
8856        /// the string representation of enums.
8857        pub fn value(&self) -> std::option::Option<i32> {
8858            match self {
8859                Self::Unspecified => std::option::Option::Some(0),
8860                Self::Calico => std::option::Option::Some(1),
8861                Self::UnknownValue(u) => u.0.value(),
8862            }
8863        }
8864
8865        /// Gets the enum value as a string.
8866        ///
8867        /// Returns `None` if the enum contains an unknown value deserialized from
8868        /// the integer representation of enums.
8869        pub fn name(&self) -> std::option::Option<&str> {
8870            match self {
8871                Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
8872                Self::Calico => std::option::Option::Some("CALICO"),
8873                Self::UnknownValue(u) => u.0.name(),
8874            }
8875        }
8876    }
8877
8878    impl std::default::Default for Provider {
8879        fn default() -> Self {
8880            use std::convert::From;
8881            Self::from(0)
8882        }
8883    }
8884
8885    impl std::fmt::Display for Provider {
8886        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8887            wkt::internal::display_enum(f, self.name(), self.value())
8888        }
8889    }
8890
8891    impl std::convert::From<i32> for Provider {
8892        fn from(value: i32) -> Self {
8893            match value {
8894                0 => Self::Unspecified,
8895                1 => Self::Calico,
8896                _ => Self::UnknownValue(provider::UnknownValue(
8897                    wkt::internal::UnknownEnumValue::Integer(value),
8898                )),
8899            }
8900        }
8901    }
8902
8903    impl std::convert::From<&str> for Provider {
8904        fn from(value: &str) -> Self {
8905            use std::string::ToString;
8906            match value {
8907                "PROVIDER_UNSPECIFIED" => Self::Unspecified,
8908                "CALICO" => Self::Calico,
8909                _ => Self::UnknownValue(provider::UnknownValue(
8910                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8911                )),
8912            }
8913        }
8914    }
8915
8916    impl serde::ser::Serialize for Provider {
8917        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8918        where
8919            S: serde::Serializer,
8920        {
8921            match self {
8922                Self::Unspecified => serializer.serialize_i32(0),
8923                Self::Calico => serializer.serialize_i32(1),
8924                Self::UnknownValue(u) => u.0.serialize(serializer),
8925            }
8926        }
8927    }
8928
8929    impl<'de> serde::de::Deserialize<'de> for Provider {
8930        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8931        where
8932            D: serde::Deserializer<'de>,
8933        {
8934            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
8935                ".google.container.v1.NetworkPolicy.Provider",
8936            ))
8937        }
8938    }
8939}
8940
8941/// Configuration for Binary Authorization.
8942#[derive(Clone, Default, PartialEq)]
8943#[non_exhaustive]
8944pub struct BinaryAuthorization {
8945    /// This field is deprecated. Leave this unset and instead configure
8946    /// BinaryAuthorization using evaluation_mode. If evaluation_mode is set to
8947    /// anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored.
8948    #[deprecated]
8949    pub enabled: bool,
8950
8951    /// Mode of operation for binauthz policy evaluation. If unspecified, defaults
8952    /// to DISABLED.
8953    pub evaluation_mode: crate::model::binary_authorization::EvaluationMode,
8954
8955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8956}
8957
8958impl BinaryAuthorization {
8959    pub fn new() -> Self {
8960        std::default::Default::default()
8961    }
8962
8963    /// Sets the value of [enabled][crate::model::BinaryAuthorization::enabled].
8964    ///
8965    /// # Example
8966    /// ```ignore,no_run
8967    /// # use google_cloud_container_v1::model::BinaryAuthorization;
8968    /// let x = BinaryAuthorization::new().set_enabled(true);
8969    /// ```
8970    #[deprecated]
8971    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8972        self.enabled = v.into();
8973        self
8974    }
8975
8976    /// Sets the value of [evaluation_mode][crate::model::BinaryAuthorization::evaluation_mode].
8977    ///
8978    /// # Example
8979    /// ```ignore,no_run
8980    /// # use google_cloud_container_v1::model::BinaryAuthorization;
8981    /// use google_cloud_container_v1::model::binary_authorization::EvaluationMode;
8982    /// let x0 = BinaryAuthorization::new().set_evaluation_mode(EvaluationMode::Disabled);
8983    /// let x1 = BinaryAuthorization::new().set_evaluation_mode(EvaluationMode::ProjectSingletonPolicyEnforce);
8984    /// ```
8985    pub fn set_evaluation_mode<
8986        T: std::convert::Into<crate::model::binary_authorization::EvaluationMode>,
8987    >(
8988        mut self,
8989        v: T,
8990    ) -> Self {
8991        self.evaluation_mode = v.into();
8992        self
8993    }
8994}
8995
8996impl wkt::message::Message for BinaryAuthorization {
8997    fn typename() -> &'static str {
8998        "type.googleapis.com/google.container.v1.BinaryAuthorization"
8999    }
9000}
9001
9002/// Defines additional types related to [BinaryAuthorization].
9003pub mod binary_authorization {
9004    #[allow(unused_imports)]
9005    use super::*;
9006
9007    /// Binary Authorization mode of operation.
9008    ///
9009    /// # Working with unknown values
9010    ///
9011    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9012    /// additional enum variants at any time. Adding new variants is not considered
9013    /// a breaking change. Applications should write their code in anticipation of:
9014    ///
9015    /// - New values appearing in future releases of the client library, **and**
9016    /// - New values received dynamically, without application changes.
9017    ///
9018    /// Please consult the [Working with enums] section in the user guide for some
9019    /// guidelines.
9020    ///
9021    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9022    #[derive(Clone, Debug, PartialEq)]
9023    #[non_exhaustive]
9024    pub enum EvaluationMode {
9025        /// Default value
9026        Unspecified,
9027        /// Disable BinaryAuthorization
9028        Disabled,
9029        /// Enforce Kubernetes admission requests with BinaryAuthorization using the
9030        /// project's singleton policy. This is equivalent to setting the
9031        /// enabled boolean to true.
9032        ProjectSingletonPolicyEnforce,
9033        /// If set, the enum was initialized with an unknown value.
9034        ///
9035        /// Applications can examine the value using [EvaluationMode::value] or
9036        /// [EvaluationMode::name].
9037        UnknownValue(evaluation_mode::UnknownValue),
9038    }
9039
9040    #[doc(hidden)]
9041    pub mod evaluation_mode {
9042        #[allow(unused_imports)]
9043        use super::*;
9044        #[derive(Clone, Debug, PartialEq)]
9045        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9046    }
9047
9048    impl EvaluationMode {
9049        /// Gets the enum value.
9050        ///
9051        /// Returns `None` if the enum contains an unknown value deserialized from
9052        /// the string representation of enums.
9053        pub fn value(&self) -> std::option::Option<i32> {
9054            match self {
9055                Self::Unspecified => std::option::Option::Some(0),
9056                Self::Disabled => std::option::Option::Some(1),
9057                Self::ProjectSingletonPolicyEnforce => std::option::Option::Some(2),
9058                Self::UnknownValue(u) => u.0.value(),
9059            }
9060        }
9061
9062        /// Gets the enum value as a string.
9063        ///
9064        /// Returns `None` if the enum contains an unknown value deserialized from
9065        /// the integer representation of enums.
9066        pub fn name(&self) -> std::option::Option<&str> {
9067            match self {
9068                Self::Unspecified => std::option::Option::Some("EVALUATION_MODE_UNSPECIFIED"),
9069                Self::Disabled => std::option::Option::Some("DISABLED"),
9070                Self::ProjectSingletonPolicyEnforce => {
9071                    std::option::Option::Some("PROJECT_SINGLETON_POLICY_ENFORCE")
9072                }
9073                Self::UnknownValue(u) => u.0.name(),
9074            }
9075        }
9076    }
9077
9078    impl std::default::Default for EvaluationMode {
9079        fn default() -> Self {
9080            use std::convert::From;
9081            Self::from(0)
9082        }
9083    }
9084
9085    impl std::fmt::Display for EvaluationMode {
9086        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9087            wkt::internal::display_enum(f, self.name(), self.value())
9088        }
9089    }
9090
9091    impl std::convert::From<i32> for EvaluationMode {
9092        fn from(value: i32) -> Self {
9093            match value {
9094                0 => Self::Unspecified,
9095                1 => Self::Disabled,
9096                2 => Self::ProjectSingletonPolicyEnforce,
9097                _ => Self::UnknownValue(evaluation_mode::UnknownValue(
9098                    wkt::internal::UnknownEnumValue::Integer(value),
9099                )),
9100            }
9101        }
9102    }
9103
9104    impl std::convert::From<&str> for EvaluationMode {
9105        fn from(value: &str) -> Self {
9106            use std::string::ToString;
9107            match value {
9108                "EVALUATION_MODE_UNSPECIFIED" => Self::Unspecified,
9109                "DISABLED" => Self::Disabled,
9110                "PROJECT_SINGLETON_POLICY_ENFORCE" => Self::ProjectSingletonPolicyEnforce,
9111                _ => Self::UnknownValue(evaluation_mode::UnknownValue(
9112                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9113                )),
9114            }
9115        }
9116    }
9117
9118    impl serde::ser::Serialize for EvaluationMode {
9119        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9120        where
9121            S: serde::Serializer,
9122        {
9123            match self {
9124                Self::Unspecified => serializer.serialize_i32(0),
9125                Self::Disabled => serializer.serialize_i32(1),
9126                Self::ProjectSingletonPolicyEnforce => serializer.serialize_i32(2),
9127                Self::UnknownValue(u) => u.0.serialize(serializer),
9128            }
9129        }
9130    }
9131
9132    impl<'de> serde::de::Deserialize<'de> for EvaluationMode {
9133        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9134        where
9135            D: serde::Deserializer<'de>,
9136        {
9137            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationMode>::new(
9138                ".google.container.v1.BinaryAuthorization.EvaluationMode",
9139            ))
9140        }
9141    }
9142}
9143
9144/// [PRIVATE FIELD]
9145/// Config for pod CIDR size overprovisioning.
9146#[derive(Clone, Default, PartialEq)]
9147#[non_exhaustive]
9148pub struct PodCIDROverprovisionConfig {
9149    /// Whether Pod CIDR overprovisioning is disabled.
9150    /// Note: Pod CIDR overprovisioning is enabled by default.
9151    pub disable: bool,
9152
9153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9154}
9155
9156impl PodCIDROverprovisionConfig {
9157    pub fn new() -> Self {
9158        std::default::Default::default()
9159    }
9160
9161    /// Sets the value of [disable][crate::model::PodCIDROverprovisionConfig::disable].
9162    ///
9163    /// # Example
9164    /// ```ignore,no_run
9165    /// # use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
9166    /// let x = PodCIDROverprovisionConfig::new().set_disable(true);
9167    /// ```
9168    pub fn set_disable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9169        self.disable = v.into();
9170        self
9171    }
9172}
9173
9174impl wkt::message::Message for PodCIDROverprovisionConfig {
9175    fn typename() -> &'static str {
9176        "type.googleapis.com/google.container.v1.PodCIDROverprovisionConfig"
9177    }
9178}
9179
9180/// Configuration for controlling how IPs are allocated in the cluster.
9181#[derive(Clone, Default, PartialEq)]
9182#[non_exhaustive]
9183pub struct IPAllocationPolicy {
9184    /// Whether alias IPs will be used for pod IPs in the cluster.
9185    /// This is used in conjunction with use_routes. It cannot
9186    /// be true if use_routes is true. If both use_ip_aliases and use_routes are
9187    /// false, then the server picks the default IP allocation mode
9188    pub use_ip_aliases: bool,
9189
9190    /// Whether a new subnetwork will be created automatically for the cluster.
9191    ///
9192    /// This field is only applicable when `use_ip_aliases` is true.
9193    pub create_subnetwork: bool,
9194
9195    /// A custom subnetwork name to be used if `create_subnetwork` is true.  If
9196    /// this field is empty, then an automatic name will be chosen for the new
9197    /// subnetwork.
9198    pub subnetwork_name: std::string::String,
9199
9200    /// This field is deprecated, use cluster_ipv4_cidr_block.
9201    #[deprecated]
9202    pub cluster_ipv4_cidr: std::string::String,
9203
9204    /// This field is deprecated, use node_ipv4_cidr_block.
9205    #[deprecated]
9206    pub node_ipv4_cidr: std::string::String,
9207
9208    /// This field is deprecated, use services_ipv4_cidr_block.
9209    #[deprecated]
9210    pub services_ipv4_cidr: std::string::String,
9211
9212    /// The name of the secondary range to be used for the cluster CIDR
9213    /// block.  The secondary range will be used for pod IP
9214    /// addresses. This must be an existing secondary range associated
9215    /// with the cluster subnetwork.
9216    ///
9217    /// This field is only applicable with use_ip_aliases is true and
9218    /// create_subnetwork is false.
9219    pub cluster_secondary_range_name: std::string::String,
9220
9221    /// The name of the secondary range to be used as for the services
9222    /// CIDR block.  The secondary range will be used for service
9223    /// ClusterIPs. This must be an existing secondary range associated
9224    /// with the cluster subnetwork.
9225    ///
9226    /// This field is only applicable with use_ip_aliases is true and
9227    /// create_subnetwork is false.
9228    pub services_secondary_range_name: std::string::String,
9229
9230    /// The IP address range for the cluster pod IPs. If this field is set, then
9231    /// `cluster.cluster_ipv4_cidr` must be left blank.
9232    ///
9233    /// This field is only applicable when `use_ip_aliases` is true.
9234    ///
9235    /// Set to blank to have a range chosen with the default size.
9236    ///
9237    /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
9238    /// netmask.
9239    ///
9240    /// Set to a
9241    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
9242    /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
9243    /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
9244    /// to use.
9245    pub cluster_ipv4_cidr_block: std::string::String,
9246
9247    /// The IP address range of the instance IPs in this cluster.
9248    ///
9249    /// This is applicable only if `create_subnetwork` is true.
9250    ///
9251    /// Set to blank to have a range chosen with the default size.
9252    ///
9253    /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
9254    /// netmask.
9255    ///
9256    /// Set to a
9257    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
9258    /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
9259    /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
9260    /// to use.
9261    pub node_ipv4_cidr_block: std::string::String,
9262
9263    /// The IP address range of the services IPs in this cluster. If blank, a range
9264    /// will be automatically chosen with the default size.
9265    ///
9266    /// This field is only applicable when `use_ip_aliases` is true.
9267    ///
9268    /// Set to blank to have a range chosen with the default size.
9269    ///
9270    /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
9271    /// netmask.
9272    ///
9273    /// Set to a
9274    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
9275    /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
9276    /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
9277    /// to use.
9278    pub services_ipv4_cidr_block: std::string::String,
9279
9280    /// The IP address range of the Cloud TPUs in this cluster. If unspecified, a
9281    /// range will be automatically chosen with the default size.
9282    ///
9283    /// This field is only applicable when `use_ip_aliases` is true.
9284    ///
9285    /// If unspecified, the range will use the default size.
9286    ///
9287    /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific
9288    /// netmask.
9289    ///
9290    /// Set to a
9291    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
9292    /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.
9293    /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
9294    /// to use.
9295    ///
9296    /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
9297    /// date for 2VM TPU is 2025-04-25.
9298    #[deprecated]
9299    pub tpu_ipv4_cidr_block: std::string::String,
9300
9301    /// Whether routes will be used for pod IPs in the cluster.
9302    /// This is used in conjunction with use_ip_aliases. It cannot be true if
9303    /// use_ip_aliases is true. If both use_ip_aliases and use_routes are false,
9304    /// then the server picks the default IP allocation mode
9305    pub use_routes: bool,
9306
9307    /// The IP stack type of the cluster
9308    pub stack_type: crate::model::StackType,
9309
9310    /// The ipv6 access type (internal or external) when create_subnetwork is true
9311    pub ipv6_access_type: crate::model::IPv6AccessType,
9312
9313    /// [PRIVATE FIELD]
9314    /// Pod CIDR size overprovisioning config for the cluster.
9315    ///
9316    /// Pod CIDR size per node depends on max_pods_per_node. By default, the value
9317    /// of max_pods_per_node is doubled and then rounded off to next power of 2 to
9318    /// get the size of pod CIDR block per node.
9319    /// Example: max_pods_per_node of 30 would result in 64 IPs (/26).
9320    ///
9321    /// This config can disable the doubling of IPs (we still round off to next
9322    /// power of 2)
9323    /// Example: max_pods_per_node of 30 will result in 32 IPs (/27) when
9324    /// overprovisioning is disabled.
9325    pub pod_cidr_overprovision_config:
9326        std::option::Option<crate::model::PodCIDROverprovisionConfig>,
9327
9328    /// Output only. The subnet's IPv6 CIDR block used by nodes and pods.
9329    pub subnet_ipv6_cidr_block: std::string::String,
9330
9331    /// Output only. The services IPv6 CIDR block for the cluster.
9332    pub services_ipv6_cidr_block: std::string::String,
9333
9334    /// Output only. The additional pod ranges that are added to the cluster.
9335    /// These pod ranges can be used by new node pools to allocate pod IPs
9336    /// automatically. Once the range is removed it will not show up in
9337    /// IPAllocationPolicy.
9338    pub additional_pod_ranges_config: std::option::Option<crate::model::AdditionalPodRangesConfig>,
9339
9340    /// Output only. The utilization of the cluster default IPv4 range for the
9341    /// pod. The ratio is Usage/[Total number of IPs in the secondary range],
9342    /// Usage=numNodes*numZones*podIPsPerNode.
9343    pub default_pod_ipv4_range_utilization: f64,
9344
9345    /// Output only. The additional IP ranges that are added to the cluster.
9346    /// These IP ranges can be used by new node pools to allocate node and pod IPs
9347    /// automatically.
9348    /// Each AdditionalIPRangesConfig corresponds to a single subnetwork.
9349    /// Once a range is removed it will not show up in IPAllocationPolicy.
9350    pub additional_ip_ranges_configs: std::vec::Vec<crate::model::AdditionalIPRangesConfig>,
9351
9352    /// Optional. AutoIpamConfig contains all information related to Auto IPAM
9353    pub auto_ipam_config: std::option::Option<crate::model::AutoIpamConfig>,
9354
9355    /// Cluster-level network tier configuration is used to determine the default
9356    /// network tier for external IP addresses on cluster resources, such as node
9357    /// pools and load balancers.
9358    pub network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
9359
9360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9361}
9362
9363impl IPAllocationPolicy {
9364    pub fn new() -> Self {
9365        std::default::Default::default()
9366    }
9367
9368    /// Sets the value of [use_ip_aliases][crate::model::IPAllocationPolicy::use_ip_aliases].
9369    ///
9370    /// # Example
9371    /// ```ignore,no_run
9372    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9373    /// let x = IPAllocationPolicy::new().set_use_ip_aliases(true);
9374    /// ```
9375    pub fn set_use_ip_aliases<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9376        self.use_ip_aliases = v.into();
9377        self
9378    }
9379
9380    /// Sets the value of [create_subnetwork][crate::model::IPAllocationPolicy::create_subnetwork].
9381    ///
9382    /// # Example
9383    /// ```ignore,no_run
9384    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9385    /// let x = IPAllocationPolicy::new().set_create_subnetwork(true);
9386    /// ```
9387    pub fn set_create_subnetwork<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9388        self.create_subnetwork = v.into();
9389        self
9390    }
9391
9392    /// Sets the value of [subnetwork_name][crate::model::IPAllocationPolicy::subnetwork_name].
9393    ///
9394    /// # Example
9395    /// ```ignore,no_run
9396    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9397    /// let x = IPAllocationPolicy::new().set_subnetwork_name("example");
9398    /// ```
9399    pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9400        self.subnetwork_name = v.into();
9401        self
9402    }
9403
9404    /// Sets the value of [cluster_ipv4_cidr][crate::model::IPAllocationPolicy::cluster_ipv4_cidr].
9405    ///
9406    /// # Example
9407    /// ```ignore,no_run
9408    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9409    /// let x = IPAllocationPolicy::new().set_cluster_ipv4_cidr("example");
9410    /// ```
9411    #[deprecated]
9412    pub fn set_cluster_ipv4_cidr<T: std::convert::Into<std::string::String>>(
9413        mut self,
9414        v: T,
9415    ) -> Self {
9416        self.cluster_ipv4_cidr = v.into();
9417        self
9418    }
9419
9420    /// Sets the value of [node_ipv4_cidr][crate::model::IPAllocationPolicy::node_ipv4_cidr].
9421    ///
9422    /// # Example
9423    /// ```ignore,no_run
9424    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9425    /// let x = IPAllocationPolicy::new().set_node_ipv4_cidr("example");
9426    /// ```
9427    #[deprecated]
9428    pub fn set_node_ipv4_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9429        self.node_ipv4_cidr = v.into();
9430        self
9431    }
9432
9433    /// Sets the value of [services_ipv4_cidr][crate::model::IPAllocationPolicy::services_ipv4_cidr].
9434    ///
9435    /// # Example
9436    /// ```ignore,no_run
9437    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9438    /// let x = IPAllocationPolicy::new().set_services_ipv4_cidr("example");
9439    /// ```
9440    #[deprecated]
9441    pub fn set_services_ipv4_cidr<T: std::convert::Into<std::string::String>>(
9442        mut self,
9443        v: T,
9444    ) -> Self {
9445        self.services_ipv4_cidr = v.into();
9446        self
9447    }
9448
9449    /// Sets the value of [cluster_secondary_range_name][crate::model::IPAllocationPolicy::cluster_secondary_range_name].
9450    ///
9451    /// # Example
9452    /// ```ignore,no_run
9453    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9454    /// let x = IPAllocationPolicy::new().set_cluster_secondary_range_name("example");
9455    /// ```
9456    pub fn set_cluster_secondary_range_name<T: std::convert::Into<std::string::String>>(
9457        mut self,
9458        v: T,
9459    ) -> Self {
9460        self.cluster_secondary_range_name = v.into();
9461        self
9462    }
9463
9464    /// Sets the value of [services_secondary_range_name][crate::model::IPAllocationPolicy::services_secondary_range_name].
9465    ///
9466    /// # Example
9467    /// ```ignore,no_run
9468    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9469    /// let x = IPAllocationPolicy::new().set_services_secondary_range_name("example");
9470    /// ```
9471    pub fn set_services_secondary_range_name<T: std::convert::Into<std::string::String>>(
9472        mut self,
9473        v: T,
9474    ) -> Self {
9475        self.services_secondary_range_name = v.into();
9476        self
9477    }
9478
9479    /// Sets the value of [cluster_ipv4_cidr_block][crate::model::IPAllocationPolicy::cluster_ipv4_cidr_block].
9480    ///
9481    /// # Example
9482    /// ```ignore,no_run
9483    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9484    /// let x = IPAllocationPolicy::new().set_cluster_ipv4_cidr_block("example");
9485    /// ```
9486    pub fn set_cluster_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
9487        mut self,
9488        v: T,
9489    ) -> Self {
9490        self.cluster_ipv4_cidr_block = v.into();
9491        self
9492    }
9493
9494    /// Sets the value of [node_ipv4_cidr_block][crate::model::IPAllocationPolicy::node_ipv4_cidr_block].
9495    ///
9496    /// # Example
9497    /// ```ignore,no_run
9498    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9499    /// let x = IPAllocationPolicy::new().set_node_ipv4_cidr_block("example");
9500    /// ```
9501    pub fn set_node_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
9502        mut self,
9503        v: T,
9504    ) -> Self {
9505        self.node_ipv4_cidr_block = v.into();
9506        self
9507    }
9508
9509    /// Sets the value of [services_ipv4_cidr_block][crate::model::IPAllocationPolicy::services_ipv4_cidr_block].
9510    ///
9511    /// # Example
9512    /// ```ignore,no_run
9513    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9514    /// let x = IPAllocationPolicy::new().set_services_ipv4_cidr_block("example");
9515    /// ```
9516    pub fn set_services_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
9517        mut self,
9518        v: T,
9519    ) -> Self {
9520        self.services_ipv4_cidr_block = v.into();
9521        self
9522    }
9523
9524    /// Sets the value of [tpu_ipv4_cidr_block][crate::model::IPAllocationPolicy::tpu_ipv4_cidr_block].
9525    ///
9526    /// # Example
9527    /// ```ignore,no_run
9528    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9529    /// let x = IPAllocationPolicy::new().set_tpu_ipv4_cidr_block("example");
9530    /// ```
9531    #[deprecated]
9532    pub fn set_tpu_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
9533        mut self,
9534        v: T,
9535    ) -> Self {
9536        self.tpu_ipv4_cidr_block = v.into();
9537        self
9538    }
9539
9540    /// Sets the value of [use_routes][crate::model::IPAllocationPolicy::use_routes].
9541    ///
9542    /// # Example
9543    /// ```ignore,no_run
9544    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9545    /// let x = IPAllocationPolicy::new().set_use_routes(true);
9546    /// ```
9547    pub fn set_use_routes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9548        self.use_routes = v.into();
9549        self
9550    }
9551
9552    /// Sets the value of [stack_type][crate::model::IPAllocationPolicy::stack_type].
9553    ///
9554    /// # Example
9555    /// ```ignore,no_run
9556    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9557    /// use google_cloud_container_v1::model::StackType;
9558    /// let x0 = IPAllocationPolicy::new().set_stack_type(StackType::Ipv4);
9559    /// let x1 = IPAllocationPolicy::new().set_stack_type(StackType::Ipv4Ipv6);
9560    /// ```
9561    pub fn set_stack_type<T: std::convert::Into<crate::model::StackType>>(mut self, v: T) -> Self {
9562        self.stack_type = v.into();
9563        self
9564    }
9565
9566    /// Sets the value of [ipv6_access_type][crate::model::IPAllocationPolicy::ipv6_access_type].
9567    ///
9568    /// # Example
9569    /// ```ignore,no_run
9570    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9571    /// use google_cloud_container_v1::model::IPv6AccessType;
9572    /// let x0 = IPAllocationPolicy::new().set_ipv6_access_type(IPv6AccessType::Internal);
9573    /// let x1 = IPAllocationPolicy::new().set_ipv6_access_type(IPv6AccessType::External);
9574    /// ```
9575    pub fn set_ipv6_access_type<T: std::convert::Into<crate::model::IPv6AccessType>>(
9576        mut self,
9577        v: T,
9578    ) -> Self {
9579        self.ipv6_access_type = v.into();
9580        self
9581    }
9582
9583    /// Sets the value of [pod_cidr_overprovision_config][crate::model::IPAllocationPolicy::pod_cidr_overprovision_config].
9584    ///
9585    /// # Example
9586    /// ```ignore,no_run
9587    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9588    /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
9589    /// let x = IPAllocationPolicy::new().set_pod_cidr_overprovision_config(PodCIDROverprovisionConfig::default()/* use setters */);
9590    /// ```
9591    pub fn set_pod_cidr_overprovision_config<T>(mut self, v: T) -> Self
9592    where
9593        T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
9594    {
9595        self.pod_cidr_overprovision_config = std::option::Option::Some(v.into());
9596        self
9597    }
9598
9599    /// Sets or clears the value of [pod_cidr_overprovision_config][crate::model::IPAllocationPolicy::pod_cidr_overprovision_config].
9600    ///
9601    /// # Example
9602    /// ```ignore,no_run
9603    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9604    /// use google_cloud_container_v1::model::PodCIDROverprovisionConfig;
9605    /// let x = IPAllocationPolicy::new().set_or_clear_pod_cidr_overprovision_config(Some(PodCIDROverprovisionConfig::default()/* use setters */));
9606    /// let x = IPAllocationPolicy::new().set_or_clear_pod_cidr_overprovision_config(None::<PodCIDROverprovisionConfig>);
9607    /// ```
9608    pub fn set_or_clear_pod_cidr_overprovision_config<T>(
9609        mut self,
9610        v: std::option::Option<T>,
9611    ) -> Self
9612    where
9613        T: std::convert::Into<crate::model::PodCIDROverprovisionConfig>,
9614    {
9615        self.pod_cidr_overprovision_config = v.map(|x| x.into());
9616        self
9617    }
9618
9619    /// Sets the value of [subnet_ipv6_cidr_block][crate::model::IPAllocationPolicy::subnet_ipv6_cidr_block].
9620    ///
9621    /// # Example
9622    /// ```ignore,no_run
9623    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9624    /// let x = IPAllocationPolicy::new().set_subnet_ipv6_cidr_block("example");
9625    /// ```
9626    pub fn set_subnet_ipv6_cidr_block<T: std::convert::Into<std::string::String>>(
9627        mut self,
9628        v: T,
9629    ) -> Self {
9630        self.subnet_ipv6_cidr_block = v.into();
9631        self
9632    }
9633
9634    /// Sets the value of [services_ipv6_cidr_block][crate::model::IPAllocationPolicy::services_ipv6_cidr_block].
9635    ///
9636    /// # Example
9637    /// ```ignore,no_run
9638    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9639    /// let x = IPAllocationPolicy::new().set_services_ipv6_cidr_block("example");
9640    /// ```
9641    pub fn set_services_ipv6_cidr_block<T: std::convert::Into<std::string::String>>(
9642        mut self,
9643        v: T,
9644    ) -> Self {
9645        self.services_ipv6_cidr_block = v.into();
9646        self
9647    }
9648
9649    /// Sets the value of [additional_pod_ranges_config][crate::model::IPAllocationPolicy::additional_pod_ranges_config].
9650    ///
9651    /// # Example
9652    /// ```ignore,no_run
9653    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9654    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
9655    /// let x = IPAllocationPolicy::new().set_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
9656    /// ```
9657    pub fn set_additional_pod_ranges_config<T>(mut self, v: T) -> Self
9658    where
9659        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
9660    {
9661        self.additional_pod_ranges_config = std::option::Option::Some(v.into());
9662        self
9663    }
9664
9665    /// Sets or clears the value of [additional_pod_ranges_config][crate::model::IPAllocationPolicy::additional_pod_ranges_config].
9666    ///
9667    /// # Example
9668    /// ```ignore,no_run
9669    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9670    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
9671    /// let x = IPAllocationPolicy::new().set_or_clear_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
9672    /// let x = IPAllocationPolicy::new().set_or_clear_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
9673    /// ```
9674    pub fn set_or_clear_additional_pod_ranges_config<T>(mut self, v: std::option::Option<T>) -> Self
9675    where
9676        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
9677    {
9678        self.additional_pod_ranges_config = v.map(|x| x.into());
9679        self
9680    }
9681
9682    /// Sets the value of [default_pod_ipv4_range_utilization][crate::model::IPAllocationPolicy::default_pod_ipv4_range_utilization].
9683    ///
9684    /// # Example
9685    /// ```ignore,no_run
9686    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9687    /// let x = IPAllocationPolicy::new().set_default_pod_ipv4_range_utilization(42.0);
9688    /// ```
9689    pub fn set_default_pod_ipv4_range_utilization<T: std::convert::Into<f64>>(
9690        mut self,
9691        v: T,
9692    ) -> Self {
9693        self.default_pod_ipv4_range_utilization = v.into();
9694        self
9695    }
9696
9697    /// Sets the value of [additional_ip_ranges_configs][crate::model::IPAllocationPolicy::additional_ip_ranges_configs].
9698    ///
9699    /// # Example
9700    /// ```ignore,no_run
9701    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9702    /// use google_cloud_container_v1::model::AdditionalIPRangesConfig;
9703    /// let x = IPAllocationPolicy::new()
9704    ///     .set_additional_ip_ranges_configs([
9705    ///         AdditionalIPRangesConfig::default()/* use setters */,
9706    ///         AdditionalIPRangesConfig::default()/* use (different) setters */,
9707    ///     ]);
9708    /// ```
9709    pub fn set_additional_ip_ranges_configs<T, V>(mut self, v: T) -> Self
9710    where
9711        T: std::iter::IntoIterator<Item = V>,
9712        V: std::convert::Into<crate::model::AdditionalIPRangesConfig>,
9713    {
9714        use std::iter::Iterator;
9715        self.additional_ip_ranges_configs = v.into_iter().map(|i| i.into()).collect();
9716        self
9717    }
9718
9719    /// Sets the value of [auto_ipam_config][crate::model::IPAllocationPolicy::auto_ipam_config].
9720    ///
9721    /// # Example
9722    /// ```ignore,no_run
9723    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9724    /// use google_cloud_container_v1::model::AutoIpamConfig;
9725    /// let x = IPAllocationPolicy::new().set_auto_ipam_config(AutoIpamConfig::default()/* use setters */);
9726    /// ```
9727    pub fn set_auto_ipam_config<T>(mut self, v: T) -> Self
9728    where
9729        T: std::convert::Into<crate::model::AutoIpamConfig>,
9730    {
9731        self.auto_ipam_config = std::option::Option::Some(v.into());
9732        self
9733    }
9734
9735    /// Sets or clears the value of [auto_ipam_config][crate::model::IPAllocationPolicy::auto_ipam_config].
9736    ///
9737    /// # Example
9738    /// ```ignore,no_run
9739    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9740    /// use google_cloud_container_v1::model::AutoIpamConfig;
9741    /// let x = IPAllocationPolicy::new().set_or_clear_auto_ipam_config(Some(AutoIpamConfig::default()/* use setters */));
9742    /// let x = IPAllocationPolicy::new().set_or_clear_auto_ipam_config(None::<AutoIpamConfig>);
9743    /// ```
9744    pub fn set_or_clear_auto_ipam_config<T>(mut self, v: std::option::Option<T>) -> Self
9745    where
9746        T: std::convert::Into<crate::model::AutoIpamConfig>,
9747    {
9748        self.auto_ipam_config = v.map(|x| x.into());
9749        self
9750    }
9751
9752    /// Sets the value of [network_tier_config][crate::model::IPAllocationPolicy::network_tier_config].
9753    ///
9754    /// # Example
9755    /// ```ignore,no_run
9756    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9757    /// use google_cloud_container_v1::model::NetworkTierConfig;
9758    /// let x = IPAllocationPolicy::new().set_network_tier_config(NetworkTierConfig::default()/* use setters */);
9759    /// ```
9760    pub fn set_network_tier_config<T>(mut self, v: T) -> Self
9761    where
9762        T: std::convert::Into<crate::model::NetworkTierConfig>,
9763    {
9764        self.network_tier_config = std::option::Option::Some(v.into());
9765        self
9766    }
9767
9768    /// Sets or clears the value of [network_tier_config][crate::model::IPAllocationPolicy::network_tier_config].
9769    ///
9770    /// # Example
9771    /// ```ignore,no_run
9772    /// # use google_cloud_container_v1::model::IPAllocationPolicy;
9773    /// use google_cloud_container_v1::model::NetworkTierConfig;
9774    /// let x = IPAllocationPolicy::new().set_or_clear_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
9775    /// let x = IPAllocationPolicy::new().set_or_clear_network_tier_config(None::<NetworkTierConfig>);
9776    /// ```
9777    pub fn set_or_clear_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
9778    where
9779        T: std::convert::Into<crate::model::NetworkTierConfig>,
9780    {
9781        self.network_tier_config = v.map(|x| x.into());
9782        self
9783    }
9784}
9785
9786impl wkt::message::Message for IPAllocationPolicy {
9787    fn typename() -> &'static str {
9788        "type.googleapis.com/google.container.v1.IPAllocationPolicy"
9789    }
9790}
9791
9792/// A Google Kubernetes Engine cluster.
9793#[derive(Clone, Default, PartialEq)]
9794#[non_exhaustive]
9795pub struct Cluster {
9796    /// The name of this cluster. The name must be unique within this project
9797    /// and location (e.g. zone or region), and can be up to 40 characters with
9798    /// the following restrictions:
9799    ///
9800    /// * Lowercase letters, numbers, and hyphens only.
9801    /// * Must start with a letter.
9802    /// * Must end with a number or a letter.
9803    pub name: std::string::String,
9804
9805    /// An optional description of this cluster.
9806    pub description: std::string::String,
9807
9808    /// The number of nodes to create in this cluster. You must ensure that your
9809    /// Compute Engine [resource
9810    /// quota](https://cloud.google.com/compute/quotas)
9811    /// is sufficient for this number of instances. You must also have available
9812    /// firewall and routes quota.
9813    /// For requests, this field should only be used in lieu of a
9814    /// "node_pool" object, since this configuration (along with the
9815    /// "node_config") will be used to create a "NodePool" object with an
9816    /// auto-generated name. Do not use this and a node_pool at the same time.
9817    ///
9818    /// This field is deprecated, use node_pool.initial_node_count instead.
9819    #[deprecated]
9820    pub initial_node_count: i32,
9821
9822    /// Parameters used in creating the cluster's nodes.
9823    /// For requests, this field should only be used in lieu of a
9824    /// "node_pool" object, since this configuration (along with the
9825    /// "initial_node_count") will be used to create a "NodePool" object with an
9826    /// auto-generated name. Do not use this and a node_pool at the same time.
9827    /// For responses, this field will be populated with the node configuration of
9828    /// the first node pool. (For configuration of each node pool, see
9829    /// `node_pool.config`)
9830    ///
9831    /// If unspecified, the defaults are used.
9832    /// This field is deprecated, use node_pool.config instead.
9833    #[deprecated]
9834    pub node_config: std::option::Option<crate::model::NodeConfig>,
9835
9836    /// The authentication information for accessing the master endpoint.
9837    /// If unspecified, the defaults are used:
9838    /// For clusters before v1.12, if master_auth is unspecified, `username` will
9839    /// be set to "admin", a random password will be generated, and a client
9840    /// certificate will be issued.
9841    pub master_auth: std::option::Option<crate::model::MasterAuth>,
9842
9843    /// The logging service the cluster should use to write logs.
9844    /// Currently available options:
9845    ///
9846    /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
9847    ///   service with a Kubernetes-native resource model
9848    /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
9849    ///   available as of GKE 1.15).
9850    /// * `none` - no logs will be exported from the cluster.
9851    ///
9852    /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
9853    /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
9854    pub logging_service: std::string::String,
9855
9856    /// The monitoring service the cluster should use to write metrics.
9857    /// Currently available options:
9858    ///
9859    /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
9860    ///   service with a Kubernetes-native resource model
9861    /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
9862    ///   longer available as of GKE 1.15).
9863    /// * `none` - No metrics will be exported from the cluster.
9864    ///
9865    /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
9866    /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
9867    pub monitoring_service: std::string::String,
9868
9869    /// The name of the Google Compute Engine
9870    /// [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks)
9871    /// to which the cluster is connected. If left unspecified, the `default`
9872    /// network will be used.
9873    pub network: std::string::String,
9874
9875    /// The IP address range of the container pods in this cluster, in
9876    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
9877    /// notation (e.g. `10.96.0.0/14`). Leave blank to have
9878    /// one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
9879    pub cluster_ipv4_cidr: std::string::String,
9880
9881    /// Configurations for the various addons available to run in the cluster.
9882    pub addons_config: std::option::Option<crate::model::AddonsConfig>,
9883
9884    /// The name of the Google Compute Engine
9885    /// [subnetwork](https://cloud.google.com/compute/docs/subnetworks)
9886    /// to which the cluster is connected.
9887    pub subnetwork: std::string::String,
9888
9889    /// The node pools associated with this cluster.
9890    /// This field should not be set if "node_config" or "initial_node_count" are
9891    /// specified.
9892    pub node_pools: std::vec::Vec<crate::model::NodePool>,
9893
9894    /// The list of Google Compute Engine
9895    /// [zones](https://cloud.google.com/compute/docs/zones#available)
9896    /// in which the cluster's nodes should be located.
9897    ///
9898    /// This field provides a default value if
9899    /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
9900    /// are not specified during node pool creation.
9901    ///
9902    /// Warning: changing cluster locations will update the
9903    /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
9904    /// of all node pools and will result in nodes being added and/or removed.
9905    pub locations: std::vec::Vec<std::string::String>,
9906
9907    /// Kubernetes alpha features are enabled on this cluster. This includes alpha
9908    /// API groups (e.g. v1alpha1) and features that may not be production ready in
9909    /// the kubernetes version of the master and nodes.
9910    /// The cluster has no SLA for uptime and master/node upgrades are disabled.
9911    /// Alpha enabled clusters are automatically deleted thirty days after
9912    /// creation.
9913    pub enable_kubernetes_alpha: bool,
9914
9915    /// The list of user specified Kubernetes feature gates.
9916    /// Each string represents the activation status of a feature gate (e.g.
9917    /// "featureX=true" or "featureX=false")
9918    pub alpha_cluster_feature_gates: std::vec::Vec<std::string::String>,
9919
9920    /// The resource labels for the cluster to use to annotate any related
9921    /// Google Compute Engine resources.
9922    pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
9923
9924    /// The fingerprint of the set of labels for this cluster.
9925    pub label_fingerprint: std::string::String,
9926
9927    /// Configuration for the legacy ABAC authorization mode.
9928    pub legacy_abac: std::option::Option<crate::model::LegacyAbac>,
9929
9930    /// Configuration options for the NetworkPolicy feature.
9931    pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
9932
9933    /// Configuration for cluster IP allocation.
9934    pub ip_allocation_policy: std::option::Option<crate::model::IPAllocationPolicy>,
9935
9936    /// The configuration options for master authorized networks feature.
9937    ///
9938    /// Deprecated: Use
9939    /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]
9940    /// instead.
9941    ///
9942    /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]: crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config
9943    #[deprecated]
9944    pub master_authorized_networks_config:
9945        std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
9946
9947    /// Configure the maintenance policy for this cluster.
9948    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
9949
9950    /// Configuration for Binary Authorization.
9951    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
9952
9953    /// Cluster-level autoscaling configuration.
9954    pub autoscaling: std::option::Option<crate::model::ClusterAutoscaling>,
9955
9956    /// Configuration for cluster networking.
9957    pub network_config: std::option::Option<crate::model::NetworkConfig>,
9958
9959    /// The default constraint on the maximum number of pods that can be run
9960    /// simultaneously on a node in the node pool of this cluster. Only honored
9961    /// if cluster created with IP Alias support.
9962    pub default_max_pods_constraint: std::option::Option<crate::model::MaxPodsConstraint>,
9963
9964    /// Configuration for exporting resource usages. Resource usage export is
9965    /// disabled when this config is unspecified.
9966    pub resource_usage_export_config: std::option::Option<crate::model::ResourceUsageExportConfig>,
9967
9968    /// Configuration controlling RBAC group membership information.
9969    pub authenticator_groups_config: std::option::Option<crate::model::AuthenticatorGroupsConfig>,
9970
9971    /// Configuration for private cluster.
9972    pub private_cluster_config: std::option::Option<crate::model::PrivateClusterConfig>,
9973
9974    /// Configuration of etcd encryption.
9975    pub database_encryption: std::option::Option<crate::model::DatabaseEncryption>,
9976
9977    /// Cluster-level Vertical Pod Autoscaling configuration.
9978    pub vertical_pod_autoscaling: std::option::Option<crate::model::VerticalPodAutoscaling>,
9979
9980    /// Shielded Nodes configuration.
9981    pub shielded_nodes: std::option::Option<crate::model::ShieldedNodes>,
9982
9983    /// Release channel configuration. If left unspecified on cluster creation and
9984    /// a version is specified, the cluster is enrolled in the most mature release
9985    /// channel where the version is available (first checking STABLE, then
9986    /// REGULAR, and finally RAPID). Otherwise, if no release channel
9987    /// configuration and no version is specified, the cluster is enrolled in the
9988    /// REGULAR channel with its default version.
9989    pub release_channel: std::option::Option<crate::model::ReleaseChannel>,
9990
9991    /// Configuration for the use of Kubernetes Service Accounts in IAM policies.
9992    pub workload_identity_config: std::option::Option<crate::model::WorkloadIdentityConfig>,
9993
9994    /// Configuration for issuance of mTLS keys and certificates to Kubernetes
9995    /// pods.
9996    pub mesh_certificates: std::option::Option<crate::model::MeshCertificates>,
9997
9998    /// Configuration for the fine-grained cost management feature.
9999    pub cost_management_config: std::option::Option<crate::model::CostManagementConfig>,
10000
10001    /// Notification configuration of the cluster.
10002    pub notification_config: std::option::Option<crate::model::NotificationConfig>,
10003
10004    /// Configuration of Confidential Nodes.
10005    /// All the nodes in the cluster will be Confidential VM once enabled.
10006    pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
10007
10008    /// Configuration for Identity Service component.
10009    pub identity_service_config: std::option::Option<crate::model::IdentityServiceConfig>,
10010
10011    /// Output only. Server-defined URL for the resource.
10012    pub self_link: std::string::String,
10013
10014    /// Output only. The name of the Google Compute Engine
10015    /// [zone](https://cloud.google.com/compute/docs/zones#available)
10016    /// in which the cluster resides. This field is deprecated, use location
10017    /// instead.
10018    #[deprecated]
10019    pub zone: std::string::String,
10020
10021    /// Output only. The IP address of this cluster's master endpoint.
10022    /// The endpoint can be accessed from the internet at
10023    /// `https://username:password@endpoint/`.
10024    ///
10025    /// See the `masterAuth` property of this resource for username and
10026    /// password information.
10027    pub endpoint: std::string::String,
10028
10029    /// The initial Kubernetes version for this cluster.  Valid versions are those
10030    /// found in validMasterVersions returned by getServerConfig.  The version can
10031    /// be upgraded over time; such upgrades are reflected in
10032    /// currentMasterVersion and currentNodeVersion.
10033    ///
10034    /// Users may specify either explicit versions offered by
10035    /// Kubernetes Engine or version aliases, which have the following behavior:
10036    ///
10037    /// - "latest": picks the highest valid Kubernetes version
10038    /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
10039    /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
10040    /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
10041    /// - "","-": picks the default Kubernetes version
10042    pub initial_cluster_version: std::string::String,
10043
10044    /// Output only. The current software version of the master endpoint.
10045    pub current_master_version: std::string::String,
10046
10047    /// Output only. Deprecated, use
10048    /// [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools)
10049    /// instead. The current version of the node software components. If they are
10050    /// currently at multiple versions because they're in the process of being
10051    /// upgraded, this reflects the minimum version of all nodes.
10052    #[deprecated]
10053    pub current_node_version: std::string::String,
10054
10055    /// Output only. The time the cluster was created, in
10056    /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
10057    pub create_time: std::string::String,
10058
10059    /// Output only. The current status of this cluster.
10060    pub status: crate::model::cluster::Status,
10061
10062    /// Output only. Deprecated. Use conditions instead.
10063    /// Additional information about the current status of this
10064    /// cluster, if available.
10065    #[deprecated]
10066    pub status_message: std::string::String,
10067
10068    /// Output only. The size of the address space on each node for hosting
10069    /// containers. This is provisioned from within the `container_ipv4_cidr`
10070    /// range. This field will only be set when cluster is in route-based network
10071    /// mode.
10072    pub node_ipv4_cidr_size: i32,
10073
10074    /// Output only. The IP address range of the Kubernetes services in
10075    /// this cluster, in
10076    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
10077    /// notation (e.g. `1.2.3.4/29`). Service addresses are
10078    /// typically put in the last `/16` from the container CIDR.
10079    pub services_ipv4_cidr: std::string::String,
10080
10081    /// Output only. Deprecated. Use node_pools.instance_group_urls.
10082    #[deprecated]
10083    pub instance_group_urls: std::vec::Vec<std::string::String>,
10084
10085    /// Output only. The number of nodes currently in the cluster. Deprecated.
10086    /// Call Kubernetes API directly to retrieve node information.
10087    #[deprecated]
10088    pub current_node_count: i32,
10089
10090    /// Output only. The time the cluster will be automatically
10091    /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
10092    pub expire_time: std::string::String,
10093
10094    /// Output only. The name of the Google Compute Engine
10095    /// [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
10096    /// or
10097    /// [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
10098    /// in which the cluster resides.
10099    pub location: std::string::String,
10100
10101    /// Enable the ability to use Cloud TPUs in this cluster.
10102    /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
10103    /// date for 2VM TPU is 2025-04-25.
10104    #[deprecated]
10105    pub enable_tpu: bool,
10106
10107    /// Output only. The IP address range of the Cloud TPUs in this cluster, in
10108    /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
10109    /// notation (e.g. `1.2.3.4/29`).
10110    /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
10111    /// date for 2VM TPU is 2025-04-25.
10112    #[deprecated]
10113    pub tpu_ipv4_cidr_block: std::string::String,
10114
10115    /// Which conditions caused the current cluster state.
10116    pub conditions: std::vec::Vec<crate::model::StatusCondition>,
10117
10118    /// Autopilot configuration for the cluster.
10119    pub autopilot: std::option::Option<crate::model::Autopilot>,
10120
10121    /// Output only. Unique id for the cluster.
10122    pub id: std::string::String,
10123
10124    /// Default NodePool settings for the entire cluster. These settings are
10125    /// overridden if specified on the specific NodePool object.
10126    pub node_pool_defaults: std::option::Option<crate::model::NodePoolDefaults>,
10127
10128    /// Logging configuration for the cluster.
10129    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
10130
10131    /// Monitoring configuration for the cluster.
10132    pub monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
10133
10134    /// Node pool configs that apply to all auto-provisioned node pools
10135    /// in autopilot clusters and node auto-provisioning enabled clusters.
10136    pub node_pool_auto_config: std::option::Option<crate::model::NodePoolAutoConfig>,
10137
10138    /// The config for pod autoscaling.
10139    pub pod_autoscaling: std::option::Option<crate::model::PodAutoscaling>,
10140
10141    /// This checksum is computed by the server based on the value of cluster
10142    /// fields, and may be sent on update requests to ensure the client has an
10143    /// up-to-date value before proceeding.
10144    pub etag: std::string::String,
10145
10146    /// Fleet information for the cluster.
10147    pub fleet: std::option::Option<crate::model::Fleet>,
10148
10149    /// Enable/Disable Security Posture API features for the cluster.
10150    pub security_posture_config: std::option::Option<crate::model::SecurityPostureConfig>,
10151
10152    /// Configuration for all cluster's control plane endpoints.
10153    pub control_plane_endpoints_config:
10154        std::option::Option<crate::model::ControlPlaneEndpointsConfig>,
10155
10156    /// Beta APIs Config
10157    pub enable_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
10158
10159    /// GKE Enterprise Configuration.
10160    ///
10161    /// Deprecated: GKE Enterprise features are now available without an Enterprise
10162    /// tier.
10163    #[deprecated]
10164    pub enterprise_config: std::option::Option<crate::model::EnterpriseConfig>,
10165
10166    /// Secret CSI driver configuration.
10167    pub secret_manager_config: std::option::Option<crate::model::SecretManagerConfig>,
10168
10169    /// Enable/Disable Compliance Posture features for the cluster.
10170    pub compliance_posture_config: std::option::Option<crate::model::CompliancePostureConfig>,
10171
10172    /// Output only. Reserved for future use.
10173    pub satisfies_pzs: std::option::Option<bool>,
10174
10175    /// Output only. Reserved for future use.
10176    pub satisfies_pzi: std::option::Option<bool>,
10177
10178    /// The Custom keys configuration for the cluster.
10179    pub user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
10180
10181    /// RBACBindingConfig allows user to restrict ClusterRoleBindings an
10182    /// RoleBindings that can be created.
10183    pub rbac_binding_config: std::option::Option<crate::model::RBACBindingConfig>,
10184
10185    /// Configuration for GKE auto upgrades.
10186    pub gke_auto_upgrade_config: std::option::Option<crate::model::GkeAutoUpgradeConfig>,
10187
10188    /// Configuration for limiting anonymous access to all endpoints except the
10189    /// health checks.
10190    pub anonymous_authentication_config:
10191        std::option::Option<crate::model::AnonymousAuthenticationConfig>,
10192
10193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10194}
10195
10196impl Cluster {
10197    pub fn new() -> Self {
10198        std::default::Default::default()
10199    }
10200
10201    /// Sets the value of [name][crate::model::Cluster::name].
10202    ///
10203    /// # Example
10204    /// ```ignore,no_run
10205    /// # use google_cloud_container_v1::model::Cluster;
10206    /// let x = Cluster::new().set_name("example");
10207    /// ```
10208    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10209        self.name = v.into();
10210        self
10211    }
10212
10213    /// Sets the value of [description][crate::model::Cluster::description].
10214    ///
10215    /// # Example
10216    /// ```ignore,no_run
10217    /// # use google_cloud_container_v1::model::Cluster;
10218    /// let x = Cluster::new().set_description("example");
10219    /// ```
10220    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10221        self.description = v.into();
10222        self
10223    }
10224
10225    /// Sets the value of [initial_node_count][crate::model::Cluster::initial_node_count].
10226    ///
10227    /// # Example
10228    /// ```ignore,no_run
10229    /// # use google_cloud_container_v1::model::Cluster;
10230    /// let x = Cluster::new().set_initial_node_count(42);
10231    /// ```
10232    #[deprecated]
10233    pub fn set_initial_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10234        self.initial_node_count = v.into();
10235        self
10236    }
10237
10238    /// Sets the value of [node_config][crate::model::Cluster::node_config].
10239    ///
10240    /// # Example
10241    /// ```ignore,no_run
10242    /// # use google_cloud_container_v1::model::Cluster;
10243    /// use google_cloud_container_v1::model::NodeConfig;
10244    /// let x = Cluster::new().set_node_config(NodeConfig::default()/* use setters */);
10245    /// ```
10246    #[deprecated]
10247    pub fn set_node_config<T>(mut self, v: T) -> Self
10248    where
10249        T: std::convert::Into<crate::model::NodeConfig>,
10250    {
10251        self.node_config = std::option::Option::Some(v.into());
10252        self
10253    }
10254
10255    /// Sets or clears the value of [node_config][crate::model::Cluster::node_config].
10256    ///
10257    /// # Example
10258    /// ```ignore,no_run
10259    /// # use google_cloud_container_v1::model::Cluster;
10260    /// use google_cloud_container_v1::model::NodeConfig;
10261    /// let x = Cluster::new().set_or_clear_node_config(Some(NodeConfig::default()/* use setters */));
10262    /// let x = Cluster::new().set_or_clear_node_config(None::<NodeConfig>);
10263    /// ```
10264    #[deprecated]
10265    pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
10266    where
10267        T: std::convert::Into<crate::model::NodeConfig>,
10268    {
10269        self.node_config = v.map(|x| x.into());
10270        self
10271    }
10272
10273    /// Sets the value of [master_auth][crate::model::Cluster::master_auth].
10274    ///
10275    /// # Example
10276    /// ```ignore,no_run
10277    /// # use google_cloud_container_v1::model::Cluster;
10278    /// use google_cloud_container_v1::model::MasterAuth;
10279    /// let x = Cluster::new().set_master_auth(MasterAuth::default()/* use setters */);
10280    /// ```
10281    pub fn set_master_auth<T>(mut self, v: T) -> Self
10282    where
10283        T: std::convert::Into<crate::model::MasterAuth>,
10284    {
10285        self.master_auth = std::option::Option::Some(v.into());
10286        self
10287    }
10288
10289    /// Sets or clears the value of [master_auth][crate::model::Cluster::master_auth].
10290    ///
10291    /// # Example
10292    /// ```ignore,no_run
10293    /// # use google_cloud_container_v1::model::Cluster;
10294    /// use google_cloud_container_v1::model::MasterAuth;
10295    /// let x = Cluster::new().set_or_clear_master_auth(Some(MasterAuth::default()/* use setters */));
10296    /// let x = Cluster::new().set_or_clear_master_auth(None::<MasterAuth>);
10297    /// ```
10298    pub fn set_or_clear_master_auth<T>(mut self, v: std::option::Option<T>) -> Self
10299    where
10300        T: std::convert::Into<crate::model::MasterAuth>,
10301    {
10302        self.master_auth = v.map(|x| x.into());
10303        self
10304    }
10305
10306    /// Sets the value of [logging_service][crate::model::Cluster::logging_service].
10307    ///
10308    /// # Example
10309    /// ```ignore,no_run
10310    /// # use google_cloud_container_v1::model::Cluster;
10311    /// let x = Cluster::new().set_logging_service("example");
10312    /// ```
10313    pub fn set_logging_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10314        self.logging_service = v.into();
10315        self
10316    }
10317
10318    /// Sets the value of [monitoring_service][crate::model::Cluster::monitoring_service].
10319    ///
10320    /// # Example
10321    /// ```ignore,no_run
10322    /// # use google_cloud_container_v1::model::Cluster;
10323    /// let x = Cluster::new().set_monitoring_service("example");
10324    /// ```
10325    pub fn set_monitoring_service<T: std::convert::Into<std::string::String>>(
10326        mut self,
10327        v: T,
10328    ) -> Self {
10329        self.monitoring_service = v.into();
10330        self
10331    }
10332
10333    /// Sets the value of [network][crate::model::Cluster::network].
10334    ///
10335    /// # Example
10336    /// ```ignore,no_run
10337    /// # use google_cloud_container_v1::model::Cluster;
10338    /// let x = Cluster::new().set_network("example");
10339    /// ```
10340    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10341        self.network = v.into();
10342        self
10343    }
10344
10345    /// Sets the value of [cluster_ipv4_cidr][crate::model::Cluster::cluster_ipv4_cidr].
10346    ///
10347    /// # Example
10348    /// ```ignore,no_run
10349    /// # use google_cloud_container_v1::model::Cluster;
10350    /// let x = Cluster::new().set_cluster_ipv4_cidr("example");
10351    /// ```
10352    pub fn set_cluster_ipv4_cidr<T: std::convert::Into<std::string::String>>(
10353        mut self,
10354        v: T,
10355    ) -> Self {
10356        self.cluster_ipv4_cidr = v.into();
10357        self
10358    }
10359
10360    /// Sets the value of [addons_config][crate::model::Cluster::addons_config].
10361    ///
10362    /// # Example
10363    /// ```ignore,no_run
10364    /// # use google_cloud_container_v1::model::Cluster;
10365    /// use google_cloud_container_v1::model::AddonsConfig;
10366    /// let x = Cluster::new().set_addons_config(AddonsConfig::default()/* use setters */);
10367    /// ```
10368    pub fn set_addons_config<T>(mut self, v: T) -> Self
10369    where
10370        T: std::convert::Into<crate::model::AddonsConfig>,
10371    {
10372        self.addons_config = std::option::Option::Some(v.into());
10373        self
10374    }
10375
10376    /// Sets or clears the value of [addons_config][crate::model::Cluster::addons_config].
10377    ///
10378    /// # Example
10379    /// ```ignore,no_run
10380    /// # use google_cloud_container_v1::model::Cluster;
10381    /// use google_cloud_container_v1::model::AddonsConfig;
10382    /// let x = Cluster::new().set_or_clear_addons_config(Some(AddonsConfig::default()/* use setters */));
10383    /// let x = Cluster::new().set_or_clear_addons_config(None::<AddonsConfig>);
10384    /// ```
10385    pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
10386    where
10387        T: std::convert::Into<crate::model::AddonsConfig>,
10388    {
10389        self.addons_config = v.map(|x| x.into());
10390        self
10391    }
10392
10393    /// Sets the value of [subnetwork][crate::model::Cluster::subnetwork].
10394    ///
10395    /// # Example
10396    /// ```ignore,no_run
10397    /// # use google_cloud_container_v1::model::Cluster;
10398    /// let x = Cluster::new().set_subnetwork("example");
10399    /// ```
10400    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10401        self.subnetwork = v.into();
10402        self
10403    }
10404
10405    /// Sets the value of [node_pools][crate::model::Cluster::node_pools].
10406    ///
10407    /// # Example
10408    /// ```ignore,no_run
10409    /// # use google_cloud_container_v1::model::Cluster;
10410    /// use google_cloud_container_v1::model::NodePool;
10411    /// let x = Cluster::new()
10412    ///     .set_node_pools([
10413    ///         NodePool::default()/* use setters */,
10414    ///         NodePool::default()/* use (different) setters */,
10415    ///     ]);
10416    /// ```
10417    pub fn set_node_pools<T, V>(mut self, v: T) -> Self
10418    where
10419        T: std::iter::IntoIterator<Item = V>,
10420        V: std::convert::Into<crate::model::NodePool>,
10421    {
10422        use std::iter::Iterator;
10423        self.node_pools = v.into_iter().map(|i| i.into()).collect();
10424        self
10425    }
10426
10427    /// Sets the value of [locations][crate::model::Cluster::locations].
10428    ///
10429    /// # Example
10430    /// ```ignore,no_run
10431    /// # use google_cloud_container_v1::model::Cluster;
10432    /// let x = Cluster::new().set_locations(["a", "b", "c"]);
10433    /// ```
10434    pub fn set_locations<T, V>(mut self, v: T) -> Self
10435    where
10436        T: std::iter::IntoIterator<Item = V>,
10437        V: std::convert::Into<std::string::String>,
10438    {
10439        use std::iter::Iterator;
10440        self.locations = v.into_iter().map(|i| i.into()).collect();
10441        self
10442    }
10443
10444    /// Sets the value of [enable_kubernetes_alpha][crate::model::Cluster::enable_kubernetes_alpha].
10445    ///
10446    /// # Example
10447    /// ```ignore,no_run
10448    /// # use google_cloud_container_v1::model::Cluster;
10449    /// let x = Cluster::new().set_enable_kubernetes_alpha(true);
10450    /// ```
10451    pub fn set_enable_kubernetes_alpha<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10452        self.enable_kubernetes_alpha = v.into();
10453        self
10454    }
10455
10456    /// Sets the value of [alpha_cluster_feature_gates][crate::model::Cluster::alpha_cluster_feature_gates].
10457    ///
10458    /// # Example
10459    /// ```ignore,no_run
10460    /// # use google_cloud_container_v1::model::Cluster;
10461    /// let x = Cluster::new().set_alpha_cluster_feature_gates(["a", "b", "c"]);
10462    /// ```
10463    pub fn set_alpha_cluster_feature_gates<T, V>(mut self, v: T) -> Self
10464    where
10465        T: std::iter::IntoIterator<Item = V>,
10466        V: std::convert::Into<std::string::String>,
10467    {
10468        use std::iter::Iterator;
10469        self.alpha_cluster_feature_gates = v.into_iter().map(|i| i.into()).collect();
10470        self
10471    }
10472
10473    /// Sets the value of [resource_labels][crate::model::Cluster::resource_labels].
10474    ///
10475    /// # Example
10476    /// ```ignore,no_run
10477    /// # use google_cloud_container_v1::model::Cluster;
10478    /// let x = Cluster::new().set_resource_labels([
10479    ///     ("key0", "abc"),
10480    ///     ("key1", "xyz"),
10481    /// ]);
10482    /// ```
10483    pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
10484    where
10485        T: std::iter::IntoIterator<Item = (K, V)>,
10486        K: std::convert::Into<std::string::String>,
10487        V: std::convert::Into<std::string::String>,
10488    {
10489        use std::iter::Iterator;
10490        self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10491        self
10492    }
10493
10494    /// Sets the value of [label_fingerprint][crate::model::Cluster::label_fingerprint].
10495    ///
10496    /// # Example
10497    /// ```ignore,no_run
10498    /// # use google_cloud_container_v1::model::Cluster;
10499    /// let x = Cluster::new().set_label_fingerprint("example");
10500    /// ```
10501    pub fn set_label_fingerprint<T: std::convert::Into<std::string::String>>(
10502        mut self,
10503        v: T,
10504    ) -> Self {
10505        self.label_fingerprint = v.into();
10506        self
10507    }
10508
10509    /// Sets the value of [legacy_abac][crate::model::Cluster::legacy_abac].
10510    ///
10511    /// # Example
10512    /// ```ignore,no_run
10513    /// # use google_cloud_container_v1::model::Cluster;
10514    /// use google_cloud_container_v1::model::LegacyAbac;
10515    /// let x = Cluster::new().set_legacy_abac(LegacyAbac::default()/* use setters */);
10516    /// ```
10517    pub fn set_legacy_abac<T>(mut self, v: T) -> Self
10518    where
10519        T: std::convert::Into<crate::model::LegacyAbac>,
10520    {
10521        self.legacy_abac = std::option::Option::Some(v.into());
10522        self
10523    }
10524
10525    /// Sets or clears the value of [legacy_abac][crate::model::Cluster::legacy_abac].
10526    ///
10527    /// # Example
10528    /// ```ignore,no_run
10529    /// # use google_cloud_container_v1::model::Cluster;
10530    /// use google_cloud_container_v1::model::LegacyAbac;
10531    /// let x = Cluster::new().set_or_clear_legacy_abac(Some(LegacyAbac::default()/* use setters */));
10532    /// let x = Cluster::new().set_or_clear_legacy_abac(None::<LegacyAbac>);
10533    /// ```
10534    pub fn set_or_clear_legacy_abac<T>(mut self, v: std::option::Option<T>) -> Self
10535    where
10536        T: std::convert::Into<crate::model::LegacyAbac>,
10537    {
10538        self.legacy_abac = v.map(|x| x.into());
10539        self
10540    }
10541
10542    /// Sets the value of [network_policy][crate::model::Cluster::network_policy].
10543    ///
10544    /// # Example
10545    /// ```ignore,no_run
10546    /// # use google_cloud_container_v1::model::Cluster;
10547    /// use google_cloud_container_v1::model::NetworkPolicy;
10548    /// let x = Cluster::new().set_network_policy(NetworkPolicy::default()/* use setters */);
10549    /// ```
10550    pub fn set_network_policy<T>(mut self, v: T) -> Self
10551    where
10552        T: std::convert::Into<crate::model::NetworkPolicy>,
10553    {
10554        self.network_policy = std::option::Option::Some(v.into());
10555        self
10556    }
10557
10558    /// Sets or clears the value of [network_policy][crate::model::Cluster::network_policy].
10559    ///
10560    /// # Example
10561    /// ```ignore,no_run
10562    /// # use google_cloud_container_v1::model::Cluster;
10563    /// use google_cloud_container_v1::model::NetworkPolicy;
10564    /// let x = Cluster::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
10565    /// let x = Cluster::new().set_or_clear_network_policy(None::<NetworkPolicy>);
10566    /// ```
10567    pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
10568    where
10569        T: std::convert::Into<crate::model::NetworkPolicy>,
10570    {
10571        self.network_policy = v.map(|x| x.into());
10572        self
10573    }
10574
10575    /// Sets the value of [ip_allocation_policy][crate::model::Cluster::ip_allocation_policy].
10576    ///
10577    /// # Example
10578    /// ```ignore,no_run
10579    /// # use google_cloud_container_v1::model::Cluster;
10580    /// use google_cloud_container_v1::model::IPAllocationPolicy;
10581    /// let x = Cluster::new().set_ip_allocation_policy(IPAllocationPolicy::default()/* use setters */);
10582    /// ```
10583    pub fn set_ip_allocation_policy<T>(mut self, v: T) -> Self
10584    where
10585        T: std::convert::Into<crate::model::IPAllocationPolicy>,
10586    {
10587        self.ip_allocation_policy = std::option::Option::Some(v.into());
10588        self
10589    }
10590
10591    /// Sets or clears the value of [ip_allocation_policy][crate::model::Cluster::ip_allocation_policy].
10592    ///
10593    /// # Example
10594    /// ```ignore,no_run
10595    /// # use google_cloud_container_v1::model::Cluster;
10596    /// use google_cloud_container_v1::model::IPAllocationPolicy;
10597    /// let x = Cluster::new().set_or_clear_ip_allocation_policy(Some(IPAllocationPolicy::default()/* use setters */));
10598    /// let x = Cluster::new().set_or_clear_ip_allocation_policy(None::<IPAllocationPolicy>);
10599    /// ```
10600    pub fn set_or_clear_ip_allocation_policy<T>(mut self, v: std::option::Option<T>) -> Self
10601    where
10602        T: std::convert::Into<crate::model::IPAllocationPolicy>,
10603    {
10604        self.ip_allocation_policy = v.map(|x| x.into());
10605        self
10606    }
10607
10608    /// Sets the value of [master_authorized_networks_config][crate::model::Cluster::master_authorized_networks_config].
10609    ///
10610    /// # Example
10611    /// ```ignore,no_run
10612    /// # use google_cloud_container_v1::model::Cluster;
10613    /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
10614    /// let x = Cluster::new().set_master_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
10615    /// ```
10616    #[deprecated]
10617    pub fn set_master_authorized_networks_config<T>(mut self, v: T) -> Self
10618    where
10619        T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
10620    {
10621        self.master_authorized_networks_config = std::option::Option::Some(v.into());
10622        self
10623    }
10624
10625    /// Sets or clears the value of [master_authorized_networks_config][crate::model::Cluster::master_authorized_networks_config].
10626    ///
10627    /// # Example
10628    /// ```ignore,no_run
10629    /// # use google_cloud_container_v1::model::Cluster;
10630    /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
10631    /// let x = Cluster::new().set_or_clear_master_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
10632    /// let x = Cluster::new().set_or_clear_master_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
10633    /// ```
10634    #[deprecated]
10635    pub fn set_or_clear_master_authorized_networks_config<T>(
10636        mut self,
10637        v: std::option::Option<T>,
10638    ) -> Self
10639    where
10640        T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
10641    {
10642        self.master_authorized_networks_config = v.map(|x| x.into());
10643        self
10644    }
10645
10646    /// Sets the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
10647    ///
10648    /// # Example
10649    /// ```ignore,no_run
10650    /// # use google_cloud_container_v1::model::Cluster;
10651    /// use google_cloud_container_v1::model::MaintenancePolicy;
10652    /// let x = Cluster::new().set_maintenance_policy(MaintenancePolicy::default()/* use setters */);
10653    /// ```
10654    pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
10655    where
10656        T: std::convert::Into<crate::model::MaintenancePolicy>,
10657    {
10658        self.maintenance_policy = std::option::Option::Some(v.into());
10659        self
10660    }
10661
10662    /// Sets or clears the value of [maintenance_policy][crate::model::Cluster::maintenance_policy].
10663    ///
10664    /// # Example
10665    /// ```ignore,no_run
10666    /// # use google_cloud_container_v1::model::Cluster;
10667    /// use google_cloud_container_v1::model::MaintenancePolicy;
10668    /// let x = Cluster::new().set_or_clear_maintenance_policy(Some(MaintenancePolicy::default()/* use setters */));
10669    /// let x = Cluster::new().set_or_clear_maintenance_policy(None::<MaintenancePolicy>);
10670    /// ```
10671    pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
10672    where
10673        T: std::convert::Into<crate::model::MaintenancePolicy>,
10674    {
10675        self.maintenance_policy = v.map(|x| x.into());
10676        self
10677    }
10678
10679    /// Sets the value of [binary_authorization][crate::model::Cluster::binary_authorization].
10680    ///
10681    /// # Example
10682    /// ```ignore,no_run
10683    /// # use google_cloud_container_v1::model::Cluster;
10684    /// use google_cloud_container_v1::model::BinaryAuthorization;
10685    /// let x = Cluster::new().set_binary_authorization(BinaryAuthorization::default()/* use setters */);
10686    /// ```
10687    pub fn set_binary_authorization<T>(mut self, v: T) -> Self
10688    where
10689        T: std::convert::Into<crate::model::BinaryAuthorization>,
10690    {
10691        self.binary_authorization = std::option::Option::Some(v.into());
10692        self
10693    }
10694
10695    /// Sets or clears the value of [binary_authorization][crate::model::Cluster::binary_authorization].
10696    ///
10697    /// # Example
10698    /// ```ignore,no_run
10699    /// # use google_cloud_container_v1::model::Cluster;
10700    /// use google_cloud_container_v1::model::BinaryAuthorization;
10701    /// let x = Cluster::new().set_or_clear_binary_authorization(Some(BinaryAuthorization::default()/* use setters */));
10702    /// let x = Cluster::new().set_or_clear_binary_authorization(None::<BinaryAuthorization>);
10703    /// ```
10704    pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
10705    where
10706        T: std::convert::Into<crate::model::BinaryAuthorization>,
10707    {
10708        self.binary_authorization = v.map(|x| x.into());
10709        self
10710    }
10711
10712    /// Sets the value of [autoscaling][crate::model::Cluster::autoscaling].
10713    ///
10714    /// # Example
10715    /// ```ignore,no_run
10716    /// # use google_cloud_container_v1::model::Cluster;
10717    /// use google_cloud_container_v1::model::ClusterAutoscaling;
10718    /// let x = Cluster::new().set_autoscaling(ClusterAutoscaling::default()/* use setters */);
10719    /// ```
10720    pub fn set_autoscaling<T>(mut self, v: T) -> Self
10721    where
10722        T: std::convert::Into<crate::model::ClusterAutoscaling>,
10723    {
10724        self.autoscaling = std::option::Option::Some(v.into());
10725        self
10726    }
10727
10728    /// Sets or clears the value of [autoscaling][crate::model::Cluster::autoscaling].
10729    ///
10730    /// # Example
10731    /// ```ignore,no_run
10732    /// # use google_cloud_container_v1::model::Cluster;
10733    /// use google_cloud_container_v1::model::ClusterAutoscaling;
10734    /// let x = Cluster::new().set_or_clear_autoscaling(Some(ClusterAutoscaling::default()/* use setters */));
10735    /// let x = Cluster::new().set_or_clear_autoscaling(None::<ClusterAutoscaling>);
10736    /// ```
10737    pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
10738    where
10739        T: std::convert::Into<crate::model::ClusterAutoscaling>,
10740    {
10741        self.autoscaling = v.map(|x| x.into());
10742        self
10743    }
10744
10745    /// Sets the value of [network_config][crate::model::Cluster::network_config].
10746    ///
10747    /// # Example
10748    /// ```ignore,no_run
10749    /// # use google_cloud_container_v1::model::Cluster;
10750    /// use google_cloud_container_v1::model::NetworkConfig;
10751    /// let x = Cluster::new().set_network_config(NetworkConfig::default()/* use setters */);
10752    /// ```
10753    pub fn set_network_config<T>(mut self, v: T) -> Self
10754    where
10755        T: std::convert::Into<crate::model::NetworkConfig>,
10756    {
10757        self.network_config = std::option::Option::Some(v.into());
10758        self
10759    }
10760
10761    /// Sets or clears the value of [network_config][crate::model::Cluster::network_config].
10762    ///
10763    /// # Example
10764    /// ```ignore,no_run
10765    /// # use google_cloud_container_v1::model::Cluster;
10766    /// use google_cloud_container_v1::model::NetworkConfig;
10767    /// let x = Cluster::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
10768    /// let x = Cluster::new().set_or_clear_network_config(None::<NetworkConfig>);
10769    /// ```
10770    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
10771    where
10772        T: std::convert::Into<crate::model::NetworkConfig>,
10773    {
10774        self.network_config = v.map(|x| x.into());
10775        self
10776    }
10777
10778    /// Sets the value of [default_max_pods_constraint][crate::model::Cluster::default_max_pods_constraint].
10779    ///
10780    /// # Example
10781    /// ```ignore,no_run
10782    /// # use google_cloud_container_v1::model::Cluster;
10783    /// use google_cloud_container_v1::model::MaxPodsConstraint;
10784    /// let x = Cluster::new().set_default_max_pods_constraint(MaxPodsConstraint::default()/* use setters */);
10785    /// ```
10786    pub fn set_default_max_pods_constraint<T>(mut self, v: T) -> Self
10787    where
10788        T: std::convert::Into<crate::model::MaxPodsConstraint>,
10789    {
10790        self.default_max_pods_constraint = std::option::Option::Some(v.into());
10791        self
10792    }
10793
10794    /// Sets or clears the value of [default_max_pods_constraint][crate::model::Cluster::default_max_pods_constraint].
10795    ///
10796    /// # Example
10797    /// ```ignore,no_run
10798    /// # use google_cloud_container_v1::model::Cluster;
10799    /// use google_cloud_container_v1::model::MaxPodsConstraint;
10800    /// let x = Cluster::new().set_or_clear_default_max_pods_constraint(Some(MaxPodsConstraint::default()/* use setters */));
10801    /// let x = Cluster::new().set_or_clear_default_max_pods_constraint(None::<MaxPodsConstraint>);
10802    /// ```
10803    pub fn set_or_clear_default_max_pods_constraint<T>(mut self, v: std::option::Option<T>) -> Self
10804    where
10805        T: std::convert::Into<crate::model::MaxPodsConstraint>,
10806    {
10807        self.default_max_pods_constraint = v.map(|x| x.into());
10808        self
10809    }
10810
10811    /// Sets the value of [resource_usage_export_config][crate::model::Cluster::resource_usage_export_config].
10812    ///
10813    /// # Example
10814    /// ```ignore,no_run
10815    /// # use google_cloud_container_v1::model::Cluster;
10816    /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
10817    /// let x = Cluster::new().set_resource_usage_export_config(ResourceUsageExportConfig::default()/* use setters */);
10818    /// ```
10819    pub fn set_resource_usage_export_config<T>(mut self, v: T) -> Self
10820    where
10821        T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
10822    {
10823        self.resource_usage_export_config = std::option::Option::Some(v.into());
10824        self
10825    }
10826
10827    /// Sets or clears the value of [resource_usage_export_config][crate::model::Cluster::resource_usage_export_config].
10828    ///
10829    /// # Example
10830    /// ```ignore,no_run
10831    /// # use google_cloud_container_v1::model::Cluster;
10832    /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
10833    /// let x = Cluster::new().set_or_clear_resource_usage_export_config(Some(ResourceUsageExportConfig::default()/* use setters */));
10834    /// let x = Cluster::new().set_or_clear_resource_usage_export_config(None::<ResourceUsageExportConfig>);
10835    /// ```
10836    pub fn set_or_clear_resource_usage_export_config<T>(mut self, v: std::option::Option<T>) -> Self
10837    where
10838        T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
10839    {
10840        self.resource_usage_export_config = v.map(|x| x.into());
10841        self
10842    }
10843
10844    /// Sets the value of [authenticator_groups_config][crate::model::Cluster::authenticator_groups_config].
10845    ///
10846    /// # Example
10847    /// ```ignore,no_run
10848    /// # use google_cloud_container_v1::model::Cluster;
10849    /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
10850    /// let x = Cluster::new().set_authenticator_groups_config(AuthenticatorGroupsConfig::default()/* use setters */);
10851    /// ```
10852    pub fn set_authenticator_groups_config<T>(mut self, v: T) -> Self
10853    where
10854        T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
10855    {
10856        self.authenticator_groups_config = std::option::Option::Some(v.into());
10857        self
10858    }
10859
10860    /// Sets or clears the value of [authenticator_groups_config][crate::model::Cluster::authenticator_groups_config].
10861    ///
10862    /// # Example
10863    /// ```ignore,no_run
10864    /// # use google_cloud_container_v1::model::Cluster;
10865    /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
10866    /// let x = Cluster::new().set_or_clear_authenticator_groups_config(Some(AuthenticatorGroupsConfig::default()/* use setters */));
10867    /// let x = Cluster::new().set_or_clear_authenticator_groups_config(None::<AuthenticatorGroupsConfig>);
10868    /// ```
10869    pub fn set_or_clear_authenticator_groups_config<T>(mut self, v: std::option::Option<T>) -> Self
10870    where
10871        T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
10872    {
10873        self.authenticator_groups_config = v.map(|x| x.into());
10874        self
10875    }
10876
10877    /// Sets the value of [private_cluster_config][crate::model::Cluster::private_cluster_config].
10878    ///
10879    /// # Example
10880    /// ```ignore,no_run
10881    /// # use google_cloud_container_v1::model::Cluster;
10882    /// use google_cloud_container_v1::model::PrivateClusterConfig;
10883    /// let x = Cluster::new().set_private_cluster_config(PrivateClusterConfig::default()/* use setters */);
10884    /// ```
10885    pub fn set_private_cluster_config<T>(mut self, v: T) -> Self
10886    where
10887        T: std::convert::Into<crate::model::PrivateClusterConfig>,
10888    {
10889        self.private_cluster_config = std::option::Option::Some(v.into());
10890        self
10891    }
10892
10893    /// Sets or clears the value of [private_cluster_config][crate::model::Cluster::private_cluster_config].
10894    ///
10895    /// # Example
10896    /// ```ignore,no_run
10897    /// # use google_cloud_container_v1::model::Cluster;
10898    /// use google_cloud_container_v1::model::PrivateClusterConfig;
10899    /// let x = Cluster::new().set_or_clear_private_cluster_config(Some(PrivateClusterConfig::default()/* use setters */));
10900    /// let x = Cluster::new().set_or_clear_private_cluster_config(None::<PrivateClusterConfig>);
10901    /// ```
10902    pub fn set_or_clear_private_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
10903    where
10904        T: std::convert::Into<crate::model::PrivateClusterConfig>,
10905    {
10906        self.private_cluster_config = v.map(|x| x.into());
10907        self
10908    }
10909
10910    /// Sets the value of [database_encryption][crate::model::Cluster::database_encryption].
10911    ///
10912    /// # Example
10913    /// ```ignore,no_run
10914    /// # use google_cloud_container_v1::model::Cluster;
10915    /// use google_cloud_container_v1::model::DatabaseEncryption;
10916    /// let x = Cluster::new().set_database_encryption(DatabaseEncryption::default()/* use setters */);
10917    /// ```
10918    pub fn set_database_encryption<T>(mut self, v: T) -> Self
10919    where
10920        T: std::convert::Into<crate::model::DatabaseEncryption>,
10921    {
10922        self.database_encryption = std::option::Option::Some(v.into());
10923        self
10924    }
10925
10926    /// Sets or clears the value of [database_encryption][crate::model::Cluster::database_encryption].
10927    ///
10928    /// # Example
10929    /// ```ignore,no_run
10930    /// # use google_cloud_container_v1::model::Cluster;
10931    /// use google_cloud_container_v1::model::DatabaseEncryption;
10932    /// let x = Cluster::new().set_or_clear_database_encryption(Some(DatabaseEncryption::default()/* use setters */));
10933    /// let x = Cluster::new().set_or_clear_database_encryption(None::<DatabaseEncryption>);
10934    /// ```
10935    pub fn set_or_clear_database_encryption<T>(mut self, v: std::option::Option<T>) -> Self
10936    where
10937        T: std::convert::Into<crate::model::DatabaseEncryption>,
10938    {
10939        self.database_encryption = v.map(|x| x.into());
10940        self
10941    }
10942
10943    /// Sets the value of [vertical_pod_autoscaling][crate::model::Cluster::vertical_pod_autoscaling].
10944    ///
10945    /// # Example
10946    /// ```ignore,no_run
10947    /// # use google_cloud_container_v1::model::Cluster;
10948    /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
10949    /// let x = Cluster::new().set_vertical_pod_autoscaling(VerticalPodAutoscaling::default()/* use setters */);
10950    /// ```
10951    pub fn set_vertical_pod_autoscaling<T>(mut self, v: T) -> Self
10952    where
10953        T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
10954    {
10955        self.vertical_pod_autoscaling = std::option::Option::Some(v.into());
10956        self
10957    }
10958
10959    /// Sets or clears the value of [vertical_pod_autoscaling][crate::model::Cluster::vertical_pod_autoscaling].
10960    ///
10961    /// # Example
10962    /// ```ignore,no_run
10963    /// # use google_cloud_container_v1::model::Cluster;
10964    /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
10965    /// let x = Cluster::new().set_or_clear_vertical_pod_autoscaling(Some(VerticalPodAutoscaling::default()/* use setters */));
10966    /// let x = Cluster::new().set_or_clear_vertical_pod_autoscaling(None::<VerticalPodAutoscaling>);
10967    /// ```
10968    pub fn set_or_clear_vertical_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
10969    where
10970        T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
10971    {
10972        self.vertical_pod_autoscaling = v.map(|x| x.into());
10973        self
10974    }
10975
10976    /// Sets the value of [shielded_nodes][crate::model::Cluster::shielded_nodes].
10977    ///
10978    /// # Example
10979    /// ```ignore,no_run
10980    /// # use google_cloud_container_v1::model::Cluster;
10981    /// use google_cloud_container_v1::model::ShieldedNodes;
10982    /// let x = Cluster::new().set_shielded_nodes(ShieldedNodes::default()/* use setters */);
10983    /// ```
10984    pub fn set_shielded_nodes<T>(mut self, v: T) -> Self
10985    where
10986        T: std::convert::Into<crate::model::ShieldedNodes>,
10987    {
10988        self.shielded_nodes = std::option::Option::Some(v.into());
10989        self
10990    }
10991
10992    /// Sets or clears the value of [shielded_nodes][crate::model::Cluster::shielded_nodes].
10993    ///
10994    /// # Example
10995    /// ```ignore,no_run
10996    /// # use google_cloud_container_v1::model::Cluster;
10997    /// use google_cloud_container_v1::model::ShieldedNodes;
10998    /// let x = Cluster::new().set_or_clear_shielded_nodes(Some(ShieldedNodes::default()/* use setters */));
10999    /// let x = Cluster::new().set_or_clear_shielded_nodes(None::<ShieldedNodes>);
11000    /// ```
11001    pub fn set_or_clear_shielded_nodes<T>(mut self, v: std::option::Option<T>) -> Self
11002    where
11003        T: std::convert::Into<crate::model::ShieldedNodes>,
11004    {
11005        self.shielded_nodes = v.map(|x| x.into());
11006        self
11007    }
11008
11009    /// Sets the value of [release_channel][crate::model::Cluster::release_channel].
11010    ///
11011    /// # Example
11012    /// ```ignore,no_run
11013    /// # use google_cloud_container_v1::model::Cluster;
11014    /// use google_cloud_container_v1::model::ReleaseChannel;
11015    /// let x = Cluster::new().set_release_channel(ReleaseChannel::default()/* use setters */);
11016    /// ```
11017    pub fn set_release_channel<T>(mut self, v: T) -> Self
11018    where
11019        T: std::convert::Into<crate::model::ReleaseChannel>,
11020    {
11021        self.release_channel = std::option::Option::Some(v.into());
11022        self
11023    }
11024
11025    /// Sets or clears the value of [release_channel][crate::model::Cluster::release_channel].
11026    ///
11027    /// # Example
11028    /// ```ignore,no_run
11029    /// # use google_cloud_container_v1::model::Cluster;
11030    /// use google_cloud_container_v1::model::ReleaseChannel;
11031    /// let x = Cluster::new().set_or_clear_release_channel(Some(ReleaseChannel::default()/* use setters */));
11032    /// let x = Cluster::new().set_or_clear_release_channel(None::<ReleaseChannel>);
11033    /// ```
11034    pub fn set_or_clear_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
11035    where
11036        T: std::convert::Into<crate::model::ReleaseChannel>,
11037    {
11038        self.release_channel = v.map(|x| x.into());
11039        self
11040    }
11041
11042    /// Sets the value of [workload_identity_config][crate::model::Cluster::workload_identity_config].
11043    ///
11044    /// # Example
11045    /// ```ignore,no_run
11046    /// # use google_cloud_container_v1::model::Cluster;
11047    /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
11048    /// let x = Cluster::new().set_workload_identity_config(WorkloadIdentityConfig::default()/* use setters */);
11049    /// ```
11050    pub fn set_workload_identity_config<T>(mut self, v: T) -> Self
11051    where
11052        T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
11053    {
11054        self.workload_identity_config = std::option::Option::Some(v.into());
11055        self
11056    }
11057
11058    /// Sets or clears the value of [workload_identity_config][crate::model::Cluster::workload_identity_config].
11059    ///
11060    /// # Example
11061    /// ```ignore,no_run
11062    /// # use google_cloud_container_v1::model::Cluster;
11063    /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
11064    /// let x = Cluster::new().set_or_clear_workload_identity_config(Some(WorkloadIdentityConfig::default()/* use setters */));
11065    /// let x = Cluster::new().set_or_clear_workload_identity_config(None::<WorkloadIdentityConfig>);
11066    /// ```
11067    pub fn set_or_clear_workload_identity_config<T>(mut self, v: std::option::Option<T>) -> Self
11068    where
11069        T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
11070    {
11071        self.workload_identity_config = v.map(|x| x.into());
11072        self
11073    }
11074
11075    /// Sets the value of [mesh_certificates][crate::model::Cluster::mesh_certificates].
11076    ///
11077    /// # Example
11078    /// ```ignore,no_run
11079    /// # use google_cloud_container_v1::model::Cluster;
11080    /// use google_cloud_container_v1::model::MeshCertificates;
11081    /// let x = Cluster::new().set_mesh_certificates(MeshCertificates::default()/* use setters */);
11082    /// ```
11083    pub fn set_mesh_certificates<T>(mut self, v: T) -> Self
11084    where
11085        T: std::convert::Into<crate::model::MeshCertificates>,
11086    {
11087        self.mesh_certificates = std::option::Option::Some(v.into());
11088        self
11089    }
11090
11091    /// Sets or clears the value of [mesh_certificates][crate::model::Cluster::mesh_certificates].
11092    ///
11093    /// # Example
11094    /// ```ignore,no_run
11095    /// # use google_cloud_container_v1::model::Cluster;
11096    /// use google_cloud_container_v1::model::MeshCertificates;
11097    /// let x = Cluster::new().set_or_clear_mesh_certificates(Some(MeshCertificates::default()/* use setters */));
11098    /// let x = Cluster::new().set_or_clear_mesh_certificates(None::<MeshCertificates>);
11099    /// ```
11100    pub fn set_or_clear_mesh_certificates<T>(mut self, v: std::option::Option<T>) -> Self
11101    where
11102        T: std::convert::Into<crate::model::MeshCertificates>,
11103    {
11104        self.mesh_certificates = v.map(|x| x.into());
11105        self
11106    }
11107
11108    /// Sets the value of [cost_management_config][crate::model::Cluster::cost_management_config].
11109    ///
11110    /// # Example
11111    /// ```ignore,no_run
11112    /// # use google_cloud_container_v1::model::Cluster;
11113    /// use google_cloud_container_v1::model::CostManagementConfig;
11114    /// let x = Cluster::new().set_cost_management_config(CostManagementConfig::default()/* use setters */);
11115    /// ```
11116    pub fn set_cost_management_config<T>(mut self, v: T) -> Self
11117    where
11118        T: std::convert::Into<crate::model::CostManagementConfig>,
11119    {
11120        self.cost_management_config = std::option::Option::Some(v.into());
11121        self
11122    }
11123
11124    /// Sets or clears the value of [cost_management_config][crate::model::Cluster::cost_management_config].
11125    ///
11126    /// # Example
11127    /// ```ignore,no_run
11128    /// # use google_cloud_container_v1::model::Cluster;
11129    /// use google_cloud_container_v1::model::CostManagementConfig;
11130    /// let x = Cluster::new().set_or_clear_cost_management_config(Some(CostManagementConfig::default()/* use setters */));
11131    /// let x = Cluster::new().set_or_clear_cost_management_config(None::<CostManagementConfig>);
11132    /// ```
11133    pub fn set_or_clear_cost_management_config<T>(mut self, v: std::option::Option<T>) -> Self
11134    where
11135        T: std::convert::Into<crate::model::CostManagementConfig>,
11136    {
11137        self.cost_management_config = v.map(|x| x.into());
11138        self
11139    }
11140
11141    /// Sets the value of [notification_config][crate::model::Cluster::notification_config].
11142    ///
11143    /// # Example
11144    /// ```ignore,no_run
11145    /// # use google_cloud_container_v1::model::Cluster;
11146    /// use google_cloud_container_v1::model::NotificationConfig;
11147    /// let x = Cluster::new().set_notification_config(NotificationConfig::default()/* use setters */);
11148    /// ```
11149    pub fn set_notification_config<T>(mut self, v: T) -> Self
11150    where
11151        T: std::convert::Into<crate::model::NotificationConfig>,
11152    {
11153        self.notification_config = std::option::Option::Some(v.into());
11154        self
11155    }
11156
11157    /// Sets or clears the value of [notification_config][crate::model::Cluster::notification_config].
11158    ///
11159    /// # Example
11160    /// ```ignore,no_run
11161    /// # use google_cloud_container_v1::model::Cluster;
11162    /// use google_cloud_container_v1::model::NotificationConfig;
11163    /// let x = Cluster::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
11164    /// let x = Cluster::new().set_or_clear_notification_config(None::<NotificationConfig>);
11165    /// ```
11166    pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
11167    where
11168        T: std::convert::Into<crate::model::NotificationConfig>,
11169    {
11170        self.notification_config = v.map(|x| x.into());
11171        self
11172    }
11173
11174    /// Sets the value of [confidential_nodes][crate::model::Cluster::confidential_nodes].
11175    ///
11176    /// # Example
11177    /// ```ignore,no_run
11178    /// # use google_cloud_container_v1::model::Cluster;
11179    /// use google_cloud_container_v1::model::ConfidentialNodes;
11180    /// let x = Cluster::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
11181    /// ```
11182    pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
11183    where
11184        T: std::convert::Into<crate::model::ConfidentialNodes>,
11185    {
11186        self.confidential_nodes = std::option::Option::Some(v.into());
11187        self
11188    }
11189
11190    /// Sets or clears the value of [confidential_nodes][crate::model::Cluster::confidential_nodes].
11191    ///
11192    /// # Example
11193    /// ```ignore,no_run
11194    /// # use google_cloud_container_v1::model::Cluster;
11195    /// use google_cloud_container_v1::model::ConfidentialNodes;
11196    /// let x = Cluster::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
11197    /// let x = Cluster::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
11198    /// ```
11199    pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
11200    where
11201        T: std::convert::Into<crate::model::ConfidentialNodes>,
11202    {
11203        self.confidential_nodes = v.map(|x| x.into());
11204        self
11205    }
11206
11207    /// Sets the value of [identity_service_config][crate::model::Cluster::identity_service_config].
11208    ///
11209    /// # Example
11210    /// ```ignore,no_run
11211    /// # use google_cloud_container_v1::model::Cluster;
11212    /// use google_cloud_container_v1::model::IdentityServiceConfig;
11213    /// let x = Cluster::new().set_identity_service_config(IdentityServiceConfig::default()/* use setters */);
11214    /// ```
11215    pub fn set_identity_service_config<T>(mut self, v: T) -> Self
11216    where
11217        T: std::convert::Into<crate::model::IdentityServiceConfig>,
11218    {
11219        self.identity_service_config = std::option::Option::Some(v.into());
11220        self
11221    }
11222
11223    /// Sets or clears the value of [identity_service_config][crate::model::Cluster::identity_service_config].
11224    ///
11225    /// # Example
11226    /// ```ignore,no_run
11227    /// # use google_cloud_container_v1::model::Cluster;
11228    /// use google_cloud_container_v1::model::IdentityServiceConfig;
11229    /// let x = Cluster::new().set_or_clear_identity_service_config(Some(IdentityServiceConfig::default()/* use setters */));
11230    /// let x = Cluster::new().set_or_clear_identity_service_config(None::<IdentityServiceConfig>);
11231    /// ```
11232    pub fn set_or_clear_identity_service_config<T>(mut self, v: std::option::Option<T>) -> Self
11233    where
11234        T: std::convert::Into<crate::model::IdentityServiceConfig>,
11235    {
11236        self.identity_service_config = v.map(|x| x.into());
11237        self
11238    }
11239
11240    /// Sets the value of [self_link][crate::model::Cluster::self_link].
11241    ///
11242    /// # Example
11243    /// ```ignore,no_run
11244    /// # use google_cloud_container_v1::model::Cluster;
11245    /// let x = Cluster::new().set_self_link("example");
11246    /// ```
11247    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11248        self.self_link = v.into();
11249        self
11250    }
11251
11252    /// Sets the value of [zone][crate::model::Cluster::zone].
11253    ///
11254    /// # Example
11255    /// ```ignore,no_run
11256    /// # use google_cloud_container_v1::model::Cluster;
11257    /// let x = Cluster::new().set_zone("example");
11258    /// ```
11259    #[deprecated]
11260    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11261        self.zone = v.into();
11262        self
11263    }
11264
11265    /// Sets the value of [endpoint][crate::model::Cluster::endpoint].
11266    ///
11267    /// # Example
11268    /// ```ignore,no_run
11269    /// # use google_cloud_container_v1::model::Cluster;
11270    /// let x = Cluster::new().set_endpoint("example");
11271    /// ```
11272    pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11273        self.endpoint = v.into();
11274        self
11275    }
11276
11277    /// Sets the value of [initial_cluster_version][crate::model::Cluster::initial_cluster_version].
11278    ///
11279    /// # Example
11280    /// ```ignore,no_run
11281    /// # use google_cloud_container_v1::model::Cluster;
11282    /// let x = Cluster::new().set_initial_cluster_version("example");
11283    /// ```
11284    pub fn set_initial_cluster_version<T: std::convert::Into<std::string::String>>(
11285        mut self,
11286        v: T,
11287    ) -> Self {
11288        self.initial_cluster_version = v.into();
11289        self
11290    }
11291
11292    /// Sets the value of [current_master_version][crate::model::Cluster::current_master_version].
11293    ///
11294    /// # Example
11295    /// ```ignore,no_run
11296    /// # use google_cloud_container_v1::model::Cluster;
11297    /// let x = Cluster::new().set_current_master_version("example");
11298    /// ```
11299    pub fn set_current_master_version<T: std::convert::Into<std::string::String>>(
11300        mut self,
11301        v: T,
11302    ) -> Self {
11303        self.current_master_version = v.into();
11304        self
11305    }
11306
11307    /// Sets the value of [current_node_version][crate::model::Cluster::current_node_version].
11308    ///
11309    /// # Example
11310    /// ```ignore,no_run
11311    /// # use google_cloud_container_v1::model::Cluster;
11312    /// let x = Cluster::new().set_current_node_version("example");
11313    /// ```
11314    #[deprecated]
11315    pub fn set_current_node_version<T: std::convert::Into<std::string::String>>(
11316        mut self,
11317        v: T,
11318    ) -> Self {
11319        self.current_node_version = v.into();
11320        self
11321    }
11322
11323    /// Sets the value of [create_time][crate::model::Cluster::create_time].
11324    ///
11325    /// # Example
11326    /// ```ignore,no_run
11327    /// # use google_cloud_container_v1::model::Cluster;
11328    /// let x = Cluster::new().set_create_time("example");
11329    /// ```
11330    pub fn set_create_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11331        self.create_time = v.into();
11332        self
11333    }
11334
11335    /// Sets the value of [status][crate::model::Cluster::status].
11336    ///
11337    /// # Example
11338    /// ```ignore,no_run
11339    /// # use google_cloud_container_v1::model::Cluster;
11340    /// use google_cloud_container_v1::model::cluster::Status;
11341    /// let x0 = Cluster::new().set_status(Status::Provisioning);
11342    /// let x1 = Cluster::new().set_status(Status::Running);
11343    /// let x2 = Cluster::new().set_status(Status::Reconciling);
11344    /// ```
11345    pub fn set_status<T: std::convert::Into<crate::model::cluster::Status>>(
11346        mut self,
11347        v: T,
11348    ) -> Self {
11349        self.status = v.into();
11350        self
11351    }
11352
11353    /// Sets the value of [status_message][crate::model::Cluster::status_message].
11354    ///
11355    /// # Example
11356    /// ```ignore,no_run
11357    /// # use google_cloud_container_v1::model::Cluster;
11358    /// let x = Cluster::new().set_status_message("example");
11359    /// ```
11360    #[deprecated]
11361    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11362        self.status_message = v.into();
11363        self
11364    }
11365
11366    /// Sets the value of [node_ipv4_cidr_size][crate::model::Cluster::node_ipv4_cidr_size].
11367    ///
11368    /// # Example
11369    /// ```ignore,no_run
11370    /// # use google_cloud_container_v1::model::Cluster;
11371    /// let x = Cluster::new().set_node_ipv4_cidr_size(42);
11372    /// ```
11373    pub fn set_node_ipv4_cidr_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11374        self.node_ipv4_cidr_size = v.into();
11375        self
11376    }
11377
11378    /// Sets the value of [services_ipv4_cidr][crate::model::Cluster::services_ipv4_cidr].
11379    ///
11380    /// # Example
11381    /// ```ignore,no_run
11382    /// # use google_cloud_container_v1::model::Cluster;
11383    /// let x = Cluster::new().set_services_ipv4_cidr("example");
11384    /// ```
11385    pub fn set_services_ipv4_cidr<T: std::convert::Into<std::string::String>>(
11386        mut self,
11387        v: T,
11388    ) -> Self {
11389        self.services_ipv4_cidr = v.into();
11390        self
11391    }
11392
11393    /// Sets the value of [instance_group_urls][crate::model::Cluster::instance_group_urls].
11394    ///
11395    /// # Example
11396    /// ```ignore,no_run
11397    /// # use google_cloud_container_v1::model::Cluster;
11398    /// let x = Cluster::new().set_instance_group_urls(["a", "b", "c"]);
11399    /// ```
11400    #[deprecated]
11401    pub fn set_instance_group_urls<T, V>(mut self, v: T) -> Self
11402    where
11403        T: std::iter::IntoIterator<Item = V>,
11404        V: std::convert::Into<std::string::String>,
11405    {
11406        use std::iter::Iterator;
11407        self.instance_group_urls = v.into_iter().map(|i| i.into()).collect();
11408        self
11409    }
11410
11411    /// Sets the value of [current_node_count][crate::model::Cluster::current_node_count].
11412    ///
11413    /// # Example
11414    /// ```ignore,no_run
11415    /// # use google_cloud_container_v1::model::Cluster;
11416    /// let x = Cluster::new().set_current_node_count(42);
11417    /// ```
11418    #[deprecated]
11419    pub fn set_current_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11420        self.current_node_count = v.into();
11421        self
11422    }
11423
11424    /// Sets the value of [expire_time][crate::model::Cluster::expire_time].
11425    ///
11426    /// # Example
11427    /// ```ignore,no_run
11428    /// # use google_cloud_container_v1::model::Cluster;
11429    /// let x = Cluster::new().set_expire_time("example");
11430    /// ```
11431    pub fn set_expire_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11432        self.expire_time = v.into();
11433        self
11434    }
11435
11436    /// Sets the value of [location][crate::model::Cluster::location].
11437    ///
11438    /// # Example
11439    /// ```ignore,no_run
11440    /// # use google_cloud_container_v1::model::Cluster;
11441    /// let x = Cluster::new().set_location("example");
11442    /// ```
11443    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11444        self.location = v.into();
11445        self
11446    }
11447
11448    /// Sets the value of [enable_tpu][crate::model::Cluster::enable_tpu].
11449    ///
11450    /// # Example
11451    /// ```ignore,no_run
11452    /// # use google_cloud_container_v1::model::Cluster;
11453    /// let x = Cluster::new().set_enable_tpu(true);
11454    /// ```
11455    #[deprecated]
11456    pub fn set_enable_tpu<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11457        self.enable_tpu = v.into();
11458        self
11459    }
11460
11461    /// Sets the value of [tpu_ipv4_cidr_block][crate::model::Cluster::tpu_ipv4_cidr_block].
11462    ///
11463    /// # Example
11464    /// ```ignore,no_run
11465    /// # use google_cloud_container_v1::model::Cluster;
11466    /// let x = Cluster::new().set_tpu_ipv4_cidr_block("example");
11467    /// ```
11468    #[deprecated]
11469    pub fn set_tpu_ipv4_cidr_block<T: std::convert::Into<std::string::String>>(
11470        mut self,
11471        v: T,
11472    ) -> Self {
11473        self.tpu_ipv4_cidr_block = v.into();
11474        self
11475    }
11476
11477    /// Sets the value of [conditions][crate::model::Cluster::conditions].
11478    ///
11479    /// # Example
11480    /// ```ignore,no_run
11481    /// # use google_cloud_container_v1::model::Cluster;
11482    /// use google_cloud_container_v1::model::StatusCondition;
11483    /// let x = Cluster::new()
11484    ///     .set_conditions([
11485    ///         StatusCondition::default()/* use setters */,
11486    ///         StatusCondition::default()/* use (different) setters */,
11487    ///     ]);
11488    /// ```
11489    pub fn set_conditions<T, V>(mut self, v: T) -> Self
11490    where
11491        T: std::iter::IntoIterator<Item = V>,
11492        V: std::convert::Into<crate::model::StatusCondition>,
11493    {
11494        use std::iter::Iterator;
11495        self.conditions = v.into_iter().map(|i| i.into()).collect();
11496        self
11497    }
11498
11499    /// Sets the value of [autopilot][crate::model::Cluster::autopilot].
11500    ///
11501    /// # Example
11502    /// ```ignore,no_run
11503    /// # use google_cloud_container_v1::model::Cluster;
11504    /// use google_cloud_container_v1::model::Autopilot;
11505    /// let x = Cluster::new().set_autopilot(Autopilot::default()/* use setters */);
11506    /// ```
11507    pub fn set_autopilot<T>(mut self, v: T) -> Self
11508    where
11509        T: std::convert::Into<crate::model::Autopilot>,
11510    {
11511        self.autopilot = std::option::Option::Some(v.into());
11512        self
11513    }
11514
11515    /// Sets or clears the value of [autopilot][crate::model::Cluster::autopilot].
11516    ///
11517    /// # Example
11518    /// ```ignore,no_run
11519    /// # use google_cloud_container_v1::model::Cluster;
11520    /// use google_cloud_container_v1::model::Autopilot;
11521    /// let x = Cluster::new().set_or_clear_autopilot(Some(Autopilot::default()/* use setters */));
11522    /// let x = Cluster::new().set_or_clear_autopilot(None::<Autopilot>);
11523    /// ```
11524    pub fn set_or_clear_autopilot<T>(mut self, v: std::option::Option<T>) -> Self
11525    where
11526        T: std::convert::Into<crate::model::Autopilot>,
11527    {
11528        self.autopilot = v.map(|x| x.into());
11529        self
11530    }
11531
11532    /// Sets the value of [id][crate::model::Cluster::id].
11533    ///
11534    /// # Example
11535    /// ```ignore,no_run
11536    /// # use google_cloud_container_v1::model::Cluster;
11537    /// let x = Cluster::new().set_id("example");
11538    /// ```
11539    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11540        self.id = v.into();
11541        self
11542    }
11543
11544    /// Sets the value of [node_pool_defaults][crate::model::Cluster::node_pool_defaults].
11545    ///
11546    /// # Example
11547    /// ```ignore,no_run
11548    /// # use google_cloud_container_v1::model::Cluster;
11549    /// use google_cloud_container_v1::model::NodePoolDefaults;
11550    /// let x = Cluster::new().set_node_pool_defaults(NodePoolDefaults::default()/* use setters */);
11551    /// ```
11552    pub fn set_node_pool_defaults<T>(mut self, v: T) -> Self
11553    where
11554        T: std::convert::Into<crate::model::NodePoolDefaults>,
11555    {
11556        self.node_pool_defaults = std::option::Option::Some(v.into());
11557        self
11558    }
11559
11560    /// Sets or clears the value of [node_pool_defaults][crate::model::Cluster::node_pool_defaults].
11561    ///
11562    /// # Example
11563    /// ```ignore,no_run
11564    /// # use google_cloud_container_v1::model::Cluster;
11565    /// use google_cloud_container_v1::model::NodePoolDefaults;
11566    /// let x = Cluster::new().set_or_clear_node_pool_defaults(Some(NodePoolDefaults::default()/* use setters */));
11567    /// let x = Cluster::new().set_or_clear_node_pool_defaults(None::<NodePoolDefaults>);
11568    /// ```
11569    pub fn set_or_clear_node_pool_defaults<T>(mut self, v: std::option::Option<T>) -> Self
11570    where
11571        T: std::convert::Into<crate::model::NodePoolDefaults>,
11572    {
11573        self.node_pool_defaults = v.map(|x| x.into());
11574        self
11575    }
11576
11577    /// Sets the value of [logging_config][crate::model::Cluster::logging_config].
11578    ///
11579    /// # Example
11580    /// ```ignore,no_run
11581    /// # use google_cloud_container_v1::model::Cluster;
11582    /// use google_cloud_container_v1::model::LoggingConfig;
11583    /// let x = Cluster::new().set_logging_config(LoggingConfig::default()/* use setters */);
11584    /// ```
11585    pub fn set_logging_config<T>(mut self, v: T) -> Self
11586    where
11587        T: std::convert::Into<crate::model::LoggingConfig>,
11588    {
11589        self.logging_config = std::option::Option::Some(v.into());
11590        self
11591    }
11592
11593    /// Sets or clears the value of [logging_config][crate::model::Cluster::logging_config].
11594    ///
11595    /// # Example
11596    /// ```ignore,no_run
11597    /// # use google_cloud_container_v1::model::Cluster;
11598    /// use google_cloud_container_v1::model::LoggingConfig;
11599    /// let x = Cluster::new().set_or_clear_logging_config(Some(LoggingConfig::default()/* use setters */));
11600    /// let x = Cluster::new().set_or_clear_logging_config(None::<LoggingConfig>);
11601    /// ```
11602    pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
11603    where
11604        T: std::convert::Into<crate::model::LoggingConfig>,
11605    {
11606        self.logging_config = v.map(|x| x.into());
11607        self
11608    }
11609
11610    /// Sets the value of [monitoring_config][crate::model::Cluster::monitoring_config].
11611    ///
11612    /// # Example
11613    /// ```ignore,no_run
11614    /// # use google_cloud_container_v1::model::Cluster;
11615    /// use google_cloud_container_v1::model::MonitoringConfig;
11616    /// let x = Cluster::new().set_monitoring_config(MonitoringConfig::default()/* use setters */);
11617    /// ```
11618    pub fn set_monitoring_config<T>(mut self, v: T) -> Self
11619    where
11620        T: std::convert::Into<crate::model::MonitoringConfig>,
11621    {
11622        self.monitoring_config = std::option::Option::Some(v.into());
11623        self
11624    }
11625
11626    /// Sets or clears the value of [monitoring_config][crate::model::Cluster::monitoring_config].
11627    ///
11628    /// # Example
11629    /// ```ignore,no_run
11630    /// # use google_cloud_container_v1::model::Cluster;
11631    /// use google_cloud_container_v1::model::MonitoringConfig;
11632    /// let x = Cluster::new().set_or_clear_monitoring_config(Some(MonitoringConfig::default()/* use setters */));
11633    /// let x = Cluster::new().set_or_clear_monitoring_config(None::<MonitoringConfig>);
11634    /// ```
11635    pub fn set_or_clear_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
11636    where
11637        T: std::convert::Into<crate::model::MonitoringConfig>,
11638    {
11639        self.monitoring_config = v.map(|x| x.into());
11640        self
11641    }
11642
11643    /// Sets the value of [node_pool_auto_config][crate::model::Cluster::node_pool_auto_config].
11644    ///
11645    /// # Example
11646    /// ```ignore,no_run
11647    /// # use google_cloud_container_v1::model::Cluster;
11648    /// use google_cloud_container_v1::model::NodePoolAutoConfig;
11649    /// let x = Cluster::new().set_node_pool_auto_config(NodePoolAutoConfig::default()/* use setters */);
11650    /// ```
11651    pub fn set_node_pool_auto_config<T>(mut self, v: T) -> Self
11652    where
11653        T: std::convert::Into<crate::model::NodePoolAutoConfig>,
11654    {
11655        self.node_pool_auto_config = std::option::Option::Some(v.into());
11656        self
11657    }
11658
11659    /// Sets or clears the value of [node_pool_auto_config][crate::model::Cluster::node_pool_auto_config].
11660    ///
11661    /// # Example
11662    /// ```ignore,no_run
11663    /// # use google_cloud_container_v1::model::Cluster;
11664    /// use google_cloud_container_v1::model::NodePoolAutoConfig;
11665    /// let x = Cluster::new().set_or_clear_node_pool_auto_config(Some(NodePoolAutoConfig::default()/* use setters */));
11666    /// let x = Cluster::new().set_or_clear_node_pool_auto_config(None::<NodePoolAutoConfig>);
11667    /// ```
11668    pub fn set_or_clear_node_pool_auto_config<T>(mut self, v: std::option::Option<T>) -> Self
11669    where
11670        T: std::convert::Into<crate::model::NodePoolAutoConfig>,
11671    {
11672        self.node_pool_auto_config = v.map(|x| x.into());
11673        self
11674    }
11675
11676    /// Sets the value of [pod_autoscaling][crate::model::Cluster::pod_autoscaling].
11677    ///
11678    /// # Example
11679    /// ```ignore,no_run
11680    /// # use google_cloud_container_v1::model::Cluster;
11681    /// use google_cloud_container_v1::model::PodAutoscaling;
11682    /// let x = Cluster::new().set_pod_autoscaling(PodAutoscaling::default()/* use setters */);
11683    /// ```
11684    pub fn set_pod_autoscaling<T>(mut self, v: T) -> Self
11685    where
11686        T: std::convert::Into<crate::model::PodAutoscaling>,
11687    {
11688        self.pod_autoscaling = std::option::Option::Some(v.into());
11689        self
11690    }
11691
11692    /// Sets or clears the value of [pod_autoscaling][crate::model::Cluster::pod_autoscaling].
11693    ///
11694    /// # Example
11695    /// ```ignore,no_run
11696    /// # use google_cloud_container_v1::model::Cluster;
11697    /// use google_cloud_container_v1::model::PodAutoscaling;
11698    /// let x = Cluster::new().set_or_clear_pod_autoscaling(Some(PodAutoscaling::default()/* use setters */));
11699    /// let x = Cluster::new().set_or_clear_pod_autoscaling(None::<PodAutoscaling>);
11700    /// ```
11701    pub fn set_or_clear_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
11702    where
11703        T: std::convert::Into<crate::model::PodAutoscaling>,
11704    {
11705        self.pod_autoscaling = v.map(|x| x.into());
11706        self
11707    }
11708
11709    /// Sets the value of [etag][crate::model::Cluster::etag].
11710    ///
11711    /// # Example
11712    /// ```ignore,no_run
11713    /// # use google_cloud_container_v1::model::Cluster;
11714    /// let x = Cluster::new().set_etag("example");
11715    /// ```
11716    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11717        self.etag = v.into();
11718        self
11719    }
11720
11721    /// Sets the value of [fleet][crate::model::Cluster::fleet].
11722    ///
11723    /// # Example
11724    /// ```ignore,no_run
11725    /// # use google_cloud_container_v1::model::Cluster;
11726    /// use google_cloud_container_v1::model::Fleet;
11727    /// let x = Cluster::new().set_fleet(Fleet::default()/* use setters */);
11728    /// ```
11729    pub fn set_fleet<T>(mut self, v: T) -> Self
11730    where
11731        T: std::convert::Into<crate::model::Fleet>,
11732    {
11733        self.fleet = std::option::Option::Some(v.into());
11734        self
11735    }
11736
11737    /// Sets or clears the value of [fleet][crate::model::Cluster::fleet].
11738    ///
11739    /// # Example
11740    /// ```ignore,no_run
11741    /// # use google_cloud_container_v1::model::Cluster;
11742    /// use google_cloud_container_v1::model::Fleet;
11743    /// let x = Cluster::new().set_or_clear_fleet(Some(Fleet::default()/* use setters */));
11744    /// let x = Cluster::new().set_or_clear_fleet(None::<Fleet>);
11745    /// ```
11746    pub fn set_or_clear_fleet<T>(mut self, v: std::option::Option<T>) -> Self
11747    where
11748        T: std::convert::Into<crate::model::Fleet>,
11749    {
11750        self.fleet = v.map(|x| x.into());
11751        self
11752    }
11753
11754    /// Sets the value of [security_posture_config][crate::model::Cluster::security_posture_config].
11755    ///
11756    /// # Example
11757    /// ```ignore,no_run
11758    /// # use google_cloud_container_v1::model::Cluster;
11759    /// use google_cloud_container_v1::model::SecurityPostureConfig;
11760    /// let x = Cluster::new().set_security_posture_config(SecurityPostureConfig::default()/* use setters */);
11761    /// ```
11762    pub fn set_security_posture_config<T>(mut self, v: T) -> Self
11763    where
11764        T: std::convert::Into<crate::model::SecurityPostureConfig>,
11765    {
11766        self.security_posture_config = std::option::Option::Some(v.into());
11767        self
11768    }
11769
11770    /// Sets or clears the value of [security_posture_config][crate::model::Cluster::security_posture_config].
11771    ///
11772    /// # Example
11773    /// ```ignore,no_run
11774    /// # use google_cloud_container_v1::model::Cluster;
11775    /// use google_cloud_container_v1::model::SecurityPostureConfig;
11776    /// let x = Cluster::new().set_or_clear_security_posture_config(Some(SecurityPostureConfig::default()/* use setters */));
11777    /// let x = Cluster::new().set_or_clear_security_posture_config(None::<SecurityPostureConfig>);
11778    /// ```
11779    pub fn set_or_clear_security_posture_config<T>(mut self, v: std::option::Option<T>) -> Self
11780    where
11781        T: std::convert::Into<crate::model::SecurityPostureConfig>,
11782    {
11783        self.security_posture_config = v.map(|x| x.into());
11784        self
11785    }
11786
11787    /// Sets the value of [control_plane_endpoints_config][crate::model::Cluster::control_plane_endpoints_config].
11788    ///
11789    /// # Example
11790    /// ```ignore,no_run
11791    /// # use google_cloud_container_v1::model::Cluster;
11792    /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
11793    /// let x = Cluster::new().set_control_plane_endpoints_config(ControlPlaneEndpointsConfig::default()/* use setters */);
11794    /// ```
11795    pub fn set_control_plane_endpoints_config<T>(mut self, v: T) -> Self
11796    where
11797        T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
11798    {
11799        self.control_plane_endpoints_config = std::option::Option::Some(v.into());
11800        self
11801    }
11802
11803    /// Sets or clears the value of [control_plane_endpoints_config][crate::model::Cluster::control_plane_endpoints_config].
11804    ///
11805    /// # Example
11806    /// ```ignore,no_run
11807    /// # use google_cloud_container_v1::model::Cluster;
11808    /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
11809    /// let x = Cluster::new().set_or_clear_control_plane_endpoints_config(Some(ControlPlaneEndpointsConfig::default()/* use setters */));
11810    /// let x = Cluster::new().set_or_clear_control_plane_endpoints_config(None::<ControlPlaneEndpointsConfig>);
11811    /// ```
11812    pub fn set_or_clear_control_plane_endpoints_config<T>(
11813        mut self,
11814        v: std::option::Option<T>,
11815    ) -> Self
11816    where
11817        T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
11818    {
11819        self.control_plane_endpoints_config = v.map(|x| x.into());
11820        self
11821    }
11822
11823    /// Sets the value of [enable_k8s_beta_apis][crate::model::Cluster::enable_k8s_beta_apis].
11824    ///
11825    /// # Example
11826    /// ```ignore,no_run
11827    /// # use google_cloud_container_v1::model::Cluster;
11828    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
11829    /// let x = Cluster::new().set_enable_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
11830    /// ```
11831    pub fn set_enable_k8s_beta_apis<T>(mut self, v: T) -> Self
11832    where
11833        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
11834    {
11835        self.enable_k8s_beta_apis = std::option::Option::Some(v.into());
11836        self
11837    }
11838
11839    /// Sets or clears the value of [enable_k8s_beta_apis][crate::model::Cluster::enable_k8s_beta_apis].
11840    ///
11841    /// # Example
11842    /// ```ignore,no_run
11843    /// # use google_cloud_container_v1::model::Cluster;
11844    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
11845    /// let x = Cluster::new().set_or_clear_enable_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
11846    /// let x = Cluster::new().set_or_clear_enable_k8s_beta_apis(None::<K8sBetaAPIConfig>);
11847    /// ```
11848    pub fn set_or_clear_enable_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
11849    where
11850        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
11851    {
11852        self.enable_k8s_beta_apis = v.map(|x| x.into());
11853        self
11854    }
11855
11856    /// Sets the value of [enterprise_config][crate::model::Cluster::enterprise_config].
11857    ///
11858    /// # Example
11859    /// ```ignore,no_run
11860    /// # use google_cloud_container_v1::model::Cluster;
11861    /// use google_cloud_container_v1::model::EnterpriseConfig;
11862    /// let x = Cluster::new().set_enterprise_config(EnterpriseConfig::default()/* use setters */);
11863    /// ```
11864    #[deprecated]
11865    pub fn set_enterprise_config<T>(mut self, v: T) -> Self
11866    where
11867        T: std::convert::Into<crate::model::EnterpriseConfig>,
11868    {
11869        self.enterprise_config = std::option::Option::Some(v.into());
11870        self
11871    }
11872
11873    /// Sets or clears the value of [enterprise_config][crate::model::Cluster::enterprise_config].
11874    ///
11875    /// # Example
11876    /// ```ignore,no_run
11877    /// # use google_cloud_container_v1::model::Cluster;
11878    /// use google_cloud_container_v1::model::EnterpriseConfig;
11879    /// let x = Cluster::new().set_or_clear_enterprise_config(Some(EnterpriseConfig::default()/* use setters */));
11880    /// let x = Cluster::new().set_or_clear_enterprise_config(None::<EnterpriseConfig>);
11881    /// ```
11882    #[deprecated]
11883    pub fn set_or_clear_enterprise_config<T>(mut self, v: std::option::Option<T>) -> Self
11884    where
11885        T: std::convert::Into<crate::model::EnterpriseConfig>,
11886    {
11887        self.enterprise_config = v.map(|x| x.into());
11888        self
11889    }
11890
11891    /// Sets the value of [secret_manager_config][crate::model::Cluster::secret_manager_config].
11892    ///
11893    /// # Example
11894    /// ```ignore,no_run
11895    /// # use google_cloud_container_v1::model::Cluster;
11896    /// use google_cloud_container_v1::model::SecretManagerConfig;
11897    /// let x = Cluster::new().set_secret_manager_config(SecretManagerConfig::default()/* use setters */);
11898    /// ```
11899    pub fn set_secret_manager_config<T>(mut self, v: T) -> Self
11900    where
11901        T: std::convert::Into<crate::model::SecretManagerConfig>,
11902    {
11903        self.secret_manager_config = std::option::Option::Some(v.into());
11904        self
11905    }
11906
11907    /// Sets or clears the value of [secret_manager_config][crate::model::Cluster::secret_manager_config].
11908    ///
11909    /// # Example
11910    /// ```ignore,no_run
11911    /// # use google_cloud_container_v1::model::Cluster;
11912    /// use google_cloud_container_v1::model::SecretManagerConfig;
11913    /// let x = Cluster::new().set_or_clear_secret_manager_config(Some(SecretManagerConfig::default()/* use setters */));
11914    /// let x = Cluster::new().set_or_clear_secret_manager_config(None::<SecretManagerConfig>);
11915    /// ```
11916    pub fn set_or_clear_secret_manager_config<T>(mut self, v: std::option::Option<T>) -> Self
11917    where
11918        T: std::convert::Into<crate::model::SecretManagerConfig>,
11919    {
11920        self.secret_manager_config = v.map(|x| x.into());
11921        self
11922    }
11923
11924    /// Sets the value of [compliance_posture_config][crate::model::Cluster::compliance_posture_config].
11925    ///
11926    /// # Example
11927    /// ```ignore,no_run
11928    /// # use google_cloud_container_v1::model::Cluster;
11929    /// use google_cloud_container_v1::model::CompliancePostureConfig;
11930    /// let x = Cluster::new().set_compliance_posture_config(CompliancePostureConfig::default()/* use setters */);
11931    /// ```
11932    pub fn set_compliance_posture_config<T>(mut self, v: T) -> Self
11933    where
11934        T: std::convert::Into<crate::model::CompliancePostureConfig>,
11935    {
11936        self.compliance_posture_config = std::option::Option::Some(v.into());
11937        self
11938    }
11939
11940    /// Sets or clears the value of [compliance_posture_config][crate::model::Cluster::compliance_posture_config].
11941    ///
11942    /// # Example
11943    /// ```ignore,no_run
11944    /// # use google_cloud_container_v1::model::Cluster;
11945    /// use google_cloud_container_v1::model::CompliancePostureConfig;
11946    /// let x = Cluster::new().set_or_clear_compliance_posture_config(Some(CompliancePostureConfig::default()/* use setters */));
11947    /// let x = Cluster::new().set_or_clear_compliance_posture_config(None::<CompliancePostureConfig>);
11948    /// ```
11949    pub fn set_or_clear_compliance_posture_config<T>(mut self, v: std::option::Option<T>) -> Self
11950    where
11951        T: std::convert::Into<crate::model::CompliancePostureConfig>,
11952    {
11953        self.compliance_posture_config = v.map(|x| x.into());
11954        self
11955    }
11956
11957    /// Sets the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
11958    ///
11959    /// # Example
11960    /// ```ignore,no_run
11961    /// # use google_cloud_container_v1::model::Cluster;
11962    /// let x = Cluster::new().set_satisfies_pzs(true);
11963    /// ```
11964    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11965    where
11966        T: std::convert::Into<bool>,
11967    {
11968        self.satisfies_pzs = std::option::Option::Some(v.into());
11969        self
11970    }
11971
11972    /// Sets or clears the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
11973    ///
11974    /// # Example
11975    /// ```ignore,no_run
11976    /// # use google_cloud_container_v1::model::Cluster;
11977    /// let x = Cluster::new().set_or_clear_satisfies_pzs(Some(false));
11978    /// let x = Cluster::new().set_or_clear_satisfies_pzs(None::<bool>);
11979    /// ```
11980    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11981    where
11982        T: std::convert::Into<bool>,
11983    {
11984        self.satisfies_pzs = v.map(|x| x.into());
11985        self
11986    }
11987
11988    /// Sets the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
11989    ///
11990    /// # Example
11991    /// ```ignore,no_run
11992    /// # use google_cloud_container_v1::model::Cluster;
11993    /// let x = Cluster::new().set_satisfies_pzi(true);
11994    /// ```
11995    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
11996    where
11997        T: std::convert::Into<bool>,
11998    {
11999        self.satisfies_pzi = std::option::Option::Some(v.into());
12000        self
12001    }
12002
12003    /// Sets or clears the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
12004    ///
12005    /// # Example
12006    /// ```ignore,no_run
12007    /// # use google_cloud_container_v1::model::Cluster;
12008    /// let x = Cluster::new().set_or_clear_satisfies_pzi(Some(false));
12009    /// let x = Cluster::new().set_or_clear_satisfies_pzi(None::<bool>);
12010    /// ```
12011    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
12012    where
12013        T: std::convert::Into<bool>,
12014    {
12015        self.satisfies_pzi = v.map(|x| x.into());
12016        self
12017    }
12018
12019    /// Sets the value of [user_managed_keys_config][crate::model::Cluster::user_managed_keys_config].
12020    ///
12021    /// # Example
12022    /// ```ignore,no_run
12023    /// # use google_cloud_container_v1::model::Cluster;
12024    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
12025    /// let x = Cluster::new().set_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
12026    /// ```
12027    pub fn set_user_managed_keys_config<T>(mut self, v: T) -> Self
12028    where
12029        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
12030    {
12031        self.user_managed_keys_config = std::option::Option::Some(v.into());
12032        self
12033    }
12034
12035    /// Sets or clears the value of [user_managed_keys_config][crate::model::Cluster::user_managed_keys_config].
12036    ///
12037    /// # Example
12038    /// ```ignore,no_run
12039    /// # use google_cloud_container_v1::model::Cluster;
12040    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
12041    /// let x = Cluster::new().set_or_clear_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
12042    /// let x = Cluster::new().set_or_clear_user_managed_keys_config(None::<UserManagedKeysConfig>);
12043    /// ```
12044    pub fn set_or_clear_user_managed_keys_config<T>(mut self, v: std::option::Option<T>) -> Self
12045    where
12046        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
12047    {
12048        self.user_managed_keys_config = v.map(|x| x.into());
12049        self
12050    }
12051
12052    /// Sets the value of [rbac_binding_config][crate::model::Cluster::rbac_binding_config].
12053    ///
12054    /// # Example
12055    /// ```ignore,no_run
12056    /// # use google_cloud_container_v1::model::Cluster;
12057    /// use google_cloud_container_v1::model::RBACBindingConfig;
12058    /// let x = Cluster::new().set_rbac_binding_config(RBACBindingConfig::default()/* use setters */);
12059    /// ```
12060    pub fn set_rbac_binding_config<T>(mut self, v: T) -> Self
12061    where
12062        T: std::convert::Into<crate::model::RBACBindingConfig>,
12063    {
12064        self.rbac_binding_config = std::option::Option::Some(v.into());
12065        self
12066    }
12067
12068    /// Sets or clears the value of [rbac_binding_config][crate::model::Cluster::rbac_binding_config].
12069    ///
12070    /// # Example
12071    /// ```ignore,no_run
12072    /// # use google_cloud_container_v1::model::Cluster;
12073    /// use google_cloud_container_v1::model::RBACBindingConfig;
12074    /// let x = Cluster::new().set_or_clear_rbac_binding_config(Some(RBACBindingConfig::default()/* use setters */));
12075    /// let x = Cluster::new().set_or_clear_rbac_binding_config(None::<RBACBindingConfig>);
12076    /// ```
12077    pub fn set_or_clear_rbac_binding_config<T>(mut self, v: std::option::Option<T>) -> Self
12078    where
12079        T: std::convert::Into<crate::model::RBACBindingConfig>,
12080    {
12081        self.rbac_binding_config = v.map(|x| x.into());
12082        self
12083    }
12084
12085    /// Sets the value of [gke_auto_upgrade_config][crate::model::Cluster::gke_auto_upgrade_config].
12086    ///
12087    /// # Example
12088    /// ```ignore,no_run
12089    /// # use google_cloud_container_v1::model::Cluster;
12090    /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
12091    /// let x = Cluster::new().set_gke_auto_upgrade_config(GkeAutoUpgradeConfig::default()/* use setters */);
12092    /// ```
12093    pub fn set_gke_auto_upgrade_config<T>(mut self, v: T) -> Self
12094    where
12095        T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
12096    {
12097        self.gke_auto_upgrade_config = std::option::Option::Some(v.into());
12098        self
12099    }
12100
12101    /// Sets or clears the value of [gke_auto_upgrade_config][crate::model::Cluster::gke_auto_upgrade_config].
12102    ///
12103    /// # Example
12104    /// ```ignore,no_run
12105    /// # use google_cloud_container_v1::model::Cluster;
12106    /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
12107    /// let x = Cluster::new().set_or_clear_gke_auto_upgrade_config(Some(GkeAutoUpgradeConfig::default()/* use setters */));
12108    /// let x = Cluster::new().set_or_clear_gke_auto_upgrade_config(None::<GkeAutoUpgradeConfig>);
12109    /// ```
12110    pub fn set_or_clear_gke_auto_upgrade_config<T>(mut self, v: std::option::Option<T>) -> Self
12111    where
12112        T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
12113    {
12114        self.gke_auto_upgrade_config = v.map(|x| x.into());
12115        self
12116    }
12117
12118    /// Sets the value of [anonymous_authentication_config][crate::model::Cluster::anonymous_authentication_config].
12119    ///
12120    /// # Example
12121    /// ```ignore,no_run
12122    /// # use google_cloud_container_v1::model::Cluster;
12123    /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
12124    /// let x = Cluster::new().set_anonymous_authentication_config(AnonymousAuthenticationConfig::default()/* use setters */);
12125    /// ```
12126    pub fn set_anonymous_authentication_config<T>(mut self, v: T) -> Self
12127    where
12128        T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
12129    {
12130        self.anonymous_authentication_config = std::option::Option::Some(v.into());
12131        self
12132    }
12133
12134    /// Sets or clears the value of [anonymous_authentication_config][crate::model::Cluster::anonymous_authentication_config].
12135    ///
12136    /// # Example
12137    /// ```ignore,no_run
12138    /// # use google_cloud_container_v1::model::Cluster;
12139    /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
12140    /// let x = Cluster::new().set_or_clear_anonymous_authentication_config(Some(AnonymousAuthenticationConfig::default()/* use setters */));
12141    /// let x = Cluster::new().set_or_clear_anonymous_authentication_config(None::<AnonymousAuthenticationConfig>);
12142    /// ```
12143    pub fn set_or_clear_anonymous_authentication_config<T>(
12144        mut self,
12145        v: std::option::Option<T>,
12146    ) -> Self
12147    where
12148        T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
12149    {
12150        self.anonymous_authentication_config = v.map(|x| x.into());
12151        self
12152    }
12153}
12154
12155impl wkt::message::Message for Cluster {
12156    fn typename() -> &'static str {
12157        "type.googleapis.com/google.container.v1.Cluster"
12158    }
12159}
12160
12161/// Defines additional types related to [Cluster].
12162pub mod cluster {
12163    #[allow(unused_imports)]
12164    use super::*;
12165
12166    /// The current status of the cluster.
12167    ///
12168    /// # Working with unknown values
12169    ///
12170    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12171    /// additional enum variants at any time. Adding new variants is not considered
12172    /// a breaking change. Applications should write their code in anticipation of:
12173    ///
12174    /// - New values appearing in future releases of the client library, **and**
12175    /// - New values received dynamically, without application changes.
12176    ///
12177    /// Please consult the [Working with enums] section in the user guide for some
12178    /// guidelines.
12179    ///
12180    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12181    #[derive(Clone, Debug, PartialEq)]
12182    #[non_exhaustive]
12183    pub enum Status {
12184        /// Not set.
12185        Unspecified,
12186        /// The PROVISIONING state indicates the cluster is being created.
12187        Provisioning,
12188        /// The RUNNING state indicates the cluster has been created and is fully
12189        /// usable.
12190        Running,
12191        /// The RECONCILING state indicates that some work is actively being done on
12192        /// the cluster, such as upgrading the master or node software. Details can
12193        /// be found in the `statusMessage` field.
12194        Reconciling,
12195        /// The STOPPING state indicates the cluster is being deleted.
12196        Stopping,
12197        /// The ERROR state indicates the cluster is unusable. It will be
12198        /// automatically deleted. Details can be found in the `statusMessage` field.
12199        Error,
12200        /// The DEGRADED state indicates the cluster requires user action to restore
12201        /// full functionality. Details can be found in the `statusMessage` field.
12202        Degraded,
12203        /// If set, the enum was initialized with an unknown value.
12204        ///
12205        /// Applications can examine the value using [Status::value] or
12206        /// [Status::name].
12207        UnknownValue(status::UnknownValue),
12208    }
12209
12210    #[doc(hidden)]
12211    pub mod status {
12212        #[allow(unused_imports)]
12213        use super::*;
12214        #[derive(Clone, Debug, PartialEq)]
12215        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12216    }
12217
12218    impl Status {
12219        /// Gets the enum value.
12220        ///
12221        /// Returns `None` if the enum contains an unknown value deserialized from
12222        /// the string representation of enums.
12223        pub fn value(&self) -> std::option::Option<i32> {
12224            match self {
12225                Self::Unspecified => std::option::Option::Some(0),
12226                Self::Provisioning => std::option::Option::Some(1),
12227                Self::Running => std::option::Option::Some(2),
12228                Self::Reconciling => std::option::Option::Some(3),
12229                Self::Stopping => std::option::Option::Some(4),
12230                Self::Error => std::option::Option::Some(5),
12231                Self::Degraded => std::option::Option::Some(6),
12232                Self::UnknownValue(u) => u.0.value(),
12233            }
12234        }
12235
12236        /// Gets the enum value as a string.
12237        ///
12238        /// Returns `None` if the enum contains an unknown value deserialized from
12239        /// the integer representation of enums.
12240        pub fn name(&self) -> std::option::Option<&str> {
12241            match self {
12242                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
12243                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
12244                Self::Running => std::option::Option::Some("RUNNING"),
12245                Self::Reconciling => std::option::Option::Some("RECONCILING"),
12246                Self::Stopping => std::option::Option::Some("STOPPING"),
12247                Self::Error => std::option::Option::Some("ERROR"),
12248                Self::Degraded => std::option::Option::Some("DEGRADED"),
12249                Self::UnknownValue(u) => u.0.name(),
12250            }
12251        }
12252    }
12253
12254    impl std::default::Default for Status {
12255        fn default() -> Self {
12256            use std::convert::From;
12257            Self::from(0)
12258        }
12259    }
12260
12261    impl std::fmt::Display for Status {
12262        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12263            wkt::internal::display_enum(f, self.name(), self.value())
12264        }
12265    }
12266
12267    impl std::convert::From<i32> for Status {
12268        fn from(value: i32) -> Self {
12269            match value {
12270                0 => Self::Unspecified,
12271                1 => Self::Provisioning,
12272                2 => Self::Running,
12273                3 => Self::Reconciling,
12274                4 => Self::Stopping,
12275                5 => Self::Error,
12276                6 => Self::Degraded,
12277                _ => Self::UnknownValue(status::UnknownValue(
12278                    wkt::internal::UnknownEnumValue::Integer(value),
12279                )),
12280            }
12281        }
12282    }
12283
12284    impl std::convert::From<&str> for Status {
12285        fn from(value: &str) -> Self {
12286            use std::string::ToString;
12287            match value {
12288                "STATUS_UNSPECIFIED" => Self::Unspecified,
12289                "PROVISIONING" => Self::Provisioning,
12290                "RUNNING" => Self::Running,
12291                "RECONCILING" => Self::Reconciling,
12292                "STOPPING" => Self::Stopping,
12293                "ERROR" => Self::Error,
12294                "DEGRADED" => Self::Degraded,
12295                _ => Self::UnknownValue(status::UnknownValue(
12296                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12297                )),
12298            }
12299        }
12300    }
12301
12302    impl serde::ser::Serialize for Status {
12303        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12304        where
12305            S: serde::Serializer,
12306        {
12307            match self {
12308                Self::Unspecified => serializer.serialize_i32(0),
12309                Self::Provisioning => serializer.serialize_i32(1),
12310                Self::Running => serializer.serialize_i32(2),
12311                Self::Reconciling => serializer.serialize_i32(3),
12312                Self::Stopping => serializer.serialize_i32(4),
12313                Self::Error => serializer.serialize_i32(5),
12314                Self::Degraded => serializer.serialize_i32(6),
12315                Self::UnknownValue(u) => u.0.serialize(serializer),
12316            }
12317        }
12318    }
12319
12320    impl<'de> serde::de::Deserialize<'de> for Status {
12321        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12322        where
12323            D: serde::Deserializer<'de>,
12324        {
12325            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
12326                ".google.container.v1.Cluster.Status",
12327            ))
12328        }
12329    }
12330}
12331
12332/// RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings
12333/// that can be created.
12334#[derive(Clone, Default, PartialEq)]
12335#[non_exhaustive]
12336pub struct RBACBindingConfig {
12337    /// Setting this to true will allow any ClusterRoleBinding and RoleBinding
12338    /// with subjets system:anonymous or system:unauthenticated.
12339    pub enable_insecure_binding_system_unauthenticated: std::option::Option<bool>,
12340
12341    /// Setting this to true will allow any ClusterRoleBinding and RoleBinding
12342    /// with subjects system:authenticated.
12343    pub enable_insecure_binding_system_authenticated: std::option::Option<bool>,
12344
12345    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12346}
12347
12348impl RBACBindingConfig {
12349    pub fn new() -> Self {
12350        std::default::Default::default()
12351    }
12352
12353    /// Sets the value of [enable_insecure_binding_system_unauthenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_unauthenticated].
12354    ///
12355    /// # Example
12356    /// ```ignore,no_run
12357    /// # use google_cloud_container_v1::model::RBACBindingConfig;
12358    /// let x = RBACBindingConfig::new().set_enable_insecure_binding_system_unauthenticated(true);
12359    /// ```
12360    pub fn set_enable_insecure_binding_system_unauthenticated<T>(mut self, v: T) -> Self
12361    where
12362        T: std::convert::Into<bool>,
12363    {
12364        self.enable_insecure_binding_system_unauthenticated = std::option::Option::Some(v.into());
12365        self
12366    }
12367
12368    /// Sets or clears the value of [enable_insecure_binding_system_unauthenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_unauthenticated].
12369    ///
12370    /// # Example
12371    /// ```ignore,no_run
12372    /// # use google_cloud_container_v1::model::RBACBindingConfig;
12373    /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_unauthenticated(Some(false));
12374    /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_unauthenticated(None::<bool>);
12375    /// ```
12376    pub fn set_or_clear_enable_insecure_binding_system_unauthenticated<T>(
12377        mut self,
12378        v: std::option::Option<T>,
12379    ) -> Self
12380    where
12381        T: std::convert::Into<bool>,
12382    {
12383        self.enable_insecure_binding_system_unauthenticated = v.map(|x| x.into());
12384        self
12385    }
12386
12387    /// Sets the value of [enable_insecure_binding_system_authenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_authenticated].
12388    ///
12389    /// # Example
12390    /// ```ignore,no_run
12391    /// # use google_cloud_container_v1::model::RBACBindingConfig;
12392    /// let x = RBACBindingConfig::new().set_enable_insecure_binding_system_authenticated(true);
12393    /// ```
12394    pub fn set_enable_insecure_binding_system_authenticated<T>(mut self, v: T) -> Self
12395    where
12396        T: std::convert::Into<bool>,
12397    {
12398        self.enable_insecure_binding_system_authenticated = std::option::Option::Some(v.into());
12399        self
12400    }
12401
12402    /// Sets or clears the value of [enable_insecure_binding_system_authenticated][crate::model::RBACBindingConfig::enable_insecure_binding_system_authenticated].
12403    ///
12404    /// # Example
12405    /// ```ignore,no_run
12406    /// # use google_cloud_container_v1::model::RBACBindingConfig;
12407    /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_authenticated(Some(false));
12408    /// let x = RBACBindingConfig::new().set_or_clear_enable_insecure_binding_system_authenticated(None::<bool>);
12409    /// ```
12410    pub fn set_or_clear_enable_insecure_binding_system_authenticated<T>(
12411        mut self,
12412        v: std::option::Option<T>,
12413    ) -> Self
12414    where
12415        T: std::convert::Into<bool>,
12416    {
12417        self.enable_insecure_binding_system_authenticated = v.map(|x| x.into());
12418        self
12419    }
12420}
12421
12422impl wkt::message::Message for RBACBindingConfig {
12423    fn typename() -> &'static str {
12424        "type.googleapis.com/google.container.v1.RBACBindingConfig"
12425    }
12426}
12427
12428/// UserManagedKeysConfig holds the resource address to Keys which are used
12429/// for signing certs and token that are used for communication within cluster.
12430#[derive(Clone, Default, PartialEq)]
12431#[non_exhaustive]
12432pub struct UserManagedKeysConfig {
12433    /// The Certificate Authority Service caPool to use for the cluster CA in this
12434    /// cluster.
12435    pub cluster_ca: std::string::String,
12436
12437    /// Resource path of the Certificate Authority Service caPool to use for the
12438    /// etcd API CA in this cluster.
12439    pub etcd_api_ca: std::string::String,
12440
12441    /// Resource path of the Certificate Authority Service caPool to use for the
12442    /// etcd peer CA in this cluster.
12443    pub etcd_peer_ca: std::string::String,
12444
12445    /// The Cloud KMS cryptoKeyVersions to use for signing service account JWTs
12446    /// issued by this cluster.
12447    ///
12448    /// Format:
12449    /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}`
12450    pub service_account_signing_keys: std::vec::Vec<std::string::String>,
12451
12452    /// The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs
12453    /// issued by this cluster.
12454    ///
12455    /// Format:
12456    /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}`
12457    pub service_account_verification_keys: std::vec::Vec<std::string::String>,
12458
12459    /// The Certificate Authority Service caPool to use for the aggregation CA in
12460    /// this cluster.
12461    pub aggregation_ca: std::string::String,
12462
12463    /// The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control
12464    /// plane nodes.
12465    pub control_plane_disk_encryption_key: std::string::String,
12466
12467    /// Resource path of the Cloud KMS cryptoKey to use for encryption of internal
12468    /// etcd backups.
12469    pub gkeops_etcd_backup_encryption_key: std::string::String,
12470
12471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12472}
12473
12474impl UserManagedKeysConfig {
12475    pub fn new() -> Self {
12476        std::default::Default::default()
12477    }
12478
12479    /// Sets the value of [cluster_ca][crate::model::UserManagedKeysConfig::cluster_ca].
12480    ///
12481    /// # Example
12482    /// ```ignore,no_run
12483    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12484    /// let x = UserManagedKeysConfig::new().set_cluster_ca("example");
12485    /// ```
12486    pub fn set_cluster_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12487        self.cluster_ca = v.into();
12488        self
12489    }
12490
12491    /// Sets the value of [etcd_api_ca][crate::model::UserManagedKeysConfig::etcd_api_ca].
12492    ///
12493    /// # Example
12494    /// ```ignore,no_run
12495    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12496    /// let x = UserManagedKeysConfig::new().set_etcd_api_ca("example");
12497    /// ```
12498    pub fn set_etcd_api_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12499        self.etcd_api_ca = v.into();
12500        self
12501    }
12502
12503    /// Sets the value of [etcd_peer_ca][crate::model::UserManagedKeysConfig::etcd_peer_ca].
12504    ///
12505    /// # Example
12506    /// ```ignore,no_run
12507    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12508    /// let x = UserManagedKeysConfig::new().set_etcd_peer_ca("example");
12509    /// ```
12510    pub fn set_etcd_peer_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12511        self.etcd_peer_ca = v.into();
12512        self
12513    }
12514
12515    /// Sets the value of [service_account_signing_keys][crate::model::UserManagedKeysConfig::service_account_signing_keys].
12516    ///
12517    /// # Example
12518    /// ```ignore,no_run
12519    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12520    /// let x = UserManagedKeysConfig::new().set_service_account_signing_keys(["a", "b", "c"]);
12521    /// ```
12522    pub fn set_service_account_signing_keys<T, V>(mut self, v: T) -> Self
12523    where
12524        T: std::iter::IntoIterator<Item = V>,
12525        V: std::convert::Into<std::string::String>,
12526    {
12527        use std::iter::Iterator;
12528        self.service_account_signing_keys = v.into_iter().map(|i| i.into()).collect();
12529        self
12530    }
12531
12532    /// Sets the value of [service_account_verification_keys][crate::model::UserManagedKeysConfig::service_account_verification_keys].
12533    ///
12534    /// # Example
12535    /// ```ignore,no_run
12536    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12537    /// let x = UserManagedKeysConfig::new().set_service_account_verification_keys(["a", "b", "c"]);
12538    /// ```
12539    pub fn set_service_account_verification_keys<T, V>(mut self, v: T) -> Self
12540    where
12541        T: std::iter::IntoIterator<Item = V>,
12542        V: std::convert::Into<std::string::String>,
12543    {
12544        use std::iter::Iterator;
12545        self.service_account_verification_keys = v.into_iter().map(|i| i.into()).collect();
12546        self
12547    }
12548
12549    /// Sets the value of [aggregation_ca][crate::model::UserManagedKeysConfig::aggregation_ca].
12550    ///
12551    /// # Example
12552    /// ```ignore,no_run
12553    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12554    /// let x = UserManagedKeysConfig::new().set_aggregation_ca("example");
12555    /// ```
12556    pub fn set_aggregation_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12557        self.aggregation_ca = v.into();
12558        self
12559    }
12560
12561    /// Sets the value of [control_plane_disk_encryption_key][crate::model::UserManagedKeysConfig::control_plane_disk_encryption_key].
12562    ///
12563    /// # Example
12564    /// ```ignore,no_run
12565    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12566    /// let x = UserManagedKeysConfig::new().set_control_plane_disk_encryption_key("example");
12567    /// ```
12568    pub fn set_control_plane_disk_encryption_key<T: std::convert::Into<std::string::String>>(
12569        mut self,
12570        v: T,
12571    ) -> Self {
12572        self.control_plane_disk_encryption_key = v.into();
12573        self
12574    }
12575
12576    /// Sets the value of [gkeops_etcd_backup_encryption_key][crate::model::UserManagedKeysConfig::gkeops_etcd_backup_encryption_key].
12577    ///
12578    /// # Example
12579    /// ```ignore,no_run
12580    /// # use google_cloud_container_v1::model::UserManagedKeysConfig;
12581    /// let x = UserManagedKeysConfig::new().set_gkeops_etcd_backup_encryption_key("example");
12582    /// ```
12583    pub fn set_gkeops_etcd_backup_encryption_key<T: std::convert::Into<std::string::String>>(
12584        mut self,
12585        v: T,
12586    ) -> Self {
12587        self.gkeops_etcd_backup_encryption_key = v.into();
12588        self
12589    }
12590}
12591
12592impl wkt::message::Message for UserManagedKeysConfig {
12593    fn typename() -> &'static str {
12594        "type.googleapis.com/google.container.v1.UserManagedKeysConfig"
12595    }
12596}
12597
12598/// AnonymousAuthenticationConfig defines the settings needed to limit endpoints
12599/// that allow anonymous authentication.
12600#[derive(Clone, Default, PartialEq)]
12601#[non_exhaustive]
12602pub struct AnonymousAuthenticationConfig {
12603    /// Defines the mode of limiting anonymous access in the cluster.
12604    pub mode: crate::model::anonymous_authentication_config::Mode,
12605
12606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12607}
12608
12609impl AnonymousAuthenticationConfig {
12610    pub fn new() -> Self {
12611        std::default::Default::default()
12612    }
12613
12614    /// Sets the value of [mode][crate::model::AnonymousAuthenticationConfig::mode].
12615    ///
12616    /// # Example
12617    /// ```ignore,no_run
12618    /// # use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
12619    /// use google_cloud_container_v1::model::anonymous_authentication_config::Mode;
12620    /// let x0 = AnonymousAuthenticationConfig::new().set_mode(Mode::Enabled);
12621    /// let x1 = AnonymousAuthenticationConfig::new().set_mode(Mode::Limited);
12622    /// ```
12623    pub fn set_mode<T: std::convert::Into<crate::model::anonymous_authentication_config::Mode>>(
12624        mut self,
12625        v: T,
12626    ) -> Self {
12627        self.mode = v.into();
12628        self
12629    }
12630}
12631
12632impl wkt::message::Message for AnonymousAuthenticationConfig {
12633    fn typename() -> &'static str {
12634        "type.googleapis.com/google.container.v1.AnonymousAuthenticationConfig"
12635    }
12636}
12637
12638/// Defines additional types related to [AnonymousAuthenticationConfig].
12639pub mod anonymous_authentication_config {
12640    #[allow(unused_imports)]
12641    use super::*;
12642
12643    /// Mode defines the mode of anonymous authentication
12644    /// allowed in the cluster.
12645    ///
12646    /// # Working with unknown values
12647    ///
12648    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12649    /// additional enum variants at any time. Adding new variants is not considered
12650    /// a breaking change. Applications should write their code in anticipation of:
12651    ///
12652    /// - New values appearing in future releases of the client library, **and**
12653    /// - New values received dynamically, without application changes.
12654    ///
12655    /// Please consult the [Working with enums] section in the user guide for some
12656    /// guidelines.
12657    ///
12658    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12659    #[derive(Clone, Debug, PartialEq)]
12660    #[non_exhaustive]
12661    pub enum Mode {
12662        /// Default value not specified.
12663        Unspecified,
12664        /// Anonymous authentication is allowed for all endpoints.
12665        Enabled,
12666        /// Anonymous authentication is allowed for only health check endpoints.
12667        Limited,
12668        /// If set, the enum was initialized with an unknown value.
12669        ///
12670        /// Applications can examine the value using [Mode::value] or
12671        /// [Mode::name].
12672        UnknownValue(mode::UnknownValue),
12673    }
12674
12675    #[doc(hidden)]
12676    pub mod mode {
12677        #[allow(unused_imports)]
12678        use super::*;
12679        #[derive(Clone, Debug, PartialEq)]
12680        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12681    }
12682
12683    impl Mode {
12684        /// Gets the enum value.
12685        ///
12686        /// Returns `None` if the enum contains an unknown value deserialized from
12687        /// the string representation of enums.
12688        pub fn value(&self) -> std::option::Option<i32> {
12689            match self {
12690                Self::Unspecified => std::option::Option::Some(0),
12691                Self::Enabled => std::option::Option::Some(1),
12692                Self::Limited => std::option::Option::Some(2),
12693                Self::UnknownValue(u) => u.0.value(),
12694            }
12695        }
12696
12697        /// Gets the enum value as a string.
12698        ///
12699        /// Returns `None` if the enum contains an unknown value deserialized from
12700        /// the integer representation of enums.
12701        pub fn name(&self) -> std::option::Option<&str> {
12702            match self {
12703                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
12704                Self::Enabled => std::option::Option::Some("ENABLED"),
12705                Self::Limited => std::option::Option::Some("LIMITED"),
12706                Self::UnknownValue(u) => u.0.name(),
12707            }
12708        }
12709    }
12710
12711    impl std::default::Default for Mode {
12712        fn default() -> Self {
12713            use std::convert::From;
12714            Self::from(0)
12715        }
12716    }
12717
12718    impl std::fmt::Display for Mode {
12719        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12720            wkt::internal::display_enum(f, self.name(), self.value())
12721        }
12722    }
12723
12724    impl std::convert::From<i32> for Mode {
12725        fn from(value: i32) -> Self {
12726            match value {
12727                0 => Self::Unspecified,
12728                1 => Self::Enabled,
12729                2 => Self::Limited,
12730                _ => Self::UnknownValue(mode::UnknownValue(
12731                    wkt::internal::UnknownEnumValue::Integer(value),
12732                )),
12733            }
12734        }
12735    }
12736
12737    impl std::convert::From<&str> for Mode {
12738        fn from(value: &str) -> Self {
12739            use std::string::ToString;
12740            match value {
12741                "MODE_UNSPECIFIED" => Self::Unspecified,
12742                "ENABLED" => Self::Enabled,
12743                "LIMITED" => Self::Limited,
12744                _ => Self::UnknownValue(mode::UnknownValue(
12745                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12746                )),
12747            }
12748        }
12749    }
12750
12751    impl serde::ser::Serialize for Mode {
12752        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12753        where
12754            S: serde::Serializer,
12755        {
12756            match self {
12757                Self::Unspecified => serializer.serialize_i32(0),
12758                Self::Enabled => serializer.serialize_i32(1),
12759                Self::Limited => serializer.serialize_i32(2),
12760                Self::UnknownValue(u) => u.0.serialize(serializer),
12761            }
12762        }
12763    }
12764
12765    impl<'de> serde::de::Deserialize<'de> for Mode {
12766        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12767        where
12768            D: serde::Deserializer<'de>,
12769        {
12770            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
12771                ".google.container.v1.AnonymousAuthenticationConfig.Mode",
12772            ))
12773        }
12774    }
12775}
12776
12777/// CompliancePostureConfig defines the settings needed to enable/disable
12778/// features for the Compliance Posture.
12779#[derive(Clone, Default, PartialEq)]
12780#[non_exhaustive]
12781pub struct CompliancePostureConfig {
12782    /// Defines the enablement mode for Compliance Posture.
12783    pub mode: std::option::Option<crate::model::compliance_posture_config::Mode>,
12784
12785    /// List of enabled compliance standards.
12786    pub compliance_standards:
12787        std::vec::Vec<crate::model::compliance_posture_config::ComplianceStandard>,
12788
12789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12790}
12791
12792impl CompliancePostureConfig {
12793    pub fn new() -> Self {
12794        std::default::Default::default()
12795    }
12796
12797    /// Sets the value of [mode][crate::model::CompliancePostureConfig::mode].
12798    ///
12799    /// # Example
12800    /// ```ignore,no_run
12801    /// # use google_cloud_container_v1::model::CompliancePostureConfig;
12802    /// use google_cloud_container_v1::model::compliance_posture_config::Mode;
12803    /// let x0 = CompliancePostureConfig::new().set_mode(Mode::Disabled);
12804    /// let x1 = CompliancePostureConfig::new().set_mode(Mode::Enabled);
12805    /// ```
12806    pub fn set_mode<T>(mut self, v: T) -> Self
12807    where
12808        T: std::convert::Into<crate::model::compliance_posture_config::Mode>,
12809    {
12810        self.mode = std::option::Option::Some(v.into());
12811        self
12812    }
12813
12814    /// Sets or clears the value of [mode][crate::model::CompliancePostureConfig::mode].
12815    ///
12816    /// # Example
12817    /// ```ignore,no_run
12818    /// # use google_cloud_container_v1::model::CompliancePostureConfig;
12819    /// use google_cloud_container_v1::model::compliance_posture_config::Mode;
12820    /// let x0 = CompliancePostureConfig::new().set_or_clear_mode(Some(Mode::Disabled));
12821    /// let x1 = CompliancePostureConfig::new().set_or_clear_mode(Some(Mode::Enabled));
12822    /// let x_none = CompliancePostureConfig::new().set_or_clear_mode(None::<Mode>);
12823    /// ```
12824    pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
12825    where
12826        T: std::convert::Into<crate::model::compliance_posture_config::Mode>,
12827    {
12828        self.mode = v.map(|x| x.into());
12829        self
12830    }
12831
12832    /// Sets the value of [compliance_standards][crate::model::CompliancePostureConfig::compliance_standards].
12833    ///
12834    /// # Example
12835    /// ```ignore,no_run
12836    /// # use google_cloud_container_v1::model::CompliancePostureConfig;
12837    /// use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
12838    /// let x = CompliancePostureConfig::new()
12839    ///     .set_compliance_standards([
12840    ///         ComplianceStandard::default()/* use setters */,
12841    ///         ComplianceStandard::default()/* use (different) setters */,
12842    ///     ]);
12843    /// ```
12844    pub fn set_compliance_standards<T, V>(mut self, v: T) -> Self
12845    where
12846        T: std::iter::IntoIterator<Item = V>,
12847        V: std::convert::Into<crate::model::compliance_posture_config::ComplianceStandard>,
12848    {
12849        use std::iter::Iterator;
12850        self.compliance_standards = v.into_iter().map(|i| i.into()).collect();
12851        self
12852    }
12853}
12854
12855impl wkt::message::Message for CompliancePostureConfig {
12856    fn typename() -> &'static str {
12857        "type.googleapis.com/google.container.v1.CompliancePostureConfig"
12858    }
12859}
12860
12861/// Defines additional types related to [CompliancePostureConfig].
12862pub mod compliance_posture_config {
12863    #[allow(unused_imports)]
12864    use super::*;
12865
12866    /// Defines the details of a compliance standard.
12867    #[derive(Clone, Default, PartialEq)]
12868    #[non_exhaustive]
12869    pub struct ComplianceStandard {
12870        /// Name of the compliance standard.
12871        pub standard: std::option::Option<std::string::String>,
12872
12873        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12874    }
12875
12876    impl ComplianceStandard {
12877        pub fn new() -> Self {
12878            std::default::Default::default()
12879        }
12880
12881        /// Sets the value of [standard][crate::model::compliance_posture_config::ComplianceStandard::standard].
12882        ///
12883        /// # Example
12884        /// ```ignore,no_run
12885        /// # use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
12886        /// let x = ComplianceStandard::new().set_standard("example");
12887        /// ```
12888        pub fn set_standard<T>(mut self, v: T) -> Self
12889        where
12890            T: std::convert::Into<std::string::String>,
12891        {
12892            self.standard = std::option::Option::Some(v.into());
12893            self
12894        }
12895
12896        /// Sets or clears the value of [standard][crate::model::compliance_posture_config::ComplianceStandard::standard].
12897        ///
12898        /// # Example
12899        /// ```ignore,no_run
12900        /// # use google_cloud_container_v1::model::compliance_posture_config::ComplianceStandard;
12901        /// let x = ComplianceStandard::new().set_or_clear_standard(Some("example"));
12902        /// let x = ComplianceStandard::new().set_or_clear_standard(None::<String>);
12903        /// ```
12904        pub fn set_or_clear_standard<T>(mut self, v: std::option::Option<T>) -> Self
12905        where
12906            T: std::convert::Into<std::string::String>,
12907        {
12908            self.standard = v.map(|x| x.into());
12909            self
12910        }
12911    }
12912
12913    impl wkt::message::Message for ComplianceStandard {
12914        fn typename() -> &'static str {
12915            "type.googleapis.com/google.container.v1.CompliancePostureConfig.ComplianceStandard"
12916        }
12917    }
12918
12919    /// Mode defines enablement mode for Compliance Posture.
12920    ///
12921    /// # Working with unknown values
12922    ///
12923    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12924    /// additional enum variants at any time. Adding new variants is not considered
12925    /// a breaking change. Applications should write their code in anticipation of:
12926    ///
12927    /// - New values appearing in future releases of the client library, **and**
12928    /// - New values received dynamically, without application changes.
12929    ///
12930    /// Please consult the [Working with enums] section in the user guide for some
12931    /// guidelines.
12932    ///
12933    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12934    #[derive(Clone, Debug, PartialEq)]
12935    #[non_exhaustive]
12936    pub enum Mode {
12937        /// Default value not specified.
12938        Unspecified,
12939        /// Disables Compliance Posture features on the cluster.
12940        Disabled,
12941        /// Enables Compliance Posture features on the cluster.
12942        Enabled,
12943        /// If set, the enum was initialized with an unknown value.
12944        ///
12945        /// Applications can examine the value using [Mode::value] or
12946        /// [Mode::name].
12947        UnknownValue(mode::UnknownValue),
12948    }
12949
12950    #[doc(hidden)]
12951    pub mod mode {
12952        #[allow(unused_imports)]
12953        use super::*;
12954        #[derive(Clone, Debug, PartialEq)]
12955        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12956    }
12957
12958    impl Mode {
12959        /// Gets the enum value.
12960        ///
12961        /// Returns `None` if the enum contains an unknown value deserialized from
12962        /// the string representation of enums.
12963        pub fn value(&self) -> std::option::Option<i32> {
12964            match self {
12965                Self::Unspecified => std::option::Option::Some(0),
12966                Self::Disabled => std::option::Option::Some(1),
12967                Self::Enabled => std::option::Option::Some(2),
12968                Self::UnknownValue(u) => u.0.value(),
12969            }
12970        }
12971
12972        /// Gets the enum value as a string.
12973        ///
12974        /// Returns `None` if the enum contains an unknown value deserialized from
12975        /// the integer representation of enums.
12976        pub fn name(&self) -> std::option::Option<&str> {
12977            match self {
12978                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
12979                Self::Disabled => std::option::Option::Some("DISABLED"),
12980                Self::Enabled => std::option::Option::Some("ENABLED"),
12981                Self::UnknownValue(u) => u.0.name(),
12982            }
12983        }
12984    }
12985
12986    impl std::default::Default for Mode {
12987        fn default() -> Self {
12988            use std::convert::From;
12989            Self::from(0)
12990        }
12991    }
12992
12993    impl std::fmt::Display for Mode {
12994        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12995            wkt::internal::display_enum(f, self.name(), self.value())
12996        }
12997    }
12998
12999    impl std::convert::From<i32> for Mode {
13000        fn from(value: i32) -> Self {
13001            match value {
13002                0 => Self::Unspecified,
13003                1 => Self::Disabled,
13004                2 => Self::Enabled,
13005                _ => Self::UnknownValue(mode::UnknownValue(
13006                    wkt::internal::UnknownEnumValue::Integer(value),
13007                )),
13008            }
13009        }
13010    }
13011
13012    impl std::convert::From<&str> for Mode {
13013        fn from(value: &str) -> Self {
13014            use std::string::ToString;
13015            match value {
13016                "MODE_UNSPECIFIED" => Self::Unspecified,
13017                "DISABLED" => Self::Disabled,
13018                "ENABLED" => Self::Enabled,
13019                _ => Self::UnknownValue(mode::UnknownValue(
13020                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13021                )),
13022            }
13023        }
13024    }
13025
13026    impl serde::ser::Serialize for Mode {
13027        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13028        where
13029            S: serde::Serializer,
13030        {
13031            match self {
13032                Self::Unspecified => serializer.serialize_i32(0),
13033                Self::Disabled => serializer.serialize_i32(1),
13034                Self::Enabled => serializer.serialize_i32(2),
13035                Self::UnknownValue(u) => u.0.serialize(serializer),
13036            }
13037        }
13038    }
13039
13040    impl<'de> serde::de::Deserialize<'de> for Mode {
13041        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13042        where
13043            D: serde::Deserializer<'de>,
13044        {
13045            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
13046                ".google.container.v1.CompliancePostureConfig.Mode",
13047            ))
13048        }
13049    }
13050}
13051
13052/// K8sBetaAPIConfig , configuration for beta APIs
13053#[derive(Clone, Default, PartialEq)]
13054#[non_exhaustive]
13055pub struct K8sBetaAPIConfig {
13056    /// Enabled k8s beta APIs.
13057    pub enabled_apis: std::vec::Vec<std::string::String>,
13058
13059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13060}
13061
13062impl K8sBetaAPIConfig {
13063    pub fn new() -> Self {
13064        std::default::Default::default()
13065    }
13066
13067    /// Sets the value of [enabled_apis][crate::model::K8sBetaAPIConfig::enabled_apis].
13068    ///
13069    /// # Example
13070    /// ```ignore,no_run
13071    /// # use google_cloud_container_v1::model::K8sBetaAPIConfig;
13072    /// let x = K8sBetaAPIConfig::new().set_enabled_apis(["a", "b", "c"]);
13073    /// ```
13074    pub fn set_enabled_apis<T, V>(mut self, v: T) -> Self
13075    where
13076        T: std::iter::IntoIterator<Item = V>,
13077        V: std::convert::Into<std::string::String>,
13078    {
13079        use std::iter::Iterator;
13080        self.enabled_apis = v.into_iter().map(|i| i.into()).collect();
13081        self
13082    }
13083}
13084
13085impl wkt::message::Message for K8sBetaAPIConfig {
13086    fn typename() -> &'static str {
13087        "type.googleapis.com/google.container.v1.K8sBetaAPIConfig"
13088    }
13089}
13090
13091/// SecurityPostureConfig defines the flags needed to enable/disable features for
13092/// the Security Posture API.
13093#[derive(Clone, Default, PartialEq)]
13094#[non_exhaustive]
13095pub struct SecurityPostureConfig {
13096    /// Sets which mode to use for Security Posture features.
13097    pub mode: std::option::Option<crate::model::security_posture_config::Mode>,
13098
13099    /// Sets which mode to use for vulnerability scanning.
13100    pub vulnerability_mode:
13101        std::option::Option<crate::model::security_posture_config::VulnerabilityMode>,
13102
13103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13104}
13105
13106impl SecurityPostureConfig {
13107    pub fn new() -> Self {
13108        std::default::Default::default()
13109    }
13110
13111    /// Sets the value of [mode][crate::model::SecurityPostureConfig::mode].
13112    ///
13113    /// # Example
13114    /// ```ignore,no_run
13115    /// # use google_cloud_container_v1::model::SecurityPostureConfig;
13116    /// use google_cloud_container_v1::model::security_posture_config::Mode;
13117    /// let x0 = SecurityPostureConfig::new().set_mode(Mode::Disabled);
13118    /// let x1 = SecurityPostureConfig::new().set_mode(Mode::Basic);
13119    /// let x2 = SecurityPostureConfig::new().set_mode(Mode::Enterprise);
13120    /// ```
13121    pub fn set_mode<T>(mut self, v: T) -> Self
13122    where
13123        T: std::convert::Into<crate::model::security_posture_config::Mode>,
13124    {
13125        self.mode = std::option::Option::Some(v.into());
13126        self
13127    }
13128
13129    /// Sets or clears the value of [mode][crate::model::SecurityPostureConfig::mode].
13130    ///
13131    /// # Example
13132    /// ```ignore,no_run
13133    /// # use google_cloud_container_v1::model::SecurityPostureConfig;
13134    /// use google_cloud_container_v1::model::security_posture_config::Mode;
13135    /// let x0 = SecurityPostureConfig::new().set_or_clear_mode(Some(Mode::Disabled));
13136    /// let x1 = SecurityPostureConfig::new().set_or_clear_mode(Some(Mode::Basic));
13137    /// let x2 = SecurityPostureConfig::new().set_or_clear_mode(Some(Mode::Enterprise));
13138    /// let x_none = SecurityPostureConfig::new().set_or_clear_mode(None::<Mode>);
13139    /// ```
13140    pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
13141    where
13142        T: std::convert::Into<crate::model::security_posture_config::Mode>,
13143    {
13144        self.mode = v.map(|x| x.into());
13145        self
13146    }
13147
13148    /// Sets the value of [vulnerability_mode][crate::model::SecurityPostureConfig::vulnerability_mode].
13149    ///
13150    /// # Example
13151    /// ```ignore,no_run
13152    /// # use google_cloud_container_v1::model::SecurityPostureConfig;
13153    /// use google_cloud_container_v1::model::security_posture_config::VulnerabilityMode;
13154    /// let x0 = SecurityPostureConfig::new().set_vulnerability_mode(VulnerabilityMode::VulnerabilityDisabled);
13155    /// let x1 = SecurityPostureConfig::new().set_vulnerability_mode(VulnerabilityMode::VulnerabilityBasic);
13156    /// let x2 = SecurityPostureConfig::new().set_vulnerability_mode(VulnerabilityMode::VulnerabilityEnterprise);
13157    /// ```
13158    pub fn set_vulnerability_mode<T>(mut self, v: T) -> Self
13159    where
13160        T: std::convert::Into<crate::model::security_posture_config::VulnerabilityMode>,
13161    {
13162        self.vulnerability_mode = std::option::Option::Some(v.into());
13163        self
13164    }
13165
13166    /// Sets or clears the value of [vulnerability_mode][crate::model::SecurityPostureConfig::vulnerability_mode].
13167    ///
13168    /// # Example
13169    /// ```ignore,no_run
13170    /// # use google_cloud_container_v1::model::SecurityPostureConfig;
13171    /// use google_cloud_container_v1::model::security_posture_config::VulnerabilityMode;
13172    /// let x0 = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(Some(VulnerabilityMode::VulnerabilityDisabled));
13173    /// let x1 = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(Some(VulnerabilityMode::VulnerabilityBasic));
13174    /// let x2 = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(Some(VulnerabilityMode::VulnerabilityEnterprise));
13175    /// let x_none = SecurityPostureConfig::new().set_or_clear_vulnerability_mode(None::<VulnerabilityMode>);
13176    /// ```
13177    pub fn set_or_clear_vulnerability_mode<T>(mut self, v: std::option::Option<T>) -> Self
13178    where
13179        T: std::convert::Into<crate::model::security_posture_config::VulnerabilityMode>,
13180    {
13181        self.vulnerability_mode = v.map(|x| x.into());
13182        self
13183    }
13184}
13185
13186impl wkt::message::Message for SecurityPostureConfig {
13187    fn typename() -> &'static str {
13188        "type.googleapis.com/google.container.v1.SecurityPostureConfig"
13189    }
13190}
13191
13192/// Defines additional types related to [SecurityPostureConfig].
13193pub mod security_posture_config {
13194    #[allow(unused_imports)]
13195    use super::*;
13196
13197    /// Mode defines enablement mode for GKE Security posture features.
13198    ///
13199    /// # Working with unknown values
13200    ///
13201    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13202    /// additional enum variants at any time. Adding new variants is not considered
13203    /// a breaking change. Applications should write their code in anticipation of:
13204    ///
13205    /// - New values appearing in future releases of the client library, **and**
13206    /// - New values received dynamically, without application changes.
13207    ///
13208    /// Please consult the [Working with enums] section in the user guide for some
13209    /// guidelines.
13210    ///
13211    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13212    #[derive(Clone, Debug, PartialEq)]
13213    #[non_exhaustive]
13214    pub enum Mode {
13215        /// Default value not specified.
13216        Unspecified,
13217        /// Disables Security Posture features on the cluster.
13218        Disabled,
13219        /// Applies Security Posture features on the cluster.
13220        Basic,
13221        /// Applies the Security Posture off cluster Enterprise level features.
13222        Enterprise,
13223        /// If set, the enum was initialized with an unknown value.
13224        ///
13225        /// Applications can examine the value using [Mode::value] or
13226        /// [Mode::name].
13227        UnknownValue(mode::UnknownValue),
13228    }
13229
13230    #[doc(hidden)]
13231    pub mod mode {
13232        #[allow(unused_imports)]
13233        use super::*;
13234        #[derive(Clone, Debug, PartialEq)]
13235        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13236    }
13237
13238    impl Mode {
13239        /// Gets the enum value.
13240        ///
13241        /// Returns `None` if the enum contains an unknown value deserialized from
13242        /// the string representation of enums.
13243        pub fn value(&self) -> std::option::Option<i32> {
13244            match self {
13245                Self::Unspecified => std::option::Option::Some(0),
13246                Self::Disabled => std::option::Option::Some(1),
13247                Self::Basic => std::option::Option::Some(2),
13248                Self::Enterprise => std::option::Option::Some(3),
13249                Self::UnknownValue(u) => u.0.value(),
13250            }
13251        }
13252
13253        /// Gets the enum value as a string.
13254        ///
13255        /// Returns `None` if the enum contains an unknown value deserialized from
13256        /// the integer representation of enums.
13257        pub fn name(&self) -> std::option::Option<&str> {
13258            match self {
13259                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
13260                Self::Disabled => std::option::Option::Some("DISABLED"),
13261                Self::Basic => std::option::Option::Some("BASIC"),
13262                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
13263                Self::UnknownValue(u) => u.0.name(),
13264            }
13265        }
13266    }
13267
13268    impl std::default::Default for Mode {
13269        fn default() -> Self {
13270            use std::convert::From;
13271            Self::from(0)
13272        }
13273    }
13274
13275    impl std::fmt::Display for Mode {
13276        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13277            wkt::internal::display_enum(f, self.name(), self.value())
13278        }
13279    }
13280
13281    impl std::convert::From<i32> for Mode {
13282        fn from(value: i32) -> Self {
13283            match value {
13284                0 => Self::Unspecified,
13285                1 => Self::Disabled,
13286                2 => Self::Basic,
13287                3 => Self::Enterprise,
13288                _ => Self::UnknownValue(mode::UnknownValue(
13289                    wkt::internal::UnknownEnumValue::Integer(value),
13290                )),
13291            }
13292        }
13293    }
13294
13295    impl std::convert::From<&str> for Mode {
13296        fn from(value: &str) -> Self {
13297            use std::string::ToString;
13298            match value {
13299                "MODE_UNSPECIFIED" => Self::Unspecified,
13300                "DISABLED" => Self::Disabled,
13301                "BASIC" => Self::Basic,
13302                "ENTERPRISE" => Self::Enterprise,
13303                _ => Self::UnknownValue(mode::UnknownValue(
13304                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13305                )),
13306            }
13307        }
13308    }
13309
13310    impl serde::ser::Serialize for Mode {
13311        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13312        where
13313            S: serde::Serializer,
13314        {
13315            match self {
13316                Self::Unspecified => serializer.serialize_i32(0),
13317                Self::Disabled => serializer.serialize_i32(1),
13318                Self::Basic => serializer.serialize_i32(2),
13319                Self::Enterprise => serializer.serialize_i32(3),
13320                Self::UnknownValue(u) => u.0.serialize(serializer),
13321            }
13322        }
13323    }
13324
13325    impl<'de> serde::de::Deserialize<'de> for Mode {
13326        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13327        where
13328            D: serde::Deserializer<'de>,
13329        {
13330            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
13331                ".google.container.v1.SecurityPostureConfig.Mode",
13332            ))
13333        }
13334    }
13335
13336    /// VulnerabilityMode defines enablement mode for vulnerability scanning.
13337    ///
13338    /// # Working with unknown values
13339    ///
13340    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13341    /// additional enum variants at any time. Adding new variants is not considered
13342    /// a breaking change. Applications should write their code in anticipation of:
13343    ///
13344    /// - New values appearing in future releases of the client library, **and**
13345    /// - New values received dynamically, without application changes.
13346    ///
13347    /// Please consult the [Working with enums] section in the user guide for some
13348    /// guidelines.
13349    ///
13350    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13351    #[derive(Clone, Debug, PartialEq)]
13352    #[non_exhaustive]
13353    pub enum VulnerabilityMode {
13354        /// Default value not specified.
13355        Unspecified,
13356        /// Disables vulnerability scanning on the cluster.
13357        VulnerabilityDisabled,
13358        /// Applies basic vulnerability scanning on the cluster.
13359        VulnerabilityBasic,
13360        /// Applies the Security Posture's vulnerability on cluster Enterprise level
13361        /// features.
13362        VulnerabilityEnterprise,
13363        /// If set, the enum was initialized with an unknown value.
13364        ///
13365        /// Applications can examine the value using [VulnerabilityMode::value] or
13366        /// [VulnerabilityMode::name].
13367        UnknownValue(vulnerability_mode::UnknownValue),
13368    }
13369
13370    #[doc(hidden)]
13371    pub mod vulnerability_mode {
13372        #[allow(unused_imports)]
13373        use super::*;
13374        #[derive(Clone, Debug, PartialEq)]
13375        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13376    }
13377
13378    impl VulnerabilityMode {
13379        /// Gets the enum value.
13380        ///
13381        /// Returns `None` if the enum contains an unknown value deserialized from
13382        /// the string representation of enums.
13383        pub fn value(&self) -> std::option::Option<i32> {
13384            match self {
13385                Self::Unspecified => std::option::Option::Some(0),
13386                Self::VulnerabilityDisabled => std::option::Option::Some(1),
13387                Self::VulnerabilityBasic => std::option::Option::Some(2),
13388                Self::VulnerabilityEnterprise => std::option::Option::Some(3),
13389                Self::UnknownValue(u) => u.0.value(),
13390            }
13391        }
13392
13393        /// Gets the enum value as a string.
13394        ///
13395        /// Returns `None` if the enum contains an unknown value deserialized from
13396        /// the integer representation of enums.
13397        pub fn name(&self) -> std::option::Option<&str> {
13398            match self {
13399                Self::Unspecified => std::option::Option::Some("VULNERABILITY_MODE_UNSPECIFIED"),
13400                Self::VulnerabilityDisabled => std::option::Option::Some("VULNERABILITY_DISABLED"),
13401                Self::VulnerabilityBasic => std::option::Option::Some("VULNERABILITY_BASIC"),
13402                Self::VulnerabilityEnterprise => {
13403                    std::option::Option::Some("VULNERABILITY_ENTERPRISE")
13404                }
13405                Self::UnknownValue(u) => u.0.name(),
13406            }
13407        }
13408    }
13409
13410    impl std::default::Default for VulnerabilityMode {
13411        fn default() -> Self {
13412            use std::convert::From;
13413            Self::from(0)
13414        }
13415    }
13416
13417    impl std::fmt::Display for VulnerabilityMode {
13418        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13419            wkt::internal::display_enum(f, self.name(), self.value())
13420        }
13421    }
13422
13423    impl std::convert::From<i32> for VulnerabilityMode {
13424        fn from(value: i32) -> Self {
13425            match value {
13426                0 => Self::Unspecified,
13427                1 => Self::VulnerabilityDisabled,
13428                2 => Self::VulnerabilityBasic,
13429                3 => Self::VulnerabilityEnterprise,
13430                _ => Self::UnknownValue(vulnerability_mode::UnknownValue(
13431                    wkt::internal::UnknownEnumValue::Integer(value),
13432                )),
13433            }
13434        }
13435    }
13436
13437    impl std::convert::From<&str> for VulnerabilityMode {
13438        fn from(value: &str) -> Self {
13439            use std::string::ToString;
13440            match value {
13441                "VULNERABILITY_MODE_UNSPECIFIED" => Self::Unspecified,
13442                "VULNERABILITY_DISABLED" => Self::VulnerabilityDisabled,
13443                "VULNERABILITY_BASIC" => Self::VulnerabilityBasic,
13444                "VULNERABILITY_ENTERPRISE" => Self::VulnerabilityEnterprise,
13445                _ => Self::UnknownValue(vulnerability_mode::UnknownValue(
13446                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13447                )),
13448            }
13449        }
13450    }
13451
13452    impl serde::ser::Serialize for VulnerabilityMode {
13453        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13454        where
13455            S: serde::Serializer,
13456        {
13457            match self {
13458                Self::Unspecified => serializer.serialize_i32(0),
13459                Self::VulnerabilityDisabled => serializer.serialize_i32(1),
13460                Self::VulnerabilityBasic => serializer.serialize_i32(2),
13461                Self::VulnerabilityEnterprise => serializer.serialize_i32(3),
13462                Self::UnknownValue(u) => u.0.serialize(serializer),
13463            }
13464        }
13465    }
13466
13467    impl<'de> serde::de::Deserialize<'de> for VulnerabilityMode {
13468        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13469        where
13470            D: serde::Deserializer<'de>,
13471        {
13472            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VulnerabilityMode>::new(
13473                ".google.container.v1.SecurityPostureConfig.VulnerabilityMode",
13474            ))
13475        }
13476    }
13477}
13478
13479/// Node pool configs that apply to all auto-provisioned node pools
13480/// in autopilot clusters and node auto-provisioning enabled clusters.
13481#[derive(Clone, Default, PartialEq)]
13482#[non_exhaustive]
13483pub struct NodePoolAutoConfig {
13484    /// The list of instance tags applied to all nodes. Tags are used to identify
13485    /// valid sources or targets for network firewalls and are specified by
13486    /// the client during cluster creation. Each tag within the list
13487    /// must comply with RFC1035.
13488    pub network_tags: std::option::Option<crate::model::NetworkTags>,
13489
13490    /// Resource manager tag keys and values to be attached to the nodes
13491    /// for managing Compute Engine firewalls using Network Firewall Policies.
13492    pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
13493
13494    /// NodeKubeletConfig controls the defaults for autoprovisioned node-pools.
13495    ///
13496    /// Currently only `insecure_kubelet_readonly_port_enabled` can be set here.
13497    pub node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
13498
13499    /// Output only. Configuration options for Linux nodes.
13500    pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
13501
13502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13503}
13504
13505impl NodePoolAutoConfig {
13506    pub fn new() -> Self {
13507        std::default::Default::default()
13508    }
13509
13510    /// Sets the value of [network_tags][crate::model::NodePoolAutoConfig::network_tags].
13511    ///
13512    /// # Example
13513    /// ```ignore,no_run
13514    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13515    /// use google_cloud_container_v1::model::NetworkTags;
13516    /// let x = NodePoolAutoConfig::new().set_network_tags(NetworkTags::default()/* use setters */);
13517    /// ```
13518    pub fn set_network_tags<T>(mut self, v: T) -> Self
13519    where
13520        T: std::convert::Into<crate::model::NetworkTags>,
13521    {
13522        self.network_tags = std::option::Option::Some(v.into());
13523        self
13524    }
13525
13526    /// Sets or clears the value of [network_tags][crate::model::NodePoolAutoConfig::network_tags].
13527    ///
13528    /// # Example
13529    /// ```ignore,no_run
13530    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13531    /// use google_cloud_container_v1::model::NetworkTags;
13532    /// let x = NodePoolAutoConfig::new().set_or_clear_network_tags(Some(NetworkTags::default()/* use setters */));
13533    /// let x = NodePoolAutoConfig::new().set_or_clear_network_tags(None::<NetworkTags>);
13534    /// ```
13535    pub fn set_or_clear_network_tags<T>(mut self, v: std::option::Option<T>) -> Self
13536    where
13537        T: std::convert::Into<crate::model::NetworkTags>,
13538    {
13539        self.network_tags = v.map(|x| x.into());
13540        self
13541    }
13542
13543    /// Sets the value of [resource_manager_tags][crate::model::NodePoolAutoConfig::resource_manager_tags].
13544    ///
13545    /// # Example
13546    /// ```ignore,no_run
13547    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13548    /// use google_cloud_container_v1::model::ResourceManagerTags;
13549    /// let x = NodePoolAutoConfig::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
13550    /// ```
13551    pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
13552    where
13553        T: std::convert::Into<crate::model::ResourceManagerTags>,
13554    {
13555        self.resource_manager_tags = std::option::Option::Some(v.into());
13556        self
13557    }
13558
13559    /// Sets or clears the value of [resource_manager_tags][crate::model::NodePoolAutoConfig::resource_manager_tags].
13560    ///
13561    /// # Example
13562    /// ```ignore,no_run
13563    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13564    /// use google_cloud_container_v1::model::ResourceManagerTags;
13565    /// let x = NodePoolAutoConfig::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
13566    /// let x = NodePoolAutoConfig::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
13567    /// ```
13568    pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
13569    where
13570        T: std::convert::Into<crate::model::ResourceManagerTags>,
13571    {
13572        self.resource_manager_tags = v.map(|x| x.into());
13573        self
13574    }
13575
13576    /// Sets the value of [node_kubelet_config][crate::model::NodePoolAutoConfig::node_kubelet_config].
13577    ///
13578    /// # Example
13579    /// ```ignore,no_run
13580    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13581    /// use google_cloud_container_v1::model::NodeKubeletConfig;
13582    /// let x = NodePoolAutoConfig::new().set_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
13583    /// ```
13584    pub fn set_node_kubelet_config<T>(mut self, v: T) -> Self
13585    where
13586        T: std::convert::Into<crate::model::NodeKubeletConfig>,
13587    {
13588        self.node_kubelet_config = std::option::Option::Some(v.into());
13589        self
13590    }
13591
13592    /// Sets or clears the value of [node_kubelet_config][crate::model::NodePoolAutoConfig::node_kubelet_config].
13593    ///
13594    /// # Example
13595    /// ```ignore,no_run
13596    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13597    /// use google_cloud_container_v1::model::NodeKubeletConfig;
13598    /// let x = NodePoolAutoConfig::new().set_or_clear_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
13599    /// let x = NodePoolAutoConfig::new().set_or_clear_node_kubelet_config(None::<NodeKubeletConfig>);
13600    /// ```
13601    pub fn set_or_clear_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
13602    where
13603        T: std::convert::Into<crate::model::NodeKubeletConfig>,
13604    {
13605        self.node_kubelet_config = v.map(|x| x.into());
13606        self
13607    }
13608
13609    /// Sets the value of [linux_node_config][crate::model::NodePoolAutoConfig::linux_node_config].
13610    ///
13611    /// # Example
13612    /// ```ignore,no_run
13613    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13614    /// use google_cloud_container_v1::model::LinuxNodeConfig;
13615    /// let x = NodePoolAutoConfig::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
13616    /// ```
13617    pub fn set_linux_node_config<T>(mut self, v: T) -> Self
13618    where
13619        T: std::convert::Into<crate::model::LinuxNodeConfig>,
13620    {
13621        self.linux_node_config = std::option::Option::Some(v.into());
13622        self
13623    }
13624
13625    /// Sets or clears the value of [linux_node_config][crate::model::NodePoolAutoConfig::linux_node_config].
13626    ///
13627    /// # Example
13628    /// ```ignore,no_run
13629    /// # use google_cloud_container_v1::model::NodePoolAutoConfig;
13630    /// use google_cloud_container_v1::model::LinuxNodeConfig;
13631    /// let x = NodePoolAutoConfig::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
13632    /// let x = NodePoolAutoConfig::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
13633    /// ```
13634    pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
13635    where
13636        T: std::convert::Into<crate::model::LinuxNodeConfig>,
13637    {
13638        self.linux_node_config = v.map(|x| x.into());
13639        self
13640    }
13641}
13642
13643impl wkt::message::Message for NodePoolAutoConfig {
13644    fn typename() -> &'static str {
13645        "type.googleapis.com/google.container.v1.NodePoolAutoConfig"
13646    }
13647}
13648
13649/// Subset of Nodepool message that has defaults.
13650#[derive(Clone, Default, PartialEq)]
13651#[non_exhaustive]
13652pub struct NodePoolDefaults {
13653    /// Subset of NodeConfig message that has defaults.
13654    pub node_config_defaults: std::option::Option<crate::model::NodeConfigDefaults>,
13655
13656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13657}
13658
13659impl NodePoolDefaults {
13660    pub fn new() -> Self {
13661        std::default::Default::default()
13662    }
13663
13664    /// Sets the value of [node_config_defaults][crate::model::NodePoolDefaults::node_config_defaults].
13665    ///
13666    /// # Example
13667    /// ```ignore,no_run
13668    /// # use google_cloud_container_v1::model::NodePoolDefaults;
13669    /// use google_cloud_container_v1::model::NodeConfigDefaults;
13670    /// let x = NodePoolDefaults::new().set_node_config_defaults(NodeConfigDefaults::default()/* use setters */);
13671    /// ```
13672    pub fn set_node_config_defaults<T>(mut self, v: T) -> Self
13673    where
13674        T: std::convert::Into<crate::model::NodeConfigDefaults>,
13675    {
13676        self.node_config_defaults = std::option::Option::Some(v.into());
13677        self
13678    }
13679
13680    /// Sets or clears the value of [node_config_defaults][crate::model::NodePoolDefaults::node_config_defaults].
13681    ///
13682    /// # Example
13683    /// ```ignore,no_run
13684    /// # use google_cloud_container_v1::model::NodePoolDefaults;
13685    /// use google_cloud_container_v1::model::NodeConfigDefaults;
13686    /// let x = NodePoolDefaults::new().set_or_clear_node_config_defaults(Some(NodeConfigDefaults::default()/* use setters */));
13687    /// let x = NodePoolDefaults::new().set_or_clear_node_config_defaults(None::<NodeConfigDefaults>);
13688    /// ```
13689    pub fn set_or_clear_node_config_defaults<T>(mut self, v: std::option::Option<T>) -> Self
13690    where
13691        T: std::convert::Into<crate::model::NodeConfigDefaults>,
13692    {
13693        self.node_config_defaults = v.map(|x| x.into());
13694        self
13695    }
13696}
13697
13698impl wkt::message::Message for NodePoolDefaults {
13699    fn typename() -> &'static str {
13700        "type.googleapis.com/google.container.v1.NodePoolDefaults"
13701    }
13702}
13703
13704/// Subset of NodeConfig message that has defaults.
13705#[derive(Clone, Default, PartialEq)]
13706#[non_exhaustive]
13707pub struct NodeConfigDefaults {
13708    /// GCFS (Google Container File System, also known as Riptide) options.
13709    pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
13710
13711    /// Logging configuration for node pools.
13712    pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
13713
13714    /// Parameters for containerd customization.
13715    pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
13716
13717    /// NodeKubeletConfig controls the defaults for new node-pools.
13718    ///
13719    /// Currently only `insecure_kubelet_readonly_port_enabled` can be set here.
13720    pub node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
13721
13722    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13723}
13724
13725impl NodeConfigDefaults {
13726    pub fn new() -> Self {
13727        std::default::Default::default()
13728    }
13729
13730    /// Sets the value of [gcfs_config][crate::model::NodeConfigDefaults::gcfs_config].
13731    ///
13732    /// # Example
13733    /// ```ignore,no_run
13734    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13735    /// use google_cloud_container_v1::model::GcfsConfig;
13736    /// let x = NodeConfigDefaults::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
13737    /// ```
13738    pub fn set_gcfs_config<T>(mut self, v: T) -> Self
13739    where
13740        T: std::convert::Into<crate::model::GcfsConfig>,
13741    {
13742        self.gcfs_config = std::option::Option::Some(v.into());
13743        self
13744    }
13745
13746    /// Sets or clears the value of [gcfs_config][crate::model::NodeConfigDefaults::gcfs_config].
13747    ///
13748    /// # Example
13749    /// ```ignore,no_run
13750    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13751    /// use google_cloud_container_v1::model::GcfsConfig;
13752    /// let x = NodeConfigDefaults::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
13753    /// let x = NodeConfigDefaults::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
13754    /// ```
13755    pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
13756    where
13757        T: std::convert::Into<crate::model::GcfsConfig>,
13758    {
13759        self.gcfs_config = v.map(|x| x.into());
13760        self
13761    }
13762
13763    /// Sets the value of [logging_config][crate::model::NodeConfigDefaults::logging_config].
13764    ///
13765    /// # Example
13766    /// ```ignore,no_run
13767    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13768    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
13769    /// let x = NodeConfigDefaults::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
13770    /// ```
13771    pub fn set_logging_config<T>(mut self, v: T) -> Self
13772    where
13773        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
13774    {
13775        self.logging_config = std::option::Option::Some(v.into());
13776        self
13777    }
13778
13779    /// Sets or clears the value of [logging_config][crate::model::NodeConfigDefaults::logging_config].
13780    ///
13781    /// # Example
13782    /// ```ignore,no_run
13783    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13784    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
13785    /// let x = NodeConfigDefaults::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
13786    /// let x = NodeConfigDefaults::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
13787    /// ```
13788    pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
13789    where
13790        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
13791    {
13792        self.logging_config = v.map(|x| x.into());
13793        self
13794    }
13795
13796    /// Sets the value of [containerd_config][crate::model::NodeConfigDefaults::containerd_config].
13797    ///
13798    /// # Example
13799    /// ```ignore,no_run
13800    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13801    /// use google_cloud_container_v1::model::ContainerdConfig;
13802    /// let x = NodeConfigDefaults::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
13803    /// ```
13804    pub fn set_containerd_config<T>(mut self, v: T) -> Self
13805    where
13806        T: std::convert::Into<crate::model::ContainerdConfig>,
13807    {
13808        self.containerd_config = std::option::Option::Some(v.into());
13809        self
13810    }
13811
13812    /// Sets or clears the value of [containerd_config][crate::model::NodeConfigDefaults::containerd_config].
13813    ///
13814    /// # Example
13815    /// ```ignore,no_run
13816    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13817    /// use google_cloud_container_v1::model::ContainerdConfig;
13818    /// let x = NodeConfigDefaults::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
13819    /// let x = NodeConfigDefaults::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
13820    /// ```
13821    pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
13822    where
13823        T: std::convert::Into<crate::model::ContainerdConfig>,
13824    {
13825        self.containerd_config = v.map(|x| x.into());
13826        self
13827    }
13828
13829    /// Sets the value of [node_kubelet_config][crate::model::NodeConfigDefaults::node_kubelet_config].
13830    ///
13831    /// # Example
13832    /// ```ignore,no_run
13833    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13834    /// use google_cloud_container_v1::model::NodeKubeletConfig;
13835    /// let x = NodeConfigDefaults::new().set_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
13836    /// ```
13837    pub fn set_node_kubelet_config<T>(mut self, v: T) -> Self
13838    where
13839        T: std::convert::Into<crate::model::NodeKubeletConfig>,
13840    {
13841        self.node_kubelet_config = std::option::Option::Some(v.into());
13842        self
13843    }
13844
13845    /// Sets or clears the value of [node_kubelet_config][crate::model::NodeConfigDefaults::node_kubelet_config].
13846    ///
13847    /// # Example
13848    /// ```ignore,no_run
13849    /// # use google_cloud_container_v1::model::NodeConfigDefaults;
13850    /// use google_cloud_container_v1::model::NodeKubeletConfig;
13851    /// let x = NodeConfigDefaults::new().set_or_clear_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
13852    /// let x = NodeConfigDefaults::new().set_or_clear_node_kubelet_config(None::<NodeKubeletConfig>);
13853    /// ```
13854    pub fn set_or_clear_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
13855    where
13856        T: std::convert::Into<crate::model::NodeKubeletConfig>,
13857    {
13858        self.node_kubelet_config = v.map(|x| x.into());
13859        self
13860    }
13861}
13862
13863impl wkt::message::Message for NodeConfigDefaults {
13864    fn typename() -> &'static str {
13865        "type.googleapis.com/google.container.v1.NodeConfigDefaults"
13866    }
13867}
13868
13869/// ClusterUpdate describes an update to the cluster. Exactly one update can
13870/// be applied to a cluster with each request, so at most one field can be
13871/// provided.
13872#[derive(Clone, Default, PartialEq)]
13873#[non_exhaustive]
13874pub struct ClusterUpdate {
13875    /// The Kubernetes version to change the nodes to (typically an
13876    /// upgrade).
13877    ///
13878    /// Users may specify either explicit versions offered by
13879    /// Kubernetes Engine or version aliases, which have the following behavior:
13880    ///
13881    /// - "latest": picks the highest valid Kubernetes version
13882    /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
13883    /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
13884    /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
13885    /// - "-": picks the Kubernetes master version
13886    pub desired_node_version: std::string::String,
13887
13888    /// The monitoring service the cluster should use to write metrics.
13889    /// Currently available options:
13890    ///
13891    /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
13892    ///   service with a Kubernetes-native resource model
13893    /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
13894    ///   longer available as of GKE 1.15).
13895    /// * `none` - No metrics will be exported from the cluster.
13896    ///
13897    /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
13898    /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
13899    pub desired_monitoring_service: std::string::String,
13900
13901    /// Configurations for the various addons available to run in the cluster.
13902    pub desired_addons_config: std::option::Option<crate::model::AddonsConfig>,
13903
13904    /// The node pool to be upgraded. This field is mandatory if
13905    /// "desired_node_version", "desired_image_family" or
13906    /// "desired_node_pool_autoscaling" is specified and there is more than one
13907    /// node pool on the cluster.
13908    pub desired_node_pool_id: std::string::String,
13909
13910    /// The desired image type for the node pool.
13911    /// NOTE: Set the "desired_node_pool" field as well.
13912    pub desired_image_type: std::string::String,
13913
13914    /// Configuration of etcd encryption.
13915    pub desired_database_encryption: std::option::Option<crate::model::DatabaseEncryption>,
13916
13917    /// Configuration for Workload Identity.
13918    pub desired_workload_identity_config: std::option::Option<crate::model::WorkloadIdentityConfig>,
13919
13920    /// Configuration for issuance of mTLS keys and certificates to Kubernetes
13921    /// pods.
13922    pub desired_mesh_certificates: std::option::Option<crate::model::MeshCertificates>,
13923
13924    /// Configuration for Shielded Nodes.
13925    pub desired_shielded_nodes: std::option::Option<crate::model::ShieldedNodes>,
13926
13927    /// The desired configuration for the fine-grained cost management feature.
13928    pub desired_cost_management_config: std::option::Option<crate::model::CostManagementConfig>,
13929
13930    /// DNSConfig contains clusterDNS config for this cluster.
13931    pub desired_dns_config: std::option::Option<crate::model::DNSConfig>,
13932
13933    /// Autoscaler configuration for the node pool specified in
13934    /// desired_node_pool_id. If there is only one pool in the
13935    /// cluster and desired_node_pool_id is not provided then
13936    /// the change applies to that single node pool.
13937    pub desired_node_pool_autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
13938
13939    /// The desired list of Google Compute Engine
13940    /// [zones](https://cloud.google.com/compute/docs/zones#available)
13941    /// in which the cluster's nodes should be located.
13942    ///
13943    /// This list must always include the cluster's primary zone.
13944    ///
13945    /// Warning: changing cluster locations will update the locations of all node
13946    /// pools and will result in nodes being added and/or removed.
13947    pub desired_locations: std::vec::Vec<std::string::String>,
13948
13949    /// The desired configuration options for master authorized networks feature.
13950    ///
13951    /// Deprecated: Use
13952    /// desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config
13953    /// instead.
13954    #[deprecated]
13955    pub desired_master_authorized_networks_config:
13956        std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
13957
13958    /// Cluster-level autoscaling configuration.
13959    pub desired_cluster_autoscaling: std::option::Option<crate::model::ClusterAutoscaling>,
13960
13961    /// The desired configuration options for the Binary Authorization feature.
13962    pub desired_binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
13963
13964    /// The logging service the cluster should use to write logs.
13965    /// Currently available options:
13966    ///
13967    /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
13968    ///   service with a Kubernetes-native resource model
13969    /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
13970    ///   available as of GKE 1.15).
13971    /// * `none` - no logs will be exported from the cluster.
13972    ///
13973    /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
13974    /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
13975    pub desired_logging_service: std::string::String,
13976
13977    /// The desired configuration for exporting resource usage.
13978    pub desired_resource_usage_export_config:
13979        std::option::Option<crate::model::ResourceUsageExportConfig>,
13980
13981    /// Cluster-level Vertical Pod Autoscaling configuration.
13982    pub desired_vertical_pod_autoscaling: std::option::Option<crate::model::VerticalPodAutoscaling>,
13983
13984    /// The desired private cluster configuration. master_global_access_config is
13985    /// the only field that can be changed via this field.
13986    /// See also
13987    /// [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint]
13988    /// for modifying other fields within
13989    /// [PrivateClusterConfig][google.container.v1.PrivateClusterConfig].
13990    ///
13991    /// Deprecated: Use
13992    /// desired_control_plane_endpoints_config.ip_endpoints_config.global_access
13993    /// instead.
13994    ///
13995    /// [google.container.v1.ClusterUpdate.desired_enable_private_endpoint]: crate::model::ClusterUpdate::desired_enable_private_endpoint
13996    /// [google.container.v1.PrivateClusterConfig]: crate::model::PrivateClusterConfig
13997    #[deprecated]
13998    pub desired_private_cluster_config: std::option::Option<crate::model::PrivateClusterConfig>,
13999
14000    /// The desired config of Intra-node visibility.
14001    pub desired_intra_node_visibility_config:
14002        std::option::Option<crate::model::IntraNodeVisibilityConfig>,
14003
14004    /// The desired status of whether to disable default sNAT for this cluster.
14005    pub desired_default_snat_status: std::option::Option<crate::model::DefaultSnatStatus>,
14006
14007    /// The desired release channel configuration.
14008    pub desired_release_channel: std::option::Option<crate::model::ReleaseChannel>,
14009
14010    /// The desired L4 Internal Load Balancer Subsetting configuration.
14011    pub desired_l4ilb_subsetting_config: std::option::Option<crate::model::ILBSubsettingConfig>,
14012
14013    /// The desired datapath provider for the cluster.
14014    pub desired_datapath_provider: crate::model::DatapathProvider,
14015
14016    /// The desired state of IPv6 connectivity to Google Services.
14017    pub desired_private_ipv6_google_access: crate::model::PrivateIPv6GoogleAccess,
14018
14019    /// The desired notification configuration.
14020    pub desired_notification_config: std::option::Option<crate::model::NotificationConfig>,
14021
14022    /// The desired authenticator groups config for the cluster.
14023    pub desired_authenticator_groups_config:
14024        std::option::Option<crate::model::AuthenticatorGroupsConfig>,
14025
14026    /// The desired logging configuration.
14027    pub desired_logging_config: std::option::Option<crate::model::LoggingConfig>,
14028
14029    /// The desired monitoring configuration.
14030    pub desired_monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
14031
14032    /// The desired Identity Service component configuration.
14033    pub desired_identity_service_config: std::option::Option<crate::model::IdentityServiceConfig>,
14034
14035    /// ServiceExternalIPsConfig specifies the config for the use of Services with
14036    /// ExternalIPs field.
14037    pub desired_service_external_ips_config:
14038        std::option::Option<crate::model::ServiceExternalIPsConfig>,
14039
14040    /// Enable/Disable private endpoint for the cluster's master.
14041    ///
14042    /// Deprecated: Use
14043    /// desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint
14044    /// instead. Note that the value of enable_public_endpoint is reversed: if
14045    /// enable_private_endpoint is false, then enable_public_endpoint will be true.
14046    #[deprecated]
14047    pub desired_enable_private_endpoint: std::option::Option<bool>,
14048
14049    /// Override the default setting of whether future created
14050    /// nodes have private IP addresses only, namely
14051    /// [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes]
14052    ///
14053    /// [google.container.v1.NetworkConfig.default_enable_private_nodes]: crate::model::NetworkConfig::default_enable_private_nodes
14054    pub desired_default_enable_private_nodes: std::option::Option<bool>,
14055
14056    /// [Control plane
14057    /// endpoints][google.container.v1.Cluster.control_plane_endpoints_config]
14058    /// configuration.
14059    ///
14060    /// [google.container.v1.Cluster.control_plane_endpoints_config]: crate::model::Cluster::control_plane_endpoints_config
14061    pub desired_control_plane_endpoints_config:
14062        std::option::Option<crate::model::ControlPlaneEndpointsConfig>,
14063
14064    /// The Kubernetes version to change the master to.
14065    ///
14066    /// Users may specify either explicit versions offered by
14067    /// Kubernetes Engine or version aliases, which have the following behavior:
14068    ///
14069    /// - "latest": picks the highest valid Kubernetes version
14070    /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
14071    /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
14072    /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
14073    /// - "-": picks the default Kubernetes version
14074    pub desired_master_version: std::string::String,
14075
14076    /// The desired GCFS config for the cluster
14077    pub desired_gcfs_config: std::option::Option<crate::model::GcfsConfig>,
14078
14079    /// The desired network tags that apply to all auto-provisioned node pools
14080    /// in autopilot clusters and node auto-provisioning enabled clusters.
14081    pub desired_node_pool_auto_config_network_tags: std::option::Option<crate::model::NetworkTags>,
14082
14083    /// The desired config for pod autoscaling.
14084    pub desired_pod_autoscaling: std::option::Option<crate::model::PodAutoscaling>,
14085
14086    /// The desired config of Gateway API on this cluster.
14087    pub desired_gateway_api_config: std::option::Option<crate::model::GatewayAPIConfig>,
14088
14089    /// The current etag of the cluster.
14090    /// If an etag is provided and does not match the current etag of the cluster,
14091    /// update will be blocked and an ABORTED error will be returned.
14092    pub etag: std::string::String,
14093
14094    /// The desired node pool logging configuration defaults for the cluster.
14095    pub desired_node_pool_logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
14096
14097    /// The desired fleet configuration for the cluster.
14098    pub desired_fleet: std::option::Option<crate::model::Fleet>,
14099
14100    /// The desired stack type of the cluster.
14101    /// If a stack type is provided and does not match the current stack type of
14102    /// the cluster, update will attempt to change the stack type to the new type.
14103    pub desired_stack_type: crate::model::StackType,
14104
14105    /// The additional pod ranges to be added to the cluster. These pod ranges
14106    /// can be used by node pools to allocate pod IPs.
14107    pub additional_pod_ranges_config: std::option::Option<crate::model::AdditionalPodRangesConfig>,
14108
14109    /// The additional pod ranges that are to be removed from the cluster.
14110    /// The pod ranges specified here must have been specified earlier in the
14111    /// 'additional_pod_ranges_config' argument.
14112    pub removed_additional_pod_ranges_config:
14113        std::option::Option<crate::model::AdditionalPodRangesConfig>,
14114
14115    /// Kubernetes open source beta apis enabled on the cluster. Only beta apis
14116    pub enable_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
14117
14118    /// Enable/Disable Security Posture API features for the cluster.
14119    pub desired_security_posture_config: std::option::Option<crate::model::SecurityPostureConfig>,
14120
14121    /// The desired network performance config.
14122    pub desired_network_performance_config:
14123        std::option::Option<crate::model::network_config::ClusterNetworkPerformanceConfig>,
14124
14125    /// Enable/Disable FQDN Network Policy for the cluster.
14126    pub desired_enable_fqdn_network_policy: std::option::Option<bool>,
14127
14128    /// WorkloadPolicyConfig is the configuration related to GCW workload policy
14129    pub desired_autopilot_workload_policy_config:
14130        std::option::Option<crate::model::WorkloadPolicyConfig>,
14131
14132    /// Desired Beta APIs to be enabled for cluster.
14133    pub desired_k8s_beta_apis: std::option::Option<crate::model::K8sBetaAPIConfig>,
14134
14135    /// The desired containerd config for the cluster.
14136    pub desired_containerd_config: std::option::Option<crate::model::ContainerdConfig>,
14137
14138    /// Enable/Disable Multi-Networking for the cluster
14139    pub desired_enable_multi_networking: std::option::Option<bool>,
14140
14141    /// The desired resource manager tags that apply to all auto-provisioned node
14142    /// pools in autopilot clusters and node auto-provisioning enabled clusters.
14143    pub desired_node_pool_auto_config_resource_manager_tags:
14144        std::option::Option<crate::model::ResourceManagerTags>,
14145
14146    /// Specify the details of in-transit encryption.
14147    pub desired_in_transit_encryption_config:
14148        std::option::Option<crate::model::InTransitEncryptionConfig>,
14149
14150    /// Enable/Disable Cilium Clusterwide Network Policy for the cluster.
14151    pub desired_enable_cilium_clusterwide_network_policy: std::option::Option<bool>,
14152
14153    /// Enable/Disable Secret Manager Config.
14154    pub desired_secret_manager_config: std::option::Option<crate::model::SecretManagerConfig>,
14155
14156    /// Enable/Disable Compliance Posture features for the cluster.
14157    pub desired_compliance_posture_config:
14158        std::option::Option<crate::model::CompliancePostureConfig>,
14159
14160    /// The desired node kubelet config for the cluster.
14161    pub desired_node_kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
14162
14163    /// The desired node kubelet config for all auto-provisioned node pools
14164    /// in autopilot clusters and node auto-provisioning enabled clusters.
14165    pub desired_node_pool_auto_config_kubelet_config:
14166        std::option::Option<crate::model::NodeKubeletConfig>,
14167
14168    /// The Custom keys configuration for the cluster.
14169    ///
14170    /// This field is deprecated.
14171    /// Use
14172    /// [ClusterUpdate.desired_user_managed_keys_config][google.container.v1.ClusterUpdate.desired_user_managed_keys_config]
14173    /// instead.
14174    ///
14175    /// [google.container.v1.ClusterUpdate.desired_user_managed_keys_config]: crate::model::ClusterUpdate::desired_user_managed_keys_config
14176    #[deprecated]
14177    pub user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
14178
14179    /// RBACBindingConfig allows user to restrict ClusterRoleBindings an
14180    /// RoleBindings that can be created.
14181    pub desired_rbac_binding_config: std::option::Option<crate::model::RBACBindingConfig>,
14182
14183    /// The desired config for additional subnetworks attached to the cluster.
14184    pub desired_additional_ip_ranges_config:
14185        std::option::Option<crate::model::DesiredAdditionalIPRangesConfig>,
14186
14187    /// The desired enterprise configuration for the cluster.
14188    ///
14189    /// Deprecated: GKE Enterprise features are now available without an Enterprise
14190    /// tier.
14191    #[deprecated]
14192    pub desired_enterprise_config: std::option::Option<crate::model::DesiredEnterpriseConfig>,
14193
14194    /// AutoIpamConfig contains all information related to Auto IPAM
14195    pub desired_auto_ipam_config: std::option::Option<crate::model::AutoIpamConfig>,
14196
14197    /// Enable/Disable L4 LB VPC firewall reconciliation for the cluster.
14198    pub desired_disable_l4_lb_firewall_reconciliation: std::option::Option<bool>,
14199
14200    /// The desired Linux node config for all auto-provisioned node pools
14201    /// in autopilot clusters and node auto-provisioning enabled clusters.
14202    ///
14203    /// Currently only `cgroup_mode` can be set here.
14204    pub desired_node_pool_auto_config_linux_node_config:
14205        std::option::Option<crate::model::LinuxNodeConfig>,
14206
14207    /// The desired user managed keys config for the cluster.
14208    pub desired_user_managed_keys_config: std::option::Option<crate::model::UserManagedKeysConfig>,
14209
14210    /// Configuration for limiting anonymous access to all endpoints except the
14211    /// health checks.
14212    pub desired_anonymous_authentication_config:
14213        std::option::Option<crate::model::AnonymousAuthenticationConfig>,
14214
14215    /// Configuration for GKE auto upgrade.
14216    pub gke_auto_upgrade_config: std::option::Option<crate::model::GkeAutoUpgradeConfig>,
14217
14218    /// The desired network tier configuration for the cluster.
14219    pub desired_network_tier_config: std::option::Option<crate::model::NetworkTierConfig>,
14220
14221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14222}
14223
14224impl ClusterUpdate {
14225    pub fn new() -> Self {
14226        std::default::Default::default()
14227    }
14228
14229    /// Sets the value of [desired_node_version][crate::model::ClusterUpdate::desired_node_version].
14230    ///
14231    /// # Example
14232    /// ```ignore,no_run
14233    /// # use google_cloud_container_v1::model::ClusterUpdate;
14234    /// let x = ClusterUpdate::new().set_desired_node_version("example");
14235    /// ```
14236    pub fn set_desired_node_version<T: std::convert::Into<std::string::String>>(
14237        mut self,
14238        v: T,
14239    ) -> Self {
14240        self.desired_node_version = v.into();
14241        self
14242    }
14243
14244    /// Sets the value of [desired_monitoring_service][crate::model::ClusterUpdate::desired_monitoring_service].
14245    ///
14246    /// # Example
14247    /// ```ignore,no_run
14248    /// # use google_cloud_container_v1::model::ClusterUpdate;
14249    /// let x = ClusterUpdate::new().set_desired_monitoring_service("example");
14250    /// ```
14251    pub fn set_desired_monitoring_service<T: std::convert::Into<std::string::String>>(
14252        mut self,
14253        v: T,
14254    ) -> Self {
14255        self.desired_monitoring_service = v.into();
14256        self
14257    }
14258
14259    /// Sets the value of [desired_addons_config][crate::model::ClusterUpdate::desired_addons_config].
14260    ///
14261    /// # Example
14262    /// ```ignore,no_run
14263    /// # use google_cloud_container_v1::model::ClusterUpdate;
14264    /// use google_cloud_container_v1::model::AddonsConfig;
14265    /// let x = ClusterUpdate::new().set_desired_addons_config(AddonsConfig::default()/* use setters */);
14266    /// ```
14267    pub fn set_desired_addons_config<T>(mut self, v: T) -> Self
14268    where
14269        T: std::convert::Into<crate::model::AddonsConfig>,
14270    {
14271        self.desired_addons_config = std::option::Option::Some(v.into());
14272        self
14273    }
14274
14275    /// Sets or clears the value of [desired_addons_config][crate::model::ClusterUpdate::desired_addons_config].
14276    ///
14277    /// # Example
14278    /// ```ignore,no_run
14279    /// # use google_cloud_container_v1::model::ClusterUpdate;
14280    /// use google_cloud_container_v1::model::AddonsConfig;
14281    /// let x = ClusterUpdate::new().set_or_clear_desired_addons_config(Some(AddonsConfig::default()/* use setters */));
14282    /// let x = ClusterUpdate::new().set_or_clear_desired_addons_config(None::<AddonsConfig>);
14283    /// ```
14284    pub fn set_or_clear_desired_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
14285    where
14286        T: std::convert::Into<crate::model::AddonsConfig>,
14287    {
14288        self.desired_addons_config = v.map(|x| x.into());
14289        self
14290    }
14291
14292    /// Sets the value of [desired_node_pool_id][crate::model::ClusterUpdate::desired_node_pool_id].
14293    ///
14294    /// # Example
14295    /// ```ignore,no_run
14296    /// # use google_cloud_container_v1::model::ClusterUpdate;
14297    /// let x = ClusterUpdate::new().set_desired_node_pool_id("example");
14298    /// ```
14299    pub fn set_desired_node_pool_id<T: std::convert::Into<std::string::String>>(
14300        mut self,
14301        v: T,
14302    ) -> Self {
14303        self.desired_node_pool_id = v.into();
14304        self
14305    }
14306
14307    /// Sets the value of [desired_image_type][crate::model::ClusterUpdate::desired_image_type].
14308    ///
14309    /// # Example
14310    /// ```ignore,no_run
14311    /// # use google_cloud_container_v1::model::ClusterUpdate;
14312    /// let x = ClusterUpdate::new().set_desired_image_type("example");
14313    /// ```
14314    pub fn set_desired_image_type<T: std::convert::Into<std::string::String>>(
14315        mut self,
14316        v: T,
14317    ) -> Self {
14318        self.desired_image_type = v.into();
14319        self
14320    }
14321
14322    /// Sets the value of [desired_database_encryption][crate::model::ClusterUpdate::desired_database_encryption].
14323    ///
14324    /// # Example
14325    /// ```ignore,no_run
14326    /// # use google_cloud_container_v1::model::ClusterUpdate;
14327    /// use google_cloud_container_v1::model::DatabaseEncryption;
14328    /// let x = ClusterUpdate::new().set_desired_database_encryption(DatabaseEncryption::default()/* use setters */);
14329    /// ```
14330    pub fn set_desired_database_encryption<T>(mut self, v: T) -> Self
14331    where
14332        T: std::convert::Into<crate::model::DatabaseEncryption>,
14333    {
14334        self.desired_database_encryption = std::option::Option::Some(v.into());
14335        self
14336    }
14337
14338    /// Sets or clears the value of [desired_database_encryption][crate::model::ClusterUpdate::desired_database_encryption].
14339    ///
14340    /// # Example
14341    /// ```ignore,no_run
14342    /// # use google_cloud_container_v1::model::ClusterUpdate;
14343    /// use google_cloud_container_v1::model::DatabaseEncryption;
14344    /// let x = ClusterUpdate::new().set_or_clear_desired_database_encryption(Some(DatabaseEncryption::default()/* use setters */));
14345    /// let x = ClusterUpdate::new().set_or_clear_desired_database_encryption(None::<DatabaseEncryption>);
14346    /// ```
14347    pub fn set_or_clear_desired_database_encryption<T>(mut self, v: std::option::Option<T>) -> Self
14348    where
14349        T: std::convert::Into<crate::model::DatabaseEncryption>,
14350    {
14351        self.desired_database_encryption = v.map(|x| x.into());
14352        self
14353    }
14354
14355    /// Sets the value of [desired_workload_identity_config][crate::model::ClusterUpdate::desired_workload_identity_config].
14356    ///
14357    /// # Example
14358    /// ```ignore,no_run
14359    /// # use google_cloud_container_v1::model::ClusterUpdate;
14360    /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
14361    /// let x = ClusterUpdate::new().set_desired_workload_identity_config(WorkloadIdentityConfig::default()/* use setters */);
14362    /// ```
14363    pub fn set_desired_workload_identity_config<T>(mut self, v: T) -> Self
14364    where
14365        T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
14366    {
14367        self.desired_workload_identity_config = std::option::Option::Some(v.into());
14368        self
14369    }
14370
14371    /// Sets or clears the value of [desired_workload_identity_config][crate::model::ClusterUpdate::desired_workload_identity_config].
14372    ///
14373    /// # Example
14374    /// ```ignore,no_run
14375    /// # use google_cloud_container_v1::model::ClusterUpdate;
14376    /// use google_cloud_container_v1::model::WorkloadIdentityConfig;
14377    /// let x = ClusterUpdate::new().set_or_clear_desired_workload_identity_config(Some(WorkloadIdentityConfig::default()/* use setters */));
14378    /// let x = ClusterUpdate::new().set_or_clear_desired_workload_identity_config(None::<WorkloadIdentityConfig>);
14379    /// ```
14380    pub fn set_or_clear_desired_workload_identity_config<T>(
14381        mut self,
14382        v: std::option::Option<T>,
14383    ) -> Self
14384    where
14385        T: std::convert::Into<crate::model::WorkloadIdentityConfig>,
14386    {
14387        self.desired_workload_identity_config = v.map(|x| x.into());
14388        self
14389    }
14390
14391    /// Sets the value of [desired_mesh_certificates][crate::model::ClusterUpdate::desired_mesh_certificates].
14392    ///
14393    /// # Example
14394    /// ```ignore,no_run
14395    /// # use google_cloud_container_v1::model::ClusterUpdate;
14396    /// use google_cloud_container_v1::model::MeshCertificates;
14397    /// let x = ClusterUpdate::new().set_desired_mesh_certificates(MeshCertificates::default()/* use setters */);
14398    /// ```
14399    pub fn set_desired_mesh_certificates<T>(mut self, v: T) -> Self
14400    where
14401        T: std::convert::Into<crate::model::MeshCertificates>,
14402    {
14403        self.desired_mesh_certificates = std::option::Option::Some(v.into());
14404        self
14405    }
14406
14407    /// Sets or clears the value of [desired_mesh_certificates][crate::model::ClusterUpdate::desired_mesh_certificates].
14408    ///
14409    /// # Example
14410    /// ```ignore,no_run
14411    /// # use google_cloud_container_v1::model::ClusterUpdate;
14412    /// use google_cloud_container_v1::model::MeshCertificates;
14413    /// let x = ClusterUpdate::new().set_or_clear_desired_mesh_certificates(Some(MeshCertificates::default()/* use setters */));
14414    /// let x = ClusterUpdate::new().set_or_clear_desired_mesh_certificates(None::<MeshCertificates>);
14415    /// ```
14416    pub fn set_or_clear_desired_mesh_certificates<T>(mut self, v: std::option::Option<T>) -> Self
14417    where
14418        T: std::convert::Into<crate::model::MeshCertificates>,
14419    {
14420        self.desired_mesh_certificates = v.map(|x| x.into());
14421        self
14422    }
14423
14424    /// Sets the value of [desired_shielded_nodes][crate::model::ClusterUpdate::desired_shielded_nodes].
14425    ///
14426    /// # Example
14427    /// ```ignore,no_run
14428    /// # use google_cloud_container_v1::model::ClusterUpdate;
14429    /// use google_cloud_container_v1::model::ShieldedNodes;
14430    /// let x = ClusterUpdate::new().set_desired_shielded_nodes(ShieldedNodes::default()/* use setters */);
14431    /// ```
14432    pub fn set_desired_shielded_nodes<T>(mut self, v: T) -> Self
14433    where
14434        T: std::convert::Into<crate::model::ShieldedNodes>,
14435    {
14436        self.desired_shielded_nodes = std::option::Option::Some(v.into());
14437        self
14438    }
14439
14440    /// Sets or clears the value of [desired_shielded_nodes][crate::model::ClusterUpdate::desired_shielded_nodes].
14441    ///
14442    /// # Example
14443    /// ```ignore,no_run
14444    /// # use google_cloud_container_v1::model::ClusterUpdate;
14445    /// use google_cloud_container_v1::model::ShieldedNodes;
14446    /// let x = ClusterUpdate::new().set_or_clear_desired_shielded_nodes(Some(ShieldedNodes::default()/* use setters */));
14447    /// let x = ClusterUpdate::new().set_or_clear_desired_shielded_nodes(None::<ShieldedNodes>);
14448    /// ```
14449    pub fn set_or_clear_desired_shielded_nodes<T>(mut self, v: std::option::Option<T>) -> Self
14450    where
14451        T: std::convert::Into<crate::model::ShieldedNodes>,
14452    {
14453        self.desired_shielded_nodes = v.map(|x| x.into());
14454        self
14455    }
14456
14457    /// Sets the value of [desired_cost_management_config][crate::model::ClusterUpdate::desired_cost_management_config].
14458    ///
14459    /// # Example
14460    /// ```ignore,no_run
14461    /// # use google_cloud_container_v1::model::ClusterUpdate;
14462    /// use google_cloud_container_v1::model::CostManagementConfig;
14463    /// let x = ClusterUpdate::new().set_desired_cost_management_config(CostManagementConfig::default()/* use setters */);
14464    /// ```
14465    pub fn set_desired_cost_management_config<T>(mut self, v: T) -> Self
14466    where
14467        T: std::convert::Into<crate::model::CostManagementConfig>,
14468    {
14469        self.desired_cost_management_config = std::option::Option::Some(v.into());
14470        self
14471    }
14472
14473    /// Sets or clears the value of [desired_cost_management_config][crate::model::ClusterUpdate::desired_cost_management_config].
14474    ///
14475    /// # Example
14476    /// ```ignore,no_run
14477    /// # use google_cloud_container_v1::model::ClusterUpdate;
14478    /// use google_cloud_container_v1::model::CostManagementConfig;
14479    /// let x = ClusterUpdate::new().set_or_clear_desired_cost_management_config(Some(CostManagementConfig::default()/* use setters */));
14480    /// let x = ClusterUpdate::new().set_or_clear_desired_cost_management_config(None::<CostManagementConfig>);
14481    /// ```
14482    pub fn set_or_clear_desired_cost_management_config<T>(
14483        mut self,
14484        v: std::option::Option<T>,
14485    ) -> Self
14486    where
14487        T: std::convert::Into<crate::model::CostManagementConfig>,
14488    {
14489        self.desired_cost_management_config = v.map(|x| x.into());
14490        self
14491    }
14492
14493    /// Sets the value of [desired_dns_config][crate::model::ClusterUpdate::desired_dns_config].
14494    ///
14495    /// # Example
14496    /// ```ignore,no_run
14497    /// # use google_cloud_container_v1::model::ClusterUpdate;
14498    /// use google_cloud_container_v1::model::DNSConfig;
14499    /// let x = ClusterUpdate::new().set_desired_dns_config(DNSConfig::default()/* use setters */);
14500    /// ```
14501    pub fn set_desired_dns_config<T>(mut self, v: T) -> Self
14502    where
14503        T: std::convert::Into<crate::model::DNSConfig>,
14504    {
14505        self.desired_dns_config = std::option::Option::Some(v.into());
14506        self
14507    }
14508
14509    /// Sets or clears the value of [desired_dns_config][crate::model::ClusterUpdate::desired_dns_config].
14510    ///
14511    /// # Example
14512    /// ```ignore,no_run
14513    /// # use google_cloud_container_v1::model::ClusterUpdate;
14514    /// use google_cloud_container_v1::model::DNSConfig;
14515    /// let x = ClusterUpdate::new().set_or_clear_desired_dns_config(Some(DNSConfig::default()/* use setters */));
14516    /// let x = ClusterUpdate::new().set_or_clear_desired_dns_config(None::<DNSConfig>);
14517    /// ```
14518    pub fn set_or_clear_desired_dns_config<T>(mut self, v: std::option::Option<T>) -> Self
14519    where
14520        T: std::convert::Into<crate::model::DNSConfig>,
14521    {
14522        self.desired_dns_config = v.map(|x| x.into());
14523        self
14524    }
14525
14526    /// Sets the value of [desired_node_pool_autoscaling][crate::model::ClusterUpdate::desired_node_pool_autoscaling].
14527    ///
14528    /// # Example
14529    /// ```ignore,no_run
14530    /// # use google_cloud_container_v1::model::ClusterUpdate;
14531    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
14532    /// let x = ClusterUpdate::new().set_desired_node_pool_autoscaling(NodePoolAutoscaling::default()/* use setters */);
14533    /// ```
14534    pub fn set_desired_node_pool_autoscaling<T>(mut self, v: T) -> Self
14535    where
14536        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
14537    {
14538        self.desired_node_pool_autoscaling = std::option::Option::Some(v.into());
14539        self
14540    }
14541
14542    /// Sets or clears the value of [desired_node_pool_autoscaling][crate::model::ClusterUpdate::desired_node_pool_autoscaling].
14543    ///
14544    /// # Example
14545    /// ```ignore,no_run
14546    /// # use google_cloud_container_v1::model::ClusterUpdate;
14547    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
14548    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
14549    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_autoscaling(None::<NodePoolAutoscaling>);
14550    /// ```
14551    pub fn set_or_clear_desired_node_pool_autoscaling<T>(
14552        mut self,
14553        v: std::option::Option<T>,
14554    ) -> Self
14555    where
14556        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
14557    {
14558        self.desired_node_pool_autoscaling = v.map(|x| x.into());
14559        self
14560    }
14561
14562    /// Sets the value of [desired_locations][crate::model::ClusterUpdate::desired_locations].
14563    ///
14564    /// # Example
14565    /// ```ignore,no_run
14566    /// # use google_cloud_container_v1::model::ClusterUpdate;
14567    /// let x = ClusterUpdate::new().set_desired_locations(["a", "b", "c"]);
14568    /// ```
14569    pub fn set_desired_locations<T, V>(mut self, v: T) -> Self
14570    where
14571        T: std::iter::IntoIterator<Item = V>,
14572        V: std::convert::Into<std::string::String>,
14573    {
14574        use std::iter::Iterator;
14575        self.desired_locations = v.into_iter().map(|i| i.into()).collect();
14576        self
14577    }
14578
14579    /// Sets the value of [desired_master_authorized_networks_config][crate::model::ClusterUpdate::desired_master_authorized_networks_config].
14580    ///
14581    /// # Example
14582    /// ```ignore,no_run
14583    /// # use google_cloud_container_v1::model::ClusterUpdate;
14584    /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
14585    /// let x = ClusterUpdate::new().set_desired_master_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
14586    /// ```
14587    #[deprecated]
14588    pub fn set_desired_master_authorized_networks_config<T>(mut self, v: T) -> Self
14589    where
14590        T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
14591    {
14592        self.desired_master_authorized_networks_config = std::option::Option::Some(v.into());
14593        self
14594    }
14595
14596    /// Sets or clears the value of [desired_master_authorized_networks_config][crate::model::ClusterUpdate::desired_master_authorized_networks_config].
14597    ///
14598    /// # Example
14599    /// ```ignore,no_run
14600    /// # use google_cloud_container_v1::model::ClusterUpdate;
14601    /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
14602    /// let x = ClusterUpdate::new().set_or_clear_desired_master_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
14603    /// let x = ClusterUpdate::new().set_or_clear_desired_master_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
14604    /// ```
14605    #[deprecated]
14606    pub fn set_or_clear_desired_master_authorized_networks_config<T>(
14607        mut self,
14608        v: std::option::Option<T>,
14609    ) -> Self
14610    where
14611        T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
14612    {
14613        self.desired_master_authorized_networks_config = v.map(|x| x.into());
14614        self
14615    }
14616
14617    /// Sets the value of [desired_cluster_autoscaling][crate::model::ClusterUpdate::desired_cluster_autoscaling].
14618    ///
14619    /// # Example
14620    /// ```ignore,no_run
14621    /// # use google_cloud_container_v1::model::ClusterUpdate;
14622    /// use google_cloud_container_v1::model::ClusterAutoscaling;
14623    /// let x = ClusterUpdate::new().set_desired_cluster_autoscaling(ClusterAutoscaling::default()/* use setters */);
14624    /// ```
14625    pub fn set_desired_cluster_autoscaling<T>(mut self, v: T) -> Self
14626    where
14627        T: std::convert::Into<crate::model::ClusterAutoscaling>,
14628    {
14629        self.desired_cluster_autoscaling = std::option::Option::Some(v.into());
14630        self
14631    }
14632
14633    /// Sets or clears the value of [desired_cluster_autoscaling][crate::model::ClusterUpdate::desired_cluster_autoscaling].
14634    ///
14635    /// # Example
14636    /// ```ignore,no_run
14637    /// # use google_cloud_container_v1::model::ClusterUpdate;
14638    /// use google_cloud_container_v1::model::ClusterAutoscaling;
14639    /// let x = ClusterUpdate::new().set_or_clear_desired_cluster_autoscaling(Some(ClusterAutoscaling::default()/* use setters */));
14640    /// let x = ClusterUpdate::new().set_or_clear_desired_cluster_autoscaling(None::<ClusterAutoscaling>);
14641    /// ```
14642    pub fn set_or_clear_desired_cluster_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
14643    where
14644        T: std::convert::Into<crate::model::ClusterAutoscaling>,
14645    {
14646        self.desired_cluster_autoscaling = v.map(|x| x.into());
14647        self
14648    }
14649
14650    /// Sets the value of [desired_binary_authorization][crate::model::ClusterUpdate::desired_binary_authorization].
14651    ///
14652    /// # Example
14653    /// ```ignore,no_run
14654    /// # use google_cloud_container_v1::model::ClusterUpdate;
14655    /// use google_cloud_container_v1::model::BinaryAuthorization;
14656    /// let x = ClusterUpdate::new().set_desired_binary_authorization(BinaryAuthorization::default()/* use setters */);
14657    /// ```
14658    pub fn set_desired_binary_authorization<T>(mut self, v: T) -> Self
14659    where
14660        T: std::convert::Into<crate::model::BinaryAuthorization>,
14661    {
14662        self.desired_binary_authorization = std::option::Option::Some(v.into());
14663        self
14664    }
14665
14666    /// Sets or clears the value of [desired_binary_authorization][crate::model::ClusterUpdate::desired_binary_authorization].
14667    ///
14668    /// # Example
14669    /// ```ignore,no_run
14670    /// # use google_cloud_container_v1::model::ClusterUpdate;
14671    /// use google_cloud_container_v1::model::BinaryAuthorization;
14672    /// let x = ClusterUpdate::new().set_or_clear_desired_binary_authorization(Some(BinaryAuthorization::default()/* use setters */));
14673    /// let x = ClusterUpdate::new().set_or_clear_desired_binary_authorization(None::<BinaryAuthorization>);
14674    /// ```
14675    pub fn set_or_clear_desired_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
14676    where
14677        T: std::convert::Into<crate::model::BinaryAuthorization>,
14678    {
14679        self.desired_binary_authorization = v.map(|x| x.into());
14680        self
14681    }
14682
14683    /// Sets the value of [desired_logging_service][crate::model::ClusterUpdate::desired_logging_service].
14684    ///
14685    /// # Example
14686    /// ```ignore,no_run
14687    /// # use google_cloud_container_v1::model::ClusterUpdate;
14688    /// let x = ClusterUpdate::new().set_desired_logging_service("example");
14689    /// ```
14690    pub fn set_desired_logging_service<T: std::convert::Into<std::string::String>>(
14691        mut self,
14692        v: T,
14693    ) -> Self {
14694        self.desired_logging_service = v.into();
14695        self
14696    }
14697
14698    /// Sets the value of [desired_resource_usage_export_config][crate::model::ClusterUpdate::desired_resource_usage_export_config].
14699    ///
14700    /// # Example
14701    /// ```ignore,no_run
14702    /// # use google_cloud_container_v1::model::ClusterUpdate;
14703    /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
14704    /// let x = ClusterUpdate::new().set_desired_resource_usage_export_config(ResourceUsageExportConfig::default()/* use setters */);
14705    /// ```
14706    pub fn set_desired_resource_usage_export_config<T>(mut self, v: T) -> Self
14707    where
14708        T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
14709    {
14710        self.desired_resource_usage_export_config = std::option::Option::Some(v.into());
14711        self
14712    }
14713
14714    /// Sets or clears the value of [desired_resource_usage_export_config][crate::model::ClusterUpdate::desired_resource_usage_export_config].
14715    ///
14716    /// # Example
14717    /// ```ignore,no_run
14718    /// # use google_cloud_container_v1::model::ClusterUpdate;
14719    /// use google_cloud_container_v1::model::ResourceUsageExportConfig;
14720    /// let x = ClusterUpdate::new().set_or_clear_desired_resource_usage_export_config(Some(ResourceUsageExportConfig::default()/* use setters */));
14721    /// let x = ClusterUpdate::new().set_or_clear_desired_resource_usage_export_config(None::<ResourceUsageExportConfig>);
14722    /// ```
14723    pub fn set_or_clear_desired_resource_usage_export_config<T>(
14724        mut self,
14725        v: std::option::Option<T>,
14726    ) -> Self
14727    where
14728        T: std::convert::Into<crate::model::ResourceUsageExportConfig>,
14729    {
14730        self.desired_resource_usage_export_config = v.map(|x| x.into());
14731        self
14732    }
14733
14734    /// Sets the value of [desired_vertical_pod_autoscaling][crate::model::ClusterUpdate::desired_vertical_pod_autoscaling].
14735    ///
14736    /// # Example
14737    /// ```ignore,no_run
14738    /// # use google_cloud_container_v1::model::ClusterUpdate;
14739    /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
14740    /// let x = ClusterUpdate::new().set_desired_vertical_pod_autoscaling(VerticalPodAutoscaling::default()/* use setters */);
14741    /// ```
14742    pub fn set_desired_vertical_pod_autoscaling<T>(mut self, v: T) -> Self
14743    where
14744        T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
14745    {
14746        self.desired_vertical_pod_autoscaling = std::option::Option::Some(v.into());
14747        self
14748    }
14749
14750    /// Sets or clears the value of [desired_vertical_pod_autoscaling][crate::model::ClusterUpdate::desired_vertical_pod_autoscaling].
14751    ///
14752    /// # Example
14753    /// ```ignore,no_run
14754    /// # use google_cloud_container_v1::model::ClusterUpdate;
14755    /// use google_cloud_container_v1::model::VerticalPodAutoscaling;
14756    /// let x = ClusterUpdate::new().set_or_clear_desired_vertical_pod_autoscaling(Some(VerticalPodAutoscaling::default()/* use setters */));
14757    /// let x = ClusterUpdate::new().set_or_clear_desired_vertical_pod_autoscaling(None::<VerticalPodAutoscaling>);
14758    /// ```
14759    pub fn set_or_clear_desired_vertical_pod_autoscaling<T>(
14760        mut self,
14761        v: std::option::Option<T>,
14762    ) -> Self
14763    where
14764        T: std::convert::Into<crate::model::VerticalPodAutoscaling>,
14765    {
14766        self.desired_vertical_pod_autoscaling = v.map(|x| x.into());
14767        self
14768    }
14769
14770    /// Sets the value of [desired_private_cluster_config][crate::model::ClusterUpdate::desired_private_cluster_config].
14771    ///
14772    /// # Example
14773    /// ```ignore,no_run
14774    /// # use google_cloud_container_v1::model::ClusterUpdate;
14775    /// use google_cloud_container_v1::model::PrivateClusterConfig;
14776    /// let x = ClusterUpdate::new().set_desired_private_cluster_config(PrivateClusterConfig::default()/* use setters */);
14777    /// ```
14778    #[deprecated]
14779    pub fn set_desired_private_cluster_config<T>(mut self, v: T) -> Self
14780    where
14781        T: std::convert::Into<crate::model::PrivateClusterConfig>,
14782    {
14783        self.desired_private_cluster_config = std::option::Option::Some(v.into());
14784        self
14785    }
14786
14787    /// Sets or clears the value of [desired_private_cluster_config][crate::model::ClusterUpdate::desired_private_cluster_config].
14788    ///
14789    /// # Example
14790    /// ```ignore,no_run
14791    /// # use google_cloud_container_v1::model::ClusterUpdate;
14792    /// use google_cloud_container_v1::model::PrivateClusterConfig;
14793    /// let x = ClusterUpdate::new().set_or_clear_desired_private_cluster_config(Some(PrivateClusterConfig::default()/* use setters */));
14794    /// let x = ClusterUpdate::new().set_or_clear_desired_private_cluster_config(None::<PrivateClusterConfig>);
14795    /// ```
14796    #[deprecated]
14797    pub fn set_or_clear_desired_private_cluster_config<T>(
14798        mut self,
14799        v: std::option::Option<T>,
14800    ) -> Self
14801    where
14802        T: std::convert::Into<crate::model::PrivateClusterConfig>,
14803    {
14804        self.desired_private_cluster_config = v.map(|x| x.into());
14805        self
14806    }
14807
14808    /// Sets the value of [desired_intra_node_visibility_config][crate::model::ClusterUpdate::desired_intra_node_visibility_config].
14809    ///
14810    /// # Example
14811    /// ```ignore,no_run
14812    /// # use google_cloud_container_v1::model::ClusterUpdate;
14813    /// use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
14814    /// let x = ClusterUpdate::new().set_desired_intra_node_visibility_config(IntraNodeVisibilityConfig::default()/* use setters */);
14815    /// ```
14816    pub fn set_desired_intra_node_visibility_config<T>(mut self, v: T) -> Self
14817    where
14818        T: std::convert::Into<crate::model::IntraNodeVisibilityConfig>,
14819    {
14820        self.desired_intra_node_visibility_config = std::option::Option::Some(v.into());
14821        self
14822    }
14823
14824    /// Sets or clears the value of [desired_intra_node_visibility_config][crate::model::ClusterUpdate::desired_intra_node_visibility_config].
14825    ///
14826    /// # Example
14827    /// ```ignore,no_run
14828    /// # use google_cloud_container_v1::model::ClusterUpdate;
14829    /// use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
14830    /// let x = ClusterUpdate::new().set_or_clear_desired_intra_node_visibility_config(Some(IntraNodeVisibilityConfig::default()/* use setters */));
14831    /// let x = ClusterUpdate::new().set_or_clear_desired_intra_node_visibility_config(None::<IntraNodeVisibilityConfig>);
14832    /// ```
14833    pub fn set_or_clear_desired_intra_node_visibility_config<T>(
14834        mut self,
14835        v: std::option::Option<T>,
14836    ) -> Self
14837    where
14838        T: std::convert::Into<crate::model::IntraNodeVisibilityConfig>,
14839    {
14840        self.desired_intra_node_visibility_config = v.map(|x| x.into());
14841        self
14842    }
14843
14844    /// Sets the value of [desired_default_snat_status][crate::model::ClusterUpdate::desired_default_snat_status].
14845    ///
14846    /// # Example
14847    /// ```ignore,no_run
14848    /// # use google_cloud_container_v1::model::ClusterUpdate;
14849    /// use google_cloud_container_v1::model::DefaultSnatStatus;
14850    /// let x = ClusterUpdate::new().set_desired_default_snat_status(DefaultSnatStatus::default()/* use setters */);
14851    /// ```
14852    pub fn set_desired_default_snat_status<T>(mut self, v: T) -> Self
14853    where
14854        T: std::convert::Into<crate::model::DefaultSnatStatus>,
14855    {
14856        self.desired_default_snat_status = std::option::Option::Some(v.into());
14857        self
14858    }
14859
14860    /// Sets or clears the value of [desired_default_snat_status][crate::model::ClusterUpdate::desired_default_snat_status].
14861    ///
14862    /// # Example
14863    /// ```ignore,no_run
14864    /// # use google_cloud_container_v1::model::ClusterUpdate;
14865    /// use google_cloud_container_v1::model::DefaultSnatStatus;
14866    /// let x = ClusterUpdate::new().set_or_clear_desired_default_snat_status(Some(DefaultSnatStatus::default()/* use setters */));
14867    /// let x = ClusterUpdate::new().set_or_clear_desired_default_snat_status(None::<DefaultSnatStatus>);
14868    /// ```
14869    pub fn set_or_clear_desired_default_snat_status<T>(mut self, v: std::option::Option<T>) -> Self
14870    where
14871        T: std::convert::Into<crate::model::DefaultSnatStatus>,
14872    {
14873        self.desired_default_snat_status = v.map(|x| x.into());
14874        self
14875    }
14876
14877    /// Sets the value of [desired_release_channel][crate::model::ClusterUpdate::desired_release_channel].
14878    ///
14879    /// # Example
14880    /// ```ignore,no_run
14881    /// # use google_cloud_container_v1::model::ClusterUpdate;
14882    /// use google_cloud_container_v1::model::ReleaseChannel;
14883    /// let x = ClusterUpdate::new().set_desired_release_channel(ReleaseChannel::default()/* use setters */);
14884    /// ```
14885    pub fn set_desired_release_channel<T>(mut self, v: T) -> Self
14886    where
14887        T: std::convert::Into<crate::model::ReleaseChannel>,
14888    {
14889        self.desired_release_channel = std::option::Option::Some(v.into());
14890        self
14891    }
14892
14893    /// Sets or clears the value of [desired_release_channel][crate::model::ClusterUpdate::desired_release_channel].
14894    ///
14895    /// # Example
14896    /// ```ignore,no_run
14897    /// # use google_cloud_container_v1::model::ClusterUpdate;
14898    /// use google_cloud_container_v1::model::ReleaseChannel;
14899    /// let x = ClusterUpdate::new().set_or_clear_desired_release_channel(Some(ReleaseChannel::default()/* use setters */));
14900    /// let x = ClusterUpdate::new().set_or_clear_desired_release_channel(None::<ReleaseChannel>);
14901    /// ```
14902    pub fn set_or_clear_desired_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
14903    where
14904        T: std::convert::Into<crate::model::ReleaseChannel>,
14905    {
14906        self.desired_release_channel = v.map(|x| x.into());
14907        self
14908    }
14909
14910    /// Sets the value of [desired_l4ilb_subsetting_config][crate::model::ClusterUpdate::desired_l4ilb_subsetting_config].
14911    ///
14912    /// # Example
14913    /// ```ignore,no_run
14914    /// # use google_cloud_container_v1::model::ClusterUpdate;
14915    /// use google_cloud_container_v1::model::ILBSubsettingConfig;
14916    /// let x = ClusterUpdate::new().set_desired_l4ilb_subsetting_config(ILBSubsettingConfig::default()/* use setters */);
14917    /// ```
14918    pub fn set_desired_l4ilb_subsetting_config<T>(mut self, v: T) -> Self
14919    where
14920        T: std::convert::Into<crate::model::ILBSubsettingConfig>,
14921    {
14922        self.desired_l4ilb_subsetting_config = std::option::Option::Some(v.into());
14923        self
14924    }
14925
14926    /// Sets or clears the value of [desired_l4ilb_subsetting_config][crate::model::ClusterUpdate::desired_l4ilb_subsetting_config].
14927    ///
14928    /// # Example
14929    /// ```ignore,no_run
14930    /// # use google_cloud_container_v1::model::ClusterUpdate;
14931    /// use google_cloud_container_v1::model::ILBSubsettingConfig;
14932    /// let x = ClusterUpdate::new().set_or_clear_desired_l4ilb_subsetting_config(Some(ILBSubsettingConfig::default()/* use setters */));
14933    /// let x = ClusterUpdate::new().set_or_clear_desired_l4ilb_subsetting_config(None::<ILBSubsettingConfig>);
14934    /// ```
14935    pub fn set_or_clear_desired_l4ilb_subsetting_config<T>(
14936        mut self,
14937        v: std::option::Option<T>,
14938    ) -> Self
14939    where
14940        T: std::convert::Into<crate::model::ILBSubsettingConfig>,
14941    {
14942        self.desired_l4ilb_subsetting_config = v.map(|x| x.into());
14943        self
14944    }
14945
14946    /// Sets the value of [desired_datapath_provider][crate::model::ClusterUpdate::desired_datapath_provider].
14947    ///
14948    /// # Example
14949    /// ```ignore,no_run
14950    /// # use google_cloud_container_v1::model::ClusterUpdate;
14951    /// use google_cloud_container_v1::model::DatapathProvider;
14952    /// let x0 = ClusterUpdate::new().set_desired_datapath_provider(DatapathProvider::LegacyDatapath);
14953    /// let x1 = ClusterUpdate::new().set_desired_datapath_provider(DatapathProvider::AdvancedDatapath);
14954    /// ```
14955    pub fn set_desired_datapath_provider<T: std::convert::Into<crate::model::DatapathProvider>>(
14956        mut self,
14957        v: T,
14958    ) -> Self {
14959        self.desired_datapath_provider = v.into();
14960        self
14961    }
14962
14963    /// Sets the value of [desired_private_ipv6_google_access][crate::model::ClusterUpdate::desired_private_ipv6_google_access].
14964    ///
14965    /// # Example
14966    /// ```ignore,no_run
14967    /// # use google_cloud_container_v1::model::ClusterUpdate;
14968    /// use google_cloud_container_v1::model::PrivateIPv6GoogleAccess;
14969    /// let x0 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessDisabled);
14970    /// let x1 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessToGoogle);
14971    /// let x2 = ClusterUpdate::new().set_desired_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessBidirectional);
14972    /// ```
14973    pub fn set_desired_private_ipv6_google_access<
14974        T: std::convert::Into<crate::model::PrivateIPv6GoogleAccess>,
14975    >(
14976        mut self,
14977        v: T,
14978    ) -> Self {
14979        self.desired_private_ipv6_google_access = v.into();
14980        self
14981    }
14982
14983    /// Sets the value of [desired_notification_config][crate::model::ClusterUpdate::desired_notification_config].
14984    ///
14985    /// # Example
14986    /// ```ignore,no_run
14987    /// # use google_cloud_container_v1::model::ClusterUpdate;
14988    /// use google_cloud_container_v1::model::NotificationConfig;
14989    /// let x = ClusterUpdate::new().set_desired_notification_config(NotificationConfig::default()/* use setters */);
14990    /// ```
14991    pub fn set_desired_notification_config<T>(mut self, v: T) -> Self
14992    where
14993        T: std::convert::Into<crate::model::NotificationConfig>,
14994    {
14995        self.desired_notification_config = std::option::Option::Some(v.into());
14996        self
14997    }
14998
14999    /// Sets or clears the value of [desired_notification_config][crate::model::ClusterUpdate::desired_notification_config].
15000    ///
15001    /// # Example
15002    /// ```ignore,no_run
15003    /// # use google_cloud_container_v1::model::ClusterUpdate;
15004    /// use google_cloud_container_v1::model::NotificationConfig;
15005    /// let x = ClusterUpdate::new().set_or_clear_desired_notification_config(Some(NotificationConfig::default()/* use setters */));
15006    /// let x = ClusterUpdate::new().set_or_clear_desired_notification_config(None::<NotificationConfig>);
15007    /// ```
15008    pub fn set_or_clear_desired_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
15009    where
15010        T: std::convert::Into<crate::model::NotificationConfig>,
15011    {
15012        self.desired_notification_config = v.map(|x| x.into());
15013        self
15014    }
15015
15016    /// Sets the value of [desired_authenticator_groups_config][crate::model::ClusterUpdate::desired_authenticator_groups_config].
15017    ///
15018    /// # Example
15019    /// ```ignore,no_run
15020    /// # use google_cloud_container_v1::model::ClusterUpdate;
15021    /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
15022    /// let x = ClusterUpdate::new().set_desired_authenticator_groups_config(AuthenticatorGroupsConfig::default()/* use setters */);
15023    /// ```
15024    pub fn set_desired_authenticator_groups_config<T>(mut self, v: T) -> Self
15025    where
15026        T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
15027    {
15028        self.desired_authenticator_groups_config = std::option::Option::Some(v.into());
15029        self
15030    }
15031
15032    /// Sets or clears the value of [desired_authenticator_groups_config][crate::model::ClusterUpdate::desired_authenticator_groups_config].
15033    ///
15034    /// # Example
15035    /// ```ignore,no_run
15036    /// # use google_cloud_container_v1::model::ClusterUpdate;
15037    /// use google_cloud_container_v1::model::AuthenticatorGroupsConfig;
15038    /// let x = ClusterUpdate::new().set_or_clear_desired_authenticator_groups_config(Some(AuthenticatorGroupsConfig::default()/* use setters */));
15039    /// let x = ClusterUpdate::new().set_or_clear_desired_authenticator_groups_config(None::<AuthenticatorGroupsConfig>);
15040    /// ```
15041    pub fn set_or_clear_desired_authenticator_groups_config<T>(
15042        mut self,
15043        v: std::option::Option<T>,
15044    ) -> Self
15045    where
15046        T: std::convert::Into<crate::model::AuthenticatorGroupsConfig>,
15047    {
15048        self.desired_authenticator_groups_config = v.map(|x| x.into());
15049        self
15050    }
15051
15052    /// Sets the value of [desired_logging_config][crate::model::ClusterUpdate::desired_logging_config].
15053    ///
15054    /// # Example
15055    /// ```ignore,no_run
15056    /// # use google_cloud_container_v1::model::ClusterUpdate;
15057    /// use google_cloud_container_v1::model::LoggingConfig;
15058    /// let x = ClusterUpdate::new().set_desired_logging_config(LoggingConfig::default()/* use setters */);
15059    /// ```
15060    pub fn set_desired_logging_config<T>(mut self, v: T) -> Self
15061    where
15062        T: std::convert::Into<crate::model::LoggingConfig>,
15063    {
15064        self.desired_logging_config = std::option::Option::Some(v.into());
15065        self
15066    }
15067
15068    /// Sets or clears the value of [desired_logging_config][crate::model::ClusterUpdate::desired_logging_config].
15069    ///
15070    /// # Example
15071    /// ```ignore,no_run
15072    /// # use google_cloud_container_v1::model::ClusterUpdate;
15073    /// use google_cloud_container_v1::model::LoggingConfig;
15074    /// let x = ClusterUpdate::new().set_or_clear_desired_logging_config(Some(LoggingConfig::default()/* use setters */));
15075    /// let x = ClusterUpdate::new().set_or_clear_desired_logging_config(None::<LoggingConfig>);
15076    /// ```
15077    pub fn set_or_clear_desired_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
15078    where
15079        T: std::convert::Into<crate::model::LoggingConfig>,
15080    {
15081        self.desired_logging_config = v.map(|x| x.into());
15082        self
15083    }
15084
15085    /// Sets the value of [desired_monitoring_config][crate::model::ClusterUpdate::desired_monitoring_config].
15086    ///
15087    /// # Example
15088    /// ```ignore,no_run
15089    /// # use google_cloud_container_v1::model::ClusterUpdate;
15090    /// use google_cloud_container_v1::model::MonitoringConfig;
15091    /// let x = ClusterUpdate::new().set_desired_monitoring_config(MonitoringConfig::default()/* use setters */);
15092    /// ```
15093    pub fn set_desired_monitoring_config<T>(mut self, v: T) -> Self
15094    where
15095        T: std::convert::Into<crate::model::MonitoringConfig>,
15096    {
15097        self.desired_monitoring_config = std::option::Option::Some(v.into());
15098        self
15099    }
15100
15101    /// Sets or clears the value of [desired_monitoring_config][crate::model::ClusterUpdate::desired_monitoring_config].
15102    ///
15103    /// # Example
15104    /// ```ignore,no_run
15105    /// # use google_cloud_container_v1::model::ClusterUpdate;
15106    /// use google_cloud_container_v1::model::MonitoringConfig;
15107    /// let x = ClusterUpdate::new().set_or_clear_desired_monitoring_config(Some(MonitoringConfig::default()/* use setters */));
15108    /// let x = ClusterUpdate::new().set_or_clear_desired_monitoring_config(None::<MonitoringConfig>);
15109    /// ```
15110    pub fn set_or_clear_desired_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
15111    where
15112        T: std::convert::Into<crate::model::MonitoringConfig>,
15113    {
15114        self.desired_monitoring_config = v.map(|x| x.into());
15115        self
15116    }
15117
15118    /// Sets the value of [desired_identity_service_config][crate::model::ClusterUpdate::desired_identity_service_config].
15119    ///
15120    /// # Example
15121    /// ```ignore,no_run
15122    /// # use google_cloud_container_v1::model::ClusterUpdate;
15123    /// use google_cloud_container_v1::model::IdentityServiceConfig;
15124    /// let x = ClusterUpdate::new().set_desired_identity_service_config(IdentityServiceConfig::default()/* use setters */);
15125    /// ```
15126    pub fn set_desired_identity_service_config<T>(mut self, v: T) -> Self
15127    where
15128        T: std::convert::Into<crate::model::IdentityServiceConfig>,
15129    {
15130        self.desired_identity_service_config = std::option::Option::Some(v.into());
15131        self
15132    }
15133
15134    /// Sets or clears the value of [desired_identity_service_config][crate::model::ClusterUpdate::desired_identity_service_config].
15135    ///
15136    /// # Example
15137    /// ```ignore,no_run
15138    /// # use google_cloud_container_v1::model::ClusterUpdate;
15139    /// use google_cloud_container_v1::model::IdentityServiceConfig;
15140    /// let x = ClusterUpdate::new().set_or_clear_desired_identity_service_config(Some(IdentityServiceConfig::default()/* use setters */));
15141    /// let x = ClusterUpdate::new().set_or_clear_desired_identity_service_config(None::<IdentityServiceConfig>);
15142    /// ```
15143    pub fn set_or_clear_desired_identity_service_config<T>(
15144        mut self,
15145        v: std::option::Option<T>,
15146    ) -> Self
15147    where
15148        T: std::convert::Into<crate::model::IdentityServiceConfig>,
15149    {
15150        self.desired_identity_service_config = v.map(|x| x.into());
15151        self
15152    }
15153
15154    /// Sets the value of [desired_service_external_ips_config][crate::model::ClusterUpdate::desired_service_external_ips_config].
15155    ///
15156    /// # Example
15157    /// ```ignore,no_run
15158    /// # use google_cloud_container_v1::model::ClusterUpdate;
15159    /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
15160    /// let x = ClusterUpdate::new().set_desired_service_external_ips_config(ServiceExternalIPsConfig::default()/* use setters */);
15161    /// ```
15162    pub fn set_desired_service_external_ips_config<T>(mut self, v: T) -> Self
15163    where
15164        T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
15165    {
15166        self.desired_service_external_ips_config = std::option::Option::Some(v.into());
15167        self
15168    }
15169
15170    /// Sets or clears the value of [desired_service_external_ips_config][crate::model::ClusterUpdate::desired_service_external_ips_config].
15171    ///
15172    /// # Example
15173    /// ```ignore,no_run
15174    /// # use google_cloud_container_v1::model::ClusterUpdate;
15175    /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
15176    /// let x = ClusterUpdate::new().set_or_clear_desired_service_external_ips_config(Some(ServiceExternalIPsConfig::default()/* use setters */));
15177    /// let x = ClusterUpdate::new().set_or_clear_desired_service_external_ips_config(None::<ServiceExternalIPsConfig>);
15178    /// ```
15179    pub fn set_or_clear_desired_service_external_ips_config<T>(
15180        mut self,
15181        v: std::option::Option<T>,
15182    ) -> Self
15183    where
15184        T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
15185    {
15186        self.desired_service_external_ips_config = v.map(|x| x.into());
15187        self
15188    }
15189
15190    /// Sets the value of [desired_enable_private_endpoint][crate::model::ClusterUpdate::desired_enable_private_endpoint].
15191    ///
15192    /// # Example
15193    /// ```ignore,no_run
15194    /// # use google_cloud_container_v1::model::ClusterUpdate;
15195    /// let x = ClusterUpdate::new().set_desired_enable_private_endpoint(true);
15196    /// ```
15197    #[deprecated]
15198    pub fn set_desired_enable_private_endpoint<T>(mut self, v: T) -> Self
15199    where
15200        T: std::convert::Into<bool>,
15201    {
15202        self.desired_enable_private_endpoint = std::option::Option::Some(v.into());
15203        self
15204    }
15205
15206    /// Sets or clears the value of [desired_enable_private_endpoint][crate::model::ClusterUpdate::desired_enable_private_endpoint].
15207    ///
15208    /// # Example
15209    /// ```ignore,no_run
15210    /// # use google_cloud_container_v1::model::ClusterUpdate;
15211    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_private_endpoint(Some(false));
15212    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_private_endpoint(None::<bool>);
15213    /// ```
15214    #[deprecated]
15215    pub fn set_or_clear_desired_enable_private_endpoint<T>(
15216        mut self,
15217        v: std::option::Option<T>,
15218    ) -> Self
15219    where
15220        T: std::convert::Into<bool>,
15221    {
15222        self.desired_enable_private_endpoint = v.map(|x| x.into());
15223        self
15224    }
15225
15226    /// Sets the value of [desired_default_enable_private_nodes][crate::model::ClusterUpdate::desired_default_enable_private_nodes].
15227    ///
15228    /// # Example
15229    /// ```ignore,no_run
15230    /// # use google_cloud_container_v1::model::ClusterUpdate;
15231    /// let x = ClusterUpdate::new().set_desired_default_enable_private_nodes(true);
15232    /// ```
15233    pub fn set_desired_default_enable_private_nodes<T>(mut self, v: T) -> Self
15234    where
15235        T: std::convert::Into<bool>,
15236    {
15237        self.desired_default_enable_private_nodes = std::option::Option::Some(v.into());
15238        self
15239    }
15240
15241    /// Sets or clears the value of [desired_default_enable_private_nodes][crate::model::ClusterUpdate::desired_default_enable_private_nodes].
15242    ///
15243    /// # Example
15244    /// ```ignore,no_run
15245    /// # use google_cloud_container_v1::model::ClusterUpdate;
15246    /// let x = ClusterUpdate::new().set_or_clear_desired_default_enable_private_nodes(Some(false));
15247    /// let x = ClusterUpdate::new().set_or_clear_desired_default_enable_private_nodes(None::<bool>);
15248    /// ```
15249    pub fn set_or_clear_desired_default_enable_private_nodes<T>(
15250        mut self,
15251        v: std::option::Option<T>,
15252    ) -> Self
15253    where
15254        T: std::convert::Into<bool>,
15255    {
15256        self.desired_default_enable_private_nodes = v.map(|x| x.into());
15257        self
15258    }
15259
15260    /// Sets the value of [desired_control_plane_endpoints_config][crate::model::ClusterUpdate::desired_control_plane_endpoints_config].
15261    ///
15262    /// # Example
15263    /// ```ignore,no_run
15264    /// # use google_cloud_container_v1::model::ClusterUpdate;
15265    /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
15266    /// let x = ClusterUpdate::new().set_desired_control_plane_endpoints_config(ControlPlaneEndpointsConfig::default()/* use setters */);
15267    /// ```
15268    pub fn set_desired_control_plane_endpoints_config<T>(mut self, v: T) -> Self
15269    where
15270        T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
15271    {
15272        self.desired_control_plane_endpoints_config = std::option::Option::Some(v.into());
15273        self
15274    }
15275
15276    /// Sets or clears the value of [desired_control_plane_endpoints_config][crate::model::ClusterUpdate::desired_control_plane_endpoints_config].
15277    ///
15278    /// # Example
15279    /// ```ignore,no_run
15280    /// # use google_cloud_container_v1::model::ClusterUpdate;
15281    /// use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
15282    /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_endpoints_config(Some(ControlPlaneEndpointsConfig::default()/* use setters */));
15283    /// let x = ClusterUpdate::new().set_or_clear_desired_control_plane_endpoints_config(None::<ControlPlaneEndpointsConfig>);
15284    /// ```
15285    pub fn set_or_clear_desired_control_plane_endpoints_config<T>(
15286        mut self,
15287        v: std::option::Option<T>,
15288    ) -> Self
15289    where
15290        T: std::convert::Into<crate::model::ControlPlaneEndpointsConfig>,
15291    {
15292        self.desired_control_plane_endpoints_config = v.map(|x| x.into());
15293        self
15294    }
15295
15296    /// Sets the value of [desired_master_version][crate::model::ClusterUpdate::desired_master_version].
15297    ///
15298    /// # Example
15299    /// ```ignore,no_run
15300    /// # use google_cloud_container_v1::model::ClusterUpdate;
15301    /// let x = ClusterUpdate::new().set_desired_master_version("example");
15302    /// ```
15303    pub fn set_desired_master_version<T: std::convert::Into<std::string::String>>(
15304        mut self,
15305        v: T,
15306    ) -> Self {
15307        self.desired_master_version = v.into();
15308        self
15309    }
15310
15311    /// Sets the value of [desired_gcfs_config][crate::model::ClusterUpdate::desired_gcfs_config].
15312    ///
15313    /// # Example
15314    /// ```ignore,no_run
15315    /// # use google_cloud_container_v1::model::ClusterUpdate;
15316    /// use google_cloud_container_v1::model::GcfsConfig;
15317    /// let x = ClusterUpdate::new().set_desired_gcfs_config(GcfsConfig::default()/* use setters */);
15318    /// ```
15319    pub fn set_desired_gcfs_config<T>(mut self, v: T) -> Self
15320    where
15321        T: std::convert::Into<crate::model::GcfsConfig>,
15322    {
15323        self.desired_gcfs_config = std::option::Option::Some(v.into());
15324        self
15325    }
15326
15327    /// Sets or clears the value of [desired_gcfs_config][crate::model::ClusterUpdate::desired_gcfs_config].
15328    ///
15329    /// # Example
15330    /// ```ignore,no_run
15331    /// # use google_cloud_container_v1::model::ClusterUpdate;
15332    /// use google_cloud_container_v1::model::GcfsConfig;
15333    /// let x = ClusterUpdate::new().set_or_clear_desired_gcfs_config(Some(GcfsConfig::default()/* use setters */));
15334    /// let x = ClusterUpdate::new().set_or_clear_desired_gcfs_config(None::<GcfsConfig>);
15335    /// ```
15336    pub fn set_or_clear_desired_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
15337    where
15338        T: std::convert::Into<crate::model::GcfsConfig>,
15339    {
15340        self.desired_gcfs_config = v.map(|x| x.into());
15341        self
15342    }
15343
15344    /// Sets the value of [desired_node_pool_auto_config_network_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_network_tags].
15345    ///
15346    /// # Example
15347    /// ```ignore,no_run
15348    /// # use google_cloud_container_v1::model::ClusterUpdate;
15349    /// use google_cloud_container_v1::model::NetworkTags;
15350    /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_network_tags(NetworkTags::default()/* use setters */);
15351    /// ```
15352    pub fn set_desired_node_pool_auto_config_network_tags<T>(mut self, v: T) -> Self
15353    where
15354        T: std::convert::Into<crate::model::NetworkTags>,
15355    {
15356        self.desired_node_pool_auto_config_network_tags = std::option::Option::Some(v.into());
15357        self
15358    }
15359
15360    /// Sets or clears the value of [desired_node_pool_auto_config_network_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_network_tags].
15361    ///
15362    /// # Example
15363    /// ```ignore,no_run
15364    /// # use google_cloud_container_v1::model::ClusterUpdate;
15365    /// use google_cloud_container_v1::model::NetworkTags;
15366    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_network_tags(Some(NetworkTags::default()/* use setters */));
15367    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_network_tags(None::<NetworkTags>);
15368    /// ```
15369    pub fn set_or_clear_desired_node_pool_auto_config_network_tags<T>(
15370        mut self,
15371        v: std::option::Option<T>,
15372    ) -> Self
15373    where
15374        T: std::convert::Into<crate::model::NetworkTags>,
15375    {
15376        self.desired_node_pool_auto_config_network_tags = v.map(|x| x.into());
15377        self
15378    }
15379
15380    /// Sets the value of [desired_pod_autoscaling][crate::model::ClusterUpdate::desired_pod_autoscaling].
15381    ///
15382    /// # Example
15383    /// ```ignore,no_run
15384    /// # use google_cloud_container_v1::model::ClusterUpdate;
15385    /// use google_cloud_container_v1::model::PodAutoscaling;
15386    /// let x = ClusterUpdate::new().set_desired_pod_autoscaling(PodAutoscaling::default()/* use setters */);
15387    /// ```
15388    pub fn set_desired_pod_autoscaling<T>(mut self, v: T) -> Self
15389    where
15390        T: std::convert::Into<crate::model::PodAutoscaling>,
15391    {
15392        self.desired_pod_autoscaling = std::option::Option::Some(v.into());
15393        self
15394    }
15395
15396    /// Sets or clears the value of [desired_pod_autoscaling][crate::model::ClusterUpdate::desired_pod_autoscaling].
15397    ///
15398    /// # Example
15399    /// ```ignore,no_run
15400    /// # use google_cloud_container_v1::model::ClusterUpdate;
15401    /// use google_cloud_container_v1::model::PodAutoscaling;
15402    /// let x = ClusterUpdate::new().set_or_clear_desired_pod_autoscaling(Some(PodAutoscaling::default()/* use setters */));
15403    /// let x = ClusterUpdate::new().set_or_clear_desired_pod_autoscaling(None::<PodAutoscaling>);
15404    /// ```
15405    pub fn set_or_clear_desired_pod_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
15406    where
15407        T: std::convert::Into<crate::model::PodAutoscaling>,
15408    {
15409        self.desired_pod_autoscaling = v.map(|x| x.into());
15410        self
15411    }
15412
15413    /// Sets the value of [desired_gateway_api_config][crate::model::ClusterUpdate::desired_gateway_api_config].
15414    ///
15415    /// # Example
15416    /// ```ignore,no_run
15417    /// # use google_cloud_container_v1::model::ClusterUpdate;
15418    /// use google_cloud_container_v1::model::GatewayAPIConfig;
15419    /// let x = ClusterUpdate::new().set_desired_gateway_api_config(GatewayAPIConfig::default()/* use setters */);
15420    /// ```
15421    pub fn set_desired_gateway_api_config<T>(mut self, v: T) -> Self
15422    where
15423        T: std::convert::Into<crate::model::GatewayAPIConfig>,
15424    {
15425        self.desired_gateway_api_config = std::option::Option::Some(v.into());
15426        self
15427    }
15428
15429    /// Sets or clears the value of [desired_gateway_api_config][crate::model::ClusterUpdate::desired_gateway_api_config].
15430    ///
15431    /// # Example
15432    /// ```ignore,no_run
15433    /// # use google_cloud_container_v1::model::ClusterUpdate;
15434    /// use google_cloud_container_v1::model::GatewayAPIConfig;
15435    /// let x = ClusterUpdate::new().set_or_clear_desired_gateway_api_config(Some(GatewayAPIConfig::default()/* use setters */));
15436    /// let x = ClusterUpdate::new().set_or_clear_desired_gateway_api_config(None::<GatewayAPIConfig>);
15437    /// ```
15438    pub fn set_or_clear_desired_gateway_api_config<T>(mut self, v: std::option::Option<T>) -> Self
15439    where
15440        T: std::convert::Into<crate::model::GatewayAPIConfig>,
15441    {
15442        self.desired_gateway_api_config = v.map(|x| x.into());
15443        self
15444    }
15445
15446    /// Sets the value of [etag][crate::model::ClusterUpdate::etag].
15447    ///
15448    /// # Example
15449    /// ```ignore,no_run
15450    /// # use google_cloud_container_v1::model::ClusterUpdate;
15451    /// let x = ClusterUpdate::new().set_etag("example");
15452    /// ```
15453    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15454        self.etag = v.into();
15455        self
15456    }
15457
15458    /// Sets the value of [desired_node_pool_logging_config][crate::model::ClusterUpdate::desired_node_pool_logging_config].
15459    ///
15460    /// # Example
15461    /// ```ignore,no_run
15462    /// # use google_cloud_container_v1::model::ClusterUpdate;
15463    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
15464    /// let x = ClusterUpdate::new().set_desired_node_pool_logging_config(NodePoolLoggingConfig::default()/* use setters */);
15465    /// ```
15466    pub fn set_desired_node_pool_logging_config<T>(mut self, v: T) -> Self
15467    where
15468        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
15469    {
15470        self.desired_node_pool_logging_config = std::option::Option::Some(v.into());
15471        self
15472    }
15473
15474    /// Sets or clears the value of [desired_node_pool_logging_config][crate::model::ClusterUpdate::desired_node_pool_logging_config].
15475    ///
15476    /// # Example
15477    /// ```ignore,no_run
15478    /// # use google_cloud_container_v1::model::ClusterUpdate;
15479    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
15480    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
15481    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_logging_config(None::<NodePoolLoggingConfig>);
15482    /// ```
15483    pub fn set_or_clear_desired_node_pool_logging_config<T>(
15484        mut self,
15485        v: std::option::Option<T>,
15486    ) -> Self
15487    where
15488        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
15489    {
15490        self.desired_node_pool_logging_config = v.map(|x| x.into());
15491        self
15492    }
15493
15494    /// Sets the value of [desired_fleet][crate::model::ClusterUpdate::desired_fleet].
15495    ///
15496    /// # Example
15497    /// ```ignore,no_run
15498    /// # use google_cloud_container_v1::model::ClusterUpdate;
15499    /// use google_cloud_container_v1::model::Fleet;
15500    /// let x = ClusterUpdate::new().set_desired_fleet(Fleet::default()/* use setters */);
15501    /// ```
15502    pub fn set_desired_fleet<T>(mut self, v: T) -> Self
15503    where
15504        T: std::convert::Into<crate::model::Fleet>,
15505    {
15506        self.desired_fleet = std::option::Option::Some(v.into());
15507        self
15508    }
15509
15510    /// Sets or clears the value of [desired_fleet][crate::model::ClusterUpdate::desired_fleet].
15511    ///
15512    /// # Example
15513    /// ```ignore,no_run
15514    /// # use google_cloud_container_v1::model::ClusterUpdate;
15515    /// use google_cloud_container_v1::model::Fleet;
15516    /// let x = ClusterUpdate::new().set_or_clear_desired_fleet(Some(Fleet::default()/* use setters */));
15517    /// let x = ClusterUpdate::new().set_or_clear_desired_fleet(None::<Fleet>);
15518    /// ```
15519    pub fn set_or_clear_desired_fleet<T>(mut self, v: std::option::Option<T>) -> Self
15520    where
15521        T: std::convert::Into<crate::model::Fleet>,
15522    {
15523        self.desired_fleet = v.map(|x| x.into());
15524        self
15525    }
15526
15527    /// Sets the value of [desired_stack_type][crate::model::ClusterUpdate::desired_stack_type].
15528    ///
15529    /// # Example
15530    /// ```ignore,no_run
15531    /// # use google_cloud_container_v1::model::ClusterUpdate;
15532    /// use google_cloud_container_v1::model::StackType;
15533    /// let x0 = ClusterUpdate::new().set_desired_stack_type(StackType::Ipv4);
15534    /// let x1 = ClusterUpdate::new().set_desired_stack_type(StackType::Ipv4Ipv6);
15535    /// ```
15536    pub fn set_desired_stack_type<T: std::convert::Into<crate::model::StackType>>(
15537        mut self,
15538        v: T,
15539    ) -> Self {
15540        self.desired_stack_type = v.into();
15541        self
15542    }
15543
15544    /// Sets the value of [additional_pod_ranges_config][crate::model::ClusterUpdate::additional_pod_ranges_config].
15545    ///
15546    /// # Example
15547    /// ```ignore,no_run
15548    /// # use google_cloud_container_v1::model::ClusterUpdate;
15549    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
15550    /// let x = ClusterUpdate::new().set_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
15551    /// ```
15552    pub fn set_additional_pod_ranges_config<T>(mut self, v: T) -> Self
15553    where
15554        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
15555    {
15556        self.additional_pod_ranges_config = std::option::Option::Some(v.into());
15557        self
15558    }
15559
15560    /// Sets or clears the value of [additional_pod_ranges_config][crate::model::ClusterUpdate::additional_pod_ranges_config].
15561    ///
15562    /// # Example
15563    /// ```ignore,no_run
15564    /// # use google_cloud_container_v1::model::ClusterUpdate;
15565    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
15566    /// let x = ClusterUpdate::new().set_or_clear_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
15567    /// let x = ClusterUpdate::new().set_or_clear_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
15568    /// ```
15569    pub fn set_or_clear_additional_pod_ranges_config<T>(mut self, v: std::option::Option<T>) -> Self
15570    where
15571        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
15572    {
15573        self.additional_pod_ranges_config = v.map(|x| x.into());
15574        self
15575    }
15576
15577    /// Sets the value of [removed_additional_pod_ranges_config][crate::model::ClusterUpdate::removed_additional_pod_ranges_config].
15578    ///
15579    /// # Example
15580    /// ```ignore,no_run
15581    /// # use google_cloud_container_v1::model::ClusterUpdate;
15582    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
15583    /// let x = ClusterUpdate::new().set_removed_additional_pod_ranges_config(AdditionalPodRangesConfig::default()/* use setters */);
15584    /// ```
15585    pub fn set_removed_additional_pod_ranges_config<T>(mut self, v: T) -> Self
15586    where
15587        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
15588    {
15589        self.removed_additional_pod_ranges_config = std::option::Option::Some(v.into());
15590        self
15591    }
15592
15593    /// Sets or clears the value of [removed_additional_pod_ranges_config][crate::model::ClusterUpdate::removed_additional_pod_ranges_config].
15594    ///
15595    /// # Example
15596    /// ```ignore,no_run
15597    /// # use google_cloud_container_v1::model::ClusterUpdate;
15598    /// use google_cloud_container_v1::model::AdditionalPodRangesConfig;
15599    /// let x = ClusterUpdate::new().set_or_clear_removed_additional_pod_ranges_config(Some(AdditionalPodRangesConfig::default()/* use setters */));
15600    /// let x = ClusterUpdate::new().set_or_clear_removed_additional_pod_ranges_config(None::<AdditionalPodRangesConfig>);
15601    /// ```
15602    pub fn set_or_clear_removed_additional_pod_ranges_config<T>(
15603        mut self,
15604        v: std::option::Option<T>,
15605    ) -> Self
15606    where
15607        T: std::convert::Into<crate::model::AdditionalPodRangesConfig>,
15608    {
15609        self.removed_additional_pod_ranges_config = v.map(|x| x.into());
15610        self
15611    }
15612
15613    /// Sets the value of [enable_k8s_beta_apis][crate::model::ClusterUpdate::enable_k8s_beta_apis].
15614    ///
15615    /// # Example
15616    /// ```ignore,no_run
15617    /// # use google_cloud_container_v1::model::ClusterUpdate;
15618    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
15619    /// let x = ClusterUpdate::new().set_enable_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
15620    /// ```
15621    pub fn set_enable_k8s_beta_apis<T>(mut self, v: T) -> Self
15622    where
15623        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
15624    {
15625        self.enable_k8s_beta_apis = std::option::Option::Some(v.into());
15626        self
15627    }
15628
15629    /// Sets or clears the value of [enable_k8s_beta_apis][crate::model::ClusterUpdate::enable_k8s_beta_apis].
15630    ///
15631    /// # Example
15632    /// ```ignore,no_run
15633    /// # use google_cloud_container_v1::model::ClusterUpdate;
15634    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
15635    /// let x = ClusterUpdate::new().set_or_clear_enable_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
15636    /// let x = ClusterUpdate::new().set_or_clear_enable_k8s_beta_apis(None::<K8sBetaAPIConfig>);
15637    /// ```
15638    pub fn set_or_clear_enable_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
15639    where
15640        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
15641    {
15642        self.enable_k8s_beta_apis = v.map(|x| x.into());
15643        self
15644    }
15645
15646    /// Sets the value of [desired_security_posture_config][crate::model::ClusterUpdate::desired_security_posture_config].
15647    ///
15648    /// # Example
15649    /// ```ignore,no_run
15650    /// # use google_cloud_container_v1::model::ClusterUpdate;
15651    /// use google_cloud_container_v1::model::SecurityPostureConfig;
15652    /// let x = ClusterUpdate::new().set_desired_security_posture_config(SecurityPostureConfig::default()/* use setters */);
15653    /// ```
15654    pub fn set_desired_security_posture_config<T>(mut self, v: T) -> Self
15655    where
15656        T: std::convert::Into<crate::model::SecurityPostureConfig>,
15657    {
15658        self.desired_security_posture_config = std::option::Option::Some(v.into());
15659        self
15660    }
15661
15662    /// Sets or clears the value of [desired_security_posture_config][crate::model::ClusterUpdate::desired_security_posture_config].
15663    ///
15664    /// # Example
15665    /// ```ignore,no_run
15666    /// # use google_cloud_container_v1::model::ClusterUpdate;
15667    /// use google_cloud_container_v1::model::SecurityPostureConfig;
15668    /// let x = ClusterUpdate::new().set_or_clear_desired_security_posture_config(Some(SecurityPostureConfig::default()/* use setters */));
15669    /// let x = ClusterUpdate::new().set_or_clear_desired_security_posture_config(None::<SecurityPostureConfig>);
15670    /// ```
15671    pub fn set_or_clear_desired_security_posture_config<T>(
15672        mut self,
15673        v: std::option::Option<T>,
15674    ) -> Self
15675    where
15676        T: std::convert::Into<crate::model::SecurityPostureConfig>,
15677    {
15678        self.desired_security_posture_config = v.map(|x| x.into());
15679        self
15680    }
15681
15682    /// Sets the value of [desired_network_performance_config][crate::model::ClusterUpdate::desired_network_performance_config].
15683    ///
15684    /// # Example
15685    /// ```ignore,no_run
15686    /// # use google_cloud_container_v1::model::ClusterUpdate;
15687    /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
15688    /// let x = ClusterUpdate::new().set_desired_network_performance_config(ClusterNetworkPerformanceConfig::default()/* use setters */);
15689    /// ```
15690    pub fn set_desired_network_performance_config<T>(mut self, v: T) -> Self
15691    where
15692        T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
15693    {
15694        self.desired_network_performance_config = std::option::Option::Some(v.into());
15695        self
15696    }
15697
15698    /// Sets or clears the value of [desired_network_performance_config][crate::model::ClusterUpdate::desired_network_performance_config].
15699    ///
15700    /// # Example
15701    /// ```ignore,no_run
15702    /// # use google_cloud_container_v1::model::ClusterUpdate;
15703    /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
15704    /// let x = ClusterUpdate::new().set_or_clear_desired_network_performance_config(Some(ClusterNetworkPerformanceConfig::default()/* use setters */));
15705    /// let x = ClusterUpdate::new().set_or_clear_desired_network_performance_config(None::<ClusterNetworkPerformanceConfig>);
15706    /// ```
15707    pub fn set_or_clear_desired_network_performance_config<T>(
15708        mut self,
15709        v: std::option::Option<T>,
15710    ) -> Self
15711    where
15712        T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
15713    {
15714        self.desired_network_performance_config = v.map(|x| x.into());
15715        self
15716    }
15717
15718    /// Sets the value of [desired_enable_fqdn_network_policy][crate::model::ClusterUpdate::desired_enable_fqdn_network_policy].
15719    ///
15720    /// # Example
15721    /// ```ignore,no_run
15722    /// # use google_cloud_container_v1::model::ClusterUpdate;
15723    /// let x = ClusterUpdate::new().set_desired_enable_fqdn_network_policy(true);
15724    /// ```
15725    pub fn set_desired_enable_fqdn_network_policy<T>(mut self, v: T) -> Self
15726    where
15727        T: std::convert::Into<bool>,
15728    {
15729        self.desired_enable_fqdn_network_policy = std::option::Option::Some(v.into());
15730        self
15731    }
15732
15733    /// Sets or clears the value of [desired_enable_fqdn_network_policy][crate::model::ClusterUpdate::desired_enable_fqdn_network_policy].
15734    ///
15735    /// # Example
15736    /// ```ignore,no_run
15737    /// # use google_cloud_container_v1::model::ClusterUpdate;
15738    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_fqdn_network_policy(Some(false));
15739    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_fqdn_network_policy(None::<bool>);
15740    /// ```
15741    pub fn set_or_clear_desired_enable_fqdn_network_policy<T>(
15742        mut self,
15743        v: std::option::Option<T>,
15744    ) -> Self
15745    where
15746        T: std::convert::Into<bool>,
15747    {
15748        self.desired_enable_fqdn_network_policy = v.map(|x| x.into());
15749        self
15750    }
15751
15752    /// Sets the value of [desired_autopilot_workload_policy_config][crate::model::ClusterUpdate::desired_autopilot_workload_policy_config].
15753    ///
15754    /// # Example
15755    /// ```ignore,no_run
15756    /// # use google_cloud_container_v1::model::ClusterUpdate;
15757    /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
15758    /// let x = ClusterUpdate::new().set_desired_autopilot_workload_policy_config(WorkloadPolicyConfig::default()/* use setters */);
15759    /// ```
15760    pub fn set_desired_autopilot_workload_policy_config<T>(mut self, v: T) -> Self
15761    where
15762        T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
15763    {
15764        self.desired_autopilot_workload_policy_config = std::option::Option::Some(v.into());
15765        self
15766    }
15767
15768    /// Sets or clears the value of [desired_autopilot_workload_policy_config][crate::model::ClusterUpdate::desired_autopilot_workload_policy_config].
15769    ///
15770    /// # Example
15771    /// ```ignore,no_run
15772    /// # use google_cloud_container_v1::model::ClusterUpdate;
15773    /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
15774    /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_workload_policy_config(Some(WorkloadPolicyConfig::default()/* use setters */));
15775    /// let x = ClusterUpdate::new().set_or_clear_desired_autopilot_workload_policy_config(None::<WorkloadPolicyConfig>);
15776    /// ```
15777    pub fn set_or_clear_desired_autopilot_workload_policy_config<T>(
15778        mut self,
15779        v: std::option::Option<T>,
15780    ) -> Self
15781    where
15782        T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
15783    {
15784        self.desired_autopilot_workload_policy_config = v.map(|x| x.into());
15785        self
15786    }
15787
15788    /// Sets the value of [desired_k8s_beta_apis][crate::model::ClusterUpdate::desired_k8s_beta_apis].
15789    ///
15790    /// # Example
15791    /// ```ignore,no_run
15792    /// # use google_cloud_container_v1::model::ClusterUpdate;
15793    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
15794    /// let x = ClusterUpdate::new().set_desired_k8s_beta_apis(K8sBetaAPIConfig::default()/* use setters */);
15795    /// ```
15796    pub fn set_desired_k8s_beta_apis<T>(mut self, v: T) -> Self
15797    where
15798        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
15799    {
15800        self.desired_k8s_beta_apis = std::option::Option::Some(v.into());
15801        self
15802    }
15803
15804    /// Sets or clears the value of [desired_k8s_beta_apis][crate::model::ClusterUpdate::desired_k8s_beta_apis].
15805    ///
15806    /// # Example
15807    /// ```ignore,no_run
15808    /// # use google_cloud_container_v1::model::ClusterUpdate;
15809    /// use google_cloud_container_v1::model::K8sBetaAPIConfig;
15810    /// let x = ClusterUpdate::new().set_or_clear_desired_k8s_beta_apis(Some(K8sBetaAPIConfig::default()/* use setters */));
15811    /// let x = ClusterUpdate::new().set_or_clear_desired_k8s_beta_apis(None::<K8sBetaAPIConfig>);
15812    /// ```
15813    pub fn set_or_clear_desired_k8s_beta_apis<T>(mut self, v: std::option::Option<T>) -> Self
15814    where
15815        T: std::convert::Into<crate::model::K8sBetaAPIConfig>,
15816    {
15817        self.desired_k8s_beta_apis = v.map(|x| x.into());
15818        self
15819    }
15820
15821    /// Sets the value of [desired_containerd_config][crate::model::ClusterUpdate::desired_containerd_config].
15822    ///
15823    /// # Example
15824    /// ```ignore,no_run
15825    /// # use google_cloud_container_v1::model::ClusterUpdate;
15826    /// use google_cloud_container_v1::model::ContainerdConfig;
15827    /// let x = ClusterUpdate::new().set_desired_containerd_config(ContainerdConfig::default()/* use setters */);
15828    /// ```
15829    pub fn set_desired_containerd_config<T>(mut self, v: T) -> Self
15830    where
15831        T: std::convert::Into<crate::model::ContainerdConfig>,
15832    {
15833        self.desired_containerd_config = std::option::Option::Some(v.into());
15834        self
15835    }
15836
15837    /// Sets or clears the value of [desired_containerd_config][crate::model::ClusterUpdate::desired_containerd_config].
15838    ///
15839    /// # Example
15840    /// ```ignore,no_run
15841    /// # use google_cloud_container_v1::model::ClusterUpdate;
15842    /// use google_cloud_container_v1::model::ContainerdConfig;
15843    /// let x = ClusterUpdate::new().set_or_clear_desired_containerd_config(Some(ContainerdConfig::default()/* use setters */));
15844    /// let x = ClusterUpdate::new().set_or_clear_desired_containerd_config(None::<ContainerdConfig>);
15845    /// ```
15846    pub fn set_or_clear_desired_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
15847    where
15848        T: std::convert::Into<crate::model::ContainerdConfig>,
15849    {
15850        self.desired_containerd_config = v.map(|x| x.into());
15851        self
15852    }
15853
15854    /// Sets the value of [desired_enable_multi_networking][crate::model::ClusterUpdate::desired_enable_multi_networking].
15855    ///
15856    /// # Example
15857    /// ```ignore,no_run
15858    /// # use google_cloud_container_v1::model::ClusterUpdate;
15859    /// let x = ClusterUpdate::new().set_desired_enable_multi_networking(true);
15860    /// ```
15861    pub fn set_desired_enable_multi_networking<T>(mut self, v: T) -> Self
15862    where
15863        T: std::convert::Into<bool>,
15864    {
15865        self.desired_enable_multi_networking = std::option::Option::Some(v.into());
15866        self
15867    }
15868
15869    /// Sets or clears the value of [desired_enable_multi_networking][crate::model::ClusterUpdate::desired_enable_multi_networking].
15870    ///
15871    /// # Example
15872    /// ```ignore,no_run
15873    /// # use google_cloud_container_v1::model::ClusterUpdate;
15874    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_multi_networking(Some(false));
15875    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_multi_networking(None::<bool>);
15876    /// ```
15877    pub fn set_or_clear_desired_enable_multi_networking<T>(
15878        mut self,
15879        v: std::option::Option<T>,
15880    ) -> Self
15881    where
15882        T: std::convert::Into<bool>,
15883    {
15884        self.desired_enable_multi_networking = v.map(|x| x.into());
15885        self
15886    }
15887
15888    /// Sets the value of [desired_node_pool_auto_config_resource_manager_tags][crate::model::ClusterUpdate::desired_node_pool_auto_config_resource_manager_tags].
15889    ///
15890    /// # Example
15891    /// ```ignore,no_run
15892    /// # use google_cloud_container_v1::model::ClusterUpdate;
15893    /// use google_cloud_container_v1::model::ResourceManagerTags;
15894    /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
15895    /// ```
15896    pub fn set_desired_node_pool_auto_config_resource_manager_tags<T>(mut self, v: T) -> Self
15897    where
15898        T: std::convert::Into<crate::model::ResourceManagerTags>,
15899    {
15900        self.desired_node_pool_auto_config_resource_manager_tags =
15901            std::option::Option::Some(v.into());
15902        self
15903    }
15904
15905    /// 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].
15906    ///
15907    /// # Example
15908    /// ```ignore,no_run
15909    /// # use google_cloud_container_v1::model::ClusterUpdate;
15910    /// use google_cloud_container_v1::model::ResourceManagerTags;
15911    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
15912    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_resource_manager_tags(None::<ResourceManagerTags>);
15913    /// ```
15914    pub fn set_or_clear_desired_node_pool_auto_config_resource_manager_tags<T>(
15915        mut self,
15916        v: std::option::Option<T>,
15917    ) -> Self
15918    where
15919        T: std::convert::Into<crate::model::ResourceManagerTags>,
15920    {
15921        self.desired_node_pool_auto_config_resource_manager_tags = v.map(|x| x.into());
15922        self
15923    }
15924
15925    /// Sets the value of [desired_in_transit_encryption_config][crate::model::ClusterUpdate::desired_in_transit_encryption_config].
15926    ///
15927    /// # Example
15928    /// ```ignore,no_run
15929    /// # use google_cloud_container_v1::model::ClusterUpdate;
15930    /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
15931    /// let x0 = ClusterUpdate::new().set_desired_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionDisabled);
15932    /// let x1 = ClusterUpdate::new().set_desired_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent);
15933    /// ```
15934    pub fn set_desired_in_transit_encryption_config<T>(mut self, v: T) -> Self
15935    where
15936        T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
15937    {
15938        self.desired_in_transit_encryption_config = std::option::Option::Some(v.into());
15939        self
15940    }
15941
15942    /// Sets or clears the value of [desired_in_transit_encryption_config][crate::model::ClusterUpdate::desired_in_transit_encryption_config].
15943    ///
15944    /// # Example
15945    /// ```ignore,no_run
15946    /// # use google_cloud_container_v1::model::ClusterUpdate;
15947    /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
15948    /// let x0 = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionDisabled));
15949    /// let x1 = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent));
15950    /// let x_none = ClusterUpdate::new().set_or_clear_desired_in_transit_encryption_config(None::<InTransitEncryptionConfig>);
15951    /// ```
15952    pub fn set_or_clear_desired_in_transit_encryption_config<T>(
15953        mut self,
15954        v: std::option::Option<T>,
15955    ) -> Self
15956    where
15957        T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
15958    {
15959        self.desired_in_transit_encryption_config = v.map(|x| x.into());
15960        self
15961    }
15962
15963    /// Sets the value of [desired_enable_cilium_clusterwide_network_policy][crate::model::ClusterUpdate::desired_enable_cilium_clusterwide_network_policy].
15964    ///
15965    /// # Example
15966    /// ```ignore,no_run
15967    /// # use google_cloud_container_v1::model::ClusterUpdate;
15968    /// let x = ClusterUpdate::new().set_desired_enable_cilium_clusterwide_network_policy(true);
15969    /// ```
15970    pub fn set_desired_enable_cilium_clusterwide_network_policy<T>(mut self, v: T) -> Self
15971    where
15972        T: std::convert::Into<bool>,
15973    {
15974        self.desired_enable_cilium_clusterwide_network_policy = std::option::Option::Some(v.into());
15975        self
15976    }
15977
15978    /// Sets or clears the value of [desired_enable_cilium_clusterwide_network_policy][crate::model::ClusterUpdate::desired_enable_cilium_clusterwide_network_policy].
15979    ///
15980    /// # Example
15981    /// ```ignore,no_run
15982    /// # use google_cloud_container_v1::model::ClusterUpdate;
15983    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_cilium_clusterwide_network_policy(Some(false));
15984    /// let x = ClusterUpdate::new().set_or_clear_desired_enable_cilium_clusterwide_network_policy(None::<bool>);
15985    /// ```
15986    pub fn set_or_clear_desired_enable_cilium_clusterwide_network_policy<T>(
15987        mut self,
15988        v: std::option::Option<T>,
15989    ) -> Self
15990    where
15991        T: std::convert::Into<bool>,
15992    {
15993        self.desired_enable_cilium_clusterwide_network_policy = v.map(|x| x.into());
15994        self
15995    }
15996
15997    /// Sets the value of [desired_secret_manager_config][crate::model::ClusterUpdate::desired_secret_manager_config].
15998    ///
15999    /// # Example
16000    /// ```ignore,no_run
16001    /// # use google_cloud_container_v1::model::ClusterUpdate;
16002    /// use google_cloud_container_v1::model::SecretManagerConfig;
16003    /// let x = ClusterUpdate::new().set_desired_secret_manager_config(SecretManagerConfig::default()/* use setters */);
16004    /// ```
16005    pub fn set_desired_secret_manager_config<T>(mut self, v: T) -> Self
16006    where
16007        T: std::convert::Into<crate::model::SecretManagerConfig>,
16008    {
16009        self.desired_secret_manager_config = std::option::Option::Some(v.into());
16010        self
16011    }
16012
16013    /// Sets or clears the value of [desired_secret_manager_config][crate::model::ClusterUpdate::desired_secret_manager_config].
16014    ///
16015    /// # Example
16016    /// ```ignore,no_run
16017    /// # use google_cloud_container_v1::model::ClusterUpdate;
16018    /// use google_cloud_container_v1::model::SecretManagerConfig;
16019    /// let x = ClusterUpdate::new().set_or_clear_desired_secret_manager_config(Some(SecretManagerConfig::default()/* use setters */));
16020    /// let x = ClusterUpdate::new().set_or_clear_desired_secret_manager_config(None::<SecretManagerConfig>);
16021    /// ```
16022    pub fn set_or_clear_desired_secret_manager_config<T>(
16023        mut self,
16024        v: std::option::Option<T>,
16025    ) -> Self
16026    where
16027        T: std::convert::Into<crate::model::SecretManagerConfig>,
16028    {
16029        self.desired_secret_manager_config = v.map(|x| x.into());
16030        self
16031    }
16032
16033    /// Sets the value of [desired_compliance_posture_config][crate::model::ClusterUpdate::desired_compliance_posture_config].
16034    ///
16035    /// # Example
16036    /// ```ignore,no_run
16037    /// # use google_cloud_container_v1::model::ClusterUpdate;
16038    /// use google_cloud_container_v1::model::CompliancePostureConfig;
16039    /// let x = ClusterUpdate::new().set_desired_compliance_posture_config(CompliancePostureConfig::default()/* use setters */);
16040    /// ```
16041    pub fn set_desired_compliance_posture_config<T>(mut self, v: T) -> Self
16042    where
16043        T: std::convert::Into<crate::model::CompliancePostureConfig>,
16044    {
16045        self.desired_compliance_posture_config = std::option::Option::Some(v.into());
16046        self
16047    }
16048
16049    /// Sets or clears the value of [desired_compliance_posture_config][crate::model::ClusterUpdate::desired_compliance_posture_config].
16050    ///
16051    /// # Example
16052    /// ```ignore,no_run
16053    /// # use google_cloud_container_v1::model::ClusterUpdate;
16054    /// use google_cloud_container_v1::model::CompliancePostureConfig;
16055    /// let x = ClusterUpdate::new().set_or_clear_desired_compliance_posture_config(Some(CompliancePostureConfig::default()/* use setters */));
16056    /// let x = ClusterUpdate::new().set_or_clear_desired_compliance_posture_config(None::<CompliancePostureConfig>);
16057    /// ```
16058    pub fn set_or_clear_desired_compliance_posture_config<T>(
16059        mut self,
16060        v: std::option::Option<T>,
16061    ) -> Self
16062    where
16063        T: std::convert::Into<crate::model::CompliancePostureConfig>,
16064    {
16065        self.desired_compliance_posture_config = v.map(|x| x.into());
16066        self
16067    }
16068
16069    /// Sets the value of [desired_node_kubelet_config][crate::model::ClusterUpdate::desired_node_kubelet_config].
16070    ///
16071    /// # Example
16072    /// ```ignore,no_run
16073    /// # use google_cloud_container_v1::model::ClusterUpdate;
16074    /// use google_cloud_container_v1::model::NodeKubeletConfig;
16075    /// let x = ClusterUpdate::new().set_desired_node_kubelet_config(NodeKubeletConfig::default()/* use setters */);
16076    /// ```
16077    pub fn set_desired_node_kubelet_config<T>(mut self, v: T) -> Self
16078    where
16079        T: std::convert::Into<crate::model::NodeKubeletConfig>,
16080    {
16081        self.desired_node_kubelet_config = std::option::Option::Some(v.into());
16082        self
16083    }
16084
16085    /// Sets or clears the value of [desired_node_kubelet_config][crate::model::ClusterUpdate::desired_node_kubelet_config].
16086    ///
16087    /// # Example
16088    /// ```ignore,no_run
16089    /// # use google_cloud_container_v1::model::ClusterUpdate;
16090    /// use google_cloud_container_v1::model::NodeKubeletConfig;
16091    /// let x = ClusterUpdate::new().set_or_clear_desired_node_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
16092    /// let x = ClusterUpdate::new().set_or_clear_desired_node_kubelet_config(None::<NodeKubeletConfig>);
16093    /// ```
16094    pub fn set_or_clear_desired_node_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
16095    where
16096        T: std::convert::Into<crate::model::NodeKubeletConfig>,
16097    {
16098        self.desired_node_kubelet_config = v.map(|x| x.into());
16099        self
16100    }
16101
16102    /// Sets the value of [desired_node_pool_auto_config_kubelet_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_kubelet_config].
16103    ///
16104    /// # Example
16105    /// ```ignore,no_run
16106    /// # use google_cloud_container_v1::model::ClusterUpdate;
16107    /// use google_cloud_container_v1::model::NodeKubeletConfig;
16108    /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_kubelet_config(NodeKubeletConfig::default()/* use setters */);
16109    /// ```
16110    pub fn set_desired_node_pool_auto_config_kubelet_config<T>(mut self, v: T) -> Self
16111    where
16112        T: std::convert::Into<crate::model::NodeKubeletConfig>,
16113    {
16114        self.desired_node_pool_auto_config_kubelet_config = std::option::Option::Some(v.into());
16115        self
16116    }
16117
16118    /// Sets or clears the value of [desired_node_pool_auto_config_kubelet_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_kubelet_config].
16119    ///
16120    /// # Example
16121    /// ```ignore,no_run
16122    /// # use google_cloud_container_v1::model::ClusterUpdate;
16123    /// use google_cloud_container_v1::model::NodeKubeletConfig;
16124    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
16125    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_kubelet_config(None::<NodeKubeletConfig>);
16126    /// ```
16127    pub fn set_or_clear_desired_node_pool_auto_config_kubelet_config<T>(
16128        mut self,
16129        v: std::option::Option<T>,
16130    ) -> Self
16131    where
16132        T: std::convert::Into<crate::model::NodeKubeletConfig>,
16133    {
16134        self.desired_node_pool_auto_config_kubelet_config = v.map(|x| x.into());
16135        self
16136    }
16137
16138    /// Sets the value of [user_managed_keys_config][crate::model::ClusterUpdate::user_managed_keys_config].
16139    ///
16140    /// # Example
16141    /// ```ignore,no_run
16142    /// # use google_cloud_container_v1::model::ClusterUpdate;
16143    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
16144    /// let x = ClusterUpdate::new().set_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
16145    /// ```
16146    #[deprecated]
16147    pub fn set_user_managed_keys_config<T>(mut self, v: T) -> Self
16148    where
16149        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
16150    {
16151        self.user_managed_keys_config = std::option::Option::Some(v.into());
16152        self
16153    }
16154
16155    /// Sets or clears the value of [user_managed_keys_config][crate::model::ClusterUpdate::user_managed_keys_config].
16156    ///
16157    /// # Example
16158    /// ```ignore,no_run
16159    /// # use google_cloud_container_v1::model::ClusterUpdate;
16160    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
16161    /// let x = ClusterUpdate::new().set_or_clear_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
16162    /// let x = ClusterUpdate::new().set_or_clear_user_managed_keys_config(None::<UserManagedKeysConfig>);
16163    /// ```
16164    #[deprecated]
16165    pub fn set_or_clear_user_managed_keys_config<T>(mut self, v: std::option::Option<T>) -> Self
16166    where
16167        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
16168    {
16169        self.user_managed_keys_config = v.map(|x| x.into());
16170        self
16171    }
16172
16173    /// Sets the value of [desired_rbac_binding_config][crate::model::ClusterUpdate::desired_rbac_binding_config].
16174    ///
16175    /// # Example
16176    /// ```ignore,no_run
16177    /// # use google_cloud_container_v1::model::ClusterUpdate;
16178    /// use google_cloud_container_v1::model::RBACBindingConfig;
16179    /// let x = ClusterUpdate::new().set_desired_rbac_binding_config(RBACBindingConfig::default()/* use setters */);
16180    /// ```
16181    pub fn set_desired_rbac_binding_config<T>(mut self, v: T) -> Self
16182    where
16183        T: std::convert::Into<crate::model::RBACBindingConfig>,
16184    {
16185        self.desired_rbac_binding_config = std::option::Option::Some(v.into());
16186        self
16187    }
16188
16189    /// Sets or clears the value of [desired_rbac_binding_config][crate::model::ClusterUpdate::desired_rbac_binding_config].
16190    ///
16191    /// # Example
16192    /// ```ignore,no_run
16193    /// # use google_cloud_container_v1::model::ClusterUpdate;
16194    /// use google_cloud_container_v1::model::RBACBindingConfig;
16195    /// let x = ClusterUpdate::new().set_or_clear_desired_rbac_binding_config(Some(RBACBindingConfig::default()/* use setters */));
16196    /// let x = ClusterUpdate::new().set_or_clear_desired_rbac_binding_config(None::<RBACBindingConfig>);
16197    /// ```
16198    pub fn set_or_clear_desired_rbac_binding_config<T>(mut self, v: std::option::Option<T>) -> Self
16199    where
16200        T: std::convert::Into<crate::model::RBACBindingConfig>,
16201    {
16202        self.desired_rbac_binding_config = v.map(|x| x.into());
16203        self
16204    }
16205
16206    /// Sets the value of [desired_additional_ip_ranges_config][crate::model::ClusterUpdate::desired_additional_ip_ranges_config].
16207    ///
16208    /// # Example
16209    /// ```ignore,no_run
16210    /// # use google_cloud_container_v1::model::ClusterUpdate;
16211    /// use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
16212    /// let x = ClusterUpdate::new().set_desired_additional_ip_ranges_config(DesiredAdditionalIPRangesConfig::default()/* use setters */);
16213    /// ```
16214    pub fn set_desired_additional_ip_ranges_config<T>(mut self, v: T) -> Self
16215    where
16216        T: std::convert::Into<crate::model::DesiredAdditionalIPRangesConfig>,
16217    {
16218        self.desired_additional_ip_ranges_config = std::option::Option::Some(v.into());
16219        self
16220    }
16221
16222    /// Sets or clears the value of [desired_additional_ip_ranges_config][crate::model::ClusterUpdate::desired_additional_ip_ranges_config].
16223    ///
16224    /// # Example
16225    /// ```ignore,no_run
16226    /// # use google_cloud_container_v1::model::ClusterUpdate;
16227    /// use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
16228    /// let x = ClusterUpdate::new().set_or_clear_desired_additional_ip_ranges_config(Some(DesiredAdditionalIPRangesConfig::default()/* use setters */));
16229    /// let x = ClusterUpdate::new().set_or_clear_desired_additional_ip_ranges_config(None::<DesiredAdditionalIPRangesConfig>);
16230    /// ```
16231    pub fn set_or_clear_desired_additional_ip_ranges_config<T>(
16232        mut self,
16233        v: std::option::Option<T>,
16234    ) -> Self
16235    where
16236        T: std::convert::Into<crate::model::DesiredAdditionalIPRangesConfig>,
16237    {
16238        self.desired_additional_ip_ranges_config = v.map(|x| x.into());
16239        self
16240    }
16241
16242    /// Sets the value of [desired_enterprise_config][crate::model::ClusterUpdate::desired_enterprise_config].
16243    ///
16244    /// # Example
16245    /// ```ignore,no_run
16246    /// # use google_cloud_container_v1::model::ClusterUpdate;
16247    /// use google_cloud_container_v1::model::DesiredEnterpriseConfig;
16248    /// let x = ClusterUpdate::new().set_desired_enterprise_config(DesiredEnterpriseConfig::default()/* use setters */);
16249    /// ```
16250    #[deprecated]
16251    pub fn set_desired_enterprise_config<T>(mut self, v: T) -> Self
16252    where
16253        T: std::convert::Into<crate::model::DesiredEnterpriseConfig>,
16254    {
16255        self.desired_enterprise_config = std::option::Option::Some(v.into());
16256        self
16257    }
16258
16259    /// Sets or clears the value of [desired_enterprise_config][crate::model::ClusterUpdate::desired_enterprise_config].
16260    ///
16261    /// # Example
16262    /// ```ignore,no_run
16263    /// # use google_cloud_container_v1::model::ClusterUpdate;
16264    /// use google_cloud_container_v1::model::DesiredEnterpriseConfig;
16265    /// let x = ClusterUpdate::new().set_or_clear_desired_enterprise_config(Some(DesiredEnterpriseConfig::default()/* use setters */));
16266    /// let x = ClusterUpdate::new().set_or_clear_desired_enterprise_config(None::<DesiredEnterpriseConfig>);
16267    /// ```
16268    #[deprecated]
16269    pub fn set_or_clear_desired_enterprise_config<T>(mut self, v: std::option::Option<T>) -> Self
16270    where
16271        T: std::convert::Into<crate::model::DesiredEnterpriseConfig>,
16272    {
16273        self.desired_enterprise_config = v.map(|x| x.into());
16274        self
16275    }
16276
16277    /// Sets the value of [desired_auto_ipam_config][crate::model::ClusterUpdate::desired_auto_ipam_config].
16278    ///
16279    /// # Example
16280    /// ```ignore,no_run
16281    /// # use google_cloud_container_v1::model::ClusterUpdate;
16282    /// use google_cloud_container_v1::model::AutoIpamConfig;
16283    /// let x = ClusterUpdate::new().set_desired_auto_ipam_config(AutoIpamConfig::default()/* use setters */);
16284    /// ```
16285    pub fn set_desired_auto_ipam_config<T>(mut self, v: T) -> Self
16286    where
16287        T: std::convert::Into<crate::model::AutoIpamConfig>,
16288    {
16289        self.desired_auto_ipam_config = std::option::Option::Some(v.into());
16290        self
16291    }
16292
16293    /// Sets or clears the value of [desired_auto_ipam_config][crate::model::ClusterUpdate::desired_auto_ipam_config].
16294    ///
16295    /// # Example
16296    /// ```ignore,no_run
16297    /// # use google_cloud_container_v1::model::ClusterUpdate;
16298    /// use google_cloud_container_v1::model::AutoIpamConfig;
16299    /// let x = ClusterUpdate::new().set_or_clear_desired_auto_ipam_config(Some(AutoIpamConfig::default()/* use setters */));
16300    /// let x = ClusterUpdate::new().set_or_clear_desired_auto_ipam_config(None::<AutoIpamConfig>);
16301    /// ```
16302    pub fn set_or_clear_desired_auto_ipam_config<T>(mut self, v: std::option::Option<T>) -> Self
16303    where
16304        T: std::convert::Into<crate::model::AutoIpamConfig>,
16305    {
16306        self.desired_auto_ipam_config = v.map(|x| x.into());
16307        self
16308    }
16309
16310    /// Sets the value of [desired_disable_l4_lb_firewall_reconciliation][crate::model::ClusterUpdate::desired_disable_l4_lb_firewall_reconciliation].
16311    ///
16312    /// # Example
16313    /// ```ignore,no_run
16314    /// # use google_cloud_container_v1::model::ClusterUpdate;
16315    /// let x = ClusterUpdate::new().set_desired_disable_l4_lb_firewall_reconciliation(true);
16316    /// ```
16317    pub fn set_desired_disable_l4_lb_firewall_reconciliation<T>(mut self, v: T) -> Self
16318    where
16319        T: std::convert::Into<bool>,
16320    {
16321        self.desired_disable_l4_lb_firewall_reconciliation = std::option::Option::Some(v.into());
16322        self
16323    }
16324
16325    /// Sets or clears the value of [desired_disable_l4_lb_firewall_reconciliation][crate::model::ClusterUpdate::desired_disable_l4_lb_firewall_reconciliation].
16326    ///
16327    /// # Example
16328    /// ```ignore,no_run
16329    /// # use google_cloud_container_v1::model::ClusterUpdate;
16330    /// let x = ClusterUpdate::new().set_or_clear_desired_disable_l4_lb_firewall_reconciliation(Some(false));
16331    /// let x = ClusterUpdate::new().set_or_clear_desired_disable_l4_lb_firewall_reconciliation(None::<bool>);
16332    /// ```
16333    pub fn set_or_clear_desired_disable_l4_lb_firewall_reconciliation<T>(
16334        mut self,
16335        v: std::option::Option<T>,
16336    ) -> Self
16337    where
16338        T: std::convert::Into<bool>,
16339    {
16340        self.desired_disable_l4_lb_firewall_reconciliation = v.map(|x| x.into());
16341        self
16342    }
16343
16344    /// Sets the value of [desired_node_pool_auto_config_linux_node_config][crate::model::ClusterUpdate::desired_node_pool_auto_config_linux_node_config].
16345    ///
16346    /// # Example
16347    /// ```ignore,no_run
16348    /// # use google_cloud_container_v1::model::ClusterUpdate;
16349    /// use google_cloud_container_v1::model::LinuxNodeConfig;
16350    /// let x = ClusterUpdate::new().set_desired_node_pool_auto_config_linux_node_config(LinuxNodeConfig::default()/* use setters */);
16351    /// ```
16352    pub fn set_desired_node_pool_auto_config_linux_node_config<T>(mut self, v: T) -> Self
16353    where
16354        T: std::convert::Into<crate::model::LinuxNodeConfig>,
16355    {
16356        self.desired_node_pool_auto_config_linux_node_config = std::option::Option::Some(v.into());
16357        self
16358    }
16359
16360    /// 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].
16361    ///
16362    /// # Example
16363    /// ```ignore,no_run
16364    /// # use google_cloud_container_v1::model::ClusterUpdate;
16365    /// use google_cloud_container_v1::model::LinuxNodeConfig;
16366    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
16367    /// let x = ClusterUpdate::new().set_or_clear_desired_node_pool_auto_config_linux_node_config(None::<LinuxNodeConfig>);
16368    /// ```
16369    pub fn set_or_clear_desired_node_pool_auto_config_linux_node_config<T>(
16370        mut self,
16371        v: std::option::Option<T>,
16372    ) -> Self
16373    where
16374        T: std::convert::Into<crate::model::LinuxNodeConfig>,
16375    {
16376        self.desired_node_pool_auto_config_linux_node_config = v.map(|x| x.into());
16377        self
16378    }
16379
16380    /// Sets the value of [desired_user_managed_keys_config][crate::model::ClusterUpdate::desired_user_managed_keys_config].
16381    ///
16382    /// # Example
16383    /// ```ignore,no_run
16384    /// # use google_cloud_container_v1::model::ClusterUpdate;
16385    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
16386    /// let x = ClusterUpdate::new().set_desired_user_managed_keys_config(UserManagedKeysConfig::default()/* use setters */);
16387    /// ```
16388    pub fn set_desired_user_managed_keys_config<T>(mut self, v: T) -> Self
16389    where
16390        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
16391    {
16392        self.desired_user_managed_keys_config = std::option::Option::Some(v.into());
16393        self
16394    }
16395
16396    /// Sets or clears the value of [desired_user_managed_keys_config][crate::model::ClusterUpdate::desired_user_managed_keys_config].
16397    ///
16398    /// # Example
16399    /// ```ignore,no_run
16400    /// # use google_cloud_container_v1::model::ClusterUpdate;
16401    /// use google_cloud_container_v1::model::UserManagedKeysConfig;
16402    /// let x = ClusterUpdate::new().set_or_clear_desired_user_managed_keys_config(Some(UserManagedKeysConfig::default()/* use setters */));
16403    /// let x = ClusterUpdate::new().set_or_clear_desired_user_managed_keys_config(None::<UserManagedKeysConfig>);
16404    /// ```
16405    pub fn set_or_clear_desired_user_managed_keys_config<T>(
16406        mut self,
16407        v: std::option::Option<T>,
16408    ) -> Self
16409    where
16410        T: std::convert::Into<crate::model::UserManagedKeysConfig>,
16411    {
16412        self.desired_user_managed_keys_config = v.map(|x| x.into());
16413        self
16414    }
16415
16416    /// Sets the value of [desired_anonymous_authentication_config][crate::model::ClusterUpdate::desired_anonymous_authentication_config].
16417    ///
16418    /// # Example
16419    /// ```ignore,no_run
16420    /// # use google_cloud_container_v1::model::ClusterUpdate;
16421    /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
16422    /// let x = ClusterUpdate::new().set_desired_anonymous_authentication_config(AnonymousAuthenticationConfig::default()/* use setters */);
16423    /// ```
16424    pub fn set_desired_anonymous_authentication_config<T>(mut self, v: T) -> Self
16425    where
16426        T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
16427    {
16428        self.desired_anonymous_authentication_config = std::option::Option::Some(v.into());
16429        self
16430    }
16431
16432    /// Sets or clears the value of [desired_anonymous_authentication_config][crate::model::ClusterUpdate::desired_anonymous_authentication_config].
16433    ///
16434    /// # Example
16435    /// ```ignore,no_run
16436    /// # use google_cloud_container_v1::model::ClusterUpdate;
16437    /// use google_cloud_container_v1::model::AnonymousAuthenticationConfig;
16438    /// let x = ClusterUpdate::new().set_or_clear_desired_anonymous_authentication_config(Some(AnonymousAuthenticationConfig::default()/* use setters */));
16439    /// let x = ClusterUpdate::new().set_or_clear_desired_anonymous_authentication_config(None::<AnonymousAuthenticationConfig>);
16440    /// ```
16441    pub fn set_or_clear_desired_anonymous_authentication_config<T>(
16442        mut self,
16443        v: std::option::Option<T>,
16444    ) -> Self
16445    where
16446        T: std::convert::Into<crate::model::AnonymousAuthenticationConfig>,
16447    {
16448        self.desired_anonymous_authentication_config = v.map(|x| x.into());
16449        self
16450    }
16451
16452    /// Sets the value of [gke_auto_upgrade_config][crate::model::ClusterUpdate::gke_auto_upgrade_config].
16453    ///
16454    /// # Example
16455    /// ```ignore,no_run
16456    /// # use google_cloud_container_v1::model::ClusterUpdate;
16457    /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
16458    /// let x = ClusterUpdate::new().set_gke_auto_upgrade_config(GkeAutoUpgradeConfig::default()/* use setters */);
16459    /// ```
16460    pub fn set_gke_auto_upgrade_config<T>(mut self, v: T) -> Self
16461    where
16462        T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
16463    {
16464        self.gke_auto_upgrade_config = std::option::Option::Some(v.into());
16465        self
16466    }
16467
16468    /// Sets or clears the value of [gke_auto_upgrade_config][crate::model::ClusterUpdate::gke_auto_upgrade_config].
16469    ///
16470    /// # Example
16471    /// ```ignore,no_run
16472    /// # use google_cloud_container_v1::model::ClusterUpdate;
16473    /// use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
16474    /// let x = ClusterUpdate::new().set_or_clear_gke_auto_upgrade_config(Some(GkeAutoUpgradeConfig::default()/* use setters */));
16475    /// let x = ClusterUpdate::new().set_or_clear_gke_auto_upgrade_config(None::<GkeAutoUpgradeConfig>);
16476    /// ```
16477    pub fn set_or_clear_gke_auto_upgrade_config<T>(mut self, v: std::option::Option<T>) -> Self
16478    where
16479        T: std::convert::Into<crate::model::GkeAutoUpgradeConfig>,
16480    {
16481        self.gke_auto_upgrade_config = v.map(|x| x.into());
16482        self
16483    }
16484
16485    /// Sets the value of [desired_network_tier_config][crate::model::ClusterUpdate::desired_network_tier_config].
16486    ///
16487    /// # Example
16488    /// ```ignore,no_run
16489    /// # use google_cloud_container_v1::model::ClusterUpdate;
16490    /// use google_cloud_container_v1::model::NetworkTierConfig;
16491    /// let x = ClusterUpdate::new().set_desired_network_tier_config(NetworkTierConfig::default()/* use setters */);
16492    /// ```
16493    pub fn set_desired_network_tier_config<T>(mut self, v: T) -> Self
16494    where
16495        T: std::convert::Into<crate::model::NetworkTierConfig>,
16496    {
16497        self.desired_network_tier_config = std::option::Option::Some(v.into());
16498        self
16499    }
16500
16501    /// Sets or clears the value of [desired_network_tier_config][crate::model::ClusterUpdate::desired_network_tier_config].
16502    ///
16503    /// # Example
16504    /// ```ignore,no_run
16505    /// # use google_cloud_container_v1::model::ClusterUpdate;
16506    /// use google_cloud_container_v1::model::NetworkTierConfig;
16507    /// let x = ClusterUpdate::new().set_or_clear_desired_network_tier_config(Some(NetworkTierConfig::default()/* use setters */));
16508    /// let x = ClusterUpdate::new().set_or_clear_desired_network_tier_config(None::<NetworkTierConfig>);
16509    /// ```
16510    pub fn set_or_clear_desired_network_tier_config<T>(mut self, v: std::option::Option<T>) -> Self
16511    where
16512        T: std::convert::Into<crate::model::NetworkTierConfig>,
16513    {
16514        self.desired_network_tier_config = v.map(|x| x.into());
16515        self
16516    }
16517}
16518
16519impl wkt::message::Message for ClusterUpdate {
16520    fn typename() -> &'static str {
16521        "type.googleapis.com/google.container.v1.ClusterUpdate"
16522    }
16523}
16524
16525/// AdditionalPodRangesConfig is the configuration for additional pod secondary
16526/// ranges supporting the ClusterUpdate message.
16527#[derive(Clone, Default, PartialEq)]
16528#[non_exhaustive]
16529pub struct AdditionalPodRangesConfig {
16530    /// Name for pod secondary ipv4 range which has the actual range defined ahead.
16531    pub pod_range_names: std::vec::Vec<std::string::String>,
16532
16533    /// Output only. Information for additional pod range.
16534    pub pod_range_info: std::vec::Vec<crate::model::RangeInfo>,
16535
16536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16537}
16538
16539impl AdditionalPodRangesConfig {
16540    pub fn new() -> Self {
16541        std::default::Default::default()
16542    }
16543
16544    /// Sets the value of [pod_range_names][crate::model::AdditionalPodRangesConfig::pod_range_names].
16545    ///
16546    /// # Example
16547    /// ```ignore,no_run
16548    /// # use google_cloud_container_v1::model::AdditionalPodRangesConfig;
16549    /// let x = AdditionalPodRangesConfig::new().set_pod_range_names(["a", "b", "c"]);
16550    /// ```
16551    pub fn set_pod_range_names<T, V>(mut self, v: T) -> Self
16552    where
16553        T: std::iter::IntoIterator<Item = V>,
16554        V: std::convert::Into<std::string::String>,
16555    {
16556        use std::iter::Iterator;
16557        self.pod_range_names = v.into_iter().map(|i| i.into()).collect();
16558        self
16559    }
16560
16561    /// Sets the value of [pod_range_info][crate::model::AdditionalPodRangesConfig::pod_range_info].
16562    ///
16563    /// # Example
16564    /// ```ignore,no_run
16565    /// # use google_cloud_container_v1::model::AdditionalPodRangesConfig;
16566    /// use google_cloud_container_v1::model::RangeInfo;
16567    /// let x = AdditionalPodRangesConfig::new()
16568    ///     .set_pod_range_info([
16569    ///         RangeInfo::default()/* use setters */,
16570    ///         RangeInfo::default()/* use (different) setters */,
16571    ///     ]);
16572    /// ```
16573    pub fn set_pod_range_info<T, V>(mut self, v: T) -> Self
16574    where
16575        T: std::iter::IntoIterator<Item = V>,
16576        V: std::convert::Into<crate::model::RangeInfo>,
16577    {
16578        use std::iter::Iterator;
16579        self.pod_range_info = v.into_iter().map(|i| i.into()).collect();
16580        self
16581    }
16582}
16583
16584impl wkt::message::Message for AdditionalPodRangesConfig {
16585    fn typename() -> &'static str {
16586        "type.googleapis.com/google.container.v1.AdditionalPodRangesConfig"
16587    }
16588}
16589
16590/// AdditionalIPRangesConfig is the configuration for individual additional
16591/// subnetwork attached to the cluster
16592#[derive(Clone, Default, PartialEq)]
16593#[non_exhaustive]
16594pub struct AdditionalIPRangesConfig {
16595    /// Name of the subnetwork. This can be the full path of the subnetwork or
16596    /// just the name.
16597    /// Example1: my-subnet
16598    /// Example2: projects/gke-project/regions/us-central1/subnetworks/my-subnet
16599    pub subnetwork: std::string::String,
16600
16601    /// List of secondary ranges names within this subnetwork that can be used for
16602    /// pod IPs.
16603    /// Example1: gke-pod-range1
16604    /// Example2: gke-pod-range1,gke-pod-range2
16605    pub pod_ipv4_range_names: std::vec::Vec<std::string::String>,
16606
16607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16608}
16609
16610impl AdditionalIPRangesConfig {
16611    pub fn new() -> Self {
16612        std::default::Default::default()
16613    }
16614
16615    /// Sets the value of [subnetwork][crate::model::AdditionalIPRangesConfig::subnetwork].
16616    ///
16617    /// # Example
16618    /// ```ignore,no_run
16619    /// # use google_cloud_container_v1::model::AdditionalIPRangesConfig;
16620    /// let x = AdditionalIPRangesConfig::new().set_subnetwork("example");
16621    /// ```
16622    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16623        self.subnetwork = v.into();
16624        self
16625    }
16626
16627    /// Sets the value of [pod_ipv4_range_names][crate::model::AdditionalIPRangesConfig::pod_ipv4_range_names].
16628    ///
16629    /// # Example
16630    /// ```ignore,no_run
16631    /// # use google_cloud_container_v1::model::AdditionalIPRangesConfig;
16632    /// let x = AdditionalIPRangesConfig::new().set_pod_ipv4_range_names(["a", "b", "c"]);
16633    /// ```
16634    pub fn set_pod_ipv4_range_names<T, V>(mut self, v: T) -> Self
16635    where
16636        T: std::iter::IntoIterator<Item = V>,
16637        V: std::convert::Into<std::string::String>,
16638    {
16639        use std::iter::Iterator;
16640        self.pod_ipv4_range_names = v.into_iter().map(|i| i.into()).collect();
16641        self
16642    }
16643}
16644
16645impl wkt::message::Message for AdditionalIPRangesConfig {
16646    fn typename() -> &'static str {
16647        "type.googleapis.com/google.container.v1.AdditionalIPRangesConfig"
16648    }
16649}
16650
16651/// DesiredAdditionalIPRangesConfig is a wrapper used for cluster update
16652/// operation and contains multiple AdditionalIPRangesConfigs.
16653#[derive(Clone, Default, PartialEq)]
16654#[non_exhaustive]
16655pub struct DesiredAdditionalIPRangesConfig {
16656    /// List of additional IP ranges configs where each AdditionalIPRangesConfig
16657    /// corresponds to one subnetwork's IP ranges
16658    pub additional_ip_ranges_configs: std::vec::Vec<crate::model::AdditionalIPRangesConfig>,
16659
16660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16661}
16662
16663impl DesiredAdditionalIPRangesConfig {
16664    pub fn new() -> Self {
16665        std::default::Default::default()
16666    }
16667
16668    /// Sets the value of [additional_ip_ranges_configs][crate::model::DesiredAdditionalIPRangesConfig::additional_ip_ranges_configs].
16669    ///
16670    /// # Example
16671    /// ```ignore,no_run
16672    /// # use google_cloud_container_v1::model::DesiredAdditionalIPRangesConfig;
16673    /// use google_cloud_container_v1::model::AdditionalIPRangesConfig;
16674    /// let x = DesiredAdditionalIPRangesConfig::new()
16675    ///     .set_additional_ip_ranges_configs([
16676    ///         AdditionalIPRangesConfig::default()/* use setters */,
16677    ///         AdditionalIPRangesConfig::default()/* use (different) setters */,
16678    ///     ]);
16679    /// ```
16680    pub fn set_additional_ip_ranges_configs<T, V>(mut self, v: T) -> Self
16681    where
16682        T: std::iter::IntoIterator<Item = V>,
16683        V: std::convert::Into<crate::model::AdditionalIPRangesConfig>,
16684    {
16685        use std::iter::Iterator;
16686        self.additional_ip_ranges_configs = v.into_iter().map(|i| i.into()).collect();
16687        self
16688    }
16689}
16690
16691impl wkt::message::Message for DesiredAdditionalIPRangesConfig {
16692    fn typename() -> &'static str {
16693        "type.googleapis.com/google.container.v1.DesiredAdditionalIPRangesConfig"
16694    }
16695}
16696
16697/// AutoIpamConfig contains all information related to Auto IPAM
16698#[derive(Clone, Default, PartialEq)]
16699#[non_exhaustive]
16700pub struct AutoIpamConfig {
16701    /// The flag that enables Auto IPAM on this cluster
16702    pub enabled: std::option::Option<bool>,
16703
16704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16705}
16706
16707impl AutoIpamConfig {
16708    pub fn new() -> Self {
16709        std::default::Default::default()
16710    }
16711
16712    /// Sets the value of [enabled][crate::model::AutoIpamConfig::enabled].
16713    ///
16714    /// # Example
16715    /// ```ignore,no_run
16716    /// # use google_cloud_container_v1::model::AutoIpamConfig;
16717    /// let x = AutoIpamConfig::new().set_enabled(true);
16718    /// ```
16719    pub fn set_enabled<T>(mut self, v: T) -> Self
16720    where
16721        T: std::convert::Into<bool>,
16722    {
16723        self.enabled = std::option::Option::Some(v.into());
16724        self
16725    }
16726
16727    /// Sets or clears the value of [enabled][crate::model::AutoIpamConfig::enabled].
16728    ///
16729    /// # Example
16730    /// ```ignore,no_run
16731    /// # use google_cloud_container_v1::model::AutoIpamConfig;
16732    /// let x = AutoIpamConfig::new().set_or_clear_enabled(Some(false));
16733    /// let x = AutoIpamConfig::new().set_or_clear_enabled(None::<bool>);
16734    /// ```
16735    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16736    where
16737        T: std::convert::Into<bool>,
16738    {
16739        self.enabled = v.map(|x| x.into());
16740        self
16741    }
16742}
16743
16744impl wkt::message::Message for AutoIpamConfig {
16745    fn typename() -> &'static str {
16746        "type.googleapis.com/google.container.v1.AutoIpamConfig"
16747    }
16748}
16749
16750/// RangeInfo contains the range name and the range utilization by this cluster.
16751#[derive(Clone, Default, PartialEq)]
16752#[non_exhaustive]
16753pub struct RangeInfo {
16754    /// Output only. Name of a range.
16755    pub range_name: std::string::String,
16756
16757    /// Output only. The utilization of the range.
16758    pub utilization: f64,
16759
16760    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16761}
16762
16763impl RangeInfo {
16764    pub fn new() -> Self {
16765        std::default::Default::default()
16766    }
16767
16768    /// Sets the value of [range_name][crate::model::RangeInfo::range_name].
16769    ///
16770    /// # Example
16771    /// ```ignore,no_run
16772    /// # use google_cloud_container_v1::model::RangeInfo;
16773    /// let x = RangeInfo::new().set_range_name("example");
16774    /// ```
16775    pub fn set_range_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16776        self.range_name = v.into();
16777        self
16778    }
16779
16780    /// Sets the value of [utilization][crate::model::RangeInfo::utilization].
16781    ///
16782    /// # Example
16783    /// ```ignore,no_run
16784    /// # use google_cloud_container_v1::model::RangeInfo;
16785    /// let x = RangeInfo::new().set_utilization(42.0);
16786    /// ```
16787    pub fn set_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
16788        self.utilization = v.into();
16789        self
16790    }
16791}
16792
16793impl wkt::message::Message for RangeInfo {
16794    fn typename() -> &'static str {
16795        "type.googleapis.com/google.container.v1.RangeInfo"
16796    }
16797}
16798
16799/// DesiredEnterpriseConfig is a wrapper used for updating enterprise_config.
16800///
16801/// Deprecated: GKE Enterprise features are now available without an Enterprise
16802/// tier.
16803#[derive(Clone, Default, PartialEq)]
16804#[non_exhaustive]
16805#[deprecated]
16806pub struct DesiredEnterpriseConfig {
16807    /// desired_tier specifies the desired tier of the cluster.
16808    pub desired_tier: crate::model::enterprise_config::ClusterTier,
16809
16810    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16811}
16812
16813impl DesiredEnterpriseConfig {
16814    pub fn new() -> Self {
16815        std::default::Default::default()
16816    }
16817
16818    /// Sets the value of [desired_tier][crate::model::DesiredEnterpriseConfig::desired_tier].
16819    ///
16820    /// # Example
16821    /// ```ignore,no_run
16822    /// # use google_cloud_container_v1::model::DesiredEnterpriseConfig;
16823    /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
16824    /// let x0 = DesiredEnterpriseConfig::new().set_desired_tier(ClusterTier::Standard);
16825    /// let x1 = DesiredEnterpriseConfig::new().set_desired_tier(ClusterTier::Enterprise);
16826    /// ```
16827    pub fn set_desired_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
16828        mut self,
16829        v: T,
16830    ) -> Self {
16831        self.desired_tier = v.into();
16832        self
16833    }
16834}
16835
16836impl wkt::message::Message for DesiredEnterpriseConfig {
16837    fn typename() -> &'static str {
16838        "type.googleapis.com/google.container.v1.DesiredEnterpriseConfig"
16839    }
16840}
16841
16842/// This operation resource represents operations that may have happened or are
16843/// happening on the cluster. All fields are output only.
16844#[derive(Clone, Default, PartialEq)]
16845#[non_exhaustive]
16846pub struct Operation {
16847    /// Output only. The server-assigned ID for the operation.
16848    pub name: std::string::String,
16849
16850    /// Output only. The name of the Google Compute Engine
16851    /// [zone](https://cloud.google.com/compute/docs/zones#available)
16852    /// in which the operation is taking place. This field is deprecated, use
16853    /// location instead.
16854    #[deprecated]
16855    pub zone: std::string::String,
16856
16857    /// Output only. The operation type.
16858    pub operation_type: crate::model::operation::Type,
16859
16860    /// Output only. The current status of the operation.
16861    pub status: crate::model::operation::Status,
16862
16863    /// Output only. Detailed operation progress, if available.
16864    pub detail: std::string::String,
16865
16866    /// Output only. If an error has occurred, a textual description of the error.
16867    /// Deprecated. Use the field error instead.
16868    #[deprecated]
16869    pub status_message: std::string::String,
16870
16871    /// Output only. Server-defined URI for the operation. Example:
16872    /// `<https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123>`.
16873    pub self_link: std::string::String,
16874
16875    /// Output only. Server-defined URI for the target of the operation. The format
16876    /// of this is a URI to the resource being modified (such as a cluster, node
16877    /// pool, or node). For node pool repairs, there may be multiple nodes being
16878    /// repaired, but only one will be the target.
16879    ///
16880    /// Examples:
16881    ///
16882    ///
16883    /// ##
16884    ///
16885    /// `<https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster>`
16886    ///
16887    /// ##
16888    ///
16889    /// `<https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np>`
16890    ///
16891    /// `<https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node>`
16892    pub target_link: std::string::String,
16893
16894    /// Output only. The name of the Google Compute Engine
16895    /// [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
16896    /// or
16897    /// [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
16898    /// in which the cluster resides.
16899    pub location: std::string::String,
16900
16901    /// Output only. The time the operation started, in
16902    /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
16903    pub start_time: std::string::String,
16904
16905    /// Output only. The time the operation completed, in
16906    /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
16907    pub end_time: std::string::String,
16908
16909    /// Output only. Progress information for an operation.
16910    pub progress: std::option::Option<crate::model::OperationProgress>,
16911
16912    /// Which conditions caused the current cluster state.
16913    /// Deprecated. Use field error instead.
16914    #[deprecated]
16915    pub cluster_conditions: std::vec::Vec<crate::model::StatusCondition>,
16916
16917    /// Which conditions caused the current node pool state.
16918    /// Deprecated. Use field error instead.
16919    #[deprecated]
16920    pub nodepool_conditions: std::vec::Vec<crate::model::StatusCondition>,
16921
16922    /// The error result of the operation in case of failure.
16923    pub error: std::option::Option<rpc::model::Status>,
16924
16925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16926}
16927
16928impl Operation {
16929    pub fn new() -> Self {
16930        std::default::Default::default()
16931    }
16932
16933    /// Sets the value of [name][crate::model::Operation::name].
16934    ///
16935    /// # Example
16936    /// ```ignore,no_run
16937    /// # use google_cloud_container_v1::model::Operation;
16938    /// let x = Operation::new().set_name("example");
16939    /// ```
16940    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16941        self.name = v.into();
16942        self
16943    }
16944
16945    /// Sets the value of [zone][crate::model::Operation::zone].
16946    ///
16947    /// # Example
16948    /// ```ignore,no_run
16949    /// # use google_cloud_container_v1::model::Operation;
16950    /// let x = Operation::new().set_zone("example");
16951    /// ```
16952    #[deprecated]
16953    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16954        self.zone = v.into();
16955        self
16956    }
16957
16958    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
16959    ///
16960    /// # Example
16961    /// ```ignore,no_run
16962    /// # use google_cloud_container_v1::model::Operation;
16963    /// use google_cloud_container_v1::model::operation::Type;
16964    /// let x0 = Operation::new().set_operation_type(Type::CreateCluster);
16965    /// let x1 = Operation::new().set_operation_type(Type::DeleteCluster);
16966    /// let x2 = Operation::new().set_operation_type(Type::UpgradeMaster);
16967    /// ```
16968    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::Type>>(
16969        mut self,
16970        v: T,
16971    ) -> Self {
16972        self.operation_type = v.into();
16973        self
16974    }
16975
16976    /// Sets the value of [status][crate::model::Operation::status].
16977    ///
16978    /// # Example
16979    /// ```ignore,no_run
16980    /// # use google_cloud_container_v1::model::Operation;
16981    /// use google_cloud_container_v1::model::operation::Status;
16982    /// let x0 = Operation::new().set_status(Status::Pending);
16983    /// let x1 = Operation::new().set_status(Status::Running);
16984    /// let x2 = Operation::new().set_status(Status::Done);
16985    /// ```
16986    pub fn set_status<T: std::convert::Into<crate::model::operation::Status>>(
16987        mut self,
16988        v: T,
16989    ) -> Self {
16990        self.status = v.into();
16991        self
16992    }
16993
16994    /// Sets the value of [detail][crate::model::Operation::detail].
16995    ///
16996    /// # Example
16997    /// ```ignore,no_run
16998    /// # use google_cloud_container_v1::model::Operation;
16999    /// let x = Operation::new().set_detail("example");
17000    /// ```
17001    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17002        self.detail = v.into();
17003        self
17004    }
17005
17006    /// Sets the value of [status_message][crate::model::Operation::status_message].
17007    ///
17008    /// # Example
17009    /// ```ignore,no_run
17010    /// # use google_cloud_container_v1::model::Operation;
17011    /// let x = Operation::new().set_status_message("example");
17012    /// ```
17013    #[deprecated]
17014    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17015        self.status_message = v.into();
17016        self
17017    }
17018
17019    /// Sets the value of [self_link][crate::model::Operation::self_link].
17020    ///
17021    /// # Example
17022    /// ```ignore,no_run
17023    /// # use google_cloud_container_v1::model::Operation;
17024    /// let x = Operation::new().set_self_link("example");
17025    /// ```
17026    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17027        self.self_link = v.into();
17028        self
17029    }
17030
17031    /// Sets the value of [target_link][crate::model::Operation::target_link].
17032    ///
17033    /// # Example
17034    /// ```ignore,no_run
17035    /// # use google_cloud_container_v1::model::Operation;
17036    /// let x = Operation::new().set_target_link("example");
17037    /// ```
17038    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17039        self.target_link = v.into();
17040        self
17041    }
17042
17043    /// Sets the value of [location][crate::model::Operation::location].
17044    ///
17045    /// # Example
17046    /// ```ignore,no_run
17047    /// # use google_cloud_container_v1::model::Operation;
17048    /// let x = Operation::new().set_location("example");
17049    /// ```
17050    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17051        self.location = v.into();
17052        self
17053    }
17054
17055    /// Sets the value of [start_time][crate::model::Operation::start_time].
17056    ///
17057    /// # Example
17058    /// ```ignore,no_run
17059    /// # use google_cloud_container_v1::model::Operation;
17060    /// let x = Operation::new().set_start_time("example");
17061    /// ```
17062    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17063        self.start_time = v.into();
17064        self
17065    }
17066
17067    /// Sets the value of [end_time][crate::model::Operation::end_time].
17068    ///
17069    /// # Example
17070    /// ```ignore,no_run
17071    /// # use google_cloud_container_v1::model::Operation;
17072    /// let x = Operation::new().set_end_time("example");
17073    /// ```
17074    pub fn set_end_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17075        self.end_time = v.into();
17076        self
17077    }
17078
17079    /// Sets the value of [progress][crate::model::Operation::progress].
17080    ///
17081    /// # Example
17082    /// ```ignore,no_run
17083    /// # use google_cloud_container_v1::model::Operation;
17084    /// use google_cloud_container_v1::model::OperationProgress;
17085    /// let x = Operation::new().set_progress(OperationProgress::default()/* use setters */);
17086    /// ```
17087    pub fn set_progress<T>(mut self, v: T) -> Self
17088    where
17089        T: std::convert::Into<crate::model::OperationProgress>,
17090    {
17091        self.progress = std::option::Option::Some(v.into());
17092        self
17093    }
17094
17095    /// Sets or clears the value of [progress][crate::model::Operation::progress].
17096    ///
17097    /// # Example
17098    /// ```ignore,no_run
17099    /// # use google_cloud_container_v1::model::Operation;
17100    /// use google_cloud_container_v1::model::OperationProgress;
17101    /// let x = Operation::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
17102    /// let x = Operation::new().set_or_clear_progress(None::<OperationProgress>);
17103    /// ```
17104    pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
17105    where
17106        T: std::convert::Into<crate::model::OperationProgress>,
17107    {
17108        self.progress = v.map(|x| x.into());
17109        self
17110    }
17111
17112    /// Sets the value of [cluster_conditions][crate::model::Operation::cluster_conditions].
17113    ///
17114    /// # Example
17115    /// ```ignore,no_run
17116    /// # use google_cloud_container_v1::model::Operation;
17117    /// use google_cloud_container_v1::model::StatusCondition;
17118    /// let x = Operation::new()
17119    ///     .set_cluster_conditions([
17120    ///         StatusCondition::default()/* use setters */,
17121    ///         StatusCondition::default()/* use (different) setters */,
17122    ///     ]);
17123    /// ```
17124    #[deprecated]
17125    pub fn set_cluster_conditions<T, V>(mut self, v: T) -> Self
17126    where
17127        T: std::iter::IntoIterator<Item = V>,
17128        V: std::convert::Into<crate::model::StatusCondition>,
17129    {
17130        use std::iter::Iterator;
17131        self.cluster_conditions = v.into_iter().map(|i| i.into()).collect();
17132        self
17133    }
17134
17135    /// Sets the value of [nodepool_conditions][crate::model::Operation::nodepool_conditions].
17136    ///
17137    /// # Example
17138    /// ```ignore,no_run
17139    /// # use google_cloud_container_v1::model::Operation;
17140    /// use google_cloud_container_v1::model::StatusCondition;
17141    /// let x = Operation::new()
17142    ///     .set_nodepool_conditions([
17143    ///         StatusCondition::default()/* use setters */,
17144    ///         StatusCondition::default()/* use (different) setters */,
17145    ///     ]);
17146    /// ```
17147    #[deprecated]
17148    pub fn set_nodepool_conditions<T, V>(mut self, v: T) -> Self
17149    where
17150        T: std::iter::IntoIterator<Item = V>,
17151        V: std::convert::Into<crate::model::StatusCondition>,
17152    {
17153        use std::iter::Iterator;
17154        self.nodepool_conditions = v.into_iter().map(|i| i.into()).collect();
17155        self
17156    }
17157
17158    /// Sets the value of [error][crate::model::Operation::error].
17159    ///
17160    /// # Example
17161    /// ```ignore,no_run
17162    /// # use google_cloud_container_v1::model::Operation;
17163    /// use rpc::model::Status;
17164    /// let x = Operation::new().set_error(Status::default()/* use setters */);
17165    /// ```
17166    pub fn set_error<T>(mut self, v: T) -> Self
17167    where
17168        T: std::convert::Into<rpc::model::Status>,
17169    {
17170        self.error = std::option::Option::Some(v.into());
17171        self
17172    }
17173
17174    /// Sets or clears the value of [error][crate::model::Operation::error].
17175    ///
17176    /// # Example
17177    /// ```ignore,no_run
17178    /// # use google_cloud_container_v1::model::Operation;
17179    /// use rpc::model::Status;
17180    /// let x = Operation::new().set_or_clear_error(Some(Status::default()/* use setters */));
17181    /// let x = Operation::new().set_or_clear_error(None::<Status>);
17182    /// ```
17183    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
17184    where
17185        T: std::convert::Into<rpc::model::Status>,
17186    {
17187        self.error = v.map(|x| x.into());
17188        self
17189    }
17190}
17191
17192impl wkt::message::Message for Operation {
17193    fn typename() -> &'static str {
17194        "type.googleapis.com/google.container.v1.Operation"
17195    }
17196}
17197
17198/// Defines additional types related to [Operation].
17199pub mod operation {
17200    #[allow(unused_imports)]
17201    use super::*;
17202
17203    /// Current status of the operation.
17204    ///
17205    /// # Working with unknown values
17206    ///
17207    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17208    /// additional enum variants at any time. Adding new variants is not considered
17209    /// a breaking change. Applications should write their code in anticipation of:
17210    ///
17211    /// - New values appearing in future releases of the client library, **and**
17212    /// - New values received dynamically, without application changes.
17213    ///
17214    /// Please consult the [Working with enums] section in the user guide for some
17215    /// guidelines.
17216    ///
17217    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17218    #[derive(Clone, Debug, PartialEq)]
17219    #[non_exhaustive]
17220    pub enum Status {
17221        /// Not set.
17222        Unspecified,
17223        /// The operation has been created.
17224        Pending,
17225        /// The operation is currently running.
17226        Running,
17227        /// The operation is done, either cancelled or completed.
17228        Done,
17229        /// The operation is aborting.
17230        Aborting,
17231        /// If set, the enum was initialized with an unknown value.
17232        ///
17233        /// Applications can examine the value using [Status::value] or
17234        /// [Status::name].
17235        UnknownValue(status::UnknownValue),
17236    }
17237
17238    #[doc(hidden)]
17239    pub mod status {
17240        #[allow(unused_imports)]
17241        use super::*;
17242        #[derive(Clone, Debug, PartialEq)]
17243        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17244    }
17245
17246    impl Status {
17247        /// Gets the enum value.
17248        ///
17249        /// Returns `None` if the enum contains an unknown value deserialized from
17250        /// the string representation of enums.
17251        pub fn value(&self) -> std::option::Option<i32> {
17252            match self {
17253                Self::Unspecified => std::option::Option::Some(0),
17254                Self::Pending => std::option::Option::Some(1),
17255                Self::Running => std::option::Option::Some(2),
17256                Self::Done => std::option::Option::Some(3),
17257                Self::Aborting => std::option::Option::Some(4),
17258                Self::UnknownValue(u) => u.0.value(),
17259            }
17260        }
17261
17262        /// Gets the enum value as a string.
17263        ///
17264        /// Returns `None` if the enum contains an unknown value deserialized from
17265        /// the integer representation of enums.
17266        pub fn name(&self) -> std::option::Option<&str> {
17267            match self {
17268                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
17269                Self::Pending => std::option::Option::Some("PENDING"),
17270                Self::Running => std::option::Option::Some("RUNNING"),
17271                Self::Done => std::option::Option::Some("DONE"),
17272                Self::Aborting => std::option::Option::Some("ABORTING"),
17273                Self::UnknownValue(u) => u.0.name(),
17274            }
17275        }
17276    }
17277
17278    impl std::default::Default for Status {
17279        fn default() -> Self {
17280            use std::convert::From;
17281            Self::from(0)
17282        }
17283    }
17284
17285    impl std::fmt::Display for Status {
17286        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17287            wkt::internal::display_enum(f, self.name(), self.value())
17288        }
17289    }
17290
17291    impl std::convert::From<i32> for Status {
17292        fn from(value: i32) -> Self {
17293            match value {
17294                0 => Self::Unspecified,
17295                1 => Self::Pending,
17296                2 => Self::Running,
17297                3 => Self::Done,
17298                4 => Self::Aborting,
17299                _ => Self::UnknownValue(status::UnknownValue(
17300                    wkt::internal::UnknownEnumValue::Integer(value),
17301                )),
17302            }
17303        }
17304    }
17305
17306    impl std::convert::From<&str> for Status {
17307        fn from(value: &str) -> Self {
17308            use std::string::ToString;
17309            match value {
17310                "STATUS_UNSPECIFIED" => Self::Unspecified,
17311                "PENDING" => Self::Pending,
17312                "RUNNING" => Self::Running,
17313                "DONE" => Self::Done,
17314                "ABORTING" => Self::Aborting,
17315                _ => Self::UnknownValue(status::UnknownValue(
17316                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17317                )),
17318            }
17319        }
17320    }
17321
17322    impl serde::ser::Serialize for Status {
17323        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17324        where
17325            S: serde::Serializer,
17326        {
17327            match self {
17328                Self::Unspecified => serializer.serialize_i32(0),
17329                Self::Pending => serializer.serialize_i32(1),
17330                Self::Running => serializer.serialize_i32(2),
17331                Self::Done => serializer.serialize_i32(3),
17332                Self::Aborting => serializer.serialize_i32(4),
17333                Self::UnknownValue(u) => u.0.serialize(serializer),
17334            }
17335        }
17336    }
17337
17338    impl<'de> serde::de::Deserialize<'de> for Status {
17339        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17340        where
17341            D: serde::Deserializer<'de>,
17342        {
17343            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
17344                ".google.container.v1.Operation.Status",
17345            ))
17346        }
17347    }
17348
17349    /// Operation type categorizes the operation.
17350    ///
17351    /// # Working with unknown values
17352    ///
17353    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17354    /// additional enum variants at any time. Adding new variants is not considered
17355    /// a breaking change. Applications should write their code in anticipation of:
17356    ///
17357    /// - New values appearing in future releases of the client library, **and**
17358    /// - New values received dynamically, without application changes.
17359    ///
17360    /// Please consult the [Working with enums] section in the user guide for some
17361    /// guidelines.
17362    ///
17363    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17364    #[derive(Clone, Debug, PartialEq)]
17365    #[non_exhaustive]
17366    pub enum Type {
17367        /// Not set.
17368        Unspecified,
17369        /// The cluster is being created. The cluster should be assumed to be
17370        /// unusable until the operation finishes.
17371        ///
17372        /// In the event of the operation failing, the cluster will enter the
17373        /// [ERROR state][google.container.v1.Cluster.Status.ERROR] and eventually be
17374        /// deleted.
17375        ///
17376        /// [google.container.v1.Cluster.Status.ERROR]: crate::model::cluster::Status::Error
17377        CreateCluster,
17378        /// The cluster is being deleted. The cluster should be assumed to be
17379        /// unusable as soon as this operation starts.
17380        ///
17381        /// In the event of the operation failing, the cluster will enter the
17382        /// [ERROR state][google.container.v1.Cluster.Status.ERROR] and the deletion
17383        /// will be automatically retried until completed.
17384        ///
17385        /// [google.container.v1.Cluster.Status.ERROR]: crate::model::cluster::Status::Error
17386        DeleteCluster,
17387        /// The [cluster
17388        /// version][google.container.v1.ClusterUpdate.desired_master_version] is
17389        /// being updated. Note that this includes "upgrades" to the same version,
17390        /// which are simply a recreation. This also includes
17391        /// [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically).
17392        /// For more details, see [documentation on cluster
17393        /// upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades).
17394        ///
17395        /// [google.container.v1.ClusterUpdate.desired_master_version]: crate::model::ClusterUpdate::desired_master_version
17396        UpgradeMaster,
17397        /// A node pool is being updated. Despite calling this an "upgrade", this
17398        /// includes most forms of updates to node pools. This also includes
17399        /// [auto-upgrades](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades).
17400        ///
17401        /// This operation sets the
17402        /// [progress][google.container.v1.Operation.progress] field and may be
17403        /// [canceled][google.container.v1.ClusterManager.CancelOperation].
17404        ///
17405        /// The upgrade strategy depends on [node pool
17406        /// configuration](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies).
17407        /// The nodes are generally still usable during this operation.
17408        ///
17409        /// [google.container.v1.ClusterManager.CancelOperation]: crate::client::ClusterManager::cancel_operation
17410        /// [google.container.v1.Operation.progress]: crate::model::Operation::progress
17411        UpgradeNodes,
17412        /// A problem has been detected with the control plane and is being repaired.
17413        /// This operation type is initiated by GKE. For more details, see
17414        /// [documentation on
17415        /// repairs](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
17416        RepairCluster,
17417        /// The cluster is being updated. This is a broad category of operations and
17418        /// includes operations that only change metadata as well as those that must
17419        /// recreate the entire cluster. If the control plane must be recreated, this
17420        /// will cause temporary downtime for zonal clusters.
17421        ///
17422        /// Some features require recreating the nodes as well. Those will be
17423        /// recreated as separate operations and the update may not be completely
17424        /// functional until the node pools recreations finish. Node recreations will
17425        /// generally follow [maintenance
17426        /// policies](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions).
17427        ///
17428        /// Some GKE-initiated operations use this type. This includes certain types
17429        /// of auto-upgrades and incident mitigations.
17430        UpdateCluster,
17431        /// A node pool is being created. The node pool should be assumed to be
17432        /// unusable until this operation finishes. In the event of an error, the
17433        /// node pool may be partially created.
17434        ///
17435        /// If enabled, [node
17436        /// autoprovisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning)
17437        /// may have automatically initiated such operations.
17438        CreateNodePool,
17439        /// The node pool is being deleted. The node pool should be assumed to be
17440        /// unusable as soon as this operation starts.
17441        DeleteNodePool,
17442        /// The node pool's [manamagent][google.container.v1.NodePool.management]
17443        /// field is being updated. These operations only update metadata and may be
17444        /// concurrent with most other operations.
17445        ///
17446        /// [google.container.v1.NodePool.management]: crate::model::NodePool::management
17447        SetNodePoolManagement,
17448        /// A problem has been detected with nodes and [they are being
17449        /// repaired](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair).
17450        /// This operation type is initiated by GKE, typically automatically. This
17451        /// operation may be concurrent with other operations and there may be
17452        /// multiple repairs occurring on the same node pool.
17453        AutoRepairNodes,
17454        /// Unused. Automatic node upgrade uses
17455        /// [UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES].
17456        ///
17457        /// [google.container.v1.Operation.Type.UPGRADE_NODES]: crate::model::operation::Type::UpgradeNodes
17458        #[deprecated]
17459        AutoUpgradeNodes,
17460        /// Unused. Updating labels uses
17461        /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
17462        ///
17463        /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
17464        #[deprecated]
17465        SetLabels,
17466        /// Unused. Updating master auth uses
17467        /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
17468        ///
17469        /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
17470        #[deprecated]
17471        SetMasterAuth,
17472        /// The node pool is being resized. With the exception of resizing to or from
17473        /// size zero, the node pool is generally usable during this operation.
17474        SetNodePoolSize,
17475        /// Unused. Updating network policy uses
17476        /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
17477        ///
17478        /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
17479        #[deprecated]
17480        SetNetworkPolicy,
17481        /// Unused. Updating maintenance policy uses
17482        /// [UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
17483        ///
17484        /// [google.container.v1.Operation.Type.UPDATE_CLUSTER]: crate::model::operation::Type::UpdateCluster
17485        #[deprecated]
17486        SetMaintenancePolicy,
17487        /// The control plane is being resized. This operation type is initiated by
17488        /// GKE. These operations are often performed preemptively to ensure that the
17489        /// control plane has sufficient resources and is not typically an indication
17490        /// of issues. For more details, see
17491        /// [documentation on
17492        /// resizes](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs).
17493        ResizeCluster,
17494        /// Fleet features of GKE Enterprise are being upgraded. The cluster should
17495        /// be assumed to be blocked for other upgrades until the operation finishes.
17496        FleetFeatureUpgrade,
17497        /// If set, the enum was initialized with an unknown value.
17498        ///
17499        /// Applications can examine the value using [Type::value] or
17500        /// [Type::name].
17501        UnknownValue(r#type::UnknownValue),
17502    }
17503
17504    #[doc(hidden)]
17505    pub mod r#type {
17506        #[allow(unused_imports)]
17507        use super::*;
17508        #[derive(Clone, Debug, PartialEq)]
17509        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17510    }
17511
17512    impl Type {
17513        /// Gets the enum value.
17514        ///
17515        /// Returns `None` if the enum contains an unknown value deserialized from
17516        /// the string representation of enums.
17517        pub fn value(&self) -> std::option::Option<i32> {
17518            match self {
17519                Self::Unspecified => std::option::Option::Some(0),
17520                Self::CreateCluster => std::option::Option::Some(1),
17521                Self::DeleteCluster => std::option::Option::Some(2),
17522                Self::UpgradeMaster => std::option::Option::Some(3),
17523                Self::UpgradeNodes => std::option::Option::Some(4),
17524                Self::RepairCluster => std::option::Option::Some(5),
17525                Self::UpdateCluster => std::option::Option::Some(6),
17526                Self::CreateNodePool => std::option::Option::Some(7),
17527                Self::DeleteNodePool => std::option::Option::Some(8),
17528                Self::SetNodePoolManagement => std::option::Option::Some(9),
17529                Self::AutoRepairNodes => std::option::Option::Some(10),
17530                Self::AutoUpgradeNodes => std::option::Option::Some(11),
17531                Self::SetLabels => std::option::Option::Some(12),
17532                Self::SetMasterAuth => std::option::Option::Some(13),
17533                Self::SetNodePoolSize => std::option::Option::Some(14),
17534                Self::SetNetworkPolicy => std::option::Option::Some(15),
17535                Self::SetMaintenancePolicy => std::option::Option::Some(16),
17536                Self::ResizeCluster => std::option::Option::Some(18),
17537                Self::FleetFeatureUpgrade => std::option::Option::Some(19),
17538                Self::UnknownValue(u) => u.0.value(),
17539            }
17540        }
17541
17542        /// Gets the enum value as a string.
17543        ///
17544        /// Returns `None` if the enum contains an unknown value deserialized from
17545        /// the integer representation of enums.
17546        pub fn name(&self) -> std::option::Option<&str> {
17547            match self {
17548                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17549                Self::CreateCluster => std::option::Option::Some("CREATE_CLUSTER"),
17550                Self::DeleteCluster => std::option::Option::Some("DELETE_CLUSTER"),
17551                Self::UpgradeMaster => std::option::Option::Some("UPGRADE_MASTER"),
17552                Self::UpgradeNodes => std::option::Option::Some("UPGRADE_NODES"),
17553                Self::RepairCluster => std::option::Option::Some("REPAIR_CLUSTER"),
17554                Self::UpdateCluster => std::option::Option::Some("UPDATE_CLUSTER"),
17555                Self::CreateNodePool => std::option::Option::Some("CREATE_NODE_POOL"),
17556                Self::DeleteNodePool => std::option::Option::Some("DELETE_NODE_POOL"),
17557                Self::SetNodePoolManagement => {
17558                    std::option::Option::Some("SET_NODE_POOL_MANAGEMENT")
17559                }
17560                Self::AutoRepairNodes => std::option::Option::Some("AUTO_REPAIR_NODES"),
17561                Self::AutoUpgradeNodes => std::option::Option::Some("AUTO_UPGRADE_NODES"),
17562                Self::SetLabels => std::option::Option::Some("SET_LABELS"),
17563                Self::SetMasterAuth => std::option::Option::Some("SET_MASTER_AUTH"),
17564                Self::SetNodePoolSize => std::option::Option::Some("SET_NODE_POOL_SIZE"),
17565                Self::SetNetworkPolicy => std::option::Option::Some("SET_NETWORK_POLICY"),
17566                Self::SetMaintenancePolicy => std::option::Option::Some("SET_MAINTENANCE_POLICY"),
17567                Self::ResizeCluster => std::option::Option::Some("RESIZE_CLUSTER"),
17568                Self::FleetFeatureUpgrade => std::option::Option::Some("FLEET_FEATURE_UPGRADE"),
17569                Self::UnknownValue(u) => u.0.name(),
17570            }
17571        }
17572    }
17573
17574    impl std::default::Default for Type {
17575        fn default() -> Self {
17576            use std::convert::From;
17577            Self::from(0)
17578        }
17579    }
17580
17581    impl std::fmt::Display for Type {
17582        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17583            wkt::internal::display_enum(f, self.name(), self.value())
17584        }
17585    }
17586
17587    impl std::convert::From<i32> for Type {
17588        fn from(value: i32) -> Self {
17589            match value {
17590                0 => Self::Unspecified,
17591                1 => Self::CreateCluster,
17592                2 => Self::DeleteCluster,
17593                3 => Self::UpgradeMaster,
17594                4 => Self::UpgradeNodes,
17595                5 => Self::RepairCluster,
17596                6 => Self::UpdateCluster,
17597                7 => Self::CreateNodePool,
17598                8 => Self::DeleteNodePool,
17599                9 => Self::SetNodePoolManagement,
17600                10 => Self::AutoRepairNodes,
17601                11 => Self::AutoUpgradeNodes,
17602                12 => Self::SetLabels,
17603                13 => Self::SetMasterAuth,
17604                14 => Self::SetNodePoolSize,
17605                15 => Self::SetNetworkPolicy,
17606                16 => Self::SetMaintenancePolicy,
17607                18 => Self::ResizeCluster,
17608                19 => Self::FleetFeatureUpgrade,
17609                _ => Self::UnknownValue(r#type::UnknownValue(
17610                    wkt::internal::UnknownEnumValue::Integer(value),
17611                )),
17612            }
17613        }
17614    }
17615
17616    impl std::convert::From<&str> for Type {
17617        fn from(value: &str) -> Self {
17618            use std::string::ToString;
17619            match value {
17620                "TYPE_UNSPECIFIED" => Self::Unspecified,
17621                "CREATE_CLUSTER" => Self::CreateCluster,
17622                "DELETE_CLUSTER" => Self::DeleteCluster,
17623                "UPGRADE_MASTER" => Self::UpgradeMaster,
17624                "UPGRADE_NODES" => Self::UpgradeNodes,
17625                "REPAIR_CLUSTER" => Self::RepairCluster,
17626                "UPDATE_CLUSTER" => Self::UpdateCluster,
17627                "CREATE_NODE_POOL" => Self::CreateNodePool,
17628                "DELETE_NODE_POOL" => Self::DeleteNodePool,
17629                "SET_NODE_POOL_MANAGEMENT" => Self::SetNodePoolManagement,
17630                "AUTO_REPAIR_NODES" => Self::AutoRepairNodes,
17631                "AUTO_UPGRADE_NODES" => Self::AutoUpgradeNodes,
17632                "SET_LABELS" => Self::SetLabels,
17633                "SET_MASTER_AUTH" => Self::SetMasterAuth,
17634                "SET_NODE_POOL_SIZE" => Self::SetNodePoolSize,
17635                "SET_NETWORK_POLICY" => Self::SetNetworkPolicy,
17636                "SET_MAINTENANCE_POLICY" => Self::SetMaintenancePolicy,
17637                "RESIZE_CLUSTER" => Self::ResizeCluster,
17638                "FLEET_FEATURE_UPGRADE" => Self::FleetFeatureUpgrade,
17639                _ => Self::UnknownValue(r#type::UnknownValue(
17640                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17641                )),
17642            }
17643        }
17644    }
17645
17646    impl serde::ser::Serialize for Type {
17647        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17648        where
17649            S: serde::Serializer,
17650        {
17651            match self {
17652                Self::Unspecified => serializer.serialize_i32(0),
17653                Self::CreateCluster => serializer.serialize_i32(1),
17654                Self::DeleteCluster => serializer.serialize_i32(2),
17655                Self::UpgradeMaster => serializer.serialize_i32(3),
17656                Self::UpgradeNodes => serializer.serialize_i32(4),
17657                Self::RepairCluster => serializer.serialize_i32(5),
17658                Self::UpdateCluster => serializer.serialize_i32(6),
17659                Self::CreateNodePool => serializer.serialize_i32(7),
17660                Self::DeleteNodePool => serializer.serialize_i32(8),
17661                Self::SetNodePoolManagement => serializer.serialize_i32(9),
17662                Self::AutoRepairNodes => serializer.serialize_i32(10),
17663                Self::AutoUpgradeNodes => serializer.serialize_i32(11),
17664                Self::SetLabels => serializer.serialize_i32(12),
17665                Self::SetMasterAuth => serializer.serialize_i32(13),
17666                Self::SetNodePoolSize => serializer.serialize_i32(14),
17667                Self::SetNetworkPolicy => serializer.serialize_i32(15),
17668                Self::SetMaintenancePolicy => serializer.serialize_i32(16),
17669                Self::ResizeCluster => serializer.serialize_i32(18),
17670                Self::FleetFeatureUpgrade => serializer.serialize_i32(19),
17671                Self::UnknownValue(u) => u.0.serialize(serializer),
17672            }
17673        }
17674    }
17675
17676    impl<'de> serde::de::Deserialize<'de> for Type {
17677        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17678        where
17679            D: serde::Deserializer<'de>,
17680        {
17681            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17682                ".google.container.v1.Operation.Type",
17683            ))
17684        }
17685    }
17686}
17687
17688/// Information about operation (or operation stage) progress.
17689#[derive(Clone, Default, PartialEq)]
17690#[non_exhaustive]
17691pub struct OperationProgress {
17692    /// A non-parameterized string describing an operation stage.
17693    /// Unset for single-stage operations.
17694    pub name: std::string::String,
17695
17696    /// Status of an operation stage.
17697    /// Unset for single-stage operations.
17698    pub status: crate::model::operation::Status,
17699
17700    /// Progress metric bundle, for example:
17701    /// metrics: [{name: "nodes done",     int_value: 15},
17702    /// {name: "nodes total",    int_value: 32}]
17703    /// or
17704    /// metrics: [{name: "progress",       double_value: 0.56},
17705    /// {name: "progress scale", double_value: 1.0}]
17706    pub metrics: std::vec::Vec<crate::model::operation_progress::Metric>,
17707
17708    /// Substages of an operation or a stage.
17709    pub stages: std::vec::Vec<crate::model::OperationProgress>,
17710
17711    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17712}
17713
17714impl OperationProgress {
17715    pub fn new() -> Self {
17716        std::default::Default::default()
17717    }
17718
17719    /// Sets the value of [name][crate::model::OperationProgress::name].
17720    ///
17721    /// # Example
17722    /// ```ignore,no_run
17723    /// # use google_cloud_container_v1::model::OperationProgress;
17724    /// let x = OperationProgress::new().set_name("example");
17725    /// ```
17726    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17727        self.name = v.into();
17728        self
17729    }
17730
17731    /// Sets the value of [status][crate::model::OperationProgress::status].
17732    ///
17733    /// # Example
17734    /// ```ignore,no_run
17735    /// # use google_cloud_container_v1::model::OperationProgress;
17736    /// use google_cloud_container_v1::model::operation::Status;
17737    /// let x0 = OperationProgress::new().set_status(Status::Pending);
17738    /// let x1 = OperationProgress::new().set_status(Status::Running);
17739    /// let x2 = OperationProgress::new().set_status(Status::Done);
17740    /// ```
17741    pub fn set_status<T: std::convert::Into<crate::model::operation::Status>>(
17742        mut self,
17743        v: T,
17744    ) -> Self {
17745        self.status = v.into();
17746        self
17747    }
17748
17749    /// Sets the value of [metrics][crate::model::OperationProgress::metrics].
17750    ///
17751    /// # Example
17752    /// ```ignore,no_run
17753    /// # use google_cloud_container_v1::model::OperationProgress;
17754    /// use google_cloud_container_v1::model::operation_progress::Metric;
17755    /// let x = OperationProgress::new()
17756    ///     .set_metrics([
17757    ///         Metric::default()/* use setters */,
17758    ///         Metric::default()/* use (different) setters */,
17759    ///     ]);
17760    /// ```
17761    pub fn set_metrics<T, V>(mut self, v: T) -> Self
17762    where
17763        T: std::iter::IntoIterator<Item = V>,
17764        V: std::convert::Into<crate::model::operation_progress::Metric>,
17765    {
17766        use std::iter::Iterator;
17767        self.metrics = v.into_iter().map(|i| i.into()).collect();
17768        self
17769    }
17770
17771    /// Sets the value of [stages][crate::model::OperationProgress::stages].
17772    ///
17773    /// # Example
17774    /// ```ignore,no_run
17775    /// # use google_cloud_container_v1::model::OperationProgress;
17776    /// let x = OperationProgress::new()
17777    ///     .set_stages([
17778    ///         OperationProgress::default()/* use setters */,
17779    ///         OperationProgress::default()/* use (different) setters */,
17780    ///     ]);
17781    /// ```
17782    pub fn set_stages<T, V>(mut self, v: T) -> Self
17783    where
17784        T: std::iter::IntoIterator<Item = V>,
17785        V: std::convert::Into<crate::model::OperationProgress>,
17786    {
17787        use std::iter::Iterator;
17788        self.stages = v.into_iter().map(|i| i.into()).collect();
17789        self
17790    }
17791}
17792
17793impl wkt::message::Message for OperationProgress {
17794    fn typename() -> &'static str {
17795        "type.googleapis.com/google.container.v1.OperationProgress"
17796    }
17797}
17798
17799/// Defines additional types related to [OperationProgress].
17800pub mod operation_progress {
17801    #[allow(unused_imports)]
17802    use super::*;
17803
17804    /// Progress metric is (string, int|float|string) pair.
17805    #[derive(Clone, Default, PartialEq)]
17806    #[non_exhaustive]
17807    pub struct Metric {
17808        /// Required. Metric name, e.g., "nodes total", "percent done".
17809        pub name: std::string::String,
17810
17811        /// Strictly one of the values is required.
17812        pub value: std::option::Option<crate::model::operation_progress::metric::Value>,
17813
17814        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17815    }
17816
17817    impl Metric {
17818        pub fn new() -> Self {
17819            std::default::Default::default()
17820        }
17821
17822        /// Sets the value of [name][crate::model::operation_progress::Metric::name].
17823        ///
17824        /// # Example
17825        /// ```ignore,no_run
17826        /// # use google_cloud_container_v1::model::operation_progress::Metric;
17827        /// let x = Metric::new().set_name("example");
17828        /// ```
17829        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17830            self.name = v.into();
17831            self
17832        }
17833
17834        /// Sets the value of [value][crate::model::operation_progress::Metric::value].
17835        ///
17836        /// Note that all the setters affecting `value` are mutually
17837        /// exclusive.
17838        ///
17839        /// # Example
17840        /// ```ignore,no_run
17841        /// # use google_cloud_container_v1::model::operation_progress::Metric;
17842        /// use google_cloud_container_v1::model::operation_progress::metric::Value;
17843        /// let x = Metric::new().set_value(Some(Value::IntValue(42)));
17844        /// ```
17845        pub fn set_value<
17846            T: std::convert::Into<
17847                    std::option::Option<crate::model::operation_progress::metric::Value>,
17848                >,
17849        >(
17850            mut self,
17851            v: T,
17852        ) -> Self {
17853            self.value = v.into();
17854            self
17855        }
17856
17857        /// The value of [value][crate::model::operation_progress::Metric::value]
17858        /// if it holds a `IntValue`, `None` if the field is not set or
17859        /// holds a different branch.
17860        pub fn int_value(&self) -> std::option::Option<&i64> {
17861            #[allow(unreachable_patterns)]
17862            self.value.as_ref().and_then(|v| match v {
17863                crate::model::operation_progress::metric::Value::IntValue(v) => {
17864                    std::option::Option::Some(v)
17865                }
17866                _ => std::option::Option::None,
17867            })
17868        }
17869
17870        /// Sets the value of [value][crate::model::operation_progress::Metric::value]
17871        /// to hold a `IntValue`.
17872        ///
17873        /// Note that all the setters affecting `value` are
17874        /// mutually exclusive.
17875        ///
17876        /// # Example
17877        /// ```ignore,no_run
17878        /// # use google_cloud_container_v1::model::operation_progress::Metric;
17879        /// let x = Metric::new().set_int_value(42);
17880        /// assert!(x.int_value().is_some());
17881        /// assert!(x.double_value().is_none());
17882        /// assert!(x.string_value().is_none());
17883        /// ```
17884        pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
17885            self.value = std::option::Option::Some(
17886                crate::model::operation_progress::metric::Value::IntValue(v.into()),
17887            );
17888            self
17889        }
17890
17891        /// The value of [value][crate::model::operation_progress::Metric::value]
17892        /// if it holds a `DoubleValue`, `None` if the field is not set or
17893        /// holds a different branch.
17894        pub fn double_value(&self) -> std::option::Option<&f64> {
17895            #[allow(unreachable_patterns)]
17896            self.value.as_ref().and_then(|v| match v {
17897                crate::model::operation_progress::metric::Value::DoubleValue(v) => {
17898                    std::option::Option::Some(v)
17899                }
17900                _ => std::option::Option::None,
17901            })
17902        }
17903
17904        /// Sets the value of [value][crate::model::operation_progress::Metric::value]
17905        /// to hold a `DoubleValue`.
17906        ///
17907        /// Note that all the setters affecting `value` are
17908        /// mutually exclusive.
17909        ///
17910        /// # Example
17911        /// ```ignore,no_run
17912        /// # use google_cloud_container_v1::model::operation_progress::Metric;
17913        /// let x = Metric::new().set_double_value(42.0);
17914        /// assert!(x.double_value().is_some());
17915        /// assert!(x.int_value().is_none());
17916        /// assert!(x.string_value().is_none());
17917        /// ```
17918        pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
17919            self.value = std::option::Option::Some(
17920                crate::model::operation_progress::metric::Value::DoubleValue(v.into()),
17921            );
17922            self
17923        }
17924
17925        /// The value of [value][crate::model::operation_progress::Metric::value]
17926        /// if it holds a `StringValue`, `None` if the field is not set or
17927        /// holds a different branch.
17928        pub fn string_value(&self) -> std::option::Option<&std::string::String> {
17929            #[allow(unreachable_patterns)]
17930            self.value.as_ref().and_then(|v| match v {
17931                crate::model::operation_progress::metric::Value::StringValue(v) => {
17932                    std::option::Option::Some(v)
17933                }
17934                _ => std::option::Option::None,
17935            })
17936        }
17937
17938        /// Sets the value of [value][crate::model::operation_progress::Metric::value]
17939        /// to hold a `StringValue`.
17940        ///
17941        /// Note that all the setters affecting `value` are
17942        /// mutually exclusive.
17943        ///
17944        /// # Example
17945        /// ```ignore,no_run
17946        /// # use google_cloud_container_v1::model::operation_progress::Metric;
17947        /// let x = Metric::new().set_string_value("example");
17948        /// assert!(x.string_value().is_some());
17949        /// assert!(x.int_value().is_none());
17950        /// assert!(x.double_value().is_none());
17951        /// ```
17952        pub fn set_string_value<T: std::convert::Into<std::string::String>>(
17953            mut self,
17954            v: T,
17955        ) -> Self {
17956            self.value = std::option::Option::Some(
17957                crate::model::operation_progress::metric::Value::StringValue(v.into()),
17958            );
17959            self
17960        }
17961    }
17962
17963    impl wkt::message::Message for Metric {
17964        fn typename() -> &'static str {
17965            "type.googleapis.com/google.container.v1.OperationProgress.Metric"
17966        }
17967    }
17968
17969    /// Defines additional types related to [Metric].
17970    pub mod metric {
17971        #[allow(unused_imports)]
17972        use super::*;
17973
17974        /// Strictly one of the values is required.
17975        #[derive(Clone, Debug, PartialEq)]
17976        #[non_exhaustive]
17977        pub enum Value {
17978            /// For metrics with integer value.
17979            IntValue(i64),
17980            /// For metrics with floating point value.
17981            DoubleValue(f64),
17982            /// For metrics with custom values (ratios, visual progress, etc.).
17983            StringValue(std::string::String),
17984        }
17985    }
17986}
17987
17988/// CreateClusterRequest creates a cluster.
17989#[derive(Clone, Default, PartialEq)]
17990#[non_exhaustive]
17991pub struct CreateClusterRequest {
17992    /// Deprecated. The Google Developers Console [project ID or project
17993    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
17994    /// This field has been deprecated and replaced by the parent field.
17995    #[deprecated]
17996    pub project_id: std::string::String,
17997
17998    /// Deprecated. The name of the Google Compute Engine
17999    /// [zone](https://cloud.google.com/compute/docs/zones#available)
18000    /// in which the cluster resides. This field has been deprecated and replaced
18001    /// by the parent field.
18002    #[deprecated]
18003    pub zone: std::string::String,
18004
18005    /// Required. A [cluster
18006    /// resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters)
18007    pub cluster: std::option::Option<crate::model::Cluster>,
18008
18009    /// The parent (project and location) where the cluster will be created.
18010    /// Specified in the format `projects/*/locations/*`.
18011    pub parent: std::string::String,
18012
18013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18014}
18015
18016impl CreateClusterRequest {
18017    pub fn new() -> Self {
18018        std::default::Default::default()
18019    }
18020
18021    /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
18022    ///
18023    /// # Example
18024    /// ```ignore,no_run
18025    /// # use google_cloud_container_v1::model::CreateClusterRequest;
18026    /// let x = CreateClusterRequest::new().set_project_id("example");
18027    /// ```
18028    #[deprecated]
18029    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18030        self.project_id = v.into();
18031        self
18032    }
18033
18034    /// Sets the value of [zone][crate::model::CreateClusterRequest::zone].
18035    ///
18036    /// # Example
18037    /// ```ignore,no_run
18038    /// # use google_cloud_container_v1::model::CreateClusterRequest;
18039    /// let x = CreateClusterRequest::new().set_zone("example");
18040    /// ```
18041    #[deprecated]
18042    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18043        self.zone = v.into();
18044        self
18045    }
18046
18047    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
18048    ///
18049    /// # Example
18050    /// ```ignore,no_run
18051    /// # use google_cloud_container_v1::model::CreateClusterRequest;
18052    /// use google_cloud_container_v1::model::Cluster;
18053    /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
18054    /// ```
18055    pub fn set_cluster<T>(mut self, v: T) -> Self
18056    where
18057        T: std::convert::Into<crate::model::Cluster>,
18058    {
18059        self.cluster = std::option::Option::Some(v.into());
18060        self
18061    }
18062
18063    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
18064    ///
18065    /// # Example
18066    /// ```ignore,no_run
18067    /// # use google_cloud_container_v1::model::CreateClusterRequest;
18068    /// use google_cloud_container_v1::model::Cluster;
18069    /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
18070    /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
18071    /// ```
18072    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
18073    where
18074        T: std::convert::Into<crate::model::Cluster>,
18075    {
18076        self.cluster = v.map(|x| x.into());
18077        self
18078    }
18079
18080    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
18081    ///
18082    /// # Example
18083    /// ```ignore,no_run
18084    /// # use google_cloud_container_v1::model::CreateClusterRequest;
18085    /// let x = CreateClusterRequest::new().set_parent("example");
18086    /// ```
18087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18088        self.parent = v.into();
18089        self
18090    }
18091}
18092
18093impl wkt::message::Message for CreateClusterRequest {
18094    fn typename() -> &'static str {
18095        "type.googleapis.com/google.container.v1.CreateClusterRequest"
18096    }
18097}
18098
18099/// GetClusterRequest gets the settings of a cluster.
18100#[derive(Clone, Default, PartialEq)]
18101#[non_exhaustive]
18102pub struct GetClusterRequest {
18103    /// Deprecated. The Google Developers Console [project ID or project
18104    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
18105    /// This field has been deprecated and replaced by the name field.
18106    #[deprecated]
18107    pub project_id: std::string::String,
18108
18109    /// Deprecated. The name of the Google Compute Engine
18110    /// [zone](https://cloud.google.com/compute/docs/zones#available)
18111    /// in which the cluster resides. This field has been deprecated and replaced
18112    /// by the name field.
18113    #[deprecated]
18114    pub zone: std::string::String,
18115
18116    /// Deprecated. The name of the cluster to retrieve.
18117    /// This field has been deprecated and replaced by the name field.
18118    #[deprecated]
18119    pub cluster_id: std::string::String,
18120
18121    /// The name (project, location, cluster) of the cluster to retrieve.
18122    /// Specified in the format `projects/*/locations/*/clusters/*`.
18123    pub name: std::string::String,
18124
18125    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18126}
18127
18128impl GetClusterRequest {
18129    pub fn new() -> Self {
18130        std::default::Default::default()
18131    }
18132
18133    /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
18134    ///
18135    /// # Example
18136    /// ```ignore,no_run
18137    /// # use google_cloud_container_v1::model::GetClusterRequest;
18138    /// let x = GetClusterRequest::new().set_project_id("example");
18139    /// ```
18140    #[deprecated]
18141    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18142        self.project_id = v.into();
18143        self
18144    }
18145
18146    /// Sets the value of [zone][crate::model::GetClusterRequest::zone].
18147    ///
18148    /// # Example
18149    /// ```ignore,no_run
18150    /// # use google_cloud_container_v1::model::GetClusterRequest;
18151    /// let x = GetClusterRequest::new().set_zone("example");
18152    /// ```
18153    #[deprecated]
18154    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18155        self.zone = v.into();
18156        self
18157    }
18158
18159    /// Sets the value of [cluster_id][crate::model::GetClusterRequest::cluster_id].
18160    ///
18161    /// # Example
18162    /// ```ignore,no_run
18163    /// # use google_cloud_container_v1::model::GetClusterRequest;
18164    /// let x = GetClusterRequest::new().set_cluster_id("example");
18165    /// ```
18166    #[deprecated]
18167    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18168        self.cluster_id = v.into();
18169        self
18170    }
18171
18172    /// Sets the value of [name][crate::model::GetClusterRequest::name].
18173    ///
18174    /// # Example
18175    /// ```ignore,no_run
18176    /// # use google_cloud_container_v1::model::GetClusterRequest;
18177    /// let x = GetClusterRequest::new().set_name("example");
18178    /// ```
18179    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18180        self.name = v.into();
18181        self
18182    }
18183}
18184
18185impl wkt::message::Message for GetClusterRequest {
18186    fn typename() -> &'static str {
18187        "type.googleapis.com/google.container.v1.GetClusterRequest"
18188    }
18189}
18190
18191/// UpdateClusterRequest updates the settings of a cluster.
18192#[derive(Clone, Default, PartialEq)]
18193#[non_exhaustive]
18194pub struct UpdateClusterRequest {
18195    /// Deprecated. The Google Developers Console [project ID or project
18196    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
18197    /// This field has been deprecated and replaced by the name field.
18198    #[deprecated]
18199    pub project_id: std::string::String,
18200
18201    /// Deprecated. The name of the Google Compute Engine
18202    /// [zone](https://cloud.google.com/compute/docs/zones#available)
18203    /// in which the cluster resides. This field has been deprecated and replaced
18204    /// by the name field.
18205    #[deprecated]
18206    pub zone: std::string::String,
18207
18208    /// Deprecated. The name of the cluster to upgrade.
18209    /// This field has been deprecated and replaced by the name field.
18210    #[deprecated]
18211    pub cluster_id: std::string::String,
18212
18213    /// Required. A description of the update.
18214    pub update: std::option::Option<crate::model::ClusterUpdate>,
18215
18216    /// The name (project, location, cluster) of the cluster to update.
18217    /// Specified in the format `projects/*/locations/*/clusters/*`.
18218    pub name: std::string::String,
18219
18220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18221}
18222
18223impl UpdateClusterRequest {
18224    pub fn new() -> Self {
18225        std::default::Default::default()
18226    }
18227
18228    /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
18229    ///
18230    /// # Example
18231    /// ```ignore,no_run
18232    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18233    /// let x = UpdateClusterRequest::new().set_project_id("example");
18234    /// ```
18235    #[deprecated]
18236    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18237        self.project_id = v.into();
18238        self
18239    }
18240
18241    /// Sets the value of [zone][crate::model::UpdateClusterRequest::zone].
18242    ///
18243    /// # Example
18244    /// ```ignore,no_run
18245    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18246    /// let x = UpdateClusterRequest::new().set_zone("example");
18247    /// ```
18248    #[deprecated]
18249    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18250        self.zone = v.into();
18251        self
18252    }
18253
18254    /// Sets the value of [cluster_id][crate::model::UpdateClusterRequest::cluster_id].
18255    ///
18256    /// # Example
18257    /// ```ignore,no_run
18258    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18259    /// let x = UpdateClusterRequest::new().set_cluster_id("example");
18260    /// ```
18261    #[deprecated]
18262    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18263        self.cluster_id = v.into();
18264        self
18265    }
18266
18267    /// Sets the value of [update][crate::model::UpdateClusterRequest::update].
18268    ///
18269    /// # Example
18270    /// ```ignore,no_run
18271    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18272    /// use google_cloud_container_v1::model::ClusterUpdate;
18273    /// let x = UpdateClusterRequest::new().set_update(ClusterUpdate::default()/* use setters */);
18274    /// ```
18275    pub fn set_update<T>(mut self, v: T) -> Self
18276    where
18277        T: std::convert::Into<crate::model::ClusterUpdate>,
18278    {
18279        self.update = std::option::Option::Some(v.into());
18280        self
18281    }
18282
18283    /// Sets or clears the value of [update][crate::model::UpdateClusterRequest::update].
18284    ///
18285    /// # Example
18286    /// ```ignore,no_run
18287    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18288    /// use google_cloud_container_v1::model::ClusterUpdate;
18289    /// let x = UpdateClusterRequest::new().set_or_clear_update(Some(ClusterUpdate::default()/* use setters */));
18290    /// let x = UpdateClusterRequest::new().set_or_clear_update(None::<ClusterUpdate>);
18291    /// ```
18292    pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
18293    where
18294        T: std::convert::Into<crate::model::ClusterUpdate>,
18295    {
18296        self.update = v.map(|x| x.into());
18297        self
18298    }
18299
18300    /// Sets the value of [name][crate::model::UpdateClusterRequest::name].
18301    ///
18302    /// # Example
18303    /// ```ignore,no_run
18304    /// # use google_cloud_container_v1::model::UpdateClusterRequest;
18305    /// let x = UpdateClusterRequest::new().set_name("example");
18306    /// ```
18307    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18308        self.name = v.into();
18309        self
18310    }
18311}
18312
18313impl wkt::message::Message for UpdateClusterRequest {
18314    fn typename() -> &'static str {
18315        "type.googleapis.com/google.container.v1.UpdateClusterRequest"
18316    }
18317}
18318
18319/// UpdateNodePoolRequests update a node pool's image and/or version.
18320#[derive(Clone, Default, PartialEq)]
18321#[non_exhaustive]
18322pub struct UpdateNodePoolRequest {
18323    /// Deprecated. The Google Developers Console [project ID or project
18324    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
18325    /// This field has been deprecated and replaced by the name field.
18326    #[deprecated]
18327    pub project_id: std::string::String,
18328
18329    /// Deprecated. The name of the Google Compute Engine
18330    /// [zone](https://cloud.google.com/compute/docs/zones#available)
18331    /// in which the cluster resides. This field has been deprecated and replaced
18332    /// by the name field.
18333    #[deprecated]
18334    pub zone: std::string::String,
18335
18336    /// Deprecated. The name of the cluster to upgrade.
18337    /// This field has been deprecated and replaced by the name field.
18338    #[deprecated]
18339    pub cluster_id: std::string::String,
18340
18341    /// Deprecated. The name of the node pool to upgrade.
18342    /// This field has been deprecated and replaced by the name field.
18343    #[deprecated]
18344    pub node_pool_id: std::string::String,
18345
18346    /// Required. The Kubernetes version to change the nodes to (typically an
18347    /// upgrade).
18348    ///
18349    /// Users may specify either explicit versions offered by Kubernetes Engine or
18350    /// version aliases, which have the following behavior:
18351    ///
18352    /// - "latest": picks the highest valid Kubernetes version
18353    /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
18354    /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
18355    /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
18356    /// - "-": picks the Kubernetes master version
18357    pub node_version: std::string::String,
18358
18359    /// Required. The desired image type for the node pool. Please see
18360    /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
18361    /// for available image types.
18362    pub image_type: std::string::String,
18363
18364    /// The name (project, location, cluster, node pool) of the node pool to
18365    /// update. Specified in the format
18366    /// `projects/*/locations/*/clusters/*/nodePools/*`.
18367    pub name: std::string::String,
18368
18369    /// The desired list of Google Compute Engine
18370    /// [zones](https://cloud.google.com/compute/docs/zones#available)
18371    /// in which the node pool's nodes should be located. Changing the locations
18372    /// for a node pool will result in nodes being either created or removed from
18373    /// the node pool, depending on whether locations are being added or removed.
18374    ///
18375    /// Warning: It is recommended to update node pool locations in a standalone
18376    /// API call. Do not combine a location update with changes to other fields
18377    /// (such as `tags`, `labels`, `taints`, etc.) in the same request.
18378    /// Otherwise, the API performs a structural modification where changes to
18379    /// other fields will only apply to newly created nodes and will not be
18380    /// applied to existing nodes in the node pool. To ensure all nodes are updated
18381    /// consistently, use a separate API call for location changes.
18382    pub locations: std::vec::Vec<std::string::String>,
18383
18384    /// The desired workload metadata config for the node pool.
18385    pub workload_metadata_config: std::option::Option<crate::model::WorkloadMetadataConfig>,
18386
18387    /// Upgrade settings control disruption and speed of the upgrade.
18388    pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
18389
18390    /// The desired network tags to be applied to all nodes in the node pool.
18391    /// If this field is not present, the tags will not be changed. Otherwise,
18392    /// the existing network tags will be *replaced* with the provided tags.
18393    pub tags: std::option::Option<crate::model::NetworkTags>,
18394
18395    /// The desired node taints to be applied to all nodes in the node pool.
18396    /// If this field is not present, the taints will not be changed. Otherwise,
18397    /// the existing node taints will be *replaced* with the provided taints.
18398    pub taints: std::option::Option<crate::model::NodeTaints>,
18399
18400    /// The desired node labels to be applied to all nodes in the node pool.
18401    /// If this field is not present, the labels will not be changed. Otherwise,
18402    /// the existing node labels will be *replaced* with the provided labels.
18403    pub labels: std::option::Option<crate::model::NodeLabels>,
18404
18405    /// Parameters that can be configured on Linux nodes.
18406    pub linux_node_config: std::option::Option<crate::model::LinuxNodeConfig>,
18407
18408    /// Node kubelet configs.
18409    pub kubelet_config: std::option::Option<crate::model::NodeKubeletConfig>,
18410
18411    /// Node network config.
18412    pub node_network_config: std::option::Option<crate::model::NodeNetworkConfig>,
18413
18414    /// GCFS config.
18415    pub gcfs_config: std::option::Option<crate::model::GcfsConfig>,
18416
18417    /// Confidential nodes config.
18418    /// All the nodes in the node pool will be Confidential VM once enabled.
18419    pub confidential_nodes: std::option::Option<crate::model::ConfidentialNodes>,
18420
18421    /// Enable or disable gvnic on the node pool.
18422    pub gvnic: std::option::Option<crate::model::VirtualNIC>,
18423
18424    /// The current etag of the node pool.
18425    /// If an etag is provided and does not match the current etag of the node
18426    /// pool, update will be blocked and an ABORTED error will be returned.
18427    pub etag: std::string::String,
18428
18429    /// Enable or disable NCCL fast socket for the node pool.
18430    pub fast_socket: std::option::Option<crate::model::FastSocket>,
18431
18432    /// Logging configuration.
18433    pub logging_config: std::option::Option<crate::model::NodePoolLoggingConfig>,
18434
18435    /// The resource labels for the node pool to use to annotate any related
18436    /// Google Compute Engine resources.
18437    pub resource_labels: std::option::Option<crate::model::ResourceLabels>,
18438
18439    /// Parameters that can be configured on Windows nodes.
18440    pub windows_node_config: std::option::Option<crate::model::WindowsNodeConfig>,
18441
18442    /// A list of hardware accelerators to be attached to each node.
18443    /// See
18444    /// <https://cloud.google.com/compute/docs/gpus>
18445    /// for more information about support for GPUs.
18446    pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
18447
18448    /// Optional. The desired [Google Compute Engine machine
18449    /// type](https://cloud.google.com/compute/docs/machine-types)
18450    /// for nodes in the node pool. Initiates an upgrade operation that migrates
18451    /// the nodes in the node pool to the specified machine type.
18452    pub machine_type: std::string::String,
18453
18454    /// Optional. The desired disk type (e.g. 'pd-standard', 'pd-ssd' or
18455    /// 'pd-balanced') for nodes in the node pool.
18456    /// Initiates an upgrade operation that migrates the nodes in the
18457    /// node pool to the specified disk type.
18458    pub disk_type: std::string::String,
18459
18460    /// Optional. The desired disk size for nodes in the node pool specified in GB.
18461    /// The smallest allowed disk size is 10GB.
18462    /// Initiates an upgrade operation that migrates the nodes in the
18463    /// node pool to the specified disk size.
18464    pub disk_size_gb: i64,
18465
18466    /// Desired resource manager tag keys and values to be attached to the nodes
18467    /// for managing Compute Engine firewalls using Network Firewall Policies.
18468    /// Existing tags will be replaced with new values.
18469    pub resource_manager_tags: std::option::Option<crate::model::ResourceManagerTags>,
18470
18471    /// The desired containerd config for nodes in the node pool.
18472    /// Initiates an upgrade operation that recreates the nodes with the new
18473    /// config.
18474    pub containerd_config: std::option::Option<crate::model::ContainerdConfig>,
18475
18476    /// Specifies the configuration of queued provisioning.
18477    pub queued_provisioning: std::option::Option<crate::model::node_pool::QueuedProvisioning>,
18478
18479    /// List of Storage Pools where boot disks are provisioned.
18480    /// Existing Storage Pools will be replaced with storage-pools.
18481    pub storage_pools: std::vec::Vec<std::string::String>,
18482
18483    /// The maximum duration for the nodes to exist.
18484    /// If unspecified, the nodes can exist indefinitely.
18485    pub max_run_duration: std::option::Option<wkt::Duration>,
18486
18487    /// Flex Start flag for enabling Flex Start VM.
18488    pub flex_start: std::option::Option<bool>,
18489
18490    /// The desired boot disk config for nodes in the node pool.
18491    /// Initiates an upgrade operation that migrates the nodes in the
18492    /// node pool to the specified boot disk config.
18493    pub boot_disk: std::option::Option<crate::model::BootDisk>,
18494
18495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18496}
18497
18498impl UpdateNodePoolRequest {
18499    pub fn new() -> Self {
18500        std::default::Default::default()
18501    }
18502
18503    /// Sets the value of [project_id][crate::model::UpdateNodePoolRequest::project_id].
18504    ///
18505    /// # Example
18506    /// ```ignore,no_run
18507    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18508    /// let x = UpdateNodePoolRequest::new().set_project_id("example");
18509    /// ```
18510    #[deprecated]
18511    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18512        self.project_id = v.into();
18513        self
18514    }
18515
18516    /// Sets the value of [zone][crate::model::UpdateNodePoolRequest::zone].
18517    ///
18518    /// # Example
18519    /// ```ignore,no_run
18520    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18521    /// let x = UpdateNodePoolRequest::new().set_zone("example");
18522    /// ```
18523    #[deprecated]
18524    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18525        self.zone = v.into();
18526        self
18527    }
18528
18529    /// Sets the value of [cluster_id][crate::model::UpdateNodePoolRequest::cluster_id].
18530    ///
18531    /// # Example
18532    /// ```ignore,no_run
18533    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18534    /// let x = UpdateNodePoolRequest::new().set_cluster_id("example");
18535    /// ```
18536    #[deprecated]
18537    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18538        self.cluster_id = v.into();
18539        self
18540    }
18541
18542    /// Sets the value of [node_pool_id][crate::model::UpdateNodePoolRequest::node_pool_id].
18543    ///
18544    /// # Example
18545    /// ```ignore,no_run
18546    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18547    /// let x = UpdateNodePoolRequest::new().set_node_pool_id("example");
18548    /// ```
18549    #[deprecated]
18550    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18551        self.node_pool_id = v.into();
18552        self
18553    }
18554
18555    /// Sets the value of [node_version][crate::model::UpdateNodePoolRequest::node_version].
18556    ///
18557    /// # Example
18558    /// ```ignore,no_run
18559    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18560    /// let x = UpdateNodePoolRequest::new().set_node_version("example");
18561    /// ```
18562    pub fn set_node_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18563        self.node_version = v.into();
18564        self
18565    }
18566
18567    /// Sets the value of [image_type][crate::model::UpdateNodePoolRequest::image_type].
18568    ///
18569    /// # Example
18570    /// ```ignore,no_run
18571    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18572    /// let x = UpdateNodePoolRequest::new().set_image_type("example");
18573    /// ```
18574    pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18575        self.image_type = v.into();
18576        self
18577    }
18578
18579    /// Sets the value of [name][crate::model::UpdateNodePoolRequest::name].
18580    ///
18581    /// # Example
18582    /// ```ignore,no_run
18583    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18584    /// let x = UpdateNodePoolRequest::new().set_name("example");
18585    /// ```
18586    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18587        self.name = v.into();
18588        self
18589    }
18590
18591    /// Sets the value of [locations][crate::model::UpdateNodePoolRequest::locations].
18592    ///
18593    /// # Example
18594    /// ```ignore,no_run
18595    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18596    /// let x = UpdateNodePoolRequest::new().set_locations(["a", "b", "c"]);
18597    /// ```
18598    pub fn set_locations<T, V>(mut self, v: T) -> Self
18599    where
18600        T: std::iter::IntoIterator<Item = V>,
18601        V: std::convert::Into<std::string::String>,
18602    {
18603        use std::iter::Iterator;
18604        self.locations = v.into_iter().map(|i| i.into()).collect();
18605        self
18606    }
18607
18608    /// Sets the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
18609    ///
18610    /// # Example
18611    /// ```ignore,no_run
18612    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18613    /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
18614    /// let x = UpdateNodePoolRequest::new().set_workload_metadata_config(WorkloadMetadataConfig::default()/* use setters */);
18615    /// ```
18616    pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
18617    where
18618        T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
18619    {
18620        self.workload_metadata_config = std::option::Option::Some(v.into());
18621        self
18622    }
18623
18624    /// Sets or clears the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
18625    ///
18626    /// # Example
18627    /// ```ignore,no_run
18628    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18629    /// use google_cloud_container_v1::model::WorkloadMetadataConfig;
18630    /// let x = UpdateNodePoolRequest::new().set_or_clear_workload_metadata_config(Some(WorkloadMetadataConfig::default()/* use setters */));
18631    /// let x = UpdateNodePoolRequest::new().set_or_clear_workload_metadata_config(None::<WorkloadMetadataConfig>);
18632    /// ```
18633    pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
18634    where
18635        T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
18636    {
18637        self.workload_metadata_config = v.map(|x| x.into());
18638        self
18639    }
18640
18641    /// Sets the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
18642    ///
18643    /// # Example
18644    /// ```ignore,no_run
18645    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18646    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
18647    /// let x = UpdateNodePoolRequest::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
18648    /// ```
18649    pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
18650    where
18651        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
18652    {
18653        self.upgrade_settings = std::option::Option::Some(v.into());
18654        self
18655    }
18656
18657    /// Sets or clears the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
18658    ///
18659    /// # Example
18660    /// ```ignore,no_run
18661    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18662    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
18663    /// let x = UpdateNodePoolRequest::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
18664    /// let x = UpdateNodePoolRequest::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
18665    /// ```
18666    pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
18667    where
18668        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
18669    {
18670        self.upgrade_settings = v.map(|x| x.into());
18671        self
18672    }
18673
18674    /// Sets the value of [tags][crate::model::UpdateNodePoolRequest::tags].
18675    ///
18676    /// # Example
18677    /// ```ignore,no_run
18678    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18679    /// use google_cloud_container_v1::model::NetworkTags;
18680    /// let x = UpdateNodePoolRequest::new().set_tags(NetworkTags::default()/* use setters */);
18681    /// ```
18682    pub fn set_tags<T>(mut self, v: T) -> Self
18683    where
18684        T: std::convert::Into<crate::model::NetworkTags>,
18685    {
18686        self.tags = std::option::Option::Some(v.into());
18687        self
18688    }
18689
18690    /// Sets or clears the value of [tags][crate::model::UpdateNodePoolRequest::tags].
18691    ///
18692    /// # Example
18693    /// ```ignore,no_run
18694    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18695    /// use google_cloud_container_v1::model::NetworkTags;
18696    /// let x = UpdateNodePoolRequest::new().set_or_clear_tags(Some(NetworkTags::default()/* use setters */));
18697    /// let x = UpdateNodePoolRequest::new().set_or_clear_tags(None::<NetworkTags>);
18698    /// ```
18699    pub fn set_or_clear_tags<T>(mut self, v: std::option::Option<T>) -> Self
18700    where
18701        T: std::convert::Into<crate::model::NetworkTags>,
18702    {
18703        self.tags = v.map(|x| x.into());
18704        self
18705    }
18706
18707    /// Sets the value of [taints][crate::model::UpdateNodePoolRequest::taints].
18708    ///
18709    /// # Example
18710    /// ```ignore,no_run
18711    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18712    /// use google_cloud_container_v1::model::NodeTaints;
18713    /// let x = UpdateNodePoolRequest::new().set_taints(NodeTaints::default()/* use setters */);
18714    /// ```
18715    pub fn set_taints<T>(mut self, v: T) -> Self
18716    where
18717        T: std::convert::Into<crate::model::NodeTaints>,
18718    {
18719        self.taints = std::option::Option::Some(v.into());
18720        self
18721    }
18722
18723    /// Sets or clears the value of [taints][crate::model::UpdateNodePoolRequest::taints].
18724    ///
18725    /// # Example
18726    /// ```ignore,no_run
18727    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18728    /// use google_cloud_container_v1::model::NodeTaints;
18729    /// let x = UpdateNodePoolRequest::new().set_or_clear_taints(Some(NodeTaints::default()/* use setters */));
18730    /// let x = UpdateNodePoolRequest::new().set_or_clear_taints(None::<NodeTaints>);
18731    /// ```
18732    pub fn set_or_clear_taints<T>(mut self, v: std::option::Option<T>) -> Self
18733    where
18734        T: std::convert::Into<crate::model::NodeTaints>,
18735    {
18736        self.taints = v.map(|x| x.into());
18737        self
18738    }
18739
18740    /// Sets the value of [labels][crate::model::UpdateNodePoolRequest::labels].
18741    ///
18742    /// # Example
18743    /// ```ignore,no_run
18744    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18745    /// use google_cloud_container_v1::model::NodeLabels;
18746    /// let x = UpdateNodePoolRequest::new().set_labels(NodeLabels::default()/* use setters */);
18747    /// ```
18748    pub fn set_labels<T>(mut self, v: T) -> Self
18749    where
18750        T: std::convert::Into<crate::model::NodeLabels>,
18751    {
18752        self.labels = std::option::Option::Some(v.into());
18753        self
18754    }
18755
18756    /// Sets or clears the value of [labels][crate::model::UpdateNodePoolRequest::labels].
18757    ///
18758    /// # Example
18759    /// ```ignore,no_run
18760    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18761    /// use google_cloud_container_v1::model::NodeLabels;
18762    /// let x = UpdateNodePoolRequest::new().set_or_clear_labels(Some(NodeLabels::default()/* use setters */));
18763    /// let x = UpdateNodePoolRequest::new().set_or_clear_labels(None::<NodeLabels>);
18764    /// ```
18765    pub fn set_or_clear_labels<T>(mut self, v: std::option::Option<T>) -> Self
18766    where
18767        T: std::convert::Into<crate::model::NodeLabels>,
18768    {
18769        self.labels = v.map(|x| x.into());
18770        self
18771    }
18772
18773    /// Sets the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
18774    ///
18775    /// # Example
18776    /// ```ignore,no_run
18777    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18778    /// use google_cloud_container_v1::model::LinuxNodeConfig;
18779    /// let x = UpdateNodePoolRequest::new().set_linux_node_config(LinuxNodeConfig::default()/* use setters */);
18780    /// ```
18781    pub fn set_linux_node_config<T>(mut self, v: T) -> Self
18782    where
18783        T: std::convert::Into<crate::model::LinuxNodeConfig>,
18784    {
18785        self.linux_node_config = std::option::Option::Some(v.into());
18786        self
18787    }
18788
18789    /// Sets or clears the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
18790    ///
18791    /// # Example
18792    /// ```ignore,no_run
18793    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18794    /// use google_cloud_container_v1::model::LinuxNodeConfig;
18795    /// let x = UpdateNodePoolRequest::new().set_or_clear_linux_node_config(Some(LinuxNodeConfig::default()/* use setters */));
18796    /// let x = UpdateNodePoolRequest::new().set_or_clear_linux_node_config(None::<LinuxNodeConfig>);
18797    /// ```
18798    pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
18799    where
18800        T: std::convert::Into<crate::model::LinuxNodeConfig>,
18801    {
18802        self.linux_node_config = v.map(|x| x.into());
18803        self
18804    }
18805
18806    /// Sets the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
18807    ///
18808    /// # Example
18809    /// ```ignore,no_run
18810    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18811    /// use google_cloud_container_v1::model::NodeKubeletConfig;
18812    /// let x = UpdateNodePoolRequest::new().set_kubelet_config(NodeKubeletConfig::default()/* use setters */);
18813    /// ```
18814    pub fn set_kubelet_config<T>(mut self, v: T) -> Self
18815    where
18816        T: std::convert::Into<crate::model::NodeKubeletConfig>,
18817    {
18818        self.kubelet_config = std::option::Option::Some(v.into());
18819        self
18820    }
18821
18822    /// Sets or clears the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
18823    ///
18824    /// # Example
18825    /// ```ignore,no_run
18826    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18827    /// use google_cloud_container_v1::model::NodeKubeletConfig;
18828    /// let x = UpdateNodePoolRequest::new().set_or_clear_kubelet_config(Some(NodeKubeletConfig::default()/* use setters */));
18829    /// let x = UpdateNodePoolRequest::new().set_or_clear_kubelet_config(None::<NodeKubeletConfig>);
18830    /// ```
18831    pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
18832    where
18833        T: std::convert::Into<crate::model::NodeKubeletConfig>,
18834    {
18835        self.kubelet_config = v.map(|x| x.into());
18836        self
18837    }
18838
18839    /// Sets the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
18840    ///
18841    /// # Example
18842    /// ```ignore,no_run
18843    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18844    /// use google_cloud_container_v1::model::NodeNetworkConfig;
18845    /// let x = UpdateNodePoolRequest::new().set_node_network_config(NodeNetworkConfig::default()/* use setters */);
18846    /// ```
18847    pub fn set_node_network_config<T>(mut self, v: T) -> Self
18848    where
18849        T: std::convert::Into<crate::model::NodeNetworkConfig>,
18850    {
18851        self.node_network_config = std::option::Option::Some(v.into());
18852        self
18853    }
18854
18855    /// Sets or clears the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
18856    ///
18857    /// # Example
18858    /// ```ignore,no_run
18859    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18860    /// use google_cloud_container_v1::model::NodeNetworkConfig;
18861    /// let x = UpdateNodePoolRequest::new().set_or_clear_node_network_config(Some(NodeNetworkConfig::default()/* use setters */));
18862    /// let x = UpdateNodePoolRequest::new().set_or_clear_node_network_config(None::<NodeNetworkConfig>);
18863    /// ```
18864    pub fn set_or_clear_node_network_config<T>(mut self, v: std::option::Option<T>) -> Self
18865    where
18866        T: std::convert::Into<crate::model::NodeNetworkConfig>,
18867    {
18868        self.node_network_config = v.map(|x| x.into());
18869        self
18870    }
18871
18872    /// Sets the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
18873    ///
18874    /// # Example
18875    /// ```ignore,no_run
18876    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18877    /// use google_cloud_container_v1::model::GcfsConfig;
18878    /// let x = UpdateNodePoolRequest::new().set_gcfs_config(GcfsConfig::default()/* use setters */);
18879    /// ```
18880    pub fn set_gcfs_config<T>(mut self, v: T) -> Self
18881    where
18882        T: std::convert::Into<crate::model::GcfsConfig>,
18883    {
18884        self.gcfs_config = std::option::Option::Some(v.into());
18885        self
18886    }
18887
18888    /// Sets or clears the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
18889    ///
18890    /// # Example
18891    /// ```ignore,no_run
18892    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18893    /// use google_cloud_container_v1::model::GcfsConfig;
18894    /// let x = UpdateNodePoolRequest::new().set_or_clear_gcfs_config(Some(GcfsConfig::default()/* use setters */));
18895    /// let x = UpdateNodePoolRequest::new().set_or_clear_gcfs_config(None::<GcfsConfig>);
18896    /// ```
18897    pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
18898    where
18899        T: std::convert::Into<crate::model::GcfsConfig>,
18900    {
18901        self.gcfs_config = v.map(|x| x.into());
18902        self
18903    }
18904
18905    /// Sets the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
18906    ///
18907    /// # Example
18908    /// ```ignore,no_run
18909    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18910    /// use google_cloud_container_v1::model::ConfidentialNodes;
18911    /// let x = UpdateNodePoolRequest::new().set_confidential_nodes(ConfidentialNodes::default()/* use setters */);
18912    /// ```
18913    pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
18914    where
18915        T: std::convert::Into<crate::model::ConfidentialNodes>,
18916    {
18917        self.confidential_nodes = std::option::Option::Some(v.into());
18918        self
18919    }
18920
18921    /// Sets or clears the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
18922    ///
18923    /// # Example
18924    /// ```ignore,no_run
18925    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18926    /// use google_cloud_container_v1::model::ConfidentialNodes;
18927    /// let x = UpdateNodePoolRequest::new().set_or_clear_confidential_nodes(Some(ConfidentialNodes::default()/* use setters */));
18928    /// let x = UpdateNodePoolRequest::new().set_or_clear_confidential_nodes(None::<ConfidentialNodes>);
18929    /// ```
18930    pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
18931    where
18932        T: std::convert::Into<crate::model::ConfidentialNodes>,
18933    {
18934        self.confidential_nodes = v.map(|x| x.into());
18935        self
18936    }
18937
18938    /// Sets the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
18939    ///
18940    /// # Example
18941    /// ```ignore,no_run
18942    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18943    /// use google_cloud_container_v1::model::VirtualNIC;
18944    /// let x = UpdateNodePoolRequest::new().set_gvnic(VirtualNIC::default()/* use setters */);
18945    /// ```
18946    pub fn set_gvnic<T>(mut self, v: T) -> Self
18947    where
18948        T: std::convert::Into<crate::model::VirtualNIC>,
18949    {
18950        self.gvnic = std::option::Option::Some(v.into());
18951        self
18952    }
18953
18954    /// Sets or clears the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
18955    ///
18956    /// # Example
18957    /// ```ignore,no_run
18958    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18959    /// use google_cloud_container_v1::model::VirtualNIC;
18960    /// let x = UpdateNodePoolRequest::new().set_or_clear_gvnic(Some(VirtualNIC::default()/* use setters */));
18961    /// let x = UpdateNodePoolRequest::new().set_or_clear_gvnic(None::<VirtualNIC>);
18962    /// ```
18963    pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
18964    where
18965        T: std::convert::Into<crate::model::VirtualNIC>,
18966    {
18967        self.gvnic = v.map(|x| x.into());
18968        self
18969    }
18970
18971    /// Sets the value of [etag][crate::model::UpdateNodePoolRequest::etag].
18972    ///
18973    /// # Example
18974    /// ```ignore,no_run
18975    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18976    /// let x = UpdateNodePoolRequest::new().set_etag("example");
18977    /// ```
18978    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18979        self.etag = v.into();
18980        self
18981    }
18982
18983    /// Sets the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
18984    ///
18985    /// # Example
18986    /// ```ignore,no_run
18987    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
18988    /// use google_cloud_container_v1::model::FastSocket;
18989    /// let x = UpdateNodePoolRequest::new().set_fast_socket(FastSocket::default()/* use setters */);
18990    /// ```
18991    pub fn set_fast_socket<T>(mut self, v: T) -> Self
18992    where
18993        T: std::convert::Into<crate::model::FastSocket>,
18994    {
18995        self.fast_socket = std::option::Option::Some(v.into());
18996        self
18997    }
18998
18999    /// Sets or clears the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
19000    ///
19001    /// # Example
19002    /// ```ignore,no_run
19003    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19004    /// use google_cloud_container_v1::model::FastSocket;
19005    /// let x = UpdateNodePoolRequest::new().set_or_clear_fast_socket(Some(FastSocket::default()/* use setters */));
19006    /// let x = UpdateNodePoolRequest::new().set_or_clear_fast_socket(None::<FastSocket>);
19007    /// ```
19008    pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
19009    where
19010        T: std::convert::Into<crate::model::FastSocket>,
19011    {
19012        self.fast_socket = v.map(|x| x.into());
19013        self
19014    }
19015
19016    /// Sets the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
19017    ///
19018    /// # Example
19019    /// ```ignore,no_run
19020    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19021    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
19022    /// let x = UpdateNodePoolRequest::new().set_logging_config(NodePoolLoggingConfig::default()/* use setters */);
19023    /// ```
19024    pub fn set_logging_config<T>(mut self, v: T) -> Self
19025    where
19026        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
19027    {
19028        self.logging_config = std::option::Option::Some(v.into());
19029        self
19030    }
19031
19032    /// Sets or clears the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
19033    ///
19034    /// # Example
19035    /// ```ignore,no_run
19036    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19037    /// use google_cloud_container_v1::model::NodePoolLoggingConfig;
19038    /// let x = UpdateNodePoolRequest::new().set_or_clear_logging_config(Some(NodePoolLoggingConfig::default()/* use setters */));
19039    /// let x = UpdateNodePoolRequest::new().set_or_clear_logging_config(None::<NodePoolLoggingConfig>);
19040    /// ```
19041    pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
19042    where
19043        T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
19044    {
19045        self.logging_config = v.map(|x| x.into());
19046        self
19047    }
19048
19049    /// Sets the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
19050    ///
19051    /// # Example
19052    /// ```ignore,no_run
19053    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19054    /// use google_cloud_container_v1::model::ResourceLabels;
19055    /// let x = UpdateNodePoolRequest::new().set_resource_labels(ResourceLabels::default()/* use setters */);
19056    /// ```
19057    pub fn set_resource_labels<T>(mut self, v: T) -> Self
19058    where
19059        T: std::convert::Into<crate::model::ResourceLabels>,
19060    {
19061        self.resource_labels = std::option::Option::Some(v.into());
19062        self
19063    }
19064
19065    /// Sets or clears the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
19066    ///
19067    /// # Example
19068    /// ```ignore,no_run
19069    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19070    /// use google_cloud_container_v1::model::ResourceLabels;
19071    /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_labels(Some(ResourceLabels::default()/* use setters */));
19072    /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_labels(None::<ResourceLabels>);
19073    /// ```
19074    pub fn set_or_clear_resource_labels<T>(mut self, v: std::option::Option<T>) -> Self
19075    where
19076        T: std::convert::Into<crate::model::ResourceLabels>,
19077    {
19078        self.resource_labels = v.map(|x| x.into());
19079        self
19080    }
19081
19082    /// Sets the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
19083    ///
19084    /// # Example
19085    /// ```ignore,no_run
19086    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19087    /// use google_cloud_container_v1::model::WindowsNodeConfig;
19088    /// let x = UpdateNodePoolRequest::new().set_windows_node_config(WindowsNodeConfig::default()/* use setters */);
19089    /// ```
19090    pub fn set_windows_node_config<T>(mut self, v: T) -> Self
19091    where
19092        T: std::convert::Into<crate::model::WindowsNodeConfig>,
19093    {
19094        self.windows_node_config = std::option::Option::Some(v.into());
19095        self
19096    }
19097
19098    /// Sets or clears the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
19099    ///
19100    /// # Example
19101    /// ```ignore,no_run
19102    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19103    /// use google_cloud_container_v1::model::WindowsNodeConfig;
19104    /// let x = UpdateNodePoolRequest::new().set_or_clear_windows_node_config(Some(WindowsNodeConfig::default()/* use setters */));
19105    /// let x = UpdateNodePoolRequest::new().set_or_clear_windows_node_config(None::<WindowsNodeConfig>);
19106    /// ```
19107    pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
19108    where
19109        T: std::convert::Into<crate::model::WindowsNodeConfig>,
19110    {
19111        self.windows_node_config = v.map(|x| x.into());
19112        self
19113    }
19114
19115    /// Sets the value of [accelerators][crate::model::UpdateNodePoolRequest::accelerators].
19116    ///
19117    /// # Example
19118    /// ```ignore,no_run
19119    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19120    /// use google_cloud_container_v1::model::AcceleratorConfig;
19121    /// let x = UpdateNodePoolRequest::new()
19122    ///     .set_accelerators([
19123    ///         AcceleratorConfig::default()/* use setters */,
19124    ///         AcceleratorConfig::default()/* use (different) setters */,
19125    ///     ]);
19126    /// ```
19127    pub fn set_accelerators<T, V>(mut self, v: T) -> Self
19128    where
19129        T: std::iter::IntoIterator<Item = V>,
19130        V: std::convert::Into<crate::model::AcceleratorConfig>,
19131    {
19132        use std::iter::Iterator;
19133        self.accelerators = v.into_iter().map(|i| i.into()).collect();
19134        self
19135    }
19136
19137    /// Sets the value of [machine_type][crate::model::UpdateNodePoolRequest::machine_type].
19138    ///
19139    /// # Example
19140    /// ```ignore,no_run
19141    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19142    /// let x = UpdateNodePoolRequest::new().set_machine_type("example");
19143    /// ```
19144    pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19145        self.machine_type = v.into();
19146        self
19147    }
19148
19149    /// Sets the value of [disk_type][crate::model::UpdateNodePoolRequest::disk_type].
19150    ///
19151    /// # Example
19152    /// ```ignore,no_run
19153    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19154    /// let x = UpdateNodePoolRequest::new().set_disk_type("example");
19155    /// ```
19156    pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19157        self.disk_type = v.into();
19158        self
19159    }
19160
19161    /// Sets the value of [disk_size_gb][crate::model::UpdateNodePoolRequest::disk_size_gb].
19162    ///
19163    /// # Example
19164    /// ```ignore,no_run
19165    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19166    /// let x = UpdateNodePoolRequest::new().set_disk_size_gb(42);
19167    /// ```
19168    pub fn set_disk_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19169        self.disk_size_gb = v.into();
19170        self
19171    }
19172
19173    /// Sets the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
19174    ///
19175    /// # Example
19176    /// ```ignore,no_run
19177    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19178    /// use google_cloud_container_v1::model::ResourceManagerTags;
19179    /// let x = UpdateNodePoolRequest::new().set_resource_manager_tags(ResourceManagerTags::default()/* use setters */);
19180    /// ```
19181    pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
19182    where
19183        T: std::convert::Into<crate::model::ResourceManagerTags>,
19184    {
19185        self.resource_manager_tags = std::option::Option::Some(v.into());
19186        self
19187    }
19188
19189    /// Sets or clears the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
19190    ///
19191    /// # Example
19192    /// ```ignore,no_run
19193    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19194    /// use google_cloud_container_v1::model::ResourceManagerTags;
19195    /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_manager_tags(Some(ResourceManagerTags::default()/* use setters */));
19196    /// let x = UpdateNodePoolRequest::new().set_or_clear_resource_manager_tags(None::<ResourceManagerTags>);
19197    /// ```
19198    pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
19199    where
19200        T: std::convert::Into<crate::model::ResourceManagerTags>,
19201    {
19202        self.resource_manager_tags = v.map(|x| x.into());
19203        self
19204    }
19205
19206    /// Sets the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
19207    ///
19208    /// # Example
19209    /// ```ignore,no_run
19210    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19211    /// use google_cloud_container_v1::model::ContainerdConfig;
19212    /// let x = UpdateNodePoolRequest::new().set_containerd_config(ContainerdConfig::default()/* use setters */);
19213    /// ```
19214    pub fn set_containerd_config<T>(mut self, v: T) -> Self
19215    where
19216        T: std::convert::Into<crate::model::ContainerdConfig>,
19217    {
19218        self.containerd_config = std::option::Option::Some(v.into());
19219        self
19220    }
19221
19222    /// Sets or clears the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
19223    ///
19224    /// # Example
19225    /// ```ignore,no_run
19226    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19227    /// use google_cloud_container_v1::model::ContainerdConfig;
19228    /// let x = UpdateNodePoolRequest::new().set_or_clear_containerd_config(Some(ContainerdConfig::default()/* use setters */));
19229    /// let x = UpdateNodePoolRequest::new().set_or_clear_containerd_config(None::<ContainerdConfig>);
19230    /// ```
19231    pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
19232    where
19233        T: std::convert::Into<crate::model::ContainerdConfig>,
19234    {
19235        self.containerd_config = v.map(|x| x.into());
19236        self
19237    }
19238
19239    /// Sets the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
19240    ///
19241    /// # Example
19242    /// ```ignore,no_run
19243    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19244    /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
19245    /// let x = UpdateNodePoolRequest::new().set_queued_provisioning(QueuedProvisioning::default()/* use setters */);
19246    /// ```
19247    pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
19248    where
19249        T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
19250    {
19251        self.queued_provisioning = std::option::Option::Some(v.into());
19252        self
19253    }
19254
19255    /// Sets or clears the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
19256    ///
19257    /// # Example
19258    /// ```ignore,no_run
19259    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19260    /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
19261    /// let x = UpdateNodePoolRequest::new().set_or_clear_queued_provisioning(Some(QueuedProvisioning::default()/* use setters */));
19262    /// let x = UpdateNodePoolRequest::new().set_or_clear_queued_provisioning(None::<QueuedProvisioning>);
19263    /// ```
19264    pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
19265    where
19266        T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
19267    {
19268        self.queued_provisioning = v.map(|x| x.into());
19269        self
19270    }
19271
19272    /// Sets the value of [storage_pools][crate::model::UpdateNodePoolRequest::storage_pools].
19273    ///
19274    /// # Example
19275    /// ```ignore,no_run
19276    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19277    /// let x = UpdateNodePoolRequest::new().set_storage_pools(["a", "b", "c"]);
19278    /// ```
19279    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
19280    where
19281        T: std::iter::IntoIterator<Item = V>,
19282        V: std::convert::Into<std::string::String>,
19283    {
19284        use std::iter::Iterator;
19285        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
19286        self
19287    }
19288
19289    /// Sets the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
19290    ///
19291    /// # Example
19292    /// ```ignore,no_run
19293    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19294    /// use wkt::Duration;
19295    /// let x = UpdateNodePoolRequest::new().set_max_run_duration(Duration::default()/* use setters */);
19296    /// ```
19297    pub fn set_max_run_duration<T>(mut self, v: T) -> Self
19298    where
19299        T: std::convert::Into<wkt::Duration>,
19300    {
19301        self.max_run_duration = std::option::Option::Some(v.into());
19302        self
19303    }
19304
19305    /// Sets or clears the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
19306    ///
19307    /// # Example
19308    /// ```ignore,no_run
19309    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19310    /// use wkt::Duration;
19311    /// let x = UpdateNodePoolRequest::new().set_or_clear_max_run_duration(Some(Duration::default()/* use setters */));
19312    /// let x = UpdateNodePoolRequest::new().set_or_clear_max_run_duration(None::<Duration>);
19313    /// ```
19314    pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
19315    where
19316        T: std::convert::Into<wkt::Duration>,
19317    {
19318        self.max_run_duration = v.map(|x| x.into());
19319        self
19320    }
19321
19322    /// Sets the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
19323    ///
19324    /// # Example
19325    /// ```ignore,no_run
19326    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19327    /// let x = UpdateNodePoolRequest::new().set_flex_start(true);
19328    /// ```
19329    pub fn set_flex_start<T>(mut self, v: T) -> Self
19330    where
19331        T: std::convert::Into<bool>,
19332    {
19333        self.flex_start = std::option::Option::Some(v.into());
19334        self
19335    }
19336
19337    /// Sets or clears the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
19338    ///
19339    /// # Example
19340    /// ```ignore,no_run
19341    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19342    /// let x = UpdateNodePoolRequest::new().set_or_clear_flex_start(Some(false));
19343    /// let x = UpdateNodePoolRequest::new().set_or_clear_flex_start(None::<bool>);
19344    /// ```
19345    pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
19346    where
19347        T: std::convert::Into<bool>,
19348    {
19349        self.flex_start = v.map(|x| x.into());
19350        self
19351    }
19352
19353    /// Sets the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
19354    ///
19355    /// # Example
19356    /// ```ignore,no_run
19357    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19358    /// use google_cloud_container_v1::model::BootDisk;
19359    /// let x = UpdateNodePoolRequest::new().set_boot_disk(BootDisk::default()/* use setters */);
19360    /// ```
19361    pub fn set_boot_disk<T>(mut self, v: T) -> Self
19362    where
19363        T: std::convert::Into<crate::model::BootDisk>,
19364    {
19365        self.boot_disk = std::option::Option::Some(v.into());
19366        self
19367    }
19368
19369    /// Sets or clears the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
19370    ///
19371    /// # Example
19372    /// ```ignore,no_run
19373    /// # use google_cloud_container_v1::model::UpdateNodePoolRequest;
19374    /// use google_cloud_container_v1::model::BootDisk;
19375    /// let x = UpdateNodePoolRequest::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
19376    /// let x = UpdateNodePoolRequest::new().set_or_clear_boot_disk(None::<BootDisk>);
19377    /// ```
19378    pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
19379    where
19380        T: std::convert::Into<crate::model::BootDisk>,
19381    {
19382        self.boot_disk = v.map(|x| x.into());
19383        self
19384    }
19385}
19386
19387impl wkt::message::Message for UpdateNodePoolRequest {
19388    fn typename() -> &'static str {
19389        "type.googleapis.com/google.container.v1.UpdateNodePoolRequest"
19390    }
19391}
19392
19393/// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool.
19394#[derive(Clone, Default, PartialEq)]
19395#[non_exhaustive]
19396pub struct SetNodePoolAutoscalingRequest {
19397    /// Deprecated. The Google Developers Console [project ID or project
19398    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
19399    /// This field has been deprecated and replaced by the name field.
19400    #[deprecated]
19401    pub project_id: std::string::String,
19402
19403    /// Deprecated. The name of the Google Compute Engine
19404    /// [zone](https://cloud.google.com/compute/docs/zones#available)
19405    /// in which the cluster resides. This field has been deprecated and replaced
19406    /// by the name field.
19407    #[deprecated]
19408    pub zone: std::string::String,
19409
19410    /// Deprecated. The name of the cluster to upgrade.
19411    /// This field has been deprecated and replaced by the name field.
19412    #[deprecated]
19413    pub cluster_id: std::string::String,
19414
19415    /// Deprecated. The name of the node pool to upgrade.
19416    /// This field has been deprecated and replaced by the name field.
19417    #[deprecated]
19418    pub node_pool_id: std::string::String,
19419
19420    /// Required. Autoscaling configuration for the node pool.
19421    pub autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
19422
19423    /// The name (project, location, cluster, node pool) of the node pool to set
19424    /// autoscaler settings. Specified in the format
19425    /// `projects/*/locations/*/clusters/*/nodePools/*`.
19426    pub name: std::string::String,
19427
19428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19429}
19430
19431impl SetNodePoolAutoscalingRequest {
19432    pub fn new() -> Self {
19433        std::default::Default::default()
19434    }
19435
19436    /// Sets the value of [project_id][crate::model::SetNodePoolAutoscalingRequest::project_id].
19437    ///
19438    /// # Example
19439    /// ```ignore,no_run
19440    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19441    /// let x = SetNodePoolAutoscalingRequest::new().set_project_id("example");
19442    /// ```
19443    #[deprecated]
19444    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19445        self.project_id = v.into();
19446        self
19447    }
19448
19449    /// Sets the value of [zone][crate::model::SetNodePoolAutoscalingRequest::zone].
19450    ///
19451    /// # Example
19452    /// ```ignore,no_run
19453    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19454    /// let x = SetNodePoolAutoscalingRequest::new().set_zone("example");
19455    /// ```
19456    #[deprecated]
19457    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19458        self.zone = v.into();
19459        self
19460    }
19461
19462    /// Sets the value of [cluster_id][crate::model::SetNodePoolAutoscalingRequest::cluster_id].
19463    ///
19464    /// # Example
19465    /// ```ignore,no_run
19466    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19467    /// let x = SetNodePoolAutoscalingRequest::new().set_cluster_id("example");
19468    /// ```
19469    #[deprecated]
19470    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19471        self.cluster_id = v.into();
19472        self
19473    }
19474
19475    /// Sets the value of [node_pool_id][crate::model::SetNodePoolAutoscalingRequest::node_pool_id].
19476    ///
19477    /// # Example
19478    /// ```ignore,no_run
19479    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19480    /// let x = SetNodePoolAutoscalingRequest::new().set_node_pool_id("example");
19481    /// ```
19482    #[deprecated]
19483    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19484        self.node_pool_id = v.into();
19485        self
19486    }
19487
19488    /// Sets the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
19489    ///
19490    /// # Example
19491    /// ```ignore,no_run
19492    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19493    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
19494    /// let x = SetNodePoolAutoscalingRequest::new().set_autoscaling(NodePoolAutoscaling::default()/* use setters */);
19495    /// ```
19496    pub fn set_autoscaling<T>(mut self, v: T) -> Self
19497    where
19498        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
19499    {
19500        self.autoscaling = std::option::Option::Some(v.into());
19501        self
19502    }
19503
19504    /// Sets or clears the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
19505    ///
19506    /// # Example
19507    /// ```ignore,no_run
19508    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19509    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
19510    /// let x = SetNodePoolAutoscalingRequest::new().set_or_clear_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
19511    /// let x = SetNodePoolAutoscalingRequest::new().set_or_clear_autoscaling(None::<NodePoolAutoscaling>);
19512    /// ```
19513    pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
19514    where
19515        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
19516    {
19517        self.autoscaling = v.map(|x| x.into());
19518        self
19519    }
19520
19521    /// Sets the value of [name][crate::model::SetNodePoolAutoscalingRequest::name].
19522    ///
19523    /// # Example
19524    /// ```ignore,no_run
19525    /// # use google_cloud_container_v1::model::SetNodePoolAutoscalingRequest;
19526    /// let x = SetNodePoolAutoscalingRequest::new().set_name("example");
19527    /// ```
19528    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19529        self.name = v.into();
19530        self
19531    }
19532}
19533
19534impl wkt::message::Message for SetNodePoolAutoscalingRequest {
19535    fn typename() -> &'static str {
19536        "type.googleapis.com/google.container.v1.SetNodePoolAutoscalingRequest"
19537    }
19538}
19539
19540/// SetLoggingServiceRequest sets the logging service of a cluster.
19541#[derive(Clone, Default, PartialEq)]
19542#[non_exhaustive]
19543pub struct SetLoggingServiceRequest {
19544    /// Deprecated. The Google Developers Console [project ID or project
19545    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
19546    /// This field has been deprecated and replaced by the name field.
19547    #[deprecated]
19548    pub project_id: std::string::String,
19549
19550    /// Deprecated. The name of the Google Compute Engine
19551    /// [zone](https://cloud.google.com/compute/docs/zones#available)
19552    /// in which the cluster resides. This field has been deprecated and replaced
19553    /// by the name field.
19554    #[deprecated]
19555    pub zone: std::string::String,
19556
19557    /// Deprecated. The name of the cluster to upgrade.
19558    /// This field has been deprecated and replaced by the name field.
19559    #[deprecated]
19560    pub cluster_id: std::string::String,
19561
19562    /// Required. The logging service the cluster should use to write logs.
19563    /// Currently available options:
19564    ///
19565    /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
19566    ///   service with a Kubernetes-native resource model
19567    /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
19568    ///   available as of GKE 1.15).
19569    /// * `none` - no logs will be exported from the cluster.
19570    ///
19571    /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
19572    /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
19573    pub logging_service: std::string::String,
19574
19575    /// The name (project, location, cluster) of the cluster to set logging.
19576    /// Specified in the format `projects/*/locations/*/clusters/*`.
19577    pub name: std::string::String,
19578
19579    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19580}
19581
19582impl SetLoggingServiceRequest {
19583    pub fn new() -> Self {
19584        std::default::Default::default()
19585    }
19586
19587    /// Sets the value of [project_id][crate::model::SetLoggingServiceRequest::project_id].
19588    ///
19589    /// # Example
19590    /// ```ignore,no_run
19591    /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
19592    /// let x = SetLoggingServiceRequest::new().set_project_id("example");
19593    /// ```
19594    #[deprecated]
19595    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19596        self.project_id = v.into();
19597        self
19598    }
19599
19600    /// Sets the value of [zone][crate::model::SetLoggingServiceRequest::zone].
19601    ///
19602    /// # Example
19603    /// ```ignore,no_run
19604    /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
19605    /// let x = SetLoggingServiceRequest::new().set_zone("example");
19606    /// ```
19607    #[deprecated]
19608    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19609        self.zone = v.into();
19610        self
19611    }
19612
19613    /// Sets the value of [cluster_id][crate::model::SetLoggingServiceRequest::cluster_id].
19614    ///
19615    /// # Example
19616    /// ```ignore,no_run
19617    /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
19618    /// let x = SetLoggingServiceRequest::new().set_cluster_id("example");
19619    /// ```
19620    #[deprecated]
19621    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19622        self.cluster_id = v.into();
19623        self
19624    }
19625
19626    /// Sets the value of [logging_service][crate::model::SetLoggingServiceRequest::logging_service].
19627    ///
19628    /// # Example
19629    /// ```ignore,no_run
19630    /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
19631    /// let x = SetLoggingServiceRequest::new().set_logging_service("example");
19632    /// ```
19633    pub fn set_logging_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19634        self.logging_service = v.into();
19635        self
19636    }
19637
19638    /// Sets the value of [name][crate::model::SetLoggingServiceRequest::name].
19639    ///
19640    /// # Example
19641    /// ```ignore,no_run
19642    /// # use google_cloud_container_v1::model::SetLoggingServiceRequest;
19643    /// let x = SetLoggingServiceRequest::new().set_name("example");
19644    /// ```
19645    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19646        self.name = v.into();
19647        self
19648    }
19649}
19650
19651impl wkt::message::Message for SetLoggingServiceRequest {
19652    fn typename() -> &'static str {
19653        "type.googleapis.com/google.container.v1.SetLoggingServiceRequest"
19654    }
19655}
19656
19657/// SetMonitoringServiceRequest sets the monitoring service of a cluster.
19658#[derive(Clone, Default, PartialEq)]
19659#[non_exhaustive]
19660pub struct SetMonitoringServiceRequest {
19661    /// Deprecated. The Google Developers Console [project ID or project
19662    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
19663    /// This field has been deprecated and replaced by the name field.
19664    #[deprecated]
19665    pub project_id: std::string::String,
19666
19667    /// Deprecated. The name of the Google Compute Engine
19668    /// [zone](https://cloud.google.com/compute/docs/zones#available)
19669    /// in which the cluster resides. This field has been deprecated and replaced
19670    /// by the name field.
19671    #[deprecated]
19672    pub zone: std::string::String,
19673
19674    /// Deprecated. The name of the cluster to upgrade.
19675    /// This field has been deprecated and replaced by the name field.
19676    #[deprecated]
19677    pub cluster_id: std::string::String,
19678
19679    /// Required. The monitoring service the cluster should use to write metrics.
19680    /// Currently available options:
19681    ///
19682    /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
19683    ///   service with a Kubernetes-native resource model
19684    /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
19685    ///   longer available as of GKE 1.15).
19686    /// * `none` - No metrics will be exported from the cluster.
19687    ///
19688    /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
19689    /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
19690    pub monitoring_service: std::string::String,
19691
19692    /// The name (project, location, cluster) of the cluster to set monitoring.
19693    /// Specified in the format `projects/*/locations/*/clusters/*`.
19694    pub name: std::string::String,
19695
19696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19697}
19698
19699impl SetMonitoringServiceRequest {
19700    pub fn new() -> Self {
19701        std::default::Default::default()
19702    }
19703
19704    /// Sets the value of [project_id][crate::model::SetMonitoringServiceRequest::project_id].
19705    ///
19706    /// # Example
19707    /// ```ignore,no_run
19708    /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
19709    /// let x = SetMonitoringServiceRequest::new().set_project_id("example");
19710    /// ```
19711    #[deprecated]
19712    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19713        self.project_id = v.into();
19714        self
19715    }
19716
19717    /// Sets the value of [zone][crate::model::SetMonitoringServiceRequest::zone].
19718    ///
19719    /// # Example
19720    /// ```ignore,no_run
19721    /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
19722    /// let x = SetMonitoringServiceRequest::new().set_zone("example");
19723    /// ```
19724    #[deprecated]
19725    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19726        self.zone = v.into();
19727        self
19728    }
19729
19730    /// Sets the value of [cluster_id][crate::model::SetMonitoringServiceRequest::cluster_id].
19731    ///
19732    /// # Example
19733    /// ```ignore,no_run
19734    /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
19735    /// let x = SetMonitoringServiceRequest::new().set_cluster_id("example");
19736    /// ```
19737    #[deprecated]
19738    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19739        self.cluster_id = v.into();
19740        self
19741    }
19742
19743    /// Sets the value of [monitoring_service][crate::model::SetMonitoringServiceRequest::monitoring_service].
19744    ///
19745    /// # Example
19746    /// ```ignore,no_run
19747    /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
19748    /// let x = SetMonitoringServiceRequest::new().set_monitoring_service("example");
19749    /// ```
19750    pub fn set_monitoring_service<T: std::convert::Into<std::string::String>>(
19751        mut self,
19752        v: T,
19753    ) -> Self {
19754        self.monitoring_service = v.into();
19755        self
19756    }
19757
19758    /// Sets the value of [name][crate::model::SetMonitoringServiceRequest::name].
19759    ///
19760    /// # Example
19761    /// ```ignore,no_run
19762    /// # use google_cloud_container_v1::model::SetMonitoringServiceRequest;
19763    /// let x = SetMonitoringServiceRequest::new().set_name("example");
19764    /// ```
19765    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19766        self.name = v.into();
19767        self
19768    }
19769}
19770
19771impl wkt::message::Message for SetMonitoringServiceRequest {
19772    fn typename() -> &'static str {
19773        "type.googleapis.com/google.container.v1.SetMonitoringServiceRequest"
19774    }
19775}
19776
19777/// SetAddonsConfigRequest sets the addons associated with the cluster.
19778#[derive(Clone, Default, PartialEq)]
19779#[non_exhaustive]
19780pub struct SetAddonsConfigRequest {
19781    /// Deprecated. The Google Developers Console [project ID or project
19782    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
19783    /// This field has been deprecated and replaced by the name field.
19784    #[deprecated]
19785    pub project_id: std::string::String,
19786
19787    /// Deprecated. The name of the Google Compute Engine
19788    /// [zone](https://cloud.google.com/compute/docs/zones#available)
19789    /// in which the cluster resides. This field has been deprecated and replaced
19790    /// by the name field.
19791    #[deprecated]
19792    pub zone: std::string::String,
19793
19794    /// Deprecated. The name of the cluster to upgrade.
19795    /// This field has been deprecated and replaced by the name field.
19796    #[deprecated]
19797    pub cluster_id: std::string::String,
19798
19799    /// Required. The desired configurations for the various addons available to
19800    /// run in the cluster.
19801    pub addons_config: std::option::Option<crate::model::AddonsConfig>,
19802
19803    /// The name (project, location, cluster) of the cluster to set addons.
19804    /// Specified in the format `projects/*/locations/*/clusters/*`.
19805    pub name: std::string::String,
19806
19807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19808}
19809
19810impl SetAddonsConfigRequest {
19811    pub fn new() -> Self {
19812        std::default::Default::default()
19813    }
19814
19815    /// Sets the value of [project_id][crate::model::SetAddonsConfigRequest::project_id].
19816    ///
19817    /// # Example
19818    /// ```ignore,no_run
19819    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19820    /// let x = SetAddonsConfigRequest::new().set_project_id("example");
19821    /// ```
19822    #[deprecated]
19823    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19824        self.project_id = v.into();
19825        self
19826    }
19827
19828    /// Sets the value of [zone][crate::model::SetAddonsConfigRequest::zone].
19829    ///
19830    /// # Example
19831    /// ```ignore,no_run
19832    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19833    /// let x = SetAddonsConfigRequest::new().set_zone("example");
19834    /// ```
19835    #[deprecated]
19836    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19837        self.zone = v.into();
19838        self
19839    }
19840
19841    /// Sets the value of [cluster_id][crate::model::SetAddonsConfigRequest::cluster_id].
19842    ///
19843    /// # Example
19844    /// ```ignore,no_run
19845    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19846    /// let x = SetAddonsConfigRequest::new().set_cluster_id("example");
19847    /// ```
19848    #[deprecated]
19849    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19850        self.cluster_id = v.into();
19851        self
19852    }
19853
19854    /// Sets the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
19855    ///
19856    /// # Example
19857    /// ```ignore,no_run
19858    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19859    /// use google_cloud_container_v1::model::AddonsConfig;
19860    /// let x = SetAddonsConfigRequest::new().set_addons_config(AddonsConfig::default()/* use setters */);
19861    /// ```
19862    pub fn set_addons_config<T>(mut self, v: T) -> Self
19863    where
19864        T: std::convert::Into<crate::model::AddonsConfig>,
19865    {
19866        self.addons_config = std::option::Option::Some(v.into());
19867        self
19868    }
19869
19870    /// Sets or clears the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
19871    ///
19872    /// # Example
19873    /// ```ignore,no_run
19874    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19875    /// use google_cloud_container_v1::model::AddonsConfig;
19876    /// let x = SetAddonsConfigRequest::new().set_or_clear_addons_config(Some(AddonsConfig::default()/* use setters */));
19877    /// let x = SetAddonsConfigRequest::new().set_or_clear_addons_config(None::<AddonsConfig>);
19878    /// ```
19879    pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
19880    where
19881        T: std::convert::Into<crate::model::AddonsConfig>,
19882    {
19883        self.addons_config = v.map(|x| x.into());
19884        self
19885    }
19886
19887    /// Sets the value of [name][crate::model::SetAddonsConfigRequest::name].
19888    ///
19889    /// # Example
19890    /// ```ignore,no_run
19891    /// # use google_cloud_container_v1::model::SetAddonsConfigRequest;
19892    /// let x = SetAddonsConfigRequest::new().set_name("example");
19893    /// ```
19894    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19895        self.name = v.into();
19896        self
19897    }
19898}
19899
19900impl wkt::message::Message for SetAddonsConfigRequest {
19901    fn typename() -> &'static str {
19902        "type.googleapis.com/google.container.v1.SetAddonsConfigRequest"
19903    }
19904}
19905
19906/// SetLocationsRequest sets the locations of the cluster.
19907#[derive(Clone, Default, PartialEq)]
19908#[non_exhaustive]
19909pub struct SetLocationsRequest {
19910    /// Deprecated. The Google Developers Console [project ID or project
19911    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
19912    /// This field has been deprecated and replaced by the name field.
19913    #[deprecated]
19914    pub project_id: std::string::String,
19915
19916    /// Deprecated. The name of the Google Compute Engine
19917    /// [zone](https://cloud.google.com/compute/docs/zones#available)
19918    /// in which the cluster resides. This field has been deprecated and replaced
19919    /// by the name field.
19920    #[deprecated]
19921    pub zone: std::string::String,
19922
19923    /// Deprecated. The name of the cluster to upgrade.
19924    /// This field has been deprecated and replaced by the name field.
19925    #[deprecated]
19926    pub cluster_id: std::string::String,
19927
19928    /// Required. The desired list of Google Compute Engine
19929    /// [zones](https://cloud.google.com/compute/docs/zones#available)
19930    /// in which the cluster's nodes should be located. Changing the locations a
19931    /// cluster is in will result in nodes being either created or removed from the
19932    /// cluster, depending on whether locations are being added or removed.
19933    ///
19934    /// This list must always include the cluster's primary zone.
19935    pub locations: std::vec::Vec<std::string::String>,
19936
19937    /// The name (project, location, cluster) of the cluster to set locations.
19938    /// Specified in the format `projects/*/locations/*/clusters/*`.
19939    pub name: std::string::String,
19940
19941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19942}
19943
19944impl SetLocationsRequest {
19945    pub fn new() -> Self {
19946        std::default::Default::default()
19947    }
19948
19949    /// Sets the value of [project_id][crate::model::SetLocationsRequest::project_id].
19950    ///
19951    /// # Example
19952    /// ```ignore,no_run
19953    /// # use google_cloud_container_v1::model::SetLocationsRequest;
19954    /// let x = SetLocationsRequest::new().set_project_id("example");
19955    /// ```
19956    #[deprecated]
19957    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19958        self.project_id = v.into();
19959        self
19960    }
19961
19962    /// Sets the value of [zone][crate::model::SetLocationsRequest::zone].
19963    ///
19964    /// # Example
19965    /// ```ignore,no_run
19966    /// # use google_cloud_container_v1::model::SetLocationsRequest;
19967    /// let x = SetLocationsRequest::new().set_zone("example");
19968    /// ```
19969    #[deprecated]
19970    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19971        self.zone = v.into();
19972        self
19973    }
19974
19975    /// Sets the value of [cluster_id][crate::model::SetLocationsRequest::cluster_id].
19976    ///
19977    /// # Example
19978    /// ```ignore,no_run
19979    /// # use google_cloud_container_v1::model::SetLocationsRequest;
19980    /// let x = SetLocationsRequest::new().set_cluster_id("example");
19981    /// ```
19982    #[deprecated]
19983    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19984        self.cluster_id = v.into();
19985        self
19986    }
19987
19988    /// Sets the value of [locations][crate::model::SetLocationsRequest::locations].
19989    ///
19990    /// # Example
19991    /// ```ignore,no_run
19992    /// # use google_cloud_container_v1::model::SetLocationsRequest;
19993    /// let x = SetLocationsRequest::new().set_locations(["a", "b", "c"]);
19994    /// ```
19995    pub fn set_locations<T, V>(mut self, v: T) -> Self
19996    where
19997        T: std::iter::IntoIterator<Item = V>,
19998        V: std::convert::Into<std::string::String>,
19999    {
20000        use std::iter::Iterator;
20001        self.locations = v.into_iter().map(|i| i.into()).collect();
20002        self
20003    }
20004
20005    /// Sets the value of [name][crate::model::SetLocationsRequest::name].
20006    ///
20007    /// # Example
20008    /// ```ignore,no_run
20009    /// # use google_cloud_container_v1::model::SetLocationsRequest;
20010    /// let x = SetLocationsRequest::new().set_name("example");
20011    /// ```
20012    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20013        self.name = v.into();
20014        self
20015    }
20016}
20017
20018impl wkt::message::Message for SetLocationsRequest {
20019    fn typename() -> &'static str {
20020        "type.googleapis.com/google.container.v1.SetLocationsRequest"
20021    }
20022}
20023
20024/// UpdateMasterRequest updates the master of the cluster.
20025#[derive(Clone, Default, PartialEq)]
20026#[non_exhaustive]
20027pub struct UpdateMasterRequest {
20028    /// Deprecated. The Google Developers Console [project ID or project
20029    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20030    /// This field has been deprecated and replaced by the name field.
20031    #[deprecated]
20032    pub project_id: std::string::String,
20033
20034    /// Deprecated. The name of the Google Compute Engine
20035    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20036    /// in which the cluster resides. This field has been deprecated and replaced
20037    /// by the name field.
20038    #[deprecated]
20039    pub zone: std::string::String,
20040
20041    /// Deprecated. The name of the cluster to upgrade.
20042    /// This field has been deprecated and replaced by the name field.
20043    #[deprecated]
20044    pub cluster_id: std::string::String,
20045
20046    /// Required. The Kubernetes version to change the master to.
20047    ///
20048    /// Users may specify either explicit versions offered by Kubernetes Engine or
20049    /// version aliases, which have the following behavior:
20050    ///
20051    /// - "latest": picks the highest valid Kubernetes version
20052    /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
20053    /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
20054    /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
20055    /// - "-": picks the default Kubernetes version
20056    pub master_version: std::string::String,
20057
20058    /// The name (project, location, cluster) of the cluster to update.
20059    /// Specified in the format `projects/*/locations/*/clusters/*`.
20060    pub name: std::string::String,
20061
20062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20063}
20064
20065impl UpdateMasterRequest {
20066    pub fn new() -> Self {
20067        std::default::Default::default()
20068    }
20069
20070    /// Sets the value of [project_id][crate::model::UpdateMasterRequest::project_id].
20071    ///
20072    /// # Example
20073    /// ```ignore,no_run
20074    /// # use google_cloud_container_v1::model::UpdateMasterRequest;
20075    /// let x = UpdateMasterRequest::new().set_project_id("example");
20076    /// ```
20077    #[deprecated]
20078    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20079        self.project_id = v.into();
20080        self
20081    }
20082
20083    /// Sets the value of [zone][crate::model::UpdateMasterRequest::zone].
20084    ///
20085    /// # Example
20086    /// ```ignore,no_run
20087    /// # use google_cloud_container_v1::model::UpdateMasterRequest;
20088    /// let x = UpdateMasterRequest::new().set_zone("example");
20089    /// ```
20090    #[deprecated]
20091    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20092        self.zone = v.into();
20093        self
20094    }
20095
20096    /// Sets the value of [cluster_id][crate::model::UpdateMasterRequest::cluster_id].
20097    ///
20098    /// # Example
20099    /// ```ignore,no_run
20100    /// # use google_cloud_container_v1::model::UpdateMasterRequest;
20101    /// let x = UpdateMasterRequest::new().set_cluster_id("example");
20102    /// ```
20103    #[deprecated]
20104    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20105        self.cluster_id = v.into();
20106        self
20107    }
20108
20109    /// Sets the value of [master_version][crate::model::UpdateMasterRequest::master_version].
20110    ///
20111    /// # Example
20112    /// ```ignore,no_run
20113    /// # use google_cloud_container_v1::model::UpdateMasterRequest;
20114    /// let x = UpdateMasterRequest::new().set_master_version("example");
20115    /// ```
20116    pub fn set_master_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20117        self.master_version = v.into();
20118        self
20119    }
20120
20121    /// Sets the value of [name][crate::model::UpdateMasterRequest::name].
20122    ///
20123    /// # Example
20124    /// ```ignore,no_run
20125    /// # use google_cloud_container_v1::model::UpdateMasterRequest;
20126    /// let x = UpdateMasterRequest::new().set_name("example");
20127    /// ```
20128    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20129        self.name = v.into();
20130        self
20131    }
20132}
20133
20134impl wkt::message::Message for UpdateMasterRequest {
20135    fn typename() -> &'static str {
20136        "type.googleapis.com/google.container.v1.UpdateMasterRequest"
20137    }
20138}
20139
20140/// SetMasterAuthRequest updates the admin password of a cluster.
20141#[derive(Clone, Default, PartialEq)]
20142#[non_exhaustive]
20143pub struct SetMasterAuthRequest {
20144    /// Deprecated. The Google Developers Console [project ID or project
20145    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20146    /// This field has been deprecated and replaced by the name field.
20147    #[deprecated]
20148    pub project_id: std::string::String,
20149
20150    /// Deprecated. The name of the Google Compute Engine
20151    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20152    /// in which the cluster resides. This field has been deprecated and replaced
20153    /// by the name field.
20154    #[deprecated]
20155    pub zone: std::string::String,
20156
20157    /// Deprecated. The name of the cluster to upgrade.
20158    /// This field has been deprecated and replaced by the name field.
20159    #[deprecated]
20160    pub cluster_id: std::string::String,
20161
20162    /// Required. The exact form of action to be taken on the master auth.
20163    pub action: crate::model::set_master_auth_request::Action,
20164
20165    /// Required. A description of the update.
20166    pub update: std::option::Option<crate::model::MasterAuth>,
20167
20168    /// The name (project, location, cluster) of the cluster to set auth.
20169    /// Specified in the format `projects/*/locations/*/clusters/*`.
20170    pub name: std::string::String,
20171
20172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20173}
20174
20175impl SetMasterAuthRequest {
20176    pub fn new() -> Self {
20177        std::default::Default::default()
20178    }
20179
20180    /// Sets the value of [project_id][crate::model::SetMasterAuthRequest::project_id].
20181    ///
20182    /// # Example
20183    /// ```ignore,no_run
20184    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20185    /// let x = SetMasterAuthRequest::new().set_project_id("example");
20186    /// ```
20187    #[deprecated]
20188    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20189        self.project_id = v.into();
20190        self
20191    }
20192
20193    /// Sets the value of [zone][crate::model::SetMasterAuthRequest::zone].
20194    ///
20195    /// # Example
20196    /// ```ignore,no_run
20197    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20198    /// let x = SetMasterAuthRequest::new().set_zone("example");
20199    /// ```
20200    #[deprecated]
20201    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20202        self.zone = v.into();
20203        self
20204    }
20205
20206    /// Sets the value of [cluster_id][crate::model::SetMasterAuthRequest::cluster_id].
20207    ///
20208    /// # Example
20209    /// ```ignore,no_run
20210    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20211    /// let x = SetMasterAuthRequest::new().set_cluster_id("example");
20212    /// ```
20213    #[deprecated]
20214    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20215        self.cluster_id = v.into();
20216        self
20217    }
20218
20219    /// Sets the value of [action][crate::model::SetMasterAuthRequest::action].
20220    ///
20221    /// # Example
20222    /// ```ignore,no_run
20223    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20224    /// use google_cloud_container_v1::model::set_master_auth_request::Action;
20225    /// let x0 = SetMasterAuthRequest::new().set_action(Action::SetPassword);
20226    /// let x1 = SetMasterAuthRequest::new().set_action(Action::GeneratePassword);
20227    /// let x2 = SetMasterAuthRequest::new().set_action(Action::SetUsername);
20228    /// ```
20229    pub fn set_action<T: std::convert::Into<crate::model::set_master_auth_request::Action>>(
20230        mut self,
20231        v: T,
20232    ) -> Self {
20233        self.action = v.into();
20234        self
20235    }
20236
20237    /// Sets the value of [update][crate::model::SetMasterAuthRequest::update].
20238    ///
20239    /// # Example
20240    /// ```ignore,no_run
20241    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20242    /// use google_cloud_container_v1::model::MasterAuth;
20243    /// let x = SetMasterAuthRequest::new().set_update(MasterAuth::default()/* use setters */);
20244    /// ```
20245    pub fn set_update<T>(mut self, v: T) -> Self
20246    where
20247        T: std::convert::Into<crate::model::MasterAuth>,
20248    {
20249        self.update = std::option::Option::Some(v.into());
20250        self
20251    }
20252
20253    /// Sets or clears the value of [update][crate::model::SetMasterAuthRequest::update].
20254    ///
20255    /// # Example
20256    /// ```ignore,no_run
20257    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20258    /// use google_cloud_container_v1::model::MasterAuth;
20259    /// let x = SetMasterAuthRequest::new().set_or_clear_update(Some(MasterAuth::default()/* use setters */));
20260    /// let x = SetMasterAuthRequest::new().set_or_clear_update(None::<MasterAuth>);
20261    /// ```
20262    pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
20263    where
20264        T: std::convert::Into<crate::model::MasterAuth>,
20265    {
20266        self.update = v.map(|x| x.into());
20267        self
20268    }
20269
20270    /// Sets the value of [name][crate::model::SetMasterAuthRequest::name].
20271    ///
20272    /// # Example
20273    /// ```ignore,no_run
20274    /// # use google_cloud_container_v1::model::SetMasterAuthRequest;
20275    /// let x = SetMasterAuthRequest::new().set_name("example");
20276    /// ```
20277    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20278        self.name = v.into();
20279        self
20280    }
20281}
20282
20283impl wkt::message::Message for SetMasterAuthRequest {
20284    fn typename() -> &'static str {
20285        "type.googleapis.com/google.container.v1.SetMasterAuthRequest"
20286    }
20287}
20288
20289/// Defines additional types related to [SetMasterAuthRequest].
20290pub mod set_master_auth_request {
20291    #[allow(unused_imports)]
20292    use super::*;
20293
20294    /// Operation type: what type update to perform.
20295    ///
20296    /// # Working with unknown values
20297    ///
20298    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20299    /// additional enum variants at any time. Adding new variants is not considered
20300    /// a breaking change. Applications should write their code in anticipation of:
20301    ///
20302    /// - New values appearing in future releases of the client library, **and**
20303    /// - New values received dynamically, without application changes.
20304    ///
20305    /// Please consult the [Working with enums] section in the user guide for some
20306    /// guidelines.
20307    ///
20308    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
20309    #[derive(Clone, Debug, PartialEq)]
20310    #[non_exhaustive]
20311    pub enum Action {
20312        /// Operation is unknown and will error out.
20313        Unknown,
20314        /// Set the password to a user generated value.
20315        SetPassword,
20316        /// Generate a new password and set it to that.
20317        GeneratePassword,
20318        /// Set the username.  If an empty username is provided, basic authentication
20319        /// is disabled for the cluster.  If a non-empty username is provided, basic
20320        /// authentication is enabled, with either a provided password or a generated
20321        /// one.
20322        SetUsername,
20323        /// If set, the enum was initialized with an unknown value.
20324        ///
20325        /// Applications can examine the value using [Action::value] or
20326        /// [Action::name].
20327        UnknownValue(action::UnknownValue),
20328    }
20329
20330    #[doc(hidden)]
20331    pub mod action {
20332        #[allow(unused_imports)]
20333        use super::*;
20334        #[derive(Clone, Debug, PartialEq)]
20335        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20336    }
20337
20338    impl Action {
20339        /// Gets the enum value.
20340        ///
20341        /// Returns `None` if the enum contains an unknown value deserialized from
20342        /// the string representation of enums.
20343        pub fn value(&self) -> std::option::Option<i32> {
20344            match self {
20345                Self::Unknown => std::option::Option::Some(0),
20346                Self::SetPassword => std::option::Option::Some(1),
20347                Self::GeneratePassword => std::option::Option::Some(2),
20348                Self::SetUsername => std::option::Option::Some(3),
20349                Self::UnknownValue(u) => u.0.value(),
20350            }
20351        }
20352
20353        /// Gets the enum value as a string.
20354        ///
20355        /// Returns `None` if the enum contains an unknown value deserialized from
20356        /// the integer representation of enums.
20357        pub fn name(&self) -> std::option::Option<&str> {
20358            match self {
20359                Self::Unknown => std::option::Option::Some("UNKNOWN"),
20360                Self::SetPassword => std::option::Option::Some("SET_PASSWORD"),
20361                Self::GeneratePassword => std::option::Option::Some("GENERATE_PASSWORD"),
20362                Self::SetUsername => std::option::Option::Some("SET_USERNAME"),
20363                Self::UnknownValue(u) => u.0.name(),
20364            }
20365        }
20366    }
20367
20368    impl std::default::Default for Action {
20369        fn default() -> Self {
20370            use std::convert::From;
20371            Self::from(0)
20372        }
20373    }
20374
20375    impl std::fmt::Display for Action {
20376        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20377            wkt::internal::display_enum(f, self.name(), self.value())
20378        }
20379    }
20380
20381    impl std::convert::From<i32> for Action {
20382        fn from(value: i32) -> Self {
20383            match value {
20384                0 => Self::Unknown,
20385                1 => Self::SetPassword,
20386                2 => Self::GeneratePassword,
20387                3 => Self::SetUsername,
20388                _ => Self::UnknownValue(action::UnknownValue(
20389                    wkt::internal::UnknownEnumValue::Integer(value),
20390                )),
20391            }
20392        }
20393    }
20394
20395    impl std::convert::From<&str> for Action {
20396        fn from(value: &str) -> Self {
20397            use std::string::ToString;
20398            match value {
20399                "UNKNOWN" => Self::Unknown,
20400                "SET_PASSWORD" => Self::SetPassword,
20401                "GENERATE_PASSWORD" => Self::GeneratePassword,
20402                "SET_USERNAME" => Self::SetUsername,
20403                _ => Self::UnknownValue(action::UnknownValue(
20404                    wkt::internal::UnknownEnumValue::String(value.to_string()),
20405                )),
20406            }
20407        }
20408    }
20409
20410    impl serde::ser::Serialize for Action {
20411        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20412        where
20413            S: serde::Serializer,
20414        {
20415            match self {
20416                Self::Unknown => serializer.serialize_i32(0),
20417                Self::SetPassword => serializer.serialize_i32(1),
20418                Self::GeneratePassword => serializer.serialize_i32(2),
20419                Self::SetUsername => serializer.serialize_i32(3),
20420                Self::UnknownValue(u) => u.0.serialize(serializer),
20421            }
20422        }
20423    }
20424
20425    impl<'de> serde::de::Deserialize<'de> for Action {
20426        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20427        where
20428            D: serde::Deserializer<'de>,
20429        {
20430            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
20431                ".google.container.v1.SetMasterAuthRequest.Action",
20432            ))
20433        }
20434    }
20435}
20436
20437/// DeleteClusterRequest deletes a cluster.
20438#[derive(Clone, Default, PartialEq)]
20439#[non_exhaustive]
20440pub struct DeleteClusterRequest {
20441    /// Deprecated. The Google Developers Console [project ID or project
20442    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20443    /// This field has been deprecated and replaced by the name field.
20444    #[deprecated]
20445    pub project_id: std::string::String,
20446
20447    /// Deprecated. The name of the Google Compute Engine
20448    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20449    /// in which the cluster resides. This field has been deprecated and replaced
20450    /// by the name field.
20451    #[deprecated]
20452    pub zone: std::string::String,
20453
20454    /// Deprecated. The name of the cluster to delete.
20455    /// This field has been deprecated and replaced by the name field.
20456    #[deprecated]
20457    pub cluster_id: std::string::String,
20458
20459    /// The name (project, location, cluster) of the cluster to delete.
20460    /// Specified in the format `projects/*/locations/*/clusters/*`.
20461    pub name: std::string::String,
20462
20463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20464}
20465
20466impl DeleteClusterRequest {
20467    pub fn new() -> Self {
20468        std::default::Default::default()
20469    }
20470
20471    /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
20472    ///
20473    /// # Example
20474    /// ```ignore,no_run
20475    /// # use google_cloud_container_v1::model::DeleteClusterRequest;
20476    /// let x = DeleteClusterRequest::new().set_project_id("example");
20477    /// ```
20478    #[deprecated]
20479    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20480        self.project_id = v.into();
20481        self
20482    }
20483
20484    /// Sets the value of [zone][crate::model::DeleteClusterRequest::zone].
20485    ///
20486    /// # Example
20487    /// ```ignore,no_run
20488    /// # use google_cloud_container_v1::model::DeleteClusterRequest;
20489    /// let x = DeleteClusterRequest::new().set_zone("example");
20490    /// ```
20491    #[deprecated]
20492    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20493        self.zone = v.into();
20494        self
20495    }
20496
20497    /// Sets the value of [cluster_id][crate::model::DeleteClusterRequest::cluster_id].
20498    ///
20499    /// # Example
20500    /// ```ignore,no_run
20501    /// # use google_cloud_container_v1::model::DeleteClusterRequest;
20502    /// let x = DeleteClusterRequest::new().set_cluster_id("example");
20503    /// ```
20504    #[deprecated]
20505    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20506        self.cluster_id = v.into();
20507        self
20508    }
20509
20510    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
20511    ///
20512    /// # Example
20513    /// ```ignore,no_run
20514    /// # use google_cloud_container_v1::model::DeleteClusterRequest;
20515    /// let x = DeleteClusterRequest::new().set_name("example");
20516    /// ```
20517    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20518        self.name = v.into();
20519        self
20520    }
20521}
20522
20523impl wkt::message::Message for DeleteClusterRequest {
20524    fn typename() -> &'static str {
20525        "type.googleapis.com/google.container.v1.DeleteClusterRequest"
20526    }
20527}
20528
20529/// ListClustersRequest lists clusters.
20530#[derive(Clone, Default, PartialEq)]
20531#[non_exhaustive]
20532pub struct ListClustersRequest {
20533    /// Deprecated. The Google Developers Console [project ID or project
20534    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20535    /// This field has been deprecated and replaced by the parent field.
20536    #[deprecated]
20537    pub project_id: std::string::String,
20538
20539    /// Deprecated. The name of the Google Compute Engine
20540    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20541    /// in which the cluster resides, or "-" for all zones. This field has been
20542    /// deprecated and replaced by the parent field.
20543    #[deprecated]
20544    pub zone: std::string::String,
20545
20546    /// The parent (project and location) where the clusters will be listed.
20547    /// Specified in the format `projects/*/locations/*`.
20548    /// Location "-" matches all zones and all regions.
20549    pub parent: std::string::String,
20550
20551    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20552}
20553
20554impl ListClustersRequest {
20555    pub fn new() -> Self {
20556        std::default::Default::default()
20557    }
20558
20559    /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
20560    ///
20561    /// # Example
20562    /// ```ignore,no_run
20563    /// # use google_cloud_container_v1::model::ListClustersRequest;
20564    /// let x = ListClustersRequest::new().set_project_id("example");
20565    /// ```
20566    #[deprecated]
20567    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20568        self.project_id = v.into();
20569        self
20570    }
20571
20572    /// Sets the value of [zone][crate::model::ListClustersRequest::zone].
20573    ///
20574    /// # Example
20575    /// ```ignore,no_run
20576    /// # use google_cloud_container_v1::model::ListClustersRequest;
20577    /// let x = ListClustersRequest::new().set_zone("example");
20578    /// ```
20579    #[deprecated]
20580    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20581        self.zone = v.into();
20582        self
20583    }
20584
20585    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
20586    ///
20587    /// # Example
20588    /// ```ignore,no_run
20589    /// # use google_cloud_container_v1::model::ListClustersRequest;
20590    /// let x = ListClustersRequest::new().set_parent("example");
20591    /// ```
20592    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20593        self.parent = v.into();
20594        self
20595    }
20596}
20597
20598impl wkt::message::Message for ListClustersRequest {
20599    fn typename() -> &'static str {
20600        "type.googleapis.com/google.container.v1.ListClustersRequest"
20601    }
20602}
20603
20604/// ListClustersResponse is the result of ListClustersRequest.
20605#[derive(Clone, Default, PartialEq)]
20606#[non_exhaustive]
20607pub struct ListClustersResponse {
20608    /// A list of clusters in the project in the specified zone, or
20609    /// across all ones.
20610    pub clusters: std::vec::Vec<crate::model::Cluster>,
20611
20612    /// If any zones are listed here, the list of clusters returned
20613    /// may be missing those zones.
20614    pub missing_zones: std::vec::Vec<std::string::String>,
20615
20616    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20617}
20618
20619impl ListClustersResponse {
20620    pub fn new() -> Self {
20621        std::default::Default::default()
20622    }
20623
20624    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
20625    ///
20626    /// # Example
20627    /// ```ignore,no_run
20628    /// # use google_cloud_container_v1::model::ListClustersResponse;
20629    /// use google_cloud_container_v1::model::Cluster;
20630    /// let x = ListClustersResponse::new()
20631    ///     .set_clusters([
20632    ///         Cluster::default()/* use setters */,
20633    ///         Cluster::default()/* use (different) setters */,
20634    ///     ]);
20635    /// ```
20636    pub fn set_clusters<T, V>(mut self, v: T) -> Self
20637    where
20638        T: std::iter::IntoIterator<Item = V>,
20639        V: std::convert::Into<crate::model::Cluster>,
20640    {
20641        use std::iter::Iterator;
20642        self.clusters = v.into_iter().map(|i| i.into()).collect();
20643        self
20644    }
20645
20646    /// Sets the value of [missing_zones][crate::model::ListClustersResponse::missing_zones].
20647    ///
20648    /// # Example
20649    /// ```ignore,no_run
20650    /// # use google_cloud_container_v1::model::ListClustersResponse;
20651    /// let x = ListClustersResponse::new().set_missing_zones(["a", "b", "c"]);
20652    /// ```
20653    pub fn set_missing_zones<T, V>(mut self, v: T) -> Self
20654    where
20655        T: std::iter::IntoIterator<Item = V>,
20656        V: std::convert::Into<std::string::String>,
20657    {
20658        use std::iter::Iterator;
20659        self.missing_zones = v.into_iter().map(|i| i.into()).collect();
20660        self
20661    }
20662}
20663
20664impl wkt::message::Message for ListClustersResponse {
20665    fn typename() -> &'static str {
20666        "type.googleapis.com/google.container.v1.ListClustersResponse"
20667    }
20668}
20669
20670/// GetOperationRequest gets a single operation.
20671#[derive(Clone, Default, PartialEq)]
20672#[non_exhaustive]
20673pub struct GetOperationRequest {
20674    /// Deprecated. The Google Developers Console [project ID or project
20675    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20676    /// This field has been deprecated and replaced by the name field.
20677    #[deprecated]
20678    pub project_id: std::string::String,
20679
20680    /// Deprecated. The name of the Google Compute Engine
20681    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20682    /// in which the cluster resides. This field has been deprecated and replaced
20683    /// by the name field.
20684    #[deprecated]
20685    pub zone: std::string::String,
20686
20687    /// Deprecated. The server-assigned `name` of the operation.
20688    /// This field has been deprecated and replaced by the name field.
20689    #[deprecated]
20690    pub operation_id: std::string::String,
20691
20692    /// The name (project, location, operation id) of the operation to get.
20693    /// Specified in the format `projects/*/locations/*/operations/*`.
20694    pub name: std::string::String,
20695
20696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20697}
20698
20699impl GetOperationRequest {
20700    pub fn new() -> Self {
20701        std::default::Default::default()
20702    }
20703
20704    /// Sets the value of [project_id][crate::model::GetOperationRequest::project_id].
20705    ///
20706    /// # Example
20707    /// ```ignore,no_run
20708    /// # use google_cloud_container_v1::model::GetOperationRequest;
20709    /// let x = GetOperationRequest::new().set_project_id("example");
20710    /// ```
20711    #[deprecated]
20712    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20713        self.project_id = v.into();
20714        self
20715    }
20716
20717    /// Sets the value of [zone][crate::model::GetOperationRequest::zone].
20718    ///
20719    /// # Example
20720    /// ```ignore,no_run
20721    /// # use google_cloud_container_v1::model::GetOperationRequest;
20722    /// let x = GetOperationRequest::new().set_zone("example");
20723    /// ```
20724    #[deprecated]
20725    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20726        self.zone = v.into();
20727        self
20728    }
20729
20730    /// Sets the value of [operation_id][crate::model::GetOperationRequest::operation_id].
20731    ///
20732    /// # Example
20733    /// ```ignore,no_run
20734    /// # use google_cloud_container_v1::model::GetOperationRequest;
20735    /// let x = GetOperationRequest::new().set_operation_id("example");
20736    /// ```
20737    #[deprecated]
20738    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20739        self.operation_id = v.into();
20740        self
20741    }
20742
20743    /// Sets the value of [name][crate::model::GetOperationRequest::name].
20744    ///
20745    /// # Example
20746    /// ```ignore,no_run
20747    /// # use google_cloud_container_v1::model::GetOperationRequest;
20748    /// let x = GetOperationRequest::new().set_name("example");
20749    /// ```
20750    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20751        self.name = v.into();
20752        self
20753    }
20754}
20755
20756impl wkt::message::Message for GetOperationRequest {
20757    fn typename() -> &'static str {
20758        "type.googleapis.com/google.container.v1.GetOperationRequest"
20759    }
20760}
20761
20762/// ListOperationsRequest lists operations.
20763#[derive(Clone, Default, PartialEq)]
20764#[non_exhaustive]
20765pub struct ListOperationsRequest {
20766    /// Deprecated. The Google Developers Console [project ID or project
20767    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20768    /// This field has been deprecated and replaced by the parent field.
20769    #[deprecated]
20770    pub project_id: std::string::String,
20771
20772    /// Deprecated. The name of the Google Compute Engine
20773    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20774    /// to return operations for, or `-` for all zones. This field has been
20775    /// deprecated and replaced by the parent field.
20776    #[deprecated]
20777    pub zone: std::string::String,
20778
20779    /// The parent (project and location) where the operations will be listed.
20780    /// Specified in the format `projects/*/locations/*`.
20781    /// Location "-" matches all zones and all regions.
20782    pub parent: std::string::String,
20783
20784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20785}
20786
20787impl ListOperationsRequest {
20788    pub fn new() -> Self {
20789        std::default::Default::default()
20790    }
20791
20792    /// Sets the value of [project_id][crate::model::ListOperationsRequest::project_id].
20793    ///
20794    /// # Example
20795    /// ```ignore,no_run
20796    /// # use google_cloud_container_v1::model::ListOperationsRequest;
20797    /// let x = ListOperationsRequest::new().set_project_id("example");
20798    /// ```
20799    #[deprecated]
20800    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20801        self.project_id = v.into();
20802        self
20803    }
20804
20805    /// Sets the value of [zone][crate::model::ListOperationsRequest::zone].
20806    ///
20807    /// # Example
20808    /// ```ignore,no_run
20809    /// # use google_cloud_container_v1::model::ListOperationsRequest;
20810    /// let x = ListOperationsRequest::new().set_zone("example");
20811    /// ```
20812    #[deprecated]
20813    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20814        self.zone = v.into();
20815        self
20816    }
20817
20818    /// Sets the value of [parent][crate::model::ListOperationsRequest::parent].
20819    ///
20820    /// # Example
20821    /// ```ignore,no_run
20822    /// # use google_cloud_container_v1::model::ListOperationsRequest;
20823    /// let x = ListOperationsRequest::new().set_parent("example");
20824    /// ```
20825    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20826        self.parent = v.into();
20827        self
20828    }
20829}
20830
20831impl wkt::message::Message for ListOperationsRequest {
20832    fn typename() -> &'static str {
20833        "type.googleapis.com/google.container.v1.ListOperationsRequest"
20834    }
20835}
20836
20837/// CancelOperationRequest cancels a single operation.
20838#[derive(Clone, Default, PartialEq)]
20839#[non_exhaustive]
20840pub struct CancelOperationRequest {
20841    /// Deprecated. The Google Developers Console [project ID or project
20842    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
20843    /// This field has been deprecated and replaced by the name field.
20844    #[deprecated]
20845    pub project_id: std::string::String,
20846
20847    /// Deprecated. The name of the Google Compute Engine
20848    /// [zone](https://cloud.google.com/compute/docs/zones#available)
20849    /// in which the operation resides. This field has been deprecated and replaced
20850    /// by the name field.
20851    #[deprecated]
20852    pub zone: std::string::String,
20853
20854    /// Deprecated. The server-assigned `name` of the operation.
20855    /// This field has been deprecated and replaced by the name field.
20856    #[deprecated]
20857    pub operation_id: std::string::String,
20858
20859    /// The name (project, location, operation id) of the operation to cancel.
20860    /// Specified in the format `projects/*/locations/*/operations/*`.
20861    pub name: std::string::String,
20862
20863    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20864}
20865
20866impl CancelOperationRequest {
20867    pub fn new() -> Self {
20868        std::default::Default::default()
20869    }
20870
20871    /// Sets the value of [project_id][crate::model::CancelOperationRequest::project_id].
20872    ///
20873    /// # Example
20874    /// ```ignore,no_run
20875    /// # use google_cloud_container_v1::model::CancelOperationRequest;
20876    /// let x = CancelOperationRequest::new().set_project_id("example");
20877    /// ```
20878    #[deprecated]
20879    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20880        self.project_id = v.into();
20881        self
20882    }
20883
20884    /// Sets the value of [zone][crate::model::CancelOperationRequest::zone].
20885    ///
20886    /// # Example
20887    /// ```ignore,no_run
20888    /// # use google_cloud_container_v1::model::CancelOperationRequest;
20889    /// let x = CancelOperationRequest::new().set_zone("example");
20890    /// ```
20891    #[deprecated]
20892    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20893        self.zone = v.into();
20894        self
20895    }
20896
20897    /// Sets the value of [operation_id][crate::model::CancelOperationRequest::operation_id].
20898    ///
20899    /// # Example
20900    /// ```ignore,no_run
20901    /// # use google_cloud_container_v1::model::CancelOperationRequest;
20902    /// let x = CancelOperationRequest::new().set_operation_id("example");
20903    /// ```
20904    #[deprecated]
20905    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20906        self.operation_id = v.into();
20907        self
20908    }
20909
20910    /// Sets the value of [name][crate::model::CancelOperationRequest::name].
20911    ///
20912    /// # Example
20913    /// ```ignore,no_run
20914    /// # use google_cloud_container_v1::model::CancelOperationRequest;
20915    /// let x = CancelOperationRequest::new().set_name("example");
20916    /// ```
20917    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20918        self.name = v.into();
20919        self
20920    }
20921}
20922
20923impl wkt::message::Message for CancelOperationRequest {
20924    fn typename() -> &'static str {
20925        "type.googleapis.com/google.container.v1.CancelOperationRequest"
20926    }
20927}
20928
20929/// ListOperationsResponse is the result of ListOperationsRequest.
20930#[derive(Clone, Default, PartialEq)]
20931#[non_exhaustive]
20932pub struct ListOperationsResponse {
20933    /// A list of operations in the project in the specified zone.
20934    pub operations: std::vec::Vec<crate::model::Operation>,
20935
20936    /// If any zones are listed here, the list of operations returned
20937    /// may be missing the operations from those zones.
20938    pub missing_zones: std::vec::Vec<std::string::String>,
20939
20940    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20941}
20942
20943impl ListOperationsResponse {
20944    pub fn new() -> Self {
20945        std::default::Default::default()
20946    }
20947
20948    /// Sets the value of [operations][crate::model::ListOperationsResponse::operations].
20949    ///
20950    /// # Example
20951    /// ```ignore,no_run
20952    /// # use google_cloud_container_v1::model::ListOperationsResponse;
20953    /// use google_cloud_container_v1::model::Operation;
20954    /// let x = ListOperationsResponse::new()
20955    ///     .set_operations([
20956    ///         Operation::default()/* use setters */,
20957    ///         Operation::default()/* use (different) setters */,
20958    ///     ]);
20959    /// ```
20960    pub fn set_operations<T, V>(mut self, v: T) -> Self
20961    where
20962        T: std::iter::IntoIterator<Item = V>,
20963        V: std::convert::Into<crate::model::Operation>,
20964    {
20965        use std::iter::Iterator;
20966        self.operations = v.into_iter().map(|i| i.into()).collect();
20967        self
20968    }
20969
20970    /// Sets the value of [missing_zones][crate::model::ListOperationsResponse::missing_zones].
20971    ///
20972    /// # Example
20973    /// ```ignore,no_run
20974    /// # use google_cloud_container_v1::model::ListOperationsResponse;
20975    /// let x = ListOperationsResponse::new().set_missing_zones(["a", "b", "c"]);
20976    /// ```
20977    pub fn set_missing_zones<T, V>(mut self, v: T) -> Self
20978    where
20979        T: std::iter::IntoIterator<Item = V>,
20980        V: std::convert::Into<std::string::String>,
20981    {
20982        use std::iter::Iterator;
20983        self.missing_zones = v.into_iter().map(|i| i.into()).collect();
20984        self
20985    }
20986}
20987
20988impl wkt::message::Message for ListOperationsResponse {
20989    fn typename() -> &'static str {
20990        "type.googleapis.com/google.container.v1.ListOperationsResponse"
20991    }
20992}
20993
20994/// Gets the current Kubernetes Engine service configuration.
20995#[derive(Clone, Default, PartialEq)]
20996#[non_exhaustive]
20997pub struct GetServerConfigRequest {
20998    /// Deprecated. The Google Developers Console [project ID or project
20999    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21000    /// This field has been deprecated and replaced by the name field.
21001    #[deprecated]
21002    pub project_id: std::string::String,
21003
21004    /// Deprecated. The name of the Google Compute Engine
21005    /// [zone](https://cloud.google.com/compute/docs/zones#available)
21006    /// to return operations for. This field has been deprecated and replaced by
21007    /// the name field.
21008    #[deprecated]
21009    pub zone: std::string::String,
21010
21011    /// The name (project and location) of the server config to get,
21012    /// specified in the format `projects/*/locations/*`.
21013    pub name: std::string::String,
21014
21015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21016}
21017
21018impl GetServerConfigRequest {
21019    pub fn new() -> Self {
21020        std::default::Default::default()
21021    }
21022
21023    /// Sets the value of [project_id][crate::model::GetServerConfigRequest::project_id].
21024    ///
21025    /// # Example
21026    /// ```ignore,no_run
21027    /// # use google_cloud_container_v1::model::GetServerConfigRequest;
21028    /// let x = GetServerConfigRequest::new().set_project_id("example");
21029    /// ```
21030    #[deprecated]
21031    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21032        self.project_id = v.into();
21033        self
21034    }
21035
21036    /// Sets the value of [zone][crate::model::GetServerConfigRequest::zone].
21037    ///
21038    /// # Example
21039    /// ```ignore,no_run
21040    /// # use google_cloud_container_v1::model::GetServerConfigRequest;
21041    /// let x = GetServerConfigRequest::new().set_zone("example");
21042    /// ```
21043    #[deprecated]
21044    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21045        self.zone = v.into();
21046        self
21047    }
21048
21049    /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
21050    ///
21051    /// # Example
21052    /// ```ignore,no_run
21053    /// # use google_cloud_container_v1::model::GetServerConfigRequest;
21054    /// let x = GetServerConfigRequest::new().set_name("example");
21055    /// ```
21056    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21057        self.name = v.into();
21058        self
21059    }
21060}
21061
21062impl wkt::message::Message for GetServerConfigRequest {
21063    fn typename() -> &'static str {
21064        "type.googleapis.com/google.container.v1.GetServerConfigRequest"
21065    }
21066}
21067
21068/// Kubernetes Engine service configuration.
21069#[derive(Clone, Default, PartialEq)]
21070#[non_exhaustive]
21071pub struct ServerConfig {
21072    /// Version of Kubernetes the service deploys by default.
21073    pub default_cluster_version: std::string::String,
21074
21075    /// List of valid node upgrade target versions, in descending order.
21076    pub valid_node_versions: std::vec::Vec<std::string::String>,
21077
21078    /// Default image type.
21079    pub default_image_type: std::string::String,
21080
21081    /// List of valid image types.
21082    pub valid_image_types: std::vec::Vec<std::string::String>,
21083
21084    /// List of valid master versions, in descending order.
21085    pub valid_master_versions: std::vec::Vec<std::string::String>,
21086
21087    /// List of release channel configurations.
21088    pub channels: std::vec::Vec<crate::model::server_config::ReleaseChannelConfig>,
21089
21090    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21091}
21092
21093impl ServerConfig {
21094    pub fn new() -> Self {
21095        std::default::Default::default()
21096    }
21097
21098    /// Sets the value of [default_cluster_version][crate::model::ServerConfig::default_cluster_version].
21099    ///
21100    /// # Example
21101    /// ```ignore,no_run
21102    /// # use google_cloud_container_v1::model::ServerConfig;
21103    /// let x = ServerConfig::new().set_default_cluster_version("example");
21104    /// ```
21105    pub fn set_default_cluster_version<T: std::convert::Into<std::string::String>>(
21106        mut self,
21107        v: T,
21108    ) -> Self {
21109        self.default_cluster_version = v.into();
21110        self
21111    }
21112
21113    /// Sets the value of [valid_node_versions][crate::model::ServerConfig::valid_node_versions].
21114    ///
21115    /// # Example
21116    /// ```ignore,no_run
21117    /// # use google_cloud_container_v1::model::ServerConfig;
21118    /// let x = ServerConfig::new().set_valid_node_versions(["a", "b", "c"]);
21119    /// ```
21120    pub fn set_valid_node_versions<T, V>(mut self, v: T) -> Self
21121    where
21122        T: std::iter::IntoIterator<Item = V>,
21123        V: std::convert::Into<std::string::String>,
21124    {
21125        use std::iter::Iterator;
21126        self.valid_node_versions = v.into_iter().map(|i| i.into()).collect();
21127        self
21128    }
21129
21130    /// Sets the value of [default_image_type][crate::model::ServerConfig::default_image_type].
21131    ///
21132    /// # Example
21133    /// ```ignore,no_run
21134    /// # use google_cloud_container_v1::model::ServerConfig;
21135    /// let x = ServerConfig::new().set_default_image_type("example");
21136    /// ```
21137    pub fn set_default_image_type<T: std::convert::Into<std::string::String>>(
21138        mut self,
21139        v: T,
21140    ) -> Self {
21141        self.default_image_type = v.into();
21142        self
21143    }
21144
21145    /// Sets the value of [valid_image_types][crate::model::ServerConfig::valid_image_types].
21146    ///
21147    /// # Example
21148    /// ```ignore,no_run
21149    /// # use google_cloud_container_v1::model::ServerConfig;
21150    /// let x = ServerConfig::new().set_valid_image_types(["a", "b", "c"]);
21151    /// ```
21152    pub fn set_valid_image_types<T, V>(mut self, v: T) -> Self
21153    where
21154        T: std::iter::IntoIterator<Item = V>,
21155        V: std::convert::Into<std::string::String>,
21156    {
21157        use std::iter::Iterator;
21158        self.valid_image_types = v.into_iter().map(|i| i.into()).collect();
21159        self
21160    }
21161
21162    /// Sets the value of [valid_master_versions][crate::model::ServerConfig::valid_master_versions].
21163    ///
21164    /// # Example
21165    /// ```ignore,no_run
21166    /// # use google_cloud_container_v1::model::ServerConfig;
21167    /// let x = ServerConfig::new().set_valid_master_versions(["a", "b", "c"]);
21168    /// ```
21169    pub fn set_valid_master_versions<T, V>(mut self, v: T) -> Self
21170    where
21171        T: std::iter::IntoIterator<Item = V>,
21172        V: std::convert::Into<std::string::String>,
21173    {
21174        use std::iter::Iterator;
21175        self.valid_master_versions = v.into_iter().map(|i| i.into()).collect();
21176        self
21177    }
21178
21179    /// Sets the value of [channels][crate::model::ServerConfig::channels].
21180    ///
21181    /// # Example
21182    /// ```ignore,no_run
21183    /// # use google_cloud_container_v1::model::ServerConfig;
21184    /// use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
21185    /// let x = ServerConfig::new()
21186    ///     .set_channels([
21187    ///         ReleaseChannelConfig::default()/* use setters */,
21188    ///         ReleaseChannelConfig::default()/* use (different) setters */,
21189    ///     ]);
21190    /// ```
21191    pub fn set_channels<T, V>(mut self, v: T) -> Self
21192    where
21193        T: std::iter::IntoIterator<Item = V>,
21194        V: std::convert::Into<crate::model::server_config::ReleaseChannelConfig>,
21195    {
21196        use std::iter::Iterator;
21197        self.channels = v.into_iter().map(|i| i.into()).collect();
21198        self
21199    }
21200}
21201
21202impl wkt::message::Message for ServerConfig {
21203    fn typename() -> &'static str {
21204        "type.googleapis.com/google.container.v1.ServerConfig"
21205    }
21206}
21207
21208/// Defines additional types related to [ServerConfig].
21209pub mod server_config {
21210    #[allow(unused_imports)]
21211    use super::*;
21212
21213    /// ReleaseChannelConfig exposes configuration for a release channel.
21214    #[derive(Clone, Default, PartialEq)]
21215    #[non_exhaustive]
21216    pub struct ReleaseChannelConfig {
21217        /// The release channel this configuration applies to.
21218        pub channel: crate::model::release_channel::Channel,
21219
21220        /// The default version for newly created clusters on the channel.
21221        pub default_version: std::string::String,
21222
21223        /// List of valid versions for the channel.
21224        pub valid_versions: std::vec::Vec<std::string::String>,
21225
21226        /// The auto upgrade target version for clusters on the channel.
21227        pub upgrade_target_version: std::string::String,
21228
21229        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21230    }
21231
21232    impl ReleaseChannelConfig {
21233        pub fn new() -> Self {
21234            std::default::Default::default()
21235        }
21236
21237        /// Sets the value of [channel][crate::model::server_config::ReleaseChannelConfig::channel].
21238        ///
21239        /// # Example
21240        /// ```ignore,no_run
21241        /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
21242        /// use google_cloud_container_v1::model::release_channel::Channel;
21243        /// let x0 = ReleaseChannelConfig::new().set_channel(Channel::Rapid);
21244        /// let x1 = ReleaseChannelConfig::new().set_channel(Channel::Regular);
21245        /// let x2 = ReleaseChannelConfig::new().set_channel(Channel::Stable);
21246        /// ```
21247        pub fn set_channel<T: std::convert::Into<crate::model::release_channel::Channel>>(
21248            mut self,
21249            v: T,
21250        ) -> Self {
21251            self.channel = v.into();
21252            self
21253        }
21254
21255        /// Sets the value of [default_version][crate::model::server_config::ReleaseChannelConfig::default_version].
21256        ///
21257        /// # Example
21258        /// ```ignore,no_run
21259        /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
21260        /// let x = ReleaseChannelConfig::new().set_default_version("example");
21261        /// ```
21262        pub fn set_default_version<T: std::convert::Into<std::string::String>>(
21263            mut self,
21264            v: T,
21265        ) -> Self {
21266            self.default_version = v.into();
21267            self
21268        }
21269
21270        /// Sets the value of [valid_versions][crate::model::server_config::ReleaseChannelConfig::valid_versions].
21271        ///
21272        /// # Example
21273        /// ```ignore,no_run
21274        /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
21275        /// let x = ReleaseChannelConfig::new().set_valid_versions(["a", "b", "c"]);
21276        /// ```
21277        pub fn set_valid_versions<T, V>(mut self, v: T) -> Self
21278        where
21279            T: std::iter::IntoIterator<Item = V>,
21280            V: std::convert::Into<std::string::String>,
21281        {
21282            use std::iter::Iterator;
21283            self.valid_versions = v.into_iter().map(|i| i.into()).collect();
21284            self
21285        }
21286
21287        /// Sets the value of [upgrade_target_version][crate::model::server_config::ReleaseChannelConfig::upgrade_target_version].
21288        ///
21289        /// # Example
21290        /// ```ignore,no_run
21291        /// # use google_cloud_container_v1::model::server_config::ReleaseChannelConfig;
21292        /// let x = ReleaseChannelConfig::new().set_upgrade_target_version("example");
21293        /// ```
21294        pub fn set_upgrade_target_version<T: std::convert::Into<std::string::String>>(
21295            mut self,
21296            v: T,
21297        ) -> Self {
21298            self.upgrade_target_version = v.into();
21299            self
21300        }
21301    }
21302
21303    impl wkt::message::Message for ReleaseChannelConfig {
21304        fn typename() -> &'static str {
21305            "type.googleapis.com/google.container.v1.ServerConfig.ReleaseChannelConfig"
21306        }
21307    }
21308}
21309
21310/// CreateNodePoolRequest creates a node pool for a cluster.
21311#[derive(Clone, Default, PartialEq)]
21312#[non_exhaustive]
21313pub struct CreateNodePoolRequest {
21314    /// Deprecated. The Google Developers Console [project ID or project
21315    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21316    /// This field has been deprecated and replaced by the parent field.
21317    #[deprecated]
21318    pub project_id: std::string::String,
21319
21320    /// Deprecated. The name of the Google Compute Engine
21321    /// [zone](https://cloud.google.com/compute/docs/zones#available)
21322    /// in which the cluster resides. This field has been deprecated and replaced
21323    /// by the parent field.
21324    #[deprecated]
21325    pub zone: std::string::String,
21326
21327    /// Deprecated. The name of the cluster.
21328    /// This field has been deprecated and replaced by the parent field.
21329    #[deprecated]
21330    pub cluster_id: std::string::String,
21331
21332    /// Required. The node pool to create.
21333    pub node_pool: std::option::Option<crate::model::NodePool>,
21334
21335    /// The parent (project, location, cluster name) where the node pool will be
21336    /// created. Specified in the format
21337    /// `projects/*/locations/*/clusters/*`.
21338    pub parent: std::string::String,
21339
21340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21341}
21342
21343impl CreateNodePoolRequest {
21344    pub fn new() -> Self {
21345        std::default::Default::default()
21346    }
21347
21348    /// Sets the value of [project_id][crate::model::CreateNodePoolRequest::project_id].
21349    ///
21350    /// # Example
21351    /// ```ignore,no_run
21352    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21353    /// let x = CreateNodePoolRequest::new().set_project_id("example");
21354    /// ```
21355    #[deprecated]
21356    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21357        self.project_id = v.into();
21358        self
21359    }
21360
21361    /// Sets the value of [zone][crate::model::CreateNodePoolRequest::zone].
21362    ///
21363    /// # Example
21364    /// ```ignore,no_run
21365    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21366    /// let x = CreateNodePoolRequest::new().set_zone("example");
21367    /// ```
21368    #[deprecated]
21369    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21370        self.zone = v.into();
21371        self
21372    }
21373
21374    /// Sets the value of [cluster_id][crate::model::CreateNodePoolRequest::cluster_id].
21375    ///
21376    /// # Example
21377    /// ```ignore,no_run
21378    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21379    /// let x = CreateNodePoolRequest::new().set_cluster_id("example");
21380    /// ```
21381    #[deprecated]
21382    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21383        self.cluster_id = v.into();
21384        self
21385    }
21386
21387    /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
21388    ///
21389    /// # Example
21390    /// ```ignore,no_run
21391    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21392    /// use google_cloud_container_v1::model::NodePool;
21393    /// let x = CreateNodePoolRequest::new().set_node_pool(NodePool::default()/* use setters */);
21394    /// ```
21395    pub fn set_node_pool<T>(mut self, v: T) -> Self
21396    where
21397        T: std::convert::Into<crate::model::NodePool>,
21398    {
21399        self.node_pool = std::option::Option::Some(v.into());
21400        self
21401    }
21402
21403    /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
21404    ///
21405    /// # Example
21406    /// ```ignore,no_run
21407    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21408    /// use google_cloud_container_v1::model::NodePool;
21409    /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(Some(NodePool::default()/* use setters */));
21410    /// let x = CreateNodePoolRequest::new().set_or_clear_node_pool(None::<NodePool>);
21411    /// ```
21412    pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
21413    where
21414        T: std::convert::Into<crate::model::NodePool>,
21415    {
21416        self.node_pool = v.map(|x| x.into());
21417        self
21418    }
21419
21420    /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
21421    ///
21422    /// # Example
21423    /// ```ignore,no_run
21424    /// # use google_cloud_container_v1::model::CreateNodePoolRequest;
21425    /// let x = CreateNodePoolRequest::new().set_parent("example");
21426    /// ```
21427    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21428        self.parent = v.into();
21429        self
21430    }
21431}
21432
21433impl wkt::message::Message for CreateNodePoolRequest {
21434    fn typename() -> &'static str {
21435        "type.googleapis.com/google.container.v1.CreateNodePoolRequest"
21436    }
21437}
21438
21439/// DeleteNodePoolRequest deletes a node pool for a cluster.
21440#[derive(Clone, Default, PartialEq)]
21441#[non_exhaustive]
21442pub struct DeleteNodePoolRequest {
21443    /// Deprecated. The Google Developers Console [project ID or project
21444    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21445    /// This field has been deprecated and replaced by the name field.
21446    #[deprecated]
21447    pub project_id: std::string::String,
21448
21449    /// Deprecated. The name of the Google Compute Engine
21450    /// [zone](https://cloud.google.com/compute/docs/zones#available)
21451    /// in which the cluster resides. This field has been deprecated and replaced
21452    /// by the name field.
21453    #[deprecated]
21454    pub zone: std::string::String,
21455
21456    /// Deprecated. The name of the cluster.
21457    /// This field has been deprecated and replaced by the name field.
21458    #[deprecated]
21459    pub cluster_id: std::string::String,
21460
21461    /// Deprecated. The name of the node pool to delete.
21462    /// This field has been deprecated and replaced by the name field.
21463    #[deprecated]
21464    pub node_pool_id: std::string::String,
21465
21466    /// The name (project, location, cluster, node pool id) of the node pool to
21467    /// delete. Specified in the format
21468    /// `projects/*/locations/*/clusters/*/nodePools/*`.
21469    pub name: std::string::String,
21470
21471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21472}
21473
21474impl DeleteNodePoolRequest {
21475    pub fn new() -> Self {
21476        std::default::Default::default()
21477    }
21478
21479    /// Sets the value of [project_id][crate::model::DeleteNodePoolRequest::project_id].
21480    ///
21481    /// # Example
21482    /// ```ignore,no_run
21483    /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
21484    /// let x = DeleteNodePoolRequest::new().set_project_id("example");
21485    /// ```
21486    #[deprecated]
21487    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21488        self.project_id = v.into();
21489        self
21490    }
21491
21492    /// Sets the value of [zone][crate::model::DeleteNodePoolRequest::zone].
21493    ///
21494    /// # Example
21495    /// ```ignore,no_run
21496    /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
21497    /// let x = DeleteNodePoolRequest::new().set_zone("example");
21498    /// ```
21499    #[deprecated]
21500    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21501        self.zone = v.into();
21502        self
21503    }
21504
21505    /// Sets the value of [cluster_id][crate::model::DeleteNodePoolRequest::cluster_id].
21506    ///
21507    /// # Example
21508    /// ```ignore,no_run
21509    /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
21510    /// let x = DeleteNodePoolRequest::new().set_cluster_id("example");
21511    /// ```
21512    #[deprecated]
21513    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21514        self.cluster_id = v.into();
21515        self
21516    }
21517
21518    /// Sets the value of [node_pool_id][crate::model::DeleteNodePoolRequest::node_pool_id].
21519    ///
21520    /// # Example
21521    /// ```ignore,no_run
21522    /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
21523    /// let x = DeleteNodePoolRequest::new().set_node_pool_id("example");
21524    /// ```
21525    #[deprecated]
21526    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21527        self.node_pool_id = v.into();
21528        self
21529    }
21530
21531    /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
21532    ///
21533    /// # Example
21534    /// ```ignore,no_run
21535    /// # use google_cloud_container_v1::model::DeleteNodePoolRequest;
21536    /// let x = DeleteNodePoolRequest::new().set_name("example");
21537    /// ```
21538    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21539        self.name = v.into();
21540        self
21541    }
21542}
21543
21544impl wkt::message::Message for DeleteNodePoolRequest {
21545    fn typename() -> &'static str {
21546        "type.googleapis.com/google.container.v1.DeleteNodePoolRequest"
21547    }
21548}
21549
21550/// ListNodePoolsRequest lists the node pool(s) for a cluster.
21551#[derive(Clone, Default, PartialEq)]
21552#[non_exhaustive]
21553pub struct ListNodePoolsRequest {
21554    /// Deprecated. The Google Developers Console [project ID or project
21555    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21556    /// This field has been deprecated and replaced by the parent field.
21557    #[deprecated]
21558    pub project_id: std::string::String,
21559
21560    /// Deprecated. The name of the Google Compute Engine
21561    /// [zone](https://cloud.google.com/compute/docs/zones#available)
21562    /// in which the cluster resides. This field has been deprecated and replaced
21563    /// by the parent field.
21564    #[deprecated]
21565    pub zone: std::string::String,
21566
21567    /// Deprecated. The name of the cluster.
21568    /// This field has been deprecated and replaced by the parent field.
21569    #[deprecated]
21570    pub cluster_id: std::string::String,
21571
21572    /// The parent (project, location, cluster name) where the node pools will be
21573    /// listed. Specified in the format `projects/*/locations/*/clusters/*`.
21574    pub parent: std::string::String,
21575
21576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21577}
21578
21579impl ListNodePoolsRequest {
21580    pub fn new() -> Self {
21581        std::default::Default::default()
21582    }
21583
21584    /// Sets the value of [project_id][crate::model::ListNodePoolsRequest::project_id].
21585    ///
21586    /// # Example
21587    /// ```ignore,no_run
21588    /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
21589    /// let x = ListNodePoolsRequest::new().set_project_id("example");
21590    /// ```
21591    #[deprecated]
21592    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21593        self.project_id = v.into();
21594        self
21595    }
21596
21597    /// Sets the value of [zone][crate::model::ListNodePoolsRequest::zone].
21598    ///
21599    /// # Example
21600    /// ```ignore,no_run
21601    /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
21602    /// let x = ListNodePoolsRequest::new().set_zone("example");
21603    /// ```
21604    #[deprecated]
21605    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21606        self.zone = v.into();
21607        self
21608    }
21609
21610    /// Sets the value of [cluster_id][crate::model::ListNodePoolsRequest::cluster_id].
21611    ///
21612    /// # Example
21613    /// ```ignore,no_run
21614    /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
21615    /// let x = ListNodePoolsRequest::new().set_cluster_id("example");
21616    /// ```
21617    #[deprecated]
21618    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21619        self.cluster_id = v.into();
21620        self
21621    }
21622
21623    /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
21624    ///
21625    /// # Example
21626    /// ```ignore,no_run
21627    /// # use google_cloud_container_v1::model::ListNodePoolsRequest;
21628    /// let x = ListNodePoolsRequest::new().set_parent("example");
21629    /// ```
21630    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21631        self.parent = v.into();
21632        self
21633    }
21634}
21635
21636impl wkt::message::Message for ListNodePoolsRequest {
21637    fn typename() -> &'static str {
21638        "type.googleapis.com/google.container.v1.ListNodePoolsRequest"
21639    }
21640}
21641
21642/// GetNodePoolRequest retrieves a node pool for a cluster.
21643#[derive(Clone, Default, PartialEq)]
21644#[non_exhaustive]
21645pub struct GetNodePoolRequest {
21646    /// Deprecated. The Google Developers Console [project ID or project
21647    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
21648    /// This field has been deprecated and replaced by the name field.
21649    #[deprecated]
21650    pub project_id: std::string::String,
21651
21652    /// Deprecated. The name of the Google Compute Engine
21653    /// [zone](https://cloud.google.com/compute/docs/zones#available)
21654    /// in which the cluster resides. This field has been deprecated and replaced
21655    /// by the name field.
21656    #[deprecated]
21657    pub zone: std::string::String,
21658
21659    /// Deprecated. The name of the cluster.
21660    /// This field has been deprecated and replaced by the name field.
21661    #[deprecated]
21662    pub cluster_id: std::string::String,
21663
21664    /// Deprecated. The name of the node pool.
21665    /// This field has been deprecated and replaced by the name field.
21666    #[deprecated]
21667    pub node_pool_id: std::string::String,
21668
21669    /// The name (project, location, cluster, node pool id) of the node pool to
21670    /// get. Specified in the format
21671    /// `projects/*/locations/*/clusters/*/nodePools/*`.
21672    pub name: std::string::String,
21673
21674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21675}
21676
21677impl GetNodePoolRequest {
21678    pub fn new() -> Self {
21679        std::default::Default::default()
21680    }
21681
21682    /// Sets the value of [project_id][crate::model::GetNodePoolRequest::project_id].
21683    ///
21684    /// # Example
21685    /// ```ignore,no_run
21686    /// # use google_cloud_container_v1::model::GetNodePoolRequest;
21687    /// let x = GetNodePoolRequest::new().set_project_id("example");
21688    /// ```
21689    #[deprecated]
21690    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21691        self.project_id = v.into();
21692        self
21693    }
21694
21695    /// Sets the value of [zone][crate::model::GetNodePoolRequest::zone].
21696    ///
21697    /// # Example
21698    /// ```ignore,no_run
21699    /// # use google_cloud_container_v1::model::GetNodePoolRequest;
21700    /// let x = GetNodePoolRequest::new().set_zone("example");
21701    /// ```
21702    #[deprecated]
21703    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21704        self.zone = v.into();
21705        self
21706    }
21707
21708    /// Sets the value of [cluster_id][crate::model::GetNodePoolRequest::cluster_id].
21709    ///
21710    /// # Example
21711    /// ```ignore,no_run
21712    /// # use google_cloud_container_v1::model::GetNodePoolRequest;
21713    /// let x = GetNodePoolRequest::new().set_cluster_id("example");
21714    /// ```
21715    #[deprecated]
21716    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21717        self.cluster_id = v.into();
21718        self
21719    }
21720
21721    /// Sets the value of [node_pool_id][crate::model::GetNodePoolRequest::node_pool_id].
21722    ///
21723    /// # Example
21724    /// ```ignore,no_run
21725    /// # use google_cloud_container_v1::model::GetNodePoolRequest;
21726    /// let x = GetNodePoolRequest::new().set_node_pool_id("example");
21727    /// ```
21728    #[deprecated]
21729    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21730        self.node_pool_id = v.into();
21731        self
21732    }
21733
21734    /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
21735    ///
21736    /// # Example
21737    /// ```ignore,no_run
21738    /// # use google_cloud_container_v1::model::GetNodePoolRequest;
21739    /// let x = GetNodePoolRequest::new().set_name("example");
21740    /// ```
21741    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21742        self.name = v.into();
21743        self
21744    }
21745}
21746
21747impl wkt::message::Message for GetNodePoolRequest {
21748    fn typename() -> &'static str {
21749        "type.googleapis.com/google.container.v1.GetNodePoolRequest"
21750    }
21751}
21752
21753/// Settings for blue-green upgrade.
21754#[derive(Clone, Default, PartialEq)]
21755#[non_exhaustive]
21756pub struct BlueGreenSettings {
21757    /// Time needed after draining entire blue pool. After this period, blue pool
21758    /// will be cleaned up.
21759    pub node_pool_soak_duration: std::option::Option<wkt::Duration>,
21760
21761    /// The rollout policy controls the general rollout progress of blue-green.
21762    pub rollout_policy: std::option::Option<crate::model::blue_green_settings::RolloutPolicy>,
21763
21764    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21765}
21766
21767impl BlueGreenSettings {
21768    pub fn new() -> Self {
21769        std::default::Default::default()
21770    }
21771
21772    /// Sets the value of [node_pool_soak_duration][crate::model::BlueGreenSettings::node_pool_soak_duration].
21773    ///
21774    /// # Example
21775    /// ```ignore,no_run
21776    /// # use google_cloud_container_v1::model::BlueGreenSettings;
21777    /// use wkt::Duration;
21778    /// let x = BlueGreenSettings::new().set_node_pool_soak_duration(Duration::default()/* use setters */);
21779    /// ```
21780    pub fn set_node_pool_soak_duration<T>(mut self, v: T) -> Self
21781    where
21782        T: std::convert::Into<wkt::Duration>,
21783    {
21784        self.node_pool_soak_duration = std::option::Option::Some(v.into());
21785        self
21786    }
21787
21788    /// Sets or clears the value of [node_pool_soak_duration][crate::model::BlueGreenSettings::node_pool_soak_duration].
21789    ///
21790    /// # Example
21791    /// ```ignore,no_run
21792    /// # use google_cloud_container_v1::model::BlueGreenSettings;
21793    /// use wkt::Duration;
21794    /// let x = BlueGreenSettings::new().set_or_clear_node_pool_soak_duration(Some(Duration::default()/* use setters */));
21795    /// let x = BlueGreenSettings::new().set_or_clear_node_pool_soak_duration(None::<Duration>);
21796    /// ```
21797    pub fn set_or_clear_node_pool_soak_duration<T>(mut self, v: std::option::Option<T>) -> Self
21798    where
21799        T: std::convert::Into<wkt::Duration>,
21800    {
21801        self.node_pool_soak_duration = v.map(|x| x.into());
21802        self
21803    }
21804
21805    /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy].
21806    ///
21807    /// Note that all the setters affecting `rollout_policy` are mutually
21808    /// exclusive.
21809    ///
21810    /// # Example
21811    /// ```ignore,no_run
21812    /// # use google_cloud_container_v1::model::BlueGreenSettings;
21813    /// use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
21814    /// let x = BlueGreenSettings::new().set_rollout_policy(Some(
21815    ///     google_cloud_container_v1::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(StandardRolloutPolicy::default().into())));
21816    /// ```
21817    pub fn set_rollout_policy<
21818        T: std::convert::Into<std::option::Option<crate::model::blue_green_settings::RolloutPolicy>>,
21819    >(
21820        mut self,
21821        v: T,
21822    ) -> Self {
21823        self.rollout_policy = v.into();
21824        self
21825    }
21826
21827    /// The value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
21828    /// if it holds a `StandardRolloutPolicy`, `None` if the field is not set or
21829    /// holds a different branch.
21830    pub fn standard_rollout_policy(
21831        &self,
21832    ) -> std::option::Option<
21833        &std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
21834    > {
21835        #[allow(unreachable_patterns)]
21836        self.rollout_policy.as_ref().and_then(|v| match v {
21837            crate::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(v) => {
21838                std::option::Option::Some(v)
21839            }
21840            _ => std::option::Option::None,
21841        })
21842    }
21843
21844    /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
21845    /// to hold a `StandardRolloutPolicy`.
21846    ///
21847    /// Note that all the setters affecting `rollout_policy` are
21848    /// mutually exclusive.
21849    ///
21850    /// # Example
21851    /// ```ignore,no_run
21852    /// # use google_cloud_container_v1::model::BlueGreenSettings;
21853    /// use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
21854    /// let x = BlueGreenSettings::new().set_standard_rollout_policy(StandardRolloutPolicy::default()/* use setters */);
21855    /// assert!(x.standard_rollout_policy().is_some());
21856    /// assert!(x.autoscaled_rollout_policy().is_none());
21857    /// ```
21858    pub fn set_standard_rollout_policy<
21859        T: std::convert::Into<
21860                std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
21861            >,
21862    >(
21863        mut self,
21864        v: T,
21865    ) -> Self {
21866        self.rollout_policy = std::option::Option::Some(
21867            crate::model::blue_green_settings::RolloutPolicy::StandardRolloutPolicy(v.into()),
21868        );
21869        self
21870    }
21871
21872    /// The value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
21873    /// if it holds a `AutoscaledRolloutPolicy`, `None` if the field is not set or
21874    /// holds a different branch.
21875    pub fn autoscaled_rollout_policy(
21876        &self,
21877    ) -> std::option::Option<
21878        &std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
21879    > {
21880        #[allow(unreachable_patterns)]
21881        self.rollout_policy.as_ref().and_then(|v| match v {
21882            crate::model::blue_green_settings::RolloutPolicy::AutoscaledRolloutPolicy(v) => {
21883                std::option::Option::Some(v)
21884            }
21885            _ => std::option::Option::None,
21886        })
21887    }
21888
21889    /// Sets the value of [rollout_policy][crate::model::BlueGreenSettings::rollout_policy]
21890    /// to hold a `AutoscaledRolloutPolicy`.
21891    ///
21892    /// Note that all the setters affecting `rollout_policy` are
21893    /// mutually exclusive.
21894    ///
21895    /// # Example
21896    /// ```ignore,no_run
21897    /// # use google_cloud_container_v1::model::BlueGreenSettings;
21898    /// use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
21899    /// let x = BlueGreenSettings::new().set_autoscaled_rollout_policy(AutoscaledRolloutPolicy::default()/* use setters */);
21900    /// assert!(x.autoscaled_rollout_policy().is_some());
21901    /// assert!(x.standard_rollout_policy().is_none());
21902    /// ```
21903    pub fn set_autoscaled_rollout_policy<
21904        T: std::convert::Into<
21905                std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
21906            >,
21907    >(
21908        mut self,
21909        v: T,
21910    ) -> Self {
21911        self.rollout_policy = std::option::Option::Some(
21912            crate::model::blue_green_settings::RolloutPolicy::AutoscaledRolloutPolicy(v.into()),
21913        );
21914        self
21915    }
21916}
21917
21918impl wkt::message::Message for BlueGreenSettings {
21919    fn typename() -> &'static str {
21920        "type.googleapis.com/google.container.v1.BlueGreenSettings"
21921    }
21922}
21923
21924/// Defines additional types related to [BlueGreenSettings].
21925pub mod blue_green_settings {
21926    #[allow(unused_imports)]
21927    use super::*;
21928
21929    /// Standard rollout policy is the default policy for blue-green.
21930    #[derive(Clone, Default, PartialEq)]
21931    #[non_exhaustive]
21932    pub struct StandardRolloutPolicy {
21933        /// Soak time after each batch gets drained. Default to zero.
21934        pub batch_soak_duration: std::option::Option<wkt::Duration>,
21935
21936        /// Blue pool size to drain in a batch.
21937        pub update_batch_size: std::option::Option<
21938            crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize,
21939        >,
21940
21941        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21942    }
21943
21944    impl StandardRolloutPolicy {
21945        pub fn new() -> Self {
21946            std::default::Default::default()
21947        }
21948
21949        /// Sets the value of [batch_soak_duration][crate::model::blue_green_settings::StandardRolloutPolicy::batch_soak_duration].
21950        ///
21951        /// # Example
21952        /// ```ignore,no_run
21953        /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
21954        /// use wkt::Duration;
21955        /// let x = StandardRolloutPolicy::new().set_batch_soak_duration(Duration::default()/* use setters */);
21956        /// ```
21957        pub fn set_batch_soak_duration<T>(mut self, v: T) -> Self
21958        where
21959            T: std::convert::Into<wkt::Duration>,
21960        {
21961            self.batch_soak_duration = std::option::Option::Some(v.into());
21962            self
21963        }
21964
21965        /// Sets or clears the value of [batch_soak_duration][crate::model::blue_green_settings::StandardRolloutPolicy::batch_soak_duration].
21966        ///
21967        /// # Example
21968        /// ```ignore,no_run
21969        /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
21970        /// use wkt::Duration;
21971        /// let x = StandardRolloutPolicy::new().set_or_clear_batch_soak_duration(Some(Duration::default()/* use setters */));
21972        /// let x = StandardRolloutPolicy::new().set_or_clear_batch_soak_duration(None::<Duration>);
21973        /// ```
21974        pub fn set_or_clear_batch_soak_duration<T>(mut self, v: std::option::Option<T>) -> Self
21975        where
21976            T: std::convert::Into<wkt::Duration>,
21977        {
21978            self.batch_soak_duration = v.map(|x| x.into());
21979            self
21980        }
21981
21982        /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size].
21983        ///
21984        /// Note that all the setters affecting `update_batch_size` are mutually
21985        /// exclusive.
21986        ///
21987        /// # Example
21988        /// ```ignore,no_run
21989        /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
21990        /// use google_cloud_container_v1::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize;
21991        /// let x = StandardRolloutPolicy::new().set_update_batch_size(Some(UpdateBatchSize::BatchPercentage(42.0)));
21992        /// ```
21993        pub fn set_update_batch_size<
21994            T: std::convert::Into<
21995                    std::option::Option<
21996                        crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize,
21997                    >,
21998                >,
21999        >(
22000            mut self,
22001            v: T,
22002        ) -> Self {
22003            self.update_batch_size = v.into();
22004            self
22005        }
22006
22007        /// The value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
22008        /// if it holds a `BatchPercentage`, `None` if the field is not set or
22009        /// holds a different branch.
22010        pub fn batch_percentage(&self) -> std::option::Option<&f32> {
22011            #[allow(unreachable_patterns)]
22012            self.update_batch_size.as_ref().and_then(|v| match v {
22013                crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchPercentage(v) => std::option::Option::Some(v),
22014                _ => std::option::Option::None,
22015            })
22016        }
22017
22018        /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
22019        /// to hold a `BatchPercentage`.
22020        ///
22021        /// Note that all the setters affecting `update_batch_size` are
22022        /// mutually exclusive.
22023        ///
22024        /// # Example
22025        /// ```ignore,no_run
22026        /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
22027        /// let x = StandardRolloutPolicy::new().set_batch_percentage(42.0);
22028        /// assert!(x.batch_percentage().is_some());
22029        /// assert!(x.batch_node_count().is_none());
22030        /// ```
22031        pub fn set_batch_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
22032            self.update_batch_size = std::option::Option::Some(
22033                crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchPercentage(
22034                    v.into()
22035                )
22036            );
22037            self
22038        }
22039
22040        /// The value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
22041        /// if it holds a `BatchNodeCount`, `None` if the field is not set or
22042        /// holds a different branch.
22043        pub fn batch_node_count(&self) -> std::option::Option<&i32> {
22044            #[allow(unreachable_patterns)]
22045            self.update_batch_size.as_ref().and_then(|v| match v {
22046                crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchNodeCount(v) => std::option::Option::Some(v),
22047                _ => std::option::Option::None,
22048            })
22049        }
22050
22051        /// Sets the value of [update_batch_size][crate::model::blue_green_settings::StandardRolloutPolicy::update_batch_size]
22052        /// to hold a `BatchNodeCount`.
22053        ///
22054        /// Note that all the setters affecting `update_batch_size` are
22055        /// mutually exclusive.
22056        ///
22057        /// # Example
22058        /// ```ignore,no_run
22059        /// # use google_cloud_container_v1::model::blue_green_settings::StandardRolloutPolicy;
22060        /// let x = StandardRolloutPolicy::new().set_batch_node_count(42);
22061        /// assert!(x.batch_node_count().is_some());
22062        /// assert!(x.batch_percentage().is_none());
22063        /// ```
22064        pub fn set_batch_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22065            self.update_batch_size = std::option::Option::Some(
22066                crate::model::blue_green_settings::standard_rollout_policy::UpdateBatchSize::BatchNodeCount(
22067                    v.into()
22068                )
22069            );
22070            self
22071        }
22072    }
22073
22074    impl wkt::message::Message for StandardRolloutPolicy {
22075        fn typename() -> &'static str {
22076            "type.googleapis.com/google.container.v1.BlueGreenSettings.StandardRolloutPolicy"
22077        }
22078    }
22079
22080    /// Defines additional types related to [StandardRolloutPolicy].
22081    pub mod standard_rollout_policy {
22082        #[allow(unused_imports)]
22083        use super::*;
22084
22085        /// Blue pool size to drain in a batch.
22086        #[derive(Clone, Debug, PartialEq)]
22087        #[non_exhaustive]
22088        pub enum UpdateBatchSize {
22089            /// Percentage of the blue pool nodes to drain in a batch.
22090            /// The range of this field should be (0.0, 1.0].
22091            BatchPercentage(f32),
22092            /// Number of blue nodes to drain in a batch.
22093            BatchNodeCount(i32),
22094        }
22095    }
22096
22097    /// Autoscaled rollout policy utilizes the cluster autoscaler during
22098    /// blue-green upgrade to scale both the blue and green pools.
22099    #[derive(Clone, Default, PartialEq)]
22100    #[non_exhaustive]
22101    pub struct AutoscaledRolloutPolicy {
22102        /// Optional. Time to wait after cordoning the blue pool before draining the
22103        /// nodes. Defaults to 3 days. The value can be set between 0 and 7 days,
22104        /// inclusive.
22105        pub wait_for_drain_duration: std::option::Option<wkt::Duration>,
22106
22107        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22108    }
22109
22110    impl AutoscaledRolloutPolicy {
22111        pub fn new() -> Self {
22112            std::default::Default::default()
22113        }
22114
22115        /// Sets the value of [wait_for_drain_duration][crate::model::blue_green_settings::AutoscaledRolloutPolicy::wait_for_drain_duration].
22116        ///
22117        /// # Example
22118        /// ```ignore,no_run
22119        /// # use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
22120        /// use wkt::Duration;
22121        /// let x = AutoscaledRolloutPolicy::new().set_wait_for_drain_duration(Duration::default()/* use setters */);
22122        /// ```
22123        pub fn set_wait_for_drain_duration<T>(mut self, v: T) -> Self
22124        where
22125            T: std::convert::Into<wkt::Duration>,
22126        {
22127            self.wait_for_drain_duration = std::option::Option::Some(v.into());
22128            self
22129        }
22130
22131        /// Sets or clears the value of [wait_for_drain_duration][crate::model::blue_green_settings::AutoscaledRolloutPolicy::wait_for_drain_duration].
22132        ///
22133        /// # Example
22134        /// ```ignore,no_run
22135        /// # use google_cloud_container_v1::model::blue_green_settings::AutoscaledRolloutPolicy;
22136        /// use wkt::Duration;
22137        /// let x = AutoscaledRolloutPolicy::new().set_or_clear_wait_for_drain_duration(Some(Duration::default()/* use setters */));
22138        /// let x = AutoscaledRolloutPolicy::new().set_or_clear_wait_for_drain_duration(None::<Duration>);
22139        /// ```
22140        pub fn set_or_clear_wait_for_drain_duration<T>(mut self, v: std::option::Option<T>) -> Self
22141        where
22142            T: std::convert::Into<wkt::Duration>,
22143        {
22144            self.wait_for_drain_duration = v.map(|x| x.into());
22145            self
22146        }
22147    }
22148
22149    impl wkt::message::Message for AutoscaledRolloutPolicy {
22150        fn typename() -> &'static str {
22151            "type.googleapis.com/google.container.v1.BlueGreenSettings.AutoscaledRolloutPolicy"
22152        }
22153    }
22154
22155    /// The rollout policy controls the general rollout progress of blue-green.
22156    #[derive(Clone, Debug, PartialEq)]
22157    #[non_exhaustive]
22158    pub enum RolloutPolicy {
22159        /// Standard policy for the blue-green upgrade.
22160        StandardRolloutPolicy(
22161            std::boxed::Box<crate::model::blue_green_settings::StandardRolloutPolicy>,
22162        ),
22163        /// Autoscaled policy for cluster autoscaler enabled blue-green upgrade.
22164        AutoscaledRolloutPolicy(
22165            std::boxed::Box<crate::model::blue_green_settings::AutoscaledRolloutPolicy>,
22166        ),
22167    }
22168}
22169
22170/// NodePool contains the name and configuration for a cluster's node pool.
22171/// Node pools are a set of nodes (i.e. VM's), with a common configuration and
22172/// specification, under the control of the cluster master. They may have a set
22173/// of Kubernetes labels applied to them, which may be used to reference them
22174/// during pod scheduling. They may also be resized up or down, to accommodate
22175/// the workload.
22176#[derive(Clone, Default, PartialEq)]
22177#[non_exhaustive]
22178pub struct NodePool {
22179    /// The name of the node pool.
22180    pub name: std::string::String,
22181
22182    /// The node configuration of the pool.
22183    pub config: std::option::Option<crate::model::NodeConfig>,
22184
22185    /// The initial node count for the pool. You must ensure that your
22186    /// Compute Engine [resource
22187    /// quota](https://cloud.google.com/compute/quotas)
22188    /// is sufficient for this number of instances. You must also have available
22189    /// firewall and routes quota.
22190    pub initial_node_count: i32,
22191
22192    /// The list of Google Compute Engine
22193    /// [zones](https://cloud.google.com/compute/docs/zones#available)
22194    /// in which the NodePool's nodes should be located.
22195    ///
22196    /// If this value is unspecified during node pool creation, the
22197    /// [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations)
22198    /// value will be used, instead.
22199    ///
22200    /// Warning: changing node pool locations will result in nodes being added
22201    /// and/or removed.
22202    pub locations: std::vec::Vec<std::string::String>,
22203
22204    /// Networking configuration for this NodePool. If specified, it overrides the
22205    /// cluster-level defaults.
22206    pub network_config: std::option::Option<crate::model::NodeNetworkConfig>,
22207
22208    /// Output only. Server-defined URL for the resource.
22209    pub self_link: std::string::String,
22210
22211    /// The version of Kubernetes running on this NodePool's nodes. If unspecified,
22212    /// it defaults as described
22213    /// [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version).
22214    pub version: std::string::String,
22215
22216    /// Output only. The resource URLs of the [managed instance
22217    /// groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances)
22218    /// associated with this node pool.
22219    /// During the node pool blue-green upgrade operation, the URLs contain both
22220    /// blue and green resources.
22221    pub instance_group_urls: std::vec::Vec<std::string::String>,
22222
22223    /// Output only. The status of the nodes in this pool instance.
22224    pub status: crate::model::node_pool::Status,
22225
22226    /// Output only. Deprecated. Use conditions instead.
22227    /// Additional information about the current status of this
22228    /// node pool instance, if available.
22229    #[deprecated]
22230    pub status_message: std::string::String,
22231
22232    /// Autoscaler configuration for this NodePool. Autoscaler is enabled
22233    /// only if a valid configuration is present.
22234    pub autoscaling: std::option::Option<crate::model::NodePoolAutoscaling>,
22235
22236    /// NodeManagement configuration for this NodePool.
22237    pub management: std::option::Option<crate::model::NodeManagement>,
22238
22239    /// The constraint on the maximum number of pods that can be run
22240    /// simultaneously on a node in the node pool.
22241    pub max_pods_constraint: std::option::Option<crate::model::MaxPodsConstraint>,
22242
22243    /// Which conditions caused the current node pool state.
22244    pub conditions: std::vec::Vec<crate::model::StatusCondition>,
22245
22246    /// Output only. The pod CIDR block size per node in this node pool.
22247    pub pod_ipv4_cidr_size: i32,
22248
22249    /// Upgrade settings control disruption and speed of the upgrade.
22250    pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
22251
22252    /// Specifies the node placement policy.
22253    pub placement_policy: std::option::Option<crate::model::node_pool::PlacementPolicy>,
22254
22255    /// Output only. Update info contains relevant information during a node
22256    /// pool update.
22257    pub update_info: std::option::Option<crate::model::node_pool::UpdateInfo>,
22258
22259    /// This checksum is computed by the server based on the value of node pool
22260    /// fields, and may be sent on update requests to ensure the client has an
22261    /// up-to-date value before proceeding.
22262    pub etag: std::string::String,
22263
22264    /// Specifies the configuration of queued provisioning.
22265    pub queued_provisioning: std::option::Option<crate::model::node_pool::QueuedProvisioning>,
22266
22267    /// Enable best effort provisioning for nodes
22268    pub best_effort_provisioning: std::option::Option<crate::model::BestEffortProvisioning>,
22269
22270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22271}
22272
22273impl NodePool {
22274    pub fn new() -> Self {
22275        std::default::Default::default()
22276    }
22277
22278    /// Sets the value of [name][crate::model::NodePool::name].
22279    ///
22280    /// # Example
22281    /// ```ignore,no_run
22282    /// # use google_cloud_container_v1::model::NodePool;
22283    /// let x = NodePool::new().set_name("example");
22284    /// ```
22285    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22286        self.name = v.into();
22287        self
22288    }
22289
22290    /// Sets the value of [config][crate::model::NodePool::config].
22291    ///
22292    /// # Example
22293    /// ```ignore,no_run
22294    /// # use google_cloud_container_v1::model::NodePool;
22295    /// use google_cloud_container_v1::model::NodeConfig;
22296    /// let x = NodePool::new().set_config(NodeConfig::default()/* use setters */);
22297    /// ```
22298    pub fn set_config<T>(mut self, v: T) -> Self
22299    where
22300        T: std::convert::Into<crate::model::NodeConfig>,
22301    {
22302        self.config = std::option::Option::Some(v.into());
22303        self
22304    }
22305
22306    /// Sets or clears the value of [config][crate::model::NodePool::config].
22307    ///
22308    /// # Example
22309    /// ```ignore,no_run
22310    /// # use google_cloud_container_v1::model::NodePool;
22311    /// use google_cloud_container_v1::model::NodeConfig;
22312    /// let x = NodePool::new().set_or_clear_config(Some(NodeConfig::default()/* use setters */));
22313    /// let x = NodePool::new().set_or_clear_config(None::<NodeConfig>);
22314    /// ```
22315    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
22316    where
22317        T: std::convert::Into<crate::model::NodeConfig>,
22318    {
22319        self.config = v.map(|x| x.into());
22320        self
22321    }
22322
22323    /// Sets the value of [initial_node_count][crate::model::NodePool::initial_node_count].
22324    ///
22325    /// # Example
22326    /// ```ignore,no_run
22327    /// # use google_cloud_container_v1::model::NodePool;
22328    /// let x = NodePool::new().set_initial_node_count(42);
22329    /// ```
22330    pub fn set_initial_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22331        self.initial_node_count = v.into();
22332        self
22333    }
22334
22335    /// Sets the value of [locations][crate::model::NodePool::locations].
22336    ///
22337    /// # Example
22338    /// ```ignore,no_run
22339    /// # use google_cloud_container_v1::model::NodePool;
22340    /// let x = NodePool::new().set_locations(["a", "b", "c"]);
22341    /// ```
22342    pub fn set_locations<T, V>(mut self, v: T) -> Self
22343    where
22344        T: std::iter::IntoIterator<Item = V>,
22345        V: std::convert::Into<std::string::String>,
22346    {
22347        use std::iter::Iterator;
22348        self.locations = v.into_iter().map(|i| i.into()).collect();
22349        self
22350    }
22351
22352    /// Sets the value of [network_config][crate::model::NodePool::network_config].
22353    ///
22354    /// # Example
22355    /// ```ignore,no_run
22356    /// # use google_cloud_container_v1::model::NodePool;
22357    /// use google_cloud_container_v1::model::NodeNetworkConfig;
22358    /// let x = NodePool::new().set_network_config(NodeNetworkConfig::default()/* use setters */);
22359    /// ```
22360    pub fn set_network_config<T>(mut self, v: T) -> Self
22361    where
22362        T: std::convert::Into<crate::model::NodeNetworkConfig>,
22363    {
22364        self.network_config = std::option::Option::Some(v.into());
22365        self
22366    }
22367
22368    /// Sets or clears the value of [network_config][crate::model::NodePool::network_config].
22369    ///
22370    /// # Example
22371    /// ```ignore,no_run
22372    /// # use google_cloud_container_v1::model::NodePool;
22373    /// use google_cloud_container_v1::model::NodeNetworkConfig;
22374    /// let x = NodePool::new().set_or_clear_network_config(Some(NodeNetworkConfig::default()/* use setters */));
22375    /// let x = NodePool::new().set_or_clear_network_config(None::<NodeNetworkConfig>);
22376    /// ```
22377    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
22378    where
22379        T: std::convert::Into<crate::model::NodeNetworkConfig>,
22380    {
22381        self.network_config = v.map(|x| x.into());
22382        self
22383    }
22384
22385    /// Sets the value of [self_link][crate::model::NodePool::self_link].
22386    ///
22387    /// # Example
22388    /// ```ignore,no_run
22389    /// # use google_cloud_container_v1::model::NodePool;
22390    /// let x = NodePool::new().set_self_link("example");
22391    /// ```
22392    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22393        self.self_link = v.into();
22394        self
22395    }
22396
22397    /// Sets the value of [version][crate::model::NodePool::version].
22398    ///
22399    /// # Example
22400    /// ```ignore,no_run
22401    /// # use google_cloud_container_v1::model::NodePool;
22402    /// let x = NodePool::new().set_version("example");
22403    /// ```
22404    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22405        self.version = v.into();
22406        self
22407    }
22408
22409    /// Sets the value of [instance_group_urls][crate::model::NodePool::instance_group_urls].
22410    ///
22411    /// # Example
22412    /// ```ignore,no_run
22413    /// # use google_cloud_container_v1::model::NodePool;
22414    /// let x = NodePool::new().set_instance_group_urls(["a", "b", "c"]);
22415    /// ```
22416    pub fn set_instance_group_urls<T, V>(mut self, v: T) -> Self
22417    where
22418        T: std::iter::IntoIterator<Item = V>,
22419        V: std::convert::Into<std::string::String>,
22420    {
22421        use std::iter::Iterator;
22422        self.instance_group_urls = v.into_iter().map(|i| i.into()).collect();
22423        self
22424    }
22425
22426    /// Sets the value of [status][crate::model::NodePool::status].
22427    ///
22428    /// # Example
22429    /// ```ignore,no_run
22430    /// # use google_cloud_container_v1::model::NodePool;
22431    /// use google_cloud_container_v1::model::node_pool::Status;
22432    /// let x0 = NodePool::new().set_status(Status::Provisioning);
22433    /// let x1 = NodePool::new().set_status(Status::Running);
22434    /// let x2 = NodePool::new().set_status(Status::RunningWithError);
22435    /// ```
22436    pub fn set_status<T: std::convert::Into<crate::model::node_pool::Status>>(
22437        mut self,
22438        v: T,
22439    ) -> Self {
22440        self.status = v.into();
22441        self
22442    }
22443
22444    /// Sets the value of [status_message][crate::model::NodePool::status_message].
22445    ///
22446    /// # Example
22447    /// ```ignore,no_run
22448    /// # use google_cloud_container_v1::model::NodePool;
22449    /// let x = NodePool::new().set_status_message("example");
22450    /// ```
22451    #[deprecated]
22452    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22453        self.status_message = v.into();
22454        self
22455    }
22456
22457    /// Sets the value of [autoscaling][crate::model::NodePool::autoscaling].
22458    ///
22459    /// # Example
22460    /// ```ignore,no_run
22461    /// # use google_cloud_container_v1::model::NodePool;
22462    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
22463    /// let x = NodePool::new().set_autoscaling(NodePoolAutoscaling::default()/* use setters */);
22464    /// ```
22465    pub fn set_autoscaling<T>(mut self, v: T) -> Self
22466    where
22467        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
22468    {
22469        self.autoscaling = std::option::Option::Some(v.into());
22470        self
22471    }
22472
22473    /// Sets or clears the value of [autoscaling][crate::model::NodePool::autoscaling].
22474    ///
22475    /// # Example
22476    /// ```ignore,no_run
22477    /// # use google_cloud_container_v1::model::NodePool;
22478    /// use google_cloud_container_v1::model::NodePoolAutoscaling;
22479    /// let x = NodePool::new().set_or_clear_autoscaling(Some(NodePoolAutoscaling::default()/* use setters */));
22480    /// let x = NodePool::new().set_or_clear_autoscaling(None::<NodePoolAutoscaling>);
22481    /// ```
22482    pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
22483    where
22484        T: std::convert::Into<crate::model::NodePoolAutoscaling>,
22485    {
22486        self.autoscaling = v.map(|x| x.into());
22487        self
22488    }
22489
22490    /// Sets the value of [management][crate::model::NodePool::management].
22491    ///
22492    /// # Example
22493    /// ```ignore,no_run
22494    /// # use google_cloud_container_v1::model::NodePool;
22495    /// use google_cloud_container_v1::model::NodeManagement;
22496    /// let x = NodePool::new().set_management(NodeManagement::default()/* use setters */);
22497    /// ```
22498    pub fn set_management<T>(mut self, v: T) -> Self
22499    where
22500        T: std::convert::Into<crate::model::NodeManagement>,
22501    {
22502        self.management = std::option::Option::Some(v.into());
22503        self
22504    }
22505
22506    /// Sets or clears the value of [management][crate::model::NodePool::management].
22507    ///
22508    /// # Example
22509    /// ```ignore,no_run
22510    /// # use google_cloud_container_v1::model::NodePool;
22511    /// use google_cloud_container_v1::model::NodeManagement;
22512    /// let x = NodePool::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
22513    /// let x = NodePool::new().set_or_clear_management(None::<NodeManagement>);
22514    /// ```
22515    pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
22516    where
22517        T: std::convert::Into<crate::model::NodeManagement>,
22518    {
22519        self.management = v.map(|x| x.into());
22520        self
22521    }
22522
22523    /// Sets the value of [max_pods_constraint][crate::model::NodePool::max_pods_constraint].
22524    ///
22525    /// # Example
22526    /// ```ignore,no_run
22527    /// # use google_cloud_container_v1::model::NodePool;
22528    /// use google_cloud_container_v1::model::MaxPodsConstraint;
22529    /// let x = NodePool::new().set_max_pods_constraint(MaxPodsConstraint::default()/* use setters */);
22530    /// ```
22531    pub fn set_max_pods_constraint<T>(mut self, v: T) -> Self
22532    where
22533        T: std::convert::Into<crate::model::MaxPodsConstraint>,
22534    {
22535        self.max_pods_constraint = std::option::Option::Some(v.into());
22536        self
22537    }
22538
22539    /// Sets or clears the value of [max_pods_constraint][crate::model::NodePool::max_pods_constraint].
22540    ///
22541    /// # Example
22542    /// ```ignore,no_run
22543    /// # use google_cloud_container_v1::model::NodePool;
22544    /// use google_cloud_container_v1::model::MaxPodsConstraint;
22545    /// let x = NodePool::new().set_or_clear_max_pods_constraint(Some(MaxPodsConstraint::default()/* use setters */));
22546    /// let x = NodePool::new().set_or_clear_max_pods_constraint(None::<MaxPodsConstraint>);
22547    /// ```
22548    pub fn set_or_clear_max_pods_constraint<T>(mut self, v: std::option::Option<T>) -> Self
22549    where
22550        T: std::convert::Into<crate::model::MaxPodsConstraint>,
22551    {
22552        self.max_pods_constraint = v.map(|x| x.into());
22553        self
22554    }
22555
22556    /// Sets the value of [conditions][crate::model::NodePool::conditions].
22557    ///
22558    /// # Example
22559    /// ```ignore,no_run
22560    /// # use google_cloud_container_v1::model::NodePool;
22561    /// use google_cloud_container_v1::model::StatusCondition;
22562    /// let x = NodePool::new()
22563    ///     .set_conditions([
22564    ///         StatusCondition::default()/* use setters */,
22565    ///         StatusCondition::default()/* use (different) setters */,
22566    ///     ]);
22567    /// ```
22568    pub fn set_conditions<T, V>(mut self, v: T) -> Self
22569    where
22570        T: std::iter::IntoIterator<Item = V>,
22571        V: std::convert::Into<crate::model::StatusCondition>,
22572    {
22573        use std::iter::Iterator;
22574        self.conditions = v.into_iter().map(|i| i.into()).collect();
22575        self
22576    }
22577
22578    /// Sets the value of [pod_ipv4_cidr_size][crate::model::NodePool::pod_ipv4_cidr_size].
22579    ///
22580    /// # Example
22581    /// ```ignore,no_run
22582    /// # use google_cloud_container_v1::model::NodePool;
22583    /// let x = NodePool::new().set_pod_ipv4_cidr_size(42);
22584    /// ```
22585    pub fn set_pod_ipv4_cidr_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22586        self.pod_ipv4_cidr_size = v.into();
22587        self
22588    }
22589
22590    /// Sets the value of [upgrade_settings][crate::model::NodePool::upgrade_settings].
22591    ///
22592    /// # Example
22593    /// ```ignore,no_run
22594    /// # use google_cloud_container_v1::model::NodePool;
22595    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22596    /// let x = NodePool::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
22597    /// ```
22598    pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
22599    where
22600        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
22601    {
22602        self.upgrade_settings = std::option::Option::Some(v.into());
22603        self
22604    }
22605
22606    /// Sets or clears the value of [upgrade_settings][crate::model::NodePool::upgrade_settings].
22607    ///
22608    /// # Example
22609    /// ```ignore,no_run
22610    /// # use google_cloud_container_v1::model::NodePool;
22611    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22612    /// let x = NodePool::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
22613    /// let x = NodePool::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
22614    /// ```
22615    pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
22616    where
22617        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
22618    {
22619        self.upgrade_settings = v.map(|x| x.into());
22620        self
22621    }
22622
22623    /// Sets the value of [placement_policy][crate::model::NodePool::placement_policy].
22624    ///
22625    /// # Example
22626    /// ```ignore,no_run
22627    /// # use google_cloud_container_v1::model::NodePool;
22628    /// use google_cloud_container_v1::model::node_pool::PlacementPolicy;
22629    /// let x = NodePool::new().set_placement_policy(PlacementPolicy::default()/* use setters */);
22630    /// ```
22631    pub fn set_placement_policy<T>(mut self, v: T) -> Self
22632    where
22633        T: std::convert::Into<crate::model::node_pool::PlacementPolicy>,
22634    {
22635        self.placement_policy = std::option::Option::Some(v.into());
22636        self
22637    }
22638
22639    /// Sets or clears the value of [placement_policy][crate::model::NodePool::placement_policy].
22640    ///
22641    /// # Example
22642    /// ```ignore,no_run
22643    /// # use google_cloud_container_v1::model::NodePool;
22644    /// use google_cloud_container_v1::model::node_pool::PlacementPolicy;
22645    /// let x = NodePool::new().set_or_clear_placement_policy(Some(PlacementPolicy::default()/* use setters */));
22646    /// let x = NodePool::new().set_or_clear_placement_policy(None::<PlacementPolicy>);
22647    /// ```
22648    pub fn set_or_clear_placement_policy<T>(mut self, v: std::option::Option<T>) -> Self
22649    where
22650        T: std::convert::Into<crate::model::node_pool::PlacementPolicy>,
22651    {
22652        self.placement_policy = v.map(|x| x.into());
22653        self
22654    }
22655
22656    /// Sets the value of [update_info][crate::model::NodePool::update_info].
22657    ///
22658    /// # Example
22659    /// ```ignore,no_run
22660    /// # use google_cloud_container_v1::model::NodePool;
22661    /// use google_cloud_container_v1::model::node_pool::UpdateInfo;
22662    /// let x = NodePool::new().set_update_info(UpdateInfo::default()/* use setters */);
22663    /// ```
22664    pub fn set_update_info<T>(mut self, v: T) -> Self
22665    where
22666        T: std::convert::Into<crate::model::node_pool::UpdateInfo>,
22667    {
22668        self.update_info = std::option::Option::Some(v.into());
22669        self
22670    }
22671
22672    /// Sets or clears the value of [update_info][crate::model::NodePool::update_info].
22673    ///
22674    /// # Example
22675    /// ```ignore,no_run
22676    /// # use google_cloud_container_v1::model::NodePool;
22677    /// use google_cloud_container_v1::model::node_pool::UpdateInfo;
22678    /// let x = NodePool::new().set_or_clear_update_info(Some(UpdateInfo::default()/* use setters */));
22679    /// let x = NodePool::new().set_or_clear_update_info(None::<UpdateInfo>);
22680    /// ```
22681    pub fn set_or_clear_update_info<T>(mut self, v: std::option::Option<T>) -> Self
22682    where
22683        T: std::convert::Into<crate::model::node_pool::UpdateInfo>,
22684    {
22685        self.update_info = v.map(|x| x.into());
22686        self
22687    }
22688
22689    /// Sets the value of [etag][crate::model::NodePool::etag].
22690    ///
22691    /// # Example
22692    /// ```ignore,no_run
22693    /// # use google_cloud_container_v1::model::NodePool;
22694    /// let x = NodePool::new().set_etag("example");
22695    /// ```
22696    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22697        self.etag = v.into();
22698        self
22699    }
22700
22701    /// Sets the value of [queued_provisioning][crate::model::NodePool::queued_provisioning].
22702    ///
22703    /// # Example
22704    /// ```ignore,no_run
22705    /// # use google_cloud_container_v1::model::NodePool;
22706    /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
22707    /// let x = NodePool::new().set_queued_provisioning(QueuedProvisioning::default()/* use setters */);
22708    /// ```
22709    pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
22710    where
22711        T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
22712    {
22713        self.queued_provisioning = std::option::Option::Some(v.into());
22714        self
22715    }
22716
22717    /// Sets or clears the value of [queued_provisioning][crate::model::NodePool::queued_provisioning].
22718    ///
22719    /// # Example
22720    /// ```ignore,no_run
22721    /// # use google_cloud_container_v1::model::NodePool;
22722    /// use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
22723    /// let x = NodePool::new().set_or_clear_queued_provisioning(Some(QueuedProvisioning::default()/* use setters */));
22724    /// let x = NodePool::new().set_or_clear_queued_provisioning(None::<QueuedProvisioning>);
22725    /// ```
22726    pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
22727    where
22728        T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
22729    {
22730        self.queued_provisioning = v.map(|x| x.into());
22731        self
22732    }
22733
22734    /// Sets the value of [best_effort_provisioning][crate::model::NodePool::best_effort_provisioning].
22735    ///
22736    /// # Example
22737    /// ```ignore,no_run
22738    /// # use google_cloud_container_v1::model::NodePool;
22739    /// use google_cloud_container_v1::model::BestEffortProvisioning;
22740    /// let x = NodePool::new().set_best_effort_provisioning(BestEffortProvisioning::default()/* use setters */);
22741    /// ```
22742    pub fn set_best_effort_provisioning<T>(mut self, v: T) -> Self
22743    where
22744        T: std::convert::Into<crate::model::BestEffortProvisioning>,
22745    {
22746        self.best_effort_provisioning = std::option::Option::Some(v.into());
22747        self
22748    }
22749
22750    /// Sets or clears the value of [best_effort_provisioning][crate::model::NodePool::best_effort_provisioning].
22751    ///
22752    /// # Example
22753    /// ```ignore,no_run
22754    /// # use google_cloud_container_v1::model::NodePool;
22755    /// use google_cloud_container_v1::model::BestEffortProvisioning;
22756    /// let x = NodePool::new().set_or_clear_best_effort_provisioning(Some(BestEffortProvisioning::default()/* use setters */));
22757    /// let x = NodePool::new().set_or_clear_best_effort_provisioning(None::<BestEffortProvisioning>);
22758    /// ```
22759    pub fn set_or_clear_best_effort_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
22760    where
22761        T: std::convert::Into<crate::model::BestEffortProvisioning>,
22762    {
22763        self.best_effort_provisioning = v.map(|x| x.into());
22764        self
22765    }
22766}
22767
22768impl wkt::message::Message for NodePool {
22769    fn typename() -> &'static str {
22770        "type.googleapis.com/google.container.v1.NodePool"
22771    }
22772}
22773
22774/// Defines additional types related to [NodePool].
22775pub mod node_pool {
22776    #[allow(unused_imports)]
22777    use super::*;
22778
22779    /// These upgrade settings control the level of parallelism and the level of
22780    /// disruption caused by an upgrade.
22781    ///
22782    /// maxUnavailable controls the number of nodes that can be simultaneously
22783    /// unavailable.
22784    ///
22785    /// maxSurge controls the number of additional nodes that can be added to the
22786    /// node pool temporarily for the time of the upgrade to increase the number of
22787    /// available nodes.
22788    ///
22789    /// (maxUnavailable + maxSurge) determines the level of parallelism (how many
22790    /// nodes are being upgraded at the same time).
22791    ///
22792    /// Note: upgrades inevitably introduce some disruption since workloads need to
22793    /// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0,
22794    /// this holds true. (Disruption stays within the limits of
22795    /// PodDisruptionBudget, if it is configured.)
22796    ///
22797    /// Consider a hypothetical node pool with 5 nodes having maxSurge=2,
22798    /// maxUnavailable=1. This means the upgrade process upgrades 3 nodes
22799    /// simultaneously. It creates 2 additional (upgraded) nodes, then it brings
22800    /// down 3 old (not yet upgraded) nodes at the same time. This ensures that
22801    /// there are always at least 4 nodes available.
22802    ///
22803    /// These upgrade settings configure the upgrade strategy for the node pool.
22804    /// Use strategy to switch between the strategies applied to the node pool.
22805    ///
22806    /// If the strategy is ROLLING, use max_surge and max_unavailable to control
22807    /// the level of parallelism and the level of disruption caused by upgrade.
22808    ///
22809    /// 1. maxSurge controls the number of additional nodes that can be added to
22810    ///    the node pool temporarily for the time of the upgrade to increase the
22811    ///    number of available nodes.
22812    /// 1. maxUnavailable controls the number of nodes that can be simultaneously
22813    ///    unavailable.
22814    /// 1. (maxUnavailable + maxSurge) determines the level of parallelism (how
22815    ///    many nodes are being upgraded at the same time).
22816    ///
22817    /// If the strategy is BLUE_GREEN, use blue_green_settings to configure the
22818    /// blue-green upgrade related settings.
22819    ///
22820    /// 1. standard_rollout_policy is the default policy. The policy is used to
22821    ///    control the way blue pool gets drained. The draining is executed in the
22822    ///    batch mode. The batch size could be specified as either percentage of the
22823    ///    node pool size or the number of nodes. batch_soak_duration is the soak
22824    ///    time after each batch gets drained.
22825    /// 1. node_pool_soak_duration is the soak time after all blue nodes are
22826    ///    drained. After this period, the blue pool nodes will be deleted.
22827    #[derive(Clone, Default, PartialEq)]
22828    #[non_exhaustive]
22829    pub struct UpgradeSettings {
22830        /// The maximum number of nodes that can be created beyond the current size
22831        /// of the node pool during the upgrade process.
22832        pub max_surge: i32,
22833
22834        /// The maximum number of nodes that can be simultaneously unavailable during
22835        /// the upgrade process. A node is considered available if its status is
22836        /// Ready.
22837        pub max_unavailable: i32,
22838
22839        /// Update strategy of the node pool.
22840        pub strategy: std::option::Option<crate::model::NodePoolUpdateStrategy>,
22841
22842        /// Settings for blue-green upgrade strategy.
22843        pub blue_green_settings: std::option::Option<crate::model::BlueGreenSettings>,
22844
22845        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22846    }
22847
22848    impl UpgradeSettings {
22849        pub fn new() -> Self {
22850            std::default::Default::default()
22851        }
22852
22853        /// Sets the value of [max_surge][crate::model::node_pool::UpgradeSettings::max_surge].
22854        ///
22855        /// # Example
22856        /// ```ignore,no_run
22857        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22858        /// let x = UpgradeSettings::new().set_max_surge(42);
22859        /// ```
22860        pub fn set_max_surge<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22861            self.max_surge = v.into();
22862            self
22863        }
22864
22865        /// Sets the value of [max_unavailable][crate::model::node_pool::UpgradeSettings::max_unavailable].
22866        ///
22867        /// # Example
22868        /// ```ignore,no_run
22869        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22870        /// let x = UpgradeSettings::new().set_max_unavailable(42);
22871        /// ```
22872        pub fn set_max_unavailable<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22873            self.max_unavailable = v.into();
22874            self
22875        }
22876
22877        /// Sets the value of [strategy][crate::model::node_pool::UpgradeSettings::strategy].
22878        ///
22879        /// # Example
22880        /// ```ignore,no_run
22881        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22882        /// use google_cloud_container_v1::model::NodePoolUpdateStrategy;
22883        /// let x0 = UpgradeSettings::new().set_strategy(NodePoolUpdateStrategy::BlueGreen);
22884        /// let x1 = UpgradeSettings::new().set_strategy(NodePoolUpdateStrategy::Surge);
22885        /// ```
22886        pub fn set_strategy<T>(mut self, v: T) -> Self
22887        where
22888            T: std::convert::Into<crate::model::NodePoolUpdateStrategy>,
22889        {
22890            self.strategy = std::option::Option::Some(v.into());
22891            self
22892        }
22893
22894        /// Sets or clears the value of [strategy][crate::model::node_pool::UpgradeSettings::strategy].
22895        ///
22896        /// # Example
22897        /// ```ignore,no_run
22898        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22899        /// use google_cloud_container_v1::model::NodePoolUpdateStrategy;
22900        /// let x0 = UpgradeSettings::new().set_or_clear_strategy(Some(NodePoolUpdateStrategy::BlueGreen));
22901        /// let x1 = UpgradeSettings::new().set_or_clear_strategy(Some(NodePoolUpdateStrategy::Surge));
22902        /// let x_none = UpgradeSettings::new().set_or_clear_strategy(None::<NodePoolUpdateStrategy>);
22903        /// ```
22904        pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
22905        where
22906            T: std::convert::Into<crate::model::NodePoolUpdateStrategy>,
22907        {
22908            self.strategy = v.map(|x| x.into());
22909            self
22910        }
22911
22912        /// Sets the value of [blue_green_settings][crate::model::node_pool::UpgradeSettings::blue_green_settings].
22913        ///
22914        /// # Example
22915        /// ```ignore,no_run
22916        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22917        /// use google_cloud_container_v1::model::BlueGreenSettings;
22918        /// let x = UpgradeSettings::new().set_blue_green_settings(BlueGreenSettings::default()/* use setters */);
22919        /// ```
22920        pub fn set_blue_green_settings<T>(mut self, v: T) -> Self
22921        where
22922            T: std::convert::Into<crate::model::BlueGreenSettings>,
22923        {
22924            self.blue_green_settings = std::option::Option::Some(v.into());
22925            self
22926        }
22927
22928        /// Sets or clears the value of [blue_green_settings][crate::model::node_pool::UpgradeSettings::blue_green_settings].
22929        ///
22930        /// # Example
22931        /// ```ignore,no_run
22932        /// # use google_cloud_container_v1::model::node_pool::UpgradeSettings;
22933        /// use google_cloud_container_v1::model::BlueGreenSettings;
22934        /// let x = UpgradeSettings::new().set_or_clear_blue_green_settings(Some(BlueGreenSettings::default()/* use setters */));
22935        /// let x = UpgradeSettings::new().set_or_clear_blue_green_settings(None::<BlueGreenSettings>);
22936        /// ```
22937        pub fn set_or_clear_blue_green_settings<T>(mut self, v: std::option::Option<T>) -> Self
22938        where
22939            T: std::convert::Into<crate::model::BlueGreenSettings>,
22940        {
22941            self.blue_green_settings = v.map(|x| x.into());
22942            self
22943        }
22944    }
22945
22946    impl wkt::message::Message for UpgradeSettings {
22947        fn typename() -> &'static str {
22948            "type.googleapis.com/google.container.v1.NodePool.UpgradeSettings"
22949        }
22950    }
22951
22952    /// UpdateInfo contains resource (instance groups, etc), status and other
22953    /// intermediate information relevant to a node pool upgrade.
22954    #[derive(Clone, Default, PartialEq)]
22955    #[non_exhaustive]
22956    pub struct UpdateInfo {
22957        /// Information of a blue-green upgrade.
22958        pub blue_green_info:
22959            std::option::Option<crate::model::node_pool::update_info::BlueGreenInfo>,
22960
22961        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22962    }
22963
22964    impl UpdateInfo {
22965        pub fn new() -> Self {
22966            std::default::Default::default()
22967        }
22968
22969        /// Sets the value of [blue_green_info][crate::model::node_pool::UpdateInfo::blue_green_info].
22970        ///
22971        /// # Example
22972        /// ```ignore,no_run
22973        /// # use google_cloud_container_v1::model::node_pool::UpdateInfo;
22974        /// use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
22975        /// let x = UpdateInfo::new().set_blue_green_info(BlueGreenInfo::default()/* use setters */);
22976        /// ```
22977        pub fn set_blue_green_info<T>(mut self, v: T) -> Self
22978        where
22979            T: std::convert::Into<crate::model::node_pool::update_info::BlueGreenInfo>,
22980        {
22981            self.blue_green_info = std::option::Option::Some(v.into());
22982            self
22983        }
22984
22985        /// Sets or clears the value of [blue_green_info][crate::model::node_pool::UpdateInfo::blue_green_info].
22986        ///
22987        /// # Example
22988        /// ```ignore,no_run
22989        /// # use google_cloud_container_v1::model::node_pool::UpdateInfo;
22990        /// use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
22991        /// let x = UpdateInfo::new().set_or_clear_blue_green_info(Some(BlueGreenInfo::default()/* use setters */));
22992        /// let x = UpdateInfo::new().set_or_clear_blue_green_info(None::<BlueGreenInfo>);
22993        /// ```
22994        pub fn set_or_clear_blue_green_info<T>(mut self, v: std::option::Option<T>) -> Self
22995        where
22996            T: std::convert::Into<crate::model::node_pool::update_info::BlueGreenInfo>,
22997        {
22998            self.blue_green_info = v.map(|x| x.into());
22999            self
23000        }
23001    }
23002
23003    impl wkt::message::Message for UpdateInfo {
23004        fn typename() -> &'static str {
23005            "type.googleapis.com/google.container.v1.NodePool.UpdateInfo"
23006        }
23007    }
23008
23009    /// Defines additional types related to [UpdateInfo].
23010    pub mod update_info {
23011        #[allow(unused_imports)]
23012        use super::*;
23013
23014        /// Information relevant to blue-green upgrade.
23015        #[derive(Clone, Default, PartialEq)]
23016        #[non_exhaustive]
23017        pub struct BlueGreenInfo {
23018            /// Current blue-green upgrade phase.
23019            pub phase: crate::model::node_pool::update_info::blue_green_info::Phase,
23020
23021            /// The resource URLs of the [managed instance groups]
23022            /// (/compute/docs/instance-groups/creating-groups-of-managed-instances)
23023            /// associated with blue pool.
23024            pub blue_instance_group_urls: std::vec::Vec<std::string::String>,
23025
23026            /// The resource URLs of the [managed instance groups]
23027            /// (/compute/docs/instance-groups/creating-groups-of-managed-instances)
23028            /// associated with green pool.
23029            pub green_instance_group_urls: std::vec::Vec<std::string::String>,
23030
23031            /// Time to start deleting blue pool to complete blue-green upgrade,
23032            /// in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
23033            pub blue_pool_deletion_start_time: std::string::String,
23034
23035            /// Version of green pool.
23036            pub green_pool_version: std::string::String,
23037
23038            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23039        }
23040
23041        impl BlueGreenInfo {
23042            pub fn new() -> Self {
23043                std::default::Default::default()
23044            }
23045
23046            /// Sets the value of [phase][crate::model::node_pool::update_info::BlueGreenInfo::phase].
23047            ///
23048            /// # Example
23049            /// ```ignore,no_run
23050            /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
23051            /// use google_cloud_container_v1::model::node_pool::update_info::blue_green_info::Phase;
23052            /// let x0 = BlueGreenInfo::new().set_phase(Phase::UpdateStarted);
23053            /// let x1 = BlueGreenInfo::new().set_phase(Phase::CreatingGreenPool);
23054            /// let x2 = BlueGreenInfo::new().set_phase(Phase::CordoningBluePool);
23055            /// ```
23056            pub fn set_phase<
23057                T: std::convert::Into<crate::model::node_pool::update_info::blue_green_info::Phase>,
23058            >(
23059                mut self,
23060                v: T,
23061            ) -> Self {
23062                self.phase = v.into();
23063                self
23064            }
23065
23066            /// Sets the value of [blue_instance_group_urls][crate::model::node_pool::update_info::BlueGreenInfo::blue_instance_group_urls].
23067            ///
23068            /// # Example
23069            /// ```ignore,no_run
23070            /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
23071            /// let x = BlueGreenInfo::new().set_blue_instance_group_urls(["a", "b", "c"]);
23072            /// ```
23073            pub fn set_blue_instance_group_urls<T, V>(mut self, v: T) -> Self
23074            where
23075                T: std::iter::IntoIterator<Item = V>,
23076                V: std::convert::Into<std::string::String>,
23077            {
23078                use std::iter::Iterator;
23079                self.blue_instance_group_urls = v.into_iter().map(|i| i.into()).collect();
23080                self
23081            }
23082
23083            /// Sets the value of [green_instance_group_urls][crate::model::node_pool::update_info::BlueGreenInfo::green_instance_group_urls].
23084            ///
23085            /// # Example
23086            /// ```ignore,no_run
23087            /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
23088            /// let x = BlueGreenInfo::new().set_green_instance_group_urls(["a", "b", "c"]);
23089            /// ```
23090            pub fn set_green_instance_group_urls<T, V>(mut self, v: T) -> Self
23091            where
23092                T: std::iter::IntoIterator<Item = V>,
23093                V: std::convert::Into<std::string::String>,
23094            {
23095                use std::iter::Iterator;
23096                self.green_instance_group_urls = v.into_iter().map(|i| i.into()).collect();
23097                self
23098            }
23099
23100            /// Sets the value of [blue_pool_deletion_start_time][crate::model::node_pool::update_info::BlueGreenInfo::blue_pool_deletion_start_time].
23101            ///
23102            /// # Example
23103            /// ```ignore,no_run
23104            /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
23105            /// let x = BlueGreenInfo::new().set_blue_pool_deletion_start_time("example");
23106            /// ```
23107            pub fn set_blue_pool_deletion_start_time<T: std::convert::Into<std::string::String>>(
23108                mut self,
23109                v: T,
23110            ) -> Self {
23111                self.blue_pool_deletion_start_time = v.into();
23112                self
23113            }
23114
23115            /// Sets the value of [green_pool_version][crate::model::node_pool::update_info::BlueGreenInfo::green_pool_version].
23116            ///
23117            /// # Example
23118            /// ```ignore,no_run
23119            /// # use google_cloud_container_v1::model::node_pool::update_info::BlueGreenInfo;
23120            /// let x = BlueGreenInfo::new().set_green_pool_version("example");
23121            /// ```
23122            pub fn set_green_pool_version<T: std::convert::Into<std::string::String>>(
23123                mut self,
23124                v: T,
23125            ) -> Self {
23126                self.green_pool_version = v.into();
23127                self
23128            }
23129        }
23130
23131        impl wkt::message::Message for BlueGreenInfo {
23132            fn typename() -> &'static str {
23133                "type.googleapis.com/google.container.v1.NodePool.UpdateInfo.BlueGreenInfo"
23134            }
23135        }
23136
23137        /// Defines additional types related to [BlueGreenInfo].
23138        pub mod blue_green_info {
23139            #[allow(unused_imports)]
23140            use super::*;
23141
23142            /// Phase represents the different stages blue-green upgrade is running in.
23143            ///
23144            /// # Working with unknown values
23145            ///
23146            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23147            /// additional enum variants at any time. Adding new variants is not considered
23148            /// a breaking change. Applications should write their code in anticipation of:
23149            ///
23150            /// - New values appearing in future releases of the client library, **and**
23151            /// - New values received dynamically, without application changes.
23152            ///
23153            /// Please consult the [Working with enums] section in the user guide for some
23154            /// guidelines.
23155            ///
23156            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23157            #[derive(Clone, Debug, PartialEq)]
23158            #[non_exhaustive]
23159            pub enum Phase {
23160                /// Unspecified phase.
23161                Unspecified,
23162                /// blue-green upgrade has been initiated.
23163                UpdateStarted,
23164                /// Start creating green pool nodes.
23165                CreatingGreenPool,
23166                /// Start cordoning blue pool nodes.
23167                CordoningBluePool,
23168                /// Start draining blue pool nodes.
23169                DrainingBluePool,
23170                /// Start soaking time after draining entire blue pool.
23171                NodePoolSoaking,
23172                /// Start deleting blue nodes.
23173                DeletingBluePool,
23174                /// Rollback has been initiated.
23175                RollbackStarted,
23176                /// If set, the enum was initialized with an unknown value.
23177                ///
23178                /// Applications can examine the value using [Phase::value] or
23179                /// [Phase::name].
23180                UnknownValue(phase::UnknownValue),
23181            }
23182
23183            #[doc(hidden)]
23184            pub mod phase {
23185                #[allow(unused_imports)]
23186                use super::*;
23187                #[derive(Clone, Debug, PartialEq)]
23188                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23189            }
23190
23191            impl Phase {
23192                /// Gets the enum value.
23193                ///
23194                /// Returns `None` if the enum contains an unknown value deserialized from
23195                /// the string representation of enums.
23196                pub fn value(&self) -> std::option::Option<i32> {
23197                    match self {
23198                        Self::Unspecified => std::option::Option::Some(0),
23199                        Self::UpdateStarted => std::option::Option::Some(1),
23200                        Self::CreatingGreenPool => std::option::Option::Some(2),
23201                        Self::CordoningBluePool => std::option::Option::Some(3),
23202                        Self::DrainingBluePool => std::option::Option::Some(4),
23203                        Self::NodePoolSoaking => std::option::Option::Some(5),
23204                        Self::DeletingBluePool => std::option::Option::Some(6),
23205                        Self::RollbackStarted => std::option::Option::Some(7),
23206                        Self::UnknownValue(u) => u.0.value(),
23207                    }
23208                }
23209
23210                /// Gets the enum value as a string.
23211                ///
23212                /// Returns `None` if the enum contains an unknown value deserialized from
23213                /// the integer representation of enums.
23214                pub fn name(&self) -> std::option::Option<&str> {
23215                    match self {
23216                        Self::Unspecified => std::option::Option::Some("PHASE_UNSPECIFIED"),
23217                        Self::UpdateStarted => std::option::Option::Some("UPDATE_STARTED"),
23218                        Self::CreatingGreenPool => std::option::Option::Some("CREATING_GREEN_POOL"),
23219                        Self::CordoningBluePool => std::option::Option::Some("CORDONING_BLUE_POOL"),
23220                        Self::DrainingBluePool => std::option::Option::Some("DRAINING_BLUE_POOL"),
23221                        Self::NodePoolSoaking => std::option::Option::Some("NODE_POOL_SOAKING"),
23222                        Self::DeletingBluePool => std::option::Option::Some("DELETING_BLUE_POOL"),
23223                        Self::RollbackStarted => std::option::Option::Some("ROLLBACK_STARTED"),
23224                        Self::UnknownValue(u) => u.0.name(),
23225                    }
23226                }
23227            }
23228
23229            impl std::default::Default for Phase {
23230                fn default() -> Self {
23231                    use std::convert::From;
23232                    Self::from(0)
23233                }
23234            }
23235
23236            impl std::fmt::Display for Phase {
23237                fn fmt(
23238                    &self,
23239                    f: &mut std::fmt::Formatter<'_>,
23240                ) -> std::result::Result<(), std::fmt::Error> {
23241                    wkt::internal::display_enum(f, self.name(), self.value())
23242                }
23243            }
23244
23245            impl std::convert::From<i32> for Phase {
23246                fn from(value: i32) -> Self {
23247                    match value {
23248                        0 => Self::Unspecified,
23249                        1 => Self::UpdateStarted,
23250                        2 => Self::CreatingGreenPool,
23251                        3 => Self::CordoningBluePool,
23252                        4 => Self::DrainingBluePool,
23253                        5 => Self::NodePoolSoaking,
23254                        6 => Self::DeletingBluePool,
23255                        7 => Self::RollbackStarted,
23256                        _ => Self::UnknownValue(phase::UnknownValue(
23257                            wkt::internal::UnknownEnumValue::Integer(value),
23258                        )),
23259                    }
23260                }
23261            }
23262
23263            impl std::convert::From<&str> for Phase {
23264                fn from(value: &str) -> Self {
23265                    use std::string::ToString;
23266                    match value {
23267                        "PHASE_UNSPECIFIED" => Self::Unspecified,
23268                        "UPDATE_STARTED" => Self::UpdateStarted,
23269                        "CREATING_GREEN_POOL" => Self::CreatingGreenPool,
23270                        "CORDONING_BLUE_POOL" => Self::CordoningBluePool,
23271                        "DRAINING_BLUE_POOL" => Self::DrainingBluePool,
23272                        "NODE_POOL_SOAKING" => Self::NodePoolSoaking,
23273                        "DELETING_BLUE_POOL" => Self::DeletingBluePool,
23274                        "ROLLBACK_STARTED" => Self::RollbackStarted,
23275                        _ => Self::UnknownValue(phase::UnknownValue(
23276                            wkt::internal::UnknownEnumValue::String(value.to_string()),
23277                        )),
23278                    }
23279                }
23280            }
23281
23282            impl serde::ser::Serialize for Phase {
23283                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23284                where
23285                    S: serde::Serializer,
23286                {
23287                    match self {
23288                        Self::Unspecified => serializer.serialize_i32(0),
23289                        Self::UpdateStarted => serializer.serialize_i32(1),
23290                        Self::CreatingGreenPool => serializer.serialize_i32(2),
23291                        Self::CordoningBluePool => serializer.serialize_i32(3),
23292                        Self::DrainingBluePool => serializer.serialize_i32(4),
23293                        Self::NodePoolSoaking => serializer.serialize_i32(5),
23294                        Self::DeletingBluePool => serializer.serialize_i32(6),
23295                        Self::RollbackStarted => serializer.serialize_i32(7),
23296                        Self::UnknownValue(u) => u.0.serialize(serializer),
23297                    }
23298                }
23299            }
23300
23301            impl<'de> serde::de::Deserialize<'de> for Phase {
23302                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23303                where
23304                    D: serde::Deserializer<'de>,
23305                {
23306                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<Phase>::new(
23307                        ".google.container.v1.NodePool.UpdateInfo.BlueGreenInfo.Phase",
23308                    ))
23309                }
23310            }
23311        }
23312    }
23313
23314    /// PlacementPolicy defines the placement policy used by the node pool.
23315    #[derive(Clone, Default, PartialEq)]
23316    #[non_exhaustive]
23317    pub struct PlacementPolicy {
23318        /// The type of placement.
23319        pub r#type: crate::model::node_pool::placement_policy::Type,
23320
23321        /// Optional. TPU placement topology for pod slice node pool.
23322        /// <https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies>
23323        pub tpu_topology: std::string::String,
23324
23325        /// If set, refers to the name of a custom resource policy supplied by the
23326        /// user. The resource policy must be in the same project and region as the
23327        /// node pool. If not found, InvalidArgument error is returned.
23328        pub policy_name: std::string::String,
23329
23330        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23331    }
23332
23333    impl PlacementPolicy {
23334        pub fn new() -> Self {
23335            std::default::Default::default()
23336        }
23337
23338        /// Sets the value of [r#type][crate::model::node_pool::PlacementPolicy::type].
23339        ///
23340        /// # Example
23341        /// ```ignore,no_run
23342        /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
23343        /// use google_cloud_container_v1::model::node_pool::placement_policy::Type;
23344        /// let x0 = PlacementPolicy::new().set_type(Type::Compact);
23345        /// ```
23346        pub fn set_type<T: std::convert::Into<crate::model::node_pool::placement_policy::Type>>(
23347            mut self,
23348            v: T,
23349        ) -> Self {
23350            self.r#type = v.into();
23351            self
23352        }
23353
23354        /// Sets the value of [tpu_topology][crate::model::node_pool::PlacementPolicy::tpu_topology].
23355        ///
23356        /// # Example
23357        /// ```ignore,no_run
23358        /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
23359        /// let x = PlacementPolicy::new().set_tpu_topology("example");
23360        /// ```
23361        pub fn set_tpu_topology<T: std::convert::Into<std::string::String>>(
23362            mut self,
23363            v: T,
23364        ) -> Self {
23365            self.tpu_topology = v.into();
23366            self
23367        }
23368
23369        /// Sets the value of [policy_name][crate::model::node_pool::PlacementPolicy::policy_name].
23370        ///
23371        /// # Example
23372        /// ```ignore,no_run
23373        /// # use google_cloud_container_v1::model::node_pool::PlacementPolicy;
23374        /// let x = PlacementPolicy::new().set_policy_name("example");
23375        /// ```
23376        pub fn set_policy_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23377            self.policy_name = v.into();
23378            self
23379        }
23380    }
23381
23382    impl wkt::message::Message for PlacementPolicy {
23383        fn typename() -> &'static str {
23384            "type.googleapis.com/google.container.v1.NodePool.PlacementPolicy"
23385        }
23386    }
23387
23388    /// Defines additional types related to [PlacementPolicy].
23389    pub mod placement_policy {
23390        #[allow(unused_imports)]
23391        use super::*;
23392
23393        /// Type defines the type of placement policy.
23394        ///
23395        /// # Working with unknown values
23396        ///
23397        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23398        /// additional enum variants at any time. Adding new variants is not considered
23399        /// a breaking change. Applications should write their code in anticipation of:
23400        ///
23401        /// - New values appearing in future releases of the client library, **and**
23402        /// - New values received dynamically, without application changes.
23403        ///
23404        /// Please consult the [Working with enums] section in the user guide for some
23405        /// guidelines.
23406        ///
23407        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23408        #[derive(Clone, Debug, PartialEq)]
23409        #[non_exhaustive]
23410        pub enum Type {
23411            /// TYPE_UNSPECIFIED specifies no requirements on nodes
23412            /// placement.
23413            Unspecified,
23414            /// COMPACT specifies node placement in the same availability domain to
23415            /// ensure low communication latency.
23416            Compact,
23417            /// If set, the enum was initialized with an unknown value.
23418            ///
23419            /// Applications can examine the value using [Type::value] or
23420            /// [Type::name].
23421            UnknownValue(r#type::UnknownValue),
23422        }
23423
23424        #[doc(hidden)]
23425        pub mod r#type {
23426            #[allow(unused_imports)]
23427            use super::*;
23428            #[derive(Clone, Debug, PartialEq)]
23429            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23430        }
23431
23432        impl Type {
23433            /// Gets the enum value.
23434            ///
23435            /// Returns `None` if the enum contains an unknown value deserialized from
23436            /// the string representation of enums.
23437            pub fn value(&self) -> std::option::Option<i32> {
23438                match self {
23439                    Self::Unspecified => std::option::Option::Some(0),
23440                    Self::Compact => std::option::Option::Some(1),
23441                    Self::UnknownValue(u) => u.0.value(),
23442                }
23443            }
23444
23445            /// Gets the enum value as a string.
23446            ///
23447            /// Returns `None` if the enum contains an unknown value deserialized from
23448            /// the integer representation of enums.
23449            pub fn name(&self) -> std::option::Option<&str> {
23450                match self {
23451                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
23452                    Self::Compact => std::option::Option::Some("COMPACT"),
23453                    Self::UnknownValue(u) => u.0.name(),
23454                }
23455            }
23456        }
23457
23458        impl std::default::Default for Type {
23459            fn default() -> Self {
23460                use std::convert::From;
23461                Self::from(0)
23462            }
23463        }
23464
23465        impl std::fmt::Display for Type {
23466            fn fmt(
23467                &self,
23468                f: &mut std::fmt::Formatter<'_>,
23469            ) -> std::result::Result<(), std::fmt::Error> {
23470                wkt::internal::display_enum(f, self.name(), self.value())
23471            }
23472        }
23473
23474        impl std::convert::From<i32> for Type {
23475            fn from(value: i32) -> Self {
23476                match value {
23477                    0 => Self::Unspecified,
23478                    1 => Self::Compact,
23479                    _ => Self::UnknownValue(r#type::UnknownValue(
23480                        wkt::internal::UnknownEnumValue::Integer(value),
23481                    )),
23482                }
23483            }
23484        }
23485
23486        impl std::convert::From<&str> for Type {
23487            fn from(value: &str) -> Self {
23488                use std::string::ToString;
23489                match value {
23490                    "TYPE_UNSPECIFIED" => Self::Unspecified,
23491                    "COMPACT" => Self::Compact,
23492                    _ => Self::UnknownValue(r#type::UnknownValue(
23493                        wkt::internal::UnknownEnumValue::String(value.to_string()),
23494                    )),
23495                }
23496            }
23497        }
23498
23499        impl serde::ser::Serialize for Type {
23500            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23501            where
23502                S: serde::Serializer,
23503            {
23504                match self {
23505                    Self::Unspecified => serializer.serialize_i32(0),
23506                    Self::Compact => serializer.serialize_i32(1),
23507                    Self::UnknownValue(u) => u.0.serialize(serializer),
23508                }
23509            }
23510        }
23511
23512        impl<'de> serde::de::Deserialize<'de> for Type {
23513            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23514            where
23515                D: serde::Deserializer<'de>,
23516            {
23517                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
23518                    ".google.container.v1.NodePool.PlacementPolicy.Type",
23519                ))
23520            }
23521        }
23522    }
23523
23524    /// QueuedProvisioning defines the queued provisioning used by the node pool.
23525    #[derive(Clone, Default, PartialEq)]
23526    #[non_exhaustive]
23527    pub struct QueuedProvisioning {
23528        /// Denotes that this nodepool is QRM specific, meaning nodes can be only
23529        /// obtained through queuing via the Cluster Autoscaler ProvisioningRequest
23530        /// API.
23531        pub enabled: bool,
23532
23533        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23534    }
23535
23536    impl QueuedProvisioning {
23537        pub fn new() -> Self {
23538            std::default::Default::default()
23539        }
23540
23541        /// Sets the value of [enabled][crate::model::node_pool::QueuedProvisioning::enabled].
23542        ///
23543        /// # Example
23544        /// ```ignore,no_run
23545        /// # use google_cloud_container_v1::model::node_pool::QueuedProvisioning;
23546        /// let x = QueuedProvisioning::new().set_enabled(true);
23547        /// ```
23548        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23549            self.enabled = v.into();
23550            self
23551        }
23552    }
23553
23554    impl wkt::message::Message for QueuedProvisioning {
23555        fn typename() -> &'static str {
23556            "type.googleapis.com/google.container.v1.NodePool.QueuedProvisioning"
23557        }
23558    }
23559
23560    /// The current status of the node pool instance.
23561    ///
23562    /// # Working with unknown values
23563    ///
23564    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23565    /// additional enum variants at any time. Adding new variants is not considered
23566    /// a breaking change. Applications should write their code in anticipation of:
23567    ///
23568    /// - New values appearing in future releases of the client library, **and**
23569    /// - New values received dynamically, without application changes.
23570    ///
23571    /// Please consult the [Working with enums] section in the user guide for some
23572    /// guidelines.
23573    ///
23574    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23575    #[derive(Clone, Debug, PartialEq)]
23576    #[non_exhaustive]
23577    pub enum Status {
23578        /// Not set.
23579        Unspecified,
23580        /// The PROVISIONING state indicates the node pool is being created.
23581        Provisioning,
23582        /// The RUNNING state indicates the node pool has been created
23583        /// and is fully usable.
23584        Running,
23585        /// The RUNNING_WITH_ERROR state indicates the node pool has been created
23586        /// and is partially usable. Some error state has occurred and some
23587        /// functionality may be impaired. Customer may need to reissue a request
23588        /// or trigger a new update.
23589        RunningWithError,
23590        /// The RECONCILING state indicates that some work is actively being done on
23591        /// the node pool, such as upgrading node software. Details can
23592        /// be found in the `statusMessage` field.
23593        Reconciling,
23594        /// The STOPPING state indicates the node pool is being deleted.
23595        Stopping,
23596        /// The ERROR state indicates the node pool may be unusable. Details
23597        /// can be found in the `statusMessage` field.
23598        Error,
23599        /// If set, the enum was initialized with an unknown value.
23600        ///
23601        /// Applications can examine the value using [Status::value] or
23602        /// [Status::name].
23603        UnknownValue(status::UnknownValue),
23604    }
23605
23606    #[doc(hidden)]
23607    pub mod status {
23608        #[allow(unused_imports)]
23609        use super::*;
23610        #[derive(Clone, Debug, PartialEq)]
23611        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23612    }
23613
23614    impl Status {
23615        /// Gets the enum value.
23616        ///
23617        /// Returns `None` if the enum contains an unknown value deserialized from
23618        /// the string representation of enums.
23619        pub fn value(&self) -> std::option::Option<i32> {
23620            match self {
23621                Self::Unspecified => std::option::Option::Some(0),
23622                Self::Provisioning => std::option::Option::Some(1),
23623                Self::Running => std::option::Option::Some(2),
23624                Self::RunningWithError => std::option::Option::Some(3),
23625                Self::Reconciling => std::option::Option::Some(4),
23626                Self::Stopping => std::option::Option::Some(5),
23627                Self::Error => std::option::Option::Some(6),
23628                Self::UnknownValue(u) => u.0.value(),
23629            }
23630        }
23631
23632        /// Gets the enum value as a string.
23633        ///
23634        /// Returns `None` if the enum contains an unknown value deserialized from
23635        /// the integer representation of enums.
23636        pub fn name(&self) -> std::option::Option<&str> {
23637            match self {
23638                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
23639                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
23640                Self::Running => std::option::Option::Some("RUNNING"),
23641                Self::RunningWithError => std::option::Option::Some("RUNNING_WITH_ERROR"),
23642                Self::Reconciling => std::option::Option::Some("RECONCILING"),
23643                Self::Stopping => std::option::Option::Some("STOPPING"),
23644                Self::Error => std::option::Option::Some("ERROR"),
23645                Self::UnknownValue(u) => u.0.name(),
23646            }
23647        }
23648    }
23649
23650    impl std::default::Default for Status {
23651        fn default() -> Self {
23652            use std::convert::From;
23653            Self::from(0)
23654        }
23655    }
23656
23657    impl std::fmt::Display for Status {
23658        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23659            wkt::internal::display_enum(f, self.name(), self.value())
23660        }
23661    }
23662
23663    impl std::convert::From<i32> for Status {
23664        fn from(value: i32) -> Self {
23665            match value {
23666                0 => Self::Unspecified,
23667                1 => Self::Provisioning,
23668                2 => Self::Running,
23669                3 => Self::RunningWithError,
23670                4 => Self::Reconciling,
23671                5 => Self::Stopping,
23672                6 => Self::Error,
23673                _ => Self::UnknownValue(status::UnknownValue(
23674                    wkt::internal::UnknownEnumValue::Integer(value),
23675                )),
23676            }
23677        }
23678    }
23679
23680    impl std::convert::From<&str> for Status {
23681        fn from(value: &str) -> Self {
23682            use std::string::ToString;
23683            match value {
23684                "STATUS_UNSPECIFIED" => Self::Unspecified,
23685                "PROVISIONING" => Self::Provisioning,
23686                "RUNNING" => Self::Running,
23687                "RUNNING_WITH_ERROR" => Self::RunningWithError,
23688                "RECONCILING" => Self::Reconciling,
23689                "STOPPING" => Self::Stopping,
23690                "ERROR" => Self::Error,
23691                _ => Self::UnknownValue(status::UnknownValue(
23692                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23693                )),
23694            }
23695        }
23696    }
23697
23698    impl serde::ser::Serialize for Status {
23699        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23700        where
23701            S: serde::Serializer,
23702        {
23703            match self {
23704                Self::Unspecified => serializer.serialize_i32(0),
23705                Self::Provisioning => serializer.serialize_i32(1),
23706                Self::Running => serializer.serialize_i32(2),
23707                Self::RunningWithError => serializer.serialize_i32(3),
23708                Self::Reconciling => serializer.serialize_i32(4),
23709                Self::Stopping => serializer.serialize_i32(5),
23710                Self::Error => serializer.serialize_i32(6),
23711                Self::UnknownValue(u) => u.0.serialize(serializer),
23712            }
23713        }
23714    }
23715
23716    impl<'de> serde::de::Deserialize<'de> for Status {
23717        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23718        where
23719            D: serde::Deserializer<'de>,
23720        {
23721            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
23722                ".google.container.v1.NodePool.Status",
23723            ))
23724        }
23725    }
23726}
23727
23728/// NodeManagement defines the set of node management services turned on for the
23729/// node pool.
23730#[derive(Clone, Default, PartialEq)]
23731#[non_exhaustive]
23732pub struct NodeManagement {
23733    /// A flag that specifies whether node auto-upgrade is enabled for the node
23734    /// pool. If enabled, node auto-upgrade helps keep the nodes in your node pool
23735    /// up to date with the latest release version of Kubernetes.
23736    pub auto_upgrade: bool,
23737
23738    /// A flag that specifies whether the node auto-repair is enabled for the node
23739    /// pool. If enabled, the nodes in this node pool will be monitored and, if
23740    /// they fail health checks too many times, an automatic repair action will be
23741    /// triggered.
23742    pub auto_repair: bool,
23743
23744    /// Specifies the Auto Upgrade knobs for the node pool.
23745    pub upgrade_options: std::option::Option<crate::model::AutoUpgradeOptions>,
23746
23747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23748}
23749
23750impl NodeManagement {
23751    pub fn new() -> Self {
23752        std::default::Default::default()
23753    }
23754
23755    /// Sets the value of [auto_upgrade][crate::model::NodeManagement::auto_upgrade].
23756    ///
23757    /// # Example
23758    /// ```ignore,no_run
23759    /// # use google_cloud_container_v1::model::NodeManagement;
23760    /// let x = NodeManagement::new().set_auto_upgrade(true);
23761    /// ```
23762    pub fn set_auto_upgrade<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23763        self.auto_upgrade = v.into();
23764        self
23765    }
23766
23767    /// Sets the value of [auto_repair][crate::model::NodeManagement::auto_repair].
23768    ///
23769    /// # Example
23770    /// ```ignore,no_run
23771    /// # use google_cloud_container_v1::model::NodeManagement;
23772    /// let x = NodeManagement::new().set_auto_repair(true);
23773    /// ```
23774    pub fn set_auto_repair<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23775        self.auto_repair = v.into();
23776        self
23777    }
23778
23779    /// Sets the value of [upgrade_options][crate::model::NodeManagement::upgrade_options].
23780    ///
23781    /// # Example
23782    /// ```ignore,no_run
23783    /// # use google_cloud_container_v1::model::NodeManagement;
23784    /// use google_cloud_container_v1::model::AutoUpgradeOptions;
23785    /// let x = NodeManagement::new().set_upgrade_options(AutoUpgradeOptions::default()/* use setters */);
23786    /// ```
23787    pub fn set_upgrade_options<T>(mut self, v: T) -> Self
23788    where
23789        T: std::convert::Into<crate::model::AutoUpgradeOptions>,
23790    {
23791        self.upgrade_options = std::option::Option::Some(v.into());
23792        self
23793    }
23794
23795    /// Sets or clears the value of [upgrade_options][crate::model::NodeManagement::upgrade_options].
23796    ///
23797    /// # Example
23798    /// ```ignore,no_run
23799    /// # use google_cloud_container_v1::model::NodeManagement;
23800    /// use google_cloud_container_v1::model::AutoUpgradeOptions;
23801    /// let x = NodeManagement::new().set_or_clear_upgrade_options(Some(AutoUpgradeOptions::default()/* use setters */));
23802    /// let x = NodeManagement::new().set_or_clear_upgrade_options(None::<AutoUpgradeOptions>);
23803    /// ```
23804    pub fn set_or_clear_upgrade_options<T>(mut self, v: std::option::Option<T>) -> Self
23805    where
23806        T: std::convert::Into<crate::model::AutoUpgradeOptions>,
23807    {
23808        self.upgrade_options = v.map(|x| x.into());
23809        self
23810    }
23811}
23812
23813impl wkt::message::Message for NodeManagement {
23814    fn typename() -> &'static str {
23815        "type.googleapis.com/google.container.v1.NodeManagement"
23816    }
23817}
23818
23819/// Best effort provisioning.
23820#[derive(Clone, Default, PartialEq)]
23821#[non_exhaustive]
23822pub struct BestEffortProvisioning {
23823    /// When this is enabled, cluster/node pool creations will ignore non-fatal
23824    /// errors like stockout to best provision as many nodes as possible right now
23825    /// and eventually bring up all target number of nodes
23826    pub enabled: bool,
23827
23828    /// Minimum number of nodes to be provisioned to be considered as succeeded,
23829    /// and the rest of nodes will be provisioned gradually and eventually when
23830    /// stockout issue has been resolved.
23831    pub min_provision_nodes: i32,
23832
23833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23834}
23835
23836impl BestEffortProvisioning {
23837    pub fn new() -> Self {
23838        std::default::Default::default()
23839    }
23840
23841    /// Sets the value of [enabled][crate::model::BestEffortProvisioning::enabled].
23842    ///
23843    /// # Example
23844    /// ```ignore,no_run
23845    /// # use google_cloud_container_v1::model::BestEffortProvisioning;
23846    /// let x = BestEffortProvisioning::new().set_enabled(true);
23847    /// ```
23848    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23849        self.enabled = v.into();
23850        self
23851    }
23852
23853    /// Sets the value of [min_provision_nodes][crate::model::BestEffortProvisioning::min_provision_nodes].
23854    ///
23855    /// # Example
23856    /// ```ignore,no_run
23857    /// # use google_cloud_container_v1::model::BestEffortProvisioning;
23858    /// let x = BestEffortProvisioning::new().set_min_provision_nodes(42);
23859    /// ```
23860    pub fn set_min_provision_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23861        self.min_provision_nodes = v.into();
23862        self
23863    }
23864}
23865
23866impl wkt::message::Message for BestEffortProvisioning {
23867    fn typename() -> &'static str {
23868        "type.googleapis.com/google.container.v1.BestEffortProvisioning"
23869    }
23870}
23871
23872/// AutoUpgradeOptions defines the set of options for the user to control how
23873/// the Auto Upgrades will proceed.
23874#[derive(Clone, Default, PartialEq)]
23875#[non_exhaustive]
23876pub struct AutoUpgradeOptions {
23877    /// Output only. This field is set when upgrades are about to commence
23878    /// with the approximate start time for the upgrades, in
23879    /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
23880    pub auto_upgrade_start_time: std::string::String,
23881
23882    /// Output only. This field is set when upgrades are about to commence
23883    /// with the description of the upgrade.
23884    pub description: std::string::String,
23885
23886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23887}
23888
23889impl AutoUpgradeOptions {
23890    pub fn new() -> Self {
23891        std::default::Default::default()
23892    }
23893
23894    /// Sets the value of [auto_upgrade_start_time][crate::model::AutoUpgradeOptions::auto_upgrade_start_time].
23895    ///
23896    /// # Example
23897    /// ```ignore,no_run
23898    /// # use google_cloud_container_v1::model::AutoUpgradeOptions;
23899    /// let x = AutoUpgradeOptions::new().set_auto_upgrade_start_time("example");
23900    /// ```
23901    pub fn set_auto_upgrade_start_time<T: std::convert::Into<std::string::String>>(
23902        mut self,
23903        v: T,
23904    ) -> Self {
23905        self.auto_upgrade_start_time = v.into();
23906        self
23907    }
23908
23909    /// Sets the value of [description][crate::model::AutoUpgradeOptions::description].
23910    ///
23911    /// # Example
23912    /// ```ignore,no_run
23913    /// # use google_cloud_container_v1::model::AutoUpgradeOptions;
23914    /// let x = AutoUpgradeOptions::new().set_description("example");
23915    /// ```
23916    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23917        self.description = v.into();
23918        self
23919    }
23920}
23921
23922impl wkt::message::Message for AutoUpgradeOptions {
23923    fn typename() -> &'static str {
23924        "type.googleapis.com/google.container.v1.AutoUpgradeOptions"
23925    }
23926}
23927
23928/// MaintenancePolicy defines the maintenance policy to be used for the cluster.
23929#[derive(Clone, Default, PartialEq)]
23930#[non_exhaustive]
23931pub struct MaintenancePolicy {
23932    /// Specifies the maintenance window in which maintenance may be performed.
23933    pub window: std::option::Option<crate::model::MaintenanceWindow>,
23934
23935    /// A hash identifying the version of this policy, so that updates to fields of
23936    /// the policy won't accidentally undo intermediate changes (and so that users
23937    /// of the API unaware of some fields won't accidentally remove other fields).
23938    /// Make a `get()` request to the cluster to get the current
23939    /// resource version and include it with requests to set the policy.
23940    pub resource_version: std::string::String,
23941
23942    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23943}
23944
23945impl MaintenancePolicy {
23946    pub fn new() -> Self {
23947        std::default::Default::default()
23948    }
23949
23950    /// Sets the value of [window][crate::model::MaintenancePolicy::window].
23951    ///
23952    /// # Example
23953    /// ```ignore,no_run
23954    /// # use google_cloud_container_v1::model::MaintenancePolicy;
23955    /// use google_cloud_container_v1::model::MaintenanceWindow;
23956    /// let x = MaintenancePolicy::new().set_window(MaintenanceWindow::default()/* use setters */);
23957    /// ```
23958    pub fn set_window<T>(mut self, v: T) -> Self
23959    where
23960        T: std::convert::Into<crate::model::MaintenanceWindow>,
23961    {
23962        self.window = std::option::Option::Some(v.into());
23963        self
23964    }
23965
23966    /// Sets or clears the value of [window][crate::model::MaintenancePolicy::window].
23967    ///
23968    /// # Example
23969    /// ```ignore,no_run
23970    /// # use google_cloud_container_v1::model::MaintenancePolicy;
23971    /// use google_cloud_container_v1::model::MaintenanceWindow;
23972    /// let x = MaintenancePolicy::new().set_or_clear_window(Some(MaintenanceWindow::default()/* use setters */));
23973    /// let x = MaintenancePolicy::new().set_or_clear_window(None::<MaintenanceWindow>);
23974    /// ```
23975    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
23976    where
23977        T: std::convert::Into<crate::model::MaintenanceWindow>,
23978    {
23979        self.window = v.map(|x| x.into());
23980        self
23981    }
23982
23983    /// Sets the value of [resource_version][crate::model::MaintenancePolicy::resource_version].
23984    ///
23985    /// # Example
23986    /// ```ignore,no_run
23987    /// # use google_cloud_container_v1::model::MaintenancePolicy;
23988    /// let x = MaintenancePolicy::new().set_resource_version("example");
23989    /// ```
23990    pub fn set_resource_version<T: std::convert::Into<std::string::String>>(
23991        mut self,
23992        v: T,
23993    ) -> Self {
23994        self.resource_version = v.into();
23995        self
23996    }
23997}
23998
23999impl wkt::message::Message for MaintenancePolicy {
24000    fn typename() -> &'static str {
24001        "type.googleapis.com/google.container.v1.MaintenancePolicy"
24002    }
24003}
24004
24005/// MaintenanceWindow defines the maintenance window to be used for the cluster.
24006#[derive(Clone, Default, PartialEq)]
24007#[non_exhaustive]
24008pub struct MaintenanceWindow {
24009    /// Exceptions to maintenance window. Non-emergency maintenance should not
24010    /// occur in these windows.
24011    pub maintenance_exclusions:
24012        std::collections::HashMap<std::string::String, crate::model::TimeWindow>,
24013
24014    pub policy: std::option::Option<crate::model::maintenance_window::Policy>,
24015
24016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24017}
24018
24019impl MaintenanceWindow {
24020    pub fn new() -> Self {
24021        std::default::Default::default()
24022    }
24023
24024    /// Sets the value of [maintenance_exclusions][crate::model::MaintenanceWindow::maintenance_exclusions].
24025    ///
24026    /// # Example
24027    /// ```ignore,no_run
24028    /// # use google_cloud_container_v1::model::MaintenanceWindow;
24029    /// use google_cloud_container_v1::model::TimeWindow;
24030    /// let x = MaintenanceWindow::new().set_maintenance_exclusions([
24031    ///     ("key0", TimeWindow::default()/* use setters */),
24032    ///     ("key1", TimeWindow::default()/* use (different) setters */),
24033    /// ]);
24034    /// ```
24035    pub fn set_maintenance_exclusions<T, K, V>(mut self, v: T) -> Self
24036    where
24037        T: std::iter::IntoIterator<Item = (K, V)>,
24038        K: std::convert::Into<std::string::String>,
24039        V: std::convert::Into<crate::model::TimeWindow>,
24040    {
24041        use std::iter::Iterator;
24042        self.maintenance_exclusions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
24043        self
24044    }
24045
24046    /// Sets the value of [policy][crate::model::MaintenanceWindow::policy].
24047    ///
24048    /// Note that all the setters affecting `policy` are mutually
24049    /// exclusive.
24050    ///
24051    /// # Example
24052    /// ```ignore,no_run
24053    /// # use google_cloud_container_v1::model::MaintenanceWindow;
24054    /// use google_cloud_container_v1::model::DailyMaintenanceWindow;
24055    /// let x = MaintenanceWindow::new().set_policy(Some(
24056    ///     google_cloud_container_v1::model::maintenance_window::Policy::DailyMaintenanceWindow(DailyMaintenanceWindow::default().into())));
24057    /// ```
24058    pub fn set_policy<
24059        T: std::convert::Into<std::option::Option<crate::model::maintenance_window::Policy>>,
24060    >(
24061        mut self,
24062        v: T,
24063    ) -> Self {
24064        self.policy = v.into();
24065        self
24066    }
24067
24068    /// The value of [policy][crate::model::MaintenanceWindow::policy]
24069    /// if it holds a `DailyMaintenanceWindow`, `None` if the field is not set or
24070    /// holds a different branch.
24071    pub fn daily_maintenance_window(
24072        &self,
24073    ) -> std::option::Option<&std::boxed::Box<crate::model::DailyMaintenanceWindow>> {
24074        #[allow(unreachable_patterns)]
24075        self.policy.as_ref().and_then(|v| match v {
24076            crate::model::maintenance_window::Policy::DailyMaintenanceWindow(v) => {
24077                std::option::Option::Some(v)
24078            }
24079            _ => std::option::Option::None,
24080        })
24081    }
24082
24083    /// Sets the value of [policy][crate::model::MaintenanceWindow::policy]
24084    /// to hold a `DailyMaintenanceWindow`.
24085    ///
24086    /// Note that all the setters affecting `policy` are
24087    /// mutually exclusive.
24088    ///
24089    /// # Example
24090    /// ```ignore,no_run
24091    /// # use google_cloud_container_v1::model::MaintenanceWindow;
24092    /// use google_cloud_container_v1::model::DailyMaintenanceWindow;
24093    /// let x = MaintenanceWindow::new().set_daily_maintenance_window(DailyMaintenanceWindow::default()/* use setters */);
24094    /// assert!(x.daily_maintenance_window().is_some());
24095    /// assert!(x.recurring_window().is_none());
24096    /// ```
24097    pub fn set_daily_maintenance_window<
24098        T: std::convert::Into<std::boxed::Box<crate::model::DailyMaintenanceWindow>>,
24099    >(
24100        mut self,
24101        v: T,
24102    ) -> Self {
24103        self.policy = std::option::Option::Some(
24104            crate::model::maintenance_window::Policy::DailyMaintenanceWindow(v.into()),
24105        );
24106        self
24107    }
24108
24109    /// The value of [policy][crate::model::MaintenanceWindow::policy]
24110    /// if it holds a `RecurringWindow`, `None` if the field is not set or
24111    /// holds a different branch.
24112    pub fn recurring_window(
24113        &self,
24114    ) -> std::option::Option<&std::boxed::Box<crate::model::RecurringTimeWindow>> {
24115        #[allow(unreachable_patterns)]
24116        self.policy.as_ref().and_then(|v| match v {
24117            crate::model::maintenance_window::Policy::RecurringWindow(v) => {
24118                std::option::Option::Some(v)
24119            }
24120            _ => std::option::Option::None,
24121        })
24122    }
24123
24124    /// Sets the value of [policy][crate::model::MaintenanceWindow::policy]
24125    /// to hold a `RecurringWindow`.
24126    ///
24127    /// Note that all the setters affecting `policy` are
24128    /// mutually exclusive.
24129    ///
24130    /// # Example
24131    /// ```ignore,no_run
24132    /// # use google_cloud_container_v1::model::MaintenanceWindow;
24133    /// use google_cloud_container_v1::model::RecurringTimeWindow;
24134    /// let x = MaintenanceWindow::new().set_recurring_window(RecurringTimeWindow::default()/* use setters */);
24135    /// assert!(x.recurring_window().is_some());
24136    /// assert!(x.daily_maintenance_window().is_none());
24137    /// ```
24138    pub fn set_recurring_window<
24139        T: std::convert::Into<std::boxed::Box<crate::model::RecurringTimeWindow>>,
24140    >(
24141        mut self,
24142        v: T,
24143    ) -> Self {
24144        self.policy = std::option::Option::Some(
24145            crate::model::maintenance_window::Policy::RecurringWindow(v.into()),
24146        );
24147        self
24148    }
24149}
24150
24151impl wkt::message::Message for MaintenanceWindow {
24152    fn typename() -> &'static str {
24153        "type.googleapis.com/google.container.v1.MaintenanceWindow"
24154    }
24155}
24156
24157/// Defines additional types related to [MaintenanceWindow].
24158pub mod maintenance_window {
24159    #[allow(unused_imports)]
24160    use super::*;
24161
24162    #[derive(Clone, Debug, PartialEq)]
24163    #[non_exhaustive]
24164    pub enum Policy {
24165        /// DailyMaintenanceWindow specifies a daily maintenance operation window.
24166        DailyMaintenanceWindow(std::boxed::Box<crate::model::DailyMaintenanceWindow>),
24167        /// RecurringWindow specifies some number of recurring time periods for
24168        /// maintenance to occur. The time windows may be overlapping. If no
24169        /// maintenance windows are set, maintenance can occur at any time.
24170        RecurringWindow(std::boxed::Box<crate::model::RecurringTimeWindow>),
24171    }
24172}
24173
24174/// Represents an arbitrary window of time.
24175#[derive(Clone, Default, PartialEq)]
24176#[non_exhaustive]
24177pub struct TimeWindow {
24178    /// The time that the window first starts.
24179    pub start_time: std::option::Option<wkt::Timestamp>,
24180
24181    /// The time that the window ends. The end time should take place after the
24182    /// start time.
24183    pub end_time: std::option::Option<wkt::Timestamp>,
24184
24185    pub options: std::option::Option<crate::model::time_window::Options>,
24186
24187    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24188}
24189
24190impl TimeWindow {
24191    pub fn new() -> Self {
24192        std::default::Default::default()
24193    }
24194
24195    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
24196    ///
24197    /// # Example
24198    /// ```ignore,no_run
24199    /// # use google_cloud_container_v1::model::TimeWindow;
24200    /// use wkt::Timestamp;
24201    /// let x = TimeWindow::new().set_start_time(Timestamp::default()/* use setters */);
24202    /// ```
24203    pub fn set_start_time<T>(mut self, v: T) -> Self
24204    where
24205        T: std::convert::Into<wkt::Timestamp>,
24206    {
24207        self.start_time = std::option::Option::Some(v.into());
24208        self
24209    }
24210
24211    /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
24212    ///
24213    /// # Example
24214    /// ```ignore,no_run
24215    /// # use google_cloud_container_v1::model::TimeWindow;
24216    /// use wkt::Timestamp;
24217    /// let x = TimeWindow::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24218    /// let x = TimeWindow::new().set_or_clear_start_time(None::<Timestamp>);
24219    /// ```
24220    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24221    where
24222        T: std::convert::Into<wkt::Timestamp>,
24223    {
24224        self.start_time = v.map(|x| x.into());
24225        self
24226    }
24227
24228    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
24229    ///
24230    /// # Example
24231    /// ```ignore,no_run
24232    /// # use google_cloud_container_v1::model::TimeWindow;
24233    /// use wkt::Timestamp;
24234    /// let x = TimeWindow::new().set_end_time(Timestamp::default()/* use setters */);
24235    /// ```
24236    pub fn set_end_time<T>(mut self, v: T) -> Self
24237    where
24238        T: std::convert::Into<wkt::Timestamp>,
24239    {
24240        self.end_time = std::option::Option::Some(v.into());
24241        self
24242    }
24243
24244    /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
24245    ///
24246    /// # Example
24247    /// ```ignore,no_run
24248    /// # use google_cloud_container_v1::model::TimeWindow;
24249    /// use wkt::Timestamp;
24250    /// let x = TimeWindow::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24251    /// let x = TimeWindow::new().set_or_clear_end_time(None::<Timestamp>);
24252    /// ```
24253    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24254    where
24255        T: std::convert::Into<wkt::Timestamp>,
24256    {
24257        self.end_time = v.map(|x| x.into());
24258        self
24259    }
24260
24261    /// Sets the value of [options][crate::model::TimeWindow::options].
24262    ///
24263    /// Note that all the setters affecting `options` are mutually
24264    /// exclusive.
24265    ///
24266    /// # Example
24267    /// ```ignore,no_run
24268    /// # use google_cloud_container_v1::model::TimeWindow;
24269    /// use google_cloud_container_v1::model::MaintenanceExclusionOptions;
24270    /// let x = TimeWindow::new().set_options(Some(
24271    ///     google_cloud_container_v1::model::time_window::Options::MaintenanceExclusionOptions(MaintenanceExclusionOptions::default().into())));
24272    /// ```
24273    pub fn set_options<
24274        T: std::convert::Into<std::option::Option<crate::model::time_window::Options>>,
24275    >(
24276        mut self,
24277        v: T,
24278    ) -> Self {
24279        self.options = v.into();
24280        self
24281    }
24282
24283    /// The value of [options][crate::model::TimeWindow::options]
24284    /// if it holds a `MaintenanceExclusionOptions`, `None` if the field is not set or
24285    /// holds a different branch.
24286    pub fn maintenance_exclusion_options(
24287        &self,
24288    ) -> std::option::Option<&std::boxed::Box<crate::model::MaintenanceExclusionOptions>> {
24289        #[allow(unreachable_patterns)]
24290        self.options.as_ref().and_then(|v| match v {
24291            crate::model::time_window::Options::MaintenanceExclusionOptions(v) => {
24292                std::option::Option::Some(v)
24293            }
24294            _ => std::option::Option::None,
24295        })
24296    }
24297
24298    /// Sets the value of [options][crate::model::TimeWindow::options]
24299    /// to hold a `MaintenanceExclusionOptions`.
24300    ///
24301    /// Note that all the setters affecting `options` are
24302    /// mutually exclusive.
24303    ///
24304    /// # Example
24305    /// ```ignore,no_run
24306    /// # use google_cloud_container_v1::model::TimeWindow;
24307    /// use google_cloud_container_v1::model::MaintenanceExclusionOptions;
24308    /// let x = TimeWindow::new().set_maintenance_exclusion_options(MaintenanceExclusionOptions::default()/* use setters */);
24309    /// assert!(x.maintenance_exclusion_options().is_some());
24310    /// ```
24311    pub fn set_maintenance_exclusion_options<
24312        T: std::convert::Into<std::boxed::Box<crate::model::MaintenanceExclusionOptions>>,
24313    >(
24314        mut self,
24315        v: T,
24316    ) -> Self {
24317        self.options = std::option::Option::Some(
24318            crate::model::time_window::Options::MaintenanceExclusionOptions(v.into()),
24319        );
24320        self
24321    }
24322}
24323
24324impl wkt::message::Message for TimeWindow {
24325    fn typename() -> &'static str {
24326        "type.googleapis.com/google.container.v1.TimeWindow"
24327    }
24328}
24329
24330/// Defines additional types related to [TimeWindow].
24331pub mod time_window {
24332    #[allow(unused_imports)]
24333    use super::*;
24334
24335    #[derive(Clone, Debug, PartialEq)]
24336    #[non_exhaustive]
24337    pub enum Options {
24338        /// MaintenanceExclusionOptions provides maintenance exclusion related
24339        /// options.
24340        MaintenanceExclusionOptions(std::boxed::Box<crate::model::MaintenanceExclusionOptions>),
24341    }
24342}
24343
24344/// Represents the Maintenance exclusion option.
24345#[derive(Clone, Default, PartialEq)]
24346#[non_exhaustive]
24347pub struct MaintenanceExclusionOptions {
24348    /// Scope specifies the upgrade scope which upgrades are blocked by the
24349    /// exclusion.
24350    pub scope: crate::model::maintenance_exclusion_options::Scope,
24351
24352    /// EndTimeBehavior specifies the behavior of the exclusion end time.
24353    pub end_time_behavior: crate::model::maintenance_exclusion_options::EndTimeBehavior,
24354
24355    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24356}
24357
24358impl MaintenanceExclusionOptions {
24359    pub fn new() -> Self {
24360        std::default::Default::default()
24361    }
24362
24363    /// Sets the value of [scope][crate::model::MaintenanceExclusionOptions::scope].
24364    ///
24365    /// # Example
24366    /// ```ignore,no_run
24367    /// # use google_cloud_container_v1::model::MaintenanceExclusionOptions;
24368    /// use google_cloud_container_v1::model::maintenance_exclusion_options::Scope;
24369    /// let x0 = MaintenanceExclusionOptions::new().set_scope(Scope::NoMinorUpgrades);
24370    /// let x1 = MaintenanceExclusionOptions::new().set_scope(Scope::NoMinorOrNodeUpgrades);
24371    /// ```
24372    pub fn set_scope<T: std::convert::Into<crate::model::maintenance_exclusion_options::Scope>>(
24373        mut self,
24374        v: T,
24375    ) -> Self {
24376        self.scope = v.into();
24377        self
24378    }
24379
24380    /// Sets the value of [end_time_behavior][crate::model::MaintenanceExclusionOptions::end_time_behavior].
24381    ///
24382    /// # Example
24383    /// ```ignore,no_run
24384    /// # use google_cloud_container_v1::model::MaintenanceExclusionOptions;
24385    /// use google_cloud_container_v1::model::maintenance_exclusion_options::EndTimeBehavior;
24386    /// let x0 = MaintenanceExclusionOptions::new().set_end_time_behavior(EndTimeBehavior::UntilEndOfSupport);
24387    /// ```
24388    pub fn set_end_time_behavior<
24389        T: std::convert::Into<crate::model::maintenance_exclusion_options::EndTimeBehavior>,
24390    >(
24391        mut self,
24392        v: T,
24393    ) -> Self {
24394        self.end_time_behavior = v.into();
24395        self
24396    }
24397}
24398
24399impl wkt::message::Message for MaintenanceExclusionOptions {
24400    fn typename() -> &'static str {
24401        "type.googleapis.com/google.container.v1.MaintenanceExclusionOptions"
24402    }
24403}
24404
24405/// Defines additional types related to [MaintenanceExclusionOptions].
24406pub mod maintenance_exclusion_options {
24407    #[allow(unused_imports)]
24408    use super::*;
24409
24410    /// Scope of exclusion.
24411    ///
24412    /// # Working with unknown values
24413    ///
24414    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24415    /// additional enum variants at any time. Adding new variants is not considered
24416    /// a breaking change. Applications should write their code in anticipation of:
24417    ///
24418    /// - New values appearing in future releases of the client library, **and**
24419    /// - New values received dynamically, without application changes.
24420    ///
24421    /// Please consult the [Working with enums] section in the user guide for some
24422    /// guidelines.
24423    ///
24424    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24425    #[derive(Clone, Debug, PartialEq)]
24426    #[non_exhaustive]
24427    pub enum Scope {
24428        /// NO_UPGRADES excludes all upgrades, including patch upgrades and minor
24429        /// upgrades across control planes and nodes. This is the default exclusion
24430        /// behavior.
24431        NoUpgrades,
24432        /// NO_MINOR_UPGRADES excludes all minor upgrades for the cluster, only
24433        /// patches are allowed.
24434        NoMinorUpgrades,
24435        /// NO_MINOR_OR_NODE_UPGRADES excludes all minor upgrades for the cluster,
24436        /// and also exclude all node pool upgrades. Only control
24437        /// plane patches are allowed.
24438        NoMinorOrNodeUpgrades,
24439        /// If set, the enum was initialized with an unknown value.
24440        ///
24441        /// Applications can examine the value using [Scope::value] or
24442        /// [Scope::name].
24443        UnknownValue(scope::UnknownValue),
24444    }
24445
24446    #[doc(hidden)]
24447    pub mod scope {
24448        #[allow(unused_imports)]
24449        use super::*;
24450        #[derive(Clone, Debug, PartialEq)]
24451        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24452    }
24453
24454    impl Scope {
24455        /// Gets the enum value.
24456        ///
24457        /// Returns `None` if the enum contains an unknown value deserialized from
24458        /// the string representation of enums.
24459        pub fn value(&self) -> std::option::Option<i32> {
24460            match self {
24461                Self::NoUpgrades => std::option::Option::Some(0),
24462                Self::NoMinorUpgrades => std::option::Option::Some(1),
24463                Self::NoMinorOrNodeUpgrades => std::option::Option::Some(2),
24464                Self::UnknownValue(u) => u.0.value(),
24465            }
24466        }
24467
24468        /// Gets the enum value as a string.
24469        ///
24470        /// Returns `None` if the enum contains an unknown value deserialized from
24471        /// the integer representation of enums.
24472        pub fn name(&self) -> std::option::Option<&str> {
24473            match self {
24474                Self::NoUpgrades => std::option::Option::Some("NO_UPGRADES"),
24475                Self::NoMinorUpgrades => std::option::Option::Some("NO_MINOR_UPGRADES"),
24476                Self::NoMinorOrNodeUpgrades => {
24477                    std::option::Option::Some("NO_MINOR_OR_NODE_UPGRADES")
24478                }
24479                Self::UnknownValue(u) => u.0.name(),
24480            }
24481        }
24482    }
24483
24484    impl std::default::Default for Scope {
24485        fn default() -> Self {
24486            use std::convert::From;
24487            Self::from(0)
24488        }
24489    }
24490
24491    impl std::fmt::Display for Scope {
24492        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24493            wkt::internal::display_enum(f, self.name(), self.value())
24494        }
24495    }
24496
24497    impl std::convert::From<i32> for Scope {
24498        fn from(value: i32) -> Self {
24499            match value {
24500                0 => Self::NoUpgrades,
24501                1 => Self::NoMinorUpgrades,
24502                2 => Self::NoMinorOrNodeUpgrades,
24503                _ => Self::UnknownValue(scope::UnknownValue(
24504                    wkt::internal::UnknownEnumValue::Integer(value),
24505                )),
24506            }
24507        }
24508    }
24509
24510    impl std::convert::From<&str> for Scope {
24511        fn from(value: &str) -> Self {
24512            use std::string::ToString;
24513            match value {
24514                "NO_UPGRADES" => Self::NoUpgrades,
24515                "NO_MINOR_UPGRADES" => Self::NoMinorUpgrades,
24516                "NO_MINOR_OR_NODE_UPGRADES" => Self::NoMinorOrNodeUpgrades,
24517                _ => Self::UnknownValue(scope::UnknownValue(
24518                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24519                )),
24520            }
24521        }
24522    }
24523
24524    impl serde::ser::Serialize for Scope {
24525        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24526        where
24527            S: serde::Serializer,
24528        {
24529            match self {
24530                Self::NoUpgrades => serializer.serialize_i32(0),
24531                Self::NoMinorUpgrades => serializer.serialize_i32(1),
24532                Self::NoMinorOrNodeUpgrades => serializer.serialize_i32(2),
24533                Self::UnknownValue(u) => u.0.serialize(serializer),
24534            }
24535        }
24536    }
24537
24538    impl<'de> serde::de::Deserialize<'de> for Scope {
24539        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24540        where
24541            D: serde::Deserializer<'de>,
24542        {
24543            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
24544                ".google.container.v1.MaintenanceExclusionOptions.Scope",
24545            ))
24546        }
24547    }
24548
24549    /// EndTimeBehavior specifies the behavior of the exclusion end time.
24550    ///
24551    /// # Working with unknown values
24552    ///
24553    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24554    /// additional enum variants at any time. Adding new variants is not considered
24555    /// a breaking change. Applications should write their code in anticipation of:
24556    ///
24557    /// - New values appearing in future releases of the client library, **and**
24558    /// - New values received dynamically, without application changes.
24559    ///
24560    /// Please consult the [Working with enums] section in the user guide for some
24561    /// guidelines.
24562    ///
24563    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24564    #[derive(Clone, Debug, PartialEq)]
24565    #[non_exhaustive]
24566    pub enum EndTimeBehavior {
24567        /// END_TIME_BEHAVIOR_UNSPECIFIED is the default behavior, which is fixed
24568        /// end time.
24569        Unspecified,
24570        /// UNTIL_END_OF_SUPPORT means the exclusion will be in effect until the end
24571        /// of the support of the cluster's current version.
24572        UntilEndOfSupport,
24573        /// If set, the enum was initialized with an unknown value.
24574        ///
24575        /// Applications can examine the value using [EndTimeBehavior::value] or
24576        /// [EndTimeBehavior::name].
24577        UnknownValue(end_time_behavior::UnknownValue),
24578    }
24579
24580    #[doc(hidden)]
24581    pub mod end_time_behavior {
24582        #[allow(unused_imports)]
24583        use super::*;
24584        #[derive(Clone, Debug, PartialEq)]
24585        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24586    }
24587
24588    impl EndTimeBehavior {
24589        /// Gets the enum value.
24590        ///
24591        /// Returns `None` if the enum contains an unknown value deserialized from
24592        /// the string representation of enums.
24593        pub fn value(&self) -> std::option::Option<i32> {
24594            match self {
24595                Self::Unspecified => std::option::Option::Some(0),
24596                Self::UntilEndOfSupport => std::option::Option::Some(1),
24597                Self::UnknownValue(u) => u.0.value(),
24598            }
24599        }
24600
24601        /// Gets the enum value as a string.
24602        ///
24603        /// Returns `None` if the enum contains an unknown value deserialized from
24604        /// the integer representation of enums.
24605        pub fn name(&self) -> std::option::Option<&str> {
24606            match self {
24607                Self::Unspecified => std::option::Option::Some("END_TIME_BEHAVIOR_UNSPECIFIED"),
24608                Self::UntilEndOfSupport => std::option::Option::Some("UNTIL_END_OF_SUPPORT"),
24609                Self::UnknownValue(u) => u.0.name(),
24610            }
24611        }
24612    }
24613
24614    impl std::default::Default for EndTimeBehavior {
24615        fn default() -> Self {
24616            use std::convert::From;
24617            Self::from(0)
24618        }
24619    }
24620
24621    impl std::fmt::Display for EndTimeBehavior {
24622        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24623            wkt::internal::display_enum(f, self.name(), self.value())
24624        }
24625    }
24626
24627    impl std::convert::From<i32> for EndTimeBehavior {
24628        fn from(value: i32) -> Self {
24629            match value {
24630                0 => Self::Unspecified,
24631                1 => Self::UntilEndOfSupport,
24632                _ => Self::UnknownValue(end_time_behavior::UnknownValue(
24633                    wkt::internal::UnknownEnumValue::Integer(value),
24634                )),
24635            }
24636        }
24637    }
24638
24639    impl std::convert::From<&str> for EndTimeBehavior {
24640        fn from(value: &str) -> Self {
24641            use std::string::ToString;
24642            match value {
24643                "END_TIME_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
24644                "UNTIL_END_OF_SUPPORT" => Self::UntilEndOfSupport,
24645                _ => Self::UnknownValue(end_time_behavior::UnknownValue(
24646                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24647                )),
24648            }
24649        }
24650    }
24651
24652    impl serde::ser::Serialize for EndTimeBehavior {
24653        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24654        where
24655            S: serde::Serializer,
24656        {
24657            match self {
24658                Self::Unspecified => serializer.serialize_i32(0),
24659                Self::UntilEndOfSupport => serializer.serialize_i32(1),
24660                Self::UnknownValue(u) => u.0.serialize(serializer),
24661            }
24662        }
24663    }
24664
24665    impl<'de> serde::de::Deserialize<'de> for EndTimeBehavior {
24666        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24667        where
24668            D: serde::Deserializer<'de>,
24669        {
24670            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EndTimeBehavior>::new(
24671                ".google.container.v1.MaintenanceExclusionOptions.EndTimeBehavior",
24672            ))
24673        }
24674    }
24675}
24676
24677/// Represents an arbitrary window of time that recurs.
24678#[derive(Clone, Default, PartialEq)]
24679#[non_exhaustive]
24680pub struct RecurringTimeWindow {
24681    /// The window of the first recurrence.
24682    pub window: std::option::Option<crate::model::TimeWindow>,
24683
24684    /// An RRULE (<https://tools.ietf.org/html/rfc5545#section-3.8.5.3>) for how
24685    /// this window reccurs. They go on for the span of time between the start and
24686    /// end time.
24687    ///
24688    /// For example, to have something repeat every weekday, you'd use:
24689    /// `FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR`
24690    ///
24691    /// To repeat some window daily (equivalent to the DailyMaintenanceWindow):
24692    /// `FREQ=DAILY`
24693    ///
24694    /// For the first weekend of every month:
24695    /// `FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU`
24696    ///
24697    /// This specifies how frequently the window starts. Eg, if you wanted to have
24698    /// a 9-5 UTC-4 window every weekday, you'd use something like:
24699    ///
24700    /// ```norust
24701    /// start time = 2019-01-01T09:00:00-0400
24702    /// end time = 2019-01-01T17:00:00-0400
24703    /// recurrence = FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
24704    /// ```
24705    ///
24706    /// Windows can span multiple days. Eg, to make the window encompass every
24707    /// weekend from midnight Saturday till the last minute of Sunday UTC:
24708    ///
24709    /// ```norust
24710    /// start time = 2019-01-05T00:00:00Z
24711    /// end time = 2019-01-07T23:59:00Z
24712    /// recurrence = FREQ=WEEKLY;BYDAY=SA
24713    /// ```
24714    ///
24715    /// Note the start and end time's specific dates are largely arbitrary except
24716    /// to specify duration of the window and when it first starts.
24717    /// The FREQ values of HOURLY, MINUTELY, and SECONDLY are not supported.
24718    pub recurrence: std::string::String,
24719
24720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24721}
24722
24723impl RecurringTimeWindow {
24724    pub fn new() -> Self {
24725        std::default::Default::default()
24726    }
24727
24728    /// Sets the value of [window][crate::model::RecurringTimeWindow::window].
24729    ///
24730    /// # Example
24731    /// ```ignore,no_run
24732    /// # use google_cloud_container_v1::model::RecurringTimeWindow;
24733    /// use google_cloud_container_v1::model::TimeWindow;
24734    /// let x = RecurringTimeWindow::new().set_window(TimeWindow::default()/* use setters */);
24735    /// ```
24736    pub fn set_window<T>(mut self, v: T) -> Self
24737    where
24738        T: std::convert::Into<crate::model::TimeWindow>,
24739    {
24740        self.window = std::option::Option::Some(v.into());
24741        self
24742    }
24743
24744    /// Sets or clears the value of [window][crate::model::RecurringTimeWindow::window].
24745    ///
24746    /// # Example
24747    /// ```ignore,no_run
24748    /// # use google_cloud_container_v1::model::RecurringTimeWindow;
24749    /// use google_cloud_container_v1::model::TimeWindow;
24750    /// let x = RecurringTimeWindow::new().set_or_clear_window(Some(TimeWindow::default()/* use setters */));
24751    /// let x = RecurringTimeWindow::new().set_or_clear_window(None::<TimeWindow>);
24752    /// ```
24753    pub fn set_or_clear_window<T>(mut self, v: std::option::Option<T>) -> Self
24754    where
24755        T: std::convert::Into<crate::model::TimeWindow>,
24756    {
24757        self.window = v.map(|x| x.into());
24758        self
24759    }
24760
24761    /// Sets the value of [recurrence][crate::model::RecurringTimeWindow::recurrence].
24762    ///
24763    /// # Example
24764    /// ```ignore,no_run
24765    /// # use google_cloud_container_v1::model::RecurringTimeWindow;
24766    /// let x = RecurringTimeWindow::new().set_recurrence("example");
24767    /// ```
24768    pub fn set_recurrence<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24769        self.recurrence = v.into();
24770        self
24771    }
24772}
24773
24774impl wkt::message::Message for RecurringTimeWindow {
24775    fn typename() -> &'static str {
24776        "type.googleapis.com/google.container.v1.RecurringTimeWindow"
24777    }
24778}
24779
24780/// Time window specified for daily maintenance operations.
24781#[derive(Clone, Default, PartialEq)]
24782#[non_exhaustive]
24783pub struct DailyMaintenanceWindow {
24784    /// Time within the maintenance window to start the maintenance operations.
24785    /// Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
24786    /// format "HH:MM", where HH : [00-23] and MM : [00-59] GMT.
24787    pub start_time: std::string::String,
24788
24789    /// Output only. Duration of the time window, automatically chosen to be
24790    /// smallest possible in the given scenario.
24791    /// Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
24792    /// format "PTnHnMnS".
24793    pub duration: std::string::String,
24794
24795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24796}
24797
24798impl DailyMaintenanceWindow {
24799    pub fn new() -> Self {
24800        std::default::Default::default()
24801    }
24802
24803    /// Sets the value of [start_time][crate::model::DailyMaintenanceWindow::start_time].
24804    ///
24805    /// # Example
24806    /// ```ignore,no_run
24807    /// # use google_cloud_container_v1::model::DailyMaintenanceWindow;
24808    /// let x = DailyMaintenanceWindow::new().set_start_time("example");
24809    /// ```
24810    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24811        self.start_time = v.into();
24812        self
24813    }
24814
24815    /// Sets the value of [duration][crate::model::DailyMaintenanceWindow::duration].
24816    ///
24817    /// # Example
24818    /// ```ignore,no_run
24819    /// # use google_cloud_container_v1::model::DailyMaintenanceWindow;
24820    /// let x = DailyMaintenanceWindow::new().set_duration("example");
24821    /// ```
24822    pub fn set_duration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24823        self.duration = v.into();
24824        self
24825    }
24826}
24827
24828impl wkt::message::Message for DailyMaintenanceWindow {
24829    fn typename() -> &'static str {
24830        "type.googleapis.com/google.container.v1.DailyMaintenanceWindow"
24831    }
24832}
24833
24834/// SetNodePoolManagementRequest sets the node management properties of a node
24835/// pool.
24836#[derive(Clone, Default, PartialEq)]
24837#[non_exhaustive]
24838pub struct SetNodePoolManagementRequest {
24839    /// Deprecated. The Google Developers Console [project ID or project
24840    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24841    /// This field has been deprecated and replaced by the name field.
24842    #[deprecated]
24843    pub project_id: std::string::String,
24844
24845    /// Deprecated. The name of the Google Compute Engine
24846    /// [zone](https://cloud.google.com/compute/docs/zones#available)
24847    /// in which the cluster resides. This field has been deprecated and replaced
24848    /// by the name field.
24849    #[deprecated]
24850    pub zone: std::string::String,
24851
24852    /// Deprecated. The name of the cluster to update.
24853    /// This field has been deprecated and replaced by the name field.
24854    #[deprecated]
24855    pub cluster_id: std::string::String,
24856
24857    /// Deprecated. The name of the node pool to update.
24858    /// This field has been deprecated and replaced by the name field.
24859    #[deprecated]
24860    pub node_pool_id: std::string::String,
24861
24862    /// Required. NodeManagement configuration for the node pool.
24863    pub management: std::option::Option<crate::model::NodeManagement>,
24864
24865    /// The name (project, location, cluster, node pool id) of the node pool to set
24866    /// management properties. Specified in the format
24867    /// `projects/*/locations/*/clusters/*/nodePools/*`.
24868    pub name: std::string::String,
24869
24870    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24871}
24872
24873impl SetNodePoolManagementRequest {
24874    pub fn new() -> Self {
24875        std::default::Default::default()
24876    }
24877
24878    /// Sets the value of [project_id][crate::model::SetNodePoolManagementRequest::project_id].
24879    ///
24880    /// # Example
24881    /// ```ignore,no_run
24882    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24883    /// let x = SetNodePoolManagementRequest::new().set_project_id("example");
24884    /// ```
24885    #[deprecated]
24886    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24887        self.project_id = v.into();
24888        self
24889    }
24890
24891    /// Sets the value of [zone][crate::model::SetNodePoolManagementRequest::zone].
24892    ///
24893    /// # Example
24894    /// ```ignore,no_run
24895    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24896    /// let x = SetNodePoolManagementRequest::new().set_zone("example");
24897    /// ```
24898    #[deprecated]
24899    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24900        self.zone = v.into();
24901        self
24902    }
24903
24904    /// Sets the value of [cluster_id][crate::model::SetNodePoolManagementRequest::cluster_id].
24905    ///
24906    /// # Example
24907    /// ```ignore,no_run
24908    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24909    /// let x = SetNodePoolManagementRequest::new().set_cluster_id("example");
24910    /// ```
24911    #[deprecated]
24912    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24913        self.cluster_id = v.into();
24914        self
24915    }
24916
24917    /// Sets the value of [node_pool_id][crate::model::SetNodePoolManagementRequest::node_pool_id].
24918    ///
24919    /// # Example
24920    /// ```ignore,no_run
24921    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24922    /// let x = SetNodePoolManagementRequest::new().set_node_pool_id("example");
24923    /// ```
24924    #[deprecated]
24925    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24926        self.node_pool_id = v.into();
24927        self
24928    }
24929
24930    /// Sets the value of [management][crate::model::SetNodePoolManagementRequest::management].
24931    ///
24932    /// # Example
24933    /// ```ignore,no_run
24934    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24935    /// use google_cloud_container_v1::model::NodeManagement;
24936    /// let x = SetNodePoolManagementRequest::new().set_management(NodeManagement::default()/* use setters */);
24937    /// ```
24938    pub fn set_management<T>(mut self, v: T) -> Self
24939    where
24940        T: std::convert::Into<crate::model::NodeManagement>,
24941    {
24942        self.management = std::option::Option::Some(v.into());
24943        self
24944    }
24945
24946    /// Sets or clears the value of [management][crate::model::SetNodePoolManagementRequest::management].
24947    ///
24948    /// # Example
24949    /// ```ignore,no_run
24950    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24951    /// use google_cloud_container_v1::model::NodeManagement;
24952    /// let x = SetNodePoolManagementRequest::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
24953    /// let x = SetNodePoolManagementRequest::new().set_or_clear_management(None::<NodeManagement>);
24954    /// ```
24955    pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
24956    where
24957        T: std::convert::Into<crate::model::NodeManagement>,
24958    {
24959        self.management = v.map(|x| x.into());
24960        self
24961    }
24962
24963    /// Sets the value of [name][crate::model::SetNodePoolManagementRequest::name].
24964    ///
24965    /// # Example
24966    /// ```ignore,no_run
24967    /// # use google_cloud_container_v1::model::SetNodePoolManagementRequest;
24968    /// let x = SetNodePoolManagementRequest::new().set_name("example");
24969    /// ```
24970    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24971        self.name = v.into();
24972        self
24973    }
24974}
24975
24976impl wkt::message::Message for SetNodePoolManagementRequest {
24977    fn typename() -> &'static str {
24978        "type.googleapis.com/google.container.v1.SetNodePoolManagementRequest"
24979    }
24980}
24981
24982/// SetNodePoolSizeRequest sets the size of a node pool.
24983#[derive(Clone, Default, PartialEq)]
24984#[non_exhaustive]
24985pub struct SetNodePoolSizeRequest {
24986    /// Deprecated. The Google Developers Console [project ID or project
24987    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
24988    /// This field has been deprecated and replaced by the name field.
24989    #[deprecated]
24990    pub project_id: std::string::String,
24991
24992    /// Deprecated. The name of the Google Compute Engine
24993    /// [zone](https://cloud.google.com/compute/docs/zones#available)
24994    /// in which the cluster resides. This field has been deprecated and replaced
24995    /// by the name field.
24996    #[deprecated]
24997    pub zone: std::string::String,
24998
24999    /// Deprecated. The name of the cluster to update.
25000    /// This field has been deprecated and replaced by the name field.
25001    #[deprecated]
25002    pub cluster_id: std::string::String,
25003
25004    /// Deprecated. The name of the node pool to update.
25005    /// This field has been deprecated and replaced by the name field.
25006    #[deprecated]
25007    pub node_pool_id: std::string::String,
25008
25009    /// Required. The desired node count for the pool.
25010    pub node_count: i32,
25011
25012    /// The name (project, location, cluster, node pool id) of the node pool to set
25013    /// size.
25014    /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
25015    pub name: std::string::String,
25016
25017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25018}
25019
25020impl SetNodePoolSizeRequest {
25021    pub fn new() -> Self {
25022        std::default::Default::default()
25023    }
25024
25025    /// Sets the value of [project_id][crate::model::SetNodePoolSizeRequest::project_id].
25026    ///
25027    /// # Example
25028    /// ```ignore,no_run
25029    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25030    /// let x = SetNodePoolSizeRequest::new().set_project_id("example");
25031    /// ```
25032    #[deprecated]
25033    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25034        self.project_id = v.into();
25035        self
25036    }
25037
25038    /// Sets the value of [zone][crate::model::SetNodePoolSizeRequest::zone].
25039    ///
25040    /// # Example
25041    /// ```ignore,no_run
25042    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25043    /// let x = SetNodePoolSizeRequest::new().set_zone("example");
25044    /// ```
25045    #[deprecated]
25046    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25047        self.zone = v.into();
25048        self
25049    }
25050
25051    /// Sets the value of [cluster_id][crate::model::SetNodePoolSizeRequest::cluster_id].
25052    ///
25053    /// # Example
25054    /// ```ignore,no_run
25055    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25056    /// let x = SetNodePoolSizeRequest::new().set_cluster_id("example");
25057    /// ```
25058    #[deprecated]
25059    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25060        self.cluster_id = v.into();
25061        self
25062    }
25063
25064    /// Sets the value of [node_pool_id][crate::model::SetNodePoolSizeRequest::node_pool_id].
25065    ///
25066    /// # Example
25067    /// ```ignore,no_run
25068    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25069    /// let x = SetNodePoolSizeRequest::new().set_node_pool_id("example");
25070    /// ```
25071    #[deprecated]
25072    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25073        self.node_pool_id = v.into();
25074        self
25075    }
25076
25077    /// Sets the value of [node_count][crate::model::SetNodePoolSizeRequest::node_count].
25078    ///
25079    /// # Example
25080    /// ```ignore,no_run
25081    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25082    /// let x = SetNodePoolSizeRequest::new().set_node_count(42);
25083    /// ```
25084    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25085        self.node_count = v.into();
25086        self
25087    }
25088
25089    /// Sets the value of [name][crate::model::SetNodePoolSizeRequest::name].
25090    ///
25091    /// # Example
25092    /// ```ignore,no_run
25093    /// # use google_cloud_container_v1::model::SetNodePoolSizeRequest;
25094    /// let x = SetNodePoolSizeRequest::new().set_name("example");
25095    /// ```
25096    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25097        self.name = v.into();
25098        self
25099    }
25100}
25101
25102impl wkt::message::Message for SetNodePoolSizeRequest {
25103    fn typename() -> &'static str {
25104        "type.googleapis.com/google.container.v1.SetNodePoolSizeRequest"
25105    }
25106}
25107
25108/// CompleteNodePoolUpgradeRequest sets the name of target node pool to complete
25109/// upgrade.
25110#[derive(Clone, Default, PartialEq)]
25111#[non_exhaustive]
25112pub struct CompleteNodePoolUpgradeRequest {
25113    /// The name (project, location, cluster, node pool id) of the node pool to
25114    /// complete upgrade.
25115    /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
25116    pub name: std::string::String,
25117
25118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25119}
25120
25121impl CompleteNodePoolUpgradeRequest {
25122    pub fn new() -> Self {
25123        std::default::Default::default()
25124    }
25125
25126    /// Sets the value of [name][crate::model::CompleteNodePoolUpgradeRequest::name].
25127    ///
25128    /// # Example
25129    /// ```ignore,no_run
25130    /// # use google_cloud_container_v1::model::CompleteNodePoolUpgradeRequest;
25131    /// let x = CompleteNodePoolUpgradeRequest::new().set_name("example");
25132    /// ```
25133    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25134        self.name = v.into();
25135        self
25136    }
25137}
25138
25139impl wkt::message::Message for CompleteNodePoolUpgradeRequest {
25140    fn typename() -> &'static str {
25141        "type.googleapis.com/google.container.v1.CompleteNodePoolUpgradeRequest"
25142    }
25143}
25144
25145/// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed
25146/// NodePool upgrade. This will be an no-op if the last upgrade successfully
25147/// completed.
25148#[derive(Clone, Default, PartialEq)]
25149#[non_exhaustive]
25150pub struct RollbackNodePoolUpgradeRequest {
25151    /// Deprecated. The Google Developers Console [project ID or project
25152    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
25153    /// This field has been deprecated and replaced by the name field.
25154    #[deprecated]
25155    pub project_id: std::string::String,
25156
25157    /// Deprecated. The name of the Google Compute Engine
25158    /// [zone](https://cloud.google.com/compute/docs/zones#available)
25159    /// in which the cluster resides. This field has been deprecated and replaced
25160    /// by the name field.
25161    #[deprecated]
25162    pub zone: std::string::String,
25163
25164    /// Deprecated. The name of the cluster to rollback.
25165    /// This field has been deprecated and replaced by the name field.
25166    #[deprecated]
25167    pub cluster_id: std::string::String,
25168
25169    /// Deprecated. The name of the node pool to rollback.
25170    /// This field has been deprecated and replaced by the name field.
25171    #[deprecated]
25172    pub node_pool_id: std::string::String,
25173
25174    /// The name (project, location, cluster, node pool id) of the node poll to
25175    /// rollback upgrade.
25176    /// Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.
25177    pub name: std::string::String,
25178
25179    /// Option for rollback to ignore the PodDisruptionBudget.
25180    /// Default value is false.
25181    pub respect_pdb: bool,
25182
25183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25184}
25185
25186impl RollbackNodePoolUpgradeRequest {
25187    pub fn new() -> Self {
25188        std::default::Default::default()
25189    }
25190
25191    /// Sets the value of [project_id][crate::model::RollbackNodePoolUpgradeRequest::project_id].
25192    ///
25193    /// # Example
25194    /// ```ignore,no_run
25195    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25196    /// let x = RollbackNodePoolUpgradeRequest::new().set_project_id("example");
25197    /// ```
25198    #[deprecated]
25199    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25200        self.project_id = v.into();
25201        self
25202    }
25203
25204    /// Sets the value of [zone][crate::model::RollbackNodePoolUpgradeRequest::zone].
25205    ///
25206    /// # Example
25207    /// ```ignore,no_run
25208    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25209    /// let x = RollbackNodePoolUpgradeRequest::new().set_zone("example");
25210    /// ```
25211    #[deprecated]
25212    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25213        self.zone = v.into();
25214        self
25215    }
25216
25217    /// Sets the value of [cluster_id][crate::model::RollbackNodePoolUpgradeRequest::cluster_id].
25218    ///
25219    /// # Example
25220    /// ```ignore,no_run
25221    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25222    /// let x = RollbackNodePoolUpgradeRequest::new().set_cluster_id("example");
25223    /// ```
25224    #[deprecated]
25225    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25226        self.cluster_id = v.into();
25227        self
25228    }
25229
25230    /// Sets the value of [node_pool_id][crate::model::RollbackNodePoolUpgradeRequest::node_pool_id].
25231    ///
25232    /// # Example
25233    /// ```ignore,no_run
25234    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25235    /// let x = RollbackNodePoolUpgradeRequest::new().set_node_pool_id("example");
25236    /// ```
25237    #[deprecated]
25238    pub fn set_node_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25239        self.node_pool_id = v.into();
25240        self
25241    }
25242
25243    /// Sets the value of [name][crate::model::RollbackNodePoolUpgradeRequest::name].
25244    ///
25245    /// # Example
25246    /// ```ignore,no_run
25247    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25248    /// let x = RollbackNodePoolUpgradeRequest::new().set_name("example");
25249    /// ```
25250    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25251        self.name = v.into();
25252        self
25253    }
25254
25255    /// Sets the value of [respect_pdb][crate::model::RollbackNodePoolUpgradeRequest::respect_pdb].
25256    ///
25257    /// # Example
25258    /// ```ignore,no_run
25259    /// # use google_cloud_container_v1::model::RollbackNodePoolUpgradeRequest;
25260    /// let x = RollbackNodePoolUpgradeRequest::new().set_respect_pdb(true);
25261    /// ```
25262    pub fn set_respect_pdb<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25263        self.respect_pdb = v.into();
25264        self
25265    }
25266}
25267
25268impl wkt::message::Message for RollbackNodePoolUpgradeRequest {
25269    fn typename() -> &'static str {
25270        "type.googleapis.com/google.container.v1.RollbackNodePoolUpgradeRequest"
25271    }
25272}
25273
25274/// ListNodePoolsResponse is the result of ListNodePoolsRequest.
25275#[derive(Clone, Default, PartialEq)]
25276#[non_exhaustive]
25277pub struct ListNodePoolsResponse {
25278    /// A list of node pools for a cluster.
25279    pub node_pools: std::vec::Vec<crate::model::NodePool>,
25280
25281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25282}
25283
25284impl ListNodePoolsResponse {
25285    pub fn new() -> Self {
25286        std::default::Default::default()
25287    }
25288
25289    /// Sets the value of [node_pools][crate::model::ListNodePoolsResponse::node_pools].
25290    ///
25291    /// # Example
25292    /// ```ignore,no_run
25293    /// # use google_cloud_container_v1::model::ListNodePoolsResponse;
25294    /// use google_cloud_container_v1::model::NodePool;
25295    /// let x = ListNodePoolsResponse::new()
25296    ///     .set_node_pools([
25297    ///         NodePool::default()/* use setters */,
25298    ///         NodePool::default()/* use (different) setters */,
25299    ///     ]);
25300    /// ```
25301    pub fn set_node_pools<T, V>(mut self, v: T) -> Self
25302    where
25303        T: std::iter::IntoIterator<Item = V>,
25304        V: std::convert::Into<crate::model::NodePool>,
25305    {
25306        use std::iter::Iterator;
25307        self.node_pools = v.into_iter().map(|i| i.into()).collect();
25308        self
25309    }
25310}
25311
25312impl wkt::message::Message for ListNodePoolsResponse {
25313    fn typename() -> &'static str {
25314        "type.googleapis.com/google.container.v1.ListNodePoolsResponse"
25315    }
25316}
25317
25318/// ClusterAutoscaling contains global, per-cluster information
25319/// required by Cluster Autoscaler to automatically adjust
25320/// the size of the cluster and create/delete
25321/// node pools based on the current needs.
25322#[derive(Clone, Default, PartialEq)]
25323#[non_exhaustive]
25324pub struct ClusterAutoscaling {
25325    /// Enables automatic node pool creation and deletion.
25326    pub enable_node_autoprovisioning: bool,
25327
25328    /// Contains global constraints regarding minimum and maximum
25329    /// amount of resources in the cluster.
25330    pub resource_limits: std::vec::Vec<crate::model::ResourceLimit>,
25331
25332    /// Defines autoscaling behaviour.
25333    pub autoscaling_profile: crate::model::cluster_autoscaling::AutoscalingProfile,
25334
25335    /// AutoprovisioningNodePoolDefaults contains defaults for a node pool
25336    /// created by NAP.
25337    pub autoprovisioning_node_pool_defaults:
25338        std::option::Option<crate::model::AutoprovisioningNodePoolDefaults>,
25339
25340    /// The list of Google Compute Engine
25341    /// [zones](https://cloud.google.com/compute/docs/zones#available)
25342    /// in which the NodePool's nodes can be created by NAP.
25343    pub autoprovisioning_locations: std::vec::Vec<std::string::String>,
25344
25345    /// Default compute class is a configuration for default compute class.
25346    pub default_compute_class_config: std::option::Option<crate::model::DefaultComputeClassConfig>,
25347
25348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25349}
25350
25351impl ClusterAutoscaling {
25352    pub fn new() -> Self {
25353        std::default::Default::default()
25354    }
25355
25356    /// Sets the value of [enable_node_autoprovisioning][crate::model::ClusterAutoscaling::enable_node_autoprovisioning].
25357    ///
25358    /// # Example
25359    /// ```ignore,no_run
25360    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25361    /// let x = ClusterAutoscaling::new().set_enable_node_autoprovisioning(true);
25362    /// ```
25363    pub fn set_enable_node_autoprovisioning<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25364        self.enable_node_autoprovisioning = v.into();
25365        self
25366    }
25367
25368    /// Sets the value of [resource_limits][crate::model::ClusterAutoscaling::resource_limits].
25369    ///
25370    /// # Example
25371    /// ```ignore,no_run
25372    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25373    /// use google_cloud_container_v1::model::ResourceLimit;
25374    /// let x = ClusterAutoscaling::new()
25375    ///     .set_resource_limits([
25376    ///         ResourceLimit::default()/* use setters */,
25377    ///         ResourceLimit::default()/* use (different) setters */,
25378    ///     ]);
25379    /// ```
25380    pub fn set_resource_limits<T, V>(mut self, v: T) -> Self
25381    where
25382        T: std::iter::IntoIterator<Item = V>,
25383        V: std::convert::Into<crate::model::ResourceLimit>,
25384    {
25385        use std::iter::Iterator;
25386        self.resource_limits = v.into_iter().map(|i| i.into()).collect();
25387        self
25388    }
25389
25390    /// Sets the value of [autoscaling_profile][crate::model::ClusterAutoscaling::autoscaling_profile].
25391    ///
25392    /// # Example
25393    /// ```ignore,no_run
25394    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25395    /// use google_cloud_container_v1::model::cluster_autoscaling::AutoscalingProfile;
25396    /// let x0 = ClusterAutoscaling::new().set_autoscaling_profile(AutoscalingProfile::OptimizeUtilization);
25397    /// let x1 = ClusterAutoscaling::new().set_autoscaling_profile(AutoscalingProfile::Balanced);
25398    /// ```
25399    pub fn set_autoscaling_profile<
25400        T: std::convert::Into<crate::model::cluster_autoscaling::AutoscalingProfile>,
25401    >(
25402        mut self,
25403        v: T,
25404    ) -> Self {
25405        self.autoscaling_profile = v.into();
25406        self
25407    }
25408
25409    /// Sets the value of [autoprovisioning_node_pool_defaults][crate::model::ClusterAutoscaling::autoprovisioning_node_pool_defaults].
25410    ///
25411    /// # Example
25412    /// ```ignore,no_run
25413    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25414    /// use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25415    /// let x = ClusterAutoscaling::new().set_autoprovisioning_node_pool_defaults(AutoprovisioningNodePoolDefaults::default()/* use setters */);
25416    /// ```
25417    pub fn set_autoprovisioning_node_pool_defaults<T>(mut self, v: T) -> Self
25418    where
25419        T: std::convert::Into<crate::model::AutoprovisioningNodePoolDefaults>,
25420    {
25421        self.autoprovisioning_node_pool_defaults = std::option::Option::Some(v.into());
25422        self
25423    }
25424
25425    /// Sets or clears the value of [autoprovisioning_node_pool_defaults][crate::model::ClusterAutoscaling::autoprovisioning_node_pool_defaults].
25426    ///
25427    /// # Example
25428    /// ```ignore,no_run
25429    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25430    /// use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25431    /// let x = ClusterAutoscaling::new().set_or_clear_autoprovisioning_node_pool_defaults(Some(AutoprovisioningNodePoolDefaults::default()/* use setters */));
25432    /// let x = ClusterAutoscaling::new().set_or_clear_autoprovisioning_node_pool_defaults(None::<AutoprovisioningNodePoolDefaults>);
25433    /// ```
25434    pub fn set_or_clear_autoprovisioning_node_pool_defaults<T>(
25435        mut self,
25436        v: std::option::Option<T>,
25437    ) -> Self
25438    where
25439        T: std::convert::Into<crate::model::AutoprovisioningNodePoolDefaults>,
25440    {
25441        self.autoprovisioning_node_pool_defaults = v.map(|x| x.into());
25442        self
25443    }
25444
25445    /// Sets the value of [autoprovisioning_locations][crate::model::ClusterAutoscaling::autoprovisioning_locations].
25446    ///
25447    /// # Example
25448    /// ```ignore,no_run
25449    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25450    /// let x = ClusterAutoscaling::new().set_autoprovisioning_locations(["a", "b", "c"]);
25451    /// ```
25452    pub fn set_autoprovisioning_locations<T, V>(mut self, v: T) -> Self
25453    where
25454        T: std::iter::IntoIterator<Item = V>,
25455        V: std::convert::Into<std::string::String>,
25456    {
25457        use std::iter::Iterator;
25458        self.autoprovisioning_locations = v.into_iter().map(|i| i.into()).collect();
25459        self
25460    }
25461
25462    /// Sets the value of [default_compute_class_config][crate::model::ClusterAutoscaling::default_compute_class_config].
25463    ///
25464    /// # Example
25465    /// ```ignore,no_run
25466    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25467    /// use google_cloud_container_v1::model::DefaultComputeClassConfig;
25468    /// let x = ClusterAutoscaling::new().set_default_compute_class_config(DefaultComputeClassConfig::default()/* use setters */);
25469    /// ```
25470    pub fn set_default_compute_class_config<T>(mut self, v: T) -> Self
25471    where
25472        T: std::convert::Into<crate::model::DefaultComputeClassConfig>,
25473    {
25474        self.default_compute_class_config = std::option::Option::Some(v.into());
25475        self
25476    }
25477
25478    /// Sets or clears the value of [default_compute_class_config][crate::model::ClusterAutoscaling::default_compute_class_config].
25479    ///
25480    /// # Example
25481    /// ```ignore,no_run
25482    /// # use google_cloud_container_v1::model::ClusterAutoscaling;
25483    /// use google_cloud_container_v1::model::DefaultComputeClassConfig;
25484    /// let x = ClusterAutoscaling::new().set_or_clear_default_compute_class_config(Some(DefaultComputeClassConfig::default()/* use setters */));
25485    /// let x = ClusterAutoscaling::new().set_or_clear_default_compute_class_config(None::<DefaultComputeClassConfig>);
25486    /// ```
25487    pub fn set_or_clear_default_compute_class_config<T>(mut self, v: std::option::Option<T>) -> Self
25488    where
25489        T: std::convert::Into<crate::model::DefaultComputeClassConfig>,
25490    {
25491        self.default_compute_class_config = v.map(|x| x.into());
25492        self
25493    }
25494}
25495
25496impl wkt::message::Message for ClusterAutoscaling {
25497    fn typename() -> &'static str {
25498        "type.googleapis.com/google.container.v1.ClusterAutoscaling"
25499    }
25500}
25501
25502/// Defines additional types related to [ClusterAutoscaling].
25503pub mod cluster_autoscaling {
25504    #[allow(unused_imports)]
25505    use super::*;
25506
25507    /// Defines possible options for autoscaling_profile field.
25508    ///
25509    /// # Working with unknown values
25510    ///
25511    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25512    /// additional enum variants at any time. Adding new variants is not considered
25513    /// a breaking change. Applications should write their code in anticipation of:
25514    ///
25515    /// - New values appearing in future releases of the client library, **and**
25516    /// - New values received dynamically, without application changes.
25517    ///
25518    /// Please consult the [Working with enums] section in the user guide for some
25519    /// guidelines.
25520    ///
25521    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25522    #[derive(Clone, Debug, PartialEq)]
25523    #[non_exhaustive]
25524    pub enum AutoscalingProfile {
25525        /// No change to autoscaling configuration.
25526        ProfileUnspecified,
25527        /// Prioritize optimizing utilization of resources.
25528        OptimizeUtilization,
25529        /// Use default (balanced) autoscaling configuration.
25530        Balanced,
25531        /// If set, the enum was initialized with an unknown value.
25532        ///
25533        /// Applications can examine the value using [AutoscalingProfile::value] or
25534        /// [AutoscalingProfile::name].
25535        UnknownValue(autoscaling_profile::UnknownValue),
25536    }
25537
25538    #[doc(hidden)]
25539    pub mod autoscaling_profile {
25540        #[allow(unused_imports)]
25541        use super::*;
25542        #[derive(Clone, Debug, PartialEq)]
25543        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25544    }
25545
25546    impl AutoscalingProfile {
25547        /// Gets the enum value.
25548        ///
25549        /// Returns `None` if the enum contains an unknown value deserialized from
25550        /// the string representation of enums.
25551        pub fn value(&self) -> std::option::Option<i32> {
25552            match self {
25553                Self::ProfileUnspecified => std::option::Option::Some(0),
25554                Self::OptimizeUtilization => std::option::Option::Some(1),
25555                Self::Balanced => std::option::Option::Some(2),
25556                Self::UnknownValue(u) => u.0.value(),
25557            }
25558        }
25559
25560        /// Gets the enum value as a string.
25561        ///
25562        /// Returns `None` if the enum contains an unknown value deserialized from
25563        /// the integer representation of enums.
25564        pub fn name(&self) -> std::option::Option<&str> {
25565            match self {
25566                Self::ProfileUnspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
25567                Self::OptimizeUtilization => std::option::Option::Some("OPTIMIZE_UTILIZATION"),
25568                Self::Balanced => std::option::Option::Some("BALANCED"),
25569                Self::UnknownValue(u) => u.0.name(),
25570            }
25571        }
25572    }
25573
25574    impl std::default::Default for AutoscalingProfile {
25575        fn default() -> Self {
25576            use std::convert::From;
25577            Self::from(0)
25578        }
25579    }
25580
25581    impl std::fmt::Display for AutoscalingProfile {
25582        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25583            wkt::internal::display_enum(f, self.name(), self.value())
25584        }
25585    }
25586
25587    impl std::convert::From<i32> for AutoscalingProfile {
25588        fn from(value: i32) -> Self {
25589            match value {
25590                0 => Self::ProfileUnspecified,
25591                1 => Self::OptimizeUtilization,
25592                2 => Self::Balanced,
25593                _ => Self::UnknownValue(autoscaling_profile::UnknownValue(
25594                    wkt::internal::UnknownEnumValue::Integer(value),
25595                )),
25596            }
25597        }
25598    }
25599
25600    impl std::convert::From<&str> for AutoscalingProfile {
25601        fn from(value: &str) -> Self {
25602            use std::string::ToString;
25603            match value {
25604                "PROFILE_UNSPECIFIED" => Self::ProfileUnspecified,
25605                "OPTIMIZE_UTILIZATION" => Self::OptimizeUtilization,
25606                "BALANCED" => Self::Balanced,
25607                _ => Self::UnknownValue(autoscaling_profile::UnknownValue(
25608                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25609                )),
25610            }
25611        }
25612    }
25613
25614    impl serde::ser::Serialize for AutoscalingProfile {
25615        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25616        where
25617            S: serde::Serializer,
25618        {
25619            match self {
25620                Self::ProfileUnspecified => serializer.serialize_i32(0),
25621                Self::OptimizeUtilization => serializer.serialize_i32(1),
25622                Self::Balanced => serializer.serialize_i32(2),
25623                Self::UnknownValue(u) => u.0.serialize(serializer),
25624            }
25625        }
25626    }
25627
25628    impl<'de> serde::de::Deserialize<'de> for AutoscalingProfile {
25629        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25630        where
25631            D: serde::Deserializer<'de>,
25632        {
25633            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoscalingProfile>::new(
25634                ".google.container.v1.ClusterAutoscaling.AutoscalingProfile",
25635            ))
25636        }
25637    }
25638}
25639
25640/// AutoprovisioningNodePoolDefaults contains defaults for a node pool created
25641/// by NAP.
25642#[derive(Clone, Default, PartialEq)]
25643#[non_exhaustive]
25644pub struct AutoprovisioningNodePoolDefaults {
25645    /// Scopes that are used by NAP when creating node pools.
25646    pub oauth_scopes: std::vec::Vec<std::string::String>,
25647
25648    /// The Google Cloud Platform Service Account to be used by the node VMs.
25649    pub service_account: std::string::String,
25650
25651    /// Specifies the upgrade settings for NAP created node pools
25652    pub upgrade_settings: std::option::Option<crate::model::node_pool::UpgradeSettings>,
25653
25654    /// Specifies the node management options for NAP created node-pools.
25655    pub management: std::option::Option<crate::model::NodeManagement>,
25656
25657    /// Deprecated. Minimum CPU platform to be used for NAP created node pools.
25658    /// The instance may be scheduled on the specified or newer CPU platform.
25659    /// Applicable values are the friendly names of CPU platforms, such as
25660    /// minCpuPlatform: Intel Haswell or
25661    /// minCpuPlatform: Intel Sandy Bridge. For more
25662    /// information, read [how to specify min CPU
25663    /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
25664    /// This field is deprecated, min_cpu_platform should be specified using
25665    /// `cloud.google.com/requested-min-cpu-platform` label selector on the pod.
25666    /// To unset the min cpu platform field pass "automatic"
25667    /// as field value.
25668    #[deprecated]
25669    pub min_cpu_platform: std::string::String,
25670
25671    /// Size of the disk attached to each node, specified in GB.
25672    /// The smallest allowed disk size is 10GB.
25673    ///
25674    /// If unspecified, the default disk size is 100GB.
25675    pub disk_size_gb: i32,
25676
25677    /// Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or
25678    /// 'pd-balanced')
25679    ///
25680    /// If unspecified, the default disk type is 'pd-standard'
25681    pub disk_type: std::string::String,
25682
25683    /// Shielded Instance options.
25684    pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
25685
25686    /// The Customer Managed Encryption Key used to encrypt the boot disk attached
25687    /// to each node in the node pool. This should be of the form
25688    /// projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
25689    /// For more information about protecting resources with Cloud KMS Keys please
25690    /// see:
25691    /// <https://cloud.google.com/compute/docs/disks/customer-managed-encryption>
25692    pub boot_disk_kms_key: std::string::String,
25693
25694    /// The image type to use for NAP created node. Please see
25695    /// <https://cloud.google.com/kubernetes-engine/docs/concepts/node-images>
25696    /// for available image types.
25697    pub image_type: std::string::String,
25698
25699    /// DEPRECATED. Use NodePoolAutoConfig.NodeKubeletConfig instead.
25700    pub insecure_kubelet_readonly_port_enabled: std::option::Option<bool>,
25701
25702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25703}
25704
25705impl AutoprovisioningNodePoolDefaults {
25706    pub fn new() -> Self {
25707        std::default::Default::default()
25708    }
25709
25710    /// Sets the value of [oauth_scopes][crate::model::AutoprovisioningNodePoolDefaults::oauth_scopes].
25711    ///
25712    /// # Example
25713    /// ```ignore,no_run
25714    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25715    /// let x = AutoprovisioningNodePoolDefaults::new().set_oauth_scopes(["a", "b", "c"]);
25716    /// ```
25717    pub fn set_oauth_scopes<T, V>(mut self, v: T) -> Self
25718    where
25719        T: std::iter::IntoIterator<Item = V>,
25720        V: std::convert::Into<std::string::String>,
25721    {
25722        use std::iter::Iterator;
25723        self.oauth_scopes = v.into_iter().map(|i| i.into()).collect();
25724        self
25725    }
25726
25727    /// Sets the value of [service_account][crate::model::AutoprovisioningNodePoolDefaults::service_account].
25728    ///
25729    /// # Example
25730    /// ```ignore,no_run
25731    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25732    /// let x = AutoprovisioningNodePoolDefaults::new().set_service_account("example");
25733    /// ```
25734    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25735        self.service_account = v.into();
25736        self
25737    }
25738
25739    /// Sets the value of [upgrade_settings][crate::model::AutoprovisioningNodePoolDefaults::upgrade_settings].
25740    ///
25741    /// # Example
25742    /// ```ignore,no_run
25743    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25744    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
25745    /// let x = AutoprovisioningNodePoolDefaults::new().set_upgrade_settings(UpgradeSettings::default()/* use setters */);
25746    /// ```
25747    pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
25748    where
25749        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
25750    {
25751        self.upgrade_settings = std::option::Option::Some(v.into());
25752        self
25753    }
25754
25755    /// Sets or clears the value of [upgrade_settings][crate::model::AutoprovisioningNodePoolDefaults::upgrade_settings].
25756    ///
25757    /// # Example
25758    /// ```ignore,no_run
25759    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25760    /// use google_cloud_container_v1::model::node_pool::UpgradeSettings;
25761    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_upgrade_settings(Some(UpgradeSettings::default()/* use setters */));
25762    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_upgrade_settings(None::<UpgradeSettings>);
25763    /// ```
25764    pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
25765    where
25766        T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
25767    {
25768        self.upgrade_settings = v.map(|x| x.into());
25769        self
25770    }
25771
25772    /// Sets the value of [management][crate::model::AutoprovisioningNodePoolDefaults::management].
25773    ///
25774    /// # Example
25775    /// ```ignore,no_run
25776    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25777    /// use google_cloud_container_v1::model::NodeManagement;
25778    /// let x = AutoprovisioningNodePoolDefaults::new().set_management(NodeManagement::default()/* use setters */);
25779    /// ```
25780    pub fn set_management<T>(mut self, v: T) -> Self
25781    where
25782        T: std::convert::Into<crate::model::NodeManagement>,
25783    {
25784        self.management = std::option::Option::Some(v.into());
25785        self
25786    }
25787
25788    /// Sets or clears the value of [management][crate::model::AutoprovisioningNodePoolDefaults::management].
25789    ///
25790    /// # Example
25791    /// ```ignore,no_run
25792    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25793    /// use google_cloud_container_v1::model::NodeManagement;
25794    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_management(Some(NodeManagement::default()/* use setters */));
25795    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_management(None::<NodeManagement>);
25796    /// ```
25797    pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
25798    where
25799        T: std::convert::Into<crate::model::NodeManagement>,
25800    {
25801        self.management = v.map(|x| x.into());
25802        self
25803    }
25804
25805    /// Sets the value of [min_cpu_platform][crate::model::AutoprovisioningNodePoolDefaults::min_cpu_platform].
25806    ///
25807    /// # Example
25808    /// ```ignore,no_run
25809    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25810    /// let x = AutoprovisioningNodePoolDefaults::new().set_min_cpu_platform("example");
25811    /// ```
25812    #[deprecated]
25813    pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
25814        mut self,
25815        v: T,
25816    ) -> Self {
25817        self.min_cpu_platform = v.into();
25818        self
25819    }
25820
25821    /// Sets the value of [disk_size_gb][crate::model::AutoprovisioningNodePoolDefaults::disk_size_gb].
25822    ///
25823    /// # Example
25824    /// ```ignore,no_run
25825    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25826    /// let x = AutoprovisioningNodePoolDefaults::new().set_disk_size_gb(42);
25827    /// ```
25828    pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25829        self.disk_size_gb = v.into();
25830        self
25831    }
25832
25833    /// Sets the value of [disk_type][crate::model::AutoprovisioningNodePoolDefaults::disk_type].
25834    ///
25835    /// # Example
25836    /// ```ignore,no_run
25837    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25838    /// let x = AutoprovisioningNodePoolDefaults::new().set_disk_type("example");
25839    /// ```
25840    pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25841        self.disk_type = v.into();
25842        self
25843    }
25844
25845    /// Sets the value of [shielded_instance_config][crate::model::AutoprovisioningNodePoolDefaults::shielded_instance_config].
25846    ///
25847    /// # Example
25848    /// ```ignore,no_run
25849    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25850    /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
25851    /// let x = AutoprovisioningNodePoolDefaults::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
25852    /// ```
25853    pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
25854    where
25855        T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
25856    {
25857        self.shielded_instance_config = std::option::Option::Some(v.into());
25858        self
25859    }
25860
25861    /// Sets or clears the value of [shielded_instance_config][crate::model::AutoprovisioningNodePoolDefaults::shielded_instance_config].
25862    ///
25863    /// # Example
25864    /// ```ignore,no_run
25865    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25866    /// use google_cloud_container_v1::model::ShieldedInstanceConfig;
25867    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
25868    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
25869    /// ```
25870    pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
25871    where
25872        T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
25873    {
25874        self.shielded_instance_config = v.map(|x| x.into());
25875        self
25876    }
25877
25878    /// Sets the value of [boot_disk_kms_key][crate::model::AutoprovisioningNodePoolDefaults::boot_disk_kms_key].
25879    ///
25880    /// # Example
25881    /// ```ignore,no_run
25882    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25883    /// let x = AutoprovisioningNodePoolDefaults::new().set_boot_disk_kms_key("example");
25884    /// ```
25885    pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
25886        mut self,
25887        v: T,
25888    ) -> Self {
25889        self.boot_disk_kms_key = v.into();
25890        self
25891    }
25892
25893    /// Sets the value of [image_type][crate::model::AutoprovisioningNodePoolDefaults::image_type].
25894    ///
25895    /// # Example
25896    /// ```ignore,no_run
25897    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25898    /// let x = AutoprovisioningNodePoolDefaults::new().set_image_type("example");
25899    /// ```
25900    pub fn set_image_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25901        self.image_type = v.into();
25902        self
25903    }
25904
25905    /// Sets the value of [insecure_kubelet_readonly_port_enabled][crate::model::AutoprovisioningNodePoolDefaults::insecure_kubelet_readonly_port_enabled].
25906    ///
25907    /// # Example
25908    /// ```ignore,no_run
25909    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25910    /// let x = AutoprovisioningNodePoolDefaults::new().set_insecure_kubelet_readonly_port_enabled(true);
25911    /// ```
25912    pub fn set_insecure_kubelet_readonly_port_enabled<T>(mut self, v: T) -> Self
25913    where
25914        T: std::convert::Into<bool>,
25915    {
25916        self.insecure_kubelet_readonly_port_enabled = std::option::Option::Some(v.into());
25917        self
25918    }
25919
25920    /// Sets or clears the value of [insecure_kubelet_readonly_port_enabled][crate::model::AutoprovisioningNodePoolDefaults::insecure_kubelet_readonly_port_enabled].
25921    ///
25922    /// # Example
25923    /// ```ignore,no_run
25924    /// # use google_cloud_container_v1::model::AutoprovisioningNodePoolDefaults;
25925    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_insecure_kubelet_readonly_port_enabled(Some(false));
25926    /// let x = AutoprovisioningNodePoolDefaults::new().set_or_clear_insecure_kubelet_readonly_port_enabled(None::<bool>);
25927    /// ```
25928    pub fn set_or_clear_insecure_kubelet_readonly_port_enabled<T>(
25929        mut self,
25930        v: std::option::Option<T>,
25931    ) -> Self
25932    where
25933        T: std::convert::Into<bool>,
25934    {
25935        self.insecure_kubelet_readonly_port_enabled = v.map(|x| x.into());
25936        self
25937    }
25938}
25939
25940impl wkt::message::Message for AutoprovisioningNodePoolDefaults {
25941    fn typename() -> &'static str {
25942        "type.googleapis.com/google.container.v1.AutoprovisioningNodePoolDefaults"
25943    }
25944}
25945
25946/// Contains information about amount of some resource in the cluster.
25947/// For memory, value should be in GB.
25948#[derive(Clone, Default, PartialEq)]
25949#[non_exhaustive]
25950pub struct ResourceLimit {
25951    /// Resource name "cpu", "memory" or gpu-specific string.
25952    pub resource_type: std::string::String,
25953
25954    /// Minimum amount of the resource in the cluster.
25955    pub minimum: i64,
25956
25957    /// Maximum amount of the resource in the cluster.
25958    pub maximum: i64,
25959
25960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25961}
25962
25963impl ResourceLimit {
25964    pub fn new() -> Self {
25965        std::default::Default::default()
25966    }
25967
25968    /// Sets the value of [resource_type][crate::model::ResourceLimit::resource_type].
25969    ///
25970    /// # Example
25971    /// ```ignore,no_run
25972    /// # use google_cloud_container_v1::model::ResourceLimit;
25973    /// let x = ResourceLimit::new().set_resource_type("example");
25974    /// ```
25975    pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25976        self.resource_type = v.into();
25977        self
25978    }
25979
25980    /// Sets the value of [minimum][crate::model::ResourceLimit::minimum].
25981    ///
25982    /// # Example
25983    /// ```ignore,no_run
25984    /// # use google_cloud_container_v1::model::ResourceLimit;
25985    /// let x = ResourceLimit::new().set_minimum(42);
25986    /// ```
25987    pub fn set_minimum<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
25988        self.minimum = v.into();
25989        self
25990    }
25991
25992    /// Sets the value of [maximum][crate::model::ResourceLimit::maximum].
25993    ///
25994    /// # Example
25995    /// ```ignore,no_run
25996    /// # use google_cloud_container_v1::model::ResourceLimit;
25997    /// let x = ResourceLimit::new().set_maximum(42);
25998    /// ```
25999    pub fn set_maximum<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
26000        self.maximum = v.into();
26001        self
26002    }
26003}
26004
26005impl wkt::message::Message for ResourceLimit {
26006    fn typename() -> &'static str {
26007        "type.googleapis.com/google.container.v1.ResourceLimit"
26008    }
26009}
26010
26011/// DefaultComputeClassConfig defines default compute class
26012/// configuration.
26013#[derive(Clone, Default, PartialEq)]
26014#[non_exhaustive]
26015pub struct DefaultComputeClassConfig {
26016    /// Enables default compute class.
26017    pub enabled: bool,
26018
26019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26020}
26021
26022impl DefaultComputeClassConfig {
26023    pub fn new() -> Self {
26024        std::default::Default::default()
26025    }
26026
26027    /// Sets the value of [enabled][crate::model::DefaultComputeClassConfig::enabled].
26028    ///
26029    /// # Example
26030    /// ```ignore,no_run
26031    /// # use google_cloud_container_v1::model::DefaultComputeClassConfig;
26032    /// let x = DefaultComputeClassConfig::new().set_enabled(true);
26033    /// ```
26034    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26035        self.enabled = v.into();
26036        self
26037    }
26038}
26039
26040impl wkt::message::Message for DefaultComputeClassConfig {
26041    fn typename() -> &'static str {
26042        "type.googleapis.com/google.container.v1.DefaultComputeClassConfig"
26043    }
26044}
26045
26046/// NodePoolAutoscaling contains information required by cluster autoscaler to
26047/// adjust the size of the node pool to the current cluster usage.
26048#[derive(Clone, Default, PartialEq)]
26049#[non_exhaustive]
26050pub struct NodePoolAutoscaling {
26051    /// Is autoscaling enabled for this node pool.
26052    pub enabled: bool,
26053
26054    /// Minimum number of nodes for one location in the node pool. Must be greater
26055    /// than or equal to 0 and less than or equal to max_node_count.
26056    pub min_node_count: i32,
26057
26058    /// Maximum number of nodes for one location in the node pool. Must be >=
26059    /// min_node_count. There has to be enough quota to scale up the cluster.
26060    pub max_node_count: i32,
26061
26062    /// Can this node pool be deleted automatically.
26063    pub autoprovisioned: bool,
26064
26065    /// Location policy used when scaling up a nodepool.
26066    pub location_policy: crate::model::node_pool_autoscaling::LocationPolicy,
26067
26068    /// Minimum number of nodes in the node pool. Must be greater than or equal
26069    /// to 0 and less than or equal to total_max_node_count.
26070    /// The total_*_node_count fields are mutually exclusive with the *_node_count
26071    /// fields.
26072    pub total_min_node_count: i32,
26073
26074    /// Maximum number of nodes in the node pool. Must be greater than or equal to
26075    /// total_min_node_count. There has to be enough quota to scale up the cluster.
26076    /// The total_*_node_count fields are mutually exclusive with the *_node_count
26077    /// fields.
26078    pub total_max_node_count: i32,
26079
26080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26081}
26082
26083impl NodePoolAutoscaling {
26084    pub fn new() -> Self {
26085        std::default::Default::default()
26086    }
26087
26088    /// Sets the value of [enabled][crate::model::NodePoolAutoscaling::enabled].
26089    ///
26090    /// # Example
26091    /// ```ignore,no_run
26092    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26093    /// let x = NodePoolAutoscaling::new().set_enabled(true);
26094    /// ```
26095    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26096        self.enabled = v.into();
26097        self
26098    }
26099
26100    /// Sets the value of [min_node_count][crate::model::NodePoolAutoscaling::min_node_count].
26101    ///
26102    /// # Example
26103    /// ```ignore,no_run
26104    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26105    /// let x = NodePoolAutoscaling::new().set_min_node_count(42);
26106    /// ```
26107    pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26108        self.min_node_count = v.into();
26109        self
26110    }
26111
26112    /// Sets the value of [max_node_count][crate::model::NodePoolAutoscaling::max_node_count].
26113    ///
26114    /// # Example
26115    /// ```ignore,no_run
26116    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26117    /// let x = NodePoolAutoscaling::new().set_max_node_count(42);
26118    /// ```
26119    pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26120        self.max_node_count = v.into();
26121        self
26122    }
26123
26124    /// Sets the value of [autoprovisioned][crate::model::NodePoolAutoscaling::autoprovisioned].
26125    ///
26126    /// # Example
26127    /// ```ignore,no_run
26128    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26129    /// let x = NodePoolAutoscaling::new().set_autoprovisioned(true);
26130    /// ```
26131    pub fn set_autoprovisioned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26132        self.autoprovisioned = v.into();
26133        self
26134    }
26135
26136    /// Sets the value of [location_policy][crate::model::NodePoolAutoscaling::location_policy].
26137    ///
26138    /// # Example
26139    /// ```ignore,no_run
26140    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26141    /// use google_cloud_container_v1::model::node_pool_autoscaling::LocationPolicy;
26142    /// let x0 = NodePoolAutoscaling::new().set_location_policy(LocationPolicy::Balanced);
26143    /// let x1 = NodePoolAutoscaling::new().set_location_policy(LocationPolicy::Any);
26144    /// ```
26145    pub fn set_location_policy<
26146        T: std::convert::Into<crate::model::node_pool_autoscaling::LocationPolicy>,
26147    >(
26148        mut self,
26149        v: T,
26150    ) -> Self {
26151        self.location_policy = v.into();
26152        self
26153    }
26154
26155    /// Sets the value of [total_min_node_count][crate::model::NodePoolAutoscaling::total_min_node_count].
26156    ///
26157    /// # Example
26158    /// ```ignore,no_run
26159    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26160    /// let x = NodePoolAutoscaling::new().set_total_min_node_count(42);
26161    /// ```
26162    pub fn set_total_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26163        self.total_min_node_count = v.into();
26164        self
26165    }
26166
26167    /// Sets the value of [total_max_node_count][crate::model::NodePoolAutoscaling::total_max_node_count].
26168    ///
26169    /// # Example
26170    /// ```ignore,no_run
26171    /// # use google_cloud_container_v1::model::NodePoolAutoscaling;
26172    /// let x = NodePoolAutoscaling::new().set_total_max_node_count(42);
26173    /// ```
26174    pub fn set_total_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26175        self.total_max_node_count = v.into();
26176        self
26177    }
26178}
26179
26180impl wkt::message::Message for NodePoolAutoscaling {
26181    fn typename() -> &'static str {
26182        "type.googleapis.com/google.container.v1.NodePoolAutoscaling"
26183    }
26184}
26185
26186/// Defines additional types related to [NodePoolAutoscaling].
26187pub mod node_pool_autoscaling {
26188    #[allow(unused_imports)]
26189    use super::*;
26190
26191    /// Location policy specifies how zones are picked when scaling up the
26192    /// nodepool.
26193    ///
26194    /// # Working with unknown values
26195    ///
26196    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26197    /// additional enum variants at any time. Adding new variants is not considered
26198    /// a breaking change. Applications should write their code in anticipation of:
26199    ///
26200    /// - New values appearing in future releases of the client library, **and**
26201    /// - New values received dynamically, without application changes.
26202    ///
26203    /// Please consult the [Working with enums] section in the user guide for some
26204    /// guidelines.
26205    ///
26206    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
26207    #[derive(Clone, Debug, PartialEq)]
26208    #[non_exhaustive]
26209    pub enum LocationPolicy {
26210        /// Not set.
26211        Unspecified,
26212        /// BALANCED is a best effort policy that aims to balance the sizes of
26213        /// different zones.
26214        Balanced,
26215        /// ANY policy picks zones that have the highest capacity available.
26216        Any,
26217        /// If set, the enum was initialized with an unknown value.
26218        ///
26219        /// Applications can examine the value using [LocationPolicy::value] or
26220        /// [LocationPolicy::name].
26221        UnknownValue(location_policy::UnknownValue),
26222    }
26223
26224    #[doc(hidden)]
26225    pub mod location_policy {
26226        #[allow(unused_imports)]
26227        use super::*;
26228        #[derive(Clone, Debug, PartialEq)]
26229        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26230    }
26231
26232    impl LocationPolicy {
26233        /// Gets the enum value.
26234        ///
26235        /// Returns `None` if the enum contains an unknown value deserialized from
26236        /// the string representation of enums.
26237        pub fn value(&self) -> std::option::Option<i32> {
26238            match self {
26239                Self::Unspecified => std::option::Option::Some(0),
26240                Self::Balanced => std::option::Option::Some(1),
26241                Self::Any => std::option::Option::Some(2),
26242                Self::UnknownValue(u) => u.0.value(),
26243            }
26244        }
26245
26246        /// Gets the enum value as a string.
26247        ///
26248        /// Returns `None` if the enum contains an unknown value deserialized from
26249        /// the integer representation of enums.
26250        pub fn name(&self) -> std::option::Option<&str> {
26251            match self {
26252                Self::Unspecified => std::option::Option::Some("LOCATION_POLICY_UNSPECIFIED"),
26253                Self::Balanced => std::option::Option::Some("BALANCED"),
26254                Self::Any => std::option::Option::Some("ANY"),
26255                Self::UnknownValue(u) => u.0.name(),
26256            }
26257        }
26258    }
26259
26260    impl std::default::Default for LocationPolicy {
26261        fn default() -> Self {
26262            use std::convert::From;
26263            Self::from(0)
26264        }
26265    }
26266
26267    impl std::fmt::Display for LocationPolicy {
26268        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26269            wkt::internal::display_enum(f, self.name(), self.value())
26270        }
26271    }
26272
26273    impl std::convert::From<i32> for LocationPolicy {
26274        fn from(value: i32) -> Self {
26275            match value {
26276                0 => Self::Unspecified,
26277                1 => Self::Balanced,
26278                2 => Self::Any,
26279                _ => Self::UnknownValue(location_policy::UnknownValue(
26280                    wkt::internal::UnknownEnumValue::Integer(value),
26281                )),
26282            }
26283        }
26284    }
26285
26286    impl std::convert::From<&str> for LocationPolicy {
26287        fn from(value: &str) -> Self {
26288            use std::string::ToString;
26289            match value {
26290                "LOCATION_POLICY_UNSPECIFIED" => Self::Unspecified,
26291                "BALANCED" => Self::Balanced,
26292                "ANY" => Self::Any,
26293                _ => Self::UnknownValue(location_policy::UnknownValue(
26294                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26295                )),
26296            }
26297        }
26298    }
26299
26300    impl serde::ser::Serialize for LocationPolicy {
26301        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26302        where
26303            S: serde::Serializer,
26304        {
26305            match self {
26306                Self::Unspecified => serializer.serialize_i32(0),
26307                Self::Balanced => serializer.serialize_i32(1),
26308                Self::Any => serializer.serialize_i32(2),
26309                Self::UnknownValue(u) => u.0.serialize(serializer),
26310            }
26311        }
26312    }
26313
26314    impl<'de> serde::de::Deserialize<'de> for LocationPolicy {
26315        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26316        where
26317            D: serde::Deserializer<'de>,
26318        {
26319            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationPolicy>::new(
26320                ".google.container.v1.NodePoolAutoscaling.LocationPolicy",
26321            ))
26322        }
26323    }
26324}
26325
26326/// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container
26327/// Engine cluster, which will in turn set them for Google Compute Engine
26328/// resources used by that cluster
26329#[derive(Clone, Default, PartialEq)]
26330#[non_exhaustive]
26331pub struct SetLabelsRequest {
26332    /// Deprecated. The Google Developers Console [project ID or project
26333    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
26334    /// This field has been deprecated and replaced by the name field.
26335    #[deprecated]
26336    pub project_id: std::string::String,
26337
26338    /// Deprecated. The name of the Google Compute Engine
26339    /// [zone](https://cloud.google.com/compute/docs/zones#available)
26340    /// in which the cluster resides. This field has been deprecated and replaced
26341    /// by the name field.
26342    #[deprecated]
26343    pub zone: std::string::String,
26344
26345    /// Deprecated. The name of the cluster.
26346    /// This field has been deprecated and replaced by the name field.
26347    #[deprecated]
26348    pub cluster_id: std::string::String,
26349
26350    /// Required. The labels to set for that cluster.
26351    pub resource_labels: std::collections::HashMap<std::string::String, std::string::String>,
26352
26353    /// Required. The fingerprint of the previous set of labels for this resource,
26354    /// used to detect conflicts. The fingerprint is initially generated by
26355    /// Kubernetes Engine and changes after every request to modify or update
26356    /// labels. You must always provide an up-to-date fingerprint hash when
26357    /// updating or changing labels. Make a `get()` request to the
26358    /// resource to get the latest fingerprint.
26359    pub label_fingerprint: std::string::String,
26360
26361    /// The name (project, location, cluster name) of the cluster to set labels.
26362    /// Specified in the format `projects/*/locations/*/clusters/*`.
26363    pub name: std::string::String,
26364
26365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26366}
26367
26368impl SetLabelsRequest {
26369    pub fn new() -> Self {
26370        std::default::Default::default()
26371    }
26372
26373    /// Sets the value of [project_id][crate::model::SetLabelsRequest::project_id].
26374    ///
26375    /// # Example
26376    /// ```ignore,no_run
26377    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26378    /// let x = SetLabelsRequest::new().set_project_id("example");
26379    /// ```
26380    #[deprecated]
26381    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26382        self.project_id = v.into();
26383        self
26384    }
26385
26386    /// Sets the value of [zone][crate::model::SetLabelsRequest::zone].
26387    ///
26388    /// # Example
26389    /// ```ignore,no_run
26390    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26391    /// let x = SetLabelsRequest::new().set_zone("example");
26392    /// ```
26393    #[deprecated]
26394    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26395        self.zone = v.into();
26396        self
26397    }
26398
26399    /// Sets the value of [cluster_id][crate::model::SetLabelsRequest::cluster_id].
26400    ///
26401    /// # Example
26402    /// ```ignore,no_run
26403    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26404    /// let x = SetLabelsRequest::new().set_cluster_id("example");
26405    /// ```
26406    #[deprecated]
26407    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26408        self.cluster_id = v.into();
26409        self
26410    }
26411
26412    /// Sets the value of [resource_labels][crate::model::SetLabelsRequest::resource_labels].
26413    ///
26414    /// # Example
26415    /// ```ignore,no_run
26416    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26417    /// let x = SetLabelsRequest::new().set_resource_labels([
26418    ///     ("key0", "abc"),
26419    ///     ("key1", "xyz"),
26420    /// ]);
26421    /// ```
26422    pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
26423    where
26424        T: std::iter::IntoIterator<Item = (K, V)>,
26425        K: std::convert::Into<std::string::String>,
26426        V: std::convert::Into<std::string::String>,
26427    {
26428        use std::iter::Iterator;
26429        self.resource_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26430        self
26431    }
26432
26433    /// Sets the value of [label_fingerprint][crate::model::SetLabelsRequest::label_fingerprint].
26434    ///
26435    /// # Example
26436    /// ```ignore,no_run
26437    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26438    /// let x = SetLabelsRequest::new().set_label_fingerprint("example");
26439    /// ```
26440    pub fn set_label_fingerprint<T: std::convert::Into<std::string::String>>(
26441        mut self,
26442        v: T,
26443    ) -> Self {
26444        self.label_fingerprint = v.into();
26445        self
26446    }
26447
26448    /// Sets the value of [name][crate::model::SetLabelsRequest::name].
26449    ///
26450    /// # Example
26451    /// ```ignore,no_run
26452    /// # use google_cloud_container_v1::model::SetLabelsRequest;
26453    /// let x = SetLabelsRequest::new().set_name("example");
26454    /// ```
26455    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26456        self.name = v.into();
26457        self
26458    }
26459}
26460
26461impl wkt::message::Message for SetLabelsRequest {
26462    fn typename() -> &'static str {
26463        "type.googleapis.com/google.container.v1.SetLabelsRequest"
26464    }
26465}
26466
26467/// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for
26468/// a cluster.
26469#[derive(Clone, Default, PartialEq)]
26470#[non_exhaustive]
26471pub struct SetLegacyAbacRequest {
26472    /// Deprecated. The Google Developers Console [project ID or project
26473    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
26474    /// This field has been deprecated and replaced by the name field.
26475    #[deprecated]
26476    pub project_id: std::string::String,
26477
26478    /// Deprecated. The name of the Google Compute Engine
26479    /// [zone](https://cloud.google.com/compute/docs/zones#available)
26480    /// in which the cluster resides. This field has been deprecated and replaced
26481    /// by the name field.
26482    #[deprecated]
26483    pub zone: std::string::String,
26484
26485    /// Deprecated. The name of the cluster to update.
26486    /// This field has been deprecated and replaced by the name field.
26487    #[deprecated]
26488    pub cluster_id: std::string::String,
26489
26490    /// Required. Whether ABAC authorization will be enabled in the cluster.
26491    pub enabled: bool,
26492
26493    /// The name (project, location, cluster name) of the cluster to set legacy
26494    /// abac. Specified in the format `projects/*/locations/*/clusters/*`.
26495    pub name: std::string::String,
26496
26497    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26498}
26499
26500impl SetLegacyAbacRequest {
26501    pub fn new() -> Self {
26502        std::default::Default::default()
26503    }
26504
26505    /// Sets the value of [project_id][crate::model::SetLegacyAbacRequest::project_id].
26506    ///
26507    /// # Example
26508    /// ```ignore,no_run
26509    /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
26510    /// let x = SetLegacyAbacRequest::new().set_project_id("example");
26511    /// ```
26512    #[deprecated]
26513    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26514        self.project_id = v.into();
26515        self
26516    }
26517
26518    /// Sets the value of [zone][crate::model::SetLegacyAbacRequest::zone].
26519    ///
26520    /// # Example
26521    /// ```ignore,no_run
26522    /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
26523    /// let x = SetLegacyAbacRequest::new().set_zone("example");
26524    /// ```
26525    #[deprecated]
26526    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26527        self.zone = v.into();
26528        self
26529    }
26530
26531    /// Sets the value of [cluster_id][crate::model::SetLegacyAbacRequest::cluster_id].
26532    ///
26533    /// # Example
26534    /// ```ignore,no_run
26535    /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
26536    /// let x = SetLegacyAbacRequest::new().set_cluster_id("example");
26537    /// ```
26538    #[deprecated]
26539    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26540        self.cluster_id = v.into();
26541        self
26542    }
26543
26544    /// Sets the value of [enabled][crate::model::SetLegacyAbacRequest::enabled].
26545    ///
26546    /// # Example
26547    /// ```ignore,no_run
26548    /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
26549    /// let x = SetLegacyAbacRequest::new().set_enabled(true);
26550    /// ```
26551    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26552        self.enabled = v.into();
26553        self
26554    }
26555
26556    /// Sets the value of [name][crate::model::SetLegacyAbacRequest::name].
26557    ///
26558    /// # Example
26559    /// ```ignore,no_run
26560    /// # use google_cloud_container_v1::model::SetLegacyAbacRequest;
26561    /// let x = SetLegacyAbacRequest::new().set_name("example");
26562    /// ```
26563    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26564        self.name = v.into();
26565        self
26566    }
26567}
26568
26569impl wkt::message::Message for SetLegacyAbacRequest {
26570    fn typename() -> &'static str {
26571        "type.googleapis.com/google.container.v1.SetLegacyAbacRequest"
26572    }
26573}
26574
26575/// StartIPRotationRequest creates a new IP for the cluster and then performs
26576/// a node upgrade on each node pool to point to the new IP.
26577#[derive(Clone, Default, PartialEq)]
26578#[non_exhaustive]
26579pub struct StartIPRotationRequest {
26580    /// Deprecated. The Google Developers Console [project ID or project
26581    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
26582    /// This field has been deprecated and replaced by the name field.
26583    #[deprecated]
26584    pub project_id: std::string::String,
26585
26586    /// Deprecated. The name of the Google Compute Engine
26587    /// [zone](https://cloud.google.com/compute/docs/zones#available)
26588    /// in which the cluster resides. This field has been deprecated and replaced
26589    /// by the name field.
26590    #[deprecated]
26591    pub zone: std::string::String,
26592
26593    /// Deprecated. The name of the cluster.
26594    /// This field has been deprecated and replaced by the name field.
26595    #[deprecated]
26596    pub cluster_id: std::string::String,
26597
26598    /// The name (project, location, cluster name) of the cluster to start IP
26599    /// rotation. Specified in the format `projects/*/locations/*/clusters/*`.
26600    pub name: std::string::String,
26601
26602    /// Whether to rotate credentials during IP rotation.
26603    pub rotate_credentials: bool,
26604
26605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26606}
26607
26608impl StartIPRotationRequest {
26609    pub fn new() -> Self {
26610        std::default::Default::default()
26611    }
26612
26613    /// Sets the value of [project_id][crate::model::StartIPRotationRequest::project_id].
26614    ///
26615    /// # Example
26616    /// ```ignore,no_run
26617    /// # use google_cloud_container_v1::model::StartIPRotationRequest;
26618    /// let x = StartIPRotationRequest::new().set_project_id("example");
26619    /// ```
26620    #[deprecated]
26621    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26622        self.project_id = v.into();
26623        self
26624    }
26625
26626    /// Sets the value of [zone][crate::model::StartIPRotationRequest::zone].
26627    ///
26628    /// # Example
26629    /// ```ignore,no_run
26630    /// # use google_cloud_container_v1::model::StartIPRotationRequest;
26631    /// let x = StartIPRotationRequest::new().set_zone("example");
26632    /// ```
26633    #[deprecated]
26634    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26635        self.zone = v.into();
26636        self
26637    }
26638
26639    /// Sets the value of [cluster_id][crate::model::StartIPRotationRequest::cluster_id].
26640    ///
26641    /// # Example
26642    /// ```ignore,no_run
26643    /// # use google_cloud_container_v1::model::StartIPRotationRequest;
26644    /// let x = StartIPRotationRequest::new().set_cluster_id("example");
26645    /// ```
26646    #[deprecated]
26647    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26648        self.cluster_id = v.into();
26649        self
26650    }
26651
26652    /// Sets the value of [name][crate::model::StartIPRotationRequest::name].
26653    ///
26654    /// # Example
26655    /// ```ignore,no_run
26656    /// # use google_cloud_container_v1::model::StartIPRotationRequest;
26657    /// let x = StartIPRotationRequest::new().set_name("example");
26658    /// ```
26659    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26660        self.name = v.into();
26661        self
26662    }
26663
26664    /// Sets the value of [rotate_credentials][crate::model::StartIPRotationRequest::rotate_credentials].
26665    ///
26666    /// # Example
26667    /// ```ignore,no_run
26668    /// # use google_cloud_container_v1::model::StartIPRotationRequest;
26669    /// let x = StartIPRotationRequest::new().set_rotate_credentials(true);
26670    /// ```
26671    pub fn set_rotate_credentials<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26672        self.rotate_credentials = v.into();
26673        self
26674    }
26675}
26676
26677impl wkt::message::Message for StartIPRotationRequest {
26678    fn typename() -> &'static str {
26679        "type.googleapis.com/google.container.v1.StartIPRotationRequest"
26680    }
26681}
26682
26683/// CompleteIPRotationRequest moves the cluster master back into single-IP mode.
26684#[derive(Clone, Default, PartialEq)]
26685#[non_exhaustive]
26686pub struct CompleteIPRotationRequest {
26687    /// Deprecated. The Google Developers Console [project ID or project
26688    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
26689    /// This field has been deprecated and replaced by the name field.
26690    #[deprecated]
26691    pub project_id: std::string::String,
26692
26693    /// Deprecated. The name of the Google Compute Engine
26694    /// [zone](https://cloud.google.com/compute/docs/zones#available)
26695    /// in which the cluster resides. This field has been deprecated and replaced
26696    /// by the name field.
26697    #[deprecated]
26698    pub zone: std::string::String,
26699
26700    /// Deprecated. The name of the cluster.
26701    /// This field has been deprecated and replaced by the name field.
26702    #[deprecated]
26703    pub cluster_id: std::string::String,
26704
26705    /// The name (project, location, cluster name) of the cluster to complete IP
26706    /// rotation. Specified in the format `projects/*/locations/*/clusters/*`.
26707    pub name: std::string::String,
26708
26709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26710}
26711
26712impl CompleteIPRotationRequest {
26713    pub fn new() -> Self {
26714        std::default::Default::default()
26715    }
26716
26717    /// Sets the value of [project_id][crate::model::CompleteIPRotationRequest::project_id].
26718    ///
26719    /// # Example
26720    /// ```ignore,no_run
26721    /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
26722    /// let x = CompleteIPRotationRequest::new().set_project_id("example");
26723    /// ```
26724    #[deprecated]
26725    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26726        self.project_id = v.into();
26727        self
26728    }
26729
26730    /// Sets the value of [zone][crate::model::CompleteIPRotationRequest::zone].
26731    ///
26732    /// # Example
26733    /// ```ignore,no_run
26734    /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
26735    /// let x = CompleteIPRotationRequest::new().set_zone("example");
26736    /// ```
26737    #[deprecated]
26738    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26739        self.zone = v.into();
26740        self
26741    }
26742
26743    /// Sets the value of [cluster_id][crate::model::CompleteIPRotationRequest::cluster_id].
26744    ///
26745    /// # Example
26746    /// ```ignore,no_run
26747    /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
26748    /// let x = CompleteIPRotationRequest::new().set_cluster_id("example");
26749    /// ```
26750    #[deprecated]
26751    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26752        self.cluster_id = v.into();
26753        self
26754    }
26755
26756    /// Sets the value of [name][crate::model::CompleteIPRotationRequest::name].
26757    ///
26758    /// # Example
26759    /// ```ignore,no_run
26760    /// # use google_cloud_container_v1::model::CompleteIPRotationRequest;
26761    /// let x = CompleteIPRotationRequest::new().set_name("example");
26762    /// ```
26763    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26764        self.name = v.into();
26765        self
26766    }
26767}
26768
26769impl wkt::message::Message for CompleteIPRotationRequest {
26770    fn typename() -> &'static str {
26771        "type.googleapis.com/google.container.v1.CompleteIPRotationRequest"
26772    }
26773}
26774
26775/// AcceleratorConfig represents a Hardware Accelerator request.
26776#[derive(Clone, Default, PartialEq)]
26777#[non_exhaustive]
26778pub struct AcceleratorConfig {
26779    /// The number of the accelerator cards exposed to an instance.
26780    pub accelerator_count: i64,
26781
26782    /// The accelerator type resource name. List of supported accelerators
26783    /// [here](https://cloud.google.com/compute/docs/gpus)
26784    pub accelerator_type: std::string::String,
26785
26786    /// Size of partitions to create on the GPU. Valid values are described in the
26787    /// NVIDIA [mig user
26788    /// guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning).
26789    pub gpu_partition_size: std::string::String,
26790
26791    /// The configuration for GPU sharing options.
26792    pub gpu_sharing_config: std::option::Option<crate::model::GPUSharingConfig>,
26793
26794    /// The configuration for auto installation of GPU driver.
26795    pub gpu_driver_installation_config:
26796        std::option::Option<crate::model::GPUDriverInstallationConfig>,
26797
26798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26799}
26800
26801impl AcceleratorConfig {
26802    pub fn new() -> Self {
26803        std::default::Default::default()
26804    }
26805
26806    /// Sets the value of [accelerator_count][crate::model::AcceleratorConfig::accelerator_count].
26807    ///
26808    /// # Example
26809    /// ```ignore,no_run
26810    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26811    /// let x = AcceleratorConfig::new().set_accelerator_count(42);
26812    /// ```
26813    pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
26814        self.accelerator_count = v.into();
26815        self
26816    }
26817
26818    /// Sets the value of [accelerator_type][crate::model::AcceleratorConfig::accelerator_type].
26819    ///
26820    /// # Example
26821    /// ```ignore,no_run
26822    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26823    /// let x = AcceleratorConfig::new().set_accelerator_type("example");
26824    /// ```
26825    pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
26826        mut self,
26827        v: T,
26828    ) -> Self {
26829        self.accelerator_type = v.into();
26830        self
26831    }
26832
26833    /// Sets the value of [gpu_partition_size][crate::model::AcceleratorConfig::gpu_partition_size].
26834    ///
26835    /// # Example
26836    /// ```ignore,no_run
26837    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26838    /// let x = AcceleratorConfig::new().set_gpu_partition_size("example");
26839    /// ```
26840    pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
26841        mut self,
26842        v: T,
26843    ) -> Self {
26844        self.gpu_partition_size = v.into();
26845        self
26846    }
26847
26848    /// Sets the value of [gpu_sharing_config][crate::model::AcceleratorConfig::gpu_sharing_config].
26849    ///
26850    /// # Example
26851    /// ```ignore,no_run
26852    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26853    /// use google_cloud_container_v1::model::GPUSharingConfig;
26854    /// let x = AcceleratorConfig::new().set_gpu_sharing_config(GPUSharingConfig::default()/* use setters */);
26855    /// ```
26856    pub fn set_gpu_sharing_config<T>(mut self, v: T) -> Self
26857    where
26858        T: std::convert::Into<crate::model::GPUSharingConfig>,
26859    {
26860        self.gpu_sharing_config = std::option::Option::Some(v.into());
26861        self
26862    }
26863
26864    /// Sets or clears the value of [gpu_sharing_config][crate::model::AcceleratorConfig::gpu_sharing_config].
26865    ///
26866    /// # Example
26867    /// ```ignore,no_run
26868    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26869    /// use google_cloud_container_v1::model::GPUSharingConfig;
26870    /// let x = AcceleratorConfig::new().set_or_clear_gpu_sharing_config(Some(GPUSharingConfig::default()/* use setters */));
26871    /// let x = AcceleratorConfig::new().set_or_clear_gpu_sharing_config(None::<GPUSharingConfig>);
26872    /// ```
26873    pub fn set_or_clear_gpu_sharing_config<T>(mut self, v: std::option::Option<T>) -> Self
26874    where
26875        T: std::convert::Into<crate::model::GPUSharingConfig>,
26876    {
26877        self.gpu_sharing_config = v.map(|x| x.into());
26878        self
26879    }
26880
26881    /// Sets the value of [gpu_driver_installation_config][crate::model::AcceleratorConfig::gpu_driver_installation_config].
26882    ///
26883    /// # Example
26884    /// ```ignore,no_run
26885    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26886    /// use google_cloud_container_v1::model::GPUDriverInstallationConfig;
26887    /// let x = AcceleratorConfig::new().set_gpu_driver_installation_config(GPUDriverInstallationConfig::default()/* use setters */);
26888    /// ```
26889    pub fn set_gpu_driver_installation_config<T>(mut self, v: T) -> Self
26890    where
26891        T: std::convert::Into<crate::model::GPUDriverInstallationConfig>,
26892    {
26893        self.gpu_driver_installation_config = std::option::Option::Some(v.into());
26894        self
26895    }
26896
26897    /// Sets or clears the value of [gpu_driver_installation_config][crate::model::AcceleratorConfig::gpu_driver_installation_config].
26898    ///
26899    /// # Example
26900    /// ```ignore,no_run
26901    /// # use google_cloud_container_v1::model::AcceleratorConfig;
26902    /// use google_cloud_container_v1::model::GPUDriverInstallationConfig;
26903    /// let x = AcceleratorConfig::new().set_or_clear_gpu_driver_installation_config(Some(GPUDriverInstallationConfig::default()/* use setters */));
26904    /// let x = AcceleratorConfig::new().set_or_clear_gpu_driver_installation_config(None::<GPUDriverInstallationConfig>);
26905    /// ```
26906    pub fn set_or_clear_gpu_driver_installation_config<T>(
26907        mut self,
26908        v: std::option::Option<T>,
26909    ) -> Self
26910    where
26911        T: std::convert::Into<crate::model::GPUDriverInstallationConfig>,
26912    {
26913        self.gpu_driver_installation_config = v.map(|x| x.into());
26914        self
26915    }
26916}
26917
26918impl wkt::message::Message for AcceleratorConfig {
26919    fn typename() -> &'static str {
26920        "type.googleapis.com/google.container.v1.AcceleratorConfig"
26921    }
26922}
26923
26924/// GPUSharingConfig represents the GPU sharing configuration for Hardware
26925/// Accelerators.
26926#[derive(Clone, Default, PartialEq)]
26927#[non_exhaustive]
26928pub struct GPUSharingConfig {
26929    /// The max number of containers that can share a physical GPU.
26930    pub max_shared_clients_per_gpu: i64,
26931
26932    /// The type of GPU sharing strategy to enable on the GPU node.
26933    pub gpu_sharing_strategy:
26934        std::option::Option<crate::model::gpu_sharing_config::GPUSharingStrategy>,
26935
26936    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26937}
26938
26939impl GPUSharingConfig {
26940    pub fn new() -> Self {
26941        std::default::Default::default()
26942    }
26943
26944    /// Sets the value of [max_shared_clients_per_gpu][crate::model::GPUSharingConfig::max_shared_clients_per_gpu].
26945    ///
26946    /// # Example
26947    /// ```ignore,no_run
26948    /// # use google_cloud_container_v1::model::GPUSharingConfig;
26949    /// let x = GPUSharingConfig::new().set_max_shared_clients_per_gpu(42);
26950    /// ```
26951    pub fn set_max_shared_clients_per_gpu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
26952        self.max_shared_clients_per_gpu = v.into();
26953        self
26954    }
26955
26956    /// Sets the value of [gpu_sharing_strategy][crate::model::GPUSharingConfig::gpu_sharing_strategy].
26957    ///
26958    /// # Example
26959    /// ```ignore,no_run
26960    /// # use google_cloud_container_v1::model::GPUSharingConfig;
26961    /// use google_cloud_container_v1::model::gpu_sharing_config::GPUSharingStrategy;
26962    /// let x0 = GPUSharingConfig::new().set_gpu_sharing_strategy(GPUSharingStrategy::TimeSharing);
26963    /// let x1 = GPUSharingConfig::new().set_gpu_sharing_strategy(GPUSharingStrategy::Mps);
26964    /// ```
26965    pub fn set_gpu_sharing_strategy<T>(mut self, v: T) -> Self
26966    where
26967        T: std::convert::Into<crate::model::gpu_sharing_config::GPUSharingStrategy>,
26968    {
26969        self.gpu_sharing_strategy = std::option::Option::Some(v.into());
26970        self
26971    }
26972
26973    /// Sets or clears the value of [gpu_sharing_strategy][crate::model::GPUSharingConfig::gpu_sharing_strategy].
26974    ///
26975    /// # Example
26976    /// ```ignore,no_run
26977    /// # use google_cloud_container_v1::model::GPUSharingConfig;
26978    /// use google_cloud_container_v1::model::gpu_sharing_config::GPUSharingStrategy;
26979    /// let x0 = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(Some(GPUSharingStrategy::TimeSharing));
26980    /// let x1 = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(Some(GPUSharingStrategy::Mps));
26981    /// let x_none = GPUSharingConfig::new().set_or_clear_gpu_sharing_strategy(None::<GPUSharingStrategy>);
26982    /// ```
26983    pub fn set_or_clear_gpu_sharing_strategy<T>(mut self, v: std::option::Option<T>) -> Self
26984    where
26985        T: std::convert::Into<crate::model::gpu_sharing_config::GPUSharingStrategy>,
26986    {
26987        self.gpu_sharing_strategy = v.map(|x| x.into());
26988        self
26989    }
26990}
26991
26992impl wkt::message::Message for GPUSharingConfig {
26993    fn typename() -> &'static str {
26994        "type.googleapis.com/google.container.v1.GPUSharingConfig"
26995    }
26996}
26997
26998/// Defines additional types related to [GPUSharingConfig].
26999pub mod gpu_sharing_config {
27000    #[allow(unused_imports)]
27001    use super::*;
27002
27003    /// The type of GPU sharing strategy currently provided.
27004    ///
27005    /// # Working with unknown values
27006    ///
27007    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27008    /// additional enum variants at any time. Adding new variants is not considered
27009    /// a breaking change. Applications should write their code in anticipation of:
27010    ///
27011    /// - New values appearing in future releases of the client library, **and**
27012    /// - New values received dynamically, without application changes.
27013    ///
27014    /// Please consult the [Working with enums] section in the user guide for some
27015    /// guidelines.
27016    ///
27017    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27018    #[derive(Clone, Debug, PartialEq)]
27019    #[non_exhaustive]
27020    pub enum GPUSharingStrategy {
27021        /// Default value.
27022        Unspecified,
27023        /// GPUs are time-shared between containers.
27024        TimeSharing,
27025        /// GPUs are shared between containers with NVIDIA MPS.
27026        Mps,
27027        /// If set, the enum was initialized with an unknown value.
27028        ///
27029        /// Applications can examine the value using [GPUSharingStrategy::value] or
27030        /// [GPUSharingStrategy::name].
27031        UnknownValue(gpu_sharing_strategy::UnknownValue),
27032    }
27033
27034    #[doc(hidden)]
27035    pub mod gpu_sharing_strategy {
27036        #[allow(unused_imports)]
27037        use super::*;
27038        #[derive(Clone, Debug, PartialEq)]
27039        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27040    }
27041
27042    impl GPUSharingStrategy {
27043        /// Gets the enum value.
27044        ///
27045        /// Returns `None` if the enum contains an unknown value deserialized from
27046        /// the string representation of enums.
27047        pub fn value(&self) -> std::option::Option<i32> {
27048            match self {
27049                Self::Unspecified => std::option::Option::Some(0),
27050                Self::TimeSharing => std::option::Option::Some(1),
27051                Self::Mps => std::option::Option::Some(2),
27052                Self::UnknownValue(u) => u.0.value(),
27053            }
27054        }
27055
27056        /// Gets the enum value as a string.
27057        ///
27058        /// Returns `None` if the enum contains an unknown value deserialized from
27059        /// the integer representation of enums.
27060        pub fn name(&self) -> std::option::Option<&str> {
27061            match self {
27062                Self::Unspecified => std::option::Option::Some("GPU_SHARING_STRATEGY_UNSPECIFIED"),
27063                Self::TimeSharing => std::option::Option::Some("TIME_SHARING"),
27064                Self::Mps => std::option::Option::Some("MPS"),
27065                Self::UnknownValue(u) => u.0.name(),
27066            }
27067        }
27068    }
27069
27070    impl std::default::Default for GPUSharingStrategy {
27071        fn default() -> Self {
27072            use std::convert::From;
27073            Self::from(0)
27074        }
27075    }
27076
27077    impl std::fmt::Display for GPUSharingStrategy {
27078        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27079            wkt::internal::display_enum(f, self.name(), self.value())
27080        }
27081    }
27082
27083    impl std::convert::From<i32> for GPUSharingStrategy {
27084        fn from(value: i32) -> Self {
27085            match value {
27086                0 => Self::Unspecified,
27087                1 => Self::TimeSharing,
27088                2 => Self::Mps,
27089                _ => Self::UnknownValue(gpu_sharing_strategy::UnknownValue(
27090                    wkt::internal::UnknownEnumValue::Integer(value),
27091                )),
27092            }
27093        }
27094    }
27095
27096    impl std::convert::From<&str> for GPUSharingStrategy {
27097        fn from(value: &str) -> Self {
27098            use std::string::ToString;
27099            match value {
27100                "GPU_SHARING_STRATEGY_UNSPECIFIED" => Self::Unspecified,
27101                "TIME_SHARING" => Self::TimeSharing,
27102                "MPS" => Self::Mps,
27103                _ => Self::UnknownValue(gpu_sharing_strategy::UnknownValue(
27104                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27105                )),
27106            }
27107        }
27108    }
27109
27110    impl serde::ser::Serialize for GPUSharingStrategy {
27111        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27112        where
27113            S: serde::Serializer,
27114        {
27115            match self {
27116                Self::Unspecified => serializer.serialize_i32(0),
27117                Self::TimeSharing => serializer.serialize_i32(1),
27118                Self::Mps => serializer.serialize_i32(2),
27119                Self::UnknownValue(u) => u.0.serialize(serializer),
27120            }
27121        }
27122    }
27123
27124    impl<'de> serde::de::Deserialize<'de> for GPUSharingStrategy {
27125        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27126        where
27127            D: serde::Deserializer<'de>,
27128        {
27129            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GPUSharingStrategy>::new(
27130                ".google.container.v1.GPUSharingConfig.GPUSharingStrategy",
27131            ))
27132        }
27133    }
27134}
27135
27136/// GPUDriverInstallationConfig specifies the version of GPU driver to be auto
27137/// installed.
27138#[derive(Clone, Default, PartialEq)]
27139#[non_exhaustive]
27140pub struct GPUDriverInstallationConfig {
27141    /// Mode for how the GPU driver is installed.
27142    pub gpu_driver_version:
27143        std::option::Option<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
27144
27145    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27146}
27147
27148impl GPUDriverInstallationConfig {
27149    pub fn new() -> Self {
27150        std::default::Default::default()
27151    }
27152
27153    /// Sets the value of [gpu_driver_version][crate::model::GPUDriverInstallationConfig::gpu_driver_version].
27154    ///
27155    /// # Example
27156    /// ```ignore,no_run
27157    /// # use google_cloud_container_v1::model::GPUDriverInstallationConfig;
27158    /// use google_cloud_container_v1::model::gpu_driver_installation_config::GPUDriverVersion;
27159    /// let x0 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::InstallationDisabled);
27160    /// let x1 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::Default);
27161    /// let x2 = GPUDriverInstallationConfig::new().set_gpu_driver_version(GPUDriverVersion::Latest);
27162    /// ```
27163    pub fn set_gpu_driver_version<T>(mut self, v: T) -> Self
27164    where
27165        T: std::convert::Into<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
27166    {
27167        self.gpu_driver_version = std::option::Option::Some(v.into());
27168        self
27169    }
27170
27171    /// Sets or clears the value of [gpu_driver_version][crate::model::GPUDriverInstallationConfig::gpu_driver_version].
27172    ///
27173    /// # Example
27174    /// ```ignore,no_run
27175    /// # use google_cloud_container_v1::model::GPUDriverInstallationConfig;
27176    /// use google_cloud_container_v1::model::gpu_driver_installation_config::GPUDriverVersion;
27177    /// let x0 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::InstallationDisabled));
27178    /// let x1 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::Default));
27179    /// let x2 = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(Some(GPUDriverVersion::Latest));
27180    /// let x_none = GPUDriverInstallationConfig::new().set_or_clear_gpu_driver_version(None::<GPUDriverVersion>);
27181    /// ```
27182    pub fn set_or_clear_gpu_driver_version<T>(mut self, v: std::option::Option<T>) -> Self
27183    where
27184        T: std::convert::Into<crate::model::gpu_driver_installation_config::GPUDriverVersion>,
27185    {
27186        self.gpu_driver_version = v.map(|x| x.into());
27187        self
27188    }
27189}
27190
27191impl wkt::message::Message for GPUDriverInstallationConfig {
27192    fn typename() -> &'static str {
27193        "type.googleapis.com/google.container.v1.GPUDriverInstallationConfig"
27194    }
27195}
27196
27197/// Defines additional types related to [GPUDriverInstallationConfig].
27198pub mod gpu_driver_installation_config {
27199    #[allow(unused_imports)]
27200    use super::*;
27201
27202    /// The GPU driver version to install.
27203    ///
27204    /// # Working with unknown values
27205    ///
27206    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27207    /// additional enum variants at any time. Adding new variants is not considered
27208    /// a breaking change. Applications should write their code in anticipation of:
27209    ///
27210    /// - New values appearing in future releases of the client library, **and**
27211    /// - New values received dynamically, without application changes.
27212    ///
27213    /// Please consult the [Working with enums] section in the user guide for some
27214    /// guidelines.
27215    ///
27216    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27217    #[derive(Clone, Debug, PartialEq)]
27218    #[non_exhaustive]
27219    pub enum GPUDriverVersion {
27220        /// Default value is to not install any GPU driver.
27221        Unspecified,
27222        /// Disable GPU driver auto installation and needs manual installation
27223        InstallationDisabled,
27224        /// "Default" GPU driver in COS and Ubuntu.
27225        Default,
27226        /// "Latest" GPU driver in COS.
27227        Latest,
27228        /// If set, the enum was initialized with an unknown value.
27229        ///
27230        /// Applications can examine the value using [GPUDriverVersion::value] or
27231        /// [GPUDriverVersion::name].
27232        UnknownValue(gpu_driver_version::UnknownValue),
27233    }
27234
27235    #[doc(hidden)]
27236    pub mod gpu_driver_version {
27237        #[allow(unused_imports)]
27238        use super::*;
27239        #[derive(Clone, Debug, PartialEq)]
27240        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27241    }
27242
27243    impl GPUDriverVersion {
27244        /// Gets the enum value.
27245        ///
27246        /// Returns `None` if the enum contains an unknown value deserialized from
27247        /// the string representation of enums.
27248        pub fn value(&self) -> std::option::Option<i32> {
27249            match self {
27250                Self::Unspecified => std::option::Option::Some(0),
27251                Self::InstallationDisabled => std::option::Option::Some(1),
27252                Self::Default => std::option::Option::Some(2),
27253                Self::Latest => std::option::Option::Some(3),
27254                Self::UnknownValue(u) => u.0.value(),
27255            }
27256        }
27257
27258        /// Gets the enum value as a string.
27259        ///
27260        /// Returns `None` if the enum contains an unknown value deserialized from
27261        /// the integer representation of enums.
27262        pub fn name(&self) -> std::option::Option<&str> {
27263            match self {
27264                Self::Unspecified => std::option::Option::Some("GPU_DRIVER_VERSION_UNSPECIFIED"),
27265                Self::InstallationDisabled => std::option::Option::Some("INSTALLATION_DISABLED"),
27266                Self::Default => std::option::Option::Some("DEFAULT"),
27267                Self::Latest => std::option::Option::Some("LATEST"),
27268                Self::UnknownValue(u) => u.0.name(),
27269            }
27270        }
27271    }
27272
27273    impl std::default::Default for GPUDriverVersion {
27274        fn default() -> Self {
27275            use std::convert::From;
27276            Self::from(0)
27277        }
27278    }
27279
27280    impl std::fmt::Display for GPUDriverVersion {
27281        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27282            wkt::internal::display_enum(f, self.name(), self.value())
27283        }
27284    }
27285
27286    impl std::convert::From<i32> for GPUDriverVersion {
27287        fn from(value: i32) -> Self {
27288            match value {
27289                0 => Self::Unspecified,
27290                1 => Self::InstallationDisabled,
27291                2 => Self::Default,
27292                3 => Self::Latest,
27293                _ => Self::UnknownValue(gpu_driver_version::UnknownValue(
27294                    wkt::internal::UnknownEnumValue::Integer(value),
27295                )),
27296            }
27297        }
27298    }
27299
27300    impl std::convert::From<&str> for GPUDriverVersion {
27301        fn from(value: &str) -> Self {
27302            use std::string::ToString;
27303            match value {
27304                "GPU_DRIVER_VERSION_UNSPECIFIED" => Self::Unspecified,
27305                "INSTALLATION_DISABLED" => Self::InstallationDisabled,
27306                "DEFAULT" => Self::Default,
27307                "LATEST" => Self::Latest,
27308                _ => Self::UnknownValue(gpu_driver_version::UnknownValue(
27309                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27310                )),
27311            }
27312        }
27313    }
27314
27315    impl serde::ser::Serialize for GPUDriverVersion {
27316        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27317        where
27318            S: serde::Serializer,
27319        {
27320            match self {
27321                Self::Unspecified => serializer.serialize_i32(0),
27322                Self::InstallationDisabled => serializer.serialize_i32(1),
27323                Self::Default => serializer.serialize_i32(2),
27324                Self::Latest => serializer.serialize_i32(3),
27325                Self::UnknownValue(u) => u.0.serialize(serializer),
27326            }
27327        }
27328    }
27329
27330    impl<'de> serde::de::Deserialize<'de> for GPUDriverVersion {
27331        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27332        where
27333            D: serde::Deserializer<'de>,
27334        {
27335            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GPUDriverVersion>::new(
27336                ".google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion",
27337            ))
27338        }
27339    }
27340}
27341
27342/// WorkloadMetadataConfig defines the metadata configuration to expose to
27343/// workloads on the node pool.
27344#[derive(Clone, Default, PartialEq)]
27345#[non_exhaustive]
27346pub struct WorkloadMetadataConfig {
27347    /// Mode is the configuration for how to expose metadata to workloads running
27348    /// on the node pool.
27349    pub mode: crate::model::workload_metadata_config::Mode,
27350
27351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27352}
27353
27354impl WorkloadMetadataConfig {
27355    pub fn new() -> Self {
27356        std::default::Default::default()
27357    }
27358
27359    /// Sets the value of [mode][crate::model::WorkloadMetadataConfig::mode].
27360    ///
27361    /// # Example
27362    /// ```ignore,no_run
27363    /// # use google_cloud_container_v1::model::WorkloadMetadataConfig;
27364    /// use google_cloud_container_v1::model::workload_metadata_config::Mode;
27365    /// let x0 = WorkloadMetadataConfig::new().set_mode(Mode::GceMetadata);
27366    /// let x1 = WorkloadMetadataConfig::new().set_mode(Mode::GkeMetadata);
27367    /// ```
27368    pub fn set_mode<T: std::convert::Into<crate::model::workload_metadata_config::Mode>>(
27369        mut self,
27370        v: T,
27371    ) -> Self {
27372        self.mode = v.into();
27373        self
27374    }
27375}
27376
27377impl wkt::message::Message for WorkloadMetadataConfig {
27378    fn typename() -> &'static str {
27379        "type.googleapis.com/google.container.v1.WorkloadMetadataConfig"
27380    }
27381}
27382
27383/// Defines additional types related to [WorkloadMetadataConfig].
27384pub mod workload_metadata_config {
27385    #[allow(unused_imports)]
27386    use super::*;
27387
27388    /// Mode is the configuration for how to expose metadata to workloads running
27389    /// on the node.
27390    ///
27391    /// # Working with unknown values
27392    ///
27393    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27394    /// additional enum variants at any time. Adding new variants is not considered
27395    /// a breaking change. Applications should write their code in anticipation of:
27396    ///
27397    /// - New values appearing in future releases of the client library, **and**
27398    /// - New values received dynamically, without application changes.
27399    ///
27400    /// Please consult the [Working with enums] section in the user guide for some
27401    /// guidelines.
27402    ///
27403    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27404    #[derive(Clone, Debug, PartialEq)]
27405    #[non_exhaustive]
27406    pub enum Mode {
27407        /// Not set.
27408        Unspecified,
27409        /// Expose all Compute Engine metadata to pods.
27410        GceMetadata,
27411        /// Run the GKE Metadata Server on this node. The GKE Metadata Server exposes
27412        /// a metadata API to workloads that is compatible with the V1 Compute
27413        /// Metadata APIs exposed by the Compute Engine and App Engine Metadata
27414        /// Servers. This feature can only be enabled if Workload Identity is enabled
27415        /// at the cluster level.
27416        GkeMetadata,
27417        /// If set, the enum was initialized with an unknown value.
27418        ///
27419        /// Applications can examine the value using [Mode::value] or
27420        /// [Mode::name].
27421        UnknownValue(mode::UnknownValue),
27422    }
27423
27424    #[doc(hidden)]
27425    pub mod mode {
27426        #[allow(unused_imports)]
27427        use super::*;
27428        #[derive(Clone, Debug, PartialEq)]
27429        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27430    }
27431
27432    impl Mode {
27433        /// Gets the enum value.
27434        ///
27435        /// Returns `None` if the enum contains an unknown value deserialized from
27436        /// the string representation of enums.
27437        pub fn value(&self) -> std::option::Option<i32> {
27438            match self {
27439                Self::Unspecified => std::option::Option::Some(0),
27440                Self::GceMetadata => std::option::Option::Some(1),
27441                Self::GkeMetadata => std::option::Option::Some(2),
27442                Self::UnknownValue(u) => u.0.value(),
27443            }
27444        }
27445
27446        /// Gets the enum value as a string.
27447        ///
27448        /// Returns `None` if the enum contains an unknown value deserialized from
27449        /// the integer representation of enums.
27450        pub fn name(&self) -> std::option::Option<&str> {
27451            match self {
27452                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
27453                Self::GceMetadata => std::option::Option::Some("GCE_METADATA"),
27454                Self::GkeMetadata => std::option::Option::Some("GKE_METADATA"),
27455                Self::UnknownValue(u) => u.0.name(),
27456            }
27457        }
27458    }
27459
27460    impl std::default::Default for Mode {
27461        fn default() -> Self {
27462            use std::convert::From;
27463            Self::from(0)
27464        }
27465    }
27466
27467    impl std::fmt::Display for Mode {
27468        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27469            wkt::internal::display_enum(f, self.name(), self.value())
27470        }
27471    }
27472
27473    impl std::convert::From<i32> for Mode {
27474        fn from(value: i32) -> Self {
27475            match value {
27476                0 => Self::Unspecified,
27477                1 => Self::GceMetadata,
27478                2 => Self::GkeMetadata,
27479                _ => Self::UnknownValue(mode::UnknownValue(
27480                    wkt::internal::UnknownEnumValue::Integer(value),
27481                )),
27482            }
27483        }
27484    }
27485
27486    impl std::convert::From<&str> for Mode {
27487        fn from(value: &str) -> Self {
27488            use std::string::ToString;
27489            match value {
27490                "MODE_UNSPECIFIED" => Self::Unspecified,
27491                "GCE_METADATA" => Self::GceMetadata,
27492                "GKE_METADATA" => Self::GkeMetadata,
27493                _ => Self::UnknownValue(mode::UnknownValue(
27494                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27495                )),
27496            }
27497        }
27498    }
27499
27500    impl serde::ser::Serialize for Mode {
27501        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27502        where
27503            S: serde::Serializer,
27504        {
27505            match self {
27506                Self::Unspecified => serializer.serialize_i32(0),
27507                Self::GceMetadata => serializer.serialize_i32(1),
27508                Self::GkeMetadata => serializer.serialize_i32(2),
27509                Self::UnknownValue(u) => u.0.serialize(serializer),
27510            }
27511        }
27512    }
27513
27514    impl<'de> serde::de::Deserialize<'de> for Mode {
27515        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27516        where
27517            D: serde::Deserializer<'de>,
27518        {
27519            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
27520                ".google.container.v1.WorkloadMetadataConfig.Mode",
27521            ))
27522        }
27523    }
27524}
27525
27526/// SetNetworkPolicyRequest enables/disables network policy for a cluster.
27527#[derive(Clone, Default, PartialEq)]
27528#[non_exhaustive]
27529pub struct SetNetworkPolicyRequest {
27530    /// Deprecated. The Google Developers Console [project ID or project
27531    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
27532    /// This field has been deprecated and replaced by the name field.
27533    #[deprecated]
27534    pub project_id: std::string::String,
27535
27536    /// Deprecated. The name of the Google Compute Engine
27537    /// [zone](https://cloud.google.com/compute/docs/zones#available)
27538    /// in which the cluster resides. This field has been deprecated and replaced
27539    /// by the name field.
27540    #[deprecated]
27541    pub zone: std::string::String,
27542
27543    /// Deprecated. The name of the cluster.
27544    /// This field has been deprecated and replaced by the name field.
27545    #[deprecated]
27546    pub cluster_id: std::string::String,
27547
27548    /// Required. Configuration options for the NetworkPolicy feature.
27549    pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
27550
27551    /// The name (project, location, cluster name) of the cluster to set networking
27552    /// policy. Specified in the format `projects/*/locations/*/clusters/*`.
27553    pub name: std::string::String,
27554
27555    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27556}
27557
27558impl SetNetworkPolicyRequest {
27559    pub fn new() -> Self {
27560        std::default::Default::default()
27561    }
27562
27563    /// Sets the value of [project_id][crate::model::SetNetworkPolicyRequest::project_id].
27564    ///
27565    /// # Example
27566    /// ```ignore,no_run
27567    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27568    /// let x = SetNetworkPolicyRequest::new().set_project_id("example");
27569    /// ```
27570    #[deprecated]
27571    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27572        self.project_id = v.into();
27573        self
27574    }
27575
27576    /// Sets the value of [zone][crate::model::SetNetworkPolicyRequest::zone].
27577    ///
27578    /// # Example
27579    /// ```ignore,no_run
27580    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27581    /// let x = SetNetworkPolicyRequest::new().set_zone("example");
27582    /// ```
27583    #[deprecated]
27584    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27585        self.zone = v.into();
27586        self
27587    }
27588
27589    /// Sets the value of [cluster_id][crate::model::SetNetworkPolicyRequest::cluster_id].
27590    ///
27591    /// # Example
27592    /// ```ignore,no_run
27593    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27594    /// let x = SetNetworkPolicyRequest::new().set_cluster_id("example");
27595    /// ```
27596    #[deprecated]
27597    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27598        self.cluster_id = v.into();
27599        self
27600    }
27601
27602    /// Sets the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
27603    ///
27604    /// # Example
27605    /// ```ignore,no_run
27606    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27607    /// use google_cloud_container_v1::model::NetworkPolicy;
27608    /// let x = SetNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
27609    /// ```
27610    pub fn set_network_policy<T>(mut self, v: T) -> Self
27611    where
27612        T: std::convert::Into<crate::model::NetworkPolicy>,
27613    {
27614        self.network_policy = std::option::Option::Some(v.into());
27615        self
27616    }
27617
27618    /// Sets or clears the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
27619    ///
27620    /// # Example
27621    /// ```ignore,no_run
27622    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27623    /// use google_cloud_container_v1::model::NetworkPolicy;
27624    /// let x = SetNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
27625    /// let x = SetNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
27626    /// ```
27627    pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
27628    where
27629        T: std::convert::Into<crate::model::NetworkPolicy>,
27630    {
27631        self.network_policy = v.map(|x| x.into());
27632        self
27633    }
27634
27635    /// Sets the value of [name][crate::model::SetNetworkPolicyRequest::name].
27636    ///
27637    /// # Example
27638    /// ```ignore,no_run
27639    /// # use google_cloud_container_v1::model::SetNetworkPolicyRequest;
27640    /// let x = SetNetworkPolicyRequest::new().set_name("example");
27641    /// ```
27642    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27643        self.name = v.into();
27644        self
27645    }
27646}
27647
27648impl wkt::message::Message for SetNetworkPolicyRequest {
27649    fn typename() -> &'static str {
27650        "type.googleapis.com/google.container.v1.SetNetworkPolicyRequest"
27651    }
27652}
27653
27654/// SetMaintenancePolicyRequest sets the maintenance policy for a cluster.
27655#[derive(Clone, Default, PartialEq)]
27656#[non_exhaustive]
27657pub struct SetMaintenancePolicyRequest {
27658    /// Required. The Google Developers Console [project ID or project
27659    /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
27660    pub project_id: std::string::String,
27661
27662    /// Required. The name of the Google Compute Engine
27663    /// [zone](https://cloud.google.com/compute/docs/zones#available)
27664    /// in which the cluster resides.
27665    pub zone: std::string::String,
27666
27667    /// Required. The name of the cluster to update.
27668    pub cluster_id: std::string::String,
27669
27670    /// Required. The maintenance policy to be set for the cluster. An empty field
27671    /// clears the existing maintenance policy.
27672    pub maintenance_policy: std::option::Option<crate::model::MaintenancePolicy>,
27673
27674    /// The name (project, location, cluster name) of the cluster to set
27675    /// maintenance policy.
27676    /// Specified in the format `projects/*/locations/*/clusters/*`.
27677    pub name: std::string::String,
27678
27679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27680}
27681
27682impl SetMaintenancePolicyRequest {
27683    pub fn new() -> Self {
27684        std::default::Default::default()
27685    }
27686
27687    /// Sets the value of [project_id][crate::model::SetMaintenancePolicyRequest::project_id].
27688    ///
27689    /// # Example
27690    /// ```ignore,no_run
27691    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27692    /// let x = SetMaintenancePolicyRequest::new().set_project_id("example");
27693    /// ```
27694    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27695        self.project_id = v.into();
27696        self
27697    }
27698
27699    /// Sets the value of [zone][crate::model::SetMaintenancePolicyRequest::zone].
27700    ///
27701    /// # Example
27702    /// ```ignore,no_run
27703    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27704    /// let x = SetMaintenancePolicyRequest::new().set_zone("example");
27705    /// ```
27706    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27707        self.zone = v.into();
27708        self
27709    }
27710
27711    /// Sets the value of [cluster_id][crate::model::SetMaintenancePolicyRequest::cluster_id].
27712    ///
27713    /// # Example
27714    /// ```ignore,no_run
27715    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27716    /// let x = SetMaintenancePolicyRequest::new().set_cluster_id("example");
27717    /// ```
27718    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27719        self.cluster_id = v.into();
27720        self
27721    }
27722
27723    /// Sets the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
27724    ///
27725    /// # Example
27726    /// ```ignore,no_run
27727    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27728    /// use google_cloud_container_v1::model::MaintenancePolicy;
27729    /// let x = SetMaintenancePolicyRequest::new().set_maintenance_policy(MaintenancePolicy::default()/* use setters */);
27730    /// ```
27731    pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
27732    where
27733        T: std::convert::Into<crate::model::MaintenancePolicy>,
27734    {
27735        self.maintenance_policy = std::option::Option::Some(v.into());
27736        self
27737    }
27738
27739    /// Sets or clears the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
27740    ///
27741    /// # Example
27742    /// ```ignore,no_run
27743    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27744    /// use google_cloud_container_v1::model::MaintenancePolicy;
27745    /// let x = SetMaintenancePolicyRequest::new().set_or_clear_maintenance_policy(Some(MaintenancePolicy::default()/* use setters */));
27746    /// let x = SetMaintenancePolicyRequest::new().set_or_clear_maintenance_policy(None::<MaintenancePolicy>);
27747    /// ```
27748    pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
27749    where
27750        T: std::convert::Into<crate::model::MaintenancePolicy>,
27751    {
27752        self.maintenance_policy = v.map(|x| x.into());
27753        self
27754    }
27755
27756    /// Sets the value of [name][crate::model::SetMaintenancePolicyRequest::name].
27757    ///
27758    /// # Example
27759    /// ```ignore,no_run
27760    /// # use google_cloud_container_v1::model::SetMaintenancePolicyRequest;
27761    /// let x = SetMaintenancePolicyRequest::new().set_name("example");
27762    /// ```
27763    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27764        self.name = v.into();
27765        self
27766    }
27767}
27768
27769impl wkt::message::Message for SetMaintenancePolicyRequest {
27770    fn typename() -> &'static str {
27771        "type.googleapis.com/google.container.v1.SetMaintenancePolicyRequest"
27772    }
27773}
27774
27775/// StatusCondition describes why a cluster or a node pool has a certain status
27776/// (e.g., ERROR or DEGRADED).
27777#[derive(Clone, Default, PartialEq)]
27778#[non_exhaustive]
27779pub struct StatusCondition {
27780    /// Machine-friendly representation of the condition
27781    /// Deprecated. Use canonical_code instead.
27782    #[deprecated]
27783    pub code: crate::model::status_condition::Code,
27784
27785    /// Human-friendly representation of the condition
27786    pub message: std::string::String,
27787
27788    /// Canonical code of the condition.
27789    pub canonical_code: rpc::model::Code,
27790
27791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27792}
27793
27794impl StatusCondition {
27795    pub fn new() -> Self {
27796        std::default::Default::default()
27797    }
27798
27799    /// Sets the value of [code][crate::model::StatusCondition::code].
27800    ///
27801    /// # Example
27802    /// ```ignore,no_run
27803    /// # use google_cloud_container_v1::model::StatusCondition;
27804    /// use google_cloud_container_v1::model::status_condition::Code;
27805    /// let x0 = StatusCondition::new().set_code(Code::GceStockout);
27806    /// let x1 = StatusCondition::new().set_code(Code::GkeServiceAccountDeleted);
27807    /// let x2 = StatusCondition::new().set_code(Code::GceQuotaExceeded);
27808    /// ```
27809    #[deprecated]
27810    pub fn set_code<T: std::convert::Into<crate::model::status_condition::Code>>(
27811        mut self,
27812        v: T,
27813    ) -> Self {
27814        self.code = v.into();
27815        self
27816    }
27817
27818    /// Sets the value of [message][crate::model::StatusCondition::message].
27819    ///
27820    /// # Example
27821    /// ```ignore,no_run
27822    /// # use google_cloud_container_v1::model::StatusCondition;
27823    /// let x = StatusCondition::new().set_message("example");
27824    /// ```
27825    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27826        self.message = v.into();
27827        self
27828    }
27829
27830    /// Sets the value of [canonical_code][crate::model::StatusCondition::canonical_code].
27831    ///
27832    /// # Example
27833    /// ```ignore,no_run
27834    /// # use google_cloud_container_v1::model::StatusCondition;
27835    /// use rpc::model::Code;
27836    /// let x0 = StatusCondition::new().set_canonical_code(Code::Cancelled);
27837    /// let x1 = StatusCondition::new().set_canonical_code(Code::Unknown);
27838    /// let x2 = StatusCondition::new().set_canonical_code(Code::InvalidArgument);
27839    /// ```
27840    pub fn set_canonical_code<T: std::convert::Into<rpc::model::Code>>(mut self, v: T) -> Self {
27841        self.canonical_code = v.into();
27842        self
27843    }
27844}
27845
27846impl wkt::message::Message for StatusCondition {
27847    fn typename() -> &'static str {
27848        "type.googleapis.com/google.container.v1.StatusCondition"
27849    }
27850}
27851
27852/// Defines additional types related to [StatusCondition].
27853pub mod status_condition {
27854    #[allow(unused_imports)]
27855    use super::*;
27856
27857    /// Code for each condition
27858    ///
27859    /// # Working with unknown values
27860    ///
27861    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27862    /// additional enum variants at any time. Adding new variants is not considered
27863    /// a breaking change. Applications should write their code in anticipation of:
27864    ///
27865    /// - New values appearing in future releases of the client library, **and**
27866    /// - New values received dynamically, without application changes.
27867    ///
27868    /// Please consult the [Working with enums] section in the user guide for some
27869    /// guidelines.
27870    ///
27871    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27872    #[derive(Clone, Debug, PartialEq)]
27873    #[non_exhaustive]
27874    pub enum Code {
27875        /// UNKNOWN indicates a generic condition.
27876        Unknown,
27877        /// GCE_STOCKOUT indicates that Google Compute Engine resources are
27878        /// temporarily unavailable.
27879        GceStockout,
27880        /// GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot
27881        /// service account.
27882        GkeServiceAccountDeleted,
27883        /// Google Compute Engine quota was exceeded.
27884        GceQuotaExceeded,
27885        /// Cluster state was manually changed by an SRE due to a system logic error.
27886        SetByOperator,
27887        /// Unable to perform an encrypt operation against the CloudKMS key used for
27888        /// etcd level encryption.
27889        CloudKmsKeyError,
27890        /// Cluster CA is expiring soon.
27891        CaExpiring,
27892        /// Node service account is missing permissions.
27893        NodeServiceAccountMissingPermissions,
27894        /// Cloud KMS key version used for etcd level encryption has been destroyed.
27895        /// This is a permanent error.
27896        CloudKmsKeyDestroyed,
27897        /// If set, the enum was initialized with an unknown value.
27898        ///
27899        /// Applications can examine the value using [Code::value] or
27900        /// [Code::name].
27901        UnknownValue(code::UnknownValue),
27902    }
27903
27904    #[doc(hidden)]
27905    pub mod code {
27906        #[allow(unused_imports)]
27907        use super::*;
27908        #[derive(Clone, Debug, PartialEq)]
27909        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27910    }
27911
27912    impl Code {
27913        /// Gets the enum value.
27914        ///
27915        /// Returns `None` if the enum contains an unknown value deserialized from
27916        /// the string representation of enums.
27917        pub fn value(&self) -> std::option::Option<i32> {
27918            match self {
27919                Self::Unknown => std::option::Option::Some(0),
27920                Self::GceStockout => std::option::Option::Some(1),
27921                Self::GkeServiceAccountDeleted => std::option::Option::Some(2),
27922                Self::GceQuotaExceeded => std::option::Option::Some(3),
27923                Self::SetByOperator => std::option::Option::Some(4),
27924                Self::CloudKmsKeyError => std::option::Option::Some(7),
27925                Self::CaExpiring => std::option::Option::Some(9),
27926                Self::NodeServiceAccountMissingPermissions => std::option::Option::Some(10),
27927                Self::CloudKmsKeyDestroyed => std::option::Option::Some(11),
27928                Self::UnknownValue(u) => u.0.value(),
27929            }
27930        }
27931
27932        /// Gets the enum value as a string.
27933        ///
27934        /// Returns `None` if the enum contains an unknown value deserialized from
27935        /// the integer representation of enums.
27936        pub fn name(&self) -> std::option::Option<&str> {
27937            match self {
27938                Self::Unknown => std::option::Option::Some("UNKNOWN"),
27939                Self::GceStockout => std::option::Option::Some("GCE_STOCKOUT"),
27940                Self::GkeServiceAccountDeleted => {
27941                    std::option::Option::Some("GKE_SERVICE_ACCOUNT_DELETED")
27942                }
27943                Self::GceQuotaExceeded => std::option::Option::Some("GCE_QUOTA_EXCEEDED"),
27944                Self::SetByOperator => std::option::Option::Some("SET_BY_OPERATOR"),
27945                Self::CloudKmsKeyError => std::option::Option::Some("CLOUD_KMS_KEY_ERROR"),
27946                Self::CaExpiring => std::option::Option::Some("CA_EXPIRING"),
27947                Self::NodeServiceAccountMissingPermissions => {
27948                    std::option::Option::Some("NODE_SERVICE_ACCOUNT_MISSING_PERMISSIONS")
27949                }
27950                Self::CloudKmsKeyDestroyed => std::option::Option::Some("CLOUD_KMS_KEY_DESTROYED"),
27951                Self::UnknownValue(u) => u.0.name(),
27952            }
27953        }
27954    }
27955
27956    impl std::default::Default for Code {
27957        fn default() -> Self {
27958            use std::convert::From;
27959            Self::from(0)
27960        }
27961    }
27962
27963    impl std::fmt::Display for Code {
27964        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27965            wkt::internal::display_enum(f, self.name(), self.value())
27966        }
27967    }
27968
27969    impl std::convert::From<i32> for Code {
27970        fn from(value: i32) -> Self {
27971            match value {
27972                0 => Self::Unknown,
27973                1 => Self::GceStockout,
27974                2 => Self::GkeServiceAccountDeleted,
27975                3 => Self::GceQuotaExceeded,
27976                4 => Self::SetByOperator,
27977                7 => Self::CloudKmsKeyError,
27978                9 => Self::CaExpiring,
27979                10 => Self::NodeServiceAccountMissingPermissions,
27980                11 => Self::CloudKmsKeyDestroyed,
27981                _ => Self::UnknownValue(code::UnknownValue(
27982                    wkt::internal::UnknownEnumValue::Integer(value),
27983                )),
27984            }
27985        }
27986    }
27987
27988    impl std::convert::From<&str> for Code {
27989        fn from(value: &str) -> Self {
27990            use std::string::ToString;
27991            match value {
27992                "UNKNOWN" => Self::Unknown,
27993                "GCE_STOCKOUT" => Self::GceStockout,
27994                "GKE_SERVICE_ACCOUNT_DELETED" => Self::GkeServiceAccountDeleted,
27995                "GCE_QUOTA_EXCEEDED" => Self::GceQuotaExceeded,
27996                "SET_BY_OPERATOR" => Self::SetByOperator,
27997                "CLOUD_KMS_KEY_ERROR" => Self::CloudKmsKeyError,
27998                "CA_EXPIRING" => Self::CaExpiring,
27999                "NODE_SERVICE_ACCOUNT_MISSING_PERMISSIONS" => {
28000                    Self::NodeServiceAccountMissingPermissions
28001                }
28002                "CLOUD_KMS_KEY_DESTROYED" => Self::CloudKmsKeyDestroyed,
28003                _ => Self::UnknownValue(code::UnknownValue(
28004                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28005                )),
28006            }
28007        }
28008    }
28009
28010    impl serde::ser::Serialize for Code {
28011        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28012        where
28013            S: serde::Serializer,
28014        {
28015            match self {
28016                Self::Unknown => serializer.serialize_i32(0),
28017                Self::GceStockout => serializer.serialize_i32(1),
28018                Self::GkeServiceAccountDeleted => serializer.serialize_i32(2),
28019                Self::GceQuotaExceeded => serializer.serialize_i32(3),
28020                Self::SetByOperator => serializer.serialize_i32(4),
28021                Self::CloudKmsKeyError => serializer.serialize_i32(7),
28022                Self::CaExpiring => serializer.serialize_i32(9),
28023                Self::NodeServiceAccountMissingPermissions => serializer.serialize_i32(10),
28024                Self::CloudKmsKeyDestroyed => serializer.serialize_i32(11),
28025                Self::UnknownValue(u) => u.0.serialize(serializer),
28026            }
28027        }
28028    }
28029
28030    impl<'de> serde::de::Deserialize<'de> for Code {
28031        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28032        where
28033            D: serde::Deserializer<'de>,
28034        {
28035            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
28036                ".google.container.v1.StatusCondition.Code",
28037            ))
28038        }
28039    }
28040}
28041
28042/// NetworkConfig reports the relative names of network & subnetwork.
28043#[derive(Clone, Default, PartialEq)]
28044#[non_exhaustive]
28045pub struct NetworkConfig {
28046    /// Output only. The relative name of the Google Compute Engine
28047    /// [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks)
28048    /// to which the cluster is connected. Example:
28049    /// projects/my-project/global/networks/my-network
28050    pub network: std::string::String,
28051
28052    /// Output only. The relative name of the Google Compute Engine
28053    /// [subnetwork](https://cloud.google.com/compute/docs/vpc)
28054    /// to which the cluster is connected. Example:
28055    /// projects/my-project/regions/us-central1/subnetworks/my-subnet
28056    pub subnetwork: std::string::String,
28057
28058    /// Whether Intra-node visibility is enabled for this cluster.
28059    /// This makes same node pod to pod traffic visible for VPC network.
28060    pub enable_intra_node_visibility: bool,
28061
28062    /// Whether the cluster disables default in-node sNAT rules. In-node sNAT rules
28063    /// will be disabled when default_snat_status is disabled. When disabled is set
28064    /// to false, default IP masquerade rules will be applied to the nodes to
28065    /// prevent sNAT on cluster internal traffic.
28066    pub default_snat_status: std::option::Option<crate::model::DefaultSnatStatus>,
28067
28068    /// Whether L4ILB Subsetting is enabled for this cluster.
28069    pub enable_l4ilb_subsetting: bool,
28070
28071    /// The desired datapath provider for this cluster. By default, uses the
28072    /// IPTables-based kube-proxy implementation.
28073    pub datapath_provider: crate::model::DatapathProvider,
28074
28075    /// The desired state of IPv6 connectivity to Google Services.
28076    /// By default, no private IPv6 access to or from Google Services (all access
28077    /// will be via IPv4)
28078    pub private_ipv6_google_access: crate::model::PrivateIPv6GoogleAccess,
28079
28080    /// DNSConfig contains clusterDNS config for this cluster.
28081    pub dns_config: std::option::Option<crate::model::DNSConfig>,
28082
28083    /// ServiceExternalIPsConfig specifies if services with externalIPs field are
28084    /// blocked or not.
28085    pub service_external_ips_config: std::option::Option<crate::model::ServiceExternalIPsConfig>,
28086
28087    /// GatewayAPIConfig contains the desired config of Gateway API on this
28088    /// cluster.
28089    pub gateway_api_config: std::option::Option<crate::model::GatewayAPIConfig>,
28090
28091    /// Whether multi-networking is enabled for this cluster.
28092    pub enable_multi_networking: bool,
28093
28094    /// Network bandwidth tier configuration.
28095    pub network_performance_config:
28096        std::option::Option<crate::model::network_config::ClusterNetworkPerformanceConfig>,
28097
28098    /// Whether FQDN Network Policy is enabled on this cluster.
28099    pub enable_fqdn_network_policy: std::option::Option<bool>,
28100
28101    /// Specify the details of in-transit encryption.
28102    /// Now named inter-node transparent encryption.
28103    pub in_transit_encryption_config: std::option::Option<crate::model::InTransitEncryptionConfig>,
28104
28105    /// Whether CiliumClusterwideNetworkPolicy is enabled on this cluster.
28106    pub enable_cilium_clusterwide_network_policy: std::option::Option<bool>,
28107
28108    /// Controls whether by default nodes have private IP addresses only.
28109    /// It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][]
28110    /// and this field at the same time.
28111    /// To update the default setting, use
28112    /// [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes]
28113    ///
28114    /// [google.container.v1.ClusterUpdate.desired_default_enable_private_nodes]: crate::model::ClusterUpdate::desired_default_enable_private_nodes
28115    pub default_enable_private_nodes: std::option::Option<bool>,
28116
28117    /// Disable L4 load balancer VPC firewalls to enable firewall policies.
28118    pub disable_l4_lb_firewall_reconciliation: std::option::Option<bool>,
28119
28120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28121}
28122
28123impl NetworkConfig {
28124    pub fn new() -> Self {
28125        std::default::Default::default()
28126    }
28127
28128    /// Sets the value of [network][crate::model::NetworkConfig::network].
28129    ///
28130    /// # Example
28131    /// ```ignore,no_run
28132    /// # use google_cloud_container_v1::model::NetworkConfig;
28133    /// let x = NetworkConfig::new().set_network("example");
28134    /// ```
28135    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28136        self.network = v.into();
28137        self
28138    }
28139
28140    /// Sets the value of [subnetwork][crate::model::NetworkConfig::subnetwork].
28141    ///
28142    /// # Example
28143    /// ```ignore,no_run
28144    /// # use google_cloud_container_v1::model::NetworkConfig;
28145    /// let x = NetworkConfig::new().set_subnetwork("example");
28146    /// ```
28147    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28148        self.subnetwork = v.into();
28149        self
28150    }
28151
28152    /// Sets the value of [enable_intra_node_visibility][crate::model::NetworkConfig::enable_intra_node_visibility].
28153    ///
28154    /// # Example
28155    /// ```ignore,no_run
28156    /// # use google_cloud_container_v1::model::NetworkConfig;
28157    /// let x = NetworkConfig::new().set_enable_intra_node_visibility(true);
28158    /// ```
28159    pub fn set_enable_intra_node_visibility<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28160        self.enable_intra_node_visibility = v.into();
28161        self
28162    }
28163
28164    /// Sets the value of [default_snat_status][crate::model::NetworkConfig::default_snat_status].
28165    ///
28166    /// # Example
28167    /// ```ignore,no_run
28168    /// # use google_cloud_container_v1::model::NetworkConfig;
28169    /// use google_cloud_container_v1::model::DefaultSnatStatus;
28170    /// let x = NetworkConfig::new().set_default_snat_status(DefaultSnatStatus::default()/* use setters */);
28171    /// ```
28172    pub fn set_default_snat_status<T>(mut self, v: T) -> Self
28173    where
28174        T: std::convert::Into<crate::model::DefaultSnatStatus>,
28175    {
28176        self.default_snat_status = std::option::Option::Some(v.into());
28177        self
28178    }
28179
28180    /// Sets or clears the value of [default_snat_status][crate::model::NetworkConfig::default_snat_status].
28181    ///
28182    /// # Example
28183    /// ```ignore,no_run
28184    /// # use google_cloud_container_v1::model::NetworkConfig;
28185    /// use google_cloud_container_v1::model::DefaultSnatStatus;
28186    /// let x = NetworkConfig::new().set_or_clear_default_snat_status(Some(DefaultSnatStatus::default()/* use setters */));
28187    /// let x = NetworkConfig::new().set_or_clear_default_snat_status(None::<DefaultSnatStatus>);
28188    /// ```
28189    pub fn set_or_clear_default_snat_status<T>(mut self, v: std::option::Option<T>) -> Self
28190    where
28191        T: std::convert::Into<crate::model::DefaultSnatStatus>,
28192    {
28193        self.default_snat_status = v.map(|x| x.into());
28194        self
28195    }
28196
28197    /// Sets the value of [enable_l4ilb_subsetting][crate::model::NetworkConfig::enable_l4ilb_subsetting].
28198    ///
28199    /// # Example
28200    /// ```ignore,no_run
28201    /// # use google_cloud_container_v1::model::NetworkConfig;
28202    /// let x = NetworkConfig::new().set_enable_l4ilb_subsetting(true);
28203    /// ```
28204    pub fn set_enable_l4ilb_subsetting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28205        self.enable_l4ilb_subsetting = v.into();
28206        self
28207    }
28208
28209    /// Sets the value of [datapath_provider][crate::model::NetworkConfig::datapath_provider].
28210    ///
28211    /// # Example
28212    /// ```ignore,no_run
28213    /// # use google_cloud_container_v1::model::NetworkConfig;
28214    /// use google_cloud_container_v1::model::DatapathProvider;
28215    /// let x0 = NetworkConfig::new().set_datapath_provider(DatapathProvider::LegacyDatapath);
28216    /// let x1 = NetworkConfig::new().set_datapath_provider(DatapathProvider::AdvancedDatapath);
28217    /// ```
28218    pub fn set_datapath_provider<T: std::convert::Into<crate::model::DatapathProvider>>(
28219        mut self,
28220        v: T,
28221    ) -> Self {
28222        self.datapath_provider = v.into();
28223        self
28224    }
28225
28226    /// Sets the value of [private_ipv6_google_access][crate::model::NetworkConfig::private_ipv6_google_access].
28227    ///
28228    /// # Example
28229    /// ```ignore,no_run
28230    /// # use google_cloud_container_v1::model::NetworkConfig;
28231    /// use google_cloud_container_v1::model::PrivateIPv6GoogleAccess;
28232    /// let x0 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessDisabled);
28233    /// let x1 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessToGoogle);
28234    /// let x2 = NetworkConfig::new().set_private_ipv6_google_access(PrivateIPv6GoogleAccess::PrivateIpv6GoogleAccessBidirectional);
28235    /// ```
28236    pub fn set_private_ipv6_google_access<
28237        T: std::convert::Into<crate::model::PrivateIPv6GoogleAccess>,
28238    >(
28239        mut self,
28240        v: T,
28241    ) -> Self {
28242        self.private_ipv6_google_access = v.into();
28243        self
28244    }
28245
28246    /// Sets the value of [dns_config][crate::model::NetworkConfig::dns_config].
28247    ///
28248    /// # Example
28249    /// ```ignore,no_run
28250    /// # use google_cloud_container_v1::model::NetworkConfig;
28251    /// use google_cloud_container_v1::model::DNSConfig;
28252    /// let x = NetworkConfig::new().set_dns_config(DNSConfig::default()/* use setters */);
28253    /// ```
28254    pub fn set_dns_config<T>(mut self, v: T) -> Self
28255    where
28256        T: std::convert::Into<crate::model::DNSConfig>,
28257    {
28258        self.dns_config = std::option::Option::Some(v.into());
28259        self
28260    }
28261
28262    /// Sets or clears the value of [dns_config][crate::model::NetworkConfig::dns_config].
28263    ///
28264    /// # Example
28265    /// ```ignore,no_run
28266    /// # use google_cloud_container_v1::model::NetworkConfig;
28267    /// use google_cloud_container_v1::model::DNSConfig;
28268    /// let x = NetworkConfig::new().set_or_clear_dns_config(Some(DNSConfig::default()/* use setters */));
28269    /// let x = NetworkConfig::new().set_or_clear_dns_config(None::<DNSConfig>);
28270    /// ```
28271    pub fn set_or_clear_dns_config<T>(mut self, v: std::option::Option<T>) -> Self
28272    where
28273        T: std::convert::Into<crate::model::DNSConfig>,
28274    {
28275        self.dns_config = v.map(|x| x.into());
28276        self
28277    }
28278
28279    /// Sets the value of [service_external_ips_config][crate::model::NetworkConfig::service_external_ips_config].
28280    ///
28281    /// # Example
28282    /// ```ignore,no_run
28283    /// # use google_cloud_container_v1::model::NetworkConfig;
28284    /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
28285    /// let x = NetworkConfig::new().set_service_external_ips_config(ServiceExternalIPsConfig::default()/* use setters */);
28286    /// ```
28287    pub fn set_service_external_ips_config<T>(mut self, v: T) -> Self
28288    where
28289        T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
28290    {
28291        self.service_external_ips_config = std::option::Option::Some(v.into());
28292        self
28293    }
28294
28295    /// Sets or clears the value of [service_external_ips_config][crate::model::NetworkConfig::service_external_ips_config].
28296    ///
28297    /// # Example
28298    /// ```ignore,no_run
28299    /// # use google_cloud_container_v1::model::NetworkConfig;
28300    /// use google_cloud_container_v1::model::ServiceExternalIPsConfig;
28301    /// let x = NetworkConfig::new().set_or_clear_service_external_ips_config(Some(ServiceExternalIPsConfig::default()/* use setters */));
28302    /// let x = NetworkConfig::new().set_or_clear_service_external_ips_config(None::<ServiceExternalIPsConfig>);
28303    /// ```
28304    pub fn set_or_clear_service_external_ips_config<T>(mut self, v: std::option::Option<T>) -> Self
28305    where
28306        T: std::convert::Into<crate::model::ServiceExternalIPsConfig>,
28307    {
28308        self.service_external_ips_config = v.map(|x| x.into());
28309        self
28310    }
28311
28312    /// Sets the value of [gateway_api_config][crate::model::NetworkConfig::gateway_api_config].
28313    ///
28314    /// # Example
28315    /// ```ignore,no_run
28316    /// # use google_cloud_container_v1::model::NetworkConfig;
28317    /// use google_cloud_container_v1::model::GatewayAPIConfig;
28318    /// let x = NetworkConfig::new().set_gateway_api_config(GatewayAPIConfig::default()/* use setters */);
28319    /// ```
28320    pub fn set_gateway_api_config<T>(mut self, v: T) -> Self
28321    where
28322        T: std::convert::Into<crate::model::GatewayAPIConfig>,
28323    {
28324        self.gateway_api_config = std::option::Option::Some(v.into());
28325        self
28326    }
28327
28328    /// Sets or clears the value of [gateway_api_config][crate::model::NetworkConfig::gateway_api_config].
28329    ///
28330    /// # Example
28331    /// ```ignore,no_run
28332    /// # use google_cloud_container_v1::model::NetworkConfig;
28333    /// use google_cloud_container_v1::model::GatewayAPIConfig;
28334    /// let x = NetworkConfig::new().set_or_clear_gateway_api_config(Some(GatewayAPIConfig::default()/* use setters */));
28335    /// let x = NetworkConfig::new().set_or_clear_gateway_api_config(None::<GatewayAPIConfig>);
28336    /// ```
28337    pub fn set_or_clear_gateway_api_config<T>(mut self, v: std::option::Option<T>) -> Self
28338    where
28339        T: std::convert::Into<crate::model::GatewayAPIConfig>,
28340    {
28341        self.gateway_api_config = v.map(|x| x.into());
28342        self
28343    }
28344
28345    /// Sets the value of [enable_multi_networking][crate::model::NetworkConfig::enable_multi_networking].
28346    ///
28347    /// # Example
28348    /// ```ignore,no_run
28349    /// # use google_cloud_container_v1::model::NetworkConfig;
28350    /// let x = NetworkConfig::new().set_enable_multi_networking(true);
28351    /// ```
28352    pub fn set_enable_multi_networking<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28353        self.enable_multi_networking = v.into();
28354        self
28355    }
28356
28357    /// Sets the value of [network_performance_config][crate::model::NetworkConfig::network_performance_config].
28358    ///
28359    /// # Example
28360    /// ```ignore,no_run
28361    /// # use google_cloud_container_v1::model::NetworkConfig;
28362    /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
28363    /// let x = NetworkConfig::new().set_network_performance_config(ClusterNetworkPerformanceConfig::default()/* use setters */);
28364    /// ```
28365    pub fn set_network_performance_config<T>(mut self, v: T) -> Self
28366    where
28367        T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
28368    {
28369        self.network_performance_config = std::option::Option::Some(v.into());
28370        self
28371    }
28372
28373    /// Sets or clears the value of [network_performance_config][crate::model::NetworkConfig::network_performance_config].
28374    ///
28375    /// # Example
28376    /// ```ignore,no_run
28377    /// # use google_cloud_container_v1::model::NetworkConfig;
28378    /// use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
28379    /// let x = NetworkConfig::new().set_or_clear_network_performance_config(Some(ClusterNetworkPerformanceConfig::default()/* use setters */));
28380    /// let x = NetworkConfig::new().set_or_clear_network_performance_config(None::<ClusterNetworkPerformanceConfig>);
28381    /// ```
28382    pub fn set_or_clear_network_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
28383    where
28384        T: std::convert::Into<crate::model::network_config::ClusterNetworkPerformanceConfig>,
28385    {
28386        self.network_performance_config = v.map(|x| x.into());
28387        self
28388    }
28389
28390    /// Sets the value of [enable_fqdn_network_policy][crate::model::NetworkConfig::enable_fqdn_network_policy].
28391    ///
28392    /// # Example
28393    /// ```ignore,no_run
28394    /// # use google_cloud_container_v1::model::NetworkConfig;
28395    /// let x = NetworkConfig::new().set_enable_fqdn_network_policy(true);
28396    /// ```
28397    pub fn set_enable_fqdn_network_policy<T>(mut self, v: T) -> Self
28398    where
28399        T: std::convert::Into<bool>,
28400    {
28401        self.enable_fqdn_network_policy = std::option::Option::Some(v.into());
28402        self
28403    }
28404
28405    /// Sets or clears the value of [enable_fqdn_network_policy][crate::model::NetworkConfig::enable_fqdn_network_policy].
28406    ///
28407    /// # Example
28408    /// ```ignore,no_run
28409    /// # use google_cloud_container_v1::model::NetworkConfig;
28410    /// let x = NetworkConfig::new().set_or_clear_enable_fqdn_network_policy(Some(false));
28411    /// let x = NetworkConfig::new().set_or_clear_enable_fqdn_network_policy(None::<bool>);
28412    /// ```
28413    pub fn set_or_clear_enable_fqdn_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
28414    where
28415        T: std::convert::Into<bool>,
28416    {
28417        self.enable_fqdn_network_policy = v.map(|x| x.into());
28418        self
28419    }
28420
28421    /// Sets the value of [in_transit_encryption_config][crate::model::NetworkConfig::in_transit_encryption_config].
28422    ///
28423    /// # Example
28424    /// ```ignore,no_run
28425    /// # use google_cloud_container_v1::model::NetworkConfig;
28426    /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
28427    /// let x0 = NetworkConfig::new().set_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionDisabled);
28428    /// let x1 = NetworkConfig::new().set_in_transit_encryption_config(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent);
28429    /// ```
28430    pub fn set_in_transit_encryption_config<T>(mut self, v: T) -> Self
28431    where
28432        T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
28433    {
28434        self.in_transit_encryption_config = std::option::Option::Some(v.into());
28435        self
28436    }
28437
28438    /// Sets or clears the value of [in_transit_encryption_config][crate::model::NetworkConfig::in_transit_encryption_config].
28439    ///
28440    /// # Example
28441    /// ```ignore,no_run
28442    /// # use google_cloud_container_v1::model::NetworkConfig;
28443    /// use google_cloud_container_v1::model::InTransitEncryptionConfig;
28444    /// let x0 = NetworkConfig::new().set_or_clear_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionDisabled));
28445    /// let x1 = NetworkConfig::new().set_or_clear_in_transit_encryption_config(Some(InTransitEncryptionConfig::InTransitEncryptionInterNodeTransparent));
28446    /// let x_none = NetworkConfig::new().set_or_clear_in_transit_encryption_config(None::<InTransitEncryptionConfig>);
28447    /// ```
28448    pub fn set_or_clear_in_transit_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
28449    where
28450        T: std::convert::Into<crate::model::InTransitEncryptionConfig>,
28451    {
28452        self.in_transit_encryption_config = v.map(|x| x.into());
28453        self
28454    }
28455
28456    /// Sets the value of [enable_cilium_clusterwide_network_policy][crate::model::NetworkConfig::enable_cilium_clusterwide_network_policy].
28457    ///
28458    /// # Example
28459    /// ```ignore,no_run
28460    /// # use google_cloud_container_v1::model::NetworkConfig;
28461    /// let x = NetworkConfig::new().set_enable_cilium_clusterwide_network_policy(true);
28462    /// ```
28463    pub fn set_enable_cilium_clusterwide_network_policy<T>(mut self, v: T) -> Self
28464    where
28465        T: std::convert::Into<bool>,
28466    {
28467        self.enable_cilium_clusterwide_network_policy = std::option::Option::Some(v.into());
28468        self
28469    }
28470
28471    /// Sets or clears the value of [enable_cilium_clusterwide_network_policy][crate::model::NetworkConfig::enable_cilium_clusterwide_network_policy].
28472    ///
28473    /// # Example
28474    /// ```ignore,no_run
28475    /// # use google_cloud_container_v1::model::NetworkConfig;
28476    /// let x = NetworkConfig::new().set_or_clear_enable_cilium_clusterwide_network_policy(Some(false));
28477    /// let x = NetworkConfig::new().set_or_clear_enable_cilium_clusterwide_network_policy(None::<bool>);
28478    /// ```
28479    pub fn set_or_clear_enable_cilium_clusterwide_network_policy<T>(
28480        mut self,
28481        v: std::option::Option<T>,
28482    ) -> Self
28483    where
28484        T: std::convert::Into<bool>,
28485    {
28486        self.enable_cilium_clusterwide_network_policy = v.map(|x| x.into());
28487        self
28488    }
28489
28490    /// Sets the value of [default_enable_private_nodes][crate::model::NetworkConfig::default_enable_private_nodes].
28491    ///
28492    /// # Example
28493    /// ```ignore,no_run
28494    /// # use google_cloud_container_v1::model::NetworkConfig;
28495    /// let x = NetworkConfig::new().set_default_enable_private_nodes(true);
28496    /// ```
28497    pub fn set_default_enable_private_nodes<T>(mut self, v: T) -> Self
28498    where
28499        T: std::convert::Into<bool>,
28500    {
28501        self.default_enable_private_nodes = std::option::Option::Some(v.into());
28502        self
28503    }
28504
28505    /// Sets or clears the value of [default_enable_private_nodes][crate::model::NetworkConfig::default_enable_private_nodes].
28506    ///
28507    /// # Example
28508    /// ```ignore,no_run
28509    /// # use google_cloud_container_v1::model::NetworkConfig;
28510    /// let x = NetworkConfig::new().set_or_clear_default_enable_private_nodes(Some(false));
28511    /// let x = NetworkConfig::new().set_or_clear_default_enable_private_nodes(None::<bool>);
28512    /// ```
28513    pub fn set_or_clear_default_enable_private_nodes<T>(mut self, v: std::option::Option<T>) -> Self
28514    where
28515        T: std::convert::Into<bool>,
28516    {
28517        self.default_enable_private_nodes = v.map(|x| x.into());
28518        self
28519    }
28520
28521    /// Sets the value of [disable_l4_lb_firewall_reconciliation][crate::model::NetworkConfig::disable_l4_lb_firewall_reconciliation].
28522    ///
28523    /// # Example
28524    /// ```ignore,no_run
28525    /// # use google_cloud_container_v1::model::NetworkConfig;
28526    /// let x = NetworkConfig::new().set_disable_l4_lb_firewall_reconciliation(true);
28527    /// ```
28528    pub fn set_disable_l4_lb_firewall_reconciliation<T>(mut self, v: T) -> Self
28529    where
28530        T: std::convert::Into<bool>,
28531    {
28532        self.disable_l4_lb_firewall_reconciliation = std::option::Option::Some(v.into());
28533        self
28534    }
28535
28536    /// Sets or clears the value of [disable_l4_lb_firewall_reconciliation][crate::model::NetworkConfig::disable_l4_lb_firewall_reconciliation].
28537    ///
28538    /// # Example
28539    /// ```ignore,no_run
28540    /// # use google_cloud_container_v1::model::NetworkConfig;
28541    /// let x = NetworkConfig::new().set_or_clear_disable_l4_lb_firewall_reconciliation(Some(false));
28542    /// let x = NetworkConfig::new().set_or_clear_disable_l4_lb_firewall_reconciliation(None::<bool>);
28543    /// ```
28544    pub fn set_or_clear_disable_l4_lb_firewall_reconciliation<T>(
28545        mut self,
28546        v: std::option::Option<T>,
28547    ) -> Self
28548    where
28549        T: std::convert::Into<bool>,
28550    {
28551        self.disable_l4_lb_firewall_reconciliation = v.map(|x| x.into());
28552        self
28553    }
28554}
28555
28556impl wkt::message::Message for NetworkConfig {
28557    fn typename() -> &'static str {
28558        "type.googleapis.com/google.container.v1.NetworkConfig"
28559    }
28560}
28561
28562/// Defines additional types related to [NetworkConfig].
28563pub mod network_config {
28564    #[allow(unused_imports)]
28565    use super::*;
28566
28567    /// Configuration of network bandwidth tiers
28568    #[derive(Clone, Default, PartialEq)]
28569    #[non_exhaustive]
28570    pub struct ClusterNetworkPerformanceConfig {
28571        /// Specifies the total network bandwidth tier for NodePools in the cluster.
28572        pub total_egress_bandwidth_tier: std::option::Option<
28573            crate::model::network_config::cluster_network_performance_config::Tier,
28574        >,
28575
28576        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28577    }
28578
28579    impl ClusterNetworkPerformanceConfig {
28580        pub fn new() -> Self {
28581            std::default::Default::default()
28582        }
28583
28584        /// Sets the value of [total_egress_bandwidth_tier][crate::model::network_config::ClusterNetworkPerformanceConfig::total_egress_bandwidth_tier].
28585        ///
28586        /// # Example
28587        /// ```ignore,no_run
28588        /// # use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
28589        /// use google_cloud_container_v1::model::network_config::cluster_network_performance_config::Tier;
28590        /// let x0 = ClusterNetworkPerformanceConfig::new().set_total_egress_bandwidth_tier(Tier::Tier1);
28591        /// ```
28592        pub fn set_total_egress_bandwidth_tier<T>(mut self, v: T) -> Self
28593        where
28594            T: std::convert::Into<
28595                    crate::model::network_config::cluster_network_performance_config::Tier,
28596                >,
28597        {
28598            self.total_egress_bandwidth_tier = std::option::Option::Some(v.into());
28599            self
28600        }
28601
28602        /// Sets or clears the value of [total_egress_bandwidth_tier][crate::model::network_config::ClusterNetworkPerformanceConfig::total_egress_bandwidth_tier].
28603        ///
28604        /// # Example
28605        /// ```ignore,no_run
28606        /// # use google_cloud_container_v1::model::network_config::ClusterNetworkPerformanceConfig;
28607        /// use google_cloud_container_v1::model::network_config::cluster_network_performance_config::Tier;
28608        /// let x0 = ClusterNetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(Some(Tier::Tier1));
28609        /// let x_none = ClusterNetworkPerformanceConfig::new().set_or_clear_total_egress_bandwidth_tier(None::<Tier>);
28610        /// ```
28611        pub fn set_or_clear_total_egress_bandwidth_tier<T>(
28612            mut self,
28613            v: std::option::Option<T>,
28614        ) -> Self
28615        where
28616            T: std::convert::Into<
28617                    crate::model::network_config::cluster_network_performance_config::Tier,
28618                >,
28619        {
28620            self.total_egress_bandwidth_tier = v.map(|x| x.into());
28621            self
28622        }
28623    }
28624
28625    impl wkt::message::Message for ClusterNetworkPerformanceConfig {
28626        fn typename() -> &'static str {
28627            "type.googleapis.com/google.container.v1.NetworkConfig.ClusterNetworkPerformanceConfig"
28628        }
28629    }
28630
28631    /// Defines additional types related to [ClusterNetworkPerformanceConfig].
28632    pub mod cluster_network_performance_config {
28633        #[allow(unused_imports)]
28634        use super::*;
28635
28636        /// Node network tier
28637        ///
28638        /// # Working with unknown values
28639        ///
28640        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28641        /// additional enum variants at any time. Adding new variants is not considered
28642        /// a breaking change. Applications should write their code in anticipation of:
28643        ///
28644        /// - New values appearing in future releases of the client library, **and**
28645        /// - New values received dynamically, without application changes.
28646        ///
28647        /// Please consult the [Working with enums] section in the user guide for some
28648        /// guidelines.
28649        ///
28650        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28651        #[derive(Clone, Debug, PartialEq)]
28652        #[non_exhaustive]
28653        pub enum Tier {
28654            /// Default value
28655            Unspecified,
28656            /// Higher bandwidth, actual values based on VM size.
28657            Tier1,
28658            /// If set, the enum was initialized with an unknown value.
28659            ///
28660            /// Applications can examine the value using [Tier::value] or
28661            /// [Tier::name].
28662            UnknownValue(tier::UnknownValue),
28663        }
28664
28665        #[doc(hidden)]
28666        pub mod tier {
28667            #[allow(unused_imports)]
28668            use super::*;
28669            #[derive(Clone, Debug, PartialEq)]
28670            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28671        }
28672
28673        impl Tier {
28674            /// Gets the enum value.
28675            ///
28676            /// Returns `None` if the enum contains an unknown value deserialized from
28677            /// the string representation of enums.
28678            pub fn value(&self) -> std::option::Option<i32> {
28679                match self {
28680                    Self::Unspecified => std::option::Option::Some(0),
28681                    Self::Tier1 => std::option::Option::Some(1),
28682                    Self::UnknownValue(u) => u.0.value(),
28683                }
28684            }
28685
28686            /// Gets the enum value as a string.
28687            ///
28688            /// Returns `None` if the enum contains an unknown value deserialized from
28689            /// the integer representation of enums.
28690            pub fn name(&self) -> std::option::Option<&str> {
28691                match self {
28692                    Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
28693                    Self::Tier1 => std::option::Option::Some("TIER_1"),
28694                    Self::UnknownValue(u) => u.0.name(),
28695                }
28696            }
28697        }
28698
28699        impl std::default::Default for Tier {
28700            fn default() -> Self {
28701                use std::convert::From;
28702                Self::from(0)
28703            }
28704        }
28705
28706        impl std::fmt::Display for Tier {
28707            fn fmt(
28708                &self,
28709                f: &mut std::fmt::Formatter<'_>,
28710            ) -> std::result::Result<(), std::fmt::Error> {
28711                wkt::internal::display_enum(f, self.name(), self.value())
28712            }
28713        }
28714
28715        impl std::convert::From<i32> for Tier {
28716            fn from(value: i32) -> Self {
28717                match value {
28718                    0 => Self::Unspecified,
28719                    1 => Self::Tier1,
28720                    _ => Self::UnknownValue(tier::UnknownValue(
28721                        wkt::internal::UnknownEnumValue::Integer(value),
28722                    )),
28723                }
28724            }
28725        }
28726
28727        impl std::convert::From<&str> for Tier {
28728            fn from(value: &str) -> Self {
28729                use std::string::ToString;
28730                match value {
28731                    "TIER_UNSPECIFIED" => Self::Unspecified,
28732                    "TIER_1" => Self::Tier1,
28733                    _ => Self::UnknownValue(tier::UnknownValue(
28734                        wkt::internal::UnknownEnumValue::String(value.to_string()),
28735                    )),
28736                }
28737            }
28738        }
28739
28740        impl serde::ser::Serialize for Tier {
28741            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28742            where
28743                S: serde::Serializer,
28744            {
28745                match self {
28746                    Self::Unspecified => serializer.serialize_i32(0),
28747                    Self::Tier1 => serializer.serialize_i32(1),
28748                    Self::UnknownValue(u) => u.0.serialize(serializer),
28749                }
28750            }
28751        }
28752
28753        impl<'de> serde::de::Deserialize<'de> for Tier {
28754            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28755            where
28756                D: serde::Deserializer<'de>,
28757            {
28758                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
28759                    ".google.container.v1.NetworkConfig.ClusterNetworkPerformanceConfig.Tier",
28760                ))
28761            }
28762        }
28763    }
28764}
28765
28766/// GatewayAPIConfig contains the desired config of Gateway API on this cluster.
28767#[derive(Clone, Default, PartialEq)]
28768#[non_exhaustive]
28769pub struct GatewayAPIConfig {
28770    /// The Gateway API release channel to use for Gateway API.
28771    pub channel: crate::model::gateway_api_config::Channel,
28772
28773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28774}
28775
28776impl GatewayAPIConfig {
28777    pub fn new() -> Self {
28778        std::default::Default::default()
28779    }
28780
28781    /// Sets the value of [channel][crate::model::GatewayAPIConfig::channel].
28782    ///
28783    /// # Example
28784    /// ```ignore,no_run
28785    /// # use google_cloud_container_v1::model::GatewayAPIConfig;
28786    /// use google_cloud_container_v1::model::gateway_api_config::Channel;
28787    /// let x0 = GatewayAPIConfig::new().set_channel(Channel::Disabled);
28788    /// let x1 = GatewayAPIConfig::new().set_channel(Channel::Standard);
28789    /// ```
28790    pub fn set_channel<T: std::convert::Into<crate::model::gateway_api_config::Channel>>(
28791        mut self,
28792        v: T,
28793    ) -> Self {
28794        self.channel = v.into();
28795        self
28796    }
28797}
28798
28799impl wkt::message::Message for GatewayAPIConfig {
28800    fn typename() -> &'static str {
28801        "type.googleapis.com/google.container.v1.GatewayAPIConfig"
28802    }
28803}
28804
28805/// Defines additional types related to [GatewayAPIConfig].
28806pub mod gateway_api_config {
28807    #[allow(unused_imports)]
28808    use super::*;
28809
28810    /// Channel describes if/how Gateway API should be installed and implemented in
28811    /// a cluster.
28812    ///
28813    /// # Working with unknown values
28814    ///
28815    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28816    /// additional enum variants at any time. Adding new variants is not considered
28817    /// a breaking change. Applications should write their code in anticipation of:
28818    ///
28819    /// - New values appearing in future releases of the client library, **and**
28820    /// - New values received dynamically, without application changes.
28821    ///
28822    /// Please consult the [Working with enums] section in the user guide for some
28823    /// guidelines.
28824    ///
28825    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28826    #[derive(Clone, Debug, PartialEq)]
28827    #[non_exhaustive]
28828    pub enum Channel {
28829        /// Default value.
28830        Unspecified,
28831        /// Gateway API support is disabled
28832        Disabled,
28833        /// Deprecated: use CHANNEL_STANDARD instead.
28834        /// Gateway API support is enabled, experimental CRDs are installed
28835        #[deprecated]
28836        Experimental,
28837        /// Gateway API support is enabled, standard CRDs are installed
28838        Standard,
28839        /// If set, the enum was initialized with an unknown value.
28840        ///
28841        /// Applications can examine the value using [Channel::value] or
28842        /// [Channel::name].
28843        UnknownValue(channel::UnknownValue),
28844    }
28845
28846    #[doc(hidden)]
28847    pub mod channel {
28848        #[allow(unused_imports)]
28849        use super::*;
28850        #[derive(Clone, Debug, PartialEq)]
28851        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28852    }
28853
28854    impl Channel {
28855        /// Gets the enum value.
28856        ///
28857        /// Returns `None` if the enum contains an unknown value deserialized from
28858        /// the string representation of enums.
28859        pub fn value(&self) -> std::option::Option<i32> {
28860            match self {
28861                Self::Unspecified => std::option::Option::Some(0),
28862                Self::Disabled => std::option::Option::Some(1),
28863                Self::Experimental => std::option::Option::Some(3),
28864                Self::Standard => std::option::Option::Some(4),
28865                Self::UnknownValue(u) => u.0.value(),
28866            }
28867        }
28868
28869        /// Gets the enum value as a string.
28870        ///
28871        /// Returns `None` if the enum contains an unknown value deserialized from
28872        /// the integer representation of enums.
28873        pub fn name(&self) -> std::option::Option<&str> {
28874            match self {
28875                Self::Unspecified => std::option::Option::Some("CHANNEL_UNSPECIFIED"),
28876                Self::Disabled => std::option::Option::Some("CHANNEL_DISABLED"),
28877                Self::Experimental => std::option::Option::Some("CHANNEL_EXPERIMENTAL"),
28878                Self::Standard => std::option::Option::Some("CHANNEL_STANDARD"),
28879                Self::UnknownValue(u) => u.0.name(),
28880            }
28881        }
28882    }
28883
28884    impl std::default::Default for Channel {
28885        fn default() -> Self {
28886            use std::convert::From;
28887            Self::from(0)
28888        }
28889    }
28890
28891    impl std::fmt::Display for Channel {
28892        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28893            wkt::internal::display_enum(f, self.name(), self.value())
28894        }
28895    }
28896
28897    impl std::convert::From<i32> for Channel {
28898        fn from(value: i32) -> Self {
28899            match value {
28900                0 => Self::Unspecified,
28901                1 => Self::Disabled,
28902                3 => Self::Experimental,
28903                4 => Self::Standard,
28904                _ => Self::UnknownValue(channel::UnknownValue(
28905                    wkt::internal::UnknownEnumValue::Integer(value),
28906                )),
28907            }
28908        }
28909    }
28910
28911    impl std::convert::From<&str> for Channel {
28912        fn from(value: &str) -> Self {
28913            use std::string::ToString;
28914            match value {
28915                "CHANNEL_UNSPECIFIED" => Self::Unspecified,
28916                "CHANNEL_DISABLED" => Self::Disabled,
28917                "CHANNEL_EXPERIMENTAL" => Self::Experimental,
28918                "CHANNEL_STANDARD" => Self::Standard,
28919                _ => Self::UnknownValue(channel::UnknownValue(
28920                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28921                )),
28922            }
28923        }
28924    }
28925
28926    impl serde::ser::Serialize for Channel {
28927        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28928        where
28929            S: serde::Serializer,
28930        {
28931            match self {
28932                Self::Unspecified => serializer.serialize_i32(0),
28933                Self::Disabled => serializer.serialize_i32(1),
28934                Self::Experimental => serializer.serialize_i32(3),
28935                Self::Standard => serializer.serialize_i32(4),
28936                Self::UnknownValue(u) => u.0.serialize(serializer),
28937            }
28938        }
28939    }
28940
28941    impl<'de> serde::de::Deserialize<'de> for Channel {
28942        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28943        where
28944            D: serde::Deserializer<'de>,
28945        {
28946            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Channel>::new(
28947                ".google.container.v1.GatewayAPIConfig.Channel",
28948            ))
28949        }
28950    }
28951}
28952
28953/// Config to block services with externalIPs field.
28954#[derive(Clone, Default, PartialEq)]
28955#[non_exhaustive]
28956pub struct ServiceExternalIPsConfig {
28957    /// Whether Services with ExternalIPs field are allowed or not.
28958    pub enabled: bool,
28959
28960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28961}
28962
28963impl ServiceExternalIPsConfig {
28964    pub fn new() -> Self {
28965        std::default::Default::default()
28966    }
28967
28968    /// Sets the value of [enabled][crate::model::ServiceExternalIPsConfig::enabled].
28969    ///
28970    /// # Example
28971    /// ```ignore,no_run
28972    /// # use google_cloud_container_v1::model::ServiceExternalIPsConfig;
28973    /// let x = ServiceExternalIPsConfig::new().set_enabled(true);
28974    /// ```
28975    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
28976        self.enabled = v.into();
28977        self
28978    }
28979}
28980
28981impl wkt::message::Message for ServiceExternalIPsConfig {
28982    fn typename() -> &'static str {
28983        "type.googleapis.com/google.container.v1.ServiceExternalIPsConfig"
28984    }
28985}
28986
28987/// GetOpenIDConfigRequest gets the OIDC discovery document for the
28988/// cluster. See the OpenID Connect Discovery 1.0 specification for details.
28989#[derive(Clone, Default, PartialEq)]
28990#[non_exhaustive]
28991pub struct GetOpenIDConfigRequest {
28992    /// The cluster (project, location, cluster name) to get the discovery document
28993    /// for. Specified in the format `projects/*/locations/*/clusters/*`.
28994    pub parent: std::string::String,
28995
28996    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28997}
28998
28999impl GetOpenIDConfigRequest {
29000    pub fn new() -> Self {
29001        std::default::Default::default()
29002    }
29003
29004    /// Sets the value of [parent][crate::model::GetOpenIDConfigRequest::parent].
29005    ///
29006    /// # Example
29007    /// ```ignore,no_run
29008    /// # use google_cloud_container_v1::model::GetOpenIDConfigRequest;
29009    /// let x = GetOpenIDConfigRequest::new().set_parent("example");
29010    /// ```
29011    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29012        self.parent = v.into();
29013        self
29014    }
29015}
29016
29017impl wkt::message::Message for GetOpenIDConfigRequest {
29018    fn typename() -> &'static str {
29019        "type.googleapis.com/google.container.v1.GetOpenIDConfigRequest"
29020    }
29021}
29022
29023/// GetOpenIDConfigResponse is an OIDC discovery document for the cluster.
29024/// See the OpenID Connect Discovery 1.0 specification for details.
29025#[derive(Clone, Default, PartialEq)]
29026#[non_exhaustive]
29027pub struct GetOpenIDConfigResponse {
29028    /// OIDC Issuer.
29029    pub issuer: std::string::String,
29030
29031    /// JSON Web Key uri.
29032    pub jwks_uri: std::string::String,
29033
29034    /// Supported response types.
29035    pub response_types_supported: std::vec::Vec<std::string::String>,
29036
29037    /// Supported subject types.
29038    pub subject_types_supported: std::vec::Vec<std::string::String>,
29039
29040    /// supported ID Token signing Algorithms.
29041    pub id_token_signing_alg_values_supported: std::vec::Vec<std::string::String>,
29042
29043    /// Supported claims.
29044    pub claims_supported: std::vec::Vec<std::string::String>,
29045
29046    /// Supported grant types.
29047    pub grant_types: std::vec::Vec<std::string::String>,
29048
29049    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29050}
29051
29052impl GetOpenIDConfigResponse {
29053    pub fn new() -> Self {
29054        std::default::Default::default()
29055    }
29056
29057    /// Sets the value of [issuer][crate::model::GetOpenIDConfigResponse::issuer].
29058    ///
29059    /// # Example
29060    /// ```ignore,no_run
29061    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29062    /// let x = GetOpenIDConfigResponse::new().set_issuer("example");
29063    /// ```
29064    pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29065        self.issuer = v.into();
29066        self
29067    }
29068
29069    /// Sets the value of [jwks_uri][crate::model::GetOpenIDConfigResponse::jwks_uri].
29070    ///
29071    /// # Example
29072    /// ```ignore,no_run
29073    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29074    /// let x = GetOpenIDConfigResponse::new().set_jwks_uri("example");
29075    /// ```
29076    pub fn set_jwks_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29077        self.jwks_uri = v.into();
29078        self
29079    }
29080
29081    /// Sets the value of [response_types_supported][crate::model::GetOpenIDConfigResponse::response_types_supported].
29082    ///
29083    /// # Example
29084    /// ```ignore,no_run
29085    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29086    /// let x = GetOpenIDConfigResponse::new().set_response_types_supported(["a", "b", "c"]);
29087    /// ```
29088    pub fn set_response_types_supported<T, V>(mut self, v: T) -> Self
29089    where
29090        T: std::iter::IntoIterator<Item = V>,
29091        V: std::convert::Into<std::string::String>,
29092    {
29093        use std::iter::Iterator;
29094        self.response_types_supported = v.into_iter().map(|i| i.into()).collect();
29095        self
29096    }
29097
29098    /// Sets the value of [subject_types_supported][crate::model::GetOpenIDConfigResponse::subject_types_supported].
29099    ///
29100    /// # Example
29101    /// ```ignore,no_run
29102    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29103    /// let x = GetOpenIDConfigResponse::new().set_subject_types_supported(["a", "b", "c"]);
29104    /// ```
29105    pub fn set_subject_types_supported<T, V>(mut self, v: T) -> Self
29106    where
29107        T: std::iter::IntoIterator<Item = V>,
29108        V: std::convert::Into<std::string::String>,
29109    {
29110        use std::iter::Iterator;
29111        self.subject_types_supported = v.into_iter().map(|i| i.into()).collect();
29112        self
29113    }
29114
29115    /// Sets the value of [id_token_signing_alg_values_supported][crate::model::GetOpenIDConfigResponse::id_token_signing_alg_values_supported].
29116    ///
29117    /// # Example
29118    /// ```ignore,no_run
29119    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29120    /// let x = GetOpenIDConfigResponse::new().set_id_token_signing_alg_values_supported(["a", "b", "c"]);
29121    /// ```
29122    pub fn set_id_token_signing_alg_values_supported<T, V>(mut self, v: T) -> Self
29123    where
29124        T: std::iter::IntoIterator<Item = V>,
29125        V: std::convert::Into<std::string::String>,
29126    {
29127        use std::iter::Iterator;
29128        self.id_token_signing_alg_values_supported = v.into_iter().map(|i| i.into()).collect();
29129        self
29130    }
29131
29132    /// Sets the value of [claims_supported][crate::model::GetOpenIDConfigResponse::claims_supported].
29133    ///
29134    /// # Example
29135    /// ```ignore,no_run
29136    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29137    /// let x = GetOpenIDConfigResponse::new().set_claims_supported(["a", "b", "c"]);
29138    /// ```
29139    pub fn set_claims_supported<T, V>(mut self, v: T) -> Self
29140    where
29141        T: std::iter::IntoIterator<Item = V>,
29142        V: std::convert::Into<std::string::String>,
29143    {
29144        use std::iter::Iterator;
29145        self.claims_supported = v.into_iter().map(|i| i.into()).collect();
29146        self
29147    }
29148
29149    /// Sets the value of [grant_types][crate::model::GetOpenIDConfigResponse::grant_types].
29150    ///
29151    /// # Example
29152    /// ```ignore,no_run
29153    /// # use google_cloud_container_v1::model::GetOpenIDConfigResponse;
29154    /// let x = GetOpenIDConfigResponse::new().set_grant_types(["a", "b", "c"]);
29155    /// ```
29156    pub fn set_grant_types<T, V>(mut self, v: T) -> Self
29157    where
29158        T: std::iter::IntoIterator<Item = V>,
29159        V: std::convert::Into<std::string::String>,
29160    {
29161        use std::iter::Iterator;
29162        self.grant_types = v.into_iter().map(|i| i.into()).collect();
29163        self
29164    }
29165}
29166
29167impl wkt::message::Message for GetOpenIDConfigResponse {
29168    fn typename() -> &'static str {
29169        "type.googleapis.com/google.container.v1.GetOpenIDConfigResponse"
29170    }
29171}
29172
29173/// GetJSONWebKeysRequest gets the public component of the keys used by the
29174/// cluster to sign token requests. This will be the jwks_uri for the discover
29175/// document returned by getOpenIDConfig. See the OpenID Connect
29176/// Discovery 1.0 specification for details.
29177#[derive(Clone, Default, PartialEq)]
29178#[non_exhaustive]
29179pub struct GetJSONWebKeysRequest {
29180    /// The cluster (project, location, cluster name) to get keys for. Specified in
29181    /// the format `projects/*/locations/*/clusters/*`.
29182    pub parent: std::string::String,
29183
29184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29185}
29186
29187impl GetJSONWebKeysRequest {
29188    pub fn new() -> Self {
29189        std::default::Default::default()
29190    }
29191
29192    /// Sets the value of [parent][crate::model::GetJSONWebKeysRequest::parent].
29193    ///
29194    /// # Example
29195    /// ```ignore,no_run
29196    /// # use google_cloud_container_v1::model::GetJSONWebKeysRequest;
29197    /// let x = GetJSONWebKeysRequest::new().set_parent("example");
29198    /// ```
29199    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29200        self.parent = v.into();
29201        self
29202    }
29203}
29204
29205impl wkt::message::Message for GetJSONWebKeysRequest {
29206    fn typename() -> &'static str {
29207        "type.googleapis.com/google.container.v1.GetJSONWebKeysRequest"
29208    }
29209}
29210
29211/// Jwk is a JSON Web Key as specified in RFC 7517
29212#[derive(Clone, Default, PartialEq)]
29213#[non_exhaustive]
29214pub struct Jwk {
29215    /// Key Type.
29216    pub kty: std::string::String,
29217
29218    /// Algorithm.
29219    pub alg: std::string::String,
29220
29221    /// Permitted uses for the public keys.
29222    pub r#use: std::string::String,
29223
29224    /// Key ID.
29225    pub kid: std::string::String,
29226
29227    /// Used for RSA keys.
29228    pub n: std::string::String,
29229
29230    /// Used for RSA keys.
29231    pub e: std::string::String,
29232
29233    /// Used for ECDSA keys.
29234    pub x: std::string::String,
29235
29236    /// Used for ECDSA keys.
29237    pub y: std::string::String,
29238
29239    /// Used for ECDSA keys.
29240    pub crv: std::string::String,
29241
29242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29243}
29244
29245impl Jwk {
29246    pub fn new() -> Self {
29247        std::default::Default::default()
29248    }
29249
29250    /// Sets the value of [kty][crate::model::Jwk::kty].
29251    ///
29252    /// # Example
29253    /// ```ignore,no_run
29254    /// # use google_cloud_container_v1::model::Jwk;
29255    /// let x = Jwk::new().set_kty("example");
29256    /// ```
29257    pub fn set_kty<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29258        self.kty = v.into();
29259        self
29260    }
29261
29262    /// Sets the value of [alg][crate::model::Jwk::alg].
29263    ///
29264    /// # Example
29265    /// ```ignore,no_run
29266    /// # use google_cloud_container_v1::model::Jwk;
29267    /// let x = Jwk::new().set_alg("example");
29268    /// ```
29269    pub fn set_alg<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29270        self.alg = v.into();
29271        self
29272    }
29273
29274    /// Sets the value of [r#use][crate::model::Jwk::use].
29275    ///
29276    /// # Example
29277    /// ```ignore,no_run
29278    /// # use google_cloud_container_v1::model::Jwk;
29279    /// let x = Jwk::new().set_use("example");
29280    /// ```
29281    pub fn set_use<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29282        self.r#use = v.into();
29283        self
29284    }
29285
29286    /// Sets the value of [kid][crate::model::Jwk::kid].
29287    ///
29288    /// # Example
29289    /// ```ignore,no_run
29290    /// # use google_cloud_container_v1::model::Jwk;
29291    /// let x = Jwk::new().set_kid("example");
29292    /// ```
29293    pub fn set_kid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29294        self.kid = v.into();
29295        self
29296    }
29297
29298    /// Sets the value of [n][crate::model::Jwk::n].
29299    ///
29300    /// # Example
29301    /// ```ignore,no_run
29302    /// # use google_cloud_container_v1::model::Jwk;
29303    /// let x = Jwk::new().set_n("example");
29304    /// ```
29305    pub fn set_n<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29306        self.n = v.into();
29307        self
29308    }
29309
29310    /// Sets the value of [e][crate::model::Jwk::e].
29311    ///
29312    /// # Example
29313    /// ```ignore,no_run
29314    /// # use google_cloud_container_v1::model::Jwk;
29315    /// let x = Jwk::new().set_e("example");
29316    /// ```
29317    pub fn set_e<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29318        self.e = v.into();
29319        self
29320    }
29321
29322    /// Sets the value of [x][crate::model::Jwk::x].
29323    ///
29324    /// # Example
29325    /// ```ignore,no_run
29326    /// # use google_cloud_container_v1::model::Jwk;
29327    /// let x = Jwk::new().set_x("example");
29328    /// ```
29329    pub fn set_x<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29330        self.x = v.into();
29331        self
29332    }
29333
29334    /// Sets the value of [y][crate::model::Jwk::y].
29335    ///
29336    /// # Example
29337    /// ```ignore,no_run
29338    /// # use google_cloud_container_v1::model::Jwk;
29339    /// let x = Jwk::new().set_y("example");
29340    /// ```
29341    pub fn set_y<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29342        self.y = v.into();
29343        self
29344    }
29345
29346    /// Sets the value of [crv][crate::model::Jwk::crv].
29347    ///
29348    /// # Example
29349    /// ```ignore,no_run
29350    /// # use google_cloud_container_v1::model::Jwk;
29351    /// let x = Jwk::new().set_crv("example");
29352    /// ```
29353    pub fn set_crv<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29354        self.crv = v.into();
29355        self
29356    }
29357}
29358
29359impl wkt::message::Message for Jwk {
29360    fn typename() -> &'static str {
29361        "type.googleapis.com/google.container.v1.Jwk"
29362    }
29363}
29364
29365/// GetJSONWebKeysResponse is a valid JSON Web Key Set as specified in rfc 7517
29366#[derive(Clone, Default, PartialEq)]
29367#[non_exhaustive]
29368pub struct GetJSONWebKeysResponse {
29369    /// The public component of the keys used by the cluster to sign token
29370    /// requests.
29371    pub keys: std::vec::Vec<crate::model::Jwk>,
29372
29373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29374}
29375
29376impl GetJSONWebKeysResponse {
29377    pub fn new() -> Self {
29378        std::default::Default::default()
29379    }
29380
29381    /// Sets the value of [keys][crate::model::GetJSONWebKeysResponse::keys].
29382    ///
29383    /// # Example
29384    /// ```ignore,no_run
29385    /// # use google_cloud_container_v1::model::GetJSONWebKeysResponse;
29386    /// use google_cloud_container_v1::model::Jwk;
29387    /// let x = GetJSONWebKeysResponse::new()
29388    ///     .set_keys([
29389    ///         Jwk::default()/* use setters */,
29390    ///         Jwk::default()/* use (different) setters */,
29391    ///     ]);
29392    /// ```
29393    pub fn set_keys<T, V>(mut self, v: T) -> Self
29394    where
29395        T: std::iter::IntoIterator<Item = V>,
29396        V: std::convert::Into<crate::model::Jwk>,
29397    {
29398        use std::iter::Iterator;
29399        self.keys = v.into_iter().map(|i| i.into()).collect();
29400        self
29401    }
29402}
29403
29404impl wkt::message::Message for GetJSONWebKeysResponse {
29405    fn typename() -> &'static str {
29406        "type.googleapis.com/google.container.v1.GetJSONWebKeysResponse"
29407    }
29408}
29409
29410/// CheckAutopilotCompatibilityRequest requests getting the blockers for the
29411/// given operation in the cluster.
29412#[derive(Clone, Default, PartialEq)]
29413#[non_exhaustive]
29414pub struct CheckAutopilotCompatibilityRequest {
29415    /// The name (project, location, cluster) of the cluster to retrieve.
29416    /// Specified in the format `projects/*/locations/*/clusters/*`.
29417    pub name: std::string::String,
29418
29419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29420}
29421
29422impl CheckAutopilotCompatibilityRequest {
29423    pub fn new() -> Self {
29424        std::default::Default::default()
29425    }
29426
29427    /// Sets the value of [name][crate::model::CheckAutopilotCompatibilityRequest::name].
29428    ///
29429    /// # Example
29430    /// ```ignore,no_run
29431    /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityRequest;
29432    /// let x = CheckAutopilotCompatibilityRequest::new().set_name("example");
29433    /// ```
29434    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29435        self.name = v.into();
29436        self
29437    }
29438}
29439
29440impl wkt::message::Message for CheckAutopilotCompatibilityRequest {
29441    fn typename() -> &'static str {
29442        "type.googleapis.com/google.container.v1.CheckAutopilotCompatibilityRequest"
29443    }
29444}
29445
29446/// AutopilotCompatibilityIssue contains information about a specific
29447/// compatibility issue with Autopilot mode.
29448#[derive(Clone, Default, PartialEq)]
29449#[non_exhaustive]
29450pub struct AutopilotCompatibilityIssue {
29451    /// The last time when this issue was observed.
29452    pub last_observation: std::option::Option<wkt::Timestamp>,
29453
29454    /// The constraint type of the issue.
29455    pub constraint_type: std::string::String,
29456
29457    /// The incompatibility type of this issue.
29458    pub incompatibility_type: crate::model::autopilot_compatibility_issue::IssueType,
29459
29460    /// The name of the resources which are subject to this issue.
29461    pub subjects: std::vec::Vec<std::string::String>,
29462
29463    /// A URL to a public documentation, which addresses resolving this issue.
29464    pub documentation_url: std::string::String,
29465
29466    /// The description of the issue.
29467    pub description: std::string::String,
29468
29469    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29470}
29471
29472impl AutopilotCompatibilityIssue {
29473    pub fn new() -> Self {
29474        std::default::Default::default()
29475    }
29476
29477    /// Sets the value of [last_observation][crate::model::AutopilotCompatibilityIssue::last_observation].
29478    ///
29479    /// # Example
29480    /// ```ignore,no_run
29481    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29482    /// use wkt::Timestamp;
29483    /// let x = AutopilotCompatibilityIssue::new().set_last_observation(Timestamp::default()/* use setters */);
29484    /// ```
29485    pub fn set_last_observation<T>(mut self, v: T) -> Self
29486    where
29487        T: std::convert::Into<wkt::Timestamp>,
29488    {
29489        self.last_observation = std::option::Option::Some(v.into());
29490        self
29491    }
29492
29493    /// Sets or clears the value of [last_observation][crate::model::AutopilotCompatibilityIssue::last_observation].
29494    ///
29495    /// # Example
29496    /// ```ignore,no_run
29497    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29498    /// use wkt::Timestamp;
29499    /// let x = AutopilotCompatibilityIssue::new().set_or_clear_last_observation(Some(Timestamp::default()/* use setters */));
29500    /// let x = AutopilotCompatibilityIssue::new().set_or_clear_last_observation(None::<Timestamp>);
29501    /// ```
29502    pub fn set_or_clear_last_observation<T>(mut self, v: std::option::Option<T>) -> Self
29503    where
29504        T: std::convert::Into<wkt::Timestamp>,
29505    {
29506        self.last_observation = v.map(|x| x.into());
29507        self
29508    }
29509
29510    /// Sets the value of [constraint_type][crate::model::AutopilotCompatibilityIssue::constraint_type].
29511    ///
29512    /// # Example
29513    /// ```ignore,no_run
29514    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29515    /// let x = AutopilotCompatibilityIssue::new().set_constraint_type("example");
29516    /// ```
29517    pub fn set_constraint_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29518        self.constraint_type = v.into();
29519        self
29520    }
29521
29522    /// Sets the value of [incompatibility_type][crate::model::AutopilotCompatibilityIssue::incompatibility_type].
29523    ///
29524    /// # Example
29525    /// ```ignore,no_run
29526    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29527    /// use google_cloud_container_v1::model::autopilot_compatibility_issue::IssueType;
29528    /// let x0 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::Incompatibility);
29529    /// let x1 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::AdditionalConfigRequired);
29530    /// let x2 = AutopilotCompatibilityIssue::new().set_incompatibility_type(IssueType::PassedWithOptionalConfig);
29531    /// ```
29532    pub fn set_incompatibility_type<
29533        T: std::convert::Into<crate::model::autopilot_compatibility_issue::IssueType>,
29534    >(
29535        mut self,
29536        v: T,
29537    ) -> Self {
29538        self.incompatibility_type = v.into();
29539        self
29540    }
29541
29542    /// Sets the value of [subjects][crate::model::AutopilotCompatibilityIssue::subjects].
29543    ///
29544    /// # Example
29545    /// ```ignore,no_run
29546    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29547    /// let x = AutopilotCompatibilityIssue::new().set_subjects(["a", "b", "c"]);
29548    /// ```
29549    pub fn set_subjects<T, V>(mut self, v: T) -> Self
29550    where
29551        T: std::iter::IntoIterator<Item = V>,
29552        V: std::convert::Into<std::string::String>,
29553    {
29554        use std::iter::Iterator;
29555        self.subjects = v.into_iter().map(|i| i.into()).collect();
29556        self
29557    }
29558
29559    /// Sets the value of [documentation_url][crate::model::AutopilotCompatibilityIssue::documentation_url].
29560    ///
29561    /// # Example
29562    /// ```ignore,no_run
29563    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29564    /// let x = AutopilotCompatibilityIssue::new().set_documentation_url("example");
29565    /// ```
29566    pub fn set_documentation_url<T: std::convert::Into<std::string::String>>(
29567        mut self,
29568        v: T,
29569    ) -> Self {
29570        self.documentation_url = v.into();
29571        self
29572    }
29573
29574    /// Sets the value of [description][crate::model::AutopilotCompatibilityIssue::description].
29575    ///
29576    /// # Example
29577    /// ```ignore,no_run
29578    /// # use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29579    /// let x = AutopilotCompatibilityIssue::new().set_description("example");
29580    /// ```
29581    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29582        self.description = v.into();
29583        self
29584    }
29585}
29586
29587impl wkt::message::Message for AutopilotCompatibilityIssue {
29588    fn typename() -> &'static str {
29589        "type.googleapis.com/google.container.v1.AutopilotCompatibilityIssue"
29590    }
29591}
29592
29593/// Defines additional types related to [AutopilotCompatibilityIssue].
29594pub mod autopilot_compatibility_issue {
29595    #[allow(unused_imports)]
29596    use super::*;
29597
29598    /// The type of the reported issue.
29599    ///
29600    /// # Working with unknown values
29601    ///
29602    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29603    /// additional enum variants at any time. Adding new variants is not considered
29604    /// a breaking change. Applications should write their code in anticipation of:
29605    ///
29606    /// - New values appearing in future releases of the client library, **and**
29607    /// - New values received dynamically, without application changes.
29608    ///
29609    /// Please consult the [Working with enums] section in the user guide for some
29610    /// guidelines.
29611    ///
29612    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29613    #[derive(Clone, Debug, PartialEq)]
29614    #[non_exhaustive]
29615    pub enum IssueType {
29616        /// Default value, should not be used.
29617        Unspecified,
29618        /// Indicates that the issue is a known incompatibility between the
29619        /// cluster and Autopilot mode.
29620        Incompatibility,
29621        /// Indicates the issue is an incompatibility if customers take no further
29622        /// action to resolve.
29623        AdditionalConfigRequired,
29624        /// Indicates the issue is not an incompatibility, but depending on the
29625        /// workloads business logic, there is a potential that they won't work on
29626        /// Autopilot.
29627        PassedWithOptionalConfig,
29628        /// If set, the enum was initialized with an unknown value.
29629        ///
29630        /// Applications can examine the value using [IssueType::value] or
29631        /// [IssueType::name].
29632        UnknownValue(issue_type::UnknownValue),
29633    }
29634
29635    #[doc(hidden)]
29636    pub mod issue_type {
29637        #[allow(unused_imports)]
29638        use super::*;
29639        #[derive(Clone, Debug, PartialEq)]
29640        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29641    }
29642
29643    impl IssueType {
29644        /// Gets the enum value.
29645        ///
29646        /// Returns `None` if the enum contains an unknown value deserialized from
29647        /// the string representation of enums.
29648        pub fn value(&self) -> std::option::Option<i32> {
29649            match self {
29650                Self::Unspecified => std::option::Option::Some(0),
29651                Self::Incompatibility => std::option::Option::Some(1),
29652                Self::AdditionalConfigRequired => std::option::Option::Some(2),
29653                Self::PassedWithOptionalConfig => std::option::Option::Some(3),
29654                Self::UnknownValue(u) => u.0.value(),
29655            }
29656        }
29657
29658        /// Gets the enum value as a string.
29659        ///
29660        /// Returns `None` if the enum contains an unknown value deserialized from
29661        /// the integer representation of enums.
29662        pub fn name(&self) -> std::option::Option<&str> {
29663            match self {
29664                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
29665                Self::Incompatibility => std::option::Option::Some("INCOMPATIBILITY"),
29666                Self::AdditionalConfigRequired => {
29667                    std::option::Option::Some("ADDITIONAL_CONFIG_REQUIRED")
29668                }
29669                Self::PassedWithOptionalConfig => {
29670                    std::option::Option::Some("PASSED_WITH_OPTIONAL_CONFIG")
29671                }
29672                Self::UnknownValue(u) => u.0.name(),
29673            }
29674        }
29675    }
29676
29677    impl std::default::Default for IssueType {
29678        fn default() -> Self {
29679            use std::convert::From;
29680            Self::from(0)
29681        }
29682    }
29683
29684    impl std::fmt::Display for IssueType {
29685        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29686            wkt::internal::display_enum(f, self.name(), self.value())
29687        }
29688    }
29689
29690    impl std::convert::From<i32> for IssueType {
29691        fn from(value: i32) -> Self {
29692            match value {
29693                0 => Self::Unspecified,
29694                1 => Self::Incompatibility,
29695                2 => Self::AdditionalConfigRequired,
29696                3 => Self::PassedWithOptionalConfig,
29697                _ => Self::UnknownValue(issue_type::UnknownValue(
29698                    wkt::internal::UnknownEnumValue::Integer(value),
29699                )),
29700            }
29701        }
29702    }
29703
29704    impl std::convert::From<&str> for IssueType {
29705        fn from(value: &str) -> Self {
29706            use std::string::ToString;
29707            match value {
29708                "UNSPECIFIED" => Self::Unspecified,
29709                "INCOMPATIBILITY" => Self::Incompatibility,
29710                "ADDITIONAL_CONFIG_REQUIRED" => Self::AdditionalConfigRequired,
29711                "PASSED_WITH_OPTIONAL_CONFIG" => Self::PassedWithOptionalConfig,
29712                _ => Self::UnknownValue(issue_type::UnknownValue(
29713                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29714                )),
29715            }
29716        }
29717    }
29718
29719    impl serde::ser::Serialize for IssueType {
29720        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29721        where
29722            S: serde::Serializer,
29723        {
29724            match self {
29725                Self::Unspecified => serializer.serialize_i32(0),
29726                Self::Incompatibility => serializer.serialize_i32(1),
29727                Self::AdditionalConfigRequired => serializer.serialize_i32(2),
29728                Self::PassedWithOptionalConfig => serializer.serialize_i32(3),
29729                Self::UnknownValue(u) => u.0.serialize(serializer),
29730            }
29731        }
29732    }
29733
29734    impl<'de> serde::de::Deserialize<'de> for IssueType {
29735        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29736        where
29737            D: serde::Deserializer<'de>,
29738        {
29739            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IssueType>::new(
29740                ".google.container.v1.AutopilotCompatibilityIssue.IssueType",
29741            ))
29742        }
29743    }
29744}
29745
29746/// CheckAutopilotCompatibilityResponse has a list of compatibility issues.
29747#[derive(Clone, Default, PartialEq)]
29748#[non_exhaustive]
29749pub struct CheckAutopilotCompatibilityResponse {
29750    /// The list of issues for the given operation.
29751    pub issues: std::vec::Vec<crate::model::AutopilotCompatibilityIssue>,
29752
29753    /// The summary of the autopilot compatibility response.
29754    pub summary: std::string::String,
29755
29756    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29757}
29758
29759impl CheckAutopilotCompatibilityResponse {
29760    pub fn new() -> Self {
29761        std::default::Default::default()
29762    }
29763
29764    /// Sets the value of [issues][crate::model::CheckAutopilotCompatibilityResponse::issues].
29765    ///
29766    /// # Example
29767    /// ```ignore,no_run
29768    /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityResponse;
29769    /// use google_cloud_container_v1::model::AutopilotCompatibilityIssue;
29770    /// let x = CheckAutopilotCompatibilityResponse::new()
29771    ///     .set_issues([
29772    ///         AutopilotCompatibilityIssue::default()/* use setters */,
29773    ///         AutopilotCompatibilityIssue::default()/* use (different) setters */,
29774    ///     ]);
29775    /// ```
29776    pub fn set_issues<T, V>(mut self, v: T) -> Self
29777    where
29778        T: std::iter::IntoIterator<Item = V>,
29779        V: std::convert::Into<crate::model::AutopilotCompatibilityIssue>,
29780    {
29781        use std::iter::Iterator;
29782        self.issues = v.into_iter().map(|i| i.into()).collect();
29783        self
29784    }
29785
29786    /// Sets the value of [summary][crate::model::CheckAutopilotCompatibilityResponse::summary].
29787    ///
29788    /// # Example
29789    /// ```ignore,no_run
29790    /// # use google_cloud_container_v1::model::CheckAutopilotCompatibilityResponse;
29791    /// let x = CheckAutopilotCompatibilityResponse::new().set_summary("example");
29792    /// ```
29793    pub fn set_summary<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29794        self.summary = v.into();
29795        self
29796    }
29797}
29798
29799impl wkt::message::Message for CheckAutopilotCompatibilityResponse {
29800    fn typename() -> &'static str {
29801        "type.googleapis.com/google.container.v1.CheckAutopilotCompatibilityResponse"
29802    }
29803}
29804
29805/// ReleaseChannel indicates which release channel a cluster is
29806/// subscribed to. Release channels are arranged in order of risk.
29807///
29808/// When a cluster is subscribed to a release channel, Google maintains
29809/// both the master version and the node version. Node auto-upgrade
29810/// defaults to true and cannot be disabled.
29811#[derive(Clone, Default, PartialEq)]
29812#[non_exhaustive]
29813pub struct ReleaseChannel {
29814    /// channel specifies which release channel the cluster is subscribed to.
29815    pub channel: crate::model::release_channel::Channel,
29816
29817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29818}
29819
29820impl ReleaseChannel {
29821    pub fn new() -> Self {
29822        std::default::Default::default()
29823    }
29824
29825    /// Sets the value of [channel][crate::model::ReleaseChannel::channel].
29826    ///
29827    /// # Example
29828    /// ```ignore,no_run
29829    /// # use google_cloud_container_v1::model::ReleaseChannel;
29830    /// use google_cloud_container_v1::model::release_channel::Channel;
29831    /// let x0 = ReleaseChannel::new().set_channel(Channel::Rapid);
29832    /// let x1 = ReleaseChannel::new().set_channel(Channel::Regular);
29833    /// let x2 = ReleaseChannel::new().set_channel(Channel::Stable);
29834    /// ```
29835    pub fn set_channel<T: std::convert::Into<crate::model::release_channel::Channel>>(
29836        mut self,
29837        v: T,
29838    ) -> Self {
29839        self.channel = v.into();
29840        self
29841    }
29842}
29843
29844impl wkt::message::Message for ReleaseChannel {
29845    fn typename() -> &'static str {
29846        "type.googleapis.com/google.container.v1.ReleaseChannel"
29847    }
29848}
29849
29850/// Defines additional types related to [ReleaseChannel].
29851pub mod release_channel {
29852    #[allow(unused_imports)]
29853    use super::*;
29854
29855    /// Possible values for 'channel'.
29856    ///
29857    /// # Working with unknown values
29858    ///
29859    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29860    /// additional enum variants at any time. Adding new variants is not considered
29861    /// a breaking change. Applications should write their code in anticipation of:
29862    ///
29863    /// - New values appearing in future releases of the client library, **and**
29864    /// - New values received dynamically, without application changes.
29865    ///
29866    /// Please consult the [Working with enums] section in the user guide for some
29867    /// guidelines.
29868    ///
29869    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29870    #[derive(Clone, Debug, PartialEq)]
29871    #[non_exhaustive]
29872    pub enum Channel {
29873        /// No channel specified.
29874        Unspecified,
29875        /// RAPID channel is offered on an early access basis for customers who want
29876        /// to test new releases.
29877        ///
29878        /// WARNING: Versions available in the RAPID Channel may be subject to
29879        /// unresolved issues with no known workaround and are not subject to any
29880        /// SLAs.
29881        Rapid,
29882        /// Clusters subscribed to REGULAR receive versions that are considered GA
29883        /// quality. REGULAR is intended for production users who want to take
29884        /// advantage of new features.
29885        Regular,
29886        /// Clusters subscribed to STABLE receive versions that are known to be
29887        /// stable and reliable in production.
29888        Stable,
29889        /// Clusters subscribed to EXTENDED receive extended support and availability
29890        /// for versions which are known to be stable and reliable in production.
29891        Extended,
29892        /// If set, the enum was initialized with an unknown value.
29893        ///
29894        /// Applications can examine the value using [Channel::value] or
29895        /// [Channel::name].
29896        UnknownValue(channel::UnknownValue),
29897    }
29898
29899    #[doc(hidden)]
29900    pub mod channel {
29901        #[allow(unused_imports)]
29902        use super::*;
29903        #[derive(Clone, Debug, PartialEq)]
29904        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29905    }
29906
29907    impl Channel {
29908        /// Gets the enum value.
29909        ///
29910        /// Returns `None` if the enum contains an unknown value deserialized from
29911        /// the string representation of enums.
29912        pub fn value(&self) -> std::option::Option<i32> {
29913            match self {
29914                Self::Unspecified => std::option::Option::Some(0),
29915                Self::Rapid => std::option::Option::Some(1),
29916                Self::Regular => std::option::Option::Some(2),
29917                Self::Stable => std::option::Option::Some(3),
29918                Self::Extended => std::option::Option::Some(4),
29919                Self::UnknownValue(u) => u.0.value(),
29920            }
29921        }
29922
29923        /// Gets the enum value as a string.
29924        ///
29925        /// Returns `None` if the enum contains an unknown value deserialized from
29926        /// the integer representation of enums.
29927        pub fn name(&self) -> std::option::Option<&str> {
29928            match self {
29929                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
29930                Self::Rapid => std::option::Option::Some("RAPID"),
29931                Self::Regular => std::option::Option::Some("REGULAR"),
29932                Self::Stable => std::option::Option::Some("STABLE"),
29933                Self::Extended => std::option::Option::Some("EXTENDED"),
29934                Self::UnknownValue(u) => u.0.name(),
29935            }
29936        }
29937    }
29938
29939    impl std::default::Default for Channel {
29940        fn default() -> Self {
29941            use std::convert::From;
29942            Self::from(0)
29943        }
29944    }
29945
29946    impl std::fmt::Display for Channel {
29947        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29948            wkt::internal::display_enum(f, self.name(), self.value())
29949        }
29950    }
29951
29952    impl std::convert::From<i32> for Channel {
29953        fn from(value: i32) -> Self {
29954            match value {
29955                0 => Self::Unspecified,
29956                1 => Self::Rapid,
29957                2 => Self::Regular,
29958                3 => Self::Stable,
29959                4 => Self::Extended,
29960                _ => Self::UnknownValue(channel::UnknownValue(
29961                    wkt::internal::UnknownEnumValue::Integer(value),
29962                )),
29963            }
29964        }
29965    }
29966
29967    impl std::convert::From<&str> for Channel {
29968        fn from(value: &str) -> Self {
29969            use std::string::ToString;
29970            match value {
29971                "UNSPECIFIED" => Self::Unspecified,
29972                "RAPID" => Self::Rapid,
29973                "REGULAR" => Self::Regular,
29974                "STABLE" => Self::Stable,
29975                "EXTENDED" => Self::Extended,
29976                _ => Self::UnknownValue(channel::UnknownValue(
29977                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29978                )),
29979            }
29980        }
29981    }
29982
29983    impl serde::ser::Serialize for Channel {
29984        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29985        where
29986            S: serde::Serializer,
29987        {
29988            match self {
29989                Self::Unspecified => serializer.serialize_i32(0),
29990                Self::Rapid => serializer.serialize_i32(1),
29991                Self::Regular => serializer.serialize_i32(2),
29992                Self::Stable => serializer.serialize_i32(3),
29993                Self::Extended => serializer.serialize_i32(4),
29994                Self::UnknownValue(u) => u.0.serialize(serializer),
29995            }
29996        }
29997    }
29998
29999    impl<'de> serde::de::Deserialize<'de> for Channel {
30000        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30001        where
30002            D: serde::Deserializer<'de>,
30003        {
30004            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Channel>::new(
30005                ".google.container.v1.ReleaseChannel.Channel",
30006            ))
30007        }
30008    }
30009}
30010
30011/// Configuration for fine-grained cost management feature.
30012#[derive(Clone, Default, PartialEq)]
30013#[non_exhaustive]
30014pub struct CostManagementConfig {
30015    /// Whether the feature is enabled or not.
30016    pub enabled: bool,
30017
30018    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30019}
30020
30021impl CostManagementConfig {
30022    pub fn new() -> Self {
30023        std::default::Default::default()
30024    }
30025
30026    /// Sets the value of [enabled][crate::model::CostManagementConfig::enabled].
30027    ///
30028    /// # Example
30029    /// ```ignore,no_run
30030    /// # use google_cloud_container_v1::model::CostManagementConfig;
30031    /// let x = CostManagementConfig::new().set_enabled(true);
30032    /// ```
30033    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30034        self.enabled = v.into();
30035        self
30036    }
30037}
30038
30039impl wkt::message::Message for CostManagementConfig {
30040    fn typename() -> &'static str {
30041        "type.googleapis.com/google.container.v1.CostManagementConfig"
30042    }
30043}
30044
30045/// IntraNodeVisibilityConfig contains the desired config of the intra-node
30046/// visibility on this cluster.
30047#[derive(Clone, Default, PartialEq)]
30048#[non_exhaustive]
30049pub struct IntraNodeVisibilityConfig {
30050    /// Enables intra node visibility for this cluster.
30051    pub enabled: bool,
30052
30053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30054}
30055
30056impl IntraNodeVisibilityConfig {
30057    pub fn new() -> Self {
30058        std::default::Default::default()
30059    }
30060
30061    /// Sets the value of [enabled][crate::model::IntraNodeVisibilityConfig::enabled].
30062    ///
30063    /// # Example
30064    /// ```ignore,no_run
30065    /// # use google_cloud_container_v1::model::IntraNodeVisibilityConfig;
30066    /// let x = IntraNodeVisibilityConfig::new().set_enabled(true);
30067    /// ```
30068    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30069        self.enabled = v.into();
30070        self
30071    }
30072}
30073
30074impl wkt::message::Message for IntraNodeVisibilityConfig {
30075    fn typename() -> &'static str {
30076        "type.googleapis.com/google.container.v1.IntraNodeVisibilityConfig"
30077    }
30078}
30079
30080/// ILBSubsettingConfig contains the desired config of L4 Internal LoadBalancer
30081/// subsetting on this cluster.
30082#[derive(Clone, Default, PartialEq)]
30083#[non_exhaustive]
30084pub struct ILBSubsettingConfig {
30085    /// Enables l4 ILB subsetting for this cluster.
30086    pub enabled: bool,
30087
30088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30089}
30090
30091impl ILBSubsettingConfig {
30092    pub fn new() -> Self {
30093        std::default::Default::default()
30094    }
30095
30096    /// Sets the value of [enabled][crate::model::ILBSubsettingConfig::enabled].
30097    ///
30098    /// # Example
30099    /// ```ignore,no_run
30100    /// # use google_cloud_container_v1::model::ILBSubsettingConfig;
30101    /// let x = ILBSubsettingConfig::new().set_enabled(true);
30102    /// ```
30103    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30104        self.enabled = v.into();
30105        self
30106    }
30107}
30108
30109impl wkt::message::Message for ILBSubsettingConfig {
30110    fn typename() -> &'static str {
30111        "type.googleapis.com/google.container.v1.ILBSubsettingConfig"
30112    }
30113}
30114
30115/// DNSConfig contains the desired set of options for configuring clusterDNS.
30116#[derive(Clone, Default, PartialEq)]
30117#[non_exhaustive]
30118pub struct DNSConfig {
30119    /// cluster_dns indicates which in-cluster DNS provider should be used.
30120    pub cluster_dns: crate::model::dns_config::Provider,
30121
30122    /// cluster_dns_scope indicates the scope of access to cluster DNS records.
30123    pub cluster_dns_scope: crate::model::dns_config::DNSScope,
30124
30125    /// cluster_dns_domain is the suffix used for all cluster service records.
30126    pub cluster_dns_domain: std::string::String,
30127
30128    /// Optional. The domain used in Additive VPC scope.
30129    pub additive_vpc_scope_dns_domain: std::string::String,
30130
30131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30132}
30133
30134impl DNSConfig {
30135    pub fn new() -> Self {
30136        std::default::Default::default()
30137    }
30138
30139    /// Sets the value of [cluster_dns][crate::model::DNSConfig::cluster_dns].
30140    ///
30141    /// # Example
30142    /// ```ignore,no_run
30143    /// # use google_cloud_container_v1::model::DNSConfig;
30144    /// use google_cloud_container_v1::model::dns_config::Provider;
30145    /// let x0 = DNSConfig::new().set_cluster_dns(Provider::PlatformDefault);
30146    /// let x1 = DNSConfig::new().set_cluster_dns(Provider::CloudDns);
30147    /// let x2 = DNSConfig::new().set_cluster_dns(Provider::KubeDns);
30148    /// ```
30149    pub fn set_cluster_dns<T: std::convert::Into<crate::model::dns_config::Provider>>(
30150        mut self,
30151        v: T,
30152    ) -> Self {
30153        self.cluster_dns = v.into();
30154        self
30155    }
30156
30157    /// Sets the value of [cluster_dns_scope][crate::model::DNSConfig::cluster_dns_scope].
30158    ///
30159    /// # Example
30160    /// ```ignore,no_run
30161    /// # use google_cloud_container_v1::model::DNSConfig;
30162    /// use google_cloud_container_v1::model::dns_config::DNSScope;
30163    /// let x0 = DNSConfig::new().set_cluster_dns_scope(DNSScope::ClusterScope);
30164    /// let x1 = DNSConfig::new().set_cluster_dns_scope(DNSScope::VpcScope);
30165    /// ```
30166    pub fn set_cluster_dns_scope<T: std::convert::Into<crate::model::dns_config::DNSScope>>(
30167        mut self,
30168        v: T,
30169    ) -> Self {
30170        self.cluster_dns_scope = v.into();
30171        self
30172    }
30173
30174    /// Sets the value of [cluster_dns_domain][crate::model::DNSConfig::cluster_dns_domain].
30175    ///
30176    /// # Example
30177    /// ```ignore,no_run
30178    /// # use google_cloud_container_v1::model::DNSConfig;
30179    /// let x = DNSConfig::new().set_cluster_dns_domain("example");
30180    /// ```
30181    pub fn set_cluster_dns_domain<T: std::convert::Into<std::string::String>>(
30182        mut self,
30183        v: T,
30184    ) -> Self {
30185        self.cluster_dns_domain = v.into();
30186        self
30187    }
30188
30189    /// Sets the value of [additive_vpc_scope_dns_domain][crate::model::DNSConfig::additive_vpc_scope_dns_domain].
30190    ///
30191    /// # Example
30192    /// ```ignore,no_run
30193    /// # use google_cloud_container_v1::model::DNSConfig;
30194    /// let x = DNSConfig::new().set_additive_vpc_scope_dns_domain("example");
30195    /// ```
30196    pub fn set_additive_vpc_scope_dns_domain<T: std::convert::Into<std::string::String>>(
30197        mut self,
30198        v: T,
30199    ) -> Self {
30200        self.additive_vpc_scope_dns_domain = v.into();
30201        self
30202    }
30203}
30204
30205impl wkt::message::Message for DNSConfig {
30206    fn typename() -> &'static str {
30207        "type.googleapis.com/google.container.v1.DNSConfig"
30208    }
30209}
30210
30211/// Defines additional types related to [DNSConfig].
30212pub mod dns_config {
30213    #[allow(unused_imports)]
30214    use super::*;
30215
30216    /// Provider lists the various in-cluster DNS providers.
30217    ///
30218    /// # Working with unknown values
30219    ///
30220    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30221    /// additional enum variants at any time. Adding new variants is not considered
30222    /// a breaking change. Applications should write their code in anticipation of:
30223    ///
30224    /// - New values appearing in future releases of the client library, **and**
30225    /// - New values received dynamically, without application changes.
30226    ///
30227    /// Please consult the [Working with enums] section in the user guide for some
30228    /// guidelines.
30229    ///
30230    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30231    #[derive(Clone, Debug, PartialEq)]
30232    #[non_exhaustive]
30233    pub enum Provider {
30234        /// Default value
30235        Unspecified,
30236        /// Use GKE default DNS provider(kube-dns) for DNS resolution.
30237        PlatformDefault,
30238        /// Use CloudDNS for DNS resolution.
30239        CloudDns,
30240        /// Use KubeDNS for DNS resolution.
30241        KubeDns,
30242        /// If set, the enum was initialized with an unknown value.
30243        ///
30244        /// Applications can examine the value using [Provider::value] or
30245        /// [Provider::name].
30246        UnknownValue(provider::UnknownValue),
30247    }
30248
30249    #[doc(hidden)]
30250    pub mod provider {
30251        #[allow(unused_imports)]
30252        use super::*;
30253        #[derive(Clone, Debug, PartialEq)]
30254        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30255    }
30256
30257    impl Provider {
30258        /// Gets the enum value.
30259        ///
30260        /// Returns `None` if the enum contains an unknown value deserialized from
30261        /// the string representation of enums.
30262        pub fn value(&self) -> std::option::Option<i32> {
30263            match self {
30264                Self::Unspecified => std::option::Option::Some(0),
30265                Self::PlatformDefault => std::option::Option::Some(1),
30266                Self::CloudDns => std::option::Option::Some(2),
30267                Self::KubeDns => std::option::Option::Some(3),
30268                Self::UnknownValue(u) => u.0.value(),
30269            }
30270        }
30271
30272        /// Gets the enum value as a string.
30273        ///
30274        /// Returns `None` if the enum contains an unknown value deserialized from
30275        /// the integer representation of enums.
30276        pub fn name(&self) -> std::option::Option<&str> {
30277            match self {
30278                Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
30279                Self::PlatformDefault => std::option::Option::Some("PLATFORM_DEFAULT"),
30280                Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
30281                Self::KubeDns => std::option::Option::Some("KUBE_DNS"),
30282                Self::UnknownValue(u) => u.0.name(),
30283            }
30284        }
30285    }
30286
30287    impl std::default::Default for Provider {
30288        fn default() -> Self {
30289            use std::convert::From;
30290            Self::from(0)
30291        }
30292    }
30293
30294    impl std::fmt::Display for Provider {
30295        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30296            wkt::internal::display_enum(f, self.name(), self.value())
30297        }
30298    }
30299
30300    impl std::convert::From<i32> for Provider {
30301        fn from(value: i32) -> Self {
30302            match value {
30303                0 => Self::Unspecified,
30304                1 => Self::PlatformDefault,
30305                2 => Self::CloudDns,
30306                3 => Self::KubeDns,
30307                _ => Self::UnknownValue(provider::UnknownValue(
30308                    wkt::internal::UnknownEnumValue::Integer(value),
30309                )),
30310            }
30311        }
30312    }
30313
30314    impl std::convert::From<&str> for Provider {
30315        fn from(value: &str) -> Self {
30316            use std::string::ToString;
30317            match value {
30318                "PROVIDER_UNSPECIFIED" => Self::Unspecified,
30319                "PLATFORM_DEFAULT" => Self::PlatformDefault,
30320                "CLOUD_DNS" => Self::CloudDns,
30321                "KUBE_DNS" => Self::KubeDns,
30322                _ => Self::UnknownValue(provider::UnknownValue(
30323                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30324                )),
30325            }
30326        }
30327    }
30328
30329    impl serde::ser::Serialize for Provider {
30330        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30331        where
30332            S: serde::Serializer,
30333        {
30334            match self {
30335                Self::Unspecified => serializer.serialize_i32(0),
30336                Self::PlatformDefault => serializer.serialize_i32(1),
30337                Self::CloudDns => serializer.serialize_i32(2),
30338                Self::KubeDns => serializer.serialize_i32(3),
30339                Self::UnknownValue(u) => u.0.serialize(serializer),
30340            }
30341        }
30342    }
30343
30344    impl<'de> serde::de::Deserialize<'de> for Provider {
30345        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30346        where
30347            D: serde::Deserializer<'de>,
30348        {
30349            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
30350                ".google.container.v1.DNSConfig.Provider",
30351            ))
30352        }
30353    }
30354
30355    /// DNSScope lists the various scopes of access to cluster DNS records.
30356    ///
30357    /// # Working with unknown values
30358    ///
30359    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30360    /// additional enum variants at any time. Adding new variants is not considered
30361    /// a breaking change. Applications should write their code in anticipation of:
30362    ///
30363    /// - New values appearing in future releases of the client library, **and**
30364    /// - New values received dynamically, without application changes.
30365    ///
30366    /// Please consult the [Working with enums] section in the user guide for some
30367    /// guidelines.
30368    ///
30369    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30370    #[derive(Clone, Debug, PartialEq)]
30371    #[non_exhaustive]
30372    pub enum DNSScope {
30373        /// Default value, will be inferred as cluster scope.
30374        Unspecified,
30375        /// DNS records are accessible from within the cluster.
30376        ClusterScope,
30377        /// DNS records are accessible from within the VPC.
30378        VpcScope,
30379        /// If set, the enum was initialized with an unknown value.
30380        ///
30381        /// Applications can examine the value using [DNSScope::value] or
30382        /// [DNSScope::name].
30383        UnknownValue(dns_scope::UnknownValue),
30384    }
30385
30386    #[doc(hidden)]
30387    pub mod dns_scope {
30388        #[allow(unused_imports)]
30389        use super::*;
30390        #[derive(Clone, Debug, PartialEq)]
30391        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30392    }
30393
30394    impl DNSScope {
30395        /// Gets the enum value.
30396        ///
30397        /// Returns `None` if the enum contains an unknown value deserialized from
30398        /// the string representation of enums.
30399        pub fn value(&self) -> std::option::Option<i32> {
30400            match self {
30401                Self::Unspecified => std::option::Option::Some(0),
30402                Self::ClusterScope => std::option::Option::Some(1),
30403                Self::VpcScope => std::option::Option::Some(2),
30404                Self::UnknownValue(u) => u.0.value(),
30405            }
30406        }
30407
30408        /// Gets the enum value as a string.
30409        ///
30410        /// Returns `None` if the enum contains an unknown value deserialized from
30411        /// the integer representation of enums.
30412        pub fn name(&self) -> std::option::Option<&str> {
30413            match self {
30414                Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
30415                Self::ClusterScope => std::option::Option::Some("CLUSTER_SCOPE"),
30416                Self::VpcScope => std::option::Option::Some("VPC_SCOPE"),
30417                Self::UnknownValue(u) => u.0.name(),
30418            }
30419        }
30420    }
30421
30422    impl std::default::Default for DNSScope {
30423        fn default() -> Self {
30424            use std::convert::From;
30425            Self::from(0)
30426        }
30427    }
30428
30429    impl std::fmt::Display for DNSScope {
30430        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30431            wkt::internal::display_enum(f, self.name(), self.value())
30432        }
30433    }
30434
30435    impl std::convert::From<i32> for DNSScope {
30436        fn from(value: i32) -> Self {
30437            match value {
30438                0 => Self::Unspecified,
30439                1 => Self::ClusterScope,
30440                2 => Self::VpcScope,
30441                _ => Self::UnknownValue(dns_scope::UnknownValue(
30442                    wkt::internal::UnknownEnumValue::Integer(value),
30443                )),
30444            }
30445        }
30446    }
30447
30448    impl std::convert::From<&str> for DNSScope {
30449        fn from(value: &str) -> Self {
30450            use std::string::ToString;
30451            match value {
30452                "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
30453                "CLUSTER_SCOPE" => Self::ClusterScope,
30454                "VPC_SCOPE" => Self::VpcScope,
30455                _ => Self::UnknownValue(dns_scope::UnknownValue(
30456                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30457                )),
30458            }
30459        }
30460    }
30461
30462    impl serde::ser::Serialize for DNSScope {
30463        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30464        where
30465            S: serde::Serializer,
30466        {
30467            match self {
30468                Self::Unspecified => serializer.serialize_i32(0),
30469                Self::ClusterScope => serializer.serialize_i32(1),
30470                Self::VpcScope => serializer.serialize_i32(2),
30471                Self::UnknownValue(u) => u.0.serialize(serializer),
30472            }
30473        }
30474    }
30475
30476    impl<'de> serde::de::Deserialize<'de> for DNSScope {
30477        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30478        where
30479            D: serde::Deserializer<'de>,
30480        {
30481            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DNSScope>::new(
30482                ".google.container.v1.DNSConfig.DNSScope",
30483            ))
30484        }
30485    }
30486}
30487
30488/// Constraints applied to pods.
30489#[derive(Clone, Default, PartialEq)]
30490#[non_exhaustive]
30491pub struct MaxPodsConstraint {
30492    /// Constraint enforced on the max num of pods per node.
30493    pub max_pods_per_node: i64,
30494
30495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30496}
30497
30498impl MaxPodsConstraint {
30499    pub fn new() -> Self {
30500        std::default::Default::default()
30501    }
30502
30503    /// Sets the value of [max_pods_per_node][crate::model::MaxPodsConstraint::max_pods_per_node].
30504    ///
30505    /// # Example
30506    /// ```ignore,no_run
30507    /// # use google_cloud_container_v1::model::MaxPodsConstraint;
30508    /// let x = MaxPodsConstraint::new().set_max_pods_per_node(42);
30509    /// ```
30510    pub fn set_max_pods_per_node<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30511        self.max_pods_per_node = v.into();
30512        self
30513    }
30514}
30515
30516impl wkt::message::Message for MaxPodsConstraint {
30517    fn typename() -> &'static str {
30518        "type.googleapis.com/google.container.v1.MaxPodsConstraint"
30519    }
30520}
30521
30522/// Configuration for the use of Kubernetes Service Accounts in IAM policies.
30523#[derive(Clone, Default, PartialEq)]
30524#[non_exhaustive]
30525pub struct WorkloadIdentityConfig {
30526    /// The workload pool to attach all Kubernetes service accounts to.
30527    pub workload_pool: std::string::String,
30528
30529    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30530}
30531
30532impl WorkloadIdentityConfig {
30533    pub fn new() -> Self {
30534        std::default::Default::default()
30535    }
30536
30537    /// Sets the value of [workload_pool][crate::model::WorkloadIdentityConfig::workload_pool].
30538    ///
30539    /// # Example
30540    /// ```ignore,no_run
30541    /// # use google_cloud_container_v1::model::WorkloadIdentityConfig;
30542    /// let x = WorkloadIdentityConfig::new().set_workload_pool("example");
30543    /// ```
30544    pub fn set_workload_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30545        self.workload_pool = v.into();
30546        self
30547    }
30548}
30549
30550impl wkt::message::Message for WorkloadIdentityConfig {
30551    fn typename() -> &'static str {
30552        "type.googleapis.com/google.container.v1.WorkloadIdentityConfig"
30553    }
30554}
30555
30556/// IdentityServiceConfig is configuration for Identity Service which allows
30557/// customers to use external identity providers with the K8S API
30558#[derive(Clone, Default, PartialEq)]
30559#[non_exhaustive]
30560pub struct IdentityServiceConfig {
30561    /// Whether to enable the Identity Service component
30562    pub enabled: bool,
30563
30564    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30565}
30566
30567impl IdentityServiceConfig {
30568    pub fn new() -> Self {
30569        std::default::Default::default()
30570    }
30571
30572    /// Sets the value of [enabled][crate::model::IdentityServiceConfig::enabled].
30573    ///
30574    /// # Example
30575    /// ```ignore,no_run
30576    /// # use google_cloud_container_v1::model::IdentityServiceConfig;
30577    /// let x = IdentityServiceConfig::new().set_enabled(true);
30578    /// ```
30579    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30580        self.enabled = v.into();
30581        self
30582    }
30583}
30584
30585impl wkt::message::Message for IdentityServiceConfig {
30586    fn typename() -> &'static str {
30587        "type.googleapis.com/google.container.v1.IdentityServiceConfig"
30588    }
30589}
30590
30591/// Configuration for issuance of mTLS keys and certificates to Kubernetes pods.
30592#[derive(Clone, Default, PartialEq)]
30593#[non_exhaustive]
30594pub struct MeshCertificates {
30595    /// enable_certificates controls issuance of workload mTLS certificates.
30596    ///
30597    /// If set, the GKE Workload Identity Certificates controller and node agent
30598    /// will be deployed in the cluster, which can then be configured by creating a
30599    /// WorkloadCertificateConfig Custom Resource.
30600    ///
30601    /// Requires Workload Identity
30602    /// ([workload_pool][google.container.v1.WorkloadIdentityConfig.workload_pool]
30603    /// must be non-empty).
30604    ///
30605    /// [google.container.v1.WorkloadIdentityConfig.workload_pool]: crate::model::WorkloadIdentityConfig::workload_pool
30606    pub enable_certificates: std::option::Option<wkt::BoolValue>,
30607
30608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30609}
30610
30611impl MeshCertificates {
30612    pub fn new() -> Self {
30613        std::default::Default::default()
30614    }
30615
30616    /// Sets the value of [enable_certificates][crate::model::MeshCertificates::enable_certificates].
30617    ///
30618    /// # Example
30619    /// ```ignore,no_run
30620    /// # use google_cloud_container_v1::model::MeshCertificates;
30621    /// use wkt::BoolValue;
30622    /// let x = MeshCertificates::new().set_enable_certificates(BoolValue::default()/* use setters */);
30623    /// ```
30624    pub fn set_enable_certificates<T>(mut self, v: T) -> Self
30625    where
30626        T: std::convert::Into<wkt::BoolValue>,
30627    {
30628        self.enable_certificates = std::option::Option::Some(v.into());
30629        self
30630    }
30631
30632    /// Sets or clears the value of [enable_certificates][crate::model::MeshCertificates::enable_certificates].
30633    ///
30634    /// # Example
30635    /// ```ignore,no_run
30636    /// # use google_cloud_container_v1::model::MeshCertificates;
30637    /// use wkt::BoolValue;
30638    /// let x = MeshCertificates::new().set_or_clear_enable_certificates(Some(BoolValue::default()/* use setters */));
30639    /// let x = MeshCertificates::new().set_or_clear_enable_certificates(None::<BoolValue>);
30640    /// ```
30641    pub fn set_or_clear_enable_certificates<T>(mut self, v: std::option::Option<T>) -> Self
30642    where
30643        T: std::convert::Into<wkt::BoolValue>,
30644    {
30645        self.enable_certificates = v.map(|x| x.into());
30646        self
30647    }
30648}
30649
30650impl wkt::message::Message for MeshCertificates {
30651    fn typename() -> &'static str {
30652        "type.googleapis.com/google.container.v1.MeshCertificates"
30653    }
30654}
30655
30656/// Configuration of etcd encryption.
30657#[derive(Clone, Default, PartialEq)]
30658#[non_exhaustive]
30659pub struct DatabaseEncryption {
30660    /// Name of CloudKMS key to use for the encryption of secrets in etcd.
30661    /// Ex. projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key
30662    pub key_name: std::string::String,
30663
30664    /// The desired state of etcd encryption.
30665    pub state: crate::model::database_encryption::State,
30666
30667    /// Output only. The current state of etcd encryption.
30668    pub current_state: std::option::Option<crate::model::database_encryption::CurrentState>,
30669
30670    /// Output only. Keys in use by the cluster for decrypting
30671    /// existing objects, in addition to the key in `key_name`.
30672    ///
30673    /// Each item is a CloudKMS key resource.
30674    pub decryption_keys: std::vec::Vec<std::string::String>,
30675
30676    /// Output only. Records errors seen during DatabaseEncryption update
30677    /// operations.
30678    pub last_operation_errors: std::vec::Vec<crate::model::database_encryption::OperationError>,
30679
30680    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30681}
30682
30683impl DatabaseEncryption {
30684    pub fn new() -> Self {
30685        std::default::Default::default()
30686    }
30687
30688    /// Sets the value of [key_name][crate::model::DatabaseEncryption::key_name].
30689    ///
30690    /// # Example
30691    /// ```ignore,no_run
30692    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30693    /// let x = DatabaseEncryption::new().set_key_name("example");
30694    /// ```
30695    pub fn set_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30696        self.key_name = v.into();
30697        self
30698    }
30699
30700    /// Sets the value of [state][crate::model::DatabaseEncryption::state].
30701    ///
30702    /// # Example
30703    /// ```ignore,no_run
30704    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30705    /// use google_cloud_container_v1::model::database_encryption::State;
30706    /// let x0 = DatabaseEncryption::new().set_state(State::Encrypted);
30707    /// let x1 = DatabaseEncryption::new().set_state(State::Decrypted);
30708    /// ```
30709    pub fn set_state<T: std::convert::Into<crate::model::database_encryption::State>>(
30710        mut self,
30711        v: T,
30712    ) -> Self {
30713        self.state = v.into();
30714        self
30715    }
30716
30717    /// Sets the value of [current_state][crate::model::DatabaseEncryption::current_state].
30718    ///
30719    /// # Example
30720    /// ```ignore,no_run
30721    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30722    /// use google_cloud_container_v1::model::database_encryption::CurrentState;
30723    /// let x0 = DatabaseEncryption::new().set_current_state(CurrentState::Encrypted);
30724    /// let x1 = DatabaseEncryption::new().set_current_state(CurrentState::Decrypted);
30725    /// let x2 = DatabaseEncryption::new().set_current_state(CurrentState::EncryptionPending);
30726    /// ```
30727    pub fn set_current_state<T>(mut self, v: T) -> Self
30728    where
30729        T: std::convert::Into<crate::model::database_encryption::CurrentState>,
30730    {
30731        self.current_state = std::option::Option::Some(v.into());
30732        self
30733    }
30734
30735    /// Sets or clears the value of [current_state][crate::model::DatabaseEncryption::current_state].
30736    ///
30737    /// # Example
30738    /// ```ignore,no_run
30739    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30740    /// use google_cloud_container_v1::model::database_encryption::CurrentState;
30741    /// let x0 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::Encrypted));
30742    /// let x1 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::Decrypted));
30743    /// let x2 = DatabaseEncryption::new().set_or_clear_current_state(Some(CurrentState::EncryptionPending));
30744    /// let x_none = DatabaseEncryption::new().set_or_clear_current_state(None::<CurrentState>);
30745    /// ```
30746    pub fn set_or_clear_current_state<T>(mut self, v: std::option::Option<T>) -> Self
30747    where
30748        T: std::convert::Into<crate::model::database_encryption::CurrentState>,
30749    {
30750        self.current_state = v.map(|x| x.into());
30751        self
30752    }
30753
30754    /// Sets the value of [decryption_keys][crate::model::DatabaseEncryption::decryption_keys].
30755    ///
30756    /// # Example
30757    /// ```ignore,no_run
30758    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30759    /// let x = DatabaseEncryption::new().set_decryption_keys(["a", "b", "c"]);
30760    /// ```
30761    pub fn set_decryption_keys<T, V>(mut self, v: T) -> Self
30762    where
30763        T: std::iter::IntoIterator<Item = V>,
30764        V: std::convert::Into<std::string::String>,
30765    {
30766        use std::iter::Iterator;
30767        self.decryption_keys = v.into_iter().map(|i| i.into()).collect();
30768        self
30769    }
30770
30771    /// Sets the value of [last_operation_errors][crate::model::DatabaseEncryption::last_operation_errors].
30772    ///
30773    /// # Example
30774    /// ```ignore,no_run
30775    /// # use google_cloud_container_v1::model::DatabaseEncryption;
30776    /// use google_cloud_container_v1::model::database_encryption::OperationError;
30777    /// let x = DatabaseEncryption::new()
30778    ///     .set_last_operation_errors([
30779    ///         OperationError::default()/* use setters */,
30780    ///         OperationError::default()/* use (different) setters */,
30781    ///     ]);
30782    /// ```
30783    pub fn set_last_operation_errors<T, V>(mut self, v: T) -> Self
30784    where
30785        T: std::iter::IntoIterator<Item = V>,
30786        V: std::convert::Into<crate::model::database_encryption::OperationError>,
30787    {
30788        use std::iter::Iterator;
30789        self.last_operation_errors = v.into_iter().map(|i| i.into()).collect();
30790        self
30791    }
30792}
30793
30794impl wkt::message::Message for DatabaseEncryption {
30795    fn typename() -> &'static str {
30796        "type.googleapis.com/google.container.v1.DatabaseEncryption"
30797    }
30798}
30799
30800/// Defines additional types related to [DatabaseEncryption].
30801pub mod database_encryption {
30802    #[allow(unused_imports)]
30803    use super::*;
30804
30805    /// OperationError records errors seen from CloudKMS keys
30806    /// encountered during updates to DatabaseEncryption configuration.
30807    #[derive(Clone, Default, PartialEq)]
30808    #[non_exhaustive]
30809    pub struct OperationError {
30810        /// CloudKMS key resource that had the error.
30811        pub key_name: std::string::String,
30812
30813        /// Description of the error seen during the operation.
30814        pub error_message: std::string::String,
30815
30816        /// Time when the CloudKMS error was seen.
30817        pub timestamp: std::option::Option<wkt::Timestamp>,
30818
30819        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30820    }
30821
30822    impl OperationError {
30823        pub fn new() -> Self {
30824            std::default::Default::default()
30825        }
30826
30827        /// Sets the value of [key_name][crate::model::database_encryption::OperationError::key_name].
30828        ///
30829        /// # Example
30830        /// ```ignore,no_run
30831        /// # use google_cloud_container_v1::model::database_encryption::OperationError;
30832        /// let x = OperationError::new().set_key_name("example");
30833        /// ```
30834        pub fn set_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30835            self.key_name = v.into();
30836            self
30837        }
30838
30839        /// Sets the value of [error_message][crate::model::database_encryption::OperationError::error_message].
30840        ///
30841        /// # Example
30842        /// ```ignore,no_run
30843        /// # use google_cloud_container_v1::model::database_encryption::OperationError;
30844        /// let x = OperationError::new().set_error_message("example");
30845        /// ```
30846        pub fn set_error_message<T: std::convert::Into<std::string::String>>(
30847            mut self,
30848            v: T,
30849        ) -> Self {
30850            self.error_message = v.into();
30851            self
30852        }
30853
30854        /// Sets the value of [timestamp][crate::model::database_encryption::OperationError::timestamp].
30855        ///
30856        /// # Example
30857        /// ```ignore,no_run
30858        /// # use google_cloud_container_v1::model::database_encryption::OperationError;
30859        /// use wkt::Timestamp;
30860        /// let x = OperationError::new().set_timestamp(Timestamp::default()/* use setters */);
30861        /// ```
30862        pub fn set_timestamp<T>(mut self, v: T) -> Self
30863        where
30864            T: std::convert::Into<wkt::Timestamp>,
30865        {
30866            self.timestamp = std::option::Option::Some(v.into());
30867            self
30868        }
30869
30870        /// Sets or clears the value of [timestamp][crate::model::database_encryption::OperationError::timestamp].
30871        ///
30872        /// # Example
30873        /// ```ignore,no_run
30874        /// # use google_cloud_container_v1::model::database_encryption::OperationError;
30875        /// use wkt::Timestamp;
30876        /// let x = OperationError::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
30877        /// let x = OperationError::new().set_or_clear_timestamp(None::<Timestamp>);
30878        /// ```
30879        pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
30880        where
30881            T: std::convert::Into<wkt::Timestamp>,
30882        {
30883            self.timestamp = v.map(|x| x.into());
30884            self
30885        }
30886    }
30887
30888    impl wkt::message::Message for OperationError {
30889        fn typename() -> &'static str {
30890            "type.googleapis.com/google.container.v1.DatabaseEncryption.OperationError"
30891        }
30892    }
30893
30894    /// State of etcd encryption.
30895    ///
30896    /// # Working with unknown values
30897    ///
30898    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30899    /// additional enum variants at any time. Adding new variants is not considered
30900    /// a breaking change. Applications should write their code in anticipation of:
30901    ///
30902    /// - New values appearing in future releases of the client library, **and**
30903    /// - New values received dynamically, without application changes.
30904    ///
30905    /// Please consult the [Working with enums] section in the user guide for some
30906    /// guidelines.
30907    ///
30908    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30909    #[derive(Clone, Debug, PartialEq)]
30910    #[non_exhaustive]
30911    pub enum State {
30912        /// Should never be set
30913        Unknown,
30914        /// Secrets in etcd are encrypted.
30915        Encrypted,
30916        /// Secrets in etcd are stored in plain text (at etcd level) - this is
30917        /// unrelated to Compute Engine level full disk encryption.
30918        Decrypted,
30919        /// If set, the enum was initialized with an unknown value.
30920        ///
30921        /// Applications can examine the value using [State::value] or
30922        /// [State::name].
30923        UnknownValue(state::UnknownValue),
30924    }
30925
30926    #[doc(hidden)]
30927    pub mod state {
30928        #[allow(unused_imports)]
30929        use super::*;
30930        #[derive(Clone, Debug, PartialEq)]
30931        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30932    }
30933
30934    impl State {
30935        /// Gets the enum value.
30936        ///
30937        /// Returns `None` if the enum contains an unknown value deserialized from
30938        /// the string representation of enums.
30939        pub fn value(&self) -> std::option::Option<i32> {
30940            match self {
30941                Self::Unknown => std::option::Option::Some(0),
30942                Self::Encrypted => std::option::Option::Some(1),
30943                Self::Decrypted => std::option::Option::Some(2),
30944                Self::UnknownValue(u) => u.0.value(),
30945            }
30946        }
30947
30948        /// Gets the enum value as a string.
30949        ///
30950        /// Returns `None` if the enum contains an unknown value deserialized from
30951        /// the integer representation of enums.
30952        pub fn name(&self) -> std::option::Option<&str> {
30953            match self {
30954                Self::Unknown => std::option::Option::Some("UNKNOWN"),
30955                Self::Encrypted => std::option::Option::Some("ENCRYPTED"),
30956                Self::Decrypted => std::option::Option::Some("DECRYPTED"),
30957                Self::UnknownValue(u) => u.0.name(),
30958            }
30959        }
30960    }
30961
30962    impl std::default::Default for State {
30963        fn default() -> Self {
30964            use std::convert::From;
30965            Self::from(0)
30966        }
30967    }
30968
30969    impl std::fmt::Display for State {
30970        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30971            wkt::internal::display_enum(f, self.name(), self.value())
30972        }
30973    }
30974
30975    impl std::convert::From<i32> for State {
30976        fn from(value: i32) -> Self {
30977            match value {
30978                0 => Self::Unknown,
30979                1 => Self::Encrypted,
30980                2 => Self::Decrypted,
30981                _ => Self::UnknownValue(state::UnknownValue(
30982                    wkt::internal::UnknownEnumValue::Integer(value),
30983                )),
30984            }
30985        }
30986    }
30987
30988    impl std::convert::From<&str> for State {
30989        fn from(value: &str) -> Self {
30990            use std::string::ToString;
30991            match value {
30992                "UNKNOWN" => Self::Unknown,
30993                "ENCRYPTED" => Self::Encrypted,
30994                "DECRYPTED" => Self::Decrypted,
30995                _ => Self::UnknownValue(state::UnknownValue(
30996                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30997                )),
30998            }
30999        }
31000    }
31001
31002    impl serde::ser::Serialize for State {
31003        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31004        where
31005            S: serde::Serializer,
31006        {
31007            match self {
31008                Self::Unknown => serializer.serialize_i32(0),
31009                Self::Encrypted => serializer.serialize_i32(1),
31010                Self::Decrypted => serializer.serialize_i32(2),
31011                Self::UnknownValue(u) => u.0.serialize(serializer),
31012            }
31013        }
31014    }
31015
31016    impl<'de> serde::de::Deserialize<'de> for State {
31017        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31018        where
31019            D: serde::Deserializer<'de>,
31020        {
31021            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
31022                ".google.container.v1.DatabaseEncryption.State",
31023            ))
31024        }
31025    }
31026
31027    /// Current State of etcd encryption.
31028    ///
31029    /// # Working with unknown values
31030    ///
31031    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31032    /// additional enum variants at any time. Adding new variants is not considered
31033    /// a breaking change. Applications should write their code in anticipation of:
31034    ///
31035    /// - New values appearing in future releases of the client library, **and**
31036    /// - New values received dynamically, without application changes.
31037    ///
31038    /// Please consult the [Working with enums] section in the user guide for some
31039    /// guidelines.
31040    ///
31041    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31042    #[derive(Clone, Debug, PartialEq)]
31043    #[non_exhaustive]
31044    pub enum CurrentState {
31045        /// Should never be set
31046        Unspecified,
31047        /// Secrets in etcd are encrypted.
31048        Encrypted,
31049        /// Secrets in etcd are stored in plain text (at etcd level) - this is
31050        /// unrelated to Compute Engine level full disk encryption.
31051        Decrypted,
31052        /// Encryption (or re-encryption with a different CloudKMS key)
31053        /// of Secrets is in progress.
31054        EncryptionPending,
31055        /// Encryption (or re-encryption with a different CloudKMS key) of Secrets in
31056        /// etcd encountered an error.
31057        EncryptionError,
31058        /// De-crypting Secrets to plain text in etcd is in progress.
31059        DecryptionPending,
31060        /// De-crypting Secrets to plain text in etcd encountered an error.
31061        DecryptionError,
31062        /// If set, the enum was initialized with an unknown value.
31063        ///
31064        /// Applications can examine the value using [CurrentState::value] or
31065        /// [CurrentState::name].
31066        UnknownValue(current_state::UnknownValue),
31067    }
31068
31069    #[doc(hidden)]
31070    pub mod current_state {
31071        #[allow(unused_imports)]
31072        use super::*;
31073        #[derive(Clone, Debug, PartialEq)]
31074        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31075    }
31076
31077    impl CurrentState {
31078        /// Gets the enum value.
31079        ///
31080        /// Returns `None` if the enum contains an unknown value deserialized from
31081        /// the string representation of enums.
31082        pub fn value(&self) -> std::option::Option<i32> {
31083            match self {
31084                Self::Unspecified => std::option::Option::Some(0),
31085                Self::Encrypted => std::option::Option::Some(7),
31086                Self::Decrypted => std::option::Option::Some(2),
31087                Self::EncryptionPending => std::option::Option::Some(3),
31088                Self::EncryptionError => std::option::Option::Some(4),
31089                Self::DecryptionPending => std::option::Option::Some(5),
31090                Self::DecryptionError => std::option::Option::Some(6),
31091                Self::UnknownValue(u) => u.0.value(),
31092            }
31093        }
31094
31095        /// Gets the enum value as a string.
31096        ///
31097        /// Returns `None` if the enum contains an unknown value deserialized from
31098        /// the integer representation of enums.
31099        pub fn name(&self) -> std::option::Option<&str> {
31100            match self {
31101                Self::Unspecified => std::option::Option::Some("CURRENT_STATE_UNSPECIFIED"),
31102                Self::Encrypted => std::option::Option::Some("CURRENT_STATE_ENCRYPTED"),
31103                Self::Decrypted => std::option::Option::Some("CURRENT_STATE_DECRYPTED"),
31104                Self::EncryptionPending => {
31105                    std::option::Option::Some("CURRENT_STATE_ENCRYPTION_PENDING")
31106                }
31107                Self::EncryptionError => {
31108                    std::option::Option::Some("CURRENT_STATE_ENCRYPTION_ERROR")
31109                }
31110                Self::DecryptionPending => {
31111                    std::option::Option::Some("CURRENT_STATE_DECRYPTION_PENDING")
31112                }
31113                Self::DecryptionError => {
31114                    std::option::Option::Some("CURRENT_STATE_DECRYPTION_ERROR")
31115                }
31116                Self::UnknownValue(u) => u.0.name(),
31117            }
31118        }
31119    }
31120
31121    impl std::default::Default for CurrentState {
31122        fn default() -> Self {
31123            use std::convert::From;
31124            Self::from(0)
31125        }
31126    }
31127
31128    impl std::fmt::Display for CurrentState {
31129        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31130            wkt::internal::display_enum(f, self.name(), self.value())
31131        }
31132    }
31133
31134    impl std::convert::From<i32> for CurrentState {
31135        fn from(value: i32) -> Self {
31136            match value {
31137                0 => Self::Unspecified,
31138                2 => Self::Decrypted,
31139                3 => Self::EncryptionPending,
31140                4 => Self::EncryptionError,
31141                5 => Self::DecryptionPending,
31142                6 => Self::DecryptionError,
31143                7 => Self::Encrypted,
31144                _ => Self::UnknownValue(current_state::UnknownValue(
31145                    wkt::internal::UnknownEnumValue::Integer(value),
31146                )),
31147            }
31148        }
31149    }
31150
31151    impl std::convert::From<&str> for CurrentState {
31152        fn from(value: &str) -> Self {
31153            use std::string::ToString;
31154            match value {
31155                "CURRENT_STATE_UNSPECIFIED" => Self::Unspecified,
31156                "CURRENT_STATE_ENCRYPTED" => Self::Encrypted,
31157                "CURRENT_STATE_DECRYPTED" => Self::Decrypted,
31158                "CURRENT_STATE_ENCRYPTION_PENDING" => Self::EncryptionPending,
31159                "CURRENT_STATE_ENCRYPTION_ERROR" => Self::EncryptionError,
31160                "CURRENT_STATE_DECRYPTION_PENDING" => Self::DecryptionPending,
31161                "CURRENT_STATE_DECRYPTION_ERROR" => Self::DecryptionError,
31162                _ => Self::UnknownValue(current_state::UnknownValue(
31163                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31164                )),
31165            }
31166        }
31167    }
31168
31169    impl serde::ser::Serialize for CurrentState {
31170        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31171        where
31172            S: serde::Serializer,
31173        {
31174            match self {
31175                Self::Unspecified => serializer.serialize_i32(0),
31176                Self::Encrypted => serializer.serialize_i32(7),
31177                Self::Decrypted => serializer.serialize_i32(2),
31178                Self::EncryptionPending => serializer.serialize_i32(3),
31179                Self::EncryptionError => serializer.serialize_i32(4),
31180                Self::DecryptionPending => serializer.serialize_i32(5),
31181                Self::DecryptionError => serializer.serialize_i32(6),
31182                Self::UnknownValue(u) => u.0.serialize(serializer),
31183            }
31184        }
31185    }
31186
31187    impl<'de> serde::de::Deserialize<'de> for CurrentState {
31188        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31189        where
31190            D: serde::Deserializer<'de>,
31191        {
31192            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurrentState>::new(
31193                ".google.container.v1.DatabaseEncryption.CurrentState",
31194            ))
31195        }
31196    }
31197}
31198
31199/// ListUsableSubnetworksRequest requests the list of usable subnetworks
31200/// available to a user for creating clusters.
31201#[derive(Clone, Default, PartialEq)]
31202#[non_exhaustive]
31203pub struct ListUsableSubnetworksRequest {
31204    /// The parent project where subnetworks are usable.
31205    /// Specified in the format `projects/*`.
31206    pub parent: std::string::String,
31207
31208    /// Filtering currently only supports equality on the networkProjectId and must
31209    /// be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId`
31210    /// is the project which owns the listed subnetworks. This defaults to the
31211    /// parent project ID.
31212    pub filter: std::string::String,
31213
31214    /// The max number of results per page that should be returned. If the number
31215    /// of available results is larger than `page_size`, a `next_page_token` is
31216    /// returned which can be used to get the next page of results in subsequent
31217    /// requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
31218    pub page_size: i32,
31219
31220    /// Specifies a page token to use. Set this to the nextPageToken returned by
31221    /// previous list requests to get the next page of results.
31222    pub page_token: std::string::String,
31223
31224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31225}
31226
31227impl ListUsableSubnetworksRequest {
31228    pub fn new() -> Self {
31229        std::default::Default::default()
31230    }
31231
31232    /// Sets the value of [parent][crate::model::ListUsableSubnetworksRequest::parent].
31233    ///
31234    /// # Example
31235    /// ```ignore,no_run
31236    /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
31237    /// let x = ListUsableSubnetworksRequest::new().set_parent("example");
31238    /// ```
31239    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31240        self.parent = v.into();
31241        self
31242    }
31243
31244    /// Sets the value of [filter][crate::model::ListUsableSubnetworksRequest::filter].
31245    ///
31246    /// # Example
31247    /// ```ignore,no_run
31248    /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
31249    /// let x = ListUsableSubnetworksRequest::new().set_filter("example");
31250    /// ```
31251    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31252        self.filter = v.into();
31253        self
31254    }
31255
31256    /// Sets the value of [page_size][crate::model::ListUsableSubnetworksRequest::page_size].
31257    ///
31258    /// # Example
31259    /// ```ignore,no_run
31260    /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
31261    /// let x = ListUsableSubnetworksRequest::new().set_page_size(42);
31262    /// ```
31263    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31264        self.page_size = v.into();
31265        self
31266    }
31267
31268    /// Sets the value of [page_token][crate::model::ListUsableSubnetworksRequest::page_token].
31269    ///
31270    /// # Example
31271    /// ```ignore,no_run
31272    /// # use google_cloud_container_v1::model::ListUsableSubnetworksRequest;
31273    /// let x = ListUsableSubnetworksRequest::new().set_page_token("example");
31274    /// ```
31275    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31276        self.page_token = v.into();
31277        self
31278    }
31279}
31280
31281impl wkt::message::Message for ListUsableSubnetworksRequest {
31282    fn typename() -> &'static str {
31283        "type.googleapis.com/google.container.v1.ListUsableSubnetworksRequest"
31284    }
31285}
31286
31287/// ListUsableSubnetworksResponse is the response of
31288/// ListUsableSubnetworksRequest.
31289#[derive(Clone, Default, PartialEq)]
31290#[non_exhaustive]
31291pub struct ListUsableSubnetworksResponse {
31292    /// A list of usable subnetworks in the specified network project.
31293    pub subnetworks: std::vec::Vec<crate::model::UsableSubnetwork>,
31294
31295    /// This token allows you to get the next page of results for list requests.
31296    /// If the number of results is larger than `page_size`, use the
31297    /// `next_page_token` as a value for the query parameter `page_token` in the
31298    /// next request. The value will become empty when there are no more pages.
31299    pub next_page_token: std::string::String,
31300
31301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31302}
31303
31304impl ListUsableSubnetworksResponse {
31305    pub fn new() -> Self {
31306        std::default::Default::default()
31307    }
31308
31309    /// Sets the value of [subnetworks][crate::model::ListUsableSubnetworksResponse::subnetworks].
31310    ///
31311    /// # Example
31312    /// ```ignore,no_run
31313    /// # use google_cloud_container_v1::model::ListUsableSubnetworksResponse;
31314    /// use google_cloud_container_v1::model::UsableSubnetwork;
31315    /// let x = ListUsableSubnetworksResponse::new()
31316    ///     .set_subnetworks([
31317    ///         UsableSubnetwork::default()/* use setters */,
31318    ///         UsableSubnetwork::default()/* use (different) setters */,
31319    ///     ]);
31320    /// ```
31321    pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
31322    where
31323        T: std::iter::IntoIterator<Item = V>,
31324        V: std::convert::Into<crate::model::UsableSubnetwork>,
31325    {
31326        use std::iter::Iterator;
31327        self.subnetworks = v.into_iter().map(|i| i.into()).collect();
31328        self
31329    }
31330
31331    /// Sets the value of [next_page_token][crate::model::ListUsableSubnetworksResponse::next_page_token].
31332    ///
31333    /// # Example
31334    /// ```ignore,no_run
31335    /// # use google_cloud_container_v1::model::ListUsableSubnetworksResponse;
31336    /// let x = ListUsableSubnetworksResponse::new().set_next_page_token("example");
31337    /// ```
31338    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31339        self.next_page_token = v.into();
31340        self
31341    }
31342}
31343
31344impl wkt::message::Message for ListUsableSubnetworksResponse {
31345    fn typename() -> &'static str {
31346        "type.googleapis.com/google.container.v1.ListUsableSubnetworksResponse"
31347    }
31348}
31349
31350#[doc(hidden)]
31351impl gax::paginator::internal::PageableResponse for ListUsableSubnetworksResponse {
31352    type PageItem = crate::model::UsableSubnetwork;
31353
31354    fn items(self) -> std::vec::Vec<Self::PageItem> {
31355        self.subnetworks
31356    }
31357
31358    fn next_page_token(&self) -> std::string::String {
31359        use std::clone::Clone;
31360        self.next_page_token.clone()
31361    }
31362}
31363
31364/// Secondary IP range of a usable subnetwork.
31365#[derive(Clone, Default, PartialEq)]
31366#[non_exhaustive]
31367pub struct UsableSubnetworkSecondaryRange {
31368    /// The name associated with this subnetwork secondary range, used when adding
31369    /// an alias IP range to a VM instance.
31370    pub range_name: std::string::String,
31371
31372    /// The range of IP addresses belonging to this subnetwork secondary range.
31373    pub ip_cidr_range: std::string::String,
31374
31375    /// This field is to determine the status of the secondary range programmably.
31376    pub status: crate::model::usable_subnetwork_secondary_range::Status,
31377
31378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31379}
31380
31381impl UsableSubnetworkSecondaryRange {
31382    pub fn new() -> Self {
31383        std::default::Default::default()
31384    }
31385
31386    /// Sets the value of [range_name][crate::model::UsableSubnetworkSecondaryRange::range_name].
31387    ///
31388    /// # Example
31389    /// ```ignore,no_run
31390    /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
31391    /// let x = UsableSubnetworkSecondaryRange::new().set_range_name("example");
31392    /// ```
31393    pub fn set_range_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31394        self.range_name = v.into();
31395        self
31396    }
31397
31398    /// Sets the value of [ip_cidr_range][crate::model::UsableSubnetworkSecondaryRange::ip_cidr_range].
31399    ///
31400    /// # Example
31401    /// ```ignore,no_run
31402    /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
31403    /// let x = UsableSubnetworkSecondaryRange::new().set_ip_cidr_range("example");
31404    /// ```
31405    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31406        self.ip_cidr_range = v.into();
31407        self
31408    }
31409
31410    /// Sets the value of [status][crate::model::UsableSubnetworkSecondaryRange::status].
31411    ///
31412    /// # Example
31413    /// ```ignore,no_run
31414    /// # use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
31415    /// use google_cloud_container_v1::model::usable_subnetwork_secondary_range::Status;
31416    /// let x0 = UsableSubnetworkSecondaryRange::new().set_status(Status::Unused);
31417    /// let x1 = UsableSubnetworkSecondaryRange::new().set_status(Status::InUseService);
31418    /// let x2 = UsableSubnetworkSecondaryRange::new().set_status(Status::InUseShareablePod);
31419    /// ```
31420    pub fn set_status<
31421        T: std::convert::Into<crate::model::usable_subnetwork_secondary_range::Status>,
31422    >(
31423        mut self,
31424        v: T,
31425    ) -> Self {
31426        self.status = v.into();
31427        self
31428    }
31429}
31430
31431impl wkt::message::Message for UsableSubnetworkSecondaryRange {
31432    fn typename() -> &'static str {
31433        "type.googleapis.com/google.container.v1.UsableSubnetworkSecondaryRange"
31434    }
31435}
31436
31437/// Defines additional types related to [UsableSubnetworkSecondaryRange].
31438pub mod usable_subnetwork_secondary_range {
31439    #[allow(unused_imports)]
31440    use super::*;
31441
31442    /// Status shows the current usage of a secondary IP range.
31443    ///
31444    /// # Working with unknown values
31445    ///
31446    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31447    /// additional enum variants at any time. Adding new variants is not considered
31448    /// a breaking change. Applications should write their code in anticipation of:
31449    ///
31450    /// - New values appearing in future releases of the client library, **and**
31451    /// - New values received dynamically, without application changes.
31452    ///
31453    /// Please consult the [Working with enums] section in the user guide for some
31454    /// guidelines.
31455    ///
31456    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31457    #[derive(Clone, Debug, PartialEq)]
31458    #[non_exhaustive]
31459    pub enum Status {
31460        /// UNKNOWN is the zero value of the Status enum. It's not a valid status.
31461        Unknown,
31462        /// UNUSED denotes that this range is unclaimed by any cluster.
31463        Unused,
31464        /// IN_USE_SERVICE denotes that this range is claimed by cluster(s) for
31465        /// services. User-managed services range can be shared between clusters
31466        /// within the same subnetwork.
31467        InUseService,
31468        /// IN_USE_SHAREABLE_POD denotes this range was created by the network admin
31469        /// and is currently claimed by a cluster for pods. It can only be used by
31470        /// other clusters as a pod range.
31471        InUseShareablePod,
31472        /// IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed
31473        /// for pods. It cannot be used for other clusters.
31474        InUseManagedPod,
31475        /// If set, the enum was initialized with an unknown value.
31476        ///
31477        /// Applications can examine the value using [Status::value] or
31478        /// [Status::name].
31479        UnknownValue(status::UnknownValue),
31480    }
31481
31482    #[doc(hidden)]
31483    pub mod status {
31484        #[allow(unused_imports)]
31485        use super::*;
31486        #[derive(Clone, Debug, PartialEq)]
31487        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31488    }
31489
31490    impl Status {
31491        /// Gets the enum value.
31492        ///
31493        /// Returns `None` if the enum contains an unknown value deserialized from
31494        /// the string representation of enums.
31495        pub fn value(&self) -> std::option::Option<i32> {
31496            match self {
31497                Self::Unknown => std::option::Option::Some(0),
31498                Self::Unused => std::option::Option::Some(1),
31499                Self::InUseService => std::option::Option::Some(2),
31500                Self::InUseShareablePod => std::option::Option::Some(3),
31501                Self::InUseManagedPod => std::option::Option::Some(4),
31502                Self::UnknownValue(u) => u.0.value(),
31503            }
31504        }
31505
31506        /// Gets the enum value as a string.
31507        ///
31508        /// Returns `None` if the enum contains an unknown value deserialized from
31509        /// the integer representation of enums.
31510        pub fn name(&self) -> std::option::Option<&str> {
31511            match self {
31512                Self::Unknown => std::option::Option::Some("UNKNOWN"),
31513                Self::Unused => std::option::Option::Some("UNUSED"),
31514                Self::InUseService => std::option::Option::Some("IN_USE_SERVICE"),
31515                Self::InUseShareablePod => std::option::Option::Some("IN_USE_SHAREABLE_POD"),
31516                Self::InUseManagedPod => std::option::Option::Some("IN_USE_MANAGED_POD"),
31517                Self::UnknownValue(u) => u.0.name(),
31518            }
31519        }
31520    }
31521
31522    impl std::default::Default for Status {
31523        fn default() -> Self {
31524            use std::convert::From;
31525            Self::from(0)
31526        }
31527    }
31528
31529    impl std::fmt::Display for Status {
31530        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31531            wkt::internal::display_enum(f, self.name(), self.value())
31532        }
31533    }
31534
31535    impl std::convert::From<i32> for Status {
31536        fn from(value: i32) -> Self {
31537            match value {
31538                0 => Self::Unknown,
31539                1 => Self::Unused,
31540                2 => Self::InUseService,
31541                3 => Self::InUseShareablePod,
31542                4 => Self::InUseManagedPod,
31543                _ => Self::UnknownValue(status::UnknownValue(
31544                    wkt::internal::UnknownEnumValue::Integer(value),
31545                )),
31546            }
31547        }
31548    }
31549
31550    impl std::convert::From<&str> for Status {
31551        fn from(value: &str) -> Self {
31552            use std::string::ToString;
31553            match value {
31554                "UNKNOWN" => Self::Unknown,
31555                "UNUSED" => Self::Unused,
31556                "IN_USE_SERVICE" => Self::InUseService,
31557                "IN_USE_SHAREABLE_POD" => Self::InUseShareablePod,
31558                "IN_USE_MANAGED_POD" => Self::InUseManagedPod,
31559                _ => Self::UnknownValue(status::UnknownValue(
31560                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31561                )),
31562            }
31563        }
31564    }
31565
31566    impl serde::ser::Serialize for Status {
31567        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31568        where
31569            S: serde::Serializer,
31570        {
31571            match self {
31572                Self::Unknown => serializer.serialize_i32(0),
31573                Self::Unused => serializer.serialize_i32(1),
31574                Self::InUseService => serializer.serialize_i32(2),
31575                Self::InUseShareablePod => serializer.serialize_i32(3),
31576                Self::InUseManagedPod => serializer.serialize_i32(4),
31577                Self::UnknownValue(u) => u.0.serialize(serializer),
31578            }
31579        }
31580    }
31581
31582    impl<'de> serde::de::Deserialize<'de> for Status {
31583        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31584        where
31585            D: serde::Deserializer<'de>,
31586        {
31587            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
31588                ".google.container.v1.UsableSubnetworkSecondaryRange.Status",
31589            ))
31590        }
31591    }
31592}
31593
31594/// UsableSubnetwork resource returns the subnetwork name, its associated network
31595/// and the primary CIDR range.
31596#[derive(Clone, Default, PartialEq)]
31597#[non_exhaustive]
31598pub struct UsableSubnetwork {
31599    /// Subnetwork Name.
31600    /// Example: projects/my-project/regions/us-central1/subnetworks/my-subnet
31601    pub subnetwork: std::string::String,
31602
31603    /// Network Name.
31604    /// Example: projects/my-project/global/networks/my-network
31605    pub network: std::string::String,
31606
31607    /// The range of internal addresses that are owned by this subnetwork.
31608    pub ip_cidr_range: std::string::String,
31609
31610    /// Secondary IP ranges.
31611    pub secondary_ip_ranges: std::vec::Vec<crate::model::UsableSubnetworkSecondaryRange>,
31612
31613    /// A human readable status message representing the reasons for cases where
31614    /// the caller cannot use the secondary ranges under the subnet. For example if
31615    /// the secondary_ip_ranges is empty due to a permission issue, an insufficient
31616    /// permission message will be given by status_message.
31617    pub status_message: std::string::String,
31618
31619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31620}
31621
31622impl UsableSubnetwork {
31623    pub fn new() -> Self {
31624        std::default::Default::default()
31625    }
31626
31627    /// Sets the value of [subnetwork][crate::model::UsableSubnetwork::subnetwork].
31628    ///
31629    /// # Example
31630    /// ```ignore,no_run
31631    /// # use google_cloud_container_v1::model::UsableSubnetwork;
31632    /// let x = UsableSubnetwork::new().set_subnetwork("example");
31633    /// ```
31634    pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31635        self.subnetwork = v.into();
31636        self
31637    }
31638
31639    /// Sets the value of [network][crate::model::UsableSubnetwork::network].
31640    ///
31641    /// # Example
31642    /// ```ignore,no_run
31643    /// # use google_cloud_container_v1::model::UsableSubnetwork;
31644    /// let x = UsableSubnetwork::new().set_network("example");
31645    /// ```
31646    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31647        self.network = v.into();
31648        self
31649    }
31650
31651    /// Sets the value of [ip_cidr_range][crate::model::UsableSubnetwork::ip_cidr_range].
31652    ///
31653    /// # Example
31654    /// ```ignore,no_run
31655    /// # use google_cloud_container_v1::model::UsableSubnetwork;
31656    /// let x = UsableSubnetwork::new().set_ip_cidr_range("example");
31657    /// ```
31658    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31659        self.ip_cidr_range = v.into();
31660        self
31661    }
31662
31663    /// Sets the value of [secondary_ip_ranges][crate::model::UsableSubnetwork::secondary_ip_ranges].
31664    ///
31665    /// # Example
31666    /// ```ignore,no_run
31667    /// # use google_cloud_container_v1::model::UsableSubnetwork;
31668    /// use google_cloud_container_v1::model::UsableSubnetworkSecondaryRange;
31669    /// let x = UsableSubnetwork::new()
31670    ///     .set_secondary_ip_ranges([
31671    ///         UsableSubnetworkSecondaryRange::default()/* use setters */,
31672    ///         UsableSubnetworkSecondaryRange::default()/* use (different) setters */,
31673    ///     ]);
31674    /// ```
31675    pub fn set_secondary_ip_ranges<T, V>(mut self, v: T) -> Self
31676    where
31677        T: std::iter::IntoIterator<Item = V>,
31678        V: std::convert::Into<crate::model::UsableSubnetworkSecondaryRange>,
31679    {
31680        use std::iter::Iterator;
31681        self.secondary_ip_ranges = v.into_iter().map(|i| i.into()).collect();
31682        self
31683    }
31684
31685    /// Sets the value of [status_message][crate::model::UsableSubnetwork::status_message].
31686    ///
31687    /// # Example
31688    /// ```ignore,no_run
31689    /// # use google_cloud_container_v1::model::UsableSubnetwork;
31690    /// let x = UsableSubnetwork::new().set_status_message("example");
31691    /// ```
31692    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31693        self.status_message = v.into();
31694        self
31695    }
31696}
31697
31698impl wkt::message::Message for UsableSubnetwork {
31699    fn typename() -> &'static str {
31700        "type.googleapis.com/google.container.v1.UsableSubnetwork"
31701    }
31702}
31703
31704/// Configuration for exporting cluster resource usages.
31705#[derive(Clone, Default, PartialEq)]
31706#[non_exhaustive]
31707pub struct ResourceUsageExportConfig {
31708    /// Configuration to use BigQuery as usage export destination.
31709    pub bigquery_destination:
31710        std::option::Option<crate::model::resource_usage_export_config::BigQueryDestination>,
31711
31712    /// Whether to enable network egress metering for this cluster. If enabled, a
31713    /// daemonset will be created in the cluster to meter network egress traffic.
31714    pub enable_network_egress_metering: bool,
31715
31716    /// Configuration to enable resource consumption metering.
31717    pub consumption_metering_config:
31718        std::option::Option<crate::model::resource_usage_export_config::ConsumptionMeteringConfig>,
31719
31720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31721}
31722
31723impl ResourceUsageExportConfig {
31724    pub fn new() -> Self {
31725        std::default::Default::default()
31726    }
31727
31728    /// Sets the value of [bigquery_destination][crate::model::ResourceUsageExportConfig::bigquery_destination].
31729    ///
31730    /// # Example
31731    /// ```ignore,no_run
31732    /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
31733    /// use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
31734    /// let x = ResourceUsageExportConfig::new().set_bigquery_destination(BigQueryDestination::default()/* use setters */);
31735    /// ```
31736    pub fn set_bigquery_destination<T>(mut self, v: T) -> Self
31737    where
31738        T: std::convert::Into<crate::model::resource_usage_export_config::BigQueryDestination>,
31739    {
31740        self.bigquery_destination = std::option::Option::Some(v.into());
31741        self
31742    }
31743
31744    /// Sets or clears the value of [bigquery_destination][crate::model::ResourceUsageExportConfig::bigquery_destination].
31745    ///
31746    /// # Example
31747    /// ```ignore,no_run
31748    /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
31749    /// use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
31750    /// let x = ResourceUsageExportConfig::new().set_or_clear_bigquery_destination(Some(BigQueryDestination::default()/* use setters */));
31751    /// let x = ResourceUsageExportConfig::new().set_or_clear_bigquery_destination(None::<BigQueryDestination>);
31752    /// ```
31753    pub fn set_or_clear_bigquery_destination<T>(mut self, v: std::option::Option<T>) -> Self
31754    where
31755        T: std::convert::Into<crate::model::resource_usage_export_config::BigQueryDestination>,
31756    {
31757        self.bigquery_destination = v.map(|x| x.into());
31758        self
31759    }
31760
31761    /// Sets the value of [enable_network_egress_metering][crate::model::ResourceUsageExportConfig::enable_network_egress_metering].
31762    ///
31763    /// # Example
31764    /// ```ignore,no_run
31765    /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
31766    /// let x = ResourceUsageExportConfig::new().set_enable_network_egress_metering(true);
31767    /// ```
31768    pub fn set_enable_network_egress_metering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31769        self.enable_network_egress_metering = v.into();
31770        self
31771    }
31772
31773    /// Sets the value of [consumption_metering_config][crate::model::ResourceUsageExportConfig::consumption_metering_config].
31774    ///
31775    /// # Example
31776    /// ```ignore,no_run
31777    /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
31778    /// use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
31779    /// let x = ResourceUsageExportConfig::new().set_consumption_metering_config(ConsumptionMeteringConfig::default()/* use setters */);
31780    /// ```
31781    pub fn set_consumption_metering_config<T>(mut self, v: T) -> Self
31782    where
31783        T: std::convert::Into<
31784                crate::model::resource_usage_export_config::ConsumptionMeteringConfig,
31785            >,
31786    {
31787        self.consumption_metering_config = std::option::Option::Some(v.into());
31788        self
31789    }
31790
31791    /// Sets or clears the value of [consumption_metering_config][crate::model::ResourceUsageExportConfig::consumption_metering_config].
31792    ///
31793    /// # Example
31794    /// ```ignore,no_run
31795    /// # use google_cloud_container_v1::model::ResourceUsageExportConfig;
31796    /// use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
31797    /// let x = ResourceUsageExportConfig::new().set_or_clear_consumption_metering_config(Some(ConsumptionMeteringConfig::default()/* use setters */));
31798    /// let x = ResourceUsageExportConfig::new().set_or_clear_consumption_metering_config(None::<ConsumptionMeteringConfig>);
31799    /// ```
31800    pub fn set_or_clear_consumption_metering_config<T>(mut self, v: std::option::Option<T>) -> Self
31801    where
31802        T: std::convert::Into<
31803                crate::model::resource_usage_export_config::ConsumptionMeteringConfig,
31804            >,
31805    {
31806        self.consumption_metering_config = v.map(|x| x.into());
31807        self
31808    }
31809}
31810
31811impl wkt::message::Message for ResourceUsageExportConfig {
31812    fn typename() -> &'static str {
31813        "type.googleapis.com/google.container.v1.ResourceUsageExportConfig"
31814    }
31815}
31816
31817/// Defines additional types related to [ResourceUsageExportConfig].
31818pub mod resource_usage_export_config {
31819    #[allow(unused_imports)]
31820    use super::*;
31821
31822    /// Parameters for using BigQuery as the destination of resource usage export.
31823    #[derive(Clone, Default, PartialEq)]
31824    #[non_exhaustive]
31825    pub struct BigQueryDestination {
31826        /// The ID of a BigQuery Dataset.
31827        pub dataset_id: std::string::String,
31828
31829        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31830    }
31831
31832    impl BigQueryDestination {
31833        pub fn new() -> Self {
31834            std::default::Default::default()
31835        }
31836
31837        /// Sets the value of [dataset_id][crate::model::resource_usage_export_config::BigQueryDestination::dataset_id].
31838        ///
31839        /// # Example
31840        /// ```ignore,no_run
31841        /// # use google_cloud_container_v1::model::resource_usage_export_config::BigQueryDestination;
31842        /// let x = BigQueryDestination::new().set_dataset_id("example");
31843        /// ```
31844        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31845            self.dataset_id = v.into();
31846            self
31847        }
31848    }
31849
31850    impl wkt::message::Message for BigQueryDestination {
31851        fn typename() -> &'static str {
31852            "type.googleapis.com/google.container.v1.ResourceUsageExportConfig.BigQueryDestination"
31853        }
31854    }
31855
31856    /// Parameters for controlling consumption metering.
31857    #[derive(Clone, Default, PartialEq)]
31858    #[non_exhaustive]
31859    pub struct ConsumptionMeteringConfig {
31860        /// Whether to enable consumption metering for this cluster. If enabled, a
31861        /// second BigQuery table will be created to hold resource consumption
31862        /// records.
31863        pub enabled: bool,
31864
31865        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31866    }
31867
31868    impl ConsumptionMeteringConfig {
31869        pub fn new() -> Self {
31870            std::default::Default::default()
31871        }
31872
31873        /// Sets the value of [enabled][crate::model::resource_usage_export_config::ConsumptionMeteringConfig::enabled].
31874        ///
31875        /// # Example
31876        /// ```ignore,no_run
31877        /// # use google_cloud_container_v1::model::resource_usage_export_config::ConsumptionMeteringConfig;
31878        /// let x = ConsumptionMeteringConfig::new().set_enabled(true);
31879        /// ```
31880        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31881            self.enabled = v.into();
31882            self
31883        }
31884    }
31885
31886    impl wkt::message::Message for ConsumptionMeteringConfig {
31887        fn typename() -> &'static str {
31888            "type.googleapis.com/google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig"
31889        }
31890    }
31891}
31892
31893/// VerticalPodAutoscaling contains global, per-cluster information
31894/// required by Vertical Pod Autoscaler to automatically adjust
31895/// the resources of pods controlled by it.
31896#[derive(Clone, Default, PartialEq)]
31897#[non_exhaustive]
31898pub struct VerticalPodAutoscaling {
31899    /// Enables vertical pod autoscaling.
31900    pub enabled: bool,
31901
31902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31903}
31904
31905impl VerticalPodAutoscaling {
31906    pub fn new() -> Self {
31907        std::default::Default::default()
31908    }
31909
31910    /// Sets the value of [enabled][crate::model::VerticalPodAutoscaling::enabled].
31911    ///
31912    /// # Example
31913    /// ```ignore,no_run
31914    /// # use google_cloud_container_v1::model::VerticalPodAutoscaling;
31915    /// let x = VerticalPodAutoscaling::new().set_enabled(true);
31916    /// ```
31917    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31918        self.enabled = v.into();
31919        self
31920    }
31921}
31922
31923impl wkt::message::Message for VerticalPodAutoscaling {
31924    fn typename() -> &'static str {
31925        "type.googleapis.com/google.container.v1.VerticalPodAutoscaling"
31926    }
31927}
31928
31929/// DefaultSnatStatus contains the desired state of whether default sNAT should
31930/// be disabled on the cluster.
31931#[derive(Clone, Default, PartialEq)]
31932#[non_exhaustive]
31933pub struct DefaultSnatStatus {
31934    /// Disables cluster default sNAT rules.
31935    pub disabled: bool,
31936
31937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31938}
31939
31940impl DefaultSnatStatus {
31941    pub fn new() -> Self {
31942        std::default::Default::default()
31943    }
31944
31945    /// Sets the value of [disabled][crate::model::DefaultSnatStatus::disabled].
31946    ///
31947    /// # Example
31948    /// ```ignore,no_run
31949    /// # use google_cloud_container_v1::model::DefaultSnatStatus;
31950    /// let x = DefaultSnatStatus::new().set_disabled(true);
31951    /// ```
31952    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31953        self.disabled = v.into();
31954        self
31955    }
31956}
31957
31958impl wkt::message::Message for DefaultSnatStatus {
31959    fn typename() -> &'static str {
31960        "type.googleapis.com/google.container.v1.DefaultSnatStatus"
31961    }
31962}
31963
31964/// Configuration of Shielded Nodes feature.
31965#[derive(Clone, Default, PartialEq)]
31966#[non_exhaustive]
31967pub struct ShieldedNodes {
31968    /// Whether Shielded Nodes features are enabled on all nodes in this cluster.
31969    pub enabled: bool,
31970
31971    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31972}
31973
31974impl ShieldedNodes {
31975    pub fn new() -> Self {
31976        std::default::Default::default()
31977    }
31978
31979    /// Sets the value of [enabled][crate::model::ShieldedNodes::enabled].
31980    ///
31981    /// # Example
31982    /// ```ignore,no_run
31983    /// # use google_cloud_container_v1::model::ShieldedNodes;
31984    /// let x = ShieldedNodes::new().set_enabled(true);
31985    /// ```
31986    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31987        self.enabled = v.into();
31988        self
31989    }
31990}
31991
31992impl wkt::message::Message for ShieldedNodes {
31993    fn typename() -> &'static str {
31994        "type.googleapis.com/google.container.v1.ShieldedNodes"
31995    }
31996}
31997
31998/// Configuration of gVNIC feature.
31999#[derive(Clone, Default, PartialEq)]
32000#[non_exhaustive]
32001pub struct VirtualNIC {
32002    /// Whether gVNIC features are enabled in the node pool.
32003    pub enabled: bool,
32004
32005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32006}
32007
32008impl VirtualNIC {
32009    pub fn new() -> Self {
32010        std::default::Default::default()
32011    }
32012
32013    /// Sets the value of [enabled][crate::model::VirtualNIC::enabled].
32014    ///
32015    /// # Example
32016    /// ```ignore,no_run
32017    /// # use google_cloud_container_v1::model::VirtualNIC;
32018    /// let x = VirtualNIC::new().set_enabled(true);
32019    /// ```
32020    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32021        self.enabled = v.into();
32022        self
32023    }
32024}
32025
32026impl wkt::message::Message for VirtualNIC {
32027    fn typename() -> &'static str {
32028        "type.googleapis.com/google.container.v1.VirtualNIC"
32029    }
32030}
32031
32032/// Configuration of Fast Socket feature.
32033#[derive(Clone, Default, PartialEq)]
32034#[non_exhaustive]
32035pub struct FastSocket {
32036    /// Whether Fast Socket features are enabled in the node pool.
32037    pub enabled: bool,
32038
32039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32040}
32041
32042impl FastSocket {
32043    pub fn new() -> Self {
32044        std::default::Default::default()
32045    }
32046
32047    /// Sets the value of [enabled][crate::model::FastSocket::enabled].
32048    ///
32049    /// # Example
32050    /// ```ignore,no_run
32051    /// # use google_cloud_container_v1::model::FastSocket;
32052    /// let x = FastSocket::new().set_enabled(true);
32053    /// ```
32054    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32055        self.enabled = v.into();
32056        self
32057    }
32058}
32059
32060impl wkt::message::Message for FastSocket {
32061    fn typename() -> &'static str {
32062        "type.googleapis.com/google.container.v1.FastSocket"
32063    }
32064}
32065
32066/// NotificationConfig is the configuration of notifications.
32067#[derive(Clone, Default, PartialEq)]
32068#[non_exhaustive]
32069pub struct NotificationConfig {
32070    /// Notification config for Pub/Sub.
32071    pub pubsub: std::option::Option<crate::model::notification_config::PubSub>,
32072
32073    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32074}
32075
32076impl NotificationConfig {
32077    pub fn new() -> Self {
32078        std::default::Default::default()
32079    }
32080
32081    /// Sets the value of [pubsub][crate::model::NotificationConfig::pubsub].
32082    ///
32083    /// # Example
32084    /// ```ignore,no_run
32085    /// # use google_cloud_container_v1::model::NotificationConfig;
32086    /// use google_cloud_container_v1::model::notification_config::PubSub;
32087    /// let x = NotificationConfig::new().set_pubsub(PubSub::default()/* use setters */);
32088    /// ```
32089    pub fn set_pubsub<T>(mut self, v: T) -> Self
32090    where
32091        T: std::convert::Into<crate::model::notification_config::PubSub>,
32092    {
32093        self.pubsub = std::option::Option::Some(v.into());
32094        self
32095    }
32096
32097    /// Sets or clears the value of [pubsub][crate::model::NotificationConfig::pubsub].
32098    ///
32099    /// # Example
32100    /// ```ignore,no_run
32101    /// # use google_cloud_container_v1::model::NotificationConfig;
32102    /// use google_cloud_container_v1::model::notification_config::PubSub;
32103    /// let x = NotificationConfig::new().set_or_clear_pubsub(Some(PubSub::default()/* use setters */));
32104    /// let x = NotificationConfig::new().set_or_clear_pubsub(None::<PubSub>);
32105    /// ```
32106    pub fn set_or_clear_pubsub<T>(mut self, v: std::option::Option<T>) -> Self
32107    where
32108        T: std::convert::Into<crate::model::notification_config::PubSub>,
32109    {
32110        self.pubsub = v.map(|x| x.into());
32111        self
32112    }
32113}
32114
32115impl wkt::message::Message for NotificationConfig {
32116    fn typename() -> &'static str {
32117        "type.googleapis.com/google.container.v1.NotificationConfig"
32118    }
32119}
32120
32121/// Defines additional types related to [NotificationConfig].
32122pub mod notification_config {
32123    #[allow(unused_imports)]
32124    use super::*;
32125
32126    /// Pub/Sub specific notification config.
32127    #[derive(Clone, Default, PartialEq)]
32128    #[non_exhaustive]
32129    pub struct PubSub {
32130        /// Enable notifications for Pub/Sub.
32131        pub enabled: bool,
32132
32133        /// The desired Pub/Sub topic to which notifications will be
32134        /// sent by GKE. Format is `projects/{project}/topics/{topic}`.
32135        pub topic: std::string::String,
32136
32137        /// Allows filtering to one or more specific event types. If no filter is
32138        /// specified, or if a filter is specified with no event types, all event
32139        /// types will be sent
32140        pub filter: std::option::Option<crate::model::notification_config::Filter>,
32141
32142        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32143    }
32144
32145    impl PubSub {
32146        pub fn new() -> Self {
32147            std::default::Default::default()
32148        }
32149
32150        /// Sets the value of [enabled][crate::model::notification_config::PubSub::enabled].
32151        ///
32152        /// # Example
32153        /// ```ignore,no_run
32154        /// # use google_cloud_container_v1::model::notification_config::PubSub;
32155        /// let x = PubSub::new().set_enabled(true);
32156        /// ```
32157        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32158            self.enabled = v.into();
32159            self
32160        }
32161
32162        /// Sets the value of [topic][crate::model::notification_config::PubSub::topic].
32163        ///
32164        /// # Example
32165        /// ```ignore,no_run
32166        /// # use google_cloud_container_v1::model::notification_config::PubSub;
32167        /// let x = PubSub::new().set_topic("example");
32168        /// ```
32169        pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32170            self.topic = v.into();
32171            self
32172        }
32173
32174        /// Sets the value of [filter][crate::model::notification_config::PubSub::filter].
32175        ///
32176        /// # Example
32177        /// ```ignore,no_run
32178        /// # use google_cloud_container_v1::model::notification_config::PubSub;
32179        /// use google_cloud_container_v1::model::notification_config::Filter;
32180        /// let x = PubSub::new().set_filter(Filter::default()/* use setters */);
32181        /// ```
32182        pub fn set_filter<T>(mut self, v: T) -> Self
32183        where
32184            T: std::convert::Into<crate::model::notification_config::Filter>,
32185        {
32186            self.filter = std::option::Option::Some(v.into());
32187            self
32188        }
32189
32190        /// Sets or clears the value of [filter][crate::model::notification_config::PubSub::filter].
32191        ///
32192        /// # Example
32193        /// ```ignore,no_run
32194        /// # use google_cloud_container_v1::model::notification_config::PubSub;
32195        /// use google_cloud_container_v1::model::notification_config::Filter;
32196        /// let x = PubSub::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
32197        /// let x = PubSub::new().set_or_clear_filter(None::<Filter>);
32198        /// ```
32199        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
32200        where
32201            T: std::convert::Into<crate::model::notification_config::Filter>,
32202        {
32203            self.filter = v.map(|x| x.into());
32204            self
32205        }
32206    }
32207
32208    impl wkt::message::Message for PubSub {
32209        fn typename() -> &'static str {
32210            "type.googleapis.com/google.container.v1.NotificationConfig.PubSub"
32211        }
32212    }
32213
32214    /// Allows filtering to one or more specific event types. If event types are
32215    /// present, those and only those event types will be transmitted to the
32216    /// cluster. Other types will be skipped. If no filter is specified, or no
32217    /// event types are present, all event types will be sent
32218    #[derive(Clone, Default, PartialEq)]
32219    #[non_exhaustive]
32220    pub struct Filter {
32221        /// Event types to allowlist.
32222        pub event_type: std::vec::Vec<crate::model::notification_config::EventType>,
32223
32224        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32225    }
32226
32227    impl Filter {
32228        pub fn new() -> Self {
32229            std::default::Default::default()
32230        }
32231
32232        /// Sets the value of [event_type][crate::model::notification_config::Filter::event_type].
32233        ///
32234        /// # Example
32235        /// ```ignore,no_run
32236        /// # use google_cloud_container_v1::model::notification_config::Filter;
32237        /// use google_cloud_container_v1::model::notification_config::EventType;
32238        /// let x = Filter::new().set_event_type([
32239        ///     EventType::UpgradeAvailableEvent,
32240        ///     EventType::UpgradeEvent,
32241        ///     EventType::SecurityBulletinEvent,
32242        /// ]);
32243        /// ```
32244        pub fn set_event_type<T, V>(mut self, v: T) -> Self
32245        where
32246            T: std::iter::IntoIterator<Item = V>,
32247            V: std::convert::Into<crate::model::notification_config::EventType>,
32248        {
32249            use std::iter::Iterator;
32250            self.event_type = v.into_iter().map(|i| i.into()).collect();
32251            self
32252        }
32253    }
32254
32255    impl wkt::message::Message for Filter {
32256        fn typename() -> &'static str {
32257            "type.googleapis.com/google.container.v1.NotificationConfig.Filter"
32258        }
32259    }
32260
32261    /// Types of notifications currently supported. Can be used to filter what
32262    /// notifications are sent.
32263    ///
32264    /// # Working with unknown values
32265    ///
32266    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32267    /// additional enum variants at any time. Adding new variants is not considered
32268    /// a breaking change. Applications should write their code in anticipation of:
32269    ///
32270    /// - New values appearing in future releases of the client library, **and**
32271    /// - New values received dynamically, without application changes.
32272    ///
32273    /// Please consult the [Working with enums] section in the user guide for some
32274    /// guidelines.
32275    ///
32276    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32277    #[derive(Clone, Debug, PartialEq)]
32278    #[non_exhaustive]
32279    pub enum EventType {
32280        /// Not set, will be ignored.
32281        Unspecified,
32282        /// Corresponds with UpgradeAvailableEvent.
32283        UpgradeAvailableEvent,
32284        /// Corresponds with UpgradeEvent.
32285        UpgradeEvent,
32286        /// Corresponds with SecurityBulletinEvent.
32287        SecurityBulletinEvent,
32288        /// Corresponds with UpgradeInfoEvent.
32289        UpgradeInfoEvent,
32290        /// If set, the enum was initialized with an unknown value.
32291        ///
32292        /// Applications can examine the value using [EventType::value] or
32293        /// [EventType::name].
32294        UnknownValue(event_type::UnknownValue),
32295    }
32296
32297    #[doc(hidden)]
32298    pub mod event_type {
32299        #[allow(unused_imports)]
32300        use super::*;
32301        #[derive(Clone, Debug, PartialEq)]
32302        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32303    }
32304
32305    impl EventType {
32306        /// Gets the enum value.
32307        ///
32308        /// Returns `None` if the enum contains an unknown value deserialized from
32309        /// the string representation of enums.
32310        pub fn value(&self) -> std::option::Option<i32> {
32311            match self {
32312                Self::Unspecified => std::option::Option::Some(0),
32313                Self::UpgradeAvailableEvent => std::option::Option::Some(1),
32314                Self::UpgradeEvent => std::option::Option::Some(2),
32315                Self::SecurityBulletinEvent => std::option::Option::Some(3),
32316                Self::UpgradeInfoEvent => std::option::Option::Some(4),
32317                Self::UnknownValue(u) => u.0.value(),
32318            }
32319        }
32320
32321        /// Gets the enum value as a string.
32322        ///
32323        /// Returns `None` if the enum contains an unknown value deserialized from
32324        /// the integer representation of enums.
32325        pub fn name(&self) -> std::option::Option<&str> {
32326            match self {
32327                Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
32328                Self::UpgradeAvailableEvent => std::option::Option::Some("UPGRADE_AVAILABLE_EVENT"),
32329                Self::UpgradeEvent => std::option::Option::Some("UPGRADE_EVENT"),
32330                Self::SecurityBulletinEvent => std::option::Option::Some("SECURITY_BULLETIN_EVENT"),
32331                Self::UpgradeInfoEvent => std::option::Option::Some("UPGRADE_INFO_EVENT"),
32332                Self::UnknownValue(u) => u.0.name(),
32333            }
32334        }
32335    }
32336
32337    impl std::default::Default for EventType {
32338        fn default() -> Self {
32339            use std::convert::From;
32340            Self::from(0)
32341        }
32342    }
32343
32344    impl std::fmt::Display for EventType {
32345        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32346            wkt::internal::display_enum(f, self.name(), self.value())
32347        }
32348    }
32349
32350    impl std::convert::From<i32> for EventType {
32351        fn from(value: i32) -> Self {
32352            match value {
32353                0 => Self::Unspecified,
32354                1 => Self::UpgradeAvailableEvent,
32355                2 => Self::UpgradeEvent,
32356                3 => Self::SecurityBulletinEvent,
32357                4 => Self::UpgradeInfoEvent,
32358                _ => Self::UnknownValue(event_type::UnknownValue(
32359                    wkt::internal::UnknownEnumValue::Integer(value),
32360                )),
32361            }
32362        }
32363    }
32364
32365    impl std::convert::From<&str> for EventType {
32366        fn from(value: &str) -> Self {
32367            use std::string::ToString;
32368            match value {
32369                "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
32370                "UPGRADE_AVAILABLE_EVENT" => Self::UpgradeAvailableEvent,
32371                "UPGRADE_EVENT" => Self::UpgradeEvent,
32372                "SECURITY_BULLETIN_EVENT" => Self::SecurityBulletinEvent,
32373                "UPGRADE_INFO_EVENT" => Self::UpgradeInfoEvent,
32374                _ => Self::UnknownValue(event_type::UnknownValue(
32375                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32376                )),
32377            }
32378        }
32379    }
32380
32381    impl serde::ser::Serialize for EventType {
32382        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32383        where
32384            S: serde::Serializer,
32385        {
32386            match self {
32387                Self::Unspecified => serializer.serialize_i32(0),
32388                Self::UpgradeAvailableEvent => serializer.serialize_i32(1),
32389                Self::UpgradeEvent => serializer.serialize_i32(2),
32390                Self::SecurityBulletinEvent => serializer.serialize_i32(3),
32391                Self::UpgradeInfoEvent => serializer.serialize_i32(4),
32392                Self::UnknownValue(u) => u.0.serialize(serializer),
32393            }
32394        }
32395    }
32396
32397    impl<'de> serde::de::Deserialize<'de> for EventType {
32398        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32399        where
32400            D: serde::Deserializer<'de>,
32401        {
32402            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
32403                ".google.container.v1.NotificationConfig.EventType",
32404            ))
32405        }
32406    }
32407}
32408
32409/// ConfidentialNodes is configuration for the confidential nodes feature, which
32410/// makes nodes run on confidential VMs.
32411#[derive(Clone, Default, PartialEq)]
32412#[non_exhaustive]
32413pub struct ConfidentialNodes {
32414    /// Whether Confidential Nodes feature is enabled.
32415    pub enabled: bool,
32416
32417    /// Defines the type of technology used by the confidential node.
32418    pub confidential_instance_type: crate::model::confidential_nodes::ConfidentialInstanceType,
32419
32420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32421}
32422
32423impl ConfidentialNodes {
32424    pub fn new() -> Self {
32425        std::default::Default::default()
32426    }
32427
32428    /// Sets the value of [enabled][crate::model::ConfidentialNodes::enabled].
32429    ///
32430    /// # Example
32431    /// ```ignore,no_run
32432    /// # use google_cloud_container_v1::model::ConfidentialNodes;
32433    /// let x = ConfidentialNodes::new().set_enabled(true);
32434    /// ```
32435    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32436        self.enabled = v.into();
32437        self
32438    }
32439
32440    /// Sets the value of [confidential_instance_type][crate::model::ConfidentialNodes::confidential_instance_type].
32441    ///
32442    /// # Example
32443    /// ```ignore,no_run
32444    /// # use google_cloud_container_v1::model::ConfidentialNodes;
32445    /// use google_cloud_container_v1::model::confidential_nodes::ConfidentialInstanceType;
32446    /// let x0 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::Sev);
32447    /// let x1 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::SevSnp);
32448    /// let x2 = ConfidentialNodes::new().set_confidential_instance_type(ConfidentialInstanceType::Tdx);
32449    /// ```
32450    pub fn set_confidential_instance_type<
32451        T: std::convert::Into<crate::model::confidential_nodes::ConfidentialInstanceType>,
32452    >(
32453        mut self,
32454        v: T,
32455    ) -> Self {
32456        self.confidential_instance_type = v.into();
32457        self
32458    }
32459}
32460
32461impl wkt::message::Message for ConfidentialNodes {
32462    fn typename() -> &'static str {
32463        "type.googleapis.com/google.container.v1.ConfidentialNodes"
32464    }
32465}
32466
32467/// Defines additional types related to [ConfidentialNodes].
32468pub mod confidential_nodes {
32469    #[allow(unused_imports)]
32470    use super::*;
32471
32472    /// The type of technology used by the confidential node.
32473    ///
32474    /// # Working with unknown values
32475    ///
32476    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32477    /// additional enum variants at any time. Adding new variants is not considered
32478    /// a breaking change. Applications should write their code in anticipation of:
32479    ///
32480    /// - New values appearing in future releases of the client library, **and**
32481    /// - New values received dynamically, without application changes.
32482    ///
32483    /// Please consult the [Working with enums] section in the user guide for some
32484    /// guidelines.
32485    ///
32486    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32487    #[derive(Clone, Debug, PartialEq)]
32488    #[non_exhaustive]
32489    pub enum ConfidentialInstanceType {
32490        /// No type specified. Do not use this value.
32491        Unspecified,
32492        /// AMD Secure Encrypted Virtualization.
32493        Sev,
32494        /// AMD Secure Encrypted Virtualization - Secure Nested Paging.
32495        SevSnp,
32496        /// Intel Trust Domain eXtension.
32497        Tdx,
32498        /// If set, the enum was initialized with an unknown value.
32499        ///
32500        /// Applications can examine the value using [ConfidentialInstanceType::value] or
32501        /// [ConfidentialInstanceType::name].
32502        UnknownValue(confidential_instance_type::UnknownValue),
32503    }
32504
32505    #[doc(hidden)]
32506    pub mod confidential_instance_type {
32507        #[allow(unused_imports)]
32508        use super::*;
32509        #[derive(Clone, Debug, PartialEq)]
32510        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32511    }
32512
32513    impl ConfidentialInstanceType {
32514        /// Gets the enum value.
32515        ///
32516        /// Returns `None` if the enum contains an unknown value deserialized from
32517        /// the string representation of enums.
32518        pub fn value(&self) -> std::option::Option<i32> {
32519            match self {
32520                Self::Unspecified => std::option::Option::Some(0),
32521                Self::Sev => std::option::Option::Some(1),
32522                Self::SevSnp => std::option::Option::Some(2),
32523                Self::Tdx => std::option::Option::Some(3),
32524                Self::UnknownValue(u) => u.0.value(),
32525            }
32526        }
32527
32528        /// Gets the enum value as a string.
32529        ///
32530        /// Returns `None` if the enum contains an unknown value deserialized from
32531        /// the integer representation of enums.
32532        pub fn name(&self) -> std::option::Option<&str> {
32533            match self {
32534                Self::Unspecified => {
32535                    std::option::Option::Some("CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED")
32536                }
32537                Self::Sev => std::option::Option::Some("SEV"),
32538                Self::SevSnp => std::option::Option::Some("SEV_SNP"),
32539                Self::Tdx => std::option::Option::Some("TDX"),
32540                Self::UnknownValue(u) => u.0.name(),
32541            }
32542        }
32543    }
32544
32545    impl std::default::Default for ConfidentialInstanceType {
32546        fn default() -> Self {
32547            use std::convert::From;
32548            Self::from(0)
32549        }
32550    }
32551
32552    impl std::fmt::Display for ConfidentialInstanceType {
32553        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32554            wkt::internal::display_enum(f, self.name(), self.value())
32555        }
32556    }
32557
32558    impl std::convert::From<i32> for ConfidentialInstanceType {
32559        fn from(value: i32) -> Self {
32560            match value {
32561                0 => Self::Unspecified,
32562                1 => Self::Sev,
32563                2 => Self::SevSnp,
32564                3 => Self::Tdx,
32565                _ => Self::UnknownValue(confidential_instance_type::UnknownValue(
32566                    wkt::internal::UnknownEnumValue::Integer(value),
32567                )),
32568            }
32569        }
32570    }
32571
32572    impl std::convert::From<&str> for ConfidentialInstanceType {
32573        fn from(value: &str) -> Self {
32574            use std::string::ToString;
32575            match value {
32576                "CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
32577                "SEV" => Self::Sev,
32578                "SEV_SNP" => Self::SevSnp,
32579                "TDX" => Self::Tdx,
32580                _ => Self::UnknownValue(confidential_instance_type::UnknownValue(
32581                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32582                )),
32583            }
32584        }
32585    }
32586
32587    impl serde::ser::Serialize for ConfidentialInstanceType {
32588        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32589        where
32590            S: serde::Serializer,
32591        {
32592            match self {
32593                Self::Unspecified => serializer.serialize_i32(0),
32594                Self::Sev => serializer.serialize_i32(1),
32595                Self::SevSnp => serializer.serialize_i32(2),
32596                Self::Tdx => serializer.serialize_i32(3),
32597                Self::UnknownValue(u) => u.0.serialize(serializer),
32598            }
32599        }
32600    }
32601
32602    impl<'de> serde::de::Deserialize<'de> for ConfidentialInstanceType {
32603        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32604        where
32605            D: serde::Deserializer<'de>,
32606        {
32607            deserializer.deserialize_any(
32608                wkt::internal::EnumVisitor::<ConfidentialInstanceType>::new(
32609                    ".google.container.v1.ConfidentialNodes.ConfidentialInstanceType",
32610                ),
32611            )
32612        }
32613    }
32614}
32615
32616/// UpgradeEvent is a notification sent to customers by the cluster server when
32617/// a resource is upgrading.
32618#[derive(Clone, Default, PartialEq)]
32619#[non_exhaustive]
32620pub struct UpgradeEvent {
32621    /// The resource type that is upgrading.
32622    pub resource_type: crate::model::UpgradeResourceType,
32623
32624    /// The operation associated with this upgrade.
32625    pub operation: std::string::String,
32626
32627    /// The time when the operation was started.
32628    pub operation_start_time: std::option::Option<wkt::Timestamp>,
32629
32630    /// The current version before the upgrade.
32631    pub current_version: std::string::String,
32632
32633    /// The target version for the upgrade.
32634    pub target_version: std::string::String,
32635
32636    /// Optional relative path to the resource. For example in node pool upgrades,
32637    /// the relative path of the node pool.
32638    pub resource: std::string::String,
32639
32640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32641}
32642
32643impl UpgradeEvent {
32644    pub fn new() -> Self {
32645        std::default::Default::default()
32646    }
32647
32648    /// Sets the value of [resource_type][crate::model::UpgradeEvent::resource_type].
32649    ///
32650    /// # Example
32651    /// ```ignore,no_run
32652    /// # use google_cloud_container_v1::model::UpgradeEvent;
32653    /// use google_cloud_container_v1::model::UpgradeResourceType;
32654    /// let x0 = UpgradeEvent::new().set_resource_type(UpgradeResourceType::Master);
32655    /// let x1 = UpgradeEvent::new().set_resource_type(UpgradeResourceType::NodePool);
32656    /// ```
32657    pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
32658        mut self,
32659        v: T,
32660    ) -> Self {
32661        self.resource_type = v.into();
32662        self
32663    }
32664
32665    /// Sets the value of [operation][crate::model::UpgradeEvent::operation].
32666    ///
32667    /// # Example
32668    /// ```ignore,no_run
32669    /// # use google_cloud_container_v1::model::UpgradeEvent;
32670    /// let x = UpgradeEvent::new().set_operation("example");
32671    /// ```
32672    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32673        self.operation = v.into();
32674        self
32675    }
32676
32677    /// Sets the value of [operation_start_time][crate::model::UpgradeEvent::operation_start_time].
32678    ///
32679    /// # Example
32680    /// ```ignore,no_run
32681    /// # use google_cloud_container_v1::model::UpgradeEvent;
32682    /// use wkt::Timestamp;
32683    /// let x = UpgradeEvent::new().set_operation_start_time(Timestamp::default()/* use setters */);
32684    /// ```
32685    pub fn set_operation_start_time<T>(mut self, v: T) -> Self
32686    where
32687        T: std::convert::Into<wkt::Timestamp>,
32688    {
32689        self.operation_start_time = std::option::Option::Some(v.into());
32690        self
32691    }
32692
32693    /// Sets or clears the value of [operation_start_time][crate::model::UpgradeEvent::operation_start_time].
32694    ///
32695    /// # Example
32696    /// ```ignore,no_run
32697    /// # use google_cloud_container_v1::model::UpgradeEvent;
32698    /// use wkt::Timestamp;
32699    /// let x = UpgradeEvent::new().set_or_clear_operation_start_time(Some(Timestamp::default()/* use setters */));
32700    /// let x = UpgradeEvent::new().set_or_clear_operation_start_time(None::<Timestamp>);
32701    /// ```
32702    pub fn set_or_clear_operation_start_time<T>(mut self, v: std::option::Option<T>) -> Self
32703    where
32704        T: std::convert::Into<wkt::Timestamp>,
32705    {
32706        self.operation_start_time = v.map(|x| x.into());
32707        self
32708    }
32709
32710    /// Sets the value of [current_version][crate::model::UpgradeEvent::current_version].
32711    ///
32712    /// # Example
32713    /// ```ignore,no_run
32714    /// # use google_cloud_container_v1::model::UpgradeEvent;
32715    /// let x = UpgradeEvent::new().set_current_version("example");
32716    /// ```
32717    pub fn set_current_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32718        self.current_version = v.into();
32719        self
32720    }
32721
32722    /// Sets the value of [target_version][crate::model::UpgradeEvent::target_version].
32723    ///
32724    /// # Example
32725    /// ```ignore,no_run
32726    /// # use google_cloud_container_v1::model::UpgradeEvent;
32727    /// let x = UpgradeEvent::new().set_target_version("example");
32728    /// ```
32729    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32730        self.target_version = v.into();
32731        self
32732    }
32733
32734    /// Sets the value of [resource][crate::model::UpgradeEvent::resource].
32735    ///
32736    /// # Example
32737    /// ```ignore,no_run
32738    /// # use google_cloud_container_v1::model::UpgradeEvent;
32739    /// let x = UpgradeEvent::new().set_resource("example");
32740    /// ```
32741    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32742        self.resource = v.into();
32743        self
32744    }
32745}
32746
32747impl wkt::message::Message for UpgradeEvent {
32748    fn typename() -> &'static str {
32749        "type.googleapis.com/google.container.v1.UpgradeEvent"
32750    }
32751}
32752
32753/// UpgradeInfoEvent is a notification sent to customers about the upgrade
32754/// information of a resource.
32755#[derive(Clone, Default, PartialEq)]
32756#[non_exhaustive]
32757pub struct UpgradeInfoEvent {
32758    /// The resource type associated with the upgrade.
32759    pub resource_type: crate::model::UpgradeResourceType,
32760
32761    /// The operation associated with this upgrade.
32762    pub operation: std::string::String,
32763
32764    /// The time when the operation was started.
32765    pub start_time: std::option::Option<wkt::Timestamp>,
32766
32767    /// The time when the operation ended.
32768    pub end_time: std::option::Option<wkt::Timestamp>,
32769
32770    /// The current version before the upgrade.
32771    pub current_version: std::string::String,
32772
32773    /// The target version for the upgrade.
32774    pub target_version: std::string::String,
32775
32776    /// Optional relative path to the resource. For example in node pool upgrades,
32777    /// the relative path of the node pool.
32778    pub resource: std::string::String,
32779
32780    /// Output only. The state of the upgrade.
32781    pub state: crate::model::upgrade_info_event::State,
32782
32783    /// The end of standard support timestamp.
32784    pub standard_support_end_time: std::option::Option<wkt::Timestamp>,
32785
32786    /// The end of extended support timestamp.
32787    pub extended_support_end_time: std::option::Option<wkt::Timestamp>,
32788
32789    /// A brief description of the event.
32790    pub description: std::string::String,
32791
32792    /// The type of the event.
32793    pub event_type: crate::model::upgrade_info_event::EventType,
32794
32795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32796}
32797
32798impl UpgradeInfoEvent {
32799    pub fn new() -> Self {
32800        std::default::Default::default()
32801    }
32802
32803    /// Sets the value of [resource_type][crate::model::UpgradeInfoEvent::resource_type].
32804    ///
32805    /// # Example
32806    /// ```ignore,no_run
32807    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32808    /// use google_cloud_container_v1::model::UpgradeResourceType;
32809    /// let x0 = UpgradeInfoEvent::new().set_resource_type(UpgradeResourceType::Master);
32810    /// let x1 = UpgradeInfoEvent::new().set_resource_type(UpgradeResourceType::NodePool);
32811    /// ```
32812    pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
32813        mut self,
32814        v: T,
32815    ) -> Self {
32816        self.resource_type = v.into();
32817        self
32818    }
32819
32820    /// Sets the value of [operation][crate::model::UpgradeInfoEvent::operation].
32821    ///
32822    /// # Example
32823    /// ```ignore,no_run
32824    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32825    /// let x = UpgradeInfoEvent::new().set_operation("example");
32826    /// ```
32827    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32828        self.operation = v.into();
32829        self
32830    }
32831
32832    /// Sets the value of [start_time][crate::model::UpgradeInfoEvent::start_time].
32833    ///
32834    /// # Example
32835    /// ```ignore,no_run
32836    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32837    /// use wkt::Timestamp;
32838    /// let x = UpgradeInfoEvent::new().set_start_time(Timestamp::default()/* use setters */);
32839    /// ```
32840    pub fn set_start_time<T>(mut self, v: T) -> Self
32841    where
32842        T: std::convert::Into<wkt::Timestamp>,
32843    {
32844        self.start_time = std::option::Option::Some(v.into());
32845        self
32846    }
32847
32848    /// Sets or clears the value of [start_time][crate::model::UpgradeInfoEvent::start_time].
32849    ///
32850    /// # Example
32851    /// ```ignore,no_run
32852    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32853    /// use wkt::Timestamp;
32854    /// let x = UpgradeInfoEvent::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
32855    /// let x = UpgradeInfoEvent::new().set_or_clear_start_time(None::<Timestamp>);
32856    /// ```
32857    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
32858    where
32859        T: std::convert::Into<wkt::Timestamp>,
32860    {
32861        self.start_time = v.map(|x| x.into());
32862        self
32863    }
32864
32865    /// Sets the value of [end_time][crate::model::UpgradeInfoEvent::end_time].
32866    ///
32867    /// # Example
32868    /// ```ignore,no_run
32869    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32870    /// use wkt::Timestamp;
32871    /// let x = UpgradeInfoEvent::new().set_end_time(Timestamp::default()/* use setters */);
32872    /// ```
32873    pub fn set_end_time<T>(mut self, v: T) -> Self
32874    where
32875        T: std::convert::Into<wkt::Timestamp>,
32876    {
32877        self.end_time = std::option::Option::Some(v.into());
32878        self
32879    }
32880
32881    /// Sets or clears the value of [end_time][crate::model::UpgradeInfoEvent::end_time].
32882    ///
32883    /// # Example
32884    /// ```ignore,no_run
32885    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32886    /// use wkt::Timestamp;
32887    /// let x = UpgradeInfoEvent::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
32888    /// let x = UpgradeInfoEvent::new().set_or_clear_end_time(None::<Timestamp>);
32889    /// ```
32890    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
32891    where
32892        T: std::convert::Into<wkt::Timestamp>,
32893    {
32894        self.end_time = v.map(|x| x.into());
32895        self
32896    }
32897
32898    /// Sets the value of [current_version][crate::model::UpgradeInfoEvent::current_version].
32899    ///
32900    /// # Example
32901    /// ```ignore,no_run
32902    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32903    /// let x = UpgradeInfoEvent::new().set_current_version("example");
32904    /// ```
32905    pub fn set_current_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32906        self.current_version = v.into();
32907        self
32908    }
32909
32910    /// Sets the value of [target_version][crate::model::UpgradeInfoEvent::target_version].
32911    ///
32912    /// # Example
32913    /// ```ignore,no_run
32914    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32915    /// let x = UpgradeInfoEvent::new().set_target_version("example");
32916    /// ```
32917    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32918        self.target_version = v.into();
32919        self
32920    }
32921
32922    /// Sets the value of [resource][crate::model::UpgradeInfoEvent::resource].
32923    ///
32924    /// # Example
32925    /// ```ignore,no_run
32926    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32927    /// let x = UpgradeInfoEvent::new().set_resource("example");
32928    /// ```
32929    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32930        self.resource = v.into();
32931        self
32932    }
32933
32934    /// Sets the value of [state][crate::model::UpgradeInfoEvent::state].
32935    ///
32936    /// # Example
32937    /// ```ignore,no_run
32938    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32939    /// use google_cloud_container_v1::model::upgrade_info_event::State;
32940    /// let x0 = UpgradeInfoEvent::new().set_state(State::Started);
32941    /// let x1 = UpgradeInfoEvent::new().set_state(State::Succeeded);
32942    /// let x2 = UpgradeInfoEvent::new().set_state(State::Failed);
32943    /// ```
32944    pub fn set_state<T: std::convert::Into<crate::model::upgrade_info_event::State>>(
32945        mut self,
32946        v: T,
32947    ) -> Self {
32948        self.state = v.into();
32949        self
32950    }
32951
32952    /// Sets the value of [standard_support_end_time][crate::model::UpgradeInfoEvent::standard_support_end_time].
32953    ///
32954    /// # Example
32955    /// ```ignore,no_run
32956    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32957    /// use wkt::Timestamp;
32958    /// let x = UpgradeInfoEvent::new().set_standard_support_end_time(Timestamp::default()/* use setters */);
32959    /// ```
32960    pub fn set_standard_support_end_time<T>(mut self, v: T) -> Self
32961    where
32962        T: std::convert::Into<wkt::Timestamp>,
32963    {
32964        self.standard_support_end_time = std::option::Option::Some(v.into());
32965        self
32966    }
32967
32968    /// Sets or clears the value of [standard_support_end_time][crate::model::UpgradeInfoEvent::standard_support_end_time].
32969    ///
32970    /// # Example
32971    /// ```ignore,no_run
32972    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32973    /// use wkt::Timestamp;
32974    /// let x = UpgradeInfoEvent::new().set_or_clear_standard_support_end_time(Some(Timestamp::default()/* use setters */));
32975    /// let x = UpgradeInfoEvent::new().set_or_clear_standard_support_end_time(None::<Timestamp>);
32976    /// ```
32977    pub fn set_or_clear_standard_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
32978    where
32979        T: std::convert::Into<wkt::Timestamp>,
32980    {
32981        self.standard_support_end_time = v.map(|x| x.into());
32982        self
32983    }
32984
32985    /// Sets the value of [extended_support_end_time][crate::model::UpgradeInfoEvent::extended_support_end_time].
32986    ///
32987    /// # Example
32988    /// ```ignore,no_run
32989    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
32990    /// use wkt::Timestamp;
32991    /// let x = UpgradeInfoEvent::new().set_extended_support_end_time(Timestamp::default()/* use setters */);
32992    /// ```
32993    pub fn set_extended_support_end_time<T>(mut self, v: T) -> Self
32994    where
32995        T: std::convert::Into<wkt::Timestamp>,
32996    {
32997        self.extended_support_end_time = std::option::Option::Some(v.into());
32998        self
32999    }
33000
33001    /// Sets or clears the value of [extended_support_end_time][crate::model::UpgradeInfoEvent::extended_support_end_time].
33002    ///
33003    /// # Example
33004    /// ```ignore,no_run
33005    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
33006    /// use wkt::Timestamp;
33007    /// let x = UpgradeInfoEvent::new().set_or_clear_extended_support_end_time(Some(Timestamp::default()/* use setters */));
33008    /// let x = UpgradeInfoEvent::new().set_or_clear_extended_support_end_time(None::<Timestamp>);
33009    /// ```
33010    pub fn set_or_clear_extended_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
33011    where
33012        T: std::convert::Into<wkt::Timestamp>,
33013    {
33014        self.extended_support_end_time = v.map(|x| x.into());
33015        self
33016    }
33017
33018    /// Sets the value of [description][crate::model::UpgradeInfoEvent::description].
33019    ///
33020    /// # Example
33021    /// ```ignore,no_run
33022    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
33023    /// let x = UpgradeInfoEvent::new().set_description("example");
33024    /// ```
33025    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33026        self.description = v.into();
33027        self
33028    }
33029
33030    /// Sets the value of [event_type][crate::model::UpgradeInfoEvent::event_type].
33031    ///
33032    /// # Example
33033    /// ```ignore,no_run
33034    /// # use google_cloud_container_v1::model::UpgradeInfoEvent;
33035    /// use google_cloud_container_v1::model::upgrade_info_event::EventType;
33036    /// let x0 = UpgradeInfoEvent::new().set_event_type(EventType::EndOfSupport);
33037    /// let x1 = UpgradeInfoEvent::new().set_event_type(EventType::CosMilestoneVersionUpdate);
33038    /// let x2 = UpgradeInfoEvent::new().set_event_type(EventType::UpgradeLifecycle);
33039    /// ```
33040    pub fn set_event_type<T: std::convert::Into<crate::model::upgrade_info_event::EventType>>(
33041        mut self,
33042        v: T,
33043    ) -> Self {
33044        self.event_type = v.into();
33045        self
33046    }
33047}
33048
33049impl wkt::message::Message for UpgradeInfoEvent {
33050    fn typename() -> &'static str {
33051        "type.googleapis.com/google.container.v1.UpgradeInfoEvent"
33052    }
33053}
33054
33055/// Defines additional types related to [UpgradeInfoEvent].
33056pub mod upgrade_info_event {
33057    #[allow(unused_imports)]
33058    use super::*;
33059
33060    /// The state of the upgrade.
33061    ///
33062    /// # Working with unknown values
33063    ///
33064    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33065    /// additional enum variants at any time. Adding new variants is not considered
33066    /// a breaking change. Applications should write their code in anticipation of:
33067    ///
33068    /// - New values appearing in future releases of the client library, **and**
33069    /// - New values received dynamically, without application changes.
33070    ///
33071    /// Please consult the [Working with enums] section in the user guide for some
33072    /// guidelines.
33073    ///
33074    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33075    #[derive(Clone, Debug, PartialEq)]
33076    #[non_exhaustive]
33077    pub enum State {
33078        /// STATE_UNSPECIFIED indicates the state is unspecified.
33079        Unspecified,
33080        /// STARTED indicates the upgrade has started.
33081        Started,
33082        /// SUCCEEDED indicates the upgrade has completed successfully.
33083        Succeeded,
33084        /// FAILED indicates the upgrade has failed.
33085        Failed,
33086        /// CANCELED indicates the upgrade has canceled.
33087        Canceled,
33088        /// If set, the enum was initialized with an unknown value.
33089        ///
33090        /// Applications can examine the value using [State::value] or
33091        /// [State::name].
33092        UnknownValue(state::UnknownValue),
33093    }
33094
33095    #[doc(hidden)]
33096    pub mod state {
33097        #[allow(unused_imports)]
33098        use super::*;
33099        #[derive(Clone, Debug, PartialEq)]
33100        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33101    }
33102
33103    impl State {
33104        /// Gets the enum value.
33105        ///
33106        /// Returns `None` if the enum contains an unknown value deserialized from
33107        /// the string representation of enums.
33108        pub fn value(&self) -> std::option::Option<i32> {
33109            match self {
33110                Self::Unspecified => std::option::Option::Some(0),
33111                Self::Started => std::option::Option::Some(3),
33112                Self::Succeeded => std::option::Option::Some(4),
33113                Self::Failed => std::option::Option::Some(5),
33114                Self::Canceled => std::option::Option::Some(6),
33115                Self::UnknownValue(u) => u.0.value(),
33116            }
33117        }
33118
33119        /// Gets the enum value as a string.
33120        ///
33121        /// Returns `None` if the enum contains an unknown value deserialized from
33122        /// the integer representation of enums.
33123        pub fn name(&self) -> std::option::Option<&str> {
33124            match self {
33125                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
33126                Self::Started => std::option::Option::Some("STARTED"),
33127                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
33128                Self::Failed => std::option::Option::Some("FAILED"),
33129                Self::Canceled => std::option::Option::Some("CANCELED"),
33130                Self::UnknownValue(u) => u.0.name(),
33131            }
33132        }
33133    }
33134
33135    impl std::default::Default for State {
33136        fn default() -> Self {
33137            use std::convert::From;
33138            Self::from(0)
33139        }
33140    }
33141
33142    impl std::fmt::Display for State {
33143        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33144            wkt::internal::display_enum(f, self.name(), self.value())
33145        }
33146    }
33147
33148    impl std::convert::From<i32> for State {
33149        fn from(value: i32) -> Self {
33150            match value {
33151                0 => Self::Unspecified,
33152                3 => Self::Started,
33153                4 => Self::Succeeded,
33154                5 => Self::Failed,
33155                6 => Self::Canceled,
33156                _ => Self::UnknownValue(state::UnknownValue(
33157                    wkt::internal::UnknownEnumValue::Integer(value),
33158                )),
33159            }
33160        }
33161    }
33162
33163    impl std::convert::From<&str> for State {
33164        fn from(value: &str) -> Self {
33165            use std::string::ToString;
33166            match value {
33167                "STATE_UNSPECIFIED" => Self::Unspecified,
33168                "STARTED" => Self::Started,
33169                "SUCCEEDED" => Self::Succeeded,
33170                "FAILED" => Self::Failed,
33171                "CANCELED" => Self::Canceled,
33172                _ => Self::UnknownValue(state::UnknownValue(
33173                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33174                )),
33175            }
33176        }
33177    }
33178
33179    impl serde::ser::Serialize for State {
33180        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33181        where
33182            S: serde::Serializer,
33183        {
33184            match self {
33185                Self::Unspecified => serializer.serialize_i32(0),
33186                Self::Started => serializer.serialize_i32(3),
33187                Self::Succeeded => serializer.serialize_i32(4),
33188                Self::Failed => serializer.serialize_i32(5),
33189                Self::Canceled => serializer.serialize_i32(6),
33190                Self::UnknownValue(u) => u.0.serialize(serializer),
33191            }
33192        }
33193    }
33194
33195    impl<'de> serde::de::Deserialize<'de> for State {
33196        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33197        where
33198            D: serde::Deserializer<'de>,
33199        {
33200            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
33201                ".google.container.v1.UpgradeInfoEvent.State",
33202            ))
33203        }
33204    }
33205
33206    /// The type of the event.
33207    ///
33208    /// # Working with unknown values
33209    ///
33210    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33211    /// additional enum variants at any time. Adding new variants is not considered
33212    /// a breaking change. Applications should write their code in anticipation of:
33213    ///
33214    /// - New values appearing in future releases of the client library, **and**
33215    /// - New values received dynamically, without application changes.
33216    ///
33217    /// Please consult the [Working with enums] section in the user guide for some
33218    /// guidelines.
33219    ///
33220    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33221    #[derive(Clone, Debug, PartialEq)]
33222    #[non_exhaustive]
33223    pub enum EventType {
33224        /// EVENT_TYPE_UNSPECIFIED indicates the event type is unspecified.
33225        Unspecified,
33226        /// END_OF_SUPPORT indicates GKE version reaches end of support, check
33227        /// standard_support_end_time and extended_support_end_time for more details.
33228        EndOfSupport,
33229        /// COS_MILESTONE_VERSION_UPDATE indicates that the COS node image will
33230        /// update COS milestone version for new patch versions starting with
33231        /// the one in the description.
33232        CosMilestoneVersionUpdate,
33233        /// UPGRADE_LIFECYCLE indicates the event is about the upgrade lifecycle.
33234        UpgradeLifecycle,
33235        /// If set, the enum was initialized with an unknown value.
33236        ///
33237        /// Applications can examine the value using [EventType::value] or
33238        /// [EventType::name].
33239        UnknownValue(event_type::UnknownValue),
33240    }
33241
33242    #[doc(hidden)]
33243    pub mod event_type {
33244        #[allow(unused_imports)]
33245        use super::*;
33246        #[derive(Clone, Debug, PartialEq)]
33247        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33248    }
33249
33250    impl EventType {
33251        /// Gets the enum value.
33252        ///
33253        /// Returns `None` if the enum contains an unknown value deserialized from
33254        /// the string representation of enums.
33255        pub fn value(&self) -> std::option::Option<i32> {
33256            match self {
33257                Self::Unspecified => std::option::Option::Some(0),
33258                Self::EndOfSupport => std::option::Option::Some(1),
33259                Self::CosMilestoneVersionUpdate => std::option::Option::Some(2),
33260                Self::UpgradeLifecycle => std::option::Option::Some(3),
33261                Self::UnknownValue(u) => u.0.value(),
33262            }
33263        }
33264
33265        /// Gets the enum value as a string.
33266        ///
33267        /// Returns `None` if the enum contains an unknown value deserialized from
33268        /// the integer representation of enums.
33269        pub fn name(&self) -> std::option::Option<&str> {
33270            match self {
33271                Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
33272                Self::EndOfSupport => std::option::Option::Some("END_OF_SUPPORT"),
33273                Self::CosMilestoneVersionUpdate => {
33274                    std::option::Option::Some("COS_MILESTONE_VERSION_UPDATE")
33275                }
33276                Self::UpgradeLifecycle => std::option::Option::Some("UPGRADE_LIFECYCLE"),
33277                Self::UnknownValue(u) => u.0.name(),
33278            }
33279        }
33280    }
33281
33282    impl std::default::Default for EventType {
33283        fn default() -> Self {
33284            use std::convert::From;
33285            Self::from(0)
33286        }
33287    }
33288
33289    impl std::fmt::Display for EventType {
33290        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33291            wkt::internal::display_enum(f, self.name(), self.value())
33292        }
33293    }
33294
33295    impl std::convert::From<i32> for EventType {
33296        fn from(value: i32) -> Self {
33297            match value {
33298                0 => Self::Unspecified,
33299                1 => Self::EndOfSupport,
33300                2 => Self::CosMilestoneVersionUpdate,
33301                3 => Self::UpgradeLifecycle,
33302                _ => Self::UnknownValue(event_type::UnknownValue(
33303                    wkt::internal::UnknownEnumValue::Integer(value),
33304                )),
33305            }
33306        }
33307    }
33308
33309    impl std::convert::From<&str> for EventType {
33310        fn from(value: &str) -> Self {
33311            use std::string::ToString;
33312            match value {
33313                "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
33314                "END_OF_SUPPORT" => Self::EndOfSupport,
33315                "COS_MILESTONE_VERSION_UPDATE" => Self::CosMilestoneVersionUpdate,
33316                "UPGRADE_LIFECYCLE" => Self::UpgradeLifecycle,
33317                _ => Self::UnknownValue(event_type::UnknownValue(
33318                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33319                )),
33320            }
33321        }
33322    }
33323
33324    impl serde::ser::Serialize for EventType {
33325        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33326        where
33327            S: serde::Serializer,
33328        {
33329            match self {
33330                Self::Unspecified => serializer.serialize_i32(0),
33331                Self::EndOfSupport => serializer.serialize_i32(1),
33332                Self::CosMilestoneVersionUpdate => serializer.serialize_i32(2),
33333                Self::UpgradeLifecycle => serializer.serialize_i32(3),
33334                Self::UnknownValue(u) => u.0.serialize(serializer),
33335            }
33336        }
33337    }
33338
33339    impl<'de> serde::de::Deserialize<'de> for EventType {
33340        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33341        where
33342            D: serde::Deserializer<'de>,
33343        {
33344            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
33345                ".google.container.v1.UpgradeInfoEvent.EventType",
33346            ))
33347        }
33348    }
33349}
33350
33351/// UpgradeAvailableEvent is a notification sent to customers when a new
33352/// available version is released.
33353#[derive(Clone, Default, PartialEq)]
33354#[non_exhaustive]
33355pub struct UpgradeAvailableEvent {
33356    /// The release version available for upgrade.
33357    pub version: std::string::String,
33358
33359    /// The resource type of the release version.
33360    pub resource_type: crate::model::UpgradeResourceType,
33361
33362    /// The release channel of the version. If empty, it means a non-channel
33363    /// release.
33364    pub release_channel: std::option::Option<crate::model::ReleaseChannel>,
33365
33366    /// Optional relative path to the resource. For example, the relative path of
33367    /// the node pool.
33368    pub resource: std::string::String,
33369
33370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33371}
33372
33373impl UpgradeAvailableEvent {
33374    pub fn new() -> Self {
33375        std::default::Default::default()
33376    }
33377
33378    /// Sets the value of [version][crate::model::UpgradeAvailableEvent::version].
33379    ///
33380    /// # Example
33381    /// ```ignore,no_run
33382    /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
33383    /// let x = UpgradeAvailableEvent::new().set_version("example");
33384    /// ```
33385    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33386        self.version = v.into();
33387        self
33388    }
33389
33390    /// Sets the value of [resource_type][crate::model::UpgradeAvailableEvent::resource_type].
33391    ///
33392    /// # Example
33393    /// ```ignore,no_run
33394    /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
33395    /// use google_cloud_container_v1::model::UpgradeResourceType;
33396    /// let x0 = UpgradeAvailableEvent::new().set_resource_type(UpgradeResourceType::Master);
33397    /// let x1 = UpgradeAvailableEvent::new().set_resource_type(UpgradeResourceType::NodePool);
33398    /// ```
33399    pub fn set_resource_type<T: std::convert::Into<crate::model::UpgradeResourceType>>(
33400        mut self,
33401        v: T,
33402    ) -> Self {
33403        self.resource_type = v.into();
33404        self
33405    }
33406
33407    /// Sets the value of [release_channel][crate::model::UpgradeAvailableEvent::release_channel].
33408    ///
33409    /// # Example
33410    /// ```ignore,no_run
33411    /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
33412    /// use google_cloud_container_v1::model::ReleaseChannel;
33413    /// let x = UpgradeAvailableEvent::new().set_release_channel(ReleaseChannel::default()/* use setters */);
33414    /// ```
33415    pub fn set_release_channel<T>(mut self, v: T) -> Self
33416    where
33417        T: std::convert::Into<crate::model::ReleaseChannel>,
33418    {
33419        self.release_channel = std::option::Option::Some(v.into());
33420        self
33421    }
33422
33423    /// Sets or clears the value of [release_channel][crate::model::UpgradeAvailableEvent::release_channel].
33424    ///
33425    /// # Example
33426    /// ```ignore,no_run
33427    /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
33428    /// use google_cloud_container_v1::model::ReleaseChannel;
33429    /// let x = UpgradeAvailableEvent::new().set_or_clear_release_channel(Some(ReleaseChannel::default()/* use setters */));
33430    /// let x = UpgradeAvailableEvent::new().set_or_clear_release_channel(None::<ReleaseChannel>);
33431    /// ```
33432    pub fn set_or_clear_release_channel<T>(mut self, v: std::option::Option<T>) -> Self
33433    where
33434        T: std::convert::Into<crate::model::ReleaseChannel>,
33435    {
33436        self.release_channel = v.map(|x| x.into());
33437        self
33438    }
33439
33440    /// Sets the value of [resource][crate::model::UpgradeAvailableEvent::resource].
33441    ///
33442    /// # Example
33443    /// ```ignore,no_run
33444    /// # use google_cloud_container_v1::model::UpgradeAvailableEvent;
33445    /// let x = UpgradeAvailableEvent::new().set_resource("example");
33446    /// ```
33447    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33448        self.resource = v.into();
33449        self
33450    }
33451}
33452
33453impl wkt::message::Message for UpgradeAvailableEvent {
33454    fn typename() -> &'static str {
33455        "type.googleapis.com/google.container.v1.UpgradeAvailableEvent"
33456    }
33457}
33458
33459/// SecurityBulletinEvent is a notification sent to customers when a security
33460/// bulletin has been posted that they are vulnerable to.
33461#[derive(Clone, Default, PartialEq)]
33462#[non_exhaustive]
33463pub struct SecurityBulletinEvent {
33464    /// The resource type (node/control plane) that has the vulnerability. Multiple
33465    /// notifications (1 notification per resource type) will be sent for a
33466    /// vulnerability that affects > 1 resource type.
33467    pub resource_type_affected: std::string::String,
33468
33469    /// The ID of the bulletin corresponding to the vulnerability.
33470    pub bulletin_id: std::string::String,
33471
33472    /// The CVEs associated with this bulletin.
33473    pub cve_ids: std::vec::Vec<std::string::String>,
33474
33475    /// The severity of this bulletin as it relates to GKE.
33476    pub severity: std::string::String,
33477
33478    /// The URI link to the bulletin on the website for more information.
33479    pub bulletin_uri: std::string::String,
33480
33481    /// A brief description of the bulletin. See the bulletin pointed to by the
33482    /// bulletin_uri field for an expanded description.
33483    pub brief_description: std::string::String,
33484
33485    /// The GKE minor versions affected by this vulnerability.
33486    pub affected_supported_minors: std::vec::Vec<std::string::String>,
33487
33488    /// The GKE versions where this vulnerability is patched.
33489    pub patched_versions: std::vec::Vec<std::string::String>,
33490
33491    /// This represents a version selected from the patched_versions field that
33492    /// the cluster receiving this notification should most likely want to upgrade
33493    /// to based on its current version. Note that if this notification is being
33494    /// received by a given cluster, it means that this version is currently
33495    /// available as an upgrade target in that cluster's location.
33496    pub suggested_upgrade_target: std::string::String,
33497
33498    /// If this field is specified, it means there are manual steps that the user
33499    /// must take to make their clusters safe.
33500    pub manual_steps_required: bool,
33501
33502    /// The GKE versions where this vulnerability is mitigated.
33503    pub mitigated_versions: std::vec::Vec<std::string::String>,
33504
33505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33506}
33507
33508impl SecurityBulletinEvent {
33509    pub fn new() -> Self {
33510        std::default::Default::default()
33511    }
33512
33513    /// Sets the value of [resource_type_affected][crate::model::SecurityBulletinEvent::resource_type_affected].
33514    ///
33515    /// # Example
33516    /// ```ignore,no_run
33517    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33518    /// let x = SecurityBulletinEvent::new().set_resource_type_affected("example");
33519    /// ```
33520    pub fn set_resource_type_affected<T: std::convert::Into<std::string::String>>(
33521        mut self,
33522        v: T,
33523    ) -> Self {
33524        self.resource_type_affected = v.into();
33525        self
33526    }
33527
33528    /// Sets the value of [bulletin_id][crate::model::SecurityBulletinEvent::bulletin_id].
33529    ///
33530    /// # Example
33531    /// ```ignore,no_run
33532    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33533    /// let x = SecurityBulletinEvent::new().set_bulletin_id("example");
33534    /// ```
33535    pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33536        self.bulletin_id = v.into();
33537        self
33538    }
33539
33540    /// Sets the value of [cve_ids][crate::model::SecurityBulletinEvent::cve_ids].
33541    ///
33542    /// # Example
33543    /// ```ignore,no_run
33544    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33545    /// let x = SecurityBulletinEvent::new().set_cve_ids(["a", "b", "c"]);
33546    /// ```
33547    pub fn set_cve_ids<T, V>(mut self, v: T) -> Self
33548    where
33549        T: std::iter::IntoIterator<Item = V>,
33550        V: std::convert::Into<std::string::String>,
33551    {
33552        use std::iter::Iterator;
33553        self.cve_ids = v.into_iter().map(|i| i.into()).collect();
33554        self
33555    }
33556
33557    /// Sets the value of [severity][crate::model::SecurityBulletinEvent::severity].
33558    ///
33559    /// # Example
33560    /// ```ignore,no_run
33561    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33562    /// let x = SecurityBulletinEvent::new().set_severity("example");
33563    /// ```
33564    pub fn set_severity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33565        self.severity = v.into();
33566        self
33567    }
33568
33569    /// Sets the value of [bulletin_uri][crate::model::SecurityBulletinEvent::bulletin_uri].
33570    ///
33571    /// # Example
33572    /// ```ignore,no_run
33573    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33574    /// let x = SecurityBulletinEvent::new().set_bulletin_uri("example");
33575    /// ```
33576    pub fn set_bulletin_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33577        self.bulletin_uri = v.into();
33578        self
33579    }
33580
33581    /// Sets the value of [brief_description][crate::model::SecurityBulletinEvent::brief_description].
33582    ///
33583    /// # Example
33584    /// ```ignore,no_run
33585    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33586    /// let x = SecurityBulletinEvent::new().set_brief_description("example");
33587    /// ```
33588    pub fn set_brief_description<T: std::convert::Into<std::string::String>>(
33589        mut self,
33590        v: T,
33591    ) -> Self {
33592        self.brief_description = v.into();
33593        self
33594    }
33595
33596    /// Sets the value of [affected_supported_minors][crate::model::SecurityBulletinEvent::affected_supported_minors].
33597    ///
33598    /// # Example
33599    /// ```ignore,no_run
33600    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33601    /// let x = SecurityBulletinEvent::new().set_affected_supported_minors(["a", "b", "c"]);
33602    /// ```
33603    pub fn set_affected_supported_minors<T, V>(mut self, v: T) -> Self
33604    where
33605        T: std::iter::IntoIterator<Item = V>,
33606        V: std::convert::Into<std::string::String>,
33607    {
33608        use std::iter::Iterator;
33609        self.affected_supported_minors = v.into_iter().map(|i| i.into()).collect();
33610        self
33611    }
33612
33613    /// Sets the value of [patched_versions][crate::model::SecurityBulletinEvent::patched_versions].
33614    ///
33615    /// # Example
33616    /// ```ignore,no_run
33617    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33618    /// let x = SecurityBulletinEvent::new().set_patched_versions(["a", "b", "c"]);
33619    /// ```
33620    pub fn set_patched_versions<T, V>(mut self, v: T) -> Self
33621    where
33622        T: std::iter::IntoIterator<Item = V>,
33623        V: std::convert::Into<std::string::String>,
33624    {
33625        use std::iter::Iterator;
33626        self.patched_versions = v.into_iter().map(|i| i.into()).collect();
33627        self
33628    }
33629
33630    /// Sets the value of [suggested_upgrade_target][crate::model::SecurityBulletinEvent::suggested_upgrade_target].
33631    ///
33632    /// # Example
33633    /// ```ignore,no_run
33634    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33635    /// let x = SecurityBulletinEvent::new().set_suggested_upgrade_target("example");
33636    /// ```
33637    pub fn set_suggested_upgrade_target<T: std::convert::Into<std::string::String>>(
33638        mut self,
33639        v: T,
33640    ) -> Self {
33641        self.suggested_upgrade_target = v.into();
33642        self
33643    }
33644
33645    /// Sets the value of [manual_steps_required][crate::model::SecurityBulletinEvent::manual_steps_required].
33646    ///
33647    /// # Example
33648    /// ```ignore,no_run
33649    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33650    /// let x = SecurityBulletinEvent::new().set_manual_steps_required(true);
33651    /// ```
33652    pub fn set_manual_steps_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33653        self.manual_steps_required = v.into();
33654        self
33655    }
33656
33657    /// Sets the value of [mitigated_versions][crate::model::SecurityBulletinEvent::mitigated_versions].
33658    ///
33659    /// # Example
33660    /// ```ignore,no_run
33661    /// # use google_cloud_container_v1::model::SecurityBulletinEvent;
33662    /// let x = SecurityBulletinEvent::new().set_mitigated_versions(["a", "b", "c"]);
33663    /// ```
33664    pub fn set_mitigated_versions<T, V>(mut self, v: T) -> Self
33665    where
33666        T: std::iter::IntoIterator<Item = V>,
33667        V: std::convert::Into<std::string::String>,
33668    {
33669        use std::iter::Iterator;
33670        self.mitigated_versions = v.into_iter().map(|i| i.into()).collect();
33671        self
33672    }
33673}
33674
33675impl wkt::message::Message for SecurityBulletinEvent {
33676    fn typename() -> &'static str {
33677        "type.googleapis.com/google.container.v1.SecurityBulletinEvent"
33678    }
33679}
33680
33681/// Autopilot is the configuration for Autopilot settings on the cluster.
33682#[derive(Clone, Default, PartialEq)]
33683#[non_exhaustive]
33684pub struct Autopilot {
33685    /// Enable Autopilot
33686    pub enabled: bool,
33687
33688    /// WorkloadPolicyConfig is the configuration related to GCW workload policy
33689    pub workload_policy_config: std::option::Option<crate::model::WorkloadPolicyConfig>,
33690
33691    /// PrivilegedAdmissionConfig is the configuration related to privileged
33692    /// admission control.
33693    pub privileged_admission_config: std::option::Option<crate::model::PrivilegedAdmissionConfig>,
33694
33695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33696}
33697
33698impl Autopilot {
33699    pub fn new() -> Self {
33700        std::default::Default::default()
33701    }
33702
33703    /// Sets the value of [enabled][crate::model::Autopilot::enabled].
33704    ///
33705    /// # Example
33706    /// ```ignore,no_run
33707    /// # use google_cloud_container_v1::model::Autopilot;
33708    /// let x = Autopilot::new().set_enabled(true);
33709    /// ```
33710    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33711        self.enabled = v.into();
33712        self
33713    }
33714
33715    /// Sets the value of [workload_policy_config][crate::model::Autopilot::workload_policy_config].
33716    ///
33717    /// # Example
33718    /// ```ignore,no_run
33719    /// # use google_cloud_container_v1::model::Autopilot;
33720    /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
33721    /// let x = Autopilot::new().set_workload_policy_config(WorkloadPolicyConfig::default()/* use setters */);
33722    /// ```
33723    pub fn set_workload_policy_config<T>(mut self, v: T) -> Self
33724    where
33725        T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
33726    {
33727        self.workload_policy_config = std::option::Option::Some(v.into());
33728        self
33729    }
33730
33731    /// Sets or clears the value of [workload_policy_config][crate::model::Autopilot::workload_policy_config].
33732    ///
33733    /// # Example
33734    /// ```ignore,no_run
33735    /// # use google_cloud_container_v1::model::Autopilot;
33736    /// use google_cloud_container_v1::model::WorkloadPolicyConfig;
33737    /// let x = Autopilot::new().set_or_clear_workload_policy_config(Some(WorkloadPolicyConfig::default()/* use setters */));
33738    /// let x = Autopilot::new().set_or_clear_workload_policy_config(None::<WorkloadPolicyConfig>);
33739    /// ```
33740    pub fn set_or_clear_workload_policy_config<T>(mut self, v: std::option::Option<T>) -> Self
33741    where
33742        T: std::convert::Into<crate::model::WorkloadPolicyConfig>,
33743    {
33744        self.workload_policy_config = v.map(|x| x.into());
33745        self
33746    }
33747
33748    /// Sets the value of [privileged_admission_config][crate::model::Autopilot::privileged_admission_config].
33749    ///
33750    /// # Example
33751    /// ```ignore,no_run
33752    /// # use google_cloud_container_v1::model::Autopilot;
33753    /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
33754    /// let x = Autopilot::new().set_privileged_admission_config(PrivilegedAdmissionConfig::default()/* use setters */);
33755    /// ```
33756    pub fn set_privileged_admission_config<T>(mut self, v: T) -> Self
33757    where
33758        T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
33759    {
33760        self.privileged_admission_config = std::option::Option::Some(v.into());
33761        self
33762    }
33763
33764    /// Sets or clears the value of [privileged_admission_config][crate::model::Autopilot::privileged_admission_config].
33765    ///
33766    /// # Example
33767    /// ```ignore,no_run
33768    /// # use google_cloud_container_v1::model::Autopilot;
33769    /// use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
33770    /// let x = Autopilot::new().set_or_clear_privileged_admission_config(Some(PrivilegedAdmissionConfig::default()/* use setters */));
33771    /// let x = Autopilot::new().set_or_clear_privileged_admission_config(None::<PrivilegedAdmissionConfig>);
33772    /// ```
33773    pub fn set_or_clear_privileged_admission_config<T>(mut self, v: std::option::Option<T>) -> Self
33774    where
33775        T: std::convert::Into<crate::model::PrivilegedAdmissionConfig>,
33776    {
33777        self.privileged_admission_config = v.map(|x| x.into());
33778        self
33779    }
33780}
33781
33782impl wkt::message::Message for Autopilot {
33783    fn typename() -> &'static str {
33784        "type.googleapis.com/google.container.v1.Autopilot"
33785    }
33786}
33787
33788/// PrivilegedAdmissionConfig stores the list of authorized allowlist
33789/// paths for the cluster.
33790#[derive(Clone, Default, PartialEq)]
33791#[non_exhaustive]
33792pub struct PrivilegedAdmissionConfig {
33793    /// The customer allowlist Cloud Storage paths for the cluster. These paths are
33794    /// used with the `--autopilot-privileged-admission` flag to authorize
33795    /// privileged workloads in Autopilot clusters.
33796    ///
33797    /// Paths can be GKE-owned, in the format
33798    /// `gke://<partner_name>/<app_name>/<allowlist_path>`, or customer-owned, in
33799    /// the format `gs://<bucket_name>/<allowlist_path>`.
33800    ///
33801    /// Wildcards (`*`) are supported to authorize all allowlists under specific
33802    /// paths or directories. Example: `gs://my-bucket/*` will authorize all
33803    /// allowlists under the `my-bucket` bucket.
33804    pub allowlist_paths: std::vec::Vec<std::string::String>,
33805
33806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33807}
33808
33809impl PrivilegedAdmissionConfig {
33810    pub fn new() -> Self {
33811        std::default::Default::default()
33812    }
33813
33814    /// Sets the value of [allowlist_paths][crate::model::PrivilegedAdmissionConfig::allowlist_paths].
33815    ///
33816    /// # Example
33817    /// ```ignore,no_run
33818    /// # use google_cloud_container_v1::model::PrivilegedAdmissionConfig;
33819    /// let x = PrivilegedAdmissionConfig::new().set_allowlist_paths(["a", "b", "c"]);
33820    /// ```
33821    pub fn set_allowlist_paths<T, V>(mut self, v: T) -> Self
33822    where
33823        T: std::iter::IntoIterator<Item = V>,
33824        V: std::convert::Into<std::string::String>,
33825    {
33826        use std::iter::Iterator;
33827        self.allowlist_paths = v.into_iter().map(|i| i.into()).collect();
33828        self
33829    }
33830}
33831
33832impl wkt::message::Message for PrivilegedAdmissionConfig {
33833    fn typename() -> &'static str {
33834        "type.googleapis.com/google.container.v1.PrivilegedAdmissionConfig"
33835    }
33836}
33837
33838/// WorkloadPolicyConfig is the configuration related to GCW workload policy
33839#[derive(Clone, Default, PartialEq)]
33840#[non_exhaustive]
33841pub struct WorkloadPolicyConfig {
33842    /// If true, workloads can use NET_ADMIN capability.
33843    pub allow_net_admin: std::option::Option<bool>,
33844
33845    /// If true, enables the GCW Auditor that audits workloads on
33846    /// standard clusters.
33847    pub autopilot_compatibility_auditing_enabled: std::option::Option<bool>,
33848
33849    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33850}
33851
33852impl WorkloadPolicyConfig {
33853    pub fn new() -> Self {
33854        std::default::Default::default()
33855    }
33856
33857    /// Sets the value of [allow_net_admin][crate::model::WorkloadPolicyConfig::allow_net_admin].
33858    ///
33859    /// # Example
33860    /// ```ignore,no_run
33861    /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
33862    /// let x = WorkloadPolicyConfig::new().set_allow_net_admin(true);
33863    /// ```
33864    pub fn set_allow_net_admin<T>(mut self, v: T) -> Self
33865    where
33866        T: std::convert::Into<bool>,
33867    {
33868        self.allow_net_admin = std::option::Option::Some(v.into());
33869        self
33870    }
33871
33872    /// Sets or clears the value of [allow_net_admin][crate::model::WorkloadPolicyConfig::allow_net_admin].
33873    ///
33874    /// # Example
33875    /// ```ignore,no_run
33876    /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
33877    /// let x = WorkloadPolicyConfig::new().set_or_clear_allow_net_admin(Some(false));
33878    /// let x = WorkloadPolicyConfig::new().set_or_clear_allow_net_admin(None::<bool>);
33879    /// ```
33880    pub fn set_or_clear_allow_net_admin<T>(mut self, v: std::option::Option<T>) -> Self
33881    where
33882        T: std::convert::Into<bool>,
33883    {
33884        self.allow_net_admin = v.map(|x| x.into());
33885        self
33886    }
33887
33888    /// Sets the value of [autopilot_compatibility_auditing_enabled][crate::model::WorkloadPolicyConfig::autopilot_compatibility_auditing_enabled].
33889    ///
33890    /// # Example
33891    /// ```ignore,no_run
33892    /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
33893    /// let x = WorkloadPolicyConfig::new().set_autopilot_compatibility_auditing_enabled(true);
33894    /// ```
33895    pub fn set_autopilot_compatibility_auditing_enabled<T>(mut self, v: T) -> Self
33896    where
33897        T: std::convert::Into<bool>,
33898    {
33899        self.autopilot_compatibility_auditing_enabled = std::option::Option::Some(v.into());
33900        self
33901    }
33902
33903    /// Sets or clears the value of [autopilot_compatibility_auditing_enabled][crate::model::WorkloadPolicyConfig::autopilot_compatibility_auditing_enabled].
33904    ///
33905    /// # Example
33906    /// ```ignore,no_run
33907    /// # use google_cloud_container_v1::model::WorkloadPolicyConfig;
33908    /// let x = WorkloadPolicyConfig::new().set_or_clear_autopilot_compatibility_auditing_enabled(Some(false));
33909    /// let x = WorkloadPolicyConfig::new().set_or_clear_autopilot_compatibility_auditing_enabled(None::<bool>);
33910    /// ```
33911    pub fn set_or_clear_autopilot_compatibility_auditing_enabled<T>(
33912        mut self,
33913        v: std::option::Option<T>,
33914    ) -> Self
33915    where
33916        T: std::convert::Into<bool>,
33917    {
33918        self.autopilot_compatibility_auditing_enabled = v.map(|x| x.into());
33919        self
33920    }
33921}
33922
33923impl wkt::message::Message for WorkloadPolicyConfig {
33924    fn typename() -> &'static str {
33925        "type.googleapis.com/google.container.v1.WorkloadPolicyConfig"
33926    }
33927}
33928
33929/// LoggingConfig is cluster logging configuration.
33930#[derive(Clone, Default, PartialEq)]
33931#[non_exhaustive]
33932pub struct LoggingConfig {
33933    /// Logging components configuration
33934    pub component_config: std::option::Option<crate::model::LoggingComponentConfig>,
33935
33936    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33937}
33938
33939impl LoggingConfig {
33940    pub fn new() -> Self {
33941        std::default::Default::default()
33942    }
33943
33944    /// Sets the value of [component_config][crate::model::LoggingConfig::component_config].
33945    ///
33946    /// # Example
33947    /// ```ignore,no_run
33948    /// # use google_cloud_container_v1::model::LoggingConfig;
33949    /// use google_cloud_container_v1::model::LoggingComponentConfig;
33950    /// let x = LoggingConfig::new().set_component_config(LoggingComponentConfig::default()/* use setters */);
33951    /// ```
33952    pub fn set_component_config<T>(mut self, v: T) -> Self
33953    where
33954        T: std::convert::Into<crate::model::LoggingComponentConfig>,
33955    {
33956        self.component_config = std::option::Option::Some(v.into());
33957        self
33958    }
33959
33960    /// Sets or clears the value of [component_config][crate::model::LoggingConfig::component_config].
33961    ///
33962    /// # Example
33963    /// ```ignore,no_run
33964    /// # use google_cloud_container_v1::model::LoggingConfig;
33965    /// use google_cloud_container_v1::model::LoggingComponentConfig;
33966    /// let x = LoggingConfig::new().set_or_clear_component_config(Some(LoggingComponentConfig::default()/* use setters */));
33967    /// let x = LoggingConfig::new().set_or_clear_component_config(None::<LoggingComponentConfig>);
33968    /// ```
33969    pub fn set_or_clear_component_config<T>(mut self, v: std::option::Option<T>) -> Self
33970    where
33971        T: std::convert::Into<crate::model::LoggingComponentConfig>,
33972    {
33973        self.component_config = v.map(|x| x.into());
33974        self
33975    }
33976}
33977
33978impl wkt::message::Message for LoggingConfig {
33979    fn typename() -> &'static str {
33980        "type.googleapis.com/google.container.v1.LoggingConfig"
33981    }
33982}
33983
33984/// LoggingComponentConfig is cluster logging component configuration.
33985#[derive(Clone, Default, PartialEq)]
33986#[non_exhaustive]
33987pub struct LoggingComponentConfig {
33988    /// Select components to collect logs. An empty set would disable all logging.
33989    pub enable_components: std::vec::Vec<crate::model::logging_component_config::Component>,
33990
33991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33992}
33993
33994impl LoggingComponentConfig {
33995    pub fn new() -> Self {
33996        std::default::Default::default()
33997    }
33998
33999    /// Sets the value of [enable_components][crate::model::LoggingComponentConfig::enable_components].
34000    ///
34001    /// # Example
34002    /// ```ignore,no_run
34003    /// # use google_cloud_container_v1::model::LoggingComponentConfig;
34004    /// use google_cloud_container_v1::model::logging_component_config::Component;
34005    /// let x = LoggingComponentConfig::new().set_enable_components([
34006    ///     Component::SystemComponents,
34007    ///     Component::Workloads,
34008    ///     Component::Apiserver,
34009    /// ]);
34010    /// ```
34011    pub fn set_enable_components<T, V>(mut self, v: T) -> Self
34012    where
34013        T: std::iter::IntoIterator<Item = V>,
34014        V: std::convert::Into<crate::model::logging_component_config::Component>,
34015    {
34016        use std::iter::Iterator;
34017        self.enable_components = v.into_iter().map(|i| i.into()).collect();
34018        self
34019    }
34020}
34021
34022impl wkt::message::Message for LoggingComponentConfig {
34023    fn typename() -> &'static str {
34024        "type.googleapis.com/google.container.v1.LoggingComponentConfig"
34025    }
34026}
34027
34028/// Defines additional types related to [LoggingComponentConfig].
34029pub mod logging_component_config {
34030    #[allow(unused_imports)]
34031    use super::*;
34032
34033    /// GKE components exposing logs
34034    ///
34035    /// # Working with unknown values
34036    ///
34037    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34038    /// additional enum variants at any time. Adding new variants is not considered
34039    /// a breaking change. Applications should write their code in anticipation of:
34040    ///
34041    /// - New values appearing in future releases of the client library, **and**
34042    /// - New values received dynamically, without application changes.
34043    ///
34044    /// Please consult the [Working with enums] section in the user guide for some
34045    /// guidelines.
34046    ///
34047    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34048    #[derive(Clone, Debug, PartialEq)]
34049    #[non_exhaustive]
34050    pub enum Component {
34051        /// Default value. This shouldn't be used.
34052        Unspecified,
34053        /// system components
34054        SystemComponents,
34055        /// workloads
34056        Workloads,
34057        /// kube-apiserver
34058        Apiserver,
34059        /// kube-scheduler
34060        Scheduler,
34061        /// kube-controller-manager
34062        ControllerManager,
34063        /// kcp-sshd
34064        KcpSshd,
34065        /// kcp connection logs
34066        KcpConnection,
34067        /// horizontal pod autoscaler decision logs
34068        KcpHpa,
34069        /// If set, the enum was initialized with an unknown value.
34070        ///
34071        /// Applications can examine the value using [Component::value] or
34072        /// [Component::name].
34073        UnknownValue(component::UnknownValue),
34074    }
34075
34076    #[doc(hidden)]
34077    pub mod component {
34078        #[allow(unused_imports)]
34079        use super::*;
34080        #[derive(Clone, Debug, PartialEq)]
34081        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34082    }
34083
34084    impl Component {
34085        /// Gets the enum value.
34086        ///
34087        /// Returns `None` if the enum contains an unknown value deserialized from
34088        /// the string representation of enums.
34089        pub fn value(&self) -> std::option::Option<i32> {
34090            match self {
34091                Self::Unspecified => std::option::Option::Some(0),
34092                Self::SystemComponents => std::option::Option::Some(1),
34093                Self::Workloads => std::option::Option::Some(2),
34094                Self::Apiserver => std::option::Option::Some(3),
34095                Self::Scheduler => std::option::Option::Some(4),
34096                Self::ControllerManager => std::option::Option::Some(5),
34097                Self::KcpSshd => std::option::Option::Some(7),
34098                Self::KcpConnection => std::option::Option::Some(8),
34099                Self::KcpHpa => std::option::Option::Some(9),
34100                Self::UnknownValue(u) => u.0.value(),
34101            }
34102        }
34103
34104        /// Gets the enum value as a string.
34105        ///
34106        /// Returns `None` if the enum contains an unknown value deserialized from
34107        /// the integer representation of enums.
34108        pub fn name(&self) -> std::option::Option<&str> {
34109            match self {
34110                Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
34111                Self::SystemComponents => std::option::Option::Some("SYSTEM_COMPONENTS"),
34112                Self::Workloads => std::option::Option::Some("WORKLOADS"),
34113                Self::Apiserver => std::option::Option::Some("APISERVER"),
34114                Self::Scheduler => std::option::Option::Some("SCHEDULER"),
34115                Self::ControllerManager => std::option::Option::Some("CONTROLLER_MANAGER"),
34116                Self::KcpSshd => std::option::Option::Some("KCP_SSHD"),
34117                Self::KcpConnection => std::option::Option::Some("KCP_CONNECTION"),
34118                Self::KcpHpa => std::option::Option::Some("KCP_HPA"),
34119                Self::UnknownValue(u) => u.0.name(),
34120            }
34121        }
34122    }
34123
34124    impl std::default::Default for Component {
34125        fn default() -> Self {
34126            use std::convert::From;
34127            Self::from(0)
34128        }
34129    }
34130
34131    impl std::fmt::Display for Component {
34132        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34133            wkt::internal::display_enum(f, self.name(), self.value())
34134        }
34135    }
34136
34137    impl std::convert::From<i32> for Component {
34138        fn from(value: i32) -> Self {
34139            match value {
34140                0 => Self::Unspecified,
34141                1 => Self::SystemComponents,
34142                2 => Self::Workloads,
34143                3 => Self::Apiserver,
34144                4 => Self::Scheduler,
34145                5 => Self::ControllerManager,
34146                7 => Self::KcpSshd,
34147                8 => Self::KcpConnection,
34148                9 => Self::KcpHpa,
34149                _ => Self::UnknownValue(component::UnknownValue(
34150                    wkt::internal::UnknownEnumValue::Integer(value),
34151                )),
34152            }
34153        }
34154    }
34155
34156    impl std::convert::From<&str> for Component {
34157        fn from(value: &str) -> Self {
34158            use std::string::ToString;
34159            match value {
34160                "COMPONENT_UNSPECIFIED" => Self::Unspecified,
34161                "SYSTEM_COMPONENTS" => Self::SystemComponents,
34162                "WORKLOADS" => Self::Workloads,
34163                "APISERVER" => Self::Apiserver,
34164                "SCHEDULER" => Self::Scheduler,
34165                "CONTROLLER_MANAGER" => Self::ControllerManager,
34166                "KCP_SSHD" => Self::KcpSshd,
34167                "KCP_CONNECTION" => Self::KcpConnection,
34168                "KCP_HPA" => Self::KcpHpa,
34169                _ => Self::UnknownValue(component::UnknownValue(
34170                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34171                )),
34172            }
34173        }
34174    }
34175
34176    impl serde::ser::Serialize for Component {
34177        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34178        where
34179            S: serde::Serializer,
34180        {
34181            match self {
34182                Self::Unspecified => serializer.serialize_i32(0),
34183                Self::SystemComponents => serializer.serialize_i32(1),
34184                Self::Workloads => serializer.serialize_i32(2),
34185                Self::Apiserver => serializer.serialize_i32(3),
34186                Self::Scheduler => serializer.serialize_i32(4),
34187                Self::ControllerManager => serializer.serialize_i32(5),
34188                Self::KcpSshd => serializer.serialize_i32(7),
34189                Self::KcpConnection => serializer.serialize_i32(8),
34190                Self::KcpHpa => serializer.serialize_i32(9),
34191                Self::UnknownValue(u) => u.0.serialize(serializer),
34192            }
34193        }
34194    }
34195
34196    impl<'de> serde::de::Deserialize<'de> for Component {
34197        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34198        where
34199            D: serde::Deserializer<'de>,
34200        {
34201            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
34202                ".google.container.v1.LoggingComponentConfig.Component",
34203            ))
34204        }
34205    }
34206}
34207
34208/// RayClusterLoggingConfig specifies configuration of Ray logging.
34209#[derive(Clone, Default, PartialEq)]
34210#[non_exhaustive]
34211pub struct RayClusterLoggingConfig {
34212    /// Enable log collection for Ray clusters.
34213    pub enabled: bool,
34214
34215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34216}
34217
34218impl RayClusterLoggingConfig {
34219    pub fn new() -> Self {
34220        std::default::Default::default()
34221    }
34222
34223    /// Sets the value of [enabled][crate::model::RayClusterLoggingConfig::enabled].
34224    ///
34225    /// # Example
34226    /// ```ignore,no_run
34227    /// # use google_cloud_container_v1::model::RayClusterLoggingConfig;
34228    /// let x = RayClusterLoggingConfig::new().set_enabled(true);
34229    /// ```
34230    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
34231        self.enabled = v.into();
34232        self
34233    }
34234}
34235
34236impl wkt::message::Message for RayClusterLoggingConfig {
34237    fn typename() -> &'static str {
34238        "type.googleapis.com/google.container.v1.RayClusterLoggingConfig"
34239    }
34240}
34241
34242/// MonitoringConfig is cluster monitoring configuration.
34243#[derive(Clone, Default, PartialEq)]
34244#[non_exhaustive]
34245pub struct MonitoringConfig {
34246    /// Monitoring components configuration
34247    pub component_config: std::option::Option<crate::model::MonitoringComponentConfig>,
34248
34249    /// Enable Google Cloud Managed Service for Prometheus
34250    /// in the cluster.
34251    pub managed_prometheus_config: std::option::Option<crate::model::ManagedPrometheusConfig>,
34252
34253    /// Configuration of Advanced Datapath Observability features.
34254    pub advanced_datapath_observability_config:
34255        std::option::Option<crate::model::AdvancedDatapathObservabilityConfig>,
34256
34257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34258}
34259
34260impl MonitoringConfig {
34261    pub fn new() -> Self {
34262        std::default::Default::default()
34263    }
34264
34265    /// Sets the value of [component_config][crate::model::MonitoringConfig::component_config].
34266    ///
34267    /// # Example
34268    /// ```ignore,no_run
34269    /// # use google_cloud_container_v1::model::MonitoringConfig;
34270    /// use google_cloud_container_v1::model::MonitoringComponentConfig;
34271    /// let x = MonitoringConfig::new().set_component_config(MonitoringComponentConfig::default()/* use setters */);
34272    /// ```
34273    pub fn set_component_config<T>(mut self, v: T) -> Self
34274    where
34275        T: std::convert::Into<crate::model::MonitoringComponentConfig>,
34276    {
34277        self.component_config = std::option::Option::Some(v.into());
34278        self
34279    }
34280
34281    /// Sets or clears the value of [component_config][crate::model::MonitoringConfig::component_config].
34282    ///
34283    /// # Example
34284    /// ```ignore,no_run
34285    /// # use google_cloud_container_v1::model::MonitoringConfig;
34286    /// use google_cloud_container_v1::model::MonitoringComponentConfig;
34287    /// let x = MonitoringConfig::new().set_or_clear_component_config(Some(MonitoringComponentConfig::default()/* use setters */));
34288    /// let x = MonitoringConfig::new().set_or_clear_component_config(None::<MonitoringComponentConfig>);
34289    /// ```
34290    pub fn set_or_clear_component_config<T>(mut self, v: std::option::Option<T>) -> Self
34291    where
34292        T: std::convert::Into<crate::model::MonitoringComponentConfig>,
34293    {
34294        self.component_config = v.map(|x| x.into());
34295        self
34296    }
34297
34298    /// Sets the value of [managed_prometheus_config][crate::model::MonitoringConfig::managed_prometheus_config].
34299    ///
34300    /// # Example
34301    /// ```ignore,no_run
34302    /// # use google_cloud_container_v1::model::MonitoringConfig;
34303    /// use google_cloud_container_v1::model::ManagedPrometheusConfig;
34304    /// let x = MonitoringConfig::new().set_managed_prometheus_config(ManagedPrometheusConfig::default()/* use setters */);
34305    /// ```
34306    pub fn set_managed_prometheus_config<T>(mut self, v: T) -> Self
34307    where
34308        T: std::convert::Into<crate::model::ManagedPrometheusConfig>,
34309    {
34310        self.managed_prometheus_config = std::option::Option::Some(v.into());
34311        self
34312    }
34313
34314    /// Sets or clears the value of [managed_prometheus_config][crate::model::MonitoringConfig::managed_prometheus_config].
34315    ///
34316    /// # Example
34317    /// ```ignore,no_run
34318    /// # use google_cloud_container_v1::model::MonitoringConfig;
34319    /// use google_cloud_container_v1::model::ManagedPrometheusConfig;
34320    /// let x = MonitoringConfig::new().set_or_clear_managed_prometheus_config(Some(ManagedPrometheusConfig::default()/* use setters */));
34321    /// let x = MonitoringConfig::new().set_or_clear_managed_prometheus_config(None::<ManagedPrometheusConfig>);
34322    /// ```
34323    pub fn set_or_clear_managed_prometheus_config<T>(mut self, v: std::option::Option<T>) -> Self
34324    where
34325        T: std::convert::Into<crate::model::ManagedPrometheusConfig>,
34326    {
34327        self.managed_prometheus_config = v.map(|x| x.into());
34328        self
34329    }
34330
34331    /// Sets the value of [advanced_datapath_observability_config][crate::model::MonitoringConfig::advanced_datapath_observability_config].
34332    ///
34333    /// # Example
34334    /// ```ignore,no_run
34335    /// # use google_cloud_container_v1::model::MonitoringConfig;
34336    /// use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34337    /// let x = MonitoringConfig::new().set_advanced_datapath_observability_config(AdvancedDatapathObservabilityConfig::default()/* use setters */);
34338    /// ```
34339    pub fn set_advanced_datapath_observability_config<T>(mut self, v: T) -> Self
34340    where
34341        T: std::convert::Into<crate::model::AdvancedDatapathObservabilityConfig>,
34342    {
34343        self.advanced_datapath_observability_config = std::option::Option::Some(v.into());
34344        self
34345    }
34346
34347    /// Sets or clears the value of [advanced_datapath_observability_config][crate::model::MonitoringConfig::advanced_datapath_observability_config].
34348    ///
34349    /// # Example
34350    /// ```ignore,no_run
34351    /// # use google_cloud_container_v1::model::MonitoringConfig;
34352    /// use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34353    /// let x = MonitoringConfig::new().set_or_clear_advanced_datapath_observability_config(Some(AdvancedDatapathObservabilityConfig::default()/* use setters */));
34354    /// let x = MonitoringConfig::new().set_or_clear_advanced_datapath_observability_config(None::<AdvancedDatapathObservabilityConfig>);
34355    /// ```
34356    pub fn set_or_clear_advanced_datapath_observability_config<T>(
34357        mut self,
34358        v: std::option::Option<T>,
34359    ) -> Self
34360    where
34361        T: std::convert::Into<crate::model::AdvancedDatapathObservabilityConfig>,
34362    {
34363        self.advanced_datapath_observability_config = v.map(|x| x.into());
34364        self
34365    }
34366}
34367
34368impl wkt::message::Message for MonitoringConfig {
34369    fn typename() -> &'static str {
34370        "type.googleapis.com/google.container.v1.MonitoringConfig"
34371    }
34372}
34373
34374/// AdvancedDatapathObservabilityConfig specifies configuration of observability
34375/// features of advanced datapath.
34376#[derive(Clone, Default, PartialEq)]
34377#[non_exhaustive]
34378pub struct AdvancedDatapathObservabilityConfig {
34379    /// Expose flow metrics on nodes
34380    pub enable_metrics: bool,
34381
34382    /// Method used to make Relay available
34383    pub relay_mode: crate::model::advanced_datapath_observability_config::RelayMode,
34384
34385    /// Enable Relay component
34386    pub enable_relay: std::option::Option<bool>,
34387
34388    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34389}
34390
34391impl AdvancedDatapathObservabilityConfig {
34392    pub fn new() -> Self {
34393        std::default::Default::default()
34394    }
34395
34396    /// Sets the value of [enable_metrics][crate::model::AdvancedDatapathObservabilityConfig::enable_metrics].
34397    ///
34398    /// # Example
34399    /// ```ignore,no_run
34400    /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34401    /// let x = AdvancedDatapathObservabilityConfig::new().set_enable_metrics(true);
34402    /// ```
34403    pub fn set_enable_metrics<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
34404        self.enable_metrics = v.into();
34405        self
34406    }
34407
34408    /// Sets the value of [relay_mode][crate::model::AdvancedDatapathObservabilityConfig::relay_mode].
34409    ///
34410    /// # Example
34411    /// ```ignore,no_run
34412    /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34413    /// use google_cloud_container_v1::model::advanced_datapath_observability_config::RelayMode;
34414    /// let x0 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::Disabled);
34415    /// let x1 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::InternalVpcLb);
34416    /// let x2 = AdvancedDatapathObservabilityConfig::new().set_relay_mode(RelayMode::ExternalLb);
34417    /// ```
34418    pub fn set_relay_mode<
34419        T: std::convert::Into<crate::model::advanced_datapath_observability_config::RelayMode>,
34420    >(
34421        mut self,
34422        v: T,
34423    ) -> Self {
34424        self.relay_mode = v.into();
34425        self
34426    }
34427
34428    /// Sets the value of [enable_relay][crate::model::AdvancedDatapathObservabilityConfig::enable_relay].
34429    ///
34430    /// # Example
34431    /// ```ignore,no_run
34432    /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34433    /// let x = AdvancedDatapathObservabilityConfig::new().set_enable_relay(true);
34434    /// ```
34435    pub fn set_enable_relay<T>(mut self, v: T) -> Self
34436    where
34437        T: std::convert::Into<bool>,
34438    {
34439        self.enable_relay = std::option::Option::Some(v.into());
34440        self
34441    }
34442
34443    /// Sets or clears the value of [enable_relay][crate::model::AdvancedDatapathObservabilityConfig::enable_relay].
34444    ///
34445    /// # Example
34446    /// ```ignore,no_run
34447    /// # use google_cloud_container_v1::model::AdvancedDatapathObservabilityConfig;
34448    /// let x = AdvancedDatapathObservabilityConfig::new().set_or_clear_enable_relay(Some(false));
34449    /// let x = AdvancedDatapathObservabilityConfig::new().set_or_clear_enable_relay(None::<bool>);
34450    /// ```
34451    pub fn set_or_clear_enable_relay<T>(mut self, v: std::option::Option<T>) -> Self
34452    where
34453        T: std::convert::Into<bool>,
34454    {
34455        self.enable_relay = v.map(|x| x.into());
34456        self
34457    }
34458}
34459
34460impl wkt::message::Message for AdvancedDatapathObservabilityConfig {
34461    fn typename() -> &'static str {
34462        "type.googleapis.com/google.container.v1.AdvancedDatapathObservabilityConfig"
34463    }
34464}
34465
34466/// Defines additional types related to [AdvancedDatapathObservabilityConfig].
34467pub mod advanced_datapath_observability_config {
34468    #[allow(unused_imports)]
34469    use super::*;
34470
34471    /// Supported Relay modes
34472    ///
34473    /// # Working with unknown values
34474    ///
34475    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34476    /// additional enum variants at any time. Adding new variants is not considered
34477    /// a breaking change. Applications should write their code in anticipation of:
34478    ///
34479    /// - New values appearing in future releases of the client library, **and**
34480    /// - New values received dynamically, without application changes.
34481    ///
34482    /// Please consult the [Working with enums] section in the user guide for some
34483    /// guidelines.
34484    ///
34485    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34486    #[derive(Clone, Debug, PartialEq)]
34487    #[non_exhaustive]
34488    pub enum RelayMode {
34489        /// Default value. This shouldn't be used.
34490        Unspecified,
34491        /// disabled
34492        Disabled,
34493        /// exposed via internal load balancer
34494        InternalVpcLb,
34495        /// exposed via external load balancer
34496        ExternalLb,
34497        /// If set, the enum was initialized with an unknown value.
34498        ///
34499        /// Applications can examine the value using [RelayMode::value] or
34500        /// [RelayMode::name].
34501        UnknownValue(relay_mode::UnknownValue),
34502    }
34503
34504    #[doc(hidden)]
34505    pub mod relay_mode {
34506        #[allow(unused_imports)]
34507        use super::*;
34508        #[derive(Clone, Debug, PartialEq)]
34509        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34510    }
34511
34512    impl RelayMode {
34513        /// Gets the enum value.
34514        ///
34515        /// Returns `None` if the enum contains an unknown value deserialized from
34516        /// the string representation of enums.
34517        pub fn value(&self) -> std::option::Option<i32> {
34518            match self {
34519                Self::Unspecified => std::option::Option::Some(0),
34520                Self::Disabled => std::option::Option::Some(1),
34521                Self::InternalVpcLb => std::option::Option::Some(3),
34522                Self::ExternalLb => std::option::Option::Some(4),
34523                Self::UnknownValue(u) => u.0.value(),
34524            }
34525        }
34526
34527        /// Gets the enum value as a string.
34528        ///
34529        /// Returns `None` if the enum contains an unknown value deserialized from
34530        /// the integer representation of enums.
34531        pub fn name(&self) -> std::option::Option<&str> {
34532            match self {
34533                Self::Unspecified => std::option::Option::Some("RELAY_MODE_UNSPECIFIED"),
34534                Self::Disabled => std::option::Option::Some("DISABLED"),
34535                Self::InternalVpcLb => std::option::Option::Some("INTERNAL_VPC_LB"),
34536                Self::ExternalLb => std::option::Option::Some("EXTERNAL_LB"),
34537                Self::UnknownValue(u) => u.0.name(),
34538            }
34539        }
34540    }
34541
34542    impl std::default::Default for RelayMode {
34543        fn default() -> Self {
34544            use std::convert::From;
34545            Self::from(0)
34546        }
34547    }
34548
34549    impl std::fmt::Display for RelayMode {
34550        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34551            wkt::internal::display_enum(f, self.name(), self.value())
34552        }
34553    }
34554
34555    impl std::convert::From<i32> for RelayMode {
34556        fn from(value: i32) -> Self {
34557            match value {
34558                0 => Self::Unspecified,
34559                1 => Self::Disabled,
34560                3 => Self::InternalVpcLb,
34561                4 => Self::ExternalLb,
34562                _ => Self::UnknownValue(relay_mode::UnknownValue(
34563                    wkt::internal::UnknownEnumValue::Integer(value),
34564                )),
34565            }
34566        }
34567    }
34568
34569    impl std::convert::From<&str> for RelayMode {
34570        fn from(value: &str) -> Self {
34571            use std::string::ToString;
34572            match value {
34573                "RELAY_MODE_UNSPECIFIED" => Self::Unspecified,
34574                "DISABLED" => Self::Disabled,
34575                "INTERNAL_VPC_LB" => Self::InternalVpcLb,
34576                "EXTERNAL_LB" => Self::ExternalLb,
34577                _ => Self::UnknownValue(relay_mode::UnknownValue(
34578                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34579                )),
34580            }
34581        }
34582    }
34583
34584    impl serde::ser::Serialize for RelayMode {
34585        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34586        where
34587            S: serde::Serializer,
34588        {
34589            match self {
34590                Self::Unspecified => serializer.serialize_i32(0),
34591                Self::Disabled => serializer.serialize_i32(1),
34592                Self::InternalVpcLb => serializer.serialize_i32(3),
34593                Self::ExternalLb => serializer.serialize_i32(4),
34594                Self::UnknownValue(u) => u.0.serialize(serializer),
34595            }
34596        }
34597    }
34598
34599    impl<'de> serde::de::Deserialize<'de> for RelayMode {
34600        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34601        where
34602            D: serde::Deserializer<'de>,
34603        {
34604            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelayMode>::new(
34605                ".google.container.v1.AdvancedDatapathObservabilityConfig.RelayMode",
34606            ))
34607        }
34608    }
34609}
34610
34611/// RayClusterMonitoringConfig specifies monitoring configuration for Ray
34612/// clusters.
34613#[derive(Clone, Default, PartialEq)]
34614#[non_exhaustive]
34615pub struct RayClusterMonitoringConfig {
34616    /// Enable metrics collection for Ray clusters.
34617    pub enabled: bool,
34618
34619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34620}
34621
34622impl RayClusterMonitoringConfig {
34623    pub fn new() -> Self {
34624        std::default::Default::default()
34625    }
34626
34627    /// Sets the value of [enabled][crate::model::RayClusterMonitoringConfig::enabled].
34628    ///
34629    /// # Example
34630    /// ```ignore,no_run
34631    /// # use google_cloud_container_v1::model::RayClusterMonitoringConfig;
34632    /// let x = RayClusterMonitoringConfig::new().set_enabled(true);
34633    /// ```
34634    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
34635        self.enabled = v.into();
34636        self
34637    }
34638}
34639
34640impl wkt::message::Message for RayClusterMonitoringConfig {
34641    fn typename() -> &'static str {
34642        "type.googleapis.com/google.container.v1.RayClusterMonitoringConfig"
34643    }
34644}
34645
34646/// NodePoolLoggingConfig specifies logging configuration for nodepools.
34647#[derive(Clone, Default, PartialEq)]
34648#[non_exhaustive]
34649pub struct NodePoolLoggingConfig {
34650    /// Logging variant configuration.
34651    pub variant_config: std::option::Option<crate::model::LoggingVariantConfig>,
34652
34653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34654}
34655
34656impl NodePoolLoggingConfig {
34657    pub fn new() -> Self {
34658        std::default::Default::default()
34659    }
34660
34661    /// Sets the value of [variant_config][crate::model::NodePoolLoggingConfig::variant_config].
34662    ///
34663    /// # Example
34664    /// ```ignore,no_run
34665    /// # use google_cloud_container_v1::model::NodePoolLoggingConfig;
34666    /// use google_cloud_container_v1::model::LoggingVariantConfig;
34667    /// let x = NodePoolLoggingConfig::new().set_variant_config(LoggingVariantConfig::default()/* use setters */);
34668    /// ```
34669    pub fn set_variant_config<T>(mut self, v: T) -> Self
34670    where
34671        T: std::convert::Into<crate::model::LoggingVariantConfig>,
34672    {
34673        self.variant_config = std::option::Option::Some(v.into());
34674        self
34675    }
34676
34677    /// Sets or clears the value of [variant_config][crate::model::NodePoolLoggingConfig::variant_config].
34678    ///
34679    /// # Example
34680    /// ```ignore,no_run
34681    /// # use google_cloud_container_v1::model::NodePoolLoggingConfig;
34682    /// use google_cloud_container_v1::model::LoggingVariantConfig;
34683    /// let x = NodePoolLoggingConfig::new().set_or_clear_variant_config(Some(LoggingVariantConfig::default()/* use setters */));
34684    /// let x = NodePoolLoggingConfig::new().set_or_clear_variant_config(None::<LoggingVariantConfig>);
34685    /// ```
34686    pub fn set_or_clear_variant_config<T>(mut self, v: std::option::Option<T>) -> Self
34687    where
34688        T: std::convert::Into<crate::model::LoggingVariantConfig>,
34689    {
34690        self.variant_config = v.map(|x| x.into());
34691        self
34692    }
34693}
34694
34695impl wkt::message::Message for NodePoolLoggingConfig {
34696    fn typename() -> &'static str {
34697        "type.googleapis.com/google.container.v1.NodePoolLoggingConfig"
34698    }
34699}
34700
34701/// LoggingVariantConfig specifies the behaviour of the logging component.
34702#[derive(Clone, Default, PartialEq)]
34703#[non_exhaustive]
34704pub struct LoggingVariantConfig {
34705    /// Logging variant deployed on nodes.
34706    pub variant: crate::model::logging_variant_config::Variant,
34707
34708    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34709}
34710
34711impl LoggingVariantConfig {
34712    pub fn new() -> Self {
34713        std::default::Default::default()
34714    }
34715
34716    /// Sets the value of [variant][crate::model::LoggingVariantConfig::variant].
34717    ///
34718    /// # Example
34719    /// ```ignore,no_run
34720    /// # use google_cloud_container_v1::model::LoggingVariantConfig;
34721    /// use google_cloud_container_v1::model::logging_variant_config::Variant;
34722    /// let x0 = LoggingVariantConfig::new().set_variant(Variant::Default);
34723    /// let x1 = LoggingVariantConfig::new().set_variant(Variant::MaxThroughput);
34724    /// ```
34725    pub fn set_variant<T: std::convert::Into<crate::model::logging_variant_config::Variant>>(
34726        mut self,
34727        v: T,
34728    ) -> Self {
34729        self.variant = v.into();
34730        self
34731    }
34732}
34733
34734impl wkt::message::Message for LoggingVariantConfig {
34735    fn typename() -> &'static str {
34736        "type.googleapis.com/google.container.v1.LoggingVariantConfig"
34737    }
34738}
34739
34740/// Defines additional types related to [LoggingVariantConfig].
34741pub mod logging_variant_config {
34742    #[allow(unused_imports)]
34743    use super::*;
34744
34745    /// Logging component variants.
34746    ///
34747    /// # Working with unknown values
34748    ///
34749    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34750    /// additional enum variants at any time. Adding new variants is not considered
34751    /// a breaking change. Applications should write their code in anticipation of:
34752    ///
34753    /// - New values appearing in future releases of the client library, **and**
34754    /// - New values received dynamically, without application changes.
34755    ///
34756    /// Please consult the [Working with enums] section in the user guide for some
34757    /// guidelines.
34758    ///
34759    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34760    #[derive(Clone, Debug, PartialEq)]
34761    #[non_exhaustive]
34762    pub enum Variant {
34763        /// Default value. This shouldn't be used.
34764        Unspecified,
34765        /// default logging variant.
34766        Default,
34767        /// maximum logging throughput variant.
34768        MaxThroughput,
34769        /// If set, the enum was initialized with an unknown value.
34770        ///
34771        /// Applications can examine the value using [Variant::value] or
34772        /// [Variant::name].
34773        UnknownValue(variant::UnknownValue),
34774    }
34775
34776    #[doc(hidden)]
34777    pub mod variant {
34778        #[allow(unused_imports)]
34779        use super::*;
34780        #[derive(Clone, Debug, PartialEq)]
34781        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34782    }
34783
34784    impl Variant {
34785        /// Gets the enum value.
34786        ///
34787        /// Returns `None` if the enum contains an unknown value deserialized from
34788        /// the string representation of enums.
34789        pub fn value(&self) -> std::option::Option<i32> {
34790            match self {
34791                Self::Unspecified => std::option::Option::Some(0),
34792                Self::Default => std::option::Option::Some(1),
34793                Self::MaxThroughput => std::option::Option::Some(2),
34794                Self::UnknownValue(u) => u.0.value(),
34795            }
34796        }
34797
34798        /// Gets the enum value as a string.
34799        ///
34800        /// Returns `None` if the enum contains an unknown value deserialized from
34801        /// the integer representation of enums.
34802        pub fn name(&self) -> std::option::Option<&str> {
34803            match self {
34804                Self::Unspecified => std::option::Option::Some("VARIANT_UNSPECIFIED"),
34805                Self::Default => std::option::Option::Some("DEFAULT"),
34806                Self::MaxThroughput => std::option::Option::Some("MAX_THROUGHPUT"),
34807                Self::UnknownValue(u) => u.0.name(),
34808            }
34809        }
34810    }
34811
34812    impl std::default::Default for Variant {
34813        fn default() -> Self {
34814            use std::convert::From;
34815            Self::from(0)
34816        }
34817    }
34818
34819    impl std::fmt::Display for Variant {
34820        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34821            wkt::internal::display_enum(f, self.name(), self.value())
34822        }
34823    }
34824
34825    impl std::convert::From<i32> for Variant {
34826        fn from(value: i32) -> Self {
34827            match value {
34828                0 => Self::Unspecified,
34829                1 => Self::Default,
34830                2 => Self::MaxThroughput,
34831                _ => Self::UnknownValue(variant::UnknownValue(
34832                    wkt::internal::UnknownEnumValue::Integer(value),
34833                )),
34834            }
34835        }
34836    }
34837
34838    impl std::convert::From<&str> for Variant {
34839        fn from(value: &str) -> Self {
34840            use std::string::ToString;
34841            match value {
34842                "VARIANT_UNSPECIFIED" => Self::Unspecified,
34843                "DEFAULT" => Self::Default,
34844                "MAX_THROUGHPUT" => Self::MaxThroughput,
34845                _ => Self::UnknownValue(variant::UnknownValue(
34846                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34847                )),
34848            }
34849        }
34850    }
34851
34852    impl serde::ser::Serialize for Variant {
34853        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34854        where
34855            S: serde::Serializer,
34856        {
34857            match self {
34858                Self::Unspecified => serializer.serialize_i32(0),
34859                Self::Default => serializer.serialize_i32(1),
34860                Self::MaxThroughput => serializer.serialize_i32(2),
34861                Self::UnknownValue(u) => u.0.serialize(serializer),
34862            }
34863        }
34864    }
34865
34866    impl<'de> serde::de::Deserialize<'de> for Variant {
34867        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34868        where
34869            D: serde::Deserializer<'de>,
34870        {
34871            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Variant>::new(
34872                ".google.container.v1.LoggingVariantConfig.Variant",
34873            ))
34874        }
34875    }
34876}
34877
34878/// MonitoringComponentConfig is cluster monitoring component configuration.
34879#[derive(Clone, Default, PartialEq)]
34880#[non_exhaustive]
34881pub struct MonitoringComponentConfig {
34882    /// Select components to collect metrics. An empty set would disable all
34883    /// monitoring.
34884    pub enable_components: std::vec::Vec<crate::model::monitoring_component_config::Component>,
34885
34886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34887}
34888
34889impl MonitoringComponentConfig {
34890    pub fn new() -> Self {
34891        std::default::Default::default()
34892    }
34893
34894    /// Sets the value of [enable_components][crate::model::MonitoringComponentConfig::enable_components].
34895    ///
34896    /// # Example
34897    /// ```ignore,no_run
34898    /// # use google_cloud_container_v1::model::MonitoringComponentConfig;
34899    /// use google_cloud_container_v1::model::monitoring_component_config::Component;
34900    /// let x = MonitoringComponentConfig::new().set_enable_components([
34901    ///     Component::SystemComponents,
34902    ///     Component::Apiserver,
34903    ///     Component::Scheduler,
34904    /// ]);
34905    /// ```
34906    pub fn set_enable_components<T, V>(mut self, v: T) -> Self
34907    where
34908        T: std::iter::IntoIterator<Item = V>,
34909        V: std::convert::Into<crate::model::monitoring_component_config::Component>,
34910    {
34911        use std::iter::Iterator;
34912        self.enable_components = v.into_iter().map(|i| i.into()).collect();
34913        self
34914    }
34915}
34916
34917impl wkt::message::Message for MonitoringComponentConfig {
34918    fn typename() -> &'static str {
34919        "type.googleapis.com/google.container.v1.MonitoringComponentConfig"
34920    }
34921}
34922
34923/// Defines additional types related to [MonitoringComponentConfig].
34924pub mod monitoring_component_config {
34925    #[allow(unused_imports)]
34926    use super::*;
34927
34928    /// GKE components exposing metrics
34929    ///
34930    /// # Working with unknown values
34931    ///
34932    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34933    /// additional enum variants at any time. Adding new variants is not considered
34934    /// a breaking change. Applications should write their code in anticipation of:
34935    ///
34936    /// - New values appearing in future releases of the client library, **and**
34937    /// - New values received dynamically, without application changes.
34938    ///
34939    /// Please consult the [Working with enums] section in the user guide for some
34940    /// guidelines.
34941    ///
34942    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34943    #[derive(Clone, Debug, PartialEq)]
34944    #[non_exhaustive]
34945    pub enum Component {
34946        /// Default value. This shouldn't be used.
34947        Unspecified,
34948        /// system components
34949        SystemComponents,
34950        /// kube-apiserver
34951        Apiserver,
34952        /// kube-scheduler
34953        Scheduler,
34954        /// kube-controller-manager
34955        ControllerManager,
34956        /// Storage
34957        Storage,
34958        /// Horizontal Pod Autoscaling
34959        Hpa,
34960        /// Pod
34961        Pod,
34962        /// DaemonSet
34963        Daemonset,
34964        /// Deployment
34965        Deployment,
34966        /// Statefulset
34967        Statefulset,
34968        /// CADVISOR
34969        Cadvisor,
34970        /// KUBELET
34971        Kubelet,
34972        /// NVIDIA Data Center GPU Manager (DCGM)
34973        Dcgm,
34974        /// JobSet
34975        Jobset,
34976        /// If set, the enum was initialized with an unknown value.
34977        ///
34978        /// Applications can examine the value using [Component::value] or
34979        /// [Component::name].
34980        UnknownValue(component::UnknownValue),
34981    }
34982
34983    #[doc(hidden)]
34984    pub mod component {
34985        #[allow(unused_imports)]
34986        use super::*;
34987        #[derive(Clone, Debug, PartialEq)]
34988        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34989    }
34990
34991    impl Component {
34992        /// Gets the enum value.
34993        ///
34994        /// Returns `None` if the enum contains an unknown value deserialized from
34995        /// the string representation of enums.
34996        pub fn value(&self) -> std::option::Option<i32> {
34997            match self {
34998                Self::Unspecified => std::option::Option::Some(0),
34999                Self::SystemComponents => std::option::Option::Some(1),
35000                Self::Apiserver => std::option::Option::Some(3),
35001                Self::Scheduler => std::option::Option::Some(4),
35002                Self::ControllerManager => std::option::Option::Some(5),
35003                Self::Storage => std::option::Option::Some(7),
35004                Self::Hpa => std::option::Option::Some(8),
35005                Self::Pod => std::option::Option::Some(9),
35006                Self::Daemonset => std::option::Option::Some(10),
35007                Self::Deployment => std::option::Option::Some(11),
35008                Self::Statefulset => std::option::Option::Some(12),
35009                Self::Cadvisor => std::option::Option::Some(13),
35010                Self::Kubelet => std::option::Option::Some(14),
35011                Self::Dcgm => std::option::Option::Some(15),
35012                Self::Jobset => std::option::Option::Some(16),
35013                Self::UnknownValue(u) => u.0.value(),
35014            }
35015        }
35016
35017        /// Gets the enum value as a string.
35018        ///
35019        /// Returns `None` if the enum contains an unknown value deserialized from
35020        /// the integer representation of enums.
35021        pub fn name(&self) -> std::option::Option<&str> {
35022            match self {
35023                Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
35024                Self::SystemComponents => std::option::Option::Some("SYSTEM_COMPONENTS"),
35025                Self::Apiserver => std::option::Option::Some("APISERVER"),
35026                Self::Scheduler => std::option::Option::Some("SCHEDULER"),
35027                Self::ControllerManager => std::option::Option::Some("CONTROLLER_MANAGER"),
35028                Self::Storage => std::option::Option::Some("STORAGE"),
35029                Self::Hpa => std::option::Option::Some("HPA"),
35030                Self::Pod => std::option::Option::Some("POD"),
35031                Self::Daemonset => std::option::Option::Some("DAEMONSET"),
35032                Self::Deployment => std::option::Option::Some("DEPLOYMENT"),
35033                Self::Statefulset => std::option::Option::Some("STATEFULSET"),
35034                Self::Cadvisor => std::option::Option::Some("CADVISOR"),
35035                Self::Kubelet => std::option::Option::Some("KUBELET"),
35036                Self::Dcgm => std::option::Option::Some("DCGM"),
35037                Self::Jobset => std::option::Option::Some("JOBSET"),
35038                Self::UnknownValue(u) => u.0.name(),
35039            }
35040        }
35041    }
35042
35043    impl std::default::Default for Component {
35044        fn default() -> Self {
35045            use std::convert::From;
35046            Self::from(0)
35047        }
35048    }
35049
35050    impl std::fmt::Display for Component {
35051        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35052            wkt::internal::display_enum(f, self.name(), self.value())
35053        }
35054    }
35055
35056    impl std::convert::From<i32> for Component {
35057        fn from(value: i32) -> Self {
35058            match value {
35059                0 => Self::Unspecified,
35060                1 => Self::SystemComponents,
35061                3 => Self::Apiserver,
35062                4 => Self::Scheduler,
35063                5 => Self::ControllerManager,
35064                7 => Self::Storage,
35065                8 => Self::Hpa,
35066                9 => Self::Pod,
35067                10 => Self::Daemonset,
35068                11 => Self::Deployment,
35069                12 => Self::Statefulset,
35070                13 => Self::Cadvisor,
35071                14 => Self::Kubelet,
35072                15 => Self::Dcgm,
35073                16 => Self::Jobset,
35074                _ => Self::UnknownValue(component::UnknownValue(
35075                    wkt::internal::UnknownEnumValue::Integer(value),
35076                )),
35077            }
35078        }
35079    }
35080
35081    impl std::convert::From<&str> for Component {
35082        fn from(value: &str) -> Self {
35083            use std::string::ToString;
35084            match value {
35085                "COMPONENT_UNSPECIFIED" => Self::Unspecified,
35086                "SYSTEM_COMPONENTS" => Self::SystemComponents,
35087                "APISERVER" => Self::Apiserver,
35088                "SCHEDULER" => Self::Scheduler,
35089                "CONTROLLER_MANAGER" => Self::ControllerManager,
35090                "STORAGE" => Self::Storage,
35091                "HPA" => Self::Hpa,
35092                "POD" => Self::Pod,
35093                "DAEMONSET" => Self::Daemonset,
35094                "DEPLOYMENT" => Self::Deployment,
35095                "STATEFULSET" => Self::Statefulset,
35096                "CADVISOR" => Self::Cadvisor,
35097                "KUBELET" => Self::Kubelet,
35098                "DCGM" => Self::Dcgm,
35099                "JOBSET" => Self::Jobset,
35100                _ => Self::UnknownValue(component::UnknownValue(
35101                    wkt::internal::UnknownEnumValue::String(value.to_string()),
35102                )),
35103            }
35104        }
35105    }
35106
35107    impl serde::ser::Serialize for Component {
35108        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35109        where
35110            S: serde::Serializer,
35111        {
35112            match self {
35113                Self::Unspecified => serializer.serialize_i32(0),
35114                Self::SystemComponents => serializer.serialize_i32(1),
35115                Self::Apiserver => serializer.serialize_i32(3),
35116                Self::Scheduler => serializer.serialize_i32(4),
35117                Self::ControllerManager => serializer.serialize_i32(5),
35118                Self::Storage => serializer.serialize_i32(7),
35119                Self::Hpa => serializer.serialize_i32(8),
35120                Self::Pod => serializer.serialize_i32(9),
35121                Self::Daemonset => serializer.serialize_i32(10),
35122                Self::Deployment => serializer.serialize_i32(11),
35123                Self::Statefulset => serializer.serialize_i32(12),
35124                Self::Cadvisor => serializer.serialize_i32(13),
35125                Self::Kubelet => serializer.serialize_i32(14),
35126                Self::Dcgm => serializer.serialize_i32(15),
35127                Self::Jobset => serializer.serialize_i32(16),
35128                Self::UnknownValue(u) => u.0.serialize(serializer),
35129            }
35130        }
35131    }
35132
35133    impl<'de> serde::de::Deserialize<'de> for Component {
35134        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35135        where
35136            D: serde::Deserializer<'de>,
35137        {
35138            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
35139                ".google.container.v1.MonitoringComponentConfig.Component",
35140            ))
35141        }
35142    }
35143}
35144
35145/// ManagedPrometheusConfig defines the configuration for
35146/// Google Cloud Managed Service for Prometheus.
35147#[derive(Clone, Default, PartialEq)]
35148#[non_exhaustive]
35149pub struct ManagedPrometheusConfig {
35150    /// Enable Managed Collection.
35151    pub enabled: bool,
35152
35153    /// GKE Workload Auto-Monitoring Configuration.
35154    pub auto_monitoring_config: std::option::Option<crate::model::AutoMonitoringConfig>,
35155
35156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35157}
35158
35159impl ManagedPrometheusConfig {
35160    pub fn new() -> Self {
35161        std::default::Default::default()
35162    }
35163
35164    /// Sets the value of [enabled][crate::model::ManagedPrometheusConfig::enabled].
35165    ///
35166    /// # Example
35167    /// ```ignore,no_run
35168    /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
35169    /// let x = ManagedPrometheusConfig::new().set_enabled(true);
35170    /// ```
35171    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35172        self.enabled = v.into();
35173        self
35174    }
35175
35176    /// Sets the value of [auto_monitoring_config][crate::model::ManagedPrometheusConfig::auto_monitoring_config].
35177    ///
35178    /// # Example
35179    /// ```ignore,no_run
35180    /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
35181    /// use google_cloud_container_v1::model::AutoMonitoringConfig;
35182    /// let x = ManagedPrometheusConfig::new().set_auto_monitoring_config(AutoMonitoringConfig::default()/* use setters */);
35183    /// ```
35184    pub fn set_auto_monitoring_config<T>(mut self, v: T) -> Self
35185    where
35186        T: std::convert::Into<crate::model::AutoMonitoringConfig>,
35187    {
35188        self.auto_monitoring_config = std::option::Option::Some(v.into());
35189        self
35190    }
35191
35192    /// Sets or clears the value of [auto_monitoring_config][crate::model::ManagedPrometheusConfig::auto_monitoring_config].
35193    ///
35194    /// # Example
35195    /// ```ignore,no_run
35196    /// # use google_cloud_container_v1::model::ManagedPrometheusConfig;
35197    /// use google_cloud_container_v1::model::AutoMonitoringConfig;
35198    /// let x = ManagedPrometheusConfig::new().set_or_clear_auto_monitoring_config(Some(AutoMonitoringConfig::default()/* use setters */));
35199    /// let x = ManagedPrometheusConfig::new().set_or_clear_auto_monitoring_config(None::<AutoMonitoringConfig>);
35200    /// ```
35201    pub fn set_or_clear_auto_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
35202    where
35203        T: std::convert::Into<crate::model::AutoMonitoringConfig>,
35204    {
35205        self.auto_monitoring_config = v.map(|x| x.into());
35206        self
35207    }
35208}
35209
35210impl wkt::message::Message for ManagedPrometheusConfig {
35211    fn typename() -> &'static str {
35212        "type.googleapis.com/google.container.v1.ManagedPrometheusConfig"
35213    }
35214}
35215
35216/// AutoMonitoringConfig defines the configuration for GKE Workload
35217/// Auto-Monitoring.
35218#[derive(Clone, Default, PartialEq)]
35219#[non_exhaustive]
35220pub struct AutoMonitoringConfig {
35221    /// Scope for GKE Workload Auto-Monitoring.
35222    pub scope: crate::model::auto_monitoring_config::Scope,
35223
35224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35225}
35226
35227impl AutoMonitoringConfig {
35228    pub fn new() -> Self {
35229        std::default::Default::default()
35230    }
35231
35232    /// Sets the value of [scope][crate::model::AutoMonitoringConfig::scope].
35233    ///
35234    /// # Example
35235    /// ```ignore,no_run
35236    /// # use google_cloud_container_v1::model::AutoMonitoringConfig;
35237    /// use google_cloud_container_v1::model::auto_monitoring_config::Scope;
35238    /// let x0 = AutoMonitoringConfig::new().set_scope(Scope::All);
35239    /// let x1 = AutoMonitoringConfig::new().set_scope(Scope::None);
35240    /// ```
35241    pub fn set_scope<T: std::convert::Into<crate::model::auto_monitoring_config::Scope>>(
35242        mut self,
35243        v: T,
35244    ) -> Self {
35245        self.scope = v.into();
35246        self
35247    }
35248}
35249
35250impl wkt::message::Message for AutoMonitoringConfig {
35251    fn typename() -> &'static str {
35252        "type.googleapis.com/google.container.v1.AutoMonitoringConfig"
35253    }
35254}
35255
35256/// Defines additional types related to [AutoMonitoringConfig].
35257pub mod auto_monitoring_config {
35258    #[allow(unused_imports)]
35259    use super::*;
35260
35261    /// Scope for applications monitored by Auto-Monitoring
35262    ///
35263    /// # Working with unknown values
35264    ///
35265    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35266    /// additional enum variants at any time. Adding new variants is not considered
35267    /// a breaking change. Applications should write their code in anticipation of:
35268    ///
35269    /// - New values appearing in future releases of the client library, **and**
35270    /// - New values received dynamically, without application changes.
35271    ///
35272    /// Please consult the [Working with enums] section in the user guide for some
35273    /// guidelines.
35274    ///
35275    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35276    #[derive(Clone, Debug, PartialEq)]
35277    #[non_exhaustive]
35278    pub enum Scope {
35279        /// Not set.
35280        Unspecified,
35281        /// Auto-Monitoring is enabled for all supported applications.
35282        All,
35283        /// Disable Auto-Monitoring.
35284        None,
35285        /// If set, the enum was initialized with an unknown value.
35286        ///
35287        /// Applications can examine the value using [Scope::value] or
35288        /// [Scope::name].
35289        UnknownValue(scope::UnknownValue),
35290    }
35291
35292    #[doc(hidden)]
35293    pub mod scope {
35294        #[allow(unused_imports)]
35295        use super::*;
35296        #[derive(Clone, Debug, PartialEq)]
35297        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35298    }
35299
35300    impl Scope {
35301        /// Gets the enum value.
35302        ///
35303        /// Returns `None` if the enum contains an unknown value deserialized from
35304        /// the string representation of enums.
35305        pub fn value(&self) -> std::option::Option<i32> {
35306            match self {
35307                Self::Unspecified => std::option::Option::Some(0),
35308                Self::All => std::option::Option::Some(1),
35309                Self::None => std::option::Option::Some(2),
35310                Self::UnknownValue(u) => u.0.value(),
35311            }
35312        }
35313
35314        /// Gets the enum value as a string.
35315        ///
35316        /// Returns `None` if the enum contains an unknown value deserialized from
35317        /// the integer representation of enums.
35318        pub fn name(&self) -> std::option::Option<&str> {
35319            match self {
35320                Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
35321                Self::All => std::option::Option::Some("ALL"),
35322                Self::None => std::option::Option::Some("NONE"),
35323                Self::UnknownValue(u) => u.0.name(),
35324            }
35325        }
35326    }
35327
35328    impl std::default::Default for Scope {
35329        fn default() -> Self {
35330            use std::convert::From;
35331            Self::from(0)
35332        }
35333    }
35334
35335    impl std::fmt::Display for Scope {
35336        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35337            wkt::internal::display_enum(f, self.name(), self.value())
35338        }
35339    }
35340
35341    impl std::convert::From<i32> for Scope {
35342        fn from(value: i32) -> Self {
35343            match value {
35344                0 => Self::Unspecified,
35345                1 => Self::All,
35346                2 => Self::None,
35347                _ => Self::UnknownValue(scope::UnknownValue(
35348                    wkt::internal::UnknownEnumValue::Integer(value),
35349                )),
35350            }
35351        }
35352    }
35353
35354    impl std::convert::From<&str> for Scope {
35355        fn from(value: &str) -> Self {
35356            use std::string::ToString;
35357            match value {
35358                "SCOPE_UNSPECIFIED" => Self::Unspecified,
35359                "ALL" => Self::All,
35360                "NONE" => Self::None,
35361                _ => Self::UnknownValue(scope::UnknownValue(
35362                    wkt::internal::UnknownEnumValue::String(value.to_string()),
35363                )),
35364            }
35365        }
35366    }
35367
35368    impl serde::ser::Serialize for Scope {
35369        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35370        where
35371            S: serde::Serializer,
35372        {
35373            match self {
35374                Self::Unspecified => serializer.serialize_i32(0),
35375                Self::All => serializer.serialize_i32(1),
35376                Self::None => serializer.serialize_i32(2),
35377                Self::UnknownValue(u) => u.0.serialize(serializer),
35378            }
35379        }
35380    }
35381
35382    impl<'de> serde::de::Deserialize<'de> for Scope {
35383        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35384        where
35385            D: serde::Deserializer<'de>,
35386        {
35387            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
35388                ".google.container.v1.AutoMonitoringConfig.Scope",
35389            ))
35390        }
35391    }
35392}
35393
35394/// PodAutoscaling is used for configuration of parameters
35395/// for workload autoscaling.
35396#[derive(Clone, Default, PartialEq)]
35397#[non_exhaustive]
35398pub struct PodAutoscaling {
35399    /// Selected Horizontal Pod Autoscaling profile.
35400    pub hpa_profile: std::option::Option<crate::model::pod_autoscaling::HPAProfile>,
35401
35402    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35403}
35404
35405impl PodAutoscaling {
35406    pub fn new() -> Self {
35407        std::default::Default::default()
35408    }
35409
35410    /// Sets the value of [hpa_profile][crate::model::PodAutoscaling::hpa_profile].
35411    ///
35412    /// # Example
35413    /// ```ignore,no_run
35414    /// # use google_cloud_container_v1::model::PodAutoscaling;
35415    /// use google_cloud_container_v1::model::pod_autoscaling::HPAProfile;
35416    /// let x0 = PodAutoscaling::new().set_hpa_profile(HPAProfile::None);
35417    /// let x1 = PodAutoscaling::new().set_hpa_profile(HPAProfile::Performance);
35418    /// ```
35419    pub fn set_hpa_profile<T>(mut self, v: T) -> Self
35420    where
35421        T: std::convert::Into<crate::model::pod_autoscaling::HPAProfile>,
35422    {
35423        self.hpa_profile = std::option::Option::Some(v.into());
35424        self
35425    }
35426
35427    /// Sets or clears the value of [hpa_profile][crate::model::PodAutoscaling::hpa_profile].
35428    ///
35429    /// # Example
35430    /// ```ignore,no_run
35431    /// # use google_cloud_container_v1::model::PodAutoscaling;
35432    /// use google_cloud_container_v1::model::pod_autoscaling::HPAProfile;
35433    /// let x0 = PodAutoscaling::new().set_or_clear_hpa_profile(Some(HPAProfile::None));
35434    /// let x1 = PodAutoscaling::new().set_or_clear_hpa_profile(Some(HPAProfile::Performance));
35435    /// let x_none = PodAutoscaling::new().set_or_clear_hpa_profile(None::<HPAProfile>);
35436    /// ```
35437    pub fn set_or_clear_hpa_profile<T>(mut self, v: std::option::Option<T>) -> Self
35438    where
35439        T: std::convert::Into<crate::model::pod_autoscaling::HPAProfile>,
35440    {
35441        self.hpa_profile = v.map(|x| x.into());
35442        self
35443    }
35444}
35445
35446impl wkt::message::Message for PodAutoscaling {
35447    fn typename() -> &'static str {
35448        "type.googleapis.com/google.container.v1.PodAutoscaling"
35449    }
35450}
35451
35452/// Defines additional types related to [PodAutoscaling].
35453pub mod pod_autoscaling {
35454    #[allow(unused_imports)]
35455    use super::*;
35456
35457    /// Possible types of Horizontal Pod Autoscaling profile.
35458    ///
35459    /// # Working with unknown values
35460    ///
35461    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35462    /// additional enum variants at any time. Adding new variants is not considered
35463    /// a breaking change. Applications should write their code in anticipation of:
35464    ///
35465    /// - New values appearing in future releases of the client library, **and**
35466    /// - New values received dynamically, without application changes.
35467    ///
35468    /// Please consult the [Working with enums] section in the user guide for some
35469    /// guidelines.
35470    ///
35471    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35472    #[derive(Clone, Debug, PartialEq)]
35473    #[non_exhaustive]
35474    pub enum HPAProfile {
35475        /// HPA_PROFILE_UNSPECIFIED is used when no custom HPA profile is set.
35476        Unspecified,
35477        /// Customers explicitly opt-out of HPA profiles.
35478        None,
35479        /// PERFORMANCE is used when customers opt-in to the performance HPA profile.
35480        /// In this profile we support a higher number of HPAs per cluster and faster
35481        /// metrics collection for workload autoscaling.
35482        Performance,
35483        /// If set, the enum was initialized with an unknown value.
35484        ///
35485        /// Applications can examine the value using [HPAProfile::value] or
35486        /// [HPAProfile::name].
35487        UnknownValue(hpa_profile::UnknownValue),
35488    }
35489
35490    #[doc(hidden)]
35491    pub mod hpa_profile {
35492        #[allow(unused_imports)]
35493        use super::*;
35494        #[derive(Clone, Debug, PartialEq)]
35495        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35496    }
35497
35498    impl HPAProfile {
35499        /// Gets the enum value.
35500        ///
35501        /// Returns `None` if the enum contains an unknown value deserialized from
35502        /// the string representation of enums.
35503        pub fn value(&self) -> std::option::Option<i32> {
35504            match self {
35505                Self::Unspecified => std::option::Option::Some(0),
35506                Self::None => std::option::Option::Some(1),
35507                Self::Performance => std::option::Option::Some(2),
35508                Self::UnknownValue(u) => u.0.value(),
35509            }
35510        }
35511
35512        /// Gets the enum value as a string.
35513        ///
35514        /// Returns `None` if the enum contains an unknown value deserialized from
35515        /// the integer representation of enums.
35516        pub fn name(&self) -> std::option::Option<&str> {
35517            match self {
35518                Self::Unspecified => std::option::Option::Some("HPA_PROFILE_UNSPECIFIED"),
35519                Self::None => std::option::Option::Some("NONE"),
35520                Self::Performance => std::option::Option::Some("PERFORMANCE"),
35521                Self::UnknownValue(u) => u.0.name(),
35522            }
35523        }
35524    }
35525
35526    impl std::default::Default for HPAProfile {
35527        fn default() -> Self {
35528            use std::convert::From;
35529            Self::from(0)
35530        }
35531    }
35532
35533    impl std::fmt::Display for HPAProfile {
35534        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35535            wkt::internal::display_enum(f, self.name(), self.value())
35536        }
35537    }
35538
35539    impl std::convert::From<i32> for HPAProfile {
35540        fn from(value: i32) -> Self {
35541            match value {
35542                0 => Self::Unspecified,
35543                1 => Self::None,
35544                2 => Self::Performance,
35545                _ => Self::UnknownValue(hpa_profile::UnknownValue(
35546                    wkt::internal::UnknownEnumValue::Integer(value),
35547                )),
35548            }
35549        }
35550    }
35551
35552    impl std::convert::From<&str> for HPAProfile {
35553        fn from(value: &str) -> Self {
35554            use std::string::ToString;
35555            match value {
35556                "HPA_PROFILE_UNSPECIFIED" => Self::Unspecified,
35557                "NONE" => Self::None,
35558                "PERFORMANCE" => Self::Performance,
35559                _ => Self::UnknownValue(hpa_profile::UnknownValue(
35560                    wkt::internal::UnknownEnumValue::String(value.to_string()),
35561                )),
35562            }
35563        }
35564    }
35565
35566    impl serde::ser::Serialize for HPAProfile {
35567        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35568        where
35569            S: serde::Serializer,
35570        {
35571            match self {
35572                Self::Unspecified => serializer.serialize_i32(0),
35573                Self::None => serializer.serialize_i32(1),
35574                Self::Performance => serializer.serialize_i32(2),
35575                Self::UnknownValue(u) => u.0.serialize(serializer),
35576            }
35577        }
35578    }
35579
35580    impl<'de> serde::de::Deserialize<'de> for HPAProfile {
35581        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35582        where
35583            D: serde::Deserializer<'de>,
35584        {
35585            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HPAProfile>::new(
35586                ".google.container.v1.PodAutoscaling.HPAProfile",
35587            ))
35588        }
35589    }
35590}
35591
35592/// Fleet is the fleet configuration for the cluster.
35593#[derive(Clone, Default, PartialEq)]
35594#[non_exhaustive]
35595pub struct Fleet {
35596    /// The Fleet host project(project ID or project number) where this cluster
35597    /// will be registered to. This field cannot be changed after the cluster has
35598    /// been registered.
35599    pub project: std::string::String,
35600
35601    /// Output only. The full resource name of the registered fleet membership of
35602    /// the cluster, in the format
35603    /// `//gkehub.googleapis.com/projects/*/locations/*/memberships/*`.
35604    pub membership: std::string::String,
35605
35606    /// Output only. Whether the cluster has been registered through the fleet
35607    /// API.
35608    pub pre_registered: bool,
35609
35610    /// The type of the cluster's fleet membership.
35611    pub membership_type: crate::model::fleet::MembershipType,
35612
35613    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35614}
35615
35616impl Fleet {
35617    pub fn new() -> Self {
35618        std::default::Default::default()
35619    }
35620
35621    /// Sets the value of [project][crate::model::Fleet::project].
35622    ///
35623    /// # Example
35624    /// ```ignore,no_run
35625    /// # use google_cloud_container_v1::model::Fleet;
35626    /// let x = Fleet::new().set_project("example");
35627    /// ```
35628    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35629        self.project = v.into();
35630        self
35631    }
35632
35633    /// Sets the value of [membership][crate::model::Fleet::membership].
35634    ///
35635    /// # Example
35636    /// ```ignore,no_run
35637    /// # use google_cloud_container_v1::model::Fleet;
35638    /// let x = Fleet::new().set_membership("example");
35639    /// ```
35640    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35641        self.membership = v.into();
35642        self
35643    }
35644
35645    /// Sets the value of [pre_registered][crate::model::Fleet::pre_registered].
35646    ///
35647    /// # Example
35648    /// ```ignore,no_run
35649    /// # use google_cloud_container_v1::model::Fleet;
35650    /// let x = Fleet::new().set_pre_registered(true);
35651    /// ```
35652    pub fn set_pre_registered<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
35653        self.pre_registered = v.into();
35654        self
35655    }
35656
35657    /// Sets the value of [membership_type][crate::model::Fleet::membership_type].
35658    ///
35659    /// # Example
35660    /// ```ignore,no_run
35661    /// # use google_cloud_container_v1::model::Fleet;
35662    /// use google_cloud_container_v1::model::fleet::MembershipType;
35663    /// let x0 = Fleet::new().set_membership_type(MembershipType::Lightweight);
35664    /// ```
35665    pub fn set_membership_type<T: std::convert::Into<crate::model::fleet::MembershipType>>(
35666        mut self,
35667        v: T,
35668    ) -> Self {
35669        self.membership_type = v.into();
35670        self
35671    }
35672}
35673
35674impl wkt::message::Message for Fleet {
35675    fn typename() -> &'static str {
35676        "type.googleapis.com/google.container.v1.Fleet"
35677    }
35678}
35679
35680/// Defines additional types related to [Fleet].
35681pub mod fleet {
35682    #[allow(unused_imports)]
35683    use super::*;
35684
35685    /// MembershipType describes if the membership supports all features or only
35686    /// lightweight compatible ones.
35687    ///
35688    /// # Working with unknown values
35689    ///
35690    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35691    /// additional enum variants at any time. Adding new variants is not considered
35692    /// a breaking change. Applications should write their code in anticipation of:
35693    ///
35694    /// - New values appearing in future releases of the client library, **and**
35695    /// - New values received dynamically, without application changes.
35696    ///
35697    /// Please consult the [Working with enums] section in the user guide for some
35698    /// guidelines.
35699    ///
35700    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35701    #[derive(Clone, Debug, PartialEq)]
35702    #[non_exhaustive]
35703    pub enum MembershipType {
35704        /// The MembershipType is not set.
35705        Unspecified,
35706        /// The membership supports only lightweight compatible features.
35707        Lightweight,
35708        /// If set, the enum was initialized with an unknown value.
35709        ///
35710        /// Applications can examine the value using [MembershipType::value] or
35711        /// [MembershipType::name].
35712        UnknownValue(membership_type::UnknownValue),
35713    }
35714
35715    #[doc(hidden)]
35716    pub mod membership_type {
35717        #[allow(unused_imports)]
35718        use super::*;
35719        #[derive(Clone, Debug, PartialEq)]
35720        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35721    }
35722
35723    impl MembershipType {
35724        /// Gets the enum value.
35725        ///
35726        /// Returns `None` if the enum contains an unknown value deserialized from
35727        /// the string representation of enums.
35728        pub fn value(&self) -> std::option::Option<i32> {
35729            match self {
35730                Self::Unspecified => std::option::Option::Some(0),
35731                Self::Lightweight => std::option::Option::Some(1),
35732                Self::UnknownValue(u) => u.0.value(),
35733            }
35734        }
35735
35736        /// Gets the enum value as a string.
35737        ///
35738        /// Returns `None` if the enum contains an unknown value deserialized from
35739        /// the integer representation of enums.
35740        pub fn name(&self) -> std::option::Option<&str> {
35741            match self {
35742                Self::Unspecified => std::option::Option::Some("MEMBERSHIP_TYPE_UNSPECIFIED"),
35743                Self::Lightweight => std::option::Option::Some("LIGHTWEIGHT"),
35744                Self::UnknownValue(u) => u.0.name(),
35745            }
35746        }
35747    }
35748
35749    impl std::default::Default for MembershipType {
35750        fn default() -> Self {
35751            use std::convert::From;
35752            Self::from(0)
35753        }
35754    }
35755
35756    impl std::fmt::Display for MembershipType {
35757        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35758            wkt::internal::display_enum(f, self.name(), self.value())
35759        }
35760    }
35761
35762    impl std::convert::From<i32> for MembershipType {
35763        fn from(value: i32) -> Self {
35764            match value {
35765                0 => Self::Unspecified,
35766                1 => Self::Lightweight,
35767                _ => Self::UnknownValue(membership_type::UnknownValue(
35768                    wkt::internal::UnknownEnumValue::Integer(value),
35769                )),
35770            }
35771        }
35772    }
35773
35774    impl std::convert::From<&str> for MembershipType {
35775        fn from(value: &str) -> Self {
35776            use std::string::ToString;
35777            match value {
35778                "MEMBERSHIP_TYPE_UNSPECIFIED" => Self::Unspecified,
35779                "LIGHTWEIGHT" => Self::Lightweight,
35780                _ => Self::UnknownValue(membership_type::UnknownValue(
35781                    wkt::internal::UnknownEnumValue::String(value.to_string()),
35782                )),
35783            }
35784        }
35785    }
35786
35787    impl serde::ser::Serialize for MembershipType {
35788        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35789        where
35790            S: serde::Serializer,
35791        {
35792            match self {
35793                Self::Unspecified => serializer.serialize_i32(0),
35794                Self::Lightweight => serializer.serialize_i32(1),
35795                Self::UnknownValue(u) => u.0.serialize(serializer),
35796            }
35797        }
35798    }
35799
35800    impl<'de> serde::de::Deserialize<'de> for MembershipType {
35801        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35802        where
35803            D: serde::Deserializer<'de>,
35804        {
35805            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MembershipType>::new(
35806                ".google.container.v1.Fleet.MembershipType",
35807            ))
35808        }
35809    }
35810}
35811
35812/// Configuration for all of the cluster's control plane endpoints.
35813#[derive(Clone, Default, PartialEq)]
35814#[non_exhaustive]
35815pub struct ControlPlaneEndpointsConfig {
35816    /// DNS endpoint configuration.
35817    pub dns_endpoint_config:
35818        std::option::Option<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
35819
35820    /// IP endpoints configuration.
35821    pub ip_endpoints_config:
35822        std::option::Option<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
35823
35824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35825}
35826
35827impl ControlPlaneEndpointsConfig {
35828    pub fn new() -> Self {
35829        std::default::Default::default()
35830    }
35831
35832    /// Sets the value of [dns_endpoint_config][crate::model::ControlPlaneEndpointsConfig::dns_endpoint_config].
35833    ///
35834    /// # Example
35835    /// ```ignore,no_run
35836    /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
35837    /// use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35838    /// let x = ControlPlaneEndpointsConfig::new().set_dns_endpoint_config(DNSEndpointConfig::default()/* use setters */);
35839    /// ```
35840    pub fn set_dns_endpoint_config<T>(mut self, v: T) -> Self
35841    where
35842        T: std::convert::Into<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
35843    {
35844        self.dns_endpoint_config = std::option::Option::Some(v.into());
35845        self
35846    }
35847
35848    /// Sets or clears the value of [dns_endpoint_config][crate::model::ControlPlaneEndpointsConfig::dns_endpoint_config].
35849    ///
35850    /// # Example
35851    /// ```ignore,no_run
35852    /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
35853    /// use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35854    /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_dns_endpoint_config(Some(DNSEndpointConfig::default()/* use setters */));
35855    /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_dns_endpoint_config(None::<DNSEndpointConfig>);
35856    /// ```
35857    pub fn set_or_clear_dns_endpoint_config<T>(mut self, v: std::option::Option<T>) -> Self
35858    where
35859        T: std::convert::Into<crate::model::control_plane_endpoints_config::DNSEndpointConfig>,
35860    {
35861        self.dns_endpoint_config = v.map(|x| x.into());
35862        self
35863    }
35864
35865    /// Sets the value of [ip_endpoints_config][crate::model::ControlPlaneEndpointsConfig::ip_endpoints_config].
35866    ///
35867    /// # Example
35868    /// ```ignore,no_run
35869    /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
35870    /// use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
35871    /// let x = ControlPlaneEndpointsConfig::new().set_ip_endpoints_config(IPEndpointsConfig::default()/* use setters */);
35872    /// ```
35873    pub fn set_ip_endpoints_config<T>(mut self, v: T) -> Self
35874    where
35875        T: std::convert::Into<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
35876    {
35877        self.ip_endpoints_config = std::option::Option::Some(v.into());
35878        self
35879    }
35880
35881    /// Sets or clears the value of [ip_endpoints_config][crate::model::ControlPlaneEndpointsConfig::ip_endpoints_config].
35882    ///
35883    /// # Example
35884    /// ```ignore,no_run
35885    /// # use google_cloud_container_v1::model::ControlPlaneEndpointsConfig;
35886    /// use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
35887    /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_ip_endpoints_config(Some(IPEndpointsConfig::default()/* use setters */));
35888    /// let x = ControlPlaneEndpointsConfig::new().set_or_clear_ip_endpoints_config(None::<IPEndpointsConfig>);
35889    /// ```
35890    pub fn set_or_clear_ip_endpoints_config<T>(mut self, v: std::option::Option<T>) -> Self
35891    where
35892        T: std::convert::Into<crate::model::control_plane_endpoints_config::IPEndpointsConfig>,
35893    {
35894        self.ip_endpoints_config = v.map(|x| x.into());
35895        self
35896    }
35897}
35898
35899impl wkt::message::Message for ControlPlaneEndpointsConfig {
35900    fn typename() -> &'static str {
35901        "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig"
35902    }
35903}
35904
35905/// Defines additional types related to [ControlPlaneEndpointsConfig].
35906pub mod control_plane_endpoints_config {
35907    #[allow(unused_imports)]
35908    use super::*;
35909
35910    /// Describes the configuration of a DNS endpoint.
35911    #[derive(Clone, Default, PartialEq)]
35912    #[non_exhaustive]
35913    pub struct DNSEndpointConfig {
35914        /// Output only. The cluster's DNS endpoint configuration.
35915        /// A DNS format address. This is accessible from the public internet.
35916        /// Ex: uid.us-central1.gke.goog.
35917        /// Always present, but the behavior may change according to the value of
35918        /// [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic].
35919        ///
35920        /// [google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]: crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic
35921        pub endpoint: std::string::String,
35922
35923        /// Controls whether user traffic is allowed over this endpoint. Note that
35924        /// Google-managed services may still use the endpoint even if this is false.
35925        pub allow_external_traffic: std::option::Option<bool>,
35926
35927        /// Controls whether the k8s token auth is allowed via DNS.
35928        pub enable_k8s_tokens_via_dns: std::option::Option<bool>,
35929
35930        /// Controls whether the k8s certs auth is allowed via DNS.
35931        pub enable_k8s_certs_via_dns: std::option::Option<bool>,
35932
35933        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35934    }
35935
35936    impl DNSEndpointConfig {
35937        pub fn new() -> Self {
35938            std::default::Default::default()
35939        }
35940
35941        /// Sets the value of [endpoint][crate::model::control_plane_endpoints_config::DNSEndpointConfig::endpoint].
35942        ///
35943        /// # Example
35944        /// ```ignore,no_run
35945        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35946        /// let x = DNSEndpointConfig::new().set_endpoint("example");
35947        /// ```
35948        pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35949            self.endpoint = v.into();
35950            self
35951        }
35952
35953        /// Sets the value of [allow_external_traffic][crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic].
35954        ///
35955        /// # Example
35956        /// ```ignore,no_run
35957        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35958        /// let x = DNSEndpointConfig::new().set_allow_external_traffic(true);
35959        /// ```
35960        pub fn set_allow_external_traffic<T>(mut self, v: T) -> Self
35961        where
35962            T: std::convert::Into<bool>,
35963        {
35964            self.allow_external_traffic = std::option::Option::Some(v.into());
35965            self
35966        }
35967
35968        /// Sets or clears the value of [allow_external_traffic][crate::model::control_plane_endpoints_config::DNSEndpointConfig::allow_external_traffic].
35969        ///
35970        /// # Example
35971        /// ```ignore,no_run
35972        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35973        /// let x = DNSEndpointConfig::new().set_or_clear_allow_external_traffic(Some(false));
35974        /// let x = DNSEndpointConfig::new().set_or_clear_allow_external_traffic(None::<bool>);
35975        /// ```
35976        pub fn set_or_clear_allow_external_traffic<T>(mut self, v: std::option::Option<T>) -> Self
35977        where
35978            T: std::convert::Into<bool>,
35979        {
35980            self.allow_external_traffic = v.map(|x| x.into());
35981            self
35982        }
35983
35984        /// Sets the value of [enable_k8s_tokens_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_tokens_via_dns].
35985        ///
35986        /// # Example
35987        /// ```ignore,no_run
35988        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
35989        /// let x = DNSEndpointConfig::new().set_enable_k8s_tokens_via_dns(true);
35990        /// ```
35991        pub fn set_enable_k8s_tokens_via_dns<T>(mut self, v: T) -> Self
35992        where
35993            T: std::convert::Into<bool>,
35994        {
35995            self.enable_k8s_tokens_via_dns = std::option::Option::Some(v.into());
35996            self
35997        }
35998
35999        /// Sets or clears the value of [enable_k8s_tokens_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_tokens_via_dns].
36000        ///
36001        /// # Example
36002        /// ```ignore,no_run
36003        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
36004        /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_tokens_via_dns(Some(false));
36005        /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_tokens_via_dns(None::<bool>);
36006        /// ```
36007        pub fn set_or_clear_enable_k8s_tokens_via_dns<T>(
36008            mut self,
36009            v: std::option::Option<T>,
36010        ) -> Self
36011        where
36012            T: std::convert::Into<bool>,
36013        {
36014            self.enable_k8s_tokens_via_dns = v.map(|x| x.into());
36015            self
36016        }
36017
36018        /// Sets the value of [enable_k8s_certs_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_certs_via_dns].
36019        ///
36020        /// # Example
36021        /// ```ignore,no_run
36022        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
36023        /// let x = DNSEndpointConfig::new().set_enable_k8s_certs_via_dns(true);
36024        /// ```
36025        pub fn set_enable_k8s_certs_via_dns<T>(mut self, v: T) -> Self
36026        where
36027            T: std::convert::Into<bool>,
36028        {
36029            self.enable_k8s_certs_via_dns = std::option::Option::Some(v.into());
36030            self
36031        }
36032
36033        /// Sets or clears the value of [enable_k8s_certs_via_dns][crate::model::control_plane_endpoints_config::DNSEndpointConfig::enable_k8s_certs_via_dns].
36034        ///
36035        /// # Example
36036        /// ```ignore,no_run
36037        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::DNSEndpointConfig;
36038        /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_certs_via_dns(Some(false));
36039        /// let x = DNSEndpointConfig::new().set_or_clear_enable_k8s_certs_via_dns(None::<bool>);
36040        /// ```
36041        pub fn set_or_clear_enable_k8s_certs_via_dns<T>(mut self, v: std::option::Option<T>) -> Self
36042        where
36043            T: std::convert::Into<bool>,
36044        {
36045            self.enable_k8s_certs_via_dns = v.map(|x| x.into());
36046            self
36047        }
36048    }
36049
36050    impl wkt::message::Message for DNSEndpointConfig {
36051        fn typename() -> &'static str {
36052            "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig"
36053        }
36054    }
36055
36056    /// IP endpoints configuration.
36057    #[derive(Clone, Default, PartialEq)]
36058    #[non_exhaustive]
36059    pub struct IPEndpointsConfig {
36060        /// Controls whether to allow direct IP access.
36061        pub enabled: std::option::Option<bool>,
36062
36063        /// Controls whether the control plane allows access through a public IP.
36064        /// It is invalid to specify both
36065        /// [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same
36066        /// time.
36067        pub enable_public_endpoint: std::option::Option<bool>,
36068
36069        /// Controls whether the control plane's private endpoint is accessible from
36070        /// sources in other regions.
36071        /// It is invalid to specify both
36072        /// [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled]
36073        /// and this field at the same time.
36074        ///
36075        /// [google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled]: crate::model::PrivateClusterMasterGlobalAccessConfig::enabled
36076        pub global_access: std::option::Option<bool>,
36077
36078        /// Configuration of authorized networks. If enabled, restricts access to the
36079        /// control plane based on source IP.
36080        /// It is invalid to specify both
36081        /// [Cluster.masterAuthorizedNetworksConfig][] and this field at the same
36082        /// time.
36083        pub authorized_networks_config:
36084            std::option::Option<crate::model::MasterAuthorizedNetworksConfig>,
36085
36086        /// Output only. The external IP address of this cluster's control plane.
36087        /// Only populated if enabled.
36088        pub public_endpoint: std::string::String,
36089
36090        /// Output only. The internal IP address of this cluster's control plane.
36091        /// Only populated if enabled.
36092        pub private_endpoint: std::string::String,
36093
36094        /// Subnet to provision the master's private endpoint during cluster
36095        /// creation. Specified in projects/*/regions/*/subnetworks/* format. It is
36096        /// invalid to specify both
36097        /// [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the
36098        /// same time.
36099        pub private_endpoint_subnetwork: std::string::String,
36100
36101        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36102    }
36103
36104    impl IPEndpointsConfig {
36105        pub fn new() -> Self {
36106            std::default::Default::default()
36107        }
36108
36109        /// Sets the value of [enabled][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enabled].
36110        ///
36111        /// # Example
36112        /// ```ignore,no_run
36113        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36114        /// let x = IPEndpointsConfig::new().set_enabled(true);
36115        /// ```
36116        pub fn set_enabled<T>(mut self, v: T) -> Self
36117        where
36118            T: std::convert::Into<bool>,
36119        {
36120            self.enabled = std::option::Option::Some(v.into());
36121            self
36122        }
36123
36124        /// Sets or clears the value of [enabled][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enabled].
36125        ///
36126        /// # Example
36127        /// ```ignore,no_run
36128        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36129        /// let x = IPEndpointsConfig::new().set_or_clear_enabled(Some(false));
36130        /// let x = IPEndpointsConfig::new().set_or_clear_enabled(None::<bool>);
36131        /// ```
36132        pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
36133        where
36134            T: std::convert::Into<bool>,
36135        {
36136            self.enabled = v.map(|x| x.into());
36137            self
36138        }
36139
36140        /// Sets the value of [enable_public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint].
36141        ///
36142        /// # Example
36143        /// ```ignore,no_run
36144        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36145        /// let x = IPEndpointsConfig::new().set_enable_public_endpoint(true);
36146        /// ```
36147        pub fn set_enable_public_endpoint<T>(mut self, v: T) -> Self
36148        where
36149            T: std::convert::Into<bool>,
36150        {
36151            self.enable_public_endpoint = std::option::Option::Some(v.into());
36152            self
36153        }
36154
36155        /// Sets or clears the value of [enable_public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::enable_public_endpoint].
36156        ///
36157        /// # Example
36158        /// ```ignore,no_run
36159        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36160        /// let x = IPEndpointsConfig::new().set_or_clear_enable_public_endpoint(Some(false));
36161        /// let x = IPEndpointsConfig::new().set_or_clear_enable_public_endpoint(None::<bool>);
36162        /// ```
36163        pub fn set_or_clear_enable_public_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
36164        where
36165            T: std::convert::Into<bool>,
36166        {
36167            self.enable_public_endpoint = v.map(|x| x.into());
36168            self
36169        }
36170
36171        /// Sets the value of [global_access][crate::model::control_plane_endpoints_config::IPEndpointsConfig::global_access].
36172        ///
36173        /// # Example
36174        /// ```ignore,no_run
36175        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36176        /// let x = IPEndpointsConfig::new().set_global_access(true);
36177        /// ```
36178        pub fn set_global_access<T>(mut self, v: T) -> Self
36179        where
36180            T: std::convert::Into<bool>,
36181        {
36182            self.global_access = std::option::Option::Some(v.into());
36183            self
36184        }
36185
36186        /// Sets or clears the value of [global_access][crate::model::control_plane_endpoints_config::IPEndpointsConfig::global_access].
36187        ///
36188        /// # Example
36189        /// ```ignore,no_run
36190        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36191        /// let x = IPEndpointsConfig::new().set_or_clear_global_access(Some(false));
36192        /// let x = IPEndpointsConfig::new().set_or_clear_global_access(None::<bool>);
36193        /// ```
36194        pub fn set_or_clear_global_access<T>(mut self, v: std::option::Option<T>) -> Self
36195        where
36196            T: std::convert::Into<bool>,
36197        {
36198            self.global_access = v.map(|x| x.into());
36199            self
36200        }
36201
36202        /// Sets the value of [authorized_networks_config][crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config].
36203        ///
36204        /// # Example
36205        /// ```ignore,no_run
36206        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36207        /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
36208        /// let x = IPEndpointsConfig::new().set_authorized_networks_config(MasterAuthorizedNetworksConfig::default()/* use setters */);
36209        /// ```
36210        pub fn set_authorized_networks_config<T>(mut self, v: T) -> Self
36211        where
36212            T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
36213        {
36214            self.authorized_networks_config = std::option::Option::Some(v.into());
36215            self
36216        }
36217
36218        /// Sets or clears the value of [authorized_networks_config][crate::model::control_plane_endpoints_config::IPEndpointsConfig::authorized_networks_config].
36219        ///
36220        /// # Example
36221        /// ```ignore,no_run
36222        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36223        /// use google_cloud_container_v1::model::MasterAuthorizedNetworksConfig;
36224        /// let x = IPEndpointsConfig::new().set_or_clear_authorized_networks_config(Some(MasterAuthorizedNetworksConfig::default()/* use setters */));
36225        /// let x = IPEndpointsConfig::new().set_or_clear_authorized_networks_config(None::<MasterAuthorizedNetworksConfig>);
36226        /// ```
36227        pub fn set_or_clear_authorized_networks_config<T>(
36228            mut self,
36229            v: std::option::Option<T>,
36230        ) -> Self
36231        where
36232            T: std::convert::Into<crate::model::MasterAuthorizedNetworksConfig>,
36233        {
36234            self.authorized_networks_config = v.map(|x| x.into());
36235            self
36236        }
36237
36238        /// Sets the value of [public_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::public_endpoint].
36239        ///
36240        /// # Example
36241        /// ```ignore,no_run
36242        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36243        /// let x = IPEndpointsConfig::new().set_public_endpoint("example");
36244        /// ```
36245        pub fn set_public_endpoint<T: std::convert::Into<std::string::String>>(
36246            mut self,
36247            v: T,
36248        ) -> Self {
36249            self.public_endpoint = v.into();
36250            self
36251        }
36252
36253        /// Sets the value of [private_endpoint][crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint].
36254        ///
36255        /// # Example
36256        /// ```ignore,no_run
36257        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36258        /// let x = IPEndpointsConfig::new().set_private_endpoint("example");
36259        /// ```
36260        pub fn set_private_endpoint<T: std::convert::Into<std::string::String>>(
36261            mut self,
36262            v: T,
36263        ) -> Self {
36264            self.private_endpoint = v.into();
36265            self
36266        }
36267
36268        /// Sets the value of [private_endpoint_subnetwork][crate::model::control_plane_endpoints_config::IPEndpointsConfig::private_endpoint_subnetwork].
36269        ///
36270        /// # Example
36271        /// ```ignore,no_run
36272        /// # use google_cloud_container_v1::model::control_plane_endpoints_config::IPEndpointsConfig;
36273        /// let x = IPEndpointsConfig::new().set_private_endpoint_subnetwork("example");
36274        /// ```
36275        pub fn set_private_endpoint_subnetwork<T: std::convert::Into<std::string::String>>(
36276            mut self,
36277            v: T,
36278        ) -> Self {
36279            self.private_endpoint_subnetwork = v.into();
36280            self
36281        }
36282    }
36283
36284    impl wkt::message::Message for IPEndpointsConfig {
36285        fn typename() -> &'static str {
36286            "type.googleapis.com/google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig"
36287        }
36288    }
36289}
36290
36291/// LocalNvmeSsdBlockConfig contains configuration for using raw-block local
36292/// NVMe SSDs
36293#[derive(Clone, Default, PartialEq)]
36294#[non_exhaustive]
36295pub struct LocalNvmeSsdBlockConfig {
36296    /// Number of local NVMe SSDs to use.  The limit for this value is dependent
36297    /// upon the maximum number of disk available on a machine per zone. See:
36298    /// <https://cloud.google.com/compute/docs/disks/local-ssd>
36299    /// for more information.
36300    ///
36301    /// A zero (or unset) value has different meanings depending on machine type
36302    /// being used:
36303    ///
36304    /// 1. For pre-Gen3 machines, which support flexible numbers of local ssds,
36305    ///    zero (or unset) means to disable using local SSDs as ephemeral storage.
36306    /// 1. For Gen3 machines which dictate a specific number of local ssds, zero
36307    ///    (or unset) means to use the default number of local ssds that goes with
36308    ///    that machine type. For example, for a c3-standard-8-lssd machine, 2 local
36309    ///    ssds would be provisioned. For c3-standard-8 (which doesn't support local
36310    ///    ssds), 0 will be provisioned. See
36311    ///    <https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds>
36312    ///    for more info.
36313    pub local_ssd_count: i32,
36314
36315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36316}
36317
36318impl LocalNvmeSsdBlockConfig {
36319    pub fn new() -> Self {
36320        std::default::Default::default()
36321    }
36322
36323    /// Sets the value of [local_ssd_count][crate::model::LocalNvmeSsdBlockConfig::local_ssd_count].
36324    ///
36325    /// # Example
36326    /// ```ignore,no_run
36327    /// # use google_cloud_container_v1::model::LocalNvmeSsdBlockConfig;
36328    /// let x = LocalNvmeSsdBlockConfig::new().set_local_ssd_count(42);
36329    /// ```
36330    pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
36331        self.local_ssd_count = v.into();
36332        self
36333    }
36334}
36335
36336impl wkt::message::Message for LocalNvmeSsdBlockConfig {
36337    fn typename() -> &'static str {
36338        "type.googleapis.com/google.container.v1.LocalNvmeSsdBlockConfig"
36339    }
36340}
36341
36342/// EphemeralStorageLocalSsdConfig contains configuration for the node ephemeral
36343/// storage using Local SSDs.
36344#[derive(Clone, Default, PartialEq)]
36345#[non_exhaustive]
36346pub struct EphemeralStorageLocalSsdConfig {
36347    /// Number of local SSDs to use to back ephemeral storage. Uses NVMe
36348    /// interfaces.
36349    ///
36350    /// A zero (or unset) value has different meanings depending on machine type
36351    /// being used:
36352    ///
36353    /// 1. For pre-Gen3 machines, which support flexible numbers of local ssds,
36354    ///    zero (or unset) means to disable using local SSDs as ephemeral storage. The
36355    ///    limit for this value is dependent upon the maximum number of disk
36356    ///    available on a machine per zone. See:
36357    ///    <https://cloud.google.com/compute/docs/disks/local-ssd>
36358    ///    for more information.
36359    /// 1. For Gen3 machines which dictate a specific number of local ssds, zero
36360    ///    (or unset) means to use the default number of local ssds that goes with
36361    ///    that machine type. For example, for a c3-standard-8-lssd machine, 2 local
36362    ///    ssds would be provisioned. For c3-standard-8 (which doesn't support local
36363    ///    ssds), 0 will be provisioned. See
36364    ///    <https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds>
36365    ///    for more info.
36366    pub local_ssd_count: i32,
36367
36368    /// Number of local SSDs to use for GKE Data Cache.
36369    pub data_cache_count: i32,
36370
36371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36372}
36373
36374impl EphemeralStorageLocalSsdConfig {
36375    pub fn new() -> Self {
36376        std::default::Default::default()
36377    }
36378
36379    /// Sets the value of [local_ssd_count][crate::model::EphemeralStorageLocalSsdConfig::local_ssd_count].
36380    ///
36381    /// # Example
36382    /// ```ignore,no_run
36383    /// # use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
36384    /// let x = EphemeralStorageLocalSsdConfig::new().set_local_ssd_count(42);
36385    /// ```
36386    pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
36387        self.local_ssd_count = v.into();
36388        self
36389    }
36390
36391    /// Sets the value of [data_cache_count][crate::model::EphemeralStorageLocalSsdConfig::data_cache_count].
36392    ///
36393    /// # Example
36394    /// ```ignore,no_run
36395    /// # use google_cloud_container_v1::model::EphemeralStorageLocalSsdConfig;
36396    /// let x = EphemeralStorageLocalSsdConfig::new().set_data_cache_count(42);
36397    /// ```
36398    pub fn set_data_cache_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
36399        self.data_cache_count = v.into();
36400        self
36401    }
36402}
36403
36404impl wkt::message::Message for EphemeralStorageLocalSsdConfig {
36405    fn typename() -> &'static str {
36406        "type.googleapis.com/google.container.v1.EphemeralStorageLocalSsdConfig"
36407    }
36408}
36409
36410/// A map of resource manager tag keys and values to be attached to the nodes
36411/// for managing Compute Engine firewalls using Network Firewall Policies.
36412/// Tags must be according to specifications in
36413/// <https://cloud.google.com/vpc/docs/tags-firewalls-overview#specifications>.
36414/// A maximum of 5 tag key-value pairs can be specified.
36415/// Existing tags will be replaced with new values.
36416#[derive(Clone, Default, PartialEq)]
36417#[non_exhaustive]
36418pub struct ResourceManagerTags {
36419    /// TagKeyValue must be in one of the following formats ([KEY]=[VALUE])
36420    ///
36421    /// 1. `tagKeys/{tag_key_id}=tagValues/{tag_value_id}`
36422    /// 1. `{org_id}/{tag_key_name}={tag_value_name}`
36423    /// 1. `{project_id}/{tag_key_name}={tag_value_name}`
36424    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
36425
36426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36427}
36428
36429impl ResourceManagerTags {
36430    pub fn new() -> Self {
36431        std::default::Default::default()
36432    }
36433
36434    /// Sets the value of [tags][crate::model::ResourceManagerTags::tags].
36435    ///
36436    /// # Example
36437    /// ```ignore,no_run
36438    /// # use google_cloud_container_v1::model::ResourceManagerTags;
36439    /// let x = ResourceManagerTags::new().set_tags([
36440    ///     ("key0", "abc"),
36441    ///     ("key1", "xyz"),
36442    /// ]);
36443    /// ```
36444    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
36445    where
36446        T: std::iter::IntoIterator<Item = (K, V)>,
36447        K: std::convert::Into<std::string::String>,
36448        V: std::convert::Into<std::string::String>,
36449    {
36450        use std::iter::Iterator;
36451        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
36452        self
36453    }
36454}
36455
36456impl wkt::message::Message for ResourceManagerTags {
36457    fn typename() -> &'static str {
36458        "type.googleapis.com/google.container.v1.ResourceManagerTags"
36459    }
36460}
36461
36462/// EnterpriseConfig is the cluster enterprise configuration.
36463///
36464/// Deprecated: GKE Enterprise features are now available without an Enterprise
36465/// tier.
36466#[derive(Clone, Default, PartialEq)]
36467#[non_exhaustive]
36468#[deprecated]
36469pub struct EnterpriseConfig {
36470    /// Output only. cluster_tier indicates the effective tier of the cluster.
36471    pub cluster_tier: crate::model::enterprise_config::ClusterTier,
36472
36473    /// desired_tier specifies the desired tier of the cluster.
36474    pub desired_tier: crate::model::enterprise_config::ClusterTier,
36475
36476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36477}
36478
36479impl EnterpriseConfig {
36480    pub fn new() -> Self {
36481        std::default::Default::default()
36482    }
36483
36484    /// Sets the value of [cluster_tier][crate::model::EnterpriseConfig::cluster_tier].
36485    ///
36486    /// # Example
36487    /// ```ignore,no_run
36488    /// # use google_cloud_container_v1::model::EnterpriseConfig;
36489    /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
36490    /// let x0 = EnterpriseConfig::new().set_cluster_tier(ClusterTier::Standard);
36491    /// let x1 = EnterpriseConfig::new().set_cluster_tier(ClusterTier::Enterprise);
36492    /// ```
36493    pub fn set_cluster_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
36494        mut self,
36495        v: T,
36496    ) -> Self {
36497        self.cluster_tier = v.into();
36498        self
36499    }
36500
36501    /// Sets the value of [desired_tier][crate::model::EnterpriseConfig::desired_tier].
36502    ///
36503    /// # Example
36504    /// ```ignore,no_run
36505    /// # use google_cloud_container_v1::model::EnterpriseConfig;
36506    /// use google_cloud_container_v1::model::enterprise_config::ClusterTier;
36507    /// let x0 = EnterpriseConfig::new().set_desired_tier(ClusterTier::Standard);
36508    /// let x1 = EnterpriseConfig::new().set_desired_tier(ClusterTier::Enterprise);
36509    /// ```
36510    pub fn set_desired_tier<T: std::convert::Into<crate::model::enterprise_config::ClusterTier>>(
36511        mut self,
36512        v: T,
36513    ) -> Self {
36514        self.desired_tier = v.into();
36515        self
36516    }
36517}
36518
36519impl wkt::message::Message for EnterpriseConfig {
36520    fn typename() -> &'static str {
36521        "type.googleapis.com/google.container.v1.EnterpriseConfig"
36522    }
36523}
36524
36525/// Defines additional types related to [EnterpriseConfig].
36526pub mod enterprise_config {
36527    #[allow(unused_imports)]
36528    use super::*;
36529
36530    /// Premium tiers for GKE Cluster.
36531    ///
36532    /// Deprecated: GKE Enterprise features are now available without an Enterprise
36533    /// tier.
36534    ///
36535    /// # Working with unknown values
36536    ///
36537    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36538    /// additional enum variants at any time. Adding new variants is not considered
36539    /// a breaking change. Applications should write their code in anticipation of:
36540    ///
36541    /// - New values appearing in future releases of the client library, **and**
36542    /// - New values received dynamically, without application changes.
36543    ///
36544    /// Please consult the [Working with enums] section in the user guide for some
36545    /// guidelines.
36546    ///
36547    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
36548    #[derive(Clone, Debug, PartialEq)]
36549    #[non_exhaustive]
36550    #[deprecated]
36551    pub enum ClusterTier {
36552        /// CLUSTER_TIER_UNSPECIFIED is when cluster_tier is not set.
36553        Unspecified,
36554        /// STANDARD indicates a standard GKE cluster.
36555        Standard,
36556        /// ENTERPRISE indicates a GKE Enterprise cluster.
36557        Enterprise,
36558        /// If set, the enum was initialized with an unknown value.
36559        ///
36560        /// Applications can examine the value using [ClusterTier::value] or
36561        /// [ClusterTier::name].
36562        UnknownValue(cluster_tier::UnknownValue),
36563    }
36564
36565    #[doc(hidden)]
36566    pub mod cluster_tier {
36567        #[allow(unused_imports)]
36568        use super::*;
36569        #[derive(Clone, Debug, PartialEq)]
36570        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36571    }
36572
36573    impl ClusterTier {
36574        /// Gets the enum value.
36575        ///
36576        /// Returns `None` if the enum contains an unknown value deserialized from
36577        /// the string representation of enums.
36578        pub fn value(&self) -> std::option::Option<i32> {
36579            match self {
36580                Self::Unspecified => std::option::Option::Some(0),
36581                Self::Standard => std::option::Option::Some(1),
36582                Self::Enterprise => std::option::Option::Some(2),
36583                Self::UnknownValue(u) => u.0.value(),
36584            }
36585        }
36586
36587        /// Gets the enum value as a string.
36588        ///
36589        /// Returns `None` if the enum contains an unknown value deserialized from
36590        /// the integer representation of enums.
36591        pub fn name(&self) -> std::option::Option<&str> {
36592            match self {
36593                Self::Unspecified => std::option::Option::Some("CLUSTER_TIER_UNSPECIFIED"),
36594                Self::Standard => std::option::Option::Some("STANDARD"),
36595                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
36596                Self::UnknownValue(u) => u.0.name(),
36597            }
36598        }
36599    }
36600
36601    impl std::default::Default for ClusterTier {
36602        fn default() -> Self {
36603            use std::convert::From;
36604            Self::from(0)
36605        }
36606    }
36607
36608    impl std::fmt::Display for ClusterTier {
36609        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36610            wkt::internal::display_enum(f, self.name(), self.value())
36611        }
36612    }
36613
36614    impl std::convert::From<i32> for ClusterTier {
36615        fn from(value: i32) -> Self {
36616            match value {
36617                0 => Self::Unspecified,
36618                1 => Self::Standard,
36619                2 => Self::Enterprise,
36620                _ => Self::UnknownValue(cluster_tier::UnknownValue(
36621                    wkt::internal::UnknownEnumValue::Integer(value),
36622                )),
36623            }
36624        }
36625    }
36626
36627    impl std::convert::From<&str> for ClusterTier {
36628        fn from(value: &str) -> Self {
36629            use std::string::ToString;
36630            match value {
36631                "CLUSTER_TIER_UNSPECIFIED" => Self::Unspecified,
36632                "STANDARD" => Self::Standard,
36633                "ENTERPRISE" => Self::Enterprise,
36634                _ => Self::UnknownValue(cluster_tier::UnknownValue(
36635                    wkt::internal::UnknownEnumValue::String(value.to_string()),
36636                )),
36637            }
36638        }
36639    }
36640
36641    impl serde::ser::Serialize for ClusterTier {
36642        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36643        where
36644            S: serde::Serializer,
36645        {
36646            match self {
36647                Self::Unspecified => serializer.serialize_i32(0),
36648                Self::Standard => serializer.serialize_i32(1),
36649                Self::Enterprise => serializer.serialize_i32(2),
36650                Self::UnknownValue(u) => u.0.serialize(serializer),
36651            }
36652        }
36653    }
36654
36655    impl<'de> serde::de::Deserialize<'de> for ClusterTier {
36656        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36657        where
36658            D: serde::Deserializer<'de>,
36659        {
36660            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterTier>::new(
36661                ".google.container.v1.EnterpriseConfig.ClusterTier",
36662            ))
36663        }
36664    }
36665}
36666
36667/// SecretManagerConfig is config for secret manager enablement.
36668#[derive(Clone, Default, PartialEq)]
36669#[non_exhaustive]
36670pub struct SecretManagerConfig {
36671    /// Enable/Disable Secret Manager Config.
36672    pub enabled: std::option::Option<bool>,
36673
36674    /// Rotation config for secret manager.
36675    pub rotation_config: std::option::Option<crate::model::secret_manager_config::RotationConfig>,
36676
36677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36678}
36679
36680impl SecretManagerConfig {
36681    pub fn new() -> Self {
36682        std::default::Default::default()
36683    }
36684
36685    /// Sets the value of [enabled][crate::model::SecretManagerConfig::enabled].
36686    ///
36687    /// # Example
36688    /// ```ignore,no_run
36689    /// # use google_cloud_container_v1::model::SecretManagerConfig;
36690    /// let x = SecretManagerConfig::new().set_enabled(true);
36691    /// ```
36692    pub fn set_enabled<T>(mut self, v: T) -> Self
36693    where
36694        T: std::convert::Into<bool>,
36695    {
36696        self.enabled = std::option::Option::Some(v.into());
36697        self
36698    }
36699
36700    /// Sets or clears the value of [enabled][crate::model::SecretManagerConfig::enabled].
36701    ///
36702    /// # Example
36703    /// ```ignore,no_run
36704    /// # use google_cloud_container_v1::model::SecretManagerConfig;
36705    /// let x = SecretManagerConfig::new().set_or_clear_enabled(Some(false));
36706    /// let x = SecretManagerConfig::new().set_or_clear_enabled(None::<bool>);
36707    /// ```
36708    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
36709    where
36710        T: std::convert::Into<bool>,
36711    {
36712        self.enabled = v.map(|x| x.into());
36713        self
36714    }
36715
36716    /// Sets the value of [rotation_config][crate::model::SecretManagerConfig::rotation_config].
36717    ///
36718    /// # Example
36719    /// ```ignore,no_run
36720    /// # use google_cloud_container_v1::model::SecretManagerConfig;
36721    /// use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36722    /// let x = SecretManagerConfig::new().set_rotation_config(RotationConfig::default()/* use setters */);
36723    /// ```
36724    pub fn set_rotation_config<T>(mut self, v: T) -> Self
36725    where
36726        T: std::convert::Into<crate::model::secret_manager_config::RotationConfig>,
36727    {
36728        self.rotation_config = std::option::Option::Some(v.into());
36729        self
36730    }
36731
36732    /// Sets or clears the value of [rotation_config][crate::model::SecretManagerConfig::rotation_config].
36733    ///
36734    /// # Example
36735    /// ```ignore,no_run
36736    /// # use google_cloud_container_v1::model::SecretManagerConfig;
36737    /// use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36738    /// let x = SecretManagerConfig::new().set_or_clear_rotation_config(Some(RotationConfig::default()/* use setters */));
36739    /// let x = SecretManagerConfig::new().set_or_clear_rotation_config(None::<RotationConfig>);
36740    /// ```
36741    pub fn set_or_clear_rotation_config<T>(mut self, v: std::option::Option<T>) -> Self
36742    where
36743        T: std::convert::Into<crate::model::secret_manager_config::RotationConfig>,
36744    {
36745        self.rotation_config = v.map(|x| x.into());
36746        self
36747    }
36748}
36749
36750impl wkt::message::Message for SecretManagerConfig {
36751    fn typename() -> &'static str {
36752        "type.googleapis.com/google.container.v1.SecretManagerConfig"
36753    }
36754}
36755
36756/// Defines additional types related to [SecretManagerConfig].
36757pub mod secret_manager_config {
36758    #[allow(unused_imports)]
36759    use super::*;
36760
36761    /// RotationConfig is config for secret manager auto rotation.
36762    #[derive(Clone, Default, PartialEq)]
36763    #[non_exhaustive]
36764    pub struct RotationConfig {
36765        /// Whether the rotation is enabled.
36766        pub enabled: std::option::Option<bool>,
36767
36768        /// The interval between two consecutive rotations. Default rotation interval
36769        /// is 2 minutes.
36770        pub rotation_interval: std::option::Option<wkt::Duration>,
36771
36772        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36773    }
36774
36775    impl RotationConfig {
36776        pub fn new() -> Self {
36777            std::default::Default::default()
36778        }
36779
36780        /// Sets the value of [enabled][crate::model::secret_manager_config::RotationConfig::enabled].
36781        ///
36782        /// # Example
36783        /// ```ignore,no_run
36784        /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36785        /// let x = RotationConfig::new().set_enabled(true);
36786        /// ```
36787        pub fn set_enabled<T>(mut self, v: T) -> Self
36788        where
36789            T: std::convert::Into<bool>,
36790        {
36791            self.enabled = std::option::Option::Some(v.into());
36792            self
36793        }
36794
36795        /// Sets or clears the value of [enabled][crate::model::secret_manager_config::RotationConfig::enabled].
36796        ///
36797        /// # Example
36798        /// ```ignore,no_run
36799        /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36800        /// let x = RotationConfig::new().set_or_clear_enabled(Some(false));
36801        /// let x = RotationConfig::new().set_or_clear_enabled(None::<bool>);
36802        /// ```
36803        pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
36804        where
36805            T: std::convert::Into<bool>,
36806        {
36807            self.enabled = v.map(|x| x.into());
36808            self
36809        }
36810
36811        /// Sets the value of [rotation_interval][crate::model::secret_manager_config::RotationConfig::rotation_interval].
36812        ///
36813        /// # Example
36814        /// ```ignore,no_run
36815        /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36816        /// use wkt::Duration;
36817        /// let x = RotationConfig::new().set_rotation_interval(Duration::default()/* use setters */);
36818        /// ```
36819        pub fn set_rotation_interval<T>(mut self, v: T) -> Self
36820        where
36821            T: std::convert::Into<wkt::Duration>,
36822        {
36823            self.rotation_interval = std::option::Option::Some(v.into());
36824            self
36825        }
36826
36827        /// Sets or clears the value of [rotation_interval][crate::model::secret_manager_config::RotationConfig::rotation_interval].
36828        ///
36829        /// # Example
36830        /// ```ignore,no_run
36831        /// # use google_cloud_container_v1::model::secret_manager_config::RotationConfig;
36832        /// use wkt::Duration;
36833        /// let x = RotationConfig::new().set_or_clear_rotation_interval(Some(Duration::default()/* use setters */));
36834        /// let x = RotationConfig::new().set_or_clear_rotation_interval(None::<Duration>);
36835        /// ```
36836        pub fn set_or_clear_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
36837        where
36838            T: std::convert::Into<wkt::Duration>,
36839        {
36840            self.rotation_interval = v.map(|x| x.into());
36841            self
36842        }
36843    }
36844
36845    impl wkt::message::Message for RotationConfig {
36846        fn typename() -> &'static str {
36847            "type.googleapis.com/google.container.v1.SecretManagerConfig.RotationConfig"
36848        }
36849    }
36850}
36851
36852/// BootDisk specifies the boot disk configuration for nodepools.
36853#[derive(Clone, Default, PartialEq)]
36854#[non_exhaustive]
36855pub struct BootDisk {
36856    /// Disk type of the boot disk.
36857    /// (i.e. Hyperdisk-Balanced, PD-Balanced, etc.)
36858    pub disk_type: std::string::String,
36859
36860    /// Disk size in GB. Replaces NodeConfig.disk_size_gb
36861    pub size_gb: i64,
36862
36863    /// For Hyperdisk-Balanced only, the provisioned IOPS config value.
36864    pub provisioned_iops: i64,
36865
36866    /// For Hyperdisk-Balanced only, the provisioned throughput config value.
36867    pub provisioned_throughput: i64,
36868
36869    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36870}
36871
36872impl BootDisk {
36873    pub fn new() -> Self {
36874        std::default::Default::default()
36875    }
36876
36877    /// Sets the value of [disk_type][crate::model::BootDisk::disk_type].
36878    ///
36879    /// # Example
36880    /// ```ignore,no_run
36881    /// # use google_cloud_container_v1::model::BootDisk;
36882    /// let x = BootDisk::new().set_disk_type("example");
36883    /// ```
36884    pub fn set_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36885        self.disk_type = v.into();
36886        self
36887    }
36888
36889    /// Sets the value of [size_gb][crate::model::BootDisk::size_gb].
36890    ///
36891    /// # Example
36892    /// ```ignore,no_run
36893    /// # use google_cloud_container_v1::model::BootDisk;
36894    /// let x = BootDisk::new().set_size_gb(42);
36895    /// ```
36896    pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
36897        self.size_gb = v.into();
36898        self
36899    }
36900
36901    /// Sets the value of [provisioned_iops][crate::model::BootDisk::provisioned_iops].
36902    ///
36903    /// # Example
36904    /// ```ignore,no_run
36905    /// # use google_cloud_container_v1::model::BootDisk;
36906    /// let x = BootDisk::new().set_provisioned_iops(42);
36907    /// ```
36908    pub fn set_provisioned_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
36909        self.provisioned_iops = v.into();
36910        self
36911    }
36912
36913    /// Sets the value of [provisioned_throughput][crate::model::BootDisk::provisioned_throughput].
36914    ///
36915    /// # Example
36916    /// ```ignore,no_run
36917    /// # use google_cloud_container_v1::model::BootDisk;
36918    /// let x = BootDisk::new().set_provisioned_throughput(42);
36919    /// ```
36920    pub fn set_provisioned_throughput<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
36921        self.provisioned_throughput = v.into();
36922        self
36923    }
36924}
36925
36926impl wkt::message::Message for BootDisk {
36927    fn typename() -> &'static str {
36928        "type.googleapis.com/google.container.v1.BootDisk"
36929    }
36930}
36931
36932/// SecondaryBootDisk represents a persistent disk attached to a node
36933/// with special configurations based on its mode.
36934#[derive(Clone, Default, PartialEq)]
36935#[non_exhaustive]
36936pub struct SecondaryBootDisk {
36937    /// Disk mode (container image cache, etc.)
36938    pub mode: crate::model::secondary_boot_disk::Mode,
36939
36940    /// Fully-qualified resource ID for an existing disk image.
36941    pub disk_image: std::string::String,
36942
36943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
36944}
36945
36946impl SecondaryBootDisk {
36947    pub fn new() -> Self {
36948        std::default::Default::default()
36949    }
36950
36951    /// Sets the value of [mode][crate::model::SecondaryBootDisk::mode].
36952    ///
36953    /// # Example
36954    /// ```ignore,no_run
36955    /// # use google_cloud_container_v1::model::SecondaryBootDisk;
36956    /// use google_cloud_container_v1::model::secondary_boot_disk::Mode;
36957    /// let x0 = SecondaryBootDisk::new().set_mode(Mode::ContainerImageCache);
36958    /// ```
36959    pub fn set_mode<T: std::convert::Into<crate::model::secondary_boot_disk::Mode>>(
36960        mut self,
36961        v: T,
36962    ) -> Self {
36963        self.mode = v.into();
36964        self
36965    }
36966
36967    /// Sets the value of [disk_image][crate::model::SecondaryBootDisk::disk_image].
36968    ///
36969    /// # Example
36970    /// ```ignore,no_run
36971    /// # use google_cloud_container_v1::model::SecondaryBootDisk;
36972    /// let x = SecondaryBootDisk::new().set_disk_image("example");
36973    /// ```
36974    pub fn set_disk_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
36975        self.disk_image = v.into();
36976        self
36977    }
36978}
36979
36980impl wkt::message::Message for SecondaryBootDisk {
36981    fn typename() -> &'static str {
36982        "type.googleapis.com/google.container.v1.SecondaryBootDisk"
36983    }
36984}
36985
36986/// Defines additional types related to [SecondaryBootDisk].
36987pub mod secondary_boot_disk {
36988    #[allow(unused_imports)]
36989    use super::*;
36990
36991    /// Mode specifies how the secondary boot disk will be used.
36992    /// This triggers mode-specified logic in the control plane.
36993    ///
36994    /// # Working with unknown values
36995    ///
36996    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36997    /// additional enum variants at any time. Adding new variants is not considered
36998    /// a breaking change. Applications should write their code in anticipation of:
36999    ///
37000    /// - New values appearing in future releases of the client library, **and**
37001    /// - New values received dynamically, without application changes.
37002    ///
37003    /// Please consult the [Working with enums] section in the user guide for some
37004    /// guidelines.
37005    ///
37006    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
37007    #[derive(Clone, Debug, PartialEq)]
37008    #[non_exhaustive]
37009    pub enum Mode {
37010        /// MODE_UNSPECIFIED is when mode is not set.
37011        Unspecified,
37012        /// CONTAINER_IMAGE_CACHE is for using the secondary boot disk as
37013        /// a container image cache.
37014        ContainerImageCache,
37015        /// If set, the enum was initialized with an unknown value.
37016        ///
37017        /// Applications can examine the value using [Mode::value] or
37018        /// [Mode::name].
37019        UnknownValue(mode::UnknownValue),
37020    }
37021
37022    #[doc(hidden)]
37023    pub mod mode {
37024        #[allow(unused_imports)]
37025        use super::*;
37026        #[derive(Clone, Debug, PartialEq)]
37027        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37028    }
37029
37030    impl Mode {
37031        /// Gets the enum value.
37032        ///
37033        /// Returns `None` if the enum contains an unknown value deserialized from
37034        /// the string representation of enums.
37035        pub fn value(&self) -> std::option::Option<i32> {
37036            match self {
37037                Self::Unspecified => std::option::Option::Some(0),
37038                Self::ContainerImageCache => std::option::Option::Some(1),
37039                Self::UnknownValue(u) => u.0.value(),
37040            }
37041        }
37042
37043        /// Gets the enum value as a string.
37044        ///
37045        /// Returns `None` if the enum contains an unknown value deserialized from
37046        /// the integer representation of enums.
37047        pub fn name(&self) -> std::option::Option<&str> {
37048            match self {
37049                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
37050                Self::ContainerImageCache => std::option::Option::Some("CONTAINER_IMAGE_CACHE"),
37051                Self::UnknownValue(u) => u.0.name(),
37052            }
37053        }
37054    }
37055
37056    impl std::default::Default for Mode {
37057        fn default() -> Self {
37058            use std::convert::From;
37059            Self::from(0)
37060        }
37061    }
37062
37063    impl std::fmt::Display for Mode {
37064        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37065            wkt::internal::display_enum(f, self.name(), self.value())
37066        }
37067    }
37068
37069    impl std::convert::From<i32> for Mode {
37070        fn from(value: i32) -> Self {
37071            match value {
37072                0 => Self::Unspecified,
37073                1 => Self::ContainerImageCache,
37074                _ => Self::UnknownValue(mode::UnknownValue(
37075                    wkt::internal::UnknownEnumValue::Integer(value),
37076                )),
37077            }
37078        }
37079    }
37080
37081    impl std::convert::From<&str> for Mode {
37082        fn from(value: &str) -> Self {
37083            use std::string::ToString;
37084            match value {
37085                "MODE_UNSPECIFIED" => Self::Unspecified,
37086                "CONTAINER_IMAGE_CACHE" => Self::ContainerImageCache,
37087                _ => Self::UnknownValue(mode::UnknownValue(
37088                    wkt::internal::UnknownEnumValue::String(value.to_string()),
37089                )),
37090            }
37091        }
37092    }
37093
37094    impl serde::ser::Serialize for Mode {
37095        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37096        where
37097            S: serde::Serializer,
37098        {
37099            match self {
37100                Self::Unspecified => serializer.serialize_i32(0),
37101                Self::ContainerImageCache => serializer.serialize_i32(1),
37102                Self::UnknownValue(u) => u.0.serialize(serializer),
37103            }
37104        }
37105    }
37106
37107    impl<'de> serde::de::Deserialize<'de> for Mode {
37108        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37109        where
37110            D: serde::Deserializer<'de>,
37111        {
37112            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
37113                ".google.container.v1.SecondaryBootDisk.Mode",
37114            ))
37115        }
37116    }
37117}
37118
37119/// SecondaryBootDiskUpdateStrategy is a placeholder which will be extended
37120/// in the future to define different options for updating secondary boot disks.
37121#[derive(Clone, Default, PartialEq)]
37122#[non_exhaustive]
37123pub struct SecondaryBootDiskUpdateStrategy {
37124    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37125}
37126
37127impl SecondaryBootDiskUpdateStrategy {
37128    pub fn new() -> Self {
37129        std::default::Default::default()
37130    }
37131}
37132
37133impl wkt::message::Message for SecondaryBootDiskUpdateStrategy {
37134    fn typename() -> &'static str {
37135        "type.googleapis.com/google.container.v1.SecondaryBootDiskUpdateStrategy"
37136    }
37137}
37138
37139/// FetchClusterUpgradeInfoRequest fetches the upgrade information of a cluster.
37140#[derive(Clone, Default, PartialEq)]
37141#[non_exhaustive]
37142pub struct FetchClusterUpgradeInfoRequest {
37143    /// Required. The name (project, location, cluster) of the cluster to get.
37144    /// Specified in the format `projects/*/locations/*/clusters/*` or
37145    /// `projects/*/zones/*/clusters/*`.
37146    pub name: std::string::String,
37147
37148    /// API request version that initiates this operation.
37149    pub version: std::string::String,
37150
37151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37152}
37153
37154impl FetchClusterUpgradeInfoRequest {
37155    pub fn new() -> Self {
37156        std::default::Default::default()
37157    }
37158
37159    /// Sets the value of [name][crate::model::FetchClusterUpgradeInfoRequest::name].
37160    ///
37161    /// # Example
37162    /// ```ignore,no_run
37163    /// # use google_cloud_container_v1::model::FetchClusterUpgradeInfoRequest;
37164    /// let x = FetchClusterUpgradeInfoRequest::new().set_name("example");
37165    /// ```
37166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37167        self.name = v.into();
37168        self
37169    }
37170
37171    /// Sets the value of [version][crate::model::FetchClusterUpgradeInfoRequest::version].
37172    ///
37173    /// # Example
37174    /// ```ignore,no_run
37175    /// # use google_cloud_container_v1::model::FetchClusterUpgradeInfoRequest;
37176    /// let x = FetchClusterUpgradeInfoRequest::new().set_version("example");
37177    /// ```
37178    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37179        self.version = v.into();
37180        self
37181    }
37182}
37183
37184impl wkt::message::Message for FetchClusterUpgradeInfoRequest {
37185    fn typename() -> &'static str {
37186        "type.googleapis.com/google.container.v1.FetchClusterUpgradeInfoRequest"
37187    }
37188}
37189
37190/// ClusterUpgradeInfo contains the upgrade information of a cluster.
37191#[derive(Clone, Default, PartialEq)]
37192#[non_exhaustive]
37193pub struct ClusterUpgradeInfo {
37194    /// minor_target_version indicates the target version for minor upgrade.
37195    pub minor_target_version: std::option::Option<std::string::String>,
37196
37197    /// patch_target_version indicates the target version for patch upgrade.
37198    pub patch_target_version: std::option::Option<std::string::String>,
37199
37200    /// The auto upgrade status.
37201    pub auto_upgrade_status: std::vec::Vec<crate::model::cluster_upgrade_info::AutoUpgradeStatus>,
37202
37203    /// The auto upgrade paused reason.
37204    pub paused_reason: std::vec::Vec<crate::model::cluster_upgrade_info::AutoUpgradePausedReason>,
37205
37206    /// The list of past auto upgrades.
37207    pub upgrade_details: std::vec::Vec<crate::model::UpgradeDetails>,
37208
37209    /// The cluster's current minor version's end of standard support timestamp.
37210    pub end_of_standard_support_timestamp: std::option::Option<std::string::String>,
37211
37212    /// The cluster's current minor version's end of extended support timestamp.
37213    pub end_of_extended_support_timestamp: std::option::Option<std::string::String>,
37214
37215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37216}
37217
37218impl ClusterUpgradeInfo {
37219    pub fn new() -> Self {
37220        std::default::Default::default()
37221    }
37222
37223    /// Sets the value of [minor_target_version][crate::model::ClusterUpgradeInfo::minor_target_version].
37224    ///
37225    /// # Example
37226    /// ```ignore,no_run
37227    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37228    /// let x = ClusterUpgradeInfo::new().set_minor_target_version("example");
37229    /// ```
37230    pub fn set_minor_target_version<T>(mut self, v: T) -> Self
37231    where
37232        T: std::convert::Into<std::string::String>,
37233    {
37234        self.minor_target_version = std::option::Option::Some(v.into());
37235        self
37236    }
37237
37238    /// Sets or clears the value of [minor_target_version][crate::model::ClusterUpgradeInfo::minor_target_version].
37239    ///
37240    /// # Example
37241    /// ```ignore,no_run
37242    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37243    /// let x = ClusterUpgradeInfo::new().set_or_clear_minor_target_version(Some("example"));
37244    /// let x = ClusterUpgradeInfo::new().set_or_clear_minor_target_version(None::<String>);
37245    /// ```
37246    pub fn set_or_clear_minor_target_version<T>(mut self, v: std::option::Option<T>) -> Self
37247    where
37248        T: std::convert::Into<std::string::String>,
37249    {
37250        self.minor_target_version = v.map(|x| x.into());
37251        self
37252    }
37253
37254    /// Sets the value of [patch_target_version][crate::model::ClusterUpgradeInfo::patch_target_version].
37255    ///
37256    /// # Example
37257    /// ```ignore,no_run
37258    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37259    /// let x = ClusterUpgradeInfo::new().set_patch_target_version("example");
37260    /// ```
37261    pub fn set_patch_target_version<T>(mut self, v: T) -> Self
37262    where
37263        T: std::convert::Into<std::string::String>,
37264    {
37265        self.patch_target_version = std::option::Option::Some(v.into());
37266        self
37267    }
37268
37269    /// Sets or clears the value of [patch_target_version][crate::model::ClusterUpgradeInfo::patch_target_version].
37270    ///
37271    /// # Example
37272    /// ```ignore,no_run
37273    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37274    /// let x = ClusterUpgradeInfo::new().set_or_clear_patch_target_version(Some("example"));
37275    /// let x = ClusterUpgradeInfo::new().set_or_clear_patch_target_version(None::<String>);
37276    /// ```
37277    pub fn set_or_clear_patch_target_version<T>(mut self, v: std::option::Option<T>) -> Self
37278    where
37279        T: std::convert::Into<std::string::String>,
37280    {
37281        self.patch_target_version = v.map(|x| x.into());
37282        self
37283    }
37284
37285    /// Sets the value of [auto_upgrade_status][crate::model::ClusterUpgradeInfo::auto_upgrade_status].
37286    ///
37287    /// # Example
37288    /// ```ignore,no_run
37289    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37290    /// use google_cloud_container_v1::model::cluster_upgrade_info::AutoUpgradeStatus;
37291    /// let x = ClusterUpgradeInfo::new().set_auto_upgrade_status([
37292    ///     AutoUpgradeStatus::Active,
37293    ///     AutoUpgradeStatus::MinorUpgradePaused,
37294    ///     AutoUpgradeStatus::UpgradePaused,
37295    /// ]);
37296    /// ```
37297    pub fn set_auto_upgrade_status<T, V>(mut self, v: T) -> Self
37298    where
37299        T: std::iter::IntoIterator<Item = V>,
37300        V: std::convert::Into<crate::model::cluster_upgrade_info::AutoUpgradeStatus>,
37301    {
37302        use std::iter::Iterator;
37303        self.auto_upgrade_status = v.into_iter().map(|i| i.into()).collect();
37304        self
37305    }
37306
37307    /// Sets the value of [paused_reason][crate::model::ClusterUpgradeInfo::paused_reason].
37308    ///
37309    /// # Example
37310    /// ```ignore,no_run
37311    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37312    /// use google_cloud_container_v1::model::cluster_upgrade_info::AutoUpgradePausedReason;
37313    /// let x = ClusterUpgradeInfo::new().set_paused_reason([
37314    ///     AutoUpgradePausedReason::MaintenanceWindow,
37315    ///     AutoUpgradePausedReason::MaintenanceExclusionNoUpgrades,
37316    ///     AutoUpgradePausedReason::MaintenanceExclusionNoMinorUpgrades,
37317    /// ]);
37318    /// ```
37319    pub fn set_paused_reason<T, V>(mut self, v: T) -> Self
37320    where
37321        T: std::iter::IntoIterator<Item = V>,
37322        V: std::convert::Into<crate::model::cluster_upgrade_info::AutoUpgradePausedReason>,
37323    {
37324        use std::iter::Iterator;
37325        self.paused_reason = v.into_iter().map(|i| i.into()).collect();
37326        self
37327    }
37328
37329    /// Sets the value of [upgrade_details][crate::model::ClusterUpgradeInfo::upgrade_details].
37330    ///
37331    /// # Example
37332    /// ```ignore,no_run
37333    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37334    /// use google_cloud_container_v1::model::UpgradeDetails;
37335    /// let x = ClusterUpgradeInfo::new()
37336    ///     .set_upgrade_details([
37337    ///         UpgradeDetails::default()/* use setters */,
37338    ///         UpgradeDetails::default()/* use (different) setters */,
37339    ///     ]);
37340    /// ```
37341    pub fn set_upgrade_details<T, V>(mut self, v: T) -> Self
37342    where
37343        T: std::iter::IntoIterator<Item = V>,
37344        V: std::convert::Into<crate::model::UpgradeDetails>,
37345    {
37346        use std::iter::Iterator;
37347        self.upgrade_details = v.into_iter().map(|i| i.into()).collect();
37348        self
37349    }
37350
37351    /// Sets the value of [end_of_standard_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_standard_support_timestamp].
37352    ///
37353    /// # Example
37354    /// ```ignore,no_run
37355    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37356    /// let x = ClusterUpgradeInfo::new().set_end_of_standard_support_timestamp("example");
37357    /// ```
37358    pub fn set_end_of_standard_support_timestamp<T>(mut self, v: T) -> Self
37359    where
37360        T: std::convert::Into<std::string::String>,
37361    {
37362        self.end_of_standard_support_timestamp = std::option::Option::Some(v.into());
37363        self
37364    }
37365
37366    /// Sets or clears the value of [end_of_standard_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_standard_support_timestamp].
37367    ///
37368    /// # Example
37369    /// ```ignore,no_run
37370    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37371    /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(Some("example"));
37372    /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(None::<String>);
37373    /// ```
37374    pub fn set_or_clear_end_of_standard_support_timestamp<T>(
37375        mut self,
37376        v: std::option::Option<T>,
37377    ) -> Self
37378    where
37379        T: std::convert::Into<std::string::String>,
37380    {
37381        self.end_of_standard_support_timestamp = v.map(|x| x.into());
37382        self
37383    }
37384
37385    /// Sets the value of [end_of_extended_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_extended_support_timestamp].
37386    ///
37387    /// # Example
37388    /// ```ignore,no_run
37389    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37390    /// let x = ClusterUpgradeInfo::new().set_end_of_extended_support_timestamp("example");
37391    /// ```
37392    pub fn set_end_of_extended_support_timestamp<T>(mut self, v: T) -> Self
37393    where
37394        T: std::convert::Into<std::string::String>,
37395    {
37396        self.end_of_extended_support_timestamp = std::option::Option::Some(v.into());
37397        self
37398    }
37399
37400    /// Sets or clears the value of [end_of_extended_support_timestamp][crate::model::ClusterUpgradeInfo::end_of_extended_support_timestamp].
37401    ///
37402    /// # Example
37403    /// ```ignore,no_run
37404    /// # use google_cloud_container_v1::model::ClusterUpgradeInfo;
37405    /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(Some("example"));
37406    /// let x = ClusterUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(None::<String>);
37407    /// ```
37408    pub fn set_or_clear_end_of_extended_support_timestamp<T>(
37409        mut self,
37410        v: std::option::Option<T>,
37411    ) -> Self
37412    where
37413        T: std::convert::Into<std::string::String>,
37414    {
37415        self.end_of_extended_support_timestamp = v.map(|x| x.into());
37416        self
37417    }
37418}
37419
37420impl wkt::message::Message for ClusterUpgradeInfo {
37421    fn typename() -> &'static str {
37422        "type.googleapis.com/google.container.v1.ClusterUpgradeInfo"
37423    }
37424}
37425
37426/// Defines additional types related to [ClusterUpgradeInfo].
37427pub mod cluster_upgrade_info {
37428    #[allow(unused_imports)]
37429    use super::*;
37430
37431    /// AutoUpgradeStatus indicates the status of auto upgrade.
37432    ///
37433    /// # Working with unknown values
37434    ///
37435    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37436    /// additional enum variants at any time. Adding new variants is not considered
37437    /// a breaking change. Applications should write their code in anticipation of:
37438    ///
37439    /// - New values appearing in future releases of the client library, **and**
37440    /// - New values received dynamically, without application changes.
37441    ///
37442    /// Please consult the [Working with enums] section in the user guide for some
37443    /// guidelines.
37444    ///
37445    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
37446    #[derive(Clone, Debug, PartialEq)]
37447    #[non_exhaustive]
37448    pub enum AutoUpgradeStatus {
37449        /// UNKNOWN indicates an unknown status.
37450        Unknown,
37451        /// ACTIVE indicates an active status.
37452        Active,
37453        /// MINOR_UPGRADE_PAUSED indicates the minor version upgrade is
37454        /// paused.
37455        MinorUpgradePaused,
37456        /// UPGRADE_PAUSED indicates the upgrade is paused.
37457        UpgradePaused,
37458        /// If set, the enum was initialized with an unknown value.
37459        ///
37460        /// Applications can examine the value using [AutoUpgradeStatus::value] or
37461        /// [AutoUpgradeStatus::name].
37462        UnknownValue(auto_upgrade_status::UnknownValue),
37463    }
37464
37465    #[doc(hidden)]
37466    pub mod auto_upgrade_status {
37467        #[allow(unused_imports)]
37468        use super::*;
37469        #[derive(Clone, Debug, PartialEq)]
37470        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37471    }
37472
37473    impl AutoUpgradeStatus {
37474        /// Gets the enum value.
37475        ///
37476        /// Returns `None` if the enum contains an unknown value deserialized from
37477        /// the string representation of enums.
37478        pub fn value(&self) -> std::option::Option<i32> {
37479            match self {
37480                Self::Unknown => std::option::Option::Some(0),
37481                Self::Active => std::option::Option::Some(1),
37482                Self::MinorUpgradePaused => std::option::Option::Some(4),
37483                Self::UpgradePaused => std::option::Option::Some(5),
37484                Self::UnknownValue(u) => u.0.value(),
37485            }
37486        }
37487
37488        /// Gets the enum value as a string.
37489        ///
37490        /// Returns `None` if the enum contains an unknown value deserialized from
37491        /// the integer representation of enums.
37492        pub fn name(&self) -> std::option::Option<&str> {
37493            match self {
37494                Self::Unknown => std::option::Option::Some("UNKNOWN"),
37495                Self::Active => std::option::Option::Some("ACTIVE"),
37496                Self::MinorUpgradePaused => std::option::Option::Some("MINOR_UPGRADE_PAUSED"),
37497                Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
37498                Self::UnknownValue(u) => u.0.name(),
37499            }
37500        }
37501    }
37502
37503    impl std::default::Default for AutoUpgradeStatus {
37504        fn default() -> Self {
37505            use std::convert::From;
37506            Self::from(0)
37507        }
37508    }
37509
37510    impl std::fmt::Display for AutoUpgradeStatus {
37511        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37512            wkt::internal::display_enum(f, self.name(), self.value())
37513        }
37514    }
37515
37516    impl std::convert::From<i32> for AutoUpgradeStatus {
37517        fn from(value: i32) -> Self {
37518            match value {
37519                0 => Self::Unknown,
37520                1 => Self::Active,
37521                4 => Self::MinorUpgradePaused,
37522                5 => Self::UpgradePaused,
37523                _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
37524                    wkt::internal::UnknownEnumValue::Integer(value),
37525                )),
37526            }
37527        }
37528    }
37529
37530    impl std::convert::From<&str> for AutoUpgradeStatus {
37531        fn from(value: &str) -> Self {
37532            use std::string::ToString;
37533            match value {
37534                "UNKNOWN" => Self::Unknown,
37535                "ACTIVE" => Self::Active,
37536                "MINOR_UPGRADE_PAUSED" => Self::MinorUpgradePaused,
37537                "UPGRADE_PAUSED" => Self::UpgradePaused,
37538                _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
37539                    wkt::internal::UnknownEnumValue::String(value.to_string()),
37540                )),
37541            }
37542        }
37543    }
37544
37545    impl serde::ser::Serialize for AutoUpgradeStatus {
37546        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37547        where
37548            S: serde::Serializer,
37549        {
37550            match self {
37551                Self::Unknown => serializer.serialize_i32(0),
37552                Self::Active => serializer.serialize_i32(1),
37553                Self::MinorUpgradePaused => serializer.serialize_i32(4),
37554                Self::UpgradePaused => serializer.serialize_i32(5),
37555                Self::UnknownValue(u) => u.0.serialize(serializer),
37556            }
37557        }
37558    }
37559
37560    impl<'de> serde::de::Deserialize<'de> for AutoUpgradeStatus {
37561        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37562        where
37563            D: serde::Deserializer<'de>,
37564        {
37565            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoUpgradeStatus>::new(
37566                ".google.container.v1.ClusterUpgradeInfo.AutoUpgradeStatus",
37567            ))
37568        }
37569    }
37570
37571    /// AutoUpgradePausedReason indicates the reason for auto upgrade paused
37572    /// status.
37573    ///
37574    /// # Working with unknown values
37575    ///
37576    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37577    /// additional enum variants at any time. Adding new variants is not considered
37578    /// a breaking change. Applications should write their code in anticipation of:
37579    ///
37580    /// - New values appearing in future releases of the client library, **and**
37581    /// - New values received dynamically, without application changes.
37582    ///
37583    /// Please consult the [Working with enums] section in the user guide for some
37584    /// guidelines.
37585    ///
37586    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
37587    #[derive(Clone, Debug, PartialEq)]
37588    #[non_exhaustive]
37589    pub enum AutoUpgradePausedReason {
37590        /// AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED indicates an unspecified reason.
37591        Unspecified,
37592        /// MAINTENANCE_WINDOW indicates the cluster is outside customer maintenance
37593        /// window.
37594        MaintenanceWindow,
37595        /// MAINTENANCE_EXCLUSION_NO_UPGRADES indicates the cluster is in a
37596        /// maintenance exclusion with scope NO_UPGRADES.
37597        MaintenanceExclusionNoUpgrades,
37598        /// MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES indicates the cluster is in a
37599        /// maintenance exclusion with scope NO_MINOR_UPGRADES.
37600        MaintenanceExclusionNoMinorUpgrades,
37601        /// CLUSTER_DISRUPTION_BUDGET indicates the cluster is outside the cluster
37602        /// disruption budget.
37603        ClusterDisruptionBudget,
37604        /// CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE indicates the cluster is outside
37605        /// the cluster disruption budget for minor version upgrade.
37606        ClusterDisruptionBudgetMinorUpgrade,
37607        /// SYSTEM_CONFIG indicates the cluster upgrade is paused  by system config.
37608        SystemConfig,
37609        /// If set, the enum was initialized with an unknown value.
37610        ///
37611        /// Applications can examine the value using [AutoUpgradePausedReason::value] or
37612        /// [AutoUpgradePausedReason::name].
37613        UnknownValue(auto_upgrade_paused_reason::UnknownValue),
37614    }
37615
37616    #[doc(hidden)]
37617    pub mod auto_upgrade_paused_reason {
37618        #[allow(unused_imports)]
37619        use super::*;
37620        #[derive(Clone, Debug, PartialEq)]
37621        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37622    }
37623
37624    impl AutoUpgradePausedReason {
37625        /// Gets the enum value.
37626        ///
37627        /// Returns `None` if the enum contains an unknown value deserialized from
37628        /// the string representation of enums.
37629        pub fn value(&self) -> std::option::Option<i32> {
37630            match self {
37631                Self::Unspecified => std::option::Option::Some(0),
37632                Self::MaintenanceWindow => std::option::Option::Some(1),
37633                Self::MaintenanceExclusionNoUpgrades => std::option::Option::Some(5),
37634                Self::MaintenanceExclusionNoMinorUpgrades => std::option::Option::Some(6),
37635                Self::ClusterDisruptionBudget => std::option::Option::Some(4),
37636                Self::ClusterDisruptionBudgetMinorUpgrade => std::option::Option::Some(7),
37637                Self::SystemConfig => std::option::Option::Some(8),
37638                Self::UnknownValue(u) => u.0.value(),
37639            }
37640        }
37641
37642        /// Gets the enum value as a string.
37643        ///
37644        /// Returns `None` if the enum contains an unknown value deserialized from
37645        /// the integer representation of enums.
37646        pub fn name(&self) -> std::option::Option<&str> {
37647            match self {
37648                Self::Unspecified => {
37649                    std::option::Option::Some("AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED")
37650                }
37651                Self::MaintenanceWindow => std::option::Option::Some("MAINTENANCE_WINDOW"),
37652                Self::MaintenanceExclusionNoUpgrades => {
37653                    std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_UPGRADES")
37654                }
37655                Self::MaintenanceExclusionNoMinorUpgrades => {
37656                    std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES")
37657                }
37658                Self::ClusterDisruptionBudget => {
37659                    std::option::Option::Some("CLUSTER_DISRUPTION_BUDGET")
37660                }
37661                Self::ClusterDisruptionBudgetMinorUpgrade => {
37662                    std::option::Option::Some("CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE")
37663                }
37664                Self::SystemConfig => std::option::Option::Some("SYSTEM_CONFIG"),
37665                Self::UnknownValue(u) => u.0.name(),
37666            }
37667        }
37668    }
37669
37670    impl std::default::Default for AutoUpgradePausedReason {
37671        fn default() -> Self {
37672            use std::convert::From;
37673            Self::from(0)
37674        }
37675    }
37676
37677    impl std::fmt::Display for AutoUpgradePausedReason {
37678        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37679            wkt::internal::display_enum(f, self.name(), self.value())
37680        }
37681    }
37682
37683    impl std::convert::From<i32> for AutoUpgradePausedReason {
37684        fn from(value: i32) -> Self {
37685            match value {
37686                0 => Self::Unspecified,
37687                1 => Self::MaintenanceWindow,
37688                4 => Self::ClusterDisruptionBudget,
37689                5 => Self::MaintenanceExclusionNoUpgrades,
37690                6 => Self::MaintenanceExclusionNoMinorUpgrades,
37691                7 => Self::ClusterDisruptionBudgetMinorUpgrade,
37692                8 => Self::SystemConfig,
37693                _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
37694                    wkt::internal::UnknownEnumValue::Integer(value),
37695                )),
37696            }
37697        }
37698    }
37699
37700    impl std::convert::From<&str> for AutoUpgradePausedReason {
37701        fn from(value: &str) -> Self {
37702            use std::string::ToString;
37703            match value {
37704                "AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED" => Self::Unspecified,
37705                "MAINTENANCE_WINDOW" => Self::MaintenanceWindow,
37706                "MAINTENANCE_EXCLUSION_NO_UPGRADES" => Self::MaintenanceExclusionNoUpgrades,
37707                "MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES" => {
37708                    Self::MaintenanceExclusionNoMinorUpgrades
37709                }
37710                "CLUSTER_DISRUPTION_BUDGET" => Self::ClusterDisruptionBudget,
37711                "CLUSTER_DISRUPTION_BUDGET_MINOR_UPGRADE" => {
37712                    Self::ClusterDisruptionBudgetMinorUpgrade
37713                }
37714                "SYSTEM_CONFIG" => Self::SystemConfig,
37715                _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
37716                    wkt::internal::UnknownEnumValue::String(value.to_string()),
37717                )),
37718            }
37719        }
37720    }
37721
37722    impl serde::ser::Serialize for AutoUpgradePausedReason {
37723        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37724        where
37725            S: serde::Serializer,
37726        {
37727            match self {
37728                Self::Unspecified => serializer.serialize_i32(0),
37729                Self::MaintenanceWindow => serializer.serialize_i32(1),
37730                Self::MaintenanceExclusionNoUpgrades => serializer.serialize_i32(5),
37731                Self::MaintenanceExclusionNoMinorUpgrades => serializer.serialize_i32(6),
37732                Self::ClusterDisruptionBudget => serializer.serialize_i32(4),
37733                Self::ClusterDisruptionBudgetMinorUpgrade => serializer.serialize_i32(7),
37734                Self::SystemConfig => serializer.serialize_i32(8),
37735                Self::UnknownValue(u) => u.0.serialize(serializer),
37736            }
37737        }
37738    }
37739
37740    impl<'de> serde::de::Deserialize<'de> for AutoUpgradePausedReason {
37741        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37742        where
37743            D: serde::Deserializer<'de>,
37744        {
37745            deserializer.deserialize_any(
37746                wkt::internal::EnumVisitor::<AutoUpgradePausedReason>::new(
37747                    ".google.container.v1.ClusterUpgradeInfo.AutoUpgradePausedReason",
37748                ),
37749            )
37750        }
37751    }
37752}
37753
37754/// UpgradeDetails contains detailed information of each individual upgrade
37755/// operation.
37756#[derive(Clone, Default, PartialEq)]
37757#[non_exhaustive]
37758pub struct UpgradeDetails {
37759    /// Output only. The state of the upgrade.
37760    pub state: crate::model::upgrade_details::State,
37761
37762    /// The start timestamp of the upgrade.
37763    pub start_time: std::option::Option<wkt::Timestamp>,
37764
37765    /// The end timestamp of the upgrade.
37766    pub end_time: std::option::Option<wkt::Timestamp>,
37767
37768    /// The version before the upgrade.
37769    pub initial_version: std::string::String,
37770
37771    /// The version after the upgrade.
37772    pub target_version: std::string::String,
37773
37774    /// The start type of the upgrade.
37775    pub start_type: crate::model::upgrade_details::StartType,
37776
37777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
37778}
37779
37780impl UpgradeDetails {
37781    pub fn new() -> Self {
37782        std::default::Default::default()
37783    }
37784
37785    /// Sets the value of [state][crate::model::UpgradeDetails::state].
37786    ///
37787    /// # Example
37788    /// ```ignore,no_run
37789    /// # use google_cloud_container_v1::model::UpgradeDetails;
37790    /// use google_cloud_container_v1::model::upgrade_details::State;
37791    /// let x0 = UpgradeDetails::new().set_state(State::Failed);
37792    /// let x1 = UpgradeDetails::new().set_state(State::Succeeded);
37793    /// let x2 = UpgradeDetails::new().set_state(State::Canceled);
37794    /// ```
37795    pub fn set_state<T: std::convert::Into<crate::model::upgrade_details::State>>(
37796        mut self,
37797        v: T,
37798    ) -> Self {
37799        self.state = v.into();
37800        self
37801    }
37802
37803    /// Sets the value of [start_time][crate::model::UpgradeDetails::start_time].
37804    ///
37805    /// # Example
37806    /// ```ignore,no_run
37807    /// # use google_cloud_container_v1::model::UpgradeDetails;
37808    /// use wkt::Timestamp;
37809    /// let x = UpgradeDetails::new().set_start_time(Timestamp::default()/* use setters */);
37810    /// ```
37811    pub fn set_start_time<T>(mut self, v: T) -> Self
37812    where
37813        T: std::convert::Into<wkt::Timestamp>,
37814    {
37815        self.start_time = std::option::Option::Some(v.into());
37816        self
37817    }
37818
37819    /// Sets or clears the value of [start_time][crate::model::UpgradeDetails::start_time].
37820    ///
37821    /// # Example
37822    /// ```ignore,no_run
37823    /// # use google_cloud_container_v1::model::UpgradeDetails;
37824    /// use wkt::Timestamp;
37825    /// let x = UpgradeDetails::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
37826    /// let x = UpgradeDetails::new().set_or_clear_start_time(None::<Timestamp>);
37827    /// ```
37828    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
37829    where
37830        T: std::convert::Into<wkt::Timestamp>,
37831    {
37832        self.start_time = v.map(|x| x.into());
37833        self
37834    }
37835
37836    /// Sets the value of [end_time][crate::model::UpgradeDetails::end_time].
37837    ///
37838    /// # Example
37839    /// ```ignore,no_run
37840    /// # use google_cloud_container_v1::model::UpgradeDetails;
37841    /// use wkt::Timestamp;
37842    /// let x = UpgradeDetails::new().set_end_time(Timestamp::default()/* use setters */);
37843    /// ```
37844    pub fn set_end_time<T>(mut self, v: T) -> Self
37845    where
37846        T: std::convert::Into<wkt::Timestamp>,
37847    {
37848        self.end_time = std::option::Option::Some(v.into());
37849        self
37850    }
37851
37852    /// Sets or clears the value of [end_time][crate::model::UpgradeDetails::end_time].
37853    ///
37854    /// # Example
37855    /// ```ignore,no_run
37856    /// # use google_cloud_container_v1::model::UpgradeDetails;
37857    /// use wkt::Timestamp;
37858    /// let x = UpgradeDetails::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
37859    /// let x = UpgradeDetails::new().set_or_clear_end_time(None::<Timestamp>);
37860    /// ```
37861    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
37862    where
37863        T: std::convert::Into<wkt::Timestamp>,
37864    {
37865        self.end_time = v.map(|x| x.into());
37866        self
37867    }
37868
37869    /// Sets the value of [initial_version][crate::model::UpgradeDetails::initial_version].
37870    ///
37871    /// # Example
37872    /// ```ignore,no_run
37873    /// # use google_cloud_container_v1::model::UpgradeDetails;
37874    /// let x = UpgradeDetails::new().set_initial_version("example");
37875    /// ```
37876    pub fn set_initial_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37877        self.initial_version = v.into();
37878        self
37879    }
37880
37881    /// Sets the value of [target_version][crate::model::UpgradeDetails::target_version].
37882    ///
37883    /// # Example
37884    /// ```ignore,no_run
37885    /// # use google_cloud_container_v1::model::UpgradeDetails;
37886    /// let x = UpgradeDetails::new().set_target_version("example");
37887    /// ```
37888    pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37889        self.target_version = v.into();
37890        self
37891    }
37892
37893    /// Sets the value of [start_type][crate::model::UpgradeDetails::start_type].
37894    ///
37895    /// # Example
37896    /// ```ignore,no_run
37897    /// # use google_cloud_container_v1::model::UpgradeDetails;
37898    /// use google_cloud_container_v1::model::upgrade_details::StartType;
37899    /// let x0 = UpgradeDetails::new().set_start_type(StartType::Automatic);
37900    /// let x1 = UpgradeDetails::new().set_start_type(StartType::Manual);
37901    /// ```
37902    pub fn set_start_type<T: std::convert::Into<crate::model::upgrade_details::StartType>>(
37903        mut self,
37904        v: T,
37905    ) -> Self {
37906        self.start_type = v.into();
37907        self
37908    }
37909}
37910
37911impl wkt::message::Message for UpgradeDetails {
37912    fn typename() -> &'static str {
37913        "type.googleapis.com/google.container.v1.UpgradeDetails"
37914    }
37915}
37916
37917/// Defines additional types related to [UpgradeDetails].
37918pub mod upgrade_details {
37919    #[allow(unused_imports)]
37920    use super::*;
37921
37922    /// State indicates the state of the upgrade.
37923    ///
37924    /// # Working with unknown values
37925    ///
37926    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37927    /// additional enum variants at any time. Adding new variants is not considered
37928    /// a breaking change. Applications should write their code in anticipation of:
37929    ///
37930    /// - New values appearing in future releases of the client library, **and**
37931    /// - New values received dynamically, without application changes.
37932    ///
37933    /// Please consult the [Working with enums] section in the user guide for some
37934    /// guidelines.
37935    ///
37936    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
37937    #[derive(Clone, Debug, PartialEq)]
37938    #[non_exhaustive]
37939    pub enum State {
37940        /// Upgrade state is unknown.
37941        Unknown,
37942        /// Upgrade has failed with an error.
37943        Failed,
37944        /// Upgrade has succeeded.
37945        Succeeded,
37946        /// Upgrade has been canceled.
37947        Canceled,
37948        /// Upgrade is running.
37949        Running,
37950        /// If set, the enum was initialized with an unknown value.
37951        ///
37952        /// Applications can examine the value using [State::value] or
37953        /// [State::name].
37954        UnknownValue(state::UnknownValue),
37955    }
37956
37957    #[doc(hidden)]
37958    pub mod state {
37959        #[allow(unused_imports)]
37960        use super::*;
37961        #[derive(Clone, Debug, PartialEq)]
37962        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37963    }
37964
37965    impl State {
37966        /// Gets the enum value.
37967        ///
37968        /// Returns `None` if the enum contains an unknown value deserialized from
37969        /// the string representation of enums.
37970        pub fn value(&self) -> std::option::Option<i32> {
37971            match self {
37972                Self::Unknown => std::option::Option::Some(0),
37973                Self::Failed => std::option::Option::Some(1),
37974                Self::Succeeded => std::option::Option::Some(2),
37975                Self::Canceled => std::option::Option::Some(3),
37976                Self::Running => std::option::Option::Some(4),
37977                Self::UnknownValue(u) => u.0.value(),
37978            }
37979        }
37980
37981        /// Gets the enum value as a string.
37982        ///
37983        /// Returns `None` if the enum contains an unknown value deserialized from
37984        /// the integer representation of enums.
37985        pub fn name(&self) -> std::option::Option<&str> {
37986            match self {
37987                Self::Unknown => std::option::Option::Some("UNKNOWN"),
37988                Self::Failed => std::option::Option::Some("FAILED"),
37989                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
37990                Self::Canceled => std::option::Option::Some("CANCELED"),
37991                Self::Running => std::option::Option::Some("RUNNING"),
37992                Self::UnknownValue(u) => u.0.name(),
37993            }
37994        }
37995    }
37996
37997    impl std::default::Default for State {
37998        fn default() -> Self {
37999            use std::convert::From;
38000            Self::from(0)
38001        }
38002    }
38003
38004    impl std::fmt::Display for State {
38005        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38006            wkt::internal::display_enum(f, self.name(), self.value())
38007        }
38008    }
38009
38010    impl std::convert::From<i32> for State {
38011        fn from(value: i32) -> Self {
38012            match value {
38013                0 => Self::Unknown,
38014                1 => Self::Failed,
38015                2 => Self::Succeeded,
38016                3 => Self::Canceled,
38017                4 => Self::Running,
38018                _ => Self::UnknownValue(state::UnknownValue(
38019                    wkt::internal::UnknownEnumValue::Integer(value),
38020                )),
38021            }
38022        }
38023    }
38024
38025    impl std::convert::From<&str> for State {
38026        fn from(value: &str) -> Self {
38027            use std::string::ToString;
38028            match value {
38029                "UNKNOWN" => Self::Unknown,
38030                "FAILED" => Self::Failed,
38031                "SUCCEEDED" => Self::Succeeded,
38032                "CANCELED" => Self::Canceled,
38033                "RUNNING" => Self::Running,
38034                _ => Self::UnknownValue(state::UnknownValue(
38035                    wkt::internal::UnknownEnumValue::String(value.to_string()),
38036                )),
38037            }
38038        }
38039    }
38040
38041    impl serde::ser::Serialize for State {
38042        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38043        where
38044            S: serde::Serializer,
38045        {
38046            match self {
38047                Self::Unknown => serializer.serialize_i32(0),
38048                Self::Failed => serializer.serialize_i32(1),
38049                Self::Succeeded => serializer.serialize_i32(2),
38050                Self::Canceled => serializer.serialize_i32(3),
38051                Self::Running => serializer.serialize_i32(4),
38052                Self::UnknownValue(u) => u.0.serialize(serializer),
38053            }
38054        }
38055    }
38056
38057    impl<'de> serde::de::Deserialize<'de> for State {
38058        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38059        where
38060            D: serde::Deserializer<'de>,
38061        {
38062            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
38063                ".google.container.v1.UpgradeDetails.State",
38064            ))
38065        }
38066    }
38067
38068    /// StartType indicates the type of starting the upgrade.
38069    ///
38070    /// # Working with unknown values
38071    ///
38072    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38073    /// additional enum variants at any time. Adding new variants is not considered
38074    /// a breaking change. Applications should write their code in anticipation of:
38075    ///
38076    /// - New values appearing in future releases of the client library, **and**
38077    /// - New values received dynamically, without application changes.
38078    ///
38079    /// Please consult the [Working with enums] section in the user guide for some
38080    /// guidelines.
38081    ///
38082    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
38083    #[derive(Clone, Debug, PartialEq)]
38084    #[non_exhaustive]
38085    pub enum StartType {
38086        /// Upgrade start type is unspecified.
38087        Unspecified,
38088        /// Upgrade started automatically.
38089        Automatic,
38090        /// Upgrade started manually.
38091        Manual,
38092        /// If set, the enum was initialized with an unknown value.
38093        ///
38094        /// Applications can examine the value using [StartType::value] or
38095        /// [StartType::name].
38096        UnknownValue(start_type::UnknownValue),
38097    }
38098
38099    #[doc(hidden)]
38100    pub mod start_type {
38101        #[allow(unused_imports)]
38102        use super::*;
38103        #[derive(Clone, Debug, PartialEq)]
38104        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38105    }
38106
38107    impl StartType {
38108        /// Gets the enum value.
38109        ///
38110        /// Returns `None` if the enum contains an unknown value deserialized from
38111        /// the string representation of enums.
38112        pub fn value(&self) -> std::option::Option<i32> {
38113            match self {
38114                Self::Unspecified => std::option::Option::Some(0),
38115                Self::Automatic => std::option::Option::Some(1),
38116                Self::Manual => std::option::Option::Some(2),
38117                Self::UnknownValue(u) => u.0.value(),
38118            }
38119        }
38120
38121        /// Gets the enum value as a string.
38122        ///
38123        /// Returns `None` if the enum contains an unknown value deserialized from
38124        /// the integer representation of enums.
38125        pub fn name(&self) -> std::option::Option<&str> {
38126            match self {
38127                Self::Unspecified => std::option::Option::Some("START_TYPE_UNSPECIFIED"),
38128                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
38129                Self::Manual => std::option::Option::Some("MANUAL"),
38130                Self::UnknownValue(u) => u.0.name(),
38131            }
38132        }
38133    }
38134
38135    impl std::default::Default for StartType {
38136        fn default() -> Self {
38137            use std::convert::From;
38138            Self::from(0)
38139        }
38140    }
38141
38142    impl std::fmt::Display for StartType {
38143        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38144            wkt::internal::display_enum(f, self.name(), self.value())
38145        }
38146    }
38147
38148    impl std::convert::From<i32> for StartType {
38149        fn from(value: i32) -> Self {
38150            match value {
38151                0 => Self::Unspecified,
38152                1 => Self::Automatic,
38153                2 => Self::Manual,
38154                _ => Self::UnknownValue(start_type::UnknownValue(
38155                    wkt::internal::UnknownEnumValue::Integer(value),
38156                )),
38157            }
38158        }
38159    }
38160
38161    impl std::convert::From<&str> for StartType {
38162        fn from(value: &str) -> Self {
38163            use std::string::ToString;
38164            match value {
38165                "START_TYPE_UNSPECIFIED" => Self::Unspecified,
38166                "AUTOMATIC" => Self::Automatic,
38167                "MANUAL" => Self::Manual,
38168                _ => Self::UnknownValue(start_type::UnknownValue(
38169                    wkt::internal::UnknownEnumValue::String(value.to_string()),
38170                )),
38171            }
38172        }
38173    }
38174
38175    impl serde::ser::Serialize for StartType {
38176        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38177        where
38178            S: serde::Serializer,
38179        {
38180            match self {
38181                Self::Unspecified => serializer.serialize_i32(0),
38182                Self::Automatic => serializer.serialize_i32(1),
38183                Self::Manual => serializer.serialize_i32(2),
38184                Self::UnknownValue(u) => u.0.serialize(serializer),
38185            }
38186        }
38187    }
38188
38189    impl<'de> serde::de::Deserialize<'de> for StartType {
38190        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38191        where
38192            D: serde::Deserializer<'de>,
38193        {
38194            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StartType>::new(
38195                ".google.container.v1.UpgradeDetails.StartType",
38196            ))
38197        }
38198    }
38199}
38200
38201/// FetchNodePoolUpgradeInfoRequest fetches the upgrade information of a
38202/// nodepool.
38203#[derive(Clone, Default, PartialEq)]
38204#[non_exhaustive]
38205pub struct FetchNodePoolUpgradeInfoRequest {
38206    /// Required. The name (project, location, cluster, nodepool) of the nodepool
38207    /// to get. Specified in the format
38208    /// `projects/*/locations/*/clusters/*/nodePools/*` or
38209    /// `projects/*/zones/*/clusters/*/nodePools/*`.
38210    pub name: std::string::String,
38211
38212    /// API request version that initiates this operation.
38213    pub version: std::string::String,
38214
38215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38216}
38217
38218impl FetchNodePoolUpgradeInfoRequest {
38219    pub fn new() -> Self {
38220        std::default::Default::default()
38221    }
38222
38223    /// Sets the value of [name][crate::model::FetchNodePoolUpgradeInfoRequest::name].
38224    ///
38225    /// # Example
38226    /// ```ignore,no_run
38227    /// # use google_cloud_container_v1::model::FetchNodePoolUpgradeInfoRequest;
38228    /// let x = FetchNodePoolUpgradeInfoRequest::new().set_name("example");
38229    /// ```
38230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38231        self.name = v.into();
38232        self
38233    }
38234
38235    /// Sets the value of [version][crate::model::FetchNodePoolUpgradeInfoRequest::version].
38236    ///
38237    /// # Example
38238    /// ```ignore,no_run
38239    /// # use google_cloud_container_v1::model::FetchNodePoolUpgradeInfoRequest;
38240    /// let x = FetchNodePoolUpgradeInfoRequest::new().set_version("example");
38241    /// ```
38242    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
38243        self.version = v.into();
38244        self
38245    }
38246}
38247
38248impl wkt::message::Message for FetchNodePoolUpgradeInfoRequest {
38249    fn typename() -> &'static str {
38250        "type.googleapis.com/google.container.v1.FetchNodePoolUpgradeInfoRequest"
38251    }
38252}
38253
38254/// NodePoolUpgradeInfo contains the upgrade information of a nodepool.
38255#[derive(Clone, Default, PartialEq)]
38256#[non_exhaustive]
38257pub struct NodePoolUpgradeInfo {
38258    /// minor_target_version indicates the target version for minor upgrade.
38259    pub minor_target_version: std::option::Option<std::string::String>,
38260
38261    /// patch_target_version indicates the target version for patch upgrade.
38262    pub patch_target_version: std::option::Option<std::string::String>,
38263
38264    /// The auto upgrade status.
38265    pub auto_upgrade_status: std::vec::Vec<crate::model::node_pool_upgrade_info::AutoUpgradeStatus>,
38266
38267    /// The auto upgrade paused reason.
38268    pub paused_reason: std::vec::Vec<crate::model::node_pool_upgrade_info::AutoUpgradePausedReason>,
38269
38270    /// The list of past auto upgrades.
38271    pub upgrade_details: std::vec::Vec<crate::model::UpgradeDetails>,
38272
38273    /// The nodepool's current minor version's end of standard support timestamp.
38274    pub end_of_standard_support_timestamp: std::option::Option<std::string::String>,
38275
38276    /// The nodepool's current minor version's end of extended support timestamp.
38277    pub end_of_extended_support_timestamp: std::option::Option<std::string::String>,
38278
38279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38280}
38281
38282impl NodePoolUpgradeInfo {
38283    pub fn new() -> Self {
38284        std::default::Default::default()
38285    }
38286
38287    /// Sets the value of [minor_target_version][crate::model::NodePoolUpgradeInfo::minor_target_version].
38288    ///
38289    /// # Example
38290    /// ```ignore,no_run
38291    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38292    /// let x = NodePoolUpgradeInfo::new().set_minor_target_version("example");
38293    /// ```
38294    pub fn set_minor_target_version<T>(mut self, v: T) -> Self
38295    where
38296        T: std::convert::Into<std::string::String>,
38297    {
38298        self.minor_target_version = std::option::Option::Some(v.into());
38299        self
38300    }
38301
38302    /// Sets or clears the value of [minor_target_version][crate::model::NodePoolUpgradeInfo::minor_target_version].
38303    ///
38304    /// # Example
38305    /// ```ignore,no_run
38306    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38307    /// let x = NodePoolUpgradeInfo::new().set_or_clear_minor_target_version(Some("example"));
38308    /// let x = NodePoolUpgradeInfo::new().set_or_clear_minor_target_version(None::<String>);
38309    /// ```
38310    pub fn set_or_clear_minor_target_version<T>(mut self, v: std::option::Option<T>) -> Self
38311    where
38312        T: std::convert::Into<std::string::String>,
38313    {
38314        self.minor_target_version = v.map(|x| x.into());
38315        self
38316    }
38317
38318    /// Sets the value of [patch_target_version][crate::model::NodePoolUpgradeInfo::patch_target_version].
38319    ///
38320    /// # Example
38321    /// ```ignore,no_run
38322    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38323    /// let x = NodePoolUpgradeInfo::new().set_patch_target_version("example");
38324    /// ```
38325    pub fn set_patch_target_version<T>(mut self, v: T) -> Self
38326    where
38327        T: std::convert::Into<std::string::String>,
38328    {
38329        self.patch_target_version = std::option::Option::Some(v.into());
38330        self
38331    }
38332
38333    /// Sets or clears the value of [patch_target_version][crate::model::NodePoolUpgradeInfo::patch_target_version].
38334    ///
38335    /// # Example
38336    /// ```ignore,no_run
38337    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38338    /// let x = NodePoolUpgradeInfo::new().set_or_clear_patch_target_version(Some("example"));
38339    /// let x = NodePoolUpgradeInfo::new().set_or_clear_patch_target_version(None::<String>);
38340    /// ```
38341    pub fn set_or_clear_patch_target_version<T>(mut self, v: std::option::Option<T>) -> Self
38342    where
38343        T: std::convert::Into<std::string::String>,
38344    {
38345        self.patch_target_version = v.map(|x| x.into());
38346        self
38347    }
38348
38349    /// Sets the value of [auto_upgrade_status][crate::model::NodePoolUpgradeInfo::auto_upgrade_status].
38350    ///
38351    /// # Example
38352    /// ```ignore,no_run
38353    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38354    /// use google_cloud_container_v1::model::node_pool_upgrade_info::AutoUpgradeStatus;
38355    /// let x = NodePoolUpgradeInfo::new().set_auto_upgrade_status([
38356    ///     AutoUpgradeStatus::Active,
38357    ///     AutoUpgradeStatus::MinorUpgradePaused,
38358    ///     AutoUpgradeStatus::UpgradePaused,
38359    /// ]);
38360    /// ```
38361    pub fn set_auto_upgrade_status<T, V>(mut self, v: T) -> Self
38362    where
38363        T: std::iter::IntoIterator<Item = V>,
38364        V: std::convert::Into<crate::model::node_pool_upgrade_info::AutoUpgradeStatus>,
38365    {
38366        use std::iter::Iterator;
38367        self.auto_upgrade_status = v.into_iter().map(|i| i.into()).collect();
38368        self
38369    }
38370
38371    /// Sets the value of [paused_reason][crate::model::NodePoolUpgradeInfo::paused_reason].
38372    ///
38373    /// # Example
38374    /// ```ignore,no_run
38375    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38376    /// use google_cloud_container_v1::model::node_pool_upgrade_info::AutoUpgradePausedReason;
38377    /// let x = NodePoolUpgradeInfo::new().set_paused_reason([
38378    ///     AutoUpgradePausedReason::MaintenanceWindow,
38379    ///     AutoUpgradePausedReason::MaintenanceExclusionNoUpgrades,
38380    ///     AutoUpgradePausedReason::MaintenanceExclusionNoMinorUpgrades,
38381    /// ]);
38382    /// ```
38383    pub fn set_paused_reason<T, V>(mut self, v: T) -> Self
38384    where
38385        T: std::iter::IntoIterator<Item = V>,
38386        V: std::convert::Into<crate::model::node_pool_upgrade_info::AutoUpgradePausedReason>,
38387    {
38388        use std::iter::Iterator;
38389        self.paused_reason = v.into_iter().map(|i| i.into()).collect();
38390        self
38391    }
38392
38393    /// Sets the value of [upgrade_details][crate::model::NodePoolUpgradeInfo::upgrade_details].
38394    ///
38395    /// # Example
38396    /// ```ignore,no_run
38397    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38398    /// use google_cloud_container_v1::model::UpgradeDetails;
38399    /// let x = NodePoolUpgradeInfo::new()
38400    ///     .set_upgrade_details([
38401    ///         UpgradeDetails::default()/* use setters */,
38402    ///         UpgradeDetails::default()/* use (different) setters */,
38403    ///     ]);
38404    /// ```
38405    pub fn set_upgrade_details<T, V>(mut self, v: T) -> Self
38406    where
38407        T: std::iter::IntoIterator<Item = V>,
38408        V: std::convert::Into<crate::model::UpgradeDetails>,
38409    {
38410        use std::iter::Iterator;
38411        self.upgrade_details = v.into_iter().map(|i| i.into()).collect();
38412        self
38413    }
38414
38415    /// Sets the value of [end_of_standard_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_standard_support_timestamp].
38416    ///
38417    /// # Example
38418    /// ```ignore,no_run
38419    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38420    /// let x = NodePoolUpgradeInfo::new().set_end_of_standard_support_timestamp("example");
38421    /// ```
38422    pub fn set_end_of_standard_support_timestamp<T>(mut self, v: T) -> Self
38423    where
38424        T: std::convert::Into<std::string::String>,
38425    {
38426        self.end_of_standard_support_timestamp = std::option::Option::Some(v.into());
38427        self
38428    }
38429
38430    /// Sets or clears the value of [end_of_standard_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_standard_support_timestamp].
38431    ///
38432    /// # Example
38433    /// ```ignore,no_run
38434    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38435    /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(Some("example"));
38436    /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_standard_support_timestamp(None::<String>);
38437    /// ```
38438    pub fn set_or_clear_end_of_standard_support_timestamp<T>(
38439        mut self,
38440        v: std::option::Option<T>,
38441    ) -> Self
38442    where
38443        T: std::convert::Into<std::string::String>,
38444    {
38445        self.end_of_standard_support_timestamp = v.map(|x| x.into());
38446        self
38447    }
38448
38449    /// Sets the value of [end_of_extended_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_extended_support_timestamp].
38450    ///
38451    /// # Example
38452    /// ```ignore,no_run
38453    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38454    /// let x = NodePoolUpgradeInfo::new().set_end_of_extended_support_timestamp("example");
38455    /// ```
38456    pub fn set_end_of_extended_support_timestamp<T>(mut self, v: T) -> Self
38457    where
38458        T: std::convert::Into<std::string::String>,
38459    {
38460        self.end_of_extended_support_timestamp = std::option::Option::Some(v.into());
38461        self
38462    }
38463
38464    /// Sets or clears the value of [end_of_extended_support_timestamp][crate::model::NodePoolUpgradeInfo::end_of_extended_support_timestamp].
38465    ///
38466    /// # Example
38467    /// ```ignore,no_run
38468    /// # use google_cloud_container_v1::model::NodePoolUpgradeInfo;
38469    /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(Some("example"));
38470    /// let x = NodePoolUpgradeInfo::new().set_or_clear_end_of_extended_support_timestamp(None::<String>);
38471    /// ```
38472    pub fn set_or_clear_end_of_extended_support_timestamp<T>(
38473        mut self,
38474        v: std::option::Option<T>,
38475    ) -> Self
38476    where
38477        T: std::convert::Into<std::string::String>,
38478    {
38479        self.end_of_extended_support_timestamp = v.map(|x| x.into());
38480        self
38481    }
38482}
38483
38484impl wkt::message::Message for NodePoolUpgradeInfo {
38485    fn typename() -> &'static str {
38486        "type.googleapis.com/google.container.v1.NodePoolUpgradeInfo"
38487    }
38488}
38489
38490/// Defines additional types related to [NodePoolUpgradeInfo].
38491pub mod node_pool_upgrade_info {
38492    #[allow(unused_imports)]
38493    use super::*;
38494
38495    /// AutoUpgradeStatus indicates the status of auto upgrade.
38496    ///
38497    /// # Working with unknown values
38498    ///
38499    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38500    /// additional enum variants at any time. Adding new variants is not considered
38501    /// a breaking change. Applications should write their code in anticipation of:
38502    ///
38503    /// - New values appearing in future releases of the client library, **and**
38504    /// - New values received dynamically, without application changes.
38505    ///
38506    /// Please consult the [Working with enums] section in the user guide for some
38507    /// guidelines.
38508    ///
38509    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
38510    #[derive(Clone, Debug, PartialEq)]
38511    #[non_exhaustive]
38512    pub enum AutoUpgradeStatus {
38513        /// UNKNOWN indicates an unknown status.
38514        Unknown,
38515        /// ACTIVE indicates an active status.
38516        Active,
38517        /// MINOR_UPGRADE_PAUSED indicates the minor version upgrade is
38518        /// paused.
38519        MinorUpgradePaused,
38520        /// UPGRADE_PAUSED indicates the upgrade is paused.
38521        UpgradePaused,
38522        /// If set, the enum was initialized with an unknown value.
38523        ///
38524        /// Applications can examine the value using [AutoUpgradeStatus::value] or
38525        /// [AutoUpgradeStatus::name].
38526        UnknownValue(auto_upgrade_status::UnknownValue),
38527    }
38528
38529    #[doc(hidden)]
38530    pub mod auto_upgrade_status {
38531        #[allow(unused_imports)]
38532        use super::*;
38533        #[derive(Clone, Debug, PartialEq)]
38534        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38535    }
38536
38537    impl AutoUpgradeStatus {
38538        /// Gets the enum value.
38539        ///
38540        /// Returns `None` if the enum contains an unknown value deserialized from
38541        /// the string representation of enums.
38542        pub fn value(&self) -> std::option::Option<i32> {
38543            match self {
38544                Self::Unknown => std::option::Option::Some(0),
38545                Self::Active => std::option::Option::Some(1),
38546                Self::MinorUpgradePaused => std::option::Option::Some(2),
38547                Self::UpgradePaused => std::option::Option::Some(3),
38548                Self::UnknownValue(u) => u.0.value(),
38549            }
38550        }
38551
38552        /// Gets the enum value as a string.
38553        ///
38554        /// Returns `None` if the enum contains an unknown value deserialized from
38555        /// the integer representation of enums.
38556        pub fn name(&self) -> std::option::Option<&str> {
38557            match self {
38558                Self::Unknown => std::option::Option::Some("UNKNOWN"),
38559                Self::Active => std::option::Option::Some("ACTIVE"),
38560                Self::MinorUpgradePaused => std::option::Option::Some("MINOR_UPGRADE_PAUSED"),
38561                Self::UpgradePaused => std::option::Option::Some("UPGRADE_PAUSED"),
38562                Self::UnknownValue(u) => u.0.name(),
38563            }
38564        }
38565    }
38566
38567    impl std::default::Default for AutoUpgradeStatus {
38568        fn default() -> Self {
38569            use std::convert::From;
38570            Self::from(0)
38571        }
38572    }
38573
38574    impl std::fmt::Display for AutoUpgradeStatus {
38575        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38576            wkt::internal::display_enum(f, self.name(), self.value())
38577        }
38578    }
38579
38580    impl std::convert::From<i32> for AutoUpgradeStatus {
38581        fn from(value: i32) -> Self {
38582            match value {
38583                0 => Self::Unknown,
38584                1 => Self::Active,
38585                2 => Self::MinorUpgradePaused,
38586                3 => Self::UpgradePaused,
38587                _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
38588                    wkt::internal::UnknownEnumValue::Integer(value),
38589                )),
38590            }
38591        }
38592    }
38593
38594    impl std::convert::From<&str> for AutoUpgradeStatus {
38595        fn from(value: &str) -> Self {
38596            use std::string::ToString;
38597            match value {
38598                "UNKNOWN" => Self::Unknown,
38599                "ACTIVE" => Self::Active,
38600                "MINOR_UPGRADE_PAUSED" => Self::MinorUpgradePaused,
38601                "UPGRADE_PAUSED" => Self::UpgradePaused,
38602                _ => Self::UnknownValue(auto_upgrade_status::UnknownValue(
38603                    wkt::internal::UnknownEnumValue::String(value.to_string()),
38604                )),
38605            }
38606        }
38607    }
38608
38609    impl serde::ser::Serialize for AutoUpgradeStatus {
38610        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38611        where
38612            S: serde::Serializer,
38613        {
38614            match self {
38615                Self::Unknown => serializer.serialize_i32(0),
38616                Self::Active => serializer.serialize_i32(1),
38617                Self::MinorUpgradePaused => serializer.serialize_i32(2),
38618                Self::UpgradePaused => serializer.serialize_i32(3),
38619                Self::UnknownValue(u) => u.0.serialize(serializer),
38620            }
38621        }
38622    }
38623
38624    impl<'de> serde::de::Deserialize<'de> for AutoUpgradeStatus {
38625        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38626        where
38627            D: serde::Deserializer<'de>,
38628        {
38629            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoUpgradeStatus>::new(
38630                ".google.container.v1.NodePoolUpgradeInfo.AutoUpgradeStatus",
38631            ))
38632        }
38633    }
38634
38635    /// AutoUpgradePausedReason indicates the reason for auto upgrade paused
38636    /// status.
38637    ///
38638    /// # Working with unknown values
38639    ///
38640    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38641    /// additional enum variants at any time. Adding new variants is not considered
38642    /// a breaking change. Applications should write their code in anticipation of:
38643    ///
38644    /// - New values appearing in future releases of the client library, **and**
38645    /// - New values received dynamically, without application changes.
38646    ///
38647    /// Please consult the [Working with enums] section in the user guide for some
38648    /// guidelines.
38649    ///
38650    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
38651    #[derive(Clone, Debug, PartialEq)]
38652    #[non_exhaustive]
38653    pub enum AutoUpgradePausedReason {
38654        /// AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED indicates an unspecified reason.
38655        Unspecified,
38656        /// MAINTENANCE_WINDOW indicates the cluster is outside customer maintenance
38657        /// window.
38658        MaintenanceWindow,
38659        /// MAINTENANCE_EXCLUSION_NO_UPGRADES indicates the cluster is in a
38660        /// maintenance exclusion with scope NO_UPGRADES.
38661        MaintenanceExclusionNoUpgrades,
38662        /// MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES indicates the cluster is in a
38663        /// maintenance exclusion with scope NO_MINOR_UPGRADES.
38664        MaintenanceExclusionNoMinorUpgrades,
38665        /// SYSTEM_CONFIG indicates the cluster upgrade is paused by system config.
38666        SystemConfig,
38667        /// If set, the enum was initialized with an unknown value.
38668        ///
38669        /// Applications can examine the value using [AutoUpgradePausedReason::value] or
38670        /// [AutoUpgradePausedReason::name].
38671        UnknownValue(auto_upgrade_paused_reason::UnknownValue),
38672    }
38673
38674    #[doc(hidden)]
38675    pub mod auto_upgrade_paused_reason {
38676        #[allow(unused_imports)]
38677        use super::*;
38678        #[derive(Clone, Debug, PartialEq)]
38679        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38680    }
38681
38682    impl AutoUpgradePausedReason {
38683        /// Gets the enum value.
38684        ///
38685        /// Returns `None` if the enum contains an unknown value deserialized from
38686        /// the string representation of enums.
38687        pub fn value(&self) -> std::option::Option<i32> {
38688            match self {
38689                Self::Unspecified => std::option::Option::Some(0),
38690                Self::MaintenanceWindow => std::option::Option::Some(1),
38691                Self::MaintenanceExclusionNoUpgrades => std::option::Option::Some(2),
38692                Self::MaintenanceExclusionNoMinorUpgrades => std::option::Option::Some(3),
38693                Self::SystemConfig => std::option::Option::Some(4),
38694                Self::UnknownValue(u) => u.0.value(),
38695            }
38696        }
38697
38698        /// Gets the enum value as a string.
38699        ///
38700        /// Returns `None` if the enum contains an unknown value deserialized from
38701        /// the integer representation of enums.
38702        pub fn name(&self) -> std::option::Option<&str> {
38703            match self {
38704                Self::Unspecified => {
38705                    std::option::Option::Some("AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED")
38706                }
38707                Self::MaintenanceWindow => std::option::Option::Some("MAINTENANCE_WINDOW"),
38708                Self::MaintenanceExclusionNoUpgrades => {
38709                    std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_UPGRADES")
38710                }
38711                Self::MaintenanceExclusionNoMinorUpgrades => {
38712                    std::option::Option::Some("MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES")
38713                }
38714                Self::SystemConfig => std::option::Option::Some("SYSTEM_CONFIG"),
38715                Self::UnknownValue(u) => u.0.name(),
38716            }
38717        }
38718    }
38719
38720    impl std::default::Default for AutoUpgradePausedReason {
38721        fn default() -> Self {
38722            use std::convert::From;
38723            Self::from(0)
38724        }
38725    }
38726
38727    impl std::fmt::Display for AutoUpgradePausedReason {
38728        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38729            wkt::internal::display_enum(f, self.name(), self.value())
38730        }
38731    }
38732
38733    impl std::convert::From<i32> for AutoUpgradePausedReason {
38734        fn from(value: i32) -> Self {
38735            match value {
38736                0 => Self::Unspecified,
38737                1 => Self::MaintenanceWindow,
38738                2 => Self::MaintenanceExclusionNoUpgrades,
38739                3 => Self::MaintenanceExclusionNoMinorUpgrades,
38740                4 => Self::SystemConfig,
38741                _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
38742                    wkt::internal::UnknownEnumValue::Integer(value),
38743                )),
38744            }
38745        }
38746    }
38747
38748    impl std::convert::From<&str> for AutoUpgradePausedReason {
38749        fn from(value: &str) -> Self {
38750            use std::string::ToString;
38751            match value {
38752                "AUTO_UPGRADE_PAUSED_REASON_UNSPECIFIED" => Self::Unspecified,
38753                "MAINTENANCE_WINDOW" => Self::MaintenanceWindow,
38754                "MAINTENANCE_EXCLUSION_NO_UPGRADES" => Self::MaintenanceExclusionNoUpgrades,
38755                "MAINTENANCE_EXCLUSION_NO_MINOR_UPGRADES" => {
38756                    Self::MaintenanceExclusionNoMinorUpgrades
38757                }
38758                "SYSTEM_CONFIG" => Self::SystemConfig,
38759                _ => Self::UnknownValue(auto_upgrade_paused_reason::UnknownValue(
38760                    wkt::internal::UnknownEnumValue::String(value.to_string()),
38761                )),
38762            }
38763        }
38764    }
38765
38766    impl serde::ser::Serialize for AutoUpgradePausedReason {
38767        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38768        where
38769            S: serde::Serializer,
38770        {
38771            match self {
38772                Self::Unspecified => serializer.serialize_i32(0),
38773                Self::MaintenanceWindow => serializer.serialize_i32(1),
38774                Self::MaintenanceExclusionNoUpgrades => serializer.serialize_i32(2),
38775                Self::MaintenanceExclusionNoMinorUpgrades => serializer.serialize_i32(3),
38776                Self::SystemConfig => serializer.serialize_i32(4),
38777                Self::UnknownValue(u) => u.0.serialize(serializer),
38778            }
38779        }
38780    }
38781
38782    impl<'de> serde::de::Deserialize<'de> for AutoUpgradePausedReason {
38783        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38784        where
38785            D: serde::Deserializer<'de>,
38786        {
38787            deserializer.deserialize_any(
38788                wkt::internal::EnumVisitor::<AutoUpgradePausedReason>::new(
38789                    ".google.container.v1.NodePoolUpgradeInfo.AutoUpgradePausedReason",
38790                ),
38791            )
38792        }
38793    }
38794}
38795
38796/// GkeAutoUpgradeConfig is the configuration for GKE auto upgrades.
38797#[derive(Clone, Default, PartialEq)]
38798#[non_exhaustive]
38799pub struct GkeAutoUpgradeConfig {
38800    /// PatchMode specifies how auto upgrade patch builds should be
38801    /// selected.
38802    pub patch_mode: crate::model::gke_auto_upgrade_config::PatchMode,
38803
38804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38805}
38806
38807impl GkeAutoUpgradeConfig {
38808    pub fn new() -> Self {
38809        std::default::Default::default()
38810    }
38811
38812    /// Sets the value of [patch_mode][crate::model::GkeAutoUpgradeConfig::patch_mode].
38813    ///
38814    /// # Example
38815    /// ```ignore,no_run
38816    /// # use google_cloud_container_v1::model::GkeAutoUpgradeConfig;
38817    /// use google_cloud_container_v1::model::gke_auto_upgrade_config::PatchMode;
38818    /// let x0 = GkeAutoUpgradeConfig::new().set_patch_mode(PatchMode::Accelerated);
38819    /// ```
38820    pub fn set_patch_mode<
38821        T: std::convert::Into<crate::model::gke_auto_upgrade_config::PatchMode>,
38822    >(
38823        mut self,
38824        v: T,
38825    ) -> Self {
38826        self.patch_mode = v.into();
38827        self
38828    }
38829}
38830
38831impl wkt::message::Message for GkeAutoUpgradeConfig {
38832    fn typename() -> &'static str {
38833        "type.googleapis.com/google.container.v1.GkeAutoUpgradeConfig"
38834    }
38835}
38836
38837/// Defines additional types related to [GkeAutoUpgradeConfig].
38838pub mod gke_auto_upgrade_config {
38839    #[allow(unused_imports)]
38840    use super::*;
38841
38842    /// PatchMode specifies how auto upgrade patch builds should be
38843    /// selected.
38844    ///
38845    /// # Working with unknown values
38846    ///
38847    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
38848    /// additional enum variants at any time. Adding new variants is not considered
38849    /// a breaking change. Applications should write their code in anticipation of:
38850    ///
38851    /// - New values appearing in future releases of the client library, **and**
38852    /// - New values received dynamically, without application changes.
38853    ///
38854    /// Please consult the [Working with enums] section in the user guide for some
38855    /// guidelines.
38856    ///
38857    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
38858    #[derive(Clone, Debug, PartialEq)]
38859    #[non_exhaustive]
38860    pub enum PatchMode {
38861        /// PATCH_MODE_UNSPECIFIED defaults to using the upgrade target from the
38862        /// channel's patch upgrade targets as the upgrade target for the
38863        /// version.
38864        Unspecified,
38865        /// ACCELERATED denotes that the latest patch build in the channel should be
38866        /// used as the upgrade target for the version.
38867        Accelerated,
38868        /// If set, the enum was initialized with an unknown value.
38869        ///
38870        /// Applications can examine the value using [PatchMode::value] or
38871        /// [PatchMode::name].
38872        UnknownValue(patch_mode::UnknownValue),
38873    }
38874
38875    #[doc(hidden)]
38876    pub mod patch_mode {
38877        #[allow(unused_imports)]
38878        use super::*;
38879        #[derive(Clone, Debug, PartialEq)]
38880        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38881    }
38882
38883    impl PatchMode {
38884        /// Gets the enum value.
38885        ///
38886        /// Returns `None` if the enum contains an unknown value deserialized from
38887        /// the string representation of enums.
38888        pub fn value(&self) -> std::option::Option<i32> {
38889            match self {
38890                Self::Unspecified => std::option::Option::Some(0),
38891                Self::Accelerated => std::option::Option::Some(1),
38892                Self::UnknownValue(u) => u.0.value(),
38893            }
38894        }
38895
38896        /// Gets the enum value as a string.
38897        ///
38898        /// Returns `None` if the enum contains an unknown value deserialized from
38899        /// the integer representation of enums.
38900        pub fn name(&self) -> std::option::Option<&str> {
38901            match self {
38902                Self::Unspecified => std::option::Option::Some("PATCH_MODE_UNSPECIFIED"),
38903                Self::Accelerated => std::option::Option::Some("ACCELERATED"),
38904                Self::UnknownValue(u) => u.0.name(),
38905            }
38906        }
38907    }
38908
38909    impl std::default::Default for PatchMode {
38910        fn default() -> Self {
38911            use std::convert::From;
38912            Self::from(0)
38913        }
38914    }
38915
38916    impl std::fmt::Display for PatchMode {
38917        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38918            wkt::internal::display_enum(f, self.name(), self.value())
38919        }
38920    }
38921
38922    impl std::convert::From<i32> for PatchMode {
38923        fn from(value: i32) -> Self {
38924            match value {
38925                0 => Self::Unspecified,
38926                1 => Self::Accelerated,
38927                _ => Self::UnknownValue(patch_mode::UnknownValue(
38928                    wkt::internal::UnknownEnumValue::Integer(value),
38929                )),
38930            }
38931        }
38932    }
38933
38934    impl std::convert::From<&str> for PatchMode {
38935        fn from(value: &str) -> Self {
38936            use std::string::ToString;
38937            match value {
38938                "PATCH_MODE_UNSPECIFIED" => Self::Unspecified,
38939                "ACCELERATED" => Self::Accelerated,
38940                _ => Self::UnknownValue(patch_mode::UnknownValue(
38941                    wkt::internal::UnknownEnumValue::String(value.to_string()),
38942                )),
38943            }
38944        }
38945    }
38946
38947    impl serde::ser::Serialize for PatchMode {
38948        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38949        where
38950            S: serde::Serializer,
38951        {
38952            match self {
38953                Self::Unspecified => serializer.serialize_i32(0),
38954                Self::Accelerated => serializer.serialize_i32(1),
38955                Self::UnknownValue(u) => u.0.serialize(serializer),
38956            }
38957        }
38958    }
38959
38960    impl<'de> serde::de::Deserialize<'de> for PatchMode {
38961        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38962        where
38963            D: serde::Deserializer<'de>,
38964        {
38965            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PatchMode>::new(
38966                ".google.container.v1.GkeAutoUpgradeConfig.PatchMode",
38967            ))
38968        }
38969    }
38970}
38971
38972/// NetworkTierConfig contains network tier information.
38973#[derive(Clone, Default, PartialEq)]
38974#[non_exhaustive]
38975pub struct NetworkTierConfig {
38976    /// Network tier configuration.
38977    pub network_tier: crate::model::network_tier_config::NetworkTier,
38978
38979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
38980}
38981
38982impl NetworkTierConfig {
38983    pub fn new() -> Self {
38984        std::default::Default::default()
38985    }
38986
38987    /// Sets the value of [network_tier][crate::model::NetworkTierConfig::network_tier].
38988    ///
38989    /// # Example
38990    /// ```ignore,no_run
38991    /// # use google_cloud_container_v1::model::NetworkTierConfig;
38992    /// use google_cloud_container_v1::model::network_tier_config::NetworkTier;
38993    /// let x0 = NetworkTierConfig::new().set_network_tier(NetworkTier::Default);
38994    /// let x1 = NetworkTierConfig::new().set_network_tier(NetworkTier::Premium);
38995    /// let x2 = NetworkTierConfig::new().set_network_tier(NetworkTier::Standard);
38996    /// ```
38997    pub fn set_network_tier<
38998        T: std::convert::Into<crate::model::network_tier_config::NetworkTier>,
38999    >(
39000        mut self,
39001        v: T,
39002    ) -> Self {
39003        self.network_tier = v.into();
39004        self
39005    }
39006}
39007
39008impl wkt::message::Message for NetworkTierConfig {
39009    fn typename() -> &'static str {
39010        "type.googleapis.com/google.container.v1.NetworkTierConfig"
39011    }
39012}
39013
39014/// Defines additional types related to [NetworkTierConfig].
39015pub mod network_tier_config {
39016    #[allow(unused_imports)]
39017    use super::*;
39018
39019    /// Network tier configuration.
39020    ///
39021    /// # Working with unknown values
39022    ///
39023    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39024    /// additional enum variants at any time. Adding new variants is not considered
39025    /// a breaking change. Applications should write their code in anticipation of:
39026    ///
39027    /// - New values appearing in future releases of the client library, **and**
39028    /// - New values received dynamically, without application changes.
39029    ///
39030    /// Please consult the [Working with enums] section in the user guide for some
39031    /// guidelines.
39032    ///
39033    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39034    #[derive(Clone, Debug, PartialEq)]
39035    #[non_exhaustive]
39036    pub enum NetworkTier {
39037        /// By default, use project-level configuration. When unspecified, the
39038        /// behavior defaults to NETWORK_TIER_DEFAULT. For cluster updates, this
39039        /// implies no action (no-op).
39040        Unspecified,
39041        /// Default network tier. Use project-level configuration. User can specify
39042        /// this value, meaning they want to keep the same behaviour as before
39043        /// cluster level network tier configuration is introduced. This field
39044        /// ensures backward compatibility for the network tier of cluster resources,
39045        /// such as node pools and load balancers, for their external IP addresses.
39046        Default,
39047        /// Premium network tier.
39048        Premium,
39049        /// Standard network tier.
39050        Standard,
39051        /// If set, the enum was initialized with an unknown value.
39052        ///
39053        /// Applications can examine the value using [NetworkTier::value] or
39054        /// [NetworkTier::name].
39055        UnknownValue(network_tier::UnknownValue),
39056    }
39057
39058    #[doc(hidden)]
39059    pub mod network_tier {
39060        #[allow(unused_imports)]
39061        use super::*;
39062        #[derive(Clone, Debug, PartialEq)]
39063        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39064    }
39065
39066    impl NetworkTier {
39067        /// Gets the enum value.
39068        ///
39069        /// Returns `None` if the enum contains an unknown value deserialized from
39070        /// the string representation of enums.
39071        pub fn value(&self) -> std::option::Option<i32> {
39072            match self {
39073                Self::Unspecified => std::option::Option::Some(0),
39074                Self::Default => std::option::Option::Some(1),
39075                Self::Premium => std::option::Option::Some(2),
39076                Self::Standard => std::option::Option::Some(3),
39077                Self::UnknownValue(u) => u.0.value(),
39078            }
39079        }
39080
39081        /// Gets the enum value as a string.
39082        ///
39083        /// Returns `None` if the enum contains an unknown value deserialized from
39084        /// the integer representation of enums.
39085        pub fn name(&self) -> std::option::Option<&str> {
39086            match self {
39087                Self::Unspecified => std::option::Option::Some("NETWORK_TIER_UNSPECIFIED"),
39088                Self::Default => std::option::Option::Some("NETWORK_TIER_DEFAULT"),
39089                Self::Premium => std::option::Option::Some("NETWORK_TIER_PREMIUM"),
39090                Self::Standard => std::option::Option::Some("NETWORK_TIER_STANDARD"),
39091                Self::UnknownValue(u) => u.0.name(),
39092            }
39093        }
39094    }
39095
39096    impl std::default::Default for NetworkTier {
39097        fn default() -> Self {
39098            use std::convert::From;
39099            Self::from(0)
39100        }
39101    }
39102
39103    impl std::fmt::Display for NetworkTier {
39104        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39105            wkt::internal::display_enum(f, self.name(), self.value())
39106        }
39107    }
39108
39109    impl std::convert::From<i32> for NetworkTier {
39110        fn from(value: i32) -> Self {
39111            match value {
39112                0 => Self::Unspecified,
39113                1 => Self::Default,
39114                2 => Self::Premium,
39115                3 => Self::Standard,
39116                _ => Self::UnknownValue(network_tier::UnknownValue(
39117                    wkt::internal::UnknownEnumValue::Integer(value),
39118                )),
39119            }
39120        }
39121    }
39122
39123    impl std::convert::From<&str> for NetworkTier {
39124        fn from(value: &str) -> Self {
39125            use std::string::ToString;
39126            match value {
39127                "NETWORK_TIER_UNSPECIFIED" => Self::Unspecified,
39128                "NETWORK_TIER_DEFAULT" => Self::Default,
39129                "NETWORK_TIER_PREMIUM" => Self::Premium,
39130                "NETWORK_TIER_STANDARD" => Self::Standard,
39131                _ => Self::UnknownValue(network_tier::UnknownValue(
39132                    wkt::internal::UnknownEnumValue::String(value.to_string()),
39133                )),
39134            }
39135        }
39136    }
39137
39138    impl serde::ser::Serialize for NetworkTier {
39139        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39140        where
39141            S: serde::Serializer,
39142        {
39143            match self {
39144                Self::Unspecified => serializer.serialize_i32(0),
39145                Self::Default => serializer.serialize_i32(1),
39146                Self::Premium => serializer.serialize_i32(2),
39147                Self::Standard => serializer.serialize_i32(3),
39148                Self::UnknownValue(u) => u.0.serialize(serializer),
39149            }
39150        }
39151    }
39152
39153    impl<'de> serde::de::Deserialize<'de> for NetworkTier {
39154        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39155        where
39156            D: serde::Deserializer<'de>,
39157        {
39158            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkTier>::new(
39159                ".google.container.v1.NetworkTierConfig.NetworkTier",
39160            ))
39161        }
39162    }
39163}
39164
39165/// PrivateIPv6GoogleAccess controls whether and how the pods can communicate
39166/// with Google Services through gRPC over IPv6.
39167///
39168/// # Working with unknown values
39169///
39170/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39171/// additional enum variants at any time. Adding new variants is not considered
39172/// a breaking change. Applications should write their code in anticipation of:
39173///
39174/// - New values appearing in future releases of the client library, **and**
39175/// - New values received dynamically, without application changes.
39176///
39177/// Please consult the [Working with enums] section in the user guide for some
39178/// guidelines.
39179///
39180/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39181#[derive(Clone, Debug, PartialEq)]
39182#[non_exhaustive]
39183pub enum PrivateIPv6GoogleAccess {
39184    /// Default value. Same as DISABLED
39185    PrivateIpv6GoogleAccessUnspecified,
39186    /// No private access to or from Google Services
39187    PrivateIpv6GoogleAccessDisabled,
39188    /// Enables private IPv6 access to Google Services from GKE
39189    PrivateIpv6GoogleAccessToGoogle,
39190    /// Enables private IPv6 access to and from Google Services
39191    PrivateIpv6GoogleAccessBidirectional,
39192    /// If set, the enum was initialized with an unknown value.
39193    ///
39194    /// Applications can examine the value using [PrivateIPv6GoogleAccess::value] or
39195    /// [PrivateIPv6GoogleAccess::name].
39196    UnknownValue(private_i_pv_6_google_access::UnknownValue),
39197}
39198
39199#[doc(hidden)]
39200pub mod private_i_pv_6_google_access {
39201    #[allow(unused_imports)]
39202    use super::*;
39203    #[derive(Clone, Debug, PartialEq)]
39204    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39205}
39206
39207impl PrivateIPv6GoogleAccess {
39208    /// Gets the enum value.
39209    ///
39210    /// Returns `None` if the enum contains an unknown value deserialized from
39211    /// the string representation of enums.
39212    pub fn value(&self) -> std::option::Option<i32> {
39213        match self {
39214            Self::PrivateIpv6GoogleAccessUnspecified => std::option::Option::Some(0),
39215            Self::PrivateIpv6GoogleAccessDisabled => std::option::Option::Some(1),
39216            Self::PrivateIpv6GoogleAccessToGoogle => std::option::Option::Some(2),
39217            Self::PrivateIpv6GoogleAccessBidirectional => std::option::Option::Some(3),
39218            Self::UnknownValue(u) => u.0.value(),
39219        }
39220    }
39221
39222    /// Gets the enum value as a string.
39223    ///
39224    /// Returns `None` if the enum contains an unknown value deserialized from
39225    /// the integer representation of enums.
39226    pub fn name(&self) -> std::option::Option<&str> {
39227        match self {
39228            Self::PrivateIpv6GoogleAccessUnspecified => {
39229                std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED")
39230            }
39231            Self::PrivateIpv6GoogleAccessDisabled => {
39232                std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED")
39233            }
39234            Self::PrivateIpv6GoogleAccessToGoogle => {
39235                std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE")
39236            }
39237            Self::PrivateIpv6GoogleAccessBidirectional => {
39238                std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL")
39239            }
39240            Self::UnknownValue(u) => u.0.name(),
39241        }
39242    }
39243}
39244
39245impl std::default::Default for PrivateIPv6GoogleAccess {
39246    fn default() -> Self {
39247        use std::convert::From;
39248        Self::from(0)
39249    }
39250}
39251
39252impl std::fmt::Display for PrivateIPv6GoogleAccess {
39253    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39254        wkt::internal::display_enum(f, self.name(), self.value())
39255    }
39256}
39257
39258impl std::convert::From<i32> for PrivateIPv6GoogleAccess {
39259    fn from(value: i32) -> Self {
39260        match value {
39261            0 => Self::PrivateIpv6GoogleAccessUnspecified,
39262            1 => Self::PrivateIpv6GoogleAccessDisabled,
39263            2 => Self::PrivateIpv6GoogleAccessToGoogle,
39264            3 => Self::PrivateIpv6GoogleAccessBidirectional,
39265            _ => Self::UnknownValue(private_i_pv_6_google_access::UnknownValue(
39266                wkt::internal::UnknownEnumValue::Integer(value),
39267            )),
39268        }
39269    }
39270}
39271
39272impl std::convert::From<&str> for PrivateIPv6GoogleAccess {
39273    fn from(value: &str) -> Self {
39274        use std::string::ToString;
39275        match value {
39276            "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => Self::PrivateIpv6GoogleAccessUnspecified,
39277            "PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED" => Self::PrivateIpv6GoogleAccessDisabled,
39278            "PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE" => Self::PrivateIpv6GoogleAccessToGoogle,
39279            "PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL" => {
39280                Self::PrivateIpv6GoogleAccessBidirectional
39281            }
39282            _ => Self::UnknownValue(private_i_pv_6_google_access::UnknownValue(
39283                wkt::internal::UnknownEnumValue::String(value.to_string()),
39284            )),
39285        }
39286    }
39287}
39288
39289impl serde::ser::Serialize for PrivateIPv6GoogleAccess {
39290    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39291    where
39292        S: serde::Serializer,
39293    {
39294        match self {
39295            Self::PrivateIpv6GoogleAccessUnspecified => serializer.serialize_i32(0),
39296            Self::PrivateIpv6GoogleAccessDisabled => serializer.serialize_i32(1),
39297            Self::PrivateIpv6GoogleAccessToGoogle => serializer.serialize_i32(2),
39298            Self::PrivateIpv6GoogleAccessBidirectional => serializer.serialize_i32(3),
39299            Self::UnknownValue(u) => u.0.serialize(serializer),
39300        }
39301    }
39302}
39303
39304impl<'de> serde::de::Deserialize<'de> for PrivateIPv6GoogleAccess {
39305    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39306    where
39307        D: serde::Deserializer<'de>,
39308    {
39309        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivateIPv6GoogleAccess>::new(
39310            ".google.container.v1.PrivateIPv6GoogleAccess",
39311        ))
39312    }
39313}
39314
39315/// UpgradeResourceType is the resource type that is upgrading. It is used
39316/// in upgrade notifications.
39317///
39318/// # Working with unknown values
39319///
39320/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39321/// additional enum variants at any time. Adding new variants is not considered
39322/// a breaking change. Applications should write their code in anticipation of:
39323///
39324/// - New values appearing in future releases of the client library, **and**
39325/// - New values received dynamically, without application changes.
39326///
39327/// Please consult the [Working with enums] section in the user guide for some
39328/// guidelines.
39329///
39330/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39331#[derive(Clone, Debug, PartialEq)]
39332#[non_exhaustive]
39333pub enum UpgradeResourceType {
39334    /// Default value. This shouldn't be used.
39335    Unspecified,
39336    /// Master / control plane
39337    Master,
39338    /// Node pool
39339    NodePool,
39340    /// If set, the enum was initialized with an unknown value.
39341    ///
39342    /// Applications can examine the value using [UpgradeResourceType::value] or
39343    /// [UpgradeResourceType::name].
39344    UnknownValue(upgrade_resource_type::UnknownValue),
39345}
39346
39347#[doc(hidden)]
39348pub mod upgrade_resource_type {
39349    #[allow(unused_imports)]
39350    use super::*;
39351    #[derive(Clone, Debug, PartialEq)]
39352    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39353}
39354
39355impl UpgradeResourceType {
39356    /// Gets the enum value.
39357    ///
39358    /// Returns `None` if the enum contains an unknown value deserialized from
39359    /// the string representation of enums.
39360    pub fn value(&self) -> std::option::Option<i32> {
39361        match self {
39362            Self::Unspecified => std::option::Option::Some(0),
39363            Self::Master => std::option::Option::Some(1),
39364            Self::NodePool => std::option::Option::Some(2),
39365            Self::UnknownValue(u) => u.0.value(),
39366        }
39367    }
39368
39369    /// Gets the enum value as a string.
39370    ///
39371    /// Returns `None` if the enum contains an unknown value deserialized from
39372    /// the integer representation of enums.
39373    pub fn name(&self) -> std::option::Option<&str> {
39374        match self {
39375            Self::Unspecified => std::option::Option::Some("UPGRADE_RESOURCE_TYPE_UNSPECIFIED"),
39376            Self::Master => std::option::Option::Some("MASTER"),
39377            Self::NodePool => std::option::Option::Some("NODE_POOL"),
39378            Self::UnknownValue(u) => u.0.name(),
39379        }
39380    }
39381}
39382
39383impl std::default::Default for UpgradeResourceType {
39384    fn default() -> Self {
39385        use std::convert::From;
39386        Self::from(0)
39387    }
39388}
39389
39390impl std::fmt::Display for UpgradeResourceType {
39391    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39392        wkt::internal::display_enum(f, self.name(), self.value())
39393    }
39394}
39395
39396impl std::convert::From<i32> for UpgradeResourceType {
39397    fn from(value: i32) -> Self {
39398        match value {
39399            0 => Self::Unspecified,
39400            1 => Self::Master,
39401            2 => Self::NodePool,
39402            _ => Self::UnknownValue(upgrade_resource_type::UnknownValue(
39403                wkt::internal::UnknownEnumValue::Integer(value),
39404            )),
39405        }
39406    }
39407}
39408
39409impl std::convert::From<&str> for UpgradeResourceType {
39410    fn from(value: &str) -> Self {
39411        use std::string::ToString;
39412        match value {
39413            "UPGRADE_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
39414            "MASTER" => Self::Master,
39415            "NODE_POOL" => Self::NodePool,
39416            _ => Self::UnknownValue(upgrade_resource_type::UnknownValue(
39417                wkt::internal::UnknownEnumValue::String(value.to_string()),
39418            )),
39419        }
39420    }
39421}
39422
39423impl serde::ser::Serialize for UpgradeResourceType {
39424    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39425    where
39426        S: serde::Serializer,
39427    {
39428        match self {
39429            Self::Unspecified => serializer.serialize_i32(0),
39430            Self::Master => serializer.serialize_i32(1),
39431            Self::NodePool => serializer.serialize_i32(2),
39432            Self::UnknownValue(u) => u.0.serialize(serializer),
39433        }
39434    }
39435}
39436
39437impl<'de> serde::de::Deserialize<'de> for UpgradeResourceType {
39438    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39439    where
39440        D: serde::Deserializer<'de>,
39441    {
39442        deserializer.deserialize_any(wkt::internal::EnumVisitor::<UpgradeResourceType>::new(
39443            ".google.container.v1.UpgradeResourceType",
39444        ))
39445    }
39446}
39447
39448/// The datapath provider selects the implementation of the Kubernetes networking
39449/// model for service resolution and network policy enforcement.
39450///
39451/// # Working with unknown values
39452///
39453/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39454/// additional enum variants at any time. Adding new variants is not considered
39455/// a breaking change. Applications should write their code in anticipation of:
39456///
39457/// - New values appearing in future releases of the client library, **and**
39458/// - New values received dynamically, without application changes.
39459///
39460/// Please consult the [Working with enums] section in the user guide for some
39461/// guidelines.
39462///
39463/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39464#[derive(Clone, Debug, PartialEq)]
39465#[non_exhaustive]
39466pub enum DatapathProvider {
39467    /// Default value.
39468    Unspecified,
39469    /// Use the IPTables implementation based on kube-proxy.
39470    LegacyDatapath,
39471    /// Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE
39472    /// Dataplane V2
39473    /// documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2)
39474    /// for more.
39475    AdvancedDatapath,
39476    /// If set, the enum was initialized with an unknown value.
39477    ///
39478    /// Applications can examine the value using [DatapathProvider::value] or
39479    /// [DatapathProvider::name].
39480    UnknownValue(datapath_provider::UnknownValue),
39481}
39482
39483#[doc(hidden)]
39484pub mod datapath_provider {
39485    #[allow(unused_imports)]
39486    use super::*;
39487    #[derive(Clone, Debug, PartialEq)]
39488    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39489}
39490
39491impl DatapathProvider {
39492    /// Gets the enum value.
39493    ///
39494    /// Returns `None` if the enum contains an unknown value deserialized from
39495    /// the string representation of enums.
39496    pub fn value(&self) -> std::option::Option<i32> {
39497        match self {
39498            Self::Unspecified => std::option::Option::Some(0),
39499            Self::LegacyDatapath => std::option::Option::Some(1),
39500            Self::AdvancedDatapath => std::option::Option::Some(2),
39501            Self::UnknownValue(u) => u.0.value(),
39502        }
39503    }
39504
39505    /// Gets the enum value as a string.
39506    ///
39507    /// Returns `None` if the enum contains an unknown value deserialized from
39508    /// the integer representation of enums.
39509    pub fn name(&self) -> std::option::Option<&str> {
39510        match self {
39511            Self::Unspecified => std::option::Option::Some("DATAPATH_PROVIDER_UNSPECIFIED"),
39512            Self::LegacyDatapath => std::option::Option::Some("LEGACY_DATAPATH"),
39513            Self::AdvancedDatapath => std::option::Option::Some("ADVANCED_DATAPATH"),
39514            Self::UnknownValue(u) => u.0.name(),
39515        }
39516    }
39517}
39518
39519impl std::default::Default for DatapathProvider {
39520    fn default() -> Self {
39521        use std::convert::From;
39522        Self::from(0)
39523    }
39524}
39525
39526impl std::fmt::Display for DatapathProvider {
39527    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39528        wkt::internal::display_enum(f, self.name(), self.value())
39529    }
39530}
39531
39532impl std::convert::From<i32> for DatapathProvider {
39533    fn from(value: i32) -> Self {
39534        match value {
39535            0 => Self::Unspecified,
39536            1 => Self::LegacyDatapath,
39537            2 => Self::AdvancedDatapath,
39538            _ => Self::UnknownValue(datapath_provider::UnknownValue(
39539                wkt::internal::UnknownEnumValue::Integer(value),
39540            )),
39541        }
39542    }
39543}
39544
39545impl std::convert::From<&str> for DatapathProvider {
39546    fn from(value: &str) -> Self {
39547        use std::string::ToString;
39548        match value {
39549            "DATAPATH_PROVIDER_UNSPECIFIED" => Self::Unspecified,
39550            "LEGACY_DATAPATH" => Self::LegacyDatapath,
39551            "ADVANCED_DATAPATH" => Self::AdvancedDatapath,
39552            _ => Self::UnknownValue(datapath_provider::UnknownValue(
39553                wkt::internal::UnknownEnumValue::String(value.to_string()),
39554            )),
39555        }
39556    }
39557}
39558
39559impl serde::ser::Serialize for DatapathProvider {
39560    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39561    where
39562        S: serde::Serializer,
39563    {
39564        match self {
39565            Self::Unspecified => serializer.serialize_i32(0),
39566            Self::LegacyDatapath => serializer.serialize_i32(1),
39567            Self::AdvancedDatapath => serializer.serialize_i32(2),
39568            Self::UnknownValue(u) => u.0.serialize(serializer),
39569        }
39570    }
39571}
39572
39573impl<'de> serde::de::Deserialize<'de> for DatapathProvider {
39574    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39575    where
39576        D: serde::Deserializer<'de>,
39577    {
39578        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatapathProvider>::new(
39579            ".google.container.v1.DatapathProvider",
39580        ))
39581    }
39582}
39583
39584/// Strategy used for node pool update.
39585///
39586/// # Working with unknown values
39587///
39588/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39589/// additional enum variants at any time. Adding new variants is not considered
39590/// a breaking change. Applications should write their code in anticipation of:
39591///
39592/// - New values appearing in future releases of the client library, **and**
39593/// - New values received dynamically, without application changes.
39594///
39595/// Please consult the [Working with enums] section in the user guide for some
39596/// guidelines.
39597///
39598/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39599#[derive(Clone, Debug, PartialEq)]
39600#[non_exhaustive]
39601pub enum NodePoolUpdateStrategy {
39602    /// Default value if unset. GKE internally defaults the update strategy to
39603    /// SURGE for unspecified strategies.
39604    Unspecified,
39605    /// blue-green upgrade.
39606    BlueGreen,
39607    /// SURGE is the traditional way of upgrade a node pool.
39608    /// max_surge and max_unavailable determines the level of upgrade parallelism.
39609    Surge,
39610    /// If set, the enum was initialized with an unknown value.
39611    ///
39612    /// Applications can examine the value using [NodePoolUpdateStrategy::value] or
39613    /// [NodePoolUpdateStrategy::name].
39614    UnknownValue(node_pool_update_strategy::UnknownValue),
39615}
39616
39617#[doc(hidden)]
39618pub mod node_pool_update_strategy {
39619    #[allow(unused_imports)]
39620    use super::*;
39621    #[derive(Clone, Debug, PartialEq)]
39622    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39623}
39624
39625impl NodePoolUpdateStrategy {
39626    /// Gets the enum value.
39627    ///
39628    /// Returns `None` if the enum contains an unknown value deserialized from
39629    /// the string representation of enums.
39630    pub fn value(&self) -> std::option::Option<i32> {
39631        match self {
39632            Self::Unspecified => std::option::Option::Some(0),
39633            Self::BlueGreen => std::option::Option::Some(2),
39634            Self::Surge => std::option::Option::Some(3),
39635            Self::UnknownValue(u) => u.0.value(),
39636        }
39637    }
39638
39639    /// Gets the enum value as a string.
39640    ///
39641    /// Returns `None` if the enum contains an unknown value deserialized from
39642    /// the integer representation of enums.
39643    pub fn name(&self) -> std::option::Option<&str> {
39644        match self {
39645            Self::Unspecified => std::option::Option::Some("NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED"),
39646            Self::BlueGreen => std::option::Option::Some("BLUE_GREEN"),
39647            Self::Surge => std::option::Option::Some("SURGE"),
39648            Self::UnknownValue(u) => u.0.name(),
39649        }
39650    }
39651}
39652
39653impl std::default::Default for NodePoolUpdateStrategy {
39654    fn default() -> Self {
39655        use std::convert::From;
39656        Self::from(0)
39657    }
39658}
39659
39660impl std::fmt::Display for NodePoolUpdateStrategy {
39661    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39662        wkt::internal::display_enum(f, self.name(), self.value())
39663    }
39664}
39665
39666impl std::convert::From<i32> for NodePoolUpdateStrategy {
39667    fn from(value: i32) -> Self {
39668        match value {
39669            0 => Self::Unspecified,
39670            2 => Self::BlueGreen,
39671            3 => Self::Surge,
39672            _ => Self::UnknownValue(node_pool_update_strategy::UnknownValue(
39673                wkt::internal::UnknownEnumValue::Integer(value),
39674            )),
39675        }
39676    }
39677}
39678
39679impl std::convert::From<&str> for NodePoolUpdateStrategy {
39680    fn from(value: &str) -> Self {
39681        use std::string::ToString;
39682        match value {
39683            "NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED" => Self::Unspecified,
39684            "BLUE_GREEN" => Self::BlueGreen,
39685            "SURGE" => Self::Surge,
39686            _ => Self::UnknownValue(node_pool_update_strategy::UnknownValue(
39687                wkt::internal::UnknownEnumValue::String(value.to_string()),
39688            )),
39689        }
39690    }
39691}
39692
39693impl serde::ser::Serialize for NodePoolUpdateStrategy {
39694    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39695    where
39696        S: serde::Serializer,
39697    {
39698        match self {
39699            Self::Unspecified => serializer.serialize_i32(0),
39700            Self::BlueGreen => serializer.serialize_i32(2),
39701            Self::Surge => serializer.serialize_i32(3),
39702            Self::UnknownValue(u) => u.0.serialize(serializer),
39703        }
39704    }
39705}
39706
39707impl<'de> serde::de::Deserialize<'de> for NodePoolUpdateStrategy {
39708    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39709    where
39710        D: serde::Deserializer<'de>,
39711    {
39712        deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodePoolUpdateStrategy>::new(
39713            ".google.container.v1.NodePoolUpdateStrategy",
39714        ))
39715    }
39716}
39717
39718/// Possible values for IP stack type
39719///
39720/// # Working with unknown values
39721///
39722/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39723/// additional enum variants at any time. Adding new variants is not considered
39724/// a breaking change. Applications should write their code in anticipation of:
39725///
39726/// - New values appearing in future releases of the client library, **and**
39727/// - New values received dynamically, without application changes.
39728///
39729/// Please consult the [Working with enums] section in the user guide for some
39730/// guidelines.
39731///
39732/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39733#[derive(Clone, Debug, PartialEq)]
39734#[non_exhaustive]
39735pub enum StackType {
39736    /// Default value, will be defaulted as IPV4 only
39737    Unspecified,
39738    /// Cluster is IPV4 only
39739    Ipv4,
39740    /// Cluster can use both IPv4 and IPv6
39741    Ipv4Ipv6,
39742    /// If set, the enum was initialized with an unknown value.
39743    ///
39744    /// Applications can examine the value using [StackType::value] or
39745    /// [StackType::name].
39746    UnknownValue(stack_type::UnknownValue),
39747}
39748
39749#[doc(hidden)]
39750pub mod stack_type {
39751    #[allow(unused_imports)]
39752    use super::*;
39753    #[derive(Clone, Debug, PartialEq)]
39754    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39755}
39756
39757impl StackType {
39758    /// Gets the enum value.
39759    ///
39760    /// Returns `None` if the enum contains an unknown value deserialized from
39761    /// the string representation of enums.
39762    pub fn value(&self) -> std::option::Option<i32> {
39763        match self {
39764            Self::Unspecified => std::option::Option::Some(0),
39765            Self::Ipv4 => std::option::Option::Some(1),
39766            Self::Ipv4Ipv6 => std::option::Option::Some(2),
39767            Self::UnknownValue(u) => u.0.value(),
39768        }
39769    }
39770
39771    /// Gets the enum value as a string.
39772    ///
39773    /// Returns `None` if the enum contains an unknown value deserialized from
39774    /// the integer representation of enums.
39775    pub fn name(&self) -> std::option::Option<&str> {
39776        match self {
39777            Self::Unspecified => std::option::Option::Some("STACK_TYPE_UNSPECIFIED"),
39778            Self::Ipv4 => std::option::Option::Some("IPV4"),
39779            Self::Ipv4Ipv6 => std::option::Option::Some("IPV4_IPV6"),
39780            Self::UnknownValue(u) => u.0.name(),
39781        }
39782    }
39783}
39784
39785impl std::default::Default for StackType {
39786    fn default() -> Self {
39787        use std::convert::From;
39788        Self::from(0)
39789    }
39790}
39791
39792impl std::fmt::Display for StackType {
39793    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39794        wkt::internal::display_enum(f, self.name(), self.value())
39795    }
39796}
39797
39798impl std::convert::From<i32> for StackType {
39799    fn from(value: i32) -> Self {
39800        match value {
39801            0 => Self::Unspecified,
39802            1 => Self::Ipv4,
39803            2 => Self::Ipv4Ipv6,
39804            _ => Self::UnknownValue(stack_type::UnknownValue(
39805                wkt::internal::UnknownEnumValue::Integer(value),
39806            )),
39807        }
39808    }
39809}
39810
39811impl std::convert::From<&str> for StackType {
39812    fn from(value: &str) -> Self {
39813        use std::string::ToString;
39814        match value {
39815            "STACK_TYPE_UNSPECIFIED" => Self::Unspecified,
39816            "IPV4" => Self::Ipv4,
39817            "IPV4_IPV6" => Self::Ipv4Ipv6,
39818            _ => Self::UnknownValue(stack_type::UnknownValue(
39819                wkt::internal::UnknownEnumValue::String(value.to_string()),
39820            )),
39821        }
39822    }
39823}
39824
39825impl serde::ser::Serialize for StackType {
39826    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39827    where
39828        S: serde::Serializer,
39829    {
39830        match self {
39831            Self::Unspecified => serializer.serialize_i32(0),
39832            Self::Ipv4 => serializer.serialize_i32(1),
39833            Self::Ipv4Ipv6 => serializer.serialize_i32(2),
39834            Self::UnknownValue(u) => u.0.serialize(serializer),
39835        }
39836    }
39837}
39838
39839impl<'de> serde::de::Deserialize<'de> for StackType {
39840    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39841    where
39842        D: serde::Deserializer<'de>,
39843    {
39844        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StackType>::new(
39845            ".google.container.v1.StackType",
39846        ))
39847    }
39848}
39849
39850/// Possible values for IPv6 access type
39851///
39852/// # Working with unknown values
39853///
39854/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39855/// additional enum variants at any time. Adding new variants is not considered
39856/// a breaking change. Applications should write their code in anticipation of:
39857///
39858/// - New values appearing in future releases of the client library, **and**
39859/// - New values received dynamically, without application changes.
39860///
39861/// Please consult the [Working with enums] section in the user guide for some
39862/// guidelines.
39863///
39864/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39865#[derive(Clone, Debug, PartialEq)]
39866#[non_exhaustive]
39867pub enum IPv6AccessType {
39868    /// Default value, will be defaulted as type external.
39869    Ipv6AccessTypeUnspecified,
39870    /// Access type internal (all v6 addresses are internal IPs)
39871    Internal,
39872    /// Access type external (all v6 addresses are external IPs)
39873    External,
39874    /// If set, the enum was initialized with an unknown value.
39875    ///
39876    /// Applications can examine the value using [IPv6AccessType::value] or
39877    /// [IPv6AccessType::name].
39878    UnknownValue(i_pv_6_access_type::UnknownValue),
39879}
39880
39881#[doc(hidden)]
39882pub mod i_pv_6_access_type {
39883    #[allow(unused_imports)]
39884    use super::*;
39885    #[derive(Clone, Debug, PartialEq)]
39886    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
39887}
39888
39889impl IPv6AccessType {
39890    /// Gets the enum value.
39891    ///
39892    /// Returns `None` if the enum contains an unknown value deserialized from
39893    /// the string representation of enums.
39894    pub fn value(&self) -> std::option::Option<i32> {
39895        match self {
39896            Self::Ipv6AccessTypeUnspecified => std::option::Option::Some(0),
39897            Self::Internal => std::option::Option::Some(1),
39898            Self::External => std::option::Option::Some(2),
39899            Self::UnknownValue(u) => u.0.value(),
39900        }
39901    }
39902
39903    /// Gets the enum value as a string.
39904    ///
39905    /// Returns `None` if the enum contains an unknown value deserialized from
39906    /// the integer representation of enums.
39907    pub fn name(&self) -> std::option::Option<&str> {
39908        match self {
39909            Self::Ipv6AccessTypeUnspecified => {
39910                std::option::Option::Some("IPV6_ACCESS_TYPE_UNSPECIFIED")
39911            }
39912            Self::Internal => std::option::Option::Some("INTERNAL"),
39913            Self::External => std::option::Option::Some("EXTERNAL"),
39914            Self::UnknownValue(u) => u.0.name(),
39915        }
39916    }
39917}
39918
39919impl std::default::Default for IPv6AccessType {
39920    fn default() -> Self {
39921        use std::convert::From;
39922        Self::from(0)
39923    }
39924}
39925
39926impl std::fmt::Display for IPv6AccessType {
39927    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
39928        wkt::internal::display_enum(f, self.name(), self.value())
39929    }
39930}
39931
39932impl std::convert::From<i32> for IPv6AccessType {
39933    fn from(value: i32) -> Self {
39934        match value {
39935            0 => Self::Ipv6AccessTypeUnspecified,
39936            1 => Self::Internal,
39937            2 => Self::External,
39938            _ => Self::UnknownValue(i_pv_6_access_type::UnknownValue(
39939                wkt::internal::UnknownEnumValue::Integer(value),
39940            )),
39941        }
39942    }
39943}
39944
39945impl std::convert::From<&str> for IPv6AccessType {
39946    fn from(value: &str) -> Self {
39947        use std::string::ToString;
39948        match value {
39949            "IPV6_ACCESS_TYPE_UNSPECIFIED" => Self::Ipv6AccessTypeUnspecified,
39950            "INTERNAL" => Self::Internal,
39951            "EXTERNAL" => Self::External,
39952            _ => Self::UnknownValue(i_pv_6_access_type::UnknownValue(
39953                wkt::internal::UnknownEnumValue::String(value.to_string()),
39954            )),
39955        }
39956    }
39957}
39958
39959impl serde::ser::Serialize for IPv6AccessType {
39960    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
39961    where
39962        S: serde::Serializer,
39963    {
39964        match self {
39965            Self::Ipv6AccessTypeUnspecified => serializer.serialize_i32(0),
39966            Self::Internal => serializer.serialize_i32(1),
39967            Self::External => serializer.serialize_i32(2),
39968            Self::UnknownValue(u) => u.0.serialize(serializer),
39969        }
39970    }
39971}
39972
39973impl<'de> serde::de::Deserialize<'de> for IPv6AccessType {
39974    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
39975    where
39976        D: serde::Deserializer<'de>,
39977    {
39978        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPv6AccessType>::new(
39979            ".google.container.v1.IPv6AccessType",
39980        ))
39981    }
39982}
39983
39984/// Options for in-transit encryption.
39985///
39986/// # Working with unknown values
39987///
39988/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
39989/// additional enum variants at any time. Adding new variants is not considered
39990/// a breaking change. Applications should write their code in anticipation of:
39991///
39992/// - New values appearing in future releases of the client library, **and**
39993/// - New values received dynamically, without application changes.
39994///
39995/// Please consult the [Working with enums] section in the user guide for some
39996/// guidelines.
39997///
39998/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
39999#[derive(Clone, Debug, PartialEq)]
40000#[non_exhaustive]
40001pub enum InTransitEncryptionConfig {
40002    /// Unspecified, will be inferred as default -
40003    /// IN_TRANSIT_ENCRYPTION_UNSPECIFIED.
40004    Unspecified,
40005    /// In-transit encryption is disabled.
40006    InTransitEncryptionDisabled,
40007    /// Data in-transit is encrypted using inter-node transparent encryption.
40008    InTransitEncryptionInterNodeTransparent,
40009    /// If set, the enum was initialized with an unknown value.
40010    ///
40011    /// Applications can examine the value using [InTransitEncryptionConfig::value] or
40012    /// [InTransitEncryptionConfig::name].
40013    UnknownValue(in_transit_encryption_config::UnknownValue),
40014}
40015
40016#[doc(hidden)]
40017pub mod in_transit_encryption_config {
40018    #[allow(unused_imports)]
40019    use super::*;
40020    #[derive(Clone, Debug, PartialEq)]
40021    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
40022}
40023
40024impl InTransitEncryptionConfig {
40025    /// Gets the enum value.
40026    ///
40027    /// Returns `None` if the enum contains an unknown value deserialized from
40028    /// the string representation of enums.
40029    pub fn value(&self) -> std::option::Option<i32> {
40030        match self {
40031            Self::Unspecified => std::option::Option::Some(0),
40032            Self::InTransitEncryptionDisabled => std::option::Option::Some(1),
40033            Self::InTransitEncryptionInterNodeTransparent => std::option::Option::Some(2),
40034            Self::UnknownValue(u) => u.0.value(),
40035        }
40036    }
40037
40038    /// Gets the enum value as a string.
40039    ///
40040    /// Returns `None` if the enum contains an unknown value deserialized from
40041    /// the integer representation of enums.
40042    pub fn name(&self) -> std::option::Option<&str> {
40043        match self {
40044            Self::Unspecified => {
40045                std::option::Option::Some("IN_TRANSIT_ENCRYPTION_CONFIG_UNSPECIFIED")
40046            }
40047            Self::InTransitEncryptionDisabled => {
40048                std::option::Option::Some("IN_TRANSIT_ENCRYPTION_DISABLED")
40049            }
40050            Self::InTransitEncryptionInterNodeTransparent => {
40051                std::option::Option::Some("IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT")
40052            }
40053            Self::UnknownValue(u) => u.0.name(),
40054        }
40055    }
40056}
40057
40058impl std::default::Default for InTransitEncryptionConfig {
40059    fn default() -> Self {
40060        use std::convert::From;
40061        Self::from(0)
40062    }
40063}
40064
40065impl std::fmt::Display for InTransitEncryptionConfig {
40066    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
40067        wkt::internal::display_enum(f, self.name(), self.value())
40068    }
40069}
40070
40071impl std::convert::From<i32> for InTransitEncryptionConfig {
40072    fn from(value: i32) -> Self {
40073        match value {
40074            0 => Self::Unspecified,
40075            1 => Self::InTransitEncryptionDisabled,
40076            2 => Self::InTransitEncryptionInterNodeTransparent,
40077            _ => Self::UnknownValue(in_transit_encryption_config::UnknownValue(
40078                wkt::internal::UnknownEnumValue::Integer(value),
40079            )),
40080        }
40081    }
40082}
40083
40084impl std::convert::From<&str> for InTransitEncryptionConfig {
40085    fn from(value: &str) -> Self {
40086        use std::string::ToString;
40087        match value {
40088            "IN_TRANSIT_ENCRYPTION_CONFIG_UNSPECIFIED" => Self::Unspecified,
40089            "IN_TRANSIT_ENCRYPTION_DISABLED" => Self::InTransitEncryptionDisabled,
40090            "IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT" => {
40091                Self::InTransitEncryptionInterNodeTransparent
40092            }
40093            _ => Self::UnknownValue(in_transit_encryption_config::UnknownValue(
40094                wkt::internal::UnknownEnumValue::String(value.to_string()),
40095            )),
40096        }
40097    }
40098}
40099
40100impl serde::ser::Serialize for InTransitEncryptionConfig {
40101    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
40102    where
40103        S: serde::Serializer,
40104    {
40105        match self {
40106            Self::Unspecified => serializer.serialize_i32(0),
40107            Self::InTransitEncryptionDisabled => serializer.serialize_i32(1),
40108            Self::InTransitEncryptionInterNodeTransparent => serializer.serialize_i32(2),
40109            Self::UnknownValue(u) => u.0.serialize(serializer),
40110        }
40111    }
40112}
40113
40114impl<'de> serde::de::Deserialize<'de> for InTransitEncryptionConfig {
40115    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
40116    where
40117        D: serde::Deserializer<'de>,
40118    {
40119        deserializer.deserialize_any(
40120            wkt::internal::EnumVisitor::<InTransitEncryptionConfig>::new(
40121                ".google.container.v1.InTransitEncryptionConfig",
40122            ),
40123        )
40124    }
40125}