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