Skip to main content

google_cloud_config_v1/
builder.rs

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