google_cloud_baremetalsolution_v2/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod bare_metal_solution {
18    use crate::Result;
19
20    /// A builder for [BareMetalSolution][crate::client::BareMetalSolution].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_baremetalsolution_v2::*;
25    /// # use builder::bare_metal_solution::ClientBuilder;
26    /// # use client::BareMetalSolution;
27    /// let builder : ClientBuilder = BareMetalSolution::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://baremetalsolution.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::BareMetalSolution;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = BareMetalSolution;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::BareMetalSolution] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [BareMetalSolution::list_instances][crate::client::BareMetalSolution::list_instances] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_baremetalsolution_v2::builder;
79    /// use builder::bare_metal_solution::ListInstances;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListInstances {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
97
98    impl ListInstances {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
119            (*self.0.stub)
120                .list_instances(self.0.request, self.0.options)
121                .await
122                .map(gax::response::Response::into_body)
123        }
124
125        /// Streams each page in the collection.
126        pub fn by_page(
127            self,
128        ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
129        {
130            use std::clone::Clone;
131            let token = self.0.request.page_token.clone();
132            let execute = move |token: String| {
133                let mut builder = self.clone();
134                builder.0.request = builder.0.request.set_page_token(token);
135                builder.send()
136            };
137            gax::paginator::internal::new_paginator(token, execute)
138        }
139
140        /// Streams each item in the collection.
141        pub fn by_item(
142            self,
143        ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
144        {
145            use gax::paginator::Paginator;
146            self.by_page().items()
147        }
148
149        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
150        ///
151        /// This is a **required** field for requests.
152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153            self.0.request.parent = v.into();
154            self
155        }
156
157        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159            self.0.request.page_size = v.into();
160            self
161        }
162
163        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165            self.0.request.page_token = v.into();
166            self
167        }
168
169        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
170        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.filter = v.into();
172            self
173        }
174    }
175
176    #[doc(hidden)]
177    impl gax::options::internal::RequestBuilder for ListInstances {
178        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
179            &mut self.0.options
180        }
181    }
182
183    /// The request builder for [BareMetalSolution::get_instance][crate::client::BareMetalSolution::get_instance] calls.
184    ///
185    /// # Example
186    /// ```no_run
187    /// # use google_cloud_baremetalsolution_v2::builder;
188    /// use builder::bare_metal_solution::GetInstance;
189    /// # tokio_test::block_on(async {
190    ///
191    /// let builder = prepare_request_builder();
192    /// let response = builder.send().await?;
193    /// # gax::Result::<()>::Ok(()) });
194    ///
195    /// fn prepare_request_builder() -> GetInstance {
196    ///   # panic!();
197    ///   // ... details omitted ...
198    /// }
199    /// ```
200    #[derive(Clone, Debug)]
201    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
202
203    impl GetInstance {
204        pub(crate) fn new(
205            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
206        ) -> Self {
207            Self(RequestBuilder::new(stub))
208        }
209
210        /// Sets the full request, replacing any prior values.
211        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
212            self.0.request = v.into();
213            self
214        }
215
216        /// Sets all the options, replacing any prior values.
217        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
218            self.0.options = v.into();
219            self
220        }
221
222        /// Sends the request.
223        pub async fn send(self) -> Result<crate::model::Instance> {
224            (*self.0.stub)
225                .get_instance(self.0.request, self.0.options)
226                .await
227                .map(gax::response::Response::into_body)
228        }
229
230        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
231        ///
232        /// This is a **required** field for requests.
233        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
234            self.0.request.name = v.into();
235            self
236        }
237    }
238
239    #[doc(hidden)]
240    impl gax::options::internal::RequestBuilder for GetInstance {
241        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
242            &mut self.0.options
243        }
244    }
245
246    /// The request builder for [BareMetalSolution::update_instance][crate::client::BareMetalSolution::update_instance] calls.
247    ///
248    /// # Example
249    /// ```no_run
250    /// # use google_cloud_baremetalsolution_v2::builder;
251    /// use builder::bare_metal_solution::UpdateInstance;
252    /// # tokio_test::block_on(async {
253    /// use lro::Poller;
254    ///
255    /// let builder = prepare_request_builder();
256    /// let response = builder.poller().until_done().await?;
257    /// # gax::Result::<()>::Ok(()) });
258    ///
259    /// fn prepare_request_builder() -> UpdateInstance {
260    ///   # panic!();
261    ///   // ... details omitted ...
262    /// }
263    /// ```
264    #[derive(Clone, Debug)]
265    pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
266
267    impl UpdateInstance {
268        pub(crate) fn new(
269            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
270        ) -> Self {
271            Self(RequestBuilder::new(stub))
272        }
273
274        /// Sets the full request, replacing any prior values.
275        pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
276            self.0.request = v.into();
277            self
278        }
279
280        /// Sets all the options, replacing any prior values.
281        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
282            self.0.options = v.into();
283            self
284        }
285
286        /// Sends the request.
287        ///
288        /// # Long running operations
289        ///
290        /// This starts, but does not poll, a longrunning operation. More information
291        /// on [update_instance][crate::client::BareMetalSolution::update_instance].
292        pub async fn send(self) -> Result<longrunning::model::Operation> {
293            (*self.0.stub)
294                .update_instance(self.0.request, self.0.options)
295                .await
296                .map(gax::response::Response::into_body)
297        }
298
299        /// Creates a [Poller][lro::Poller] to work with `update_instance`.
300        pub fn poller(
301            self,
302        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
303            type Operation =
304                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
305            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
306            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
307
308            let stub = self.0.stub.clone();
309            let mut options = self.0.options.clone();
310            options.set_retry_policy(gax::retry_policy::NeverRetry);
311            let query = move |name| {
312                let stub = stub.clone();
313                let options = options.clone();
314                async {
315                    let op = GetOperation::new(stub)
316                        .set_name(name)
317                        .with_options(options)
318                        .send()
319                        .await?;
320                    Ok(Operation::new(op))
321                }
322            };
323
324            let start = move || async {
325                let op = self.send().await?;
326                Ok(Operation::new(op))
327            };
328
329            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
330        }
331
332        /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
333        ///
334        /// This is a **required** field for requests.
335        pub fn set_instance<T>(mut self, v: T) -> Self
336        where
337            T: std::convert::Into<crate::model::Instance>,
338        {
339            self.0.request.instance = std::option::Option::Some(v.into());
340            self
341        }
342
343        /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
344        ///
345        /// This is a **required** field for requests.
346        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
347        where
348            T: std::convert::Into<crate::model::Instance>,
349        {
350            self.0.request.instance = v.map(|x| x.into());
351            self
352        }
353
354        /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
355        pub fn set_update_mask<T>(mut self, v: T) -> Self
356        where
357            T: std::convert::Into<wkt::FieldMask>,
358        {
359            self.0.request.update_mask = std::option::Option::Some(v.into());
360            self
361        }
362
363        /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
364        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
365        where
366            T: std::convert::Into<wkt::FieldMask>,
367        {
368            self.0.request.update_mask = v.map(|x| x.into());
369            self
370        }
371    }
372
373    #[doc(hidden)]
374    impl gax::options::internal::RequestBuilder for UpdateInstance {
375        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
376            &mut self.0.options
377        }
378    }
379
380    /// The request builder for [BareMetalSolution::rename_instance][crate::client::BareMetalSolution::rename_instance] calls.
381    ///
382    /// # Example
383    /// ```no_run
384    /// # use google_cloud_baremetalsolution_v2::builder;
385    /// use builder::bare_metal_solution::RenameInstance;
386    /// # tokio_test::block_on(async {
387    ///
388    /// let builder = prepare_request_builder();
389    /// let response = builder.send().await?;
390    /// # gax::Result::<()>::Ok(()) });
391    ///
392    /// fn prepare_request_builder() -> RenameInstance {
393    ///   # panic!();
394    ///   // ... details omitted ...
395    /// }
396    /// ```
397    #[derive(Clone, Debug)]
398    pub struct RenameInstance(RequestBuilder<crate::model::RenameInstanceRequest>);
399
400    impl RenameInstance {
401        pub(crate) fn new(
402            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
403        ) -> Self {
404            Self(RequestBuilder::new(stub))
405        }
406
407        /// Sets the full request, replacing any prior values.
408        pub fn with_request<V: Into<crate::model::RenameInstanceRequest>>(mut self, v: V) -> Self {
409            self.0.request = v.into();
410            self
411        }
412
413        /// Sets all the options, replacing any prior values.
414        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
415            self.0.options = v.into();
416            self
417        }
418
419        /// Sends the request.
420        pub async fn send(self) -> Result<crate::model::Instance> {
421            (*self.0.stub)
422                .rename_instance(self.0.request, self.0.options)
423                .await
424                .map(gax::response::Response::into_body)
425        }
426
427        /// Sets the value of [name][crate::model::RenameInstanceRequest::name].
428        ///
429        /// This is a **required** field for requests.
430        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
431            self.0.request.name = v.into();
432            self
433        }
434
435        /// Sets the value of [new_instance_id][crate::model::RenameInstanceRequest::new_instance_id].
436        ///
437        /// This is a **required** field for requests.
438        pub fn set_new_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
439            self.0.request.new_instance_id = v.into();
440            self
441        }
442    }
443
444    #[doc(hidden)]
445    impl gax::options::internal::RequestBuilder for RenameInstance {
446        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
447            &mut self.0.options
448        }
449    }
450
451    /// The request builder for [BareMetalSolution::reset_instance][crate::client::BareMetalSolution::reset_instance] calls.
452    ///
453    /// # Example
454    /// ```no_run
455    /// # use google_cloud_baremetalsolution_v2::builder;
456    /// use builder::bare_metal_solution::ResetInstance;
457    /// # tokio_test::block_on(async {
458    /// use lro::Poller;
459    ///
460    /// let builder = prepare_request_builder();
461    /// let response = builder.poller().until_done().await?;
462    /// # gax::Result::<()>::Ok(()) });
463    ///
464    /// fn prepare_request_builder() -> ResetInstance {
465    ///   # panic!();
466    ///   // ... details omitted ...
467    /// }
468    /// ```
469    #[derive(Clone, Debug)]
470    pub struct ResetInstance(RequestBuilder<crate::model::ResetInstanceRequest>);
471
472    impl ResetInstance {
473        pub(crate) fn new(
474            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
475        ) -> Self {
476            Self(RequestBuilder::new(stub))
477        }
478
479        /// Sets the full request, replacing any prior values.
480        pub fn with_request<V: Into<crate::model::ResetInstanceRequest>>(mut self, v: V) -> Self {
481            self.0.request = v.into();
482            self
483        }
484
485        /// Sets all the options, replacing any prior values.
486        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
487            self.0.options = v.into();
488            self
489        }
490
491        /// Sends the request.
492        ///
493        /// # Long running operations
494        ///
495        /// This starts, but does not poll, a longrunning operation. More information
496        /// on [reset_instance][crate::client::BareMetalSolution::reset_instance].
497        pub async fn send(self) -> Result<longrunning::model::Operation> {
498            (*self.0.stub)
499                .reset_instance(self.0.request, self.0.options)
500                .await
501                .map(gax::response::Response::into_body)
502        }
503
504        /// Creates a [Poller][lro::Poller] to work with `reset_instance`.
505        pub fn poller(
506            self,
507        ) -> impl lro::Poller<crate::model::ResetInstanceResponse, crate::model::OperationMetadata>
508        {
509            type Operation = lro::internal::Operation<
510                crate::model::ResetInstanceResponse,
511                crate::model::OperationMetadata,
512            >;
513            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
514            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
515
516            let stub = self.0.stub.clone();
517            let mut options = self.0.options.clone();
518            options.set_retry_policy(gax::retry_policy::NeverRetry);
519            let query = move |name| {
520                let stub = stub.clone();
521                let options = options.clone();
522                async {
523                    let op = GetOperation::new(stub)
524                        .set_name(name)
525                        .with_options(options)
526                        .send()
527                        .await?;
528                    Ok(Operation::new(op))
529                }
530            };
531
532            let start = move || async {
533                let op = self.send().await?;
534                Ok(Operation::new(op))
535            };
536
537            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
538        }
539
540        /// Sets the value of [name][crate::model::ResetInstanceRequest::name].
541        ///
542        /// This is a **required** field for requests.
543        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
544            self.0.request.name = v.into();
545            self
546        }
547    }
548
549    #[doc(hidden)]
550    impl gax::options::internal::RequestBuilder for ResetInstance {
551        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
552            &mut self.0.options
553        }
554    }
555
556    /// The request builder for [BareMetalSolution::start_instance][crate::client::BareMetalSolution::start_instance] calls.
557    ///
558    /// # Example
559    /// ```no_run
560    /// # use google_cloud_baremetalsolution_v2::builder;
561    /// use builder::bare_metal_solution::StartInstance;
562    /// # tokio_test::block_on(async {
563    /// use lro::Poller;
564    ///
565    /// let builder = prepare_request_builder();
566    /// let response = builder.poller().until_done().await?;
567    /// # gax::Result::<()>::Ok(()) });
568    ///
569    /// fn prepare_request_builder() -> StartInstance {
570    ///   # panic!();
571    ///   // ... details omitted ...
572    /// }
573    /// ```
574    #[derive(Clone, Debug)]
575    pub struct StartInstance(RequestBuilder<crate::model::StartInstanceRequest>);
576
577    impl StartInstance {
578        pub(crate) fn new(
579            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
580        ) -> Self {
581            Self(RequestBuilder::new(stub))
582        }
583
584        /// Sets the full request, replacing any prior values.
585        pub fn with_request<V: Into<crate::model::StartInstanceRequest>>(mut self, v: V) -> Self {
586            self.0.request = v.into();
587            self
588        }
589
590        /// Sets all the options, replacing any prior values.
591        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
592            self.0.options = v.into();
593            self
594        }
595
596        /// Sends the request.
597        ///
598        /// # Long running operations
599        ///
600        /// This starts, but does not poll, a longrunning operation. More information
601        /// on [start_instance][crate::client::BareMetalSolution::start_instance].
602        pub async fn send(self) -> Result<longrunning::model::Operation> {
603            (*self.0.stub)
604                .start_instance(self.0.request, self.0.options)
605                .await
606                .map(gax::response::Response::into_body)
607        }
608
609        /// Creates a [Poller][lro::Poller] to work with `start_instance`.
610        pub fn poller(
611            self,
612        ) -> impl lro::Poller<crate::model::StartInstanceResponse, crate::model::OperationMetadata>
613        {
614            type Operation = lro::internal::Operation<
615                crate::model::StartInstanceResponse,
616                crate::model::OperationMetadata,
617            >;
618            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
619            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
620
621            let stub = self.0.stub.clone();
622            let mut options = self.0.options.clone();
623            options.set_retry_policy(gax::retry_policy::NeverRetry);
624            let query = move |name| {
625                let stub = stub.clone();
626                let options = options.clone();
627                async {
628                    let op = GetOperation::new(stub)
629                        .set_name(name)
630                        .with_options(options)
631                        .send()
632                        .await?;
633                    Ok(Operation::new(op))
634                }
635            };
636
637            let start = move || async {
638                let op = self.send().await?;
639                Ok(Operation::new(op))
640            };
641
642            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
643        }
644
645        /// Sets the value of [name][crate::model::StartInstanceRequest::name].
646        ///
647        /// This is a **required** field for requests.
648        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
649            self.0.request.name = v.into();
650            self
651        }
652    }
653
654    #[doc(hidden)]
655    impl gax::options::internal::RequestBuilder for StartInstance {
656        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
657            &mut self.0.options
658        }
659    }
660
661    /// The request builder for [BareMetalSolution::stop_instance][crate::client::BareMetalSolution::stop_instance] calls.
662    ///
663    /// # Example
664    /// ```no_run
665    /// # use google_cloud_baremetalsolution_v2::builder;
666    /// use builder::bare_metal_solution::StopInstance;
667    /// # tokio_test::block_on(async {
668    /// use lro::Poller;
669    ///
670    /// let builder = prepare_request_builder();
671    /// let response = builder.poller().until_done().await?;
672    /// # gax::Result::<()>::Ok(()) });
673    ///
674    /// fn prepare_request_builder() -> StopInstance {
675    ///   # panic!();
676    ///   // ... details omitted ...
677    /// }
678    /// ```
679    #[derive(Clone, Debug)]
680    pub struct StopInstance(RequestBuilder<crate::model::StopInstanceRequest>);
681
682    impl StopInstance {
683        pub(crate) fn new(
684            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
685        ) -> Self {
686            Self(RequestBuilder::new(stub))
687        }
688
689        /// Sets the full request, replacing any prior values.
690        pub fn with_request<V: Into<crate::model::StopInstanceRequest>>(mut self, v: V) -> Self {
691            self.0.request = v.into();
692            self
693        }
694
695        /// Sets all the options, replacing any prior values.
696        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
697            self.0.options = v.into();
698            self
699        }
700
701        /// Sends the request.
702        ///
703        /// # Long running operations
704        ///
705        /// This starts, but does not poll, a longrunning operation. More information
706        /// on [stop_instance][crate::client::BareMetalSolution::stop_instance].
707        pub async fn send(self) -> Result<longrunning::model::Operation> {
708            (*self.0.stub)
709                .stop_instance(self.0.request, self.0.options)
710                .await
711                .map(gax::response::Response::into_body)
712        }
713
714        /// Creates a [Poller][lro::Poller] to work with `stop_instance`.
715        pub fn poller(
716            self,
717        ) -> impl lro::Poller<crate::model::StopInstanceResponse, crate::model::OperationMetadata>
718        {
719            type Operation = lro::internal::Operation<
720                crate::model::StopInstanceResponse,
721                crate::model::OperationMetadata,
722            >;
723            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
724            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
725
726            let stub = self.0.stub.clone();
727            let mut options = self.0.options.clone();
728            options.set_retry_policy(gax::retry_policy::NeverRetry);
729            let query = move |name| {
730                let stub = stub.clone();
731                let options = options.clone();
732                async {
733                    let op = GetOperation::new(stub)
734                        .set_name(name)
735                        .with_options(options)
736                        .send()
737                        .await?;
738                    Ok(Operation::new(op))
739                }
740            };
741
742            let start = move || async {
743                let op = self.send().await?;
744                Ok(Operation::new(op))
745            };
746
747            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
748        }
749
750        /// Sets the value of [name][crate::model::StopInstanceRequest::name].
751        ///
752        /// This is a **required** field for requests.
753        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
754            self.0.request.name = v.into();
755            self
756        }
757    }
758
759    #[doc(hidden)]
760    impl gax::options::internal::RequestBuilder for StopInstance {
761        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
762            &mut self.0.options
763        }
764    }
765
766    /// The request builder for [BareMetalSolution::enable_interactive_serial_console][crate::client::BareMetalSolution::enable_interactive_serial_console] calls.
767    ///
768    /// # Example
769    /// ```no_run
770    /// # use google_cloud_baremetalsolution_v2::builder;
771    /// use builder::bare_metal_solution::EnableInteractiveSerialConsole;
772    /// # tokio_test::block_on(async {
773    /// use lro::Poller;
774    ///
775    /// let builder = prepare_request_builder();
776    /// let response = builder.poller().until_done().await?;
777    /// # gax::Result::<()>::Ok(()) });
778    ///
779    /// fn prepare_request_builder() -> EnableInteractiveSerialConsole {
780    ///   # panic!();
781    ///   // ... details omitted ...
782    /// }
783    /// ```
784    #[derive(Clone, Debug)]
785    pub struct EnableInteractiveSerialConsole(
786        RequestBuilder<crate::model::EnableInteractiveSerialConsoleRequest>,
787    );
788
789    impl EnableInteractiveSerialConsole {
790        pub(crate) fn new(
791            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
792        ) -> Self {
793            Self(RequestBuilder::new(stub))
794        }
795
796        /// Sets the full request, replacing any prior values.
797        pub fn with_request<V: Into<crate::model::EnableInteractiveSerialConsoleRequest>>(
798            mut self,
799            v: V,
800        ) -> Self {
801            self.0.request = v.into();
802            self
803        }
804
805        /// Sets all the options, replacing any prior values.
806        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
807            self.0.options = v.into();
808            self
809        }
810
811        /// Sends the request.
812        ///
813        /// # Long running operations
814        ///
815        /// This starts, but does not poll, a longrunning operation. More information
816        /// on [enable_interactive_serial_console][crate::client::BareMetalSolution::enable_interactive_serial_console].
817        pub async fn send(self) -> Result<longrunning::model::Operation> {
818            (*self.0.stub)
819                .enable_interactive_serial_console(self.0.request, self.0.options)
820                .await
821                .map(gax::response::Response::into_body)
822        }
823
824        /// Creates a [Poller][lro::Poller] to work with `enable_interactive_serial_console`.
825        pub fn poller(
826            self,
827        ) -> impl lro::Poller<
828            crate::model::EnableInteractiveSerialConsoleResponse,
829            crate::model::OperationMetadata,
830        > {
831            type Operation = lro::internal::Operation<
832                crate::model::EnableInteractiveSerialConsoleResponse,
833                crate::model::OperationMetadata,
834            >;
835            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
836            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
837
838            let stub = self.0.stub.clone();
839            let mut options = self.0.options.clone();
840            options.set_retry_policy(gax::retry_policy::NeverRetry);
841            let query = move |name| {
842                let stub = stub.clone();
843                let options = options.clone();
844                async {
845                    let op = GetOperation::new(stub)
846                        .set_name(name)
847                        .with_options(options)
848                        .send()
849                        .await?;
850                    Ok(Operation::new(op))
851                }
852            };
853
854            let start = move || async {
855                let op = self.send().await?;
856                Ok(Operation::new(op))
857            };
858
859            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
860        }
861
862        /// Sets the value of [name][crate::model::EnableInteractiveSerialConsoleRequest::name].
863        ///
864        /// This is a **required** field for requests.
865        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
866            self.0.request.name = v.into();
867            self
868        }
869    }
870
871    #[doc(hidden)]
872    impl gax::options::internal::RequestBuilder for EnableInteractiveSerialConsole {
873        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
874            &mut self.0.options
875        }
876    }
877
878    /// The request builder for [BareMetalSolution::disable_interactive_serial_console][crate::client::BareMetalSolution::disable_interactive_serial_console] calls.
879    ///
880    /// # Example
881    /// ```no_run
882    /// # use google_cloud_baremetalsolution_v2::builder;
883    /// use builder::bare_metal_solution::DisableInteractiveSerialConsole;
884    /// # tokio_test::block_on(async {
885    /// use lro::Poller;
886    ///
887    /// let builder = prepare_request_builder();
888    /// let response = builder.poller().until_done().await?;
889    /// # gax::Result::<()>::Ok(()) });
890    ///
891    /// fn prepare_request_builder() -> DisableInteractiveSerialConsole {
892    ///   # panic!();
893    ///   // ... details omitted ...
894    /// }
895    /// ```
896    #[derive(Clone, Debug)]
897    pub struct DisableInteractiveSerialConsole(
898        RequestBuilder<crate::model::DisableInteractiveSerialConsoleRequest>,
899    );
900
901    impl DisableInteractiveSerialConsole {
902        pub(crate) fn new(
903            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
904        ) -> Self {
905            Self(RequestBuilder::new(stub))
906        }
907
908        /// Sets the full request, replacing any prior values.
909        pub fn with_request<V: Into<crate::model::DisableInteractiveSerialConsoleRequest>>(
910            mut self,
911            v: V,
912        ) -> Self {
913            self.0.request = v.into();
914            self
915        }
916
917        /// Sets all the options, replacing any prior values.
918        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
919            self.0.options = v.into();
920            self
921        }
922
923        /// Sends the request.
924        ///
925        /// # Long running operations
926        ///
927        /// This starts, but does not poll, a longrunning operation. More information
928        /// on [disable_interactive_serial_console][crate::client::BareMetalSolution::disable_interactive_serial_console].
929        pub async fn send(self) -> Result<longrunning::model::Operation> {
930            (*self.0.stub)
931                .disable_interactive_serial_console(self.0.request, self.0.options)
932                .await
933                .map(gax::response::Response::into_body)
934        }
935
936        /// Creates a [Poller][lro::Poller] to work with `disable_interactive_serial_console`.
937        pub fn poller(
938            self,
939        ) -> impl lro::Poller<
940            crate::model::DisableInteractiveSerialConsoleResponse,
941            crate::model::OperationMetadata,
942        > {
943            type Operation = lro::internal::Operation<
944                crate::model::DisableInteractiveSerialConsoleResponse,
945                crate::model::OperationMetadata,
946            >;
947            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
948            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
949
950            let stub = self.0.stub.clone();
951            let mut options = self.0.options.clone();
952            options.set_retry_policy(gax::retry_policy::NeverRetry);
953            let query = move |name| {
954                let stub = stub.clone();
955                let options = options.clone();
956                async {
957                    let op = GetOperation::new(stub)
958                        .set_name(name)
959                        .with_options(options)
960                        .send()
961                        .await?;
962                    Ok(Operation::new(op))
963                }
964            };
965
966            let start = move || async {
967                let op = self.send().await?;
968                Ok(Operation::new(op))
969            };
970
971            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
972        }
973
974        /// Sets the value of [name][crate::model::DisableInteractiveSerialConsoleRequest::name].
975        ///
976        /// This is a **required** field for requests.
977        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
978            self.0.request.name = v.into();
979            self
980        }
981    }
982
983    #[doc(hidden)]
984    impl gax::options::internal::RequestBuilder for DisableInteractiveSerialConsole {
985        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
986            &mut self.0.options
987        }
988    }
989
990    /// The request builder for [BareMetalSolution::detach_lun][crate::client::BareMetalSolution::detach_lun] calls.
991    ///
992    /// # Example
993    /// ```no_run
994    /// # use google_cloud_baremetalsolution_v2::builder;
995    /// use builder::bare_metal_solution::DetachLun;
996    /// # tokio_test::block_on(async {
997    /// use lro::Poller;
998    ///
999    /// let builder = prepare_request_builder();
1000    /// let response = builder.poller().until_done().await?;
1001    /// # gax::Result::<()>::Ok(()) });
1002    ///
1003    /// fn prepare_request_builder() -> DetachLun {
1004    ///   # panic!();
1005    ///   // ... details omitted ...
1006    /// }
1007    /// ```
1008    #[derive(Clone, Debug)]
1009    pub struct DetachLun(RequestBuilder<crate::model::DetachLunRequest>);
1010
1011    impl DetachLun {
1012        pub(crate) fn new(
1013            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1014        ) -> Self {
1015            Self(RequestBuilder::new(stub))
1016        }
1017
1018        /// Sets the full request, replacing any prior values.
1019        pub fn with_request<V: Into<crate::model::DetachLunRequest>>(mut self, v: V) -> Self {
1020            self.0.request = v.into();
1021            self
1022        }
1023
1024        /// Sets all the options, replacing any prior values.
1025        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1026            self.0.options = v.into();
1027            self
1028        }
1029
1030        /// Sends the request.
1031        ///
1032        /// # Long running operations
1033        ///
1034        /// This starts, but does not poll, a longrunning operation. More information
1035        /// on [detach_lun][crate::client::BareMetalSolution::detach_lun].
1036        pub async fn send(self) -> Result<longrunning::model::Operation> {
1037            (*self.0.stub)
1038                .detach_lun(self.0.request, self.0.options)
1039                .await
1040                .map(gax::response::Response::into_body)
1041        }
1042
1043        /// Creates a [Poller][lro::Poller] to work with `detach_lun`.
1044        pub fn poller(
1045            self,
1046        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
1047            type Operation =
1048                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
1049            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1050            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1051
1052            let stub = self.0.stub.clone();
1053            let mut options = self.0.options.clone();
1054            options.set_retry_policy(gax::retry_policy::NeverRetry);
1055            let query = move |name| {
1056                let stub = stub.clone();
1057                let options = options.clone();
1058                async {
1059                    let op = GetOperation::new(stub)
1060                        .set_name(name)
1061                        .with_options(options)
1062                        .send()
1063                        .await?;
1064                    Ok(Operation::new(op))
1065                }
1066            };
1067
1068            let start = move || async {
1069                let op = self.send().await?;
1070                Ok(Operation::new(op))
1071            };
1072
1073            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1074        }
1075
1076        /// Sets the value of [instance][crate::model::DetachLunRequest::instance].
1077        ///
1078        /// This is a **required** field for requests.
1079        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080            self.0.request.instance = v.into();
1081            self
1082        }
1083
1084        /// Sets the value of [lun][crate::model::DetachLunRequest::lun].
1085        ///
1086        /// This is a **required** field for requests.
1087        pub fn set_lun<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088            self.0.request.lun = v.into();
1089            self
1090        }
1091
1092        /// Sets the value of [skip_reboot][crate::model::DetachLunRequest::skip_reboot].
1093        pub fn set_skip_reboot<T: Into<bool>>(mut self, v: T) -> Self {
1094            self.0.request.skip_reboot = v.into();
1095            self
1096        }
1097    }
1098
1099    #[doc(hidden)]
1100    impl gax::options::internal::RequestBuilder for DetachLun {
1101        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1102            &mut self.0.options
1103        }
1104    }
1105
1106    /// The request builder for [BareMetalSolution::list_ssh_keys][crate::client::BareMetalSolution::list_ssh_keys] calls.
1107    ///
1108    /// # Example
1109    /// ```no_run
1110    /// # use google_cloud_baremetalsolution_v2::builder;
1111    /// use builder::bare_metal_solution::ListSSHKeys;
1112    /// # tokio_test::block_on(async {
1113    /// use gax::paginator::ItemPaginator;
1114    ///
1115    /// let builder = prepare_request_builder();
1116    /// let mut items = builder.by_item();
1117    /// while let Some(result) = items.next().await {
1118    ///   let item = result?;
1119    /// }
1120    /// # gax::Result::<()>::Ok(()) });
1121    ///
1122    /// fn prepare_request_builder() -> ListSSHKeys {
1123    ///   # panic!();
1124    ///   // ... details omitted ...
1125    /// }
1126    /// ```
1127    #[derive(Clone, Debug)]
1128    pub struct ListSSHKeys(RequestBuilder<crate::model::ListSSHKeysRequest>);
1129
1130    impl ListSSHKeys {
1131        pub(crate) fn new(
1132            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1133        ) -> Self {
1134            Self(RequestBuilder::new(stub))
1135        }
1136
1137        /// Sets the full request, replacing any prior values.
1138        pub fn with_request<V: Into<crate::model::ListSSHKeysRequest>>(mut self, v: V) -> Self {
1139            self.0.request = v.into();
1140            self
1141        }
1142
1143        /// Sets all the options, replacing any prior values.
1144        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1145            self.0.options = v.into();
1146            self
1147        }
1148
1149        /// Sends the request.
1150        pub async fn send(self) -> Result<crate::model::ListSSHKeysResponse> {
1151            (*self.0.stub)
1152                .list_ssh_keys(self.0.request, self.0.options)
1153                .await
1154                .map(gax::response::Response::into_body)
1155        }
1156
1157        /// Streams each page in the collection.
1158        pub fn by_page(
1159            self,
1160        ) -> impl gax::paginator::Paginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1161        {
1162            use std::clone::Clone;
1163            let token = self.0.request.page_token.clone();
1164            let execute = move |token: String| {
1165                let mut builder = self.clone();
1166                builder.0.request = builder.0.request.set_page_token(token);
1167                builder.send()
1168            };
1169            gax::paginator::internal::new_paginator(token, execute)
1170        }
1171
1172        /// Streams each item in the collection.
1173        pub fn by_item(
1174            self,
1175        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1176        {
1177            use gax::paginator::Paginator;
1178            self.by_page().items()
1179        }
1180
1181        /// Sets the value of [parent][crate::model::ListSSHKeysRequest::parent].
1182        ///
1183        /// This is a **required** field for requests.
1184        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185            self.0.request.parent = v.into();
1186            self
1187        }
1188
1189        /// Sets the value of [page_size][crate::model::ListSSHKeysRequest::page_size].
1190        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1191            self.0.request.page_size = v.into();
1192            self
1193        }
1194
1195        /// Sets the value of [page_token][crate::model::ListSSHKeysRequest::page_token].
1196        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1197            self.0.request.page_token = v.into();
1198            self
1199        }
1200    }
1201
1202    #[doc(hidden)]
1203    impl gax::options::internal::RequestBuilder for ListSSHKeys {
1204        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1205            &mut self.0.options
1206        }
1207    }
1208
1209    /// The request builder for [BareMetalSolution::create_ssh_key][crate::client::BareMetalSolution::create_ssh_key] calls.
1210    ///
1211    /// # Example
1212    /// ```no_run
1213    /// # use google_cloud_baremetalsolution_v2::builder;
1214    /// use builder::bare_metal_solution::CreateSSHKey;
1215    /// # tokio_test::block_on(async {
1216    ///
1217    /// let builder = prepare_request_builder();
1218    /// let response = builder.send().await?;
1219    /// # gax::Result::<()>::Ok(()) });
1220    ///
1221    /// fn prepare_request_builder() -> CreateSSHKey {
1222    ///   # panic!();
1223    ///   // ... details omitted ...
1224    /// }
1225    /// ```
1226    #[derive(Clone, Debug)]
1227    pub struct CreateSSHKey(RequestBuilder<crate::model::CreateSSHKeyRequest>);
1228
1229    impl CreateSSHKey {
1230        pub(crate) fn new(
1231            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1232        ) -> Self {
1233            Self(RequestBuilder::new(stub))
1234        }
1235
1236        /// Sets the full request, replacing any prior values.
1237        pub fn with_request<V: Into<crate::model::CreateSSHKeyRequest>>(mut self, v: V) -> Self {
1238            self.0.request = v.into();
1239            self
1240        }
1241
1242        /// Sets all the options, replacing any prior values.
1243        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1244            self.0.options = v.into();
1245            self
1246        }
1247
1248        /// Sends the request.
1249        pub async fn send(self) -> Result<crate::model::SSHKey> {
1250            (*self.0.stub)
1251                .create_ssh_key(self.0.request, self.0.options)
1252                .await
1253                .map(gax::response::Response::into_body)
1254        }
1255
1256        /// Sets the value of [parent][crate::model::CreateSSHKeyRequest::parent].
1257        ///
1258        /// This is a **required** field for requests.
1259        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260            self.0.request.parent = v.into();
1261            self
1262        }
1263
1264        /// Sets the value of [ssh_key][crate::model::CreateSSHKeyRequest::ssh_key].
1265        ///
1266        /// This is a **required** field for requests.
1267        pub fn set_ssh_key<T>(mut self, v: T) -> Self
1268        where
1269            T: std::convert::Into<crate::model::SSHKey>,
1270        {
1271            self.0.request.ssh_key = std::option::Option::Some(v.into());
1272            self
1273        }
1274
1275        /// Sets or clears the value of [ssh_key][crate::model::CreateSSHKeyRequest::ssh_key].
1276        ///
1277        /// This is a **required** field for requests.
1278        pub fn set_or_clear_ssh_key<T>(mut self, v: std::option::Option<T>) -> Self
1279        where
1280            T: std::convert::Into<crate::model::SSHKey>,
1281        {
1282            self.0.request.ssh_key = v.map(|x| x.into());
1283            self
1284        }
1285
1286        /// Sets the value of [ssh_key_id][crate::model::CreateSSHKeyRequest::ssh_key_id].
1287        ///
1288        /// This is a **required** field for requests.
1289        pub fn set_ssh_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1290            self.0.request.ssh_key_id = v.into();
1291            self
1292        }
1293    }
1294
1295    #[doc(hidden)]
1296    impl gax::options::internal::RequestBuilder for CreateSSHKey {
1297        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1298            &mut self.0.options
1299        }
1300    }
1301
1302    /// The request builder for [BareMetalSolution::delete_ssh_key][crate::client::BareMetalSolution::delete_ssh_key] calls.
1303    ///
1304    /// # Example
1305    /// ```no_run
1306    /// # use google_cloud_baremetalsolution_v2::builder;
1307    /// use builder::bare_metal_solution::DeleteSSHKey;
1308    /// # tokio_test::block_on(async {
1309    ///
1310    /// let builder = prepare_request_builder();
1311    /// let response = builder.send().await?;
1312    /// # gax::Result::<()>::Ok(()) });
1313    ///
1314    /// fn prepare_request_builder() -> DeleteSSHKey {
1315    ///   # panic!();
1316    ///   // ... details omitted ...
1317    /// }
1318    /// ```
1319    #[derive(Clone, Debug)]
1320    pub struct DeleteSSHKey(RequestBuilder<crate::model::DeleteSSHKeyRequest>);
1321
1322    impl DeleteSSHKey {
1323        pub(crate) fn new(
1324            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1325        ) -> Self {
1326            Self(RequestBuilder::new(stub))
1327        }
1328
1329        /// Sets the full request, replacing any prior values.
1330        pub fn with_request<V: Into<crate::model::DeleteSSHKeyRequest>>(mut self, v: V) -> Self {
1331            self.0.request = v.into();
1332            self
1333        }
1334
1335        /// Sets all the options, replacing any prior values.
1336        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1337            self.0.options = v.into();
1338            self
1339        }
1340
1341        /// Sends the request.
1342        pub async fn send(self) -> Result<()> {
1343            (*self.0.stub)
1344                .delete_ssh_key(self.0.request, self.0.options)
1345                .await
1346                .map(gax::response::Response::into_body)
1347        }
1348
1349        /// Sets the value of [name][crate::model::DeleteSSHKeyRequest::name].
1350        ///
1351        /// This is a **required** field for requests.
1352        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1353            self.0.request.name = v.into();
1354            self
1355        }
1356    }
1357
1358    #[doc(hidden)]
1359    impl gax::options::internal::RequestBuilder for DeleteSSHKey {
1360        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1361            &mut self.0.options
1362        }
1363    }
1364
1365    /// The request builder for [BareMetalSolution::list_volumes][crate::client::BareMetalSolution::list_volumes] calls.
1366    ///
1367    /// # Example
1368    /// ```no_run
1369    /// # use google_cloud_baremetalsolution_v2::builder;
1370    /// use builder::bare_metal_solution::ListVolumes;
1371    /// # tokio_test::block_on(async {
1372    /// use gax::paginator::ItemPaginator;
1373    ///
1374    /// let builder = prepare_request_builder();
1375    /// let mut items = builder.by_item();
1376    /// while let Some(result) = items.next().await {
1377    ///   let item = result?;
1378    /// }
1379    /// # gax::Result::<()>::Ok(()) });
1380    ///
1381    /// fn prepare_request_builder() -> ListVolumes {
1382    ///   # panic!();
1383    ///   // ... details omitted ...
1384    /// }
1385    /// ```
1386    #[derive(Clone, Debug)]
1387    pub struct ListVolumes(RequestBuilder<crate::model::ListVolumesRequest>);
1388
1389    impl ListVolumes {
1390        pub(crate) fn new(
1391            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1392        ) -> Self {
1393            Self(RequestBuilder::new(stub))
1394        }
1395
1396        /// Sets the full request, replacing any prior values.
1397        pub fn with_request<V: Into<crate::model::ListVolumesRequest>>(mut self, v: V) -> Self {
1398            self.0.request = v.into();
1399            self
1400        }
1401
1402        /// Sets all the options, replacing any prior values.
1403        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1404            self.0.options = v.into();
1405            self
1406        }
1407
1408        /// Sends the request.
1409        pub async fn send(self) -> Result<crate::model::ListVolumesResponse> {
1410            (*self.0.stub)
1411                .list_volumes(self.0.request, self.0.options)
1412                .await
1413                .map(gax::response::Response::into_body)
1414        }
1415
1416        /// Streams each page in the collection.
1417        pub fn by_page(
1418            self,
1419        ) -> impl gax::paginator::Paginator<crate::model::ListVolumesResponse, gax::error::Error>
1420        {
1421            use std::clone::Clone;
1422            let token = self.0.request.page_token.clone();
1423            let execute = move |token: String| {
1424                let mut builder = self.clone();
1425                builder.0.request = builder.0.request.set_page_token(token);
1426                builder.send()
1427            };
1428            gax::paginator::internal::new_paginator(token, execute)
1429        }
1430
1431        /// Streams each item in the collection.
1432        pub fn by_item(
1433            self,
1434        ) -> impl gax::paginator::ItemPaginator<crate::model::ListVolumesResponse, gax::error::Error>
1435        {
1436            use gax::paginator::Paginator;
1437            self.by_page().items()
1438        }
1439
1440        /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
1441        ///
1442        /// This is a **required** field for requests.
1443        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1444            self.0.request.parent = v.into();
1445            self
1446        }
1447
1448        /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
1449        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1450            self.0.request.page_size = v.into();
1451            self
1452        }
1453
1454        /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
1455        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1456            self.0.request.page_token = v.into();
1457            self
1458        }
1459
1460        /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
1461        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462            self.0.request.filter = v.into();
1463            self
1464        }
1465    }
1466
1467    #[doc(hidden)]
1468    impl gax::options::internal::RequestBuilder for ListVolumes {
1469        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1470            &mut self.0.options
1471        }
1472    }
1473
1474    /// The request builder for [BareMetalSolution::get_volume][crate::client::BareMetalSolution::get_volume] calls.
1475    ///
1476    /// # Example
1477    /// ```no_run
1478    /// # use google_cloud_baremetalsolution_v2::builder;
1479    /// use builder::bare_metal_solution::GetVolume;
1480    /// # tokio_test::block_on(async {
1481    ///
1482    /// let builder = prepare_request_builder();
1483    /// let response = builder.send().await?;
1484    /// # gax::Result::<()>::Ok(()) });
1485    ///
1486    /// fn prepare_request_builder() -> GetVolume {
1487    ///   # panic!();
1488    ///   // ... details omitted ...
1489    /// }
1490    /// ```
1491    #[derive(Clone, Debug)]
1492    pub struct GetVolume(RequestBuilder<crate::model::GetVolumeRequest>);
1493
1494    impl GetVolume {
1495        pub(crate) fn new(
1496            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1497        ) -> Self {
1498            Self(RequestBuilder::new(stub))
1499        }
1500
1501        /// Sets the full request, replacing any prior values.
1502        pub fn with_request<V: Into<crate::model::GetVolumeRequest>>(mut self, v: V) -> Self {
1503            self.0.request = v.into();
1504            self
1505        }
1506
1507        /// Sets all the options, replacing any prior values.
1508        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1509            self.0.options = v.into();
1510            self
1511        }
1512
1513        /// Sends the request.
1514        pub async fn send(self) -> Result<crate::model::Volume> {
1515            (*self.0.stub)
1516                .get_volume(self.0.request, self.0.options)
1517                .await
1518                .map(gax::response::Response::into_body)
1519        }
1520
1521        /// Sets the value of [name][crate::model::GetVolumeRequest::name].
1522        ///
1523        /// This is a **required** field for requests.
1524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525            self.0.request.name = v.into();
1526            self
1527        }
1528    }
1529
1530    #[doc(hidden)]
1531    impl gax::options::internal::RequestBuilder for GetVolume {
1532        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1533            &mut self.0.options
1534        }
1535    }
1536
1537    /// The request builder for [BareMetalSolution::update_volume][crate::client::BareMetalSolution::update_volume] calls.
1538    ///
1539    /// # Example
1540    /// ```no_run
1541    /// # use google_cloud_baremetalsolution_v2::builder;
1542    /// use builder::bare_metal_solution::UpdateVolume;
1543    /// # tokio_test::block_on(async {
1544    /// use lro::Poller;
1545    ///
1546    /// let builder = prepare_request_builder();
1547    /// let response = builder.poller().until_done().await?;
1548    /// # gax::Result::<()>::Ok(()) });
1549    ///
1550    /// fn prepare_request_builder() -> UpdateVolume {
1551    ///   # panic!();
1552    ///   // ... details omitted ...
1553    /// }
1554    /// ```
1555    #[derive(Clone, Debug)]
1556    pub struct UpdateVolume(RequestBuilder<crate::model::UpdateVolumeRequest>);
1557
1558    impl UpdateVolume {
1559        pub(crate) fn new(
1560            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1561        ) -> Self {
1562            Self(RequestBuilder::new(stub))
1563        }
1564
1565        /// Sets the full request, replacing any prior values.
1566        pub fn with_request<V: Into<crate::model::UpdateVolumeRequest>>(mut self, v: V) -> Self {
1567            self.0.request = v.into();
1568            self
1569        }
1570
1571        /// Sets all the options, replacing any prior values.
1572        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1573            self.0.options = v.into();
1574            self
1575        }
1576
1577        /// Sends the request.
1578        ///
1579        /// # Long running operations
1580        ///
1581        /// This starts, but does not poll, a longrunning operation. More information
1582        /// on [update_volume][crate::client::BareMetalSolution::update_volume].
1583        pub async fn send(self) -> Result<longrunning::model::Operation> {
1584            (*self.0.stub)
1585                .update_volume(self.0.request, self.0.options)
1586                .await
1587                .map(gax::response::Response::into_body)
1588        }
1589
1590        /// Creates a [Poller][lro::Poller] to work with `update_volume`.
1591        pub fn poller(
1592            self,
1593        ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1594            type Operation =
1595                lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1596            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1597            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1598
1599            let stub = self.0.stub.clone();
1600            let mut options = self.0.options.clone();
1601            options.set_retry_policy(gax::retry_policy::NeverRetry);
1602            let query = move |name| {
1603                let stub = stub.clone();
1604                let options = options.clone();
1605                async {
1606                    let op = GetOperation::new(stub)
1607                        .set_name(name)
1608                        .with_options(options)
1609                        .send()
1610                        .await?;
1611                    Ok(Operation::new(op))
1612                }
1613            };
1614
1615            let start = move || async {
1616                let op = self.send().await?;
1617                Ok(Operation::new(op))
1618            };
1619
1620            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1621        }
1622
1623        /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
1624        ///
1625        /// This is a **required** field for requests.
1626        pub fn set_volume<T>(mut self, v: T) -> Self
1627        where
1628            T: std::convert::Into<crate::model::Volume>,
1629        {
1630            self.0.request.volume = std::option::Option::Some(v.into());
1631            self
1632        }
1633
1634        /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
1635        ///
1636        /// This is a **required** field for requests.
1637        pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1638        where
1639            T: std::convert::Into<crate::model::Volume>,
1640        {
1641            self.0.request.volume = v.map(|x| x.into());
1642            self
1643        }
1644
1645        /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
1646        pub fn set_update_mask<T>(mut self, v: T) -> Self
1647        where
1648            T: std::convert::Into<wkt::FieldMask>,
1649        {
1650            self.0.request.update_mask = std::option::Option::Some(v.into());
1651            self
1652        }
1653
1654        /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
1655        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1656        where
1657            T: std::convert::Into<wkt::FieldMask>,
1658        {
1659            self.0.request.update_mask = v.map(|x| x.into());
1660            self
1661        }
1662    }
1663
1664    #[doc(hidden)]
1665    impl gax::options::internal::RequestBuilder for UpdateVolume {
1666        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1667            &mut self.0.options
1668        }
1669    }
1670
1671    /// The request builder for [BareMetalSolution::rename_volume][crate::client::BareMetalSolution::rename_volume] calls.
1672    ///
1673    /// # Example
1674    /// ```no_run
1675    /// # use google_cloud_baremetalsolution_v2::builder;
1676    /// use builder::bare_metal_solution::RenameVolume;
1677    /// # tokio_test::block_on(async {
1678    ///
1679    /// let builder = prepare_request_builder();
1680    /// let response = builder.send().await?;
1681    /// # gax::Result::<()>::Ok(()) });
1682    ///
1683    /// fn prepare_request_builder() -> RenameVolume {
1684    ///   # panic!();
1685    ///   // ... details omitted ...
1686    /// }
1687    /// ```
1688    #[derive(Clone, Debug)]
1689    pub struct RenameVolume(RequestBuilder<crate::model::RenameVolumeRequest>);
1690
1691    impl RenameVolume {
1692        pub(crate) fn new(
1693            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1694        ) -> Self {
1695            Self(RequestBuilder::new(stub))
1696        }
1697
1698        /// Sets the full request, replacing any prior values.
1699        pub fn with_request<V: Into<crate::model::RenameVolumeRequest>>(mut self, v: V) -> Self {
1700            self.0.request = v.into();
1701            self
1702        }
1703
1704        /// Sets all the options, replacing any prior values.
1705        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1706            self.0.options = v.into();
1707            self
1708        }
1709
1710        /// Sends the request.
1711        pub async fn send(self) -> Result<crate::model::Volume> {
1712            (*self.0.stub)
1713                .rename_volume(self.0.request, self.0.options)
1714                .await
1715                .map(gax::response::Response::into_body)
1716        }
1717
1718        /// Sets the value of [name][crate::model::RenameVolumeRequest::name].
1719        ///
1720        /// This is a **required** field for requests.
1721        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1722            self.0.request.name = v.into();
1723            self
1724        }
1725
1726        /// Sets the value of [new_volume_id][crate::model::RenameVolumeRequest::new_volume_id].
1727        ///
1728        /// This is a **required** field for requests.
1729        pub fn set_new_volume_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1730            self.0.request.new_volume_id = v.into();
1731            self
1732        }
1733    }
1734
1735    #[doc(hidden)]
1736    impl gax::options::internal::RequestBuilder for RenameVolume {
1737        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1738            &mut self.0.options
1739        }
1740    }
1741
1742    /// The request builder for [BareMetalSolution::evict_volume][crate::client::BareMetalSolution::evict_volume] calls.
1743    ///
1744    /// # Example
1745    /// ```no_run
1746    /// # use google_cloud_baremetalsolution_v2::builder;
1747    /// use builder::bare_metal_solution::EvictVolume;
1748    /// # tokio_test::block_on(async {
1749    /// use lro::Poller;
1750    ///
1751    /// let builder = prepare_request_builder();
1752    /// let response = builder.poller().until_done().await?;
1753    /// # gax::Result::<()>::Ok(()) });
1754    ///
1755    /// fn prepare_request_builder() -> EvictVolume {
1756    ///   # panic!();
1757    ///   // ... details omitted ...
1758    /// }
1759    /// ```
1760    #[derive(Clone, Debug)]
1761    pub struct EvictVolume(RequestBuilder<crate::model::EvictVolumeRequest>);
1762
1763    impl EvictVolume {
1764        pub(crate) fn new(
1765            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1766        ) -> Self {
1767            Self(RequestBuilder::new(stub))
1768        }
1769
1770        /// Sets the full request, replacing any prior values.
1771        pub fn with_request<V: Into<crate::model::EvictVolumeRequest>>(mut self, v: V) -> Self {
1772            self.0.request = v.into();
1773            self
1774        }
1775
1776        /// Sets all the options, replacing any prior values.
1777        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1778            self.0.options = v.into();
1779            self
1780        }
1781
1782        /// Sends the request.
1783        ///
1784        /// # Long running operations
1785        ///
1786        /// This starts, but does not poll, a longrunning operation. More information
1787        /// on [evict_volume][crate::client::BareMetalSolution::evict_volume].
1788        pub async fn send(self) -> Result<longrunning::model::Operation> {
1789            (*self.0.stub)
1790                .evict_volume(self.0.request, self.0.options)
1791                .await
1792                .map(gax::response::Response::into_body)
1793        }
1794
1795        /// Creates a [Poller][lro::Poller] to work with `evict_volume`.
1796        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1797            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1798            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1799            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1800
1801            let stub = self.0.stub.clone();
1802            let mut options = self.0.options.clone();
1803            options.set_retry_policy(gax::retry_policy::NeverRetry);
1804            let query = move |name| {
1805                let stub = stub.clone();
1806                let options = options.clone();
1807                async {
1808                    let op = GetOperation::new(stub)
1809                        .set_name(name)
1810                        .with_options(options)
1811                        .send()
1812                        .await?;
1813                    Ok(Operation::new(op))
1814                }
1815            };
1816
1817            let start = move || async {
1818                let op = self.send().await?;
1819                Ok(Operation::new(op))
1820            };
1821
1822            lro::internal::new_unit_response_poller(
1823                polling_error_policy,
1824                polling_backoff_policy,
1825                start,
1826                query,
1827            )
1828        }
1829
1830        /// Sets the value of [name][crate::model::EvictVolumeRequest::name].
1831        ///
1832        /// This is a **required** field for requests.
1833        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834            self.0.request.name = v.into();
1835            self
1836        }
1837    }
1838
1839    #[doc(hidden)]
1840    impl gax::options::internal::RequestBuilder for EvictVolume {
1841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1842            &mut self.0.options
1843        }
1844    }
1845
1846    /// The request builder for [BareMetalSolution::resize_volume][crate::client::BareMetalSolution::resize_volume] calls.
1847    ///
1848    /// # Example
1849    /// ```no_run
1850    /// # use google_cloud_baremetalsolution_v2::builder;
1851    /// use builder::bare_metal_solution::ResizeVolume;
1852    /// # tokio_test::block_on(async {
1853    /// use lro::Poller;
1854    ///
1855    /// let builder = prepare_request_builder();
1856    /// let response = builder.poller().until_done().await?;
1857    /// # gax::Result::<()>::Ok(()) });
1858    ///
1859    /// fn prepare_request_builder() -> ResizeVolume {
1860    ///   # panic!();
1861    ///   // ... details omitted ...
1862    /// }
1863    /// ```
1864    #[derive(Clone, Debug)]
1865    pub struct ResizeVolume(RequestBuilder<crate::model::ResizeVolumeRequest>);
1866
1867    impl ResizeVolume {
1868        pub(crate) fn new(
1869            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1870        ) -> Self {
1871            Self(RequestBuilder::new(stub))
1872        }
1873
1874        /// Sets the full request, replacing any prior values.
1875        pub fn with_request<V: Into<crate::model::ResizeVolumeRequest>>(mut self, v: V) -> Self {
1876            self.0.request = v.into();
1877            self
1878        }
1879
1880        /// Sets all the options, replacing any prior values.
1881        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1882            self.0.options = v.into();
1883            self
1884        }
1885
1886        /// Sends the request.
1887        ///
1888        /// # Long running operations
1889        ///
1890        /// This starts, but does not poll, a longrunning operation. More information
1891        /// on [resize_volume][crate::client::BareMetalSolution::resize_volume].
1892        pub async fn send(self) -> Result<longrunning::model::Operation> {
1893            (*self.0.stub)
1894                .resize_volume(self.0.request, self.0.options)
1895                .await
1896                .map(gax::response::Response::into_body)
1897        }
1898
1899        /// Creates a [Poller][lro::Poller] to work with `resize_volume`.
1900        pub fn poller(
1901            self,
1902        ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1903            type Operation =
1904                lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1905            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1906            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1907
1908            let stub = self.0.stub.clone();
1909            let mut options = self.0.options.clone();
1910            options.set_retry_policy(gax::retry_policy::NeverRetry);
1911            let query = move |name| {
1912                let stub = stub.clone();
1913                let options = options.clone();
1914                async {
1915                    let op = GetOperation::new(stub)
1916                        .set_name(name)
1917                        .with_options(options)
1918                        .send()
1919                        .await?;
1920                    Ok(Operation::new(op))
1921                }
1922            };
1923
1924            let start = move || async {
1925                let op = self.send().await?;
1926                Ok(Operation::new(op))
1927            };
1928
1929            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1930        }
1931
1932        /// Sets the value of [volume][crate::model::ResizeVolumeRequest::volume].
1933        ///
1934        /// This is a **required** field for requests.
1935        pub fn set_volume<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936            self.0.request.volume = v.into();
1937            self
1938        }
1939
1940        /// Sets the value of [size_gib][crate::model::ResizeVolumeRequest::size_gib].
1941        pub fn set_size_gib<T: Into<i64>>(mut self, v: T) -> Self {
1942            self.0.request.size_gib = v.into();
1943            self
1944        }
1945    }
1946
1947    #[doc(hidden)]
1948    impl gax::options::internal::RequestBuilder for ResizeVolume {
1949        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1950            &mut self.0.options
1951        }
1952    }
1953
1954    /// The request builder for [BareMetalSolution::list_networks][crate::client::BareMetalSolution::list_networks] calls.
1955    ///
1956    /// # Example
1957    /// ```no_run
1958    /// # use google_cloud_baremetalsolution_v2::builder;
1959    /// use builder::bare_metal_solution::ListNetworks;
1960    /// # tokio_test::block_on(async {
1961    /// use gax::paginator::ItemPaginator;
1962    ///
1963    /// let builder = prepare_request_builder();
1964    /// let mut items = builder.by_item();
1965    /// while let Some(result) = items.next().await {
1966    ///   let item = result?;
1967    /// }
1968    /// # gax::Result::<()>::Ok(()) });
1969    ///
1970    /// fn prepare_request_builder() -> ListNetworks {
1971    ///   # panic!();
1972    ///   // ... details omitted ...
1973    /// }
1974    /// ```
1975    #[derive(Clone, Debug)]
1976    pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
1977
1978    impl ListNetworks {
1979        pub(crate) fn new(
1980            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1981        ) -> Self {
1982            Self(RequestBuilder::new(stub))
1983        }
1984
1985        /// Sets the full request, replacing any prior values.
1986        pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
1987            self.0.request = v.into();
1988            self
1989        }
1990
1991        /// Sets all the options, replacing any prior values.
1992        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1993            self.0.options = v.into();
1994            self
1995        }
1996
1997        /// Sends the request.
1998        pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
1999            (*self.0.stub)
2000                .list_networks(self.0.request, self.0.options)
2001                .await
2002                .map(gax::response::Response::into_body)
2003        }
2004
2005        /// Streams each page in the collection.
2006        pub fn by_page(
2007            self,
2008        ) -> impl gax::paginator::Paginator<crate::model::ListNetworksResponse, gax::error::Error>
2009        {
2010            use std::clone::Clone;
2011            let token = self.0.request.page_token.clone();
2012            let execute = move |token: String| {
2013                let mut builder = self.clone();
2014                builder.0.request = builder.0.request.set_page_token(token);
2015                builder.send()
2016            };
2017            gax::paginator::internal::new_paginator(token, execute)
2018        }
2019
2020        /// Streams each item in the collection.
2021        pub fn by_item(
2022            self,
2023        ) -> impl gax::paginator::ItemPaginator<crate::model::ListNetworksResponse, gax::error::Error>
2024        {
2025            use gax::paginator::Paginator;
2026            self.by_page().items()
2027        }
2028
2029        /// Sets the value of [parent][crate::model::ListNetworksRequest::parent].
2030        ///
2031        /// This is a **required** field for requests.
2032        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033            self.0.request.parent = v.into();
2034            self
2035        }
2036
2037        /// Sets the value of [page_size][crate::model::ListNetworksRequest::page_size].
2038        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2039            self.0.request.page_size = v.into();
2040            self
2041        }
2042
2043        /// Sets the value of [page_token][crate::model::ListNetworksRequest::page_token].
2044        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2045            self.0.request.page_token = v.into();
2046            self
2047        }
2048
2049        /// Sets the value of [filter][crate::model::ListNetworksRequest::filter].
2050        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2051            self.0.request.filter = v.into();
2052            self
2053        }
2054    }
2055
2056    #[doc(hidden)]
2057    impl gax::options::internal::RequestBuilder for ListNetworks {
2058        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2059            &mut self.0.options
2060        }
2061    }
2062
2063    /// The request builder for [BareMetalSolution::list_network_usage][crate::client::BareMetalSolution::list_network_usage] calls.
2064    ///
2065    /// # Example
2066    /// ```no_run
2067    /// # use google_cloud_baremetalsolution_v2::builder;
2068    /// use builder::bare_metal_solution::ListNetworkUsage;
2069    /// # tokio_test::block_on(async {
2070    ///
2071    /// let builder = prepare_request_builder();
2072    /// let response = builder.send().await?;
2073    /// # gax::Result::<()>::Ok(()) });
2074    ///
2075    /// fn prepare_request_builder() -> ListNetworkUsage {
2076    ///   # panic!();
2077    ///   // ... details omitted ...
2078    /// }
2079    /// ```
2080    #[derive(Clone, Debug)]
2081    pub struct ListNetworkUsage(RequestBuilder<crate::model::ListNetworkUsageRequest>);
2082
2083    impl ListNetworkUsage {
2084        pub(crate) fn new(
2085            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2086        ) -> Self {
2087            Self(RequestBuilder::new(stub))
2088        }
2089
2090        /// Sets the full request, replacing any prior values.
2091        pub fn with_request<V: Into<crate::model::ListNetworkUsageRequest>>(
2092            mut self,
2093            v: V,
2094        ) -> Self {
2095            self.0.request = v.into();
2096            self
2097        }
2098
2099        /// Sets all the options, replacing any prior values.
2100        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2101            self.0.options = v.into();
2102            self
2103        }
2104
2105        /// Sends the request.
2106        pub async fn send(self) -> Result<crate::model::ListNetworkUsageResponse> {
2107            (*self.0.stub)
2108                .list_network_usage(self.0.request, self.0.options)
2109                .await
2110                .map(gax::response::Response::into_body)
2111        }
2112
2113        /// Sets the value of [location][crate::model::ListNetworkUsageRequest::location].
2114        ///
2115        /// This is a **required** field for requests.
2116        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2117            self.0.request.location = v.into();
2118            self
2119        }
2120    }
2121
2122    #[doc(hidden)]
2123    impl gax::options::internal::RequestBuilder for ListNetworkUsage {
2124        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2125            &mut self.0.options
2126        }
2127    }
2128
2129    /// The request builder for [BareMetalSolution::get_network][crate::client::BareMetalSolution::get_network] calls.
2130    ///
2131    /// # Example
2132    /// ```no_run
2133    /// # use google_cloud_baremetalsolution_v2::builder;
2134    /// use builder::bare_metal_solution::GetNetwork;
2135    /// # tokio_test::block_on(async {
2136    ///
2137    /// let builder = prepare_request_builder();
2138    /// let response = builder.send().await?;
2139    /// # gax::Result::<()>::Ok(()) });
2140    ///
2141    /// fn prepare_request_builder() -> GetNetwork {
2142    ///   # panic!();
2143    ///   // ... details omitted ...
2144    /// }
2145    /// ```
2146    #[derive(Clone, Debug)]
2147    pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
2148
2149    impl GetNetwork {
2150        pub(crate) fn new(
2151            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2152        ) -> Self {
2153            Self(RequestBuilder::new(stub))
2154        }
2155
2156        /// Sets the full request, replacing any prior values.
2157        pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
2158            self.0.request = v.into();
2159            self
2160        }
2161
2162        /// Sets all the options, replacing any prior values.
2163        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2164            self.0.options = v.into();
2165            self
2166        }
2167
2168        /// Sends the request.
2169        pub async fn send(self) -> Result<crate::model::Network> {
2170            (*self.0.stub)
2171                .get_network(self.0.request, self.0.options)
2172                .await
2173                .map(gax::response::Response::into_body)
2174        }
2175
2176        /// Sets the value of [name][crate::model::GetNetworkRequest::name].
2177        ///
2178        /// This is a **required** field for requests.
2179        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2180            self.0.request.name = v.into();
2181            self
2182        }
2183    }
2184
2185    #[doc(hidden)]
2186    impl gax::options::internal::RequestBuilder for GetNetwork {
2187        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2188            &mut self.0.options
2189        }
2190    }
2191
2192    /// The request builder for [BareMetalSolution::update_network][crate::client::BareMetalSolution::update_network] calls.
2193    ///
2194    /// # Example
2195    /// ```no_run
2196    /// # use google_cloud_baremetalsolution_v2::builder;
2197    /// use builder::bare_metal_solution::UpdateNetwork;
2198    /// # tokio_test::block_on(async {
2199    /// use lro::Poller;
2200    ///
2201    /// let builder = prepare_request_builder();
2202    /// let response = builder.poller().until_done().await?;
2203    /// # gax::Result::<()>::Ok(()) });
2204    ///
2205    /// fn prepare_request_builder() -> UpdateNetwork {
2206    ///   # panic!();
2207    ///   // ... details omitted ...
2208    /// }
2209    /// ```
2210    #[derive(Clone, Debug)]
2211    pub struct UpdateNetwork(RequestBuilder<crate::model::UpdateNetworkRequest>);
2212
2213    impl UpdateNetwork {
2214        pub(crate) fn new(
2215            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2216        ) -> Self {
2217            Self(RequestBuilder::new(stub))
2218        }
2219
2220        /// Sets the full request, replacing any prior values.
2221        pub fn with_request<V: Into<crate::model::UpdateNetworkRequest>>(mut self, v: V) -> Self {
2222            self.0.request = v.into();
2223            self
2224        }
2225
2226        /// Sets all the options, replacing any prior values.
2227        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2228            self.0.options = v.into();
2229            self
2230        }
2231
2232        /// Sends the request.
2233        ///
2234        /// # Long running operations
2235        ///
2236        /// This starts, but does not poll, a longrunning operation. More information
2237        /// on [update_network][crate::client::BareMetalSolution::update_network].
2238        pub async fn send(self) -> Result<longrunning::model::Operation> {
2239            (*self.0.stub)
2240                .update_network(self.0.request, self.0.options)
2241                .await
2242                .map(gax::response::Response::into_body)
2243        }
2244
2245        /// Creates a [Poller][lro::Poller] to work with `update_network`.
2246        pub fn poller(
2247            self,
2248        ) -> impl lro::Poller<crate::model::Network, crate::model::OperationMetadata> {
2249            type Operation =
2250                lro::internal::Operation<crate::model::Network, crate::model::OperationMetadata>;
2251            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2252            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2253
2254            let stub = self.0.stub.clone();
2255            let mut options = self.0.options.clone();
2256            options.set_retry_policy(gax::retry_policy::NeverRetry);
2257            let query = move |name| {
2258                let stub = stub.clone();
2259                let options = options.clone();
2260                async {
2261                    let op = GetOperation::new(stub)
2262                        .set_name(name)
2263                        .with_options(options)
2264                        .send()
2265                        .await?;
2266                    Ok(Operation::new(op))
2267                }
2268            };
2269
2270            let start = move || async {
2271                let op = self.send().await?;
2272                Ok(Operation::new(op))
2273            };
2274
2275            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2276        }
2277
2278        /// Sets the value of [network][crate::model::UpdateNetworkRequest::network].
2279        ///
2280        /// This is a **required** field for requests.
2281        pub fn set_network<T>(mut self, v: T) -> Self
2282        where
2283            T: std::convert::Into<crate::model::Network>,
2284        {
2285            self.0.request.network = std::option::Option::Some(v.into());
2286            self
2287        }
2288
2289        /// Sets or clears the value of [network][crate::model::UpdateNetworkRequest::network].
2290        ///
2291        /// This is a **required** field for requests.
2292        pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
2293        where
2294            T: std::convert::Into<crate::model::Network>,
2295        {
2296            self.0.request.network = v.map(|x| x.into());
2297            self
2298        }
2299
2300        /// Sets the value of [update_mask][crate::model::UpdateNetworkRequest::update_mask].
2301        pub fn set_update_mask<T>(mut self, v: T) -> Self
2302        where
2303            T: std::convert::Into<wkt::FieldMask>,
2304        {
2305            self.0.request.update_mask = std::option::Option::Some(v.into());
2306            self
2307        }
2308
2309        /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkRequest::update_mask].
2310        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2311        where
2312            T: std::convert::Into<wkt::FieldMask>,
2313        {
2314            self.0.request.update_mask = v.map(|x| x.into());
2315            self
2316        }
2317    }
2318
2319    #[doc(hidden)]
2320    impl gax::options::internal::RequestBuilder for UpdateNetwork {
2321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2322            &mut self.0.options
2323        }
2324    }
2325
2326    /// The request builder for [BareMetalSolution::create_volume_snapshot][crate::client::BareMetalSolution::create_volume_snapshot] calls.
2327    ///
2328    /// # Example
2329    /// ```no_run
2330    /// # use google_cloud_baremetalsolution_v2::builder;
2331    /// use builder::bare_metal_solution::CreateVolumeSnapshot;
2332    /// # tokio_test::block_on(async {
2333    ///
2334    /// let builder = prepare_request_builder();
2335    /// let response = builder.send().await?;
2336    /// # gax::Result::<()>::Ok(()) });
2337    ///
2338    /// fn prepare_request_builder() -> CreateVolumeSnapshot {
2339    ///   # panic!();
2340    ///   // ... details omitted ...
2341    /// }
2342    /// ```
2343    #[derive(Clone, Debug)]
2344    pub struct CreateVolumeSnapshot(RequestBuilder<crate::model::CreateVolumeSnapshotRequest>);
2345
2346    impl CreateVolumeSnapshot {
2347        pub(crate) fn new(
2348            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2349        ) -> Self {
2350            Self(RequestBuilder::new(stub))
2351        }
2352
2353        /// Sets the full request, replacing any prior values.
2354        pub fn with_request<V: Into<crate::model::CreateVolumeSnapshotRequest>>(
2355            mut self,
2356            v: V,
2357        ) -> Self {
2358            self.0.request = v.into();
2359            self
2360        }
2361
2362        /// Sets all the options, replacing any prior values.
2363        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2364            self.0.options = v.into();
2365            self
2366        }
2367
2368        /// Sends the request.
2369        pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2370            (*self.0.stub)
2371                .create_volume_snapshot(self.0.request, self.0.options)
2372                .await
2373                .map(gax::response::Response::into_body)
2374        }
2375
2376        /// Sets the value of [parent][crate::model::CreateVolumeSnapshotRequest::parent].
2377        ///
2378        /// This is a **required** field for requests.
2379        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380            self.0.request.parent = v.into();
2381            self
2382        }
2383
2384        /// Sets the value of [volume_snapshot][crate::model::CreateVolumeSnapshotRequest::volume_snapshot].
2385        ///
2386        /// This is a **required** field for requests.
2387        pub fn set_volume_snapshot<T>(mut self, v: T) -> Self
2388        where
2389            T: std::convert::Into<crate::model::VolumeSnapshot>,
2390        {
2391            self.0.request.volume_snapshot = std::option::Option::Some(v.into());
2392            self
2393        }
2394
2395        /// Sets or clears the value of [volume_snapshot][crate::model::CreateVolumeSnapshotRequest::volume_snapshot].
2396        ///
2397        /// This is a **required** field for requests.
2398        pub fn set_or_clear_volume_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2399        where
2400            T: std::convert::Into<crate::model::VolumeSnapshot>,
2401        {
2402            self.0.request.volume_snapshot = v.map(|x| x.into());
2403            self
2404        }
2405    }
2406
2407    #[doc(hidden)]
2408    impl gax::options::internal::RequestBuilder for CreateVolumeSnapshot {
2409        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2410            &mut self.0.options
2411        }
2412    }
2413
2414    /// The request builder for [BareMetalSolution::restore_volume_snapshot][crate::client::BareMetalSolution::restore_volume_snapshot] calls.
2415    ///
2416    /// # Example
2417    /// ```no_run
2418    /// # use google_cloud_baremetalsolution_v2::builder;
2419    /// use builder::bare_metal_solution::RestoreVolumeSnapshot;
2420    /// # tokio_test::block_on(async {
2421    /// use lro::Poller;
2422    ///
2423    /// let builder = prepare_request_builder();
2424    /// let response = builder.poller().until_done().await?;
2425    /// # gax::Result::<()>::Ok(()) });
2426    ///
2427    /// fn prepare_request_builder() -> RestoreVolumeSnapshot {
2428    ///   # panic!();
2429    ///   // ... details omitted ...
2430    /// }
2431    /// ```
2432    #[derive(Clone, Debug)]
2433    pub struct RestoreVolumeSnapshot(RequestBuilder<crate::model::RestoreVolumeSnapshotRequest>);
2434
2435    impl RestoreVolumeSnapshot {
2436        pub(crate) fn new(
2437            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2438        ) -> Self {
2439            Self(RequestBuilder::new(stub))
2440        }
2441
2442        /// Sets the full request, replacing any prior values.
2443        pub fn with_request<V: Into<crate::model::RestoreVolumeSnapshotRequest>>(
2444            mut self,
2445            v: V,
2446        ) -> Self {
2447            self.0.request = v.into();
2448            self
2449        }
2450
2451        /// Sets all the options, replacing any prior values.
2452        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2453            self.0.options = v.into();
2454            self
2455        }
2456
2457        /// Sends the request.
2458        ///
2459        /// # Long running operations
2460        ///
2461        /// This starts, but does not poll, a longrunning operation. More information
2462        /// on [restore_volume_snapshot][crate::client::BareMetalSolution::restore_volume_snapshot].
2463        pub async fn send(self) -> Result<longrunning::model::Operation> {
2464            (*self.0.stub)
2465                .restore_volume_snapshot(self.0.request, self.0.options)
2466                .await
2467                .map(gax::response::Response::into_body)
2468        }
2469
2470        /// Creates a [Poller][lro::Poller] to work with `restore_volume_snapshot`.
2471        pub fn poller(
2472            self,
2473        ) -> impl lro::Poller<crate::model::VolumeSnapshot, crate::model::OperationMetadata>
2474        {
2475            type Operation = lro::internal::Operation<
2476                crate::model::VolumeSnapshot,
2477                crate::model::OperationMetadata,
2478            >;
2479            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2480            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2481
2482            let stub = self.0.stub.clone();
2483            let mut options = self.0.options.clone();
2484            options.set_retry_policy(gax::retry_policy::NeverRetry);
2485            let query = move |name| {
2486                let stub = stub.clone();
2487                let options = options.clone();
2488                async {
2489                    let op = GetOperation::new(stub)
2490                        .set_name(name)
2491                        .with_options(options)
2492                        .send()
2493                        .await?;
2494                    Ok(Operation::new(op))
2495                }
2496            };
2497
2498            let start = move || async {
2499                let op = self.send().await?;
2500                Ok(Operation::new(op))
2501            };
2502
2503            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2504        }
2505
2506        /// Sets the value of [volume_snapshot][crate::model::RestoreVolumeSnapshotRequest::volume_snapshot].
2507        ///
2508        /// This is a **required** field for requests.
2509        pub fn set_volume_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
2510            self.0.request.volume_snapshot = v.into();
2511            self
2512        }
2513    }
2514
2515    #[doc(hidden)]
2516    impl gax::options::internal::RequestBuilder for RestoreVolumeSnapshot {
2517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2518            &mut self.0.options
2519        }
2520    }
2521
2522    /// The request builder for [BareMetalSolution::delete_volume_snapshot][crate::client::BareMetalSolution::delete_volume_snapshot] calls.
2523    ///
2524    /// # Example
2525    /// ```no_run
2526    /// # use google_cloud_baremetalsolution_v2::builder;
2527    /// use builder::bare_metal_solution::DeleteVolumeSnapshot;
2528    /// # tokio_test::block_on(async {
2529    ///
2530    /// let builder = prepare_request_builder();
2531    /// let response = builder.send().await?;
2532    /// # gax::Result::<()>::Ok(()) });
2533    ///
2534    /// fn prepare_request_builder() -> DeleteVolumeSnapshot {
2535    ///   # panic!();
2536    ///   // ... details omitted ...
2537    /// }
2538    /// ```
2539    #[derive(Clone, Debug)]
2540    pub struct DeleteVolumeSnapshot(RequestBuilder<crate::model::DeleteVolumeSnapshotRequest>);
2541
2542    impl DeleteVolumeSnapshot {
2543        pub(crate) fn new(
2544            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2545        ) -> Self {
2546            Self(RequestBuilder::new(stub))
2547        }
2548
2549        /// Sets the full request, replacing any prior values.
2550        pub fn with_request<V: Into<crate::model::DeleteVolumeSnapshotRequest>>(
2551            mut self,
2552            v: V,
2553        ) -> Self {
2554            self.0.request = v.into();
2555            self
2556        }
2557
2558        /// Sets all the options, replacing any prior values.
2559        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2560            self.0.options = v.into();
2561            self
2562        }
2563
2564        /// Sends the request.
2565        pub async fn send(self) -> Result<()> {
2566            (*self.0.stub)
2567                .delete_volume_snapshot(self.0.request, self.0.options)
2568                .await
2569                .map(gax::response::Response::into_body)
2570        }
2571
2572        /// Sets the value of [name][crate::model::DeleteVolumeSnapshotRequest::name].
2573        ///
2574        /// This is a **required** field for requests.
2575        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2576            self.0.request.name = v.into();
2577            self
2578        }
2579    }
2580
2581    #[doc(hidden)]
2582    impl gax::options::internal::RequestBuilder for DeleteVolumeSnapshot {
2583        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2584            &mut self.0.options
2585        }
2586    }
2587
2588    /// The request builder for [BareMetalSolution::get_volume_snapshot][crate::client::BareMetalSolution::get_volume_snapshot] calls.
2589    ///
2590    /// # Example
2591    /// ```no_run
2592    /// # use google_cloud_baremetalsolution_v2::builder;
2593    /// use builder::bare_metal_solution::GetVolumeSnapshot;
2594    /// # tokio_test::block_on(async {
2595    ///
2596    /// let builder = prepare_request_builder();
2597    /// let response = builder.send().await?;
2598    /// # gax::Result::<()>::Ok(()) });
2599    ///
2600    /// fn prepare_request_builder() -> GetVolumeSnapshot {
2601    ///   # panic!();
2602    ///   // ... details omitted ...
2603    /// }
2604    /// ```
2605    #[derive(Clone, Debug)]
2606    pub struct GetVolumeSnapshot(RequestBuilder<crate::model::GetVolumeSnapshotRequest>);
2607
2608    impl GetVolumeSnapshot {
2609        pub(crate) fn new(
2610            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2611        ) -> Self {
2612            Self(RequestBuilder::new(stub))
2613        }
2614
2615        /// Sets the full request, replacing any prior values.
2616        pub fn with_request<V: Into<crate::model::GetVolumeSnapshotRequest>>(
2617            mut self,
2618            v: V,
2619        ) -> Self {
2620            self.0.request = v.into();
2621            self
2622        }
2623
2624        /// Sets all the options, replacing any prior values.
2625        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2626            self.0.options = v.into();
2627            self
2628        }
2629
2630        /// Sends the request.
2631        pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2632            (*self.0.stub)
2633                .get_volume_snapshot(self.0.request, self.0.options)
2634                .await
2635                .map(gax::response::Response::into_body)
2636        }
2637
2638        /// Sets the value of [name][crate::model::GetVolumeSnapshotRequest::name].
2639        ///
2640        /// This is a **required** field for requests.
2641        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2642            self.0.request.name = v.into();
2643            self
2644        }
2645    }
2646
2647    #[doc(hidden)]
2648    impl gax::options::internal::RequestBuilder for GetVolumeSnapshot {
2649        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2650            &mut self.0.options
2651        }
2652    }
2653
2654    /// The request builder for [BareMetalSolution::list_volume_snapshots][crate::client::BareMetalSolution::list_volume_snapshots] calls.
2655    ///
2656    /// # Example
2657    /// ```no_run
2658    /// # use google_cloud_baremetalsolution_v2::builder;
2659    /// use builder::bare_metal_solution::ListVolumeSnapshots;
2660    /// # tokio_test::block_on(async {
2661    /// use gax::paginator::ItemPaginator;
2662    ///
2663    /// let builder = prepare_request_builder();
2664    /// let mut items = builder.by_item();
2665    /// while let Some(result) = items.next().await {
2666    ///   let item = result?;
2667    /// }
2668    /// # gax::Result::<()>::Ok(()) });
2669    ///
2670    /// fn prepare_request_builder() -> ListVolumeSnapshots {
2671    ///   # panic!();
2672    ///   // ... details omitted ...
2673    /// }
2674    /// ```
2675    #[derive(Clone, Debug)]
2676    pub struct ListVolumeSnapshots(RequestBuilder<crate::model::ListVolumeSnapshotsRequest>);
2677
2678    impl ListVolumeSnapshots {
2679        pub(crate) fn new(
2680            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2681        ) -> Self {
2682            Self(RequestBuilder::new(stub))
2683        }
2684
2685        /// Sets the full request, replacing any prior values.
2686        pub fn with_request<V: Into<crate::model::ListVolumeSnapshotsRequest>>(
2687            mut self,
2688            v: V,
2689        ) -> Self {
2690            self.0.request = v.into();
2691            self
2692        }
2693
2694        /// Sets all the options, replacing any prior values.
2695        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2696            self.0.options = v.into();
2697            self
2698        }
2699
2700        /// Sends the request.
2701        pub async fn send(self) -> Result<crate::model::ListVolumeSnapshotsResponse> {
2702            (*self.0.stub)
2703                .list_volume_snapshots(self.0.request, self.0.options)
2704                .await
2705                .map(gax::response::Response::into_body)
2706        }
2707
2708        /// Streams each page in the collection.
2709        pub fn by_page(
2710            self,
2711        ) -> impl gax::paginator::Paginator<crate::model::ListVolumeSnapshotsResponse, gax::error::Error>
2712        {
2713            use std::clone::Clone;
2714            let token = self.0.request.page_token.clone();
2715            let execute = move |token: String| {
2716                let mut builder = self.clone();
2717                builder.0.request = builder.0.request.set_page_token(token);
2718                builder.send()
2719            };
2720            gax::paginator::internal::new_paginator(token, execute)
2721        }
2722
2723        /// Streams each item in the collection.
2724        pub fn by_item(
2725            self,
2726        ) -> impl gax::paginator::ItemPaginator<
2727            crate::model::ListVolumeSnapshotsResponse,
2728            gax::error::Error,
2729        > {
2730            use gax::paginator::Paginator;
2731            self.by_page().items()
2732        }
2733
2734        /// Sets the value of [parent][crate::model::ListVolumeSnapshotsRequest::parent].
2735        ///
2736        /// This is a **required** field for requests.
2737        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738            self.0.request.parent = v.into();
2739            self
2740        }
2741
2742        /// Sets the value of [page_size][crate::model::ListVolumeSnapshotsRequest::page_size].
2743        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2744            self.0.request.page_size = v.into();
2745            self
2746        }
2747
2748        /// Sets the value of [page_token][crate::model::ListVolumeSnapshotsRequest::page_token].
2749        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2750            self.0.request.page_token = v.into();
2751            self
2752        }
2753    }
2754
2755    #[doc(hidden)]
2756    impl gax::options::internal::RequestBuilder for ListVolumeSnapshots {
2757        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2758            &mut self.0.options
2759        }
2760    }
2761
2762    /// The request builder for [BareMetalSolution::get_lun][crate::client::BareMetalSolution::get_lun] calls.
2763    ///
2764    /// # Example
2765    /// ```no_run
2766    /// # use google_cloud_baremetalsolution_v2::builder;
2767    /// use builder::bare_metal_solution::GetLun;
2768    /// # tokio_test::block_on(async {
2769    ///
2770    /// let builder = prepare_request_builder();
2771    /// let response = builder.send().await?;
2772    /// # gax::Result::<()>::Ok(()) });
2773    ///
2774    /// fn prepare_request_builder() -> GetLun {
2775    ///   # panic!();
2776    ///   // ... details omitted ...
2777    /// }
2778    /// ```
2779    #[derive(Clone, Debug)]
2780    pub struct GetLun(RequestBuilder<crate::model::GetLunRequest>);
2781
2782    impl GetLun {
2783        pub(crate) fn new(
2784            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2785        ) -> Self {
2786            Self(RequestBuilder::new(stub))
2787        }
2788
2789        /// Sets the full request, replacing any prior values.
2790        pub fn with_request<V: Into<crate::model::GetLunRequest>>(mut self, v: V) -> Self {
2791            self.0.request = v.into();
2792            self
2793        }
2794
2795        /// Sets all the options, replacing any prior values.
2796        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2797            self.0.options = v.into();
2798            self
2799        }
2800
2801        /// Sends the request.
2802        pub async fn send(self) -> Result<crate::model::Lun> {
2803            (*self.0.stub)
2804                .get_lun(self.0.request, self.0.options)
2805                .await
2806                .map(gax::response::Response::into_body)
2807        }
2808
2809        /// Sets the value of [name][crate::model::GetLunRequest::name].
2810        ///
2811        /// This is a **required** field for requests.
2812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813            self.0.request.name = v.into();
2814            self
2815        }
2816    }
2817
2818    #[doc(hidden)]
2819    impl gax::options::internal::RequestBuilder for GetLun {
2820        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2821            &mut self.0.options
2822        }
2823    }
2824
2825    /// The request builder for [BareMetalSolution::list_luns][crate::client::BareMetalSolution::list_luns] calls.
2826    ///
2827    /// # Example
2828    /// ```no_run
2829    /// # use google_cloud_baremetalsolution_v2::builder;
2830    /// use builder::bare_metal_solution::ListLuns;
2831    /// # tokio_test::block_on(async {
2832    /// use gax::paginator::ItemPaginator;
2833    ///
2834    /// let builder = prepare_request_builder();
2835    /// let mut items = builder.by_item();
2836    /// while let Some(result) = items.next().await {
2837    ///   let item = result?;
2838    /// }
2839    /// # gax::Result::<()>::Ok(()) });
2840    ///
2841    /// fn prepare_request_builder() -> ListLuns {
2842    ///   # panic!();
2843    ///   // ... details omitted ...
2844    /// }
2845    /// ```
2846    #[derive(Clone, Debug)]
2847    pub struct ListLuns(RequestBuilder<crate::model::ListLunsRequest>);
2848
2849    impl ListLuns {
2850        pub(crate) fn new(
2851            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2852        ) -> Self {
2853            Self(RequestBuilder::new(stub))
2854        }
2855
2856        /// Sets the full request, replacing any prior values.
2857        pub fn with_request<V: Into<crate::model::ListLunsRequest>>(mut self, v: V) -> Self {
2858            self.0.request = v.into();
2859            self
2860        }
2861
2862        /// Sets all the options, replacing any prior values.
2863        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2864            self.0.options = v.into();
2865            self
2866        }
2867
2868        /// Sends the request.
2869        pub async fn send(self) -> Result<crate::model::ListLunsResponse> {
2870            (*self.0.stub)
2871                .list_luns(self.0.request, self.0.options)
2872                .await
2873                .map(gax::response::Response::into_body)
2874        }
2875
2876        /// Streams each page in the collection.
2877        pub fn by_page(
2878            self,
2879        ) -> impl gax::paginator::Paginator<crate::model::ListLunsResponse, gax::error::Error>
2880        {
2881            use std::clone::Clone;
2882            let token = self.0.request.page_token.clone();
2883            let execute = move |token: String| {
2884                let mut builder = self.clone();
2885                builder.0.request = builder.0.request.set_page_token(token);
2886                builder.send()
2887            };
2888            gax::paginator::internal::new_paginator(token, execute)
2889        }
2890
2891        /// Streams each item in the collection.
2892        pub fn by_item(
2893            self,
2894        ) -> impl gax::paginator::ItemPaginator<crate::model::ListLunsResponse, gax::error::Error>
2895        {
2896            use gax::paginator::Paginator;
2897            self.by_page().items()
2898        }
2899
2900        /// Sets the value of [parent][crate::model::ListLunsRequest::parent].
2901        ///
2902        /// This is a **required** field for requests.
2903        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904            self.0.request.parent = v.into();
2905            self
2906        }
2907
2908        /// Sets the value of [page_size][crate::model::ListLunsRequest::page_size].
2909        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2910            self.0.request.page_size = v.into();
2911            self
2912        }
2913
2914        /// Sets the value of [page_token][crate::model::ListLunsRequest::page_token].
2915        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2916            self.0.request.page_token = v.into();
2917            self
2918        }
2919    }
2920
2921    #[doc(hidden)]
2922    impl gax::options::internal::RequestBuilder for ListLuns {
2923        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2924            &mut self.0.options
2925        }
2926    }
2927
2928    /// The request builder for [BareMetalSolution::evict_lun][crate::client::BareMetalSolution::evict_lun] calls.
2929    ///
2930    /// # Example
2931    /// ```no_run
2932    /// # use google_cloud_baremetalsolution_v2::builder;
2933    /// use builder::bare_metal_solution::EvictLun;
2934    /// # tokio_test::block_on(async {
2935    /// use lro::Poller;
2936    ///
2937    /// let builder = prepare_request_builder();
2938    /// let response = builder.poller().until_done().await?;
2939    /// # gax::Result::<()>::Ok(()) });
2940    ///
2941    /// fn prepare_request_builder() -> EvictLun {
2942    ///   # panic!();
2943    ///   // ... details omitted ...
2944    /// }
2945    /// ```
2946    #[derive(Clone, Debug)]
2947    pub struct EvictLun(RequestBuilder<crate::model::EvictLunRequest>);
2948
2949    impl EvictLun {
2950        pub(crate) fn new(
2951            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2952        ) -> Self {
2953            Self(RequestBuilder::new(stub))
2954        }
2955
2956        /// Sets the full request, replacing any prior values.
2957        pub fn with_request<V: Into<crate::model::EvictLunRequest>>(mut self, v: V) -> Self {
2958            self.0.request = v.into();
2959            self
2960        }
2961
2962        /// Sets all the options, replacing any prior values.
2963        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2964            self.0.options = v.into();
2965            self
2966        }
2967
2968        /// Sends the request.
2969        ///
2970        /// # Long running operations
2971        ///
2972        /// This starts, but does not poll, a longrunning operation. More information
2973        /// on [evict_lun][crate::client::BareMetalSolution::evict_lun].
2974        pub async fn send(self) -> Result<longrunning::model::Operation> {
2975            (*self.0.stub)
2976                .evict_lun(self.0.request, self.0.options)
2977                .await
2978                .map(gax::response::Response::into_body)
2979        }
2980
2981        /// Creates a [Poller][lro::Poller] to work with `evict_lun`.
2982        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2983            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2984            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2985            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2986
2987            let stub = self.0.stub.clone();
2988            let mut options = self.0.options.clone();
2989            options.set_retry_policy(gax::retry_policy::NeverRetry);
2990            let query = move |name| {
2991                let stub = stub.clone();
2992                let options = options.clone();
2993                async {
2994                    let op = GetOperation::new(stub)
2995                        .set_name(name)
2996                        .with_options(options)
2997                        .send()
2998                        .await?;
2999                    Ok(Operation::new(op))
3000                }
3001            };
3002
3003            let start = move || async {
3004                let op = self.send().await?;
3005                Ok(Operation::new(op))
3006            };
3007
3008            lro::internal::new_unit_response_poller(
3009                polling_error_policy,
3010                polling_backoff_policy,
3011                start,
3012                query,
3013            )
3014        }
3015
3016        /// Sets the value of [name][crate::model::EvictLunRequest::name].
3017        ///
3018        /// This is a **required** field for requests.
3019        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3020            self.0.request.name = v.into();
3021            self
3022        }
3023    }
3024
3025    #[doc(hidden)]
3026    impl gax::options::internal::RequestBuilder for EvictLun {
3027        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3028            &mut self.0.options
3029        }
3030    }
3031
3032    /// The request builder for [BareMetalSolution::get_nfs_share][crate::client::BareMetalSolution::get_nfs_share] calls.
3033    ///
3034    /// # Example
3035    /// ```no_run
3036    /// # use google_cloud_baremetalsolution_v2::builder;
3037    /// use builder::bare_metal_solution::GetNfsShare;
3038    /// # tokio_test::block_on(async {
3039    ///
3040    /// let builder = prepare_request_builder();
3041    /// let response = builder.send().await?;
3042    /// # gax::Result::<()>::Ok(()) });
3043    ///
3044    /// fn prepare_request_builder() -> GetNfsShare {
3045    ///   # panic!();
3046    ///   // ... details omitted ...
3047    /// }
3048    /// ```
3049    #[derive(Clone, Debug)]
3050    pub struct GetNfsShare(RequestBuilder<crate::model::GetNfsShareRequest>);
3051
3052    impl GetNfsShare {
3053        pub(crate) fn new(
3054            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3055        ) -> Self {
3056            Self(RequestBuilder::new(stub))
3057        }
3058
3059        /// Sets the full request, replacing any prior values.
3060        pub fn with_request<V: Into<crate::model::GetNfsShareRequest>>(mut self, v: V) -> Self {
3061            self.0.request = v.into();
3062            self
3063        }
3064
3065        /// Sets all the options, replacing any prior values.
3066        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3067            self.0.options = v.into();
3068            self
3069        }
3070
3071        /// Sends the request.
3072        pub async fn send(self) -> Result<crate::model::NfsShare> {
3073            (*self.0.stub)
3074                .get_nfs_share(self.0.request, self.0.options)
3075                .await
3076                .map(gax::response::Response::into_body)
3077        }
3078
3079        /// Sets the value of [name][crate::model::GetNfsShareRequest::name].
3080        ///
3081        /// This is a **required** field for requests.
3082        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083            self.0.request.name = v.into();
3084            self
3085        }
3086    }
3087
3088    #[doc(hidden)]
3089    impl gax::options::internal::RequestBuilder for GetNfsShare {
3090        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3091            &mut self.0.options
3092        }
3093    }
3094
3095    /// The request builder for [BareMetalSolution::list_nfs_shares][crate::client::BareMetalSolution::list_nfs_shares] calls.
3096    ///
3097    /// # Example
3098    /// ```no_run
3099    /// # use google_cloud_baremetalsolution_v2::builder;
3100    /// use builder::bare_metal_solution::ListNfsShares;
3101    /// # tokio_test::block_on(async {
3102    /// use gax::paginator::ItemPaginator;
3103    ///
3104    /// let builder = prepare_request_builder();
3105    /// let mut items = builder.by_item();
3106    /// while let Some(result) = items.next().await {
3107    ///   let item = result?;
3108    /// }
3109    /// # gax::Result::<()>::Ok(()) });
3110    ///
3111    /// fn prepare_request_builder() -> ListNfsShares {
3112    ///   # panic!();
3113    ///   // ... details omitted ...
3114    /// }
3115    /// ```
3116    #[derive(Clone, Debug)]
3117    pub struct ListNfsShares(RequestBuilder<crate::model::ListNfsSharesRequest>);
3118
3119    impl ListNfsShares {
3120        pub(crate) fn new(
3121            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3122        ) -> Self {
3123            Self(RequestBuilder::new(stub))
3124        }
3125
3126        /// Sets the full request, replacing any prior values.
3127        pub fn with_request<V: Into<crate::model::ListNfsSharesRequest>>(mut self, v: V) -> Self {
3128            self.0.request = v.into();
3129            self
3130        }
3131
3132        /// Sets all the options, replacing any prior values.
3133        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3134            self.0.options = v.into();
3135            self
3136        }
3137
3138        /// Sends the request.
3139        pub async fn send(self) -> Result<crate::model::ListNfsSharesResponse> {
3140            (*self.0.stub)
3141                .list_nfs_shares(self.0.request, self.0.options)
3142                .await
3143                .map(gax::response::Response::into_body)
3144        }
3145
3146        /// Streams each page in the collection.
3147        pub fn by_page(
3148            self,
3149        ) -> impl gax::paginator::Paginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3150        {
3151            use std::clone::Clone;
3152            let token = self.0.request.page_token.clone();
3153            let execute = move |token: String| {
3154                let mut builder = self.clone();
3155                builder.0.request = builder.0.request.set_page_token(token);
3156                builder.send()
3157            };
3158            gax::paginator::internal::new_paginator(token, execute)
3159        }
3160
3161        /// Streams each item in the collection.
3162        pub fn by_item(
3163            self,
3164        ) -> impl gax::paginator::ItemPaginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3165        {
3166            use gax::paginator::Paginator;
3167            self.by_page().items()
3168        }
3169
3170        /// Sets the value of [parent][crate::model::ListNfsSharesRequest::parent].
3171        ///
3172        /// This is a **required** field for requests.
3173        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174            self.0.request.parent = v.into();
3175            self
3176        }
3177
3178        /// Sets the value of [page_size][crate::model::ListNfsSharesRequest::page_size].
3179        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3180            self.0.request.page_size = v.into();
3181            self
3182        }
3183
3184        /// Sets the value of [page_token][crate::model::ListNfsSharesRequest::page_token].
3185        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3186            self.0.request.page_token = v.into();
3187            self
3188        }
3189
3190        /// Sets the value of [filter][crate::model::ListNfsSharesRequest::filter].
3191        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192            self.0.request.filter = v.into();
3193            self
3194        }
3195    }
3196
3197    #[doc(hidden)]
3198    impl gax::options::internal::RequestBuilder for ListNfsShares {
3199        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3200            &mut self.0.options
3201        }
3202    }
3203
3204    /// The request builder for [BareMetalSolution::update_nfs_share][crate::client::BareMetalSolution::update_nfs_share] calls.
3205    ///
3206    /// # Example
3207    /// ```no_run
3208    /// # use google_cloud_baremetalsolution_v2::builder;
3209    /// use builder::bare_metal_solution::UpdateNfsShare;
3210    /// # tokio_test::block_on(async {
3211    /// use lro::Poller;
3212    ///
3213    /// let builder = prepare_request_builder();
3214    /// let response = builder.poller().until_done().await?;
3215    /// # gax::Result::<()>::Ok(()) });
3216    ///
3217    /// fn prepare_request_builder() -> UpdateNfsShare {
3218    ///   # panic!();
3219    ///   // ... details omitted ...
3220    /// }
3221    /// ```
3222    #[derive(Clone, Debug)]
3223    pub struct UpdateNfsShare(RequestBuilder<crate::model::UpdateNfsShareRequest>);
3224
3225    impl UpdateNfsShare {
3226        pub(crate) fn new(
3227            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3228        ) -> Self {
3229            Self(RequestBuilder::new(stub))
3230        }
3231
3232        /// Sets the full request, replacing any prior values.
3233        pub fn with_request<V: Into<crate::model::UpdateNfsShareRequest>>(mut self, v: V) -> Self {
3234            self.0.request = v.into();
3235            self
3236        }
3237
3238        /// Sets all the options, replacing any prior values.
3239        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3240            self.0.options = v.into();
3241            self
3242        }
3243
3244        /// Sends the request.
3245        ///
3246        /// # Long running operations
3247        ///
3248        /// This starts, but does not poll, a longrunning operation. More information
3249        /// on [update_nfs_share][crate::client::BareMetalSolution::update_nfs_share].
3250        pub async fn send(self) -> Result<longrunning::model::Operation> {
3251            (*self.0.stub)
3252                .update_nfs_share(self.0.request, self.0.options)
3253                .await
3254                .map(gax::response::Response::into_body)
3255        }
3256
3257        /// Creates a [Poller][lro::Poller] to work with `update_nfs_share`.
3258        pub fn poller(
3259            self,
3260        ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3261            type Operation =
3262                lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3263            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3264            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3265
3266            let stub = self.0.stub.clone();
3267            let mut options = self.0.options.clone();
3268            options.set_retry_policy(gax::retry_policy::NeverRetry);
3269            let query = move |name| {
3270                let stub = stub.clone();
3271                let options = options.clone();
3272                async {
3273                    let op = GetOperation::new(stub)
3274                        .set_name(name)
3275                        .with_options(options)
3276                        .send()
3277                        .await?;
3278                    Ok(Operation::new(op))
3279                }
3280            };
3281
3282            let start = move || async {
3283                let op = self.send().await?;
3284                Ok(Operation::new(op))
3285            };
3286
3287            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3288        }
3289
3290        /// Sets the value of [nfs_share][crate::model::UpdateNfsShareRequest::nfs_share].
3291        ///
3292        /// This is a **required** field for requests.
3293        pub fn set_nfs_share<T>(mut self, v: T) -> Self
3294        where
3295            T: std::convert::Into<crate::model::NfsShare>,
3296        {
3297            self.0.request.nfs_share = std::option::Option::Some(v.into());
3298            self
3299        }
3300
3301        /// Sets or clears the value of [nfs_share][crate::model::UpdateNfsShareRequest::nfs_share].
3302        ///
3303        /// This is a **required** field for requests.
3304        pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3305        where
3306            T: std::convert::Into<crate::model::NfsShare>,
3307        {
3308            self.0.request.nfs_share = v.map(|x| x.into());
3309            self
3310        }
3311
3312        /// Sets the value of [update_mask][crate::model::UpdateNfsShareRequest::update_mask].
3313        pub fn set_update_mask<T>(mut self, v: T) -> Self
3314        where
3315            T: std::convert::Into<wkt::FieldMask>,
3316        {
3317            self.0.request.update_mask = std::option::Option::Some(v.into());
3318            self
3319        }
3320
3321        /// Sets or clears the value of [update_mask][crate::model::UpdateNfsShareRequest::update_mask].
3322        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3323        where
3324            T: std::convert::Into<wkt::FieldMask>,
3325        {
3326            self.0.request.update_mask = v.map(|x| x.into());
3327            self
3328        }
3329    }
3330
3331    #[doc(hidden)]
3332    impl gax::options::internal::RequestBuilder for UpdateNfsShare {
3333        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3334            &mut self.0.options
3335        }
3336    }
3337
3338    /// The request builder for [BareMetalSolution::create_nfs_share][crate::client::BareMetalSolution::create_nfs_share] calls.
3339    ///
3340    /// # Example
3341    /// ```no_run
3342    /// # use google_cloud_baremetalsolution_v2::builder;
3343    /// use builder::bare_metal_solution::CreateNfsShare;
3344    /// # tokio_test::block_on(async {
3345    /// use lro::Poller;
3346    ///
3347    /// let builder = prepare_request_builder();
3348    /// let response = builder.poller().until_done().await?;
3349    /// # gax::Result::<()>::Ok(()) });
3350    ///
3351    /// fn prepare_request_builder() -> CreateNfsShare {
3352    ///   # panic!();
3353    ///   // ... details omitted ...
3354    /// }
3355    /// ```
3356    #[derive(Clone, Debug)]
3357    pub struct CreateNfsShare(RequestBuilder<crate::model::CreateNfsShareRequest>);
3358
3359    impl CreateNfsShare {
3360        pub(crate) fn new(
3361            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3362        ) -> Self {
3363            Self(RequestBuilder::new(stub))
3364        }
3365
3366        /// Sets the full request, replacing any prior values.
3367        pub fn with_request<V: Into<crate::model::CreateNfsShareRequest>>(mut self, v: V) -> Self {
3368            self.0.request = v.into();
3369            self
3370        }
3371
3372        /// Sets all the options, replacing any prior values.
3373        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3374            self.0.options = v.into();
3375            self
3376        }
3377
3378        /// Sends the request.
3379        ///
3380        /// # Long running operations
3381        ///
3382        /// This starts, but does not poll, a longrunning operation. More information
3383        /// on [create_nfs_share][crate::client::BareMetalSolution::create_nfs_share].
3384        pub async fn send(self) -> Result<longrunning::model::Operation> {
3385            (*self.0.stub)
3386                .create_nfs_share(self.0.request, self.0.options)
3387                .await
3388                .map(gax::response::Response::into_body)
3389        }
3390
3391        /// Creates a [Poller][lro::Poller] to work with `create_nfs_share`.
3392        pub fn poller(
3393            self,
3394        ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3395            type Operation =
3396                lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3397            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3398            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3399
3400            let stub = self.0.stub.clone();
3401            let mut options = self.0.options.clone();
3402            options.set_retry_policy(gax::retry_policy::NeverRetry);
3403            let query = move |name| {
3404                let stub = stub.clone();
3405                let options = options.clone();
3406                async {
3407                    let op = GetOperation::new(stub)
3408                        .set_name(name)
3409                        .with_options(options)
3410                        .send()
3411                        .await?;
3412                    Ok(Operation::new(op))
3413                }
3414            };
3415
3416            let start = move || async {
3417                let op = self.send().await?;
3418                Ok(Operation::new(op))
3419            };
3420
3421            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3422        }
3423
3424        /// Sets the value of [parent][crate::model::CreateNfsShareRequest::parent].
3425        ///
3426        /// This is a **required** field for requests.
3427        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3428            self.0.request.parent = v.into();
3429            self
3430        }
3431
3432        /// Sets the value of [nfs_share][crate::model::CreateNfsShareRequest::nfs_share].
3433        ///
3434        /// This is a **required** field for requests.
3435        pub fn set_nfs_share<T>(mut self, v: T) -> Self
3436        where
3437            T: std::convert::Into<crate::model::NfsShare>,
3438        {
3439            self.0.request.nfs_share = std::option::Option::Some(v.into());
3440            self
3441        }
3442
3443        /// Sets or clears the value of [nfs_share][crate::model::CreateNfsShareRequest::nfs_share].
3444        ///
3445        /// This is a **required** field for requests.
3446        pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3447        where
3448            T: std::convert::Into<crate::model::NfsShare>,
3449        {
3450            self.0.request.nfs_share = v.map(|x| x.into());
3451            self
3452        }
3453    }
3454
3455    #[doc(hidden)]
3456    impl gax::options::internal::RequestBuilder for CreateNfsShare {
3457        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3458            &mut self.0.options
3459        }
3460    }
3461
3462    /// The request builder for [BareMetalSolution::rename_nfs_share][crate::client::BareMetalSolution::rename_nfs_share] calls.
3463    ///
3464    /// # Example
3465    /// ```no_run
3466    /// # use google_cloud_baremetalsolution_v2::builder;
3467    /// use builder::bare_metal_solution::RenameNfsShare;
3468    /// # tokio_test::block_on(async {
3469    ///
3470    /// let builder = prepare_request_builder();
3471    /// let response = builder.send().await?;
3472    /// # gax::Result::<()>::Ok(()) });
3473    ///
3474    /// fn prepare_request_builder() -> RenameNfsShare {
3475    ///   # panic!();
3476    ///   // ... details omitted ...
3477    /// }
3478    /// ```
3479    #[derive(Clone, Debug)]
3480    pub struct RenameNfsShare(RequestBuilder<crate::model::RenameNfsShareRequest>);
3481
3482    impl RenameNfsShare {
3483        pub(crate) fn new(
3484            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3485        ) -> Self {
3486            Self(RequestBuilder::new(stub))
3487        }
3488
3489        /// Sets the full request, replacing any prior values.
3490        pub fn with_request<V: Into<crate::model::RenameNfsShareRequest>>(mut self, v: V) -> Self {
3491            self.0.request = v.into();
3492            self
3493        }
3494
3495        /// Sets all the options, replacing any prior values.
3496        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3497            self.0.options = v.into();
3498            self
3499        }
3500
3501        /// Sends the request.
3502        pub async fn send(self) -> Result<crate::model::NfsShare> {
3503            (*self.0.stub)
3504                .rename_nfs_share(self.0.request, self.0.options)
3505                .await
3506                .map(gax::response::Response::into_body)
3507        }
3508
3509        /// Sets the value of [name][crate::model::RenameNfsShareRequest::name].
3510        ///
3511        /// This is a **required** field for requests.
3512        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3513            self.0.request.name = v.into();
3514            self
3515        }
3516
3517        /// Sets the value of [new_nfsshare_id][crate::model::RenameNfsShareRequest::new_nfsshare_id].
3518        ///
3519        /// This is a **required** field for requests.
3520        pub fn set_new_nfsshare_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3521            self.0.request.new_nfsshare_id = v.into();
3522            self
3523        }
3524    }
3525
3526    #[doc(hidden)]
3527    impl gax::options::internal::RequestBuilder for RenameNfsShare {
3528        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3529            &mut self.0.options
3530        }
3531    }
3532
3533    /// The request builder for [BareMetalSolution::delete_nfs_share][crate::client::BareMetalSolution::delete_nfs_share] calls.
3534    ///
3535    /// # Example
3536    /// ```no_run
3537    /// # use google_cloud_baremetalsolution_v2::builder;
3538    /// use builder::bare_metal_solution::DeleteNfsShare;
3539    /// # tokio_test::block_on(async {
3540    /// use lro::Poller;
3541    ///
3542    /// let builder = prepare_request_builder();
3543    /// let response = builder.poller().until_done().await?;
3544    /// # gax::Result::<()>::Ok(()) });
3545    ///
3546    /// fn prepare_request_builder() -> DeleteNfsShare {
3547    ///   # panic!();
3548    ///   // ... details omitted ...
3549    /// }
3550    /// ```
3551    #[derive(Clone, Debug)]
3552    pub struct DeleteNfsShare(RequestBuilder<crate::model::DeleteNfsShareRequest>);
3553
3554    impl DeleteNfsShare {
3555        pub(crate) fn new(
3556            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3557        ) -> Self {
3558            Self(RequestBuilder::new(stub))
3559        }
3560
3561        /// Sets the full request, replacing any prior values.
3562        pub fn with_request<V: Into<crate::model::DeleteNfsShareRequest>>(mut self, v: V) -> Self {
3563            self.0.request = v.into();
3564            self
3565        }
3566
3567        /// Sets all the options, replacing any prior values.
3568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3569            self.0.options = v.into();
3570            self
3571        }
3572
3573        /// Sends the request.
3574        ///
3575        /// # Long running operations
3576        ///
3577        /// This starts, but does not poll, a longrunning operation. More information
3578        /// on [delete_nfs_share][crate::client::BareMetalSolution::delete_nfs_share].
3579        pub async fn send(self) -> Result<longrunning::model::Operation> {
3580            (*self.0.stub)
3581                .delete_nfs_share(self.0.request, self.0.options)
3582                .await
3583                .map(gax::response::Response::into_body)
3584        }
3585
3586        /// Creates a [Poller][lro::Poller] to work with `delete_nfs_share`.
3587        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3588            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3589            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3590            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3591
3592            let stub = self.0.stub.clone();
3593            let mut options = self.0.options.clone();
3594            options.set_retry_policy(gax::retry_policy::NeverRetry);
3595            let query = move |name| {
3596                let stub = stub.clone();
3597                let options = options.clone();
3598                async {
3599                    let op = GetOperation::new(stub)
3600                        .set_name(name)
3601                        .with_options(options)
3602                        .send()
3603                        .await?;
3604                    Ok(Operation::new(op))
3605                }
3606            };
3607
3608            let start = move || async {
3609                let op = self.send().await?;
3610                Ok(Operation::new(op))
3611            };
3612
3613            lro::internal::new_unit_response_poller(
3614                polling_error_policy,
3615                polling_backoff_policy,
3616                start,
3617                query,
3618            )
3619        }
3620
3621        /// Sets the value of [name][crate::model::DeleteNfsShareRequest::name].
3622        ///
3623        /// This is a **required** field for requests.
3624        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3625            self.0.request.name = v.into();
3626            self
3627        }
3628    }
3629
3630    #[doc(hidden)]
3631    impl gax::options::internal::RequestBuilder for DeleteNfsShare {
3632        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3633            &mut self.0.options
3634        }
3635    }
3636
3637    /// The request builder for [BareMetalSolution::list_provisioning_quotas][crate::client::BareMetalSolution::list_provisioning_quotas] calls.
3638    ///
3639    /// # Example
3640    /// ```no_run
3641    /// # use google_cloud_baremetalsolution_v2::builder;
3642    /// use builder::bare_metal_solution::ListProvisioningQuotas;
3643    /// # tokio_test::block_on(async {
3644    /// use gax::paginator::ItemPaginator;
3645    ///
3646    /// let builder = prepare_request_builder();
3647    /// let mut items = builder.by_item();
3648    /// while let Some(result) = items.next().await {
3649    ///   let item = result?;
3650    /// }
3651    /// # gax::Result::<()>::Ok(()) });
3652    ///
3653    /// fn prepare_request_builder() -> ListProvisioningQuotas {
3654    ///   # panic!();
3655    ///   // ... details omitted ...
3656    /// }
3657    /// ```
3658    #[derive(Clone, Debug)]
3659    pub struct ListProvisioningQuotas(RequestBuilder<crate::model::ListProvisioningQuotasRequest>);
3660
3661    impl ListProvisioningQuotas {
3662        pub(crate) fn new(
3663            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3664        ) -> Self {
3665            Self(RequestBuilder::new(stub))
3666        }
3667
3668        /// Sets the full request, replacing any prior values.
3669        pub fn with_request<V: Into<crate::model::ListProvisioningQuotasRequest>>(
3670            mut self,
3671            v: V,
3672        ) -> Self {
3673            self.0.request = v.into();
3674            self
3675        }
3676
3677        /// Sets all the options, replacing any prior values.
3678        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3679            self.0.options = v.into();
3680            self
3681        }
3682
3683        /// Sends the request.
3684        pub async fn send(self) -> Result<crate::model::ListProvisioningQuotasResponse> {
3685            (*self.0.stub)
3686                .list_provisioning_quotas(self.0.request, self.0.options)
3687                .await
3688                .map(gax::response::Response::into_body)
3689        }
3690
3691        /// Streams each page in the collection.
3692        pub fn by_page(
3693            self,
3694        ) -> impl gax::paginator::Paginator<
3695            crate::model::ListProvisioningQuotasResponse,
3696            gax::error::Error,
3697        > {
3698            use std::clone::Clone;
3699            let token = self.0.request.page_token.clone();
3700            let execute = move |token: String| {
3701                let mut builder = self.clone();
3702                builder.0.request = builder.0.request.set_page_token(token);
3703                builder.send()
3704            };
3705            gax::paginator::internal::new_paginator(token, execute)
3706        }
3707
3708        /// Streams each item in the collection.
3709        pub fn by_item(
3710            self,
3711        ) -> impl gax::paginator::ItemPaginator<
3712            crate::model::ListProvisioningQuotasResponse,
3713            gax::error::Error,
3714        > {
3715            use gax::paginator::Paginator;
3716            self.by_page().items()
3717        }
3718
3719        /// Sets the value of [parent][crate::model::ListProvisioningQuotasRequest::parent].
3720        ///
3721        /// This is a **required** field for requests.
3722        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3723            self.0.request.parent = v.into();
3724            self
3725        }
3726
3727        /// Sets the value of [page_size][crate::model::ListProvisioningQuotasRequest::page_size].
3728        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3729            self.0.request.page_size = v.into();
3730            self
3731        }
3732
3733        /// Sets the value of [page_token][crate::model::ListProvisioningQuotasRequest::page_token].
3734        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3735            self.0.request.page_token = v.into();
3736            self
3737        }
3738    }
3739
3740    #[doc(hidden)]
3741    impl gax::options::internal::RequestBuilder for ListProvisioningQuotas {
3742        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3743            &mut self.0.options
3744        }
3745    }
3746
3747    /// The request builder for [BareMetalSolution::submit_provisioning_config][crate::client::BareMetalSolution::submit_provisioning_config] calls.
3748    ///
3749    /// # Example
3750    /// ```no_run
3751    /// # use google_cloud_baremetalsolution_v2::builder;
3752    /// use builder::bare_metal_solution::SubmitProvisioningConfig;
3753    /// # tokio_test::block_on(async {
3754    ///
3755    /// let builder = prepare_request_builder();
3756    /// let response = builder.send().await?;
3757    /// # gax::Result::<()>::Ok(()) });
3758    ///
3759    /// fn prepare_request_builder() -> SubmitProvisioningConfig {
3760    ///   # panic!();
3761    ///   // ... details omitted ...
3762    /// }
3763    /// ```
3764    #[derive(Clone, Debug)]
3765    pub struct SubmitProvisioningConfig(
3766        RequestBuilder<crate::model::SubmitProvisioningConfigRequest>,
3767    );
3768
3769    impl SubmitProvisioningConfig {
3770        pub(crate) fn new(
3771            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3772        ) -> Self {
3773            Self(RequestBuilder::new(stub))
3774        }
3775
3776        /// Sets the full request, replacing any prior values.
3777        pub fn with_request<V: Into<crate::model::SubmitProvisioningConfigRequest>>(
3778            mut self,
3779            v: V,
3780        ) -> Self {
3781            self.0.request = v.into();
3782            self
3783        }
3784
3785        /// Sets all the options, replacing any prior values.
3786        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3787            self.0.options = v.into();
3788            self
3789        }
3790
3791        /// Sends the request.
3792        pub async fn send(self) -> Result<crate::model::SubmitProvisioningConfigResponse> {
3793            (*self.0.stub)
3794                .submit_provisioning_config(self.0.request, self.0.options)
3795                .await
3796                .map(gax::response::Response::into_body)
3797        }
3798
3799        /// Sets the value of [parent][crate::model::SubmitProvisioningConfigRequest::parent].
3800        ///
3801        /// This is a **required** field for requests.
3802        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3803            self.0.request.parent = v.into();
3804            self
3805        }
3806
3807        /// Sets the value of [provisioning_config][crate::model::SubmitProvisioningConfigRequest::provisioning_config].
3808        ///
3809        /// This is a **required** field for requests.
3810        pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3811        where
3812            T: std::convert::Into<crate::model::ProvisioningConfig>,
3813        {
3814            self.0.request.provisioning_config = std::option::Option::Some(v.into());
3815            self
3816        }
3817
3818        /// Sets or clears the value of [provisioning_config][crate::model::SubmitProvisioningConfigRequest::provisioning_config].
3819        ///
3820        /// This is a **required** field for requests.
3821        pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3822        where
3823            T: std::convert::Into<crate::model::ProvisioningConfig>,
3824        {
3825            self.0.request.provisioning_config = v.map(|x| x.into());
3826            self
3827        }
3828
3829        /// Sets the value of [email][crate::model::SubmitProvisioningConfigRequest::email].
3830        pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3831            self.0.request.email = v.into();
3832            self
3833        }
3834    }
3835
3836    #[doc(hidden)]
3837    impl gax::options::internal::RequestBuilder for SubmitProvisioningConfig {
3838        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3839            &mut self.0.options
3840        }
3841    }
3842
3843    /// The request builder for [BareMetalSolution::get_provisioning_config][crate::client::BareMetalSolution::get_provisioning_config] calls.
3844    ///
3845    /// # Example
3846    /// ```no_run
3847    /// # use google_cloud_baremetalsolution_v2::builder;
3848    /// use builder::bare_metal_solution::GetProvisioningConfig;
3849    /// # tokio_test::block_on(async {
3850    ///
3851    /// let builder = prepare_request_builder();
3852    /// let response = builder.send().await?;
3853    /// # gax::Result::<()>::Ok(()) });
3854    ///
3855    /// fn prepare_request_builder() -> GetProvisioningConfig {
3856    ///   # panic!();
3857    ///   // ... details omitted ...
3858    /// }
3859    /// ```
3860    #[derive(Clone, Debug)]
3861    pub struct GetProvisioningConfig(RequestBuilder<crate::model::GetProvisioningConfigRequest>);
3862
3863    impl GetProvisioningConfig {
3864        pub(crate) fn new(
3865            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3866        ) -> Self {
3867            Self(RequestBuilder::new(stub))
3868        }
3869
3870        /// Sets the full request, replacing any prior values.
3871        pub fn with_request<V: Into<crate::model::GetProvisioningConfigRequest>>(
3872            mut self,
3873            v: V,
3874        ) -> Self {
3875            self.0.request = v.into();
3876            self
3877        }
3878
3879        /// Sets all the options, replacing any prior values.
3880        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3881            self.0.options = v.into();
3882            self
3883        }
3884
3885        /// Sends the request.
3886        pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3887            (*self.0.stub)
3888                .get_provisioning_config(self.0.request, self.0.options)
3889                .await
3890                .map(gax::response::Response::into_body)
3891        }
3892
3893        /// Sets the value of [name][crate::model::GetProvisioningConfigRequest::name].
3894        ///
3895        /// This is a **required** field for requests.
3896        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897            self.0.request.name = v.into();
3898            self
3899        }
3900    }
3901
3902    #[doc(hidden)]
3903    impl gax::options::internal::RequestBuilder for GetProvisioningConfig {
3904        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3905            &mut self.0.options
3906        }
3907    }
3908
3909    /// The request builder for [BareMetalSolution::create_provisioning_config][crate::client::BareMetalSolution::create_provisioning_config] calls.
3910    ///
3911    /// # Example
3912    /// ```no_run
3913    /// # use google_cloud_baremetalsolution_v2::builder;
3914    /// use builder::bare_metal_solution::CreateProvisioningConfig;
3915    /// # tokio_test::block_on(async {
3916    ///
3917    /// let builder = prepare_request_builder();
3918    /// let response = builder.send().await?;
3919    /// # gax::Result::<()>::Ok(()) });
3920    ///
3921    /// fn prepare_request_builder() -> CreateProvisioningConfig {
3922    ///   # panic!();
3923    ///   // ... details omitted ...
3924    /// }
3925    /// ```
3926    #[derive(Clone, Debug)]
3927    pub struct CreateProvisioningConfig(
3928        RequestBuilder<crate::model::CreateProvisioningConfigRequest>,
3929    );
3930
3931    impl CreateProvisioningConfig {
3932        pub(crate) fn new(
3933            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3934        ) -> Self {
3935            Self(RequestBuilder::new(stub))
3936        }
3937
3938        /// Sets the full request, replacing any prior values.
3939        pub fn with_request<V: Into<crate::model::CreateProvisioningConfigRequest>>(
3940            mut self,
3941            v: V,
3942        ) -> Self {
3943            self.0.request = v.into();
3944            self
3945        }
3946
3947        /// Sets all the options, replacing any prior values.
3948        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3949            self.0.options = v.into();
3950            self
3951        }
3952
3953        /// Sends the request.
3954        pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3955            (*self.0.stub)
3956                .create_provisioning_config(self.0.request, self.0.options)
3957                .await
3958                .map(gax::response::Response::into_body)
3959        }
3960
3961        /// Sets the value of [parent][crate::model::CreateProvisioningConfigRequest::parent].
3962        ///
3963        /// This is a **required** field for requests.
3964        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3965            self.0.request.parent = v.into();
3966            self
3967        }
3968
3969        /// Sets the value of [provisioning_config][crate::model::CreateProvisioningConfigRequest::provisioning_config].
3970        ///
3971        /// This is a **required** field for requests.
3972        pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3973        where
3974            T: std::convert::Into<crate::model::ProvisioningConfig>,
3975        {
3976            self.0.request.provisioning_config = std::option::Option::Some(v.into());
3977            self
3978        }
3979
3980        /// Sets or clears the value of [provisioning_config][crate::model::CreateProvisioningConfigRequest::provisioning_config].
3981        ///
3982        /// This is a **required** field for requests.
3983        pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3984        where
3985            T: std::convert::Into<crate::model::ProvisioningConfig>,
3986        {
3987            self.0.request.provisioning_config = v.map(|x| x.into());
3988            self
3989        }
3990
3991        /// Sets the value of [email][crate::model::CreateProvisioningConfigRequest::email].
3992        pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3993            self.0.request.email = v.into();
3994            self
3995        }
3996    }
3997
3998    #[doc(hidden)]
3999    impl gax::options::internal::RequestBuilder for CreateProvisioningConfig {
4000        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4001            &mut self.0.options
4002        }
4003    }
4004
4005    /// The request builder for [BareMetalSolution::update_provisioning_config][crate::client::BareMetalSolution::update_provisioning_config] calls.
4006    ///
4007    /// # Example
4008    /// ```no_run
4009    /// # use google_cloud_baremetalsolution_v2::builder;
4010    /// use builder::bare_metal_solution::UpdateProvisioningConfig;
4011    /// # tokio_test::block_on(async {
4012    ///
4013    /// let builder = prepare_request_builder();
4014    /// let response = builder.send().await?;
4015    /// # gax::Result::<()>::Ok(()) });
4016    ///
4017    /// fn prepare_request_builder() -> UpdateProvisioningConfig {
4018    ///   # panic!();
4019    ///   // ... details omitted ...
4020    /// }
4021    /// ```
4022    #[derive(Clone, Debug)]
4023    pub struct UpdateProvisioningConfig(
4024        RequestBuilder<crate::model::UpdateProvisioningConfigRequest>,
4025    );
4026
4027    impl UpdateProvisioningConfig {
4028        pub(crate) fn new(
4029            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4030        ) -> Self {
4031            Self(RequestBuilder::new(stub))
4032        }
4033
4034        /// Sets the full request, replacing any prior values.
4035        pub fn with_request<V: Into<crate::model::UpdateProvisioningConfigRequest>>(
4036            mut self,
4037            v: V,
4038        ) -> Self {
4039            self.0.request = v.into();
4040            self
4041        }
4042
4043        /// Sets all the options, replacing any prior values.
4044        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4045            self.0.options = v.into();
4046            self
4047        }
4048
4049        /// Sends the request.
4050        pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4051            (*self.0.stub)
4052                .update_provisioning_config(self.0.request, self.0.options)
4053                .await
4054                .map(gax::response::Response::into_body)
4055        }
4056
4057        /// Sets the value of [provisioning_config][crate::model::UpdateProvisioningConfigRequest::provisioning_config].
4058        ///
4059        /// This is a **required** field for requests.
4060        pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4061        where
4062            T: std::convert::Into<crate::model::ProvisioningConfig>,
4063        {
4064            self.0.request.provisioning_config = std::option::Option::Some(v.into());
4065            self
4066        }
4067
4068        /// Sets or clears the value of [provisioning_config][crate::model::UpdateProvisioningConfigRequest::provisioning_config].
4069        ///
4070        /// This is a **required** field for requests.
4071        pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4072        where
4073            T: std::convert::Into<crate::model::ProvisioningConfig>,
4074        {
4075            self.0.request.provisioning_config = v.map(|x| x.into());
4076            self
4077        }
4078
4079        /// Sets the value of [update_mask][crate::model::UpdateProvisioningConfigRequest::update_mask].
4080        ///
4081        /// This is a **required** field for requests.
4082        pub fn set_update_mask<T>(mut self, v: T) -> Self
4083        where
4084            T: std::convert::Into<wkt::FieldMask>,
4085        {
4086            self.0.request.update_mask = std::option::Option::Some(v.into());
4087            self
4088        }
4089
4090        /// Sets or clears the value of [update_mask][crate::model::UpdateProvisioningConfigRequest::update_mask].
4091        ///
4092        /// This is a **required** field for requests.
4093        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4094        where
4095            T: std::convert::Into<wkt::FieldMask>,
4096        {
4097            self.0.request.update_mask = v.map(|x| x.into());
4098            self
4099        }
4100
4101        /// Sets the value of [email][crate::model::UpdateProvisioningConfigRequest::email].
4102        pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4103            self.0.request.email = v.into();
4104            self
4105        }
4106    }
4107
4108    #[doc(hidden)]
4109    impl gax::options::internal::RequestBuilder for UpdateProvisioningConfig {
4110        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4111            &mut self.0.options
4112        }
4113    }
4114
4115    /// The request builder for [BareMetalSolution::rename_network][crate::client::BareMetalSolution::rename_network] calls.
4116    ///
4117    /// # Example
4118    /// ```no_run
4119    /// # use google_cloud_baremetalsolution_v2::builder;
4120    /// use builder::bare_metal_solution::RenameNetwork;
4121    /// # tokio_test::block_on(async {
4122    ///
4123    /// let builder = prepare_request_builder();
4124    /// let response = builder.send().await?;
4125    /// # gax::Result::<()>::Ok(()) });
4126    ///
4127    /// fn prepare_request_builder() -> RenameNetwork {
4128    ///   # panic!();
4129    ///   // ... details omitted ...
4130    /// }
4131    /// ```
4132    #[derive(Clone, Debug)]
4133    pub struct RenameNetwork(RequestBuilder<crate::model::RenameNetworkRequest>);
4134
4135    impl RenameNetwork {
4136        pub(crate) fn new(
4137            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4138        ) -> Self {
4139            Self(RequestBuilder::new(stub))
4140        }
4141
4142        /// Sets the full request, replacing any prior values.
4143        pub fn with_request<V: Into<crate::model::RenameNetworkRequest>>(mut self, v: V) -> Self {
4144            self.0.request = v.into();
4145            self
4146        }
4147
4148        /// Sets all the options, replacing any prior values.
4149        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4150            self.0.options = v.into();
4151            self
4152        }
4153
4154        /// Sends the request.
4155        pub async fn send(self) -> Result<crate::model::Network> {
4156            (*self.0.stub)
4157                .rename_network(self.0.request, self.0.options)
4158                .await
4159                .map(gax::response::Response::into_body)
4160        }
4161
4162        /// Sets the value of [name][crate::model::RenameNetworkRequest::name].
4163        ///
4164        /// This is a **required** field for requests.
4165        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4166            self.0.request.name = v.into();
4167            self
4168        }
4169
4170        /// Sets the value of [new_network_id][crate::model::RenameNetworkRequest::new_network_id].
4171        ///
4172        /// This is a **required** field for requests.
4173        pub fn set_new_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4174            self.0.request.new_network_id = v.into();
4175            self
4176        }
4177    }
4178
4179    #[doc(hidden)]
4180    impl gax::options::internal::RequestBuilder for RenameNetwork {
4181        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4182            &mut self.0.options
4183        }
4184    }
4185
4186    /// The request builder for [BareMetalSolution::list_os_images][crate::client::BareMetalSolution::list_os_images] calls.
4187    ///
4188    /// # Example
4189    /// ```no_run
4190    /// # use google_cloud_baremetalsolution_v2::builder;
4191    /// use builder::bare_metal_solution::ListOSImages;
4192    /// # tokio_test::block_on(async {
4193    /// use gax::paginator::ItemPaginator;
4194    ///
4195    /// let builder = prepare_request_builder();
4196    /// let mut items = builder.by_item();
4197    /// while let Some(result) = items.next().await {
4198    ///   let item = result?;
4199    /// }
4200    /// # gax::Result::<()>::Ok(()) });
4201    ///
4202    /// fn prepare_request_builder() -> ListOSImages {
4203    ///   # panic!();
4204    ///   // ... details omitted ...
4205    /// }
4206    /// ```
4207    #[derive(Clone, Debug)]
4208    pub struct ListOSImages(RequestBuilder<crate::model::ListOSImagesRequest>);
4209
4210    impl ListOSImages {
4211        pub(crate) fn new(
4212            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4213        ) -> Self {
4214            Self(RequestBuilder::new(stub))
4215        }
4216
4217        /// Sets the full request, replacing any prior values.
4218        pub fn with_request<V: Into<crate::model::ListOSImagesRequest>>(mut self, v: V) -> Self {
4219            self.0.request = v.into();
4220            self
4221        }
4222
4223        /// Sets all the options, replacing any prior values.
4224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4225            self.0.options = v.into();
4226            self
4227        }
4228
4229        /// Sends the request.
4230        pub async fn send(self) -> Result<crate::model::ListOSImagesResponse> {
4231            (*self.0.stub)
4232                .list_os_images(self.0.request, self.0.options)
4233                .await
4234                .map(gax::response::Response::into_body)
4235        }
4236
4237        /// Streams each page in the collection.
4238        pub fn by_page(
4239            self,
4240        ) -> impl gax::paginator::Paginator<crate::model::ListOSImagesResponse, gax::error::Error>
4241        {
4242            use std::clone::Clone;
4243            let token = self.0.request.page_token.clone();
4244            let execute = move |token: String| {
4245                let mut builder = self.clone();
4246                builder.0.request = builder.0.request.set_page_token(token);
4247                builder.send()
4248            };
4249            gax::paginator::internal::new_paginator(token, execute)
4250        }
4251
4252        /// Streams each item in the collection.
4253        pub fn by_item(
4254            self,
4255        ) -> impl gax::paginator::ItemPaginator<crate::model::ListOSImagesResponse, gax::error::Error>
4256        {
4257            use gax::paginator::Paginator;
4258            self.by_page().items()
4259        }
4260
4261        /// Sets the value of [parent][crate::model::ListOSImagesRequest::parent].
4262        ///
4263        /// This is a **required** field for requests.
4264        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4265            self.0.request.parent = v.into();
4266            self
4267        }
4268
4269        /// Sets the value of [page_size][crate::model::ListOSImagesRequest::page_size].
4270        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4271            self.0.request.page_size = v.into();
4272            self
4273        }
4274
4275        /// Sets the value of [page_token][crate::model::ListOSImagesRequest::page_token].
4276        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277            self.0.request.page_token = v.into();
4278            self
4279        }
4280    }
4281
4282    #[doc(hidden)]
4283    impl gax::options::internal::RequestBuilder for ListOSImages {
4284        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4285            &mut self.0.options
4286        }
4287    }
4288
4289    /// The request builder for [BareMetalSolution::list_locations][crate::client::BareMetalSolution::list_locations] calls.
4290    ///
4291    /// # Example
4292    /// ```no_run
4293    /// # use google_cloud_baremetalsolution_v2::builder;
4294    /// use builder::bare_metal_solution::ListLocations;
4295    /// # tokio_test::block_on(async {
4296    /// use gax::paginator::ItemPaginator;
4297    ///
4298    /// let builder = prepare_request_builder();
4299    /// let mut items = builder.by_item();
4300    /// while let Some(result) = items.next().await {
4301    ///   let item = result?;
4302    /// }
4303    /// # gax::Result::<()>::Ok(()) });
4304    ///
4305    /// fn prepare_request_builder() -> ListLocations {
4306    ///   # panic!();
4307    ///   // ... details omitted ...
4308    /// }
4309    /// ```
4310    #[derive(Clone, Debug)]
4311    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4312
4313    impl ListLocations {
4314        pub(crate) fn new(
4315            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4316        ) -> Self {
4317            Self(RequestBuilder::new(stub))
4318        }
4319
4320        /// Sets the full request, replacing any prior values.
4321        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4322            mut self,
4323            v: V,
4324        ) -> Self {
4325            self.0.request = v.into();
4326            self
4327        }
4328
4329        /// Sets all the options, replacing any prior values.
4330        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4331            self.0.options = v.into();
4332            self
4333        }
4334
4335        /// Sends the request.
4336        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4337            (*self.0.stub)
4338                .list_locations(self.0.request, self.0.options)
4339                .await
4340                .map(gax::response::Response::into_body)
4341        }
4342
4343        /// Streams each page in the collection.
4344        pub fn by_page(
4345            self,
4346        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4347        {
4348            use std::clone::Clone;
4349            let token = self.0.request.page_token.clone();
4350            let execute = move |token: String| {
4351                let mut builder = self.clone();
4352                builder.0.request = builder.0.request.set_page_token(token);
4353                builder.send()
4354            };
4355            gax::paginator::internal::new_paginator(token, execute)
4356        }
4357
4358        /// Streams each item in the collection.
4359        pub fn by_item(
4360            self,
4361        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4362        {
4363            use gax::paginator::Paginator;
4364            self.by_page().items()
4365        }
4366
4367        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4368        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4369            self.0.request.name = v.into();
4370            self
4371        }
4372
4373        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4374        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4375            self.0.request.filter = v.into();
4376            self
4377        }
4378
4379        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4380        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4381            self.0.request.page_size = v.into();
4382            self
4383        }
4384
4385        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4386        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387            self.0.request.page_token = v.into();
4388            self
4389        }
4390    }
4391
4392    #[doc(hidden)]
4393    impl gax::options::internal::RequestBuilder for ListLocations {
4394        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4395            &mut self.0.options
4396        }
4397    }
4398
4399    /// The request builder for [BareMetalSolution::get_location][crate::client::BareMetalSolution::get_location] calls.
4400    ///
4401    /// # Example
4402    /// ```no_run
4403    /// # use google_cloud_baremetalsolution_v2::builder;
4404    /// use builder::bare_metal_solution::GetLocation;
4405    /// # tokio_test::block_on(async {
4406    ///
4407    /// let builder = prepare_request_builder();
4408    /// let response = builder.send().await?;
4409    /// # gax::Result::<()>::Ok(()) });
4410    ///
4411    /// fn prepare_request_builder() -> GetLocation {
4412    ///   # panic!();
4413    ///   // ... details omitted ...
4414    /// }
4415    /// ```
4416    #[derive(Clone, Debug)]
4417    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4418
4419    impl GetLocation {
4420        pub(crate) fn new(
4421            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4422        ) -> Self {
4423            Self(RequestBuilder::new(stub))
4424        }
4425
4426        /// Sets the full request, replacing any prior values.
4427        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4428            self.0.request = v.into();
4429            self
4430        }
4431
4432        /// Sets all the options, replacing any prior values.
4433        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4434            self.0.options = v.into();
4435            self
4436        }
4437
4438        /// Sends the request.
4439        pub async fn send(self) -> Result<location::model::Location> {
4440            (*self.0.stub)
4441                .get_location(self.0.request, self.0.options)
4442                .await
4443                .map(gax::response::Response::into_body)
4444        }
4445
4446        /// Sets the value of [name][location::model::GetLocationRequest::name].
4447        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4448            self.0.request.name = v.into();
4449            self
4450        }
4451    }
4452
4453    #[doc(hidden)]
4454    impl gax::options::internal::RequestBuilder for GetLocation {
4455        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4456            &mut self.0.options
4457        }
4458    }
4459
4460    /// The request builder for [BareMetalSolution::get_operation][crate::client::BareMetalSolution::get_operation] calls.
4461    ///
4462    /// # Example
4463    /// ```no_run
4464    /// # use google_cloud_baremetalsolution_v2::builder;
4465    /// use builder::bare_metal_solution::GetOperation;
4466    /// # tokio_test::block_on(async {
4467    ///
4468    /// let builder = prepare_request_builder();
4469    /// let response = builder.send().await?;
4470    /// # gax::Result::<()>::Ok(()) });
4471    ///
4472    /// fn prepare_request_builder() -> GetOperation {
4473    ///   # panic!();
4474    ///   // ... details omitted ...
4475    /// }
4476    /// ```
4477    #[derive(Clone, Debug)]
4478    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4479
4480    impl GetOperation {
4481        pub(crate) fn new(
4482            stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4483        ) -> Self {
4484            Self(RequestBuilder::new(stub))
4485        }
4486
4487        /// Sets the full request, replacing any prior values.
4488        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4489            mut self,
4490            v: V,
4491        ) -> Self {
4492            self.0.request = v.into();
4493            self
4494        }
4495
4496        /// Sets all the options, replacing any prior values.
4497        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4498            self.0.options = v.into();
4499            self
4500        }
4501
4502        /// Sends the request.
4503        pub async fn send(self) -> Result<longrunning::model::Operation> {
4504            (*self.0.stub)
4505                .get_operation(self.0.request, self.0.options)
4506                .await
4507                .map(gax::response::Response::into_body)
4508        }
4509
4510        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4511        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4512            self.0.request.name = v.into();
4513            self
4514        }
4515    }
4516
4517    #[doc(hidden)]
4518    impl gax::options::internal::RequestBuilder for GetOperation {
4519        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4520            &mut self.0.options
4521        }
4522    }
4523}