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    /// # tokio_test::block_on(async {
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    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Config;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = Config;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::Config] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: gax::options::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [Config::list_deployments][crate::client::Config::list_deployments] calls.
73    ///
74    /// # Example
75    /// ```no_run
76    /// # use google_cloud_config_v1::builder;
77    /// use builder::config::ListDeployments;
78    /// # tokio_test::block_on(async {
79    /// use gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # gax::Result::<()>::Ok(()) });
87    ///
88    /// fn prepare_request_builder() -> ListDeployments {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[derive(Clone, Debug)]
94    pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
95
96    impl ListDeployments {
97        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
98            Self(RequestBuilder::new(stub))
99        }
100
101        /// Sets the full request, replacing any prior values.
102        pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
103            self.0.request = v.into();
104            self
105        }
106
107        /// Sets all the options, replacing any prior values.
108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109            self.0.options = v.into();
110            self
111        }
112
113        /// Sends the request.
114        pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
115            (*self.0.stub)
116                .list_deployments(self.0.request, self.0.options)
117                .await
118                .map(gax::response::Response::into_body)
119        }
120
121        /// Streams each page in the collection.
122        pub fn by_page(
123            self,
124        ) -> impl gax::paginator::Paginator<crate::model::ListDeploymentsResponse, gax::error::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            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 gax::paginator::ItemPaginator<crate::model::ListDeploymentsResponse, gax::error::Error>
140        {
141            use gax::paginator::Paginator;
142            self.by_page().items()
143        }
144
145        /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
146        ///
147        /// This is a **required** field for requests.
148        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
149            self.0.request.parent = v.into();
150            self
151        }
152
153        /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
154        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
155            self.0.request.page_size = v.into();
156            self
157        }
158
159        /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
160        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
161            self.0.request.page_token = v.into();
162            self
163        }
164
165        /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
166        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
167            self.0.request.filter = v.into();
168            self
169        }
170
171        /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
172        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
173            self.0.request.order_by = v.into();
174            self
175        }
176    }
177
178    #[doc(hidden)]
179    impl gax::options::internal::RequestBuilder for ListDeployments {
180        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
181            &mut self.0.options
182        }
183    }
184
185    /// The request builder for [Config::get_deployment][crate::client::Config::get_deployment] calls.
186    ///
187    /// # Example
188    /// ```no_run
189    /// # use google_cloud_config_v1::builder;
190    /// use builder::config::GetDeployment;
191    /// # tokio_test::block_on(async {
192    ///
193    /// let builder = prepare_request_builder();
194    /// let response = builder.send().await?;
195    /// # gax::Result::<()>::Ok(()) });
196    ///
197    /// fn prepare_request_builder() -> GetDeployment {
198    ///   # panic!();
199    ///   // ... details omitted ...
200    /// }
201    /// ```
202    #[derive(Clone, Debug)]
203    pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
204
205    impl GetDeployment {
206        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
207            Self(RequestBuilder::new(stub))
208        }
209
210        /// Sets the full request, replacing any prior values.
211        pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
212            self.0.request = v.into();
213            self
214        }
215
216        /// Sets all the options, replacing any prior values.
217        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
218            self.0.options = v.into();
219            self
220        }
221
222        /// Sends the request.
223        pub async fn send(self) -> Result<crate::model::Deployment> {
224            (*self.0.stub)
225                .get_deployment(self.0.request, self.0.options)
226                .await
227                .map(gax::response::Response::into_body)
228        }
229
230        /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
231        ///
232        /// This is a **required** field for requests.
233        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
234            self.0.request.name = v.into();
235            self
236        }
237    }
238
239    #[doc(hidden)]
240    impl gax::options::internal::RequestBuilder for GetDeployment {
241        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
242            &mut self.0.options
243        }
244    }
245
246    /// The request builder for [Config::create_deployment][crate::client::Config::create_deployment] calls.
247    ///
248    /// # Example
249    /// ```no_run
250    /// # use google_cloud_config_v1::builder;
251    /// use builder::config::CreateDeployment;
252    /// # tokio_test::block_on(async {
253    /// use lro::Poller;
254    ///
255    /// let builder = prepare_request_builder();
256    /// let response = builder.poller().until_done().await?;
257    /// # gax::Result::<()>::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<gax::options::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<longrunning::model::Operation> {
294            (*self.0.stub)
295                .create_deployment(self.0.request, self.0.options)
296                .await
297                .map(gax::response::Response::into_body)
298        }
299
300        /// Creates a [Poller][lro::Poller] to work with `create_deployment`.
301        pub fn poller(
302            self,
303        ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
304            type Operation =
305                lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
306            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
307            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
308
309            let stub = self.0.stub.clone();
310            let mut options = self.0.options.clone();
311            options.set_retry_policy(gax::retry_policy::NeverRetry);
312            let query = move |name| {
313                let stub = stub.clone();
314                let options = options.clone();
315                async {
316                    let op = GetOperation::new(stub)
317                        .set_name(name)
318                        .with_options(options)
319                        .send()
320                        .await?;
321                    Ok(Operation::new(op))
322                }
323            };
324
325            let start = move || async {
326                let op = self.send().await?;
327                Ok(Operation::new(op))
328            };
329
330            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
331        }
332
333        /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
334        ///
335        /// This is a **required** field for requests.
336        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
337            self.0.request.parent = v.into();
338            self
339        }
340
341        /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
342        ///
343        /// This is a **required** field for requests.
344        pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
345            self.0.request.deployment_id = v.into();
346            self
347        }
348
349        /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
350        ///
351        /// This is a **required** field for requests.
352        pub fn set_deployment<T>(mut self, v: T) -> Self
353        where
354            T: std::convert::Into<crate::model::Deployment>,
355        {
356            self.0.request.deployment = std::option::Option::Some(v.into());
357            self
358        }
359
360        /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
361        ///
362        /// This is a **required** field for requests.
363        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
364        where
365            T: std::convert::Into<crate::model::Deployment>,
366        {
367            self.0.request.deployment = v.map(|x| x.into());
368            self
369        }
370
371        /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
372        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373            self.0.request.request_id = v.into();
374            self
375        }
376    }
377
378    #[doc(hidden)]
379    impl gax::options::internal::RequestBuilder for CreateDeployment {
380        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
381            &mut self.0.options
382        }
383    }
384
385    /// The request builder for [Config::update_deployment][crate::client::Config::update_deployment] calls.
386    ///
387    /// # Example
388    /// ```no_run
389    /// # use google_cloud_config_v1::builder;
390    /// use builder::config::UpdateDeployment;
391    /// # tokio_test::block_on(async {
392    /// use lro::Poller;
393    ///
394    /// let builder = prepare_request_builder();
395    /// let response = builder.poller().until_done().await?;
396    /// # gax::Result::<()>::Ok(()) });
397    ///
398    /// fn prepare_request_builder() -> UpdateDeployment {
399    ///   # panic!();
400    ///   // ... details omitted ...
401    /// }
402    /// ```
403    #[derive(Clone, Debug)]
404    pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
405
406    impl UpdateDeployment {
407        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
408            Self(RequestBuilder::new(stub))
409        }
410
411        /// Sets the full request, replacing any prior values.
412        pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
413            mut self,
414            v: V,
415        ) -> Self {
416            self.0.request = v.into();
417            self
418        }
419
420        /// Sets all the options, replacing any prior values.
421        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422            self.0.options = v.into();
423            self
424        }
425
426        /// Sends the request.
427        ///
428        /// # Long running operations
429        ///
430        /// This starts, but does not poll, a longrunning operation. More information
431        /// on [update_deployment][crate::client::Config::update_deployment].
432        pub async fn send(self) -> Result<longrunning::model::Operation> {
433            (*self.0.stub)
434                .update_deployment(self.0.request, self.0.options)
435                .await
436                .map(gax::response::Response::into_body)
437        }
438
439        /// Creates a [Poller][lro::Poller] to work with `update_deployment`.
440        pub fn poller(
441            self,
442        ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
443            type Operation =
444                lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
445            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
446            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
447
448            let stub = self.0.stub.clone();
449            let mut options = self.0.options.clone();
450            options.set_retry_policy(gax::retry_policy::NeverRetry);
451            let query = move |name| {
452                let stub = stub.clone();
453                let options = options.clone();
454                async {
455                    let op = GetOperation::new(stub)
456                        .set_name(name)
457                        .with_options(options)
458                        .send()
459                        .await?;
460                    Ok(Operation::new(op))
461                }
462            };
463
464            let start = move || async {
465                let op = self.send().await?;
466                Ok(Operation::new(op))
467            };
468
469            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
470        }
471
472        /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
473        pub fn set_update_mask<T>(mut self, v: T) -> Self
474        where
475            T: std::convert::Into<wkt::FieldMask>,
476        {
477            self.0.request.update_mask = std::option::Option::Some(v.into());
478            self
479        }
480
481        /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
482        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
483        where
484            T: std::convert::Into<wkt::FieldMask>,
485        {
486            self.0.request.update_mask = v.map(|x| x.into());
487            self
488        }
489
490        /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
491        ///
492        /// This is a **required** field for requests.
493        pub fn set_deployment<T>(mut self, v: T) -> Self
494        where
495            T: std::convert::Into<crate::model::Deployment>,
496        {
497            self.0.request.deployment = std::option::Option::Some(v.into());
498            self
499        }
500
501        /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
502        ///
503        /// This is a **required** field for requests.
504        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
505        where
506            T: std::convert::Into<crate::model::Deployment>,
507        {
508            self.0.request.deployment = v.map(|x| x.into());
509            self
510        }
511
512        /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
513        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
514            self.0.request.request_id = v.into();
515            self
516        }
517    }
518
519    #[doc(hidden)]
520    impl gax::options::internal::RequestBuilder for UpdateDeployment {
521        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
522            &mut self.0.options
523        }
524    }
525
526    /// The request builder for [Config::delete_deployment][crate::client::Config::delete_deployment] calls.
527    ///
528    /// # Example
529    /// ```no_run
530    /// # use google_cloud_config_v1::builder;
531    /// use builder::config::DeleteDeployment;
532    /// # tokio_test::block_on(async {
533    /// use lro::Poller;
534    ///
535    /// let builder = prepare_request_builder();
536    /// let response = builder.poller().until_done().await?;
537    /// # gax::Result::<()>::Ok(()) });
538    ///
539    /// fn prepare_request_builder() -> DeleteDeployment {
540    ///   # panic!();
541    ///   // ... details omitted ...
542    /// }
543    /// ```
544    #[derive(Clone, Debug)]
545    pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
546
547    impl DeleteDeployment {
548        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
549            Self(RequestBuilder::new(stub))
550        }
551
552        /// Sets the full request, replacing any prior values.
553        pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
554            mut self,
555            v: V,
556        ) -> Self {
557            self.0.request = v.into();
558            self
559        }
560
561        /// Sets all the options, replacing any prior values.
562        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
563            self.0.options = v.into();
564            self
565        }
566
567        /// Sends the request.
568        ///
569        /// # Long running operations
570        ///
571        /// This starts, but does not poll, a longrunning operation. More information
572        /// on [delete_deployment][crate::client::Config::delete_deployment].
573        pub async fn send(self) -> Result<longrunning::model::Operation> {
574            (*self.0.stub)
575                .delete_deployment(self.0.request, self.0.options)
576                .await
577                .map(gax::response::Response::into_body)
578        }
579
580        /// Creates a [Poller][lro::Poller] to work with `delete_deployment`.
581        pub fn poller(
582            self,
583        ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
584            type Operation =
585                lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
586            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
587            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
588
589            let stub = self.0.stub.clone();
590            let mut options = self.0.options.clone();
591            options.set_retry_policy(gax::retry_policy::NeverRetry);
592            let query = move |name| {
593                let stub = stub.clone();
594                let options = options.clone();
595                async {
596                    let op = GetOperation::new(stub)
597                        .set_name(name)
598                        .with_options(options)
599                        .send()
600                        .await?;
601                    Ok(Operation::new(op))
602                }
603            };
604
605            let start = move || async {
606                let op = self.send().await?;
607                Ok(Operation::new(op))
608            };
609
610            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
611        }
612
613        /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
614        ///
615        /// This is a **required** field for requests.
616        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
617            self.0.request.name = v.into();
618            self
619        }
620
621        /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
622        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
623            self.0.request.request_id = v.into();
624            self
625        }
626
627        /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
628        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
629            self.0.request.force = v.into();
630            self
631        }
632
633        /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
634        pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
635            mut self,
636            v: T,
637        ) -> Self {
638            self.0.request.delete_policy = v.into();
639            self
640        }
641    }
642
643    #[doc(hidden)]
644    impl gax::options::internal::RequestBuilder for DeleteDeployment {
645        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
646            &mut self.0.options
647        }
648    }
649
650    /// The request builder for [Config::list_revisions][crate::client::Config::list_revisions] calls.
651    ///
652    /// # Example
653    /// ```no_run
654    /// # use google_cloud_config_v1::builder;
655    /// use builder::config::ListRevisions;
656    /// # tokio_test::block_on(async {
657    /// use gax::paginator::ItemPaginator;
658    ///
659    /// let builder = prepare_request_builder();
660    /// let mut items = builder.by_item();
661    /// while let Some(result) = items.next().await {
662    ///   let item = result?;
663    /// }
664    /// # gax::Result::<()>::Ok(()) });
665    ///
666    /// fn prepare_request_builder() -> ListRevisions {
667    ///   # panic!();
668    ///   // ... details omitted ...
669    /// }
670    /// ```
671    #[derive(Clone, Debug)]
672    pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
673
674    impl ListRevisions {
675        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
676            Self(RequestBuilder::new(stub))
677        }
678
679        /// Sets the full request, replacing any prior values.
680        pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
681            self.0.request = v.into();
682            self
683        }
684
685        /// Sets all the options, replacing any prior values.
686        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
687            self.0.options = v.into();
688            self
689        }
690
691        /// Sends the request.
692        pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
693            (*self.0.stub)
694                .list_revisions(self.0.request, self.0.options)
695                .await
696                .map(gax::response::Response::into_body)
697        }
698
699        /// Streams each page in the collection.
700        pub fn by_page(
701            self,
702        ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
703        {
704            use std::clone::Clone;
705            let token = self.0.request.page_token.clone();
706            let execute = move |token: String| {
707                let mut builder = self.clone();
708                builder.0.request = builder.0.request.set_page_token(token);
709                builder.send()
710            };
711            gax::paginator::internal::new_paginator(token, execute)
712        }
713
714        /// Streams each item in the collection.
715        pub fn by_item(
716            self,
717        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
718        {
719            use gax::paginator::Paginator;
720            self.by_page().items()
721        }
722
723        /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
724        ///
725        /// This is a **required** field for requests.
726        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
727            self.0.request.parent = v.into();
728            self
729        }
730
731        /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
732        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
733            self.0.request.page_size = v.into();
734            self
735        }
736
737        /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
738        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
739            self.0.request.page_token = v.into();
740            self
741        }
742
743        /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
744        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
745            self.0.request.filter = v.into();
746            self
747        }
748
749        /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
750        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
751            self.0.request.order_by = v.into();
752            self
753        }
754    }
755
756    #[doc(hidden)]
757    impl gax::options::internal::RequestBuilder for ListRevisions {
758        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
759            &mut self.0.options
760        }
761    }
762
763    /// The request builder for [Config::get_revision][crate::client::Config::get_revision] calls.
764    ///
765    /// # Example
766    /// ```no_run
767    /// # use google_cloud_config_v1::builder;
768    /// use builder::config::GetRevision;
769    /// # tokio_test::block_on(async {
770    ///
771    /// let builder = prepare_request_builder();
772    /// let response = builder.send().await?;
773    /// # gax::Result::<()>::Ok(()) });
774    ///
775    /// fn prepare_request_builder() -> GetRevision {
776    ///   # panic!();
777    ///   // ... details omitted ...
778    /// }
779    /// ```
780    #[derive(Clone, Debug)]
781    pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
782
783    impl GetRevision {
784        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
785            Self(RequestBuilder::new(stub))
786        }
787
788        /// Sets the full request, replacing any prior values.
789        pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
790            self.0.request = v.into();
791            self
792        }
793
794        /// Sets all the options, replacing any prior values.
795        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
796            self.0.options = v.into();
797            self
798        }
799
800        /// Sends the request.
801        pub async fn send(self) -> Result<crate::model::Revision> {
802            (*self.0.stub)
803                .get_revision(self.0.request, self.0.options)
804                .await
805                .map(gax::response::Response::into_body)
806        }
807
808        /// Sets the value of [name][crate::model::GetRevisionRequest::name].
809        ///
810        /// This is a **required** field for requests.
811        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
812            self.0.request.name = v.into();
813            self
814        }
815    }
816
817    #[doc(hidden)]
818    impl gax::options::internal::RequestBuilder for GetRevision {
819        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
820            &mut self.0.options
821        }
822    }
823
824    /// The request builder for [Config::get_resource][crate::client::Config::get_resource] calls.
825    ///
826    /// # Example
827    /// ```no_run
828    /// # use google_cloud_config_v1::builder;
829    /// use builder::config::GetResource;
830    /// # tokio_test::block_on(async {
831    ///
832    /// let builder = prepare_request_builder();
833    /// let response = builder.send().await?;
834    /// # gax::Result::<()>::Ok(()) });
835    ///
836    /// fn prepare_request_builder() -> GetResource {
837    ///   # panic!();
838    ///   // ... details omitted ...
839    /// }
840    /// ```
841    #[derive(Clone, Debug)]
842    pub struct GetResource(RequestBuilder<crate::model::GetResourceRequest>);
843
844    impl GetResource {
845        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
846            Self(RequestBuilder::new(stub))
847        }
848
849        /// Sets the full request, replacing any prior values.
850        pub fn with_request<V: Into<crate::model::GetResourceRequest>>(mut self, v: V) -> Self {
851            self.0.request = v.into();
852            self
853        }
854
855        /// Sets all the options, replacing any prior values.
856        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
857            self.0.options = v.into();
858            self
859        }
860
861        /// Sends the request.
862        pub async fn send(self) -> Result<crate::model::Resource> {
863            (*self.0.stub)
864                .get_resource(self.0.request, self.0.options)
865                .await
866                .map(gax::response::Response::into_body)
867        }
868
869        /// Sets the value of [name][crate::model::GetResourceRequest::name].
870        ///
871        /// This is a **required** field for requests.
872        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
873            self.0.request.name = v.into();
874            self
875        }
876    }
877
878    #[doc(hidden)]
879    impl gax::options::internal::RequestBuilder for GetResource {
880        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
881            &mut self.0.options
882        }
883    }
884
885    /// The request builder for [Config::list_resources][crate::client::Config::list_resources] calls.
886    ///
887    /// # Example
888    /// ```no_run
889    /// # use google_cloud_config_v1::builder;
890    /// use builder::config::ListResources;
891    /// # tokio_test::block_on(async {
892    /// use gax::paginator::ItemPaginator;
893    ///
894    /// let builder = prepare_request_builder();
895    /// let mut items = builder.by_item();
896    /// while let Some(result) = items.next().await {
897    ///   let item = result?;
898    /// }
899    /// # gax::Result::<()>::Ok(()) });
900    ///
901    /// fn prepare_request_builder() -> ListResources {
902    ///   # panic!();
903    ///   // ... details omitted ...
904    /// }
905    /// ```
906    #[derive(Clone, Debug)]
907    pub struct ListResources(RequestBuilder<crate::model::ListResourcesRequest>);
908
909    impl ListResources {
910        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
911            Self(RequestBuilder::new(stub))
912        }
913
914        /// Sets the full request, replacing any prior values.
915        pub fn with_request<V: Into<crate::model::ListResourcesRequest>>(mut self, v: V) -> Self {
916            self.0.request = v.into();
917            self
918        }
919
920        /// Sets all the options, replacing any prior values.
921        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
922            self.0.options = v.into();
923            self
924        }
925
926        /// Sends the request.
927        pub async fn send(self) -> Result<crate::model::ListResourcesResponse> {
928            (*self.0.stub)
929                .list_resources(self.0.request, self.0.options)
930                .await
931                .map(gax::response::Response::into_body)
932        }
933
934        /// Streams each page in the collection.
935        pub fn by_page(
936            self,
937        ) -> impl gax::paginator::Paginator<crate::model::ListResourcesResponse, gax::error::Error>
938        {
939            use std::clone::Clone;
940            let token = self.0.request.page_token.clone();
941            let execute = move |token: String| {
942                let mut builder = self.clone();
943                builder.0.request = builder.0.request.set_page_token(token);
944                builder.send()
945            };
946            gax::paginator::internal::new_paginator(token, execute)
947        }
948
949        /// Streams each item in the collection.
950        pub fn by_item(
951            self,
952        ) -> impl gax::paginator::ItemPaginator<crate::model::ListResourcesResponse, gax::error::Error>
953        {
954            use gax::paginator::Paginator;
955            self.by_page().items()
956        }
957
958        /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
959        ///
960        /// This is a **required** field for requests.
961        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
962            self.0.request.parent = v.into();
963            self
964        }
965
966        /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
967        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
968            self.0.request.page_size = v.into();
969            self
970        }
971
972        /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
973        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
974            self.0.request.page_token = v.into();
975            self
976        }
977
978        /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
979        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
980            self.0.request.filter = v.into();
981            self
982        }
983
984        /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
985        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
986            self.0.request.order_by = v.into();
987            self
988        }
989    }
990
991    #[doc(hidden)]
992    impl gax::options::internal::RequestBuilder for ListResources {
993        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
994            &mut self.0.options
995        }
996    }
997
998    /// The request builder for [Config::export_deployment_statefile][crate::client::Config::export_deployment_statefile] calls.
999    ///
1000    /// # Example
1001    /// ```no_run
1002    /// # use google_cloud_config_v1::builder;
1003    /// use builder::config::ExportDeploymentStatefile;
1004    /// # tokio_test::block_on(async {
1005    ///
1006    /// let builder = prepare_request_builder();
1007    /// let response = builder.send().await?;
1008    /// # gax::Result::<()>::Ok(()) });
1009    ///
1010    /// fn prepare_request_builder() -> ExportDeploymentStatefile {
1011    ///   # panic!();
1012    ///   // ... details omitted ...
1013    /// }
1014    /// ```
1015    #[derive(Clone, Debug)]
1016    pub struct ExportDeploymentStatefile(
1017        RequestBuilder<crate::model::ExportDeploymentStatefileRequest>,
1018    );
1019
1020    impl ExportDeploymentStatefile {
1021        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1022            Self(RequestBuilder::new(stub))
1023        }
1024
1025        /// Sets the full request, replacing any prior values.
1026        pub fn with_request<V: Into<crate::model::ExportDeploymentStatefileRequest>>(
1027            mut self,
1028            v: V,
1029        ) -> Self {
1030            self.0.request = v.into();
1031            self
1032        }
1033
1034        /// Sets all the options, replacing any prior values.
1035        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1036            self.0.options = v.into();
1037            self
1038        }
1039
1040        /// Sends the request.
1041        pub async fn send(self) -> Result<crate::model::Statefile> {
1042            (*self.0.stub)
1043                .export_deployment_statefile(self.0.request, self.0.options)
1044                .await
1045                .map(gax::response::Response::into_body)
1046        }
1047
1048        /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
1049        ///
1050        /// This is a **required** field for requests.
1051        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052            self.0.request.parent = v.into();
1053            self
1054        }
1055
1056        /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
1057        pub fn set_draft<T: Into<bool>>(mut self, v: T) -> Self {
1058            self.0.request.draft = v.into();
1059            self
1060        }
1061    }
1062
1063    #[doc(hidden)]
1064    impl gax::options::internal::RequestBuilder for ExportDeploymentStatefile {
1065        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1066            &mut self.0.options
1067        }
1068    }
1069
1070    /// The request builder for [Config::export_revision_statefile][crate::client::Config::export_revision_statefile] calls.
1071    ///
1072    /// # Example
1073    /// ```no_run
1074    /// # use google_cloud_config_v1::builder;
1075    /// use builder::config::ExportRevisionStatefile;
1076    /// # tokio_test::block_on(async {
1077    ///
1078    /// let builder = prepare_request_builder();
1079    /// let response = builder.send().await?;
1080    /// # gax::Result::<()>::Ok(()) });
1081    ///
1082    /// fn prepare_request_builder() -> ExportRevisionStatefile {
1083    ///   # panic!();
1084    ///   // ... details omitted ...
1085    /// }
1086    /// ```
1087    #[derive(Clone, Debug)]
1088    pub struct ExportRevisionStatefile(
1089        RequestBuilder<crate::model::ExportRevisionStatefileRequest>,
1090    );
1091
1092    impl ExportRevisionStatefile {
1093        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1094            Self(RequestBuilder::new(stub))
1095        }
1096
1097        /// Sets the full request, replacing any prior values.
1098        pub fn with_request<V: Into<crate::model::ExportRevisionStatefileRequest>>(
1099            mut self,
1100            v: V,
1101        ) -> Self {
1102            self.0.request = v.into();
1103            self
1104        }
1105
1106        /// Sets all the options, replacing any prior values.
1107        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1108            self.0.options = v.into();
1109            self
1110        }
1111
1112        /// Sends the request.
1113        pub async fn send(self) -> Result<crate::model::Statefile> {
1114            (*self.0.stub)
1115                .export_revision_statefile(self.0.request, self.0.options)
1116                .await
1117                .map(gax::response::Response::into_body)
1118        }
1119
1120        /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
1121        ///
1122        /// This is a **required** field for requests.
1123        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124            self.0.request.parent = v.into();
1125            self
1126        }
1127    }
1128
1129    #[doc(hidden)]
1130    impl gax::options::internal::RequestBuilder for ExportRevisionStatefile {
1131        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1132            &mut self.0.options
1133        }
1134    }
1135
1136    /// The request builder for [Config::import_statefile][crate::client::Config::import_statefile] calls.
1137    ///
1138    /// # Example
1139    /// ```no_run
1140    /// # use google_cloud_config_v1::builder;
1141    /// use builder::config::ImportStatefile;
1142    /// # tokio_test::block_on(async {
1143    ///
1144    /// let builder = prepare_request_builder();
1145    /// let response = builder.send().await?;
1146    /// # gax::Result::<()>::Ok(()) });
1147    ///
1148    /// fn prepare_request_builder() -> ImportStatefile {
1149    ///   # panic!();
1150    ///   // ... details omitted ...
1151    /// }
1152    /// ```
1153    #[derive(Clone, Debug)]
1154    pub struct ImportStatefile(RequestBuilder<crate::model::ImportStatefileRequest>);
1155
1156    impl ImportStatefile {
1157        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1158            Self(RequestBuilder::new(stub))
1159        }
1160
1161        /// Sets the full request, replacing any prior values.
1162        pub fn with_request<V: Into<crate::model::ImportStatefileRequest>>(mut self, v: V) -> Self {
1163            self.0.request = v.into();
1164            self
1165        }
1166
1167        /// Sets all the options, replacing any prior values.
1168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1169            self.0.options = v.into();
1170            self
1171        }
1172
1173        /// Sends the request.
1174        pub async fn send(self) -> Result<crate::model::Statefile> {
1175            (*self.0.stub)
1176                .import_statefile(self.0.request, self.0.options)
1177                .await
1178                .map(gax::response::Response::into_body)
1179        }
1180
1181        /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
1182        ///
1183        /// This is a **required** field for requests.
1184        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185            self.0.request.parent = v.into();
1186            self
1187        }
1188
1189        /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
1190        ///
1191        /// This is a **required** field for requests.
1192        pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1193            self.0.request.lock_id = v.into();
1194            self
1195        }
1196
1197        /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
1198        pub fn set_skip_draft<T: Into<bool>>(mut self, v: T) -> Self {
1199            self.0.request.skip_draft = v.into();
1200            self
1201        }
1202    }
1203
1204    #[doc(hidden)]
1205    impl gax::options::internal::RequestBuilder for ImportStatefile {
1206        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1207            &mut self.0.options
1208        }
1209    }
1210
1211    /// The request builder for [Config::delete_statefile][crate::client::Config::delete_statefile] calls.
1212    ///
1213    /// # Example
1214    /// ```no_run
1215    /// # use google_cloud_config_v1::builder;
1216    /// use builder::config::DeleteStatefile;
1217    /// # tokio_test::block_on(async {
1218    ///
1219    /// let builder = prepare_request_builder();
1220    /// let response = builder.send().await?;
1221    /// # gax::Result::<()>::Ok(()) });
1222    ///
1223    /// fn prepare_request_builder() -> DeleteStatefile {
1224    ///   # panic!();
1225    ///   // ... details omitted ...
1226    /// }
1227    /// ```
1228    #[derive(Clone, Debug)]
1229    pub struct DeleteStatefile(RequestBuilder<crate::model::DeleteStatefileRequest>);
1230
1231    impl DeleteStatefile {
1232        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1233            Self(RequestBuilder::new(stub))
1234        }
1235
1236        /// Sets the full request, replacing any prior values.
1237        pub fn with_request<V: Into<crate::model::DeleteStatefileRequest>>(mut self, v: V) -> Self {
1238            self.0.request = v.into();
1239            self
1240        }
1241
1242        /// Sets all the options, replacing any prior values.
1243        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1244            self.0.options = v.into();
1245            self
1246        }
1247
1248        /// Sends the request.
1249        pub async fn send(self) -> Result<()> {
1250            (*self.0.stub)
1251                .delete_statefile(self.0.request, self.0.options)
1252                .await
1253                .map(gax::response::Response::into_body)
1254        }
1255
1256        /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
1257        ///
1258        /// This is a **required** field for requests.
1259        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260            self.0.request.name = v.into();
1261            self
1262        }
1263
1264        /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
1265        ///
1266        /// This is a **required** field for requests.
1267        pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1268            self.0.request.lock_id = v.into();
1269            self
1270        }
1271    }
1272
1273    #[doc(hidden)]
1274    impl gax::options::internal::RequestBuilder for DeleteStatefile {
1275        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1276            &mut self.0.options
1277        }
1278    }
1279
1280    /// The request builder for [Config::lock_deployment][crate::client::Config::lock_deployment] calls.
1281    ///
1282    /// # Example
1283    /// ```no_run
1284    /// # use google_cloud_config_v1::builder;
1285    /// use builder::config::LockDeployment;
1286    /// # tokio_test::block_on(async {
1287    /// use lro::Poller;
1288    ///
1289    /// let builder = prepare_request_builder();
1290    /// let response = builder.poller().until_done().await?;
1291    /// # gax::Result::<()>::Ok(()) });
1292    ///
1293    /// fn prepare_request_builder() -> LockDeployment {
1294    ///   # panic!();
1295    ///   // ... details omitted ...
1296    /// }
1297    /// ```
1298    #[derive(Clone, Debug)]
1299    pub struct LockDeployment(RequestBuilder<crate::model::LockDeploymentRequest>);
1300
1301    impl LockDeployment {
1302        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1303            Self(RequestBuilder::new(stub))
1304        }
1305
1306        /// Sets the full request, replacing any prior values.
1307        pub fn with_request<V: Into<crate::model::LockDeploymentRequest>>(mut self, v: V) -> Self {
1308            self.0.request = v.into();
1309            self
1310        }
1311
1312        /// Sets all the options, replacing any prior values.
1313        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1314            self.0.options = v.into();
1315            self
1316        }
1317
1318        /// Sends the request.
1319        ///
1320        /// # Long running operations
1321        ///
1322        /// This starts, but does not poll, a longrunning operation. More information
1323        /// on [lock_deployment][crate::client::Config::lock_deployment].
1324        pub async fn send(self) -> Result<longrunning::model::Operation> {
1325            (*self.0.stub)
1326                .lock_deployment(self.0.request, self.0.options)
1327                .await
1328                .map(gax::response::Response::into_body)
1329        }
1330
1331        /// Creates a [Poller][lro::Poller] to work with `lock_deployment`.
1332        pub fn poller(
1333            self,
1334        ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1335            type Operation =
1336                lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1337            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1338            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1339
1340            let stub = self.0.stub.clone();
1341            let mut options = self.0.options.clone();
1342            options.set_retry_policy(gax::retry_policy::NeverRetry);
1343            let query = move |name| {
1344                let stub = stub.clone();
1345                let options = options.clone();
1346                async {
1347                    let op = GetOperation::new(stub)
1348                        .set_name(name)
1349                        .with_options(options)
1350                        .send()
1351                        .await?;
1352                    Ok(Operation::new(op))
1353                }
1354            };
1355
1356            let start = move || async {
1357                let op = self.send().await?;
1358                Ok(Operation::new(op))
1359            };
1360
1361            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1362        }
1363
1364        /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
1365        ///
1366        /// This is a **required** field for requests.
1367        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1368            self.0.request.name = v.into();
1369            self
1370        }
1371    }
1372
1373    #[doc(hidden)]
1374    impl gax::options::internal::RequestBuilder for LockDeployment {
1375        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1376            &mut self.0.options
1377        }
1378    }
1379
1380    /// The request builder for [Config::unlock_deployment][crate::client::Config::unlock_deployment] calls.
1381    ///
1382    /// # Example
1383    /// ```no_run
1384    /// # use google_cloud_config_v1::builder;
1385    /// use builder::config::UnlockDeployment;
1386    /// # tokio_test::block_on(async {
1387    /// use lro::Poller;
1388    ///
1389    /// let builder = prepare_request_builder();
1390    /// let response = builder.poller().until_done().await?;
1391    /// # gax::Result::<()>::Ok(()) });
1392    ///
1393    /// fn prepare_request_builder() -> UnlockDeployment {
1394    ///   # panic!();
1395    ///   // ... details omitted ...
1396    /// }
1397    /// ```
1398    #[derive(Clone, Debug)]
1399    pub struct UnlockDeployment(RequestBuilder<crate::model::UnlockDeploymentRequest>);
1400
1401    impl UnlockDeployment {
1402        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1403            Self(RequestBuilder::new(stub))
1404        }
1405
1406        /// Sets the full request, replacing any prior values.
1407        pub fn with_request<V: Into<crate::model::UnlockDeploymentRequest>>(
1408            mut self,
1409            v: V,
1410        ) -> Self {
1411            self.0.request = v.into();
1412            self
1413        }
1414
1415        /// Sets all the options, replacing any prior values.
1416        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1417            self.0.options = v.into();
1418            self
1419        }
1420
1421        /// Sends the request.
1422        ///
1423        /// # Long running operations
1424        ///
1425        /// This starts, but does not poll, a longrunning operation. More information
1426        /// on [unlock_deployment][crate::client::Config::unlock_deployment].
1427        pub async fn send(self) -> Result<longrunning::model::Operation> {
1428            (*self.0.stub)
1429                .unlock_deployment(self.0.request, self.0.options)
1430                .await
1431                .map(gax::response::Response::into_body)
1432        }
1433
1434        /// Creates a [Poller][lro::Poller] to work with `unlock_deployment`.
1435        pub fn poller(
1436            self,
1437        ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1438            type Operation =
1439                lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1440            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1441            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1442
1443            let stub = self.0.stub.clone();
1444            let mut options = self.0.options.clone();
1445            options.set_retry_policy(gax::retry_policy::NeverRetry);
1446            let query = move |name| {
1447                let stub = stub.clone();
1448                let options = options.clone();
1449                async {
1450                    let op = GetOperation::new(stub)
1451                        .set_name(name)
1452                        .with_options(options)
1453                        .send()
1454                        .await?;
1455                    Ok(Operation::new(op))
1456                }
1457            };
1458
1459            let start = move || async {
1460                let op = self.send().await?;
1461                Ok(Operation::new(op))
1462            };
1463
1464            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1465        }
1466
1467        /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
1468        ///
1469        /// This is a **required** field for requests.
1470        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1471            self.0.request.name = v.into();
1472            self
1473        }
1474
1475        /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
1476        ///
1477        /// This is a **required** field for requests.
1478        pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1479            self.0.request.lock_id = v.into();
1480            self
1481        }
1482    }
1483
1484    #[doc(hidden)]
1485    impl gax::options::internal::RequestBuilder for UnlockDeployment {
1486        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1487            &mut self.0.options
1488        }
1489    }
1490
1491    /// The request builder for [Config::export_lock_info][crate::client::Config::export_lock_info] calls.
1492    ///
1493    /// # Example
1494    /// ```no_run
1495    /// # use google_cloud_config_v1::builder;
1496    /// use builder::config::ExportLockInfo;
1497    /// # tokio_test::block_on(async {
1498    ///
1499    /// let builder = prepare_request_builder();
1500    /// let response = builder.send().await?;
1501    /// # gax::Result::<()>::Ok(()) });
1502    ///
1503    /// fn prepare_request_builder() -> ExportLockInfo {
1504    ///   # panic!();
1505    ///   // ... details omitted ...
1506    /// }
1507    /// ```
1508    #[derive(Clone, Debug)]
1509    pub struct ExportLockInfo(RequestBuilder<crate::model::ExportLockInfoRequest>);
1510
1511    impl ExportLockInfo {
1512        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1513            Self(RequestBuilder::new(stub))
1514        }
1515
1516        /// Sets the full request, replacing any prior values.
1517        pub fn with_request<V: Into<crate::model::ExportLockInfoRequest>>(mut self, v: V) -> Self {
1518            self.0.request = v.into();
1519            self
1520        }
1521
1522        /// Sets all the options, replacing any prior values.
1523        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1524            self.0.options = v.into();
1525            self
1526        }
1527
1528        /// Sends the request.
1529        pub async fn send(self) -> Result<crate::model::LockInfo> {
1530            (*self.0.stub)
1531                .export_lock_info(self.0.request, self.0.options)
1532                .await
1533                .map(gax::response::Response::into_body)
1534        }
1535
1536        /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
1537        ///
1538        /// This is a **required** field for requests.
1539        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540            self.0.request.name = v.into();
1541            self
1542        }
1543    }
1544
1545    #[doc(hidden)]
1546    impl gax::options::internal::RequestBuilder for ExportLockInfo {
1547        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1548            &mut self.0.options
1549        }
1550    }
1551
1552    /// The request builder for [Config::create_preview][crate::client::Config::create_preview] calls.
1553    ///
1554    /// # Example
1555    /// ```no_run
1556    /// # use google_cloud_config_v1::builder;
1557    /// use builder::config::CreatePreview;
1558    /// # tokio_test::block_on(async {
1559    /// use lro::Poller;
1560    ///
1561    /// let builder = prepare_request_builder();
1562    /// let response = builder.poller().until_done().await?;
1563    /// # gax::Result::<()>::Ok(()) });
1564    ///
1565    /// fn prepare_request_builder() -> CreatePreview {
1566    ///   # panic!();
1567    ///   // ... details omitted ...
1568    /// }
1569    /// ```
1570    #[derive(Clone, Debug)]
1571    pub struct CreatePreview(RequestBuilder<crate::model::CreatePreviewRequest>);
1572
1573    impl CreatePreview {
1574        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1575            Self(RequestBuilder::new(stub))
1576        }
1577
1578        /// Sets the full request, replacing any prior values.
1579        pub fn with_request<V: Into<crate::model::CreatePreviewRequest>>(mut self, v: V) -> Self {
1580            self.0.request = v.into();
1581            self
1582        }
1583
1584        /// Sets all the options, replacing any prior values.
1585        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1586            self.0.options = v.into();
1587            self
1588        }
1589
1590        /// Sends the request.
1591        ///
1592        /// # Long running operations
1593        ///
1594        /// This starts, but does not poll, a longrunning operation. More information
1595        /// on [create_preview][crate::client::Config::create_preview].
1596        pub async fn send(self) -> Result<longrunning::model::Operation> {
1597            (*self.0.stub)
1598                .create_preview(self.0.request, self.0.options)
1599                .await
1600                .map(gax::response::Response::into_body)
1601        }
1602
1603        /// Creates a [Poller][lro::Poller] to work with `create_preview`.
1604        pub fn poller(
1605            self,
1606        ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1607            type Operation =
1608                lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1609            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1610            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1611
1612            let stub = self.0.stub.clone();
1613            let mut options = self.0.options.clone();
1614            options.set_retry_policy(gax::retry_policy::NeverRetry);
1615            let query = move |name| {
1616                let stub = stub.clone();
1617                let options = options.clone();
1618                async {
1619                    let op = GetOperation::new(stub)
1620                        .set_name(name)
1621                        .with_options(options)
1622                        .send()
1623                        .await?;
1624                    Ok(Operation::new(op))
1625                }
1626            };
1627
1628            let start = move || async {
1629                let op = self.send().await?;
1630                Ok(Operation::new(op))
1631            };
1632
1633            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1634        }
1635
1636        /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
1637        ///
1638        /// This is a **required** field for requests.
1639        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1640            self.0.request.parent = v.into();
1641            self
1642        }
1643
1644        /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
1645        pub fn set_preview_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646            self.0.request.preview_id = v.into();
1647            self
1648        }
1649
1650        /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
1651        ///
1652        /// This is a **required** field for requests.
1653        pub fn set_preview<T>(mut self, v: T) -> Self
1654        where
1655            T: std::convert::Into<crate::model::Preview>,
1656        {
1657            self.0.request.preview = std::option::Option::Some(v.into());
1658            self
1659        }
1660
1661        /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
1662        ///
1663        /// This is a **required** field for requests.
1664        pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
1665        where
1666            T: std::convert::Into<crate::model::Preview>,
1667        {
1668            self.0.request.preview = v.map(|x| x.into());
1669            self
1670        }
1671
1672        /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
1673        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1674            self.0.request.request_id = v.into();
1675            self
1676        }
1677    }
1678
1679    #[doc(hidden)]
1680    impl gax::options::internal::RequestBuilder for CreatePreview {
1681        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1682            &mut self.0.options
1683        }
1684    }
1685
1686    /// The request builder for [Config::get_preview][crate::client::Config::get_preview] calls.
1687    ///
1688    /// # Example
1689    /// ```no_run
1690    /// # use google_cloud_config_v1::builder;
1691    /// use builder::config::GetPreview;
1692    /// # tokio_test::block_on(async {
1693    ///
1694    /// let builder = prepare_request_builder();
1695    /// let response = builder.send().await?;
1696    /// # gax::Result::<()>::Ok(()) });
1697    ///
1698    /// fn prepare_request_builder() -> GetPreview {
1699    ///   # panic!();
1700    ///   // ... details omitted ...
1701    /// }
1702    /// ```
1703    #[derive(Clone, Debug)]
1704    pub struct GetPreview(RequestBuilder<crate::model::GetPreviewRequest>);
1705
1706    impl GetPreview {
1707        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1708            Self(RequestBuilder::new(stub))
1709        }
1710
1711        /// Sets the full request, replacing any prior values.
1712        pub fn with_request<V: Into<crate::model::GetPreviewRequest>>(mut self, v: V) -> Self {
1713            self.0.request = v.into();
1714            self
1715        }
1716
1717        /// Sets all the options, replacing any prior values.
1718        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1719            self.0.options = v.into();
1720            self
1721        }
1722
1723        /// Sends the request.
1724        pub async fn send(self) -> Result<crate::model::Preview> {
1725            (*self.0.stub)
1726                .get_preview(self.0.request, self.0.options)
1727                .await
1728                .map(gax::response::Response::into_body)
1729        }
1730
1731        /// Sets the value of [name][crate::model::GetPreviewRequest::name].
1732        ///
1733        /// This is a **required** field for requests.
1734        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735            self.0.request.name = v.into();
1736            self
1737        }
1738    }
1739
1740    #[doc(hidden)]
1741    impl gax::options::internal::RequestBuilder for GetPreview {
1742        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1743            &mut self.0.options
1744        }
1745    }
1746
1747    /// The request builder for [Config::list_previews][crate::client::Config::list_previews] calls.
1748    ///
1749    /// # Example
1750    /// ```no_run
1751    /// # use google_cloud_config_v1::builder;
1752    /// use builder::config::ListPreviews;
1753    /// # tokio_test::block_on(async {
1754    /// use gax::paginator::ItemPaginator;
1755    ///
1756    /// let builder = prepare_request_builder();
1757    /// let mut items = builder.by_item();
1758    /// while let Some(result) = items.next().await {
1759    ///   let item = result?;
1760    /// }
1761    /// # gax::Result::<()>::Ok(()) });
1762    ///
1763    /// fn prepare_request_builder() -> ListPreviews {
1764    ///   # panic!();
1765    ///   // ... details omitted ...
1766    /// }
1767    /// ```
1768    #[derive(Clone, Debug)]
1769    pub struct ListPreviews(RequestBuilder<crate::model::ListPreviewsRequest>);
1770
1771    impl ListPreviews {
1772        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1773            Self(RequestBuilder::new(stub))
1774        }
1775
1776        /// Sets the full request, replacing any prior values.
1777        pub fn with_request<V: Into<crate::model::ListPreviewsRequest>>(mut self, v: V) -> Self {
1778            self.0.request = v.into();
1779            self
1780        }
1781
1782        /// Sets all the options, replacing any prior values.
1783        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1784            self.0.options = v.into();
1785            self
1786        }
1787
1788        /// Sends the request.
1789        pub async fn send(self) -> Result<crate::model::ListPreviewsResponse> {
1790            (*self.0.stub)
1791                .list_previews(self.0.request, self.0.options)
1792                .await
1793                .map(gax::response::Response::into_body)
1794        }
1795
1796        /// Streams each page in the collection.
1797        pub fn by_page(
1798            self,
1799        ) -> impl gax::paginator::Paginator<crate::model::ListPreviewsResponse, gax::error::Error>
1800        {
1801            use std::clone::Clone;
1802            let token = self.0.request.page_token.clone();
1803            let execute = move |token: String| {
1804                let mut builder = self.clone();
1805                builder.0.request = builder.0.request.set_page_token(token);
1806                builder.send()
1807            };
1808            gax::paginator::internal::new_paginator(token, execute)
1809        }
1810
1811        /// Streams each item in the collection.
1812        pub fn by_item(
1813            self,
1814        ) -> impl gax::paginator::ItemPaginator<crate::model::ListPreviewsResponse, gax::error::Error>
1815        {
1816            use gax::paginator::Paginator;
1817            self.by_page().items()
1818        }
1819
1820        /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
1821        ///
1822        /// This is a **required** field for requests.
1823        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1824            self.0.request.parent = v.into();
1825            self
1826        }
1827
1828        /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
1829        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1830            self.0.request.page_size = v.into();
1831            self
1832        }
1833
1834        /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
1835        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1836            self.0.request.page_token = v.into();
1837            self
1838        }
1839
1840        /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
1841        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842            self.0.request.filter = v.into();
1843            self
1844        }
1845
1846        /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
1847        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1848            self.0.request.order_by = v.into();
1849            self
1850        }
1851    }
1852
1853    #[doc(hidden)]
1854    impl gax::options::internal::RequestBuilder for ListPreviews {
1855        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1856            &mut self.0.options
1857        }
1858    }
1859
1860    /// The request builder for [Config::delete_preview][crate::client::Config::delete_preview] calls.
1861    ///
1862    /// # Example
1863    /// ```no_run
1864    /// # use google_cloud_config_v1::builder;
1865    /// use builder::config::DeletePreview;
1866    /// # tokio_test::block_on(async {
1867    /// use lro::Poller;
1868    ///
1869    /// let builder = prepare_request_builder();
1870    /// let response = builder.poller().until_done().await?;
1871    /// # gax::Result::<()>::Ok(()) });
1872    ///
1873    /// fn prepare_request_builder() -> DeletePreview {
1874    ///   # panic!();
1875    ///   // ... details omitted ...
1876    /// }
1877    /// ```
1878    #[derive(Clone, Debug)]
1879    pub struct DeletePreview(RequestBuilder<crate::model::DeletePreviewRequest>);
1880
1881    impl DeletePreview {
1882        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1883            Self(RequestBuilder::new(stub))
1884        }
1885
1886        /// Sets the full request, replacing any prior values.
1887        pub fn with_request<V: Into<crate::model::DeletePreviewRequest>>(mut self, v: V) -> Self {
1888            self.0.request = v.into();
1889            self
1890        }
1891
1892        /// Sets all the options, replacing any prior values.
1893        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1894            self.0.options = v.into();
1895            self
1896        }
1897
1898        /// Sends the request.
1899        ///
1900        /// # Long running operations
1901        ///
1902        /// This starts, but does not poll, a longrunning operation. More information
1903        /// on [delete_preview][crate::client::Config::delete_preview].
1904        pub async fn send(self) -> Result<longrunning::model::Operation> {
1905            (*self.0.stub)
1906                .delete_preview(self.0.request, self.0.options)
1907                .await
1908                .map(gax::response::Response::into_body)
1909        }
1910
1911        /// Creates a [Poller][lro::Poller] to work with `delete_preview`.
1912        pub fn poller(
1913            self,
1914        ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1915            type Operation =
1916                lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1917            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1918            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1919
1920            let stub = self.0.stub.clone();
1921            let mut options = self.0.options.clone();
1922            options.set_retry_policy(gax::retry_policy::NeverRetry);
1923            let query = move |name| {
1924                let stub = stub.clone();
1925                let options = options.clone();
1926                async {
1927                    let op = GetOperation::new(stub)
1928                        .set_name(name)
1929                        .with_options(options)
1930                        .send()
1931                        .await?;
1932                    Ok(Operation::new(op))
1933                }
1934            };
1935
1936            let start = move || async {
1937                let op = self.send().await?;
1938                Ok(Operation::new(op))
1939            };
1940
1941            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1942        }
1943
1944        /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
1945        ///
1946        /// This is a **required** field for requests.
1947        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948            self.0.request.name = v.into();
1949            self
1950        }
1951
1952        /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
1953        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954            self.0.request.request_id = v.into();
1955            self
1956        }
1957    }
1958
1959    #[doc(hidden)]
1960    impl gax::options::internal::RequestBuilder for DeletePreview {
1961        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1962            &mut self.0.options
1963        }
1964    }
1965
1966    /// The request builder for [Config::export_preview_result][crate::client::Config::export_preview_result] calls.
1967    ///
1968    /// # Example
1969    /// ```no_run
1970    /// # use google_cloud_config_v1::builder;
1971    /// use builder::config::ExportPreviewResult;
1972    /// # tokio_test::block_on(async {
1973    ///
1974    /// let builder = prepare_request_builder();
1975    /// let response = builder.send().await?;
1976    /// # gax::Result::<()>::Ok(()) });
1977    ///
1978    /// fn prepare_request_builder() -> ExportPreviewResult {
1979    ///   # panic!();
1980    ///   // ... details omitted ...
1981    /// }
1982    /// ```
1983    #[derive(Clone, Debug)]
1984    pub struct ExportPreviewResult(RequestBuilder<crate::model::ExportPreviewResultRequest>);
1985
1986    impl ExportPreviewResult {
1987        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1988            Self(RequestBuilder::new(stub))
1989        }
1990
1991        /// Sets the full request, replacing any prior values.
1992        pub fn with_request<V: Into<crate::model::ExportPreviewResultRequest>>(
1993            mut self,
1994            v: V,
1995        ) -> Self {
1996            self.0.request = v.into();
1997            self
1998        }
1999
2000        /// Sets all the options, replacing any prior values.
2001        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2002            self.0.options = v.into();
2003            self
2004        }
2005
2006        /// Sends the request.
2007        pub async fn send(self) -> Result<crate::model::ExportPreviewResultResponse> {
2008            (*self.0.stub)
2009                .export_preview_result(self.0.request, self.0.options)
2010                .await
2011                .map(gax::response::Response::into_body)
2012        }
2013
2014        /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
2015        ///
2016        /// This is a **required** field for requests.
2017        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018            self.0.request.parent = v.into();
2019            self
2020        }
2021    }
2022
2023    #[doc(hidden)]
2024    impl gax::options::internal::RequestBuilder for ExportPreviewResult {
2025        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2026            &mut self.0.options
2027        }
2028    }
2029
2030    /// The request builder for [Config::list_terraform_versions][crate::client::Config::list_terraform_versions] calls.
2031    ///
2032    /// # Example
2033    /// ```no_run
2034    /// # use google_cloud_config_v1::builder;
2035    /// use builder::config::ListTerraformVersions;
2036    /// # tokio_test::block_on(async {
2037    /// use gax::paginator::ItemPaginator;
2038    ///
2039    /// let builder = prepare_request_builder();
2040    /// let mut items = builder.by_item();
2041    /// while let Some(result) = items.next().await {
2042    ///   let item = result?;
2043    /// }
2044    /// # gax::Result::<()>::Ok(()) });
2045    ///
2046    /// fn prepare_request_builder() -> ListTerraformVersions {
2047    ///   # panic!();
2048    ///   // ... details omitted ...
2049    /// }
2050    /// ```
2051    #[derive(Clone, Debug)]
2052    pub struct ListTerraformVersions(RequestBuilder<crate::model::ListTerraformVersionsRequest>);
2053
2054    impl ListTerraformVersions {
2055        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2056            Self(RequestBuilder::new(stub))
2057        }
2058
2059        /// Sets the full request, replacing any prior values.
2060        pub fn with_request<V: Into<crate::model::ListTerraformVersionsRequest>>(
2061            mut self,
2062            v: V,
2063        ) -> Self {
2064            self.0.request = v.into();
2065            self
2066        }
2067
2068        /// Sets all the options, replacing any prior values.
2069        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2070            self.0.options = v.into();
2071            self
2072        }
2073
2074        /// Sends the request.
2075        pub async fn send(self) -> Result<crate::model::ListTerraformVersionsResponse> {
2076            (*self.0.stub)
2077                .list_terraform_versions(self.0.request, self.0.options)
2078                .await
2079                .map(gax::response::Response::into_body)
2080        }
2081
2082        /// Streams each page in the collection.
2083        pub fn by_page(
2084            self,
2085        ) -> impl gax::paginator::Paginator<crate::model::ListTerraformVersionsResponse, gax::error::Error>
2086        {
2087            use std::clone::Clone;
2088            let token = self.0.request.page_token.clone();
2089            let execute = move |token: String| {
2090                let mut builder = self.clone();
2091                builder.0.request = builder.0.request.set_page_token(token);
2092                builder.send()
2093            };
2094            gax::paginator::internal::new_paginator(token, execute)
2095        }
2096
2097        /// Streams each item in the collection.
2098        pub fn by_item(
2099            self,
2100        ) -> impl gax::paginator::ItemPaginator<
2101            crate::model::ListTerraformVersionsResponse,
2102            gax::error::Error,
2103        > {
2104            use gax::paginator::Paginator;
2105            self.by_page().items()
2106        }
2107
2108        /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
2109        ///
2110        /// This is a **required** field for requests.
2111        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2112            self.0.request.parent = v.into();
2113            self
2114        }
2115
2116        /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
2117        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2118            self.0.request.page_size = v.into();
2119            self
2120        }
2121
2122        /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
2123        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124            self.0.request.page_token = v.into();
2125            self
2126        }
2127
2128        /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
2129        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2130            self.0.request.filter = v.into();
2131            self
2132        }
2133
2134        /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
2135        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2136            self.0.request.order_by = v.into();
2137            self
2138        }
2139    }
2140
2141    #[doc(hidden)]
2142    impl gax::options::internal::RequestBuilder for ListTerraformVersions {
2143        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2144            &mut self.0.options
2145        }
2146    }
2147
2148    /// The request builder for [Config::get_terraform_version][crate::client::Config::get_terraform_version] calls.
2149    ///
2150    /// # Example
2151    /// ```no_run
2152    /// # use google_cloud_config_v1::builder;
2153    /// use builder::config::GetTerraformVersion;
2154    /// # tokio_test::block_on(async {
2155    ///
2156    /// let builder = prepare_request_builder();
2157    /// let response = builder.send().await?;
2158    /// # gax::Result::<()>::Ok(()) });
2159    ///
2160    /// fn prepare_request_builder() -> GetTerraformVersion {
2161    ///   # panic!();
2162    ///   // ... details omitted ...
2163    /// }
2164    /// ```
2165    #[derive(Clone, Debug)]
2166    pub struct GetTerraformVersion(RequestBuilder<crate::model::GetTerraformVersionRequest>);
2167
2168    impl GetTerraformVersion {
2169        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2170            Self(RequestBuilder::new(stub))
2171        }
2172
2173        /// Sets the full request, replacing any prior values.
2174        pub fn with_request<V: Into<crate::model::GetTerraformVersionRequest>>(
2175            mut self,
2176            v: V,
2177        ) -> Self {
2178            self.0.request = v.into();
2179            self
2180        }
2181
2182        /// Sets all the options, replacing any prior values.
2183        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2184            self.0.options = v.into();
2185            self
2186        }
2187
2188        /// Sends the request.
2189        pub async fn send(self) -> Result<crate::model::TerraformVersion> {
2190            (*self.0.stub)
2191                .get_terraform_version(self.0.request, self.0.options)
2192                .await
2193                .map(gax::response::Response::into_body)
2194        }
2195
2196        /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
2197        ///
2198        /// This is a **required** field for requests.
2199        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200            self.0.request.name = v.into();
2201            self
2202        }
2203    }
2204
2205    #[doc(hidden)]
2206    impl gax::options::internal::RequestBuilder for GetTerraformVersion {
2207        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2208            &mut self.0.options
2209        }
2210    }
2211
2212    /// The request builder for [Config::list_resource_changes][crate::client::Config::list_resource_changes] calls.
2213    ///
2214    /// # Example
2215    /// ```no_run
2216    /// # use google_cloud_config_v1::builder;
2217    /// use builder::config::ListResourceChanges;
2218    /// # tokio_test::block_on(async {
2219    /// use gax::paginator::ItemPaginator;
2220    ///
2221    /// let builder = prepare_request_builder();
2222    /// let mut items = builder.by_item();
2223    /// while let Some(result) = items.next().await {
2224    ///   let item = result?;
2225    /// }
2226    /// # gax::Result::<()>::Ok(()) });
2227    ///
2228    /// fn prepare_request_builder() -> ListResourceChanges {
2229    ///   # panic!();
2230    ///   // ... details omitted ...
2231    /// }
2232    /// ```
2233    #[derive(Clone, Debug)]
2234    pub struct ListResourceChanges(RequestBuilder<crate::model::ListResourceChangesRequest>);
2235
2236    impl ListResourceChanges {
2237        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2238            Self(RequestBuilder::new(stub))
2239        }
2240
2241        /// Sets the full request, replacing any prior values.
2242        pub fn with_request<V: Into<crate::model::ListResourceChangesRequest>>(
2243            mut self,
2244            v: V,
2245        ) -> Self {
2246            self.0.request = v.into();
2247            self
2248        }
2249
2250        /// Sets all the options, replacing any prior values.
2251        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2252            self.0.options = v.into();
2253            self
2254        }
2255
2256        /// Sends the request.
2257        pub async fn send(self) -> Result<crate::model::ListResourceChangesResponse> {
2258            (*self.0.stub)
2259                .list_resource_changes(self.0.request, self.0.options)
2260                .await
2261                .map(gax::response::Response::into_body)
2262        }
2263
2264        /// Streams each page in the collection.
2265        pub fn by_page(
2266            self,
2267        ) -> impl gax::paginator::Paginator<crate::model::ListResourceChangesResponse, gax::error::Error>
2268        {
2269            use std::clone::Clone;
2270            let token = self.0.request.page_token.clone();
2271            let execute = move |token: String| {
2272                let mut builder = self.clone();
2273                builder.0.request = builder.0.request.set_page_token(token);
2274                builder.send()
2275            };
2276            gax::paginator::internal::new_paginator(token, execute)
2277        }
2278
2279        /// Streams each item in the collection.
2280        pub fn by_item(
2281            self,
2282        ) -> impl gax::paginator::ItemPaginator<
2283            crate::model::ListResourceChangesResponse,
2284            gax::error::Error,
2285        > {
2286            use gax::paginator::Paginator;
2287            self.by_page().items()
2288        }
2289
2290        /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
2291        ///
2292        /// This is a **required** field for requests.
2293        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294            self.0.request.parent = v.into();
2295            self
2296        }
2297
2298        /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
2299        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2300            self.0.request.page_size = v.into();
2301            self
2302        }
2303
2304        /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
2305        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2306            self.0.request.page_token = v.into();
2307            self
2308        }
2309
2310        /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
2311        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312            self.0.request.filter = v.into();
2313            self
2314        }
2315
2316        /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
2317        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2318            self.0.request.order_by = v.into();
2319            self
2320        }
2321    }
2322
2323    #[doc(hidden)]
2324    impl gax::options::internal::RequestBuilder for ListResourceChanges {
2325        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2326            &mut self.0.options
2327        }
2328    }
2329
2330    /// The request builder for [Config::get_resource_change][crate::client::Config::get_resource_change] calls.
2331    ///
2332    /// # Example
2333    /// ```no_run
2334    /// # use google_cloud_config_v1::builder;
2335    /// use builder::config::GetResourceChange;
2336    /// # tokio_test::block_on(async {
2337    ///
2338    /// let builder = prepare_request_builder();
2339    /// let response = builder.send().await?;
2340    /// # gax::Result::<()>::Ok(()) });
2341    ///
2342    /// fn prepare_request_builder() -> GetResourceChange {
2343    ///   # panic!();
2344    ///   // ... details omitted ...
2345    /// }
2346    /// ```
2347    #[derive(Clone, Debug)]
2348    pub struct GetResourceChange(RequestBuilder<crate::model::GetResourceChangeRequest>);
2349
2350    impl GetResourceChange {
2351        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2352            Self(RequestBuilder::new(stub))
2353        }
2354
2355        /// Sets the full request, replacing any prior values.
2356        pub fn with_request<V: Into<crate::model::GetResourceChangeRequest>>(
2357            mut self,
2358            v: V,
2359        ) -> Self {
2360            self.0.request = v.into();
2361            self
2362        }
2363
2364        /// Sets all the options, replacing any prior values.
2365        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2366            self.0.options = v.into();
2367            self
2368        }
2369
2370        /// Sends the request.
2371        pub async fn send(self) -> Result<crate::model::ResourceChange> {
2372            (*self.0.stub)
2373                .get_resource_change(self.0.request, self.0.options)
2374                .await
2375                .map(gax::response::Response::into_body)
2376        }
2377
2378        /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
2379        ///
2380        /// This is a **required** field for requests.
2381        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2382            self.0.request.name = v.into();
2383            self
2384        }
2385    }
2386
2387    #[doc(hidden)]
2388    impl gax::options::internal::RequestBuilder for GetResourceChange {
2389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2390            &mut self.0.options
2391        }
2392    }
2393
2394    /// The request builder for [Config::list_resource_drifts][crate::client::Config::list_resource_drifts] calls.
2395    ///
2396    /// # Example
2397    /// ```no_run
2398    /// # use google_cloud_config_v1::builder;
2399    /// use builder::config::ListResourceDrifts;
2400    /// # tokio_test::block_on(async {
2401    /// use gax::paginator::ItemPaginator;
2402    ///
2403    /// let builder = prepare_request_builder();
2404    /// let mut items = builder.by_item();
2405    /// while let Some(result) = items.next().await {
2406    ///   let item = result?;
2407    /// }
2408    /// # gax::Result::<()>::Ok(()) });
2409    ///
2410    /// fn prepare_request_builder() -> ListResourceDrifts {
2411    ///   # panic!();
2412    ///   // ... details omitted ...
2413    /// }
2414    /// ```
2415    #[derive(Clone, Debug)]
2416    pub struct ListResourceDrifts(RequestBuilder<crate::model::ListResourceDriftsRequest>);
2417
2418    impl ListResourceDrifts {
2419        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2420            Self(RequestBuilder::new(stub))
2421        }
2422
2423        /// Sets the full request, replacing any prior values.
2424        pub fn with_request<V: Into<crate::model::ListResourceDriftsRequest>>(
2425            mut self,
2426            v: V,
2427        ) -> Self {
2428            self.0.request = v.into();
2429            self
2430        }
2431
2432        /// Sets all the options, replacing any prior values.
2433        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2434            self.0.options = v.into();
2435            self
2436        }
2437
2438        /// Sends the request.
2439        pub async fn send(self) -> Result<crate::model::ListResourceDriftsResponse> {
2440            (*self.0.stub)
2441                .list_resource_drifts(self.0.request, self.0.options)
2442                .await
2443                .map(gax::response::Response::into_body)
2444        }
2445
2446        /// Streams each page in the collection.
2447        pub fn by_page(
2448            self,
2449        ) -> impl gax::paginator::Paginator<crate::model::ListResourceDriftsResponse, gax::error::Error>
2450        {
2451            use std::clone::Clone;
2452            let token = self.0.request.page_token.clone();
2453            let execute = move |token: String| {
2454                let mut builder = self.clone();
2455                builder.0.request = builder.0.request.set_page_token(token);
2456                builder.send()
2457            };
2458            gax::paginator::internal::new_paginator(token, execute)
2459        }
2460
2461        /// Streams each item in the collection.
2462        pub fn by_item(
2463            self,
2464        ) -> impl gax::paginator::ItemPaginator<
2465            crate::model::ListResourceDriftsResponse,
2466            gax::error::Error,
2467        > {
2468            use gax::paginator::Paginator;
2469            self.by_page().items()
2470        }
2471
2472        /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
2473        ///
2474        /// This is a **required** field for requests.
2475        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2476            self.0.request.parent = v.into();
2477            self
2478        }
2479
2480        /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
2481        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2482            self.0.request.page_size = v.into();
2483            self
2484        }
2485
2486        /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
2487        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2488            self.0.request.page_token = v.into();
2489            self
2490        }
2491
2492        /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
2493        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2494            self.0.request.filter = v.into();
2495            self
2496        }
2497
2498        /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
2499        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2500            self.0.request.order_by = v.into();
2501            self
2502        }
2503    }
2504
2505    #[doc(hidden)]
2506    impl gax::options::internal::RequestBuilder for ListResourceDrifts {
2507        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2508            &mut self.0.options
2509        }
2510    }
2511
2512    /// The request builder for [Config::get_resource_drift][crate::client::Config::get_resource_drift] calls.
2513    ///
2514    /// # Example
2515    /// ```no_run
2516    /// # use google_cloud_config_v1::builder;
2517    /// use builder::config::GetResourceDrift;
2518    /// # tokio_test::block_on(async {
2519    ///
2520    /// let builder = prepare_request_builder();
2521    /// let response = builder.send().await?;
2522    /// # gax::Result::<()>::Ok(()) });
2523    ///
2524    /// fn prepare_request_builder() -> GetResourceDrift {
2525    ///   # panic!();
2526    ///   // ... details omitted ...
2527    /// }
2528    /// ```
2529    #[derive(Clone, Debug)]
2530    pub struct GetResourceDrift(RequestBuilder<crate::model::GetResourceDriftRequest>);
2531
2532    impl GetResourceDrift {
2533        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2534            Self(RequestBuilder::new(stub))
2535        }
2536
2537        /// Sets the full request, replacing any prior values.
2538        pub fn with_request<V: Into<crate::model::GetResourceDriftRequest>>(
2539            mut self,
2540            v: V,
2541        ) -> Self {
2542            self.0.request = v.into();
2543            self
2544        }
2545
2546        /// Sets all the options, replacing any prior values.
2547        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2548            self.0.options = v.into();
2549            self
2550        }
2551
2552        /// Sends the request.
2553        pub async fn send(self) -> Result<crate::model::ResourceDrift> {
2554            (*self.0.stub)
2555                .get_resource_drift(self.0.request, self.0.options)
2556                .await
2557                .map(gax::response::Response::into_body)
2558        }
2559
2560        /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
2561        ///
2562        /// This is a **required** field for requests.
2563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2564            self.0.request.name = v.into();
2565            self
2566        }
2567    }
2568
2569    #[doc(hidden)]
2570    impl gax::options::internal::RequestBuilder for GetResourceDrift {
2571        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2572            &mut self.0.options
2573        }
2574    }
2575
2576    /// The request builder for [Config::list_locations][crate::client::Config::list_locations] calls.
2577    ///
2578    /// # Example
2579    /// ```no_run
2580    /// # use google_cloud_config_v1::builder;
2581    /// use builder::config::ListLocations;
2582    /// # tokio_test::block_on(async {
2583    /// use gax::paginator::ItemPaginator;
2584    ///
2585    /// let builder = prepare_request_builder();
2586    /// let mut items = builder.by_item();
2587    /// while let Some(result) = items.next().await {
2588    ///   let item = result?;
2589    /// }
2590    /// # gax::Result::<()>::Ok(()) });
2591    ///
2592    /// fn prepare_request_builder() -> ListLocations {
2593    ///   # panic!();
2594    ///   // ... details omitted ...
2595    /// }
2596    /// ```
2597    #[derive(Clone, Debug)]
2598    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2599
2600    impl ListLocations {
2601        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2602            Self(RequestBuilder::new(stub))
2603        }
2604
2605        /// Sets the full request, replacing any prior values.
2606        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2607            mut self,
2608            v: V,
2609        ) -> Self {
2610            self.0.request = v.into();
2611            self
2612        }
2613
2614        /// Sets all the options, replacing any prior values.
2615        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2616            self.0.options = v.into();
2617            self
2618        }
2619
2620        /// Sends the request.
2621        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2622            (*self.0.stub)
2623                .list_locations(self.0.request, self.0.options)
2624                .await
2625                .map(gax::response::Response::into_body)
2626        }
2627
2628        /// Streams each page in the collection.
2629        pub fn by_page(
2630            self,
2631        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2632        {
2633            use std::clone::Clone;
2634            let token = self.0.request.page_token.clone();
2635            let execute = move |token: String| {
2636                let mut builder = self.clone();
2637                builder.0.request = builder.0.request.set_page_token(token);
2638                builder.send()
2639            };
2640            gax::paginator::internal::new_paginator(token, execute)
2641        }
2642
2643        /// Streams each item in the collection.
2644        pub fn by_item(
2645            self,
2646        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2647        {
2648            use gax::paginator::Paginator;
2649            self.by_page().items()
2650        }
2651
2652        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2653        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2654            self.0.request.name = v.into();
2655            self
2656        }
2657
2658        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2659        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2660            self.0.request.filter = v.into();
2661            self
2662        }
2663
2664        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2665        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2666            self.0.request.page_size = v.into();
2667            self
2668        }
2669
2670        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2671        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2672            self.0.request.page_token = v.into();
2673            self
2674        }
2675    }
2676
2677    #[doc(hidden)]
2678    impl gax::options::internal::RequestBuilder for ListLocations {
2679        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2680            &mut self.0.options
2681        }
2682    }
2683
2684    /// The request builder for [Config::get_location][crate::client::Config::get_location] calls.
2685    ///
2686    /// # Example
2687    /// ```no_run
2688    /// # use google_cloud_config_v1::builder;
2689    /// use builder::config::GetLocation;
2690    /// # tokio_test::block_on(async {
2691    ///
2692    /// let builder = prepare_request_builder();
2693    /// let response = builder.send().await?;
2694    /// # gax::Result::<()>::Ok(()) });
2695    ///
2696    /// fn prepare_request_builder() -> GetLocation {
2697    ///   # panic!();
2698    ///   // ... details omitted ...
2699    /// }
2700    /// ```
2701    #[derive(Clone, Debug)]
2702    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2703
2704    impl GetLocation {
2705        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2706            Self(RequestBuilder::new(stub))
2707        }
2708
2709        /// Sets the full request, replacing any prior values.
2710        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2711            self.0.request = v.into();
2712            self
2713        }
2714
2715        /// Sets all the options, replacing any prior values.
2716        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2717            self.0.options = v.into();
2718            self
2719        }
2720
2721        /// Sends the request.
2722        pub async fn send(self) -> Result<location::model::Location> {
2723            (*self.0.stub)
2724                .get_location(self.0.request, self.0.options)
2725                .await
2726                .map(gax::response::Response::into_body)
2727        }
2728
2729        /// Sets the value of [name][location::model::GetLocationRequest::name].
2730        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2731            self.0.request.name = v.into();
2732            self
2733        }
2734    }
2735
2736    #[doc(hidden)]
2737    impl gax::options::internal::RequestBuilder for GetLocation {
2738        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2739            &mut self.0.options
2740        }
2741    }
2742
2743    /// The request builder for [Config::set_iam_policy][crate::client::Config::set_iam_policy] calls.
2744    ///
2745    /// # Example
2746    /// ```no_run
2747    /// # use google_cloud_config_v1::builder;
2748    /// use builder::config::SetIamPolicy;
2749    /// # tokio_test::block_on(async {
2750    ///
2751    /// let builder = prepare_request_builder();
2752    /// let response = builder.send().await?;
2753    /// # gax::Result::<()>::Ok(()) });
2754    ///
2755    /// fn prepare_request_builder() -> SetIamPolicy {
2756    ///   # panic!();
2757    ///   // ... details omitted ...
2758    /// }
2759    /// ```
2760    #[derive(Clone, Debug)]
2761    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2762
2763    impl SetIamPolicy {
2764        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2765            Self(RequestBuilder::new(stub))
2766        }
2767
2768        /// Sets the full request, replacing any prior values.
2769        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2770            self.0.request = v.into();
2771            self
2772        }
2773
2774        /// Sets all the options, replacing any prior values.
2775        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2776            self.0.options = v.into();
2777            self
2778        }
2779
2780        /// Sends the request.
2781        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2782            (*self.0.stub)
2783                .set_iam_policy(self.0.request, self.0.options)
2784                .await
2785                .map(gax::response::Response::into_body)
2786        }
2787
2788        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2789        ///
2790        /// This is a **required** field for requests.
2791        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2792            self.0.request.resource = v.into();
2793            self
2794        }
2795
2796        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2797        ///
2798        /// This is a **required** field for requests.
2799        pub fn set_policy<T>(mut self, v: T) -> Self
2800        where
2801            T: std::convert::Into<iam_v1::model::Policy>,
2802        {
2803            self.0.request.policy = std::option::Option::Some(v.into());
2804            self
2805        }
2806
2807        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2808        ///
2809        /// This is a **required** field for requests.
2810        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2811        where
2812            T: std::convert::Into<iam_v1::model::Policy>,
2813        {
2814            self.0.request.policy = v.map(|x| x.into());
2815            self
2816        }
2817
2818        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2819        pub fn set_update_mask<T>(mut self, v: T) -> Self
2820        where
2821            T: std::convert::Into<wkt::FieldMask>,
2822        {
2823            self.0.request.update_mask = std::option::Option::Some(v.into());
2824            self
2825        }
2826
2827        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2828        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2829        where
2830            T: std::convert::Into<wkt::FieldMask>,
2831        {
2832            self.0.request.update_mask = v.map(|x| x.into());
2833            self
2834        }
2835    }
2836
2837    #[doc(hidden)]
2838    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2839        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2840            &mut self.0.options
2841        }
2842    }
2843
2844    /// The request builder for [Config::get_iam_policy][crate::client::Config::get_iam_policy] calls.
2845    ///
2846    /// # Example
2847    /// ```no_run
2848    /// # use google_cloud_config_v1::builder;
2849    /// use builder::config::GetIamPolicy;
2850    /// # tokio_test::block_on(async {
2851    ///
2852    /// let builder = prepare_request_builder();
2853    /// let response = builder.send().await?;
2854    /// # gax::Result::<()>::Ok(()) });
2855    ///
2856    /// fn prepare_request_builder() -> GetIamPolicy {
2857    ///   # panic!();
2858    ///   // ... details omitted ...
2859    /// }
2860    /// ```
2861    #[derive(Clone, Debug)]
2862    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2863
2864    impl GetIamPolicy {
2865        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2866            Self(RequestBuilder::new(stub))
2867        }
2868
2869        /// Sets the full request, replacing any prior values.
2870        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2871            self.0.request = v.into();
2872            self
2873        }
2874
2875        /// Sets all the options, replacing any prior values.
2876        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2877            self.0.options = v.into();
2878            self
2879        }
2880
2881        /// Sends the request.
2882        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2883            (*self.0.stub)
2884                .get_iam_policy(self.0.request, self.0.options)
2885                .await
2886                .map(gax::response::Response::into_body)
2887        }
2888
2889        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2890        ///
2891        /// This is a **required** field for requests.
2892        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893            self.0.request.resource = v.into();
2894            self
2895        }
2896
2897        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2898        pub fn set_options<T>(mut self, v: T) -> Self
2899        where
2900            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2901        {
2902            self.0.request.options = std::option::Option::Some(v.into());
2903            self
2904        }
2905
2906        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2907        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2908        where
2909            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2910        {
2911            self.0.request.options = v.map(|x| x.into());
2912            self
2913        }
2914    }
2915
2916    #[doc(hidden)]
2917    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2918        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2919            &mut self.0.options
2920        }
2921    }
2922
2923    /// The request builder for [Config::test_iam_permissions][crate::client::Config::test_iam_permissions] calls.
2924    ///
2925    /// # Example
2926    /// ```no_run
2927    /// # use google_cloud_config_v1::builder;
2928    /// use builder::config::TestIamPermissions;
2929    /// # tokio_test::block_on(async {
2930    ///
2931    /// let builder = prepare_request_builder();
2932    /// let response = builder.send().await?;
2933    /// # gax::Result::<()>::Ok(()) });
2934    ///
2935    /// fn prepare_request_builder() -> TestIamPermissions {
2936    ///   # panic!();
2937    ///   // ... details omitted ...
2938    /// }
2939    /// ```
2940    #[derive(Clone, Debug)]
2941    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2942
2943    impl TestIamPermissions {
2944        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2945            Self(RequestBuilder::new(stub))
2946        }
2947
2948        /// Sets the full request, replacing any prior values.
2949        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2950            mut self,
2951            v: V,
2952        ) -> Self {
2953            self.0.request = v.into();
2954            self
2955        }
2956
2957        /// Sets all the options, replacing any prior values.
2958        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2959            self.0.options = v.into();
2960            self
2961        }
2962
2963        /// Sends the request.
2964        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2965            (*self.0.stub)
2966                .test_iam_permissions(self.0.request, self.0.options)
2967                .await
2968                .map(gax::response::Response::into_body)
2969        }
2970
2971        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2972        ///
2973        /// This is a **required** field for requests.
2974        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2975            self.0.request.resource = v.into();
2976            self
2977        }
2978
2979        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2980        ///
2981        /// This is a **required** field for requests.
2982        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2983        where
2984            T: std::iter::IntoIterator<Item = V>,
2985            V: std::convert::Into<std::string::String>,
2986        {
2987            use std::iter::Iterator;
2988            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2989            self
2990        }
2991    }
2992
2993    #[doc(hidden)]
2994    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2995        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2996            &mut self.0.options
2997        }
2998    }
2999
3000    /// The request builder for [Config::list_operations][crate::client::Config::list_operations] calls.
3001    ///
3002    /// # Example
3003    /// ```no_run
3004    /// # use google_cloud_config_v1::builder;
3005    /// use builder::config::ListOperations;
3006    /// # tokio_test::block_on(async {
3007    /// use gax::paginator::ItemPaginator;
3008    ///
3009    /// let builder = prepare_request_builder();
3010    /// let mut items = builder.by_item();
3011    /// while let Some(result) = items.next().await {
3012    ///   let item = result?;
3013    /// }
3014    /// # gax::Result::<()>::Ok(()) });
3015    ///
3016    /// fn prepare_request_builder() -> ListOperations {
3017    ///   # panic!();
3018    ///   // ... details omitted ...
3019    /// }
3020    /// ```
3021    #[derive(Clone, Debug)]
3022    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3023
3024    impl ListOperations {
3025        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3026            Self(RequestBuilder::new(stub))
3027        }
3028
3029        /// Sets the full request, replacing any prior values.
3030        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3031            mut self,
3032            v: V,
3033        ) -> Self {
3034            self.0.request = v.into();
3035            self
3036        }
3037
3038        /// Sets all the options, replacing any prior values.
3039        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3040            self.0.options = v.into();
3041            self
3042        }
3043
3044        /// Sends the request.
3045        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3046            (*self.0.stub)
3047                .list_operations(self.0.request, self.0.options)
3048                .await
3049                .map(gax::response::Response::into_body)
3050        }
3051
3052        /// Streams each page in the collection.
3053        pub fn by_page(
3054            self,
3055        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3056        {
3057            use std::clone::Clone;
3058            let token = self.0.request.page_token.clone();
3059            let execute = move |token: String| {
3060                let mut builder = self.clone();
3061                builder.0.request = builder.0.request.set_page_token(token);
3062                builder.send()
3063            };
3064            gax::paginator::internal::new_paginator(token, execute)
3065        }
3066
3067        /// Streams each item in the collection.
3068        pub fn by_item(
3069            self,
3070        ) -> impl gax::paginator::ItemPaginator<
3071            longrunning::model::ListOperationsResponse,
3072            gax::error::Error,
3073        > {
3074            use gax::paginator::Paginator;
3075            self.by_page().items()
3076        }
3077
3078        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
3079        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3080            self.0.request.name = v.into();
3081            self
3082        }
3083
3084        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
3085        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3086            self.0.request.filter = v.into();
3087            self
3088        }
3089
3090        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
3091        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3092            self.0.request.page_size = v.into();
3093            self
3094        }
3095
3096        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
3097        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3098            self.0.request.page_token = v.into();
3099            self
3100        }
3101
3102        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
3103        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3104            self.0.request.return_partial_success = v.into();
3105            self
3106        }
3107    }
3108
3109    #[doc(hidden)]
3110    impl gax::options::internal::RequestBuilder for ListOperations {
3111        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3112            &mut self.0.options
3113        }
3114    }
3115
3116    /// The request builder for [Config::get_operation][crate::client::Config::get_operation] calls.
3117    ///
3118    /// # Example
3119    /// ```no_run
3120    /// # use google_cloud_config_v1::builder;
3121    /// use builder::config::GetOperation;
3122    /// # tokio_test::block_on(async {
3123    ///
3124    /// let builder = prepare_request_builder();
3125    /// let response = builder.send().await?;
3126    /// # gax::Result::<()>::Ok(()) });
3127    ///
3128    /// fn prepare_request_builder() -> GetOperation {
3129    ///   # panic!();
3130    ///   // ... details omitted ...
3131    /// }
3132    /// ```
3133    #[derive(Clone, Debug)]
3134    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3135
3136    impl GetOperation {
3137        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3138            Self(RequestBuilder::new(stub))
3139        }
3140
3141        /// Sets the full request, replacing any prior values.
3142        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3143            mut self,
3144            v: V,
3145        ) -> Self {
3146            self.0.request = v.into();
3147            self
3148        }
3149
3150        /// Sets all the options, replacing any prior values.
3151        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3152            self.0.options = v.into();
3153            self
3154        }
3155
3156        /// Sends the request.
3157        pub async fn send(self) -> Result<longrunning::model::Operation> {
3158            (*self.0.stub)
3159                .get_operation(self.0.request, self.0.options)
3160                .await
3161                .map(gax::response::Response::into_body)
3162        }
3163
3164        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
3165        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3166            self.0.request.name = v.into();
3167            self
3168        }
3169    }
3170
3171    #[doc(hidden)]
3172    impl gax::options::internal::RequestBuilder for GetOperation {
3173        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3174            &mut self.0.options
3175        }
3176    }
3177
3178    /// The request builder for [Config::delete_operation][crate::client::Config::delete_operation] calls.
3179    ///
3180    /// # Example
3181    /// ```no_run
3182    /// # use google_cloud_config_v1::builder;
3183    /// use builder::config::DeleteOperation;
3184    /// # tokio_test::block_on(async {
3185    ///
3186    /// let builder = prepare_request_builder();
3187    /// let response = builder.send().await?;
3188    /// # gax::Result::<()>::Ok(()) });
3189    ///
3190    /// fn prepare_request_builder() -> DeleteOperation {
3191    ///   # panic!();
3192    ///   // ... details omitted ...
3193    /// }
3194    /// ```
3195    #[derive(Clone, Debug)]
3196    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3197
3198    impl DeleteOperation {
3199        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3200            Self(RequestBuilder::new(stub))
3201        }
3202
3203        /// Sets the full request, replacing any prior values.
3204        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3205            mut self,
3206            v: V,
3207        ) -> Self {
3208            self.0.request = v.into();
3209            self
3210        }
3211
3212        /// Sets all the options, replacing any prior values.
3213        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3214            self.0.options = v.into();
3215            self
3216        }
3217
3218        /// Sends the request.
3219        pub async fn send(self) -> Result<()> {
3220            (*self.0.stub)
3221                .delete_operation(self.0.request, self.0.options)
3222                .await
3223                .map(gax::response::Response::into_body)
3224        }
3225
3226        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3227        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3228            self.0.request.name = v.into();
3229            self
3230        }
3231    }
3232
3233    #[doc(hidden)]
3234    impl gax::options::internal::RequestBuilder for DeleteOperation {
3235        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3236            &mut self.0.options
3237        }
3238    }
3239
3240    /// The request builder for [Config::cancel_operation][crate::client::Config::cancel_operation] calls.
3241    ///
3242    /// # Example
3243    /// ```no_run
3244    /// # use google_cloud_config_v1::builder;
3245    /// use builder::config::CancelOperation;
3246    /// # tokio_test::block_on(async {
3247    ///
3248    /// let builder = prepare_request_builder();
3249    /// let response = builder.send().await?;
3250    /// # gax::Result::<()>::Ok(()) });
3251    ///
3252    /// fn prepare_request_builder() -> CancelOperation {
3253    ///   # panic!();
3254    ///   // ... details omitted ...
3255    /// }
3256    /// ```
3257    #[derive(Clone, Debug)]
3258    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3259
3260    impl CancelOperation {
3261        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3262            Self(RequestBuilder::new(stub))
3263        }
3264
3265        /// Sets the full request, replacing any prior values.
3266        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3267            mut self,
3268            v: V,
3269        ) -> Self {
3270            self.0.request = v.into();
3271            self
3272        }
3273
3274        /// Sets all the options, replacing any prior values.
3275        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3276            self.0.options = v.into();
3277            self
3278        }
3279
3280        /// Sends the request.
3281        pub async fn send(self) -> Result<()> {
3282            (*self.0.stub)
3283                .cancel_operation(self.0.request, self.0.options)
3284                .await
3285                .map(gax::response::Response::into_body)
3286        }
3287
3288        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
3289        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3290            self.0.request.name = v.into();
3291            self
3292        }
3293    }
3294
3295    #[doc(hidden)]
3296    impl gax::options::internal::RequestBuilder for CancelOperation {
3297        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3298            &mut self.0.options
3299        }
3300    }
3301}