google_cloud_compute_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
17#[cfg(feature = "images")]
18#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
19pub mod images {
20    use crate::Result;
21
22    /// A builder for [Images][crate::client::Images].
23    ///
24    /// ```
25    /// # tokio_test::block_on(async {
26    /// # use google_cloud_compute_v1::*;
27    /// # use builder::images::ClientBuilder;
28    /// # use client::Images;
29    /// let builder : ClientBuilder = Images::builder();
30    /// let client = builder
31    ///     .with_endpoint("https://compute.googleapis.com")
32    ///     .build().await?;
33    /// # gax::client_builder::Result::<()>::Ok(()) });
34    /// ```
35    pub type ClientBuilder =
36        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38    pub(crate) mod client {
39        use super::super::super::client::Images;
40        pub struct Factory;
41        impl gax::client_builder::internal::ClientFactory for Factory {
42            type Client = Images;
43            type Credentials = gaxi::options::Credentials;
44            async fn build(
45                self,
46                config: gaxi::options::ClientConfig,
47            ) -> gax::client_builder::Result<Self::Client> {
48                Self::Client::new(config).await
49            }
50        }
51    }
52
53    /// Common implementation for [crate::client::Images] request builders.
54    #[derive(Clone, Debug)]
55    pub(crate) struct RequestBuilder<R: std::default::Default> {
56        stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>,
57        request: R,
58        options: gax::options::RequestOptions,
59    }
60
61    impl<R> RequestBuilder<R>
62    where
63        R: std::default::Default,
64    {
65        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Images::delete][crate::client::Images::delete] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_compute_v1::builder;
79    /// use builder::images::Delete;
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() -> Delete {
87    ///   # panic!();
88    ///   // ... details omitted ...
89    /// }
90    /// ```
91    #[derive(Clone, Debug)]
92    pub struct Delete(RequestBuilder<crate::model::images::DeleteRequest>);
93
94    impl Delete {
95        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
96            Self(RequestBuilder::new(stub))
97        }
98
99        /// Sets the full request, replacing any prior values.
100        pub fn with_request<V: Into<crate::model::images::DeleteRequest>>(mut self, v: V) -> Self {
101            self.0.request = v.into();
102            self
103        }
104
105        /// Sets all the options, replacing any prior values.
106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
107            self.0.options = v.into();
108            self
109        }
110
111        /// Sends the request.
112        pub async fn send(self) -> Result<crate::model::Operation> {
113            (*self.0.stub)
114                .delete(self.0.request, self.0.options)
115                .await
116                .map(gax::response::Response::into_body)
117        }
118
119        /// Sets the value of [image][crate::model::images::DeleteRequest::image].
120        pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
121            self.0.request.image = v.into();
122            self
123        }
124
125        /// Sets the value of [project][crate::model::images::DeleteRequest::project].
126        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
127            self.0.request.project = v.into();
128            self
129        }
130
131        /// Sets the value of [request_id][crate::model::images::DeleteRequest::request_id].
132        pub fn set_request_id<T>(mut self, v: T) -> Self
133        where
134            T: std::convert::Into<std::string::String>,
135        {
136            self.0.request.request_id = std::option::Option::Some(v.into());
137            self
138        }
139
140        /// Sets or clears the value of [request_id][crate::model::images::DeleteRequest::request_id].
141        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
142        where
143            T: std::convert::Into<std::string::String>,
144        {
145            self.0.request.request_id = v.map(|x| x.into());
146            self
147        }
148    }
149
150    #[doc(hidden)]
151    impl gax::options::internal::RequestBuilder for Delete {
152        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
153            &mut self.0.options
154        }
155    }
156
157    /// The request builder for [Images::deprecate][crate::client::Images::deprecate] calls.
158    ///
159    /// # Example
160    /// ```no_run
161    /// # use google_cloud_compute_v1::builder;
162    /// use builder::images::Deprecate;
163    /// # tokio_test::block_on(async {
164    ///
165    /// let builder = prepare_request_builder();
166    /// let response = builder.send().await?;
167    /// # gax::Result::<()>::Ok(()) });
168    ///
169    /// fn prepare_request_builder() -> Deprecate {
170    ///   # panic!();
171    ///   // ... details omitted ...
172    /// }
173    /// ```
174    #[derive(Clone, Debug)]
175    pub struct Deprecate(RequestBuilder<crate::model::images::DeprecateRequest>);
176
177    impl Deprecate {
178        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
179            Self(RequestBuilder::new(stub))
180        }
181
182        /// Sets the full request, replacing any prior values.
183        pub fn with_request<V: Into<crate::model::images::DeprecateRequest>>(
184            mut self,
185            v: V,
186        ) -> Self {
187            self.0.request = v.into();
188            self
189        }
190
191        /// Sets all the options, replacing any prior values.
192        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
193            self.0.options = v.into();
194            self
195        }
196
197        /// Sends the request.
198        pub async fn send(self) -> Result<crate::model::Operation> {
199            (*self.0.stub)
200                .deprecate(self.0.request, self.0.options)
201                .await
202                .map(gax::response::Response::into_body)
203        }
204
205        /// Sets the value of [image][crate::model::images::DeprecateRequest::image].
206        pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
207            self.0.request.image = v.into();
208            self
209        }
210
211        /// Sets the value of [project][crate::model::images::DeprecateRequest::project].
212        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
213            self.0.request.project = v.into();
214            self
215        }
216
217        /// Sets the value of [request_id][crate::model::images::DeprecateRequest::request_id].
218        pub fn set_request_id<T>(mut self, v: T) -> Self
219        where
220            T: std::convert::Into<std::string::String>,
221        {
222            self.0.request.request_id = std::option::Option::Some(v.into());
223            self
224        }
225
226        /// Sets or clears the value of [request_id][crate::model::images::DeprecateRequest::request_id].
227        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
228        where
229            T: std::convert::Into<std::string::String>,
230        {
231            self.0.request.request_id = v.map(|x| x.into());
232            self
233        }
234
235        /// Sets the value of [body][crate::model::images::DeprecateRequest::body].
236        pub fn set_body<T>(mut self, v: T) -> Self
237        where
238            T: std::convert::Into<crate::model::DeprecationStatus>,
239        {
240            self.0.request.body = std::option::Option::Some(v.into());
241            self
242        }
243
244        /// Sets or clears the value of [body][crate::model::images::DeprecateRequest::body].
245        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
246        where
247            T: std::convert::Into<crate::model::DeprecationStatus>,
248        {
249            self.0.request.body = v.map(|x| x.into());
250            self
251        }
252    }
253
254    #[doc(hidden)]
255    impl gax::options::internal::RequestBuilder for Deprecate {
256        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
257            &mut self.0.options
258        }
259    }
260
261    /// The request builder for [Images::get][crate::client::Images::get] calls.
262    ///
263    /// # Example
264    /// ```no_run
265    /// # use google_cloud_compute_v1::builder;
266    /// use builder::images::Get;
267    /// # tokio_test::block_on(async {
268    ///
269    /// let builder = prepare_request_builder();
270    /// let response = builder.send().await?;
271    /// # gax::Result::<()>::Ok(()) });
272    ///
273    /// fn prepare_request_builder() -> Get {
274    ///   # panic!();
275    ///   // ... details omitted ...
276    /// }
277    /// ```
278    #[derive(Clone, Debug)]
279    pub struct Get(RequestBuilder<crate::model::images::GetRequest>);
280
281    impl Get {
282        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
283            Self(RequestBuilder::new(stub))
284        }
285
286        /// Sets the full request, replacing any prior values.
287        pub fn with_request<V: Into<crate::model::images::GetRequest>>(mut self, v: V) -> Self {
288            self.0.request = v.into();
289            self
290        }
291
292        /// Sets all the options, replacing any prior values.
293        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294            self.0.options = v.into();
295            self
296        }
297
298        /// Sends the request.
299        pub async fn send(self) -> Result<crate::model::Image> {
300            (*self.0.stub)
301                .get(self.0.request, self.0.options)
302                .await
303                .map(gax::response::Response::into_body)
304        }
305
306        /// Sets the value of [image][crate::model::images::GetRequest::image].
307        pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
308            self.0.request.image = v.into();
309            self
310        }
311
312        /// Sets the value of [project][crate::model::images::GetRequest::project].
313        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
314            self.0.request.project = v.into();
315            self
316        }
317    }
318
319    #[doc(hidden)]
320    impl gax::options::internal::RequestBuilder for Get {
321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
322            &mut self.0.options
323        }
324    }
325
326    /// The request builder for [Images::get_from_family][crate::client::Images::get_from_family] calls.
327    ///
328    /// # Example
329    /// ```no_run
330    /// # use google_cloud_compute_v1::builder;
331    /// use builder::images::GetFromFamily;
332    /// # tokio_test::block_on(async {
333    ///
334    /// let builder = prepare_request_builder();
335    /// let response = builder.send().await?;
336    /// # gax::Result::<()>::Ok(()) });
337    ///
338    /// fn prepare_request_builder() -> GetFromFamily {
339    ///   # panic!();
340    ///   // ... details omitted ...
341    /// }
342    /// ```
343    #[derive(Clone, Debug)]
344    pub struct GetFromFamily(RequestBuilder<crate::model::images::GetFromFamilyRequest>);
345
346    impl GetFromFamily {
347        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
348            Self(RequestBuilder::new(stub))
349        }
350
351        /// Sets the full request, replacing any prior values.
352        pub fn with_request<V: Into<crate::model::images::GetFromFamilyRequest>>(
353            mut self,
354            v: V,
355        ) -> Self {
356            self.0.request = v.into();
357            self
358        }
359
360        /// Sets all the options, replacing any prior values.
361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
362            self.0.options = v.into();
363            self
364        }
365
366        /// Sends the request.
367        pub async fn send(self) -> Result<crate::model::Image> {
368            (*self.0.stub)
369                .get_from_family(self.0.request, self.0.options)
370                .await
371                .map(gax::response::Response::into_body)
372        }
373
374        /// Sets the value of [family][crate::model::images::GetFromFamilyRequest::family].
375        pub fn set_family<T: Into<std::string::String>>(mut self, v: T) -> Self {
376            self.0.request.family = v.into();
377            self
378        }
379
380        /// Sets the value of [project][crate::model::images::GetFromFamilyRequest::project].
381        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
382            self.0.request.project = v.into();
383            self
384        }
385    }
386
387    #[doc(hidden)]
388    impl gax::options::internal::RequestBuilder for GetFromFamily {
389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
390            &mut self.0.options
391        }
392    }
393
394    /// The request builder for [Images::get_iam_policy][crate::client::Images::get_iam_policy] calls.
395    ///
396    /// # Example
397    /// ```no_run
398    /// # use google_cloud_compute_v1::builder;
399    /// use builder::images::GetIamPolicy;
400    /// # tokio_test::block_on(async {
401    ///
402    /// let builder = prepare_request_builder();
403    /// let response = builder.send().await?;
404    /// # gax::Result::<()>::Ok(()) });
405    ///
406    /// fn prepare_request_builder() -> GetIamPolicy {
407    ///   # panic!();
408    ///   // ... details omitted ...
409    /// }
410    /// ```
411    #[derive(Clone, Debug)]
412    pub struct GetIamPolicy(RequestBuilder<crate::model::images::GetIamPolicyRequest>);
413
414    impl GetIamPolicy {
415        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
416            Self(RequestBuilder::new(stub))
417        }
418
419        /// Sets the full request, replacing any prior values.
420        pub fn with_request<V: Into<crate::model::images::GetIamPolicyRequest>>(
421            mut self,
422            v: V,
423        ) -> Self {
424            self.0.request = v.into();
425            self
426        }
427
428        /// Sets all the options, replacing any prior values.
429        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
430            self.0.options = v.into();
431            self
432        }
433
434        /// Sends the request.
435        pub async fn send(self) -> Result<crate::model::Policy> {
436            (*self.0.stub)
437                .get_iam_policy(self.0.request, self.0.options)
438                .await
439                .map(gax::response::Response::into_body)
440        }
441
442        /// Sets the value of [options_requested_policy_version][crate::model::images::GetIamPolicyRequest::options_requested_policy_version].
443        pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
444        where
445            T: std::convert::Into<i32>,
446        {
447            self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
448            self
449        }
450
451        /// Sets or clears the value of [options_requested_policy_version][crate::model::images::GetIamPolicyRequest::options_requested_policy_version].
452        pub fn set_or_clear_options_requested_policy_version<T>(
453            mut self,
454            v: std::option::Option<T>,
455        ) -> Self
456        where
457            T: std::convert::Into<i32>,
458        {
459            self.0.request.options_requested_policy_version = v.map(|x| x.into());
460            self
461        }
462
463        /// Sets the value of [project][crate::model::images::GetIamPolicyRequest::project].
464        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
465            self.0.request.project = v.into();
466            self
467        }
468
469        /// Sets the value of [resource][crate::model::images::GetIamPolicyRequest::resource].
470        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
471            self.0.request.resource = v.into();
472            self
473        }
474    }
475
476    #[doc(hidden)]
477    impl gax::options::internal::RequestBuilder for GetIamPolicy {
478        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
479            &mut self.0.options
480        }
481    }
482
483    /// The request builder for [Images::insert][crate::client::Images::insert] calls.
484    ///
485    /// # Example
486    /// ```no_run
487    /// # use google_cloud_compute_v1::builder;
488    /// use builder::images::Insert;
489    /// # tokio_test::block_on(async {
490    ///
491    /// let builder = prepare_request_builder();
492    /// let response = builder.send().await?;
493    /// # gax::Result::<()>::Ok(()) });
494    ///
495    /// fn prepare_request_builder() -> Insert {
496    ///   # panic!();
497    ///   // ... details omitted ...
498    /// }
499    /// ```
500    #[derive(Clone, Debug)]
501    pub struct Insert(RequestBuilder<crate::model::images::InsertRequest>);
502
503    impl Insert {
504        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
505            Self(RequestBuilder::new(stub))
506        }
507
508        /// Sets the full request, replacing any prior values.
509        pub fn with_request<V: Into<crate::model::images::InsertRequest>>(mut self, v: V) -> Self {
510            self.0.request = v.into();
511            self
512        }
513
514        /// Sets all the options, replacing any prior values.
515        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
516            self.0.options = v.into();
517            self
518        }
519
520        /// Sends the request.
521        pub async fn send(self) -> Result<crate::model::Operation> {
522            (*self.0.stub)
523                .insert(self.0.request, self.0.options)
524                .await
525                .map(gax::response::Response::into_body)
526        }
527
528        /// Sets the value of [force_create][crate::model::images::InsertRequest::force_create].
529        pub fn set_force_create<T>(mut self, v: T) -> Self
530        where
531            T: std::convert::Into<bool>,
532        {
533            self.0.request.force_create = std::option::Option::Some(v.into());
534            self
535        }
536
537        /// Sets or clears the value of [force_create][crate::model::images::InsertRequest::force_create].
538        pub fn set_or_clear_force_create<T>(mut self, v: std::option::Option<T>) -> Self
539        where
540            T: std::convert::Into<bool>,
541        {
542            self.0.request.force_create = v.map(|x| x.into());
543            self
544        }
545
546        /// Sets the value of [project][crate::model::images::InsertRequest::project].
547        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
548            self.0.request.project = v.into();
549            self
550        }
551
552        /// Sets the value of [request_id][crate::model::images::InsertRequest::request_id].
553        pub fn set_request_id<T>(mut self, v: T) -> Self
554        where
555            T: std::convert::Into<std::string::String>,
556        {
557            self.0.request.request_id = std::option::Option::Some(v.into());
558            self
559        }
560
561        /// Sets or clears the value of [request_id][crate::model::images::InsertRequest::request_id].
562        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
563        where
564            T: std::convert::Into<std::string::String>,
565        {
566            self.0.request.request_id = v.map(|x| x.into());
567            self
568        }
569
570        /// Sets the value of [body][crate::model::images::InsertRequest::body].
571        pub fn set_body<T>(mut self, v: T) -> Self
572        where
573            T: std::convert::Into<crate::model::Image>,
574        {
575            self.0.request.body = std::option::Option::Some(v.into());
576            self
577        }
578
579        /// Sets or clears the value of [body][crate::model::images::InsertRequest::body].
580        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
581        where
582            T: std::convert::Into<crate::model::Image>,
583        {
584            self.0.request.body = v.map(|x| x.into());
585            self
586        }
587    }
588
589    #[doc(hidden)]
590    impl gax::options::internal::RequestBuilder for Insert {
591        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
592            &mut self.0.options
593        }
594    }
595
596    /// The request builder for [Images::list][crate::client::Images::list] calls.
597    ///
598    /// # Example
599    /// ```no_run
600    /// # use google_cloud_compute_v1::builder;
601    /// use builder::images::List;
602    /// # tokio_test::block_on(async {
603    /// use gax::paginator::ItemPaginator;
604    ///
605    /// let builder = prepare_request_builder();
606    /// let mut items = builder.by_item();
607    /// while let Some(result) = items.next().await {
608    ///   let item = result?;
609    /// }
610    /// # gax::Result::<()>::Ok(()) });
611    ///
612    /// fn prepare_request_builder() -> List {
613    ///   # panic!();
614    ///   // ... details omitted ...
615    /// }
616    /// ```
617    #[derive(Clone, Debug)]
618    pub struct List(RequestBuilder<crate::model::images::ListRequest>);
619
620    impl List {
621        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
622            Self(RequestBuilder::new(stub))
623        }
624
625        /// Sets the full request, replacing any prior values.
626        pub fn with_request<V: Into<crate::model::images::ListRequest>>(mut self, v: V) -> Self {
627            self.0.request = v.into();
628            self
629        }
630
631        /// Sets all the options, replacing any prior values.
632        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
633            self.0.options = v.into();
634            self
635        }
636
637        /// Sends the request.
638        pub async fn send(self) -> Result<crate::model::ImageList> {
639            (*self.0.stub)
640                .list(self.0.request, self.0.options)
641                .await
642                .map(gax::response::Response::into_body)
643        }
644
645        /// Streams each page in the collection.
646        pub fn by_page(
647            self,
648        ) -> impl gax::paginator::Paginator<crate::model::ImageList, gax::error::Error> {
649            use std::clone::Clone;
650            let token = self.0.request.page_token.clone().unwrap_or_default();
651            let execute = move |token: String| {
652                let mut builder = self.clone();
653                builder.0.request = builder.0.request.set_page_token(token);
654                builder.send()
655            };
656            gax::paginator::internal::new_paginator(token, execute)
657        }
658
659        /// Streams each item in the collection.
660        pub fn by_item(
661            self,
662        ) -> impl gax::paginator::ItemPaginator<crate::model::ImageList, gax::error::Error>
663        {
664            use gax::paginator::Paginator;
665            self.by_page().items()
666        }
667
668        /// Sets the value of [filter][crate::model::images::ListRequest::filter].
669        pub fn set_filter<T>(mut self, v: T) -> Self
670        where
671            T: std::convert::Into<std::string::String>,
672        {
673            self.0.request.filter = std::option::Option::Some(v.into());
674            self
675        }
676
677        /// Sets or clears the value of [filter][crate::model::images::ListRequest::filter].
678        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
679        where
680            T: std::convert::Into<std::string::String>,
681        {
682            self.0.request.filter = v.map(|x| x.into());
683            self
684        }
685
686        /// Sets the value of [max_results][crate::model::images::ListRequest::max_results].
687        pub fn set_max_results<T>(mut self, v: T) -> Self
688        where
689            T: std::convert::Into<u32>,
690        {
691            self.0.request.max_results = std::option::Option::Some(v.into());
692            self
693        }
694
695        /// Sets or clears the value of [max_results][crate::model::images::ListRequest::max_results].
696        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
697        where
698            T: std::convert::Into<u32>,
699        {
700            self.0.request.max_results = v.map(|x| x.into());
701            self
702        }
703
704        /// Sets the value of [order_by][crate::model::images::ListRequest::order_by].
705        pub fn set_order_by<T>(mut self, v: T) -> Self
706        where
707            T: std::convert::Into<std::string::String>,
708        {
709            self.0.request.order_by = std::option::Option::Some(v.into());
710            self
711        }
712
713        /// Sets or clears the value of [order_by][crate::model::images::ListRequest::order_by].
714        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
715        where
716            T: std::convert::Into<std::string::String>,
717        {
718            self.0.request.order_by = v.map(|x| x.into());
719            self
720        }
721
722        /// Sets the value of [page_token][crate::model::images::ListRequest::page_token].
723        pub fn set_page_token<T>(mut self, v: T) -> Self
724        where
725            T: std::convert::Into<std::string::String>,
726        {
727            self.0.request.page_token = std::option::Option::Some(v.into());
728            self
729        }
730
731        /// Sets or clears the value of [page_token][crate::model::images::ListRequest::page_token].
732        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
733        where
734            T: std::convert::Into<std::string::String>,
735        {
736            self.0.request.page_token = v.map(|x| x.into());
737            self
738        }
739
740        /// Sets the value of [project][crate::model::images::ListRequest::project].
741        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
742            self.0.request.project = v.into();
743            self
744        }
745
746        /// Sets the value of [return_partial_success][crate::model::images::ListRequest::return_partial_success].
747        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
748        where
749            T: std::convert::Into<bool>,
750        {
751            self.0.request.return_partial_success = std::option::Option::Some(v.into());
752            self
753        }
754
755        /// Sets or clears the value of [return_partial_success][crate::model::images::ListRequest::return_partial_success].
756        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
757        where
758            T: std::convert::Into<bool>,
759        {
760            self.0.request.return_partial_success = v.map(|x| x.into());
761            self
762        }
763    }
764
765    #[doc(hidden)]
766    impl gax::options::internal::RequestBuilder for List {
767        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
768            &mut self.0.options
769        }
770    }
771
772    /// The request builder for [Images::patch][crate::client::Images::patch] calls.
773    ///
774    /// # Example
775    /// ```no_run
776    /// # use google_cloud_compute_v1::builder;
777    /// use builder::images::Patch;
778    /// # tokio_test::block_on(async {
779    ///
780    /// let builder = prepare_request_builder();
781    /// let response = builder.send().await?;
782    /// # gax::Result::<()>::Ok(()) });
783    ///
784    /// fn prepare_request_builder() -> Patch {
785    ///   # panic!();
786    ///   // ... details omitted ...
787    /// }
788    /// ```
789    #[derive(Clone, Debug)]
790    pub struct Patch(RequestBuilder<crate::model::images::PatchRequest>);
791
792    impl Patch {
793        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
794            Self(RequestBuilder::new(stub))
795        }
796
797        /// Sets the full request, replacing any prior values.
798        pub fn with_request<V: Into<crate::model::images::PatchRequest>>(mut self, v: V) -> Self {
799            self.0.request = v.into();
800            self
801        }
802
803        /// Sets all the options, replacing any prior values.
804        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
805            self.0.options = v.into();
806            self
807        }
808
809        /// Sends the request.
810        pub async fn send(self) -> Result<crate::model::Operation> {
811            (*self.0.stub)
812                .patch(self.0.request, self.0.options)
813                .await
814                .map(gax::response::Response::into_body)
815        }
816
817        /// Sets the value of [image][crate::model::images::PatchRequest::image].
818        pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
819            self.0.request.image = v.into();
820            self
821        }
822
823        /// Sets the value of [project][crate::model::images::PatchRequest::project].
824        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
825            self.0.request.project = v.into();
826            self
827        }
828
829        /// Sets the value of [request_id][crate::model::images::PatchRequest::request_id].
830        pub fn set_request_id<T>(mut self, v: T) -> Self
831        where
832            T: std::convert::Into<std::string::String>,
833        {
834            self.0.request.request_id = std::option::Option::Some(v.into());
835            self
836        }
837
838        /// Sets or clears the value of [request_id][crate::model::images::PatchRequest::request_id].
839        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
840        where
841            T: std::convert::Into<std::string::String>,
842        {
843            self.0.request.request_id = v.map(|x| x.into());
844            self
845        }
846
847        /// Sets the value of [body][crate::model::images::PatchRequest::body].
848        pub fn set_body<T>(mut self, v: T) -> Self
849        where
850            T: std::convert::Into<crate::model::Image>,
851        {
852            self.0.request.body = std::option::Option::Some(v.into());
853            self
854        }
855
856        /// Sets or clears the value of [body][crate::model::images::PatchRequest::body].
857        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
858        where
859            T: std::convert::Into<crate::model::Image>,
860        {
861            self.0.request.body = v.map(|x| x.into());
862            self
863        }
864    }
865
866    #[doc(hidden)]
867    impl gax::options::internal::RequestBuilder for Patch {
868        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
869            &mut self.0.options
870        }
871    }
872
873    /// The request builder for [Images::set_iam_policy][crate::client::Images::set_iam_policy] calls.
874    ///
875    /// # Example
876    /// ```no_run
877    /// # use google_cloud_compute_v1::builder;
878    /// use builder::images::SetIamPolicy;
879    /// # tokio_test::block_on(async {
880    ///
881    /// let builder = prepare_request_builder();
882    /// let response = builder.send().await?;
883    /// # gax::Result::<()>::Ok(()) });
884    ///
885    /// fn prepare_request_builder() -> SetIamPolicy {
886    ///   # panic!();
887    ///   // ... details omitted ...
888    /// }
889    /// ```
890    #[derive(Clone, Debug)]
891    pub struct SetIamPolicy(RequestBuilder<crate::model::images::SetIamPolicyRequest>);
892
893    impl SetIamPolicy {
894        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
895            Self(RequestBuilder::new(stub))
896        }
897
898        /// Sets the full request, replacing any prior values.
899        pub fn with_request<V: Into<crate::model::images::SetIamPolicyRequest>>(
900            mut self,
901            v: V,
902        ) -> Self {
903            self.0.request = v.into();
904            self
905        }
906
907        /// Sets all the options, replacing any prior values.
908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
909            self.0.options = v.into();
910            self
911        }
912
913        /// Sends the request.
914        pub async fn send(self) -> Result<crate::model::Policy> {
915            (*self.0.stub)
916                .set_iam_policy(self.0.request, self.0.options)
917                .await
918                .map(gax::response::Response::into_body)
919        }
920
921        /// Sets the value of [project][crate::model::images::SetIamPolicyRequest::project].
922        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
923            self.0.request.project = v.into();
924            self
925        }
926
927        /// Sets the value of [resource][crate::model::images::SetIamPolicyRequest::resource].
928        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
929            self.0.request.resource = v.into();
930            self
931        }
932
933        /// Sets the value of [body][crate::model::images::SetIamPolicyRequest::body].
934        pub fn set_body<T>(mut self, v: T) -> Self
935        where
936            T: std::convert::Into<crate::model::GlobalSetPolicyRequest>,
937        {
938            self.0.request.body = std::option::Option::Some(v.into());
939            self
940        }
941
942        /// Sets or clears the value of [body][crate::model::images::SetIamPolicyRequest::body].
943        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
944        where
945            T: std::convert::Into<crate::model::GlobalSetPolicyRequest>,
946        {
947            self.0.request.body = v.map(|x| x.into());
948            self
949        }
950    }
951
952    #[doc(hidden)]
953    impl gax::options::internal::RequestBuilder for SetIamPolicy {
954        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
955            &mut self.0.options
956        }
957    }
958
959    /// The request builder for [Images::set_labels][crate::client::Images::set_labels] calls.
960    ///
961    /// # Example
962    /// ```no_run
963    /// # use google_cloud_compute_v1::builder;
964    /// use builder::images::SetLabels;
965    /// # tokio_test::block_on(async {
966    ///
967    /// let builder = prepare_request_builder();
968    /// let response = builder.send().await?;
969    /// # gax::Result::<()>::Ok(()) });
970    ///
971    /// fn prepare_request_builder() -> SetLabels {
972    ///   # panic!();
973    ///   // ... details omitted ...
974    /// }
975    /// ```
976    #[derive(Clone, Debug)]
977    pub struct SetLabels(RequestBuilder<crate::model::images::SetLabelsRequest>);
978
979    impl SetLabels {
980        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
981            Self(RequestBuilder::new(stub))
982        }
983
984        /// Sets the full request, replacing any prior values.
985        pub fn with_request<V: Into<crate::model::images::SetLabelsRequest>>(
986            mut self,
987            v: V,
988        ) -> Self {
989            self.0.request = v.into();
990            self
991        }
992
993        /// Sets all the options, replacing any prior values.
994        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
995            self.0.options = v.into();
996            self
997        }
998
999        /// Sends the request.
1000        pub async fn send(self) -> Result<crate::model::Operation> {
1001            (*self.0.stub)
1002                .set_labels(self.0.request, self.0.options)
1003                .await
1004                .map(gax::response::Response::into_body)
1005        }
1006
1007        /// Sets the value of [project][crate::model::images::SetLabelsRequest::project].
1008        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009            self.0.request.project = v.into();
1010            self
1011        }
1012
1013        /// Sets the value of [resource][crate::model::images::SetLabelsRequest::resource].
1014        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1015            self.0.request.resource = v.into();
1016            self
1017        }
1018
1019        /// Sets the value of [body][crate::model::images::SetLabelsRequest::body].
1020        pub fn set_body<T>(mut self, v: T) -> Self
1021        where
1022            T: std::convert::Into<crate::model::GlobalSetLabelsRequest>,
1023        {
1024            self.0.request.body = std::option::Option::Some(v.into());
1025            self
1026        }
1027
1028        /// Sets or clears the value of [body][crate::model::images::SetLabelsRequest::body].
1029        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1030        where
1031            T: std::convert::Into<crate::model::GlobalSetLabelsRequest>,
1032        {
1033            self.0.request.body = v.map(|x| x.into());
1034            self
1035        }
1036    }
1037
1038    #[doc(hidden)]
1039    impl gax::options::internal::RequestBuilder for SetLabels {
1040        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1041            &mut self.0.options
1042        }
1043    }
1044
1045    /// The request builder for [Images::test_iam_permissions][crate::client::Images::test_iam_permissions] calls.
1046    ///
1047    /// # Example
1048    /// ```no_run
1049    /// # use google_cloud_compute_v1::builder;
1050    /// use builder::images::TestIamPermissions;
1051    /// # tokio_test::block_on(async {
1052    ///
1053    /// let builder = prepare_request_builder();
1054    /// let response = builder.send().await?;
1055    /// # gax::Result::<()>::Ok(()) });
1056    ///
1057    /// fn prepare_request_builder() -> TestIamPermissions {
1058    ///   # panic!();
1059    ///   // ... details omitted ...
1060    /// }
1061    /// ```
1062    #[derive(Clone, Debug)]
1063    pub struct TestIamPermissions(RequestBuilder<crate::model::images::TestIamPermissionsRequest>);
1064
1065    impl TestIamPermissions {
1066        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
1067            Self(RequestBuilder::new(stub))
1068        }
1069
1070        /// Sets the full request, replacing any prior values.
1071        pub fn with_request<V: Into<crate::model::images::TestIamPermissionsRequest>>(
1072            mut self,
1073            v: V,
1074        ) -> Self {
1075            self.0.request = v.into();
1076            self
1077        }
1078
1079        /// Sets all the options, replacing any prior values.
1080        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1081            self.0.options = v.into();
1082            self
1083        }
1084
1085        /// Sends the request.
1086        pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
1087            (*self.0.stub)
1088                .test_iam_permissions(self.0.request, self.0.options)
1089                .await
1090                .map(gax::response::Response::into_body)
1091        }
1092
1093        /// Sets the value of [project][crate::model::images::TestIamPermissionsRequest::project].
1094        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1095            self.0.request.project = v.into();
1096            self
1097        }
1098
1099        /// Sets the value of [resource][crate::model::images::TestIamPermissionsRequest::resource].
1100        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1101            self.0.request.resource = v.into();
1102            self
1103        }
1104
1105        /// Sets the value of [body][crate::model::images::TestIamPermissionsRequest::body].
1106        pub fn set_body<T>(mut self, v: T) -> Self
1107        where
1108            T: std::convert::Into<crate::model::TestPermissionsRequest>,
1109        {
1110            self.0.request.body = std::option::Option::Some(v.into());
1111            self
1112        }
1113
1114        /// Sets or clears the value of [body][crate::model::images::TestIamPermissionsRequest::body].
1115        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1116        where
1117            T: std::convert::Into<crate::model::TestPermissionsRequest>,
1118        {
1119            self.0.request.body = v.map(|x| x.into());
1120            self
1121        }
1122    }
1123
1124    #[doc(hidden)]
1125    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1126        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1127            &mut self.0.options
1128        }
1129    }
1130}
1131
1132#[cfg(feature = "instance-group-manager-resize-requests")]
1133#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
1134pub mod instance_group_manager_resize_requests {
1135    use crate::Result;
1136
1137    /// A builder for [InstanceGroupManagerResizeRequests][crate::client::InstanceGroupManagerResizeRequests].
1138    ///
1139    /// ```
1140    /// # tokio_test::block_on(async {
1141    /// # use google_cloud_compute_v1::*;
1142    /// # use builder::instance_group_manager_resize_requests::ClientBuilder;
1143    /// # use client::InstanceGroupManagerResizeRequests;
1144    /// let builder : ClientBuilder = InstanceGroupManagerResizeRequests::builder();
1145    /// let client = builder
1146    ///     .with_endpoint("https://compute.googleapis.com")
1147    ///     .build().await?;
1148    /// # gax::client_builder::Result::<()>::Ok(()) });
1149    /// ```
1150    pub type ClientBuilder =
1151        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1152
1153    pub(crate) mod client {
1154        use super::super::super::client::InstanceGroupManagerResizeRequests;
1155        pub struct Factory;
1156        impl gax::client_builder::internal::ClientFactory for Factory {
1157            type Client = InstanceGroupManagerResizeRequests;
1158            type Credentials = gaxi::options::Credentials;
1159            async fn build(
1160                self,
1161                config: gaxi::options::ClientConfig,
1162            ) -> gax::client_builder::Result<Self::Client> {
1163                Self::Client::new(config).await
1164            }
1165        }
1166    }
1167
1168    /// Common implementation for [crate::client::InstanceGroupManagerResizeRequests] request builders.
1169    #[derive(Clone, Debug)]
1170    pub(crate) struct RequestBuilder<R: std::default::Default> {
1171        stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests>,
1172        request: R,
1173        options: gax::options::RequestOptions,
1174    }
1175
1176    impl<R> RequestBuilder<R>
1177    where
1178        R: std::default::Default,
1179    {
1180        pub(crate) fn new(
1181            stub: std::sync::Arc<
1182                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1183            >,
1184        ) -> Self {
1185            Self {
1186                stub,
1187                request: R::default(),
1188                options: gax::options::RequestOptions::default(),
1189            }
1190        }
1191    }
1192
1193    /// The request builder for [InstanceGroupManagerResizeRequests::cancel][crate::client::InstanceGroupManagerResizeRequests::cancel] calls.
1194    ///
1195    /// # Example
1196    /// ```no_run
1197    /// # use google_cloud_compute_v1::builder;
1198    /// use builder::instance_group_manager_resize_requests::Cancel;
1199    /// # tokio_test::block_on(async {
1200    ///
1201    /// let builder = prepare_request_builder();
1202    /// let response = builder.send().await?;
1203    /// # gax::Result::<()>::Ok(()) });
1204    ///
1205    /// fn prepare_request_builder() -> Cancel {
1206    ///   # panic!();
1207    ///   // ... details omitted ...
1208    /// }
1209    /// ```
1210    #[derive(Clone, Debug)]
1211    pub struct Cancel(
1212        RequestBuilder<crate::model::instance_group_manager_resize_requests::CancelRequest>,
1213    );
1214
1215    impl Cancel {
1216        pub(crate) fn new(
1217            stub: std::sync::Arc<
1218                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1219            >,
1220        ) -> Self {
1221            Self(RequestBuilder::new(stub))
1222        }
1223
1224        /// Sets the full request, replacing any prior values.
1225        pub fn with_request<
1226            V: Into<crate::model::instance_group_manager_resize_requests::CancelRequest>,
1227        >(
1228            mut self,
1229            v: V,
1230        ) -> Self {
1231            self.0.request = v.into();
1232            self
1233        }
1234
1235        /// Sets all the options, replacing any prior values.
1236        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1237            self.0.options = v.into();
1238            self
1239        }
1240
1241        /// Sends the request.
1242        pub async fn send(self) -> Result<crate::model::Operation> {
1243            (*self.0.stub)
1244                .cancel(self.0.request, self.0.options)
1245                .await
1246                .map(gax::response::Response::into_body)
1247        }
1248
1249        /// Sets the value of [instance_group_manager][crate::model::instance_group_manager_resize_requests::CancelRequest::instance_group_manager].
1250        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251            self.0.request.instance_group_manager = v.into();
1252            self
1253        }
1254
1255        /// Sets the value of [project][crate::model::instance_group_manager_resize_requests::CancelRequest::project].
1256        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257            self.0.request.project = v.into();
1258            self
1259        }
1260
1261        /// Sets the value of [request_id][crate::model::instance_group_manager_resize_requests::CancelRequest::request_id].
1262        pub fn set_request_id<T>(mut self, v: T) -> Self
1263        where
1264            T: std::convert::Into<std::string::String>,
1265        {
1266            self.0.request.request_id = std::option::Option::Some(v.into());
1267            self
1268        }
1269
1270        /// Sets or clears the value of [request_id][crate::model::instance_group_manager_resize_requests::CancelRequest::request_id].
1271        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1272        where
1273            T: std::convert::Into<std::string::String>,
1274        {
1275            self.0.request.request_id = v.map(|x| x.into());
1276            self
1277        }
1278
1279        /// Sets the value of [resize_request][crate::model::instance_group_manager_resize_requests::CancelRequest::resize_request].
1280        pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281            self.0.request.resize_request = v.into();
1282            self
1283        }
1284
1285        /// Sets the value of [zone][crate::model::instance_group_manager_resize_requests::CancelRequest::zone].
1286        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287            self.0.request.zone = v.into();
1288            self
1289        }
1290    }
1291
1292    #[doc(hidden)]
1293    impl gax::options::internal::RequestBuilder for Cancel {
1294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1295            &mut self.0.options
1296        }
1297    }
1298
1299    /// The request builder for [InstanceGroupManagerResizeRequests::delete][crate::client::InstanceGroupManagerResizeRequests::delete] calls.
1300    ///
1301    /// # Example
1302    /// ```no_run
1303    /// # use google_cloud_compute_v1::builder;
1304    /// use builder::instance_group_manager_resize_requests::Delete;
1305    /// # tokio_test::block_on(async {
1306    ///
1307    /// let builder = prepare_request_builder();
1308    /// let response = builder.send().await?;
1309    /// # gax::Result::<()>::Ok(()) });
1310    ///
1311    /// fn prepare_request_builder() -> Delete {
1312    ///   # panic!();
1313    ///   // ... details omitted ...
1314    /// }
1315    /// ```
1316    #[derive(Clone, Debug)]
1317    pub struct Delete(
1318        RequestBuilder<crate::model::instance_group_manager_resize_requests::DeleteRequest>,
1319    );
1320
1321    impl Delete {
1322        pub(crate) fn new(
1323            stub: std::sync::Arc<
1324                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1325            >,
1326        ) -> Self {
1327            Self(RequestBuilder::new(stub))
1328        }
1329
1330        /// Sets the full request, replacing any prior values.
1331        pub fn with_request<
1332            V: Into<crate::model::instance_group_manager_resize_requests::DeleteRequest>,
1333        >(
1334            mut self,
1335            v: V,
1336        ) -> Self {
1337            self.0.request = v.into();
1338            self
1339        }
1340
1341        /// Sets all the options, replacing any prior values.
1342        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1343            self.0.options = v.into();
1344            self
1345        }
1346
1347        /// Sends the request.
1348        pub async fn send(self) -> Result<crate::model::Operation> {
1349            (*self.0.stub)
1350                .delete(self.0.request, self.0.options)
1351                .await
1352                .map(gax::response::Response::into_body)
1353        }
1354
1355        /// Sets the value of [instance_group_manager][crate::model::instance_group_manager_resize_requests::DeleteRequest::instance_group_manager].
1356        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1357            self.0.request.instance_group_manager = v.into();
1358            self
1359        }
1360
1361        /// Sets the value of [project][crate::model::instance_group_manager_resize_requests::DeleteRequest::project].
1362        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1363            self.0.request.project = v.into();
1364            self
1365        }
1366
1367        /// Sets the value of [request_id][crate::model::instance_group_manager_resize_requests::DeleteRequest::request_id].
1368        pub fn set_request_id<T>(mut self, v: T) -> Self
1369        where
1370            T: std::convert::Into<std::string::String>,
1371        {
1372            self.0.request.request_id = std::option::Option::Some(v.into());
1373            self
1374        }
1375
1376        /// Sets or clears the value of [request_id][crate::model::instance_group_manager_resize_requests::DeleteRequest::request_id].
1377        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1378        where
1379            T: std::convert::Into<std::string::String>,
1380        {
1381            self.0.request.request_id = v.map(|x| x.into());
1382            self
1383        }
1384
1385        /// Sets the value of [resize_request][crate::model::instance_group_manager_resize_requests::DeleteRequest::resize_request].
1386        pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1387            self.0.request.resize_request = v.into();
1388            self
1389        }
1390
1391        /// Sets the value of [zone][crate::model::instance_group_manager_resize_requests::DeleteRequest::zone].
1392        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1393            self.0.request.zone = v.into();
1394            self
1395        }
1396    }
1397
1398    #[doc(hidden)]
1399    impl gax::options::internal::RequestBuilder for Delete {
1400        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1401            &mut self.0.options
1402        }
1403    }
1404
1405    /// The request builder for [InstanceGroupManagerResizeRequests::get][crate::client::InstanceGroupManagerResizeRequests::get] calls.
1406    ///
1407    /// # Example
1408    /// ```no_run
1409    /// # use google_cloud_compute_v1::builder;
1410    /// use builder::instance_group_manager_resize_requests::Get;
1411    /// # tokio_test::block_on(async {
1412    ///
1413    /// let builder = prepare_request_builder();
1414    /// let response = builder.send().await?;
1415    /// # gax::Result::<()>::Ok(()) });
1416    ///
1417    /// fn prepare_request_builder() -> Get {
1418    ///   # panic!();
1419    ///   // ... details omitted ...
1420    /// }
1421    /// ```
1422    #[derive(Clone, Debug)]
1423    pub struct Get(
1424        RequestBuilder<crate::model::instance_group_manager_resize_requests::GetRequest>,
1425    );
1426
1427    impl Get {
1428        pub(crate) fn new(
1429            stub: std::sync::Arc<
1430                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1431            >,
1432        ) -> Self {
1433            Self(RequestBuilder::new(stub))
1434        }
1435
1436        /// Sets the full request, replacing any prior values.
1437        pub fn with_request<
1438            V: Into<crate::model::instance_group_manager_resize_requests::GetRequest>,
1439        >(
1440            mut self,
1441            v: V,
1442        ) -> Self {
1443            self.0.request = v.into();
1444            self
1445        }
1446
1447        /// Sets all the options, replacing any prior values.
1448        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1449            self.0.options = v.into();
1450            self
1451        }
1452
1453        /// Sends the request.
1454        pub async fn send(self) -> Result<crate::model::InstanceGroupManagerResizeRequest> {
1455            (*self.0.stub)
1456                .get(self.0.request, self.0.options)
1457                .await
1458                .map(gax::response::Response::into_body)
1459        }
1460
1461        /// Sets the value of [instance_group_manager][crate::model::instance_group_manager_resize_requests::GetRequest::instance_group_manager].
1462        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1463            self.0.request.instance_group_manager = v.into();
1464            self
1465        }
1466
1467        /// Sets the value of [project][crate::model::instance_group_manager_resize_requests::GetRequest::project].
1468        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1469            self.0.request.project = v.into();
1470            self
1471        }
1472
1473        /// Sets the value of [resize_request][crate::model::instance_group_manager_resize_requests::GetRequest::resize_request].
1474        pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1475            self.0.request.resize_request = v.into();
1476            self
1477        }
1478
1479        /// Sets the value of [zone][crate::model::instance_group_manager_resize_requests::GetRequest::zone].
1480        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1481            self.0.request.zone = v.into();
1482            self
1483        }
1484    }
1485
1486    #[doc(hidden)]
1487    impl gax::options::internal::RequestBuilder for Get {
1488        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1489            &mut self.0.options
1490        }
1491    }
1492
1493    /// The request builder for [InstanceGroupManagerResizeRequests::insert][crate::client::InstanceGroupManagerResizeRequests::insert] calls.
1494    ///
1495    /// # Example
1496    /// ```no_run
1497    /// # use google_cloud_compute_v1::builder;
1498    /// use builder::instance_group_manager_resize_requests::Insert;
1499    /// # tokio_test::block_on(async {
1500    ///
1501    /// let builder = prepare_request_builder();
1502    /// let response = builder.send().await?;
1503    /// # gax::Result::<()>::Ok(()) });
1504    ///
1505    /// fn prepare_request_builder() -> Insert {
1506    ///   # panic!();
1507    ///   // ... details omitted ...
1508    /// }
1509    /// ```
1510    #[derive(Clone, Debug)]
1511    pub struct Insert(
1512        RequestBuilder<crate::model::instance_group_manager_resize_requests::InsertRequest>,
1513    );
1514
1515    impl Insert {
1516        pub(crate) fn new(
1517            stub: std::sync::Arc<
1518                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1519            >,
1520        ) -> Self {
1521            Self(RequestBuilder::new(stub))
1522        }
1523
1524        /// Sets the full request, replacing any prior values.
1525        pub fn with_request<
1526            V: Into<crate::model::instance_group_manager_resize_requests::InsertRequest>,
1527        >(
1528            mut self,
1529            v: V,
1530        ) -> Self {
1531            self.0.request = v.into();
1532            self
1533        }
1534
1535        /// Sets all the options, replacing any prior values.
1536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537            self.0.options = v.into();
1538            self
1539        }
1540
1541        /// Sends the request.
1542        pub async fn send(self) -> Result<crate::model::Operation> {
1543            (*self.0.stub)
1544                .insert(self.0.request, self.0.options)
1545                .await
1546                .map(gax::response::Response::into_body)
1547        }
1548
1549        /// Sets the value of [instance_group_manager][crate::model::instance_group_manager_resize_requests::InsertRequest::instance_group_manager].
1550        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1551            self.0.request.instance_group_manager = v.into();
1552            self
1553        }
1554
1555        /// Sets the value of [project][crate::model::instance_group_manager_resize_requests::InsertRequest::project].
1556        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1557            self.0.request.project = v.into();
1558            self
1559        }
1560
1561        /// Sets the value of [request_id][crate::model::instance_group_manager_resize_requests::InsertRequest::request_id].
1562        pub fn set_request_id<T>(mut self, v: T) -> Self
1563        where
1564            T: std::convert::Into<std::string::String>,
1565        {
1566            self.0.request.request_id = std::option::Option::Some(v.into());
1567            self
1568        }
1569
1570        /// Sets or clears the value of [request_id][crate::model::instance_group_manager_resize_requests::InsertRequest::request_id].
1571        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1572        where
1573            T: std::convert::Into<std::string::String>,
1574        {
1575            self.0.request.request_id = v.map(|x| x.into());
1576            self
1577        }
1578
1579        /// Sets the value of [zone][crate::model::instance_group_manager_resize_requests::InsertRequest::zone].
1580        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581            self.0.request.zone = v.into();
1582            self
1583        }
1584
1585        /// Sets the value of [body][crate::model::instance_group_manager_resize_requests::InsertRequest::body].
1586        pub fn set_body<T>(mut self, v: T) -> Self
1587        where
1588            T: std::convert::Into<crate::model::InstanceGroupManagerResizeRequest>,
1589        {
1590            self.0.request.body = std::option::Option::Some(v.into());
1591            self
1592        }
1593
1594        /// Sets or clears the value of [body][crate::model::instance_group_manager_resize_requests::InsertRequest::body].
1595        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1596        where
1597            T: std::convert::Into<crate::model::InstanceGroupManagerResizeRequest>,
1598        {
1599            self.0.request.body = v.map(|x| x.into());
1600            self
1601        }
1602    }
1603
1604    #[doc(hidden)]
1605    impl gax::options::internal::RequestBuilder for Insert {
1606        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1607            &mut self.0.options
1608        }
1609    }
1610
1611    /// The request builder for [InstanceGroupManagerResizeRequests::list][crate::client::InstanceGroupManagerResizeRequests::list] calls.
1612    ///
1613    /// # Example
1614    /// ```no_run
1615    /// # use google_cloud_compute_v1::builder;
1616    /// use builder::instance_group_manager_resize_requests::List;
1617    /// # tokio_test::block_on(async {
1618    /// use gax::paginator::ItemPaginator;
1619    ///
1620    /// let builder = prepare_request_builder();
1621    /// let mut items = builder.by_item();
1622    /// while let Some(result) = items.next().await {
1623    ///   let item = result?;
1624    /// }
1625    /// # gax::Result::<()>::Ok(()) });
1626    ///
1627    /// fn prepare_request_builder() -> List {
1628    ///   # panic!();
1629    ///   // ... details omitted ...
1630    /// }
1631    /// ```
1632    #[derive(Clone, Debug)]
1633    pub struct List(
1634        RequestBuilder<crate::model::instance_group_manager_resize_requests::ListRequest>,
1635    );
1636
1637    impl List {
1638        pub(crate) fn new(
1639            stub: std::sync::Arc<
1640                dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1641            >,
1642        ) -> Self {
1643            Self(RequestBuilder::new(stub))
1644        }
1645
1646        /// Sets the full request, replacing any prior values.
1647        pub fn with_request<
1648            V: Into<crate::model::instance_group_manager_resize_requests::ListRequest>,
1649        >(
1650            mut self,
1651            v: V,
1652        ) -> Self {
1653            self.0.request = v.into();
1654            self
1655        }
1656
1657        /// Sets all the options, replacing any prior values.
1658        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1659            self.0.options = v.into();
1660            self
1661        }
1662
1663        /// Sends the request.
1664        pub async fn send(
1665            self,
1666        ) -> Result<crate::model::InstanceGroupManagerResizeRequestsListResponse> {
1667            (*self.0.stub)
1668                .list(self.0.request, self.0.options)
1669                .await
1670                .map(gax::response::Response::into_body)
1671        }
1672
1673        /// Streams each page in the collection.
1674        pub fn by_page(
1675            self,
1676        ) -> impl gax::paginator::Paginator<
1677            crate::model::InstanceGroupManagerResizeRequestsListResponse,
1678            gax::error::Error,
1679        > {
1680            use std::clone::Clone;
1681            let token = self.0.request.page_token.clone().unwrap_or_default();
1682            let execute = move |token: String| {
1683                let mut builder = self.clone();
1684                builder.0.request = builder.0.request.set_page_token(token);
1685                builder.send()
1686            };
1687            gax::paginator::internal::new_paginator(token, execute)
1688        }
1689
1690        /// Streams each item in the collection.
1691        pub fn by_item(
1692            self,
1693        ) -> impl gax::paginator::ItemPaginator<
1694            crate::model::InstanceGroupManagerResizeRequestsListResponse,
1695            gax::error::Error,
1696        > {
1697            use gax::paginator::Paginator;
1698            self.by_page().items()
1699        }
1700
1701        /// Sets the value of [filter][crate::model::instance_group_manager_resize_requests::ListRequest::filter].
1702        pub fn set_filter<T>(mut self, v: T) -> Self
1703        where
1704            T: std::convert::Into<std::string::String>,
1705        {
1706            self.0.request.filter = std::option::Option::Some(v.into());
1707            self
1708        }
1709
1710        /// Sets or clears the value of [filter][crate::model::instance_group_manager_resize_requests::ListRequest::filter].
1711        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
1712        where
1713            T: std::convert::Into<std::string::String>,
1714        {
1715            self.0.request.filter = v.map(|x| x.into());
1716            self
1717        }
1718
1719        /// Sets the value of [instance_group_manager][crate::model::instance_group_manager_resize_requests::ListRequest::instance_group_manager].
1720        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721            self.0.request.instance_group_manager = v.into();
1722            self
1723        }
1724
1725        /// Sets the value of [max_results][crate::model::instance_group_manager_resize_requests::ListRequest::max_results].
1726        pub fn set_max_results<T>(mut self, v: T) -> Self
1727        where
1728            T: std::convert::Into<u32>,
1729        {
1730            self.0.request.max_results = std::option::Option::Some(v.into());
1731            self
1732        }
1733
1734        /// Sets or clears the value of [max_results][crate::model::instance_group_manager_resize_requests::ListRequest::max_results].
1735        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
1736        where
1737            T: std::convert::Into<u32>,
1738        {
1739            self.0.request.max_results = v.map(|x| x.into());
1740            self
1741        }
1742
1743        /// Sets the value of [order_by][crate::model::instance_group_manager_resize_requests::ListRequest::order_by].
1744        pub fn set_order_by<T>(mut self, v: T) -> Self
1745        where
1746            T: std::convert::Into<std::string::String>,
1747        {
1748            self.0.request.order_by = std::option::Option::Some(v.into());
1749            self
1750        }
1751
1752        /// Sets or clears the value of [order_by][crate::model::instance_group_manager_resize_requests::ListRequest::order_by].
1753        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
1754        where
1755            T: std::convert::Into<std::string::String>,
1756        {
1757            self.0.request.order_by = v.map(|x| x.into());
1758            self
1759        }
1760
1761        /// Sets the value of [page_token][crate::model::instance_group_manager_resize_requests::ListRequest::page_token].
1762        pub fn set_page_token<T>(mut self, v: T) -> Self
1763        where
1764            T: std::convert::Into<std::string::String>,
1765        {
1766            self.0.request.page_token = std::option::Option::Some(v.into());
1767            self
1768        }
1769
1770        /// Sets or clears the value of [page_token][crate::model::instance_group_manager_resize_requests::ListRequest::page_token].
1771        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
1772        where
1773            T: std::convert::Into<std::string::String>,
1774        {
1775            self.0.request.page_token = v.map(|x| x.into());
1776            self
1777        }
1778
1779        /// Sets the value of [project][crate::model::instance_group_manager_resize_requests::ListRequest::project].
1780        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1781            self.0.request.project = v.into();
1782            self
1783        }
1784
1785        /// Sets the value of [return_partial_success][crate::model::instance_group_manager_resize_requests::ListRequest::return_partial_success].
1786        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
1787        where
1788            T: std::convert::Into<bool>,
1789        {
1790            self.0.request.return_partial_success = std::option::Option::Some(v.into());
1791            self
1792        }
1793
1794        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_manager_resize_requests::ListRequest::return_partial_success].
1795        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
1796        where
1797            T: std::convert::Into<bool>,
1798        {
1799            self.0.request.return_partial_success = v.map(|x| x.into());
1800            self
1801        }
1802
1803        /// Sets the value of [zone][crate::model::instance_group_manager_resize_requests::ListRequest::zone].
1804        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805            self.0.request.zone = v.into();
1806            self
1807        }
1808    }
1809
1810    #[doc(hidden)]
1811    impl gax::options::internal::RequestBuilder for List {
1812        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813            &mut self.0.options
1814        }
1815    }
1816}
1817
1818#[cfg(feature = "instance-group-managers")]
1819#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
1820pub mod instance_group_managers {
1821    use crate::Result;
1822
1823    /// A builder for [InstanceGroupManagers][crate::client::InstanceGroupManagers].
1824    ///
1825    /// ```
1826    /// # tokio_test::block_on(async {
1827    /// # use google_cloud_compute_v1::*;
1828    /// # use builder::instance_group_managers::ClientBuilder;
1829    /// # use client::InstanceGroupManagers;
1830    /// let builder : ClientBuilder = InstanceGroupManagers::builder();
1831    /// let client = builder
1832    ///     .with_endpoint("https://compute.googleapis.com")
1833    ///     .build().await?;
1834    /// # gax::client_builder::Result::<()>::Ok(()) });
1835    /// ```
1836    pub type ClientBuilder =
1837        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1838
1839    pub(crate) mod client {
1840        use super::super::super::client::InstanceGroupManagers;
1841        pub struct Factory;
1842        impl gax::client_builder::internal::ClientFactory for Factory {
1843            type Client = InstanceGroupManagers;
1844            type Credentials = gaxi::options::Credentials;
1845            async fn build(
1846                self,
1847                config: gaxi::options::ClientConfig,
1848            ) -> gax::client_builder::Result<Self::Client> {
1849                Self::Client::new(config).await
1850            }
1851        }
1852    }
1853
1854    /// Common implementation for [crate::client::InstanceGroupManagers] request builders.
1855    #[derive(Clone, Debug)]
1856    pub(crate) struct RequestBuilder<R: std::default::Default> {
1857        stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1858        request: R,
1859        options: gax::options::RequestOptions,
1860    }
1861
1862    impl<R> RequestBuilder<R>
1863    where
1864        R: std::default::Default,
1865    {
1866        pub(crate) fn new(
1867            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1868        ) -> Self {
1869            Self {
1870                stub,
1871                request: R::default(),
1872                options: gax::options::RequestOptions::default(),
1873            }
1874        }
1875    }
1876
1877    /// The request builder for [InstanceGroupManagers::abandon_instances][crate::client::InstanceGroupManagers::abandon_instances] calls.
1878    ///
1879    /// # Example
1880    /// ```no_run
1881    /// # use google_cloud_compute_v1::builder;
1882    /// use builder::instance_group_managers::AbandonInstances;
1883    /// # tokio_test::block_on(async {
1884    ///
1885    /// let builder = prepare_request_builder();
1886    /// let response = builder.send().await?;
1887    /// # gax::Result::<()>::Ok(()) });
1888    ///
1889    /// fn prepare_request_builder() -> AbandonInstances {
1890    ///   # panic!();
1891    ///   // ... details omitted ...
1892    /// }
1893    /// ```
1894    #[derive(Clone, Debug)]
1895    pub struct AbandonInstances(
1896        RequestBuilder<crate::model::instance_group_managers::AbandonInstancesRequest>,
1897    );
1898
1899    impl AbandonInstances {
1900        pub(crate) fn new(
1901            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1902        ) -> Self {
1903            Self(RequestBuilder::new(stub))
1904        }
1905
1906        /// Sets the full request, replacing any prior values.
1907        pub fn with_request<
1908            V: Into<crate::model::instance_group_managers::AbandonInstancesRequest>,
1909        >(
1910            mut self,
1911            v: V,
1912        ) -> Self {
1913            self.0.request = v.into();
1914            self
1915        }
1916
1917        /// Sets all the options, replacing any prior values.
1918        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1919            self.0.options = v.into();
1920            self
1921        }
1922
1923        /// Sends the request.
1924        pub async fn send(self) -> Result<crate::model::Operation> {
1925            (*self.0.stub)
1926                .abandon_instances(self.0.request, self.0.options)
1927                .await
1928                .map(gax::response::Response::into_body)
1929        }
1930
1931        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::AbandonInstancesRequest::instance_group_manager].
1932        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1933            self.0.request.instance_group_manager = v.into();
1934            self
1935        }
1936
1937        /// Sets the value of [project][crate::model::instance_group_managers::AbandonInstancesRequest::project].
1938        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1939            self.0.request.project = v.into();
1940            self
1941        }
1942
1943        /// Sets the value of [request_id][crate::model::instance_group_managers::AbandonInstancesRequest::request_id].
1944        pub fn set_request_id<T>(mut self, v: T) -> Self
1945        where
1946            T: std::convert::Into<std::string::String>,
1947        {
1948            self.0.request.request_id = std::option::Option::Some(v.into());
1949            self
1950        }
1951
1952        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::AbandonInstancesRequest::request_id].
1953        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1954        where
1955            T: std::convert::Into<std::string::String>,
1956        {
1957            self.0.request.request_id = v.map(|x| x.into());
1958            self
1959        }
1960
1961        /// Sets the value of [zone][crate::model::instance_group_managers::AbandonInstancesRequest::zone].
1962        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1963            self.0.request.zone = v.into();
1964            self
1965        }
1966
1967        /// Sets the value of [body][crate::model::instance_group_managers::AbandonInstancesRequest::body].
1968        pub fn set_body<T>(mut self, v: T) -> Self
1969        where
1970            T: std::convert::Into<crate::model::InstanceGroupManagersAbandonInstancesRequest>,
1971        {
1972            self.0.request.body = std::option::Option::Some(v.into());
1973            self
1974        }
1975
1976        /// Sets or clears the value of [body][crate::model::instance_group_managers::AbandonInstancesRequest::body].
1977        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1978        where
1979            T: std::convert::Into<crate::model::InstanceGroupManagersAbandonInstancesRequest>,
1980        {
1981            self.0.request.body = v.map(|x| x.into());
1982            self
1983        }
1984    }
1985
1986    #[doc(hidden)]
1987    impl gax::options::internal::RequestBuilder for AbandonInstances {
1988        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1989            &mut self.0.options
1990        }
1991    }
1992
1993    /// The request builder for [InstanceGroupManagers::aggregated_list][crate::client::InstanceGroupManagers::aggregated_list] calls.
1994    ///
1995    /// # Example
1996    /// ```no_run
1997    /// # use google_cloud_compute_v1::builder;
1998    /// use builder::instance_group_managers::AggregatedList;
1999    /// # tokio_test::block_on(async {
2000    /// use gax::paginator::ItemPaginator;
2001    ///
2002    /// let builder = prepare_request_builder();
2003    /// let mut items = builder.by_item();
2004    /// while let Some(result) = items.next().await {
2005    ///   let item = result?;
2006    /// }
2007    /// # gax::Result::<()>::Ok(()) });
2008    ///
2009    /// fn prepare_request_builder() -> AggregatedList {
2010    ///   # panic!();
2011    ///   // ... details omitted ...
2012    /// }
2013    /// ```
2014    #[derive(Clone, Debug)]
2015    pub struct AggregatedList(
2016        RequestBuilder<crate::model::instance_group_managers::AggregatedListRequest>,
2017    );
2018
2019    impl AggregatedList {
2020        pub(crate) fn new(
2021            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2022        ) -> Self {
2023            Self(RequestBuilder::new(stub))
2024        }
2025
2026        /// Sets the full request, replacing any prior values.
2027        pub fn with_request<
2028            V: Into<crate::model::instance_group_managers::AggregatedListRequest>,
2029        >(
2030            mut self,
2031            v: V,
2032        ) -> Self {
2033            self.0.request = v.into();
2034            self
2035        }
2036
2037        /// Sets all the options, replacing any prior values.
2038        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2039            self.0.options = v.into();
2040            self
2041        }
2042
2043        /// Sends the request.
2044        pub async fn send(self) -> Result<crate::model::InstanceGroupManagerAggregatedList> {
2045            (*self.0.stub)
2046                .aggregated_list(self.0.request, self.0.options)
2047                .await
2048                .map(gax::response::Response::into_body)
2049        }
2050
2051        /// Streams each page in the collection.
2052        pub fn by_page(
2053            self,
2054        ) -> impl gax::paginator::Paginator<
2055            crate::model::InstanceGroupManagerAggregatedList,
2056            gax::error::Error,
2057        > {
2058            use std::clone::Clone;
2059            let token = self.0.request.page_token.clone().unwrap_or_default();
2060            let execute = move |token: String| {
2061                let mut builder = self.clone();
2062                builder.0.request = builder.0.request.set_page_token(token);
2063                builder.send()
2064            };
2065            gax::paginator::internal::new_paginator(token, execute)
2066        }
2067
2068        /// Streams each item in the collection.
2069        pub fn by_item(
2070            self,
2071        ) -> impl gax::paginator::ItemPaginator<
2072            crate::model::InstanceGroupManagerAggregatedList,
2073            gax::error::Error,
2074        > {
2075            use gax::paginator::Paginator;
2076            self.by_page().items()
2077        }
2078
2079        /// Sets the value of [filter][crate::model::instance_group_managers::AggregatedListRequest::filter].
2080        pub fn set_filter<T>(mut self, v: T) -> Self
2081        where
2082            T: std::convert::Into<std::string::String>,
2083        {
2084            self.0.request.filter = std::option::Option::Some(v.into());
2085            self
2086        }
2087
2088        /// Sets or clears the value of [filter][crate::model::instance_group_managers::AggregatedListRequest::filter].
2089        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
2090        where
2091            T: std::convert::Into<std::string::String>,
2092        {
2093            self.0.request.filter = v.map(|x| x.into());
2094            self
2095        }
2096
2097        /// Sets the value of [include_all_scopes][crate::model::instance_group_managers::AggregatedListRequest::include_all_scopes].
2098        pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
2099        where
2100            T: std::convert::Into<bool>,
2101        {
2102            self.0.request.include_all_scopes = std::option::Option::Some(v.into());
2103            self
2104        }
2105
2106        /// Sets or clears the value of [include_all_scopes][crate::model::instance_group_managers::AggregatedListRequest::include_all_scopes].
2107        pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
2108        where
2109            T: std::convert::Into<bool>,
2110        {
2111            self.0.request.include_all_scopes = v.map(|x| x.into());
2112            self
2113        }
2114
2115        /// Sets the value of [max_results][crate::model::instance_group_managers::AggregatedListRequest::max_results].
2116        pub fn set_max_results<T>(mut self, v: T) -> Self
2117        where
2118            T: std::convert::Into<u32>,
2119        {
2120            self.0.request.max_results = std::option::Option::Some(v.into());
2121            self
2122        }
2123
2124        /// Sets or clears the value of [max_results][crate::model::instance_group_managers::AggregatedListRequest::max_results].
2125        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
2126        where
2127            T: std::convert::Into<u32>,
2128        {
2129            self.0.request.max_results = v.map(|x| x.into());
2130            self
2131        }
2132
2133        /// Sets the value of [order_by][crate::model::instance_group_managers::AggregatedListRequest::order_by].
2134        pub fn set_order_by<T>(mut self, v: T) -> Self
2135        where
2136            T: std::convert::Into<std::string::String>,
2137        {
2138            self.0.request.order_by = std::option::Option::Some(v.into());
2139            self
2140        }
2141
2142        /// Sets or clears the value of [order_by][crate::model::instance_group_managers::AggregatedListRequest::order_by].
2143        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
2144        where
2145            T: std::convert::Into<std::string::String>,
2146        {
2147            self.0.request.order_by = v.map(|x| x.into());
2148            self
2149        }
2150
2151        /// Sets the value of [page_token][crate::model::instance_group_managers::AggregatedListRequest::page_token].
2152        pub fn set_page_token<T>(mut self, v: T) -> Self
2153        where
2154            T: std::convert::Into<std::string::String>,
2155        {
2156            self.0.request.page_token = std::option::Option::Some(v.into());
2157            self
2158        }
2159
2160        /// Sets or clears the value of [page_token][crate::model::instance_group_managers::AggregatedListRequest::page_token].
2161        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
2162        where
2163            T: std::convert::Into<std::string::String>,
2164        {
2165            self.0.request.page_token = v.map(|x| x.into());
2166            self
2167        }
2168
2169        /// Sets the value of [project][crate::model::instance_group_managers::AggregatedListRequest::project].
2170        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2171            self.0.request.project = v.into();
2172            self
2173        }
2174
2175        /// Sets the value of [return_partial_success][crate::model::instance_group_managers::AggregatedListRequest::return_partial_success].
2176        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
2177        where
2178            T: std::convert::Into<bool>,
2179        {
2180            self.0.request.return_partial_success = std::option::Option::Some(v.into());
2181            self
2182        }
2183
2184        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_managers::AggregatedListRequest::return_partial_success].
2185        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
2186        where
2187            T: std::convert::Into<bool>,
2188        {
2189            self.0.request.return_partial_success = v.map(|x| x.into());
2190            self
2191        }
2192
2193        /// Sets the value of [service_project_number][crate::model::instance_group_managers::AggregatedListRequest::service_project_number].
2194        pub fn set_service_project_number<T>(mut self, v: T) -> Self
2195        where
2196            T: std::convert::Into<i64>,
2197        {
2198            self.0.request.service_project_number = std::option::Option::Some(v.into());
2199            self
2200        }
2201
2202        /// Sets or clears the value of [service_project_number][crate::model::instance_group_managers::AggregatedListRequest::service_project_number].
2203        pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
2204        where
2205            T: std::convert::Into<i64>,
2206        {
2207            self.0.request.service_project_number = v.map(|x| x.into());
2208            self
2209        }
2210    }
2211
2212    #[doc(hidden)]
2213    impl gax::options::internal::RequestBuilder for AggregatedList {
2214        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2215            &mut self.0.options
2216        }
2217    }
2218
2219    /// The request builder for [InstanceGroupManagers::apply_updates_to_instances][crate::client::InstanceGroupManagers::apply_updates_to_instances] calls.
2220    ///
2221    /// # Example
2222    /// ```no_run
2223    /// # use google_cloud_compute_v1::builder;
2224    /// use builder::instance_group_managers::ApplyUpdatesToInstances;
2225    /// # tokio_test::block_on(async {
2226    ///
2227    /// let builder = prepare_request_builder();
2228    /// let response = builder.send().await?;
2229    /// # gax::Result::<()>::Ok(()) });
2230    ///
2231    /// fn prepare_request_builder() -> ApplyUpdatesToInstances {
2232    ///   # panic!();
2233    ///   // ... details omitted ...
2234    /// }
2235    /// ```
2236    #[derive(Clone, Debug)]
2237    pub struct ApplyUpdatesToInstances(
2238        RequestBuilder<crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest>,
2239    );
2240
2241    impl ApplyUpdatesToInstances {
2242        pub(crate) fn new(
2243            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2244        ) -> Self {
2245            Self(RequestBuilder::new(stub))
2246        }
2247
2248        /// Sets the full request, replacing any prior values.
2249        pub fn with_request<
2250            V: Into<crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest>,
2251        >(
2252            mut self,
2253            v: V,
2254        ) -> Self {
2255            self.0.request = v.into();
2256            self
2257        }
2258
2259        /// Sets all the options, replacing any prior values.
2260        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2261            self.0.options = v.into();
2262            self
2263        }
2264
2265        /// Sends the request.
2266        pub async fn send(self) -> Result<crate::model::Operation> {
2267            (*self.0.stub)
2268                .apply_updates_to_instances(self.0.request, self.0.options)
2269                .await
2270                .map(gax::response::Response::into_body)
2271        }
2272
2273        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest::instance_group_manager].
2274        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2275            self.0.request.instance_group_manager = v.into();
2276            self
2277        }
2278
2279        /// Sets the value of [project][crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest::project].
2280        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2281            self.0.request.project = v.into();
2282            self
2283        }
2284
2285        /// Sets the value of [zone][crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest::zone].
2286        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2287            self.0.request.zone = v.into();
2288            self
2289        }
2290
2291        /// Sets the value of [body][crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest::body].
2292        pub fn set_body<T>(mut self, v: T) -> Self
2293        where
2294            T: std::convert::Into<crate::model::InstanceGroupManagersApplyUpdatesRequest>,
2295        {
2296            self.0.request.body = std::option::Option::Some(v.into());
2297            self
2298        }
2299
2300        /// Sets or clears the value of [body][crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest::body].
2301        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2302        where
2303            T: std::convert::Into<crate::model::InstanceGroupManagersApplyUpdatesRequest>,
2304        {
2305            self.0.request.body = v.map(|x| x.into());
2306            self
2307        }
2308    }
2309
2310    #[doc(hidden)]
2311    impl gax::options::internal::RequestBuilder for ApplyUpdatesToInstances {
2312        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2313            &mut self.0.options
2314        }
2315    }
2316
2317    /// The request builder for [InstanceGroupManagers::create_instances][crate::client::InstanceGroupManagers::create_instances] calls.
2318    ///
2319    /// # Example
2320    /// ```no_run
2321    /// # use google_cloud_compute_v1::builder;
2322    /// use builder::instance_group_managers::CreateInstances;
2323    /// # tokio_test::block_on(async {
2324    ///
2325    /// let builder = prepare_request_builder();
2326    /// let response = builder.send().await?;
2327    /// # gax::Result::<()>::Ok(()) });
2328    ///
2329    /// fn prepare_request_builder() -> CreateInstances {
2330    ///   # panic!();
2331    ///   // ... details omitted ...
2332    /// }
2333    /// ```
2334    #[derive(Clone, Debug)]
2335    pub struct CreateInstances(
2336        RequestBuilder<crate::model::instance_group_managers::CreateInstancesRequest>,
2337    );
2338
2339    impl CreateInstances {
2340        pub(crate) fn new(
2341            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2342        ) -> Self {
2343            Self(RequestBuilder::new(stub))
2344        }
2345
2346        /// Sets the full request, replacing any prior values.
2347        pub fn with_request<
2348            V: Into<crate::model::instance_group_managers::CreateInstancesRequest>,
2349        >(
2350            mut self,
2351            v: V,
2352        ) -> Self {
2353            self.0.request = v.into();
2354            self
2355        }
2356
2357        /// Sets all the options, replacing any prior values.
2358        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2359            self.0.options = v.into();
2360            self
2361        }
2362
2363        /// Sends the request.
2364        pub async fn send(self) -> Result<crate::model::Operation> {
2365            (*self.0.stub)
2366                .create_instances(self.0.request, self.0.options)
2367                .await
2368                .map(gax::response::Response::into_body)
2369        }
2370
2371        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::CreateInstancesRequest::instance_group_manager].
2372        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373            self.0.request.instance_group_manager = v.into();
2374            self
2375        }
2376
2377        /// Sets the value of [project][crate::model::instance_group_managers::CreateInstancesRequest::project].
2378        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2379            self.0.request.project = v.into();
2380            self
2381        }
2382
2383        /// Sets the value of [request_id][crate::model::instance_group_managers::CreateInstancesRequest::request_id].
2384        pub fn set_request_id<T>(mut self, v: T) -> Self
2385        where
2386            T: std::convert::Into<std::string::String>,
2387        {
2388            self.0.request.request_id = std::option::Option::Some(v.into());
2389            self
2390        }
2391
2392        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::CreateInstancesRequest::request_id].
2393        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2394        where
2395            T: std::convert::Into<std::string::String>,
2396        {
2397            self.0.request.request_id = v.map(|x| x.into());
2398            self
2399        }
2400
2401        /// Sets the value of [zone][crate::model::instance_group_managers::CreateInstancesRequest::zone].
2402        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2403            self.0.request.zone = v.into();
2404            self
2405        }
2406
2407        /// Sets the value of [body][crate::model::instance_group_managers::CreateInstancesRequest::body].
2408        pub fn set_body<T>(mut self, v: T) -> Self
2409        where
2410            T: std::convert::Into<crate::model::InstanceGroupManagersCreateInstancesRequest>,
2411        {
2412            self.0.request.body = std::option::Option::Some(v.into());
2413            self
2414        }
2415
2416        /// Sets or clears the value of [body][crate::model::instance_group_managers::CreateInstancesRequest::body].
2417        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2418        where
2419            T: std::convert::Into<crate::model::InstanceGroupManagersCreateInstancesRequest>,
2420        {
2421            self.0.request.body = v.map(|x| x.into());
2422            self
2423        }
2424    }
2425
2426    #[doc(hidden)]
2427    impl gax::options::internal::RequestBuilder for CreateInstances {
2428        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2429            &mut self.0.options
2430        }
2431    }
2432
2433    /// The request builder for [InstanceGroupManagers::delete][crate::client::InstanceGroupManagers::delete] calls.
2434    ///
2435    /// # Example
2436    /// ```no_run
2437    /// # use google_cloud_compute_v1::builder;
2438    /// use builder::instance_group_managers::Delete;
2439    /// # tokio_test::block_on(async {
2440    ///
2441    /// let builder = prepare_request_builder();
2442    /// let response = builder.send().await?;
2443    /// # gax::Result::<()>::Ok(()) });
2444    ///
2445    /// fn prepare_request_builder() -> Delete {
2446    ///   # panic!();
2447    ///   // ... details omitted ...
2448    /// }
2449    /// ```
2450    #[derive(Clone, Debug)]
2451    pub struct Delete(RequestBuilder<crate::model::instance_group_managers::DeleteRequest>);
2452
2453    impl Delete {
2454        pub(crate) fn new(
2455            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2456        ) -> Self {
2457            Self(RequestBuilder::new(stub))
2458        }
2459
2460        /// Sets the full request, replacing any prior values.
2461        pub fn with_request<V: Into<crate::model::instance_group_managers::DeleteRequest>>(
2462            mut self,
2463            v: V,
2464        ) -> Self {
2465            self.0.request = v.into();
2466            self
2467        }
2468
2469        /// Sets all the options, replacing any prior values.
2470        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2471            self.0.options = v.into();
2472            self
2473        }
2474
2475        /// Sends the request.
2476        pub async fn send(self) -> Result<crate::model::Operation> {
2477            (*self.0.stub)
2478                .delete(self.0.request, self.0.options)
2479                .await
2480                .map(gax::response::Response::into_body)
2481        }
2482
2483        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::DeleteRequest::instance_group_manager].
2484        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2485            self.0.request.instance_group_manager = v.into();
2486            self
2487        }
2488
2489        /// Sets the value of [project][crate::model::instance_group_managers::DeleteRequest::project].
2490        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2491            self.0.request.project = v.into();
2492            self
2493        }
2494
2495        /// Sets the value of [request_id][crate::model::instance_group_managers::DeleteRequest::request_id].
2496        pub fn set_request_id<T>(mut self, v: T) -> Self
2497        where
2498            T: std::convert::Into<std::string::String>,
2499        {
2500            self.0.request.request_id = std::option::Option::Some(v.into());
2501            self
2502        }
2503
2504        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::DeleteRequest::request_id].
2505        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2506        where
2507            T: std::convert::Into<std::string::String>,
2508        {
2509            self.0.request.request_id = v.map(|x| x.into());
2510            self
2511        }
2512
2513        /// Sets the value of [zone][crate::model::instance_group_managers::DeleteRequest::zone].
2514        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2515            self.0.request.zone = v.into();
2516            self
2517        }
2518    }
2519
2520    #[doc(hidden)]
2521    impl gax::options::internal::RequestBuilder for Delete {
2522        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2523            &mut self.0.options
2524        }
2525    }
2526
2527    /// The request builder for [InstanceGroupManagers::delete_instances][crate::client::InstanceGroupManagers::delete_instances] calls.
2528    ///
2529    /// # Example
2530    /// ```no_run
2531    /// # use google_cloud_compute_v1::builder;
2532    /// use builder::instance_group_managers::DeleteInstances;
2533    /// # tokio_test::block_on(async {
2534    ///
2535    /// let builder = prepare_request_builder();
2536    /// let response = builder.send().await?;
2537    /// # gax::Result::<()>::Ok(()) });
2538    ///
2539    /// fn prepare_request_builder() -> DeleteInstances {
2540    ///   # panic!();
2541    ///   // ... details omitted ...
2542    /// }
2543    /// ```
2544    #[derive(Clone, Debug)]
2545    pub struct DeleteInstances(
2546        RequestBuilder<crate::model::instance_group_managers::DeleteInstancesRequest>,
2547    );
2548
2549    impl DeleteInstances {
2550        pub(crate) fn new(
2551            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2552        ) -> Self {
2553            Self(RequestBuilder::new(stub))
2554        }
2555
2556        /// Sets the full request, replacing any prior values.
2557        pub fn with_request<
2558            V: Into<crate::model::instance_group_managers::DeleteInstancesRequest>,
2559        >(
2560            mut self,
2561            v: V,
2562        ) -> Self {
2563            self.0.request = v.into();
2564            self
2565        }
2566
2567        /// Sets all the options, replacing any prior values.
2568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569            self.0.options = v.into();
2570            self
2571        }
2572
2573        /// Sends the request.
2574        pub async fn send(self) -> Result<crate::model::Operation> {
2575            (*self.0.stub)
2576                .delete_instances(self.0.request, self.0.options)
2577                .await
2578                .map(gax::response::Response::into_body)
2579        }
2580
2581        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::DeleteInstancesRequest::instance_group_manager].
2582        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583            self.0.request.instance_group_manager = v.into();
2584            self
2585        }
2586
2587        /// Sets the value of [project][crate::model::instance_group_managers::DeleteInstancesRequest::project].
2588        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589            self.0.request.project = v.into();
2590            self
2591        }
2592
2593        /// Sets the value of [request_id][crate::model::instance_group_managers::DeleteInstancesRequest::request_id].
2594        pub fn set_request_id<T>(mut self, v: T) -> Self
2595        where
2596            T: std::convert::Into<std::string::String>,
2597        {
2598            self.0.request.request_id = std::option::Option::Some(v.into());
2599            self
2600        }
2601
2602        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::DeleteInstancesRequest::request_id].
2603        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2604        where
2605            T: std::convert::Into<std::string::String>,
2606        {
2607            self.0.request.request_id = v.map(|x| x.into());
2608            self
2609        }
2610
2611        /// Sets the value of [zone][crate::model::instance_group_managers::DeleteInstancesRequest::zone].
2612        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613            self.0.request.zone = v.into();
2614            self
2615        }
2616
2617        /// Sets the value of [body][crate::model::instance_group_managers::DeleteInstancesRequest::body].
2618        pub fn set_body<T>(mut self, v: T) -> Self
2619        where
2620            T: std::convert::Into<crate::model::InstanceGroupManagersDeleteInstancesRequest>,
2621        {
2622            self.0.request.body = std::option::Option::Some(v.into());
2623            self
2624        }
2625
2626        /// Sets or clears the value of [body][crate::model::instance_group_managers::DeleteInstancesRequest::body].
2627        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2628        where
2629            T: std::convert::Into<crate::model::InstanceGroupManagersDeleteInstancesRequest>,
2630        {
2631            self.0.request.body = v.map(|x| x.into());
2632            self
2633        }
2634    }
2635
2636    #[doc(hidden)]
2637    impl gax::options::internal::RequestBuilder for DeleteInstances {
2638        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2639            &mut self.0.options
2640        }
2641    }
2642
2643    /// The request builder for [InstanceGroupManagers::delete_per_instance_configs][crate::client::InstanceGroupManagers::delete_per_instance_configs] calls.
2644    ///
2645    /// # Example
2646    /// ```no_run
2647    /// # use google_cloud_compute_v1::builder;
2648    /// use builder::instance_group_managers::DeletePerInstanceConfigs;
2649    /// # tokio_test::block_on(async {
2650    ///
2651    /// let builder = prepare_request_builder();
2652    /// let response = builder.send().await?;
2653    /// # gax::Result::<()>::Ok(()) });
2654    ///
2655    /// fn prepare_request_builder() -> DeletePerInstanceConfigs {
2656    ///   # panic!();
2657    ///   // ... details omitted ...
2658    /// }
2659    /// ```
2660    #[derive(Clone, Debug)]
2661    pub struct DeletePerInstanceConfigs(
2662        RequestBuilder<crate::model::instance_group_managers::DeletePerInstanceConfigsRequest>,
2663    );
2664
2665    impl DeletePerInstanceConfigs {
2666        pub(crate) fn new(
2667            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2668        ) -> Self {
2669            Self(RequestBuilder::new(stub))
2670        }
2671
2672        /// Sets the full request, replacing any prior values.
2673        pub fn with_request<
2674            V: Into<crate::model::instance_group_managers::DeletePerInstanceConfigsRequest>,
2675        >(
2676            mut self,
2677            v: V,
2678        ) -> Self {
2679            self.0.request = v.into();
2680            self
2681        }
2682
2683        /// Sets all the options, replacing any prior values.
2684        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2685            self.0.options = v.into();
2686            self
2687        }
2688
2689        /// Sends the request.
2690        pub async fn send(self) -> Result<crate::model::Operation> {
2691            (*self.0.stub)
2692                .delete_per_instance_configs(self.0.request, self.0.options)
2693                .await
2694                .map(gax::response::Response::into_body)
2695        }
2696
2697        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::DeletePerInstanceConfigsRequest::instance_group_manager].
2698        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2699            self.0.request.instance_group_manager = v.into();
2700            self
2701        }
2702
2703        /// Sets the value of [project][crate::model::instance_group_managers::DeletePerInstanceConfigsRequest::project].
2704        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705            self.0.request.project = v.into();
2706            self
2707        }
2708
2709        /// Sets the value of [zone][crate::model::instance_group_managers::DeletePerInstanceConfigsRequest::zone].
2710        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2711            self.0.request.zone = v.into();
2712            self
2713        }
2714
2715        /// Sets the value of [body][crate::model::instance_group_managers::DeletePerInstanceConfigsRequest::body].
2716        pub fn set_body<T>(mut self, v: T) -> Self
2717        where
2718            T: std::convert::Into<crate::model::InstanceGroupManagersDeletePerInstanceConfigsReq>,
2719        {
2720            self.0.request.body = std::option::Option::Some(v.into());
2721            self
2722        }
2723
2724        /// Sets or clears the value of [body][crate::model::instance_group_managers::DeletePerInstanceConfigsRequest::body].
2725        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2726        where
2727            T: std::convert::Into<crate::model::InstanceGroupManagersDeletePerInstanceConfigsReq>,
2728        {
2729            self.0.request.body = v.map(|x| x.into());
2730            self
2731        }
2732    }
2733
2734    #[doc(hidden)]
2735    impl gax::options::internal::RequestBuilder for DeletePerInstanceConfigs {
2736        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2737            &mut self.0.options
2738        }
2739    }
2740
2741    /// The request builder for [InstanceGroupManagers::get][crate::client::InstanceGroupManagers::get] calls.
2742    ///
2743    /// # Example
2744    /// ```no_run
2745    /// # use google_cloud_compute_v1::builder;
2746    /// use builder::instance_group_managers::Get;
2747    /// # tokio_test::block_on(async {
2748    ///
2749    /// let builder = prepare_request_builder();
2750    /// let response = builder.send().await?;
2751    /// # gax::Result::<()>::Ok(()) });
2752    ///
2753    /// fn prepare_request_builder() -> Get {
2754    ///   # panic!();
2755    ///   // ... details omitted ...
2756    /// }
2757    /// ```
2758    #[derive(Clone, Debug)]
2759    pub struct Get(RequestBuilder<crate::model::instance_group_managers::GetRequest>);
2760
2761    impl Get {
2762        pub(crate) fn new(
2763            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2764        ) -> Self {
2765            Self(RequestBuilder::new(stub))
2766        }
2767
2768        /// Sets the full request, replacing any prior values.
2769        pub fn with_request<V: Into<crate::model::instance_group_managers::GetRequest>>(
2770            mut self,
2771            v: V,
2772        ) -> Self {
2773            self.0.request = v.into();
2774            self
2775        }
2776
2777        /// Sets all the options, replacing any prior values.
2778        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2779            self.0.options = v.into();
2780            self
2781        }
2782
2783        /// Sends the request.
2784        pub async fn send(self) -> Result<crate::model::InstanceGroupManager> {
2785            (*self.0.stub)
2786                .get(self.0.request, self.0.options)
2787                .await
2788                .map(gax::response::Response::into_body)
2789        }
2790
2791        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::GetRequest::instance_group_manager].
2792        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2793            self.0.request.instance_group_manager = v.into();
2794            self
2795        }
2796
2797        /// Sets the value of [project][crate::model::instance_group_managers::GetRequest::project].
2798        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2799            self.0.request.project = v.into();
2800            self
2801        }
2802
2803        /// Sets the value of [zone][crate::model::instance_group_managers::GetRequest::zone].
2804        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2805            self.0.request.zone = v.into();
2806            self
2807        }
2808    }
2809
2810    #[doc(hidden)]
2811    impl gax::options::internal::RequestBuilder for Get {
2812        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2813            &mut self.0.options
2814        }
2815    }
2816
2817    /// The request builder for [InstanceGroupManagers::insert][crate::client::InstanceGroupManagers::insert] calls.
2818    ///
2819    /// # Example
2820    /// ```no_run
2821    /// # use google_cloud_compute_v1::builder;
2822    /// use builder::instance_group_managers::Insert;
2823    /// # tokio_test::block_on(async {
2824    ///
2825    /// let builder = prepare_request_builder();
2826    /// let response = builder.send().await?;
2827    /// # gax::Result::<()>::Ok(()) });
2828    ///
2829    /// fn prepare_request_builder() -> Insert {
2830    ///   # panic!();
2831    ///   // ... details omitted ...
2832    /// }
2833    /// ```
2834    #[derive(Clone, Debug)]
2835    pub struct Insert(RequestBuilder<crate::model::instance_group_managers::InsertRequest>);
2836
2837    impl Insert {
2838        pub(crate) fn new(
2839            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2840        ) -> Self {
2841            Self(RequestBuilder::new(stub))
2842        }
2843
2844        /// Sets the full request, replacing any prior values.
2845        pub fn with_request<V: Into<crate::model::instance_group_managers::InsertRequest>>(
2846            mut self,
2847            v: V,
2848        ) -> Self {
2849            self.0.request = v.into();
2850            self
2851        }
2852
2853        /// Sets all the options, replacing any prior values.
2854        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2855            self.0.options = v.into();
2856            self
2857        }
2858
2859        /// Sends the request.
2860        pub async fn send(self) -> Result<crate::model::Operation> {
2861            (*self.0.stub)
2862                .insert(self.0.request, self.0.options)
2863                .await
2864                .map(gax::response::Response::into_body)
2865        }
2866
2867        /// Sets the value of [project][crate::model::instance_group_managers::InsertRequest::project].
2868        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869            self.0.request.project = v.into();
2870            self
2871        }
2872
2873        /// Sets the value of [request_id][crate::model::instance_group_managers::InsertRequest::request_id].
2874        pub fn set_request_id<T>(mut self, v: T) -> Self
2875        where
2876            T: std::convert::Into<std::string::String>,
2877        {
2878            self.0.request.request_id = std::option::Option::Some(v.into());
2879            self
2880        }
2881
2882        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::InsertRequest::request_id].
2883        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2884        where
2885            T: std::convert::Into<std::string::String>,
2886        {
2887            self.0.request.request_id = v.map(|x| x.into());
2888            self
2889        }
2890
2891        /// Sets the value of [zone][crate::model::instance_group_managers::InsertRequest::zone].
2892        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893            self.0.request.zone = v.into();
2894            self
2895        }
2896
2897        /// Sets the value of [body][crate::model::instance_group_managers::InsertRequest::body].
2898        pub fn set_body<T>(mut self, v: T) -> Self
2899        where
2900            T: std::convert::Into<crate::model::InstanceGroupManager>,
2901        {
2902            self.0.request.body = std::option::Option::Some(v.into());
2903            self
2904        }
2905
2906        /// Sets or clears the value of [body][crate::model::instance_group_managers::InsertRequest::body].
2907        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2908        where
2909            T: std::convert::Into<crate::model::InstanceGroupManager>,
2910        {
2911            self.0.request.body = v.map(|x| x.into());
2912            self
2913        }
2914    }
2915
2916    #[doc(hidden)]
2917    impl gax::options::internal::RequestBuilder for Insert {
2918        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2919            &mut self.0.options
2920        }
2921    }
2922
2923    /// The request builder for [InstanceGroupManagers::list][crate::client::InstanceGroupManagers::list] calls.
2924    ///
2925    /// # Example
2926    /// ```no_run
2927    /// # use google_cloud_compute_v1::builder;
2928    /// use builder::instance_group_managers::List;
2929    /// # tokio_test::block_on(async {
2930    /// use gax::paginator::ItemPaginator;
2931    ///
2932    /// let builder = prepare_request_builder();
2933    /// let mut items = builder.by_item();
2934    /// while let Some(result) = items.next().await {
2935    ///   let item = result?;
2936    /// }
2937    /// # gax::Result::<()>::Ok(()) });
2938    ///
2939    /// fn prepare_request_builder() -> List {
2940    ///   # panic!();
2941    ///   // ... details omitted ...
2942    /// }
2943    /// ```
2944    #[derive(Clone, Debug)]
2945    pub struct List(RequestBuilder<crate::model::instance_group_managers::ListRequest>);
2946
2947    impl List {
2948        pub(crate) fn new(
2949            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2950        ) -> Self {
2951            Self(RequestBuilder::new(stub))
2952        }
2953
2954        /// Sets the full request, replacing any prior values.
2955        pub fn with_request<V: Into<crate::model::instance_group_managers::ListRequest>>(
2956            mut self,
2957            v: V,
2958        ) -> Self {
2959            self.0.request = v.into();
2960            self
2961        }
2962
2963        /// Sets all the options, replacing any prior values.
2964        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2965            self.0.options = v.into();
2966            self
2967        }
2968
2969        /// Sends the request.
2970        pub async fn send(self) -> Result<crate::model::InstanceGroupManagerList> {
2971            (*self.0.stub)
2972                .list(self.0.request, self.0.options)
2973                .await
2974                .map(gax::response::Response::into_body)
2975        }
2976
2977        /// Streams each page in the collection.
2978        pub fn by_page(
2979            self,
2980        ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupManagerList, gax::error::Error>
2981        {
2982            use std::clone::Clone;
2983            let token = self.0.request.page_token.clone().unwrap_or_default();
2984            let execute = move |token: String| {
2985                let mut builder = self.clone();
2986                builder.0.request = builder.0.request.set_page_token(token);
2987                builder.send()
2988            };
2989            gax::paginator::internal::new_paginator(token, execute)
2990        }
2991
2992        /// Streams each item in the collection.
2993        pub fn by_item(
2994            self,
2995        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceGroupManagerList, gax::error::Error>
2996        {
2997            use gax::paginator::Paginator;
2998            self.by_page().items()
2999        }
3000
3001        /// Sets the value of [filter][crate::model::instance_group_managers::ListRequest::filter].
3002        pub fn set_filter<T>(mut self, v: T) -> Self
3003        where
3004            T: std::convert::Into<std::string::String>,
3005        {
3006            self.0.request.filter = std::option::Option::Some(v.into());
3007            self
3008        }
3009
3010        /// Sets or clears the value of [filter][crate::model::instance_group_managers::ListRequest::filter].
3011        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3012        where
3013            T: std::convert::Into<std::string::String>,
3014        {
3015            self.0.request.filter = v.map(|x| x.into());
3016            self
3017        }
3018
3019        /// Sets the value of [max_results][crate::model::instance_group_managers::ListRequest::max_results].
3020        pub fn set_max_results<T>(mut self, v: T) -> Self
3021        where
3022            T: std::convert::Into<u32>,
3023        {
3024            self.0.request.max_results = std::option::Option::Some(v.into());
3025            self
3026        }
3027
3028        /// Sets or clears the value of [max_results][crate::model::instance_group_managers::ListRequest::max_results].
3029        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3030        where
3031            T: std::convert::Into<u32>,
3032        {
3033            self.0.request.max_results = v.map(|x| x.into());
3034            self
3035        }
3036
3037        /// Sets the value of [order_by][crate::model::instance_group_managers::ListRequest::order_by].
3038        pub fn set_order_by<T>(mut self, v: T) -> Self
3039        where
3040            T: std::convert::Into<std::string::String>,
3041        {
3042            self.0.request.order_by = std::option::Option::Some(v.into());
3043            self
3044        }
3045
3046        /// Sets or clears the value of [order_by][crate::model::instance_group_managers::ListRequest::order_by].
3047        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3048        where
3049            T: std::convert::Into<std::string::String>,
3050        {
3051            self.0.request.order_by = v.map(|x| x.into());
3052            self
3053        }
3054
3055        /// Sets the value of [page_token][crate::model::instance_group_managers::ListRequest::page_token].
3056        pub fn set_page_token<T>(mut self, v: T) -> Self
3057        where
3058            T: std::convert::Into<std::string::String>,
3059        {
3060            self.0.request.page_token = std::option::Option::Some(v.into());
3061            self
3062        }
3063
3064        /// Sets or clears the value of [page_token][crate::model::instance_group_managers::ListRequest::page_token].
3065        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3066        where
3067            T: std::convert::Into<std::string::String>,
3068        {
3069            self.0.request.page_token = v.map(|x| x.into());
3070            self
3071        }
3072
3073        /// Sets the value of [project][crate::model::instance_group_managers::ListRequest::project].
3074        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3075            self.0.request.project = v.into();
3076            self
3077        }
3078
3079        /// Sets the value of [return_partial_success][crate::model::instance_group_managers::ListRequest::return_partial_success].
3080        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3081        where
3082            T: std::convert::Into<bool>,
3083        {
3084            self.0.request.return_partial_success = std::option::Option::Some(v.into());
3085            self
3086        }
3087
3088        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_managers::ListRequest::return_partial_success].
3089        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3090        where
3091            T: std::convert::Into<bool>,
3092        {
3093            self.0.request.return_partial_success = v.map(|x| x.into());
3094            self
3095        }
3096
3097        /// Sets the value of [zone][crate::model::instance_group_managers::ListRequest::zone].
3098        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3099            self.0.request.zone = v.into();
3100            self
3101        }
3102    }
3103
3104    #[doc(hidden)]
3105    impl gax::options::internal::RequestBuilder for List {
3106        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3107            &mut self.0.options
3108        }
3109    }
3110
3111    /// The request builder for [InstanceGroupManagers::list_errors][crate::client::InstanceGroupManagers::list_errors] calls.
3112    ///
3113    /// # Example
3114    /// ```no_run
3115    /// # use google_cloud_compute_v1::builder;
3116    /// use builder::instance_group_managers::ListErrors;
3117    /// # tokio_test::block_on(async {
3118    /// use gax::paginator::ItemPaginator;
3119    ///
3120    /// let builder = prepare_request_builder();
3121    /// let mut items = builder.by_item();
3122    /// while let Some(result) = items.next().await {
3123    ///   let item = result?;
3124    /// }
3125    /// # gax::Result::<()>::Ok(()) });
3126    ///
3127    /// fn prepare_request_builder() -> ListErrors {
3128    ///   # panic!();
3129    ///   // ... details omitted ...
3130    /// }
3131    /// ```
3132    #[derive(Clone, Debug)]
3133    pub struct ListErrors(RequestBuilder<crate::model::instance_group_managers::ListErrorsRequest>);
3134
3135    impl ListErrors {
3136        pub(crate) fn new(
3137            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3138        ) -> Self {
3139            Self(RequestBuilder::new(stub))
3140        }
3141
3142        /// Sets the full request, replacing any prior values.
3143        pub fn with_request<V: Into<crate::model::instance_group_managers::ListErrorsRequest>>(
3144            mut self,
3145            v: V,
3146        ) -> Self {
3147            self.0.request = v.into();
3148            self
3149        }
3150
3151        /// Sets all the options, replacing any prior values.
3152        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3153            self.0.options = v.into();
3154            self
3155        }
3156
3157        /// Sends the request.
3158        pub async fn send(self) -> Result<crate::model::InstanceGroupManagersListErrorsResponse> {
3159            (*self.0.stub)
3160                .list_errors(self.0.request, self.0.options)
3161                .await
3162                .map(gax::response::Response::into_body)
3163        }
3164
3165        /// Streams each page in the collection.
3166        pub fn by_page(
3167            self,
3168        ) -> impl gax::paginator::Paginator<
3169            crate::model::InstanceGroupManagersListErrorsResponse,
3170            gax::error::Error,
3171        > {
3172            use std::clone::Clone;
3173            let token = self.0.request.page_token.clone().unwrap_or_default();
3174            let execute = move |token: String| {
3175                let mut builder = self.clone();
3176                builder.0.request = builder.0.request.set_page_token(token);
3177                builder.send()
3178            };
3179            gax::paginator::internal::new_paginator(token, execute)
3180        }
3181
3182        /// Streams each item in the collection.
3183        pub fn by_item(
3184            self,
3185        ) -> impl gax::paginator::ItemPaginator<
3186            crate::model::InstanceGroupManagersListErrorsResponse,
3187            gax::error::Error,
3188        > {
3189            use gax::paginator::Paginator;
3190            self.by_page().items()
3191        }
3192
3193        /// Sets the value of [filter][crate::model::instance_group_managers::ListErrorsRequest::filter].
3194        pub fn set_filter<T>(mut self, v: T) -> Self
3195        where
3196            T: std::convert::Into<std::string::String>,
3197        {
3198            self.0.request.filter = std::option::Option::Some(v.into());
3199            self
3200        }
3201
3202        /// Sets or clears the value of [filter][crate::model::instance_group_managers::ListErrorsRequest::filter].
3203        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3204        where
3205            T: std::convert::Into<std::string::String>,
3206        {
3207            self.0.request.filter = v.map(|x| x.into());
3208            self
3209        }
3210
3211        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ListErrorsRequest::instance_group_manager].
3212        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3213            self.0.request.instance_group_manager = v.into();
3214            self
3215        }
3216
3217        /// Sets the value of [max_results][crate::model::instance_group_managers::ListErrorsRequest::max_results].
3218        pub fn set_max_results<T>(mut self, v: T) -> Self
3219        where
3220            T: std::convert::Into<u32>,
3221        {
3222            self.0.request.max_results = std::option::Option::Some(v.into());
3223            self
3224        }
3225
3226        /// Sets or clears the value of [max_results][crate::model::instance_group_managers::ListErrorsRequest::max_results].
3227        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3228        where
3229            T: std::convert::Into<u32>,
3230        {
3231            self.0.request.max_results = v.map(|x| x.into());
3232            self
3233        }
3234
3235        /// Sets the value of [order_by][crate::model::instance_group_managers::ListErrorsRequest::order_by].
3236        pub fn set_order_by<T>(mut self, v: T) -> Self
3237        where
3238            T: std::convert::Into<std::string::String>,
3239        {
3240            self.0.request.order_by = std::option::Option::Some(v.into());
3241            self
3242        }
3243
3244        /// Sets or clears the value of [order_by][crate::model::instance_group_managers::ListErrorsRequest::order_by].
3245        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3246        where
3247            T: std::convert::Into<std::string::String>,
3248        {
3249            self.0.request.order_by = v.map(|x| x.into());
3250            self
3251        }
3252
3253        /// Sets the value of [page_token][crate::model::instance_group_managers::ListErrorsRequest::page_token].
3254        pub fn set_page_token<T>(mut self, v: T) -> Self
3255        where
3256            T: std::convert::Into<std::string::String>,
3257        {
3258            self.0.request.page_token = std::option::Option::Some(v.into());
3259            self
3260        }
3261
3262        /// Sets or clears the value of [page_token][crate::model::instance_group_managers::ListErrorsRequest::page_token].
3263        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3264        where
3265            T: std::convert::Into<std::string::String>,
3266        {
3267            self.0.request.page_token = v.map(|x| x.into());
3268            self
3269        }
3270
3271        /// Sets the value of [project][crate::model::instance_group_managers::ListErrorsRequest::project].
3272        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3273            self.0.request.project = v.into();
3274            self
3275        }
3276
3277        /// Sets the value of [return_partial_success][crate::model::instance_group_managers::ListErrorsRequest::return_partial_success].
3278        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3279        where
3280            T: std::convert::Into<bool>,
3281        {
3282            self.0.request.return_partial_success = std::option::Option::Some(v.into());
3283            self
3284        }
3285
3286        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_managers::ListErrorsRequest::return_partial_success].
3287        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3288        where
3289            T: std::convert::Into<bool>,
3290        {
3291            self.0.request.return_partial_success = v.map(|x| x.into());
3292            self
3293        }
3294
3295        /// Sets the value of [zone][crate::model::instance_group_managers::ListErrorsRequest::zone].
3296        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297            self.0.request.zone = v.into();
3298            self
3299        }
3300    }
3301
3302    #[doc(hidden)]
3303    impl gax::options::internal::RequestBuilder for ListErrors {
3304        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3305            &mut self.0.options
3306        }
3307    }
3308
3309    /// The request builder for [InstanceGroupManagers::list_managed_instances][crate::client::InstanceGroupManagers::list_managed_instances] calls.
3310    ///
3311    /// # Example
3312    /// ```no_run
3313    /// # use google_cloud_compute_v1::builder;
3314    /// use builder::instance_group_managers::ListManagedInstances;
3315    /// # tokio_test::block_on(async {
3316    /// use gax::paginator::ItemPaginator;
3317    ///
3318    /// let builder = prepare_request_builder();
3319    /// let mut items = builder.by_item();
3320    /// while let Some(result) = items.next().await {
3321    ///   let item = result?;
3322    /// }
3323    /// # gax::Result::<()>::Ok(()) });
3324    ///
3325    /// fn prepare_request_builder() -> ListManagedInstances {
3326    ///   # panic!();
3327    ///   // ... details omitted ...
3328    /// }
3329    /// ```
3330    #[derive(Clone, Debug)]
3331    pub struct ListManagedInstances(
3332        RequestBuilder<crate::model::instance_group_managers::ListManagedInstancesRequest>,
3333    );
3334
3335    impl ListManagedInstances {
3336        pub(crate) fn new(
3337            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3338        ) -> Self {
3339            Self(RequestBuilder::new(stub))
3340        }
3341
3342        /// Sets the full request, replacing any prior values.
3343        pub fn with_request<
3344            V: Into<crate::model::instance_group_managers::ListManagedInstancesRequest>,
3345        >(
3346            mut self,
3347            v: V,
3348        ) -> Self {
3349            self.0.request = v.into();
3350            self
3351        }
3352
3353        /// Sets all the options, replacing any prior values.
3354        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3355            self.0.options = v.into();
3356            self
3357        }
3358
3359        /// Sends the request.
3360        pub async fn send(
3361            self,
3362        ) -> Result<crate::model::InstanceGroupManagersListManagedInstancesResponse> {
3363            (*self.0.stub)
3364                .list_managed_instances(self.0.request, self.0.options)
3365                .await
3366                .map(gax::response::Response::into_body)
3367        }
3368
3369        /// Streams each page in the collection.
3370        pub fn by_page(
3371            self,
3372        ) -> impl gax::paginator::Paginator<
3373            crate::model::InstanceGroupManagersListManagedInstancesResponse,
3374            gax::error::Error,
3375        > {
3376            use std::clone::Clone;
3377            let token = self.0.request.page_token.clone().unwrap_or_default();
3378            let execute = move |token: String| {
3379                let mut builder = self.clone();
3380                builder.0.request = builder.0.request.set_page_token(token);
3381                builder.send()
3382            };
3383            gax::paginator::internal::new_paginator(token, execute)
3384        }
3385
3386        /// Streams each item in the collection.
3387        pub fn by_item(
3388            self,
3389        ) -> impl gax::paginator::ItemPaginator<
3390            crate::model::InstanceGroupManagersListManagedInstancesResponse,
3391            gax::error::Error,
3392        > {
3393            use gax::paginator::Paginator;
3394            self.by_page().items()
3395        }
3396
3397        /// Sets the value of [filter][crate::model::instance_group_managers::ListManagedInstancesRequest::filter].
3398        pub fn set_filter<T>(mut self, v: T) -> Self
3399        where
3400            T: std::convert::Into<std::string::String>,
3401        {
3402            self.0.request.filter = std::option::Option::Some(v.into());
3403            self
3404        }
3405
3406        /// Sets or clears the value of [filter][crate::model::instance_group_managers::ListManagedInstancesRequest::filter].
3407        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3408        where
3409            T: std::convert::Into<std::string::String>,
3410        {
3411            self.0.request.filter = v.map(|x| x.into());
3412            self
3413        }
3414
3415        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ListManagedInstancesRequest::instance_group_manager].
3416        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3417            self.0.request.instance_group_manager = v.into();
3418            self
3419        }
3420
3421        /// Sets the value of [max_results][crate::model::instance_group_managers::ListManagedInstancesRequest::max_results].
3422        pub fn set_max_results<T>(mut self, v: T) -> Self
3423        where
3424            T: std::convert::Into<u32>,
3425        {
3426            self.0.request.max_results = std::option::Option::Some(v.into());
3427            self
3428        }
3429
3430        /// Sets or clears the value of [max_results][crate::model::instance_group_managers::ListManagedInstancesRequest::max_results].
3431        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3432        where
3433            T: std::convert::Into<u32>,
3434        {
3435            self.0.request.max_results = v.map(|x| x.into());
3436            self
3437        }
3438
3439        /// Sets the value of [order_by][crate::model::instance_group_managers::ListManagedInstancesRequest::order_by].
3440        pub fn set_order_by<T>(mut self, v: T) -> Self
3441        where
3442            T: std::convert::Into<std::string::String>,
3443        {
3444            self.0.request.order_by = std::option::Option::Some(v.into());
3445            self
3446        }
3447
3448        /// Sets or clears the value of [order_by][crate::model::instance_group_managers::ListManagedInstancesRequest::order_by].
3449        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3450        where
3451            T: std::convert::Into<std::string::String>,
3452        {
3453            self.0.request.order_by = v.map(|x| x.into());
3454            self
3455        }
3456
3457        /// Sets the value of [page_token][crate::model::instance_group_managers::ListManagedInstancesRequest::page_token].
3458        pub fn set_page_token<T>(mut self, v: T) -> Self
3459        where
3460            T: std::convert::Into<std::string::String>,
3461        {
3462            self.0.request.page_token = std::option::Option::Some(v.into());
3463            self
3464        }
3465
3466        /// Sets or clears the value of [page_token][crate::model::instance_group_managers::ListManagedInstancesRequest::page_token].
3467        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3468        where
3469            T: std::convert::Into<std::string::String>,
3470        {
3471            self.0.request.page_token = v.map(|x| x.into());
3472            self
3473        }
3474
3475        /// Sets the value of [project][crate::model::instance_group_managers::ListManagedInstancesRequest::project].
3476        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3477            self.0.request.project = v.into();
3478            self
3479        }
3480
3481        /// Sets the value of [return_partial_success][crate::model::instance_group_managers::ListManagedInstancesRequest::return_partial_success].
3482        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3483        where
3484            T: std::convert::Into<bool>,
3485        {
3486            self.0.request.return_partial_success = std::option::Option::Some(v.into());
3487            self
3488        }
3489
3490        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_managers::ListManagedInstancesRequest::return_partial_success].
3491        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3492        where
3493            T: std::convert::Into<bool>,
3494        {
3495            self.0.request.return_partial_success = v.map(|x| x.into());
3496            self
3497        }
3498
3499        /// Sets the value of [zone][crate::model::instance_group_managers::ListManagedInstancesRequest::zone].
3500        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3501            self.0.request.zone = v.into();
3502            self
3503        }
3504    }
3505
3506    #[doc(hidden)]
3507    impl gax::options::internal::RequestBuilder for ListManagedInstances {
3508        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3509            &mut self.0.options
3510        }
3511    }
3512
3513    /// The request builder for [InstanceGroupManagers::list_per_instance_configs][crate::client::InstanceGroupManagers::list_per_instance_configs] calls.
3514    ///
3515    /// # Example
3516    /// ```no_run
3517    /// # use google_cloud_compute_v1::builder;
3518    /// use builder::instance_group_managers::ListPerInstanceConfigs;
3519    /// # tokio_test::block_on(async {
3520    /// use gax::paginator::ItemPaginator;
3521    ///
3522    /// let builder = prepare_request_builder();
3523    /// let mut items = builder.by_item();
3524    /// while let Some(result) = items.next().await {
3525    ///   let item = result?;
3526    /// }
3527    /// # gax::Result::<()>::Ok(()) });
3528    ///
3529    /// fn prepare_request_builder() -> ListPerInstanceConfigs {
3530    ///   # panic!();
3531    ///   // ... details omitted ...
3532    /// }
3533    /// ```
3534    #[derive(Clone, Debug)]
3535    pub struct ListPerInstanceConfigs(
3536        RequestBuilder<crate::model::instance_group_managers::ListPerInstanceConfigsRequest>,
3537    );
3538
3539    impl ListPerInstanceConfigs {
3540        pub(crate) fn new(
3541            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3542        ) -> Self {
3543            Self(RequestBuilder::new(stub))
3544        }
3545
3546        /// Sets the full request, replacing any prior values.
3547        pub fn with_request<
3548            V: Into<crate::model::instance_group_managers::ListPerInstanceConfigsRequest>,
3549        >(
3550            mut self,
3551            v: V,
3552        ) -> Self {
3553            self.0.request = v.into();
3554            self
3555        }
3556
3557        /// Sets all the options, replacing any prior values.
3558        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3559            self.0.options = v.into();
3560            self
3561        }
3562
3563        /// Sends the request.
3564        pub async fn send(
3565            self,
3566        ) -> Result<crate::model::InstanceGroupManagersListPerInstanceConfigsResp> {
3567            (*self.0.stub)
3568                .list_per_instance_configs(self.0.request, self.0.options)
3569                .await
3570                .map(gax::response::Response::into_body)
3571        }
3572
3573        /// Streams each page in the collection.
3574        pub fn by_page(
3575            self,
3576        ) -> impl gax::paginator::Paginator<
3577            crate::model::InstanceGroupManagersListPerInstanceConfigsResp,
3578            gax::error::Error,
3579        > {
3580            use std::clone::Clone;
3581            let token = self.0.request.page_token.clone().unwrap_or_default();
3582            let execute = move |token: String| {
3583                let mut builder = self.clone();
3584                builder.0.request = builder.0.request.set_page_token(token);
3585                builder.send()
3586            };
3587            gax::paginator::internal::new_paginator(token, execute)
3588        }
3589
3590        /// Streams each item in the collection.
3591        pub fn by_item(
3592            self,
3593        ) -> impl gax::paginator::ItemPaginator<
3594            crate::model::InstanceGroupManagersListPerInstanceConfigsResp,
3595            gax::error::Error,
3596        > {
3597            use gax::paginator::Paginator;
3598            self.by_page().items()
3599        }
3600
3601        /// Sets the value of [filter][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::filter].
3602        pub fn set_filter<T>(mut self, v: T) -> Self
3603        where
3604            T: std::convert::Into<std::string::String>,
3605        {
3606            self.0.request.filter = std::option::Option::Some(v.into());
3607            self
3608        }
3609
3610        /// Sets or clears the value of [filter][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::filter].
3611        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3612        where
3613            T: std::convert::Into<std::string::String>,
3614        {
3615            self.0.request.filter = v.map(|x| x.into());
3616            self
3617        }
3618
3619        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::instance_group_manager].
3620        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3621            self.0.request.instance_group_manager = v.into();
3622            self
3623        }
3624
3625        /// Sets the value of [max_results][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::max_results].
3626        pub fn set_max_results<T>(mut self, v: T) -> Self
3627        where
3628            T: std::convert::Into<u32>,
3629        {
3630            self.0.request.max_results = std::option::Option::Some(v.into());
3631            self
3632        }
3633
3634        /// Sets or clears the value of [max_results][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::max_results].
3635        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3636        where
3637            T: std::convert::Into<u32>,
3638        {
3639            self.0.request.max_results = v.map(|x| x.into());
3640            self
3641        }
3642
3643        /// Sets the value of [order_by][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::order_by].
3644        pub fn set_order_by<T>(mut self, v: T) -> Self
3645        where
3646            T: std::convert::Into<std::string::String>,
3647        {
3648            self.0.request.order_by = std::option::Option::Some(v.into());
3649            self
3650        }
3651
3652        /// Sets or clears the value of [order_by][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::order_by].
3653        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3654        where
3655            T: std::convert::Into<std::string::String>,
3656        {
3657            self.0.request.order_by = v.map(|x| x.into());
3658            self
3659        }
3660
3661        /// Sets the value of [page_token][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::page_token].
3662        pub fn set_page_token<T>(mut self, v: T) -> Self
3663        where
3664            T: std::convert::Into<std::string::String>,
3665        {
3666            self.0.request.page_token = std::option::Option::Some(v.into());
3667            self
3668        }
3669
3670        /// Sets or clears the value of [page_token][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::page_token].
3671        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3672        where
3673            T: std::convert::Into<std::string::String>,
3674        {
3675            self.0.request.page_token = v.map(|x| x.into());
3676            self
3677        }
3678
3679        /// Sets the value of [project][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::project].
3680        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681            self.0.request.project = v.into();
3682            self
3683        }
3684
3685        /// Sets the value of [return_partial_success][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::return_partial_success].
3686        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3687        where
3688            T: std::convert::Into<bool>,
3689        {
3690            self.0.request.return_partial_success = std::option::Option::Some(v.into());
3691            self
3692        }
3693
3694        /// Sets or clears the value of [return_partial_success][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::return_partial_success].
3695        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3696        where
3697            T: std::convert::Into<bool>,
3698        {
3699            self.0.request.return_partial_success = v.map(|x| x.into());
3700            self
3701        }
3702
3703        /// Sets the value of [zone][crate::model::instance_group_managers::ListPerInstanceConfigsRequest::zone].
3704        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705            self.0.request.zone = v.into();
3706            self
3707        }
3708    }
3709
3710    #[doc(hidden)]
3711    impl gax::options::internal::RequestBuilder for ListPerInstanceConfigs {
3712        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3713            &mut self.0.options
3714        }
3715    }
3716
3717    /// The request builder for [InstanceGroupManagers::patch][crate::client::InstanceGroupManagers::patch] calls.
3718    ///
3719    /// # Example
3720    /// ```no_run
3721    /// # use google_cloud_compute_v1::builder;
3722    /// use builder::instance_group_managers::Patch;
3723    /// # tokio_test::block_on(async {
3724    ///
3725    /// let builder = prepare_request_builder();
3726    /// let response = builder.send().await?;
3727    /// # gax::Result::<()>::Ok(()) });
3728    ///
3729    /// fn prepare_request_builder() -> Patch {
3730    ///   # panic!();
3731    ///   // ... details omitted ...
3732    /// }
3733    /// ```
3734    #[derive(Clone, Debug)]
3735    pub struct Patch(RequestBuilder<crate::model::instance_group_managers::PatchRequest>);
3736
3737    impl Patch {
3738        pub(crate) fn new(
3739            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3740        ) -> Self {
3741            Self(RequestBuilder::new(stub))
3742        }
3743
3744        /// Sets the full request, replacing any prior values.
3745        pub fn with_request<V: Into<crate::model::instance_group_managers::PatchRequest>>(
3746            mut self,
3747            v: V,
3748        ) -> Self {
3749            self.0.request = v.into();
3750            self
3751        }
3752
3753        /// Sets all the options, replacing any prior values.
3754        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3755            self.0.options = v.into();
3756            self
3757        }
3758
3759        /// Sends the request.
3760        pub async fn send(self) -> Result<crate::model::Operation> {
3761            (*self.0.stub)
3762                .patch(self.0.request, self.0.options)
3763                .await
3764                .map(gax::response::Response::into_body)
3765        }
3766
3767        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::PatchRequest::instance_group_manager].
3768        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3769            self.0.request.instance_group_manager = v.into();
3770            self
3771        }
3772
3773        /// Sets the value of [project][crate::model::instance_group_managers::PatchRequest::project].
3774        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3775            self.0.request.project = v.into();
3776            self
3777        }
3778
3779        /// Sets the value of [request_id][crate::model::instance_group_managers::PatchRequest::request_id].
3780        pub fn set_request_id<T>(mut self, v: T) -> Self
3781        where
3782            T: std::convert::Into<std::string::String>,
3783        {
3784            self.0.request.request_id = std::option::Option::Some(v.into());
3785            self
3786        }
3787
3788        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::PatchRequest::request_id].
3789        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
3790        where
3791            T: std::convert::Into<std::string::String>,
3792        {
3793            self.0.request.request_id = v.map(|x| x.into());
3794            self
3795        }
3796
3797        /// Sets the value of [zone][crate::model::instance_group_managers::PatchRequest::zone].
3798        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799            self.0.request.zone = v.into();
3800            self
3801        }
3802
3803        /// Sets the value of [body][crate::model::instance_group_managers::PatchRequest::body].
3804        pub fn set_body<T>(mut self, v: T) -> Self
3805        where
3806            T: std::convert::Into<crate::model::InstanceGroupManager>,
3807        {
3808            self.0.request.body = std::option::Option::Some(v.into());
3809            self
3810        }
3811
3812        /// Sets or clears the value of [body][crate::model::instance_group_managers::PatchRequest::body].
3813        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3814        where
3815            T: std::convert::Into<crate::model::InstanceGroupManager>,
3816        {
3817            self.0.request.body = v.map(|x| x.into());
3818            self
3819        }
3820    }
3821
3822    #[doc(hidden)]
3823    impl gax::options::internal::RequestBuilder for Patch {
3824        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3825            &mut self.0.options
3826        }
3827    }
3828
3829    /// The request builder for [InstanceGroupManagers::patch_per_instance_configs][crate::client::InstanceGroupManagers::patch_per_instance_configs] calls.
3830    ///
3831    /// # Example
3832    /// ```no_run
3833    /// # use google_cloud_compute_v1::builder;
3834    /// use builder::instance_group_managers::PatchPerInstanceConfigs;
3835    /// # tokio_test::block_on(async {
3836    ///
3837    /// let builder = prepare_request_builder();
3838    /// let response = builder.send().await?;
3839    /// # gax::Result::<()>::Ok(()) });
3840    ///
3841    /// fn prepare_request_builder() -> PatchPerInstanceConfigs {
3842    ///   # panic!();
3843    ///   // ... details omitted ...
3844    /// }
3845    /// ```
3846    #[derive(Clone, Debug)]
3847    pub struct PatchPerInstanceConfigs(
3848        RequestBuilder<crate::model::instance_group_managers::PatchPerInstanceConfigsRequest>,
3849    );
3850
3851    impl PatchPerInstanceConfigs {
3852        pub(crate) fn new(
3853            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3854        ) -> Self {
3855            Self(RequestBuilder::new(stub))
3856        }
3857
3858        /// Sets the full request, replacing any prior values.
3859        pub fn with_request<
3860            V: Into<crate::model::instance_group_managers::PatchPerInstanceConfigsRequest>,
3861        >(
3862            mut self,
3863            v: V,
3864        ) -> Self {
3865            self.0.request = v.into();
3866            self
3867        }
3868
3869        /// Sets all the options, replacing any prior values.
3870        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3871            self.0.options = v.into();
3872            self
3873        }
3874
3875        /// Sends the request.
3876        pub async fn send(self) -> Result<crate::model::Operation> {
3877            (*self.0.stub)
3878                .patch_per_instance_configs(self.0.request, self.0.options)
3879                .await
3880                .map(gax::response::Response::into_body)
3881        }
3882
3883        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::instance_group_manager].
3884        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3885            self.0.request.instance_group_manager = v.into();
3886            self
3887        }
3888
3889        /// Sets the value of [project][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::project].
3890        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3891            self.0.request.project = v.into();
3892            self
3893        }
3894
3895        /// Sets the value of [request_id][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::request_id].
3896        pub fn set_request_id<T>(mut self, v: T) -> Self
3897        where
3898            T: std::convert::Into<std::string::String>,
3899        {
3900            self.0.request.request_id = std::option::Option::Some(v.into());
3901            self
3902        }
3903
3904        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::request_id].
3905        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
3906        where
3907            T: std::convert::Into<std::string::String>,
3908        {
3909            self.0.request.request_id = v.map(|x| x.into());
3910            self
3911        }
3912
3913        /// Sets the value of [zone][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::zone].
3914        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3915            self.0.request.zone = v.into();
3916            self
3917        }
3918
3919        /// Sets the value of [body][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::body].
3920        pub fn set_body<T>(mut self, v: T) -> Self
3921        where
3922            T: std::convert::Into<crate::model::InstanceGroupManagersPatchPerInstanceConfigsReq>,
3923        {
3924            self.0.request.body = std::option::Option::Some(v.into());
3925            self
3926        }
3927
3928        /// Sets or clears the value of [body][crate::model::instance_group_managers::PatchPerInstanceConfigsRequest::body].
3929        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3930        where
3931            T: std::convert::Into<crate::model::InstanceGroupManagersPatchPerInstanceConfigsReq>,
3932        {
3933            self.0.request.body = v.map(|x| x.into());
3934            self
3935        }
3936    }
3937
3938    #[doc(hidden)]
3939    impl gax::options::internal::RequestBuilder for PatchPerInstanceConfigs {
3940        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3941            &mut self.0.options
3942        }
3943    }
3944
3945    /// The request builder for [InstanceGroupManagers::recreate_instances][crate::client::InstanceGroupManagers::recreate_instances] calls.
3946    ///
3947    /// # Example
3948    /// ```no_run
3949    /// # use google_cloud_compute_v1::builder;
3950    /// use builder::instance_group_managers::RecreateInstances;
3951    /// # tokio_test::block_on(async {
3952    ///
3953    /// let builder = prepare_request_builder();
3954    /// let response = builder.send().await?;
3955    /// # gax::Result::<()>::Ok(()) });
3956    ///
3957    /// fn prepare_request_builder() -> RecreateInstances {
3958    ///   # panic!();
3959    ///   // ... details omitted ...
3960    /// }
3961    /// ```
3962    #[derive(Clone, Debug)]
3963    pub struct RecreateInstances(
3964        RequestBuilder<crate::model::instance_group_managers::RecreateInstancesRequest>,
3965    );
3966
3967    impl RecreateInstances {
3968        pub(crate) fn new(
3969            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3970        ) -> Self {
3971            Self(RequestBuilder::new(stub))
3972        }
3973
3974        /// Sets the full request, replacing any prior values.
3975        pub fn with_request<
3976            V: Into<crate::model::instance_group_managers::RecreateInstancesRequest>,
3977        >(
3978            mut self,
3979            v: V,
3980        ) -> Self {
3981            self.0.request = v.into();
3982            self
3983        }
3984
3985        /// Sets all the options, replacing any prior values.
3986        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3987            self.0.options = v.into();
3988            self
3989        }
3990
3991        /// Sends the request.
3992        pub async fn send(self) -> Result<crate::model::Operation> {
3993            (*self.0.stub)
3994                .recreate_instances(self.0.request, self.0.options)
3995                .await
3996                .map(gax::response::Response::into_body)
3997        }
3998
3999        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::RecreateInstancesRequest::instance_group_manager].
4000        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4001            self.0.request.instance_group_manager = v.into();
4002            self
4003        }
4004
4005        /// Sets the value of [project][crate::model::instance_group_managers::RecreateInstancesRequest::project].
4006        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4007            self.0.request.project = v.into();
4008            self
4009        }
4010
4011        /// Sets the value of [request_id][crate::model::instance_group_managers::RecreateInstancesRequest::request_id].
4012        pub fn set_request_id<T>(mut self, v: T) -> Self
4013        where
4014            T: std::convert::Into<std::string::String>,
4015        {
4016            self.0.request.request_id = std::option::Option::Some(v.into());
4017            self
4018        }
4019
4020        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::RecreateInstancesRequest::request_id].
4021        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4022        where
4023            T: std::convert::Into<std::string::String>,
4024        {
4025            self.0.request.request_id = v.map(|x| x.into());
4026            self
4027        }
4028
4029        /// Sets the value of [zone][crate::model::instance_group_managers::RecreateInstancesRequest::zone].
4030        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4031            self.0.request.zone = v.into();
4032            self
4033        }
4034
4035        /// Sets the value of [body][crate::model::instance_group_managers::RecreateInstancesRequest::body].
4036        pub fn set_body<T>(mut self, v: T) -> Self
4037        where
4038            T: std::convert::Into<crate::model::InstanceGroupManagersRecreateInstancesRequest>,
4039        {
4040            self.0.request.body = std::option::Option::Some(v.into());
4041            self
4042        }
4043
4044        /// Sets or clears the value of [body][crate::model::instance_group_managers::RecreateInstancesRequest::body].
4045        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4046        where
4047            T: std::convert::Into<crate::model::InstanceGroupManagersRecreateInstancesRequest>,
4048        {
4049            self.0.request.body = v.map(|x| x.into());
4050            self
4051        }
4052    }
4053
4054    #[doc(hidden)]
4055    impl gax::options::internal::RequestBuilder for RecreateInstances {
4056        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4057            &mut self.0.options
4058        }
4059    }
4060
4061    /// The request builder for [InstanceGroupManagers::resize][crate::client::InstanceGroupManagers::resize] calls.
4062    ///
4063    /// # Example
4064    /// ```no_run
4065    /// # use google_cloud_compute_v1::builder;
4066    /// use builder::instance_group_managers::Resize;
4067    /// # tokio_test::block_on(async {
4068    ///
4069    /// let builder = prepare_request_builder();
4070    /// let response = builder.send().await?;
4071    /// # gax::Result::<()>::Ok(()) });
4072    ///
4073    /// fn prepare_request_builder() -> Resize {
4074    ///   # panic!();
4075    ///   // ... details omitted ...
4076    /// }
4077    /// ```
4078    #[derive(Clone, Debug)]
4079    pub struct Resize(RequestBuilder<crate::model::instance_group_managers::ResizeRequest>);
4080
4081    impl Resize {
4082        pub(crate) fn new(
4083            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4084        ) -> Self {
4085            Self(RequestBuilder::new(stub))
4086        }
4087
4088        /// Sets the full request, replacing any prior values.
4089        pub fn with_request<V: Into<crate::model::instance_group_managers::ResizeRequest>>(
4090            mut self,
4091            v: V,
4092        ) -> Self {
4093            self.0.request = v.into();
4094            self
4095        }
4096
4097        /// Sets all the options, replacing any prior values.
4098        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4099            self.0.options = v.into();
4100            self
4101        }
4102
4103        /// Sends the request.
4104        pub async fn send(self) -> Result<crate::model::Operation> {
4105            (*self.0.stub)
4106                .resize(self.0.request, self.0.options)
4107                .await
4108                .map(gax::response::Response::into_body)
4109        }
4110
4111        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ResizeRequest::instance_group_manager].
4112        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113            self.0.request.instance_group_manager = v.into();
4114            self
4115        }
4116
4117        /// Sets the value of [project][crate::model::instance_group_managers::ResizeRequest::project].
4118        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119            self.0.request.project = v.into();
4120            self
4121        }
4122
4123        /// Sets the value of [request_id][crate::model::instance_group_managers::ResizeRequest::request_id].
4124        pub fn set_request_id<T>(mut self, v: T) -> Self
4125        where
4126            T: std::convert::Into<std::string::String>,
4127        {
4128            self.0.request.request_id = std::option::Option::Some(v.into());
4129            self
4130        }
4131
4132        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::ResizeRequest::request_id].
4133        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4134        where
4135            T: std::convert::Into<std::string::String>,
4136        {
4137            self.0.request.request_id = v.map(|x| x.into());
4138            self
4139        }
4140
4141        /// Sets the value of [size][crate::model::instance_group_managers::ResizeRequest::size].
4142        pub fn set_size<T: Into<i32>>(mut self, v: T) -> Self {
4143            self.0.request.size = v.into();
4144            self
4145        }
4146
4147        /// Sets the value of [zone][crate::model::instance_group_managers::ResizeRequest::zone].
4148        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4149            self.0.request.zone = v.into();
4150            self
4151        }
4152    }
4153
4154    #[doc(hidden)]
4155    impl gax::options::internal::RequestBuilder for Resize {
4156        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4157            &mut self.0.options
4158        }
4159    }
4160
4161    /// The request builder for [InstanceGroupManagers::resume_instances][crate::client::InstanceGroupManagers::resume_instances] calls.
4162    ///
4163    /// # Example
4164    /// ```no_run
4165    /// # use google_cloud_compute_v1::builder;
4166    /// use builder::instance_group_managers::ResumeInstances;
4167    /// # tokio_test::block_on(async {
4168    ///
4169    /// let builder = prepare_request_builder();
4170    /// let response = builder.send().await?;
4171    /// # gax::Result::<()>::Ok(()) });
4172    ///
4173    /// fn prepare_request_builder() -> ResumeInstances {
4174    ///   # panic!();
4175    ///   // ... details omitted ...
4176    /// }
4177    /// ```
4178    #[derive(Clone, Debug)]
4179    pub struct ResumeInstances(
4180        RequestBuilder<crate::model::instance_group_managers::ResumeInstancesRequest>,
4181    );
4182
4183    impl ResumeInstances {
4184        pub(crate) fn new(
4185            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4186        ) -> Self {
4187            Self(RequestBuilder::new(stub))
4188        }
4189
4190        /// Sets the full request, replacing any prior values.
4191        pub fn with_request<
4192            V: Into<crate::model::instance_group_managers::ResumeInstancesRequest>,
4193        >(
4194            mut self,
4195            v: V,
4196        ) -> Self {
4197            self.0.request = v.into();
4198            self
4199        }
4200
4201        /// Sets all the options, replacing any prior values.
4202        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4203            self.0.options = v.into();
4204            self
4205        }
4206
4207        /// Sends the request.
4208        pub async fn send(self) -> Result<crate::model::Operation> {
4209            (*self.0.stub)
4210                .resume_instances(self.0.request, self.0.options)
4211                .await
4212                .map(gax::response::Response::into_body)
4213        }
4214
4215        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::ResumeInstancesRequest::instance_group_manager].
4216        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217            self.0.request.instance_group_manager = v.into();
4218            self
4219        }
4220
4221        /// Sets the value of [project][crate::model::instance_group_managers::ResumeInstancesRequest::project].
4222        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4223            self.0.request.project = v.into();
4224            self
4225        }
4226
4227        /// Sets the value of [request_id][crate::model::instance_group_managers::ResumeInstancesRequest::request_id].
4228        pub fn set_request_id<T>(mut self, v: T) -> Self
4229        where
4230            T: std::convert::Into<std::string::String>,
4231        {
4232            self.0.request.request_id = std::option::Option::Some(v.into());
4233            self
4234        }
4235
4236        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::ResumeInstancesRequest::request_id].
4237        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4238        where
4239            T: std::convert::Into<std::string::String>,
4240        {
4241            self.0.request.request_id = v.map(|x| x.into());
4242            self
4243        }
4244
4245        /// Sets the value of [zone][crate::model::instance_group_managers::ResumeInstancesRequest::zone].
4246        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4247            self.0.request.zone = v.into();
4248            self
4249        }
4250
4251        /// Sets the value of [body][crate::model::instance_group_managers::ResumeInstancesRequest::body].
4252        pub fn set_body<T>(mut self, v: T) -> Self
4253        where
4254            T: std::convert::Into<crate::model::InstanceGroupManagersResumeInstancesRequest>,
4255        {
4256            self.0.request.body = std::option::Option::Some(v.into());
4257            self
4258        }
4259
4260        /// Sets or clears the value of [body][crate::model::instance_group_managers::ResumeInstancesRequest::body].
4261        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4262        where
4263            T: std::convert::Into<crate::model::InstanceGroupManagersResumeInstancesRequest>,
4264        {
4265            self.0.request.body = v.map(|x| x.into());
4266            self
4267        }
4268    }
4269
4270    #[doc(hidden)]
4271    impl gax::options::internal::RequestBuilder for ResumeInstances {
4272        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4273            &mut self.0.options
4274        }
4275    }
4276
4277    /// The request builder for [InstanceGroupManagers::set_instance_template][crate::client::InstanceGroupManagers::set_instance_template] calls.
4278    ///
4279    /// # Example
4280    /// ```no_run
4281    /// # use google_cloud_compute_v1::builder;
4282    /// use builder::instance_group_managers::SetInstanceTemplate;
4283    /// # tokio_test::block_on(async {
4284    ///
4285    /// let builder = prepare_request_builder();
4286    /// let response = builder.send().await?;
4287    /// # gax::Result::<()>::Ok(()) });
4288    ///
4289    /// fn prepare_request_builder() -> SetInstanceTemplate {
4290    ///   # panic!();
4291    ///   // ... details omitted ...
4292    /// }
4293    /// ```
4294    #[derive(Clone, Debug)]
4295    pub struct SetInstanceTemplate(
4296        RequestBuilder<crate::model::instance_group_managers::SetInstanceTemplateRequest>,
4297    );
4298
4299    impl SetInstanceTemplate {
4300        pub(crate) fn new(
4301            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4302        ) -> Self {
4303            Self(RequestBuilder::new(stub))
4304        }
4305
4306        /// Sets the full request, replacing any prior values.
4307        pub fn with_request<
4308            V: Into<crate::model::instance_group_managers::SetInstanceTemplateRequest>,
4309        >(
4310            mut self,
4311            v: V,
4312        ) -> Self {
4313            self.0.request = v.into();
4314            self
4315        }
4316
4317        /// Sets all the options, replacing any prior values.
4318        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4319            self.0.options = v.into();
4320            self
4321        }
4322
4323        /// Sends the request.
4324        pub async fn send(self) -> Result<crate::model::Operation> {
4325            (*self.0.stub)
4326                .set_instance_template(self.0.request, self.0.options)
4327                .await
4328                .map(gax::response::Response::into_body)
4329        }
4330
4331        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::SetInstanceTemplateRequest::instance_group_manager].
4332        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4333            self.0.request.instance_group_manager = v.into();
4334            self
4335        }
4336
4337        /// Sets the value of [project][crate::model::instance_group_managers::SetInstanceTemplateRequest::project].
4338        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4339            self.0.request.project = v.into();
4340            self
4341        }
4342
4343        /// Sets the value of [request_id][crate::model::instance_group_managers::SetInstanceTemplateRequest::request_id].
4344        pub fn set_request_id<T>(mut self, v: T) -> Self
4345        where
4346            T: std::convert::Into<std::string::String>,
4347        {
4348            self.0.request.request_id = std::option::Option::Some(v.into());
4349            self
4350        }
4351
4352        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::SetInstanceTemplateRequest::request_id].
4353        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4354        where
4355            T: std::convert::Into<std::string::String>,
4356        {
4357            self.0.request.request_id = v.map(|x| x.into());
4358            self
4359        }
4360
4361        /// Sets the value of [zone][crate::model::instance_group_managers::SetInstanceTemplateRequest::zone].
4362        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363            self.0.request.zone = v.into();
4364            self
4365        }
4366
4367        /// Sets the value of [body][crate::model::instance_group_managers::SetInstanceTemplateRequest::body].
4368        pub fn set_body<T>(mut self, v: T) -> Self
4369        where
4370            T: std::convert::Into<crate::model::InstanceGroupManagersSetInstanceTemplateRequest>,
4371        {
4372            self.0.request.body = std::option::Option::Some(v.into());
4373            self
4374        }
4375
4376        /// Sets or clears the value of [body][crate::model::instance_group_managers::SetInstanceTemplateRequest::body].
4377        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4378        where
4379            T: std::convert::Into<crate::model::InstanceGroupManagersSetInstanceTemplateRequest>,
4380        {
4381            self.0.request.body = v.map(|x| x.into());
4382            self
4383        }
4384    }
4385
4386    #[doc(hidden)]
4387    impl gax::options::internal::RequestBuilder for SetInstanceTemplate {
4388        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4389            &mut self.0.options
4390        }
4391    }
4392
4393    /// The request builder for [InstanceGroupManagers::set_target_pools][crate::client::InstanceGroupManagers::set_target_pools] calls.
4394    ///
4395    /// # Example
4396    /// ```no_run
4397    /// # use google_cloud_compute_v1::builder;
4398    /// use builder::instance_group_managers::SetTargetPools;
4399    /// # tokio_test::block_on(async {
4400    ///
4401    /// let builder = prepare_request_builder();
4402    /// let response = builder.send().await?;
4403    /// # gax::Result::<()>::Ok(()) });
4404    ///
4405    /// fn prepare_request_builder() -> SetTargetPools {
4406    ///   # panic!();
4407    ///   // ... details omitted ...
4408    /// }
4409    /// ```
4410    #[derive(Clone, Debug)]
4411    pub struct SetTargetPools(
4412        RequestBuilder<crate::model::instance_group_managers::SetTargetPoolsRequest>,
4413    );
4414
4415    impl SetTargetPools {
4416        pub(crate) fn new(
4417            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4418        ) -> Self {
4419            Self(RequestBuilder::new(stub))
4420        }
4421
4422        /// Sets the full request, replacing any prior values.
4423        pub fn with_request<
4424            V: Into<crate::model::instance_group_managers::SetTargetPoolsRequest>,
4425        >(
4426            mut self,
4427            v: V,
4428        ) -> Self {
4429            self.0.request = v.into();
4430            self
4431        }
4432
4433        /// Sets all the options, replacing any prior values.
4434        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4435            self.0.options = v.into();
4436            self
4437        }
4438
4439        /// Sends the request.
4440        pub async fn send(self) -> Result<crate::model::Operation> {
4441            (*self.0.stub)
4442                .set_target_pools(self.0.request, self.0.options)
4443                .await
4444                .map(gax::response::Response::into_body)
4445        }
4446
4447        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::SetTargetPoolsRequest::instance_group_manager].
4448        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4449            self.0.request.instance_group_manager = v.into();
4450            self
4451        }
4452
4453        /// Sets the value of [project][crate::model::instance_group_managers::SetTargetPoolsRequest::project].
4454        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4455            self.0.request.project = v.into();
4456            self
4457        }
4458
4459        /// Sets the value of [request_id][crate::model::instance_group_managers::SetTargetPoolsRequest::request_id].
4460        pub fn set_request_id<T>(mut self, v: T) -> Self
4461        where
4462            T: std::convert::Into<std::string::String>,
4463        {
4464            self.0.request.request_id = std::option::Option::Some(v.into());
4465            self
4466        }
4467
4468        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::SetTargetPoolsRequest::request_id].
4469        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4470        where
4471            T: std::convert::Into<std::string::String>,
4472        {
4473            self.0.request.request_id = v.map(|x| x.into());
4474            self
4475        }
4476
4477        /// Sets the value of [zone][crate::model::instance_group_managers::SetTargetPoolsRequest::zone].
4478        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4479            self.0.request.zone = v.into();
4480            self
4481        }
4482
4483        /// Sets the value of [body][crate::model::instance_group_managers::SetTargetPoolsRequest::body].
4484        pub fn set_body<T>(mut self, v: T) -> Self
4485        where
4486            T: std::convert::Into<crate::model::InstanceGroupManagersSetTargetPoolsRequest>,
4487        {
4488            self.0.request.body = std::option::Option::Some(v.into());
4489            self
4490        }
4491
4492        /// Sets or clears the value of [body][crate::model::instance_group_managers::SetTargetPoolsRequest::body].
4493        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4494        where
4495            T: std::convert::Into<crate::model::InstanceGroupManagersSetTargetPoolsRequest>,
4496        {
4497            self.0.request.body = v.map(|x| x.into());
4498            self
4499        }
4500    }
4501
4502    #[doc(hidden)]
4503    impl gax::options::internal::RequestBuilder for SetTargetPools {
4504        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4505            &mut self.0.options
4506        }
4507    }
4508
4509    /// The request builder for [InstanceGroupManagers::start_instances][crate::client::InstanceGroupManagers::start_instances] calls.
4510    ///
4511    /// # Example
4512    /// ```no_run
4513    /// # use google_cloud_compute_v1::builder;
4514    /// use builder::instance_group_managers::StartInstances;
4515    /// # tokio_test::block_on(async {
4516    ///
4517    /// let builder = prepare_request_builder();
4518    /// let response = builder.send().await?;
4519    /// # gax::Result::<()>::Ok(()) });
4520    ///
4521    /// fn prepare_request_builder() -> StartInstances {
4522    ///   # panic!();
4523    ///   // ... details omitted ...
4524    /// }
4525    /// ```
4526    #[derive(Clone, Debug)]
4527    pub struct StartInstances(
4528        RequestBuilder<crate::model::instance_group_managers::StartInstancesRequest>,
4529    );
4530
4531    impl StartInstances {
4532        pub(crate) fn new(
4533            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4534        ) -> Self {
4535            Self(RequestBuilder::new(stub))
4536        }
4537
4538        /// Sets the full request, replacing any prior values.
4539        pub fn with_request<
4540            V: Into<crate::model::instance_group_managers::StartInstancesRequest>,
4541        >(
4542            mut self,
4543            v: V,
4544        ) -> Self {
4545            self.0.request = v.into();
4546            self
4547        }
4548
4549        /// Sets all the options, replacing any prior values.
4550        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4551            self.0.options = v.into();
4552            self
4553        }
4554
4555        /// Sends the request.
4556        pub async fn send(self) -> Result<crate::model::Operation> {
4557            (*self.0.stub)
4558                .start_instances(self.0.request, self.0.options)
4559                .await
4560                .map(gax::response::Response::into_body)
4561        }
4562
4563        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::StartInstancesRequest::instance_group_manager].
4564        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4565            self.0.request.instance_group_manager = v.into();
4566            self
4567        }
4568
4569        /// Sets the value of [project][crate::model::instance_group_managers::StartInstancesRequest::project].
4570        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4571            self.0.request.project = v.into();
4572            self
4573        }
4574
4575        /// Sets the value of [request_id][crate::model::instance_group_managers::StartInstancesRequest::request_id].
4576        pub fn set_request_id<T>(mut self, v: T) -> Self
4577        where
4578            T: std::convert::Into<std::string::String>,
4579        {
4580            self.0.request.request_id = std::option::Option::Some(v.into());
4581            self
4582        }
4583
4584        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::StartInstancesRequest::request_id].
4585        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4586        where
4587            T: std::convert::Into<std::string::String>,
4588        {
4589            self.0.request.request_id = v.map(|x| x.into());
4590            self
4591        }
4592
4593        /// Sets the value of [zone][crate::model::instance_group_managers::StartInstancesRequest::zone].
4594        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4595            self.0.request.zone = v.into();
4596            self
4597        }
4598
4599        /// Sets the value of [body][crate::model::instance_group_managers::StartInstancesRequest::body].
4600        pub fn set_body<T>(mut self, v: T) -> Self
4601        where
4602            T: std::convert::Into<crate::model::InstanceGroupManagersStartInstancesRequest>,
4603        {
4604            self.0.request.body = std::option::Option::Some(v.into());
4605            self
4606        }
4607
4608        /// Sets or clears the value of [body][crate::model::instance_group_managers::StartInstancesRequest::body].
4609        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4610        where
4611            T: std::convert::Into<crate::model::InstanceGroupManagersStartInstancesRequest>,
4612        {
4613            self.0.request.body = v.map(|x| x.into());
4614            self
4615        }
4616    }
4617
4618    #[doc(hidden)]
4619    impl gax::options::internal::RequestBuilder for StartInstances {
4620        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4621            &mut self.0.options
4622        }
4623    }
4624
4625    /// The request builder for [InstanceGroupManagers::stop_instances][crate::client::InstanceGroupManagers::stop_instances] calls.
4626    ///
4627    /// # Example
4628    /// ```no_run
4629    /// # use google_cloud_compute_v1::builder;
4630    /// use builder::instance_group_managers::StopInstances;
4631    /// # tokio_test::block_on(async {
4632    ///
4633    /// let builder = prepare_request_builder();
4634    /// let response = builder.send().await?;
4635    /// # gax::Result::<()>::Ok(()) });
4636    ///
4637    /// fn prepare_request_builder() -> StopInstances {
4638    ///   # panic!();
4639    ///   // ... details omitted ...
4640    /// }
4641    /// ```
4642    #[derive(Clone, Debug)]
4643    pub struct StopInstances(
4644        RequestBuilder<crate::model::instance_group_managers::StopInstancesRequest>,
4645    );
4646
4647    impl StopInstances {
4648        pub(crate) fn new(
4649            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4650        ) -> Self {
4651            Self(RequestBuilder::new(stub))
4652        }
4653
4654        /// Sets the full request, replacing any prior values.
4655        pub fn with_request<
4656            V: Into<crate::model::instance_group_managers::StopInstancesRequest>,
4657        >(
4658            mut self,
4659            v: V,
4660        ) -> Self {
4661            self.0.request = v.into();
4662            self
4663        }
4664
4665        /// Sets all the options, replacing any prior values.
4666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4667            self.0.options = v.into();
4668            self
4669        }
4670
4671        /// Sends the request.
4672        pub async fn send(self) -> Result<crate::model::Operation> {
4673            (*self.0.stub)
4674                .stop_instances(self.0.request, self.0.options)
4675                .await
4676                .map(gax::response::Response::into_body)
4677        }
4678
4679        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::StopInstancesRequest::instance_group_manager].
4680        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4681            self.0.request.instance_group_manager = v.into();
4682            self
4683        }
4684
4685        /// Sets the value of [project][crate::model::instance_group_managers::StopInstancesRequest::project].
4686        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4687            self.0.request.project = v.into();
4688            self
4689        }
4690
4691        /// Sets the value of [request_id][crate::model::instance_group_managers::StopInstancesRequest::request_id].
4692        pub fn set_request_id<T>(mut self, v: T) -> Self
4693        where
4694            T: std::convert::Into<std::string::String>,
4695        {
4696            self.0.request.request_id = std::option::Option::Some(v.into());
4697            self
4698        }
4699
4700        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::StopInstancesRequest::request_id].
4701        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4702        where
4703            T: std::convert::Into<std::string::String>,
4704        {
4705            self.0.request.request_id = v.map(|x| x.into());
4706            self
4707        }
4708
4709        /// Sets the value of [zone][crate::model::instance_group_managers::StopInstancesRequest::zone].
4710        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4711            self.0.request.zone = v.into();
4712            self
4713        }
4714
4715        /// Sets the value of [body][crate::model::instance_group_managers::StopInstancesRequest::body].
4716        pub fn set_body<T>(mut self, v: T) -> Self
4717        where
4718            T: std::convert::Into<crate::model::InstanceGroupManagersStopInstancesRequest>,
4719        {
4720            self.0.request.body = std::option::Option::Some(v.into());
4721            self
4722        }
4723
4724        /// Sets or clears the value of [body][crate::model::instance_group_managers::StopInstancesRequest::body].
4725        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4726        where
4727            T: std::convert::Into<crate::model::InstanceGroupManagersStopInstancesRequest>,
4728        {
4729            self.0.request.body = v.map(|x| x.into());
4730            self
4731        }
4732    }
4733
4734    #[doc(hidden)]
4735    impl gax::options::internal::RequestBuilder for StopInstances {
4736        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4737            &mut self.0.options
4738        }
4739    }
4740
4741    /// The request builder for [InstanceGroupManagers::suspend_instances][crate::client::InstanceGroupManagers::suspend_instances] calls.
4742    ///
4743    /// # Example
4744    /// ```no_run
4745    /// # use google_cloud_compute_v1::builder;
4746    /// use builder::instance_group_managers::SuspendInstances;
4747    /// # tokio_test::block_on(async {
4748    ///
4749    /// let builder = prepare_request_builder();
4750    /// let response = builder.send().await?;
4751    /// # gax::Result::<()>::Ok(()) });
4752    ///
4753    /// fn prepare_request_builder() -> SuspendInstances {
4754    ///   # panic!();
4755    ///   // ... details omitted ...
4756    /// }
4757    /// ```
4758    #[derive(Clone, Debug)]
4759    pub struct SuspendInstances(
4760        RequestBuilder<crate::model::instance_group_managers::SuspendInstancesRequest>,
4761    );
4762
4763    impl SuspendInstances {
4764        pub(crate) fn new(
4765            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4766        ) -> Self {
4767            Self(RequestBuilder::new(stub))
4768        }
4769
4770        /// Sets the full request, replacing any prior values.
4771        pub fn with_request<
4772            V: Into<crate::model::instance_group_managers::SuspendInstancesRequest>,
4773        >(
4774            mut self,
4775            v: V,
4776        ) -> Self {
4777            self.0.request = v.into();
4778            self
4779        }
4780
4781        /// Sets all the options, replacing any prior values.
4782        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4783            self.0.options = v.into();
4784            self
4785        }
4786
4787        /// Sends the request.
4788        pub async fn send(self) -> Result<crate::model::Operation> {
4789            (*self.0.stub)
4790                .suspend_instances(self.0.request, self.0.options)
4791                .await
4792                .map(gax::response::Response::into_body)
4793        }
4794
4795        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::SuspendInstancesRequest::instance_group_manager].
4796        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4797            self.0.request.instance_group_manager = v.into();
4798            self
4799        }
4800
4801        /// Sets the value of [project][crate::model::instance_group_managers::SuspendInstancesRequest::project].
4802        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4803            self.0.request.project = v.into();
4804            self
4805        }
4806
4807        /// Sets the value of [request_id][crate::model::instance_group_managers::SuspendInstancesRequest::request_id].
4808        pub fn set_request_id<T>(mut self, v: T) -> Self
4809        where
4810            T: std::convert::Into<std::string::String>,
4811        {
4812            self.0.request.request_id = std::option::Option::Some(v.into());
4813            self
4814        }
4815
4816        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::SuspendInstancesRequest::request_id].
4817        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4818        where
4819            T: std::convert::Into<std::string::String>,
4820        {
4821            self.0.request.request_id = v.map(|x| x.into());
4822            self
4823        }
4824
4825        /// Sets the value of [zone][crate::model::instance_group_managers::SuspendInstancesRequest::zone].
4826        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4827            self.0.request.zone = v.into();
4828            self
4829        }
4830
4831        /// Sets the value of [body][crate::model::instance_group_managers::SuspendInstancesRequest::body].
4832        pub fn set_body<T>(mut self, v: T) -> Self
4833        where
4834            T: std::convert::Into<crate::model::InstanceGroupManagersSuspendInstancesRequest>,
4835        {
4836            self.0.request.body = std::option::Option::Some(v.into());
4837            self
4838        }
4839
4840        /// Sets or clears the value of [body][crate::model::instance_group_managers::SuspendInstancesRequest::body].
4841        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4842        where
4843            T: std::convert::Into<crate::model::InstanceGroupManagersSuspendInstancesRequest>,
4844        {
4845            self.0.request.body = v.map(|x| x.into());
4846            self
4847        }
4848    }
4849
4850    #[doc(hidden)]
4851    impl gax::options::internal::RequestBuilder for SuspendInstances {
4852        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4853            &mut self.0.options
4854        }
4855    }
4856
4857    /// The request builder for [InstanceGroupManagers::update_per_instance_configs][crate::client::InstanceGroupManagers::update_per_instance_configs] calls.
4858    ///
4859    /// # Example
4860    /// ```no_run
4861    /// # use google_cloud_compute_v1::builder;
4862    /// use builder::instance_group_managers::UpdatePerInstanceConfigs;
4863    /// # tokio_test::block_on(async {
4864    ///
4865    /// let builder = prepare_request_builder();
4866    /// let response = builder.send().await?;
4867    /// # gax::Result::<()>::Ok(()) });
4868    ///
4869    /// fn prepare_request_builder() -> UpdatePerInstanceConfigs {
4870    ///   # panic!();
4871    ///   // ... details omitted ...
4872    /// }
4873    /// ```
4874    #[derive(Clone, Debug)]
4875    pub struct UpdatePerInstanceConfigs(
4876        RequestBuilder<crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest>,
4877    );
4878
4879    impl UpdatePerInstanceConfigs {
4880        pub(crate) fn new(
4881            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4882        ) -> Self {
4883            Self(RequestBuilder::new(stub))
4884        }
4885
4886        /// Sets the full request, replacing any prior values.
4887        pub fn with_request<
4888            V: Into<crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest>,
4889        >(
4890            mut self,
4891            v: V,
4892        ) -> Self {
4893            self.0.request = v.into();
4894            self
4895        }
4896
4897        /// Sets all the options, replacing any prior values.
4898        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4899            self.0.options = v.into();
4900            self
4901        }
4902
4903        /// Sends the request.
4904        pub async fn send(self) -> Result<crate::model::Operation> {
4905            (*self.0.stub)
4906                .update_per_instance_configs(self.0.request, self.0.options)
4907                .await
4908                .map(gax::response::Response::into_body)
4909        }
4910
4911        /// Sets the value of [instance_group_manager][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::instance_group_manager].
4912        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4913            self.0.request.instance_group_manager = v.into();
4914            self
4915        }
4916
4917        /// Sets the value of [project][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::project].
4918        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4919            self.0.request.project = v.into();
4920            self
4921        }
4922
4923        /// Sets the value of [request_id][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::request_id].
4924        pub fn set_request_id<T>(mut self, v: T) -> Self
4925        where
4926            T: std::convert::Into<std::string::String>,
4927        {
4928            self.0.request.request_id = std::option::Option::Some(v.into());
4929            self
4930        }
4931
4932        /// Sets or clears the value of [request_id][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::request_id].
4933        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4934        where
4935            T: std::convert::Into<std::string::String>,
4936        {
4937            self.0.request.request_id = v.map(|x| x.into());
4938            self
4939        }
4940
4941        /// Sets the value of [zone][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::zone].
4942        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4943            self.0.request.zone = v.into();
4944            self
4945        }
4946
4947        /// Sets the value of [body][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::body].
4948        pub fn set_body<T>(mut self, v: T) -> Self
4949        where
4950            T: std::convert::Into<crate::model::InstanceGroupManagersUpdatePerInstanceConfigsReq>,
4951        {
4952            self.0.request.body = std::option::Option::Some(v.into());
4953            self
4954        }
4955
4956        /// Sets or clears the value of [body][crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest::body].
4957        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4958        where
4959            T: std::convert::Into<crate::model::InstanceGroupManagersUpdatePerInstanceConfigsReq>,
4960        {
4961            self.0.request.body = v.map(|x| x.into());
4962            self
4963        }
4964    }
4965
4966    #[doc(hidden)]
4967    impl gax::options::internal::RequestBuilder for UpdatePerInstanceConfigs {
4968        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4969            &mut self.0.options
4970        }
4971    }
4972}
4973
4974#[cfg(feature = "instance-groups")]
4975#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4976pub mod instance_groups {
4977    use crate::Result;
4978
4979    /// A builder for [InstanceGroups][crate::client::InstanceGroups].
4980    ///
4981    /// ```
4982    /// # tokio_test::block_on(async {
4983    /// # use google_cloud_compute_v1::*;
4984    /// # use builder::instance_groups::ClientBuilder;
4985    /// # use client::InstanceGroups;
4986    /// let builder : ClientBuilder = InstanceGroups::builder();
4987    /// let client = builder
4988    ///     .with_endpoint("https://compute.googleapis.com")
4989    ///     .build().await?;
4990    /// # gax::client_builder::Result::<()>::Ok(()) });
4991    /// ```
4992    pub type ClientBuilder =
4993        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4994
4995    pub(crate) mod client {
4996        use super::super::super::client::InstanceGroups;
4997        pub struct Factory;
4998        impl gax::client_builder::internal::ClientFactory for Factory {
4999            type Client = InstanceGroups;
5000            type Credentials = gaxi::options::Credentials;
5001            async fn build(
5002                self,
5003                config: gaxi::options::ClientConfig,
5004            ) -> gax::client_builder::Result<Self::Client> {
5005                Self::Client::new(config).await
5006            }
5007        }
5008    }
5009
5010    /// Common implementation for [crate::client::InstanceGroups] request builders.
5011    #[derive(Clone, Debug)]
5012    pub(crate) struct RequestBuilder<R: std::default::Default> {
5013        stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5014        request: R,
5015        options: gax::options::RequestOptions,
5016    }
5017
5018    impl<R> RequestBuilder<R>
5019    where
5020        R: std::default::Default,
5021    {
5022        pub(crate) fn new(
5023            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5024        ) -> Self {
5025            Self {
5026                stub,
5027                request: R::default(),
5028                options: gax::options::RequestOptions::default(),
5029            }
5030        }
5031    }
5032
5033    /// The request builder for [InstanceGroups::add_instances][crate::client::InstanceGroups::add_instances] calls.
5034    ///
5035    /// # Example
5036    /// ```no_run
5037    /// # use google_cloud_compute_v1::builder;
5038    /// use builder::instance_groups::AddInstances;
5039    /// # tokio_test::block_on(async {
5040    ///
5041    /// let builder = prepare_request_builder();
5042    /// let response = builder.send().await?;
5043    /// # gax::Result::<()>::Ok(()) });
5044    ///
5045    /// fn prepare_request_builder() -> AddInstances {
5046    ///   # panic!();
5047    ///   // ... details omitted ...
5048    /// }
5049    /// ```
5050    #[derive(Clone, Debug)]
5051    pub struct AddInstances(RequestBuilder<crate::model::instance_groups::AddInstancesRequest>);
5052
5053    impl AddInstances {
5054        pub(crate) fn new(
5055            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5056        ) -> Self {
5057            Self(RequestBuilder::new(stub))
5058        }
5059
5060        /// Sets the full request, replacing any prior values.
5061        pub fn with_request<V: Into<crate::model::instance_groups::AddInstancesRequest>>(
5062            mut self,
5063            v: V,
5064        ) -> Self {
5065            self.0.request = v.into();
5066            self
5067        }
5068
5069        /// Sets all the options, replacing any prior values.
5070        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5071            self.0.options = v.into();
5072            self
5073        }
5074
5075        /// Sends the request.
5076        pub async fn send(self) -> Result<crate::model::Operation> {
5077            (*self.0.stub)
5078                .add_instances(self.0.request, self.0.options)
5079                .await
5080                .map(gax::response::Response::into_body)
5081        }
5082
5083        /// Sets the value of [instance_group][crate::model::instance_groups::AddInstancesRequest::instance_group].
5084        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5085            self.0.request.instance_group = v.into();
5086            self
5087        }
5088
5089        /// Sets the value of [project][crate::model::instance_groups::AddInstancesRequest::project].
5090        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5091            self.0.request.project = v.into();
5092            self
5093        }
5094
5095        /// Sets the value of [request_id][crate::model::instance_groups::AddInstancesRequest::request_id].
5096        pub fn set_request_id<T>(mut self, v: T) -> Self
5097        where
5098            T: std::convert::Into<std::string::String>,
5099        {
5100            self.0.request.request_id = std::option::Option::Some(v.into());
5101            self
5102        }
5103
5104        /// Sets or clears the value of [request_id][crate::model::instance_groups::AddInstancesRequest::request_id].
5105        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5106        where
5107            T: std::convert::Into<std::string::String>,
5108        {
5109            self.0.request.request_id = v.map(|x| x.into());
5110            self
5111        }
5112
5113        /// Sets the value of [zone][crate::model::instance_groups::AddInstancesRequest::zone].
5114        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115            self.0.request.zone = v.into();
5116            self
5117        }
5118
5119        /// Sets the value of [body][crate::model::instance_groups::AddInstancesRequest::body].
5120        pub fn set_body<T>(mut self, v: T) -> Self
5121        where
5122            T: std::convert::Into<crate::model::InstanceGroupsAddInstancesRequest>,
5123        {
5124            self.0.request.body = std::option::Option::Some(v.into());
5125            self
5126        }
5127
5128        /// Sets or clears the value of [body][crate::model::instance_groups::AddInstancesRequest::body].
5129        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5130        where
5131            T: std::convert::Into<crate::model::InstanceGroupsAddInstancesRequest>,
5132        {
5133            self.0.request.body = v.map(|x| x.into());
5134            self
5135        }
5136    }
5137
5138    #[doc(hidden)]
5139    impl gax::options::internal::RequestBuilder for AddInstances {
5140        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5141            &mut self.0.options
5142        }
5143    }
5144
5145    /// The request builder for [InstanceGroups::aggregated_list][crate::client::InstanceGroups::aggregated_list] calls.
5146    ///
5147    /// # Example
5148    /// ```no_run
5149    /// # use google_cloud_compute_v1::builder;
5150    /// use builder::instance_groups::AggregatedList;
5151    /// # tokio_test::block_on(async {
5152    /// use gax::paginator::ItemPaginator;
5153    ///
5154    /// let builder = prepare_request_builder();
5155    /// let mut items = builder.by_item();
5156    /// while let Some(result) = items.next().await {
5157    ///   let item = result?;
5158    /// }
5159    /// # gax::Result::<()>::Ok(()) });
5160    ///
5161    /// fn prepare_request_builder() -> AggregatedList {
5162    ///   # panic!();
5163    ///   // ... details omitted ...
5164    /// }
5165    /// ```
5166    #[derive(Clone, Debug)]
5167    pub struct AggregatedList(RequestBuilder<crate::model::instance_groups::AggregatedListRequest>);
5168
5169    impl AggregatedList {
5170        pub(crate) fn new(
5171            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5172        ) -> Self {
5173            Self(RequestBuilder::new(stub))
5174        }
5175
5176        /// Sets the full request, replacing any prior values.
5177        pub fn with_request<V: Into<crate::model::instance_groups::AggregatedListRequest>>(
5178            mut self,
5179            v: V,
5180        ) -> Self {
5181            self.0.request = v.into();
5182            self
5183        }
5184
5185        /// Sets all the options, replacing any prior values.
5186        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5187            self.0.options = v.into();
5188            self
5189        }
5190
5191        /// Sends the request.
5192        pub async fn send(self) -> Result<crate::model::InstanceGroupAggregatedList> {
5193            (*self.0.stub)
5194                .aggregated_list(self.0.request, self.0.options)
5195                .await
5196                .map(gax::response::Response::into_body)
5197        }
5198
5199        /// Streams each page in the collection.
5200        pub fn by_page(
5201            self,
5202        ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupAggregatedList, gax::error::Error>
5203        {
5204            use std::clone::Clone;
5205            let token = self.0.request.page_token.clone().unwrap_or_default();
5206            let execute = move |token: String| {
5207                let mut builder = self.clone();
5208                builder.0.request = builder.0.request.set_page_token(token);
5209                builder.send()
5210            };
5211            gax::paginator::internal::new_paginator(token, execute)
5212        }
5213
5214        /// Streams each item in the collection.
5215        pub fn by_item(
5216            self,
5217        ) -> impl gax::paginator::ItemPaginator<
5218            crate::model::InstanceGroupAggregatedList,
5219            gax::error::Error,
5220        > {
5221            use gax::paginator::Paginator;
5222            self.by_page().items()
5223        }
5224
5225        /// Sets the value of [filter][crate::model::instance_groups::AggregatedListRequest::filter].
5226        pub fn set_filter<T>(mut self, v: T) -> Self
5227        where
5228            T: std::convert::Into<std::string::String>,
5229        {
5230            self.0.request.filter = std::option::Option::Some(v.into());
5231            self
5232        }
5233
5234        /// Sets or clears the value of [filter][crate::model::instance_groups::AggregatedListRequest::filter].
5235        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5236        where
5237            T: std::convert::Into<std::string::String>,
5238        {
5239            self.0.request.filter = v.map(|x| x.into());
5240            self
5241        }
5242
5243        /// Sets the value of [include_all_scopes][crate::model::instance_groups::AggregatedListRequest::include_all_scopes].
5244        pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
5245        where
5246            T: std::convert::Into<bool>,
5247        {
5248            self.0.request.include_all_scopes = std::option::Option::Some(v.into());
5249            self
5250        }
5251
5252        /// Sets or clears the value of [include_all_scopes][crate::model::instance_groups::AggregatedListRequest::include_all_scopes].
5253        pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
5254        where
5255            T: std::convert::Into<bool>,
5256        {
5257            self.0.request.include_all_scopes = v.map(|x| x.into());
5258            self
5259        }
5260
5261        /// Sets the value of [max_results][crate::model::instance_groups::AggregatedListRequest::max_results].
5262        pub fn set_max_results<T>(mut self, v: T) -> Self
5263        where
5264            T: std::convert::Into<u32>,
5265        {
5266            self.0.request.max_results = std::option::Option::Some(v.into());
5267            self
5268        }
5269
5270        /// Sets or clears the value of [max_results][crate::model::instance_groups::AggregatedListRequest::max_results].
5271        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5272        where
5273            T: std::convert::Into<u32>,
5274        {
5275            self.0.request.max_results = v.map(|x| x.into());
5276            self
5277        }
5278
5279        /// Sets the value of [order_by][crate::model::instance_groups::AggregatedListRequest::order_by].
5280        pub fn set_order_by<T>(mut self, v: T) -> Self
5281        where
5282            T: std::convert::Into<std::string::String>,
5283        {
5284            self.0.request.order_by = std::option::Option::Some(v.into());
5285            self
5286        }
5287
5288        /// Sets or clears the value of [order_by][crate::model::instance_groups::AggregatedListRequest::order_by].
5289        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5290        where
5291            T: std::convert::Into<std::string::String>,
5292        {
5293            self.0.request.order_by = v.map(|x| x.into());
5294            self
5295        }
5296
5297        /// Sets the value of [page_token][crate::model::instance_groups::AggregatedListRequest::page_token].
5298        pub fn set_page_token<T>(mut self, v: T) -> Self
5299        where
5300            T: std::convert::Into<std::string::String>,
5301        {
5302            self.0.request.page_token = std::option::Option::Some(v.into());
5303            self
5304        }
5305
5306        /// Sets or clears the value of [page_token][crate::model::instance_groups::AggregatedListRequest::page_token].
5307        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5308        where
5309            T: std::convert::Into<std::string::String>,
5310        {
5311            self.0.request.page_token = v.map(|x| x.into());
5312            self
5313        }
5314
5315        /// Sets the value of [project][crate::model::instance_groups::AggregatedListRequest::project].
5316        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5317            self.0.request.project = v.into();
5318            self
5319        }
5320
5321        /// Sets the value of [return_partial_success][crate::model::instance_groups::AggregatedListRequest::return_partial_success].
5322        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5323        where
5324            T: std::convert::Into<bool>,
5325        {
5326            self.0.request.return_partial_success = std::option::Option::Some(v.into());
5327            self
5328        }
5329
5330        /// Sets or clears the value of [return_partial_success][crate::model::instance_groups::AggregatedListRequest::return_partial_success].
5331        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
5332        where
5333            T: std::convert::Into<bool>,
5334        {
5335            self.0.request.return_partial_success = v.map(|x| x.into());
5336            self
5337        }
5338
5339        /// Sets the value of [service_project_number][crate::model::instance_groups::AggregatedListRequest::service_project_number].
5340        pub fn set_service_project_number<T>(mut self, v: T) -> Self
5341        where
5342            T: std::convert::Into<i64>,
5343        {
5344            self.0.request.service_project_number = std::option::Option::Some(v.into());
5345            self
5346        }
5347
5348        /// Sets or clears the value of [service_project_number][crate::model::instance_groups::AggregatedListRequest::service_project_number].
5349        pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
5350        where
5351            T: std::convert::Into<i64>,
5352        {
5353            self.0.request.service_project_number = v.map(|x| x.into());
5354            self
5355        }
5356    }
5357
5358    #[doc(hidden)]
5359    impl gax::options::internal::RequestBuilder for AggregatedList {
5360        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5361            &mut self.0.options
5362        }
5363    }
5364
5365    /// The request builder for [InstanceGroups::delete][crate::client::InstanceGroups::delete] calls.
5366    ///
5367    /// # Example
5368    /// ```no_run
5369    /// # use google_cloud_compute_v1::builder;
5370    /// use builder::instance_groups::Delete;
5371    /// # tokio_test::block_on(async {
5372    ///
5373    /// let builder = prepare_request_builder();
5374    /// let response = builder.send().await?;
5375    /// # gax::Result::<()>::Ok(()) });
5376    ///
5377    /// fn prepare_request_builder() -> Delete {
5378    ///   # panic!();
5379    ///   // ... details omitted ...
5380    /// }
5381    /// ```
5382    #[derive(Clone, Debug)]
5383    pub struct Delete(RequestBuilder<crate::model::instance_groups::DeleteRequest>);
5384
5385    impl Delete {
5386        pub(crate) fn new(
5387            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5388        ) -> Self {
5389            Self(RequestBuilder::new(stub))
5390        }
5391
5392        /// Sets the full request, replacing any prior values.
5393        pub fn with_request<V: Into<crate::model::instance_groups::DeleteRequest>>(
5394            mut self,
5395            v: V,
5396        ) -> Self {
5397            self.0.request = v.into();
5398            self
5399        }
5400
5401        /// Sets all the options, replacing any prior values.
5402        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5403            self.0.options = v.into();
5404            self
5405        }
5406
5407        /// Sends the request.
5408        pub async fn send(self) -> Result<crate::model::Operation> {
5409            (*self.0.stub)
5410                .delete(self.0.request, self.0.options)
5411                .await
5412                .map(gax::response::Response::into_body)
5413        }
5414
5415        /// Sets the value of [instance_group][crate::model::instance_groups::DeleteRequest::instance_group].
5416        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417            self.0.request.instance_group = v.into();
5418            self
5419        }
5420
5421        /// Sets the value of [project][crate::model::instance_groups::DeleteRequest::project].
5422        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5423            self.0.request.project = v.into();
5424            self
5425        }
5426
5427        /// Sets the value of [request_id][crate::model::instance_groups::DeleteRequest::request_id].
5428        pub fn set_request_id<T>(mut self, v: T) -> Self
5429        where
5430            T: std::convert::Into<std::string::String>,
5431        {
5432            self.0.request.request_id = std::option::Option::Some(v.into());
5433            self
5434        }
5435
5436        /// Sets or clears the value of [request_id][crate::model::instance_groups::DeleteRequest::request_id].
5437        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5438        where
5439            T: std::convert::Into<std::string::String>,
5440        {
5441            self.0.request.request_id = v.map(|x| x.into());
5442            self
5443        }
5444
5445        /// Sets the value of [zone][crate::model::instance_groups::DeleteRequest::zone].
5446        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5447            self.0.request.zone = v.into();
5448            self
5449        }
5450    }
5451
5452    #[doc(hidden)]
5453    impl gax::options::internal::RequestBuilder for Delete {
5454        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5455            &mut self.0.options
5456        }
5457    }
5458
5459    /// The request builder for [InstanceGroups::get][crate::client::InstanceGroups::get] calls.
5460    ///
5461    /// # Example
5462    /// ```no_run
5463    /// # use google_cloud_compute_v1::builder;
5464    /// use builder::instance_groups::Get;
5465    /// # tokio_test::block_on(async {
5466    ///
5467    /// let builder = prepare_request_builder();
5468    /// let response = builder.send().await?;
5469    /// # gax::Result::<()>::Ok(()) });
5470    ///
5471    /// fn prepare_request_builder() -> Get {
5472    ///   # panic!();
5473    ///   // ... details omitted ...
5474    /// }
5475    /// ```
5476    #[derive(Clone, Debug)]
5477    pub struct Get(RequestBuilder<crate::model::instance_groups::GetRequest>);
5478
5479    impl Get {
5480        pub(crate) fn new(
5481            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5482        ) -> Self {
5483            Self(RequestBuilder::new(stub))
5484        }
5485
5486        /// Sets the full request, replacing any prior values.
5487        pub fn with_request<V: Into<crate::model::instance_groups::GetRequest>>(
5488            mut self,
5489            v: V,
5490        ) -> Self {
5491            self.0.request = v.into();
5492            self
5493        }
5494
5495        /// Sets all the options, replacing any prior values.
5496        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5497            self.0.options = v.into();
5498            self
5499        }
5500
5501        /// Sends the request.
5502        pub async fn send(self) -> Result<crate::model::InstanceGroup> {
5503            (*self.0.stub)
5504                .get(self.0.request, self.0.options)
5505                .await
5506                .map(gax::response::Response::into_body)
5507        }
5508
5509        /// Sets the value of [instance_group][crate::model::instance_groups::GetRequest::instance_group].
5510        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5511            self.0.request.instance_group = v.into();
5512            self
5513        }
5514
5515        /// Sets the value of [project][crate::model::instance_groups::GetRequest::project].
5516        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5517            self.0.request.project = v.into();
5518            self
5519        }
5520
5521        /// Sets the value of [zone][crate::model::instance_groups::GetRequest::zone].
5522        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5523            self.0.request.zone = v.into();
5524            self
5525        }
5526    }
5527
5528    #[doc(hidden)]
5529    impl gax::options::internal::RequestBuilder for Get {
5530        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5531            &mut self.0.options
5532        }
5533    }
5534
5535    /// The request builder for [InstanceGroups::insert][crate::client::InstanceGroups::insert] calls.
5536    ///
5537    /// # Example
5538    /// ```no_run
5539    /// # use google_cloud_compute_v1::builder;
5540    /// use builder::instance_groups::Insert;
5541    /// # tokio_test::block_on(async {
5542    ///
5543    /// let builder = prepare_request_builder();
5544    /// let response = builder.send().await?;
5545    /// # gax::Result::<()>::Ok(()) });
5546    ///
5547    /// fn prepare_request_builder() -> Insert {
5548    ///   # panic!();
5549    ///   // ... details omitted ...
5550    /// }
5551    /// ```
5552    #[derive(Clone, Debug)]
5553    pub struct Insert(RequestBuilder<crate::model::instance_groups::InsertRequest>);
5554
5555    impl Insert {
5556        pub(crate) fn new(
5557            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5558        ) -> Self {
5559            Self(RequestBuilder::new(stub))
5560        }
5561
5562        /// Sets the full request, replacing any prior values.
5563        pub fn with_request<V: Into<crate::model::instance_groups::InsertRequest>>(
5564            mut self,
5565            v: V,
5566        ) -> Self {
5567            self.0.request = v.into();
5568            self
5569        }
5570
5571        /// Sets all the options, replacing any prior values.
5572        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5573            self.0.options = v.into();
5574            self
5575        }
5576
5577        /// Sends the request.
5578        pub async fn send(self) -> Result<crate::model::Operation> {
5579            (*self.0.stub)
5580                .insert(self.0.request, self.0.options)
5581                .await
5582                .map(gax::response::Response::into_body)
5583        }
5584
5585        /// Sets the value of [project][crate::model::instance_groups::InsertRequest::project].
5586        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587            self.0.request.project = v.into();
5588            self
5589        }
5590
5591        /// Sets the value of [request_id][crate::model::instance_groups::InsertRequest::request_id].
5592        pub fn set_request_id<T>(mut self, v: T) -> Self
5593        where
5594            T: std::convert::Into<std::string::String>,
5595        {
5596            self.0.request.request_id = std::option::Option::Some(v.into());
5597            self
5598        }
5599
5600        /// Sets or clears the value of [request_id][crate::model::instance_groups::InsertRequest::request_id].
5601        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5602        where
5603            T: std::convert::Into<std::string::String>,
5604        {
5605            self.0.request.request_id = v.map(|x| x.into());
5606            self
5607        }
5608
5609        /// Sets the value of [zone][crate::model::instance_groups::InsertRequest::zone].
5610        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5611            self.0.request.zone = v.into();
5612            self
5613        }
5614
5615        /// Sets the value of [body][crate::model::instance_groups::InsertRequest::body].
5616        pub fn set_body<T>(mut self, v: T) -> Self
5617        where
5618            T: std::convert::Into<crate::model::InstanceGroup>,
5619        {
5620            self.0.request.body = std::option::Option::Some(v.into());
5621            self
5622        }
5623
5624        /// Sets or clears the value of [body][crate::model::instance_groups::InsertRequest::body].
5625        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5626        where
5627            T: std::convert::Into<crate::model::InstanceGroup>,
5628        {
5629            self.0.request.body = v.map(|x| x.into());
5630            self
5631        }
5632    }
5633
5634    #[doc(hidden)]
5635    impl gax::options::internal::RequestBuilder for Insert {
5636        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5637            &mut self.0.options
5638        }
5639    }
5640
5641    /// The request builder for [InstanceGroups::list][crate::client::InstanceGroups::list] calls.
5642    ///
5643    /// # Example
5644    /// ```no_run
5645    /// # use google_cloud_compute_v1::builder;
5646    /// use builder::instance_groups::List;
5647    /// # tokio_test::block_on(async {
5648    /// use gax::paginator::ItemPaginator;
5649    ///
5650    /// let builder = prepare_request_builder();
5651    /// let mut items = builder.by_item();
5652    /// while let Some(result) = items.next().await {
5653    ///   let item = result?;
5654    /// }
5655    /// # gax::Result::<()>::Ok(()) });
5656    ///
5657    /// fn prepare_request_builder() -> List {
5658    ///   # panic!();
5659    ///   // ... details omitted ...
5660    /// }
5661    /// ```
5662    #[derive(Clone, Debug)]
5663    pub struct List(RequestBuilder<crate::model::instance_groups::ListRequest>);
5664
5665    impl List {
5666        pub(crate) fn new(
5667            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5668        ) -> Self {
5669            Self(RequestBuilder::new(stub))
5670        }
5671
5672        /// Sets the full request, replacing any prior values.
5673        pub fn with_request<V: Into<crate::model::instance_groups::ListRequest>>(
5674            mut self,
5675            v: V,
5676        ) -> Self {
5677            self.0.request = v.into();
5678            self
5679        }
5680
5681        /// Sets all the options, replacing any prior values.
5682        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5683            self.0.options = v.into();
5684            self
5685        }
5686
5687        /// Sends the request.
5688        pub async fn send(self) -> Result<crate::model::InstanceGroupList> {
5689            (*self.0.stub)
5690                .list(self.0.request, self.0.options)
5691                .await
5692                .map(gax::response::Response::into_body)
5693        }
5694
5695        /// Streams each page in the collection.
5696        pub fn by_page(
5697            self,
5698        ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupList, gax::error::Error>
5699        {
5700            use std::clone::Clone;
5701            let token = self.0.request.page_token.clone().unwrap_or_default();
5702            let execute = move |token: String| {
5703                let mut builder = self.clone();
5704                builder.0.request = builder.0.request.set_page_token(token);
5705                builder.send()
5706            };
5707            gax::paginator::internal::new_paginator(token, execute)
5708        }
5709
5710        /// Streams each item in the collection.
5711        pub fn by_item(
5712            self,
5713        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceGroupList, gax::error::Error>
5714        {
5715            use gax::paginator::Paginator;
5716            self.by_page().items()
5717        }
5718
5719        /// Sets the value of [filter][crate::model::instance_groups::ListRequest::filter].
5720        pub fn set_filter<T>(mut self, v: T) -> Self
5721        where
5722            T: std::convert::Into<std::string::String>,
5723        {
5724            self.0.request.filter = std::option::Option::Some(v.into());
5725            self
5726        }
5727
5728        /// Sets or clears the value of [filter][crate::model::instance_groups::ListRequest::filter].
5729        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5730        where
5731            T: std::convert::Into<std::string::String>,
5732        {
5733            self.0.request.filter = v.map(|x| x.into());
5734            self
5735        }
5736
5737        /// Sets the value of [max_results][crate::model::instance_groups::ListRequest::max_results].
5738        pub fn set_max_results<T>(mut self, v: T) -> Self
5739        where
5740            T: std::convert::Into<u32>,
5741        {
5742            self.0.request.max_results = std::option::Option::Some(v.into());
5743            self
5744        }
5745
5746        /// Sets or clears the value of [max_results][crate::model::instance_groups::ListRequest::max_results].
5747        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5748        where
5749            T: std::convert::Into<u32>,
5750        {
5751            self.0.request.max_results = v.map(|x| x.into());
5752            self
5753        }
5754
5755        /// Sets the value of [order_by][crate::model::instance_groups::ListRequest::order_by].
5756        pub fn set_order_by<T>(mut self, v: T) -> Self
5757        where
5758            T: std::convert::Into<std::string::String>,
5759        {
5760            self.0.request.order_by = std::option::Option::Some(v.into());
5761            self
5762        }
5763
5764        /// Sets or clears the value of [order_by][crate::model::instance_groups::ListRequest::order_by].
5765        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5766        where
5767            T: std::convert::Into<std::string::String>,
5768        {
5769            self.0.request.order_by = v.map(|x| x.into());
5770            self
5771        }
5772
5773        /// Sets the value of [page_token][crate::model::instance_groups::ListRequest::page_token].
5774        pub fn set_page_token<T>(mut self, v: T) -> Self
5775        where
5776            T: std::convert::Into<std::string::String>,
5777        {
5778            self.0.request.page_token = std::option::Option::Some(v.into());
5779            self
5780        }
5781
5782        /// Sets or clears the value of [page_token][crate::model::instance_groups::ListRequest::page_token].
5783        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5784        where
5785            T: std::convert::Into<std::string::String>,
5786        {
5787            self.0.request.page_token = v.map(|x| x.into());
5788            self
5789        }
5790
5791        /// Sets the value of [project][crate::model::instance_groups::ListRequest::project].
5792        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5793            self.0.request.project = v.into();
5794            self
5795        }
5796
5797        /// Sets the value of [return_partial_success][crate::model::instance_groups::ListRequest::return_partial_success].
5798        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5799        where
5800            T: std::convert::Into<bool>,
5801        {
5802            self.0.request.return_partial_success = std::option::Option::Some(v.into());
5803            self
5804        }
5805
5806        /// Sets or clears the value of [return_partial_success][crate::model::instance_groups::ListRequest::return_partial_success].
5807        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
5808        where
5809            T: std::convert::Into<bool>,
5810        {
5811            self.0.request.return_partial_success = v.map(|x| x.into());
5812            self
5813        }
5814
5815        /// Sets the value of [zone][crate::model::instance_groups::ListRequest::zone].
5816        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5817            self.0.request.zone = v.into();
5818            self
5819        }
5820    }
5821
5822    #[doc(hidden)]
5823    impl gax::options::internal::RequestBuilder for List {
5824        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5825            &mut self.0.options
5826        }
5827    }
5828
5829    /// The request builder for [InstanceGroups::list_instances][crate::client::InstanceGroups::list_instances] calls.
5830    ///
5831    /// # Example
5832    /// ```no_run
5833    /// # use google_cloud_compute_v1::builder;
5834    /// use builder::instance_groups::ListInstances;
5835    /// # tokio_test::block_on(async {
5836    /// use gax::paginator::ItemPaginator;
5837    ///
5838    /// let builder = prepare_request_builder();
5839    /// let mut items = builder.by_item();
5840    /// while let Some(result) = items.next().await {
5841    ///   let item = result?;
5842    /// }
5843    /// # gax::Result::<()>::Ok(()) });
5844    ///
5845    /// fn prepare_request_builder() -> ListInstances {
5846    ///   # panic!();
5847    ///   // ... details omitted ...
5848    /// }
5849    /// ```
5850    #[derive(Clone, Debug)]
5851    pub struct ListInstances(RequestBuilder<crate::model::instance_groups::ListInstancesRequest>);
5852
5853    impl ListInstances {
5854        pub(crate) fn new(
5855            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5856        ) -> Self {
5857            Self(RequestBuilder::new(stub))
5858        }
5859
5860        /// Sets the full request, replacing any prior values.
5861        pub fn with_request<V: Into<crate::model::instance_groups::ListInstancesRequest>>(
5862            mut self,
5863            v: V,
5864        ) -> Self {
5865            self.0.request = v.into();
5866            self
5867        }
5868
5869        /// Sets all the options, replacing any prior values.
5870        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5871            self.0.options = v.into();
5872            self
5873        }
5874
5875        /// Sends the request.
5876        pub async fn send(self) -> Result<crate::model::InstanceGroupsListInstances> {
5877            (*self.0.stub)
5878                .list_instances(self.0.request, self.0.options)
5879                .await
5880                .map(gax::response::Response::into_body)
5881        }
5882
5883        /// Streams each page in the collection.
5884        pub fn by_page(
5885            self,
5886        ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupsListInstances, gax::error::Error>
5887        {
5888            use std::clone::Clone;
5889            let token = self.0.request.page_token.clone().unwrap_or_default();
5890            let execute = move |token: String| {
5891                let mut builder = self.clone();
5892                builder.0.request = builder.0.request.set_page_token(token);
5893                builder.send()
5894            };
5895            gax::paginator::internal::new_paginator(token, execute)
5896        }
5897
5898        /// Streams each item in the collection.
5899        pub fn by_item(
5900            self,
5901        ) -> impl gax::paginator::ItemPaginator<
5902            crate::model::InstanceGroupsListInstances,
5903            gax::error::Error,
5904        > {
5905            use gax::paginator::Paginator;
5906            self.by_page().items()
5907        }
5908
5909        /// Sets the value of [filter][crate::model::instance_groups::ListInstancesRequest::filter].
5910        pub fn set_filter<T>(mut self, v: T) -> Self
5911        where
5912            T: std::convert::Into<std::string::String>,
5913        {
5914            self.0.request.filter = std::option::Option::Some(v.into());
5915            self
5916        }
5917
5918        /// Sets or clears the value of [filter][crate::model::instance_groups::ListInstancesRequest::filter].
5919        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5920        where
5921            T: std::convert::Into<std::string::String>,
5922        {
5923            self.0.request.filter = v.map(|x| x.into());
5924            self
5925        }
5926
5927        /// Sets the value of [instance_group][crate::model::instance_groups::ListInstancesRequest::instance_group].
5928        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5929            self.0.request.instance_group = v.into();
5930            self
5931        }
5932
5933        /// Sets the value of [max_results][crate::model::instance_groups::ListInstancesRequest::max_results].
5934        pub fn set_max_results<T>(mut self, v: T) -> Self
5935        where
5936            T: std::convert::Into<u32>,
5937        {
5938            self.0.request.max_results = std::option::Option::Some(v.into());
5939            self
5940        }
5941
5942        /// Sets or clears the value of [max_results][crate::model::instance_groups::ListInstancesRequest::max_results].
5943        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5944        where
5945            T: std::convert::Into<u32>,
5946        {
5947            self.0.request.max_results = v.map(|x| x.into());
5948            self
5949        }
5950
5951        /// Sets the value of [order_by][crate::model::instance_groups::ListInstancesRequest::order_by].
5952        pub fn set_order_by<T>(mut self, v: T) -> Self
5953        where
5954            T: std::convert::Into<std::string::String>,
5955        {
5956            self.0.request.order_by = std::option::Option::Some(v.into());
5957            self
5958        }
5959
5960        /// Sets or clears the value of [order_by][crate::model::instance_groups::ListInstancesRequest::order_by].
5961        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5962        where
5963            T: std::convert::Into<std::string::String>,
5964        {
5965            self.0.request.order_by = v.map(|x| x.into());
5966            self
5967        }
5968
5969        /// Sets the value of [page_token][crate::model::instance_groups::ListInstancesRequest::page_token].
5970        pub fn set_page_token<T>(mut self, v: T) -> Self
5971        where
5972            T: std::convert::Into<std::string::String>,
5973        {
5974            self.0.request.page_token = std::option::Option::Some(v.into());
5975            self
5976        }
5977
5978        /// Sets or clears the value of [page_token][crate::model::instance_groups::ListInstancesRequest::page_token].
5979        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5980        where
5981            T: std::convert::Into<std::string::String>,
5982        {
5983            self.0.request.page_token = v.map(|x| x.into());
5984            self
5985        }
5986
5987        /// Sets the value of [project][crate::model::instance_groups::ListInstancesRequest::project].
5988        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5989            self.0.request.project = v.into();
5990            self
5991        }
5992
5993        /// Sets the value of [return_partial_success][crate::model::instance_groups::ListInstancesRequest::return_partial_success].
5994        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5995        where
5996            T: std::convert::Into<bool>,
5997        {
5998            self.0.request.return_partial_success = std::option::Option::Some(v.into());
5999            self
6000        }
6001
6002        /// Sets or clears the value of [return_partial_success][crate::model::instance_groups::ListInstancesRequest::return_partial_success].
6003        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
6004        where
6005            T: std::convert::Into<bool>,
6006        {
6007            self.0.request.return_partial_success = v.map(|x| x.into());
6008            self
6009        }
6010
6011        /// Sets the value of [zone][crate::model::instance_groups::ListInstancesRequest::zone].
6012        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013            self.0.request.zone = v.into();
6014            self
6015        }
6016
6017        /// Sets the value of [body][crate::model::instance_groups::ListInstancesRequest::body].
6018        pub fn set_body<T>(mut self, v: T) -> Self
6019        where
6020            T: std::convert::Into<crate::model::InstanceGroupsListInstancesRequest>,
6021        {
6022            self.0.request.body = std::option::Option::Some(v.into());
6023            self
6024        }
6025
6026        /// Sets or clears the value of [body][crate::model::instance_groups::ListInstancesRequest::body].
6027        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6028        where
6029            T: std::convert::Into<crate::model::InstanceGroupsListInstancesRequest>,
6030        {
6031            self.0.request.body = v.map(|x| x.into());
6032            self
6033        }
6034    }
6035
6036    #[doc(hidden)]
6037    impl gax::options::internal::RequestBuilder for ListInstances {
6038        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6039            &mut self.0.options
6040        }
6041    }
6042
6043    /// The request builder for [InstanceGroups::remove_instances][crate::client::InstanceGroups::remove_instances] calls.
6044    ///
6045    /// # Example
6046    /// ```no_run
6047    /// # use google_cloud_compute_v1::builder;
6048    /// use builder::instance_groups::RemoveInstances;
6049    /// # tokio_test::block_on(async {
6050    ///
6051    /// let builder = prepare_request_builder();
6052    /// let response = builder.send().await?;
6053    /// # gax::Result::<()>::Ok(()) });
6054    ///
6055    /// fn prepare_request_builder() -> RemoveInstances {
6056    ///   # panic!();
6057    ///   // ... details omitted ...
6058    /// }
6059    /// ```
6060    #[derive(Clone, Debug)]
6061    pub struct RemoveInstances(
6062        RequestBuilder<crate::model::instance_groups::RemoveInstancesRequest>,
6063    );
6064
6065    impl RemoveInstances {
6066        pub(crate) fn new(
6067            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6068        ) -> Self {
6069            Self(RequestBuilder::new(stub))
6070        }
6071
6072        /// Sets the full request, replacing any prior values.
6073        pub fn with_request<V: Into<crate::model::instance_groups::RemoveInstancesRequest>>(
6074            mut self,
6075            v: V,
6076        ) -> Self {
6077            self.0.request = v.into();
6078            self
6079        }
6080
6081        /// Sets all the options, replacing any prior values.
6082        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6083            self.0.options = v.into();
6084            self
6085        }
6086
6087        /// Sends the request.
6088        pub async fn send(self) -> Result<crate::model::Operation> {
6089            (*self.0.stub)
6090                .remove_instances(self.0.request, self.0.options)
6091                .await
6092                .map(gax::response::Response::into_body)
6093        }
6094
6095        /// Sets the value of [instance_group][crate::model::instance_groups::RemoveInstancesRequest::instance_group].
6096        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
6097            self.0.request.instance_group = v.into();
6098            self
6099        }
6100
6101        /// Sets the value of [project][crate::model::instance_groups::RemoveInstancesRequest::project].
6102        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6103            self.0.request.project = v.into();
6104            self
6105        }
6106
6107        /// Sets the value of [request_id][crate::model::instance_groups::RemoveInstancesRequest::request_id].
6108        pub fn set_request_id<T>(mut self, v: T) -> Self
6109        where
6110            T: std::convert::Into<std::string::String>,
6111        {
6112            self.0.request.request_id = std::option::Option::Some(v.into());
6113            self
6114        }
6115
6116        /// Sets or clears the value of [request_id][crate::model::instance_groups::RemoveInstancesRequest::request_id].
6117        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6118        where
6119            T: std::convert::Into<std::string::String>,
6120        {
6121            self.0.request.request_id = v.map(|x| x.into());
6122            self
6123        }
6124
6125        /// Sets the value of [zone][crate::model::instance_groups::RemoveInstancesRequest::zone].
6126        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127            self.0.request.zone = v.into();
6128            self
6129        }
6130
6131        /// Sets the value of [body][crate::model::instance_groups::RemoveInstancesRequest::body].
6132        pub fn set_body<T>(mut self, v: T) -> Self
6133        where
6134            T: std::convert::Into<crate::model::InstanceGroupsRemoveInstancesRequest>,
6135        {
6136            self.0.request.body = std::option::Option::Some(v.into());
6137            self
6138        }
6139
6140        /// Sets or clears the value of [body][crate::model::instance_groups::RemoveInstancesRequest::body].
6141        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6142        where
6143            T: std::convert::Into<crate::model::InstanceGroupsRemoveInstancesRequest>,
6144        {
6145            self.0.request.body = v.map(|x| x.into());
6146            self
6147        }
6148    }
6149
6150    #[doc(hidden)]
6151    impl gax::options::internal::RequestBuilder for RemoveInstances {
6152        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6153            &mut self.0.options
6154        }
6155    }
6156
6157    /// The request builder for [InstanceGroups::set_named_ports][crate::client::InstanceGroups::set_named_ports] calls.
6158    ///
6159    /// # Example
6160    /// ```no_run
6161    /// # use google_cloud_compute_v1::builder;
6162    /// use builder::instance_groups::SetNamedPorts;
6163    /// # tokio_test::block_on(async {
6164    ///
6165    /// let builder = prepare_request_builder();
6166    /// let response = builder.send().await?;
6167    /// # gax::Result::<()>::Ok(()) });
6168    ///
6169    /// fn prepare_request_builder() -> SetNamedPorts {
6170    ///   # panic!();
6171    ///   // ... details omitted ...
6172    /// }
6173    /// ```
6174    #[derive(Clone, Debug)]
6175    pub struct SetNamedPorts(RequestBuilder<crate::model::instance_groups::SetNamedPortsRequest>);
6176
6177    impl SetNamedPorts {
6178        pub(crate) fn new(
6179            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6180        ) -> Self {
6181            Self(RequestBuilder::new(stub))
6182        }
6183
6184        /// Sets the full request, replacing any prior values.
6185        pub fn with_request<V: Into<crate::model::instance_groups::SetNamedPortsRequest>>(
6186            mut self,
6187            v: V,
6188        ) -> Self {
6189            self.0.request = v.into();
6190            self
6191        }
6192
6193        /// Sets all the options, replacing any prior values.
6194        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6195            self.0.options = v.into();
6196            self
6197        }
6198
6199        /// Sends the request.
6200        pub async fn send(self) -> Result<crate::model::Operation> {
6201            (*self.0.stub)
6202                .set_named_ports(self.0.request, self.0.options)
6203                .await
6204                .map(gax::response::Response::into_body)
6205        }
6206
6207        /// Sets the value of [instance_group][crate::model::instance_groups::SetNamedPortsRequest::instance_group].
6208        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209            self.0.request.instance_group = v.into();
6210            self
6211        }
6212
6213        /// Sets the value of [project][crate::model::instance_groups::SetNamedPortsRequest::project].
6214        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6215            self.0.request.project = v.into();
6216            self
6217        }
6218
6219        /// Sets the value of [request_id][crate::model::instance_groups::SetNamedPortsRequest::request_id].
6220        pub fn set_request_id<T>(mut self, v: T) -> Self
6221        where
6222            T: std::convert::Into<std::string::String>,
6223        {
6224            self.0.request.request_id = std::option::Option::Some(v.into());
6225            self
6226        }
6227
6228        /// Sets or clears the value of [request_id][crate::model::instance_groups::SetNamedPortsRequest::request_id].
6229        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6230        where
6231            T: std::convert::Into<std::string::String>,
6232        {
6233            self.0.request.request_id = v.map(|x| x.into());
6234            self
6235        }
6236
6237        /// Sets the value of [zone][crate::model::instance_groups::SetNamedPortsRequest::zone].
6238        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6239            self.0.request.zone = v.into();
6240            self
6241        }
6242
6243        /// Sets the value of [body][crate::model::instance_groups::SetNamedPortsRequest::body].
6244        pub fn set_body<T>(mut self, v: T) -> Self
6245        where
6246            T: std::convert::Into<crate::model::InstanceGroupsSetNamedPortsRequest>,
6247        {
6248            self.0.request.body = std::option::Option::Some(v.into());
6249            self
6250        }
6251
6252        /// Sets or clears the value of [body][crate::model::instance_groups::SetNamedPortsRequest::body].
6253        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6254        where
6255            T: std::convert::Into<crate::model::InstanceGroupsSetNamedPortsRequest>,
6256        {
6257            self.0.request.body = v.map(|x| x.into());
6258            self
6259        }
6260    }
6261
6262    #[doc(hidden)]
6263    impl gax::options::internal::RequestBuilder for SetNamedPorts {
6264        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6265            &mut self.0.options
6266        }
6267    }
6268
6269    /// The request builder for [InstanceGroups::test_iam_permissions][crate::client::InstanceGroups::test_iam_permissions] calls.
6270    ///
6271    /// # Example
6272    /// ```no_run
6273    /// # use google_cloud_compute_v1::builder;
6274    /// use builder::instance_groups::TestIamPermissions;
6275    /// # tokio_test::block_on(async {
6276    ///
6277    /// let builder = prepare_request_builder();
6278    /// let response = builder.send().await?;
6279    /// # gax::Result::<()>::Ok(()) });
6280    ///
6281    /// fn prepare_request_builder() -> TestIamPermissions {
6282    ///   # panic!();
6283    ///   // ... details omitted ...
6284    /// }
6285    /// ```
6286    #[derive(Clone, Debug)]
6287    pub struct TestIamPermissions(
6288        RequestBuilder<crate::model::instance_groups::TestIamPermissionsRequest>,
6289    );
6290
6291    impl TestIamPermissions {
6292        pub(crate) fn new(
6293            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6294        ) -> Self {
6295            Self(RequestBuilder::new(stub))
6296        }
6297
6298        /// Sets the full request, replacing any prior values.
6299        pub fn with_request<V: Into<crate::model::instance_groups::TestIamPermissionsRequest>>(
6300            mut self,
6301            v: V,
6302        ) -> Self {
6303            self.0.request = v.into();
6304            self
6305        }
6306
6307        /// Sets all the options, replacing any prior values.
6308        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6309            self.0.options = v.into();
6310            self
6311        }
6312
6313        /// Sends the request.
6314        pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
6315            (*self.0.stub)
6316                .test_iam_permissions(self.0.request, self.0.options)
6317                .await
6318                .map(gax::response::Response::into_body)
6319        }
6320
6321        /// Sets the value of [project][crate::model::instance_groups::TestIamPermissionsRequest::project].
6322        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6323            self.0.request.project = v.into();
6324            self
6325        }
6326
6327        /// Sets the value of [resource][crate::model::instance_groups::TestIamPermissionsRequest::resource].
6328        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6329            self.0.request.resource = v.into();
6330            self
6331        }
6332
6333        /// Sets the value of [zone][crate::model::instance_groups::TestIamPermissionsRequest::zone].
6334        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6335            self.0.request.zone = v.into();
6336            self
6337        }
6338
6339        /// Sets the value of [body][crate::model::instance_groups::TestIamPermissionsRequest::body].
6340        pub fn set_body<T>(mut self, v: T) -> Self
6341        where
6342            T: std::convert::Into<crate::model::TestPermissionsRequest>,
6343        {
6344            self.0.request.body = std::option::Option::Some(v.into());
6345            self
6346        }
6347
6348        /// Sets or clears the value of [body][crate::model::instance_groups::TestIamPermissionsRequest::body].
6349        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6350        where
6351            T: std::convert::Into<crate::model::TestPermissionsRequest>,
6352        {
6353            self.0.request.body = v.map(|x| x.into());
6354            self
6355        }
6356    }
6357
6358    #[doc(hidden)]
6359    impl gax::options::internal::RequestBuilder for TestIamPermissions {
6360        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6361            &mut self.0.options
6362        }
6363    }
6364}
6365
6366#[cfg(feature = "instances")]
6367#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
6368pub mod instances {
6369    use crate::Result;
6370
6371    /// A builder for [Instances][crate::client::Instances].
6372    ///
6373    /// ```
6374    /// # tokio_test::block_on(async {
6375    /// # use google_cloud_compute_v1::*;
6376    /// # use builder::instances::ClientBuilder;
6377    /// # use client::Instances;
6378    /// let builder : ClientBuilder = Instances::builder();
6379    /// let client = builder
6380    ///     .with_endpoint("https://compute.googleapis.com")
6381    ///     .build().await?;
6382    /// # gax::client_builder::Result::<()>::Ok(()) });
6383    /// ```
6384    pub type ClientBuilder =
6385        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6386
6387    pub(crate) mod client {
6388        use super::super::super::client::Instances;
6389        pub struct Factory;
6390        impl gax::client_builder::internal::ClientFactory for Factory {
6391            type Client = Instances;
6392            type Credentials = gaxi::options::Credentials;
6393            async fn build(
6394                self,
6395                config: gaxi::options::ClientConfig,
6396            ) -> gax::client_builder::Result<Self::Client> {
6397                Self::Client::new(config).await
6398            }
6399        }
6400    }
6401
6402    /// Common implementation for [crate::client::Instances] request builders.
6403    #[derive(Clone, Debug)]
6404    pub(crate) struct RequestBuilder<R: std::default::Default> {
6405        stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6406        request: R,
6407        options: gax::options::RequestOptions,
6408    }
6409
6410    impl<R> RequestBuilder<R>
6411    where
6412        R: std::default::Default,
6413    {
6414        pub(crate) fn new(
6415            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6416        ) -> Self {
6417            Self {
6418                stub,
6419                request: R::default(),
6420                options: gax::options::RequestOptions::default(),
6421            }
6422        }
6423    }
6424
6425    /// The request builder for [Instances::add_access_config][crate::client::Instances::add_access_config] calls.
6426    ///
6427    /// # Example
6428    /// ```no_run
6429    /// # use google_cloud_compute_v1::builder;
6430    /// use builder::instances::AddAccessConfig;
6431    /// # tokio_test::block_on(async {
6432    ///
6433    /// let builder = prepare_request_builder();
6434    /// let response = builder.send().await?;
6435    /// # gax::Result::<()>::Ok(()) });
6436    ///
6437    /// fn prepare_request_builder() -> AddAccessConfig {
6438    ///   # panic!();
6439    ///   // ... details omitted ...
6440    /// }
6441    /// ```
6442    #[derive(Clone, Debug)]
6443    pub struct AddAccessConfig(RequestBuilder<crate::model::instances::AddAccessConfigRequest>);
6444
6445    impl AddAccessConfig {
6446        pub(crate) fn new(
6447            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6448        ) -> Self {
6449            Self(RequestBuilder::new(stub))
6450        }
6451
6452        /// Sets the full request, replacing any prior values.
6453        pub fn with_request<V: Into<crate::model::instances::AddAccessConfigRequest>>(
6454            mut self,
6455            v: V,
6456        ) -> Self {
6457            self.0.request = v.into();
6458            self
6459        }
6460
6461        /// Sets all the options, replacing any prior values.
6462        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6463            self.0.options = v.into();
6464            self
6465        }
6466
6467        /// Sends the request.
6468        pub async fn send(self) -> Result<crate::model::Operation> {
6469            (*self.0.stub)
6470                .add_access_config(self.0.request, self.0.options)
6471                .await
6472                .map(gax::response::Response::into_body)
6473        }
6474
6475        /// Sets the value of [instance][crate::model::instances::AddAccessConfigRequest::instance].
6476        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477            self.0.request.instance = v.into();
6478            self
6479        }
6480
6481        /// Sets the value of [network_interface][crate::model::instances::AddAccessConfigRequest::network_interface].
6482        pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
6483            self.0.request.network_interface = v.into();
6484            self
6485        }
6486
6487        /// Sets the value of [project][crate::model::instances::AddAccessConfigRequest::project].
6488        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6489            self.0.request.project = v.into();
6490            self
6491        }
6492
6493        /// Sets the value of [request_id][crate::model::instances::AddAccessConfigRequest::request_id].
6494        pub fn set_request_id<T>(mut self, v: T) -> Self
6495        where
6496            T: std::convert::Into<std::string::String>,
6497        {
6498            self.0.request.request_id = std::option::Option::Some(v.into());
6499            self
6500        }
6501
6502        /// Sets or clears the value of [request_id][crate::model::instances::AddAccessConfigRequest::request_id].
6503        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6504        where
6505            T: std::convert::Into<std::string::String>,
6506        {
6507            self.0.request.request_id = v.map(|x| x.into());
6508            self
6509        }
6510
6511        /// Sets the value of [zone][crate::model::instances::AddAccessConfigRequest::zone].
6512        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6513            self.0.request.zone = v.into();
6514            self
6515        }
6516
6517        /// Sets the value of [body][crate::model::instances::AddAccessConfigRequest::body].
6518        pub fn set_body<T>(mut self, v: T) -> Self
6519        where
6520            T: std::convert::Into<crate::model::AccessConfig>,
6521        {
6522            self.0.request.body = std::option::Option::Some(v.into());
6523            self
6524        }
6525
6526        /// Sets or clears the value of [body][crate::model::instances::AddAccessConfigRequest::body].
6527        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6528        where
6529            T: std::convert::Into<crate::model::AccessConfig>,
6530        {
6531            self.0.request.body = v.map(|x| x.into());
6532            self
6533        }
6534    }
6535
6536    #[doc(hidden)]
6537    impl gax::options::internal::RequestBuilder for AddAccessConfig {
6538        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6539            &mut self.0.options
6540        }
6541    }
6542
6543    /// The request builder for [Instances::add_network_interface][crate::client::Instances::add_network_interface] calls.
6544    ///
6545    /// # Example
6546    /// ```no_run
6547    /// # use google_cloud_compute_v1::builder;
6548    /// use builder::instances::AddNetworkInterface;
6549    /// # tokio_test::block_on(async {
6550    ///
6551    /// let builder = prepare_request_builder();
6552    /// let response = builder.send().await?;
6553    /// # gax::Result::<()>::Ok(()) });
6554    ///
6555    /// fn prepare_request_builder() -> AddNetworkInterface {
6556    ///   # panic!();
6557    ///   // ... details omitted ...
6558    /// }
6559    /// ```
6560    #[derive(Clone, Debug)]
6561    pub struct AddNetworkInterface(
6562        RequestBuilder<crate::model::instances::AddNetworkInterfaceRequest>,
6563    );
6564
6565    impl AddNetworkInterface {
6566        pub(crate) fn new(
6567            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6568        ) -> Self {
6569            Self(RequestBuilder::new(stub))
6570        }
6571
6572        /// Sets the full request, replacing any prior values.
6573        pub fn with_request<V: Into<crate::model::instances::AddNetworkInterfaceRequest>>(
6574            mut self,
6575            v: V,
6576        ) -> Self {
6577            self.0.request = v.into();
6578            self
6579        }
6580
6581        /// Sets all the options, replacing any prior values.
6582        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6583            self.0.options = v.into();
6584            self
6585        }
6586
6587        /// Sends the request.
6588        pub async fn send(self) -> Result<crate::model::Operation> {
6589            (*self.0.stub)
6590                .add_network_interface(self.0.request, self.0.options)
6591                .await
6592                .map(gax::response::Response::into_body)
6593        }
6594
6595        /// Sets the value of [instance][crate::model::instances::AddNetworkInterfaceRequest::instance].
6596        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6597            self.0.request.instance = v.into();
6598            self
6599        }
6600
6601        /// Sets the value of [project][crate::model::instances::AddNetworkInterfaceRequest::project].
6602        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6603            self.0.request.project = v.into();
6604            self
6605        }
6606
6607        /// Sets the value of [request_id][crate::model::instances::AddNetworkInterfaceRequest::request_id].
6608        pub fn set_request_id<T>(mut self, v: T) -> Self
6609        where
6610            T: std::convert::Into<std::string::String>,
6611        {
6612            self.0.request.request_id = std::option::Option::Some(v.into());
6613            self
6614        }
6615
6616        /// Sets or clears the value of [request_id][crate::model::instances::AddNetworkInterfaceRequest::request_id].
6617        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6618        where
6619            T: std::convert::Into<std::string::String>,
6620        {
6621            self.0.request.request_id = v.map(|x| x.into());
6622            self
6623        }
6624
6625        /// Sets the value of [zone][crate::model::instances::AddNetworkInterfaceRequest::zone].
6626        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627            self.0.request.zone = v.into();
6628            self
6629        }
6630
6631        /// Sets the value of [body][crate::model::instances::AddNetworkInterfaceRequest::body].
6632        pub fn set_body<T>(mut self, v: T) -> Self
6633        where
6634            T: std::convert::Into<crate::model::NetworkInterface>,
6635        {
6636            self.0.request.body = std::option::Option::Some(v.into());
6637            self
6638        }
6639
6640        /// Sets or clears the value of [body][crate::model::instances::AddNetworkInterfaceRequest::body].
6641        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6642        where
6643            T: std::convert::Into<crate::model::NetworkInterface>,
6644        {
6645            self.0.request.body = v.map(|x| x.into());
6646            self
6647        }
6648    }
6649
6650    #[doc(hidden)]
6651    impl gax::options::internal::RequestBuilder for AddNetworkInterface {
6652        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6653            &mut self.0.options
6654        }
6655    }
6656
6657    /// The request builder for [Instances::add_resource_policies][crate::client::Instances::add_resource_policies] calls.
6658    ///
6659    /// # Example
6660    /// ```no_run
6661    /// # use google_cloud_compute_v1::builder;
6662    /// use builder::instances::AddResourcePolicies;
6663    /// # tokio_test::block_on(async {
6664    ///
6665    /// let builder = prepare_request_builder();
6666    /// let response = builder.send().await?;
6667    /// # gax::Result::<()>::Ok(()) });
6668    ///
6669    /// fn prepare_request_builder() -> AddResourcePolicies {
6670    ///   # panic!();
6671    ///   // ... details omitted ...
6672    /// }
6673    /// ```
6674    #[derive(Clone, Debug)]
6675    pub struct AddResourcePolicies(
6676        RequestBuilder<crate::model::instances::AddResourcePoliciesRequest>,
6677    );
6678
6679    impl AddResourcePolicies {
6680        pub(crate) fn new(
6681            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6682        ) -> Self {
6683            Self(RequestBuilder::new(stub))
6684        }
6685
6686        /// Sets the full request, replacing any prior values.
6687        pub fn with_request<V: Into<crate::model::instances::AddResourcePoliciesRequest>>(
6688            mut self,
6689            v: V,
6690        ) -> Self {
6691            self.0.request = v.into();
6692            self
6693        }
6694
6695        /// Sets all the options, replacing any prior values.
6696        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6697            self.0.options = v.into();
6698            self
6699        }
6700
6701        /// Sends the request.
6702        pub async fn send(self) -> Result<crate::model::Operation> {
6703            (*self.0.stub)
6704                .add_resource_policies(self.0.request, self.0.options)
6705                .await
6706                .map(gax::response::Response::into_body)
6707        }
6708
6709        /// Sets the value of [instance][crate::model::instances::AddResourcePoliciesRequest::instance].
6710        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6711            self.0.request.instance = v.into();
6712            self
6713        }
6714
6715        /// Sets the value of [project][crate::model::instances::AddResourcePoliciesRequest::project].
6716        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6717            self.0.request.project = v.into();
6718            self
6719        }
6720
6721        /// Sets the value of [request_id][crate::model::instances::AddResourcePoliciesRequest::request_id].
6722        pub fn set_request_id<T>(mut self, v: T) -> Self
6723        where
6724            T: std::convert::Into<std::string::String>,
6725        {
6726            self.0.request.request_id = std::option::Option::Some(v.into());
6727            self
6728        }
6729
6730        /// Sets or clears the value of [request_id][crate::model::instances::AddResourcePoliciesRequest::request_id].
6731        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6732        where
6733            T: std::convert::Into<std::string::String>,
6734        {
6735            self.0.request.request_id = v.map(|x| x.into());
6736            self
6737        }
6738
6739        /// Sets the value of [zone][crate::model::instances::AddResourcePoliciesRequest::zone].
6740        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6741            self.0.request.zone = v.into();
6742            self
6743        }
6744
6745        /// Sets the value of [body][crate::model::instances::AddResourcePoliciesRequest::body].
6746        pub fn set_body<T>(mut self, v: T) -> Self
6747        where
6748            T: std::convert::Into<crate::model::InstancesAddResourcePoliciesRequest>,
6749        {
6750            self.0.request.body = std::option::Option::Some(v.into());
6751            self
6752        }
6753
6754        /// Sets or clears the value of [body][crate::model::instances::AddResourcePoliciesRequest::body].
6755        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6756        where
6757            T: std::convert::Into<crate::model::InstancesAddResourcePoliciesRequest>,
6758        {
6759            self.0.request.body = v.map(|x| x.into());
6760            self
6761        }
6762    }
6763
6764    #[doc(hidden)]
6765    impl gax::options::internal::RequestBuilder for AddResourcePolicies {
6766        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6767            &mut self.0.options
6768        }
6769    }
6770
6771    /// The request builder for [Instances::aggregated_list][crate::client::Instances::aggregated_list] calls.
6772    ///
6773    /// # Example
6774    /// ```no_run
6775    /// # use google_cloud_compute_v1::builder;
6776    /// use builder::instances::AggregatedList;
6777    /// # tokio_test::block_on(async {
6778    /// use gax::paginator::ItemPaginator;
6779    ///
6780    /// let builder = prepare_request_builder();
6781    /// let mut items = builder.by_item();
6782    /// while let Some(result) = items.next().await {
6783    ///   let item = result?;
6784    /// }
6785    /// # gax::Result::<()>::Ok(()) });
6786    ///
6787    /// fn prepare_request_builder() -> AggregatedList {
6788    ///   # panic!();
6789    ///   // ... details omitted ...
6790    /// }
6791    /// ```
6792    #[derive(Clone, Debug)]
6793    pub struct AggregatedList(RequestBuilder<crate::model::instances::AggregatedListRequest>);
6794
6795    impl AggregatedList {
6796        pub(crate) fn new(
6797            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6798        ) -> Self {
6799            Self(RequestBuilder::new(stub))
6800        }
6801
6802        /// Sets the full request, replacing any prior values.
6803        pub fn with_request<V: Into<crate::model::instances::AggregatedListRequest>>(
6804            mut self,
6805            v: V,
6806        ) -> Self {
6807            self.0.request = v.into();
6808            self
6809        }
6810
6811        /// Sets all the options, replacing any prior values.
6812        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6813            self.0.options = v.into();
6814            self
6815        }
6816
6817        /// Sends the request.
6818        pub async fn send(self) -> Result<crate::model::InstanceAggregatedList> {
6819            (*self.0.stub)
6820                .aggregated_list(self.0.request, self.0.options)
6821                .await
6822                .map(gax::response::Response::into_body)
6823        }
6824
6825        /// Streams each page in the collection.
6826        pub fn by_page(
6827            self,
6828        ) -> impl gax::paginator::Paginator<crate::model::InstanceAggregatedList, gax::error::Error>
6829        {
6830            use std::clone::Clone;
6831            let token = self.0.request.page_token.clone().unwrap_or_default();
6832            let execute = move |token: String| {
6833                let mut builder = self.clone();
6834                builder.0.request = builder.0.request.set_page_token(token);
6835                builder.send()
6836            };
6837            gax::paginator::internal::new_paginator(token, execute)
6838        }
6839
6840        /// Streams each item in the collection.
6841        pub fn by_item(
6842            self,
6843        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceAggregatedList, gax::error::Error>
6844        {
6845            use gax::paginator::Paginator;
6846            self.by_page().items()
6847        }
6848
6849        /// Sets the value of [filter][crate::model::instances::AggregatedListRequest::filter].
6850        pub fn set_filter<T>(mut self, v: T) -> Self
6851        where
6852            T: std::convert::Into<std::string::String>,
6853        {
6854            self.0.request.filter = std::option::Option::Some(v.into());
6855            self
6856        }
6857
6858        /// Sets or clears the value of [filter][crate::model::instances::AggregatedListRequest::filter].
6859        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
6860        where
6861            T: std::convert::Into<std::string::String>,
6862        {
6863            self.0.request.filter = v.map(|x| x.into());
6864            self
6865        }
6866
6867        /// Sets the value of [include_all_scopes][crate::model::instances::AggregatedListRequest::include_all_scopes].
6868        pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
6869        where
6870            T: std::convert::Into<bool>,
6871        {
6872            self.0.request.include_all_scopes = std::option::Option::Some(v.into());
6873            self
6874        }
6875
6876        /// Sets or clears the value of [include_all_scopes][crate::model::instances::AggregatedListRequest::include_all_scopes].
6877        pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
6878        where
6879            T: std::convert::Into<bool>,
6880        {
6881            self.0.request.include_all_scopes = v.map(|x| x.into());
6882            self
6883        }
6884
6885        /// Sets the value of [max_results][crate::model::instances::AggregatedListRequest::max_results].
6886        pub fn set_max_results<T>(mut self, v: T) -> Self
6887        where
6888            T: std::convert::Into<u32>,
6889        {
6890            self.0.request.max_results = std::option::Option::Some(v.into());
6891            self
6892        }
6893
6894        /// Sets or clears the value of [max_results][crate::model::instances::AggregatedListRequest::max_results].
6895        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
6896        where
6897            T: std::convert::Into<u32>,
6898        {
6899            self.0.request.max_results = v.map(|x| x.into());
6900            self
6901        }
6902
6903        /// Sets the value of [order_by][crate::model::instances::AggregatedListRequest::order_by].
6904        pub fn set_order_by<T>(mut self, v: T) -> Self
6905        where
6906            T: std::convert::Into<std::string::String>,
6907        {
6908            self.0.request.order_by = std::option::Option::Some(v.into());
6909            self
6910        }
6911
6912        /// Sets or clears the value of [order_by][crate::model::instances::AggregatedListRequest::order_by].
6913        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
6914        where
6915            T: std::convert::Into<std::string::String>,
6916        {
6917            self.0.request.order_by = v.map(|x| x.into());
6918            self
6919        }
6920
6921        /// Sets the value of [page_token][crate::model::instances::AggregatedListRequest::page_token].
6922        pub fn set_page_token<T>(mut self, v: T) -> Self
6923        where
6924            T: std::convert::Into<std::string::String>,
6925        {
6926            self.0.request.page_token = std::option::Option::Some(v.into());
6927            self
6928        }
6929
6930        /// Sets or clears the value of [page_token][crate::model::instances::AggregatedListRequest::page_token].
6931        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
6932        where
6933            T: std::convert::Into<std::string::String>,
6934        {
6935            self.0.request.page_token = v.map(|x| x.into());
6936            self
6937        }
6938
6939        /// Sets the value of [project][crate::model::instances::AggregatedListRequest::project].
6940        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6941            self.0.request.project = v.into();
6942            self
6943        }
6944
6945        /// Sets the value of [return_partial_success][crate::model::instances::AggregatedListRequest::return_partial_success].
6946        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
6947        where
6948            T: std::convert::Into<bool>,
6949        {
6950            self.0.request.return_partial_success = std::option::Option::Some(v.into());
6951            self
6952        }
6953
6954        /// Sets or clears the value of [return_partial_success][crate::model::instances::AggregatedListRequest::return_partial_success].
6955        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
6956        where
6957            T: std::convert::Into<bool>,
6958        {
6959            self.0.request.return_partial_success = v.map(|x| x.into());
6960            self
6961        }
6962
6963        /// Sets the value of [service_project_number][crate::model::instances::AggregatedListRequest::service_project_number].
6964        pub fn set_service_project_number<T>(mut self, v: T) -> Self
6965        where
6966            T: std::convert::Into<i64>,
6967        {
6968            self.0.request.service_project_number = std::option::Option::Some(v.into());
6969            self
6970        }
6971
6972        /// Sets or clears the value of [service_project_number][crate::model::instances::AggregatedListRequest::service_project_number].
6973        pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
6974        where
6975            T: std::convert::Into<i64>,
6976        {
6977            self.0.request.service_project_number = v.map(|x| x.into());
6978            self
6979        }
6980    }
6981
6982    #[doc(hidden)]
6983    impl gax::options::internal::RequestBuilder for AggregatedList {
6984        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6985            &mut self.0.options
6986        }
6987    }
6988
6989    /// The request builder for [Instances::attach_disk][crate::client::Instances::attach_disk] calls.
6990    ///
6991    /// # Example
6992    /// ```no_run
6993    /// # use google_cloud_compute_v1::builder;
6994    /// use builder::instances::AttachDisk;
6995    /// # tokio_test::block_on(async {
6996    ///
6997    /// let builder = prepare_request_builder();
6998    /// let response = builder.send().await?;
6999    /// # gax::Result::<()>::Ok(()) });
7000    ///
7001    /// fn prepare_request_builder() -> AttachDisk {
7002    ///   # panic!();
7003    ///   // ... details omitted ...
7004    /// }
7005    /// ```
7006    #[derive(Clone, Debug)]
7007    pub struct AttachDisk(RequestBuilder<crate::model::instances::AttachDiskRequest>);
7008
7009    impl AttachDisk {
7010        pub(crate) fn new(
7011            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7012        ) -> Self {
7013            Self(RequestBuilder::new(stub))
7014        }
7015
7016        /// Sets the full request, replacing any prior values.
7017        pub fn with_request<V: Into<crate::model::instances::AttachDiskRequest>>(
7018            mut self,
7019            v: V,
7020        ) -> Self {
7021            self.0.request = v.into();
7022            self
7023        }
7024
7025        /// Sets all the options, replacing any prior values.
7026        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7027            self.0.options = v.into();
7028            self
7029        }
7030
7031        /// Sends the request.
7032        pub async fn send(self) -> Result<crate::model::Operation> {
7033            (*self.0.stub)
7034                .attach_disk(self.0.request, self.0.options)
7035                .await
7036                .map(gax::response::Response::into_body)
7037        }
7038
7039        /// Sets the value of [force_attach][crate::model::instances::AttachDiskRequest::force_attach].
7040        pub fn set_force_attach<T>(mut self, v: T) -> Self
7041        where
7042            T: std::convert::Into<bool>,
7043        {
7044            self.0.request.force_attach = std::option::Option::Some(v.into());
7045            self
7046        }
7047
7048        /// Sets or clears the value of [force_attach][crate::model::instances::AttachDiskRequest::force_attach].
7049        pub fn set_or_clear_force_attach<T>(mut self, v: std::option::Option<T>) -> Self
7050        where
7051            T: std::convert::Into<bool>,
7052        {
7053            self.0.request.force_attach = v.map(|x| x.into());
7054            self
7055        }
7056
7057        /// Sets the value of [instance][crate::model::instances::AttachDiskRequest::instance].
7058        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7059            self.0.request.instance = v.into();
7060            self
7061        }
7062
7063        /// Sets the value of [project][crate::model::instances::AttachDiskRequest::project].
7064        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7065            self.0.request.project = v.into();
7066            self
7067        }
7068
7069        /// Sets the value of [request_id][crate::model::instances::AttachDiskRequest::request_id].
7070        pub fn set_request_id<T>(mut self, v: T) -> Self
7071        where
7072            T: std::convert::Into<std::string::String>,
7073        {
7074            self.0.request.request_id = std::option::Option::Some(v.into());
7075            self
7076        }
7077
7078        /// Sets or clears the value of [request_id][crate::model::instances::AttachDiskRequest::request_id].
7079        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7080        where
7081            T: std::convert::Into<std::string::String>,
7082        {
7083            self.0.request.request_id = v.map(|x| x.into());
7084            self
7085        }
7086
7087        /// Sets the value of [zone][crate::model::instances::AttachDiskRequest::zone].
7088        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7089            self.0.request.zone = v.into();
7090            self
7091        }
7092
7093        /// Sets the value of [body][crate::model::instances::AttachDiskRequest::body].
7094        pub fn set_body<T>(mut self, v: T) -> Self
7095        where
7096            T: std::convert::Into<crate::model::AttachedDisk>,
7097        {
7098            self.0.request.body = std::option::Option::Some(v.into());
7099            self
7100        }
7101
7102        /// Sets or clears the value of [body][crate::model::instances::AttachDiskRequest::body].
7103        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7104        where
7105            T: std::convert::Into<crate::model::AttachedDisk>,
7106        {
7107            self.0.request.body = v.map(|x| x.into());
7108            self
7109        }
7110    }
7111
7112    #[doc(hidden)]
7113    impl gax::options::internal::RequestBuilder for AttachDisk {
7114        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7115            &mut self.0.options
7116        }
7117    }
7118
7119    /// The request builder for [Instances::bulk_insert][crate::client::Instances::bulk_insert] calls.
7120    ///
7121    /// # Example
7122    /// ```no_run
7123    /// # use google_cloud_compute_v1::builder;
7124    /// use builder::instances::BulkInsert;
7125    /// # tokio_test::block_on(async {
7126    ///
7127    /// let builder = prepare_request_builder();
7128    /// let response = builder.send().await?;
7129    /// # gax::Result::<()>::Ok(()) });
7130    ///
7131    /// fn prepare_request_builder() -> BulkInsert {
7132    ///   # panic!();
7133    ///   // ... details omitted ...
7134    /// }
7135    /// ```
7136    #[derive(Clone, Debug)]
7137    pub struct BulkInsert(RequestBuilder<crate::model::instances::BulkInsertRequest>);
7138
7139    impl BulkInsert {
7140        pub(crate) fn new(
7141            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7142        ) -> Self {
7143            Self(RequestBuilder::new(stub))
7144        }
7145
7146        /// Sets the full request, replacing any prior values.
7147        pub fn with_request<V: Into<crate::model::instances::BulkInsertRequest>>(
7148            mut self,
7149            v: V,
7150        ) -> Self {
7151            self.0.request = v.into();
7152            self
7153        }
7154
7155        /// Sets all the options, replacing any prior values.
7156        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7157            self.0.options = v.into();
7158            self
7159        }
7160
7161        /// Sends the request.
7162        pub async fn send(self) -> Result<crate::model::Operation> {
7163            (*self.0.stub)
7164                .bulk_insert(self.0.request, self.0.options)
7165                .await
7166                .map(gax::response::Response::into_body)
7167        }
7168
7169        /// Sets the value of [project][crate::model::instances::BulkInsertRequest::project].
7170        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7171            self.0.request.project = v.into();
7172            self
7173        }
7174
7175        /// Sets the value of [request_id][crate::model::instances::BulkInsertRequest::request_id].
7176        pub fn set_request_id<T>(mut self, v: T) -> Self
7177        where
7178            T: std::convert::Into<std::string::String>,
7179        {
7180            self.0.request.request_id = std::option::Option::Some(v.into());
7181            self
7182        }
7183
7184        /// Sets or clears the value of [request_id][crate::model::instances::BulkInsertRequest::request_id].
7185        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7186        where
7187            T: std::convert::Into<std::string::String>,
7188        {
7189            self.0.request.request_id = v.map(|x| x.into());
7190            self
7191        }
7192
7193        /// Sets the value of [zone][crate::model::instances::BulkInsertRequest::zone].
7194        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7195            self.0.request.zone = v.into();
7196            self
7197        }
7198
7199        /// Sets the value of [body][crate::model::instances::BulkInsertRequest::body].
7200        pub fn set_body<T>(mut self, v: T) -> Self
7201        where
7202            T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
7203        {
7204            self.0.request.body = std::option::Option::Some(v.into());
7205            self
7206        }
7207
7208        /// Sets or clears the value of [body][crate::model::instances::BulkInsertRequest::body].
7209        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7210        where
7211            T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
7212        {
7213            self.0.request.body = v.map(|x| x.into());
7214            self
7215        }
7216    }
7217
7218    #[doc(hidden)]
7219    impl gax::options::internal::RequestBuilder for BulkInsert {
7220        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7221            &mut self.0.options
7222        }
7223    }
7224
7225    /// The request builder for [Instances::delete][crate::client::Instances::delete] calls.
7226    ///
7227    /// # Example
7228    /// ```no_run
7229    /// # use google_cloud_compute_v1::builder;
7230    /// use builder::instances::Delete;
7231    /// # tokio_test::block_on(async {
7232    ///
7233    /// let builder = prepare_request_builder();
7234    /// let response = builder.send().await?;
7235    /// # gax::Result::<()>::Ok(()) });
7236    ///
7237    /// fn prepare_request_builder() -> Delete {
7238    ///   # panic!();
7239    ///   // ... details omitted ...
7240    /// }
7241    /// ```
7242    #[derive(Clone, Debug)]
7243    pub struct Delete(RequestBuilder<crate::model::instances::DeleteRequest>);
7244
7245    impl Delete {
7246        pub(crate) fn new(
7247            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7248        ) -> Self {
7249            Self(RequestBuilder::new(stub))
7250        }
7251
7252        /// Sets the full request, replacing any prior values.
7253        pub fn with_request<V: Into<crate::model::instances::DeleteRequest>>(
7254            mut self,
7255            v: V,
7256        ) -> Self {
7257            self.0.request = v.into();
7258            self
7259        }
7260
7261        /// Sets all the options, replacing any prior values.
7262        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7263            self.0.options = v.into();
7264            self
7265        }
7266
7267        /// Sends the request.
7268        pub async fn send(self) -> Result<crate::model::Operation> {
7269            (*self.0.stub)
7270                .delete(self.0.request, self.0.options)
7271                .await
7272                .map(gax::response::Response::into_body)
7273        }
7274
7275        /// Sets the value of [instance][crate::model::instances::DeleteRequest::instance].
7276        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7277            self.0.request.instance = v.into();
7278            self
7279        }
7280
7281        /// Sets the value of [project][crate::model::instances::DeleteRequest::project].
7282        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7283            self.0.request.project = v.into();
7284            self
7285        }
7286
7287        /// Sets the value of [request_id][crate::model::instances::DeleteRequest::request_id].
7288        pub fn set_request_id<T>(mut self, v: T) -> Self
7289        where
7290            T: std::convert::Into<std::string::String>,
7291        {
7292            self.0.request.request_id = std::option::Option::Some(v.into());
7293            self
7294        }
7295
7296        /// Sets or clears the value of [request_id][crate::model::instances::DeleteRequest::request_id].
7297        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7298        where
7299            T: std::convert::Into<std::string::String>,
7300        {
7301            self.0.request.request_id = v.map(|x| x.into());
7302            self
7303        }
7304
7305        /// Sets the value of [zone][crate::model::instances::DeleteRequest::zone].
7306        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7307            self.0.request.zone = v.into();
7308            self
7309        }
7310    }
7311
7312    #[doc(hidden)]
7313    impl gax::options::internal::RequestBuilder for Delete {
7314        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7315            &mut self.0.options
7316        }
7317    }
7318
7319    /// The request builder for [Instances::delete_access_config][crate::client::Instances::delete_access_config] calls.
7320    ///
7321    /// # Example
7322    /// ```no_run
7323    /// # use google_cloud_compute_v1::builder;
7324    /// use builder::instances::DeleteAccessConfig;
7325    /// # tokio_test::block_on(async {
7326    ///
7327    /// let builder = prepare_request_builder();
7328    /// let response = builder.send().await?;
7329    /// # gax::Result::<()>::Ok(()) });
7330    ///
7331    /// fn prepare_request_builder() -> DeleteAccessConfig {
7332    ///   # panic!();
7333    ///   // ... details omitted ...
7334    /// }
7335    /// ```
7336    #[derive(Clone, Debug)]
7337    pub struct DeleteAccessConfig(
7338        RequestBuilder<crate::model::instances::DeleteAccessConfigRequest>,
7339    );
7340
7341    impl DeleteAccessConfig {
7342        pub(crate) fn new(
7343            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7344        ) -> Self {
7345            Self(RequestBuilder::new(stub))
7346        }
7347
7348        /// Sets the full request, replacing any prior values.
7349        pub fn with_request<V: Into<crate::model::instances::DeleteAccessConfigRequest>>(
7350            mut self,
7351            v: V,
7352        ) -> Self {
7353            self.0.request = v.into();
7354            self
7355        }
7356
7357        /// Sets all the options, replacing any prior values.
7358        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7359            self.0.options = v.into();
7360            self
7361        }
7362
7363        /// Sends the request.
7364        pub async fn send(self) -> Result<crate::model::Operation> {
7365            (*self.0.stub)
7366                .delete_access_config(self.0.request, self.0.options)
7367                .await
7368                .map(gax::response::Response::into_body)
7369        }
7370
7371        /// Sets the value of [access_config][crate::model::instances::DeleteAccessConfigRequest::access_config].
7372        pub fn set_access_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
7373            self.0.request.access_config = v.into();
7374            self
7375        }
7376
7377        /// Sets the value of [instance][crate::model::instances::DeleteAccessConfigRequest::instance].
7378        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7379            self.0.request.instance = v.into();
7380            self
7381        }
7382
7383        /// Sets the value of [network_interface][crate::model::instances::DeleteAccessConfigRequest::network_interface].
7384        pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
7385            self.0.request.network_interface = v.into();
7386            self
7387        }
7388
7389        /// Sets the value of [project][crate::model::instances::DeleteAccessConfigRequest::project].
7390        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7391            self.0.request.project = v.into();
7392            self
7393        }
7394
7395        /// Sets the value of [request_id][crate::model::instances::DeleteAccessConfigRequest::request_id].
7396        pub fn set_request_id<T>(mut self, v: T) -> Self
7397        where
7398            T: std::convert::Into<std::string::String>,
7399        {
7400            self.0.request.request_id = std::option::Option::Some(v.into());
7401            self
7402        }
7403
7404        /// Sets or clears the value of [request_id][crate::model::instances::DeleteAccessConfigRequest::request_id].
7405        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7406        where
7407            T: std::convert::Into<std::string::String>,
7408        {
7409            self.0.request.request_id = v.map(|x| x.into());
7410            self
7411        }
7412
7413        /// Sets the value of [zone][crate::model::instances::DeleteAccessConfigRequest::zone].
7414        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7415            self.0.request.zone = v.into();
7416            self
7417        }
7418    }
7419
7420    #[doc(hidden)]
7421    impl gax::options::internal::RequestBuilder for DeleteAccessConfig {
7422        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7423            &mut self.0.options
7424        }
7425    }
7426
7427    /// The request builder for [Instances::delete_network_interface][crate::client::Instances::delete_network_interface] calls.
7428    ///
7429    /// # Example
7430    /// ```no_run
7431    /// # use google_cloud_compute_v1::builder;
7432    /// use builder::instances::DeleteNetworkInterface;
7433    /// # tokio_test::block_on(async {
7434    ///
7435    /// let builder = prepare_request_builder();
7436    /// let response = builder.send().await?;
7437    /// # gax::Result::<()>::Ok(()) });
7438    ///
7439    /// fn prepare_request_builder() -> DeleteNetworkInterface {
7440    ///   # panic!();
7441    ///   // ... details omitted ...
7442    /// }
7443    /// ```
7444    #[derive(Clone, Debug)]
7445    pub struct DeleteNetworkInterface(
7446        RequestBuilder<crate::model::instances::DeleteNetworkInterfaceRequest>,
7447    );
7448
7449    impl DeleteNetworkInterface {
7450        pub(crate) fn new(
7451            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7452        ) -> Self {
7453            Self(RequestBuilder::new(stub))
7454        }
7455
7456        /// Sets the full request, replacing any prior values.
7457        pub fn with_request<V: Into<crate::model::instances::DeleteNetworkInterfaceRequest>>(
7458            mut self,
7459            v: V,
7460        ) -> Self {
7461            self.0.request = v.into();
7462            self
7463        }
7464
7465        /// Sets all the options, replacing any prior values.
7466        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7467            self.0.options = v.into();
7468            self
7469        }
7470
7471        /// Sends the request.
7472        pub async fn send(self) -> Result<crate::model::Operation> {
7473            (*self.0.stub)
7474                .delete_network_interface(self.0.request, self.0.options)
7475                .await
7476                .map(gax::response::Response::into_body)
7477        }
7478
7479        /// Sets the value of [instance][crate::model::instances::DeleteNetworkInterfaceRequest::instance].
7480        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7481            self.0.request.instance = v.into();
7482            self
7483        }
7484
7485        /// Sets the value of [network_interface_name][crate::model::instances::DeleteNetworkInterfaceRequest::network_interface_name].
7486        pub fn set_network_interface_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7487            self.0.request.network_interface_name = v.into();
7488            self
7489        }
7490
7491        /// Sets the value of [project][crate::model::instances::DeleteNetworkInterfaceRequest::project].
7492        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7493            self.0.request.project = v.into();
7494            self
7495        }
7496
7497        /// Sets the value of [request_id][crate::model::instances::DeleteNetworkInterfaceRequest::request_id].
7498        pub fn set_request_id<T>(mut self, v: T) -> Self
7499        where
7500            T: std::convert::Into<std::string::String>,
7501        {
7502            self.0.request.request_id = std::option::Option::Some(v.into());
7503            self
7504        }
7505
7506        /// Sets or clears the value of [request_id][crate::model::instances::DeleteNetworkInterfaceRequest::request_id].
7507        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7508        where
7509            T: std::convert::Into<std::string::String>,
7510        {
7511            self.0.request.request_id = v.map(|x| x.into());
7512            self
7513        }
7514
7515        /// Sets the value of [zone][crate::model::instances::DeleteNetworkInterfaceRequest::zone].
7516        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7517            self.0.request.zone = v.into();
7518            self
7519        }
7520    }
7521
7522    #[doc(hidden)]
7523    impl gax::options::internal::RequestBuilder for DeleteNetworkInterface {
7524        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7525            &mut self.0.options
7526        }
7527    }
7528
7529    /// The request builder for [Instances::detach_disk][crate::client::Instances::detach_disk] calls.
7530    ///
7531    /// # Example
7532    /// ```no_run
7533    /// # use google_cloud_compute_v1::builder;
7534    /// use builder::instances::DetachDisk;
7535    /// # tokio_test::block_on(async {
7536    ///
7537    /// let builder = prepare_request_builder();
7538    /// let response = builder.send().await?;
7539    /// # gax::Result::<()>::Ok(()) });
7540    ///
7541    /// fn prepare_request_builder() -> DetachDisk {
7542    ///   # panic!();
7543    ///   // ... details omitted ...
7544    /// }
7545    /// ```
7546    #[derive(Clone, Debug)]
7547    pub struct DetachDisk(RequestBuilder<crate::model::instances::DetachDiskRequest>);
7548
7549    impl DetachDisk {
7550        pub(crate) fn new(
7551            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7552        ) -> Self {
7553            Self(RequestBuilder::new(stub))
7554        }
7555
7556        /// Sets the full request, replacing any prior values.
7557        pub fn with_request<V: Into<crate::model::instances::DetachDiskRequest>>(
7558            mut self,
7559            v: V,
7560        ) -> Self {
7561            self.0.request = v.into();
7562            self
7563        }
7564
7565        /// Sets all the options, replacing any prior values.
7566        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7567            self.0.options = v.into();
7568            self
7569        }
7570
7571        /// Sends the request.
7572        pub async fn send(self) -> Result<crate::model::Operation> {
7573            (*self.0.stub)
7574                .detach_disk(self.0.request, self.0.options)
7575                .await
7576                .map(gax::response::Response::into_body)
7577        }
7578
7579        /// Sets the value of [device_name][crate::model::instances::DetachDiskRequest::device_name].
7580        pub fn set_device_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7581            self.0.request.device_name = v.into();
7582            self
7583        }
7584
7585        /// Sets the value of [instance][crate::model::instances::DetachDiskRequest::instance].
7586        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7587            self.0.request.instance = v.into();
7588            self
7589        }
7590
7591        /// Sets the value of [project][crate::model::instances::DetachDiskRequest::project].
7592        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7593            self.0.request.project = v.into();
7594            self
7595        }
7596
7597        /// Sets the value of [request_id][crate::model::instances::DetachDiskRequest::request_id].
7598        pub fn set_request_id<T>(mut self, v: T) -> Self
7599        where
7600            T: std::convert::Into<std::string::String>,
7601        {
7602            self.0.request.request_id = std::option::Option::Some(v.into());
7603            self
7604        }
7605
7606        /// Sets or clears the value of [request_id][crate::model::instances::DetachDiskRequest::request_id].
7607        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7608        where
7609            T: std::convert::Into<std::string::String>,
7610        {
7611            self.0.request.request_id = v.map(|x| x.into());
7612            self
7613        }
7614
7615        /// Sets the value of [zone][crate::model::instances::DetachDiskRequest::zone].
7616        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7617            self.0.request.zone = v.into();
7618            self
7619        }
7620    }
7621
7622    #[doc(hidden)]
7623    impl gax::options::internal::RequestBuilder for DetachDisk {
7624        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7625            &mut self.0.options
7626        }
7627    }
7628
7629    /// The request builder for [Instances::get][crate::client::Instances::get] calls.
7630    ///
7631    /// # Example
7632    /// ```no_run
7633    /// # use google_cloud_compute_v1::builder;
7634    /// use builder::instances::Get;
7635    /// # tokio_test::block_on(async {
7636    ///
7637    /// let builder = prepare_request_builder();
7638    /// let response = builder.send().await?;
7639    /// # gax::Result::<()>::Ok(()) });
7640    ///
7641    /// fn prepare_request_builder() -> Get {
7642    ///   # panic!();
7643    ///   // ... details omitted ...
7644    /// }
7645    /// ```
7646    #[derive(Clone, Debug)]
7647    pub struct Get(RequestBuilder<crate::model::instances::GetRequest>);
7648
7649    impl Get {
7650        pub(crate) fn new(
7651            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7652        ) -> Self {
7653            Self(RequestBuilder::new(stub))
7654        }
7655
7656        /// Sets the full request, replacing any prior values.
7657        pub fn with_request<V: Into<crate::model::instances::GetRequest>>(mut self, v: V) -> Self {
7658            self.0.request = v.into();
7659            self
7660        }
7661
7662        /// Sets all the options, replacing any prior values.
7663        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7664            self.0.options = v.into();
7665            self
7666        }
7667
7668        /// Sends the request.
7669        pub async fn send(self) -> Result<crate::model::Instance> {
7670            (*self.0.stub)
7671                .get(self.0.request, self.0.options)
7672                .await
7673                .map(gax::response::Response::into_body)
7674        }
7675
7676        /// Sets the value of [instance][crate::model::instances::GetRequest::instance].
7677        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7678            self.0.request.instance = v.into();
7679            self
7680        }
7681
7682        /// Sets the value of [project][crate::model::instances::GetRequest::project].
7683        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7684            self.0.request.project = v.into();
7685            self
7686        }
7687
7688        /// Sets the value of [zone][crate::model::instances::GetRequest::zone].
7689        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7690            self.0.request.zone = v.into();
7691            self
7692        }
7693    }
7694
7695    #[doc(hidden)]
7696    impl gax::options::internal::RequestBuilder for Get {
7697        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7698            &mut self.0.options
7699        }
7700    }
7701
7702    /// The request builder for [Instances::get_effective_firewalls][crate::client::Instances::get_effective_firewalls] calls.
7703    ///
7704    /// # Example
7705    /// ```no_run
7706    /// # use google_cloud_compute_v1::builder;
7707    /// use builder::instances::GetEffectiveFirewalls;
7708    /// # tokio_test::block_on(async {
7709    ///
7710    /// let builder = prepare_request_builder();
7711    /// let response = builder.send().await?;
7712    /// # gax::Result::<()>::Ok(()) });
7713    ///
7714    /// fn prepare_request_builder() -> GetEffectiveFirewalls {
7715    ///   # panic!();
7716    ///   // ... details omitted ...
7717    /// }
7718    /// ```
7719    #[derive(Clone, Debug)]
7720    pub struct GetEffectiveFirewalls(
7721        RequestBuilder<crate::model::instances::GetEffectiveFirewallsRequest>,
7722    );
7723
7724    impl GetEffectiveFirewalls {
7725        pub(crate) fn new(
7726            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7727        ) -> Self {
7728            Self(RequestBuilder::new(stub))
7729        }
7730
7731        /// Sets the full request, replacing any prior values.
7732        pub fn with_request<V: Into<crate::model::instances::GetEffectiveFirewallsRequest>>(
7733            mut self,
7734            v: V,
7735        ) -> Self {
7736            self.0.request = v.into();
7737            self
7738        }
7739
7740        /// Sets all the options, replacing any prior values.
7741        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7742            self.0.options = v.into();
7743            self
7744        }
7745
7746        /// Sends the request.
7747        pub async fn send(self) -> Result<crate::model::InstancesGetEffectiveFirewallsResponse> {
7748            (*self.0.stub)
7749                .get_effective_firewalls(self.0.request, self.0.options)
7750                .await
7751                .map(gax::response::Response::into_body)
7752        }
7753
7754        /// Sets the value of [instance][crate::model::instances::GetEffectiveFirewallsRequest::instance].
7755        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7756            self.0.request.instance = v.into();
7757            self
7758        }
7759
7760        /// Sets the value of [network_interface][crate::model::instances::GetEffectiveFirewallsRequest::network_interface].
7761        pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
7762            self.0.request.network_interface = v.into();
7763            self
7764        }
7765
7766        /// Sets the value of [project][crate::model::instances::GetEffectiveFirewallsRequest::project].
7767        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7768            self.0.request.project = v.into();
7769            self
7770        }
7771
7772        /// Sets the value of [zone][crate::model::instances::GetEffectiveFirewallsRequest::zone].
7773        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7774            self.0.request.zone = v.into();
7775            self
7776        }
7777    }
7778
7779    #[doc(hidden)]
7780    impl gax::options::internal::RequestBuilder for GetEffectiveFirewalls {
7781        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7782            &mut self.0.options
7783        }
7784    }
7785
7786    /// The request builder for [Instances::get_guest_attributes][crate::client::Instances::get_guest_attributes] calls.
7787    ///
7788    /// # Example
7789    /// ```no_run
7790    /// # use google_cloud_compute_v1::builder;
7791    /// use builder::instances::GetGuestAttributes;
7792    /// # tokio_test::block_on(async {
7793    ///
7794    /// let builder = prepare_request_builder();
7795    /// let response = builder.send().await?;
7796    /// # gax::Result::<()>::Ok(()) });
7797    ///
7798    /// fn prepare_request_builder() -> GetGuestAttributes {
7799    ///   # panic!();
7800    ///   // ... details omitted ...
7801    /// }
7802    /// ```
7803    #[derive(Clone, Debug)]
7804    pub struct GetGuestAttributes(
7805        RequestBuilder<crate::model::instances::GetGuestAttributesRequest>,
7806    );
7807
7808    impl GetGuestAttributes {
7809        pub(crate) fn new(
7810            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7811        ) -> Self {
7812            Self(RequestBuilder::new(stub))
7813        }
7814
7815        /// Sets the full request, replacing any prior values.
7816        pub fn with_request<V: Into<crate::model::instances::GetGuestAttributesRequest>>(
7817            mut self,
7818            v: V,
7819        ) -> Self {
7820            self.0.request = v.into();
7821            self
7822        }
7823
7824        /// Sets all the options, replacing any prior values.
7825        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7826            self.0.options = v.into();
7827            self
7828        }
7829
7830        /// Sends the request.
7831        pub async fn send(self) -> Result<crate::model::GuestAttributes> {
7832            (*self.0.stub)
7833                .get_guest_attributes(self.0.request, self.0.options)
7834                .await
7835                .map(gax::response::Response::into_body)
7836        }
7837
7838        /// Sets the value of [instance][crate::model::instances::GetGuestAttributesRequest::instance].
7839        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7840            self.0.request.instance = v.into();
7841            self
7842        }
7843
7844        /// Sets the value of [project][crate::model::instances::GetGuestAttributesRequest::project].
7845        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7846            self.0.request.project = v.into();
7847            self
7848        }
7849
7850        /// Sets the value of [query_path][crate::model::instances::GetGuestAttributesRequest::query_path].
7851        pub fn set_query_path<T>(mut self, v: T) -> Self
7852        where
7853            T: std::convert::Into<std::string::String>,
7854        {
7855            self.0.request.query_path = std::option::Option::Some(v.into());
7856            self
7857        }
7858
7859        /// Sets or clears the value of [query_path][crate::model::instances::GetGuestAttributesRequest::query_path].
7860        pub fn set_or_clear_query_path<T>(mut self, v: std::option::Option<T>) -> Self
7861        where
7862            T: std::convert::Into<std::string::String>,
7863        {
7864            self.0.request.query_path = v.map(|x| x.into());
7865            self
7866        }
7867
7868        /// Sets the value of [variable_key][crate::model::instances::GetGuestAttributesRequest::variable_key].
7869        pub fn set_variable_key<T>(mut self, v: T) -> Self
7870        where
7871            T: std::convert::Into<std::string::String>,
7872        {
7873            self.0.request.variable_key = std::option::Option::Some(v.into());
7874            self
7875        }
7876
7877        /// Sets or clears the value of [variable_key][crate::model::instances::GetGuestAttributesRequest::variable_key].
7878        pub fn set_or_clear_variable_key<T>(mut self, v: std::option::Option<T>) -> Self
7879        where
7880            T: std::convert::Into<std::string::String>,
7881        {
7882            self.0.request.variable_key = v.map(|x| x.into());
7883            self
7884        }
7885
7886        /// Sets the value of [zone][crate::model::instances::GetGuestAttributesRequest::zone].
7887        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7888            self.0.request.zone = v.into();
7889            self
7890        }
7891    }
7892
7893    #[doc(hidden)]
7894    impl gax::options::internal::RequestBuilder for GetGuestAttributes {
7895        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7896            &mut self.0.options
7897        }
7898    }
7899
7900    /// The request builder for [Instances::get_iam_policy][crate::client::Instances::get_iam_policy] calls.
7901    ///
7902    /// # Example
7903    /// ```no_run
7904    /// # use google_cloud_compute_v1::builder;
7905    /// use builder::instances::GetIamPolicy;
7906    /// # tokio_test::block_on(async {
7907    ///
7908    /// let builder = prepare_request_builder();
7909    /// let response = builder.send().await?;
7910    /// # gax::Result::<()>::Ok(()) });
7911    ///
7912    /// fn prepare_request_builder() -> GetIamPolicy {
7913    ///   # panic!();
7914    ///   // ... details omitted ...
7915    /// }
7916    /// ```
7917    #[derive(Clone, Debug)]
7918    pub struct GetIamPolicy(RequestBuilder<crate::model::instances::GetIamPolicyRequest>);
7919
7920    impl GetIamPolicy {
7921        pub(crate) fn new(
7922            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7923        ) -> Self {
7924            Self(RequestBuilder::new(stub))
7925        }
7926
7927        /// Sets the full request, replacing any prior values.
7928        pub fn with_request<V: Into<crate::model::instances::GetIamPolicyRequest>>(
7929            mut self,
7930            v: V,
7931        ) -> Self {
7932            self.0.request = v.into();
7933            self
7934        }
7935
7936        /// Sets all the options, replacing any prior values.
7937        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7938            self.0.options = v.into();
7939            self
7940        }
7941
7942        /// Sends the request.
7943        pub async fn send(self) -> Result<crate::model::Policy> {
7944            (*self.0.stub)
7945                .get_iam_policy(self.0.request, self.0.options)
7946                .await
7947                .map(gax::response::Response::into_body)
7948        }
7949
7950        /// Sets the value of [options_requested_policy_version][crate::model::instances::GetIamPolicyRequest::options_requested_policy_version].
7951        pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
7952        where
7953            T: std::convert::Into<i32>,
7954        {
7955            self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
7956            self
7957        }
7958
7959        /// Sets or clears the value of [options_requested_policy_version][crate::model::instances::GetIamPolicyRequest::options_requested_policy_version].
7960        pub fn set_or_clear_options_requested_policy_version<T>(
7961            mut self,
7962            v: std::option::Option<T>,
7963        ) -> Self
7964        where
7965            T: std::convert::Into<i32>,
7966        {
7967            self.0.request.options_requested_policy_version = v.map(|x| x.into());
7968            self
7969        }
7970
7971        /// Sets the value of [project][crate::model::instances::GetIamPolicyRequest::project].
7972        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7973            self.0.request.project = v.into();
7974            self
7975        }
7976
7977        /// Sets the value of [resource][crate::model::instances::GetIamPolicyRequest::resource].
7978        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7979            self.0.request.resource = v.into();
7980            self
7981        }
7982
7983        /// Sets the value of [zone][crate::model::instances::GetIamPolicyRequest::zone].
7984        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7985            self.0.request.zone = v.into();
7986            self
7987        }
7988    }
7989
7990    #[doc(hidden)]
7991    impl gax::options::internal::RequestBuilder for GetIamPolicy {
7992        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7993            &mut self.0.options
7994        }
7995    }
7996
7997    /// The request builder for [Instances::get_screenshot][crate::client::Instances::get_screenshot] calls.
7998    ///
7999    /// # Example
8000    /// ```no_run
8001    /// # use google_cloud_compute_v1::builder;
8002    /// use builder::instances::GetScreenshot;
8003    /// # tokio_test::block_on(async {
8004    ///
8005    /// let builder = prepare_request_builder();
8006    /// let response = builder.send().await?;
8007    /// # gax::Result::<()>::Ok(()) });
8008    ///
8009    /// fn prepare_request_builder() -> GetScreenshot {
8010    ///   # panic!();
8011    ///   // ... details omitted ...
8012    /// }
8013    /// ```
8014    #[derive(Clone, Debug)]
8015    pub struct GetScreenshot(RequestBuilder<crate::model::instances::GetScreenshotRequest>);
8016
8017    impl GetScreenshot {
8018        pub(crate) fn new(
8019            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8020        ) -> Self {
8021            Self(RequestBuilder::new(stub))
8022        }
8023
8024        /// Sets the full request, replacing any prior values.
8025        pub fn with_request<V: Into<crate::model::instances::GetScreenshotRequest>>(
8026            mut self,
8027            v: V,
8028        ) -> Self {
8029            self.0.request = v.into();
8030            self
8031        }
8032
8033        /// Sets all the options, replacing any prior values.
8034        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8035            self.0.options = v.into();
8036            self
8037        }
8038
8039        /// Sends the request.
8040        pub async fn send(self) -> Result<crate::model::Screenshot> {
8041            (*self.0.stub)
8042                .get_screenshot(self.0.request, self.0.options)
8043                .await
8044                .map(gax::response::Response::into_body)
8045        }
8046
8047        /// Sets the value of [instance][crate::model::instances::GetScreenshotRequest::instance].
8048        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8049            self.0.request.instance = v.into();
8050            self
8051        }
8052
8053        /// Sets the value of [project][crate::model::instances::GetScreenshotRequest::project].
8054        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8055            self.0.request.project = v.into();
8056            self
8057        }
8058
8059        /// Sets the value of [zone][crate::model::instances::GetScreenshotRequest::zone].
8060        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8061            self.0.request.zone = v.into();
8062            self
8063        }
8064    }
8065
8066    #[doc(hidden)]
8067    impl gax::options::internal::RequestBuilder for GetScreenshot {
8068        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8069            &mut self.0.options
8070        }
8071    }
8072
8073    /// The request builder for [Instances::get_serial_port_output][crate::client::Instances::get_serial_port_output] calls.
8074    ///
8075    /// # Example
8076    /// ```no_run
8077    /// # use google_cloud_compute_v1::builder;
8078    /// use builder::instances::GetSerialPortOutput;
8079    /// # tokio_test::block_on(async {
8080    ///
8081    /// let builder = prepare_request_builder();
8082    /// let response = builder.send().await?;
8083    /// # gax::Result::<()>::Ok(()) });
8084    ///
8085    /// fn prepare_request_builder() -> GetSerialPortOutput {
8086    ///   # panic!();
8087    ///   // ... details omitted ...
8088    /// }
8089    /// ```
8090    #[derive(Clone, Debug)]
8091    pub struct GetSerialPortOutput(
8092        RequestBuilder<crate::model::instances::GetSerialPortOutputRequest>,
8093    );
8094
8095    impl GetSerialPortOutput {
8096        pub(crate) fn new(
8097            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8098        ) -> Self {
8099            Self(RequestBuilder::new(stub))
8100        }
8101
8102        /// Sets the full request, replacing any prior values.
8103        pub fn with_request<V: Into<crate::model::instances::GetSerialPortOutputRequest>>(
8104            mut self,
8105            v: V,
8106        ) -> Self {
8107            self.0.request = v.into();
8108            self
8109        }
8110
8111        /// Sets all the options, replacing any prior values.
8112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8113            self.0.options = v.into();
8114            self
8115        }
8116
8117        /// Sends the request.
8118        pub async fn send(self) -> Result<crate::model::SerialPortOutput> {
8119            (*self.0.stub)
8120                .get_serial_port_output(self.0.request, self.0.options)
8121                .await
8122                .map(gax::response::Response::into_body)
8123        }
8124
8125        /// Sets the value of [instance][crate::model::instances::GetSerialPortOutputRequest::instance].
8126        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8127            self.0.request.instance = v.into();
8128            self
8129        }
8130
8131        /// Sets the value of [port][crate::model::instances::GetSerialPortOutputRequest::port].
8132        pub fn set_port<T>(mut self, v: T) -> Self
8133        where
8134            T: std::convert::Into<i32>,
8135        {
8136            self.0.request.port = std::option::Option::Some(v.into());
8137            self
8138        }
8139
8140        /// Sets or clears the value of [port][crate::model::instances::GetSerialPortOutputRequest::port].
8141        pub fn set_or_clear_port<T>(mut self, v: std::option::Option<T>) -> Self
8142        where
8143            T: std::convert::Into<i32>,
8144        {
8145            self.0.request.port = v.map(|x| x.into());
8146            self
8147        }
8148
8149        /// Sets the value of [project][crate::model::instances::GetSerialPortOutputRequest::project].
8150        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8151            self.0.request.project = v.into();
8152            self
8153        }
8154
8155        /// Sets the value of [start][crate::model::instances::GetSerialPortOutputRequest::start].
8156        pub fn set_start<T>(mut self, v: T) -> Self
8157        where
8158            T: std::convert::Into<i64>,
8159        {
8160            self.0.request.start = std::option::Option::Some(v.into());
8161            self
8162        }
8163
8164        /// Sets or clears the value of [start][crate::model::instances::GetSerialPortOutputRequest::start].
8165        pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
8166        where
8167            T: std::convert::Into<i64>,
8168        {
8169            self.0.request.start = v.map(|x| x.into());
8170            self
8171        }
8172
8173        /// Sets the value of [zone][crate::model::instances::GetSerialPortOutputRequest::zone].
8174        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8175            self.0.request.zone = v.into();
8176            self
8177        }
8178    }
8179
8180    #[doc(hidden)]
8181    impl gax::options::internal::RequestBuilder for GetSerialPortOutput {
8182        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8183            &mut self.0.options
8184        }
8185    }
8186
8187    /// The request builder for [Instances::get_shielded_instance_identity][crate::client::Instances::get_shielded_instance_identity] calls.
8188    ///
8189    /// # Example
8190    /// ```no_run
8191    /// # use google_cloud_compute_v1::builder;
8192    /// use builder::instances::GetShieldedInstanceIdentity;
8193    /// # tokio_test::block_on(async {
8194    ///
8195    /// let builder = prepare_request_builder();
8196    /// let response = builder.send().await?;
8197    /// # gax::Result::<()>::Ok(()) });
8198    ///
8199    /// fn prepare_request_builder() -> GetShieldedInstanceIdentity {
8200    ///   # panic!();
8201    ///   // ... details omitted ...
8202    /// }
8203    /// ```
8204    #[derive(Clone, Debug)]
8205    pub struct GetShieldedInstanceIdentity(
8206        RequestBuilder<crate::model::instances::GetShieldedInstanceIdentityRequest>,
8207    );
8208
8209    impl GetShieldedInstanceIdentity {
8210        pub(crate) fn new(
8211            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8212        ) -> Self {
8213            Self(RequestBuilder::new(stub))
8214        }
8215
8216        /// Sets the full request, replacing any prior values.
8217        pub fn with_request<
8218            V: Into<crate::model::instances::GetShieldedInstanceIdentityRequest>,
8219        >(
8220            mut self,
8221            v: V,
8222        ) -> Self {
8223            self.0.request = v.into();
8224            self
8225        }
8226
8227        /// Sets all the options, replacing any prior values.
8228        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8229            self.0.options = v.into();
8230            self
8231        }
8232
8233        /// Sends the request.
8234        pub async fn send(self) -> Result<crate::model::ShieldedInstanceIdentity> {
8235            (*self.0.stub)
8236                .get_shielded_instance_identity(self.0.request, self.0.options)
8237                .await
8238                .map(gax::response::Response::into_body)
8239        }
8240
8241        /// Sets the value of [instance][crate::model::instances::GetShieldedInstanceIdentityRequest::instance].
8242        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8243            self.0.request.instance = v.into();
8244            self
8245        }
8246
8247        /// Sets the value of [project][crate::model::instances::GetShieldedInstanceIdentityRequest::project].
8248        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8249            self.0.request.project = v.into();
8250            self
8251        }
8252
8253        /// Sets the value of [zone][crate::model::instances::GetShieldedInstanceIdentityRequest::zone].
8254        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8255            self.0.request.zone = v.into();
8256            self
8257        }
8258    }
8259
8260    #[doc(hidden)]
8261    impl gax::options::internal::RequestBuilder for GetShieldedInstanceIdentity {
8262        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8263            &mut self.0.options
8264        }
8265    }
8266
8267    /// The request builder for [Instances::insert][crate::client::Instances::insert] calls.
8268    ///
8269    /// # Example
8270    /// ```no_run
8271    /// # use google_cloud_compute_v1::builder;
8272    /// use builder::instances::Insert;
8273    /// # tokio_test::block_on(async {
8274    ///
8275    /// let builder = prepare_request_builder();
8276    /// let response = builder.send().await?;
8277    /// # gax::Result::<()>::Ok(()) });
8278    ///
8279    /// fn prepare_request_builder() -> Insert {
8280    ///   # panic!();
8281    ///   // ... details omitted ...
8282    /// }
8283    /// ```
8284    #[derive(Clone, Debug)]
8285    pub struct Insert(RequestBuilder<crate::model::instances::InsertRequest>);
8286
8287    impl Insert {
8288        pub(crate) fn new(
8289            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8290        ) -> Self {
8291            Self(RequestBuilder::new(stub))
8292        }
8293
8294        /// Sets the full request, replacing any prior values.
8295        pub fn with_request<V: Into<crate::model::instances::InsertRequest>>(
8296            mut self,
8297            v: V,
8298        ) -> Self {
8299            self.0.request = v.into();
8300            self
8301        }
8302
8303        /// Sets all the options, replacing any prior values.
8304        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8305            self.0.options = v.into();
8306            self
8307        }
8308
8309        /// Sends the request.
8310        pub async fn send(self) -> Result<crate::model::Operation> {
8311            (*self.0.stub)
8312                .insert(self.0.request, self.0.options)
8313                .await
8314                .map(gax::response::Response::into_body)
8315        }
8316
8317        /// Sets the value of [project][crate::model::instances::InsertRequest::project].
8318        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8319            self.0.request.project = v.into();
8320            self
8321        }
8322
8323        /// Sets the value of [request_id][crate::model::instances::InsertRequest::request_id].
8324        pub fn set_request_id<T>(mut self, v: T) -> Self
8325        where
8326            T: std::convert::Into<std::string::String>,
8327        {
8328            self.0.request.request_id = std::option::Option::Some(v.into());
8329            self
8330        }
8331
8332        /// Sets or clears the value of [request_id][crate::model::instances::InsertRequest::request_id].
8333        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8334        where
8335            T: std::convert::Into<std::string::String>,
8336        {
8337            self.0.request.request_id = v.map(|x| x.into());
8338            self
8339        }
8340
8341        /// Sets the value of [source_instance_template][crate::model::instances::InsertRequest::source_instance_template].
8342        pub fn set_source_instance_template<T>(mut self, v: T) -> Self
8343        where
8344            T: std::convert::Into<std::string::String>,
8345        {
8346            self.0.request.source_instance_template = std::option::Option::Some(v.into());
8347            self
8348        }
8349
8350        /// Sets or clears the value of [source_instance_template][crate::model::instances::InsertRequest::source_instance_template].
8351        pub fn set_or_clear_source_instance_template<T>(mut self, v: std::option::Option<T>) -> Self
8352        where
8353            T: std::convert::Into<std::string::String>,
8354        {
8355            self.0.request.source_instance_template = v.map(|x| x.into());
8356            self
8357        }
8358
8359        /// Sets the value of [source_machine_image][crate::model::instances::InsertRequest::source_machine_image].
8360        pub fn set_source_machine_image<T>(mut self, v: T) -> Self
8361        where
8362            T: std::convert::Into<std::string::String>,
8363        {
8364            self.0.request.source_machine_image = std::option::Option::Some(v.into());
8365            self
8366        }
8367
8368        /// Sets or clears the value of [source_machine_image][crate::model::instances::InsertRequest::source_machine_image].
8369        pub fn set_or_clear_source_machine_image<T>(mut self, v: std::option::Option<T>) -> Self
8370        where
8371            T: std::convert::Into<std::string::String>,
8372        {
8373            self.0.request.source_machine_image = v.map(|x| x.into());
8374            self
8375        }
8376
8377        /// Sets the value of [zone][crate::model::instances::InsertRequest::zone].
8378        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8379            self.0.request.zone = v.into();
8380            self
8381        }
8382
8383        /// Sets the value of [body][crate::model::instances::InsertRequest::body].
8384        pub fn set_body<T>(mut self, v: T) -> Self
8385        where
8386            T: std::convert::Into<crate::model::Instance>,
8387        {
8388            self.0.request.body = std::option::Option::Some(v.into());
8389            self
8390        }
8391
8392        /// Sets or clears the value of [body][crate::model::instances::InsertRequest::body].
8393        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8394        where
8395            T: std::convert::Into<crate::model::Instance>,
8396        {
8397            self.0.request.body = v.map(|x| x.into());
8398            self
8399        }
8400    }
8401
8402    #[doc(hidden)]
8403    impl gax::options::internal::RequestBuilder for Insert {
8404        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8405            &mut self.0.options
8406        }
8407    }
8408
8409    /// The request builder for [Instances::list][crate::client::Instances::list] calls.
8410    ///
8411    /// # Example
8412    /// ```no_run
8413    /// # use google_cloud_compute_v1::builder;
8414    /// use builder::instances::List;
8415    /// # tokio_test::block_on(async {
8416    /// use gax::paginator::ItemPaginator;
8417    ///
8418    /// let builder = prepare_request_builder();
8419    /// let mut items = builder.by_item();
8420    /// while let Some(result) = items.next().await {
8421    ///   let item = result?;
8422    /// }
8423    /// # gax::Result::<()>::Ok(()) });
8424    ///
8425    /// fn prepare_request_builder() -> List {
8426    ///   # panic!();
8427    ///   // ... details omitted ...
8428    /// }
8429    /// ```
8430    #[derive(Clone, Debug)]
8431    pub struct List(RequestBuilder<crate::model::instances::ListRequest>);
8432
8433    impl List {
8434        pub(crate) fn new(
8435            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8436        ) -> Self {
8437            Self(RequestBuilder::new(stub))
8438        }
8439
8440        /// Sets the full request, replacing any prior values.
8441        pub fn with_request<V: Into<crate::model::instances::ListRequest>>(mut self, v: V) -> Self {
8442            self.0.request = v.into();
8443            self
8444        }
8445
8446        /// Sets all the options, replacing any prior values.
8447        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8448            self.0.options = v.into();
8449            self
8450        }
8451
8452        /// Sends the request.
8453        pub async fn send(self) -> Result<crate::model::InstanceList> {
8454            (*self.0.stub)
8455                .list(self.0.request, self.0.options)
8456                .await
8457                .map(gax::response::Response::into_body)
8458        }
8459
8460        /// Streams each page in the collection.
8461        pub fn by_page(
8462            self,
8463        ) -> impl gax::paginator::Paginator<crate::model::InstanceList, gax::error::Error> {
8464            use std::clone::Clone;
8465            let token = self.0.request.page_token.clone().unwrap_or_default();
8466            let execute = move |token: String| {
8467                let mut builder = self.clone();
8468                builder.0.request = builder.0.request.set_page_token(token);
8469                builder.send()
8470            };
8471            gax::paginator::internal::new_paginator(token, execute)
8472        }
8473
8474        /// Streams each item in the collection.
8475        pub fn by_item(
8476            self,
8477        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceList, gax::error::Error>
8478        {
8479            use gax::paginator::Paginator;
8480            self.by_page().items()
8481        }
8482
8483        /// Sets the value of [filter][crate::model::instances::ListRequest::filter].
8484        pub fn set_filter<T>(mut self, v: T) -> Self
8485        where
8486            T: std::convert::Into<std::string::String>,
8487        {
8488            self.0.request.filter = std::option::Option::Some(v.into());
8489            self
8490        }
8491
8492        /// Sets or clears the value of [filter][crate::model::instances::ListRequest::filter].
8493        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
8494        where
8495            T: std::convert::Into<std::string::String>,
8496        {
8497            self.0.request.filter = v.map(|x| x.into());
8498            self
8499        }
8500
8501        /// Sets the value of [max_results][crate::model::instances::ListRequest::max_results].
8502        pub fn set_max_results<T>(mut self, v: T) -> Self
8503        where
8504            T: std::convert::Into<u32>,
8505        {
8506            self.0.request.max_results = std::option::Option::Some(v.into());
8507            self
8508        }
8509
8510        /// Sets or clears the value of [max_results][crate::model::instances::ListRequest::max_results].
8511        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
8512        where
8513            T: std::convert::Into<u32>,
8514        {
8515            self.0.request.max_results = v.map(|x| x.into());
8516            self
8517        }
8518
8519        /// Sets the value of [order_by][crate::model::instances::ListRequest::order_by].
8520        pub fn set_order_by<T>(mut self, v: T) -> Self
8521        where
8522            T: std::convert::Into<std::string::String>,
8523        {
8524            self.0.request.order_by = std::option::Option::Some(v.into());
8525            self
8526        }
8527
8528        /// Sets or clears the value of [order_by][crate::model::instances::ListRequest::order_by].
8529        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
8530        where
8531            T: std::convert::Into<std::string::String>,
8532        {
8533            self.0.request.order_by = v.map(|x| x.into());
8534            self
8535        }
8536
8537        /// Sets the value of [page_token][crate::model::instances::ListRequest::page_token].
8538        pub fn set_page_token<T>(mut self, v: T) -> Self
8539        where
8540            T: std::convert::Into<std::string::String>,
8541        {
8542            self.0.request.page_token = std::option::Option::Some(v.into());
8543            self
8544        }
8545
8546        /// Sets or clears the value of [page_token][crate::model::instances::ListRequest::page_token].
8547        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
8548        where
8549            T: std::convert::Into<std::string::String>,
8550        {
8551            self.0.request.page_token = v.map(|x| x.into());
8552            self
8553        }
8554
8555        /// Sets the value of [project][crate::model::instances::ListRequest::project].
8556        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8557            self.0.request.project = v.into();
8558            self
8559        }
8560
8561        /// Sets the value of [return_partial_success][crate::model::instances::ListRequest::return_partial_success].
8562        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
8563        where
8564            T: std::convert::Into<bool>,
8565        {
8566            self.0.request.return_partial_success = std::option::Option::Some(v.into());
8567            self
8568        }
8569
8570        /// Sets or clears the value of [return_partial_success][crate::model::instances::ListRequest::return_partial_success].
8571        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
8572        where
8573            T: std::convert::Into<bool>,
8574        {
8575            self.0.request.return_partial_success = v.map(|x| x.into());
8576            self
8577        }
8578
8579        /// Sets the value of [zone][crate::model::instances::ListRequest::zone].
8580        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8581            self.0.request.zone = v.into();
8582            self
8583        }
8584    }
8585
8586    #[doc(hidden)]
8587    impl gax::options::internal::RequestBuilder for List {
8588        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8589            &mut self.0.options
8590        }
8591    }
8592
8593    /// The request builder for [Instances::list_referrers][crate::client::Instances::list_referrers] calls.
8594    ///
8595    /// # Example
8596    /// ```no_run
8597    /// # use google_cloud_compute_v1::builder;
8598    /// use builder::instances::ListReferrers;
8599    /// # tokio_test::block_on(async {
8600    /// use gax::paginator::ItemPaginator;
8601    ///
8602    /// let builder = prepare_request_builder();
8603    /// let mut items = builder.by_item();
8604    /// while let Some(result) = items.next().await {
8605    ///   let item = result?;
8606    /// }
8607    /// # gax::Result::<()>::Ok(()) });
8608    ///
8609    /// fn prepare_request_builder() -> ListReferrers {
8610    ///   # panic!();
8611    ///   // ... details omitted ...
8612    /// }
8613    /// ```
8614    #[derive(Clone, Debug)]
8615    pub struct ListReferrers(RequestBuilder<crate::model::instances::ListReferrersRequest>);
8616
8617    impl ListReferrers {
8618        pub(crate) fn new(
8619            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8620        ) -> Self {
8621            Self(RequestBuilder::new(stub))
8622        }
8623
8624        /// Sets the full request, replacing any prior values.
8625        pub fn with_request<V: Into<crate::model::instances::ListReferrersRequest>>(
8626            mut self,
8627            v: V,
8628        ) -> Self {
8629            self.0.request = v.into();
8630            self
8631        }
8632
8633        /// Sets all the options, replacing any prior values.
8634        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8635            self.0.options = v.into();
8636            self
8637        }
8638
8639        /// Sends the request.
8640        pub async fn send(self) -> Result<crate::model::InstanceListReferrers> {
8641            (*self.0.stub)
8642                .list_referrers(self.0.request, self.0.options)
8643                .await
8644                .map(gax::response::Response::into_body)
8645        }
8646
8647        /// Streams each page in the collection.
8648        pub fn by_page(
8649            self,
8650        ) -> impl gax::paginator::Paginator<crate::model::InstanceListReferrers, gax::error::Error>
8651        {
8652            use std::clone::Clone;
8653            let token = self.0.request.page_token.clone().unwrap_or_default();
8654            let execute = move |token: String| {
8655                let mut builder = self.clone();
8656                builder.0.request = builder.0.request.set_page_token(token);
8657                builder.send()
8658            };
8659            gax::paginator::internal::new_paginator(token, execute)
8660        }
8661
8662        /// Streams each item in the collection.
8663        pub fn by_item(
8664            self,
8665        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceListReferrers, gax::error::Error>
8666        {
8667            use gax::paginator::Paginator;
8668            self.by_page().items()
8669        }
8670
8671        /// Sets the value of [filter][crate::model::instances::ListReferrersRequest::filter].
8672        pub fn set_filter<T>(mut self, v: T) -> Self
8673        where
8674            T: std::convert::Into<std::string::String>,
8675        {
8676            self.0.request.filter = std::option::Option::Some(v.into());
8677            self
8678        }
8679
8680        /// Sets or clears the value of [filter][crate::model::instances::ListReferrersRequest::filter].
8681        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
8682        where
8683            T: std::convert::Into<std::string::String>,
8684        {
8685            self.0.request.filter = v.map(|x| x.into());
8686            self
8687        }
8688
8689        /// Sets the value of [instance][crate::model::instances::ListReferrersRequest::instance].
8690        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8691            self.0.request.instance = v.into();
8692            self
8693        }
8694
8695        /// Sets the value of [max_results][crate::model::instances::ListReferrersRequest::max_results].
8696        pub fn set_max_results<T>(mut self, v: T) -> Self
8697        where
8698            T: std::convert::Into<u32>,
8699        {
8700            self.0.request.max_results = std::option::Option::Some(v.into());
8701            self
8702        }
8703
8704        /// Sets or clears the value of [max_results][crate::model::instances::ListReferrersRequest::max_results].
8705        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
8706        where
8707            T: std::convert::Into<u32>,
8708        {
8709            self.0.request.max_results = v.map(|x| x.into());
8710            self
8711        }
8712
8713        /// Sets the value of [order_by][crate::model::instances::ListReferrersRequest::order_by].
8714        pub fn set_order_by<T>(mut self, v: T) -> Self
8715        where
8716            T: std::convert::Into<std::string::String>,
8717        {
8718            self.0.request.order_by = std::option::Option::Some(v.into());
8719            self
8720        }
8721
8722        /// Sets or clears the value of [order_by][crate::model::instances::ListReferrersRequest::order_by].
8723        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
8724        where
8725            T: std::convert::Into<std::string::String>,
8726        {
8727            self.0.request.order_by = v.map(|x| x.into());
8728            self
8729        }
8730
8731        /// Sets the value of [page_token][crate::model::instances::ListReferrersRequest::page_token].
8732        pub fn set_page_token<T>(mut self, v: T) -> Self
8733        where
8734            T: std::convert::Into<std::string::String>,
8735        {
8736            self.0.request.page_token = std::option::Option::Some(v.into());
8737            self
8738        }
8739
8740        /// Sets or clears the value of [page_token][crate::model::instances::ListReferrersRequest::page_token].
8741        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
8742        where
8743            T: std::convert::Into<std::string::String>,
8744        {
8745            self.0.request.page_token = v.map(|x| x.into());
8746            self
8747        }
8748
8749        /// Sets the value of [project][crate::model::instances::ListReferrersRequest::project].
8750        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8751            self.0.request.project = v.into();
8752            self
8753        }
8754
8755        /// Sets the value of [return_partial_success][crate::model::instances::ListReferrersRequest::return_partial_success].
8756        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
8757        where
8758            T: std::convert::Into<bool>,
8759        {
8760            self.0.request.return_partial_success = std::option::Option::Some(v.into());
8761            self
8762        }
8763
8764        /// Sets or clears the value of [return_partial_success][crate::model::instances::ListReferrersRequest::return_partial_success].
8765        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
8766        where
8767            T: std::convert::Into<bool>,
8768        {
8769            self.0.request.return_partial_success = v.map(|x| x.into());
8770            self
8771        }
8772
8773        /// Sets the value of [zone][crate::model::instances::ListReferrersRequest::zone].
8774        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8775            self.0.request.zone = v.into();
8776            self
8777        }
8778    }
8779
8780    #[doc(hidden)]
8781    impl gax::options::internal::RequestBuilder for ListReferrers {
8782        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8783            &mut self.0.options
8784        }
8785    }
8786
8787    /// The request builder for [Instances::perform_maintenance][crate::client::Instances::perform_maintenance] calls.
8788    ///
8789    /// # Example
8790    /// ```no_run
8791    /// # use google_cloud_compute_v1::builder;
8792    /// use builder::instances::PerformMaintenance;
8793    /// # tokio_test::block_on(async {
8794    ///
8795    /// let builder = prepare_request_builder();
8796    /// let response = builder.send().await?;
8797    /// # gax::Result::<()>::Ok(()) });
8798    ///
8799    /// fn prepare_request_builder() -> PerformMaintenance {
8800    ///   # panic!();
8801    ///   // ... details omitted ...
8802    /// }
8803    /// ```
8804    #[derive(Clone, Debug)]
8805    pub struct PerformMaintenance(
8806        RequestBuilder<crate::model::instances::PerformMaintenanceRequest>,
8807    );
8808
8809    impl PerformMaintenance {
8810        pub(crate) fn new(
8811            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8812        ) -> Self {
8813            Self(RequestBuilder::new(stub))
8814        }
8815
8816        /// Sets the full request, replacing any prior values.
8817        pub fn with_request<V: Into<crate::model::instances::PerformMaintenanceRequest>>(
8818            mut self,
8819            v: V,
8820        ) -> Self {
8821            self.0.request = v.into();
8822            self
8823        }
8824
8825        /// Sets all the options, replacing any prior values.
8826        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8827            self.0.options = v.into();
8828            self
8829        }
8830
8831        /// Sends the request.
8832        pub async fn send(self) -> Result<crate::model::Operation> {
8833            (*self.0.stub)
8834                .perform_maintenance(self.0.request, self.0.options)
8835                .await
8836                .map(gax::response::Response::into_body)
8837        }
8838
8839        /// Sets the value of [instance][crate::model::instances::PerformMaintenanceRequest::instance].
8840        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8841            self.0.request.instance = v.into();
8842            self
8843        }
8844
8845        /// Sets the value of [project][crate::model::instances::PerformMaintenanceRequest::project].
8846        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8847            self.0.request.project = v.into();
8848            self
8849        }
8850
8851        /// Sets the value of [request_id][crate::model::instances::PerformMaintenanceRequest::request_id].
8852        pub fn set_request_id<T>(mut self, v: T) -> Self
8853        where
8854            T: std::convert::Into<std::string::String>,
8855        {
8856            self.0.request.request_id = std::option::Option::Some(v.into());
8857            self
8858        }
8859
8860        /// Sets or clears the value of [request_id][crate::model::instances::PerformMaintenanceRequest::request_id].
8861        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8862        where
8863            T: std::convert::Into<std::string::String>,
8864        {
8865            self.0.request.request_id = v.map(|x| x.into());
8866            self
8867        }
8868
8869        /// Sets the value of [zone][crate::model::instances::PerformMaintenanceRequest::zone].
8870        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8871            self.0.request.zone = v.into();
8872            self
8873        }
8874    }
8875
8876    #[doc(hidden)]
8877    impl gax::options::internal::RequestBuilder for PerformMaintenance {
8878        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8879            &mut self.0.options
8880        }
8881    }
8882
8883    /// The request builder for [Instances::remove_resource_policies][crate::client::Instances::remove_resource_policies] calls.
8884    ///
8885    /// # Example
8886    /// ```no_run
8887    /// # use google_cloud_compute_v1::builder;
8888    /// use builder::instances::RemoveResourcePolicies;
8889    /// # tokio_test::block_on(async {
8890    ///
8891    /// let builder = prepare_request_builder();
8892    /// let response = builder.send().await?;
8893    /// # gax::Result::<()>::Ok(()) });
8894    ///
8895    /// fn prepare_request_builder() -> RemoveResourcePolicies {
8896    ///   # panic!();
8897    ///   // ... details omitted ...
8898    /// }
8899    /// ```
8900    #[derive(Clone, Debug)]
8901    pub struct RemoveResourcePolicies(
8902        RequestBuilder<crate::model::instances::RemoveResourcePoliciesRequest>,
8903    );
8904
8905    impl RemoveResourcePolicies {
8906        pub(crate) fn new(
8907            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8908        ) -> Self {
8909            Self(RequestBuilder::new(stub))
8910        }
8911
8912        /// Sets the full request, replacing any prior values.
8913        pub fn with_request<V: Into<crate::model::instances::RemoveResourcePoliciesRequest>>(
8914            mut self,
8915            v: V,
8916        ) -> Self {
8917            self.0.request = v.into();
8918            self
8919        }
8920
8921        /// Sets all the options, replacing any prior values.
8922        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8923            self.0.options = v.into();
8924            self
8925        }
8926
8927        /// Sends the request.
8928        pub async fn send(self) -> Result<crate::model::Operation> {
8929            (*self.0.stub)
8930                .remove_resource_policies(self.0.request, self.0.options)
8931                .await
8932                .map(gax::response::Response::into_body)
8933        }
8934
8935        /// Sets the value of [instance][crate::model::instances::RemoveResourcePoliciesRequest::instance].
8936        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8937            self.0.request.instance = v.into();
8938            self
8939        }
8940
8941        /// Sets the value of [project][crate::model::instances::RemoveResourcePoliciesRequest::project].
8942        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8943            self.0.request.project = v.into();
8944            self
8945        }
8946
8947        /// Sets the value of [request_id][crate::model::instances::RemoveResourcePoliciesRequest::request_id].
8948        pub fn set_request_id<T>(mut self, v: T) -> Self
8949        where
8950            T: std::convert::Into<std::string::String>,
8951        {
8952            self.0.request.request_id = std::option::Option::Some(v.into());
8953            self
8954        }
8955
8956        /// Sets or clears the value of [request_id][crate::model::instances::RemoveResourcePoliciesRequest::request_id].
8957        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8958        where
8959            T: std::convert::Into<std::string::String>,
8960        {
8961            self.0.request.request_id = v.map(|x| x.into());
8962            self
8963        }
8964
8965        /// Sets the value of [zone][crate::model::instances::RemoveResourcePoliciesRequest::zone].
8966        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8967            self.0.request.zone = v.into();
8968            self
8969        }
8970
8971        /// Sets the value of [body][crate::model::instances::RemoveResourcePoliciesRequest::body].
8972        pub fn set_body<T>(mut self, v: T) -> Self
8973        where
8974            T: std::convert::Into<crate::model::InstancesRemoveResourcePoliciesRequest>,
8975        {
8976            self.0.request.body = std::option::Option::Some(v.into());
8977            self
8978        }
8979
8980        /// Sets or clears the value of [body][crate::model::instances::RemoveResourcePoliciesRequest::body].
8981        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8982        where
8983            T: std::convert::Into<crate::model::InstancesRemoveResourcePoliciesRequest>,
8984        {
8985            self.0.request.body = v.map(|x| x.into());
8986            self
8987        }
8988    }
8989
8990    #[doc(hidden)]
8991    impl gax::options::internal::RequestBuilder for RemoveResourcePolicies {
8992        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8993            &mut self.0.options
8994        }
8995    }
8996
8997    /// The request builder for [Instances::report_host_as_faulty][crate::client::Instances::report_host_as_faulty] calls.
8998    ///
8999    /// # Example
9000    /// ```no_run
9001    /// # use google_cloud_compute_v1::builder;
9002    /// use builder::instances::ReportHostAsFaulty;
9003    /// # tokio_test::block_on(async {
9004    ///
9005    /// let builder = prepare_request_builder();
9006    /// let response = builder.send().await?;
9007    /// # gax::Result::<()>::Ok(()) });
9008    ///
9009    /// fn prepare_request_builder() -> ReportHostAsFaulty {
9010    ///   # panic!();
9011    ///   // ... details omitted ...
9012    /// }
9013    /// ```
9014    #[derive(Clone, Debug)]
9015    pub struct ReportHostAsFaulty(
9016        RequestBuilder<crate::model::instances::ReportHostAsFaultyRequest>,
9017    );
9018
9019    impl ReportHostAsFaulty {
9020        pub(crate) fn new(
9021            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9022        ) -> Self {
9023            Self(RequestBuilder::new(stub))
9024        }
9025
9026        /// Sets the full request, replacing any prior values.
9027        pub fn with_request<V: Into<crate::model::instances::ReportHostAsFaultyRequest>>(
9028            mut self,
9029            v: V,
9030        ) -> Self {
9031            self.0.request = v.into();
9032            self
9033        }
9034
9035        /// Sets all the options, replacing any prior values.
9036        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9037            self.0.options = v.into();
9038            self
9039        }
9040
9041        /// Sends the request.
9042        pub async fn send(self) -> Result<crate::model::Operation> {
9043            (*self.0.stub)
9044                .report_host_as_faulty(self.0.request, self.0.options)
9045                .await
9046                .map(gax::response::Response::into_body)
9047        }
9048
9049        /// Sets the value of [instance][crate::model::instances::ReportHostAsFaultyRequest::instance].
9050        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9051            self.0.request.instance = v.into();
9052            self
9053        }
9054
9055        /// Sets the value of [project][crate::model::instances::ReportHostAsFaultyRequest::project].
9056        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9057            self.0.request.project = v.into();
9058            self
9059        }
9060
9061        /// Sets the value of [request_id][crate::model::instances::ReportHostAsFaultyRequest::request_id].
9062        pub fn set_request_id<T>(mut self, v: T) -> Self
9063        where
9064            T: std::convert::Into<std::string::String>,
9065        {
9066            self.0.request.request_id = std::option::Option::Some(v.into());
9067            self
9068        }
9069
9070        /// Sets or clears the value of [request_id][crate::model::instances::ReportHostAsFaultyRequest::request_id].
9071        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9072        where
9073            T: std::convert::Into<std::string::String>,
9074        {
9075            self.0.request.request_id = v.map(|x| x.into());
9076            self
9077        }
9078
9079        /// Sets the value of [zone][crate::model::instances::ReportHostAsFaultyRequest::zone].
9080        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9081            self.0.request.zone = v.into();
9082            self
9083        }
9084
9085        /// Sets the value of [body][crate::model::instances::ReportHostAsFaultyRequest::body].
9086        pub fn set_body<T>(mut self, v: T) -> Self
9087        where
9088            T: std::convert::Into<crate::model::InstancesReportHostAsFaultyRequest>,
9089        {
9090            self.0.request.body = std::option::Option::Some(v.into());
9091            self
9092        }
9093
9094        /// Sets or clears the value of [body][crate::model::instances::ReportHostAsFaultyRequest::body].
9095        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9096        where
9097            T: std::convert::Into<crate::model::InstancesReportHostAsFaultyRequest>,
9098        {
9099            self.0.request.body = v.map(|x| x.into());
9100            self
9101        }
9102    }
9103
9104    #[doc(hidden)]
9105    impl gax::options::internal::RequestBuilder for ReportHostAsFaulty {
9106        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9107            &mut self.0.options
9108        }
9109    }
9110
9111    /// The request builder for [Instances::reset][crate::client::Instances::reset] calls.
9112    ///
9113    /// # Example
9114    /// ```no_run
9115    /// # use google_cloud_compute_v1::builder;
9116    /// use builder::instances::Reset;
9117    /// # tokio_test::block_on(async {
9118    ///
9119    /// let builder = prepare_request_builder();
9120    /// let response = builder.send().await?;
9121    /// # gax::Result::<()>::Ok(()) });
9122    ///
9123    /// fn prepare_request_builder() -> Reset {
9124    ///   # panic!();
9125    ///   // ... details omitted ...
9126    /// }
9127    /// ```
9128    #[derive(Clone, Debug)]
9129    pub struct Reset(RequestBuilder<crate::model::instances::ResetRequest>);
9130
9131    impl Reset {
9132        pub(crate) fn new(
9133            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9134        ) -> Self {
9135            Self(RequestBuilder::new(stub))
9136        }
9137
9138        /// Sets the full request, replacing any prior values.
9139        pub fn with_request<V: Into<crate::model::instances::ResetRequest>>(
9140            mut self,
9141            v: V,
9142        ) -> Self {
9143            self.0.request = v.into();
9144            self
9145        }
9146
9147        /// Sets all the options, replacing any prior values.
9148        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9149            self.0.options = v.into();
9150            self
9151        }
9152
9153        /// Sends the request.
9154        pub async fn send(self) -> Result<crate::model::Operation> {
9155            (*self.0.stub)
9156                .reset(self.0.request, self.0.options)
9157                .await
9158                .map(gax::response::Response::into_body)
9159        }
9160
9161        /// Sets the value of [instance][crate::model::instances::ResetRequest::instance].
9162        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9163            self.0.request.instance = v.into();
9164            self
9165        }
9166
9167        /// Sets the value of [project][crate::model::instances::ResetRequest::project].
9168        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9169            self.0.request.project = v.into();
9170            self
9171        }
9172
9173        /// Sets the value of [request_id][crate::model::instances::ResetRequest::request_id].
9174        pub fn set_request_id<T>(mut self, v: T) -> Self
9175        where
9176            T: std::convert::Into<std::string::String>,
9177        {
9178            self.0.request.request_id = std::option::Option::Some(v.into());
9179            self
9180        }
9181
9182        /// Sets or clears the value of [request_id][crate::model::instances::ResetRequest::request_id].
9183        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9184        where
9185            T: std::convert::Into<std::string::String>,
9186        {
9187            self.0.request.request_id = v.map(|x| x.into());
9188            self
9189        }
9190
9191        /// Sets the value of [zone][crate::model::instances::ResetRequest::zone].
9192        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9193            self.0.request.zone = v.into();
9194            self
9195        }
9196    }
9197
9198    #[doc(hidden)]
9199    impl gax::options::internal::RequestBuilder for Reset {
9200        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9201            &mut self.0.options
9202        }
9203    }
9204
9205    /// The request builder for [Instances::resume][crate::client::Instances::resume] calls.
9206    ///
9207    /// # Example
9208    /// ```no_run
9209    /// # use google_cloud_compute_v1::builder;
9210    /// use builder::instances::Resume;
9211    /// # tokio_test::block_on(async {
9212    ///
9213    /// let builder = prepare_request_builder();
9214    /// let response = builder.send().await?;
9215    /// # gax::Result::<()>::Ok(()) });
9216    ///
9217    /// fn prepare_request_builder() -> Resume {
9218    ///   # panic!();
9219    ///   // ... details omitted ...
9220    /// }
9221    /// ```
9222    #[derive(Clone, Debug)]
9223    pub struct Resume(RequestBuilder<crate::model::instances::ResumeRequest>);
9224
9225    impl Resume {
9226        pub(crate) fn new(
9227            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9228        ) -> Self {
9229            Self(RequestBuilder::new(stub))
9230        }
9231
9232        /// Sets the full request, replacing any prior values.
9233        pub fn with_request<V: Into<crate::model::instances::ResumeRequest>>(
9234            mut self,
9235            v: V,
9236        ) -> Self {
9237            self.0.request = v.into();
9238            self
9239        }
9240
9241        /// Sets all the options, replacing any prior values.
9242        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9243            self.0.options = v.into();
9244            self
9245        }
9246
9247        /// Sends the request.
9248        pub async fn send(self) -> Result<crate::model::Operation> {
9249            (*self.0.stub)
9250                .resume(self.0.request, self.0.options)
9251                .await
9252                .map(gax::response::Response::into_body)
9253        }
9254
9255        /// Sets the value of [instance][crate::model::instances::ResumeRequest::instance].
9256        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9257            self.0.request.instance = v.into();
9258            self
9259        }
9260
9261        /// Sets the value of [project][crate::model::instances::ResumeRequest::project].
9262        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9263            self.0.request.project = v.into();
9264            self
9265        }
9266
9267        /// Sets the value of [request_id][crate::model::instances::ResumeRequest::request_id].
9268        pub fn set_request_id<T>(mut self, v: T) -> Self
9269        where
9270            T: std::convert::Into<std::string::String>,
9271        {
9272            self.0.request.request_id = std::option::Option::Some(v.into());
9273            self
9274        }
9275
9276        /// Sets or clears the value of [request_id][crate::model::instances::ResumeRequest::request_id].
9277        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9278        where
9279            T: std::convert::Into<std::string::String>,
9280        {
9281            self.0.request.request_id = v.map(|x| x.into());
9282            self
9283        }
9284
9285        /// Sets the value of [zone][crate::model::instances::ResumeRequest::zone].
9286        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9287            self.0.request.zone = v.into();
9288            self
9289        }
9290    }
9291
9292    #[doc(hidden)]
9293    impl gax::options::internal::RequestBuilder for Resume {
9294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9295            &mut self.0.options
9296        }
9297    }
9298
9299    /// The request builder for [Instances::send_diagnostic_interrupt][crate::client::Instances::send_diagnostic_interrupt] calls.
9300    ///
9301    /// # Example
9302    /// ```no_run
9303    /// # use google_cloud_compute_v1::builder;
9304    /// use builder::instances::SendDiagnosticInterrupt;
9305    /// # tokio_test::block_on(async {
9306    ///
9307    /// let builder = prepare_request_builder();
9308    /// let response = builder.send().await?;
9309    /// # gax::Result::<()>::Ok(()) });
9310    ///
9311    /// fn prepare_request_builder() -> SendDiagnosticInterrupt {
9312    ///   # panic!();
9313    ///   // ... details omitted ...
9314    /// }
9315    /// ```
9316    #[derive(Clone, Debug)]
9317    pub struct SendDiagnosticInterrupt(
9318        RequestBuilder<crate::model::instances::SendDiagnosticInterruptRequest>,
9319    );
9320
9321    impl SendDiagnosticInterrupt {
9322        pub(crate) fn new(
9323            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9324        ) -> Self {
9325            Self(RequestBuilder::new(stub))
9326        }
9327
9328        /// Sets the full request, replacing any prior values.
9329        pub fn with_request<V: Into<crate::model::instances::SendDiagnosticInterruptRequest>>(
9330            mut self,
9331            v: V,
9332        ) -> Self {
9333            self.0.request = v.into();
9334            self
9335        }
9336
9337        /// Sets all the options, replacing any prior values.
9338        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9339            self.0.options = v.into();
9340            self
9341        }
9342
9343        /// Sends the request.
9344        pub async fn send(self) -> Result<wkt::Empty> {
9345            (*self.0.stub)
9346                .send_diagnostic_interrupt(self.0.request, self.0.options)
9347                .await
9348                .map(gax::response::Response::into_body)
9349        }
9350
9351        /// Sets the value of [instance][crate::model::instances::SendDiagnosticInterruptRequest::instance].
9352        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9353            self.0.request.instance = v.into();
9354            self
9355        }
9356
9357        /// Sets the value of [project][crate::model::instances::SendDiagnosticInterruptRequest::project].
9358        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9359            self.0.request.project = v.into();
9360            self
9361        }
9362
9363        /// Sets the value of [zone][crate::model::instances::SendDiagnosticInterruptRequest::zone].
9364        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9365            self.0.request.zone = v.into();
9366            self
9367        }
9368    }
9369
9370    #[doc(hidden)]
9371    impl gax::options::internal::RequestBuilder for SendDiagnosticInterrupt {
9372        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9373            &mut self.0.options
9374        }
9375    }
9376
9377    /// The request builder for [Instances::set_deletion_protection][crate::client::Instances::set_deletion_protection] calls.
9378    ///
9379    /// # Example
9380    /// ```no_run
9381    /// # use google_cloud_compute_v1::builder;
9382    /// use builder::instances::SetDeletionProtection;
9383    /// # tokio_test::block_on(async {
9384    ///
9385    /// let builder = prepare_request_builder();
9386    /// let response = builder.send().await?;
9387    /// # gax::Result::<()>::Ok(()) });
9388    ///
9389    /// fn prepare_request_builder() -> SetDeletionProtection {
9390    ///   # panic!();
9391    ///   // ... details omitted ...
9392    /// }
9393    /// ```
9394    #[derive(Clone, Debug)]
9395    pub struct SetDeletionProtection(
9396        RequestBuilder<crate::model::instances::SetDeletionProtectionRequest>,
9397    );
9398
9399    impl SetDeletionProtection {
9400        pub(crate) fn new(
9401            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9402        ) -> Self {
9403            Self(RequestBuilder::new(stub))
9404        }
9405
9406        /// Sets the full request, replacing any prior values.
9407        pub fn with_request<V: Into<crate::model::instances::SetDeletionProtectionRequest>>(
9408            mut self,
9409            v: V,
9410        ) -> Self {
9411            self.0.request = v.into();
9412            self
9413        }
9414
9415        /// Sets all the options, replacing any prior values.
9416        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9417            self.0.options = v.into();
9418            self
9419        }
9420
9421        /// Sends the request.
9422        pub async fn send(self) -> Result<crate::model::Operation> {
9423            (*self.0.stub)
9424                .set_deletion_protection(self.0.request, self.0.options)
9425                .await
9426                .map(gax::response::Response::into_body)
9427        }
9428
9429        /// Sets the value of [deletion_protection][crate::model::instances::SetDeletionProtectionRequest::deletion_protection].
9430        pub fn set_deletion_protection<T>(mut self, v: T) -> Self
9431        where
9432            T: std::convert::Into<bool>,
9433        {
9434            self.0.request.deletion_protection = std::option::Option::Some(v.into());
9435            self
9436        }
9437
9438        /// Sets or clears the value of [deletion_protection][crate::model::instances::SetDeletionProtectionRequest::deletion_protection].
9439        pub fn set_or_clear_deletion_protection<T>(mut self, v: std::option::Option<T>) -> Self
9440        where
9441            T: std::convert::Into<bool>,
9442        {
9443            self.0.request.deletion_protection = v.map(|x| x.into());
9444            self
9445        }
9446
9447        /// Sets the value of [project][crate::model::instances::SetDeletionProtectionRequest::project].
9448        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9449            self.0.request.project = v.into();
9450            self
9451        }
9452
9453        /// Sets the value of [request_id][crate::model::instances::SetDeletionProtectionRequest::request_id].
9454        pub fn set_request_id<T>(mut self, v: T) -> Self
9455        where
9456            T: std::convert::Into<std::string::String>,
9457        {
9458            self.0.request.request_id = std::option::Option::Some(v.into());
9459            self
9460        }
9461
9462        /// Sets or clears the value of [request_id][crate::model::instances::SetDeletionProtectionRequest::request_id].
9463        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9464        where
9465            T: std::convert::Into<std::string::String>,
9466        {
9467            self.0.request.request_id = v.map(|x| x.into());
9468            self
9469        }
9470
9471        /// Sets the value of [resource][crate::model::instances::SetDeletionProtectionRequest::resource].
9472        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9473            self.0.request.resource = v.into();
9474            self
9475        }
9476
9477        /// Sets the value of [zone][crate::model::instances::SetDeletionProtectionRequest::zone].
9478        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9479            self.0.request.zone = v.into();
9480            self
9481        }
9482    }
9483
9484    #[doc(hidden)]
9485    impl gax::options::internal::RequestBuilder for SetDeletionProtection {
9486        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9487            &mut self.0.options
9488        }
9489    }
9490
9491    /// The request builder for [Instances::set_disk_auto_delete][crate::client::Instances::set_disk_auto_delete] calls.
9492    ///
9493    /// # Example
9494    /// ```no_run
9495    /// # use google_cloud_compute_v1::builder;
9496    /// use builder::instances::SetDiskAutoDelete;
9497    /// # tokio_test::block_on(async {
9498    ///
9499    /// let builder = prepare_request_builder();
9500    /// let response = builder.send().await?;
9501    /// # gax::Result::<()>::Ok(()) });
9502    ///
9503    /// fn prepare_request_builder() -> SetDiskAutoDelete {
9504    ///   # panic!();
9505    ///   // ... details omitted ...
9506    /// }
9507    /// ```
9508    #[derive(Clone, Debug)]
9509    pub struct SetDiskAutoDelete(RequestBuilder<crate::model::instances::SetDiskAutoDeleteRequest>);
9510
9511    impl SetDiskAutoDelete {
9512        pub(crate) fn new(
9513            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9514        ) -> Self {
9515            Self(RequestBuilder::new(stub))
9516        }
9517
9518        /// Sets the full request, replacing any prior values.
9519        pub fn with_request<V: Into<crate::model::instances::SetDiskAutoDeleteRequest>>(
9520            mut self,
9521            v: V,
9522        ) -> Self {
9523            self.0.request = v.into();
9524            self
9525        }
9526
9527        /// Sets all the options, replacing any prior values.
9528        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9529            self.0.options = v.into();
9530            self
9531        }
9532
9533        /// Sends the request.
9534        pub async fn send(self) -> Result<crate::model::Operation> {
9535            (*self.0.stub)
9536                .set_disk_auto_delete(self.0.request, self.0.options)
9537                .await
9538                .map(gax::response::Response::into_body)
9539        }
9540
9541        /// Sets the value of [auto_delete][crate::model::instances::SetDiskAutoDeleteRequest::auto_delete].
9542        pub fn set_auto_delete<T: Into<bool>>(mut self, v: T) -> Self {
9543            self.0.request.auto_delete = v.into();
9544            self
9545        }
9546
9547        /// Sets the value of [device_name][crate::model::instances::SetDiskAutoDeleteRequest::device_name].
9548        pub fn set_device_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9549            self.0.request.device_name = v.into();
9550            self
9551        }
9552
9553        /// Sets the value of [instance][crate::model::instances::SetDiskAutoDeleteRequest::instance].
9554        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9555            self.0.request.instance = v.into();
9556            self
9557        }
9558
9559        /// Sets the value of [project][crate::model::instances::SetDiskAutoDeleteRequest::project].
9560        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9561            self.0.request.project = v.into();
9562            self
9563        }
9564
9565        /// Sets the value of [request_id][crate::model::instances::SetDiskAutoDeleteRequest::request_id].
9566        pub fn set_request_id<T>(mut self, v: T) -> Self
9567        where
9568            T: std::convert::Into<std::string::String>,
9569        {
9570            self.0.request.request_id = std::option::Option::Some(v.into());
9571            self
9572        }
9573
9574        /// Sets or clears the value of [request_id][crate::model::instances::SetDiskAutoDeleteRequest::request_id].
9575        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9576        where
9577            T: std::convert::Into<std::string::String>,
9578        {
9579            self.0.request.request_id = v.map(|x| x.into());
9580            self
9581        }
9582
9583        /// Sets the value of [zone][crate::model::instances::SetDiskAutoDeleteRequest::zone].
9584        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9585            self.0.request.zone = v.into();
9586            self
9587        }
9588    }
9589
9590    #[doc(hidden)]
9591    impl gax::options::internal::RequestBuilder for SetDiskAutoDelete {
9592        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9593            &mut self.0.options
9594        }
9595    }
9596
9597    /// The request builder for [Instances::set_iam_policy][crate::client::Instances::set_iam_policy] calls.
9598    ///
9599    /// # Example
9600    /// ```no_run
9601    /// # use google_cloud_compute_v1::builder;
9602    /// use builder::instances::SetIamPolicy;
9603    /// # tokio_test::block_on(async {
9604    ///
9605    /// let builder = prepare_request_builder();
9606    /// let response = builder.send().await?;
9607    /// # gax::Result::<()>::Ok(()) });
9608    ///
9609    /// fn prepare_request_builder() -> SetIamPolicy {
9610    ///   # panic!();
9611    ///   // ... details omitted ...
9612    /// }
9613    /// ```
9614    #[derive(Clone, Debug)]
9615    pub struct SetIamPolicy(RequestBuilder<crate::model::instances::SetIamPolicyRequest>);
9616
9617    impl SetIamPolicy {
9618        pub(crate) fn new(
9619            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9620        ) -> Self {
9621            Self(RequestBuilder::new(stub))
9622        }
9623
9624        /// Sets the full request, replacing any prior values.
9625        pub fn with_request<V: Into<crate::model::instances::SetIamPolicyRequest>>(
9626            mut self,
9627            v: V,
9628        ) -> Self {
9629            self.0.request = v.into();
9630            self
9631        }
9632
9633        /// Sets all the options, replacing any prior values.
9634        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9635            self.0.options = v.into();
9636            self
9637        }
9638
9639        /// Sends the request.
9640        pub async fn send(self) -> Result<crate::model::Policy> {
9641            (*self.0.stub)
9642                .set_iam_policy(self.0.request, self.0.options)
9643                .await
9644                .map(gax::response::Response::into_body)
9645        }
9646
9647        /// Sets the value of [project][crate::model::instances::SetIamPolicyRequest::project].
9648        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9649            self.0.request.project = v.into();
9650            self
9651        }
9652
9653        /// Sets the value of [resource][crate::model::instances::SetIamPolicyRequest::resource].
9654        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9655            self.0.request.resource = v.into();
9656            self
9657        }
9658
9659        /// Sets the value of [zone][crate::model::instances::SetIamPolicyRequest::zone].
9660        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9661            self.0.request.zone = v.into();
9662            self
9663        }
9664
9665        /// Sets the value of [body][crate::model::instances::SetIamPolicyRequest::body].
9666        pub fn set_body<T>(mut self, v: T) -> Self
9667        where
9668            T: std::convert::Into<crate::model::ZoneSetPolicyRequest>,
9669        {
9670            self.0.request.body = std::option::Option::Some(v.into());
9671            self
9672        }
9673
9674        /// Sets or clears the value of [body][crate::model::instances::SetIamPolicyRequest::body].
9675        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9676        where
9677            T: std::convert::Into<crate::model::ZoneSetPolicyRequest>,
9678        {
9679            self.0.request.body = v.map(|x| x.into());
9680            self
9681        }
9682    }
9683
9684    #[doc(hidden)]
9685    impl gax::options::internal::RequestBuilder for SetIamPolicy {
9686        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9687            &mut self.0.options
9688        }
9689    }
9690
9691    /// The request builder for [Instances::set_labels][crate::client::Instances::set_labels] calls.
9692    ///
9693    /// # Example
9694    /// ```no_run
9695    /// # use google_cloud_compute_v1::builder;
9696    /// use builder::instances::SetLabels;
9697    /// # tokio_test::block_on(async {
9698    ///
9699    /// let builder = prepare_request_builder();
9700    /// let response = builder.send().await?;
9701    /// # gax::Result::<()>::Ok(()) });
9702    ///
9703    /// fn prepare_request_builder() -> SetLabels {
9704    ///   # panic!();
9705    ///   // ... details omitted ...
9706    /// }
9707    /// ```
9708    #[derive(Clone, Debug)]
9709    pub struct SetLabels(RequestBuilder<crate::model::instances::SetLabelsRequest>);
9710
9711    impl SetLabels {
9712        pub(crate) fn new(
9713            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9714        ) -> Self {
9715            Self(RequestBuilder::new(stub))
9716        }
9717
9718        /// Sets the full request, replacing any prior values.
9719        pub fn with_request<V: Into<crate::model::instances::SetLabelsRequest>>(
9720            mut self,
9721            v: V,
9722        ) -> Self {
9723            self.0.request = v.into();
9724            self
9725        }
9726
9727        /// Sets all the options, replacing any prior values.
9728        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9729            self.0.options = v.into();
9730            self
9731        }
9732
9733        /// Sends the request.
9734        pub async fn send(self) -> Result<crate::model::Operation> {
9735            (*self.0.stub)
9736                .set_labels(self.0.request, self.0.options)
9737                .await
9738                .map(gax::response::Response::into_body)
9739        }
9740
9741        /// Sets the value of [instance][crate::model::instances::SetLabelsRequest::instance].
9742        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9743            self.0.request.instance = v.into();
9744            self
9745        }
9746
9747        /// Sets the value of [project][crate::model::instances::SetLabelsRequest::project].
9748        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9749            self.0.request.project = v.into();
9750            self
9751        }
9752
9753        /// Sets the value of [request_id][crate::model::instances::SetLabelsRequest::request_id].
9754        pub fn set_request_id<T>(mut self, v: T) -> Self
9755        where
9756            T: std::convert::Into<std::string::String>,
9757        {
9758            self.0.request.request_id = std::option::Option::Some(v.into());
9759            self
9760        }
9761
9762        /// Sets or clears the value of [request_id][crate::model::instances::SetLabelsRequest::request_id].
9763        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9764        where
9765            T: std::convert::Into<std::string::String>,
9766        {
9767            self.0.request.request_id = v.map(|x| x.into());
9768            self
9769        }
9770
9771        /// Sets the value of [zone][crate::model::instances::SetLabelsRequest::zone].
9772        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9773            self.0.request.zone = v.into();
9774            self
9775        }
9776
9777        /// Sets the value of [body][crate::model::instances::SetLabelsRequest::body].
9778        pub fn set_body<T>(mut self, v: T) -> Self
9779        where
9780            T: std::convert::Into<crate::model::InstancesSetLabelsRequest>,
9781        {
9782            self.0.request.body = std::option::Option::Some(v.into());
9783            self
9784        }
9785
9786        /// Sets or clears the value of [body][crate::model::instances::SetLabelsRequest::body].
9787        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9788        where
9789            T: std::convert::Into<crate::model::InstancesSetLabelsRequest>,
9790        {
9791            self.0.request.body = v.map(|x| x.into());
9792            self
9793        }
9794    }
9795
9796    #[doc(hidden)]
9797    impl gax::options::internal::RequestBuilder for SetLabels {
9798        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9799            &mut self.0.options
9800        }
9801    }
9802
9803    /// The request builder for [Instances::set_machine_resources][crate::client::Instances::set_machine_resources] calls.
9804    ///
9805    /// # Example
9806    /// ```no_run
9807    /// # use google_cloud_compute_v1::builder;
9808    /// use builder::instances::SetMachineResources;
9809    /// # tokio_test::block_on(async {
9810    ///
9811    /// let builder = prepare_request_builder();
9812    /// let response = builder.send().await?;
9813    /// # gax::Result::<()>::Ok(()) });
9814    ///
9815    /// fn prepare_request_builder() -> SetMachineResources {
9816    ///   # panic!();
9817    ///   // ... details omitted ...
9818    /// }
9819    /// ```
9820    #[derive(Clone, Debug)]
9821    pub struct SetMachineResources(
9822        RequestBuilder<crate::model::instances::SetMachineResourcesRequest>,
9823    );
9824
9825    impl SetMachineResources {
9826        pub(crate) fn new(
9827            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9828        ) -> Self {
9829            Self(RequestBuilder::new(stub))
9830        }
9831
9832        /// Sets the full request, replacing any prior values.
9833        pub fn with_request<V: Into<crate::model::instances::SetMachineResourcesRequest>>(
9834            mut self,
9835            v: V,
9836        ) -> Self {
9837            self.0.request = v.into();
9838            self
9839        }
9840
9841        /// Sets all the options, replacing any prior values.
9842        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9843            self.0.options = v.into();
9844            self
9845        }
9846
9847        /// Sends the request.
9848        pub async fn send(self) -> Result<crate::model::Operation> {
9849            (*self.0.stub)
9850                .set_machine_resources(self.0.request, self.0.options)
9851                .await
9852                .map(gax::response::Response::into_body)
9853        }
9854
9855        /// Sets the value of [instance][crate::model::instances::SetMachineResourcesRequest::instance].
9856        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9857            self.0.request.instance = v.into();
9858            self
9859        }
9860
9861        /// Sets the value of [project][crate::model::instances::SetMachineResourcesRequest::project].
9862        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9863            self.0.request.project = v.into();
9864            self
9865        }
9866
9867        /// Sets the value of [request_id][crate::model::instances::SetMachineResourcesRequest::request_id].
9868        pub fn set_request_id<T>(mut self, v: T) -> Self
9869        where
9870            T: std::convert::Into<std::string::String>,
9871        {
9872            self.0.request.request_id = std::option::Option::Some(v.into());
9873            self
9874        }
9875
9876        /// Sets or clears the value of [request_id][crate::model::instances::SetMachineResourcesRequest::request_id].
9877        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9878        where
9879            T: std::convert::Into<std::string::String>,
9880        {
9881            self.0.request.request_id = v.map(|x| x.into());
9882            self
9883        }
9884
9885        /// Sets the value of [zone][crate::model::instances::SetMachineResourcesRequest::zone].
9886        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9887            self.0.request.zone = v.into();
9888            self
9889        }
9890
9891        /// Sets the value of [body][crate::model::instances::SetMachineResourcesRequest::body].
9892        pub fn set_body<T>(mut self, v: T) -> Self
9893        where
9894            T: std::convert::Into<crate::model::InstancesSetMachineResourcesRequest>,
9895        {
9896            self.0.request.body = std::option::Option::Some(v.into());
9897            self
9898        }
9899
9900        /// Sets or clears the value of [body][crate::model::instances::SetMachineResourcesRequest::body].
9901        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9902        where
9903            T: std::convert::Into<crate::model::InstancesSetMachineResourcesRequest>,
9904        {
9905            self.0.request.body = v.map(|x| x.into());
9906            self
9907        }
9908    }
9909
9910    #[doc(hidden)]
9911    impl gax::options::internal::RequestBuilder for SetMachineResources {
9912        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9913            &mut self.0.options
9914        }
9915    }
9916
9917    /// The request builder for [Instances::set_machine_type][crate::client::Instances::set_machine_type] calls.
9918    ///
9919    /// # Example
9920    /// ```no_run
9921    /// # use google_cloud_compute_v1::builder;
9922    /// use builder::instances::SetMachineType;
9923    /// # tokio_test::block_on(async {
9924    ///
9925    /// let builder = prepare_request_builder();
9926    /// let response = builder.send().await?;
9927    /// # gax::Result::<()>::Ok(()) });
9928    ///
9929    /// fn prepare_request_builder() -> SetMachineType {
9930    ///   # panic!();
9931    ///   // ... details omitted ...
9932    /// }
9933    /// ```
9934    #[derive(Clone, Debug)]
9935    pub struct SetMachineType(RequestBuilder<crate::model::instances::SetMachineTypeRequest>);
9936
9937    impl SetMachineType {
9938        pub(crate) fn new(
9939            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9940        ) -> Self {
9941            Self(RequestBuilder::new(stub))
9942        }
9943
9944        /// Sets the full request, replacing any prior values.
9945        pub fn with_request<V: Into<crate::model::instances::SetMachineTypeRequest>>(
9946            mut self,
9947            v: V,
9948        ) -> Self {
9949            self.0.request = v.into();
9950            self
9951        }
9952
9953        /// Sets all the options, replacing any prior values.
9954        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9955            self.0.options = v.into();
9956            self
9957        }
9958
9959        /// Sends the request.
9960        pub async fn send(self) -> Result<crate::model::Operation> {
9961            (*self.0.stub)
9962                .set_machine_type(self.0.request, self.0.options)
9963                .await
9964                .map(gax::response::Response::into_body)
9965        }
9966
9967        /// Sets the value of [instance][crate::model::instances::SetMachineTypeRequest::instance].
9968        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9969            self.0.request.instance = v.into();
9970            self
9971        }
9972
9973        /// Sets the value of [project][crate::model::instances::SetMachineTypeRequest::project].
9974        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9975            self.0.request.project = v.into();
9976            self
9977        }
9978
9979        /// Sets the value of [request_id][crate::model::instances::SetMachineTypeRequest::request_id].
9980        pub fn set_request_id<T>(mut self, v: T) -> Self
9981        where
9982            T: std::convert::Into<std::string::String>,
9983        {
9984            self.0.request.request_id = std::option::Option::Some(v.into());
9985            self
9986        }
9987
9988        /// Sets or clears the value of [request_id][crate::model::instances::SetMachineTypeRequest::request_id].
9989        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9990        where
9991            T: std::convert::Into<std::string::String>,
9992        {
9993            self.0.request.request_id = v.map(|x| x.into());
9994            self
9995        }
9996
9997        /// Sets the value of [zone][crate::model::instances::SetMachineTypeRequest::zone].
9998        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9999            self.0.request.zone = v.into();
10000            self
10001        }
10002
10003        /// Sets the value of [body][crate::model::instances::SetMachineTypeRequest::body].
10004        pub fn set_body<T>(mut self, v: T) -> Self
10005        where
10006            T: std::convert::Into<crate::model::InstancesSetMachineTypeRequest>,
10007        {
10008            self.0.request.body = std::option::Option::Some(v.into());
10009            self
10010        }
10011
10012        /// Sets or clears the value of [body][crate::model::instances::SetMachineTypeRequest::body].
10013        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10014        where
10015            T: std::convert::Into<crate::model::InstancesSetMachineTypeRequest>,
10016        {
10017            self.0.request.body = v.map(|x| x.into());
10018            self
10019        }
10020    }
10021
10022    #[doc(hidden)]
10023    impl gax::options::internal::RequestBuilder for SetMachineType {
10024        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10025            &mut self.0.options
10026        }
10027    }
10028
10029    /// The request builder for [Instances::set_metadata][crate::client::Instances::set_metadata] calls.
10030    ///
10031    /// # Example
10032    /// ```no_run
10033    /// # use google_cloud_compute_v1::builder;
10034    /// use builder::instances::SetMetadata;
10035    /// # tokio_test::block_on(async {
10036    ///
10037    /// let builder = prepare_request_builder();
10038    /// let response = builder.send().await?;
10039    /// # gax::Result::<()>::Ok(()) });
10040    ///
10041    /// fn prepare_request_builder() -> SetMetadata {
10042    ///   # panic!();
10043    ///   // ... details omitted ...
10044    /// }
10045    /// ```
10046    #[derive(Clone, Debug)]
10047    pub struct SetMetadata(RequestBuilder<crate::model::instances::SetMetadataRequest>);
10048
10049    impl SetMetadata {
10050        pub(crate) fn new(
10051            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10052        ) -> Self {
10053            Self(RequestBuilder::new(stub))
10054        }
10055
10056        /// Sets the full request, replacing any prior values.
10057        pub fn with_request<V: Into<crate::model::instances::SetMetadataRequest>>(
10058            mut self,
10059            v: V,
10060        ) -> Self {
10061            self.0.request = v.into();
10062            self
10063        }
10064
10065        /// Sets all the options, replacing any prior values.
10066        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10067            self.0.options = v.into();
10068            self
10069        }
10070
10071        /// Sends the request.
10072        pub async fn send(self) -> Result<crate::model::Operation> {
10073            (*self.0.stub)
10074                .set_metadata(self.0.request, self.0.options)
10075                .await
10076                .map(gax::response::Response::into_body)
10077        }
10078
10079        /// Sets the value of [instance][crate::model::instances::SetMetadataRequest::instance].
10080        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10081            self.0.request.instance = v.into();
10082            self
10083        }
10084
10085        /// Sets the value of [project][crate::model::instances::SetMetadataRequest::project].
10086        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10087            self.0.request.project = v.into();
10088            self
10089        }
10090
10091        /// Sets the value of [request_id][crate::model::instances::SetMetadataRequest::request_id].
10092        pub fn set_request_id<T>(mut self, v: T) -> Self
10093        where
10094            T: std::convert::Into<std::string::String>,
10095        {
10096            self.0.request.request_id = std::option::Option::Some(v.into());
10097            self
10098        }
10099
10100        /// Sets or clears the value of [request_id][crate::model::instances::SetMetadataRequest::request_id].
10101        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10102        where
10103            T: std::convert::Into<std::string::String>,
10104        {
10105            self.0.request.request_id = v.map(|x| x.into());
10106            self
10107        }
10108
10109        /// Sets the value of [zone][crate::model::instances::SetMetadataRequest::zone].
10110        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10111            self.0.request.zone = v.into();
10112            self
10113        }
10114
10115        /// Sets the value of [body][crate::model::instances::SetMetadataRequest::body].
10116        pub fn set_body<T>(mut self, v: T) -> Self
10117        where
10118            T: std::convert::Into<crate::model::Metadata>,
10119        {
10120            self.0.request.body = std::option::Option::Some(v.into());
10121            self
10122        }
10123
10124        /// Sets or clears the value of [body][crate::model::instances::SetMetadataRequest::body].
10125        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10126        where
10127            T: std::convert::Into<crate::model::Metadata>,
10128        {
10129            self.0.request.body = v.map(|x| x.into());
10130            self
10131        }
10132    }
10133
10134    #[doc(hidden)]
10135    impl gax::options::internal::RequestBuilder for SetMetadata {
10136        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10137            &mut self.0.options
10138        }
10139    }
10140
10141    /// The request builder for [Instances::set_min_cpu_platform][crate::client::Instances::set_min_cpu_platform] calls.
10142    ///
10143    /// # Example
10144    /// ```no_run
10145    /// # use google_cloud_compute_v1::builder;
10146    /// use builder::instances::SetMinCpuPlatform;
10147    /// # tokio_test::block_on(async {
10148    ///
10149    /// let builder = prepare_request_builder();
10150    /// let response = builder.send().await?;
10151    /// # gax::Result::<()>::Ok(()) });
10152    ///
10153    /// fn prepare_request_builder() -> SetMinCpuPlatform {
10154    ///   # panic!();
10155    ///   // ... details omitted ...
10156    /// }
10157    /// ```
10158    #[derive(Clone, Debug)]
10159    pub struct SetMinCpuPlatform(RequestBuilder<crate::model::instances::SetMinCpuPlatformRequest>);
10160
10161    impl SetMinCpuPlatform {
10162        pub(crate) fn new(
10163            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10164        ) -> Self {
10165            Self(RequestBuilder::new(stub))
10166        }
10167
10168        /// Sets the full request, replacing any prior values.
10169        pub fn with_request<V: Into<crate::model::instances::SetMinCpuPlatformRequest>>(
10170            mut self,
10171            v: V,
10172        ) -> Self {
10173            self.0.request = v.into();
10174            self
10175        }
10176
10177        /// Sets all the options, replacing any prior values.
10178        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10179            self.0.options = v.into();
10180            self
10181        }
10182
10183        /// Sends the request.
10184        pub async fn send(self) -> Result<crate::model::Operation> {
10185            (*self.0.stub)
10186                .set_min_cpu_platform(self.0.request, self.0.options)
10187                .await
10188                .map(gax::response::Response::into_body)
10189        }
10190
10191        /// Sets the value of [instance][crate::model::instances::SetMinCpuPlatformRequest::instance].
10192        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10193            self.0.request.instance = v.into();
10194            self
10195        }
10196
10197        /// Sets the value of [project][crate::model::instances::SetMinCpuPlatformRequest::project].
10198        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10199            self.0.request.project = v.into();
10200            self
10201        }
10202
10203        /// Sets the value of [request_id][crate::model::instances::SetMinCpuPlatformRequest::request_id].
10204        pub fn set_request_id<T>(mut self, v: T) -> Self
10205        where
10206            T: std::convert::Into<std::string::String>,
10207        {
10208            self.0.request.request_id = std::option::Option::Some(v.into());
10209            self
10210        }
10211
10212        /// Sets or clears the value of [request_id][crate::model::instances::SetMinCpuPlatformRequest::request_id].
10213        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10214        where
10215            T: std::convert::Into<std::string::String>,
10216        {
10217            self.0.request.request_id = v.map(|x| x.into());
10218            self
10219        }
10220
10221        /// Sets the value of [zone][crate::model::instances::SetMinCpuPlatformRequest::zone].
10222        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10223            self.0.request.zone = v.into();
10224            self
10225        }
10226
10227        /// Sets the value of [body][crate::model::instances::SetMinCpuPlatformRequest::body].
10228        pub fn set_body<T>(mut self, v: T) -> Self
10229        where
10230            T: std::convert::Into<crate::model::InstancesSetMinCpuPlatformRequest>,
10231        {
10232            self.0.request.body = std::option::Option::Some(v.into());
10233            self
10234        }
10235
10236        /// Sets or clears the value of [body][crate::model::instances::SetMinCpuPlatformRequest::body].
10237        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10238        where
10239            T: std::convert::Into<crate::model::InstancesSetMinCpuPlatformRequest>,
10240        {
10241            self.0.request.body = v.map(|x| x.into());
10242            self
10243        }
10244    }
10245
10246    #[doc(hidden)]
10247    impl gax::options::internal::RequestBuilder for SetMinCpuPlatform {
10248        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10249            &mut self.0.options
10250        }
10251    }
10252
10253    /// The request builder for [Instances::set_name][crate::client::Instances::set_name] calls.
10254    ///
10255    /// # Example
10256    /// ```no_run
10257    /// # use google_cloud_compute_v1::builder;
10258    /// use builder::instances::SetName;
10259    /// # tokio_test::block_on(async {
10260    ///
10261    /// let builder = prepare_request_builder();
10262    /// let response = builder.send().await?;
10263    /// # gax::Result::<()>::Ok(()) });
10264    ///
10265    /// fn prepare_request_builder() -> SetName {
10266    ///   # panic!();
10267    ///   // ... details omitted ...
10268    /// }
10269    /// ```
10270    #[derive(Clone, Debug)]
10271    pub struct SetName(RequestBuilder<crate::model::instances::SetNameRequest>);
10272
10273    impl SetName {
10274        pub(crate) fn new(
10275            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10276        ) -> Self {
10277            Self(RequestBuilder::new(stub))
10278        }
10279
10280        /// Sets the full request, replacing any prior values.
10281        pub fn with_request<V: Into<crate::model::instances::SetNameRequest>>(
10282            mut self,
10283            v: V,
10284        ) -> Self {
10285            self.0.request = v.into();
10286            self
10287        }
10288
10289        /// Sets all the options, replacing any prior values.
10290        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10291            self.0.options = v.into();
10292            self
10293        }
10294
10295        /// Sends the request.
10296        pub async fn send(self) -> Result<crate::model::Operation> {
10297            (*self.0.stub)
10298                .set_name(self.0.request, self.0.options)
10299                .await
10300                .map(gax::response::Response::into_body)
10301        }
10302
10303        /// Sets the value of [instance][crate::model::instances::SetNameRequest::instance].
10304        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10305            self.0.request.instance = v.into();
10306            self
10307        }
10308
10309        /// Sets the value of [project][crate::model::instances::SetNameRequest::project].
10310        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10311            self.0.request.project = v.into();
10312            self
10313        }
10314
10315        /// Sets the value of [request_id][crate::model::instances::SetNameRequest::request_id].
10316        pub fn set_request_id<T>(mut self, v: T) -> Self
10317        where
10318            T: std::convert::Into<std::string::String>,
10319        {
10320            self.0.request.request_id = std::option::Option::Some(v.into());
10321            self
10322        }
10323
10324        /// Sets or clears the value of [request_id][crate::model::instances::SetNameRequest::request_id].
10325        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10326        where
10327            T: std::convert::Into<std::string::String>,
10328        {
10329            self.0.request.request_id = v.map(|x| x.into());
10330            self
10331        }
10332
10333        /// Sets the value of [zone][crate::model::instances::SetNameRequest::zone].
10334        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10335            self.0.request.zone = v.into();
10336            self
10337        }
10338
10339        /// Sets the value of [body][crate::model::instances::SetNameRequest::body].
10340        pub fn set_body<T>(mut self, v: T) -> Self
10341        where
10342            T: std::convert::Into<crate::model::InstancesSetNameRequest>,
10343        {
10344            self.0.request.body = std::option::Option::Some(v.into());
10345            self
10346        }
10347
10348        /// Sets or clears the value of [body][crate::model::instances::SetNameRequest::body].
10349        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10350        where
10351            T: std::convert::Into<crate::model::InstancesSetNameRequest>,
10352        {
10353            self.0.request.body = v.map(|x| x.into());
10354            self
10355        }
10356    }
10357
10358    #[doc(hidden)]
10359    impl gax::options::internal::RequestBuilder for SetName {
10360        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10361            &mut self.0.options
10362        }
10363    }
10364
10365    /// The request builder for [Instances::set_scheduling][crate::client::Instances::set_scheduling] calls.
10366    ///
10367    /// # Example
10368    /// ```no_run
10369    /// # use google_cloud_compute_v1::builder;
10370    /// use builder::instances::SetScheduling;
10371    /// # tokio_test::block_on(async {
10372    ///
10373    /// let builder = prepare_request_builder();
10374    /// let response = builder.send().await?;
10375    /// # gax::Result::<()>::Ok(()) });
10376    ///
10377    /// fn prepare_request_builder() -> SetScheduling {
10378    ///   # panic!();
10379    ///   // ... details omitted ...
10380    /// }
10381    /// ```
10382    #[derive(Clone, Debug)]
10383    pub struct SetScheduling(RequestBuilder<crate::model::instances::SetSchedulingRequest>);
10384
10385    impl SetScheduling {
10386        pub(crate) fn new(
10387            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10388        ) -> Self {
10389            Self(RequestBuilder::new(stub))
10390        }
10391
10392        /// Sets the full request, replacing any prior values.
10393        pub fn with_request<V: Into<crate::model::instances::SetSchedulingRequest>>(
10394            mut self,
10395            v: V,
10396        ) -> Self {
10397            self.0.request = v.into();
10398            self
10399        }
10400
10401        /// Sets all the options, replacing any prior values.
10402        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10403            self.0.options = v.into();
10404            self
10405        }
10406
10407        /// Sends the request.
10408        pub async fn send(self) -> Result<crate::model::Operation> {
10409            (*self.0.stub)
10410                .set_scheduling(self.0.request, self.0.options)
10411                .await
10412                .map(gax::response::Response::into_body)
10413        }
10414
10415        /// Sets the value of [instance][crate::model::instances::SetSchedulingRequest::instance].
10416        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10417            self.0.request.instance = v.into();
10418            self
10419        }
10420
10421        /// Sets the value of [project][crate::model::instances::SetSchedulingRequest::project].
10422        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10423            self.0.request.project = v.into();
10424            self
10425        }
10426
10427        /// Sets the value of [request_id][crate::model::instances::SetSchedulingRequest::request_id].
10428        pub fn set_request_id<T>(mut self, v: T) -> Self
10429        where
10430            T: std::convert::Into<std::string::String>,
10431        {
10432            self.0.request.request_id = std::option::Option::Some(v.into());
10433            self
10434        }
10435
10436        /// Sets or clears the value of [request_id][crate::model::instances::SetSchedulingRequest::request_id].
10437        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10438        where
10439            T: std::convert::Into<std::string::String>,
10440        {
10441            self.0.request.request_id = v.map(|x| x.into());
10442            self
10443        }
10444
10445        /// Sets the value of [zone][crate::model::instances::SetSchedulingRequest::zone].
10446        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10447            self.0.request.zone = v.into();
10448            self
10449        }
10450
10451        /// Sets the value of [body][crate::model::instances::SetSchedulingRequest::body].
10452        pub fn set_body<T>(mut self, v: T) -> Self
10453        where
10454            T: std::convert::Into<crate::model::Scheduling>,
10455        {
10456            self.0.request.body = std::option::Option::Some(v.into());
10457            self
10458        }
10459
10460        /// Sets or clears the value of [body][crate::model::instances::SetSchedulingRequest::body].
10461        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10462        where
10463            T: std::convert::Into<crate::model::Scheduling>,
10464        {
10465            self.0.request.body = v.map(|x| x.into());
10466            self
10467        }
10468    }
10469
10470    #[doc(hidden)]
10471    impl gax::options::internal::RequestBuilder for SetScheduling {
10472        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10473            &mut self.0.options
10474        }
10475    }
10476
10477    /// The request builder for [Instances::set_security_policy][crate::client::Instances::set_security_policy] calls.
10478    ///
10479    /// # Example
10480    /// ```no_run
10481    /// # use google_cloud_compute_v1::builder;
10482    /// use builder::instances::SetSecurityPolicy;
10483    /// # tokio_test::block_on(async {
10484    ///
10485    /// let builder = prepare_request_builder();
10486    /// let response = builder.send().await?;
10487    /// # gax::Result::<()>::Ok(()) });
10488    ///
10489    /// fn prepare_request_builder() -> SetSecurityPolicy {
10490    ///   # panic!();
10491    ///   // ... details omitted ...
10492    /// }
10493    /// ```
10494    #[derive(Clone, Debug)]
10495    pub struct SetSecurityPolicy(RequestBuilder<crate::model::instances::SetSecurityPolicyRequest>);
10496
10497    impl SetSecurityPolicy {
10498        pub(crate) fn new(
10499            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10500        ) -> Self {
10501            Self(RequestBuilder::new(stub))
10502        }
10503
10504        /// Sets the full request, replacing any prior values.
10505        pub fn with_request<V: Into<crate::model::instances::SetSecurityPolicyRequest>>(
10506            mut self,
10507            v: V,
10508        ) -> Self {
10509            self.0.request = v.into();
10510            self
10511        }
10512
10513        /// Sets all the options, replacing any prior values.
10514        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10515            self.0.options = v.into();
10516            self
10517        }
10518
10519        /// Sends the request.
10520        pub async fn send(self) -> Result<crate::model::Operation> {
10521            (*self.0.stub)
10522                .set_security_policy(self.0.request, self.0.options)
10523                .await
10524                .map(gax::response::Response::into_body)
10525        }
10526
10527        /// Sets the value of [instance][crate::model::instances::SetSecurityPolicyRequest::instance].
10528        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10529            self.0.request.instance = v.into();
10530            self
10531        }
10532
10533        /// Sets the value of [project][crate::model::instances::SetSecurityPolicyRequest::project].
10534        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10535            self.0.request.project = v.into();
10536            self
10537        }
10538
10539        /// Sets the value of [request_id][crate::model::instances::SetSecurityPolicyRequest::request_id].
10540        pub fn set_request_id<T>(mut self, v: T) -> Self
10541        where
10542            T: std::convert::Into<std::string::String>,
10543        {
10544            self.0.request.request_id = std::option::Option::Some(v.into());
10545            self
10546        }
10547
10548        /// Sets or clears the value of [request_id][crate::model::instances::SetSecurityPolicyRequest::request_id].
10549        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10550        where
10551            T: std::convert::Into<std::string::String>,
10552        {
10553            self.0.request.request_id = v.map(|x| x.into());
10554            self
10555        }
10556
10557        /// Sets the value of [zone][crate::model::instances::SetSecurityPolicyRequest::zone].
10558        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10559            self.0.request.zone = v.into();
10560            self
10561        }
10562
10563        /// Sets the value of [body][crate::model::instances::SetSecurityPolicyRequest::body].
10564        pub fn set_body<T>(mut self, v: T) -> Self
10565        where
10566            T: std::convert::Into<crate::model::InstancesSetSecurityPolicyRequest>,
10567        {
10568            self.0.request.body = std::option::Option::Some(v.into());
10569            self
10570        }
10571
10572        /// Sets or clears the value of [body][crate::model::instances::SetSecurityPolicyRequest::body].
10573        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10574        where
10575            T: std::convert::Into<crate::model::InstancesSetSecurityPolicyRequest>,
10576        {
10577            self.0.request.body = v.map(|x| x.into());
10578            self
10579        }
10580    }
10581
10582    #[doc(hidden)]
10583    impl gax::options::internal::RequestBuilder for SetSecurityPolicy {
10584        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10585            &mut self.0.options
10586        }
10587    }
10588
10589    /// The request builder for [Instances::set_service_account][crate::client::Instances::set_service_account] calls.
10590    ///
10591    /// # Example
10592    /// ```no_run
10593    /// # use google_cloud_compute_v1::builder;
10594    /// use builder::instances::SetServiceAccount;
10595    /// # tokio_test::block_on(async {
10596    ///
10597    /// let builder = prepare_request_builder();
10598    /// let response = builder.send().await?;
10599    /// # gax::Result::<()>::Ok(()) });
10600    ///
10601    /// fn prepare_request_builder() -> SetServiceAccount {
10602    ///   # panic!();
10603    ///   // ... details omitted ...
10604    /// }
10605    /// ```
10606    #[derive(Clone, Debug)]
10607    pub struct SetServiceAccount(RequestBuilder<crate::model::instances::SetServiceAccountRequest>);
10608
10609    impl SetServiceAccount {
10610        pub(crate) fn new(
10611            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10612        ) -> Self {
10613            Self(RequestBuilder::new(stub))
10614        }
10615
10616        /// Sets the full request, replacing any prior values.
10617        pub fn with_request<V: Into<crate::model::instances::SetServiceAccountRequest>>(
10618            mut self,
10619            v: V,
10620        ) -> Self {
10621            self.0.request = v.into();
10622            self
10623        }
10624
10625        /// Sets all the options, replacing any prior values.
10626        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10627            self.0.options = v.into();
10628            self
10629        }
10630
10631        /// Sends the request.
10632        pub async fn send(self) -> Result<crate::model::Operation> {
10633            (*self.0.stub)
10634                .set_service_account(self.0.request, self.0.options)
10635                .await
10636                .map(gax::response::Response::into_body)
10637        }
10638
10639        /// Sets the value of [instance][crate::model::instances::SetServiceAccountRequest::instance].
10640        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10641            self.0.request.instance = v.into();
10642            self
10643        }
10644
10645        /// Sets the value of [project][crate::model::instances::SetServiceAccountRequest::project].
10646        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10647            self.0.request.project = v.into();
10648            self
10649        }
10650
10651        /// Sets the value of [request_id][crate::model::instances::SetServiceAccountRequest::request_id].
10652        pub fn set_request_id<T>(mut self, v: T) -> Self
10653        where
10654            T: std::convert::Into<std::string::String>,
10655        {
10656            self.0.request.request_id = std::option::Option::Some(v.into());
10657            self
10658        }
10659
10660        /// Sets or clears the value of [request_id][crate::model::instances::SetServiceAccountRequest::request_id].
10661        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10662        where
10663            T: std::convert::Into<std::string::String>,
10664        {
10665            self.0.request.request_id = v.map(|x| x.into());
10666            self
10667        }
10668
10669        /// Sets the value of [zone][crate::model::instances::SetServiceAccountRequest::zone].
10670        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10671            self.0.request.zone = v.into();
10672            self
10673        }
10674
10675        /// Sets the value of [body][crate::model::instances::SetServiceAccountRequest::body].
10676        pub fn set_body<T>(mut self, v: T) -> Self
10677        where
10678            T: std::convert::Into<crate::model::InstancesSetServiceAccountRequest>,
10679        {
10680            self.0.request.body = std::option::Option::Some(v.into());
10681            self
10682        }
10683
10684        /// Sets or clears the value of [body][crate::model::instances::SetServiceAccountRequest::body].
10685        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10686        where
10687            T: std::convert::Into<crate::model::InstancesSetServiceAccountRequest>,
10688        {
10689            self.0.request.body = v.map(|x| x.into());
10690            self
10691        }
10692    }
10693
10694    #[doc(hidden)]
10695    impl gax::options::internal::RequestBuilder for SetServiceAccount {
10696        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10697            &mut self.0.options
10698        }
10699    }
10700
10701    /// The request builder for [Instances::set_shielded_instance_integrity_policy][crate::client::Instances::set_shielded_instance_integrity_policy] calls.
10702    ///
10703    /// # Example
10704    /// ```no_run
10705    /// # use google_cloud_compute_v1::builder;
10706    /// use builder::instances::SetShieldedInstanceIntegrityPolicy;
10707    /// # tokio_test::block_on(async {
10708    ///
10709    /// let builder = prepare_request_builder();
10710    /// let response = builder.send().await?;
10711    /// # gax::Result::<()>::Ok(()) });
10712    ///
10713    /// fn prepare_request_builder() -> SetShieldedInstanceIntegrityPolicy {
10714    ///   # panic!();
10715    ///   // ... details omitted ...
10716    /// }
10717    /// ```
10718    #[derive(Clone, Debug)]
10719    pub struct SetShieldedInstanceIntegrityPolicy(
10720        RequestBuilder<crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest>,
10721    );
10722
10723    impl SetShieldedInstanceIntegrityPolicy {
10724        pub(crate) fn new(
10725            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10726        ) -> Self {
10727            Self(RequestBuilder::new(stub))
10728        }
10729
10730        /// Sets the full request, replacing any prior values.
10731        pub fn with_request<
10732            V: Into<crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest>,
10733        >(
10734            mut self,
10735            v: V,
10736        ) -> Self {
10737            self.0.request = v.into();
10738            self
10739        }
10740
10741        /// Sets all the options, replacing any prior values.
10742        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10743            self.0.options = v.into();
10744            self
10745        }
10746
10747        /// Sends the request.
10748        pub async fn send(self) -> Result<crate::model::Operation> {
10749            (*self.0.stub)
10750                .set_shielded_instance_integrity_policy(self.0.request, self.0.options)
10751                .await
10752                .map(gax::response::Response::into_body)
10753        }
10754
10755        /// Sets the value of [instance][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::instance].
10756        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10757            self.0.request.instance = v.into();
10758            self
10759        }
10760
10761        /// Sets the value of [project][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::project].
10762        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10763            self.0.request.project = v.into();
10764            self
10765        }
10766
10767        /// Sets the value of [request_id][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::request_id].
10768        pub fn set_request_id<T>(mut self, v: T) -> Self
10769        where
10770            T: std::convert::Into<std::string::String>,
10771        {
10772            self.0.request.request_id = std::option::Option::Some(v.into());
10773            self
10774        }
10775
10776        /// Sets or clears the value of [request_id][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::request_id].
10777        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10778        where
10779            T: std::convert::Into<std::string::String>,
10780        {
10781            self.0.request.request_id = v.map(|x| x.into());
10782            self
10783        }
10784
10785        /// Sets the value of [zone][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::zone].
10786        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10787            self.0.request.zone = v.into();
10788            self
10789        }
10790
10791        /// Sets the value of [body][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::body].
10792        pub fn set_body<T>(mut self, v: T) -> Self
10793        where
10794            T: std::convert::Into<crate::model::ShieldedInstanceIntegrityPolicy>,
10795        {
10796            self.0.request.body = std::option::Option::Some(v.into());
10797            self
10798        }
10799
10800        /// Sets or clears the value of [body][crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest::body].
10801        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10802        where
10803            T: std::convert::Into<crate::model::ShieldedInstanceIntegrityPolicy>,
10804        {
10805            self.0.request.body = v.map(|x| x.into());
10806            self
10807        }
10808    }
10809
10810    #[doc(hidden)]
10811    impl gax::options::internal::RequestBuilder for SetShieldedInstanceIntegrityPolicy {
10812        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10813            &mut self.0.options
10814        }
10815    }
10816
10817    /// The request builder for [Instances::set_tags][crate::client::Instances::set_tags] calls.
10818    ///
10819    /// # Example
10820    /// ```no_run
10821    /// # use google_cloud_compute_v1::builder;
10822    /// use builder::instances::SetTags;
10823    /// # tokio_test::block_on(async {
10824    ///
10825    /// let builder = prepare_request_builder();
10826    /// let response = builder.send().await?;
10827    /// # gax::Result::<()>::Ok(()) });
10828    ///
10829    /// fn prepare_request_builder() -> SetTags {
10830    ///   # panic!();
10831    ///   // ... details omitted ...
10832    /// }
10833    /// ```
10834    #[derive(Clone, Debug)]
10835    pub struct SetTags(RequestBuilder<crate::model::instances::SetTagsRequest>);
10836
10837    impl SetTags {
10838        pub(crate) fn new(
10839            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10840        ) -> Self {
10841            Self(RequestBuilder::new(stub))
10842        }
10843
10844        /// Sets the full request, replacing any prior values.
10845        pub fn with_request<V: Into<crate::model::instances::SetTagsRequest>>(
10846            mut self,
10847            v: V,
10848        ) -> Self {
10849            self.0.request = v.into();
10850            self
10851        }
10852
10853        /// Sets all the options, replacing any prior values.
10854        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10855            self.0.options = v.into();
10856            self
10857        }
10858
10859        /// Sends the request.
10860        pub async fn send(self) -> Result<crate::model::Operation> {
10861            (*self.0.stub)
10862                .set_tags(self.0.request, self.0.options)
10863                .await
10864                .map(gax::response::Response::into_body)
10865        }
10866
10867        /// Sets the value of [instance][crate::model::instances::SetTagsRequest::instance].
10868        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10869            self.0.request.instance = v.into();
10870            self
10871        }
10872
10873        /// Sets the value of [project][crate::model::instances::SetTagsRequest::project].
10874        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10875            self.0.request.project = v.into();
10876            self
10877        }
10878
10879        /// Sets the value of [request_id][crate::model::instances::SetTagsRequest::request_id].
10880        pub fn set_request_id<T>(mut self, v: T) -> Self
10881        where
10882            T: std::convert::Into<std::string::String>,
10883        {
10884            self.0.request.request_id = std::option::Option::Some(v.into());
10885            self
10886        }
10887
10888        /// Sets or clears the value of [request_id][crate::model::instances::SetTagsRequest::request_id].
10889        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10890        where
10891            T: std::convert::Into<std::string::String>,
10892        {
10893            self.0.request.request_id = v.map(|x| x.into());
10894            self
10895        }
10896
10897        /// Sets the value of [zone][crate::model::instances::SetTagsRequest::zone].
10898        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10899            self.0.request.zone = v.into();
10900            self
10901        }
10902
10903        /// Sets the value of [body][crate::model::instances::SetTagsRequest::body].
10904        pub fn set_body<T>(mut self, v: T) -> Self
10905        where
10906            T: std::convert::Into<crate::model::Tags>,
10907        {
10908            self.0.request.body = std::option::Option::Some(v.into());
10909            self
10910        }
10911
10912        /// Sets or clears the value of [body][crate::model::instances::SetTagsRequest::body].
10913        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10914        where
10915            T: std::convert::Into<crate::model::Tags>,
10916        {
10917            self.0.request.body = v.map(|x| x.into());
10918            self
10919        }
10920    }
10921
10922    #[doc(hidden)]
10923    impl gax::options::internal::RequestBuilder for SetTags {
10924        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10925            &mut self.0.options
10926        }
10927    }
10928
10929    /// The request builder for [Instances::simulate_maintenance_event][crate::client::Instances::simulate_maintenance_event] calls.
10930    ///
10931    /// # Example
10932    /// ```no_run
10933    /// # use google_cloud_compute_v1::builder;
10934    /// use builder::instances::SimulateMaintenanceEvent;
10935    /// # tokio_test::block_on(async {
10936    ///
10937    /// let builder = prepare_request_builder();
10938    /// let response = builder.send().await?;
10939    /// # gax::Result::<()>::Ok(()) });
10940    ///
10941    /// fn prepare_request_builder() -> SimulateMaintenanceEvent {
10942    ///   # panic!();
10943    ///   // ... details omitted ...
10944    /// }
10945    /// ```
10946    #[derive(Clone, Debug)]
10947    pub struct SimulateMaintenanceEvent(
10948        RequestBuilder<crate::model::instances::SimulateMaintenanceEventRequest>,
10949    );
10950
10951    impl SimulateMaintenanceEvent {
10952        pub(crate) fn new(
10953            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10954        ) -> Self {
10955            Self(RequestBuilder::new(stub))
10956        }
10957
10958        /// Sets the full request, replacing any prior values.
10959        pub fn with_request<V: Into<crate::model::instances::SimulateMaintenanceEventRequest>>(
10960            mut self,
10961            v: V,
10962        ) -> Self {
10963            self.0.request = v.into();
10964            self
10965        }
10966
10967        /// Sets all the options, replacing any prior values.
10968        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10969            self.0.options = v.into();
10970            self
10971        }
10972
10973        /// Sends the request.
10974        pub async fn send(self) -> Result<crate::model::Operation> {
10975            (*self.0.stub)
10976                .simulate_maintenance_event(self.0.request, self.0.options)
10977                .await
10978                .map(gax::response::Response::into_body)
10979        }
10980
10981        /// Sets the value of [instance][crate::model::instances::SimulateMaintenanceEventRequest::instance].
10982        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10983            self.0.request.instance = v.into();
10984            self
10985        }
10986
10987        /// Sets the value of [project][crate::model::instances::SimulateMaintenanceEventRequest::project].
10988        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10989            self.0.request.project = v.into();
10990            self
10991        }
10992
10993        /// Sets the value of [request_id][crate::model::instances::SimulateMaintenanceEventRequest::request_id].
10994        pub fn set_request_id<T>(mut self, v: T) -> Self
10995        where
10996            T: std::convert::Into<std::string::String>,
10997        {
10998            self.0.request.request_id = std::option::Option::Some(v.into());
10999            self
11000        }
11001
11002        /// Sets or clears the value of [request_id][crate::model::instances::SimulateMaintenanceEventRequest::request_id].
11003        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11004        where
11005            T: std::convert::Into<std::string::String>,
11006        {
11007            self.0.request.request_id = v.map(|x| x.into());
11008            self
11009        }
11010
11011        /// Sets the value of [with_extended_notifications][crate::model::instances::SimulateMaintenanceEventRequest::with_extended_notifications].
11012        pub fn set_with_extended_notifications<T>(mut self, v: T) -> Self
11013        where
11014            T: std::convert::Into<bool>,
11015        {
11016            self.0.request.with_extended_notifications = std::option::Option::Some(v.into());
11017            self
11018        }
11019
11020        /// Sets or clears the value of [with_extended_notifications][crate::model::instances::SimulateMaintenanceEventRequest::with_extended_notifications].
11021        pub fn set_or_clear_with_extended_notifications<T>(
11022            mut self,
11023            v: std::option::Option<T>,
11024        ) -> Self
11025        where
11026            T: std::convert::Into<bool>,
11027        {
11028            self.0.request.with_extended_notifications = v.map(|x| x.into());
11029            self
11030        }
11031
11032        /// Sets the value of [zone][crate::model::instances::SimulateMaintenanceEventRequest::zone].
11033        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11034            self.0.request.zone = v.into();
11035            self
11036        }
11037    }
11038
11039    #[doc(hidden)]
11040    impl gax::options::internal::RequestBuilder for SimulateMaintenanceEvent {
11041        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11042            &mut self.0.options
11043        }
11044    }
11045
11046    /// The request builder for [Instances::start][crate::client::Instances::start] calls.
11047    ///
11048    /// # Example
11049    /// ```no_run
11050    /// # use google_cloud_compute_v1::builder;
11051    /// use builder::instances::Start;
11052    /// # tokio_test::block_on(async {
11053    ///
11054    /// let builder = prepare_request_builder();
11055    /// let response = builder.send().await?;
11056    /// # gax::Result::<()>::Ok(()) });
11057    ///
11058    /// fn prepare_request_builder() -> Start {
11059    ///   # panic!();
11060    ///   // ... details omitted ...
11061    /// }
11062    /// ```
11063    #[derive(Clone, Debug)]
11064    pub struct Start(RequestBuilder<crate::model::instances::StartRequest>);
11065
11066    impl Start {
11067        pub(crate) fn new(
11068            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11069        ) -> Self {
11070            Self(RequestBuilder::new(stub))
11071        }
11072
11073        /// Sets the full request, replacing any prior values.
11074        pub fn with_request<V: Into<crate::model::instances::StartRequest>>(
11075            mut self,
11076            v: V,
11077        ) -> Self {
11078            self.0.request = v.into();
11079            self
11080        }
11081
11082        /// Sets all the options, replacing any prior values.
11083        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11084            self.0.options = v.into();
11085            self
11086        }
11087
11088        /// Sends the request.
11089        pub async fn send(self) -> Result<crate::model::Operation> {
11090            (*self.0.stub)
11091                .start(self.0.request, self.0.options)
11092                .await
11093                .map(gax::response::Response::into_body)
11094        }
11095
11096        /// Sets the value of [instance][crate::model::instances::StartRequest::instance].
11097        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11098            self.0.request.instance = v.into();
11099            self
11100        }
11101
11102        /// Sets the value of [project][crate::model::instances::StartRequest::project].
11103        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11104            self.0.request.project = v.into();
11105            self
11106        }
11107
11108        /// Sets the value of [request_id][crate::model::instances::StartRequest::request_id].
11109        pub fn set_request_id<T>(mut self, v: T) -> Self
11110        where
11111            T: std::convert::Into<std::string::String>,
11112        {
11113            self.0.request.request_id = std::option::Option::Some(v.into());
11114            self
11115        }
11116
11117        /// Sets or clears the value of [request_id][crate::model::instances::StartRequest::request_id].
11118        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11119        where
11120            T: std::convert::Into<std::string::String>,
11121        {
11122            self.0.request.request_id = v.map(|x| x.into());
11123            self
11124        }
11125
11126        /// Sets the value of [zone][crate::model::instances::StartRequest::zone].
11127        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11128            self.0.request.zone = v.into();
11129            self
11130        }
11131    }
11132
11133    #[doc(hidden)]
11134    impl gax::options::internal::RequestBuilder for Start {
11135        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11136            &mut self.0.options
11137        }
11138    }
11139
11140    /// The request builder for [Instances::start_with_encryption_key][crate::client::Instances::start_with_encryption_key] calls.
11141    ///
11142    /// # Example
11143    /// ```no_run
11144    /// # use google_cloud_compute_v1::builder;
11145    /// use builder::instances::StartWithEncryptionKey;
11146    /// # tokio_test::block_on(async {
11147    ///
11148    /// let builder = prepare_request_builder();
11149    /// let response = builder.send().await?;
11150    /// # gax::Result::<()>::Ok(()) });
11151    ///
11152    /// fn prepare_request_builder() -> StartWithEncryptionKey {
11153    ///   # panic!();
11154    ///   // ... details omitted ...
11155    /// }
11156    /// ```
11157    #[derive(Clone, Debug)]
11158    pub struct StartWithEncryptionKey(
11159        RequestBuilder<crate::model::instances::StartWithEncryptionKeyRequest>,
11160    );
11161
11162    impl StartWithEncryptionKey {
11163        pub(crate) fn new(
11164            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11165        ) -> Self {
11166            Self(RequestBuilder::new(stub))
11167        }
11168
11169        /// Sets the full request, replacing any prior values.
11170        pub fn with_request<V: Into<crate::model::instances::StartWithEncryptionKeyRequest>>(
11171            mut self,
11172            v: V,
11173        ) -> Self {
11174            self.0.request = v.into();
11175            self
11176        }
11177
11178        /// Sets all the options, replacing any prior values.
11179        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11180            self.0.options = v.into();
11181            self
11182        }
11183
11184        /// Sends the request.
11185        pub async fn send(self) -> Result<crate::model::Operation> {
11186            (*self.0.stub)
11187                .start_with_encryption_key(self.0.request, self.0.options)
11188                .await
11189                .map(gax::response::Response::into_body)
11190        }
11191
11192        /// Sets the value of [instance][crate::model::instances::StartWithEncryptionKeyRequest::instance].
11193        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11194            self.0.request.instance = v.into();
11195            self
11196        }
11197
11198        /// Sets the value of [project][crate::model::instances::StartWithEncryptionKeyRequest::project].
11199        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11200            self.0.request.project = v.into();
11201            self
11202        }
11203
11204        /// Sets the value of [request_id][crate::model::instances::StartWithEncryptionKeyRequest::request_id].
11205        pub fn set_request_id<T>(mut self, v: T) -> Self
11206        where
11207            T: std::convert::Into<std::string::String>,
11208        {
11209            self.0.request.request_id = std::option::Option::Some(v.into());
11210            self
11211        }
11212
11213        /// Sets or clears the value of [request_id][crate::model::instances::StartWithEncryptionKeyRequest::request_id].
11214        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11215        where
11216            T: std::convert::Into<std::string::String>,
11217        {
11218            self.0.request.request_id = v.map(|x| x.into());
11219            self
11220        }
11221
11222        /// Sets the value of [zone][crate::model::instances::StartWithEncryptionKeyRequest::zone].
11223        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11224            self.0.request.zone = v.into();
11225            self
11226        }
11227
11228        /// Sets the value of [body][crate::model::instances::StartWithEncryptionKeyRequest::body].
11229        pub fn set_body<T>(mut self, v: T) -> Self
11230        where
11231            T: std::convert::Into<crate::model::InstancesStartWithEncryptionKeyRequest>,
11232        {
11233            self.0.request.body = std::option::Option::Some(v.into());
11234            self
11235        }
11236
11237        /// Sets or clears the value of [body][crate::model::instances::StartWithEncryptionKeyRequest::body].
11238        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11239        where
11240            T: std::convert::Into<crate::model::InstancesStartWithEncryptionKeyRequest>,
11241        {
11242            self.0.request.body = v.map(|x| x.into());
11243            self
11244        }
11245    }
11246
11247    #[doc(hidden)]
11248    impl gax::options::internal::RequestBuilder for StartWithEncryptionKey {
11249        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11250            &mut self.0.options
11251        }
11252    }
11253
11254    /// The request builder for [Instances::stop][crate::client::Instances::stop] calls.
11255    ///
11256    /// # Example
11257    /// ```no_run
11258    /// # use google_cloud_compute_v1::builder;
11259    /// use builder::instances::Stop;
11260    /// # tokio_test::block_on(async {
11261    ///
11262    /// let builder = prepare_request_builder();
11263    /// let response = builder.send().await?;
11264    /// # gax::Result::<()>::Ok(()) });
11265    ///
11266    /// fn prepare_request_builder() -> Stop {
11267    ///   # panic!();
11268    ///   // ... details omitted ...
11269    /// }
11270    /// ```
11271    #[derive(Clone, Debug)]
11272    pub struct Stop(RequestBuilder<crate::model::instances::StopRequest>);
11273
11274    impl Stop {
11275        pub(crate) fn new(
11276            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11277        ) -> Self {
11278            Self(RequestBuilder::new(stub))
11279        }
11280
11281        /// Sets the full request, replacing any prior values.
11282        pub fn with_request<V: Into<crate::model::instances::StopRequest>>(mut self, v: V) -> Self {
11283            self.0.request = v.into();
11284            self
11285        }
11286
11287        /// Sets all the options, replacing any prior values.
11288        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11289            self.0.options = v.into();
11290            self
11291        }
11292
11293        /// Sends the request.
11294        pub async fn send(self) -> Result<crate::model::Operation> {
11295            (*self.0.stub)
11296                .stop(self.0.request, self.0.options)
11297                .await
11298                .map(gax::response::Response::into_body)
11299        }
11300
11301        /// Sets the value of [discard_local_ssd][crate::model::instances::StopRequest::discard_local_ssd].
11302        pub fn set_discard_local_ssd<T>(mut self, v: T) -> Self
11303        where
11304            T: std::convert::Into<bool>,
11305        {
11306            self.0.request.discard_local_ssd = std::option::Option::Some(v.into());
11307            self
11308        }
11309
11310        /// Sets or clears the value of [discard_local_ssd][crate::model::instances::StopRequest::discard_local_ssd].
11311        pub fn set_or_clear_discard_local_ssd<T>(mut self, v: std::option::Option<T>) -> Self
11312        where
11313            T: std::convert::Into<bool>,
11314        {
11315            self.0.request.discard_local_ssd = v.map(|x| x.into());
11316            self
11317        }
11318
11319        /// Sets the value of [instance][crate::model::instances::StopRequest::instance].
11320        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11321            self.0.request.instance = v.into();
11322            self
11323        }
11324
11325        /// Sets the value of [project][crate::model::instances::StopRequest::project].
11326        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11327            self.0.request.project = v.into();
11328            self
11329        }
11330
11331        /// Sets the value of [request_id][crate::model::instances::StopRequest::request_id].
11332        pub fn set_request_id<T>(mut self, v: T) -> Self
11333        where
11334            T: std::convert::Into<std::string::String>,
11335        {
11336            self.0.request.request_id = std::option::Option::Some(v.into());
11337            self
11338        }
11339
11340        /// Sets or clears the value of [request_id][crate::model::instances::StopRequest::request_id].
11341        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11342        where
11343            T: std::convert::Into<std::string::String>,
11344        {
11345            self.0.request.request_id = v.map(|x| x.into());
11346            self
11347        }
11348
11349        /// Sets the value of [zone][crate::model::instances::StopRequest::zone].
11350        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11351            self.0.request.zone = v.into();
11352            self
11353        }
11354    }
11355
11356    #[doc(hidden)]
11357    impl gax::options::internal::RequestBuilder for Stop {
11358        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11359            &mut self.0.options
11360        }
11361    }
11362
11363    /// The request builder for [Instances::suspend][crate::client::Instances::suspend] calls.
11364    ///
11365    /// # Example
11366    /// ```no_run
11367    /// # use google_cloud_compute_v1::builder;
11368    /// use builder::instances::Suspend;
11369    /// # tokio_test::block_on(async {
11370    ///
11371    /// let builder = prepare_request_builder();
11372    /// let response = builder.send().await?;
11373    /// # gax::Result::<()>::Ok(()) });
11374    ///
11375    /// fn prepare_request_builder() -> Suspend {
11376    ///   # panic!();
11377    ///   // ... details omitted ...
11378    /// }
11379    /// ```
11380    #[derive(Clone, Debug)]
11381    pub struct Suspend(RequestBuilder<crate::model::instances::SuspendRequest>);
11382
11383    impl Suspend {
11384        pub(crate) fn new(
11385            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11386        ) -> Self {
11387            Self(RequestBuilder::new(stub))
11388        }
11389
11390        /// Sets the full request, replacing any prior values.
11391        pub fn with_request<V: Into<crate::model::instances::SuspendRequest>>(
11392            mut self,
11393            v: V,
11394        ) -> Self {
11395            self.0.request = v.into();
11396            self
11397        }
11398
11399        /// Sets all the options, replacing any prior values.
11400        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11401            self.0.options = v.into();
11402            self
11403        }
11404
11405        /// Sends the request.
11406        pub async fn send(self) -> Result<crate::model::Operation> {
11407            (*self.0.stub)
11408                .suspend(self.0.request, self.0.options)
11409                .await
11410                .map(gax::response::Response::into_body)
11411        }
11412
11413        /// Sets the value of [discard_local_ssd][crate::model::instances::SuspendRequest::discard_local_ssd].
11414        pub fn set_discard_local_ssd<T>(mut self, v: T) -> Self
11415        where
11416            T: std::convert::Into<bool>,
11417        {
11418            self.0.request.discard_local_ssd = std::option::Option::Some(v.into());
11419            self
11420        }
11421
11422        /// Sets or clears the value of [discard_local_ssd][crate::model::instances::SuspendRequest::discard_local_ssd].
11423        pub fn set_or_clear_discard_local_ssd<T>(mut self, v: std::option::Option<T>) -> Self
11424        where
11425            T: std::convert::Into<bool>,
11426        {
11427            self.0.request.discard_local_ssd = v.map(|x| x.into());
11428            self
11429        }
11430
11431        /// Sets the value of [instance][crate::model::instances::SuspendRequest::instance].
11432        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11433            self.0.request.instance = v.into();
11434            self
11435        }
11436
11437        /// Sets the value of [project][crate::model::instances::SuspendRequest::project].
11438        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11439            self.0.request.project = v.into();
11440            self
11441        }
11442
11443        /// Sets the value of [request_id][crate::model::instances::SuspendRequest::request_id].
11444        pub fn set_request_id<T>(mut self, v: T) -> Self
11445        where
11446            T: std::convert::Into<std::string::String>,
11447        {
11448            self.0.request.request_id = std::option::Option::Some(v.into());
11449            self
11450        }
11451
11452        /// Sets or clears the value of [request_id][crate::model::instances::SuspendRequest::request_id].
11453        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11454        where
11455            T: std::convert::Into<std::string::String>,
11456        {
11457            self.0.request.request_id = v.map(|x| x.into());
11458            self
11459        }
11460
11461        /// Sets the value of [zone][crate::model::instances::SuspendRequest::zone].
11462        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11463            self.0.request.zone = v.into();
11464            self
11465        }
11466    }
11467
11468    #[doc(hidden)]
11469    impl gax::options::internal::RequestBuilder for Suspend {
11470        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11471            &mut self.0.options
11472        }
11473    }
11474
11475    /// The request builder for [Instances::test_iam_permissions][crate::client::Instances::test_iam_permissions] calls.
11476    ///
11477    /// # Example
11478    /// ```no_run
11479    /// # use google_cloud_compute_v1::builder;
11480    /// use builder::instances::TestIamPermissions;
11481    /// # tokio_test::block_on(async {
11482    ///
11483    /// let builder = prepare_request_builder();
11484    /// let response = builder.send().await?;
11485    /// # gax::Result::<()>::Ok(()) });
11486    ///
11487    /// fn prepare_request_builder() -> TestIamPermissions {
11488    ///   # panic!();
11489    ///   // ... details omitted ...
11490    /// }
11491    /// ```
11492    #[derive(Clone, Debug)]
11493    pub struct TestIamPermissions(
11494        RequestBuilder<crate::model::instances::TestIamPermissionsRequest>,
11495    );
11496
11497    impl TestIamPermissions {
11498        pub(crate) fn new(
11499            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11500        ) -> Self {
11501            Self(RequestBuilder::new(stub))
11502        }
11503
11504        /// Sets the full request, replacing any prior values.
11505        pub fn with_request<V: Into<crate::model::instances::TestIamPermissionsRequest>>(
11506            mut self,
11507            v: V,
11508        ) -> Self {
11509            self.0.request = v.into();
11510            self
11511        }
11512
11513        /// Sets all the options, replacing any prior values.
11514        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11515            self.0.options = v.into();
11516            self
11517        }
11518
11519        /// Sends the request.
11520        pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
11521            (*self.0.stub)
11522                .test_iam_permissions(self.0.request, self.0.options)
11523                .await
11524                .map(gax::response::Response::into_body)
11525        }
11526
11527        /// Sets the value of [project][crate::model::instances::TestIamPermissionsRequest::project].
11528        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11529            self.0.request.project = v.into();
11530            self
11531        }
11532
11533        /// Sets the value of [resource][crate::model::instances::TestIamPermissionsRequest::resource].
11534        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11535            self.0.request.resource = v.into();
11536            self
11537        }
11538
11539        /// Sets the value of [zone][crate::model::instances::TestIamPermissionsRequest::zone].
11540        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11541            self.0.request.zone = v.into();
11542            self
11543        }
11544
11545        /// Sets the value of [body][crate::model::instances::TestIamPermissionsRequest::body].
11546        pub fn set_body<T>(mut self, v: T) -> Self
11547        where
11548            T: std::convert::Into<crate::model::TestPermissionsRequest>,
11549        {
11550            self.0.request.body = std::option::Option::Some(v.into());
11551            self
11552        }
11553
11554        /// Sets or clears the value of [body][crate::model::instances::TestIamPermissionsRequest::body].
11555        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11556        where
11557            T: std::convert::Into<crate::model::TestPermissionsRequest>,
11558        {
11559            self.0.request.body = v.map(|x| x.into());
11560            self
11561        }
11562    }
11563
11564    #[doc(hidden)]
11565    impl gax::options::internal::RequestBuilder for TestIamPermissions {
11566        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11567            &mut self.0.options
11568        }
11569    }
11570
11571    /// The request builder for [Instances::update][crate::client::Instances::update] calls.
11572    ///
11573    /// # Example
11574    /// ```no_run
11575    /// # use google_cloud_compute_v1::builder;
11576    /// use builder::instances::Update;
11577    /// # tokio_test::block_on(async {
11578    ///
11579    /// let builder = prepare_request_builder();
11580    /// let response = builder.send().await?;
11581    /// # gax::Result::<()>::Ok(()) });
11582    ///
11583    /// fn prepare_request_builder() -> Update {
11584    ///   # panic!();
11585    ///   // ... details omitted ...
11586    /// }
11587    /// ```
11588    #[derive(Clone, Debug)]
11589    pub struct Update(RequestBuilder<crate::model::instances::UpdateRequest>);
11590
11591    impl Update {
11592        pub(crate) fn new(
11593            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11594        ) -> Self {
11595            Self(RequestBuilder::new(stub))
11596        }
11597
11598        /// Sets the full request, replacing any prior values.
11599        pub fn with_request<V: Into<crate::model::instances::UpdateRequest>>(
11600            mut self,
11601            v: V,
11602        ) -> Self {
11603            self.0.request = v.into();
11604            self
11605        }
11606
11607        /// Sets all the options, replacing any prior values.
11608        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11609            self.0.options = v.into();
11610            self
11611        }
11612
11613        /// Sends the request.
11614        pub async fn send(self) -> Result<crate::model::Operation> {
11615            (*self.0.stub)
11616                .update(self.0.request, self.0.options)
11617                .await
11618                .map(gax::response::Response::into_body)
11619        }
11620
11621        /// Sets the value of [instance][crate::model::instances::UpdateRequest::instance].
11622        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11623            self.0.request.instance = v.into();
11624            self
11625        }
11626
11627        /// Sets the value of [minimal_action][crate::model::instances::UpdateRequest::minimal_action].
11628        pub fn set_minimal_action<T>(mut self, v: T) -> Self
11629        where
11630            T: std::convert::Into<crate::model::instances::update_request::MinimalAction>,
11631        {
11632            self.0.request.minimal_action = std::option::Option::Some(v.into());
11633            self
11634        }
11635
11636        /// Sets or clears the value of [minimal_action][crate::model::instances::UpdateRequest::minimal_action].
11637        pub fn set_or_clear_minimal_action<T>(mut self, v: std::option::Option<T>) -> Self
11638        where
11639            T: std::convert::Into<crate::model::instances::update_request::MinimalAction>,
11640        {
11641            self.0.request.minimal_action = v.map(|x| x.into());
11642            self
11643        }
11644
11645        /// Sets the value of [most_disruptive_allowed_action][crate::model::instances::UpdateRequest::most_disruptive_allowed_action].
11646        pub fn set_most_disruptive_allowed_action<T>(mut self, v: T) -> Self
11647        where
11648            T: std::convert::Into<
11649                    crate::model::instances::update_request::MostDisruptiveAllowedAction,
11650                >,
11651        {
11652            self.0.request.most_disruptive_allowed_action = std::option::Option::Some(v.into());
11653            self
11654        }
11655
11656        /// Sets or clears the value of [most_disruptive_allowed_action][crate::model::instances::UpdateRequest::most_disruptive_allowed_action].
11657        pub fn set_or_clear_most_disruptive_allowed_action<T>(
11658            mut self,
11659            v: std::option::Option<T>,
11660        ) -> Self
11661        where
11662            T: std::convert::Into<
11663                    crate::model::instances::update_request::MostDisruptiveAllowedAction,
11664                >,
11665        {
11666            self.0.request.most_disruptive_allowed_action = v.map(|x| x.into());
11667            self
11668        }
11669
11670        /// Sets the value of [project][crate::model::instances::UpdateRequest::project].
11671        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11672            self.0.request.project = v.into();
11673            self
11674        }
11675
11676        /// Sets the value of [request_id][crate::model::instances::UpdateRequest::request_id].
11677        pub fn set_request_id<T>(mut self, v: T) -> Self
11678        where
11679            T: std::convert::Into<std::string::String>,
11680        {
11681            self.0.request.request_id = std::option::Option::Some(v.into());
11682            self
11683        }
11684
11685        /// Sets or clears the value of [request_id][crate::model::instances::UpdateRequest::request_id].
11686        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11687        where
11688            T: std::convert::Into<std::string::String>,
11689        {
11690            self.0.request.request_id = v.map(|x| x.into());
11691            self
11692        }
11693
11694        /// Sets the value of [zone][crate::model::instances::UpdateRequest::zone].
11695        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11696            self.0.request.zone = v.into();
11697            self
11698        }
11699
11700        /// Sets the value of [body][crate::model::instances::UpdateRequest::body].
11701        pub fn set_body<T>(mut self, v: T) -> Self
11702        where
11703            T: std::convert::Into<crate::model::Instance>,
11704        {
11705            self.0.request.body = std::option::Option::Some(v.into());
11706            self
11707        }
11708
11709        /// Sets or clears the value of [body][crate::model::instances::UpdateRequest::body].
11710        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11711        where
11712            T: std::convert::Into<crate::model::Instance>,
11713        {
11714            self.0.request.body = v.map(|x| x.into());
11715            self
11716        }
11717    }
11718
11719    #[doc(hidden)]
11720    impl gax::options::internal::RequestBuilder for Update {
11721        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11722            &mut self.0.options
11723        }
11724    }
11725
11726    /// The request builder for [Instances::update_access_config][crate::client::Instances::update_access_config] calls.
11727    ///
11728    /// # Example
11729    /// ```no_run
11730    /// # use google_cloud_compute_v1::builder;
11731    /// use builder::instances::UpdateAccessConfig;
11732    /// # tokio_test::block_on(async {
11733    ///
11734    /// let builder = prepare_request_builder();
11735    /// let response = builder.send().await?;
11736    /// # gax::Result::<()>::Ok(()) });
11737    ///
11738    /// fn prepare_request_builder() -> UpdateAccessConfig {
11739    ///   # panic!();
11740    ///   // ... details omitted ...
11741    /// }
11742    /// ```
11743    #[derive(Clone, Debug)]
11744    pub struct UpdateAccessConfig(
11745        RequestBuilder<crate::model::instances::UpdateAccessConfigRequest>,
11746    );
11747
11748    impl UpdateAccessConfig {
11749        pub(crate) fn new(
11750            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11751        ) -> Self {
11752            Self(RequestBuilder::new(stub))
11753        }
11754
11755        /// Sets the full request, replacing any prior values.
11756        pub fn with_request<V: Into<crate::model::instances::UpdateAccessConfigRequest>>(
11757            mut self,
11758            v: V,
11759        ) -> Self {
11760            self.0.request = v.into();
11761            self
11762        }
11763
11764        /// Sets all the options, replacing any prior values.
11765        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11766            self.0.options = v.into();
11767            self
11768        }
11769
11770        /// Sends the request.
11771        pub async fn send(self) -> Result<crate::model::Operation> {
11772            (*self.0.stub)
11773                .update_access_config(self.0.request, self.0.options)
11774                .await
11775                .map(gax::response::Response::into_body)
11776        }
11777
11778        /// Sets the value of [instance][crate::model::instances::UpdateAccessConfigRequest::instance].
11779        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11780            self.0.request.instance = v.into();
11781            self
11782        }
11783
11784        /// Sets the value of [network_interface][crate::model::instances::UpdateAccessConfigRequest::network_interface].
11785        pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
11786            self.0.request.network_interface = v.into();
11787            self
11788        }
11789
11790        /// Sets the value of [project][crate::model::instances::UpdateAccessConfigRequest::project].
11791        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11792            self.0.request.project = v.into();
11793            self
11794        }
11795
11796        /// Sets the value of [request_id][crate::model::instances::UpdateAccessConfigRequest::request_id].
11797        pub fn set_request_id<T>(mut self, v: T) -> Self
11798        where
11799            T: std::convert::Into<std::string::String>,
11800        {
11801            self.0.request.request_id = std::option::Option::Some(v.into());
11802            self
11803        }
11804
11805        /// Sets or clears the value of [request_id][crate::model::instances::UpdateAccessConfigRequest::request_id].
11806        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11807        where
11808            T: std::convert::Into<std::string::String>,
11809        {
11810            self.0.request.request_id = v.map(|x| x.into());
11811            self
11812        }
11813
11814        /// Sets the value of [zone][crate::model::instances::UpdateAccessConfigRequest::zone].
11815        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11816            self.0.request.zone = v.into();
11817            self
11818        }
11819
11820        /// Sets the value of [body][crate::model::instances::UpdateAccessConfigRequest::body].
11821        pub fn set_body<T>(mut self, v: T) -> Self
11822        where
11823            T: std::convert::Into<crate::model::AccessConfig>,
11824        {
11825            self.0.request.body = std::option::Option::Some(v.into());
11826            self
11827        }
11828
11829        /// Sets or clears the value of [body][crate::model::instances::UpdateAccessConfigRequest::body].
11830        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11831        where
11832            T: std::convert::Into<crate::model::AccessConfig>,
11833        {
11834            self.0.request.body = v.map(|x| x.into());
11835            self
11836        }
11837    }
11838
11839    #[doc(hidden)]
11840    impl gax::options::internal::RequestBuilder for UpdateAccessConfig {
11841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11842            &mut self.0.options
11843        }
11844    }
11845
11846    /// The request builder for [Instances::update_display_device][crate::client::Instances::update_display_device] calls.
11847    ///
11848    /// # Example
11849    /// ```no_run
11850    /// # use google_cloud_compute_v1::builder;
11851    /// use builder::instances::UpdateDisplayDevice;
11852    /// # tokio_test::block_on(async {
11853    ///
11854    /// let builder = prepare_request_builder();
11855    /// let response = builder.send().await?;
11856    /// # gax::Result::<()>::Ok(()) });
11857    ///
11858    /// fn prepare_request_builder() -> UpdateDisplayDevice {
11859    ///   # panic!();
11860    ///   // ... details omitted ...
11861    /// }
11862    /// ```
11863    #[derive(Clone, Debug)]
11864    pub struct UpdateDisplayDevice(
11865        RequestBuilder<crate::model::instances::UpdateDisplayDeviceRequest>,
11866    );
11867
11868    impl UpdateDisplayDevice {
11869        pub(crate) fn new(
11870            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11871        ) -> Self {
11872            Self(RequestBuilder::new(stub))
11873        }
11874
11875        /// Sets the full request, replacing any prior values.
11876        pub fn with_request<V: Into<crate::model::instances::UpdateDisplayDeviceRequest>>(
11877            mut self,
11878            v: V,
11879        ) -> Self {
11880            self.0.request = v.into();
11881            self
11882        }
11883
11884        /// Sets all the options, replacing any prior values.
11885        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11886            self.0.options = v.into();
11887            self
11888        }
11889
11890        /// Sends the request.
11891        pub async fn send(self) -> Result<crate::model::Operation> {
11892            (*self.0.stub)
11893                .update_display_device(self.0.request, self.0.options)
11894                .await
11895                .map(gax::response::Response::into_body)
11896        }
11897
11898        /// Sets the value of [instance][crate::model::instances::UpdateDisplayDeviceRequest::instance].
11899        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11900            self.0.request.instance = v.into();
11901            self
11902        }
11903
11904        /// Sets the value of [project][crate::model::instances::UpdateDisplayDeviceRequest::project].
11905        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11906            self.0.request.project = v.into();
11907            self
11908        }
11909
11910        /// Sets the value of [request_id][crate::model::instances::UpdateDisplayDeviceRequest::request_id].
11911        pub fn set_request_id<T>(mut self, v: T) -> Self
11912        where
11913            T: std::convert::Into<std::string::String>,
11914        {
11915            self.0.request.request_id = std::option::Option::Some(v.into());
11916            self
11917        }
11918
11919        /// Sets or clears the value of [request_id][crate::model::instances::UpdateDisplayDeviceRequest::request_id].
11920        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11921        where
11922            T: std::convert::Into<std::string::String>,
11923        {
11924            self.0.request.request_id = v.map(|x| x.into());
11925            self
11926        }
11927
11928        /// Sets the value of [zone][crate::model::instances::UpdateDisplayDeviceRequest::zone].
11929        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11930            self.0.request.zone = v.into();
11931            self
11932        }
11933
11934        /// Sets the value of [body][crate::model::instances::UpdateDisplayDeviceRequest::body].
11935        pub fn set_body<T>(mut self, v: T) -> Self
11936        where
11937            T: std::convert::Into<crate::model::DisplayDevice>,
11938        {
11939            self.0.request.body = std::option::Option::Some(v.into());
11940            self
11941        }
11942
11943        /// Sets or clears the value of [body][crate::model::instances::UpdateDisplayDeviceRequest::body].
11944        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11945        where
11946            T: std::convert::Into<crate::model::DisplayDevice>,
11947        {
11948            self.0.request.body = v.map(|x| x.into());
11949            self
11950        }
11951    }
11952
11953    #[doc(hidden)]
11954    impl gax::options::internal::RequestBuilder for UpdateDisplayDevice {
11955        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11956            &mut self.0.options
11957        }
11958    }
11959
11960    /// The request builder for [Instances::update_network_interface][crate::client::Instances::update_network_interface] calls.
11961    ///
11962    /// # Example
11963    /// ```no_run
11964    /// # use google_cloud_compute_v1::builder;
11965    /// use builder::instances::UpdateNetworkInterface;
11966    /// # tokio_test::block_on(async {
11967    ///
11968    /// let builder = prepare_request_builder();
11969    /// let response = builder.send().await?;
11970    /// # gax::Result::<()>::Ok(()) });
11971    ///
11972    /// fn prepare_request_builder() -> UpdateNetworkInterface {
11973    ///   # panic!();
11974    ///   // ... details omitted ...
11975    /// }
11976    /// ```
11977    #[derive(Clone, Debug)]
11978    pub struct UpdateNetworkInterface(
11979        RequestBuilder<crate::model::instances::UpdateNetworkInterfaceRequest>,
11980    );
11981
11982    impl UpdateNetworkInterface {
11983        pub(crate) fn new(
11984            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11985        ) -> Self {
11986            Self(RequestBuilder::new(stub))
11987        }
11988
11989        /// Sets the full request, replacing any prior values.
11990        pub fn with_request<V: Into<crate::model::instances::UpdateNetworkInterfaceRequest>>(
11991            mut self,
11992            v: V,
11993        ) -> Self {
11994            self.0.request = v.into();
11995            self
11996        }
11997
11998        /// Sets all the options, replacing any prior values.
11999        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12000            self.0.options = v.into();
12001            self
12002        }
12003
12004        /// Sends the request.
12005        pub async fn send(self) -> Result<crate::model::Operation> {
12006            (*self.0.stub)
12007                .update_network_interface(self.0.request, self.0.options)
12008                .await
12009                .map(gax::response::Response::into_body)
12010        }
12011
12012        /// Sets the value of [instance][crate::model::instances::UpdateNetworkInterfaceRequest::instance].
12013        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
12014            self.0.request.instance = v.into();
12015            self
12016        }
12017
12018        /// Sets the value of [network_interface][crate::model::instances::UpdateNetworkInterfaceRequest::network_interface].
12019        pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
12020            self.0.request.network_interface = v.into();
12021            self
12022        }
12023
12024        /// Sets the value of [project][crate::model::instances::UpdateNetworkInterfaceRequest::project].
12025        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12026            self.0.request.project = v.into();
12027            self
12028        }
12029
12030        /// Sets the value of [request_id][crate::model::instances::UpdateNetworkInterfaceRequest::request_id].
12031        pub fn set_request_id<T>(mut self, v: T) -> Self
12032        where
12033            T: std::convert::Into<std::string::String>,
12034        {
12035            self.0.request.request_id = std::option::Option::Some(v.into());
12036            self
12037        }
12038
12039        /// Sets or clears the value of [request_id][crate::model::instances::UpdateNetworkInterfaceRequest::request_id].
12040        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12041        where
12042            T: std::convert::Into<std::string::String>,
12043        {
12044            self.0.request.request_id = v.map(|x| x.into());
12045            self
12046        }
12047
12048        /// Sets the value of [zone][crate::model::instances::UpdateNetworkInterfaceRequest::zone].
12049        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12050            self.0.request.zone = v.into();
12051            self
12052        }
12053
12054        /// Sets the value of [body][crate::model::instances::UpdateNetworkInterfaceRequest::body].
12055        pub fn set_body<T>(mut self, v: T) -> Self
12056        where
12057            T: std::convert::Into<crate::model::NetworkInterface>,
12058        {
12059            self.0.request.body = std::option::Option::Some(v.into());
12060            self
12061        }
12062
12063        /// Sets or clears the value of [body][crate::model::instances::UpdateNetworkInterfaceRequest::body].
12064        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12065        where
12066            T: std::convert::Into<crate::model::NetworkInterface>,
12067        {
12068            self.0.request.body = v.map(|x| x.into());
12069            self
12070        }
12071    }
12072
12073    #[doc(hidden)]
12074    impl gax::options::internal::RequestBuilder for UpdateNetworkInterface {
12075        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12076            &mut self.0.options
12077        }
12078    }
12079
12080    /// The request builder for [Instances::update_shielded_instance_config][crate::client::Instances::update_shielded_instance_config] calls.
12081    ///
12082    /// # Example
12083    /// ```no_run
12084    /// # use google_cloud_compute_v1::builder;
12085    /// use builder::instances::UpdateShieldedInstanceConfig;
12086    /// # tokio_test::block_on(async {
12087    ///
12088    /// let builder = prepare_request_builder();
12089    /// let response = builder.send().await?;
12090    /// # gax::Result::<()>::Ok(()) });
12091    ///
12092    /// fn prepare_request_builder() -> UpdateShieldedInstanceConfig {
12093    ///   # panic!();
12094    ///   // ... details omitted ...
12095    /// }
12096    /// ```
12097    #[derive(Clone, Debug)]
12098    pub struct UpdateShieldedInstanceConfig(
12099        RequestBuilder<crate::model::instances::UpdateShieldedInstanceConfigRequest>,
12100    );
12101
12102    impl UpdateShieldedInstanceConfig {
12103        pub(crate) fn new(
12104            stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
12105        ) -> Self {
12106            Self(RequestBuilder::new(stub))
12107        }
12108
12109        /// Sets the full request, replacing any prior values.
12110        pub fn with_request<
12111            V: Into<crate::model::instances::UpdateShieldedInstanceConfigRequest>,
12112        >(
12113            mut self,
12114            v: V,
12115        ) -> Self {
12116            self.0.request = v.into();
12117            self
12118        }
12119
12120        /// Sets all the options, replacing any prior values.
12121        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12122            self.0.options = v.into();
12123            self
12124        }
12125
12126        /// Sends the request.
12127        pub async fn send(self) -> Result<crate::model::Operation> {
12128            (*self.0.stub)
12129                .update_shielded_instance_config(self.0.request, self.0.options)
12130                .await
12131                .map(gax::response::Response::into_body)
12132        }
12133
12134        /// Sets the value of [instance][crate::model::instances::UpdateShieldedInstanceConfigRequest::instance].
12135        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
12136            self.0.request.instance = v.into();
12137            self
12138        }
12139
12140        /// Sets the value of [project][crate::model::instances::UpdateShieldedInstanceConfigRequest::project].
12141        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12142            self.0.request.project = v.into();
12143            self
12144        }
12145
12146        /// Sets the value of [request_id][crate::model::instances::UpdateShieldedInstanceConfigRequest::request_id].
12147        pub fn set_request_id<T>(mut self, v: T) -> Self
12148        where
12149            T: std::convert::Into<std::string::String>,
12150        {
12151            self.0.request.request_id = std::option::Option::Some(v.into());
12152            self
12153        }
12154
12155        /// Sets or clears the value of [request_id][crate::model::instances::UpdateShieldedInstanceConfigRequest::request_id].
12156        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12157        where
12158            T: std::convert::Into<std::string::String>,
12159        {
12160            self.0.request.request_id = v.map(|x| x.into());
12161            self
12162        }
12163
12164        /// Sets the value of [zone][crate::model::instances::UpdateShieldedInstanceConfigRequest::zone].
12165        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12166            self.0.request.zone = v.into();
12167            self
12168        }
12169
12170        /// Sets the value of [body][crate::model::instances::UpdateShieldedInstanceConfigRequest::body].
12171        pub fn set_body<T>(mut self, v: T) -> Self
12172        where
12173            T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
12174        {
12175            self.0.request.body = std::option::Option::Some(v.into());
12176            self
12177        }
12178
12179        /// Sets or clears the value of [body][crate::model::instances::UpdateShieldedInstanceConfigRequest::body].
12180        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12181        where
12182            T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
12183        {
12184            self.0.request.body = v.map(|x| x.into());
12185            self
12186        }
12187    }
12188
12189    #[doc(hidden)]
12190    impl gax::options::internal::RequestBuilder for UpdateShieldedInstanceConfig {
12191        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12192            &mut self.0.options
12193        }
12194    }
12195}
12196
12197#[cfg(feature = "machine-types")]
12198#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
12199pub mod machine_types {
12200    use crate::Result;
12201
12202    /// A builder for [MachineTypes][crate::client::MachineTypes].
12203    ///
12204    /// ```
12205    /// # tokio_test::block_on(async {
12206    /// # use google_cloud_compute_v1::*;
12207    /// # use builder::machine_types::ClientBuilder;
12208    /// # use client::MachineTypes;
12209    /// let builder : ClientBuilder = MachineTypes::builder();
12210    /// let client = builder
12211    ///     .with_endpoint("https://compute.googleapis.com")
12212    ///     .build().await?;
12213    /// # gax::client_builder::Result::<()>::Ok(()) });
12214    /// ```
12215    pub type ClientBuilder =
12216        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12217
12218    pub(crate) mod client {
12219        use super::super::super::client::MachineTypes;
12220        pub struct Factory;
12221        impl gax::client_builder::internal::ClientFactory for Factory {
12222            type Client = MachineTypes;
12223            type Credentials = gaxi::options::Credentials;
12224            async fn build(
12225                self,
12226                config: gaxi::options::ClientConfig,
12227            ) -> gax::client_builder::Result<Self::Client> {
12228                Self::Client::new(config).await
12229            }
12230        }
12231    }
12232
12233    /// Common implementation for [crate::client::MachineTypes] request builders.
12234    #[derive(Clone, Debug)]
12235    pub(crate) struct RequestBuilder<R: std::default::Default> {
12236        stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12237        request: R,
12238        options: gax::options::RequestOptions,
12239    }
12240
12241    impl<R> RequestBuilder<R>
12242    where
12243        R: std::default::Default,
12244    {
12245        pub(crate) fn new(
12246            stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12247        ) -> Self {
12248            Self {
12249                stub,
12250                request: R::default(),
12251                options: gax::options::RequestOptions::default(),
12252            }
12253        }
12254    }
12255
12256    /// The request builder for [MachineTypes::aggregated_list][crate::client::MachineTypes::aggregated_list] calls.
12257    ///
12258    /// # Example
12259    /// ```no_run
12260    /// # use google_cloud_compute_v1::builder;
12261    /// use builder::machine_types::AggregatedList;
12262    /// # tokio_test::block_on(async {
12263    /// use gax::paginator::ItemPaginator;
12264    ///
12265    /// let builder = prepare_request_builder();
12266    /// let mut items = builder.by_item();
12267    /// while let Some(result) = items.next().await {
12268    ///   let item = result?;
12269    /// }
12270    /// # gax::Result::<()>::Ok(()) });
12271    ///
12272    /// fn prepare_request_builder() -> AggregatedList {
12273    ///   # panic!();
12274    ///   // ... details omitted ...
12275    /// }
12276    /// ```
12277    #[derive(Clone, Debug)]
12278    pub struct AggregatedList(RequestBuilder<crate::model::machine_types::AggregatedListRequest>);
12279
12280    impl AggregatedList {
12281        pub(crate) fn new(
12282            stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12283        ) -> Self {
12284            Self(RequestBuilder::new(stub))
12285        }
12286
12287        /// Sets the full request, replacing any prior values.
12288        pub fn with_request<V: Into<crate::model::machine_types::AggregatedListRequest>>(
12289            mut self,
12290            v: V,
12291        ) -> Self {
12292            self.0.request = v.into();
12293            self
12294        }
12295
12296        /// Sets all the options, replacing any prior values.
12297        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12298            self.0.options = v.into();
12299            self
12300        }
12301
12302        /// Sends the request.
12303        pub async fn send(self) -> Result<crate::model::MachineTypeAggregatedList> {
12304            (*self.0.stub)
12305                .aggregated_list(self.0.request, self.0.options)
12306                .await
12307                .map(gax::response::Response::into_body)
12308        }
12309
12310        /// Streams each page in the collection.
12311        pub fn by_page(
12312            self,
12313        ) -> impl gax::paginator::Paginator<crate::model::MachineTypeAggregatedList, gax::error::Error>
12314        {
12315            use std::clone::Clone;
12316            let token = self.0.request.page_token.clone().unwrap_or_default();
12317            let execute = move |token: String| {
12318                let mut builder = self.clone();
12319                builder.0.request = builder.0.request.set_page_token(token);
12320                builder.send()
12321            };
12322            gax::paginator::internal::new_paginator(token, execute)
12323        }
12324
12325        /// Streams each item in the collection.
12326        pub fn by_item(
12327            self,
12328        ) -> impl gax::paginator::ItemPaginator<crate::model::MachineTypeAggregatedList, gax::error::Error>
12329        {
12330            use gax::paginator::Paginator;
12331            self.by_page().items()
12332        }
12333
12334        /// Sets the value of [filter][crate::model::machine_types::AggregatedListRequest::filter].
12335        pub fn set_filter<T>(mut self, v: T) -> Self
12336        where
12337            T: std::convert::Into<std::string::String>,
12338        {
12339            self.0.request.filter = std::option::Option::Some(v.into());
12340            self
12341        }
12342
12343        /// Sets or clears the value of [filter][crate::model::machine_types::AggregatedListRequest::filter].
12344        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12345        where
12346            T: std::convert::Into<std::string::String>,
12347        {
12348            self.0.request.filter = v.map(|x| x.into());
12349            self
12350        }
12351
12352        /// Sets the value of [include_all_scopes][crate::model::machine_types::AggregatedListRequest::include_all_scopes].
12353        pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
12354        where
12355            T: std::convert::Into<bool>,
12356        {
12357            self.0.request.include_all_scopes = std::option::Option::Some(v.into());
12358            self
12359        }
12360
12361        /// Sets or clears the value of [include_all_scopes][crate::model::machine_types::AggregatedListRequest::include_all_scopes].
12362        pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
12363        where
12364            T: std::convert::Into<bool>,
12365        {
12366            self.0.request.include_all_scopes = v.map(|x| x.into());
12367            self
12368        }
12369
12370        /// Sets the value of [max_results][crate::model::machine_types::AggregatedListRequest::max_results].
12371        pub fn set_max_results<T>(mut self, v: T) -> Self
12372        where
12373            T: std::convert::Into<u32>,
12374        {
12375            self.0.request.max_results = std::option::Option::Some(v.into());
12376            self
12377        }
12378
12379        /// Sets or clears the value of [max_results][crate::model::machine_types::AggregatedListRequest::max_results].
12380        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12381        where
12382            T: std::convert::Into<u32>,
12383        {
12384            self.0.request.max_results = v.map(|x| x.into());
12385            self
12386        }
12387
12388        /// Sets the value of [order_by][crate::model::machine_types::AggregatedListRequest::order_by].
12389        pub fn set_order_by<T>(mut self, v: T) -> Self
12390        where
12391            T: std::convert::Into<std::string::String>,
12392        {
12393            self.0.request.order_by = std::option::Option::Some(v.into());
12394            self
12395        }
12396
12397        /// Sets or clears the value of [order_by][crate::model::machine_types::AggregatedListRequest::order_by].
12398        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
12399        where
12400            T: std::convert::Into<std::string::String>,
12401        {
12402            self.0.request.order_by = v.map(|x| x.into());
12403            self
12404        }
12405
12406        /// Sets the value of [page_token][crate::model::machine_types::AggregatedListRequest::page_token].
12407        pub fn set_page_token<T>(mut self, v: T) -> Self
12408        where
12409            T: std::convert::Into<std::string::String>,
12410        {
12411            self.0.request.page_token = std::option::Option::Some(v.into());
12412            self
12413        }
12414
12415        /// Sets or clears the value of [page_token][crate::model::machine_types::AggregatedListRequest::page_token].
12416        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12417        where
12418            T: std::convert::Into<std::string::String>,
12419        {
12420            self.0.request.page_token = v.map(|x| x.into());
12421            self
12422        }
12423
12424        /// Sets the value of [project][crate::model::machine_types::AggregatedListRequest::project].
12425        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426            self.0.request.project = v.into();
12427            self
12428        }
12429
12430        /// Sets the value of [return_partial_success][crate::model::machine_types::AggregatedListRequest::return_partial_success].
12431        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
12432        where
12433            T: std::convert::Into<bool>,
12434        {
12435            self.0.request.return_partial_success = std::option::Option::Some(v.into());
12436            self
12437        }
12438
12439        /// Sets or clears the value of [return_partial_success][crate::model::machine_types::AggregatedListRequest::return_partial_success].
12440        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
12441        where
12442            T: std::convert::Into<bool>,
12443        {
12444            self.0.request.return_partial_success = v.map(|x| x.into());
12445            self
12446        }
12447
12448        /// Sets the value of [service_project_number][crate::model::machine_types::AggregatedListRequest::service_project_number].
12449        pub fn set_service_project_number<T>(mut self, v: T) -> Self
12450        where
12451            T: std::convert::Into<i64>,
12452        {
12453            self.0.request.service_project_number = std::option::Option::Some(v.into());
12454            self
12455        }
12456
12457        /// Sets or clears the value of [service_project_number][crate::model::machine_types::AggregatedListRequest::service_project_number].
12458        pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
12459        where
12460            T: std::convert::Into<i64>,
12461        {
12462            self.0.request.service_project_number = v.map(|x| x.into());
12463            self
12464        }
12465    }
12466
12467    #[doc(hidden)]
12468    impl gax::options::internal::RequestBuilder for AggregatedList {
12469        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12470            &mut self.0.options
12471        }
12472    }
12473
12474    /// The request builder for [MachineTypes::get][crate::client::MachineTypes::get] calls.
12475    ///
12476    /// # Example
12477    /// ```no_run
12478    /// # use google_cloud_compute_v1::builder;
12479    /// use builder::machine_types::Get;
12480    /// # tokio_test::block_on(async {
12481    ///
12482    /// let builder = prepare_request_builder();
12483    /// let response = builder.send().await?;
12484    /// # gax::Result::<()>::Ok(()) });
12485    ///
12486    /// fn prepare_request_builder() -> Get {
12487    ///   # panic!();
12488    ///   // ... details omitted ...
12489    /// }
12490    /// ```
12491    #[derive(Clone, Debug)]
12492    pub struct Get(RequestBuilder<crate::model::machine_types::GetRequest>);
12493
12494    impl Get {
12495        pub(crate) fn new(
12496            stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12497        ) -> Self {
12498            Self(RequestBuilder::new(stub))
12499        }
12500
12501        /// Sets the full request, replacing any prior values.
12502        pub fn with_request<V: Into<crate::model::machine_types::GetRequest>>(
12503            mut self,
12504            v: V,
12505        ) -> Self {
12506            self.0.request = v.into();
12507            self
12508        }
12509
12510        /// Sets all the options, replacing any prior values.
12511        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12512            self.0.options = v.into();
12513            self
12514        }
12515
12516        /// Sends the request.
12517        pub async fn send(self) -> Result<crate::model::MachineType> {
12518            (*self.0.stub)
12519                .get(self.0.request, self.0.options)
12520                .await
12521                .map(gax::response::Response::into_body)
12522        }
12523
12524        /// Sets the value of [machine_type][crate::model::machine_types::GetRequest::machine_type].
12525        pub fn set_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
12526            self.0.request.machine_type = v.into();
12527            self
12528        }
12529
12530        /// Sets the value of [project][crate::model::machine_types::GetRequest::project].
12531        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12532            self.0.request.project = v.into();
12533            self
12534        }
12535
12536        /// Sets the value of [zone][crate::model::machine_types::GetRequest::zone].
12537        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12538            self.0.request.zone = v.into();
12539            self
12540        }
12541    }
12542
12543    #[doc(hidden)]
12544    impl gax::options::internal::RequestBuilder for Get {
12545        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12546            &mut self.0.options
12547        }
12548    }
12549
12550    /// The request builder for [MachineTypes::list][crate::client::MachineTypes::list] calls.
12551    ///
12552    /// # Example
12553    /// ```no_run
12554    /// # use google_cloud_compute_v1::builder;
12555    /// use builder::machine_types::List;
12556    /// # tokio_test::block_on(async {
12557    /// use gax::paginator::ItemPaginator;
12558    ///
12559    /// let builder = prepare_request_builder();
12560    /// let mut items = builder.by_item();
12561    /// while let Some(result) = items.next().await {
12562    ///   let item = result?;
12563    /// }
12564    /// # gax::Result::<()>::Ok(()) });
12565    ///
12566    /// fn prepare_request_builder() -> List {
12567    ///   # panic!();
12568    ///   // ... details omitted ...
12569    /// }
12570    /// ```
12571    #[derive(Clone, Debug)]
12572    pub struct List(RequestBuilder<crate::model::machine_types::ListRequest>);
12573
12574    impl List {
12575        pub(crate) fn new(
12576            stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12577        ) -> Self {
12578            Self(RequestBuilder::new(stub))
12579        }
12580
12581        /// Sets the full request, replacing any prior values.
12582        pub fn with_request<V: Into<crate::model::machine_types::ListRequest>>(
12583            mut self,
12584            v: V,
12585        ) -> Self {
12586            self.0.request = v.into();
12587            self
12588        }
12589
12590        /// Sets all the options, replacing any prior values.
12591        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12592            self.0.options = v.into();
12593            self
12594        }
12595
12596        /// Sends the request.
12597        pub async fn send(self) -> Result<crate::model::MachineTypeList> {
12598            (*self.0.stub)
12599                .list(self.0.request, self.0.options)
12600                .await
12601                .map(gax::response::Response::into_body)
12602        }
12603
12604        /// Streams each page in the collection.
12605        pub fn by_page(
12606            self,
12607        ) -> impl gax::paginator::Paginator<crate::model::MachineTypeList, gax::error::Error>
12608        {
12609            use std::clone::Clone;
12610            let token = self.0.request.page_token.clone().unwrap_or_default();
12611            let execute = move |token: String| {
12612                let mut builder = self.clone();
12613                builder.0.request = builder.0.request.set_page_token(token);
12614                builder.send()
12615            };
12616            gax::paginator::internal::new_paginator(token, execute)
12617        }
12618
12619        /// Streams each item in the collection.
12620        pub fn by_item(
12621            self,
12622        ) -> impl gax::paginator::ItemPaginator<crate::model::MachineTypeList, gax::error::Error>
12623        {
12624            use gax::paginator::Paginator;
12625            self.by_page().items()
12626        }
12627
12628        /// Sets the value of [filter][crate::model::machine_types::ListRequest::filter].
12629        pub fn set_filter<T>(mut self, v: T) -> Self
12630        where
12631            T: std::convert::Into<std::string::String>,
12632        {
12633            self.0.request.filter = std::option::Option::Some(v.into());
12634            self
12635        }
12636
12637        /// Sets or clears the value of [filter][crate::model::machine_types::ListRequest::filter].
12638        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12639        where
12640            T: std::convert::Into<std::string::String>,
12641        {
12642            self.0.request.filter = v.map(|x| x.into());
12643            self
12644        }
12645
12646        /// Sets the value of [max_results][crate::model::machine_types::ListRequest::max_results].
12647        pub fn set_max_results<T>(mut self, v: T) -> Self
12648        where
12649            T: std::convert::Into<u32>,
12650        {
12651            self.0.request.max_results = std::option::Option::Some(v.into());
12652            self
12653        }
12654
12655        /// Sets or clears the value of [max_results][crate::model::machine_types::ListRequest::max_results].
12656        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12657        where
12658            T: std::convert::Into<u32>,
12659        {
12660            self.0.request.max_results = v.map(|x| x.into());
12661            self
12662        }
12663
12664        /// Sets the value of [order_by][crate::model::machine_types::ListRequest::order_by].
12665        pub fn set_order_by<T>(mut self, v: T) -> Self
12666        where
12667            T: std::convert::Into<std::string::String>,
12668        {
12669            self.0.request.order_by = std::option::Option::Some(v.into());
12670            self
12671        }
12672
12673        /// Sets or clears the value of [order_by][crate::model::machine_types::ListRequest::order_by].
12674        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
12675        where
12676            T: std::convert::Into<std::string::String>,
12677        {
12678            self.0.request.order_by = v.map(|x| x.into());
12679            self
12680        }
12681
12682        /// Sets the value of [page_token][crate::model::machine_types::ListRequest::page_token].
12683        pub fn set_page_token<T>(mut self, v: T) -> Self
12684        where
12685            T: std::convert::Into<std::string::String>,
12686        {
12687            self.0.request.page_token = std::option::Option::Some(v.into());
12688            self
12689        }
12690
12691        /// Sets or clears the value of [page_token][crate::model::machine_types::ListRequest::page_token].
12692        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12693        where
12694            T: std::convert::Into<std::string::String>,
12695        {
12696            self.0.request.page_token = v.map(|x| x.into());
12697            self
12698        }
12699
12700        /// Sets the value of [project][crate::model::machine_types::ListRequest::project].
12701        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12702            self.0.request.project = v.into();
12703            self
12704        }
12705
12706        /// Sets the value of [return_partial_success][crate::model::machine_types::ListRequest::return_partial_success].
12707        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
12708        where
12709            T: std::convert::Into<bool>,
12710        {
12711            self.0.request.return_partial_success = std::option::Option::Some(v.into());
12712            self
12713        }
12714
12715        /// Sets or clears the value of [return_partial_success][crate::model::machine_types::ListRequest::return_partial_success].
12716        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
12717        where
12718            T: std::convert::Into<bool>,
12719        {
12720            self.0.request.return_partial_success = v.map(|x| x.into());
12721            self
12722        }
12723
12724        /// Sets the value of [zone][crate::model::machine_types::ListRequest::zone].
12725        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12726            self.0.request.zone = v.into();
12727            self
12728        }
12729    }
12730
12731    #[doc(hidden)]
12732    impl gax::options::internal::RequestBuilder for List {
12733        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12734            &mut self.0.options
12735        }
12736    }
12737}
12738
12739#[cfg(feature = "region-instance-group-managers")]
12740#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
12741pub mod region_instance_group_managers {
12742    use crate::Result;
12743
12744    /// A builder for [RegionInstanceGroupManagers][crate::client::RegionInstanceGroupManagers].
12745    ///
12746    /// ```
12747    /// # tokio_test::block_on(async {
12748    /// # use google_cloud_compute_v1::*;
12749    /// # use builder::region_instance_group_managers::ClientBuilder;
12750    /// # use client::RegionInstanceGroupManagers;
12751    /// let builder : ClientBuilder = RegionInstanceGroupManagers::builder();
12752    /// let client = builder
12753    ///     .with_endpoint("https://compute.googleapis.com")
12754    ///     .build().await?;
12755    /// # gax::client_builder::Result::<()>::Ok(()) });
12756    /// ```
12757    pub type ClientBuilder =
12758        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12759
12760    pub(crate) mod client {
12761        use super::super::super::client::RegionInstanceGroupManagers;
12762        pub struct Factory;
12763        impl gax::client_builder::internal::ClientFactory for Factory {
12764            type Client = RegionInstanceGroupManagers;
12765            type Credentials = gaxi::options::Credentials;
12766            async fn build(
12767                self,
12768                config: gaxi::options::ClientConfig,
12769            ) -> gax::client_builder::Result<Self::Client> {
12770                Self::Client::new(config).await
12771            }
12772        }
12773    }
12774
12775    /// Common implementation for [crate::client::RegionInstanceGroupManagers] request builders.
12776    #[derive(Clone, Debug)]
12777    pub(crate) struct RequestBuilder<R: std::default::Default> {
12778        stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12779        request: R,
12780        options: gax::options::RequestOptions,
12781    }
12782
12783    impl<R> RequestBuilder<R>
12784    where
12785        R: std::default::Default,
12786    {
12787        pub(crate) fn new(
12788            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12789        ) -> Self {
12790            Self {
12791                stub,
12792                request: R::default(),
12793                options: gax::options::RequestOptions::default(),
12794            }
12795        }
12796    }
12797
12798    /// The request builder for [RegionInstanceGroupManagers::abandon_instances][crate::client::RegionInstanceGroupManagers::abandon_instances] calls.
12799    ///
12800    /// # Example
12801    /// ```no_run
12802    /// # use google_cloud_compute_v1::builder;
12803    /// use builder::region_instance_group_managers::AbandonInstances;
12804    /// # tokio_test::block_on(async {
12805    ///
12806    /// let builder = prepare_request_builder();
12807    /// let response = builder.send().await?;
12808    /// # gax::Result::<()>::Ok(()) });
12809    ///
12810    /// fn prepare_request_builder() -> AbandonInstances {
12811    ///   # panic!();
12812    ///   // ... details omitted ...
12813    /// }
12814    /// ```
12815    #[derive(Clone, Debug)]
12816    pub struct AbandonInstances(
12817        RequestBuilder<crate::model::region_instance_group_managers::AbandonInstancesRequest>,
12818    );
12819
12820    impl AbandonInstances {
12821        pub(crate) fn new(
12822            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12823        ) -> Self {
12824            Self(RequestBuilder::new(stub))
12825        }
12826
12827        /// Sets the full request, replacing any prior values.
12828        pub fn with_request<
12829            V: Into<crate::model::region_instance_group_managers::AbandonInstancesRequest>,
12830        >(
12831            mut self,
12832            v: V,
12833        ) -> Self {
12834            self.0.request = v.into();
12835            self
12836        }
12837
12838        /// Sets all the options, replacing any prior values.
12839        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12840            self.0.options = v.into();
12841            self
12842        }
12843
12844        /// Sends the request.
12845        pub async fn send(self) -> Result<crate::model::Operation> {
12846            (*self.0.stub)
12847                .abandon_instances(self.0.request, self.0.options)
12848                .await
12849                .map(gax::response::Response::into_body)
12850        }
12851
12852        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::AbandonInstancesRequest::instance_group_manager].
12853        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
12854            self.0.request.instance_group_manager = v.into();
12855            self
12856        }
12857
12858        /// Sets the value of [project][crate::model::region_instance_group_managers::AbandonInstancesRequest::project].
12859        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12860            self.0.request.project = v.into();
12861            self
12862        }
12863
12864        /// Sets the value of [region][crate::model::region_instance_group_managers::AbandonInstancesRequest::region].
12865        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
12866            self.0.request.region = v.into();
12867            self
12868        }
12869
12870        /// Sets the value of [request_id][crate::model::region_instance_group_managers::AbandonInstancesRequest::request_id].
12871        pub fn set_request_id<T>(mut self, v: T) -> Self
12872        where
12873            T: std::convert::Into<std::string::String>,
12874        {
12875            self.0.request.request_id = std::option::Option::Some(v.into());
12876            self
12877        }
12878
12879        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::AbandonInstancesRequest::request_id].
12880        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12881        where
12882            T: std::convert::Into<std::string::String>,
12883        {
12884            self.0.request.request_id = v.map(|x| x.into());
12885            self
12886        }
12887
12888        /// Sets the value of [body][crate::model::region_instance_group_managers::AbandonInstancesRequest::body].
12889        pub fn set_body<T>(mut self, v: T) -> Self
12890        where
12891            T: std::convert::Into<crate::model::RegionInstanceGroupManagersAbandonInstancesRequest>,
12892        {
12893            self.0.request.body = std::option::Option::Some(v.into());
12894            self
12895        }
12896
12897        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::AbandonInstancesRequest::body].
12898        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12899        where
12900            T: std::convert::Into<crate::model::RegionInstanceGroupManagersAbandonInstancesRequest>,
12901        {
12902            self.0.request.body = v.map(|x| x.into());
12903            self
12904        }
12905    }
12906
12907    #[doc(hidden)]
12908    impl gax::options::internal::RequestBuilder for AbandonInstances {
12909        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12910            &mut self.0.options
12911        }
12912    }
12913
12914    /// The request builder for [RegionInstanceGroupManagers::apply_updates_to_instances][crate::client::RegionInstanceGroupManagers::apply_updates_to_instances] calls.
12915    ///
12916    /// # Example
12917    /// ```no_run
12918    /// # use google_cloud_compute_v1::builder;
12919    /// use builder::region_instance_group_managers::ApplyUpdatesToInstances;
12920    /// # tokio_test::block_on(async {
12921    ///
12922    /// let builder = prepare_request_builder();
12923    /// let response = builder.send().await?;
12924    /// # gax::Result::<()>::Ok(()) });
12925    ///
12926    /// fn prepare_request_builder() -> ApplyUpdatesToInstances {
12927    ///   # panic!();
12928    ///   // ... details omitted ...
12929    /// }
12930    /// ```
12931    #[derive(Clone, Debug)]
12932    pub struct ApplyUpdatesToInstances(
12933        RequestBuilder<
12934            crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest,
12935        >,
12936    );
12937
12938    impl ApplyUpdatesToInstances {
12939        pub(crate) fn new(
12940            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12941        ) -> Self {
12942            Self(RequestBuilder::new(stub))
12943        }
12944
12945        /// Sets the full request, replacing any prior values.
12946        pub fn with_request<
12947            V: Into<crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest>,
12948        >(
12949            mut self,
12950            v: V,
12951        ) -> Self {
12952            self.0.request = v.into();
12953            self
12954        }
12955
12956        /// Sets all the options, replacing any prior values.
12957        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12958            self.0.options = v.into();
12959            self
12960        }
12961
12962        /// Sends the request.
12963        pub async fn send(self) -> Result<crate::model::Operation> {
12964            (*self.0.stub)
12965                .apply_updates_to_instances(self.0.request, self.0.options)
12966                .await
12967                .map(gax::response::Response::into_body)
12968        }
12969
12970        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest::instance_group_manager].
12971        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
12972            self.0.request.instance_group_manager = v.into();
12973            self
12974        }
12975
12976        /// Sets the value of [project][crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest::project].
12977        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12978            self.0.request.project = v.into();
12979            self
12980        }
12981
12982        /// Sets the value of [region][crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest::region].
12983        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
12984            self.0.request.region = v.into();
12985            self
12986        }
12987
12988        /// Sets the value of [body][crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest::body].
12989        pub fn set_body<T>(mut self, v: T) -> Self
12990        where
12991            T: std::convert::Into<crate::model::RegionInstanceGroupManagersApplyUpdatesRequest>,
12992        {
12993            self.0.request.body = std::option::Option::Some(v.into());
12994            self
12995        }
12996
12997        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest::body].
12998        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12999        where
13000            T: std::convert::Into<crate::model::RegionInstanceGroupManagersApplyUpdatesRequest>,
13001        {
13002            self.0.request.body = v.map(|x| x.into());
13003            self
13004        }
13005    }
13006
13007    #[doc(hidden)]
13008    impl gax::options::internal::RequestBuilder for ApplyUpdatesToInstances {
13009        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13010            &mut self.0.options
13011        }
13012    }
13013
13014    /// The request builder for [RegionInstanceGroupManagers::create_instances][crate::client::RegionInstanceGroupManagers::create_instances] calls.
13015    ///
13016    /// # Example
13017    /// ```no_run
13018    /// # use google_cloud_compute_v1::builder;
13019    /// use builder::region_instance_group_managers::CreateInstances;
13020    /// # tokio_test::block_on(async {
13021    ///
13022    /// let builder = prepare_request_builder();
13023    /// let response = builder.send().await?;
13024    /// # gax::Result::<()>::Ok(()) });
13025    ///
13026    /// fn prepare_request_builder() -> CreateInstances {
13027    ///   # panic!();
13028    ///   // ... details omitted ...
13029    /// }
13030    /// ```
13031    #[derive(Clone, Debug)]
13032    pub struct CreateInstances(
13033        RequestBuilder<crate::model::region_instance_group_managers::CreateInstancesRequest>,
13034    );
13035
13036    impl CreateInstances {
13037        pub(crate) fn new(
13038            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13039        ) -> Self {
13040            Self(RequestBuilder::new(stub))
13041        }
13042
13043        /// Sets the full request, replacing any prior values.
13044        pub fn with_request<
13045            V: Into<crate::model::region_instance_group_managers::CreateInstancesRequest>,
13046        >(
13047            mut self,
13048            v: V,
13049        ) -> Self {
13050            self.0.request = v.into();
13051            self
13052        }
13053
13054        /// Sets all the options, replacing any prior values.
13055        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13056            self.0.options = v.into();
13057            self
13058        }
13059
13060        /// Sends the request.
13061        pub async fn send(self) -> Result<crate::model::Operation> {
13062            (*self.0.stub)
13063                .create_instances(self.0.request, self.0.options)
13064                .await
13065                .map(gax::response::Response::into_body)
13066        }
13067
13068        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::CreateInstancesRequest::instance_group_manager].
13069        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13070            self.0.request.instance_group_manager = v.into();
13071            self
13072        }
13073
13074        /// Sets the value of [project][crate::model::region_instance_group_managers::CreateInstancesRequest::project].
13075        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13076            self.0.request.project = v.into();
13077            self
13078        }
13079
13080        /// Sets the value of [region][crate::model::region_instance_group_managers::CreateInstancesRequest::region].
13081        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13082            self.0.request.region = v.into();
13083            self
13084        }
13085
13086        /// Sets the value of [request_id][crate::model::region_instance_group_managers::CreateInstancesRequest::request_id].
13087        pub fn set_request_id<T>(mut self, v: T) -> Self
13088        where
13089            T: std::convert::Into<std::string::String>,
13090        {
13091            self.0.request.request_id = std::option::Option::Some(v.into());
13092            self
13093        }
13094
13095        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::CreateInstancesRequest::request_id].
13096        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13097        where
13098            T: std::convert::Into<std::string::String>,
13099        {
13100            self.0.request.request_id = v.map(|x| x.into());
13101            self
13102        }
13103
13104        /// Sets the value of [body][crate::model::region_instance_group_managers::CreateInstancesRequest::body].
13105        pub fn set_body<T>(mut self, v: T) -> Self
13106        where
13107            T: std::convert::Into<crate::model::RegionInstanceGroupManagersCreateInstancesRequest>,
13108        {
13109            self.0.request.body = std::option::Option::Some(v.into());
13110            self
13111        }
13112
13113        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::CreateInstancesRequest::body].
13114        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13115        where
13116            T: std::convert::Into<crate::model::RegionInstanceGroupManagersCreateInstancesRequest>,
13117        {
13118            self.0.request.body = v.map(|x| x.into());
13119            self
13120        }
13121    }
13122
13123    #[doc(hidden)]
13124    impl gax::options::internal::RequestBuilder for CreateInstances {
13125        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13126            &mut self.0.options
13127        }
13128    }
13129
13130    /// The request builder for [RegionInstanceGroupManagers::delete][crate::client::RegionInstanceGroupManagers::delete] calls.
13131    ///
13132    /// # Example
13133    /// ```no_run
13134    /// # use google_cloud_compute_v1::builder;
13135    /// use builder::region_instance_group_managers::Delete;
13136    /// # tokio_test::block_on(async {
13137    ///
13138    /// let builder = prepare_request_builder();
13139    /// let response = builder.send().await?;
13140    /// # gax::Result::<()>::Ok(()) });
13141    ///
13142    /// fn prepare_request_builder() -> Delete {
13143    ///   # panic!();
13144    ///   // ... details omitted ...
13145    /// }
13146    /// ```
13147    #[derive(Clone, Debug)]
13148    pub struct Delete(RequestBuilder<crate::model::region_instance_group_managers::DeleteRequest>);
13149
13150    impl Delete {
13151        pub(crate) fn new(
13152            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13153        ) -> Self {
13154            Self(RequestBuilder::new(stub))
13155        }
13156
13157        /// Sets the full request, replacing any prior values.
13158        pub fn with_request<
13159            V: Into<crate::model::region_instance_group_managers::DeleteRequest>,
13160        >(
13161            mut self,
13162            v: V,
13163        ) -> Self {
13164            self.0.request = v.into();
13165            self
13166        }
13167
13168        /// Sets all the options, replacing any prior values.
13169        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13170            self.0.options = v.into();
13171            self
13172        }
13173
13174        /// Sends the request.
13175        pub async fn send(self) -> Result<crate::model::Operation> {
13176            (*self.0.stub)
13177                .delete(self.0.request, self.0.options)
13178                .await
13179                .map(gax::response::Response::into_body)
13180        }
13181
13182        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::DeleteRequest::instance_group_manager].
13183        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13184            self.0.request.instance_group_manager = v.into();
13185            self
13186        }
13187
13188        /// Sets the value of [project][crate::model::region_instance_group_managers::DeleteRequest::project].
13189        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13190            self.0.request.project = v.into();
13191            self
13192        }
13193
13194        /// Sets the value of [region][crate::model::region_instance_group_managers::DeleteRequest::region].
13195        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13196            self.0.request.region = v.into();
13197            self
13198        }
13199
13200        /// Sets the value of [request_id][crate::model::region_instance_group_managers::DeleteRequest::request_id].
13201        pub fn set_request_id<T>(mut self, v: T) -> Self
13202        where
13203            T: std::convert::Into<std::string::String>,
13204        {
13205            self.0.request.request_id = std::option::Option::Some(v.into());
13206            self
13207        }
13208
13209        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::DeleteRequest::request_id].
13210        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13211        where
13212            T: std::convert::Into<std::string::String>,
13213        {
13214            self.0.request.request_id = v.map(|x| x.into());
13215            self
13216        }
13217    }
13218
13219    #[doc(hidden)]
13220    impl gax::options::internal::RequestBuilder for Delete {
13221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13222            &mut self.0.options
13223        }
13224    }
13225
13226    /// The request builder for [RegionInstanceGroupManagers::delete_instances][crate::client::RegionInstanceGroupManagers::delete_instances] calls.
13227    ///
13228    /// # Example
13229    /// ```no_run
13230    /// # use google_cloud_compute_v1::builder;
13231    /// use builder::region_instance_group_managers::DeleteInstances;
13232    /// # tokio_test::block_on(async {
13233    ///
13234    /// let builder = prepare_request_builder();
13235    /// let response = builder.send().await?;
13236    /// # gax::Result::<()>::Ok(()) });
13237    ///
13238    /// fn prepare_request_builder() -> DeleteInstances {
13239    ///   # panic!();
13240    ///   // ... details omitted ...
13241    /// }
13242    /// ```
13243    #[derive(Clone, Debug)]
13244    pub struct DeleteInstances(
13245        RequestBuilder<crate::model::region_instance_group_managers::DeleteInstancesRequest>,
13246    );
13247
13248    impl DeleteInstances {
13249        pub(crate) fn new(
13250            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13251        ) -> Self {
13252            Self(RequestBuilder::new(stub))
13253        }
13254
13255        /// Sets the full request, replacing any prior values.
13256        pub fn with_request<
13257            V: Into<crate::model::region_instance_group_managers::DeleteInstancesRequest>,
13258        >(
13259            mut self,
13260            v: V,
13261        ) -> Self {
13262            self.0.request = v.into();
13263            self
13264        }
13265
13266        /// Sets all the options, replacing any prior values.
13267        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13268            self.0.options = v.into();
13269            self
13270        }
13271
13272        /// Sends the request.
13273        pub async fn send(self) -> Result<crate::model::Operation> {
13274            (*self.0.stub)
13275                .delete_instances(self.0.request, self.0.options)
13276                .await
13277                .map(gax::response::Response::into_body)
13278        }
13279
13280        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::DeleteInstancesRequest::instance_group_manager].
13281        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13282            self.0.request.instance_group_manager = v.into();
13283            self
13284        }
13285
13286        /// Sets the value of [project][crate::model::region_instance_group_managers::DeleteInstancesRequest::project].
13287        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13288            self.0.request.project = v.into();
13289            self
13290        }
13291
13292        /// Sets the value of [region][crate::model::region_instance_group_managers::DeleteInstancesRequest::region].
13293        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13294            self.0.request.region = v.into();
13295            self
13296        }
13297
13298        /// Sets the value of [request_id][crate::model::region_instance_group_managers::DeleteInstancesRequest::request_id].
13299        pub fn set_request_id<T>(mut self, v: T) -> Self
13300        where
13301            T: std::convert::Into<std::string::String>,
13302        {
13303            self.0.request.request_id = std::option::Option::Some(v.into());
13304            self
13305        }
13306
13307        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::DeleteInstancesRequest::request_id].
13308        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13309        where
13310            T: std::convert::Into<std::string::String>,
13311        {
13312            self.0.request.request_id = v.map(|x| x.into());
13313            self
13314        }
13315
13316        /// Sets the value of [body][crate::model::region_instance_group_managers::DeleteInstancesRequest::body].
13317        pub fn set_body<T>(mut self, v: T) -> Self
13318        where
13319            T: std::convert::Into<crate::model::RegionInstanceGroupManagersDeleteInstancesRequest>,
13320        {
13321            self.0.request.body = std::option::Option::Some(v.into());
13322            self
13323        }
13324
13325        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::DeleteInstancesRequest::body].
13326        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13327        where
13328            T: std::convert::Into<crate::model::RegionInstanceGroupManagersDeleteInstancesRequest>,
13329        {
13330            self.0.request.body = v.map(|x| x.into());
13331            self
13332        }
13333    }
13334
13335    #[doc(hidden)]
13336    impl gax::options::internal::RequestBuilder for DeleteInstances {
13337        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13338            &mut self.0.options
13339        }
13340    }
13341
13342    /// The request builder for [RegionInstanceGroupManagers::delete_per_instance_configs][crate::client::RegionInstanceGroupManagers::delete_per_instance_configs] calls.
13343    ///
13344    /// # Example
13345    /// ```no_run
13346    /// # use google_cloud_compute_v1::builder;
13347    /// use builder::region_instance_group_managers::DeletePerInstanceConfigs;
13348    /// # tokio_test::block_on(async {
13349    ///
13350    /// let builder = prepare_request_builder();
13351    /// let response = builder.send().await?;
13352    /// # gax::Result::<()>::Ok(()) });
13353    ///
13354    /// fn prepare_request_builder() -> DeletePerInstanceConfigs {
13355    ///   # panic!();
13356    ///   // ... details omitted ...
13357    /// }
13358    /// ```
13359    #[derive(Clone, Debug)]
13360    pub struct DeletePerInstanceConfigs(
13361        RequestBuilder<
13362            crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest,
13363        >,
13364    );
13365
13366    impl DeletePerInstanceConfigs {
13367        pub(crate) fn new(
13368            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13369        ) -> Self {
13370            Self(RequestBuilder::new(stub))
13371        }
13372
13373        /// Sets the full request, replacing any prior values.
13374        pub fn with_request<
13375            V: Into<crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest>,
13376        >(
13377            mut self,
13378            v: V,
13379        ) -> Self {
13380            self.0.request = v.into();
13381            self
13382        }
13383
13384        /// Sets all the options, replacing any prior values.
13385        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13386            self.0.options = v.into();
13387            self
13388        }
13389
13390        /// Sends the request.
13391        pub async fn send(self) -> Result<crate::model::Operation> {
13392            (*self.0.stub)
13393                .delete_per_instance_configs(self.0.request, self.0.options)
13394                .await
13395                .map(gax::response::Response::into_body)
13396        }
13397
13398        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest::instance_group_manager].
13399        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13400            self.0.request.instance_group_manager = v.into();
13401            self
13402        }
13403
13404        /// Sets the value of [project][crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest::project].
13405        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13406            self.0.request.project = v.into();
13407            self
13408        }
13409
13410        /// Sets the value of [region][crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest::region].
13411        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13412            self.0.request.region = v.into();
13413            self
13414        }
13415
13416        /// Sets the value of [body][crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest::body].
13417        pub fn set_body<T>(mut self, v: T) -> Self
13418        where
13419            T: std::convert::Into<crate::model::RegionInstanceGroupManagerDeleteInstanceConfigReq>,
13420        {
13421            self.0.request.body = std::option::Option::Some(v.into());
13422            self
13423        }
13424
13425        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest::body].
13426        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13427        where
13428            T: std::convert::Into<crate::model::RegionInstanceGroupManagerDeleteInstanceConfigReq>,
13429        {
13430            self.0.request.body = v.map(|x| x.into());
13431            self
13432        }
13433    }
13434
13435    #[doc(hidden)]
13436    impl gax::options::internal::RequestBuilder for DeletePerInstanceConfigs {
13437        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13438            &mut self.0.options
13439        }
13440    }
13441
13442    /// The request builder for [RegionInstanceGroupManagers::get][crate::client::RegionInstanceGroupManagers::get] calls.
13443    ///
13444    /// # Example
13445    /// ```no_run
13446    /// # use google_cloud_compute_v1::builder;
13447    /// use builder::region_instance_group_managers::Get;
13448    /// # tokio_test::block_on(async {
13449    ///
13450    /// let builder = prepare_request_builder();
13451    /// let response = builder.send().await?;
13452    /// # gax::Result::<()>::Ok(()) });
13453    ///
13454    /// fn prepare_request_builder() -> Get {
13455    ///   # panic!();
13456    ///   // ... details omitted ...
13457    /// }
13458    /// ```
13459    #[derive(Clone, Debug)]
13460    pub struct Get(RequestBuilder<crate::model::region_instance_group_managers::GetRequest>);
13461
13462    impl Get {
13463        pub(crate) fn new(
13464            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13465        ) -> Self {
13466            Self(RequestBuilder::new(stub))
13467        }
13468
13469        /// Sets the full request, replacing any prior values.
13470        pub fn with_request<V: Into<crate::model::region_instance_group_managers::GetRequest>>(
13471            mut self,
13472            v: V,
13473        ) -> Self {
13474            self.0.request = v.into();
13475            self
13476        }
13477
13478        /// Sets all the options, replacing any prior values.
13479        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13480            self.0.options = v.into();
13481            self
13482        }
13483
13484        /// Sends the request.
13485        pub async fn send(self) -> Result<crate::model::InstanceGroupManager> {
13486            (*self.0.stub)
13487                .get(self.0.request, self.0.options)
13488                .await
13489                .map(gax::response::Response::into_body)
13490        }
13491
13492        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::GetRequest::instance_group_manager].
13493        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13494            self.0.request.instance_group_manager = v.into();
13495            self
13496        }
13497
13498        /// Sets the value of [project][crate::model::region_instance_group_managers::GetRequest::project].
13499        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13500            self.0.request.project = v.into();
13501            self
13502        }
13503
13504        /// Sets the value of [region][crate::model::region_instance_group_managers::GetRequest::region].
13505        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13506            self.0.request.region = v.into();
13507            self
13508        }
13509    }
13510
13511    #[doc(hidden)]
13512    impl gax::options::internal::RequestBuilder for Get {
13513        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13514            &mut self.0.options
13515        }
13516    }
13517
13518    /// The request builder for [RegionInstanceGroupManagers::insert][crate::client::RegionInstanceGroupManagers::insert] calls.
13519    ///
13520    /// # Example
13521    /// ```no_run
13522    /// # use google_cloud_compute_v1::builder;
13523    /// use builder::region_instance_group_managers::Insert;
13524    /// # tokio_test::block_on(async {
13525    ///
13526    /// let builder = prepare_request_builder();
13527    /// let response = builder.send().await?;
13528    /// # gax::Result::<()>::Ok(()) });
13529    ///
13530    /// fn prepare_request_builder() -> Insert {
13531    ///   # panic!();
13532    ///   // ... details omitted ...
13533    /// }
13534    /// ```
13535    #[derive(Clone, Debug)]
13536    pub struct Insert(RequestBuilder<crate::model::region_instance_group_managers::InsertRequest>);
13537
13538    impl Insert {
13539        pub(crate) fn new(
13540            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13541        ) -> Self {
13542            Self(RequestBuilder::new(stub))
13543        }
13544
13545        /// Sets the full request, replacing any prior values.
13546        pub fn with_request<
13547            V: Into<crate::model::region_instance_group_managers::InsertRequest>,
13548        >(
13549            mut self,
13550            v: V,
13551        ) -> Self {
13552            self.0.request = v.into();
13553            self
13554        }
13555
13556        /// Sets all the options, replacing any prior values.
13557        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13558            self.0.options = v.into();
13559            self
13560        }
13561
13562        /// Sends the request.
13563        pub async fn send(self) -> Result<crate::model::Operation> {
13564            (*self.0.stub)
13565                .insert(self.0.request, self.0.options)
13566                .await
13567                .map(gax::response::Response::into_body)
13568        }
13569
13570        /// Sets the value of [project][crate::model::region_instance_group_managers::InsertRequest::project].
13571        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13572            self.0.request.project = v.into();
13573            self
13574        }
13575
13576        /// Sets the value of [region][crate::model::region_instance_group_managers::InsertRequest::region].
13577        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13578            self.0.request.region = v.into();
13579            self
13580        }
13581
13582        /// Sets the value of [request_id][crate::model::region_instance_group_managers::InsertRequest::request_id].
13583        pub fn set_request_id<T>(mut self, v: T) -> Self
13584        where
13585            T: std::convert::Into<std::string::String>,
13586        {
13587            self.0.request.request_id = std::option::Option::Some(v.into());
13588            self
13589        }
13590
13591        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::InsertRequest::request_id].
13592        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13593        where
13594            T: std::convert::Into<std::string::String>,
13595        {
13596            self.0.request.request_id = v.map(|x| x.into());
13597            self
13598        }
13599
13600        /// Sets the value of [body][crate::model::region_instance_group_managers::InsertRequest::body].
13601        pub fn set_body<T>(mut self, v: T) -> Self
13602        where
13603            T: std::convert::Into<crate::model::InstanceGroupManager>,
13604        {
13605            self.0.request.body = std::option::Option::Some(v.into());
13606            self
13607        }
13608
13609        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::InsertRequest::body].
13610        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13611        where
13612            T: std::convert::Into<crate::model::InstanceGroupManager>,
13613        {
13614            self.0.request.body = v.map(|x| x.into());
13615            self
13616        }
13617    }
13618
13619    #[doc(hidden)]
13620    impl gax::options::internal::RequestBuilder for Insert {
13621        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13622            &mut self.0.options
13623        }
13624    }
13625
13626    /// The request builder for [RegionInstanceGroupManagers::list][crate::client::RegionInstanceGroupManagers::list] calls.
13627    ///
13628    /// # Example
13629    /// ```no_run
13630    /// # use google_cloud_compute_v1::builder;
13631    /// use builder::region_instance_group_managers::List;
13632    /// # tokio_test::block_on(async {
13633    /// use gax::paginator::ItemPaginator;
13634    ///
13635    /// let builder = prepare_request_builder();
13636    /// let mut items = builder.by_item();
13637    /// while let Some(result) = items.next().await {
13638    ///   let item = result?;
13639    /// }
13640    /// # gax::Result::<()>::Ok(()) });
13641    ///
13642    /// fn prepare_request_builder() -> List {
13643    ///   # panic!();
13644    ///   // ... details omitted ...
13645    /// }
13646    /// ```
13647    #[derive(Clone, Debug)]
13648    pub struct List(RequestBuilder<crate::model::region_instance_group_managers::ListRequest>);
13649
13650    impl List {
13651        pub(crate) fn new(
13652            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13653        ) -> Self {
13654            Self(RequestBuilder::new(stub))
13655        }
13656
13657        /// Sets the full request, replacing any prior values.
13658        pub fn with_request<V: Into<crate::model::region_instance_group_managers::ListRequest>>(
13659            mut self,
13660            v: V,
13661        ) -> Self {
13662            self.0.request = v.into();
13663            self
13664        }
13665
13666        /// Sets all the options, replacing any prior values.
13667        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13668            self.0.options = v.into();
13669            self
13670        }
13671
13672        /// Sends the request.
13673        pub async fn send(self) -> Result<crate::model::RegionInstanceGroupManagerList> {
13674            (*self.0.stub)
13675                .list(self.0.request, self.0.options)
13676                .await
13677                .map(gax::response::Response::into_body)
13678        }
13679
13680        /// Streams each page in the collection.
13681        pub fn by_page(
13682            self,
13683        ) -> impl gax::paginator::Paginator<
13684            crate::model::RegionInstanceGroupManagerList,
13685            gax::error::Error,
13686        > {
13687            use std::clone::Clone;
13688            let token = self.0.request.page_token.clone().unwrap_or_default();
13689            let execute = move |token: String| {
13690                let mut builder = self.clone();
13691                builder.0.request = builder.0.request.set_page_token(token);
13692                builder.send()
13693            };
13694            gax::paginator::internal::new_paginator(token, execute)
13695        }
13696
13697        /// Streams each item in the collection.
13698        pub fn by_item(
13699            self,
13700        ) -> impl gax::paginator::ItemPaginator<
13701            crate::model::RegionInstanceGroupManagerList,
13702            gax::error::Error,
13703        > {
13704            use gax::paginator::Paginator;
13705            self.by_page().items()
13706        }
13707
13708        /// Sets the value of [filter][crate::model::region_instance_group_managers::ListRequest::filter].
13709        pub fn set_filter<T>(mut self, v: T) -> Self
13710        where
13711            T: std::convert::Into<std::string::String>,
13712        {
13713            self.0.request.filter = std::option::Option::Some(v.into());
13714            self
13715        }
13716
13717        /// Sets or clears the value of [filter][crate::model::region_instance_group_managers::ListRequest::filter].
13718        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
13719        where
13720            T: std::convert::Into<std::string::String>,
13721        {
13722            self.0.request.filter = v.map(|x| x.into());
13723            self
13724        }
13725
13726        /// Sets the value of [max_results][crate::model::region_instance_group_managers::ListRequest::max_results].
13727        pub fn set_max_results<T>(mut self, v: T) -> Self
13728        where
13729            T: std::convert::Into<u32>,
13730        {
13731            self.0.request.max_results = std::option::Option::Some(v.into());
13732            self
13733        }
13734
13735        /// Sets or clears the value of [max_results][crate::model::region_instance_group_managers::ListRequest::max_results].
13736        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
13737        where
13738            T: std::convert::Into<u32>,
13739        {
13740            self.0.request.max_results = v.map(|x| x.into());
13741            self
13742        }
13743
13744        /// Sets the value of [order_by][crate::model::region_instance_group_managers::ListRequest::order_by].
13745        pub fn set_order_by<T>(mut self, v: T) -> Self
13746        where
13747            T: std::convert::Into<std::string::String>,
13748        {
13749            self.0.request.order_by = std::option::Option::Some(v.into());
13750            self
13751        }
13752
13753        /// Sets or clears the value of [order_by][crate::model::region_instance_group_managers::ListRequest::order_by].
13754        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
13755        where
13756            T: std::convert::Into<std::string::String>,
13757        {
13758            self.0.request.order_by = v.map(|x| x.into());
13759            self
13760        }
13761
13762        /// Sets the value of [page_token][crate::model::region_instance_group_managers::ListRequest::page_token].
13763        pub fn set_page_token<T>(mut self, v: T) -> Self
13764        where
13765            T: std::convert::Into<std::string::String>,
13766        {
13767            self.0.request.page_token = std::option::Option::Some(v.into());
13768            self
13769        }
13770
13771        /// Sets or clears the value of [page_token][crate::model::region_instance_group_managers::ListRequest::page_token].
13772        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
13773        where
13774            T: std::convert::Into<std::string::String>,
13775        {
13776            self.0.request.page_token = v.map(|x| x.into());
13777            self
13778        }
13779
13780        /// Sets the value of [project][crate::model::region_instance_group_managers::ListRequest::project].
13781        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13782            self.0.request.project = v.into();
13783            self
13784        }
13785
13786        /// Sets the value of [region][crate::model::region_instance_group_managers::ListRequest::region].
13787        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13788            self.0.request.region = v.into();
13789            self
13790        }
13791
13792        /// Sets the value of [return_partial_success][crate::model::region_instance_group_managers::ListRequest::return_partial_success].
13793        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
13794        where
13795            T: std::convert::Into<bool>,
13796        {
13797            self.0.request.return_partial_success = std::option::Option::Some(v.into());
13798            self
13799        }
13800
13801        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_group_managers::ListRequest::return_partial_success].
13802        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
13803        where
13804            T: std::convert::Into<bool>,
13805        {
13806            self.0.request.return_partial_success = v.map(|x| x.into());
13807            self
13808        }
13809    }
13810
13811    #[doc(hidden)]
13812    impl gax::options::internal::RequestBuilder for List {
13813        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13814            &mut self.0.options
13815        }
13816    }
13817
13818    /// The request builder for [RegionInstanceGroupManagers::list_errors][crate::client::RegionInstanceGroupManagers::list_errors] calls.
13819    ///
13820    /// # Example
13821    /// ```no_run
13822    /// # use google_cloud_compute_v1::builder;
13823    /// use builder::region_instance_group_managers::ListErrors;
13824    /// # tokio_test::block_on(async {
13825    /// use gax::paginator::ItemPaginator;
13826    ///
13827    /// let builder = prepare_request_builder();
13828    /// let mut items = builder.by_item();
13829    /// while let Some(result) = items.next().await {
13830    ///   let item = result?;
13831    /// }
13832    /// # gax::Result::<()>::Ok(()) });
13833    ///
13834    /// fn prepare_request_builder() -> ListErrors {
13835    ///   # panic!();
13836    ///   // ... details omitted ...
13837    /// }
13838    /// ```
13839    #[derive(Clone, Debug)]
13840    pub struct ListErrors(
13841        RequestBuilder<crate::model::region_instance_group_managers::ListErrorsRequest>,
13842    );
13843
13844    impl ListErrors {
13845        pub(crate) fn new(
13846            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13847        ) -> Self {
13848            Self(RequestBuilder::new(stub))
13849        }
13850
13851        /// Sets the full request, replacing any prior values.
13852        pub fn with_request<
13853            V: Into<crate::model::region_instance_group_managers::ListErrorsRequest>,
13854        >(
13855            mut self,
13856            v: V,
13857        ) -> Self {
13858            self.0.request = v.into();
13859            self
13860        }
13861
13862        /// Sets all the options, replacing any prior values.
13863        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13864            self.0.options = v.into();
13865            self
13866        }
13867
13868        /// Sends the request.
13869        pub async fn send(
13870            self,
13871        ) -> Result<crate::model::RegionInstanceGroupManagersListErrorsResponse> {
13872            (*self.0.stub)
13873                .list_errors(self.0.request, self.0.options)
13874                .await
13875                .map(gax::response::Response::into_body)
13876        }
13877
13878        /// Streams each page in the collection.
13879        pub fn by_page(
13880            self,
13881        ) -> impl gax::paginator::Paginator<
13882            crate::model::RegionInstanceGroupManagersListErrorsResponse,
13883            gax::error::Error,
13884        > {
13885            use std::clone::Clone;
13886            let token = self.0.request.page_token.clone().unwrap_or_default();
13887            let execute = move |token: String| {
13888                let mut builder = self.clone();
13889                builder.0.request = builder.0.request.set_page_token(token);
13890                builder.send()
13891            };
13892            gax::paginator::internal::new_paginator(token, execute)
13893        }
13894
13895        /// Streams each item in the collection.
13896        pub fn by_item(
13897            self,
13898        ) -> impl gax::paginator::ItemPaginator<
13899            crate::model::RegionInstanceGroupManagersListErrorsResponse,
13900            gax::error::Error,
13901        > {
13902            use gax::paginator::Paginator;
13903            self.by_page().items()
13904        }
13905
13906        /// Sets the value of [filter][crate::model::region_instance_group_managers::ListErrorsRequest::filter].
13907        pub fn set_filter<T>(mut self, v: T) -> Self
13908        where
13909            T: std::convert::Into<std::string::String>,
13910        {
13911            self.0.request.filter = std::option::Option::Some(v.into());
13912            self
13913        }
13914
13915        /// Sets or clears the value of [filter][crate::model::region_instance_group_managers::ListErrorsRequest::filter].
13916        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
13917        where
13918            T: std::convert::Into<std::string::String>,
13919        {
13920            self.0.request.filter = v.map(|x| x.into());
13921            self
13922        }
13923
13924        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ListErrorsRequest::instance_group_manager].
13925        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13926            self.0.request.instance_group_manager = v.into();
13927            self
13928        }
13929
13930        /// Sets the value of [max_results][crate::model::region_instance_group_managers::ListErrorsRequest::max_results].
13931        pub fn set_max_results<T>(mut self, v: T) -> Self
13932        where
13933            T: std::convert::Into<u32>,
13934        {
13935            self.0.request.max_results = std::option::Option::Some(v.into());
13936            self
13937        }
13938
13939        /// Sets or clears the value of [max_results][crate::model::region_instance_group_managers::ListErrorsRequest::max_results].
13940        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
13941        where
13942            T: std::convert::Into<u32>,
13943        {
13944            self.0.request.max_results = v.map(|x| x.into());
13945            self
13946        }
13947
13948        /// Sets the value of [order_by][crate::model::region_instance_group_managers::ListErrorsRequest::order_by].
13949        pub fn set_order_by<T>(mut self, v: T) -> Self
13950        where
13951            T: std::convert::Into<std::string::String>,
13952        {
13953            self.0.request.order_by = std::option::Option::Some(v.into());
13954            self
13955        }
13956
13957        /// Sets or clears the value of [order_by][crate::model::region_instance_group_managers::ListErrorsRequest::order_by].
13958        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
13959        where
13960            T: std::convert::Into<std::string::String>,
13961        {
13962            self.0.request.order_by = v.map(|x| x.into());
13963            self
13964        }
13965
13966        /// Sets the value of [page_token][crate::model::region_instance_group_managers::ListErrorsRequest::page_token].
13967        pub fn set_page_token<T>(mut self, v: T) -> Self
13968        where
13969            T: std::convert::Into<std::string::String>,
13970        {
13971            self.0.request.page_token = std::option::Option::Some(v.into());
13972            self
13973        }
13974
13975        /// Sets or clears the value of [page_token][crate::model::region_instance_group_managers::ListErrorsRequest::page_token].
13976        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
13977        where
13978            T: std::convert::Into<std::string::String>,
13979        {
13980            self.0.request.page_token = v.map(|x| x.into());
13981            self
13982        }
13983
13984        /// Sets the value of [project][crate::model::region_instance_group_managers::ListErrorsRequest::project].
13985        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13986            self.0.request.project = v.into();
13987            self
13988        }
13989
13990        /// Sets the value of [region][crate::model::region_instance_group_managers::ListErrorsRequest::region].
13991        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13992            self.0.request.region = v.into();
13993            self
13994        }
13995
13996        /// Sets the value of [return_partial_success][crate::model::region_instance_group_managers::ListErrorsRequest::return_partial_success].
13997        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
13998        where
13999            T: std::convert::Into<bool>,
14000        {
14001            self.0.request.return_partial_success = std::option::Option::Some(v.into());
14002            self
14003        }
14004
14005        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_group_managers::ListErrorsRequest::return_partial_success].
14006        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14007        where
14008            T: std::convert::Into<bool>,
14009        {
14010            self.0.request.return_partial_success = v.map(|x| x.into());
14011            self
14012        }
14013    }
14014
14015    #[doc(hidden)]
14016    impl gax::options::internal::RequestBuilder for ListErrors {
14017        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14018            &mut self.0.options
14019        }
14020    }
14021
14022    /// The request builder for [RegionInstanceGroupManagers::list_managed_instances][crate::client::RegionInstanceGroupManagers::list_managed_instances] calls.
14023    ///
14024    /// # Example
14025    /// ```no_run
14026    /// # use google_cloud_compute_v1::builder;
14027    /// use builder::region_instance_group_managers::ListManagedInstances;
14028    /// # tokio_test::block_on(async {
14029    /// use gax::paginator::ItemPaginator;
14030    ///
14031    /// let builder = prepare_request_builder();
14032    /// let mut items = builder.by_item();
14033    /// while let Some(result) = items.next().await {
14034    ///   let item = result?;
14035    /// }
14036    /// # gax::Result::<()>::Ok(()) });
14037    ///
14038    /// fn prepare_request_builder() -> ListManagedInstances {
14039    ///   # panic!();
14040    ///   // ... details omitted ...
14041    /// }
14042    /// ```
14043    #[derive(Clone, Debug)]
14044    pub struct ListManagedInstances(
14045        RequestBuilder<crate::model::region_instance_group_managers::ListManagedInstancesRequest>,
14046    );
14047
14048    impl ListManagedInstances {
14049        pub(crate) fn new(
14050            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14051        ) -> Self {
14052            Self(RequestBuilder::new(stub))
14053        }
14054
14055        /// Sets the full request, replacing any prior values.
14056        pub fn with_request<
14057            V: Into<crate::model::region_instance_group_managers::ListManagedInstancesRequest>,
14058        >(
14059            mut self,
14060            v: V,
14061        ) -> Self {
14062            self.0.request = v.into();
14063            self
14064        }
14065
14066        /// Sets all the options, replacing any prior values.
14067        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14068            self.0.options = v.into();
14069            self
14070        }
14071
14072        /// Sends the request.
14073        pub async fn send(
14074            self,
14075        ) -> Result<crate::model::RegionInstanceGroupManagersListInstancesResponse> {
14076            (*self.0.stub)
14077                .list_managed_instances(self.0.request, self.0.options)
14078                .await
14079                .map(gax::response::Response::into_body)
14080        }
14081
14082        /// Streams each page in the collection.
14083        pub fn by_page(
14084            self,
14085        ) -> impl gax::paginator::Paginator<
14086            crate::model::RegionInstanceGroupManagersListInstancesResponse,
14087            gax::error::Error,
14088        > {
14089            use std::clone::Clone;
14090            let token = self.0.request.page_token.clone().unwrap_or_default();
14091            let execute = move |token: String| {
14092                let mut builder = self.clone();
14093                builder.0.request = builder.0.request.set_page_token(token);
14094                builder.send()
14095            };
14096            gax::paginator::internal::new_paginator(token, execute)
14097        }
14098
14099        /// Streams each item in the collection.
14100        pub fn by_item(
14101            self,
14102        ) -> impl gax::paginator::ItemPaginator<
14103            crate::model::RegionInstanceGroupManagersListInstancesResponse,
14104            gax::error::Error,
14105        > {
14106            use gax::paginator::Paginator;
14107            self.by_page().items()
14108        }
14109
14110        /// Sets the value of [filter][crate::model::region_instance_group_managers::ListManagedInstancesRequest::filter].
14111        pub fn set_filter<T>(mut self, v: T) -> Self
14112        where
14113            T: std::convert::Into<std::string::String>,
14114        {
14115            self.0.request.filter = std::option::Option::Some(v.into());
14116            self
14117        }
14118
14119        /// Sets or clears the value of [filter][crate::model::region_instance_group_managers::ListManagedInstancesRequest::filter].
14120        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
14121        where
14122            T: std::convert::Into<std::string::String>,
14123        {
14124            self.0.request.filter = v.map(|x| x.into());
14125            self
14126        }
14127
14128        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ListManagedInstancesRequest::instance_group_manager].
14129        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14130            self.0.request.instance_group_manager = v.into();
14131            self
14132        }
14133
14134        /// Sets the value of [max_results][crate::model::region_instance_group_managers::ListManagedInstancesRequest::max_results].
14135        pub fn set_max_results<T>(mut self, v: T) -> Self
14136        where
14137            T: std::convert::Into<u32>,
14138        {
14139            self.0.request.max_results = std::option::Option::Some(v.into());
14140            self
14141        }
14142
14143        /// Sets or clears the value of [max_results][crate::model::region_instance_group_managers::ListManagedInstancesRequest::max_results].
14144        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14145        where
14146            T: std::convert::Into<u32>,
14147        {
14148            self.0.request.max_results = v.map(|x| x.into());
14149            self
14150        }
14151
14152        /// Sets the value of [order_by][crate::model::region_instance_group_managers::ListManagedInstancesRequest::order_by].
14153        pub fn set_order_by<T>(mut self, v: T) -> Self
14154        where
14155            T: std::convert::Into<std::string::String>,
14156        {
14157            self.0.request.order_by = std::option::Option::Some(v.into());
14158            self
14159        }
14160
14161        /// Sets or clears the value of [order_by][crate::model::region_instance_group_managers::ListManagedInstancesRequest::order_by].
14162        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
14163        where
14164            T: std::convert::Into<std::string::String>,
14165        {
14166            self.0.request.order_by = v.map(|x| x.into());
14167            self
14168        }
14169
14170        /// Sets the value of [page_token][crate::model::region_instance_group_managers::ListManagedInstancesRequest::page_token].
14171        pub fn set_page_token<T>(mut self, v: T) -> Self
14172        where
14173            T: std::convert::Into<std::string::String>,
14174        {
14175            self.0.request.page_token = std::option::Option::Some(v.into());
14176            self
14177        }
14178
14179        /// Sets or clears the value of [page_token][crate::model::region_instance_group_managers::ListManagedInstancesRequest::page_token].
14180        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14181        where
14182            T: std::convert::Into<std::string::String>,
14183        {
14184            self.0.request.page_token = v.map(|x| x.into());
14185            self
14186        }
14187
14188        /// Sets the value of [project][crate::model::region_instance_group_managers::ListManagedInstancesRequest::project].
14189        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14190            self.0.request.project = v.into();
14191            self
14192        }
14193
14194        /// Sets the value of [region][crate::model::region_instance_group_managers::ListManagedInstancesRequest::region].
14195        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14196            self.0.request.region = v.into();
14197            self
14198        }
14199
14200        /// Sets the value of [return_partial_success][crate::model::region_instance_group_managers::ListManagedInstancesRequest::return_partial_success].
14201        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
14202        where
14203            T: std::convert::Into<bool>,
14204        {
14205            self.0.request.return_partial_success = std::option::Option::Some(v.into());
14206            self
14207        }
14208
14209        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_group_managers::ListManagedInstancesRequest::return_partial_success].
14210        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14211        where
14212            T: std::convert::Into<bool>,
14213        {
14214            self.0.request.return_partial_success = v.map(|x| x.into());
14215            self
14216        }
14217    }
14218
14219    #[doc(hidden)]
14220    impl gax::options::internal::RequestBuilder for ListManagedInstances {
14221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14222            &mut self.0.options
14223        }
14224    }
14225
14226    /// The request builder for [RegionInstanceGroupManagers::list_per_instance_configs][crate::client::RegionInstanceGroupManagers::list_per_instance_configs] calls.
14227    ///
14228    /// # Example
14229    /// ```no_run
14230    /// # use google_cloud_compute_v1::builder;
14231    /// use builder::region_instance_group_managers::ListPerInstanceConfigs;
14232    /// # tokio_test::block_on(async {
14233    /// use gax::paginator::ItemPaginator;
14234    ///
14235    /// let builder = prepare_request_builder();
14236    /// let mut items = builder.by_item();
14237    /// while let Some(result) = items.next().await {
14238    ///   let item = result?;
14239    /// }
14240    /// # gax::Result::<()>::Ok(()) });
14241    ///
14242    /// fn prepare_request_builder() -> ListPerInstanceConfigs {
14243    ///   # panic!();
14244    ///   // ... details omitted ...
14245    /// }
14246    /// ```
14247    #[derive(Clone, Debug)]
14248    pub struct ListPerInstanceConfigs(
14249        RequestBuilder<crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest>,
14250    );
14251
14252    impl ListPerInstanceConfigs {
14253        pub(crate) fn new(
14254            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14255        ) -> Self {
14256            Self(RequestBuilder::new(stub))
14257        }
14258
14259        /// Sets the full request, replacing any prior values.
14260        pub fn with_request<
14261            V: Into<crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest>,
14262        >(
14263            mut self,
14264            v: V,
14265        ) -> Self {
14266            self.0.request = v.into();
14267            self
14268        }
14269
14270        /// Sets all the options, replacing any prior values.
14271        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14272            self.0.options = v.into();
14273            self
14274        }
14275
14276        /// Sends the request.
14277        pub async fn send(
14278            self,
14279        ) -> Result<crate::model::RegionInstanceGroupManagersListInstanceConfigsResp> {
14280            (*self.0.stub)
14281                .list_per_instance_configs(self.0.request, self.0.options)
14282                .await
14283                .map(gax::response::Response::into_body)
14284        }
14285
14286        /// Streams each page in the collection.
14287        pub fn by_page(
14288            self,
14289        ) -> impl gax::paginator::Paginator<
14290            crate::model::RegionInstanceGroupManagersListInstanceConfigsResp,
14291            gax::error::Error,
14292        > {
14293            use std::clone::Clone;
14294            let token = self.0.request.page_token.clone().unwrap_or_default();
14295            let execute = move |token: String| {
14296                let mut builder = self.clone();
14297                builder.0.request = builder.0.request.set_page_token(token);
14298                builder.send()
14299            };
14300            gax::paginator::internal::new_paginator(token, execute)
14301        }
14302
14303        /// Streams each item in the collection.
14304        pub fn by_item(
14305            self,
14306        ) -> impl gax::paginator::ItemPaginator<
14307            crate::model::RegionInstanceGroupManagersListInstanceConfigsResp,
14308            gax::error::Error,
14309        > {
14310            use gax::paginator::Paginator;
14311            self.by_page().items()
14312        }
14313
14314        /// Sets the value of [filter][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::filter].
14315        pub fn set_filter<T>(mut self, v: T) -> Self
14316        where
14317            T: std::convert::Into<std::string::String>,
14318        {
14319            self.0.request.filter = std::option::Option::Some(v.into());
14320            self
14321        }
14322
14323        /// Sets or clears the value of [filter][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::filter].
14324        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
14325        where
14326            T: std::convert::Into<std::string::String>,
14327        {
14328            self.0.request.filter = v.map(|x| x.into());
14329            self
14330        }
14331
14332        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::instance_group_manager].
14333        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14334            self.0.request.instance_group_manager = v.into();
14335            self
14336        }
14337
14338        /// Sets the value of [max_results][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::max_results].
14339        pub fn set_max_results<T>(mut self, v: T) -> Self
14340        where
14341            T: std::convert::Into<u32>,
14342        {
14343            self.0.request.max_results = std::option::Option::Some(v.into());
14344            self
14345        }
14346
14347        /// Sets or clears the value of [max_results][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::max_results].
14348        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14349        where
14350            T: std::convert::Into<u32>,
14351        {
14352            self.0.request.max_results = v.map(|x| x.into());
14353            self
14354        }
14355
14356        /// Sets the value of [order_by][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::order_by].
14357        pub fn set_order_by<T>(mut self, v: T) -> Self
14358        where
14359            T: std::convert::Into<std::string::String>,
14360        {
14361            self.0.request.order_by = std::option::Option::Some(v.into());
14362            self
14363        }
14364
14365        /// Sets or clears the value of [order_by][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::order_by].
14366        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
14367        where
14368            T: std::convert::Into<std::string::String>,
14369        {
14370            self.0.request.order_by = v.map(|x| x.into());
14371            self
14372        }
14373
14374        /// Sets the value of [page_token][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::page_token].
14375        pub fn set_page_token<T>(mut self, v: T) -> Self
14376        where
14377            T: std::convert::Into<std::string::String>,
14378        {
14379            self.0.request.page_token = std::option::Option::Some(v.into());
14380            self
14381        }
14382
14383        /// Sets or clears the value of [page_token][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::page_token].
14384        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14385        where
14386            T: std::convert::Into<std::string::String>,
14387        {
14388            self.0.request.page_token = v.map(|x| x.into());
14389            self
14390        }
14391
14392        /// Sets the value of [project][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::project].
14393        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14394            self.0.request.project = v.into();
14395            self
14396        }
14397
14398        /// Sets the value of [region][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::region].
14399        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14400            self.0.request.region = v.into();
14401            self
14402        }
14403
14404        /// Sets the value of [return_partial_success][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::return_partial_success].
14405        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
14406        where
14407            T: std::convert::Into<bool>,
14408        {
14409            self.0.request.return_partial_success = std::option::Option::Some(v.into());
14410            self
14411        }
14412
14413        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest::return_partial_success].
14414        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14415        where
14416            T: std::convert::Into<bool>,
14417        {
14418            self.0.request.return_partial_success = v.map(|x| x.into());
14419            self
14420        }
14421    }
14422
14423    #[doc(hidden)]
14424    impl gax::options::internal::RequestBuilder for ListPerInstanceConfigs {
14425        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14426            &mut self.0.options
14427        }
14428    }
14429
14430    /// The request builder for [RegionInstanceGroupManagers::patch][crate::client::RegionInstanceGroupManagers::patch] calls.
14431    ///
14432    /// # Example
14433    /// ```no_run
14434    /// # use google_cloud_compute_v1::builder;
14435    /// use builder::region_instance_group_managers::Patch;
14436    /// # tokio_test::block_on(async {
14437    ///
14438    /// let builder = prepare_request_builder();
14439    /// let response = builder.send().await?;
14440    /// # gax::Result::<()>::Ok(()) });
14441    ///
14442    /// fn prepare_request_builder() -> Patch {
14443    ///   # panic!();
14444    ///   // ... details omitted ...
14445    /// }
14446    /// ```
14447    #[derive(Clone, Debug)]
14448    pub struct Patch(RequestBuilder<crate::model::region_instance_group_managers::PatchRequest>);
14449
14450    impl Patch {
14451        pub(crate) fn new(
14452            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14453        ) -> Self {
14454            Self(RequestBuilder::new(stub))
14455        }
14456
14457        /// Sets the full request, replacing any prior values.
14458        pub fn with_request<V: Into<crate::model::region_instance_group_managers::PatchRequest>>(
14459            mut self,
14460            v: V,
14461        ) -> Self {
14462            self.0.request = v.into();
14463            self
14464        }
14465
14466        /// Sets all the options, replacing any prior values.
14467        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14468            self.0.options = v.into();
14469            self
14470        }
14471
14472        /// Sends the request.
14473        pub async fn send(self) -> Result<crate::model::Operation> {
14474            (*self.0.stub)
14475                .patch(self.0.request, self.0.options)
14476                .await
14477                .map(gax::response::Response::into_body)
14478        }
14479
14480        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::PatchRequest::instance_group_manager].
14481        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14482            self.0.request.instance_group_manager = v.into();
14483            self
14484        }
14485
14486        /// Sets the value of [project][crate::model::region_instance_group_managers::PatchRequest::project].
14487        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14488            self.0.request.project = v.into();
14489            self
14490        }
14491
14492        /// Sets the value of [region][crate::model::region_instance_group_managers::PatchRequest::region].
14493        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14494            self.0.request.region = v.into();
14495            self
14496        }
14497
14498        /// Sets the value of [request_id][crate::model::region_instance_group_managers::PatchRequest::request_id].
14499        pub fn set_request_id<T>(mut self, v: T) -> Self
14500        where
14501            T: std::convert::Into<std::string::String>,
14502        {
14503            self.0.request.request_id = std::option::Option::Some(v.into());
14504            self
14505        }
14506
14507        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::PatchRequest::request_id].
14508        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14509        where
14510            T: std::convert::Into<std::string::String>,
14511        {
14512            self.0.request.request_id = v.map(|x| x.into());
14513            self
14514        }
14515
14516        /// Sets the value of [body][crate::model::region_instance_group_managers::PatchRequest::body].
14517        pub fn set_body<T>(mut self, v: T) -> Self
14518        where
14519            T: std::convert::Into<crate::model::InstanceGroupManager>,
14520        {
14521            self.0.request.body = std::option::Option::Some(v.into());
14522            self
14523        }
14524
14525        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::PatchRequest::body].
14526        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14527        where
14528            T: std::convert::Into<crate::model::InstanceGroupManager>,
14529        {
14530            self.0.request.body = v.map(|x| x.into());
14531            self
14532        }
14533    }
14534
14535    #[doc(hidden)]
14536    impl gax::options::internal::RequestBuilder for Patch {
14537        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14538            &mut self.0.options
14539        }
14540    }
14541
14542    /// The request builder for [RegionInstanceGroupManagers::patch_per_instance_configs][crate::client::RegionInstanceGroupManagers::patch_per_instance_configs] calls.
14543    ///
14544    /// # Example
14545    /// ```no_run
14546    /// # use google_cloud_compute_v1::builder;
14547    /// use builder::region_instance_group_managers::PatchPerInstanceConfigs;
14548    /// # tokio_test::block_on(async {
14549    ///
14550    /// let builder = prepare_request_builder();
14551    /// let response = builder.send().await?;
14552    /// # gax::Result::<()>::Ok(()) });
14553    ///
14554    /// fn prepare_request_builder() -> PatchPerInstanceConfigs {
14555    ///   # panic!();
14556    ///   // ... details omitted ...
14557    /// }
14558    /// ```
14559    #[derive(Clone, Debug)]
14560    pub struct PatchPerInstanceConfigs(
14561        RequestBuilder<
14562            crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest,
14563        >,
14564    );
14565
14566    impl PatchPerInstanceConfigs {
14567        pub(crate) fn new(
14568            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14569        ) -> Self {
14570            Self(RequestBuilder::new(stub))
14571        }
14572
14573        /// Sets the full request, replacing any prior values.
14574        pub fn with_request<
14575            V: Into<crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest>,
14576        >(
14577            mut self,
14578            v: V,
14579        ) -> Self {
14580            self.0.request = v.into();
14581            self
14582        }
14583
14584        /// Sets all the options, replacing any prior values.
14585        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14586            self.0.options = v.into();
14587            self
14588        }
14589
14590        /// Sends the request.
14591        pub async fn send(self) -> Result<crate::model::Operation> {
14592            (*self.0.stub)
14593                .patch_per_instance_configs(self.0.request, self.0.options)
14594                .await
14595                .map(gax::response::Response::into_body)
14596        }
14597
14598        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::instance_group_manager].
14599        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14600            self.0.request.instance_group_manager = v.into();
14601            self
14602        }
14603
14604        /// Sets the value of [project][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::project].
14605        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14606            self.0.request.project = v.into();
14607            self
14608        }
14609
14610        /// Sets the value of [region][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::region].
14611        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14612            self.0.request.region = v.into();
14613            self
14614        }
14615
14616        /// Sets the value of [request_id][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::request_id].
14617        pub fn set_request_id<T>(mut self, v: T) -> Self
14618        where
14619            T: std::convert::Into<std::string::String>,
14620        {
14621            self.0.request.request_id = std::option::Option::Some(v.into());
14622            self
14623        }
14624
14625        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::request_id].
14626        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14627        where
14628            T: std::convert::Into<std::string::String>,
14629        {
14630            self.0.request.request_id = v.map(|x| x.into());
14631            self
14632        }
14633
14634        /// Sets the value of [body][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::body].
14635        pub fn set_body<T>(mut self, v: T) -> Self
14636        where
14637            T: std::convert::Into<crate::model::RegionInstanceGroupManagerPatchInstanceConfigReq>,
14638        {
14639            self.0.request.body = std::option::Option::Some(v.into());
14640            self
14641        }
14642
14643        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest::body].
14644        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14645        where
14646            T: std::convert::Into<crate::model::RegionInstanceGroupManagerPatchInstanceConfigReq>,
14647        {
14648            self.0.request.body = v.map(|x| x.into());
14649            self
14650        }
14651    }
14652
14653    #[doc(hidden)]
14654    impl gax::options::internal::RequestBuilder for PatchPerInstanceConfigs {
14655        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14656            &mut self.0.options
14657        }
14658    }
14659
14660    /// The request builder for [RegionInstanceGroupManagers::recreate_instances][crate::client::RegionInstanceGroupManagers::recreate_instances] calls.
14661    ///
14662    /// # Example
14663    /// ```no_run
14664    /// # use google_cloud_compute_v1::builder;
14665    /// use builder::region_instance_group_managers::RecreateInstances;
14666    /// # tokio_test::block_on(async {
14667    ///
14668    /// let builder = prepare_request_builder();
14669    /// let response = builder.send().await?;
14670    /// # gax::Result::<()>::Ok(()) });
14671    ///
14672    /// fn prepare_request_builder() -> RecreateInstances {
14673    ///   # panic!();
14674    ///   // ... details omitted ...
14675    /// }
14676    /// ```
14677    #[derive(Clone, Debug)]
14678    pub struct RecreateInstances(
14679        RequestBuilder<crate::model::region_instance_group_managers::RecreateInstancesRequest>,
14680    );
14681
14682    impl RecreateInstances {
14683        pub(crate) fn new(
14684            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14685        ) -> Self {
14686            Self(RequestBuilder::new(stub))
14687        }
14688
14689        /// Sets the full request, replacing any prior values.
14690        pub fn with_request<
14691            V: Into<crate::model::region_instance_group_managers::RecreateInstancesRequest>,
14692        >(
14693            mut self,
14694            v: V,
14695        ) -> Self {
14696            self.0.request = v.into();
14697            self
14698        }
14699
14700        /// Sets all the options, replacing any prior values.
14701        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14702            self.0.options = v.into();
14703            self
14704        }
14705
14706        /// Sends the request.
14707        pub async fn send(self) -> Result<crate::model::Operation> {
14708            (*self.0.stub)
14709                .recreate_instances(self.0.request, self.0.options)
14710                .await
14711                .map(gax::response::Response::into_body)
14712        }
14713
14714        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::RecreateInstancesRequest::instance_group_manager].
14715        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14716            self.0.request.instance_group_manager = v.into();
14717            self
14718        }
14719
14720        /// Sets the value of [project][crate::model::region_instance_group_managers::RecreateInstancesRequest::project].
14721        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14722            self.0.request.project = v.into();
14723            self
14724        }
14725
14726        /// Sets the value of [region][crate::model::region_instance_group_managers::RecreateInstancesRequest::region].
14727        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14728            self.0.request.region = v.into();
14729            self
14730        }
14731
14732        /// Sets the value of [request_id][crate::model::region_instance_group_managers::RecreateInstancesRequest::request_id].
14733        pub fn set_request_id<T>(mut self, v: T) -> Self
14734        where
14735            T: std::convert::Into<std::string::String>,
14736        {
14737            self.0.request.request_id = std::option::Option::Some(v.into());
14738            self
14739        }
14740
14741        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::RecreateInstancesRequest::request_id].
14742        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14743        where
14744            T: std::convert::Into<std::string::String>,
14745        {
14746            self.0.request.request_id = v.map(|x| x.into());
14747            self
14748        }
14749
14750        /// Sets the value of [body][crate::model::region_instance_group_managers::RecreateInstancesRequest::body].
14751        pub fn set_body<T>(mut self, v: T) -> Self
14752        where
14753            T: std::convert::Into<crate::model::RegionInstanceGroupManagersRecreateRequest>,
14754        {
14755            self.0.request.body = std::option::Option::Some(v.into());
14756            self
14757        }
14758
14759        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::RecreateInstancesRequest::body].
14760        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14761        where
14762            T: std::convert::Into<crate::model::RegionInstanceGroupManagersRecreateRequest>,
14763        {
14764            self.0.request.body = v.map(|x| x.into());
14765            self
14766        }
14767    }
14768
14769    #[doc(hidden)]
14770    impl gax::options::internal::RequestBuilder for RecreateInstances {
14771        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14772            &mut self.0.options
14773        }
14774    }
14775
14776    /// The request builder for [RegionInstanceGroupManagers::resize][crate::client::RegionInstanceGroupManagers::resize] calls.
14777    ///
14778    /// # Example
14779    /// ```no_run
14780    /// # use google_cloud_compute_v1::builder;
14781    /// use builder::region_instance_group_managers::Resize;
14782    /// # tokio_test::block_on(async {
14783    ///
14784    /// let builder = prepare_request_builder();
14785    /// let response = builder.send().await?;
14786    /// # gax::Result::<()>::Ok(()) });
14787    ///
14788    /// fn prepare_request_builder() -> Resize {
14789    ///   # panic!();
14790    ///   // ... details omitted ...
14791    /// }
14792    /// ```
14793    #[derive(Clone, Debug)]
14794    pub struct Resize(RequestBuilder<crate::model::region_instance_group_managers::ResizeRequest>);
14795
14796    impl Resize {
14797        pub(crate) fn new(
14798            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14799        ) -> Self {
14800            Self(RequestBuilder::new(stub))
14801        }
14802
14803        /// Sets the full request, replacing any prior values.
14804        pub fn with_request<
14805            V: Into<crate::model::region_instance_group_managers::ResizeRequest>,
14806        >(
14807            mut self,
14808            v: V,
14809        ) -> Self {
14810            self.0.request = v.into();
14811            self
14812        }
14813
14814        /// Sets all the options, replacing any prior values.
14815        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14816            self.0.options = v.into();
14817            self
14818        }
14819
14820        /// Sends the request.
14821        pub async fn send(self) -> Result<crate::model::Operation> {
14822            (*self.0.stub)
14823                .resize(self.0.request, self.0.options)
14824                .await
14825                .map(gax::response::Response::into_body)
14826        }
14827
14828        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ResizeRequest::instance_group_manager].
14829        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14830            self.0.request.instance_group_manager = v.into();
14831            self
14832        }
14833
14834        /// Sets the value of [project][crate::model::region_instance_group_managers::ResizeRequest::project].
14835        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14836            self.0.request.project = v.into();
14837            self
14838        }
14839
14840        /// Sets the value of [region][crate::model::region_instance_group_managers::ResizeRequest::region].
14841        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14842            self.0.request.region = v.into();
14843            self
14844        }
14845
14846        /// Sets the value of [request_id][crate::model::region_instance_group_managers::ResizeRequest::request_id].
14847        pub fn set_request_id<T>(mut self, v: T) -> Self
14848        where
14849            T: std::convert::Into<std::string::String>,
14850        {
14851            self.0.request.request_id = std::option::Option::Some(v.into());
14852            self
14853        }
14854
14855        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::ResizeRequest::request_id].
14856        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14857        where
14858            T: std::convert::Into<std::string::String>,
14859        {
14860            self.0.request.request_id = v.map(|x| x.into());
14861            self
14862        }
14863
14864        /// Sets the value of [size][crate::model::region_instance_group_managers::ResizeRequest::size].
14865        pub fn set_size<T: Into<i32>>(mut self, v: T) -> Self {
14866            self.0.request.size = v.into();
14867            self
14868        }
14869    }
14870
14871    #[doc(hidden)]
14872    impl gax::options::internal::RequestBuilder for Resize {
14873        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14874            &mut self.0.options
14875        }
14876    }
14877
14878    /// The request builder for [RegionInstanceGroupManagers::resume_instances][crate::client::RegionInstanceGroupManagers::resume_instances] calls.
14879    ///
14880    /// # Example
14881    /// ```no_run
14882    /// # use google_cloud_compute_v1::builder;
14883    /// use builder::region_instance_group_managers::ResumeInstances;
14884    /// # tokio_test::block_on(async {
14885    ///
14886    /// let builder = prepare_request_builder();
14887    /// let response = builder.send().await?;
14888    /// # gax::Result::<()>::Ok(()) });
14889    ///
14890    /// fn prepare_request_builder() -> ResumeInstances {
14891    ///   # panic!();
14892    ///   // ... details omitted ...
14893    /// }
14894    /// ```
14895    #[derive(Clone, Debug)]
14896    pub struct ResumeInstances(
14897        RequestBuilder<crate::model::region_instance_group_managers::ResumeInstancesRequest>,
14898    );
14899
14900    impl ResumeInstances {
14901        pub(crate) fn new(
14902            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14903        ) -> Self {
14904            Self(RequestBuilder::new(stub))
14905        }
14906
14907        /// Sets the full request, replacing any prior values.
14908        pub fn with_request<
14909            V: Into<crate::model::region_instance_group_managers::ResumeInstancesRequest>,
14910        >(
14911            mut self,
14912            v: V,
14913        ) -> Self {
14914            self.0.request = v.into();
14915            self
14916        }
14917
14918        /// Sets all the options, replacing any prior values.
14919        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14920            self.0.options = v.into();
14921            self
14922        }
14923
14924        /// Sends the request.
14925        pub async fn send(self) -> Result<crate::model::Operation> {
14926            (*self.0.stub)
14927                .resume_instances(self.0.request, self.0.options)
14928                .await
14929                .map(gax::response::Response::into_body)
14930        }
14931
14932        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::ResumeInstancesRequest::instance_group_manager].
14933        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14934            self.0.request.instance_group_manager = v.into();
14935            self
14936        }
14937
14938        /// Sets the value of [project][crate::model::region_instance_group_managers::ResumeInstancesRequest::project].
14939        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14940            self.0.request.project = v.into();
14941            self
14942        }
14943
14944        /// Sets the value of [region][crate::model::region_instance_group_managers::ResumeInstancesRequest::region].
14945        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14946            self.0.request.region = v.into();
14947            self
14948        }
14949
14950        /// Sets the value of [request_id][crate::model::region_instance_group_managers::ResumeInstancesRequest::request_id].
14951        pub fn set_request_id<T>(mut self, v: T) -> Self
14952        where
14953            T: std::convert::Into<std::string::String>,
14954        {
14955            self.0.request.request_id = std::option::Option::Some(v.into());
14956            self
14957        }
14958
14959        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::ResumeInstancesRequest::request_id].
14960        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14961        where
14962            T: std::convert::Into<std::string::String>,
14963        {
14964            self.0.request.request_id = v.map(|x| x.into());
14965            self
14966        }
14967
14968        /// Sets the value of [body][crate::model::region_instance_group_managers::ResumeInstancesRequest::body].
14969        pub fn set_body<T>(mut self, v: T) -> Self
14970        where
14971            T: std::convert::Into<crate::model::RegionInstanceGroupManagersResumeInstancesRequest>,
14972        {
14973            self.0.request.body = std::option::Option::Some(v.into());
14974            self
14975        }
14976
14977        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::ResumeInstancesRequest::body].
14978        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14979        where
14980            T: std::convert::Into<crate::model::RegionInstanceGroupManagersResumeInstancesRequest>,
14981        {
14982            self.0.request.body = v.map(|x| x.into());
14983            self
14984        }
14985    }
14986
14987    #[doc(hidden)]
14988    impl gax::options::internal::RequestBuilder for ResumeInstances {
14989        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14990            &mut self.0.options
14991        }
14992    }
14993
14994    /// The request builder for [RegionInstanceGroupManagers::set_instance_template][crate::client::RegionInstanceGroupManagers::set_instance_template] calls.
14995    ///
14996    /// # Example
14997    /// ```no_run
14998    /// # use google_cloud_compute_v1::builder;
14999    /// use builder::region_instance_group_managers::SetInstanceTemplate;
15000    /// # tokio_test::block_on(async {
15001    ///
15002    /// let builder = prepare_request_builder();
15003    /// let response = builder.send().await?;
15004    /// # gax::Result::<()>::Ok(()) });
15005    ///
15006    /// fn prepare_request_builder() -> SetInstanceTemplate {
15007    ///   # panic!();
15008    ///   // ... details omitted ...
15009    /// }
15010    /// ```
15011    #[derive(Clone, Debug)]
15012    pub struct SetInstanceTemplate(
15013        RequestBuilder<crate::model::region_instance_group_managers::SetInstanceTemplateRequest>,
15014    );
15015
15016    impl SetInstanceTemplate {
15017        pub(crate) fn new(
15018            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15019        ) -> Self {
15020            Self(RequestBuilder::new(stub))
15021        }
15022
15023        /// Sets the full request, replacing any prior values.
15024        pub fn with_request<
15025            V: Into<crate::model::region_instance_group_managers::SetInstanceTemplateRequest>,
15026        >(
15027            mut self,
15028            v: V,
15029        ) -> Self {
15030            self.0.request = v.into();
15031            self
15032        }
15033
15034        /// Sets all the options, replacing any prior values.
15035        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15036            self.0.options = v.into();
15037            self
15038        }
15039
15040        /// Sends the request.
15041        pub async fn send(self) -> Result<crate::model::Operation> {
15042            (*self.0.stub)
15043                .set_instance_template(self.0.request, self.0.options)
15044                .await
15045                .map(gax::response::Response::into_body)
15046        }
15047
15048        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::instance_group_manager].
15049        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15050            self.0.request.instance_group_manager = v.into();
15051            self
15052        }
15053
15054        /// Sets the value of [project][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::project].
15055        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15056            self.0.request.project = v.into();
15057            self
15058        }
15059
15060        /// Sets the value of [region][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::region].
15061        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15062            self.0.request.region = v.into();
15063            self
15064        }
15065
15066        /// Sets the value of [request_id][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::request_id].
15067        pub fn set_request_id<T>(mut self, v: T) -> Self
15068        where
15069            T: std::convert::Into<std::string::String>,
15070        {
15071            self.0.request.request_id = std::option::Option::Some(v.into());
15072            self
15073        }
15074
15075        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::request_id].
15076        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15077        where
15078            T: std::convert::Into<std::string::String>,
15079        {
15080            self.0.request.request_id = v.map(|x| x.into());
15081            self
15082        }
15083
15084        /// Sets the value of [body][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::body].
15085        pub fn set_body<T>(mut self, v: T) -> Self
15086        where
15087            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTemplateRequest>,
15088        {
15089            self.0.request.body = std::option::Option::Some(v.into());
15090            self
15091        }
15092
15093        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::SetInstanceTemplateRequest::body].
15094        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15095        where
15096            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTemplateRequest>,
15097        {
15098            self.0.request.body = v.map(|x| x.into());
15099            self
15100        }
15101    }
15102
15103    #[doc(hidden)]
15104    impl gax::options::internal::RequestBuilder for SetInstanceTemplate {
15105        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15106            &mut self.0.options
15107        }
15108    }
15109
15110    /// The request builder for [RegionInstanceGroupManagers::set_target_pools][crate::client::RegionInstanceGroupManagers::set_target_pools] calls.
15111    ///
15112    /// # Example
15113    /// ```no_run
15114    /// # use google_cloud_compute_v1::builder;
15115    /// use builder::region_instance_group_managers::SetTargetPools;
15116    /// # tokio_test::block_on(async {
15117    ///
15118    /// let builder = prepare_request_builder();
15119    /// let response = builder.send().await?;
15120    /// # gax::Result::<()>::Ok(()) });
15121    ///
15122    /// fn prepare_request_builder() -> SetTargetPools {
15123    ///   # panic!();
15124    ///   // ... details omitted ...
15125    /// }
15126    /// ```
15127    #[derive(Clone, Debug)]
15128    pub struct SetTargetPools(
15129        RequestBuilder<crate::model::region_instance_group_managers::SetTargetPoolsRequest>,
15130    );
15131
15132    impl SetTargetPools {
15133        pub(crate) fn new(
15134            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15135        ) -> Self {
15136            Self(RequestBuilder::new(stub))
15137        }
15138
15139        /// Sets the full request, replacing any prior values.
15140        pub fn with_request<
15141            V: Into<crate::model::region_instance_group_managers::SetTargetPoolsRequest>,
15142        >(
15143            mut self,
15144            v: V,
15145        ) -> Self {
15146            self.0.request = v.into();
15147            self
15148        }
15149
15150        /// Sets all the options, replacing any prior values.
15151        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15152            self.0.options = v.into();
15153            self
15154        }
15155
15156        /// Sends the request.
15157        pub async fn send(self) -> Result<crate::model::Operation> {
15158            (*self.0.stub)
15159                .set_target_pools(self.0.request, self.0.options)
15160                .await
15161                .map(gax::response::Response::into_body)
15162        }
15163
15164        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::SetTargetPoolsRequest::instance_group_manager].
15165        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15166            self.0.request.instance_group_manager = v.into();
15167            self
15168        }
15169
15170        /// Sets the value of [project][crate::model::region_instance_group_managers::SetTargetPoolsRequest::project].
15171        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15172            self.0.request.project = v.into();
15173            self
15174        }
15175
15176        /// Sets the value of [region][crate::model::region_instance_group_managers::SetTargetPoolsRequest::region].
15177        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15178            self.0.request.region = v.into();
15179            self
15180        }
15181
15182        /// Sets the value of [request_id][crate::model::region_instance_group_managers::SetTargetPoolsRequest::request_id].
15183        pub fn set_request_id<T>(mut self, v: T) -> Self
15184        where
15185            T: std::convert::Into<std::string::String>,
15186        {
15187            self.0.request.request_id = std::option::Option::Some(v.into());
15188            self
15189        }
15190
15191        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::SetTargetPoolsRequest::request_id].
15192        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15193        where
15194            T: std::convert::Into<std::string::String>,
15195        {
15196            self.0.request.request_id = v.map(|x| x.into());
15197            self
15198        }
15199
15200        /// Sets the value of [body][crate::model::region_instance_group_managers::SetTargetPoolsRequest::body].
15201        pub fn set_body<T>(mut self, v: T) -> Self
15202        where
15203            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTargetPoolsRequest>,
15204        {
15205            self.0.request.body = std::option::Option::Some(v.into());
15206            self
15207        }
15208
15209        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::SetTargetPoolsRequest::body].
15210        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15211        where
15212            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTargetPoolsRequest>,
15213        {
15214            self.0.request.body = v.map(|x| x.into());
15215            self
15216        }
15217    }
15218
15219    #[doc(hidden)]
15220    impl gax::options::internal::RequestBuilder for SetTargetPools {
15221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15222            &mut self.0.options
15223        }
15224    }
15225
15226    /// The request builder for [RegionInstanceGroupManagers::start_instances][crate::client::RegionInstanceGroupManagers::start_instances] calls.
15227    ///
15228    /// # Example
15229    /// ```no_run
15230    /// # use google_cloud_compute_v1::builder;
15231    /// use builder::region_instance_group_managers::StartInstances;
15232    /// # tokio_test::block_on(async {
15233    ///
15234    /// let builder = prepare_request_builder();
15235    /// let response = builder.send().await?;
15236    /// # gax::Result::<()>::Ok(()) });
15237    ///
15238    /// fn prepare_request_builder() -> StartInstances {
15239    ///   # panic!();
15240    ///   // ... details omitted ...
15241    /// }
15242    /// ```
15243    #[derive(Clone, Debug)]
15244    pub struct StartInstances(
15245        RequestBuilder<crate::model::region_instance_group_managers::StartInstancesRequest>,
15246    );
15247
15248    impl StartInstances {
15249        pub(crate) fn new(
15250            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15251        ) -> Self {
15252            Self(RequestBuilder::new(stub))
15253        }
15254
15255        /// Sets the full request, replacing any prior values.
15256        pub fn with_request<
15257            V: Into<crate::model::region_instance_group_managers::StartInstancesRequest>,
15258        >(
15259            mut self,
15260            v: V,
15261        ) -> Self {
15262            self.0.request = v.into();
15263            self
15264        }
15265
15266        /// Sets all the options, replacing any prior values.
15267        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15268            self.0.options = v.into();
15269            self
15270        }
15271
15272        /// Sends the request.
15273        pub async fn send(self) -> Result<crate::model::Operation> {
15274            (*self.0.stub)
15275                .start_instances(self.0.request, self.0.options)
15276                .await
15277                .map(gax::response::Response::into_body)
15278        }
15279
15280        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::StartInstancesRequest::instance_group_manager].
15281        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15282            self.0.request.instance_group_manager = v.into();
15283            self
15284        }
15285
15286        /// Sets the value of [project][crate::model::region_instance_group_managers::StartInstancesRequest::project].
15287        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15288            self.0.request.project = v.into();
15289            self
15290        }
15291
15292        /// Sets the value of [region][crate::model::region_instance_group_managers::StartInstancesRequest::region].
15293        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15294            self.0.request.region = v.into();
15295            self
15296        }
15297
15298        /// Sets the value of [request_id][crate::model::region_instance_group_managers::StartInstancesRequest::request_id].
15299        pub fn set_request_id<T>(mut self, v: T) -> Self
15300        where
15301            T: std::convert::Into<std::string::String>,
15302        {
15303            self.0.request.request_id = std::option::Option::Some(v.into());
15304            self
15305        }
15306
15307        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::StartInstancesRequest::request_id].
15308        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15309        where
15310            T: std::convert::Into<std::string::String>,
15311        {
15312            self.0.request.request_id = v.map(|x| x.into());
15313            self
15314        }
15315
15316        /// Sets the value of [body][crate::model::region_instance_group_managers::StartInstancesRequest::body].
15317        pub fn set_body<T>(mut self, v: T) -> Self
15318        where
15319            T: std::convert::Into<crate::model::RegionInstanceGroupManagersStartInstancesRequest>,
15320        {
15321            self.0.request.body = std::option::Option::Some(v.into());
15322            self
15323        }
15324
15325        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::StartInstancesRequest::body].
15326        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15327        where
15328            T: std::convert::Into<crate::model::RegionInstanceGroupManagersStartInstancesRequest>,
15329        {
15330            self.0.request.body = v.map(|x| x.into());
15331            self
15332        }
15333    }
15334
15335    #[doc(hidden)]
15336    impl gax::options::internal::RequestBuilder for StartInstances {
15337        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15338            &mut self.0.options
15339        }
15340    }
15341
15342    /// The request builder for [RegionInstanceGroupManagers::stop_instances][crate::client::RegionInstanceGroupManagers::stop_instances] calls.
15343    ///
15344    /// # Example
15345    /// ```no_run
15346    /// # use google_cloud_compute_v1::builder;
15347    /// use builder::region_instance_group_managers::StopInstances;
15348    /// # tokio_test::block_on(async {
15349    ///
15350    /// let builder = prepare_request_builder();
15351    /// let response = builder.send().await?;
15352    /// # gax::Result::<()>::Ok(()) });
15353    ///
15354    /// fn prepare_request_builder() -> StopInstances {
15355    ///   # panic!();
15356    ///   // ... details omitted ...
15357    /// }
15358    /// ```
15359    #[derive(Clone, Debug)]
15360    pub struct StopInstances(
15361        RequestBuilder<crate::model::region_instance_group_managers::StopInstancesRequest>,
15362    );
15363
15364    impl StopInstances {
15365        pub(crate) fn new(
15366            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15367        ) -> Self {
15368            Self(RequestBuilder::new(stub))
15369        }
15370
15371        /// Sets the full request, replacing any prior values.
15372        pub fn with_request<
15373            V: Into<crate::model::region_instance_group_managers::StopInstancesRequest>,
15374        >(
15375            mut self,
15376            v: V,
15377        ) -> Self {
15378            self.0.request = v.into();
15379            self
15380        }
15381
15382        /// Sets all the options, replacing any prior values.
15383        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15384            self.0.options = v.into();
15385            self
15386        }
15387
15388        /// Sends the request.
15389        pub async fn send(self) -> Result<crate::model::Operation> {
15390            (*self.0.stub)
15391                .stop_instances(self.0.request, self.0.options)
15392                .await
15393                .map(gax::response::Response::into_body)
15394        }
15395
15396        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::StopInstancesRequest::instance_group_manager].
15397        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15398            self.0.request.instance_group_manager = v.into();
15399            self
15400        }
15401
15402        /// Sets the value of [project][crate::model::region_instance_group_managers::StopInstancesRequest::project].
15403        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15404            self.0.request.project = v.into();
15405            self
15406        }
15407
15408        /// Sets the value of [region][crate::model::region_instance_group_managers::StopInstancesRequest::region].
15409        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15410            self.0.request.region = v.into();
15411            self
15412        }
15413
15414        /// Sets the value of [request_id][crate::model::region_instance_group_managers::StopInstancesRequest::request_id].
15415        pub fn set_request_id<T>(mut self, v: T) -> Self
15416        where
15417            T: std::convert::Into<std::string::String>,
15418        {
15419            self.0.request.request_id = std::option::Option::Some(v.into());
15420            self
15421        }
15422
15423        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::StopInstancesRequest::request_id].
15424        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15425        where
15426            T: std::convert::Into<std::string::String>,
15427        {
15428            self.0.request.request_id = v.map(|x| x.into());
15429            self
15430        }
15431
15432        /// Sets the value of [body][crate::model::region_instance_group_managers::StopInstancesRequest::body].
15433        pub fn set_body<T>(mut self, v: T) -> Self
15434        where
15435            T: std::convert::Into<crate::model::RegionInstanceGroupManagersStopInstancesRequest>,
15436        {
15437            self.0.request.body = std::option::Option::Some(v.into());
15438            self
15439        }
15440
15441        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::StopInstancesRequest::body].
15442        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15443        where
15444            T: std::convert::Into<crate::model::RegionInstanceGroupManagersStopInstancesRequest>,
15445        {
15446            self.0.request.body = v.map(|x| x.into());
15447            self
15448        }
15449    }
15450
15451    #[doc(hidden)]
15452    impl gax::options::internal::RequestBuilder for StopInstances {
15453        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15454            &mut self.0.options
15455        }
15456    }
15457
15458    /// The request builder for [RegionInstanceGroupManagers::suspend_instances][crate::client::RegionInstanceGroupManagers::suspend_instances] calls.
15459    ///
15460    /// # Example
15461    /// ```no_run
15462    /// # use google_cloud_compute_v1::builder;
15463    /// use builder::region_instance_group_managers::SuspendInstances;
15464    /// # tokio_test::block_on(async {
15465    ///
15466    /// let builder = prepare_request_builder();
15467    /// let response = builder.send().await?;
15468    /// # gax::Result::<()>::Ok(()) });
15469    ///
15470    /// fn prepare_request_builder() -> SuspendInstances {
15471    ///   # panic!();
15472    ///   // ... details omitted ...
15473    /// }
15474    /// ```
15475    #[derive(Clone, Debug)]
15476    pub struct SuspendInstances(
15477        RequestBuilder<crate::model::region_instance_group_managers::SuspendInstancesRequest>,
15478    );
15479
15480    impl SuspendInstances {
15481        pub(crate) fn new(
15482            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15483        ) -> Self {
15484            Self(RequestBuilder::new(stub))
15485        }
15486
15487        /// Sets the full request, replacing any prior values.
15488        pub fn with_request<
15489            V: Into<crate::model::region_instance_group_managers::SuspendInstancesRequest>,
15490        >(
15491            mut self,
15492            v: V,
15493        ) -> Self {
15494            self.0.request = v.into();
15495            self
15496        }
15497
15498        /// Sets all the options, replacing any prior values.
15499        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15500            self.0.options = v.into();
15501            self
15502        }
15503
15504        /// Sends the request.
15505        pub async fn send(self) -> Result<crate::model::Operation> {
15506            (*self.0.stub)
15507                .suspend_instances(self.0.request, self.0.options)
15508                .await
15509                .map(gax::response::Response::into_body)
15510        }
15511
15512        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::SuspendInstancesRequest::instance_group_manager].
15513        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15514            self.0.request.instance_group_manager = v.into();
15515            self
15516        }
15517
15518        /// Sets the value of [project][crate::model::region_instance_group_managers::SuspendInstancesRequest::project].
15519        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15520            self.0.request.project = v.into();
15521            self
15522        }
15523
15524        /// Sets the value of [region][crate::model::region_instance_group_managers::SuspendInstancesRequest::region].
15525        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15526            self.0.request.region = v.into();
15527            self
15528        }
15529
15530        /// Sets the value of [request_id][crate::model::region_instance_group_managers::SuspendInstancesRequest::request_id].
15531        pub fn set_request_id<T>(mut self, v: T) -> Self
15532        where
15533            T: std::convert::Into<std::string::String>,
15534        {
15535            self.0.request.request_id = std::option::Option::Some(v.into());
15536            self
15537        }
15538
15539        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::SuspendInstancesRequest::request_id].
15540        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15541        where
15542            T: std::convert::Into<std::string::String>,
15543        {
15544            self.0.request.request_id = v.map(|x| x.into());
15545            self
15546        }
15547
15548        /// Sets the value of [body][crate::model::region_instance_group_managers::SuspendInstancesRequest::body].
15549        pub fn set_body<T>(mut self, v: T) -> Self
15550        where
15551            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSuspendInstancesRequest>,
15552        {
15553            self.0.request.body = std::option::Option::Some(v.into());
15554            self
15555        }
15556
15557        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::SuspendInstancesRequest::body].
15558        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15559        where
15560            T: std::convert::Into<crate::model::RegionInstanceGroupManagersSuspendInstancesRequest>,
15561        {
15562            self.0.request.body = v.map(|x| x.into());
15563            self
15564        }
15565    }
15566
15567    #[doc(hidden)]
15568    impl gax::options::internal::RequestBuilder for SuspendInstances {
15569        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15570            &mut self.0.options
15571        }
15572    }
15573
15574    /// The request builder for [RegionInstanceGroupManagers::update_per_instance_configs][crate::client::RegionInstanceGroupManagers::update_per_instance_configs] calls.
15575    ///
15576    /// # Example
15577    /// ```no_run
15578    /// # use google_cloud_compute_v1::builder;
15579    /// use builder::region_instance_group_managers::UpdatePerInstanceConfigs;
15580    /// # tokio_test::block_on(async {
15581    ///
15582    /// let builder = prepare_request_builder();
15583    /// let response = builder.send().await?;
15584    /// # gax::Result::<()>::Ok(()) });
15585    ///
15586    /// fn prepare_request_builder() -> UpdatePerInstanceConfigs {
15587    ///   # panic!();
15588    ///   // ... details omitted ...
15589    /// }
15590    /// ```
15591    #[derive(Clone, Debug)]
15592    pub struct UpdatePerInstanceConfigs(
15593        RequestBuilder<
15594            crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest,
15595        >,
15596    );
15597
15598    impl UpdatePerInstanceConfigs {
15599        pub(crate) fn new(
15600            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15601        ) -> Self {
15602            Self(RequestBuilder::new(stub))
15603        }
15604
15605        /// Sets the full request, replacing any prior values.
15606        pub fn with_request<
15607            V: Into<crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest>,
15608        >(
15609            mut self,
15610            v: V,
15611        ) -> Self {
15612            self.0.request = v.into();
15613            self
15614        }
15615
15616        /// Sets all the options, replacing any prior values.
15617        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15618            self.0.options = v.into();
15619            self
15620        }
15621
15622        /// Sends the request.
15623        pub async fn send(self) -> Result<crate::model::Operation> {
15624            (*self.0.stub)
15625                .update_per_instance_configs(self.0.request, self.0.options)
15626                .await
15627                .map(gax::response::Response::into_body)
15628        }
15629
15630        /// Sets the value of [instance_group_manager][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::instance_group_manager].
15631        pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15632            self.0.request.instance_group_manager = v.into();
15633            self
15634        }
15635
15636        /// Sets the value of [project][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::project].
15637        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15638            self.0.request.project = v.into();
15639            self
15640        }
15641
15642        /// Sets the value of [region][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::region].
15643        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15644            self.0.request.region = v.into();
15645            self
15646        }
15647
15648        /// Sets the value of [request_id][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::request_id].
15649        pub fn set_request_id<T>(mut self, v: T) -> Self
15650        where
15651            T: std::convert::Into<std::string::String>,
15652        {
15653            self.0.request.request_id = std::option::Option::Some(v.into());
15654            self
15655        }
15656
15657        /// Sets or clears the value of [request_id][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::request_id].
15658        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15659        where
15660            T: std::convert::Into<std::string::String>,
15661        {
15662            self.0.request.request_id = v.map(|x| x.into());
15663            self
15664        }
15665
15666        /// Sets the value of [body][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::body].
15667        pub fn set_body<T>(mut self, v: T) -> Self
15668        where
15669            T: std::convert::Into<crate::model::RegionInstanceGroupManagerUpdateInstanceConfigReq>,
15670        {
15671            self.0.request.body = std::option::Option::Some(v.into());
15672            self
15673        }
15674
15675        /// Sets or clears the value of [body][crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest::body].
15676        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15677        where
15678            T: std::convert::Into<crate::model::RegionInstanceGroupManagerUpdateInstanceConfigReq>,
15679        {
15680            self.0.request.body = v.map(|x| x.into());
15681            self
15682        }
15683    }
15684
15685    #[doc(hidden)]
15686    impl gax::options::internal::RequestBuilder for UpdatePerInstanceConfigs {
15687        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15688            &mut self.0.options
15689        }
15690    }
15691}
15692
15693#[cfg(feature = "region-instance-groups")]
15694#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
15695pub mod region_instance_groups {
15696    use crate::Result;
15697
15698    /// A builder for [RegionInstanceGroups][crate::client::RegionInstanceGroups].
15699    ///
15700    /// ```
15701    /// # tokio_test::block_on(async {
15702    /// # use google_cloud_compute_v1::*;
15703    /// # use builder::region_instance_groups::ClientBuilder;
15704    /// # use client::RegionInstanceGroups;
15705    /// let builder : ClientBuilder = RegionInstanceGroups::builder();
15706    /// let client = builder
15707    ///     .with_endpoint("https://compute.googleapis.com")
15708    ///     .build().await?;
15709    /// # gax::client_builder::Result::<()>::Ok(()) });
15710    /// ```
15711    pub type ClientBuilder =
15712        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15713
15714    pub(crate) mod client {
15715        use super::super::super::client::RegionInstanceGroups;
15716        pub struct Factory;
15717        impl gax::client_builder::internal::ClientFactory for Factory {
15718            type Client = RegionInstanceGroups;
15719            type Credentials = gaxi::options::Credentials;
15720            async fn build(
15721                self,
15722                config: gaxi::options::ClientConfig,
15723            ) -> gax::client_builder::Result<Self::Client> {
15724                Self::Client::new(config).await
15725            }
15726        }
15727    }
15728
15729    /// Common implementation for [crate::client::RegionInstanceGroups] request builders.
15730    #[derive(Clone, Debug)]
15731    pub(crate) struct RequestBuilder<R: std::default::Default> {
15732        stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15733        request: R,
15734        options: gax::options::RequestOptions,
15735    }
15736
15737    impl<R> RequestBuilder<R>
15738    where
15739        R: std::default::Default,
15740    {
15741        pub(crate) fn new(
15742            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15743        ) -> Self {
15744            Self {
15745                stub,
15746                request: R::default(),
15747                options: gax::options::RequestOptions::default(),
15748            }
15749        }
15750    }
15751
15752    /// The request builder for [RegionInstanceGroups::get][crate::client::RegionInstanceGroups::get] calls.
15753    ///
15754    /// # Example
15755    /// ```no_run
15756    /// # use google_cloud_compute_v1::builder;
15757    /// use builder::region_instance_groups::Get;
15758    /// # tokio_test::block_on(async {
15759    ///
15760    /// let builder = prepare_request_builder();
15761    /// let response = builder.send().await?;
15762    /// # gax::Result::<()>::Ok(()) });
15763    ///
15764    /// fn prepare_request_builder() -> Get {
15765    ///   # panic!();
15766    ///   // ... details omitted ...
15767    /// }
15768    /// ```
15769    #[derive(Clone, Debug)]
15770    pub struct Get(RequestBuilder<crate::model::region_instance_groups::GetRequest>);
15771
15772    impl Get {
15773        pub(crate) fn new(
15774            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15775        ) -> Self {
15776            Self(RequestBuilder::new(stub))
15777        }
15778
15779        /// Sets the full request, replacing any prior values.
15780        pub fn with_request<V: Into<crate::model::region_instance_groups::GetRequest>>(
15781            mut self,
15782            v: V,
15783        ) -> Self {
15784            self.0.request = v.into();
15785            self
15786        }
15787
15788        /// Sets all the options, replacing any prior values.
15789        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15790            self.0.options = v.into();
15791            self
15792        }
15793
15794        /// Sends the request.
15795        pub async fn send(self) -> Result<crate::model::InstanceGroup> {
15796            (*self.0.stub)
15797                .get(self.0.request, self.0.options)
15798                .await
15799                .map(gax::response::Response::into_body)
15800        }
15801
15802        /// Sets the value of [instance_group][crate::model::region_instance_groups::GetRequest::instance_group].
15803        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
15804            self.0.request.instance_group = v.into();
15805            self
15806        }
15807
15808        /// Sets the value of [project][crate::model::region_instance_groups::GetRequest::project].
15809        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15810            self.0.request.project = v.into();
15811            self
15812        }
15813
15814        /// Sets the value of [region][crate::model::region_instance_groups::GetRequest::region].
15815        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15816            self.0.request.region = v.into();
15817            self
15818        }
15819    }
15820
15821    #[doc(hidden)]
15822    impl gax::options::internal::RequestBuilder for Get {
15823        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15824            &mut self.0.options
15825        }
15826    }
15827
15828    /// The request builder for [RegionInstanceGroups::list][crate::client::RegionInstanceGroups::list] calls.
15829    ///
15830    /// # Example
15831    /// ```no_run
15832    /// # use google_cloud_compute_v1::builder;
15833    /// use builder::region_instance_groups::List;
15834    /// # tokio_test::block_on(async {
15835    /// use gax::paginator::ItemPaginator;
15836    ///
15837    /// let builder = prepare_request_builder();
15838    /// let mut items = builder.by_item();
15839    /// while let Some(result) = items.next().await {
15840    ///   let item = result?;
15841    /// }
15842    /// # gax::Result::<()>::Ok(()) });
15843    ///
15844    /// fn prepare_request_builder() -> List {
15845    ///   # panic!();
15846    ///   // ... details omitted ...
15847    /// }
15848    /// ```
15849    #[derive(Clone, Debug)]
15850    pub struct List(RequestBuilder<crate::model::region_instance_groups::ListRequest>);
15851
15852    impl List {
15853        pub(crate) fn new(
15854            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15855        ) -> Self {
15856            Self(RequestBuilder::new(stub))
15857        }
15858
15859        /// Sets the full request, replacing any prior values.
15860        pub fn with_request<V: Into<crate::model::region_instance_groups::ListRequest>>(
15861            mut self,
15862            v: V,
15863        ) -> Self {
15864            self.0.request = v.into();
15865            self
15866        }
15867
15868        /// Sets all the options, replacing any prior values.
15869        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15870            self.0.options = v.into();
15871            self
15872        }
15873
15874        /// Sends the request.
15875        pub async fn send(self) -> Result<crate::model::RegionInstanceGroupList> {
15876            (*self.0.stub)
15877                .list(self.0.request, self.0.options)
15878                .await
15879                .map(gax::response::Response::into_body)
15880        }
15881
15882        /// Streams each page in the collection.
15883        pub fn by_page(
15884            self,
15885        ) -> impl gax::paginator::Paginator<crate::model::RegionInstanceGroupList, gax::error::Error>
15886        {
15887            use std::clone::Clone;
15888            let token = self.0.request.page_token.clone().unwrap_or_default();
15889            let execute = move |token: String| {
15890                let mut builder = self.clone();
15891                builder.0.request = builder.0.request.set_page_token(token);
15892                builder.send()
15893            };
15894            gax::paginator::internal::new_paginator(token, execute)
15895        }
15896
15897        /// Streams each item in the collection.
15898        pub fn by_item(
15899            self,
15900        ) -> impl gax::paginator::ItemPaginator<crate::model::RegionInstanceGroupList, gax::error::Error>
15901        {
15902            use gax::paginator::Paginator;
15903            self.by_page().items()
15904        }
15905
15906        /// Sets the value of [filter][crate::model::region_instance_groups::ListRequest::filter].
15907        pub fn set_filter<T>(mut self, v: T) -> Self
15908        where
15909            T: std::convert::Into<std::string::String>,
15910        {
15911            self.0.request.filter = std::option::Option::Some(v.into());
15912            self
15913        }
15914
15915        /// Sets or clears the value of [filter][crate::model::region_instance_groups::ListRequest::filter].
15916        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
15917        where
15918            T: std::convert::Into<std::string::String>,
15919        {
15920            self.0.request.filter = v.map(|x| x.into());
15921            self
15922        }
15923
15924        /// Sets the value of [max_results][crate::model::region_instance_groups::ListRequest::max_results].
15925        pub fn set_max_results<T>(mut self, v: T) -> Self
15926        where
15927            T: std::convert::Into<u32>,
15928        {
15929            self.0.request.max_results = std::option::Option::Some(v.into());
15930            self
15931        }
15932
15933        /// Sets or clears the value of [max_results][crate::model::region_instance_groups::ListRequest::max_results].
15934        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
15935        where
15936            T: std::convert::Into<u32>,
15937        {
15938            self.0.request.max_results = v.map(|x| x.into());
15939            self
15940        }
15941
15942        /// Sets the value of [order_by][crate::model::region_instance_groups::ListRequest::order_by].
15943        pub fn set_order_by<T>(mut self, v: T) -> Self
15944        where
15945            T: std::convert::Into<std::string::String>,
15946        {
15947            self.0.request.order_by = std::option::Option::Some(v.into());
15948            self
15949        }
15950
15951        /// Sets or clears the value of [order_by][crate::model::region_instance_groups::ListRequest::order_by].
15952        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
15953        where
15954            T: std::convert::Into<std::string::String>,
15955        {
15956            self.0.request.order_by = v.map(|x| x.into());
15957            self
15958        }
15959
15960        /// Sets the value of [page_token][crate::model::region_instance_groups::ListRequest::page_token].
15961        pub fn set_page_token<T>(mut self, v: T) -> Self
15962        where
15963            T: std::convert::Into<std::string::String>,
15964        {
15965            self.0.request.page_token = std::option::Option::Some(v.into());
15966            self
15967        }
15968
15969        /// Sets or clears the value of [page_token][crate::model::region_instance_groups::ListRequest::page_token].
15970        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
15971        where
15972            T: std::convert::Into<std::string::String>,
15973        {
15974            self.0.request.page_token = v.map(|x| x.into());
15975            self
15976        }
15977
15978        /// Sets the value of [project][crate::model::region_instance_groups::ListRequest::project].
15979        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15980            self.0.request.project = v.into();
15981            self
15982        }
15983
15984        /// Sets the value of [region][crate::model::region_instance_groups::ListRequest::region].
15985        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15986            self.0.request.region = v.into();
15987            self
15988        }
15989
15990        /// Sets the value of [return_partial_success][crate::model::region_instance_groups::ListRequest::return_partial_success].
15991        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
15992        where
15993            T: std::convert::Into<bool>,
15994        {
15995            self.0.request.return_partial_success = std::option::Option::Some(v.into());
15996            self
15997        }
15998
15999        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_groups::ListRequest::return_partial_success].
16000        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16001        where
16002            T: std::convert::Into<bool>,
16003        {
16004            self.0.request.return_partial_success = v.map(|x| x.into());
16005            self
16006        }
16007    }
16008
16009    #[doc(hidden)]
16010    impl gax::options::internal::RequestBuilder for List {
16011        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16012            &mut self.0.options
16013        }
16014    }
16015
16016    /// The request builder for [RegionInstanceGroups::list_instances][crate::client::RegionInstanceGroups::list_instances] calls.
16017    ///
16018    /// # Example
16019    /// ```no_run
16020    /// # use google_cloud_compute_v1::builder;
16021    /// use builder::region_instance_groups::ListInstances;
16022    /// # tokio_test::block_on(async {
16023    /// use gax::paginator::ItemPaginator;
16024    ///
16025    /// let builder = prepare_request_builder();
16026    /// let mut items = builder.by_item();
16027    /// while let Some(result) = items.next().await {
16028    ///   let item = result?;
16029    /// }
16030    /// # gax::Result::<()>::Ok(()) });
16031    ///
16032    /// fn prepare_request_builder() -> ListInstances {
16033    ///   # panic!();
16034    ///   // ... details omitted ...
16035    /// }
16036    /// ```
16037    #[derive(Clone, Debug)]
16038    pub struct ListInstances(
16039        RequestBuilder<crate::model::region_instance_groups::ListInstancesRequest>,
16040    );
16041
16042    impl ListInstances {
16043        pub(crate) fn new(
16044            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16045        ) -> Self {
16046            Self(RequestBuilder::new(stub))
16047        }
16048
16049        /// Sets the full request, replacing any prior values.
16050        pub fn with_request<V: Into<crate::model::region_instance_groups::ListInstancesRequest>>(
16051            mut self,
16052            v: V,
16053        ) -> Self {
16054            self.0.request = v.into();
16055            self
16056        }
16057
16058        /// Sets all the options, replacing any prior values.
16059        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16060            self.0.options = v.into();
16061            self
16062        }
16063
16064        /// Sends the request.
16065        pub async fn send(self) -> Result<crate::model::RegionInstanceGroupsListInstances> {
16066            (*self.0.stub)
16067                .list_instances(self.0.request, self.0.options)
16068                .await
16069                .map(gax::response::Response::into_body)
16070        }
16071
16072        /// Streams each page in the collection.
16073        pub fn by_page(
16074            self,
16075        ) -> impl gax::paginator::Paginator<
16076            crate::model::RegionInstanceGroupsListInstances,
16077            gax::error::Error,
16078        > {
16079            use std::clone::Clone;
16080            let token = self.0.request.page_token.clone().unwrap_or_default();
16081            let execute = move |token: String| {
16082                let mut builder = self.clone();
16083                builder.0.request = builder.0.request.set_page_token(token);
16084                builder.send()
16085            };
16086            gax::paginator::internal::new_paginator(token, execute)
16087        }
16088
16089        /// Streams each item in the collection.
16090        pub fn by_item(
16091            self,
16092        ) -> impl gax::paginator::ItemPaginator<
16093            crate::model::RegionInstanceGroupsListInstances,
16094            gax::error::Error,
16095        > {
16096            use gax::paginator::Paginator;
16097            self.by_page().items()
16098        }
16099
16100        /// Sets the value of [filter][crate::model::region_instance_groups::ListInstancesRequest::filter].
16101        pub fn set_filter<T>(mut self, v: T) -> Self
16102        where
16103            T: std::convert::Into<std::string::String>,
16104        {
16105            self.0.request.filter = std::option::Option::Some(v.into());
16106            self
16107        }
16108
16109        /// Sets or clears the value of [filter][crate::model::region_instance_groups::ListInstancesRequest::filter].
16110        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16111        where
16112            T: std::convert::Into<std::string::String>,
16113        {
16114            self.0.request.filter = v.map(|x| x.into());
16115            self
16116        }
16117
16118        /// Sets the value of [instance_group][crate::model::region_instance_groups::ListInstancesRequest::instance_group].
16119        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
16120            self.0.request.instance_group = v.into();
16121            self
16122        }
16123
16124        /// Sets the value of [max_results][crate::model::region_instance_groups::ListInstancesRequest::max_results].
16125        pub fn set_max_results<T>(mut self, v: T) -> Self
16126        where
16127            T: std::convert::Into<u32>,
16128        {
16129            self.0.request.max_results = std::option::Option::Some(v.into());
16130            self
16131        }
16132
16133        /// Sets or clears the value of [max_results][crate::model::region_instance_groups::ListInstancesRequest::max_results].
16134        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
16135        where
16136            T: std::convert::Into<u32>,
16137        {
16138            self.0.request.max_results = v.map(|x| x.into());
16139            self
16140        }
16141
16142        /// Sets the value of [order_by][crate::model::region_instance_groups::ListInstancesRequest::order_by].
16143        pub fn set_order_by<T>(mut self, v: T) -> Self
16144        where
16145            T: std::convert::Into<std::string::String>,
16146        {
16147            self.0.request.order_by = std::option::Option::Some(v.into());
16148            self
16149        }
16150
16151        /// Sets or clears the value of [order_by][crate::model::region_instance_groups::ListInstancesRequest::order_by].
16152        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
16153        where
16154            T: std::convert::Into<std::string::String>,
16155        {
16156            self.0.request.order_by = v.map(|x| x.into());
16157            self
16158        }
16159
16160        /// Sets the value of [page_token][crate::model::region_instance_groups::ListInstancesRequest::page_token].
16161        pub fn set_page_token<T>(mut self, v: T) -> Self
16162        where
16163            T: std::convert::Into<std::string::String>,
16164        {
16165            self.0.request.page_token = std::option::Option::Some(v.into());
16166            self
16167        }
16168
16169        /// Sets or clears the value of [page_token][crate::model::region_instance_groups::ListInstancesRequest::page_token].
16170        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
16171        where
16172            T: std::convert::Into<std::string::String>,
16173        {
16174            self.0.request.page_token = v.map(|x| x.into());
16175            self
16176        }
16177
16178        /// Sets the value of [project][crate::model::region_instance_groups::ListInstancesRequest::project].
16179        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16180            self.0.request.project = v.into();
16181            self
16182        }
16183
16184        /// Sets the value of [region][crate::model::region_instance_groups::ListInstancesRequest::region].
16185        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16186            self.0.request.region = v.into();
16187            self
16188        }
16189
16190        /// Sets the value of [return_partial_success][crate::model::region_instance_groups::ListInstancesRequest::return_partial_success].
16191        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
16192        where
16193            T: std::convert::Into<bool>,
16194        {
16195            self.0.request.return_partial_success = std::option::Option::Some(v.into());
16196            self
16197        }
16198
16199        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_groups::ListInstancesRequest::return_partial_success].
16200        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16201        where
16202            T: std::convert::Into<bool>,
16203        {
16204            self.0.request.return_partial_success = v.map(|x| x.into());
16205            self
16206        }
16207
16208        /// Sets the value of [body][crate::model::region_instance_groups::ListInstancesRequest::body].
16209        pub fn set_body<T>(mut self, v: T) -> Self
16210        where
16211            T: std::convert::Into<crate::model::RegionInstanceGroupsListInstancesRequest>,
16212        {
16213            self.0.request.body = std::option::Option::Some(v.into());
16214            self
16215        }
16216
16217        /// Sets or clears the value of [body][crate::model::region_instance_groups::ListInstancesRequest::body].
16218        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16219        where
16220            T: std::convert::Into<crate::model::RegionInstanceGroupsListInstancesRequest>,
16221        {
16222            self.0.request.body = v.map(|x| x.into());
16223            self
16224        }
16225    }
16226
16227    #[doc(hidden)]
16228    impl gax::options::internal::RequestBuilder for ListInstances {
16229        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16230            &mut self.0.options
16231        }
16232    }
16233
16234    /// The request builder for [RegionInstanceGroups::set_named_ports][crate::client::RegionInstanceGroups::set_named_ports] calls.
16235    ///
16236    /// # Example
16237    /// ```no_run
16238    /// # use google_cloud_compute_v1::builder;
16239    /// use builder::region_instance_groups::SetNamedPorts;
16240    /// # tokio_test::block_on(async {
16241    ///
16242    /// let builder = prepare_request_builder();
16243    /// let response = builder.send().await?;
16244    /// # gax::Result::<()>::Ok(()) });
16245    ///
16246    /// fn prepare_request_builder() -> SetNamedPorts {
16247    ///   # panic!();
16248    ///   // ... details omitted ...
16249    /// }
16250    /// ```
16251    #[derive(Clone, Debug)]
16252    pub struct SetNamedPorts(
16253        RequestBuilder<crate::model::region_instance_groups::SetNamedPortsRequest>,
16254    );
16255
16256    impl SetNamedPorts {
16257        pub(crate) fn new(
16258            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16259        ) -> Self {
16260            Self(RequestBuilder::new(stub))
16261        }
16262
16263        /// Sets the full request, replacing any prior values.
16264        pub fn with_request<V: Into<crate::model::region_instance_groups::SetNamedPortsRequest>>(
16265            mut self,
16266            v: V,
16267        ) -> Self {
16268            self.0.request = v.into();
16269            self
16270        }
16271
16272        /// Sets all the options, replacing any prior values.
16273        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16274            self.0.options = v.into();
16275            self
16276        }
16277
16278        /// Sends the request.
16279        pub async fn send(self) -> Result<crate::model::Operation> {
16280            (*self.0.stub)
16281                .set_named_ports(self.0.request, self.0.options)
16282                .await
16283                .map(gax::response::Response::into_body)
16284        }
16285
16286        /// Sets the value of [instance_group][crate::model::region_instance_groups::SetNamedPortsRequest::instance_group].
16287        pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
16288            self.0.request.instance_group = v.into();
16289            self
16290        }
16291
16292        /// Sets the value of [project][crate::model::region_instance_groups::SetNamedPortsRequest::project].
16293        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16294            self.0.request.project = v.into();
16295            self
16296        }
16297
16298        /// Sets the value of [region][crate::model::region_instance_groups::SetNamedPortsRequest::region].
16299        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16300            self.0.request.region = v.into();
16301            self
16302        }
16303
16304        /// Sets the value of [request_id][crate::model::region_instance_groups::SetNamedPortsRequest::request_id].
16305        pub fn set_request_id<T>(mut self, v: T) -> Self
16306        where
16307            T: std::convert::Into<std::string::String>,
16308        {
16309            self.0.request.request_id = std::option::Option::Some(v.into());
16310            self
16311        }
16312
16313        /// Sets or clears the value of [request_id][crate::model::region_instance_groups::SetNamedPortsRequest::request_id].
16314        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16315        where
16316            T: std::convert::Into<std::string::String>,
16317        {
16318            self.0.request.request_id = v.map(|x| x.into());
16319            self
16320        }
16321
16322        /// Sets the value of [body][crate::model::region_instance_groups::SetNamedPortsRequest::body].
16323        pub fn set_body<T>(mut self, v: T) -> Self
16324        where
16325            T: std::convert::Into<crate::model::RegionInstanceGroupsSetNamedPortsRequest>,
16326        {
16327            self.0.request.body = std::option::Option::Some(v.into());
16328            self
16329        }
16330
16331        /// Sets or clears the value of [body][crate::model::region_instance_groups::SetNamedPortsRequest::body].
16332        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16333        where
16334            T: std::convert::Into<crate::model::RegionInstanceGroupsSetNamedPortsRequest>,
16335        {
16336            self.0.request.body = v.map(|x| x.into());
16337            self
16338        }
16339    }
16340
16341    #[doc(hidden)]
16342    impl gax::options::internal::RequestBuilder for SetNamedPorts {
16343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16344            &mut self.0.options
16345        }
16346    }
16347
16348    /// The request builder for [RegionInstanceGroups::test_iam_permissions][crate::client::RegionInstanceGroups::test_iam_permissions] calls.
16349    ///
16350    /// # Example
16351    /// ```no_run
16352    /// # use google_cloud_compute_v1::builder;
16353    /// use builder::region_instance_groups::TestIamPermissions;
16354    /// # tokio_test::block_on(async {
16355    ///
16356    /// let builder = prepare_request_builder();
16357    /// let response = builder.send().await?;
16358    /// # gax::Result::<()>::Ok(()) });
16359    ///
16360    /// fn prepare_request_builder() -> TestIamPermissions {
16361    ///   # panic!();
16362    ///   // ... details omitted ...
16363    /// }
16364    /// ```
16365    #[derive(Clone, Debug)]
16366    pub struct TestIamPermissions(
16367        RequestBuilder<crate::model::region_instance_groups::TestIamPermissionsRequest>,
16368    );
16369
16370    impl TestIamPermissions {
16371        pub(crate) fn new(
16372            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16373        ) -> Self {
16374            Self(RequestBuilder::new(stub))
16375        }
16376
16377        /// Sets the full request, replacing any prior values.
16378        pub fn with_request<
16379            V: Into<crate::model::region_instance_groups::TestIamPermissionsRequest>,
16380        >(
16381            mut self,
16382            v: V,
16383        ) -> Self {
16384            self.0.request = v.into();
16385            self
16386        }
16387
16388        /// Sets all the options, replacing any prior values.
16389        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16390            self.0.options = v.into();
16391            self
16392        }
16393
16394        /// Sends the request.
16395        pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
16396            (*self.0.stub)
16397                .test_iam_permissions(self.0.request, self.0.options)
16398                .await
16399                .map(gax::response::Response::into_body)
16400        }
16401
16402        /// Sets the value of [project][crate::model::region_instance_groups::TestIamPermissionsRequest::project].
16403        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16404            self.0.request.project = v.into();
16405            self
16406        }
16407
16408        /// Sets the value of [region][crate::model::region_instance_groups::TestIamPermissionsRequest::region].
16409        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16410            self.0.request.region = v.into();
16411            self
16412        }
16413
16414        /// Sets the value of [resource][crate::model::region_instance_groups::TestIamPermissionsRequest::resource].
16415        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16416            self.0.request.resource = v.into();
16417            self
16418        }
16419
16420        /// Sets the value of [body][crate::model::region_instance_groups::TestIamPermissionsRequest::body].
16421        pub fn set_body<T>(mut self, v: T) -> Self
16422        where
16423            T: std::convert::Into<crate::model::TestPermissionsRequest>,
16424        {
16425            self.0.request.body = std::option::Option::Some(v.into());
16426            self
16427        }
16428
16429        /// Sets or clears the value of [body][crate::model::region_instance_groups::TestIamPermissionsRequest::body].
16430        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16431        where
16432            T: std::convert::Into<crate::model::TestPermissionsRequest>,
16433        {
16434            self.0.request.body = v.map(|x| x.into());
16435            self
16436        }
16437    }
16438
16439    #[doc(hidden)]
16440    impl gax::options::internal::RequestBuilder for TestIamPermissions {
16441        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16442            &mut self.0.options
16443        }
16444    }
16445}
16446
16447#[cfg(feature = "region-instance-templates")]
16448#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
16449pub mod region_instance_templates {
16450    use crate::Result;
16451
16452    /// A builder for [RegionInstanceTemplates][crate::client::RegionInstanceTemplates].
16453    ///
16454    /// ```
16455    /// # tokio_test::block_on(async {
16456    /// # use google_cloud_compute_v1::*;
16457    /// # use builder::region_instance_templates::ClientBuilder;
16458    /// # use client::RegionInstanceTemplates;
16459    /// let builder : ClientBuilder = RegionInstanceTemplates::builder();
16460    /// let client = builder
16461    ///     .with_endpoint("https://compute.googleapis.com")
16462    ///     .build().await?;
16463    /// # gax::client_builder::Result::<()>::Ok(()) });
16464    /// ```
16465    pub type ClientBuilder =
16466        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16467
16468    pub(crate) mod client {
16469        use super::super::super::client::RegionInstanceTemplates;
16470        pub struct Factory;
16471        impl gax::client_builder::internal::ClientFactory for Factory {
16472            type Client = RegionInstanceTemplates;
16473            type Credentials = gaxi::options::Credentials;
16474            async fn build(
16475                self,
16476                config: gaxi::options::ClientConfig,
16477            ) -> gax::client_builder::Result<Self::Client> {
16478                Self::Client::new(config).await
16479            }
16480        }
16481    }
16482
16483    /// Common implementation for [crate::client::RegionInstanceTemplates] request builders.
16484    #[derive(Clone, Debug)]
16485    pub(crate) struct RequestBuilder<R: std::default::Default> {
16486        stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16487        request: R,
16488        options: gax::options::RequestOptions,
16489    }
16490
16491    impl<R> RequestBuilder<R>
16492    where
16493        R: std::default::Default,
16494    {
16495        pub(crate) fn new(
16496            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16497        ) -> Self {
16498            Self {
16499                stub,
16500                request: R::default(),
16501                options: gax::options::RequestOptions::default(),
16502            }
16503        }
16504    }
16505
16506    /// The request builder for [RegionInstanceTemplates::delete][crate::client::RegionInstanceTemplates::delete] calls.
16507    ///
16508    /// # Example
16509    /// ```no_run
16510    /// # use google_cloud_compute_v1::builder;
16511    /// use builder::region_instance_templates::Delete;
16512    /// # tokio_test::block_on(async {
16513    ///
16514    /// let builder = prepare_request_builder();
16515    /// let response = builder.send().await?;
16516    /// # gax::Result::<()>::Ok(()) });
16517    ///
16518    /// fn prepare_request_builder() -> Delete {
16519    ///   # panic!();
16520    ///   // ... details omitted ...
16521    /// }
16522    /// ```
16523    #[derive(Clone, Debug)]
16524    pub struct Delete(RequestBuilder<crate::model::region_instance_templates::DeleteRequest>);
16525
16526    impl Delete {
16527        pub(crate) fn new(
16528            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16529        ) -> Self {
16530            Self(RequestBuilder::new(stub))
16531        }
16532
16533        /// Sets the full request, replacing any prior values.
16534        pub fn with_request<V: Into<crate::model::region_instance_templates::DeleteRequest>>(
16535            mut self,
16536            v: V,
16537        ) -> Self {
16538            self.0.request = v.into();
16539            self
16540        }
16541
16542        /// Sets all the options, replacing any prior values.
16543        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16544            self.0.options = v.into();
16545            self
16546        }
16547
16548        /// Sends the request.
16549        pub async fn send(self) -> Result<crate::model::Operation> {
16550            (*self.0.stub)
16551                .delete(self.0.request, self.0.options)
16552                .await
16553                .map(gax::response::Response::into_body)
16554        }
16555
16556        /// Sets the value of [instance_template][crate::model::region_instance_templates::DeleteRequest::instance_template].
16557        pub fn set_instance_template<T: Into<std::string::String>>(mut self, v: T) -> Self {
16558            self.0.request.instance_template = v.into();
16559            self
16560        }
16561
16562        /// Sets the value of [project][crate::model::region_instance_templates::DeleteRequest::project].
16563        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16564            self.0.request.project = v.into();
16565            self
16566        }
16567
16568        /// Sets the value of [region][crate::model::region_instance_templates::DeleteRequest::region].
16569        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16570            self.0.request.region = v.into();
16571            self
16572        }
16573
16574        /// Sets the value of [request_id][crate::model::region_instance_templates::DeleteRequest::request_id].
16575        pub fn set_request_id<T>(mut self, v: T) -> Self
16576        where
16577            T: std::convert::Into<std::string::String>,
16578        {
16579            self.0.request.request_id = std::option::Option::Some(v.into());
16580            self
16581        }
16582
16583        /// Sets or clears the value of [request_id][crate::model::region_instance_templates::DeleteRequest::request_id].
16584        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16585        where
16586            T: std::convert::Into<std::string::String>,
16587        {
16588            self.0.request.request_id = v.map(|x| x.into());
16589            self
16590        }
16591    }
16592
16593    #[doc(hidden)]
16594    impl gax::options::internal::RequestBuilder for Delete {
16595        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16596            &mut self.0.options
16597        }
16598    }
16599
16600    /// The request builder for [RegionInstanceTemplates::get][crate::client::RegionInstanceTemplates::get] calls.
16601    ///
16602    /// # Example
16603    /// ```no_run
16604    /// # use google_cloud_compute_v1::builder;
16605    /// use builder::region_instance_templates::Get;
16606    /// # tokio_test::block_on(async {
16607    ///
16608    /// let builder = prepare_request_builder();
16609    /// let response = builder.send().await?;
16610    /// # gax::Result::<()>::Ok(()) });
16611    ///
16612    /// fn prepare_request_builder() -> Get {
16613    ///   # panic!();
16614    ///   // ... details omitted ...
16615    /// }
16616    /// ```
16617    #[derive(Clone, Debug)]
16618    pub struct Get(RequestBuilder<crate::model::region_instance_templates::GetRequest>);
16619
16620    impl Get {
16621        pub(crate) fn new(
16622            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16623        ) -> Self {
16624            Self(RequestBuilder::new(stub))
16625        }
16626
16627        /// Sets the full request, replacing any prior values.
16628        pub fn with_request<V: Into<crate::model::region_instance_templates::GetRequest>>(
16629            mut self,
16630            v: V,
16631        ) -> Self {
16632            self.0.request = v.into();
16633            self
16634        }
16635
16636        /// Sets all the options, replacing any prior values.
16637        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16638            self.0.options = v.into();
16639            self
16640        }
16641
16642        /// Sends the request.
16643        pub async fn send(self) -> Result<crate::model::InstanceTemplate> {
16644            (*self.0.stub)
16645                .get(self.0.request, self.0.options)
16646                .await
16647                .map(gax::response::Response::into_body)
16648        }
16649
16650        /// Sets the value of [instance_template][crate::model::region_instance_templates::GetRequest::instance_template].
16651        pub fn set_instance_template<T: Into<std::string::String>>(mut self, v: T) -> Self {
16652            self.0.request.instance_template = v.into();
16653            self
16654        }
16655
16656        /// Sets the value of [project][crate::model::region_instance_templates::GetRequest::project].
16657        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16658            self.0.request.project = v.into();
16659            self
16660        }
16661
16662        /// Sets the value of [region][crate::model::region_instance_templates::GetRequest::region].
16663        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16664            self.0.request.region = v.into();
16665            self
16666        }
16667    }
16668
16669    #[doc(hidden)]
16670    impl gax::options::internal::RequestBuilder for Get {
16671        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16672            &mut self.0.options
16673        }
16674    }
16675
16676    /// The request builder for [RegionInstanceTemplates::insert][crate::client::RegionInstanceTemplates::insert] calls.
16677    ///
16678    /// # Example
16679    /// ```no_run
16680    /// # use google_cloud_compute_v1::builder;
16681    /// use builder::region_instance_templates::Insert;
16682    /// # tokio_test::block_on(async {
16683    ///
16684    /// let builder = prepare_request_builder();
16685    /// let response = builder.send().await?;
16686    /// # gax::Result::<()>::Ok(()) });
16687    ///
16688    /// fn prepare_request_builder() -> Insert {
16689    ///   # panic!();
16690    ///   // ... details omitted ...
16691    /// }
16692    /// ```
16693    #[derive(Clone, Debug)]
16694    pub struct Insert(RequestBuilder<crate::model::region_instance_templates::InsertRequest>);
16695
16696    impl Insert {
16697        pub(crate) fn new(
16698            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16699        ) -> Self {
16700            Self(RequestBuilder::new(stub))
16701        }
16702
16703        /// Sets the full request, replacing any prior values.
16704        pub fn with_request<V: Into<crate::model::region_instance_templates::InsertRequest>>(
16705            mut self,
16706            v: V,
16707        ) -> Self {
16708            self.0.request = v.into();
16709            self
16710        }
16711
16712        /// Sets all the options, replacing any prior values.
16713        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16714            self.0.options = v.into();
16715            self
16716        }
16717
16718        /// Sends the request.
16719        pub async fn send(self) -> Result<crate::model::Operation> {
16720            (*self.0.stub)
16721                .insert(self.0.request, self.0.options)
16722                .await
16723                .map(gax::response::Response::into_body)
16724        }
16725
16726        /// Sets the value of [project][crate::model::region_instance_templates::InsertRequest::project].
16727        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16728            self.0.request.project = v.into();
16729            self
16730        }
16731
16732        /// Sets the value of [region][crate::model::region_instance_templates::InsertRequest::region].
16733        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16734            self.0.request.region = v.into();
16735            self
16736        }
16737
16738        /// Sets the value of [request_id][crate::model::region_instance_templates::InsertRequest::request_id].
16739        pub fn set_request_id<T>(mut self, v: T) -> Self
16740        where
16741            T: std::convert::Into<std::string::String>,
16742        {
16743            self.0.request.request_id = std::option::Option::Some(v.into());
16744            self
16745        }
16746
16747        /// Sets or clears the value of [request_id][crate::model::region_instance_templates::InsertRequest::request_id].
16748        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16749        where
16750            T: std::convert::Into<std::string::String>,
16751        {
16752            self.0.request.request_id = v.map(|x| x.into());
16753            self
16754        }
16755
16756        /// Sets the value of [body][crate::model::region_instance_templates::InsertRequest::body].
16757        pub fn set_body<T>(mut self, v: T) -> Self
16758        where
16759            T: std::convert::Into<crate::model::InstanceTemplate>,
16760        {
16761            self.0.request.body = std::option::Option::Some(v.into());
16762            self
16763        }
16764
16765        /// Sets or clears the value of [body][crate::model::region_instance_templates::InsertRequest::body].
16766        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16767        where
16768            T: std::convert::Into<crate::model::InstanceTemplate>,
16769        {
16770            self.0.request.body = v.map(|x| x.into());
16771            self
16772        }
16773    }
16774
16775    #[doc(hidden)]
16776    impl gax::options::internal::RequestBuilder for Insert {
16777        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16778            &mut self.0.options
16779        }
16780    }
16781
16782    /// The request builder for [RegionInstanceTemplates::list][crate::client::RegionInstanceTemplates::list] calls.
16783    ///
16784    /// # Example
16785    /// ```no_run
16786    /// # use google_cloud_compute_v1::builder;
16787    /// use builder::region_instance_templates::List;
16788    /// # tokio_test::block_on(async {
16789    /// use gax::paginator::ItemPaginator;
16790    ///
16791    /// let builder = prepare_request_builder();
16792    /// let mut items = builder.by_item();
16793    /// while let Some(result) = items.next().await {
16794    ///   let item = result?;
16795    /// }
16796    /// # gax::Result::<()>::Ok(()) });
16797    ///
16798    /// fn prepare_request_builder() -> List {
16799    ///   # panic!();
16800    ///   // ... details omitted ...
16801    /// }
16802    /// ```
16803    #[derive(Clone, Debug)]
16804    pub struct List(RequestBuilder<crate::model::region_instance_templates::ListRequest>);
16805
16806    impl List {
16807        pub(crate) fn new(
16808            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16809        ) -> Self {
16810            Self(RequestBuilder::new(stub))
16811        }
16812
16813        /// Sets the full request, replacing any prior values.
16814        pub fn with_request<V: Into<crate::model::region_instance_templates::ListRequest>>(
16815            mut self,
16816            v: V,
16817        ) -> Self {
16818            self.0.request = v.into();
16819            self
16820        }
16821
16822        /// Sets all the options, replacing any prior values.
16823        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16824            self.0.options = v.into();
16825            self
16826        }
16827
16828        /// Sends the request.
16829        pub async fn send(self) -> Result<crate::model::InstanceTemplateList> {
16830            (*self.0.stub)
16831                .list(self.0.request, self.0.options)
16832                .await
16833                .map(gax::response::Response::into_body)
16834        }
16835
16836        /// Streams each page in the collection.
16837        pub fn by_page(
16838            self,
16839        ) -> impl gax::paginator::Paginator<crate::model::InstanceTemplateList, gax::error::Error>
16840        {
16841            use std::clone::Clone;
16842            let token = self.0.request.page_token.clone().unwrap_or_default();
16843            let execute = move |token: String| {
16844                let mut builder = self.clone();
16845                builder.0.request = builder.0.request.set_page_token(token);
16846                builder.send()
16847            };
16848            gax::paginator::internal::new_paginator(token, execute)
16849        }
16850
16851        /// Streams each item in the collection.
16852        pub fn by_item(
16853            self,
16854        ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceTemplateList, gax::error::Error>
16855        {
16856            use gax::paginator::Paginator;
16857            self.by_page().items()
16858        }
16859
16860        /// Sets the value of [filter][crate::model::region_instance_templates::ListRequest::filter].
16861        pub fn set_filter<T>(mut self, v: T) -> Self
16862        where
16863            T: std::convert::Into<std::string::String>,
16864        {
16865            self.0.request.filter = std::option::Option::Some(v.into());
16866            self
16867        }
16868
16869        /// Sets or clears the value of [filter][crate::model::region_instance_templates::ListRequest::filter].
16870        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16871        where
16872            T: std::convert::Into<std::string::String>,
16873        {
16874            self.0.request.filter = v.map(|x| x.into());
16875            self
16876        }
16877
16878        /// Sets the value of [max_results][crate::model::region_instance_templates::ListRequest::max_results].
16879        pub fn set_max_results<T>(mut self, v: T) -> Self
16880        where
16881            T: std::convert::Into<u32>,
16882        {
16883            self.0.request.max_results = std::option::Option::Some(v.into());
16884            self
16885        }
16886
16887        /// Sets or clears the value of [max_results][crate::model::region_instance_templates::ListRequest::max_results].
16888        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
16889        where
16890            T: std::convert::Into<u32>,
16891        {
16892            self.0.request.max_results = v.map(|x| x.into());
16893            self
16894        }
16895
16896        /// Sets the value of [order_by][crate::model::region_instance_templates::ListRequest::order_by].
16897        pub fn set_order_by<T>(mut self, v: T) -> Self
16898        where
16899            T: std::convert::Into<std::string::String>,
16900        {
16901            self.0.request.order_by = std::option::Option::Some(v.into());
16902            self
16903        }
16904
16905        /// Sets or clears the value of [order_by][crate::model::region_instance_templates::ListRequest::order_by].
16906        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
16907        where
16908            T: std::convert::Into<std::string::String>,
16909        {
16910            self.0.request.order_by = v.map(|x| x.into());
16911            self
16912        }
16913
16914        /// Sets the value of [page_token][crate::model::region_instance_templates::ListRequest::page_token].
16915        pub fn set_page_token<T>(mut self, v: T) -> Self
16916        where
16917            T: std::convert::Into<std::string::String>,
16918        {
16919            self.0.request.page_token = std::option::Option::Some(v.into());
16920            self
16921        }
16922
16923        /// Sets or clears the value of [page_token][crate::model::region_instance_templates::ListRequest::page_token].
16924        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
16925        where
16926            T: std::convert::Into<std::string::String>,
16927        {
16928            self.0.request.page_token = v.map(|x| x.into());
16929            self
16930        }
16931
16932        /// Sets the value of [project][crate::model::region_instance_templates::ListRequest::project].
16933        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16934            self.0.request.project = v.into();
16935            self
16936        }
16937
16938        /// Sets the value of [region][crate::model::region_instance_templates::ListRequest::region].
16939        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16940            self.0.request.region = v.into();
16941            self
16942        }
16943
16944        /// Sets the value of [return_partial_success][crate::model::region_instance_templates::ListRequest::return_partial_success].
16945        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
16946        where
16947            T: std::convert::Into<bool>,
16948        {
16949            self.0.request.return_partial_success = std::option::Option::Some(v.into());
16950            self
16951        }
16952
16953        /// Sets or clears the value of [return_partial_success][crate::model::region_instance_templates::ListRequest::return_partial_success].
16954        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16955        where
16956            T: std::convert::Into<bool>,
16957        {
16958            self.0.request.return_partial_success = v.map(|x| x.into());
16959            self
16960        }
16961    }
16962
16963    #[doc(hidden)]
16964    impl gax::options::internal::RequestBuilder for List {
16965        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16966            &mut self.0.options
16967        }
16968    }
16969}
16970
16971#[cfg(feature = "region-instances")]
16972#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
16973pub mod region_instances {
16974    use crate::Result;
16975
16976    /// A builder for [RegionInstances][crate::client::RegionInstances].
16977    ///
16978    /// ```
16979    /// # tokio_test::block_on(async {
16980    /// # use google_cloud_compute_v1::*;
16981    /// # use builder::region_instances::ClientBuilder;
16982    /// # use client::RegionInstances;
16983    /// let builder : ClientBuilder = RegionInstances::builder();
16984    /// let client = builder
16985    ///     .with_endpoint("https://compute.googleapis.com")
16986    ///     .build().await?;
16987    /// # gax::client_builder::Result::<()>::Ok(()) });
16988    /// ```
16989    pub type ClientBuilder =
16990        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16991
16992    pub(crate) mod client {
16993        use super::super::super::client::RegionInstances;
16994        pub struct Factory;
16995        impl gax::client_builder::internal::ClientFactory for Factory {
16996            type Client = RegionInstances;
16997            type Credentials = gaxi::options::Credentials;
16998            async fn build(
16999                self,
17000                config: gaxi::options::ClientConfig,
17001            ) -> gax::client_builder::Result<Self::Client> {
17002                Self::Client::new(config).await
17003            }
17004        }
17005    }
17006
17007    /// Common implementation for [crate::client::RegionInstances] request builders.
17008    #[derive(Clone, Debug)]
17009    pub(crate) struct RequestBuilder<R: std::default::Default> {
17010        stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17011        request: R,
17012        options: gax::options::RequestOptions,
17013    }
17014
17015    impl<R> RequestBuilder<R>
17016    where
17017        R: std::default::Default,
17018    {
17019        pub(crate) fn new(
17020            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17021        ) -> Self {
17022            Self {
17023                stub,
17024                request: R::default(),
17025                options: gax::options::RequestOptions::default(),
17026            }
17027        }
17028    }
17029
17030    /// The request builder for [RegionInstances::bulk_insert][crate::client::RegionInstances::bulk_insert] calls.
17031    ///
17032    /// # Example
17033    /// ```no_run
17034    /// # use google_cloud_compute_v1::builder;
17035    /// use builder::region_instances::BulkInsert;
17036    /// # tokio_test::block_on(async {
17037    ///
17038    /// let builder = prepare_request_builder();
17039    /// let response = builder.send().await?;
17040    /// # gax::Result::<()>::Ok(()) });
17041    ///
17042    /// fn prepare_request_builder() -> BulkInsert {
17043    ///   # panic!();
17044    ///   // ... details omitted ...
17045    /// }
17046    /// ```
17047    #[derive(Clone, Debug)]
17048    pub struct BulkInsert(RequestBuilder<crate::model::region_instances::BulkInsertRequest>);
17049
17050    impl BulkInsert {
17051        pub(crate) fn new(
17052            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17053        ) -> Self {
17054            Self(RequestBuilder::new(stub))
17055        }
17056
17057        /// Sets the full request, replacing any prior values.
17058        pub fn with_request<V: Into<crate::model::region_instances::BulkInsertRequest>>(
17059            mut self,
17060            v: V,
17061        ) -> Self {
17062            self.0.request = v.into();
17063            self
17064        }
17065
17066        /// Sets all the options, replacing any prior values.
17067        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17068            self.0.options = v.into();
17069            self
17070        }
17071
17072        /// Sends the request.
17073        pub async fn send(self) -> Result<crate::model::Operation> {
17074            (*self.0.stub)
17075                .bulk_insert(self.0.request, self.0.options)
17076                .await
17077                .map(gax::response::Response::into_body)
17078        }
17079
17080        /// Sets the value of [project][crate::model::region_instances::BulkInsertRequest::project].
17081        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17082            self.0.request.project = v.into();
17083            self
17084        }
17085
17086        /// Sets the value of [region][crate::model::region_instances::BulkInsertRequest::region].
17087        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17088            self.0.request.region = v.into();
17089            self
17090        }
17091
17092        /// Sets the value of [request_id][crate::model::region_instances::BulkInsertRequest::request_id].
17093        pub fn set_request_id<T>(mut self, v: T) -> Self
17094        where
17095            T: std::convert::Into<std::string::String>,
17096        {
17097            self.0.request.request_id = std::option::Option::Some(v.into());
17098            self
17099        }
17100
17101        /// Sets or clears the value of [request_id][crate::model::region_instances::BulkInsertRequest::request_id].
17102        pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
17103        where
17104            T: std::convert::Into<std::string::String>,
17105        {
17106            self.0.request.request_id = v.map(|x| x.into());
17107            self
17108        }
17109
17110        /// Sets the value of [body][crate::model::region_instances::BulkInsertRequest::body].
17111        pub fn set_body<T>(mut self, v: T) -> Self
17112        where
17113            T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
17114        {
17115            self.0.request.body = std::option::Option::Some(v.into());
17116            self
17117        }
17118
17119        /// Sets or clears the value of [body][crate::model::region_instances::BulkInsertRequest::body].
17120        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
17121        where
17122            T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
17123        {
17124            self.0.request.body = v.map(|x| x.into());
17125            self
17126        }
17127    }
17128
17129    #[doc(hidden)]
17130    impl gax::options::internal::RequestBuilder for BulkInsert {
17131        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17132            &mut self.0.options
17133        }
17134    }
17135}
17136
17137#[cfg(feature = "region-operations")]
17138#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
17139pub mod region_operations {
17140    use crate::Result;
17141
17142    /// A builder for [RegionOperations][crate::client::RegionOperations].
17143    ///
17144    /// ```
17145    /// # tokio_test::block_on(async {
17146    /// # use google_cloud_compute_v1::*;
17147    /// # use builder::region_operations::ClientBuilder;
17148    /// # use client::RegionOperations;
17149    /// let builder : ClientBuilder = RegionOperations::builder();
17150    /// let client = builder
17151    ///     .with_endpoint("https://compute.googleapis.com")
17152    ///     .build().await?;
17153    /// # gax::client_builder::Result::<()>::Ok(()) });
17154    /// ```
17155    pub type ClientBuilder =
17156        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17157
17158    pub(crate) mod client {
17159        use super::super::super::client::RegionOperations;
17160        pub struct Factory;
17161        impl gax::client_builder::internal::ClientFactory for Factory {
17162            type Client = RegionOperations;
17163            type Credentials = gaxi::options::Credentials;
17164            async fn build(
17165                self,
17166                config: gaxi::options::ClientConfig,
17167            ) -> gax::client_builder::Result<Self::Client> {
17168                Self::Client::new(config).await
17169            }
17170        }
17171    }
17172
17173    /// Common implementation for [crate::client::RegionOperations] request builders.
17174    #[derive(Clone, Debug)]
17175    pub(crate) struct RequestBuilder<R: std::default::Default> {
17176        stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17177        request: R,
17178        options: gax::options::RequestOptions,
17179    }
17180
17181    impl<R> RequestBuilder<R>
17182    where
17183        R: std::default::Default,
17184    {
17185        pub(crate) fn new(
17186            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17187        ) -> Self {
17188            Self {
17189                stub,
17190                request: R::default(),
17191                options: gax::options::RequestOptions::default(),
17192            }
17193        }
17194    }
17195
17196    /// The request builder for [RegionOperations::delete][crate::client::RegionOperations::delete] calls.
17197    ///
17198    /// # Example
17199    /// ```no_run
17200    /// # use google_cloud_compute_v1::builder;
17201    /// use builder::region_operations::Delete;
17202    /// # tokio_test::block_on(async {
17203    ///
17204    /// let builder = prepare_request_builder();
17205    /// let response = builder.send().await?;
17206    /// # gax::Result::<()>::Ok(()) });
17207    ///
17208    /// fn prepare_request_builder() -> Delete {
17209    ///   # panic!();
17210    ///   // ... details omitted ...
17211    /// }
17212    /// ```
17213    #[derive(Clone, Debug)]
17214    pub struct Delete(RequestBuilder<crate::model::region_operations::DeleteRequest>);
17215
17216    impl Delete {
17217        pub(crate) fn new(
17218            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17219        ) -> Self {
17220            Self(RequestBuilder::new(stub))
17221        }
17222
17223        /// Sets the full request, replacing any prior values.
17224        pub fn with_request<V: Into<crate::model::region_operations::DeleteRequest>>(
17225            mut self,
17226            v: V,
17227        ) -> Self {
17228            self.0.request = v.into();
17229            self
17230        }
17231
17232        /// Sets all the options, replacing any prior values.
17233        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17234            self.0.options = v.into();
17235            self
17236        }
17237
17238        /// Sends the request.
17239        pub async fn send(self) -> Result<wkt::Empty> {
17240            (*self.0.stub)
17241                .delete(self.0.request, self.0.options)
17242                .await
17243                .map(gax::response::Response::into_body)
17244        }
17245
17246        /// Sets the value of [operation][crate::model::region_operations::DeleteRequest::operation].
17247        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17248            self.0.request.operation = v.into();
17249            self
17250        }
17251
17252        /// Sets the value of [project][crate::model::region_operations::DeleteRequest::project].
17253        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17254            self.0.request.project = v.into();
17255            self
17256        }
17257
17258        /// Sets the value of [region][crate::model::region_operations::DeleteRequest::region].
17259        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17260            self.0.request.region = v.into();
17261            self
17262        }
17263    }
17264
17265    #[doc(hidden)]
17266    impl gax::options::internal::RequestBuilder for Delete {
17267        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17268            &mut self.0.options
17269        }
17270    }
17271
17272    /// The request builder for [RegionOperations::get][crate::client::RegionOperations::get] calls.
17273    ///
17274    /// # Example
17275    /// ```no_run
17276    /// # use google_cloud_compute_v1::builder;
17277    /// use builder::region_operations::Get;
17278    /// # tokio_test::block_on(async {
17279    ///
17280    /// let builder = prepare_request_builder();
17281    /// let response = builder.send().await?;
17282    /// # gax::Result::<()>::Ok(()) });
17283    ///
17284    /// fn prepare_request_builder() -> Get {
17285    ///   # panic!();
17286    ///   // ... details omitted ...
17287    /// }
17288    /// ```
17289    #[derive(Clone, Debug)]
17290    pub struct Get(RequestBuilder<crate::model::region_operations::GetRequest>);
17291
17292    impl Get {
17293        pub(crate) fn new(
17294            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17295        ) -> Self {
17296            Self(RequestBuilder::new(stub))
17297        }
17298
17299        /// Sets the full request, replacing any prior values.
17300        pub fn with_request<V: Into<crate::model::region_operations::GetRequest>>(
17301            mut self,
17302            v: V,
17303        ) -> Self {
17304            self.0.request = v.into();
17305            self
17306        }
17307
17308        /// Sets all the options, replacing any prior values.
17309        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17310            self.0.options = v.into();
17311            self
17312        }
17313
17314        /// Sends the request.
17315        pub async fn send(self) -> Result<crate::model::Operation> {
17316            (*self.0.stub)
17317                .get(self.0.request, self.0.options)
17318                .await
17319                .map(gax::response::Response::into_body)
17320        }
17321
17322        /// Sets the value of [operation][crate::model::region_operations::GetRequest::operation].
17323        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17324            self.0.request.operation = v.into();
17325            self
17326        }
17327
17328        /// Sets the value of [project][crate::model::region_operations::GetRequest::project].
17329        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17330            self.0.request.project = v.into();
17331            self
17332        }
17333
17334        /// Sets the value of [region][crate::model::region_operations::GetRequest::region].
17335        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17336            self.0.request.region = v.into();
17337            self
17338        }
17339    }
17340
17341    #[doc(hidden)]
17342    impl gax::options::internal::RequestBuilder for Get {
17343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17344            &mut self.0.options
17345        }
17346    }
17347
17348    /// The request builder for [RegionOperations::list][crate::client::RegionOperations::list] calls.
17349    ///
17350    /// # Example
17351    /// ```no_run
17352    /// # use google_cloud_compute_v1::builder;
17353    /// use builder::region_operations::List;
17354    /// # tokio_test::block_on(async {
17355    /// use gax::paginator::ItemPaginator;
17356    ///
17357    /// let builder = prepare_request_builder();
17358    /// let mut items = builder.by_item();
17359    /// while let Some(result) = items.next().await {
17360    ///   let item = result?;
17361    /// }
17362    /// # gax::Result::<()>::Ok(()) });
17363    ///
17364    /// fn prepare_request_builder() -> List {
17365    ///   # panic!();
17366    ///   // ... details omitted ...
17367    /// }
17368    /// ```
17369    #[derive(Clone, Debug)]
17370    pub struct List(RequestBuilder<crate::model::region_operations::ListRequest>);
17371
17372    impl List {
17373        pub(crate) fn new(
17374            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17375        ) -> Self {
17376            Self(RequestBuilder::new(stub))
17377        }
17378
17379        /// Sets the full request, replacing any prior values.
17380        pub fn with_request<V: Into<crate::model::region_operations::ListRequest>>(
17381            mut self,
17382            v: V,
17383        ) -> Self {
17384            self.0.request = v.into();
17385            self
17386        }
17387
17388        /// Sets all the options, replacing any prior values.
17389        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17390            self.0.options = v.into();
17391            self
17392        }
17393
17394        /// Sends the request.
17395        pub async fn send(self) -> Result<crate::model::OperationList> {
17396            (*self.0.stub)
17397                .list(self.0.request, self.0.options)
17398                .await
17399                .map(gax::response::Response::into_body)
17400        }
17401
17402        /// Streams each page in the collection.
17403        pub fn by_page(
17404            self,
17405        ) -> impl gax::paginator::Paginator<crate::model::OperationList, gax::error::Error>
17406        {
17407            use std::clone::Clone;
17408            let token = self.0.request.page_token.clone().unwrap_or_default();
17409            let execute = move |token: String| {
17410                let mut builder = self.clone();
17411                builder.0.request = builder.0.request.set_page_token(token);
17412                builder.send()
17413            };
17414            gax::paginator::internal::new_paginator(token, execute)
17415        }
17416
17417        /// Streams each item in the collection.
17418        pub fn by_item(
17419            self,
17420        ) -> impl gax::paginator::ItemPaginator<crate::model::OperationList, gax::error::Error>
17421        {
17422            use gax::paginator::Paginator;
17423            self.by_page().items()
17424        }
17425
17426        /// Sets the value of [filter][crate::model::region_operations::ListRequest::filter].
17427        pub fn set_filter<T>(mut self, v: T) -> Self
17428        where
17429            T: std::convert::Into<std::string::String>,
17430        {
17431            self.0.request.filter = std::option::Option::Some(v.into());
17432            self
17433        }
17434
17435        /// Sets or clears the value of [filter][crate::model::region_operations::ListRequest::filter].
17436        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
17437        where
17438            T: std::convert::Into<std::string::String>,
17439        {
17440            self.0.request.filter = v.map(|x| x.into());
17441            self
17442        }
17443
17444        /// Sets the value of [max_results][crate::model::region_operations::ListRequest::max_results].
17445        pub fn set_max_results<T>(mut self, v: T) -> Self
17446        where
17447            T: std::convert::Into<u32>,
17448        {
17449            self.0.request.max_results = std::option::Option::Some(v.into());
17450            self
17451        }
17452
17453        /// Sets or clears the value of [max_results][crate::model::region_operations::ListRequest::max_results].
17454        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
17455        where
17456            T: std::convert::Into<u32>,
17457        {
17458            self.0.request.max_results = v.map(|x| x.into());
17459            self
17460        }
17461
17462        /// Sets the value of [order_by][crate::model::region_operations::ListRequest::order_by].
17463        pub fn set_order_by<T>(mut self, v: T) -> Self
17464        where
17465            T: std::convert::Into<std::string::String>,
17466        {
17467            self.0.request.order_by = std::option::Option::Some(v.into());
17468            self
17469        }
17470
17471        /// Sets or clears the value of [order_by][crate::model::region_operations::ListRequest::order_by].
17472        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
17473        where
17474            T: std::convert::Into<std::string::String>,
17475        {
17476            self.0.request.order_by = v.map(|x| x.into());
17477            self
17478        }
17479
17480        /// Sets the value of [page_token][crate::model::region_operations::ListRequest::page_token].
17481        pub fn set_page_token<T>(mut self, v: T) -> Self
17482        where
17483            T: std::convert::Into<std::string::String>,
17484        {
17485            self.0.request.page_token = std::option::Option::Some(v.into());
17486            self
17487        }
17488
17489        /// Sets or clears the value of [page_token][crate::model::region_operations::ListRequest::page_token].
17490        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
17491        where
17492            T: std::convert::Into<std::string::String>,
17493        {
17494            self.0.request.page_token = v.map(|x| x.into());
17495            self
17496        }
17497
17498        /// Sets the value of [project][crate::model::region_operations::ListRequest::project].
17499        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17500            self.0.request.project = v.into();
17501            self
17502        }
17503
17504        /// Sets the value of [region][crate::model::region_operations::ListRequest::region].
17505        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17506            self.0.request.region = v.into();
17507            self
17508        }
17509
17510        /// Sets the value of [return_partial_success][crate::model::region_operations::ListRequest::return_partial_success].
17511        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
17512        where
17513            T: std::convert::Into<bool>,
17514        {
17515            self.0.request.return_partial_success = std::option::Option::Some(v.into());
17516            self
17517        }
17518
17519        /// Sets or clears the value of [return_partial_success][crate::model::region_operations::ListRequest::return_partial_success].
17520        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
17521        where
17522            T: std::convert::Into<bool>,
17523        {
17524            self.0.request.return_partial_success = v.map(|x| x.into());
17525            self
17526        }
17527    }
17528
17529    #[doc(hidden)]
17530    impl gax::options::internal::RequestBuilder for List {
17531        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17532            &mut self.0.options
17533        }
17534    }
17535
17536    /// The request builder for [RegionOperations::wait][crate::client::RegionOperations::wait] calls.
17537    ///
17538    /// # Example
17539    /// ```no_run
17540    /// # use google_cloud_compute_v1::builder;
17541    /// use builder::region_operations::Wait;
17542    /// # tokio_test::block_on(async {
17543    ///
17544    /// let builder = prepare_request_builder();
17545    /// let response = builder.send().await?;
17546    /// # gax::Result::<()>::Ok(()) });
17547    ///
17548    /// fn prepare_request_builder() -> Wait {
17549    ///   # panic!();
17550    ///   // ... details omitted ...
17551    /// }
17552    /// ```
17553    #[derive(Clone, Debug)]
17554    pub struct Wait(RequestBuilder<crate::model::region_operations::WaitRequest>);
17555
17556    impl Wait {
17557        pub(crate) fn new(
17558            stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17559        ) -> Self {
17560            Self(RequestBuilder::new(stub))
17561        }
17562
17563        /// Sets the full request, replacing any prior values.
17564        pub fn with_request<V: Into<crate::model::region_operations::WaitRequest>>(
17565            mut self,
17566            v: V,
17567        ) -> Self {
17568            self.0.request = v.into();
17569            self
17570        }
17571
17572        /// Sets all the options, replacing any prior values.
17573        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17574            self.0.options = v.into();
17575            self
17576        }
17577
17578        /// Sends the request.
17579        pub async fn send(self) -> Result<crate::model::Operation> {
17580            (*self.0.stub)
17581                .wait(self.0.request, self.0.options)
17582                .await
17583                .map(gax::response::Response::into_body)
17584        }
17585
17586        /// Sets the value of [operation][crate::model::region_operations::WaitRequest::operation].
17587        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17588            self.0.request.operation = v.into();
17589            self
17590        }
17591
17592        /// Sets the value of [project][crate::model::region_operations::WaitRequest::project].
17593        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17594            self.0.request.project = v.into();
17595            self
17596        }
17597
17598        /// Sets the value of [region][crate::model::region_operations::WaitRequest::region].
17599        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17600            self.0.request.region = v.into();
17601            self
17602        }
17603    }
17604
17605    #[doc(hidden)]
17606    impl gax::options::internal::RequestBuilder for Wait {
17607        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17608            &mut self.0.options
17609        }
17610    }
17611}
17612
17613#[cfg(feature = "zone-operations")]
17614#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
17615pub mod zone_operations {
17616    use crate::Result;
17617
17618    /// A builder for [ZoneOperations][crate::client::ZoneOperations].
17619    ///
17620    /// ```
17621    /// # tokio_test::block_on(async {
17622    /// # use google_cloud_compute_v1::*;
17623    /// # use builder::zone_operations::ClientBuilder;
17624    /// # use client::ZoneOperations;
17625    /// let builder : ClientBuilder = ZoneOperations::builder();
17626    /// let client = builder
17627    ///     .with_endpoint("https://compute.googleapis.com")
17628    ///     .build().await?;
17629    /// # gax::client_builder::Result::<()>::Ok(()) });
17630    /// ```
17631    pub type ClientBuilder =
17632        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17633
17634    pub(crate) mod client {
17635        use super::super::super::client::ZoneOperations;
17636        pub struct Factory;
17637        impl gax::client_builder::internal::ClientFactory for Factory {
17638            type Client = ZoneOperations;
17639            type Credentials = gaxi::options::Credentials;
17640            async fn build(
17641                self,
17642                config: gaxi::options::ClientConfig,
17643            ) -> gax::client_builder::Result<Self::Client> {
17644                Self::Client::new(config).await
17645            }
17646        }
17647    }
17648
17649    /// Common implementation for [crate::client::ZoneOperations] request builders.
17650    #[derive(Clone, Debug)]
17651    pub(crate) struct RequestBuilder<R: std::default::Default> {
17652        stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17653        request: R,
17654        options: gax::options::RequestOptions,
17655    }
17656
17657    impl<R> RequestBuilder<R>
17658    where
17659        R: std::default::Default,
17660    {
17661        pub(crate) fn new(
17662            stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17663        ) -> Self {
17664            Self {
17665                stub,
17666                request: R::default(),
17667                options: gax::options::RequestOptions::default(),
17668            }
17669        }
17670    }
17671
17672    /// The request builder for [ZoneOperations::delete][crate::client::ZoneOperations::delete] calls.
17673    ///
17674    /// # Example
17675    /// ```no_run
17676    /// # use google_cloud_compute_v1::builder;
17677    /// use builder::zone_operations::Delete;
17678    /// # tokio_test::block_on(async {
17679    ///
17680    /// let builder = prepare_request_builder();
17681    /// let response = builder.send().await?;
17682    /// # gax::Result::<()>::Ok(()) });
17683    ///
17684    /// fn prepare_request_builder() -> Delete {
17685    ///   # panic!();
17686    ///   // ... details omitted ...
17687    /// }
17688    /// ```
17689    #[derive(Clone, Debug)]
17690    pub struct Delete(RequestBuilder<crate::model::zone_operations::DeleteRequest>);
17691
17692    impl Delete {
17693        pub(crate) fn new(
17694            stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17695        ) -> Self {
17696            Self(RequestBuilder::new(stub))
17697        }
17698
17699        /// Sets the full request, replacing any prior values.
17700        pub fn with_request<V: Into<crate::model::zone_operations::DeleteRequest>>(
17701            mut self,
17702            v: V,
17703        ) -> Self {
17704            self.0.request = v.into();
17705            self
17706        }
17707
17708        /// Sets all the options, replacing any prior values.
17709        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17710            self.0.options = v.into();
17711            self
17712        }
17713
17714        /// Sends the request.
17715        pub async fn send(self) -> Result<wkt::Empty> {
17716            (*self.0.stub)
17717                .delete(self.0.request, self.0.options)
17718                .await
17719                .map(gax::response::Response::into_body)
17720        }
17721
17722        /// Sets the value of [operation][crate::model::zone_operations::DeleteRequest::operation].
17723        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17724            self.0.request.operation = v.into();
17725            self
17726        }
17727
17728        /// Sets the value of [project][crate::model::zone_operations::DeleteRequest::project].
17729        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17730            self.0.request.project = v.into();
17731            self
17732        }
17733
17734        /// Sets the value of [zone][crate::model::zone_operations::DeleteRequest::zone].
17735        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
17736            self.0.request.zone = v.into();
17737            self
17738        }
17739    }
17740
17741    #[doc(hidden)]
17742    impl gax::options::internal::RequestBuilder for Delete {
17743        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17744            &mut self.0.options
17745        }
17746    }
17747
17748    /// The request builder for [ZoneOperations::get][crate::client::ZoneOperations::get] calls.
17749    ///
17750    /// # Example
17751    /// ```no_run
17752    /// # use google_cloud_compute_v1::builder;
17753    /// use builder::zone_operations::Get;
17754    /// # tokio_test::block_on(async {
17755    ///
17756    /// let builder = prepare_request_builder();
17757    /// let response = builder.send().await?;
17758    /// # gax::Result::<()>::Ok(()) });
17759    ///
17760    /// fn prepare_request_builder() -> Get {
17761    ///   # panic!();
17762    ///   // ... details omitted ...
17763    /// }
17764    /// ```
17765    #[derive(Clone, Debug)]
17766    pub struct Get(RequestBuilder<crate::model::zone_operations::GetRequest>);
17767
17768    impl Get {
17769        pub(crate) fn new(
17770            stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17771        ) -> Self {
17772            Self(RequestBuilder::new(stub))
17773        }
17774
17775        /// Sets the full request, replacing any prior values.
17776        pub fn with_request<V: Into<crate::model::zone_operations::GetRequest>>(
17777            mut self,
17778            v: V,
17779        ) -> Self {
17780            self.0.request = v.into();
17781            self
17782        }
17783
17784        /// Sets all the options, replacing any prior values.
17785        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17786            self.0.options = v.into();
17787            self
17788        }
17789
17790        /// Sends the request.
17791        pub async fn send(self) -> Result<crate::model::Operation> {
17792            (*self.0.stub)
17793                .get(self.0.request, self.0.options)
17794                .await
17795                .map(gax::response::Response::into_body)
17796        }
17797
17798        /// Sets the value of [operation][crate::model::zone_operations::GetRequest::operation].
17799        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17800            self.0.request.operation = v.into();
17801            self
17802        }
17803
17804        /// Sets the value of [project][crate::model::zone_operations::GetRequest::project].
17805        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17806            self.0.request.project = v.into();
17807            self
17808        }
17809
17810        /// Sets the value of [zone][crate::model::zone_operations::GetRequest::zone].
17811        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
17812            self.0.request.zone = v.into();
17813            self
17814        }
17815    }
17816
17817    #[doc(hidden)]
17818    impl gax::options::internal::RequestBuilder for Get {
17819        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17820            &mut self.0.options
17821        }
17822    }
17823
17824    /// The request builder for [ZoneOperations::list][crate::client::ZoneOperations::list] calls.
17825    ///
17826    /// # Example
17827    /// ```no_run
17828    /// # use google_cloud_compute_v1::builder;
17829    /// use builder::zone_operations::List;
17830    /// # tokio_test::block_on(async {
17831    /// use gax::paginator::ItemPaginator;
17832    ///
17833    /// let builder = prepare_request_builder();
17834    /// let mut items = builder.by_item();
17835    /// while let Some(result) = items.next().await {
17836    ///   let item = result?;
17837    /// }
17838    /// # gax::Result::<()>::Ok(()) });
17839    ///
17840    /// fn prepare_request_builder() -> List {
17841    ///   # panic!();
17842    ///   // ... details omitted ...
17843    /// }
17844    /// ```
17845    #[derive(Clone, Debug)]
17846    pub struct List(RequestBuilder<crate::model::zone_operations::ListRequest>);
17847
17848    impl List {
17849        pub(crate) fn new(
17850            stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17851        ) -> Self {
17852            Self(RequestBuilder::new(stub))
17853        }
17854
17855        /// Sets the full request, replacing any prior values.
17856        pub fn with_request<V: Into<crate::model::zone_operations::ListRequest>>(
17857            mut self,
17858            v: V,
17859        ) -> Self {
17860            self.0.request = v.into();
17861            self
17862        }
17863
17864        /// Sets all the options, replacing any prior values.
17865        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17866            self.0.options = v.into();
17867            self
17868        }
17869
17870        /// Sends the request.
17871        pub async fn send(self) -> Result<crate::model::OperationList> {
17872            (*self.0.stub)
17873                .list(self.0.request, self.0.options)
17874                .await
17875                .map(gax::response::Response::into_body)
17876        }
17877
17878        /// Streams each page in the collection.
17879        pub fn by_page(
17880            self,
17881        ) -> impl gax::paginator::Paginator<crate::model::OperationList, gax::error::Error>
17882        {
17883            use std::clone::Clone;
17884            let token = self.0.request.page_token.clone().unwrap_or_default();
17885            let execute = move |token: String| {
17886                let mut builder = self.clone();
17887                builder.0.request = builder.0.request.set_page_token(token);
17888                builder.send()
17889            };
17890            gax::paginator::internal::new_paginator(token, execute)
17891        }
17892
17893        /// Streams each item in the collection.
17894        pub fn by_item(
17895            self,
17896        ) -> impl gax::paginator::ItemPaginator<crate::model::OperationList, gax::error::Error>
17897        {
17898            use gax::paginator::Paginator;
17899            self.by_page().items()
17900        }
17901
17902        /// Sets the value of [filter][crate::model::zone_operations::ListRequest::filter].
17903        pub fn set_filter<T>(mut self, v: T) -> Self
17904        where
17905            T: std::convert::Into<std::string::String>,
17906        {
17907            self.0.request.filter = std::option::Option::Some(v.into());
17908            self
17909        }
17910
17911        /// Sets or clears the value of [filter][crate::model::zone_operations::ListRequest::filter].
17912        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
17913        where
17914            T: std::convert::Into<std::string::String>,
17915        {
17916            self.0.request.filter = v.map(|x| x.into());
17917            self
17918        }
17919
17920        /// Sets the value of [max_results][crate::model::zone_operations::ListRequest::max_results].
17921        pub fn set_max_results<T>(mut self, v: T) -> Self
17922        where
17923            T: std::convert::Into<u32>,
17924        {
17925            self.0.request.max_results = std::option::Option::Some(v.into());
17926            self
17927        }
17928
17929        /// Sets or clears the value of [max_results][crate::model::zone_operations::ListRequest::max_results].
17930        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
17931        where
17932            T: std::convert::Into<u32>,
17933        {
17934            self.0.request.max_results = v.map(|x| x.into());
17935            self
17936        }
17937
17938        /// Sets the value of [order_by][crate::model::zone_operations::ListRequest::order_by].
17939        pub fn set_order_by<T>(mut self, v: T) -> Self
17940        where
17941            T: std::convert::Into<std::string::String>,
17942        {
17943            self.0.request.order_by = std::option::Option::Some(v.into());
17944            self
17945        }
17946
17947        /// Sets or clears the value of [order_by][crate::model::zone_operations::ListRequest::order_by].
17948        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
17949        where
17950            T: std::convert::Into<std::string::String>,
17951        {
17952            self.0.request.order_by = v.map(|x| x.into());
17953            self
17954        }
17955
17956        /// Sets the value of [page_token][crate::model::zone_operations::ListRequest::page_token].
17957        pub fn set_page_token<T>(mut self, v: T) -> Self
17958        where
17959            T: std::convert::Into<std::string::String>,
17960        {
17961            self.0.request.page_token = std::option::Option::Some(v.into());
17962            self
17963        }
17964
17965        /// Sets or clears the value of [page_token][crate::model::zone_operations::ListRequest::page_token].
17966        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
17967        where
17968            T: std::convert::Into<std::string::String>,
17969        {
17970            self.0.request.page_token = v.map(|x| x.into());
17971            self
17972        }
17973
17974        /// Sets the value of [project][crate::model::zone_operations::ListRequest::project].
17975        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17976            self.0.request.project = v.into();
17977            self
17978        }
17979
17980        /// Sets the value of [return_partial_success][crate::model::zone_operations::ListRequest::return_partial_success].
17981        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
17982        where
17983            T: std::convert::Into<bool>,
17984        {
17985            self.0.request.return_partial_success = std::option::Option::Some(v.into());
17986            self
17987        }
17988
17989        /// Sets or clears the value of [return_partial_success][crate::model::zone_operations::ListRequest::return_partial_success].
17990        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
17991        where
17992            T: std::convert::Into<bool>,
17993        {
17994            self.0.request.return_partial_success = v.map(|x| x.into());
17995            self
17996        }
17997
17998        /// Sets the value of [zone][crate::model::zone_operations::ListRequest::zone].
17999        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18000            self.0.request.zone = v.into();
18001            self
18002        }
18003    }
18004
18005    #[doc(hidden)]
18006    impl gax::options::internal::RequestBuilder for List {
18007        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18008            &mut self.0.options
18009        }
18010    }
18011
18012    /// The request builder for [ZoneOperations::wait][crate::client::ZoneOperations::wait] calls.
18013    ///
18014    /// # Example
18015    /// ```no_run
18016    /// # use google_cloud_compute_v1::builder;
18017    /// use builder::zone_operations::Wait;
18018    /// # tokio_test::block_on(async {
18019    ///
18020    /// let builder = prepare_request_builder();
18021    /// let response = builder.send().await?;
18022    /// # gax::Result::<()>::Ok(()) });
18023    ///
18024    /// fn prepare_request_builder() -> Wait {
18025    ///   # panic!();
18026    ///   // ... details omitted ...
18027    /// }
18028    /// ```
18029    #[derive(Clone, Debug)]
18030    pub struct Wait(RequestBuilder<crate::model::zone_operations::WaitRequest>);
18031
18032    impl Wait {
18033        pub(crate) fn new(
18034            stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
18035        ) -> Self {
18036            Self(RequestBuilder::new(stub))
18037        }
18038
18039        /// Sets the full request, replacing any prior values.
18040        pub fn with_request<V: Into<crate::model::zone_operations::WaitRequest>>(
18041            mut self,
18042            v: V,
18043        ) -> Self {
18044            self.0.request = v.into();
18045            self
18046        }
18047
18048        /// Sets all the options, replacing any prior values.
18049        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18050            self.0.options = v.into();
18051            self
18052        }
18053
18054        /// Sends the request.
18055        pub async fn send(self) -> Result<crate::model::Operation> {
18056            (*self.0.stub)
18057                .wait(self.0.request, self.0.options)
18058                .await
18059                .map(gax::response::Response::into_body)
18060        }
18061
18062        /// Sets the value of [operation][crate::model::zone_operations::WaitRequest::operation].
18063        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
18064            self.0.request.operation = v.into();
18065            self
18066        }
18067
18068        /// Sets the value of [project][crate::model::zone_operations::WaitRequest::project].
18069        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18070            self.0.request.project = v.into();
18071            self
18072        }
18073
18074        /// Sets the value of [zone][crate::model::zone_operations::WaitRequest::zone].
18075        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18076            self.0.request.zone = v.into();
18077            self
18078        }
18079    }
18080
18081    #[doc(hidden)]
18082    impl gax::options::internal::RequestBuilder for Wait {
18083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18084            &mut self.0.options
18085        }
18086    }
18087}
18088
18089#[cfg(feature = "zones")]
18090#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18091pub mod zones {
18092    use crate::Result;
18093
18094    /// A builder for [Zones][crate::client::Zones].
18095    ///
18096    /// ```
18097    /// # tokio_test::block_on(async {
18098    /// # use google_cloud_compute_v1::*;
18099    /// # use builder::zones::ClientBuilder;
18100    /// # use client::Zones;
18101    /// let builder : ClientBuilder = Zones::builder();
18102    /// let client = builder
18103    ///     .with_endpoint("https://compute.googleapis.com")
18104    ///     .build().await?;
18105    /// # gax::client_builder::Result::<()>::Ok(()) });
18106    /// ```
18107    pub type ClientBuilder =
18108        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
18109
18110    pub(crate) mod client {
18111        use super::super::super::client::Zones;
18112        pub struct Factory;
18113        impl gax::client_builder::internal::ClientFactory for Factory {
18114            type Client = Zones;
18115            type Credentials = gaxi::options::Credentials;
18116            async fn build(
18117                self,
18118                config: gaxi::options::ClientConfig,
18119            ) -> gax::client_builder::Result<Self::Client> {
18120                Self::Client::new(config).await
18121            }
18122        }
18123    }
18124
18125    /// Common implementation for [crate::client::Zones] request builders.
18126    #[derive(Clone, Debug)]
18127    pub(crate) struct RequestBuilder<R: std::default::Default> {
18128        stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>,
18129        request: R,
18130        options: gax::options::RequestOptions,
18131    }
18132
18133    impl<R> RequestBuilder<R>
18134    where
18135        R: std::default::Default,
18136    {
18137        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18138            Self {
18139                stub,
18140                request: R::default(),
18141                options: gax::options::RequestOptions::default(),
18142            }
18143        }
18144    }
18145
18146    /// The request builder for [Zones::get][crate::client::Zones::get] calls.
18147    ///
18148    /// # Example
18149    /// ```no_run
18150    /// # use google_cloud_compute_v1::builder;
18151    /// use builder::zones::Get;
18152    /// # tokio_test::block_on(async {
18153    ///
18154    /// let builder = prepare_request_builder();
18155    /// let response = builder.send().await?;
18156    /// # gax::Result::<()>::Ok(()) });
18157    ///
18158    /// fn prepare_request_builder() -> Get {
18159    ///   # panic!();
18160    ///   // ... details omitted ...
18161    /// }
18162    /// ```
18163    #[derive(Clone, Debug)]
18164    pub struct Get(RequestBuilder<crate::model::zones::GetRequest>);
18165
18166    impl Get {
18167        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18168            Self(RequestBuilder::new(stub))
18169        }
18170
18171        /// Sets the full request, replacing any prior values.
18172        pub fn with_request<V: Into<crate::model::zones::GetRequest>>(mut self, v: V) -> Self {
18173            self.0.request = v.into();
18174            self
18175        }
18176
18177        /// Sets all the options, replacing any prior values.
18178        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18179            self.0.options = v.into();
18180            self
18181        }
18182
18183        /// Sends the request.
18184        pub async fn send(self) -> Result<crate::model::Zone> {
18185            (*self.0.stub)
18186                .get(self.0.request, self.0.options)
18187                .await
18188                .map(gax::response::Response::into_body)
18189        }
18190
18191        /// Sets the value of [project][crate::model::zones::GetRequest::project].
18192        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18193            self.0.request.project = v.into();
18194            self
18195        }
18196
18197        /// Sets the value of [zone][crate::model::zones::GetRequest::zone].
18198        pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18199            self.0.request.zone = v.into();
18200            self
18201        }
18202    }
18203
18204    #[doc(hidden)]
18205    impl gax::options::internal::RequestBuilder for Get {
18206        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18207            &mut self.0.options
18208        }
18209    }
18210
18211    /// The request builder for [Zones::list][crate::client::Zones::list] calls.
18212    ///
18213    /// # Example
18214    /// ```no_run
18215    /// # use google_cloud_compute_v1::builder;
18216    /// use builder::zones::List;
18217    /// # tokio_test::block_on(async {
18218    /// use gax::paginator::ItemPaginator;
18219    ///
18220    /// let builder = prepare_request_builder();
18221    /// let mut items = builder.by_item();
18222    /// while let Some(result) = items.next().await {
18223    ///   let item = result?;
18224    /// }
18225    /// # gax::Result::<()>::Ok(()) });
18226    ///
18227    /// fn prepare_request_builder() -> List {
18228    ///   # panic!();
18229    ///   // ... details omitted ...
18230    /// }
18231    /// ```
18232    #[derive(Clone, Debug)]
18233    pub struct List(RequestBuilder<crate::model::zones::ListRequest>);
18234
18235    impl List {
18236        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18237            Self(RequestBuilder::new(stub))
18238        }
18239
18240        /// Sets the full request, replacing any prior values.
18241        pub fn with_request<V: Into<crate::model::zones::ListRequest>>(mut self, v: V) -> Self {
18242            self.0.request = v.into();
18243            self
18244        }
18245
18246        /// Sets all the options, replacing any prior values.
18247        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18248            self.0.options = v.into();
18249            self
18250        }
18251
18252        /// Sends the request.
18253        pub async fn send(self) -> Result<crate::model::ZoneList> {
18254            (*self.0.stub)
18255                .list(self.0.request, self.0.options)
18256                .await
18257                .map(gax::response::Response::into_body)
18258        }
18259
18260        /// Streams each page in the collection.
18261        pub fn by_page(
18262            self,
18263        ) -> impl gax::paginator::Paginator<crate::model::ZoneList, gax::error::Error> {
18264            use std::clone::Clone;
18265            let token = self.0.request.page_token.clone().unwrap_or_default();
18266            let execute = move |token: String| {
18267                let mut builder = self.clone();
18268                builder.0.request = builder.0.request.set_page_token(token);
18269                builder.send()
18270            };
18271            gax::paginator::internal::new_paginator(token, execute)
18272        }
18273
18274        /// Streams each item in the collection.
18275        pub fn by_item(
18276            self,
18277        ) -> impl gax::paginator::ItemPaginator<crate::model::ZoneList, gax::error::Error> {
18278            use gax::paginator::Paginator;
18279            self.by_page().items()
18280        }
18281
18282        /// Sets the value of [filter][crate::model::zones::ListRequest::filter].
18283        pub fn set_filter<T>(mut self, v: T) -> Self
18284        where
18285            T: std::convert::Into<std::string::String>,
18286        {
18287            self.0.request.filter = std::option::Option::Some(v.into());
18288            self
18289        }
18290
18291        /// Sets or clears the value of [filter][crate::model::zones::ListRequest::filter].
18292        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
18293        where
18294            T: std::convert::Into<std::string::String>,
18295        {
18296            self.0.request.filter = v.map(|x| x.into());
18297            self
18298        }
18299
18300        /// Sets the value of [max_results][crate::model::zones::ListRequest::max_results].
18301        pub fn set_max_results<T>(mut self, v: T) -> Self
18302        where
18303            T: std::convert::Into<u32>,
18304        {
18305            self.0.request.max_results = std::option::Option::Some(v.into());
18306            self
18307        }
18308
18309        /// Sets or clears the value of [max_results][crate::model::zones::ListRequest::max_results].
18310        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
18311        where
18312            T: std::convert::Into<u32>,
18313        {
18314            self.0.request.max_results = v.map(|x| x.into());
18315            self
18316        }
18317
18318        /// Sets the value of [order_by][crate::model::zones::ListRequest::order_by].
18319        pub fn set_order_by<T>(mut self, v: T) -> Self
18320        where
18321            T: std::convert::Into<std::string::String>,
18322        {
18323            self.0.request.order_by = std::option::Option::Some(v.into());
18324            self
18325        }
18326
18327        /// Sets or clears the value of [order_by][crate::model::zones::ListRequest::order_by].
18328        pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
18329        where
18330            T: std::convert::Into<std::string::String>,
18331        {
18332            self.0.request.order_by = v.map(|x| x.into());
18333            self
18334        }
18335
18336        /// Sets the value of [page_token][crate::model::zones::ListRequest::page_token].
18337        pub fn set_page_token<T>(mut self, v: T) -> Self
18338        where
18339            T: std::convert::Into<std::string::String>,
18340        {
18341            self.0.request.page_token = std::option::Option::Some(v.into());
18342            self
18343        }
18344
18345        /// Sets or clears the value of [page_token][crate::model::zones::ListRequest::page_token].
18346        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
18347        where
18348            T: std::convert::Into<std::string::String>,
18349        {
18350            self.0.request.page_token = v.map(|x| x.into());
18351            self
18352        }
18353
18354        /// Sets the value of [project][crate::model::zones::ListRequest::project].
18355        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18356            self.0.request.project = v.into();
18357            self
18358        }
18359
18360        /// Sets the value of [return_partial_success][crate::model::zones::ListRequest::return_partial_success].
18361        pub fn set_return_partial_success<T>(mut self, v: T) -> Self
18362        where
18363            T: std::convert::Into<bool>,
18364        {
18365            self.0.request.return_partial_success = std::option::Option::Some(v.into());
18366            self
18367        }
18368
18369        /// Sets or clears the value of [return_partial_success][crate::model::zones::ListRequest::return_partial_success].
18370        pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
18371        where
18372            T: std::convert::Into<bool>,
18373        {
18374            self.0.request.return_partial_success = v.map(|x| x.into());
18375            self
18376        }
18377    }
18378
18379    #[doc(hidden)]
18380    impl gax::options::internal::RequestBuilder for List {
18381        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18382            &mut self.0.options
18383        }
18384    }
18385}