Skip to main content

google_cloud_config_v1/
builder.rs

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