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