google_cloud_container_v1/
builder.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
17pub mod cluster_manager {
18    use crate::Result;
19
20    /// A builder for [ClusterManager][crate::client::ClusterManager].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_container_v1::*;
25    /// # use builder::cluster_manager::ClientBuilder;
26    /// # use client::ClusterManager;
27    /// let builder : ClientBuilder = ClusterManager::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://container.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::ClusterManager;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = ClusterManager;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::ClusterManager] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [ClusterManager::list_clusters][crate::client::ClusterManager::list_clusters] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_container_v1::builder;
79    /// use builder::cluster_manager::ListClusters;
80    /// # tokio_test::block_on(async {
81    ///
82    /// let builder = prepare_request_builder();
83    /// let response = builder.send().await?;
84    /// # gax::Result::<()>::Ok(()) });
85    ///
86    /// fn prepare_request_builder() -> ListClusters {
87    ///   # panic!();
88    ///   // ... details omitted ...
89    /// }
90    /// ```
91    #[derive(Clone, Debug)]
92    pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
93
94    impl ListClusters {
95        pub(crate) fn new(
96            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
97        ) -> Self {
98            Self(RequestBuilder::new(stub))
99        }
100
101        /// Sets the full request, replacing any prior values.
102        pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
103            self.0.request = v.into();
104            self
105        }
106
107        /// Sets all the options, replacing any prior values.
108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109            self.0.options = v.into();
110            self
111        }
112
113        /// Sends the request.
114        pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
115            (*self.0.stub)
116                .list_clusters(self.0.request, self.0.options)
117                .await
118                .map(gax::response::Response::into_body)
119        }
120
121        /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
122        #[deprecated]
123        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
124            self.0.request.project_id = v.into();
125            self
126        }
127
128        /// Sets the value of [zone][crate::model::ListClustersRequest::zone].
129        #[deprecated]
130        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
131            self.0.request.zone = v.into();
132            self
133        }
134
135        /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
136        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
137            self.0.request.parent = v.into();
138            self
139        }
140    }
141
142    #[doc(hidden)]
143    impl gax::options::internal::RequestBuilder for ListClusters {
144        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
145            &mut self.0.options
146        }
147    }
148
149    /// The request builder for [ClusterManager::get_cluster][crate::client::ClusterManager::get_cluster] calls.
150    ///
151    /// # Example
152    /// ```no_run
153    /// # use google_cloud_container_v1::builder;
154    /// use builder::cluster_manager::GetCluster;
155    /// # tokio_test::block_on(async {
156    ///
157    /// let builder = prepare_request_builder();
158    /// let response = builder.send().await?;
159    /// # gax::Result::<()>::Ok(()) });
160    ///
161    /// fn prepare_request_builder() -> GetCluster {
162    ///   # panic!();
163    ///   // ... details omitted ...
164    /// }
165    /// ```
166    #[derive(Clone, Debug)]
167    pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
168
169    impl GetCluster {
170        pub(crate) fn new(
171            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
172        ) -> Self {
173            Self(RequestBuilder::new(stub))
174        }
175
176        /// Sets the full request, replacing any prior values.
177        pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
178            self.0.request = v.into();
179            self
180        }
181
182        /// Sets all the options, replacing any prior values.
183        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
184            self.0.options = v.into();
185            self
186        }
187
188        /// Sends the request.
189        pub async fn send(self) -> Result<crate::model::Cluster> {
190            (*self.0.stub)
191                .get_cluster(self.0.request, self.0.options)
192                .await
193                .map(gax::response::Response::into_body)
194        }
195
196        /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
197        #[deprecated]
198        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
199            self.0.request.project_id = v.into();
200            self
201        }
202
203        /// Sets the value of [zone][crate::model::GetClusterRequest::zone].
204        #[deprecated]
205        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
206            self.0.request.zone = v.into();
207            self
208        }
209
210        /// Sets the value of [cluster_id][crate::model::GetClusterRequest::cluster_id].
211        #[deprecated]
212        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
213            self.0.request.cluster_id = v.into();
214            self
215        }
216
217        /// Sets the value of [name][crate::model::GetClusterRequest::name].
218        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
219            self.0.request.name = v.into();
220            self
221        }
222    }
223
224    #[doc(hidden)]
225    impl gax::options::internal::RequestBuilder for GetCluster {
226        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
227            &mut self.0.options
228        }
229    }
230
231    /// The request builder for [ClusterManager::create_cluster][crate::client::ClusterManager::create_cluster] calls.
232    ///
233    /// # Example
234    /// ```no_run
235    /// # use google_cloud_container_v1::builder;
236    /// use builder::cluster_manager::CreateCluster;
237    /// # tokio_test::block_on(async {
238    ///
239    /// let builder = prepare_request_builder();
240    /// let response = builder.send().await?;
241    /// # gax::Result::<()>::Ok(()) });
242    ///
243    /// fn prepare_request_builder() -> CreateCluster {
244    ///   # panic!();
245    ///   // ... details omitted ...
246    /// }
247    /// ```
248    #[derive(Clone, Debug)]
249    pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
250
251    impl CreateCluster {
252        pub(crate) fn new(
253            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
254        ) -> Self {
255            Self(RequestBuilder::new(stub))
256        }
257
258        /// Sets the full request, replacing any prior values.
259        pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
260            self.0.request = v.into();
261            self
262        }
263
264        /// Sets all the options, replacing any prior values.
265        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
266            self.0.options = v.into();
267            self
268        }
269
270        /// Sends the request.
271        pub async fn send(self) -> Result<crate::model::Operation> {
272            (*self.0.stub)
273                .create_cluster(self.0.request, self.0.options)
274                .await
275                .map(gax::response::Response::into_body)
276        }
277
278        /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
279        #[deprecated]
280        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
281            self.0.request.project_id = v.into();
282            self
283        }
284
285        /// Sets the value of [zone][crate::model::CreateClusterRequest::zone].
286        #[deprecated]
287        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
288            self.0.request.zone = v.into();
289            self
290        }
291
292        /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
293        ///
294        /// This is a **required** field for requests.
295        pub fn set_cluster<T>(mut self, v: T) -> Self
296        where
297            T: std::convert::Into<crate::model::Cluster>,
298        {
299            self.0.request.cluster = std::option::Option::Some(v.into());
300            self
301        }
302
303        /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
304        ///
305        /// This is a **required** field for requests.
306        pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
307        where
308            T: std::convert::Into<crate::model::Cluster>,
309        {
310            self.0.request.cluster = v.map(|x| x.into());
311            self
312        }
313
314        /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
315        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
316            self.0.request.parent = v.into();
317            self
318        }
319    }
320
321    #[doc(hidden)]
322    impl gax::options::internal::RequestBuilder for CreateCluster {
323        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
324            &mut self.0.options
325        }
326    }
327
328    /// The request builder for [ClusterManager::update_cluster][crate::client::ClusterManager::update_cluster] calls.
329    ///
330    /// # Example
331    /// ```no_run
332    /// # use google_cloud_container_v1::builder;
333    /// use builder::cluster_manager::UpdateCluster;
334    /// # tokio_test::block_on(async {
335    ///
336    /// let builder = prepare_request_builder();
337    /// let response = builder.send().await?;
338    /// # gax::Result::<()>::Ok(()) });
339    ///
340    /// fn prepare_request_builder() -> UpdateCluster {
341    ///   # panic!();
342    ///   // ... details omitted ...
343    /// }
344    /// ```
345    #[derive(Clone, Debug)]
346    pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
347
348    impl UpdateCluster {
349        pub(crate) fn new(
350            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
351        ) -> Self {
352            Self(RequestBuilder::new(stub))
353        }
354
355        /// Sets the full request, replacing any prior values.
356        pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
357            self.0.request = v.into();
358            self
359        }
360
361        /// Sets all the options, replacing any prior values.
362        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
363            self.0.options = v.into();
364            self
365        }
366
367        /// Sends the request.
368        pub async fn send(self) -> Result<crate::model::Operation> {
369            (*self.0.stub)
370                .update_cluster(self.0.request, self.0.options)
371                .await
372                .map(gax::response::Response::into_body)
373        }
374
375        /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
376        #[deprecated]
377        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.project_id = v.into();
379            self
380        }
381
382        /// Sets the value of [zone][crate::model::UpdateClusterRequest::zone].
383        #[deprecated]
384        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
385            self.0.request.zone = v.into();
386            self
387        }
388
389        /// Sets the value of [cluster_id][crate::model::UpdateClusterRequest::cluster_id].
390        #[deprecated]
391        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
392            self.0.request.cluster_id = v.into();
393            self
394        }
395
396        /// Sets the value of [update][crate::model::UpdateClusterRequest::update].
397        ///
398        /// This is a **required** field for requests.
399        pub fn set_update<T>(mut self, v: T) -> Self
400        where
401            T: std::convert::Into<crate::model::ClusterUpdate>,
402        {
403            self.0.request.update = std::option::Option::Some(v.into());
404            self
405        }
406
407        /// Sets or clears the value of [update][crate::model::UpdateClusterRequest::update].
408        ///
409        /// This is a **required** field for requests.
410        pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
411        where
412            T: std::convert::Into<crate::model::ClusterUpdate>,
413        {
414            self.0.request.update = v.map(|x| x.into());
415            self
416        }
417
418        /// Sets the value of [name][crate::model::UpdateClusterRequest::name].
419        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
420            self.0.request.name = v.into();
421            self
422        }
423    }
424
425    #[doc(hidden)]
426    impl gax::options::internal::RequestBuilder for UpdateCluster {
427        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
428            &mut self.0.options
429        }
430    }
431
432    /// The request builder for [ClusterManager::update_node_pool][crate::client::ClusterManager::update_node_pool] calls.
433    ///
434    /// # Example
435    /// ```no_run
436    /// # use google_cloud_container_v1::builder;
437    /// use builder::cluster_manager::UpdateNodePool;
438    /// # tokio_test::block_on(async {
439    ///
440    /// let builder = prepare_request_builder();
441    /// let response = builder.send().await?;
442    /// # gax::Result::<()>::Ok(()) });
443    ///
444    /// fn prepare_request_builder() -> UpdateNodePool {
445    ///   # panic!();
446    ///   // ... details omitted ...
447    /// }
448    /// ```
449    #[derive(Clone, Debug)]
450    pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
451
452    impl UpdateNodePool {
453        pub(crate) fn new(
454            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
455        ) -> Self {
456            Self(RequestBuilder::new(stub))
457        }
458
459        /// Sets the full request, replacing any prior values.
460        pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
461            self.0.request = v.into();
462            self
463        }
464
465        /// Sets all the options, replacing any prior values.
466        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
467            self.0.options = v.into();
468            self
469        }
470
471        /// Sends the request.
472        pub async fn send(self) -> Result<crate::model::Operation> {
473            (*self.0.stub)
474                .update_node_pool(self.0.request, self.0.options)
475                .await
476                .map(gax::response::Response::into_body)
477        }
478
479        /// Sets the value of [project_id][crate::model::UpdateNodePoolRequest::project_id].
480        #[deprecated]
481        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
482            self.0.request.project_id = v.into();
483            self
484        }
485
486        /// Sets the value of [zone][crate::model::UpdateNodePoolRequest::zone].
487        #[deprecated]
488        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
489            self.0.request.zone = v.into();
490            self
491        }
492
493        /// Sets the value of [cluster_id][crate::model::UpdateNodePoolRequest::cluster_id].
494        #[deprecated]
495        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
496            self.0.request.cluster_id = v.into();
497            self
498        }
499
500        /// Sets the value of [node_pool_id][crate::model::UpdateNodePoolRequest::node_pool_id].
501        #[deprecated]
502        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
503            self.0.request.node_pool_id = v.into();
504            self
505        }
506
507        /// Sets the value of [node_version][crate::model::UpdateNodePoolRequest::node_version].
508        ///
509        /// This is a **required** field for requests.
510        pub fn set_node_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
511            self.0.request.node_version = v.into();
512            self
513        }
514
515        /// Sets the value of [image_type][crate::model::UpdateNodePoolRequest::image_type].
516        ///
517        /// This is a **required** field for requests.
518        pub fn set_image_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
519            self.0.request.image_type = v.into();
520            self
521        }
522
523        /// Sets the value of [name][crate::model::UpdateNodePoolRequest::name].
524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
525            self.0.request.name = v.into();
526            self
527        }
528
529        /// Sets the value of [locations][crate::model::UpdateNodePoolRequest::locations].
530        pub fn set_locations<T, V>(mut self, v: T) -> Self
531        where
532            T: std::iter::IntoIterator<Item = V>,
533            V: std::convert::Into<std::string::String>,
534        {
535            use std::iter::Iterator;
536            self.0.request.locations = v.into_iter().map(|i| i.into()).collect();
537            self
538        }
539
540        /// Sets the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
541        pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
542        where
543            T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
544        {
545            self.0.request.workload_metadata_config = std::option::Option::Some(v.into());
546            self
547        }
548
549        /// Sets or clears the value of [workload_metadata_config][crate::model::UpdateNodePoolRequest::workload_metadata_config].
550        pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
551        where
552            T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
553        {
554            self.0.request.workload_metadata_config = v.map(|x| x.into());
555            self
556        }
557
558        /// Sets the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
559        pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
560        where
561            T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
562        {
563            self.0.request.upgrade_settings = std::option::Option::Some(v.into());
564            self
565        }
566
567        /// Sets or clears the value of [upgrade_settings][crate::model::UpdateNodePoolRequest::upgrade_settings].
568        pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
569        where
570            T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
571        {
572            self.0.request.upgrade_settings = v.map(|x| x.into());
573            self
574        }
575
576        /// Sets the value of [tags][crate::model::UpdateNodePoolRequest::tags].
577        pub fn set_tags<T>(mut self, v: T) -> Self
578        where
579            T: std::convert::Into<crate::model::NetworkTags>,
580        {
581            self.0.request.tags = std::option::Option::Some(v.into());
582            self
583        }
584
585        /// Sets or clears the value of [tags][crate::model::UpdateNodePoolRequest::tags].
586        pub fn set_or_clear_tags<T>(mut self, v: std::option::Option<T>) -> Self
587        where
588            T: std::convert::Into<crate::model::NetworkTags>,
589        {
590            self.0.request.tags = v.map(|x| x.into());
591            self
592        }
593
594        /// Sets the value of [taints][crate::model::UpdateNodePoolRequest::taints].
595        pub fn set_taints<T>(mut self, v: T) -> Self
596        where
597            T: std::convert::Into<crate::model::NodeTaints>,
598        {
599            self.0.request.taints = std::option::Option::Some(v.into());
600            self
601        }
602
603        /// Sets or clears the value of [taints][crate::model::UpdateNodePoolRequest::taints].
604        pub fn set_or_clear_taints<T>(mut self, v: std::option::Option<T>) -> Self
605        where
606            T: std::convert::Into<crate::model::NodeTaints>,
607        {
608            self.0.request.taints = v.map(|x| x.into());
609            self
610        }
611
612        /// Sets the value of [labels][crate::model::UpdateNodePoolRequest::labels].
613        pub fn set_labels<T>(mut self, v: T) -> Self
614        where
615            T: std::convert::Into<crate::model::NodeLabels>,
616        {
617            self.0.request.labels = std::option::Option::Some(v.into());
618            self
619        }
620
621        /// Sets or clears the value of [labels][crate::model::UpdateNodePoolRequest::labels].
622        pub fn set_or_clear_labels<T>(mut self, v: std::option::Option<T>) -> Self
623        where
624            T: std::convert::Into<crate::model::NodeLabels>,
625        {
626            self.0.request.labels = v.map(|x| x.into());
627            self
628        }
629
630        /// Sets the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
631        pub fn set_linux_node_config<T>(mut self, v: T) -> Self
632        where
633            T: std::convert::Into<crate::model::LinuxNodeConfig>,
634        {
635            self.0.request.linux_node_config = std::option::Option::Some(v.into());
636            self
637        }
638
639        /// Sets or clears the value of [linux_node_config][crate::model::UpdateNodePoolRequest::linux_node_config].
640        pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
641        where
642            T: std::convert::Into<crate::model::LinuxNodeConfig>,
643        {
644            self.0.request.linux_node_config = v.map(|x| x.into());
645            self
646        }
647
648        /// Sets the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
649        pub fn set_kubelet_config<T>(mut self, v: T) -> Self
650        where
651            T: std::convert::Into<crate::model::NodeKubeletConfig>,
652        {
653            self.0.request.kubelet_config = std::option::Option::Some(v.into());
654            self
655        }
656
657        /// Sets or clears the value of [kubelet_config][crate::model::UpdateNodePoolRequest::kubelet_config].
658        pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
659        where
660            T: std::convert::Into<crate::model::NodeKubeletConfig>,
661        {
662            self.0.request.kubelet_config = v.map(|x| x.into());
663            self
664        }
665
666        /// Sets the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
667        pub fn set_node_network_config<T>(mut self, v: T) -> Self
668        where
669            T: std::convert::Into<crate::model::NodeNetworkConfig>,
670        {
671            self.0.request.node_network_config = std::option::Option::Some(v.into());
672            self
673        }
674
675        /// Sets or clears the value of [node_network_config][crate::model::UpdateNodePoolRequest::node_network_config].
676        pub fn set_or_clear_node_network_config<T>(mut self, v: std::option::Option<T>) -> Self
677        where
678            T: std::convert::Into<crate::model::NodeNetworkConfig>,
679        {
680            self.0.request.node_network_config = v.map(|x| x.into());
681            self
682        }
683
684        /// Sets the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
685        pub fn set_gcfs_config<T>(mut self, v: T) -> Self
686        where
687            T: std::convert::Into<crate::model::GcfsConfig>,
688        {
689            self.0.request.gcfs_config = std::option::Option::Some(v.into());
690            self
691        }
692
693        /// Sets or clears the value of [gcfs_config][crate::model::UpdateNodePoolRequest::gcfs_config].
694        pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
695        where
696            T: std::convert::Into<crate::model::GcfsConfig>,
697        {
698            self.0.request.gcfs_config = v.map(|x| x.into());
699            self
700        }
701
702        /// Sets the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
703        pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
704        where
705            T: std::convert::Into<crate::model::ConfidentialNodes>,
706        {
707            self.0.request.confidential_nodes = std::option::Option::Some(v.into());
708            self
709        }
710
711        /// Sets or clears the value of [confidential_nodes][crate::model::UpdateNodePoolRequest::confidential_nodes].
712        pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
713        where
714            T: std::convert::Into<crate::model::ConfidentialNodes>,
715        {
716            self.0.request.confidential_nodes = v.map(|x| x.into());
717            self
718        }
719
720        /// Sets the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
721        pub fn set_gvnic<T>(mut self, v: T) -> Self
722        where
723            T: std::convert::Into<crate::model::VirtualNIC>,
724        {
725            self.0.request.gvnic = std::option::Option::Some(v.into());
726            self
727        }
728
729        /// Sets or clears the value of [gvnic][crate::model::UpdateNodePoolRequest::gvnic].
730        pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
731        where
732            T: std::convert::Into<crate::model::VirtualNIC>,
733        {
734            self.0.request.gvnic = v.map(|x| x.into());
735            self
736        }
737
738        /// Sets the value of [etag][crate::model::UpdateNodePoolRequest::etag].
739        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
740            self.0.request.etag = v.into();
741            self
742        }
743
744        /// Sets the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
745        pub fn set_fast_socket<T>(mut self, v: T) -> Self
746        where
747            T: std::convert::Into<crate::model::FastSocket>,
748        {
749            self.0.request.fast_socket = std::option::Option::Some(v.into());
750            self
751        }
752
753        /// Sets or clears the value of [fast_socket][crate::model::UpdateNodePoolRequest::fast_socket].
754        pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
755        where
756            T: std::convert::Into<crate::model::FastSocket>,
757        {
758            self.0.request.fast_socket = v.map(|x| x.into());
759            self
760        }
761
762        /// Sets the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
763        pub fn set_logging_config<T>(mut self, v: T) -> Self
764        where
765            T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
766        {
767            self.0.request.logging_config = std::option::Option::Some(v.into());
768            self
769        }
770
771        /// Sets or clears the value of [logging_config][crate::model::UpdateNodePoolRequest::logging_config].
772        pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
773        where
774            T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
775        {
776            self.0.request.logging_config = v.map(|x| x.into());
777            self
778        }
779
780        /// Sets the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
781        pub fn set_resource_labels<T>(mut self, v: T) -> Self
782        where
783            T: std::convert::Into<crate::model::ResourceLabels>,
784        {
785            self.0.request.resource_labels = std::option::Option::Some(v.into());
786            self
787        }
788
789        /// Sets or clears the value of [resource_labels][crate::model::UpdateNodePoolRequest::resource_labels].
790        pub fn set_or_clear_resource_labels<T>(mut self, v: std::option::Option<T>) -> Self
791        where
792            T: std::convert::Into<crate::model::ResourceLabels>,
793        {
794            self.0.request.resource_labels = v.map(|x| x.into());
795            self
796        }
797
798        /// Sets the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
799        pub fn set_windows_node_config<T>(mut self, v: T) -> Self
800        where
801            T: std::convert::Into<crate::model::WindowsNodeConfig>,
802        {
803            self.0.request.windows_node_config = std::option::Option::Some(v.into());
804            self
805        }
806
807        /// Sets or clears the value of [windows_node_config][crate::model::UpdateNodePoolRequest::windows_node_config].
808        pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
809        where
810            T: std::convert::Into<crate::model::WindowsNodeConfig>,
811        {
812            self.0.request.windows_node_config = v.map(|x| x.into());
813            self
814        }
815
816        /// Sets the value of [accelerators][crate::model::UpdateNodePoolRequest::accelerators].
817        pub fn set_accelerators<T, V>(mut self, v: T) -> Self
818        where
819            T: std::iter::IntoIterator<Item = V>,
820            V: std::convert::Into<crate::model::AcceleratorConfig>,
821        {
822            use std::iter::Iterator;
823            self.0.request.accelerators = v.into_iter().map(|i| i.into()).collect();
824            self
825        }
826
827        /// Sets the value of [machine_type][crate::model::UpdateNodePoolRequest::machine_type].
828        pub fn set_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
829            self.0.request.machine_type = v.into();
830            self
831        }
832
833        /// Sets the value of [disk_type][crate::model::UpdateNodePoolRequest::disk_type].
834        pub fn set_disk_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
835            self.0.request.disk_type = v.into();
836            self
837        }
838
839        /// Sets the value of [disk_size_gb][crate::model::UpdateNodePoolRequest::disk_size_gb].
840        pub fn set_disk_size_gb<T: Into<i64>>(mut self, v: T) -> Self {
841            self.0.request.disk_size_gb = v.into();
842            self
843        }
844
845        /// Sets the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
846        pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
847        where
848            T: std::convert::Into<crate::model::ResourceManagerTags>,
849        {
850            self.0.request.resource_manager_tags = std::option::Option::Some(v.into());
851            self
852        }
853
854        /// Sets or clears the value of [resource_manager_tags][crate::model::UpdateNodePoolRequest::resource_manager_tags].
855        pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
856        where
857            T: std::convert::Into<crate::model::ResourceManagerTags>,
858        {
859            self.0.request.resource_manager_tags = v.map(|x| x.into());
860            self
861        }
862
863        /// Sets the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
864        pub fn set_containerd_config<T>(mut self, v: T) -> Self
865        where
866            T: std::convert::Into<crate::model::ContainerdConfig>,
867        {
868            self.0.request.containerd_config = std::option::Option::Some(v.into());
869            self
870        }
871
872        /// Sets or clears the value of [containerd_config][crate::model::UpdateNodePoolRequest::containerd_config].
873        pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
874        where
875            T: std::convert::Into<crate::model::ContainerdConfig>,
876        {
877            self.0.request.containerd_config = v.map(|x| x.into());
878            self
879        }
880
881        /// Sets the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
882        pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
883        where
884            T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
885        {
886            self.0.request.queued_provisioning = std::option::Option::Some(v.into());
887            self
888        }
889
890        /// Sets or clears the value of [queued_provisioning][crate::model::UpdateNodePoolRequest::queued_provisioning].
891        pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
892        where
893            T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
894        {
895            self.0.request.queued_provisioning = v.map(|x| x.into());
896            self
897        }
898
899        /// Sets the value of [storage_pools][crate::model::UpdateNodePoolRequest::storage_pools].
900        pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
901        where
902            T: std::iter::IntoIterator<Item = V>,
903            V: std::convert::Into<std::string::String>,
904        {
905            use std::iter::Iterator;
906            self.0.request.storage_pools = v.into_iter().map(|i| i.into()).collect();
907            self
908        }
909
910        /// Sets the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
911        pub fn set_max_run_duration<T>(mut self, v: T) -> Self
912        where
913            T: std::convert::Into<wkt::Duration>,
914        {
915            self.0.request.max_run_duration = std::option::Option::Some(v.into());
916            self
917        }
918
919        /// Sets or clears the value of [max_run_duration][crate::model::UpdateNodePoolRequest::max_run_duration].
920        pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
921        where
922            T: std::convert::Into<wkt::Duration>,
923        {
924            self.0.request.max_run_duration = v.map(|x| x.into());
925            self
926        }
927
928        /// Sets the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
929        pub fn set_flex_start<T>(mut self, v: T) -> Self
930        where
931            T: std::convert::Into<bool>,
932        {
933            self.0.request.flex_start = std::option::Option::Some(v.into());
934            self
935        }
936
937        /// Sets or clears the value of [flex_start][crate::model::UpdateNodePoolRequest::flex_start].
938        pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
939        where
940            T: std::convert::Into<bool>,
941        {
942            self.0.request.flex_start = v.map(|x| x.into());
943            self
944        }
945
946        /// Sets the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
947        pub fn set_boot_disk<T>(mut self, v: T) -> Self
948        where
949            T: std::convert::Into<crate::model::BootDisk>,
950        {
951            self.0.request.boot_disk = std::option::Option::Some(v.into());
952            self
953        }
954
955        /// Sets or clears the value of [boot_disk][crate::model::UpdateNodePoolRequest::boot_disk].
956        pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
957        where
958            T: std::convert::Into<crate::model::BootDisk>,
959        {
960            self.0.request.boot_disk = v.map(|x| x.into());
961            self
962        }
963    }
964
965    #[doc(hidden)]
966    impl gax::options::internal::RequestBuilder for UpdateNodePool {
967        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
968            &mut self.0.options
969        }
970    }
971
972    /// The request builder for [ClusterManager::set_node_pool_autoscaling][crate::client::ClusterManager::set_node_pool_autoscaling] calls.
973    ///
974    /// # Example
975    /// ```no_run
976    /// # use google_cloud_container_v1::builder;
977    /// use builder::cluster_manager::SetNodePoolAutoscaling;
978    /// # tokio_test::block_on(async {
979    ///
980    /// let builder = prepare_request_builder();
981    /// let response = builder.send().await?;
982    /// # gax::Result::<()>::Ok(()) });
983    ///
984    /// fn prepare_request_builder() -> SetNodePoolAutoscaling {
985    ///   # panic!();
986    ///   // ... details omitted ...
987    /// }
988    /// ```
989    #[derive(Clone, Debug)]
990    pub struct SetNodePoolAutoscaling(RequestBuilder<crate::model::SetNodePoolAutoscalingRequest>);
991
992    impl SetNodePoolAutoscaling {
993        pub(crate) fn new(
994            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
995        ) -> Self {
996            Self(RequestBuilder::new(stub))
997        }
998
999        /// Sets the full request, replacing any prior values.
1000        pub fn with_request<V: Into<crate::model::SetNodePoolAutoscalingRequest>>(
1001            mut self,
1002            v: V,
1003        ) -> Self {
1004            self.0.request = v.into();
1005            self
1006        }
1007
1008        /// Sets all the options, replacing any prior values.
1009        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1010            self.0.options = v.into();
1011            self
1012        }
1013
1014        /// Sends the request.
1015        pub async fn send(self) -> Result<crate::model::Operation> {
1016            (*self.0.stub)
1017                .set_node_pool_autoscaling(self.0.request, self.0.options)
1018                .await
1019                .map(gax::response::Response::into_body)
1020        }
1021
1022        /// Sets the value of [project_id][crate::model::SetNodePoolAutoscalingRequest::project_id].
1023        #[deprecated]
1024        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1025            self.0.request.project_id = v.into();
1026            self
1027        }
1028
1029        /// Sets the value of [zone][crate::model::SetNodePoolAutoscalingRequest::zone].
1030        #[deprecated]
1031        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032            self.0.request.zone = v.into();
1033            self
1034        }
1035
1036        /// Sets the value of [cluster_id][crate::model::SetNodePoolAutoscalingRequest::cluster_id].
1037        #[deprecated]
1038        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039            self.0.request.cluster_id = v.into();
1040            self
1041        }
1042
1043        /// Sets the value of [node_pool_id][crate::model::SetNodePoolAutoscalingRequest::node_pool_id].
1044        #[deprecated]
1045        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1046            self.0.request.node_pool_id = v.into();
1047            self
1048        }
1049
1050        /// Sets the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
1051        ///
1052        /// This is a **required** field for requests.
1053        pub fn set_autoscaling<T>(mut self, v: T) -> Self
1054        where
1055            T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1056        {
1057            self.0.request.autoscaling = std::option::Option::Some(v.into());
1058            self
1059        }
1060
1061        /// Sets or clears the value of [autoscaling][crate::model::SetNodePoolAutoscalingRequest::autoscaling].
1062        ///
1063        /// This is a **required** field for requests.
1064        pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
1065        where
1066            T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1067        {
1068            self.0.request.autoscaling = v.map(|x| x.into());
1069            self
1070        }
1071
1072        /// Sets the value of [name][crate::model::SetNodePoolAutoscalingRequest::name].
1073        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1074            self.0.request.name = v.into();
1075            self
1076        }
1077    }
1078
1079    #[doc(hidden)]
1080    impl gax::options::internal::RequestBuilder for SetNodePoolAutoscaling {
1081        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1082            &mut self.0.options
1083        }
1084    }
1085
1086    /// The request builder for [ClusterManager::set_logging_service][crate::client::ClusterManager::set_logging_service] calls.
1087    ///
1088    /// # Example
1089    /// ```no_run
1090    /// # use google_cloud_container_v1::builder;
1091    /// use builder::cluster_manager::SetLoggingService;
1092    /// # tokio_test::block_on(async {
1093    ///
1094    /// let builder = prepare_request_builder();
1095    /// let response = builder.send().await?;
1096    /// # gax::Result::<()>::Ok(()) });
1097    ///
1098    /// fn prepare_request_builder() -> SetLoggingService {
1099    ///   # panic!();
1100    ///   // ... details omitted ...
1101    /// }
1102    /// ```
1103    #[derive(Clone, Debug)]
1104    pub struct SetLoggingService(RequestBuilder<crate::model::SetLoggingServiceRequest>);
1105
1106    impl SetLoggingService {
1107        pub(crate) fn new(
1108            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1109        ) -> Self {
1110            Self(RequestBuilder::new(stub))
1111        }
1112
1113        /// Sets the full request, replacing any prior values.
1114        pub fn with_request<V: Into<crate::model::SetLoggingServiceRequest>>(
1115            mut self,
1116            v: V,
1117        ) -> Self {
1118            self.0.request = v.into();
1119            self
1120        }
1121
1122        /// Sets all the options, replacing any prior values.
1123        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1124            self.0.options = v.into();
1125            self
1126        }
1127
1128        /// Sends the request.
1129        pub async fn send(self) -> Result<crate::model::Operation> {
1130            (*self.0.stub)
1131                .set_logging_service(self.0.request, self.0.options)
1132                .await
1133                .map(gax::response::Response::into_body)
1134        }
1135
1136        /// Sets the value of [project_id][crate::model::SetLoggingServiceRequest::project_id].
1137        #[deprecated]
1138        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139            self.0.request.project_id = v.into();
1140            self
1141        }
1142
1143        /// Sets the value of [zone][crate::model::SetLoggingServiceRequest::zone].
1144        #[deprecated]
1145        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1146            self.0.request.zone = v.into();
1147            self
1148        }
1149
1150        /// Sets the value of [cluster_id][crate::model::SetLoggingServiceRequest::cluster_id].
1151        #[deprecated]
1152        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1153            self.0.request.cluster_id = v.into();
1154            self
1155        }
1156
1157        /// Sets the value of [logging_service][crate::model::SetLoggingServiceRequest::logging_service].
1158        ///
1159        /// This is a **required** field for requests.
1160        pub fn set_logging_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1161            self.0.request.logging_service = v.into();
1162            self
1163        }
1164
1165        /// Sets the value of [name][crate::model::SetLoggingServiceRequest::name].
1166        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1167            self.0.request.name = v.into();
1168            self
1169        }
1170    }
1171
1172    #[doc(hidden)]
1173    impl gax::options::internal::RequestBuilder for SetLoggingService {
1174        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1175            &mut self.0.options
1176        }
1177    }
1178
1179    /// The request builder for [ClusterManager::set_monitoring_service][crate::client::ClusterManager::set_monitoring_service] calls.
1180    ///
1181    /// # Example
1182    /// ```no_run
1183    /// # use google_cloud_container_v1::builder;
1184    /// use builder::cluster_manager::SetMonitoringService;
1185    /// # tokio_test::block_on(async {
1186    ///
1187    /// let builder = prepare_request_builder();
1188    /// let response = builder.send().await?;
1189    /// # gax::Result::<()>::Ok(()) });
1190    ///
1191    /// fn prepare_request_builder() -> SetMonitoringService {
1192    ///   # panic!();
1193    ///   // ... details omitted ...
1194    /// }
1195    /// ```
1196    #[derive(Clone, Debug)]
1197    pub struct SetMonitoringService(RequestBuilder<crate::model::SetMonitoringServiceRequest>);
1198
1199    impl SetMonitoringService {
1200        pub(crate) fn new(
1201            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1202        ) -> Self {
1203            Self(RequestBuilder::new(stub))
1204        }
1205
1206        /// Sets the full request, replacing any prior values.
1207        pub fn with_request<V: Into<crate::model::SetMonitoringServiceRequest>>(
1208            mut self,
1209            v: V,
1210        ) -> Self {
1211            self.0.request = v.into();
1212            self
1213        }
1214
1215        /// Sets all the options, replacing any prior values.
1216        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1217            self.0.options = v.into();
1218            self
1219        }
1220
1221        /// Sends the request.
1222        pub async fn send(self) -> Result<crate::model::Operation> {
1223            (*self.0.stub)
1224                .set_monitoring_service(self.0.request, self.0.options)
1225                .await
1226                .map(gax::response::Response::into_body)
1227        }
1228
1229        /// Sets the value of [project_id][crate::model::SetMonitoringServiceRequest::project_id].
1230        #[deprecated]
1231        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1232            self.0.request.project_id = v.into();
1233            self
1234        }
1235
1236        /// Sets the value of [zone][crate::model::SetMonitoringServiceRequest::zone].
1237        #[deprecated]
1238        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1239            self.0.request.zone = v.into();
1240            self
1241        }
1242
1243        /// Sets the value of [cluster_id][crate::model::SetMonitoringServiceRequest::cluster_id].
1244        #[deprecated]
1245        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246            self.0.request.cluster_id = v.into();
1247            self
1248        }
1249
1250        /// Sets the value of [monitoring_service][crate::model::SetMonitoringServiceRequest::monitoring_service].
1251        ///
1252        /// This is a **required** field for requests.
1253        pub fn set_monitoring_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1254            self.0.request.monitoring_service = v.into();
1255            self
1256        }
1257
1258        /// Sets the value of [name][crate::model::SetMonitoringServiceRequest::name].
1259        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260            self.0.request.name = v.into();
1261            self
1262        }
1263    }
1264
1265    #[doc(hidden)]
1266    impl gax::options::internal::RequestBuilder for SetMonitoringService {
1267        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1268            &mut self.0.options
1269        }
1270    }
1271
1272    /// The request builder for [ClusterManager::set_addons_config][crate::client::ClusterManager::set_addons_config] calls.
1273    ///
1274    /// # Example
1275    /// ```no_run
1276    /// # use google_cloud_container_v1::builder;
1277    /// use builder::cluster_manager::SetAddonsConfig;
1278    /// # tokio_test::block_on(async {
1279    ///
1280    /// let builder = prepare_request_builder();
1281    /// let response = builder.send().await?;
1282    /// # gax::Result::<()>::Ok(()) });
1283    ///
1284    /// fn prepare_request_builder() -> SetAddonsConfig {
1285    ///   # panic!();
1286    ///   // ... details omitted ...
1287    /// }
1288    /// ```
1289    #[derive(Clone, Debug)]
1290    pub struct SetAddonsConfig(RequestBuilder<crate::model::SetAddonsConfigRequest>);
1291
1292    impl SetAddonsConfig {
1293        pub(crate) fn new(
1294            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1295        ) -> Self {
1296            Self(RequestBuilder::new(stub))
1297        }
1298
1299        /// Sets the full request, replacing any prior values.
1300        pub fn with_request<V: Into<crate::model::SetAddonsConfigRequest>>(mut self, v: V) -> Self {
1301            self.0.request = v.into();
1302            self
1303        }
1304
1305        /// Sets all the options, replacing any prior values.
1306        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1307            self.0.options = v.into();
1308            self
1309        }
1310
1311        /// Sends the request.
1312        pub async fn send(self) -> Result<crate::model::Operation> {
1313            (*self.0.stub)
1314                .set_addons_config(self.0.request, self.0.options)
1315                .await
1316                .map(gax::response::Response::into_body)
1317        }
1318
1319        /// Sets the value of [project_id][crate::model::SetAddonsConfigRequest::project_id].
1320        #[deprecated]
1321        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1322            self.0.request.project_id = v.into();
1323            self
1324        }
1325
1326        /// Sets the value of [zone][crate::model::SetAddonsConfigRequest::zone].
1327        #[deprecated]
1328        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1329            self.0.request.zone = v.into();
1330            self
1331        }
1332
1333        /// Sets the value of [cluster_id][crate::model::SetAddonsConfigRequest::cluster_id].
1334        #[deprecated]
1335        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336            self.0.request.cluster_id = v.into();
1337            self
1338        }
1339
1340        /// Sets the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
1341        ///
1342        /// This is a **required** field for requests.
1343        pub fn set_addons_config<T>(mut self, v: T) -> Self
1344        where
1345            T: std::convert::Into<crate::model::AddonsConfig>,
1346        {
1347            self.0.request.addons_config = std::option::Option::Some(v.into());
1348            self
1349        }
1350
1351        /// Sets or clears the value of [addons_config][crate::model::SetAddonsConfigRequest::addons_config].
1352        ///
1353        /// This is a **required** field for requests.
1354        pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
1355        where
1356            T: std::convert::Into<crate::model::AddonsConfig>,
1357        {
1358            self.0.request.addons_config = v.map(|x| x.into());
1359            self
1360        }
1361
1362        /// Sets the value of [name][crate::model::SetAddonsConfigRequest::name].
1363        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1364            self.0.request.name = v.into();
1365            self
1366        }
1367    }
1368
1369    #[doc(hidden)]
1370    impl gax::options::internal::RequestBuilder for SetAddonsConfig {
1371        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1372            &mut self.0.options
1373        }
1374    }
1375
1376    /// The request builder for [ClusterManager::set_locations][crate::client::ClusterManager::set_locations] calls.
1377    ///
1378    /// # Example
1379    /// ```no_run
1380    /// # use google_cloud_container_v1::builder;
1381    /// use builder::cluster_manager::SetLocations;
1382    /// # tokio_test::block_on(async {
1383    ///
1384    /// let builder = prepare_request_builder();
1385    /// let response = builder.send().await?;
1386    /// # gax::Result::<()>::Ok(()) });
1387    ///
1388    /// fn prepare_request_builder() -> SetLocations {
1389    ///   # panic!();
1390    ///   // ... details omitted ...
1391    /// }
1392    /// ```
1393    #[derive(Clone, Debug)]
1394    pub struct SetLocations(RequestBuilder<crate::model::SetLocationsRequest>);
1395
1396    impl SetLocations {
1397        pub(crate) fn new(
1398            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1399        ) -> Self {
1400            Self(RequestBuilder::new(stub))
1401        }
1402
1403        /// Sets the full request, replacing any prior values.
1404        pub fn with_request<V: Into<crate::model::SetLocationsRequest>>(mut self, v: V) -> Self {
1405            self.0.request = v.into();
1406            self
1407        }
1408
1409        /// Sets all the options, replacing any prior values.
1410        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1411            self.0.options = v.into();
1412            self
1413        }
1414
1415        /// Sends the request.
1416        pub async fn send(self) -> Result<crate::model::Operation> {
1417            (*self.0.stub)
1418                .set_locations(self.0.request, self.0.options)
1419                .await
1420                .map(gax::response::Response::into_body)
1421        }
1422
1423        /// Sets the value of [project_id][crate::model::SetLocationsRequest::project_id].
1424        #[deprecated]
1425        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1426            self.0.request.project_id = v.into();
1427            self
1428        }
1429
1430        /// Sets the value of [zone][crate::model::SetLocationsRequest::zone].
1431        #[deprecated]
1432        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.zone = v.into();
1434            self
1435        }
1436
1437        /// Sets the value of [cluster_id][crate::model::SetLocationsRequest::cluster_id].
1438        #[deprecated]
1439        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.cluster_id = v.into();
1441            self
1442        }
1443
1444        /// Sets the value of [locations][crate::model::SetLocationsRequest::locations].
1445        ///
1446        /// This is a **required** field for requests.
1447        pub fn set_locations<T, V>(mut self, v: T) -> Self
1448        where
1449            T: std::iter::IntoIterator<Item = V>,
1450            V: std::convert::Into<std::string::String>,
1451        {
1452            use std::iter::Iterator;
1453            self.0.request.locations = v.into_iter().map(|i| i.into()).collect();
1454            self
1455        }
1456
1457        /// Sets the value of [name][crate::model::SetLocationsRequest::name].
1458        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1459            self.0.request.name = v.into();
1460            self
1461        }
1462    }
1463
1464    #[doc(hidden)]
1465    impl gax::options::internal::RequestBuilder for SetLocations {
1466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1467            &mut self.0.options
1468        }
1469    }
1470
1471    /// The request builder for [ClusterManager::update_master][crate::client::ClusterManager::update_master] calls.
1472    ///
1473    /// # Example
1474    /// ```no_run
1475    /// # use google_cloud_container_v1::builder;
1476    /// use builder::cluster_manager::UpdateMaster;
1477    /// # tokio_test::block_on(async {
1478    ///
1479    /// let builder = prepare_request_builder();
1480    /// let response = builder.send().await?;
1481    /// # gax::Result::<()>::Ok(()) });
1482    ///
1483    /// fn prepare_request_builder() -> UpdateMaster {
1484    ///   # panic!();
1485    ///   // ... details omitted ...
1486    /// }
1487    /// ```
1488    #[derive(Clone, Debug)]
1489    pub struct UpdateMaster(RequestBuilder<crate::model::UpdateMasterRequest>);
1490
1491    impl UpdateMaster {
1492        pub(crate) fn new(
1493            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1494        ) -> Self {
1495            Self(RequestBuilder::new(stub))
1496        }
1497
1498        /// Sets the full request, replacing any prior values.
1499        pub fn with_request<V: Into<crate::model::UpdateMasterRequest>>(mut self, v: V) -> Self {
1500            self.0.request = v.into();
1501            self
1502        }
1503
1504        /// Sets all the options, replacing any prior values.
1505        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1506            self.0.options = v.into();
1507            self
1508        }
1509
1510        /// Sends the request.
1511        pub async fn send(self) -> Result<crate::model::Operation> {
1512            (*self.0.stub)
1513                .update_master(self.0.request, self.0.options)
1514                .await
1515                .map(gax::response::Response::into_body)
1516        }
1517
1518        /// Sets the value of [project_id][crate::model::UpdateMasterRequest::project_id].
1519        #[deprecated]
1520        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1521            self.0.request.project_id = v.into();
1522            self
1523        }
1524
1525        /// Sets the value of [zone][crate::model::UpdateMasterRequest::zone].
1526        #[deprecated]
1527        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1528            self.0.request.zone = v.into();
1529            self
1530        }
1531
1532        /// Sets the value of [cluster_id][crate::model::UpdateMasterRequest::cluster_id].
1533        #[deprecated]
1534        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1535            self.0.request.cluster_id = v.into();
1536            self
1537        }
1538
1539        /// Sets the value of [master_version][crate::model::UpdateMasterRequest::master_version].
1540        ///
1541        /// This is a **required** field for requests.
1542        pub fn set_master_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1543            self.0.request.master_version = v.into();
1544            self
1545        }
1546
1547        /// Sets the value of [name][crate::model::UpdateMasterRequest::name].
1548        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549            self.0.request.name = v.into();
1550            self
1551        }
1552    }
1553
1554    #[doc(hidden)]
1555    impl gax::options::internal::RequestBuilder for UpdateMaster {
1556        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1557            &mut self.0.options
1558        }
1559    }
1560
1561    /// The request builder for [ClusterManager::set_master_auth][crate::client::ClusterManager::set_master_auth] calls.
1562    ///
1563    /// # Example
1564    /// ```no_run
1565    /// # use google_cloud_container_v1::builder;
1566    /// use builder::cluster_manager::SetMasterAuth;
1567    /// # tokio_test::block_on(async {
1568    ///
1569    /// let builder = prepare_request_builder();
1570    /// let response = builder.send().await?;
1571    /// # gax::Result::<()>::Ok(()) });
1572    ///
1573    /// fn prepare_request_builder() -> SetMasterAuth {
1574    ///   # panic!();
1575    ///   // ... details omitted ...
1576    /// }
1577    /// ```
1578    #[derive(Clone, Debug)]
1579    pub struct SetMasterAuth(RequestBuilder<crate::model::SetMasterAuthRequest>);
1580
1581    impl SetMasterAuth {
1582        pub(crate) fn new(
1583            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1584        ) -> Self {
1585            Self(RequestBuilder::new(stub))
1586        }
1587
1588        /// Sets the full request, replacing any prior values.
1589        pub fn with_request<V: Into<crate::model::SetMasterAuthRequest>>(mut self, v: V) -> Self {
1590            self.0.request = v.into();
1591            self
1592        }
1593
1594        /// Sets all the options, replacing any prior values.
1595        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1596            self.0.options = v.into();
1597            self
1598        }
1599
1600        /// Sends the request.
1601        pub async fn send(self) -> Result<crate::model::Operation> {
1602            (*self.0.stub)
1603                .set_master_auth(self.0.request, self.0.options)
1604                .await
1605                .map(gax::response::Response::into_body)
1606        }
1607
1608        /// Sets the value of [project_id][crate::model::SetMasterAuthRequest::project_id].
1609        #[deprecated]
1610        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1611            self.0.request.project_id = v.into();
1612            self
1613        }
1614
1615        /// Sets the value of [zone][crate::model::SetMasterAuthRequest::zone].
1616        #[deprecated]
1617        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1618            self.0.request.zone = v.into();
1619            self
1620        }
1621
1622        /// Sets the value of [cluster_id][crate::model::SetMasterAuthRequest::cluster_id].
1623        #[deprecated]
1624        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1625            self.0.request.cluster_id = v.into();
1626            self
1627        }
1628
1629        /// Sets the value of [action][crate::model::SetMasterAuthRequest::action].
1630        ///
1631        /// This is a **required** field for requests.
1632        pub fn set_action<T: Into<crate::model::set_master_auth_request::Action>>(
1633            mut self,
1634            v: T,
1635        ) -> Self {
1636            self.0.request.action = v.into();
1637            self
1638        }
1639
1640        /// Sets the value of [update][crate::model::SetMasterAuthRequest::update].
1641        ///
1642        /// This is a **required** field for requests.
1643        pub fn set_update<T>(mut self, v: T) -> Self
1644        where
1645            T: std::convert::Into<crate::model::MasterAuth>,
1646        {
1647            self.0.request.update = std::option::Option::Some(v.into());
1648            self
1649        }
1650
1651        /// Sets or clears the value of [update][crate::model::SetMasterAuthRequest::update].
1652        ///
1653        /// This is a **required** field for requests.
1654        pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
1655        where
1656            T: std::convert::Into<crate::model::MasterAuth>,
1657        {
1658            self.0.request.update = v.map(|x| x.into());
1659            self
1660        }
1661
1662        /// Sets the value of [name][crate::model::SetMasterAuthRequest::name].
1663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664            self.0.request.name = v.into();
1665            self
1666        }
1667    }
1668
1669    #[doc(hidden)]
1670    impl gax::options::internal::RequestBuilder for SetMasterAuth {
1671        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1672            &mut self.0.options
1673        }
1674    }
1675
1676    /// The request builder for [ClusterManager::delete_cluster][crate::client::ClusterManager::delete_cluster] calls.
1677    ///
1678    /// # Example
1679    /// ```no_run
1680    /// # use google_cloud_container_v1::builder;
1681    /// use builder::cluster_manager::DeleteCluster;
1682    /// # tokio_test::block_on(async {
1683    ///
1684    /// let builder = prepare_request_builder();
1685    /// let response = builder.send().await?;
1686    /// # gax::Result::<()>::Ok(()) });
1687    ///
1688    /// fn prepare_request_builder() -> DeleteCluster {
1689    ///   # panic!();
1690    ///   // ... details omitted ...
1691    /// }
1692    /// ```
1693    #[derive(Clone, Debug)]
1694    pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
1695
1696    impl DeleteCluster {
1697        pub(crate) fn new(
1698            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1699        ) -> Self {
1700            Self(RequestBuilder::new(stub))
1701        }
1702
1703        /// Sets the full request, replacing any prior values.
1704        pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
1705            self.0.request = v.into();
1706            self
1707        }
1708
1709        /// Sets all the options, replacing any prior values.
1710        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1711            self.0.options = v.into();
1712            self
1713        }
1714
1715        /// Sends the request.
1716        pub async fn send(self) -> Result<crate::model::Operation> {
1717            (*self.0.stub)
1718                .delete_cluster(self.0.request, self.0.options)
1719                .await
1720                .map(gax::response::Response::into_body)
1721        }
1722
1723        /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
1724        #[deprecated]
1725        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1726            self.0.request.project_id = v.into();
1727            self
1728        }
1729
1730        /// Sets the value of [zone][crate::model::DeleteClusterRequest::zone].
1731        #[deprecated]
1732        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1733            self.0.request.zone = v.into();
1734            self
1735        }
1736
1737        /// Sets the value of [cluster_id][crate::model::DeleteClusterRequest::cluster_id].
1738        #[deprecated]
1739        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740            self.0.request.cluster_id = v.into();
1741            self
1742        }
1743
1744        /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1745        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746            self.0.request.name = v.into();
1747            self
1748        }
1749    }
1750
1751    #[doc(hidden)]
1752    impl gax::options::internal::RequestBuilder for DeleteCluster {
1753        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1754            &mut self.0.options
1755        }
1756    }
1757
1758    /// The request builder for [ClusterManager::list_operations][crate::client::ClusterManager::list_operations] calls.
1759    ///
1760    /// # Example
1761    /// ```no_run
1762    /// # use google_cloud_container_v1::builder;
1763    /// use builder::cluster_manager::ListOperations;
1764    /// # tokio_test::block_on(async {
1765    ///
1766    /// let builder = prepare_request_builder();
1767    /// let response = builder.send().await?;
1768    /// # gax::Result::<()>::Ok(()) });
1769    ///
1770    /// fn prepare_request_builder() -> ListOperations {
1771    ///   # panic!();
1772    ///   // ... details omitted ...
1773    /// }
1774    /// ```
1775    #[derive(Clone, Debug)]
1776    pub struct ListOperations(RequestBuilder<crate::model::ListOperationsRequest>);
1777
1778    impl ListOperations {
1779        pub(crate) fn new(
1780            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1781        ) -> Self {
1782            Self(RequestBuilder::new(stub))
1783        }
1784
1785        /// Sets the full request, replacing any prior values.
1786        pub fn with_request<V: Into<crate::model::ListOperationsRequest>>(mut self, v: V) -> Self {
1787            self.0.request = v.into();
1788            self
1789        }
1790
1791        /// Sets all the options, replacing any prior values.
1792        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793            self.0.options = v.into();
1794            self
1795        }
1796
1797        /// Sends the request.
1798        pub async fn send(self) -> Result<crate::model::ListOperationsResponse> {
1799            (*self.0.stub)
1800                .list_operations(self.0.request, self.0.options)
1801                .await
1802                .map(gax::response::Response::into_body)
1803        }
1804
1805        /// Sets the value of [project_id][crate::model::ListOperationsRequest::project_id].
1806        #[deprecated]
1807        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1808            self.0.request.project_id = v.into();
1809            self
1810        }
1811
1812        /// Sets the value of [zone][crate::model::ListOperationsRequest::zone].
1813        #[deprecated]
1814        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815            self.0.request.zone = v.into();
1816            self
1817        }
1818
1819        /// Sets the value of [parent][crate::model::ListOperationsRequest::parent].
1820        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1821            self.0.request.parent = v.into();
1822            self
1823        }
1824    }
1825
1826    #[doc(hidden)]
1827    impl gax::options::internal::RequestBuilder for ListOperations {
1828        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1829            &mut self.0.options
1830        }
1831    }
1832
1833    /// The request builder for [ClusterManager::get_operation][crate::client::ClusterManager::get_operation] calls.
1834    ///
1835    /// # Example
1836    /// ```no_run
1837    /// # use google_cloud_container_v1::builder;
1838    /// use builder::cluster_manager::GetOperation;
1839    /// # tokio_test::block_on(async {
1840    ///
1841    /// let builder = prepare_request_builder();
1842    /// let response = builder.send().await?;
1843    /// # gax::Result::<()>::Ok(()) });
1844    ///
1845    /// fn prepare_request_builder() -> GetOperation {
1846    ///   # panic!();
1847    ///   // ... details omitted ...
1848    /// }
1849    /// ```
1850    #[derive(Clone, Debug)]
1851    pub struct GetOperation(RequestBuilder<crate::model::GetOperationRequest>);
1852
1853    impl GetOperation {
1854        pub(crate) fn new(
1855            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1856        ) -> Self {
1857            Self(RequestBuilder::new(stub))
1858        }
1859
1860        /// Sets the full request, replacing any prior values.
1861        pub fn with_request<V: Into<crate::model::GetOperationRequest>>(mut self, v: V) -> Self {
1862            self.0.request = v.into();
1863            self
1864        }
1865
1866        /// Sets all the options, replacing any prior values.
1867        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1868            self.0.options = v.into();
1869            self
1870        }
1871
1872        /// Sends the request.
1873        pub async fn send(self) -> Result<crate::model::Operation> {
1874            (*self.0.stub)
1875                .get_operation(self.0.request, self.0.options)
1876                .await
1877                .map(gax::response::Response::into_body)
1878        }
1879
1880        /// Sets the value of [project_id][crate::model::GetOperationRequest::project_id].
1881        #[deprecated]
1882        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1883            self.0.request.project_id = v.into();
1884            self
1885        }
1886
1887        /// Sets the value of [zone][crate::model::GetOperationRequest::zone].
1888        #[deprecated]
1889        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890            self.0.request.zone = v.into();
1891            self
1892        }
1893
1894        /// Sets the value of [operation_id][crate::model::GetOperationRequest::operation_id].
1895        #[deprecated]
1896        pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1897            self.0.request.operation_id = v.into();
1898            self
1899        }
1900
1901        /// Sets the value of [name][crate::model::GetOperationRequest::name].
1902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1903            self.0.request.name = v.into();
1904            self
1905        }
1906    }
1907
1908    #[doc(hidden)]
1909    impl gax::options::internal::RequestBuilder for GetOperation {
1910        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1911            &mut self.0.options
1912        }
1913    }
1914
1915    /// The request builder for [ClusterManager::cancel_operation][crate::client::ClusterManager::cancel_operation] calls.
1916    ///
1917    /// # Example
1918    /// ```no_run
1919    /// # use google_cloud_container_v1::builder;
1920    /// use builder::cluster_manager::CancelOperation;
1921    /// # tokio_test::block_on(async {
1922    ///
1923    /// let builder = prepare_request_builder();
1924    /// let response = builder.send().await?;
1925    /// # gax::Result::<()>::Ok(()) });
1926    ///
1927    /// fn prepare_request_builder() -> CancelOperation {
1928    ///   # panic!();
1929    ///   // ... details omitted ...
1930    /// }
1931    /// ```
1932    #[derive(Clone, Debug)]
1933    pub struct CancelOperation(RequestBuilder<crate::model::CancelOperationRequest>);
1934
1935    impl CancelOperation {
1936        pub(crate) fn new(
1937            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1938        ) -> Self {
1939            Self(RequestBuilder::new(stub))
1940        }
1941
1942        /// Sets the full request, replacing any prior values.
1943        pub fn with_request<V: Into<crate::model::CancelOperationRequest>>(mut self, v: V) -> Self {
1944            self.0.request = v.into();
1945            self
1946        }
1947
1948        /// Sets all the options, replacing any prior values.
1949        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1950            self.0.options = v.into();
1951            self
1952        }
1953
1954        /// Sends the request.
1955        pub async fn send(self) -> Result<()> {
1956            (*self.0.stub)
1957                .cancel_operation(self.0.request, self.0.options)
1958                .await
1959                .map(gax::response::Response::into_body)
1960        }
1961
1962        /// Sets the value of [project_id][crate::model::CancelOperationRequest::project_id].
1963        #[deprecated]
1964        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1965            self.0.request.project_id = v.into();
1966            self
1967        }
1968
1969        /// Sets the value of [zone][crate::model::CancelOperationRequest::zone].
1970        #[deprecated]
1971        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1972            self.0.request.zone = v.into();
1973            self
1974        }
1975
1976        /// Sets the value of [operation_id][crate::model::CancelOperationRequest::operation_id].
1977        #[deprecated]
1978        pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1979            self.0.request.operation_id = v.into();
1980            self
1981        }
1982
1983        /// Sets the value of [name][crate::model::CancelOperationRequest::name].
1984        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1985            self.0.request.name = v.into();
1986            self
1987        }
1988    }
1989
1990    #[doc(hidden)]
1991    impl gax::options::internal::RequestBuilder for CancelOperation {
1992        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1993            &mut self.0.options
1994        }
1995    }
1996
1997    /// The request builder for [ClusterManager::get_server_config][crate::client::ClusterManager::get_server_config] calls.
1998    ///
1999    /// # Example
2000    /// ```no_run
2001    /// # use google_cloud_container_v1::builder;
2002    /// use builder::cluster_manager::GetServerConfig;
2003    /// # tokio_test::block_on(async {
2004    ///
2005    /// let builder = prepare_request_builder();
2006    /// let response = builder.send().await?;
2007    /// # gax::Result::<()>::Ok(()) });
2008    ///
2009    /// fn prepare_request_builder() -> GetServerConfig {
2010    ///   # panic!();
2011    ///   // ... details omitted ...
2012    /// }
2013    /// ```
2014    #[derive(Clone, Debug)]
2015    pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2016
2017    impl GetServerConfig {
2018        pub(crate) fn new(
2019            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2020        ) -> Self {
2021            Self(RequestBuilder::new(stub))
2022        }
2023
2024        /// Sets the full request, replacing any prior values.
2025        pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2026            self.0.request = v.into();
2027            self
2028        }
2029
2030        /// Sets all the options, replacing any prior values.
2031        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2032            self.0.options = v.into();
2033            self
2034        }
2035
2036        /// Sends the request.
2037        pub async fn send(self) -> Result<crate::model::ServerConfig> {
2038            (*self.0.stub)
2039                .get_server_config(self.0.request, self.0.options)
2040                .await
2041                .map(gax::response::Response::into_body)
2042        }
2043
2044        /// Sets the value of [project_id][crate::model::GetServerConfigRequest::project_id].
2045        #[deprecated]
2046        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2047            self.0.request.project_id = v.into();
2048            self
2049        }
2050
2051        /// Sets the value of [zone][crate::model::GetServerConfigRequest::zone].
2052        #[deprecated]
2053        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2054            self.0.request.zone = v.into();
2055            self
2056        }
2057
2058        /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
2059        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2060            self.0.request.name = v.into();
2061            self
2062        }
2063    }
2064
2065    #[doc(hidden)]
2066    impl gax::options::internal::RequestBuilder for GetServerConfig {
2067        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2068            &mut self.0.options
2069        }
2070    }
2071
2072    /// The request builder for [ClusterManager::get_json_web_keys][crate::client::ClusterManager::get_json_web_keys] calls.
2073    ///
2074    /// # Example
2075    /// ```no_run
2076    /// # use google_cloud_container_v1::builder;
2077    /// use builder::cluster_manager::GetJSONWebKeys;
2078    /// # tokio_test::block_on(async {
2079    ///
2080    /// let builder = prepare_request_builder();
2081    /// let response = builder.send().await?;
2082    /// # gax::Result::<()>::Ok(()) });
2083    ///
2084    /// fn prepare_request_builder() -> GetJSONWebKeys {
2085    ///   # panic!();
2086    ///   // ... details omitted ...
2087    /// }
2088    /// ```
2089    #[derive(Clone, Debug)]
2090    pub struct GetJSONWebKeys(RequestBuilder<crate::model::GetJSONWebKeysRequest>);
2091
2092    impl GetJSONWebKeys {
2093        pub(crate) fn new(
2094            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2095        ) -> Self {
2096            Self(RequestBuilder::new(stub))
2097        }
2098
2099        /// Sets the full request, replacing any prior values.
2100        pub fn with_request<V: Into<crate::model::GetJSONWebKeysRequest>>(mut self, v: V) -> Self {
2101            self.0.request = v.into();
2102            self
2103        }
2104
2105        /// Sets all the options, replacing any prior values.
2106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2107            self.0.options = v.into();
2108            self
2109        }
2110
2111        /// Sends the request.
2112        pub async fn send(self) -> Result<crate::model::GetJSONWebKeysResponse> {
2113            (*self.0.stub)
2114                .get_json_web_keys(self.0.request, self.0.options)
2115                .await
2116                .map(gax::response::Response::into_body)
2117        }
2118
2119        /// Sets the value of [parent][crate::model::GetJSONWebKeysRequest::parent].
2120        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121            self.0.request.parent = v.into();
2122            self
2123        }
2124    }
2125
2126    #[doc(hidden)]
2127    impl gax::options::internal::RequestBuilder for GetJSONWebKeys {
2128        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2129            &mut self.0.options
2130        }
2131    }
2132
2133    /// The request builder for [ClusterManager::list_node_pools][crate::client::ClusterManager::list_node_pools] calls.
2134    ///
2135    /// # Example
2136    /// ```no_run
2137    /// # use google_cloud_container_v1::builder;
2138    /// use builder::cluster_manager::ListNodePools;
2139    /// # tokio_test::block_on(async {
2140    ///
2141    /// let builder = prepare_request_builder();
2142    /// let response = builder.send().await?;
2143    /// # gax::Result::<()>::Ok(()) });
2144    ///
2145    /// fn prepare_request_builder() -> ListNodePools {
2146    ///   # panic!();
2147    ///   // ... details omitted ...
2148    /// }
2149    /// ```
2150    #[derive(Clone, Debug)]
2151    pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
2152
2153    impl ListNodePools {
2154        pub(crate) fn new(
2155            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2156        ) -> Self {
2157            Self(RequestBuilder::new(stub))
2158        }
2159
2160        /// Sets the full request, replacing any prior values.
2161        pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
2162            self.0.request = v.into();
2163            self
2164        }
2165
2166        /// Sets all the options, replacing any prior values.
2167        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2168            self.0.options = v.into();
2169            self
2170        }
2171
2172        /// Sends the request.
2173        pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
2174            (*self.0.stub)
2175                .list_node_pools(self.0.request, self.0.options)
2176                .await
2177                .map(gax::response::Response::into_body)
2178        }
2179
2180        /// Sets the value of [project_id][crate::model::ListNodePoolsRequest::project_id].
2181        #[deprecated]
2182        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2183            self.0.request.project_id = v.into();
2184            self
2185        }
2186
2187        /// Sets the value of [zone][crate::model::ListNodePoolsRequest::zone].
2188        #[deprecated]
2189        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190            self.0.request.zone = v.into();
2191            self
2192        }
2193
2194        /// Sets the value of [cluster_id][crate::model::ListNodePoolsRequest::cluster_id].
2195        #[deprecated]
2196        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2197            self.0.request.cluster_id = v.into();
2198            self
2199        }
2200
2201        /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
2202        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2203            self.0.request.parent = v.into();
2204            self
2205        }
2206    }
2207
2208    #[doc(hidden)]
2209    impl gax::options::internal::RequestBuilder for ListNodePools {
2210        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2211            &mut self.0.options
2212        }
2213    }
2214
2215    /// The request builder for [ClusterManager::get_node_pool][crate::client::ClusterManager::get_node_pool] calls.
2216    ///
2217    /// # Example
2218    /// ```no_run
2219    /// # use google_cloud_container_v1::builder;
2220    /// use builder::cluster_manager::GetNodePool;
2221    /// # tokio_test::block_on(async {
2222    ///
2223    /// let builder = prepare_request_builder();
2224    /// let response = builder.send().await?;
2225    /// # gax::Result::<()>::Ok(()) });
2226    ///
2227    /// fn prepare_request_builder() -> GetNodePool {
2228    ///   # panic!();
2229    ///   // ... details omitted ...
2230    /// }
2231    /// ```
2232    #[derive(Clone, Debug)]
2233    pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
2234
2235    impl GetNodePool {
2236        pub(crate) fn new(
2237            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2238        ) -> Self {
2239            Self(RequestBuilder::new(stub))
2240        }
2241
2242        /// Sets the full request, replacing any prior values.
2243        pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
2244            self.0.request = v.into();
2245            self
2246        }
2247
2248        /// Sets all the options, replacing any prior values.
2249        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2250            self.0.options = v.into();
2251            self
2252        }
2253
2254        /// Sends the request.
2255        pub async fn send(self) -> Result<crate::model::NodePool> {
2256            (*self.0.stub)
2257                .get_node_pool(self.0.request, self.0.options)
2258                .await
2259                .map(gax::response::Response::into_body)
2260        }
2261
2262        /// Sets the value of [project_id][crate::model::GetNodePoolRequest::project_id].
2263        #[deprecated]
2264        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2265            self.0.request.project_id = v.into();
2266            self
2267        }
2268
2269        /// Sets the value of [zone][crate::model::GetNodePoolRequest::zone].
2270        #[deprecated]
2271        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2272            self.0.request.zone = v.into();
2273            self
2274        }
2275
2276        /// Sets the value of [cluster_id][crate::model::GetNodePoolRequest::cluster_id].
2277        #[deprecated]
2278        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2279            self.0.request.cluster_id = v.into();
2280            self
2281        }
2282
2283        /// Sets the value of [node_pool_id][crate::model::GetNodePoolRequest::node_pool_id].
2284        #[deprecated]
2285        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2286            self.0.request.node_pool_id = v.into();
2287            self
2288        }
2289
2290        /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
2291        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292            self.0.request.name = v.into();
2293            self
2294        }
2295    }
2296
2297    #[doc(hidden)]
2298    impl gax::options::internal::RequestBuilder for GetNodePool {
2299        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2300            &mut self.0.options
2301        }
2302    }
2303
2304    /// The request builder for [ClusterManager::create_node_pool][crate::client::ClusterManager::create_node_pool] calls.
2305    ///
2306    /// # Example
2307    /// ```no_run
2308    /// # use google_cloud_container_v1::builder;
2309    /// use builder::cluster_manager::CreateNodePool;
2310    /// # tokio_test::block_on(async {
2311    ///
2312    /// let builder = prepare_request_builder();
2313    /// let response = builder.send().await?;
2314    /// # gax::Result::<()>::Ok(()) });
2315    ///
2316    /// fn prepare_request_builder() -> CreateNodePool {
2317    ///   # panic!();
2318    ///   // ... details omitted ...
2319    /// }
2320    /// ```
2321    #[derive(Clone, Debug)]
2322    pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
2323
2324    impl CreateNodePool {
2325        pub(crate) fn new(
2326            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2327        ) -> Self {
2328            Self(RequestBuilder::new(stub))
2329        }
2330
2331        /// Sets the full request, replacing any prior values.
2332        pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
2333            self.0.request = v.into();
2334            self
2335        }
2336
2337        /// Sets all the options, replacing any prior values.
2338        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2339            self.0.options = v.into();
2340            self
2341        }
2342
2343        /// Sends the request.
2344        pub async fn send(self) -> Result<crate::model::Operation> {
2345            (*self.0.stub)
2346                .create_node_pool(self.0.request, self.0.options)
2347                .await
2348                .map(gax::response::Response::into_body)
2349        }
2350
2351        /// Sets the value of [project_id][crate::model::CreateNodePoolRequest::project_id].
2352        #[deprecated]
2353        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2354            self.0.request.project_id = v.into();
2355            self
2356        }
2357
2358        /// Sets the value of [zone][crate::model::CreateNodePoolRequest::zone].
2359        #[deprecated]
2360        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2361            self.0.request.zone = v.into();
2362            self
2363        }
2364
2365        /// Sets the value of [cluster_id][crate::model::CreateNodePoolRequest::cluster_id].
2366        #[deprecated]
2367        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368            self.0.request.cluster_id = v.into();
2369            self
2370        }
2371
2372        /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
2373        ///
2374        /// This is a **required** field for requests.
2375        pub fn set_node_pool<T>(mut self, v: T) -> Self
2376        where
2377            T: std::convert::Into<crate::model::NodePool>,
2378        {
2379            self.0.request.node_pool = std::option::Option::Some(v.into());
2380            self
2381        }
2382
2383        /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
2384        ///
2385        /// This is a **required** field for requests.
2386        pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
2387        where
2388            T: std::convert::Into<crate::model::NodePool>,
2389        {
2390            self.0.request.node_pool = v.map(|x| x.into());
2391            self
2392        }
2393
2394        /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
2395        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2396            self.0.request.parent = v.into();
2397            self
2398        }
2399    }
2400
2401    #[doc(hidden)]
2402    impl gax::options::internal::RequestBuilder for CreateNodePool {
2403        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2404            &mut self.0.options
2405        }
2406    }
2407
2408    /// The request builder for [ClusterManager::delete_node_pool][crate::client::ClusterManager::delete_node_pool] calls.
2409    ///
2410    /// # Example
2411    /// ```no_run
2412    /// # use google_cloud_container_v1::builder;
2413    /// use builder::cluster_manager::DeleteNodePool;
2414    /// # tokio_test::block_on(async {
2415    ///
2416    /// let builder = prepare_request_builder();
2417    /// let response = builder.send().await?;
2418    /// # gax::Result::<()>::Ok(()) });
2419    ///
2420    /// fn prepare_request_builder() -> DeleteNodePool {
2421    ///   # panic!();
2422    ///   // ... details omitted ...
2423    /// }
2424    /// ```
2425    #[derive(Clone, Debug)]
2426    pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
2427
2428    impl DeleteNodePool {
2429        pub(crate) fn new(
2430            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2431        ) -> Self {
2432            Self(RequestBuilder::new(stub))
2433        }
2434
2435        /// Sets the full request, replacing any prior values.
2436        pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
2437            self.0.request = v.into();
2438            self
2439        }
2440
2441        /// Sets all the options, replacing any prior values.
2442        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2443            self.0.options = v.into();
2444            self
2445        }
2446
2447        /// Sends the request.
2448        pub async fn send(self) -> Result<crate::model::Operation> {
2449            (*self.0.stub)
2450                .delete_node_pool(self.0.request, self.0.options)
2451                .await
2452                .map(gax::response::Response::into_body)
2453        }
2454
2455        /// Sets the value of [project_id][crate::model::DeleteNodePoolRequest::project_id].
2456        #[deprecated]
2457        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458            self.0.request.project_id = v.into();
2459            self
2460        }
2461
2462        /// Sets the value of [zone][crate::model::DeleteNodePoolRequest::zone].
2463        #[deprecated]
2464        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2465            self.0.request.zone = v.into();
2466            self
2467        }
2468
2469        /// Sets the value of [cluster_id][crate::model::DeleteNodePoolRequest::cluster_id].
2470        #[deprecated]
2471        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2472            self.0.request.cluster_id = v.into();
2473            self
2474        }
2475
2476        /// Sets the value of [node_pool_id][crate::model::DeleteNodePoolRequest::node_pool_id].
2477        #[deprecated]
2478        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479            self.0.request.node_pool_id = v.into();
2480            self
2481        }
2482
2483        /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
2484        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2485            self.0.request.name = v.into();
2486            self
2487        }
2488    }
2489
2490    #[doc(hidden)]
2491    impl gax::options::internal::RequestBuilder for DeleteNodePool {
2492        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2493            &mut self.0.options
2494        }
2495    }
2496
2497    /// The request builder for [ClusterManager::complete_node_pool_upgrade][crate::client::ClusterManager::complete_node_pool_upgrade] calls.
2498    ///
2499    /// # Example
2500    /// ```no_run
2501    /// # use google_cloud_container_v1::builder;
2502    /// use builder::cluster_manager::CompleteNodePoolUpgrade;
2503    /// # tokio_test::block_on(async {
2504    ///
2505    /// let builder = prepare_request_builder();
2506    /// let response = builder.send().await?;
2507    /// # gax::Result::<()>::Ok(()) });
2508    ///
2509    /// fn prepare_request_builder() -> CompleteNodePoolUpgrade {
2510    ///   # panic!();
2511    ///   // ... details omitted ...
2512    /// }
2513    /// ```
2514    #[derive(Clone, Debug)]
2515    pub struct CompleteNodePoolUpgrade(
2516        RequestBuilder<crate::model::CompleteNodePoolUpgradeRequest>,
2517    );
2518
2519    impl CompleteNodePoolUpgrade {
2520        pub(crate) fn new(
2521            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2522        ) -> Self {
2523            Self(RequestBuilder::new(stub))
2524        }
2525
2526        /// Sets the full request, replacing any prior values.
2527        pub fn with_request<V: Into<crate::model::CompleteNodePoolUpgradeRequest>>(
2528            mut self,
2529            v: V,
2530        ) -> Self {
2531            self.0.request = v.into();
2532            self
2533        }
2534
2535        /// Sets all the options, replacing any prior values.
2536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2537            self.0.options = v.into();
2538            self
2539        }
2540
2541        /// Sends the request.
2542        pub async fn send(self) -> Result<()> {
2543            (*self.0.stub)
2544                .complete_node_pool_upgrade(self.0.request, self.0.options)
2545                .await
2546                .map(gax::response::Response::into_body)
2547        }
2548
2549        /// Sets the value of [name][crate::model::CompleteNodePoolUpgradeRequest::name].
2550        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551            self.0.request.name = v.into();
2552            self
2553        }
2554    }
2555
2556    #[doc(hidden)]
2557    impl gax::options::internal::RequestBuilder for CompleteNodePoolUpgrade {
2558        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2559            &mut self.0.options
2560        }
2561    }
2562
2563    /// The request builder for [ClusterManager::rollback_node_pool_upgrade][crate::client::ClusterManager::rollback_node_pool_upgrade] calls.
2564    ///
2565    /// # Example
2566    /// ```no_run
2567    /// # use google_cloud_container_v1::builder;
2568    /// use builder::cluster_manager::RollbackNodePoolUpgrade;
2569    /// # tokio_test::block_on(async {
2570    ///
2571    /// let builder = prepare_request_builder();
2572    /// let response = builder.send().await?;
2573    /// # gax::Result::<()>::Ok(()) });
2574    ///
2575    /// fn prepare_request_builder() -> RollbackNodePoolUpgrade {
2576    ///   # panic!();
2577    ///   // ... details omitted ...
2578    /// }
2579    /// ```
2580    #[derive(Clone, Debug)]
2581    pub struct RollbackNodePoolUpgrade(
2582        RequestBuilder<crate::model::RollbackNodePoolUpgradeRequest>,
2583    );
2584
2585    impl RollbackNodePoolUpgrade {
2586        pub(crate) fn new(
2587            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2588        ) -> Self {
2589            Self(RequestBuilder::new(stub))
2590        }
2591
2592        /// Sets the full request, replacing any prior values.
2593        pub fn with_request<V: Into<crate::model::RollbackNodePoolUpgradeRequest>>(
2594            mut self,
2595            v: V,
2596        ) -> Self {
2597            self.0.request = v.into();
2598            self
2599        }
2600
2601        /// Sets all the options, replacing any prior values.
2602        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2603            self.0.options = v.into();
2604            self
2605        }
2606
2607        /// Sends the request.
2608        pub async fn send(self) -> Result<crate::model::Operation> {
2609            (*self.0.stub)
2610                .rollback_node_pool_upgrade(self.0.request, self.0.options)
2611                .await
2612                .map(gax::response::Response::into_body)
2613        }
2614
2615        /// Sets the value of [project_id][crate::model::RollbackNodePoolUpgradeRequest::project_id].
2616        #[deprecated]
2617        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2618            self.0.request.project_id = v.into();
2619            self
2620        }
2621
2622        /// Sets the value of [zone][crate::model::RollbackNodePoolUpgradeRequest::zone].
2623        #[deprecated]
2624        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2625            self.0.request.zone = v.into();
2626            self
2627        }
2628
2629        /// Sets the value of [cluster_id][crate::model::RollbackNodePoolUpgradeRequest::cluster_id].
2630        #[deprecated]
2631        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2632            self.0.request.cluster_id = v.into();
2633            self
2634        }
2635
2636        /// Sets the value of [node_pool_id][crate::model::RollbackNodePoolUpgradeRequest::node_pool_id].
2637        #[deprecated]
2638        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639            self.0.request.node_pool_id = v.into();
2640            self
2641        }
2642
2643        /// Sets the value of [name][crate::model::RollbackNodePoolUpgradeRequest::name].
2644        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645            self.0.request.name = v.into();
2646            self
2647        }
2648
2649        /// Sets the value of [respect_pdb][crate::model::RollbackNodePoolUpgradeRequest::respect_pdb].
2650        pub fn set_respect_pdb<T: Into<bool>>(mut self, v: T) -> Self {
2651            self.0.request.respect_pdb = v.into();
2652            self
2653        }
2654    }
2655
2656    #[doc(hidden)]
2657    impl gax::options::internal::RequestBuilder for RollbackNodePoolUpgrade {
2658        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2659            &mut self.0.options
2660        }
2661    }
2662
2663    /// The request builder for [ClusterManager::set_node_pool_management][crate::client::ClusterManager::set_node_pool_management] calls.
2664    ///
2665    /// # Example
2666    /// ```no_run
2667    /// # use google_cloud_container_v1::builder;
2668    /// use builder::cluster_manager::SetNodePoolManagement;
2669    /// # tokio_test::block_on(async {
2670    ///
2671    /// let builder = prepare_request_builder();
2672    /// let response = builder.send().await?;
2673    /// # gax::Result::<()>::Ok(()) });
2674    ///
2675    /// fn prepare_request_builder() -> SetNodePoolManagement {
2676    ///   # panic!();
2677    ///   // ... details omitted ...
2678    /// }
2679    /// ```
2680    #[derive(Clone, Debug)]
2681    pub struct SetNodePoolManagement(RequestBuilder<crate::model::SetNodePoolManagementRequest>);
2682
2683    impl SetNodePoolManagement {
2684        pub(crate) fn new(
2685            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2686        ) -> Self {
2687            Self(RequestBuilder::new(stub))
2688        }
2689
2690        /// Sets the full request, replacing any prior values.
2691        pub fn with_request<V: Into<crate::model::SetNodePoolManagementRequest>>(
2692            mut self,
2693            v: V,
2694        ) -> Self {
2695            self.0.request = v.into();
2696            self
2697        }
2698
2699        /// Sets all the options, replacing any prior values.
2700        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2701            self.0.options = v.into();
2702            self
2703        }
2704
2705        /// Sends the request.
2706        pub async fn send(self) -> Result<crate::model::Operation> {
2707            (*self.0.stub)
2708                .set_node_pool_management(self.0.request, self.0.options)
2709                .await
2710                .map(gax::response::Response::into_body)
2711        }
2712
2713        /// Sets the value of [project_id][crate::model::SetNodePoolManagementRequest::project_id].
2714        #[deprecated]
2715        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2716            self.0.request.project_id = v.into();
2717            self
2718        }
2719
2720        /// Sets the value of [zone][crate::model::SetNodePoolManagementRequest::zone].
2721        #[deprecated]
2722        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2723            self.0.request.zone = v.into();
2724            self
2725        }
2726
2727        /// Sets the value of [cluster_id][crate::model::SetNodePoolManagementRequest::cluster_id].
2728        #[deprecated]
2729        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2730            self.0.request.cluster_id = v.into();
2731            self
2732        }
2733
2734        /// Sets the value of [node_pool_id][crate::model::SetNodePoolManagementRequest::node_pool_id].
2735        #[deprecated]
2736        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2737            self.0.request.node_pool_id = v.into();
2738            self
2739        }
2740
2741        /// Sets the value of [management][crate::model::SetNodePoolManagementRequest::management].
2742        ///
2743        /// This is a **required** field for requests.
2744        pub fn set_management<T>(mut self, v: T) -> Self
2745        where
2746            T: std::convert::Into<crate::model::NodeManagement>,
2747        {
2748            self.0.request.management = std::option::Option::Some(v.into());
2749            self
2750        }
2751
2752        /// Sets or clears the value of [management][crate::model::SetNodePoolManagementRequest::management].
2753        ///
2754        /// This is a **required** field for requests.
2755        pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
2756        where
2757            T: std::convert::Into<crate::model::NodeManagement>,
2758        {
2759            self.0.request.management = v.map(|x| x.into());
2760            self
2761        }
2762
2763        /// Sets the value of [name][crate::model::SetNodePoolManagementRequest::name].
2764        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2765            self.0.request.name = v.into();
2766            self
2767        }
2768    }
2769
2770    #[doc(hidden)]
2771    impl gax::options::internal::RequestBuilder for SetNodePoolManagement {
2772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2773            &mut self.0.options
2774        }
2775    }
2776
2777    /// The request builder for [ClusterManager::set_labels][crate::client::ClusterManager::set_labels] calls.
2778    ///
2779    /// # Example
2780    /// ```no_run
2781    /// # use google_cloud_container_v1::builder;
2782    /// use builder::cluster_manager::SetLabels;
2783    /// # tokio_test::block_on(async {
2784    ///
2785    /// let builder = prepare_request_builder();
2786    /// let response = builder.send().await?;
2787    /// # gax::Result::<()>::Ok(()) });
2788    ///
2789    /// fn prepare_request_builder() -> SetLabels {
2790    ///   # panic!();
2791    ///   // ... details omitted ...
2792    /// }
2793    /// ```
2794    #[derive(Clone, Debug)]
2795    pub struct SetLabels(RequestBuilder<crate::model::SetLabelsRequest>);
2796
2797    impl SetLabels {
2798        pub(crate) fn new(
2799            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2800        ) -> Self {
2801            Self(RequestBuilder::new(stub))
2802        }
2803
2804        /// Sets the full request, replacing any prior values.
2805        pub fn with_request<V: Into<crate::model::SetLabelsRequest>>(mut self, v: V) -> Self {
2806            self.0.request = v.into();
2807            self
2808        }
2809
2810        /// Sets all the options, replacing any prior values.
2811        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2812            self.0.options = v.into();
2813            self
2814        }
2815
2816        /// Sends the request.
2817        pub async fn send(self) -> Result<crate::model::Operation> {
2818            (*self.0.stub)
2819                .set_labels(self.0.request, self.0.options)
2820                .await
2821                .map(gax::response::Response::into_body)
2822        }
2823
2824        /// Sets the value of [project_id][crate::model::SetLabelsRequest::project_id].
2825        #[deprecated]
2826        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2827            self.0.request.project_id = v.into();
2828            self
2829        }
2830
2831        /// Sets the value of [zone][crate::model::SetLabelsRequest::zone].
2832        #[deprecated]
2833        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2834            self.0.request.zone = v.into();
2835            self
2836        }
2837
2838        /// Sets the value of [cluster_id][crate::model::SetLabelsRequest::cluster_id].
2839        #[deprecated]
2840        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2841            self.0.request.cluster_id = v.into();
2842            self
2843        }
2844
2845        /// Sets the value of [resource_labels][crate::model::SetLabelsRequest::resource_labels].
2846        ///
2847        /// This is a **required** field for requests.
2848        pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
2849        where
2850            T: std::iter::IntoIterator<Item = (K, V)>,
2851            K: std::convert::Into<std::string::String>,
2852            V: std::convert::Into<std::string::String>,
2853        {
2854            self.0.request.resource_labels =
2855                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2856            self
2857        }
2858
2859        /// Sets the value of [label_fingerprint][crate::model::SetLabelsRequest::label_fingerprint].
2860        ///
2861        /// This is a **required** field for requests.
2862        pub fn set_label_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2863            self.0.request.label_fingerprint = v.into();
2864            self
2865        }
2866
2867        /// Sets the value of [name][crate::model::SetLabelsRequest::name].
2868        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869            self.0.request.name = v.into();
2870            self
2871        }
2872    }
2873
2874    #[doc(hidden)]
2875    impl gax::options::internal::RequestBuilder for SetLabels {
2876        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2877            &mut self.0.options
2878        }
2879    }
2880
2881    /// The request builder for [ClusterManager::set_legacy_abac][crate::client::ClusterManager::set_legacy_abac] calls.
2882    ///
2883    /// # Example
2884    /// ```no_run
2885    /// # use google_cloud_container_v1::builder;
2886    /// use builder::cluster_manager::SetLegacyAbac;
2887    /// # tokio_test::block_on(async {
2888    ///
2889    /// let builder = prepare_request_builder();
2890    /// let response = builder.send().await?;
2891    /// # gax::Result::<()>::Ok(()) });
2892    ///
2893    /// fn prepare_request_builder() -> SetLegacyAbac {
2894    ///   # panic!();
2895    ///   // ... details omitted ...
2896    /// }
2897    /// ```
2898    #[derive(Clone, Debug)]
2899    pub struct SetLegacyAbac(RequestBuilder<crate::model::SetLegacyAbacRequest>);
2900
2901    impl SetLegacyAbac {
2902        pub(crate) fn new(
2903            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2904        ) -> Self {
2905            Self(RequestBuilder::new(stub))
2906        }
2907
2908        /// Sets the full request, replacing any prior values.
2909        pub fn with_request<V: Into<crate::model::SetLegacyAbacRequest>>(mut self, v: V) -> Self {
2910            self.0.request = v.into();
2911            self
2912        }
2913
2914        /// Sets all the options, replacing any prior values.
2915        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2916            self.0.options = v.into();
2917            self
2918        }
2919
2920        /// Sends the request.
2921        pub async fn send(self) -> Result<crate::model::Operation> {
2922            (*self.0.stub)
2923                .set_legacy_abac(self.0.request, self.0.options)
2924                .await
2925                .map(gax::response::Response::into_body)
2926        }
2927
2928        /// Sets the value of [project_id][crate::model::SetLegacyAbacRequest::project_id].
2929        #[deprecated]
2930        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2931            self.0.request.project_id = v.into();
2932            self
2933        }
2934
2935        /// Sets the value of [zone][crate::model::SetLegacyAbacRequest::zone].
2936        #[deprecated]
2937        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2938            self.0.request.zone = v.into();
2939            self
2940        }
2941
2942        /// Sets the value of [cluster_id][crate::model::SetLegacyAbacRequest::cluster_id].
2943        #[deprecated]
2944        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2945            self.0.request.cluster_id = v.into();
2946            self
2947        }
2948
2949        /// Sets the value of [enabled][crate::model::SetLegacyAbacRequest::enabled].
2950        ///
2951        /// This is a **required** field for requests.
2952        pub fn set_enabled<T: Into<bool>>(mut self, v: T) -> Self {
2953            self.0.request.enabled = v.into();
2954            self
2955        }
2956
2957        /// Sets the value of [name][crate::model::SetLegacyAbacRequest::name].
2958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2959            self.0.request.name = v.into();
2960            self
2961        }
2962    }
2963
2964    #[doc(hidden)]
2965    impl gax::options::internal::RequestBuilder for SetLegacyAbac {
2966        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2967            &mut self.0.options
2968        }
2969    }
2970
2971    /// The request builder for [ClusterManager::start_ip_rotation][crate::client::ClusterManager::start_ip_rotation] calls.
2972    ///
2973    /// # Example
2974    /// ```no_run
2975    /// # use google_cloud_container_v1::builder;
2976    /// use builder::cluster_manager::StartIPRotation;
2977    /// # tokio_test::block_on(async {
2978    ///
2979    /// let builder = prepare_request_builder();
2980    /// let response = builder.send().await?;
2981    /// # gax::Result::<()>::Ok(()) });
2982    ///
2983    /// fn prepare_request_builder() -> StartIPRotation {
2984    ///   # panic!();
2985    ///   // ... details omitted ...
2986    /// }
2987    /// ```
2988    #[derive(Clone, Debug)]
2989    pub struct StartIPRotation(RequestBuilder<crate::model::StartIPRotationRequest>);
2990
2991    impl StartIPRotation {
2992        pub(crate) fn new(
2993            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2994        ) -> Self {
2995            Self(RequestBuilder::new(stub))
2996        }
2997
2998        /// Sets the full request, replacing any prior values.
2999        pub fn with_request<V: Into<crate::model::StartIPRotationRequest>>(mut self, v: V) -> Self {
3000            self.0.request = v.into();
3001            self
3002        }
3003
3004        /// Sets all the options, replacing any prior values.
3005        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3006            self.0.options = v.into();
3007            self
3008        }
3009
3010        /// Sends the request.
3011        pub async fn send(self) -> Result<crate::model::Operation> {
3012            (*self.0.stub)
3013                .start_ip_rotation(self.0.request, self.0.options)
3014                .await
3015                .map(gax::response::Response::into_body)
3016        }
3017
3018        /// Sets the value of [project_id][crate::model::StartIPRotationRequest::project_id].
3019        #[deprecated]
3020        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3021            self.0.request.project_id = v.into();
3022            self
3023        }
3024
3025        /// Sets the value of [zone][crate::model::StartIPRotationRequest::zone].
3026        #[deprecated]
3027        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3028            self.0.request.zone = v.into();
3029            self
3030        }
3031
3032        /// Sets the value of [cluster_id][crate::model::StartIPRotationRequest::cluster_id].
3033        #[deprecated]
3034        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3035            self.0.request.cluster_id = v.into();
3036            self
3037        }
3038
3039        /// Sets the value of [name][crate::model::StartIPRotationRequest::name].
3040        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3041            self.0.request.name = v.into();
3042            self
3043        }
3044
3045        /// Sets the value of [rotate_credentials][crate::model::StartIPRotationRequest::rotate_credentials].
3046        pub fn set_rotate_credentials<T: Into<bool>>(mut self, v: T) -> Self {
3047            self.0.request.rotate_credentials = v.into();
3048            self
3049        }
3050    }
3051
3052    #[doc(hidden)]
3053    impl gax::options::internal::RequestBuilder for StartIPRotation {
3054        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3055            &mut self.0.options
3056        }
3057    }
3058
3059    /// The request builder for [ClusterManager::complete_ip_rotation][crate::client::ClusterManager::complete_ip_rotation] calls.
3060    ///
3061    /// # Example
3062    /// ```no_run
3063    /// # use google_cloud_container_v1::builder;
3064    /// use builder::cluster_manager::CompleteIPRotation;
3065    /// # tokio_test::block_on(async {
3066    ///
3067    /// let builder = prepare_request_builder();
3068    /// let response = builder.send().await?;
3069    /// # gax::Result::<()>::Ok(()) });
3070    ///
3071    /// fn prepare_request_builder() -> CompleteIPRotation {
3072    ///   # panic!();
3073    ///   // ... details omitted ...
3074    /// }
3075    /// ```
3076    #[derive(Clone, Debug)]
3077    pub struct CompleteIPRotation(RequestBuilder<crate::model::CompleteIPRotationRequest>);
3078
3079    impl CompleteIPRotation {
3080        pub(crate) fn new(
3081            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3082        ) -> Self {
3083            Self(RequestBuilder::new(stub))
3084        }
3085
3086        /// Sets the full request, replacing any prior values.
3087        pub fn with_request<V: Into<crate::model::CompleteIPRotationRequest>>(
3088            mut self,
3089            v: V,
3090        ) -> Self {
3091            self.0.request = v.into();
3092            self
3093        }
3094
3095        /// Sets all the options, replacing any prior values.
3096        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3097            self.0.options = v.into();
3098            self
3099        }
3100
3101        /// Sends the request.
3102        pub async fn send(self) -> Result<crate::model::Operation> {
3103            (*self.0.stub)
3104                .complete_ip_rotation(self.0.request, self.0.options)
3105                .await
3106                .map(gax::response::Response::into_body)
3107        }
3108
3109        /// Sets the value of [project_id][crate::model::CompleteIPRotationRequest::project_id].
3110        #[deprecated]
3111        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3112            self.0.request.project_id = v.into();
3113            self
3114        }
3115
3116        /// Sets the value of [zone][crate::model::CompleteIPRotationRequest::zone].
3117        #[deprecated]
3118        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3119            self.0.request.zone = v.into();
3120            self
3121        }
3122
3123        /// Sets the value of [cluster_id][crate::model::CompleteIPRotationRequest::cluster_id].
3124        #[deprecated]
3125        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3126            self.0.request.cluster_id = v.into();
3127            self
3128        }
3129
3130        /// Sets the value of [name][crate::model::CompleteIPRotationRequest::name].
3131        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132            self.0.request.name = v.into();
3133            self
3134        }
3135    }
3136
3137    #[doc(hidden)]
3138    impl gax::options::internal::RequestBuilder for CompleteIPRotation {
3139        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3140            &mut self.0.options
3141        }
3142    }
3143
3144    /// The request builder for [ClusterManager::set_node_pool_size][crate::client::ClusterManager::set_node_pool_size] calls.
3145    ///
3146    /// # Example
3147    /// ```no_run
3148    /// # use google_cloud_container_v1::builder;
3149    /// use builder::cluster_manager::SetNodePoolSize;
3150    /// # tokio_test::block_on(async {
3151    ///
3152    /// let builder = prepare_request_builder();
3153    /// let response = builder.send().await?;
3154    /// # gax::Result::<()>::Ok(()) });
3155    ///
3156    /// fn prepare_request_builder() -> SetNodePoolSize {
3157    ///   # panic!();
3158    ///   // ... details omitted ...
3159    /// }
3160    /// ```
3161    #[derive(Clone, Debug)]
3162    pub struct SetNodePoolSize(RequestBuilder<crate::model::SetNodePoolSizeRequest>);
3163
3164    impl SetNodePoolSize {
3165        pub(crate) fn new(
3166            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3167        ) -> Self {
3168            Self(RequestBuilder::new(stub))
3169        }
3170
3171        /// Sets the full request, replacing any prior values.
3172        pub fn with_request<V: Into<crate::model::SetNodePoolSizeRequest>>(mut self, v: V) -> Self {
3173            self.0.request = v.into();
3174            self
3175        }
3176
3177        /// Sets all the options, replacing any prior values.
3178        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3179            self.0.options = v.into();
3180            self
3181        }
3182
3183        /// Sends the request.
3184        pub async fn send(self) -> Result<crate::model::Operation> {
3185            (*self.0.stub)
3186                .set_node_pool_size(self.0.request, self.0.options)
3187                .await
3188                .map(gax::response::Response::into_body)
3189        }
3190
3191        /// Sets the value of [project_id][crate::model::SetNodePoolSizeRequest::project_id].
3192        #[deprecated]
3193        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3194            self.0.request.project_id = v.into();
3195            self
3196        }
3197
3198        /// Sets the value of [zone][crate::model::SetNodePoolSizeRequest::zone].
3199        #[deprecated]
3200        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3201            self.0.request.zone = v.into();
3202            self
3203        }
3204
3205        /// Sets the value of [cluster_id][crate::model::SetNodePoolSizeRequest::cluster_id].
3206        #[deprecated]
3207        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3208            self.0.request.cluster_id = v.into();
3209            self
3210        }
3211
3212        /// Sets the value of [node_pool_id][crate::model::SetNodePoolSizeRequest::node_pool_id].
3213        #[deprecated]
3214        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3215            self.0.request.node_pool_id = v.into();
3216            self
3217        }
3218
3219        /// Sets the value of [node_count][crate::model::SetNodePoolSizeRequest::node_count].
3220        ///
3221        /// This is a **required** field for requests.
3222        pub fn set_node_count<T: Into<i32>>(mut self, v: T) -> Self {
3223            self.0.request.node_count = v.into();
3224            self
3225        }
3226
3227        /// Sets the value of [name][crate::model::SetNodePoolSizeRequest::name].
3228        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3229            self.0.request.name = v.into();
3230            self
3231        }
3232    }
3233
3234    #[doc(hidden)]
3235    impl gax::options::internal::RequestBuilder for SetNodePoolSize {
3236        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3237            &mut self.0.options
3238        }
3239    }
3240
3241    /// The request builder for [ClusterManager::set_network_policy][crate::client::ClusterManager::set_network_policy] calls.
3242    ///
3243    /// # Example
3244    /// ```no_run
3245    /// # use google_cloud_container_v1::builder;
3246    /// use builder::cluster_manager::SetNetworkPolicy;
3247    /// # tokio_test::block_on(async {
3248    ///
3249    /// let builder = prepare_request_builder();
3250    /// let response = builder.send().await?;
3251    /// # gax::Result::<()>::Ok(()) });
3252    ///
3253    /// fn prepare_request_builder() -> SetNetworkPolicy {
3254    ///   # panic!();
3255    ///   // ... details omitted ...
3256    /// }
3257    /// ```
3258    #[derive(Clone, Debug)]
3259    pub struct SetNetworkPolicy(RequestBuilder<crate::model::SetNetworkPolicyRequest>);
3260
3261    impl SetNetworkPolicy {
3262        pub(crate) fn new(
3263            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3264        ) -> Self {
3265            Self(RequestBuilder::new(stub))
3266        }
3267
3268        /// Sets the full request, replacing any prior values.
3269        pub fn with_request<V: Into<crate::model::SetNetworkPolicyRequest>>(
3270            mut self,
3271            v: V,
3272        ) -> Self {
3273            self.0.request = v.into();
3274            self
3275        }
3276
3277        /// Sets all the options, replacing any prior values.
3278        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3279            self.0.options = v.into();
3280            self
3281        }
3282
3283        /// Sends the request.
3284        pub async fn send(self) -> Result<crate::model::Operation> {
3285            (*self.0.stub)
3286                .set_network_policy(self.0.request, self.0.options)
3287                .await
3288                .map(gax::response::Response::into_body)
3289        }
3290
3291        /// Sets the value of [project_id][crate::model::SetNetworkPolicyRequest::project_id].
3292        #[deprecated]
3293        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3294            self.0.request.project_id = v.into();
3295            self
3296        }
3297
3298        /// Sets the value of [zone][crate::model::SetNetworkPolicyRequest::zone].
3299        #[deprecated]
3300        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3301            self.0.request.zone = v.into();
3302            self
3303        }
3304
3305        /// Sets the value of [cluster_id][crate::model::SetNetworkPolicyRequest::cluster_id].
3306        #[deprecated]
3307        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3308            self.0.request.cluster_id = v.into();
3309            self
3310        }
3311
3312        /// Sets the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
3313        ///
3314        /// This is a **required** field for requests.
3315        pub fn set_network_policy<T>(mut self, v: T) -> Self
3316        where
3317            T: std::convert::Into<crate::model::NetworkPolicy>,
3318        {
3319            self.0.request.network_policy = std::option::Option::Some(v.into());
3320            self
3321        }
3322
3323        /// Sets or clears the value of [network_policy][crate::model::SetNetworkPolicyRequest::network_policy].
3324        ///
3325        /// This is a **required** field for requests.
3326        pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
3327        where
3328            T: std::convert::Into<crate::model::NetworkPolicy>,
3329        {
3330            self.0.request.network_policy = v.map(|x| x.into());
3331            self
3332        }
3333
3334        /// Sets the value of [name][crate::model::SetNetworkPolicyRequest::name].
3335        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3336            self.0.request.name = v.into();
3337            self
3338        }
3339    }
3340
3341    #[doc(hidden)]
3342    impl gax::options::internal::RequestBuilder for SetNetworkPolicy {
3343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3344            &mut self.0.options
3345        }
3346    }
3347
3348    /// The request builder for [ClusterManager::set_maintenance_policy][crate::client::ClusterManager::set_maintenance_policy] calls.
3349    ///
3350    /// # Example
3351    /// ```no_run
3352    /// # use google_cloud_container_v1::builder;
3353    /// use builder::cluster_manager::SetMaintenancePolicy;
3354    /// # tokio_test::block_on(async {
3355    ///
3356    /// let builder = prepare_request_builder();
3357    /// let response = builder.send().await?;
3358    /// # gax::Result::<()>::Ok(()) });
3359    ///
3360    /// fn prepare_request_builder() -> SetMaintenancePolicy {
3361    ///   # panic!();
3362    ///   // ... details omitted ...
3363    /// }
3364    /// ```
3365    #[derive(Clone, Debug)]
3366    pub struct SetMaintenancePolicy(RequestBuilder<crate::model::SetMaintenancePolicyRequest>);
3367
3368    impl SetMaintenancePolicy {
3369        pub(crate) fn new(
3370            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3371        ) -> Self {
3372            Self(RequestBuilder::new(stub))
3373        }
3374
3375        /// Sets the full request, replacing any prior values.
3376        pub fn with_request<V: Into<crate::model::SetMaintenancePolicyRequest>>(
3377            mut self,
3378            v: V,
3379        ) -> Self {
3380            self.0.request = v.into();
3381            self
3382        }
3383
3384        /// Sets all the options, replacing any prior values.
3385        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3386            self.0.options = v.into();
3387            self
3388        }
3389
3390        /// Sends the request.
3391        pub async fn send(self) -> Result<crate::model::Operation> {
3392            (*self.0.stub)
3393                .set_maintenance_policy(self.0.request, self.0.options)
3394                .await
3395                .map(gax::response::Response::into_body)
3396        }
3397
3398        /// Sets the value of [project_id][crate::model::SetMaintenancePolicyRequest::project_id].
3399        ///
3400        /// This is a **required** field for requests.
3401        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402            self.0.request.project_id = v.into();
3403            self
3404        }
3405
3406        /// Sets the value of [zone][crate::model::SetMaintenancePolicyRequest::zone].
3407        ///
3408        /// This is a **required** field for requests.
3409        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3410            self.0.request.zone = v.into();
3411            self
3412        }
3413
3414        /// Sets the value of [cluster_id][crate::model::SetMaintenancePolicyRequest::cluster_id].
3415        ///
3416        /// This is a **required** field for requests.
3417        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3418            self.0.request.cluster_id = v.into();
3419            self
3420        }
3421
3422        /// Sets the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
3423        ///
3424        /// This is a **required** field for requests.
3425        pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
3426        where
3427            T: std::convert::Into<crate::model::MaintenancePolicy>,
3428        {
3429            self.0.request.maintenance_policy = std::option::Option::Some(v.into());
3430            self
3431        }
3432
3433        /// Sets or clears the value of [maintenance_policy][crate::model::SetMaintenancePolicyRequest::maintenance_policy].
3434        ///
3435        /// This is a **required** field for requests.
3436        pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
3437        where
3438            T: std::convert::Into<crate::model::MaintenancePolicy>,
3439        {
3440            self.0.request.maintenance_policy = v.map(|x| x.into());
3441            self
3442        }
3443
3444        /// Sets the value of [name][crate::model::SetMaintenancePolicyRequest::name].
3445        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3446            self.0.request.name = v.into();
3447            self
3448        }
3449    }
3450
3451    #[doc(hidden)]
3452    impl gax::options::internal::RequestBuilder for SetMaintenancePolicy {
3453        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3454            &mut self.0.options
3455        }
3456    }
3457
3458    /// The request builder for [ClusterManager::list_usable_subnetworks][crate::client::ClusterManager::list_usable_subnetworks] calls.
3459    ///
3460    /// # Example
3461    /// ```no_run
3462    /// # use google_cloud_container_v1::builder;
3463    /// use builder::cluster_manager::ListUsableSubnetworks;
3464    /// # tokio_test::block_on(async {
3465    /// use gax::paginator::ItemPaginator;
3466    ///
3467    /// let builder = prepare_request_builder();
3468    /// let mut items = builder.by_item();
3469    /// while let Some(result) = items.next().await {
3470    ///   let item = result?;
3471    /// }
3472    /// # gax::Result::<()>::Ok(()) });
3473    ///
3474    /// fn prepare_request_builder() -> ListUsableSubnetworks {
3475    ///   # panic!();
3476    ///   // ... details omitted ...
3477    /// }
3478    /// ```
3479    #[derive(Clone, Debug)]
3480    pub struct ListUsableSubnetworks(RequestBuilder<crate::model::ListUsableSubnetworksRequest>);
3481
3482    impl ListUsableSubnetworks {
3483        pub(crate) fn new(
3484            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3485        ) -> Self {
3486            Self(RequestBuilder::new(stub))
3487        }
3488
3489        /// Sets the full request, replacing any prior values.
3490        pub fn with_request<V: Into<crate::model::ListUsableSubnetworksRequest>>(
3491            mut self,
3492            v: V,
3493        ) -> Self {
3494            self.0.request = v.into();
3495            self
3496        }
3497
3498        /// Sets all the options, replacing any prior values.
3499        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3500            self.0.options = v.into();
3501            self
3502        }
3503
3504        /// Sends the request.
3505        pub async fn send(self) -> Result<crate::model::ListUsableSubnetworksResponse> {
3506            (*self.0.stub)
3507                .list_usable_subnetworks(self.0.request, self.0.options)
3508                .await
3509                .map(gax::response::Response::into_body)
3510        }
3511
3512        /// Streams each page in the collection.
3513        pub fn by_page(
3514            self,
3515        ) -> impl gax::paginator::Paginator<crate::model::ListUsableSubnetworksResponse, gax::error::Error>
3516        {
3517            use std::clone::Clone;
3518            let token = self.0.request.page_token.clone();
3519            let execute = move |token: String| {
3520                let mut builder = self.clone();
3521                builder.0.request = builder.0.request.set_page_token(token);
3522                builder.send()
3523            };
3524            gax::paginator::internal::new_paginator(token, execute)
3525        }
3526
3527        /// Streams each item in the collection.
3528        pub fn by_item(
3529            self,
3530        ) -> impl gax::paginator::ItemPaginator<
3531            crate::model::ListUsableSubnetworksResponse,
3532            gax::error::Error,
3533        > {
3534            use gax::paginator::Paginator;
3535            self.by_page().items()
3536        }
3537
3538        /// Sets the value of [parent][crate::model::ListUsableSubnetworksRequest::parent].
3539        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3540            self.0.request.parent = v.into();
3541            self
3542        }
3543
3544        /// Sets the value of [filter][crate::model::ListUsableSubnetworksRequest::filter].
3545        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3546            self.0.request.filter = v.into();
3547            self
3548        }
3549
3550        /// Sets the value of [page_size][crate::model::ListUsableSubnetworksRequest::page_size].
3551        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3552            self.0.request.page_size = v.into();
3553            self
3554        }
3555
3556        /// Sets the value of [page_token][crate::model::ListUsableSubnetworksRequest::page_token].
3557        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3558            self.0.request.page_token = v.into();
3559            self
3560        }
3561    }
3562
3563    #[doc(hidden)]
3564    impl gax::options::internal::RequestBuilder for ListUsableSubnetworks {
3565        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3566            &mut self.0.options
3567        }
3568    }
3569
3570    /// The request builder for [ClusterManager::check_autopilot_compatibility][crate::client::ClusterManager::check_autopilot_compatibility] calls.
3571    ///
3572    /// # Example
3573    /// ```no_run
3574    /// # use google_cloud_container_v1::builder;
3575    /// use builder::cluster_manager::CheckAutopilotCompatibility;
3576    /// # tokio_test::block_on(async {
3577    ///
3578    /// let builder = prepare_request_builder();
3579    /// let response = builder.send().await?;
3580    /// # gax::Result::<()>::Ok(()) });
3581    ///
3582    /// fn prepare_request_builder() -> CheckAutopilotCompatibility {
3583    ///   # panic!();
3584    ///   // ... details omitted ...
3585    /// }
3586    /// ```
3587    #[derive(Clone, Debug)]
3588    pub struct CheckAutopilotCompatibility(
3589        RequestBuilder<crate::model::CheckAutopilotCompatibilityRequest>,
3590    );
3591
3592    impl CheckAutopilotCompatibility {
3593        pub(crate) fn new(
3594            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3595        ) -> Self {
3596            Self(RequestBuilder::new(stub))
3597        }
3598
3599        /// Sets the full request, replacing any prior values.
3600        pub fn with_request<V: Into<crate::model::CheckAutopilotCompatibilityRequest>>(
3601            mut self,
3602            v: V,
3603        ) -> Self {
3604            self.0.request = v.into();
3605            self
3606        }
3607
3608        /// Sets all the options, replacing any prior values.
3609        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3610            self.0.options = v.into();
3611            self
3612        }
3613
3614        /// Sends the request.
3615        pub async fn send(self) -> Result<crate::model::CheckAutopilotCompatibilityResponse> {
3616            (*self.0.stub)
3617                .check_autopilot_compatibility(self.0.request, self.0.options)
3618                .await
3619                .map(gax::response::Response::into_body)
3620        }
3621
3622        /// Sets the value of [name][crate::model::CheckAutopilotCompatibilityRequest::name].
3623        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3624            self.0.request.name = v.into();
3625            self
3626        }
3627    }
3628
3629    #[doc(hidden)]
3630    impl gax::options::internal::RequestBuilder for CheckAutopilotCompatibility {
3631        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3632            &mut self.0.options
3633        }
3634    }
3635
3636    /// The request builder for [ClusterManager::fetch_cluster_upgrade_info][crate::client::ClusterManager::fetch_cluster_upgrade_info] calls.
3637    ///
3638    /// # Example
3639    /// ```no_run
3640    /// # use google_cloud_container_v1::builder;
3641    /// use builder::cluster_manager::FetchClusterUpgradeInfo;
3642    /// # tokio_test::block_on(async {
3643    ///
3644    /// let builder = prepare_request_builder();
3645    /// let response = builder.send().await?;
3646    /// # gax::Result::<()>::Ok(()) });
3647    ///
3648    /// fn prepare_request_builder() -> FetchClusterUpgradeInfo {
3649    ///   # panic!();
3650    ///   // ... details omitted ...
3651    /// }
3652    /// ```
3653    #[derive(Clone, Debug)]
3654    pub struct FetchClusterUpgradeInfo(
3655        RequestBuilder<crate::model::FetchClusterUpgradeInfoRequest>,
3656    );
3657
3658    impl FetchClusterUpgradeInfo {
3659        pub(crate) fn new(
3660            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3661        ) -> Self {
3662            Self(RequestBuilder::new(stub))
3663        }
3664
3665        /// Sets the full request, replacing any prior values.
3666        pub fn with_request<V: Into<crate::model::FetchClusterUpgradeInfoRequest>>(
3667            mut self,
3668            v: V,
3669        ) -> Self {
3670            self.0.request = v.into();
3671            self
3672        }
3673
3674        /// Sets all the options, replacing any prior values.
3675        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3676            self.0.options = v.into();
3677            self
3678        }
3679
3680        /// Sends the request.
3681        pub async fn send(self) -> Result<crate::model::ClusterUpgradeInfo> {
3682            (*self.0.stub)
3683                .fetch_cluster_upgrade_info(self.0.request, self.0.options)
3684                .await
3685                .map(gax::response::Response::into_body)
3686        }
3687
3688        /// Sets the value of [name][crate::model::FetchClusterUpgradeInfoRequest::name].
3689        ///
3690        /// This is a **required** field for requests.
3691        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3692            self.0.request.name = v.into();
3693            self
3694        }
3695
3696        /// Sets the value of [version][crate::model::FetchClusterUpgradeInfoRequest::version].
3697        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3698            self.0.request.version = v.into();
3699            self
3700        }
3701    }
3702
3703    #[doc(hidden)]
3704    impl gax::options::internal::RequestBuilder for FetchClusterUpgradeInfo {
3705        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3706            &mut self.0.options
3707        }
3708    }
3709
3710    /// The request builder for [ClusterManager::fetch_node_pool_upgrade_info][crate::client::ClusterManager::fetch_node_pool_upgrade_info] calls.
3711    ///
3712    /// # Example
3713    /// ```no_run
3714    /// # use google_cloud_container_v1::builder;
3715    /// use builder::cluster_manager::FetchNodePoolUpgradeInfo;
3716    /// # tokio_test::block_on(async {
3717    ///
3718    /// let builder = prepare_request_builder();
3719    /// let response = builder.send().await?;
3720    /// # gax::Result::<()>::Ok(()) });
3721    ///
3722    /// fn prepare_request_builder() -> FetchNodePoolUpgradeInfo {
3723    ///   # panic!();
3724    ///   // ... details omitted ...
3725    /// }
3726    /// ```
3727    #[derive(Clone, Debug)]
3728    pub struct FetchNodePoolUpgradeInfo(
3729        RequestBuilder<crate::model::FetchNodePoolUpgradeInfoRequest>,
3730    );
3731
3732    impl FetchNodePoolUpgradeInfo {
3733        pub(crate) fn new(
3734            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3735        ) -> Self {
3736            Self(RequestBuilder::new(stub))
3737        }
3738
3739        /// Sets the full request, replacing any prior values.
3740        pub fn with_request<V: Into<crate::model::FetchNodePoolUpgradeInfoRequest>>(
3741            mut self,
3742            v: V,
3743        ) -> Self {
3744            self.0.request = v.into();
3745            self
3746        }
3747
3748        /// Sets all the options, replacing any prior values.
3749        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3750            self.0.options = v.into();
3751            self
3752        }
3753
3754        /// Sends the request.
3755        pub async fn send(self) -> Result<crate::model::NodePoolUpgradeInfo> {
3756            (*self.0.stub)
3757                .fetch_node_pool_upgrade_info(self.0.request, self.0.options)
3758                .await
3759                .map(gax::response::Response::into_body)
3760        }
3761
3762        /// Sets the value of [name][crate::model::FetchNodePoolUpgradeInfoRequest::name].
3763        ///
3764        /// This is a **required** field for requests.
3765        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3766            self.0.request.name = v.into();
3767            self
3768        }
3769
3770        /// Sets the value of [version][crate::model::FetchNodePoolUpgradeInfoRequest::version].
3771        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3772            self.0.request.version = v.into();
3773            self
3774        }
3775    }
3776
3777    #[doc(hidden)]
3778    impl gax::options::internal::RequestBuilder for FetchNodePoolUpgradeInfo {
3779        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3780            &mut self.0.options
3781        }
3782    }
3783}