Skip to main content

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