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