google_cloud_deploy_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 cloud_deploy {
18    use crate::Result;
19
20    /// A builder for [CloudDeploy][crate::client::CloudDeploy].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_deploy_v1::*;
25    /// # use builder::cloud_deploy::ClientBuilder;
26    /// # use client::CloudDeploy;
27    /// let builder : ClientBuilder = CloudDeploy::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://clouddeploy.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CloudDeploy;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = CloudDeploy;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::CloudDeploy] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CloudDeploy::list_delivery_pipelines][crate::client::CloudDeploy::list_delivery_pipelines] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_deploy_v1::builder;
79    /// use builder::cloud_deploy::ListDeliveryPipelines;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListDeliveryPipelines {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListDeliveryPipelines(RequestBuilder<crate::model::ListDeliveryPipelinesRequest>);
97
98    impl ListDeliveryPipelines {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListDeliveryPipelinesRequest>>(
107            mut self,
108            v: V,
109        ) -> Self {
110            self.0.request = v.into();
111            self
112        }
113
114        /// Sets all the options, replacing any prior values.
115        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116            self.0.options = v.into();
117            self
118        }
119
120        /// Sends the request.
121        pub async fn send(self) -> Result<crate::model::ListDeliveryPipelinesResponse> {
122            (*self.0.stub)
123                .list_delivery_pipelines(self.0.request, self.0.options)
124                .await
125                .map(gax::response::Response::into_body)
126        }
127
128        /// Streams each page in the collection.
129        pub fn by_page(
130            self,
131        ) -> impl gax::paginator::Paginator<crate::model::ListDeliveryPipelinesResponse, gax::error::Error>
132        {
133            use std::clone::Clone;
134            let token = self.0.request.page_token.clone();
135            let execute = move |token: String| {
136                let mut builder = self.clone();
137                builder.0.request = builder.0.request.set_page_token(token);
138                builder.send()
139            };
140            gax::paginator::internal::new_paginator(token, execute)
141        }
142
143        /// Streams each item in the collection.
144        pub fn by_item(
145            self,
146        ) -> impl gax::paginator::ItemPaginator<
147            crate::model::ListDeliveryPipelinesResponse,
148            gax::error::Error,
149        > {
150            use gax::paginator::Paginator;
151            self.by_page().items()
152        }
153
154        /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
155        ///
156        /// This is a **required** field for requests.
157        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158            self.0.request.parent = v.into();
159            self
160        }
161
162        /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
163        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164            self.0.request.page_size = v.into();
165            self
166        }
167
168        /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
169        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.page_token = v.into();
171            self
172        }
173
174        /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
175        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176            self.0.request.filter = v.into();
177            self
178        }
179
180        /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
181        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182            self.0.request.order_by = v.into();
183            self
184        }
185    }
186
187    #[doc(hidden)]
188    impl gax::options::internal::RequestBuilder for ListDeliveryPipelines {
189        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
190            &mut self.0.options
191        }
192    }
193
194    /// The request builder for [CloudDeploy::get_delivery_pipeline][crate::client::CloudDeploy::get_delivery_pipeline] calls.
195    ///
196    /// # Example
197    /// ```no_run
198    /// # use google_cloud_deploy_v1::builder;
199    /// use builder::cloud_deploy::GetDeliveryPipeline;
200    /// # tokio_test::block_on(async {
201    ///
202    /// let builder = prepare_request_builder();
203    /// let response = builder.send().await?;
204    /// # gax::Result::<()>::Ok(()) });
205    ///
206    /// fn prepare_request_builder() -> GetDeliveryPipeline {
207    ///   # panic!();
208    ///   // ... details omitted ...
209    /// }
210    /// ```
211    #[derive(Clone, Debug)]
212    pub struct GetDeliveryPipeline(RequestBuilder<crate::model::GetDeliveryPipelineRequest>);
213
214    impl GetDeliveryPipeline {
215        pub(crate) fn new(
216            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
217        ) -> Self {
218            Self(RequestBuilder::new(stub))
219        }
220
221        /// Sets the full request, replacing any prior values.
222        pub fn with_request<V: Into<crate::model::GetDeliveryPipelineRequest>>(
223            mut self,
224            v: V,
225        ) -> Self {
226            self.0.request = v.into();
227            self
228        }
229
230        /// Sets all the options, replacing any prior values.
231        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
232            self.0.options = v.into();
233            self
234        }
235
236        /// Sends the request.
237        pub async fn send(self) -> Result<crate::model::DeliveryPipeline> {
238            (*self.0.stub)
239                .get_delivery_pipeline(self.0.request, self.0.options)
240                .await
241                .map(gax::response::Response::into_body)
242        }
243
244        /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
245        ///
246        /// This is a **required** field for requests.
247        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
248            self.0.request.name = v.into();
249            self
250        }
251    }
252
253    #[doc(hidden)]
254    impl gax::options::internal::RequestBuilder for GetDeliveryPipeline {
255        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
256            &mut self.0.options
257        }
258    }
259
260    /// The request builder for [CloudDeploy::create_delivery_pipeline][crate::client::CloudDeploy::create_delivery_pipeline] calls.
261    ///
262    /// # Example
263    /// ```no_run
264    /// # use google_cloud_deploy_v1::builder;
265    /// use builder::cloud_deploy::CreateDeliveryPipeline;
266    /// # tokio_test::block_on(async {
267    /// use lro::Poller;
268    ///
269    /// let builder = prepare_request_builder();
270    /// let response = builder.poller().until_done().await?;
271    /// # gax::Result::<()>::Ok(()) });
272    ///
273    /// fn prepare_request_builder() -> CreateDeliveryPipeline {
274    ///   # panic!();
275    ///   // ... details omitted ...
276    /// }
277    /// ```
278    #[derive(Clone, Debug)]
279    pub struct CreateDeliveryPipeline(RequestBuilder<crate::model::CreateDeliveryPipelineRequest>);
280
281    impl CreateDeliveryPipeline {
282        pub(crate) fn new(
283            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
284        ) -> Self {
285            Self(RequestBuilder::new(stub))
286        }
287
288        /// Sets the full request, replacing any prior values.
289        pub fn with_request<V: Into<crate::model::CreateDeliveryPipelineRequest>>(
290            mut self,
291            v: V,
292        ) -> Self {
293            self.0.request = v.into();
294            self
295        }
296
297        /// Sets all the options, replacing any prior values.
298        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
299            self.0.options = v.into();
300            self
301        }
302
303        /// Sends the request.
304        ///
305        /// # Long running operations
306        ///
307        /// This starts, but does not poll, a longrunning operation. More information
308        /// on [create_delivery_pipeline][crate::client::CloudDeploy::create_delivery_pipeline].
309        pub async fn send(self) -> Result<longrunning::model::Operation> {
310            (*self.0.stub)
311                .create_delivery_pipeline(self.0.request, self.0.options)
312                .await
313                .map(gax::response::Response::into_body)
314        }
315
316        /// Creates a [Poller][lro::Poller] to work with `create_delivery_pipeline`.
317        pub fn poller(
318            self,
319        ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
320        {
321            type Operation = lro::internal::Operation<
322                crate::model::DeliveryPipeline,
323                crate::model::OperationMetadata,
324            >;
325            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
326            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
327
328            let stub = self.0.stub.clone();
329            let mut options = self.0.options.clone();
330            options.set_retry_policy(gax::retry_policy::NeverRetry);
331            let query = move |name| {
332                let stub = stub.clone();
333                let options = options.clone();
334                async {
335                    let op = GetOperation::new(stub)
336                        .set_name(name)
337                        .with_options(options)
338                        .send()
339                        .await?;
340                    Ok(Operation::new(op))
341                }
342            };
343
344            let start = move || async {
345                let op = self.send().await?;
346                Ok(Operation::new(op))
347            };
348
349            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
350        }
351
352        /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
353        ///
354        /// This is a **required** field for requests.
355        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356            self.0.request.parent = v.into();
357            self
358        }
359
360        /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
361        ///
362        /// This is a **required** field for requests.
363        pub fn set_delivery_pipeline_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
364            self.0.request.delivery_pipeline_id = v.into();
365            self
366        }
367
368        /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
369        ///
370        /// This is a **required** field for requests.
371        pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
372        where
373            T: std::convert::Into<crate::model::DeliveryPipeline>,
374        {
375            self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
376            self
377        }
378
379        /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
380        ///
381        /// This is a **required** field for requests.
382        pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
383        where
384            T: std::convert::Into<crate::model::DeliveryPipeline>,
385        {
386            self.0.request.delivery_pipeline = v.map(|x| x.into());
387            self
388        }
389
390        /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
391        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
392            self.0.request.request_id = v.into();
393            self
394        }
395
396        /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
397        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
398            self.0.request.validate_only = v.into();
399            self
400        }
401    }
402
403    #[doc(hidden)]
404    impl gax::options::internal::RequestBuilder for CreateDeliveryPipeline {
405        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
406            &mut self.0.options
407        }
408    }
409
410    /// The request builder for [CloudDeploy::update_delivery_pipeline][crate::client::CloudDeploy::update_delivery_pipeline] calls.
411    ///
412    /// # Example
413    /// ```no_run
414    /// # use google_cloud_deploy_v1::builder;
415    /// use builder::cloud_deploy::UpdateDeliveryPipeline;
416    /// # tokio_test::block_on(async {
417    /// use lro::Poller;
418    ///
419    /// let builder = prepare_request_builder();
420    /// let response = builder.poller().until_done().await?;
421    /// # gax::Result::<()>::Ok(()) });
422    ///
423    /// fn prepare_request_builder() -> UpdateDeliveryPipeline {
424    ///   # panic!();
425    ///   // ... details omitted ...
426    /// }
427    /// ```
428    #[derive(Clone, Debug)]
429    pub struct UpdateDeliveryPipeline(RequestBuilder<crate::model::UpdateDeliveryPipelineRequest>);
430
431    impl UpdateDeliveryPipeline {
432        pub(crate) fn new(
433            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
434        ) -> Self {
435            Self(RequestBuilder::new(stub))
436        }
437
438        /// Sets the full request, replacing any prior values.
439        pub fn with_request<V: Into<crate::model::UpdateDeliveryPipelineRequest>>(
440            mut self,
441            v: V,
442        ) -> Self {
443            self.0.request = v.into();
444            self
445        }
446
447        /// Sets all the options, replacing any prior values.
448        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
449            self.0.options = v.into();
450            self
451        }
452
453        /// Sends the request.
454        ///
455        /// # Long running operations
456        ///
457        /// This starts, but does not poll, a longrunning operation. More information
458        /// on [update_delivery_pipeline][crate::client::CloudDeploy::update_delivery_pipeline].
459        pub async fn send(self) -> Result<longrunning::model::Operation> {
460            (*self.0.stub)
461                .update_delivery_pipeline(self.0.request, self.0.options)
462                .await
463                .map(gax::response::Response::into_body)
464        }
465
466        /// Creates a [Poller][lro::Poller] to work with `update_delivery_pipeline`.
467        pub fn poller(
468            self,
469        ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
470        {
471            type Operation = lro::internal::Operation<
472                crate::model::DeliveryPipeline,
473                crate::model::OperationMetadata,
474            >;
475            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
476            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
477
478            let stub = self.0.stub.clone();
479            let mut options = self.0.options.clone();
480            options.set_retry_policy(gax::retry_policy::NeverRetry);
481            let query = move |name| {
482                let stub = stub.clone();
483                let options = options.clone();
484                async {
485                    let op = GetOperation::new(stub)
486                        .set_name(name)
487                        .with_options(options)
488                        .send()
489                        .await?;
490                    Ok(Operation::new(op))
491                }
492            };
493
494            let start = move || async {
495                let op = self.send().await?;
496                Ok(Operation::new(op))
497            };
498
499            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
500        }
501
502        /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
503        ///
504        /// This is a **required** field for requests.
505        pub fn set_update_mask<T>(mut self, v: T) -> Self
506        where
507            T: std::convert::Into<wkt::FieldMask>,
508        {
509            self.0.request.update_mask = std::option::Option::Some(v.into());
510            self
511        }
512
513        /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
514        ///
515        /// This is a **required** field for requests.
516        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
517        where
518            T: std::convert::Into<wkt::FieldMask>,
519        {
520            self.0.request.update_mask = v.map(|x| x.into());
521            self
522        }
523
524        /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
525        ///
526        /// This is a **required** field for requests.
527        pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
528        where
529            T: std::convert::Into<crate::model::DeliveryPipeline>,
530        {
531            self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
532            self
533        }
534
535        /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
536        ///
537        /// This is a **required** field for requests.
538        pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
539        where
540            T: std::convert::Into<crate::model::DeliveryPipeline>,
541        {
542            self.0.request.delivery_pipeline = v.map(|x| x.into());
543            self
544        }
545
546        /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
547        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548            self.0.request.request_id = v.into();
549            self
550        }
551
552        /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
553        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
554            self.0.request.allow_missing = v.into();
555            self
556        }
557
558        /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
559        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
560            self.0.request.validate_only = v.into();
561            self
562        }
563    }
564
565    #[doc(hidden)]
566    impl gax::options::internal::RequestBuilder for UpdateDeliveryPipeline {
567        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
568            &mut self.0.options
569        }
570    }
571
572    /// The request builder for [CloudDeploy::delete_delivery_pipeline][crate::client::CloudDeploy::delete_delivery_pipeline] calls.
573    ///
574    /// # Example
575    /// ```no_run
576    /// # use google_cloud_deploy_v1::builder;
577    /// use builder::cloud_deploy::DeleteDeliveryPipeline;
578    /// # tokio_test::block_on(async {
579    /// use lro::Poller;
580    ///
581    /// let builder = prepare_request_builder();
582    /// let response = builder.poller().until_done().await?;
583    /// # gax::Result::<()>::Ok(()) });
584    ///
585    /// fn prepare_request_builder() -> DeleteDeliveryPipeline {
586    ///   # panic!();
587    ///   // ... details omitted ...
588    /// }
589    /// ```
590    #[derive(Clone, Debug)]
591    pub struct DeleteDeliveryPipeline(RequestBuilder<crate::model::DeleteDeliveryPipelineRequest>);
592
593    impl DeleteDeliveryPipeline {
594        pub(crate) fn new(
595            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
596        ) -> Self {
597            Self(RequestBuilder::new(stub))
598        }
599
600        /// Sets the full request, replacing any prior values.
601        pub fn with_request<V: Into<crate::model::DeleteDeliveryPipelineRequest>>(
602            mut self,
603            v: V,
604        ) -> Self {
605            self.0.request = v.into();
606            self
607        }
608
609        /// Sets all the options, replacing any prior values.
610        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
611            self.0.options = v.into();
612            self
613        }
614
615        /// Sends the request.
616        ///
617        /// # Long running operations
618        ///
619        /// This starts, but does not poll, a longrunning operation. More information
620        /// on [delete_delivery_pipeline][crate::client::CloudDeploy::delete_delivery_pipeline].
621        pub async fn send(self) -> Result<longrunning::model::Operation> {
622            (*self.0.stub)
623                .delete_delivery_pipeline(self.0.request, self.0.options)
624                .await
625                .map(gax::response::Response::into_body)
626        }
627
628        /// Creates a [Poller][lro::Poller] to work with `delete_delivery_pipeline`.
629        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
630            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
631            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
632            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
633
634            let stub = self.0.stub.clone();
635            let mut options = self.0.options.clone();
636            options.set_retry_policy(gax::retry_policy::NeverRetry);
637            let query = move |name| {
638                let stub = stub.clone();
639                let options = options.clone();
640                async {
641                    let op = GetOperation::new(stub)
642                        .set_name(name)
643                        .with_options(options)
644                        .send()
645                        .await?;
646                    Ok(Operation::new(op))
647                }
648            };
649
650            let start = move || async {
651                let op = self.send().await?;
652                Ok(Operation::new(op))
653            };
654
655            lro::internal::new_unit_response_poller(
656                polling_error_policy,
657                polling_backoff_policy,
658                start,
659                query,
660            )
661        }
662
663        /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
664        ///
665        /// This is a **required** field for requests.
666        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
667            self.0.request.name = v.into();
668            self
669        }
670
671        /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
672        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
673            self.0.request.request_id = v.into();
674            self
675        }
676
677        /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
678        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
679            self.0.request.allow_missing = v.into();
680            self
681        }
682
683        /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
684        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
685            self.0.request.validate_only = v.into();
686            self
687        }
688
689        /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
690        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
691            self.0.request.force = v.into();
692            self
693        }
694
695        /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
696        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
697            self.0.request.etag = v.into();
698            self
699        }
700    }
701
702    #[doc(hidden)]
703    impl gax::options::internal::RequestBuilder for DeleteDeliveryPipeline {
704        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
705            &mut self.0.options
706        }
707    }
708
709    /// The request builder for [CloudDeploy::list_targets][crate::client::CloudDeploy::list_targets] calls.
710    ///
711    /// # Example
712    /// ```no_run
713    /// # use google_cloud_deploy_v1::builder;
714    /// use builder::cloud_deploy::ListTargets;
715    /// # tokio_test::block_on(async {
716    /// use gax::paginator::ItemPaginator;
717    ///
718    /// let builder = prepare_request_builder();
719    /// let mut items = builder.by_item();
720    /// while let Some(result) = items.next().await {
721    ///   let item = result?;
722    /// }
723    /// # gax::Result::<()>::Ok(()) });
724    ///
725    /// fn prepare_request_builder() -> ListTargets {
726    ///   # panic!();
727    ///   // ... details omitted ...
728    /// }
729    /// ```
730    #[derive(Clone, Debug)]
731    pub struct ListTargets(RequestBuilder<crate::model::ListTargetsRequest>);
732
733    impl ListTargets {
734        pub(crate) fn new(
735            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
736        ) -> Self {
737            Self(RequestBuilder::new(stub))
738        }
739
740        /// Sets the full request, replacing any prior values.
741        pub fn with_request<V: Into<crate::model::ListTargetsRequest>>(mut self, v: V) -> Self {
742            self.0.request = v.into();
743            self
744        }
745
746        /// Sets all the options, replacing any prior values.
747        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
748            self.0.options = v.into();
749            self
750        }
751
752        /// Sends the request.
753        pub async fn send(self) -> Result<crate::model::ListTargetsResponse> {
754            (*self.0.stub)
755                .list_targets(self.0.request, self.0.options)
756                .await
757                .map(gax::response::Response::into_body)
758        }
759
760        /// Streams each page in the collection.
761        pub fn by_page(
762            self,
763        ) -> impl gax::paginator::Paginator<crate::model::ListTargetsResponse, gax::error::Error>
764        {
765            use std::clone::Clone;
766            let token = self.0.request.page_token.clone();
767            let execute = move |token: String| {
768                let mut builder = self.clone();
769                builder.0.request = builder.0.request.set_page_token(token);
770                builder.send()
771            };
772            gax::paginator::internal::new_paginator(token, execute)
773        }
774
775        /// Streams each item in the collection.
776        pub fn by_item(
777            self,
778        ) -> impl gax::paginator::ItemPaginator<crate::model::ListTargetsResponse, gax::error::Error>
779        {
780            use gax::paginator::Paginator;
781            self.by_page().items()
782        }
783
784        /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
785        ///
786        /// This is a **required** field for requests.
787        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
788            self.0.request.parent = v.into();
789            self
790        }
791
792        /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
793        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794            self.0.request.page_size = v.into();
795            self
796        }
797
798        /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
799        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800            self.0.request.page_token = v.into();
801            self
802        }
803
804        /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
805        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
806            self.0.request.filter = v.into();
807            self
808        }
809
810        /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
811        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
812            self.0.request.order_by = v.into();
813            self
814        }
815    }
816
817    #[doc(hidden)]
818    impl gax::options::internal::RequestBuilder for ListTargets {
819        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
820            &mut self.0.options
821        }
822    }
823
824    /// The request builder for [CloudDeploy::rollback_target][crate::client::CloudDeploy::rollback_target] calls.
825    ///
826    /// # Example
827    /// ```no_run
828    /// # use google_cloud_deploy_v1::builder;
829    /// use builder::cloud_deploy::RollbackTarget;
830    /// # tokio_test::block_on(async {
831    ///
832    /// let builder = prepare_request_builder();
833    /// let response = builder.send().await?;
834    /// # gax::Result::<()>::Ok(()) });
835    ///
836    /// fn prepare_request_builder() -> RollbackTarget {
837    ///   # panic!();
838    ///   // ... details omitted ...
839    /// }
840    /// ```
841    #[derive(Clone, Debug)]
842    pub struct RollbackTarget(RequestBuilder<crate::model::RollbackTargetRequest>);
843
844    impl RollbackTarget {
845        pub(crate) fn new(
846            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
847        ) -> Self {
848            Self(RequestBuilder::new(stub))
849        }
850
851        /// Sets the full request, replacing any prior values.
852        pub fn with_request<V: Into<crate::model::RollbackTargetRequest>>(mut self, v: V) -> Self {
853            self.0.request = v.into();
854            self
855        }
856
857        /// Sets all the options, replacing any prior values.
858        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
859            self.0.options = v.into();
860            self
861        }
862
863        /// Sends the request.
864        pub async fn send(self) -> Result<crate::model::RollbackTargetResponse> {
865            (*self.0.stub)
866                .rollback_target(self.0.request, self.0.options)
867                .await
868                .map(gax::response::Response::into_body)
869        }
870
871        /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
872        ///
873        /// This is a **required** field for requests.
874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
875            self.0.request.name = v.into();
876            self
877        }
878
879        /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
880        ///
881        /// This is a **required** field for requests.
882        pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
883            self.0.request.target_id = v.into();
884            self
885        }
886
887        /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
888        ///
889        /// This is a **required** field for requests.
890        pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
891            self.0.request.rollout_id = v.into();
892            self
893        }
894
895        /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
896        pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
897            self.0.request.release_id = v.into();
898            self
899        }
900
901        /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
902        pub fn set_rollout_to_roll_back<T: Into<std::string::String>>(mut self, v: T) -> Self {
903            self.0.request.rollout_to_roll_back = v.into();
904            self
905        }
906
907        /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
908        pub fn set_rollback_config<T>(mut self, v: T) -> Self
909        where
910            T: std::convert::Into<crate::model::RollbackTargetConfig>,
911        {
912            self.0.request.rollback_config = std::option::Option::Some(v.into());
913            self
914        }
915
916        /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
917        pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
918        where
919            T: std::convert::Into<crate::model::RollbackTargetConfig>,
920        {
921            self.0.request.rollback_config = v.map(|x| x.into());
922            self
923        }
924
925        /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
926        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
927            self.0.request.validate_only = v.into();
928            self
929        }
930
931        /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
932        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
933        where
934            T: std::iter::IntoIterator<Item = V>,
935            V: std::convert::Into<std::string::String>,
936        {
937            use std::iter::Iterator;
938            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
939            self
940        }
941    }
942
943    #[doc(hidden)]
944    impl gax::options::internal::RequestBuilder for RollbackTarget {
945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
946            &mut self.0.options
947        }
948    }
949
950    /// The request builder for [CloudDeploy::get_target][crate::client::CloudDeploy::get_target] calls.
951    ///
952    /// # Example
953    /// ```no_run
954    /// # use google_cloud_deploy_v1::builder;
955    /// use builder::cloud_deploy::GetTarget;
956    /// # tokio_test::block_on(async {
957    ///
958    /// let builder = prepare_request_builder();
959    /// let response = builder.send().await?;
960    /// # gax::Result::<()>::Ok(()) });
961    ///
962    /// fn prepare_request_builder() -> GetTarget {
963    ///   # panic!();
964    ///   // ... details omitted ...
965    /// }
966    /// ```
967    #[derive(Clone, Debug)]
968    pub struct GetTarget(RequestBuilder<crate::model::GetTargetRequest>);
969
970    impl GetTarget {
971        pub(crate) fn new(
972            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
973        ) -> Self {
974            Self(RequestBuilder::new(stub))
975        }
976
977        /// Sets the full request, replacing any prior values.
978        pub fn with_request<V: Into<crate::model::GetTargetRequest>>(mut self, v: V) -> Self {
979            self.0.request = v.into();
980            self
981        }
982
983        /// Sets all the options, replacing any prior values.
984        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
985            self.0.options = v.into();
986            self
987        }
988
989        /// Sends the request.
990        pub async fn send(self) -> Result<crate::model::Target> {
991            (*self.0.stub)
992                .get_target(self.0.request, self.0.options)
993                .await
994                .map(gax::response::Response::into_body)
995        }
996
997        /// Sets the value of [name][crate::model::GetTargetRequest::name].
998        ///
999        /// This is a **required** field for requests.
1000        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1001            self.0.request.name = v.into();
1002            self
1003        }
1004    }
1005
1006    #[doc(hidden)]
1007    impl gax::options::internal::RequestBuilder for GetTarget {
1008        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1009            &mut self.0.options
1010        }
1011    }
1012
1013    /// The request builder for [CloudDeploy::create_target][crate::client::CloudDeploy::create_target] calls.
1014    ///
1015    /// # Example
1016    /// ```no_run
1017    /// # use google_cloud_deploy_v1::builder;
1018    /// use builder::cloud_deploy::CreateTarget;
1019    /// # tokio_test::block_on(async {
1020    /// use lro::Poller;
1021    ///
1022    /// let builder = prepare_request_builder();
1023    /// let response = builder.poller().until_done().await?;
1024    /// # gax::Result::<()>::Ok(()) });
1025    ///
1026    /// fn prepare_request_builder() -> CreateTarget {
1027    ///   # panic!();
1028    ///   // ... details omitted ...
1029    /// }
1030    /// ```
1031    #[derive(Clone, Debug)]
1032    pub struct CreateTarget(RequestBuilder<crate::model::CreateTargetRequest>);
1033
1034    impl CreateTarget {
1035        pub(crate) fn new(
1036            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1037        ) -> Self {
1038            Self(RequestBuilder::new(stub))
1039        }
1040
1041        /// Sets the full request, replacing any prior values.
1042        pub fn with_request<V: Into<crate::model::CreateTargetRequest>>(mut self, v: V) -> Self {
1043            self.0.request = v.into();
1044            self
1045        }
1046
1047        /// Sets all the options, replacing any prior values.
1048        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1049            self.0.options = v.into();
1050            self
1051        }
1052
1053        /// Sends the request.
1054        ///
1055        /// # Long running operations
1056        ///
1057        /// This starts, but does not poll, a longrunning operation. More information
1058        /// on [create_target][crate::client::CloudDeploy::create_target].
1059        pub async fn send(self) -> Result<longrunning::model::Operation> {
1060            (*self.0.stub)
1061                .create_target(self.0.request, self.0.options)
1062                .await
1063                .map(gax::response::Response::into_body)
1064        }
1065
1066        /// Creates a [Poller][lro::Poller] to work with `create_target`.
1067        pub fn poller(
1068            self,
1069        ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1070            type Operation =
1071                lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1072            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1073            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1074
1075            let stub = self.0.stub.clone();
1076            let mut options = self.0.options.clone();
1077            options.set_retry_policy(gax::retry_policy::NeverRetry);
1078            let query = move |name| {
1079                let stub = stub.clone();
1080                let options = options.clone();
1081                async {
1082                    let op = GetOperation::new(stub)
1083                        .set_name(name)
1084                        .with_options(options)
1085                        .send()
1086                        .await?;
1087                    Ok(Operation::new(op))
1088                }
1089            };
1090
1091            let start = move || async {
1092                let op = self.send().await?;
1093                Ok(Operation::new(op))
1094            };
1095
1096            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1097        }
1098
1099        /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
1100        ///
1101        /// This is a **required** field for requests.
1102        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103            self.0.request.parent = v.into();
1104            self
1105        }
1106
1107        /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
1108        ///
1109        /// This is a **required** field for requests.
1110        pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111            self.0.request.target_id = v.into();
1112            self
1113        }
1114
1115        /// Sets the value of [target][crate::model::CreateTargetRequest::target].
1116        ///
1117        /// This is a **required** field for requests.
1118        pub fn set_target<T>(mut self, v: T) -> Self
1119        where
1120            T: std::convert::Into<crate::model::Target>,
1121        {
1122            self.0.request.target = std::option::Option::Some(v.into());
1123            self
1124        }
1125
1126        /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
1127        ///
1128        /// This is a **required** field for requests.
1129        pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1130        where
1131            T: std::convert::Into<crate::model::Target>,
1132        {
1133            self.0.request.target = v.map(|x| x.into());
1134            self
1135        }
1136
1137        /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
1138        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139            self.0.request.request_id = v.into();
1140            self
1141        }
1142
1143        /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
1144        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1145            self.0.request.validate_only = v.into();
1146            self
1147        }
1148    }
1149
1150    #[doc(hidden)]
1151    impl gax::options::internal::RequestBuilder for CreateTarget {
1152        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1153            &mut self.0.options
1154        }
1155    }
1156
1157    /// The request builder for [CloudDeploy::update_target][crate::client::CloudDeploy::update_target] calls.
1158    ///
1159    /// # Example
1160    /// ```no_run
1161    /// # use google_cloud_deploy_v1::builder;
1162    /// use builder::cloud_deploy::UpdateTarget;
1163    /// # tokio_test::block_on(async {
1164    /// use lro::Poller;
1165    ///
1166    /// let builder = prepare_request_builder();
1167    /// let response = builder.poller().until_done().await?;
1168    /// # gax::Result::<()>::Ok(()) });
1169    ///
1170    /// fn prepare_request_builder() -> UpdateTarget {
1171    ///   # panic!();
1172    ///   // ... details omitted ...
1173    /// }
1174    /// ```
1175    #[derive(Clone, Debug)]
1176    pub struct UpdateTarget(RequestBuilder<crate::model::UpdateTargetRequest>);
1177
1178    impl UpdateTarget {
1179        pub(crate) fn new(
1180            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1181        ) -> Self {
1182            Self(RequestBuilder::new(stub))
1183        }
1184
1185        /// Sets the full request, replacing any prior values.
1186        pub fn with_request<V: Into<crate::model::UpdateTargetRequest>>(mut self, v: V) -> Self {
1187            self.0.request = v.into();
1188            self
1189        }
1190
1191        /// Sets all the options, replacing any prior values.
1192        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1193            self.0.options = v.into();
1194            self
1195        }
1196
1197        /// Sends the request.
1198        ///
1199        /// # Long running operations
1200        ///
1201        /// This starts, but does not poll, a longrunning operation. More information
1202        /// on [update_target][crate::client::CloudDeploy::update_target].
1203        pub async fn send(self) -> Result<longrunning::model::Operation> {
1204            (*self.0.stub)
1205                .update_target(self.0.request, self.0.options)
1206                .await
1207                .map(gax::response::Response::into_body)
1208        }
1209
1210        /// Creates a [Poller][lro::Poller] to work with `update_target`.
1211        pub fn poller(
1212            self,
1213        ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1214            type Operation =
1215                lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1216            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1217            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1218
1219            let stub = self.0.stub.clone();
1220            let mut options = self.0.options.clone();
1221            options.set_retry_policy(gax::retry_policy::NeverRetry);
1222            let query = move |name| {
1223                let stub = stub.clone();
1224                let options = options.clone();
1225                async {
1226                    let op = GetOperation::new(stub)
1227                        .set_name(name)
1228                        .with_options(options)
1229                        .send()
1230                        .await?;
1231                    Ok(Operation::new(op))
1232                }
1233            };
1234
1235            let start = move || async {
1236                let op = self.send().await?;
1237                Ok(Operation::new(op))
1238            };
1239
1240            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1241        }
1242
1243        /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
1244        ///
1245        /// This is a **required** field for requests.
1246        pub fn set_update_mask<T>(mut self, v: T) -> Self
1247        where
1248            T: std::convert::Into<wkt::FieldMask>,
1249        {
1250            self.0.request.update_mask = std::option::Option::Some(v.into());
1251            self
1252        }
1253
1254        /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
1255        ///
1256        /// This is a **required** field for requests.
1257        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1258        where
1259            T: std::convert::Into<wkt::FieldMask>,
1260        {
1261            self.0.request.update_mask = v.map(|x| x.into());
1262            self
1263        }
1264
1265        /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
1266        ///
1267        /// This is a **required** field for requests.
1268        pub fn set_target<T>(mut self, v: T) -> Self
1269        where
1270            T: std::convert::Into<crate::model::Target>,
1271        {
1272            self.0.request.target = std::option::Option::Some(v.into());
1273            self
1274        }
1275
1276        /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
1277        ///
1278        /// This is a **required** field for requests.
1279        pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1280        where
1281            T: std::convert::Into<crate::model::Target>,
1282        {
1283            self.0.request.target = v.map(|x| x.into());
1284            self
1285        }
1286
1287        /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
1288        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1289            self.0.request.request_id = v.into();
1290            self
1291        }
1292
1293        /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
1294        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1295            self.0.request.allow_missing = v.into();
1296            self
1297        }
1298
1299        /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
1300        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1301            self.0.request.validate_only = v.into();
1302            self
1303        }
1304    }
1305
1306    #[doc(hidden)]
1307    impl gax::options::internal::RequestBuilder for UpdateTarget {
1308        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1309            &mut self.0.options
1310        }
1311    }
1312
1313    /// The request builder for [CloudDeploy::delete_target][crate::client::CloudDeploy::delete_target] calls.
1314    ///
1315    /// # Example
1316    /// ```no_run
1317    /// # use google_cloud_deploy_v1::builder;
1318    /// use builder::cloud_deploy::DeleteTarget;
1319    /// # tokio_test::block_on(async {
1320    /// use lro::Poller;
1321    ///
1322    /// let builder = prepare_request_builder();
1323    /// let response = builder.poller().until_done().await?;
1324    /// # gax::Result::<()>::Ok(()) });
1325    ///
1326    /// fn prepare_request_builder() -> DeleteTarget {
1327    ///   # panic!();
1328    ///   // ... details omitted ...
1329    /// }
1330    /// ```
1331    #[derive(Clone, Debug)]
1332    pub struct DeleteTarget(RequestBuilder<crate::model::DeleteTargetRequest>);
1333
1334    impl DeleteTarget {
1335        pub(crate) fn new(
1336            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1337        ) -> Self {
1338            Self(RequestBuilder::new(stub))
1339        }
1340
1341        /// Sets the full request, replacing any prior values.
1342        pub fn with_request<V: Into<crate::model::DeleteTargetRequest>>(mut self, v: V) -> Self {
1343            self.0.request = v.into();
1344            self
1345        }
1346
1347        /// Sets all the options, replacing any prior values.
1348        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1349            self.0.options = v.into();
1350            self
1351        }
1352
1353        /// Sends the request.
1354        ///
1355        /// # Long running operations
1356        ///
1357        /// This starts, but does not poll, a longrunning operation. More information
1358        /// on [delete_target][crate::client::CloudDeploy::delete_target].
1359        pub async fn send(self) -> Result<longrunning::model::Operation> {
1360            (*self.0.stub)
1361                .delete_target(self.0.request, self.0.options)
1362                .await
1363                .map(gax::response::Response::into_body)
1364        }
1365
1366        /// Creates a [Poller][lro::Poller] to work with `delete_target`.
1367        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1368            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1369            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1370            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1371
1372            let stub = self.0.stub.clone();
1373            let mut options = self.0.options.clone();
1374            options.set_retry_policy(gax::retry_policy::NeverRetry);
1375            let query = move |name| {
1376                let stub = stub.clone();
1377                let options = options.clone();
1378                async {
1379                    let op = GetOperation::new(stub)
1380                        .set_name(name)
1381                        .with_options(options)
1382                        .send()
1383                        .await?;
1384                    Ok(Operation::new(op))
1385                }
1386            };
1387
1388            let start = move || async {
1389                let op = self.send().await?;
1390                Ok(Operation::new(op))
1391            };
1392
1393            lro::internal::new_unit_response_poller(
1394                polling_error_policy,
1395                polling_backoff_policy,
1396                start,
1397                query,
1398            )
1399        }
1400
1401        /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
1402        ///
1403        /// This is a **required** field for requests.
1404        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1405            self.0.request.name = v.into();
1406            self
1407        }
1408
1409        /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
1410        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411            self.0.request.request_id = v.into();
1412            self
1413        }
1414
1415        /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
1416        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1417            self.0.request.allow_missing = v.into();
1418            self
1419        }
1420
1421        /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
1422        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1423            self.0.request.validate_only = v.into();
1424            self
1425        }
1426
1427        /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
1428        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1429            self.0.request.etag = v.into();
1430            self
1431        }
1432    }
1433
1434    #[doc(hidden)]
1435    impl gax::options::internal::RequestBuilder for DeleteTarget {
1436        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1437            &mut self.0.options
1438        }
1439    }
1440
1441    /// The request builder for [CloudDeploy::list_custom_target_types][crate::client::CloudDeploy::list_custom_target_types] calls.
1442    ///
1443    /// # Example
1444    /// ```no_run
1445    /// # use google_cloud_deploy_v1::builder;
1446    /// use builder::cloud_deploy::ListCustomTargetTypes;
1447    /// # tokio_test::block_on(async {
1448    /// use gax::paginator::ItemPaginator;
1449    ///
1450    /// let builder = prepare_request_builder();
1451    /// let mut items = builder.by_item();
1452    /// while let Some(result) = items.next().await {
1453    ///   let item = result?;
1454    /// }
1455    /// # gax::Result::<()>::Ok(()) });
1456    ///
1457    /// fn prepare_request_builder() -> ListCustomTargetTypes {
1458    ///   # panic!();
1459    ///   // ... details omitted ...
1460    /// }
1461    /// ```
1462    #[derive(Clone, Debug)]
1463    pub struct ListCustomTargetTypes(RequestBuilder<crate::model::ListCustomTargetTypesRequest>);
1464
1465    impl ListCustomTargetTypes {
1466        pub(crate) fn new(
1467            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1468        ) -> Self {
1469            Self(RequestBuilder::new(stub))
1470        }
1471
1472        /// Sets the full request, replacing any prior values.
1473        pub fn with_request<V: Into<crate::model::ListCustomTargetTypesRequest>>(
1474            mut self,
1475            v: V,
1476        ) -> Self {
1477            self.0.request = v.into();
1478            self
1479        }
1480
1481        /// Sets all the options, replacing any prior values.
1482        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1483            self.0.options = v.into();
1484            self
1485        }
1486
1487        /// Sends the request.
1488        pub async fn send(self) -> Result<crate::model::ListCustomTargetTypesResponse> {
1489            (*self.0.stub)
1490                .list_custom_target_types(self.0.request, self.0.options)
1491                .await
1492                .map(gax::response::Response::into_body)
1493        }
1494
1495        /// Streams each page in the collection.
1496        pub fn by_page(
1497            self,
1498        ) -> impl gax::paginator::Paginator<crate::model::ListCustomTargetTypesResponse, gax::error::Error>
1499        {
1500            use std::clone::Clone;
1501            let token = self.0.request.page_token.clone();
1502            let execute = move |token: String| {
1503                let mut builder = self.clone();
1504                builder.0.request = builder.0.request.set_page_token(token);
1505                builder.send()
1506            };
1507            gax::paginator::internal::new_paginator(token, execute)
1508        }
1509
1510        /// Streams each item in the collection.
1511        pub fn by_item(
1512            self,
1513        ) -> impl gax::paginator::ItemPaginator<
1514            crate::model::ListCustomTargetTypesResponse,
1515            gax::error::Error,
1516        > {
1517            use gax::paginator::Paginator;
1518            self.by_page().items()
1519        }
1520
1521        /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
1522        ///
1523        /// This is a **required** field for requests.
1524        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525            self.0.request.parent = v.into();
1526            self
1527        }
1528
1529        /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
1530        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1531            self.0.request.page_size = v.into();
1532            self
1533        }
1534
1535        /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
1536        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1537            self.0.request.page_token = v.into();
1538            self
1539        }
1540
1541        /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
1542        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1543            self.0.request.filter = v.into();
1544            self
1545        }
1546
1547        /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
1548        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549            self.0.request.order_by = v.into();
1550            self
1551        }
1552    }
1553
1554    #[doc(hidden)]
1555    impl gax::options::internal::RequestBuilder for ListCustomTargetTypes {
1556        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1557            &mut self.0.options
1558        }
1559    }
1560
1561    /// The request builder for [CloudDeploy::get_custom_target_type][crate::client::CloudDeploy::get_custom_target_type] calls.
1562    ///
1563    /// # Example
1564    /// ```no_run
1565    /// # use google_cloud_deploy_v1::builder;
1566    /// use builder::cloud_deploy::GetCustomTargetType;
1567    /// # tokio_test::block_on(async {
1568    ///
1569    /// let builder = prepare_request_builder();
1570    /// let response = builder.send().await?;
1571    /// # gax::Result::<()>::Ok(()) });
1572    ///
1573    /// fn prepare_request_builder() -> GetCustomTargetType {
1574    ///   # panic!();
1575    ///   // ... details omitted ...
1576    /// }
1577    /// ```
1578    #[derive(Clone, Debug)]
1579    pub struct GetCustomTargetType(RequestBuilder<crate::model::GetCustomTargetTypeRequest>);
1580
1581    impl GetCustomTargetType {
1582        pub(crate) fn new(
1583            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1584        ) -> Self {
1585            Self(RequestBuilder::new(stub))
1586        }
1587
1588        /// Sets the full request, replacing any prior values.
1589        pub fn with_request<V: Into<crate::model::GetCustomTargetTypeRequest>>(
1590            mut self,
1591            v: V,
1592        ) -> Self {
1593            self.0.request = v.into();
1594            self
1595        }
1596
1597        /// Sets all the options, replacing any prior values.
1598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1599            self.0.options = v.into();
1600            self
1601        }
1602
1603        /// Sends the request.
1604        pub async fn send(self) -> Result<crate::model::CustomTargetType> {
1605            (*self.0.stub)
1606                .get_custom_target_type(self.0.request, self.0.options)
1607                .await
1608                .map(gax::response::Response::into_body)
1609        }
1610
1611        /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
1612        ///
1613        /// This is a **required** field for requests.
1614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1615            self.0.request.name = v.into();
1616            self
1617        }
1618    }
1619
1620    #[doc(hidden)]
1621    impl gax::options::internal::RequestBuilder for GetCustomTargetType {
1622        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1623            &mut self.0.options
1624        }
1625    }
1626
1627    /// The request builder for [CloudDeploy::create_custom_target_type][crate::client::CloudDeploy::create_custom_target_type] calls.
1628    ///
1629    /// # Example
1630    /// ```no_run
1631    /// # use google_cloud_deploy_v1::builder;
1632    /// use builder::cloud_deploy::CreateCustomTargetType;
1633    /// # tokio_test::block_on(async {
1634    /// use lro::Poller;
1635    ///
1636    /// let builder = prepare_request_builder();
1637    /// let response = builder.poller().until_done().await?;
1638    /// # gax::Result::<()>::Ok(()) });
1639    ///
1640    /// fn prepare_request_builder() -> CreateCustomTargetType {
1641    ///   # panic!();
1642    ///   // ... details omitted ...
1643    /// }
1644    /// ```
1645    #[derive(Clone, Debug)]
1646    pub struct CreateCustomTargetType(RequestBuilder<crate::model::CreateCustomTargetTypeRequest>);
1647
1648    impl CreateCustomTargetType {
1649        pub(crate) fn new(
1650            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1651        ) -> Self {
1652            Self(RequestBuilder::new(stub))
1653        }
1654
1655        /// Sets the full request, replacing any prior values.
1656        pub fn with_request<V: Into<crate::model::CreateCustomTargetTypeRequest>>(
1657            mut self,
1658            v: V,
1659        ) -> Self {
1660            self.0.request = v.into();
1661            self
1662        }
1663
1664        /// Sets all the options, replacing any prior values.
1665        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1666            self.0.options = v.into();
1667            self
1668        }
1669
1670        /// Sends the request.
1671        ///
1672        /// # Long running operations
1673        ///
1674        /// This starts, but does not poll, a longrunning operation. More information
1675        /// on [create_custom_target_type][crate::client::CloudDeploy::create_custom_target_type].
1676        pub async fn send(self) -> Result<longrunning::model::Operation> {
1677            (*self.0.stub)
1678                .create_custom_target_type(self.0.request, self.0.options)
1679                .await
1680                .map(gax::response::Response::into_body)
1681        }
1682
1683        /// Creates a [Poller][lro::Poller] to work with `create_custom_target_type`.
1684        pub fn poller(
1685            self,
1686        ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1687        {
1688            type Operation = lro::internal::Operation<
1689                crate::model::CustomTargetType,
1690                crate::model::OperationMetadata,
1691            >;
1692            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1693            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1694
1695            let stub = self.0.stub.clone();
1696            let mut options = self.0.options.clone();
1697            options.set_retry_policy(gax::retry_policy::NeverRetry);
1698            let query = move |name| {
1699                let stub = stub.clone();
1700                let options = options.clone();
1701                async {
1702                    let op = GetOperation::new(stub)
1703                        .set_name(name)
1704                        .with_options(options)
1705                        .send()
1706                        .await?;
1707                    Ok(Operation::new(op))
1708                }
1709            };
1710
1711            let start = move || async {
1712                let op = self.send().await?;
1713                Ok(Operation::new(op))
1714            };
1715
1716            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1717        }
1718
1719        /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
1720        ///
1721        /// This is a **required** field for requests.
1722        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1723            self.0.request.parent = v.into();
1724            self
1725        }
1726
1727        /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
1728        ///
1729        /// This is a **required** field for requests.
1730        pub fn set_custom_target_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731            self.0.request.custom_target_type_id = v.into();
1732            self
1733        }
1734
1735        /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
1736        ///
1737        /// This is a **required** field for requests.
1738        pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1739        where
1740            T: std::convert::Into<crate::model::CustomTargetType>,
1741        {
1742            self.0.request.custom_target_type = std::option::Option::Some(v.into());
1743            self
1744        }
1745
1746        /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
1747        ///
1748        /// This is a **required** field for requests.
1749        pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1750        where
1751            T: std::convert::Into<crate::model::CustomTargetType>,
1752        {
1753            self.0.request.custom_target_type = v.map(|x| x.into());
1754            self
1755        }
1756
1757        /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
1758        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1759            self.0.request.request_id = v.into();
1760            self
1761        }
1762
1763        /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
1764        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1765            self.0.request.validate_only = v.into();
1766            self
1767        }
1768    }
1769
1770    #[doc(hidden)]
1771    impl gax::options::internal::RequestBuilder for CreateCustomTargetType {
1772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1773            &mut self.0.options
1774        }
1775    }
1776
1777    /// The request builder for [CloudDeploy::update_custom_target_type][crate::client::CloudDeploy::update_custom_target_type] calls.
1778    ///
1779    /// # Example
1780    /// ```no_run
1781    /// # use google_cloud_deploy_v1::builder;
1782    /// use builder::cloud_deploy::UpdateCustomTargetType;
1783    /// # tokio_test::block_on(async {
1784    /// use lro::Poller;
1785    ///
1786    /// let builder = prepare_request_builder();
1787    /// let response = builder.poller().until_done().await?;
1788    /// # gax::Result::<()>::Ok(()) });
1789    ///
1790    /// fn prepare_request_builder() -> UpdateCustomTargetType {
1791    ///   # panic!();
1792    ///   // ... details omitted ...
1793    /// }
1794    /// ```
1795    #[derive(Clone, Debug)]
1796    pub struct UpdateCustomTargetType(RequestBuilder<crate::model::UpdateCustomTargetTypeRequest>);
1797
1798    impl UpdateCustomTargetType {
1799        pub(crate) fn new(
1800            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1801        ) -> Self {
1802            Self(RequestBuilder::new(stub))
1803        }
1804
1805        /// Sets the full request, replacing any prior values.
1806        pub fn with_request<V: Into<crate::model::UpdateCustomTargetTypeRequest>>(
1807            mut self,
1808            v: V,
1809        ) -> Self {
1810            self.0.request = v.into();
1811            self
1812        }
1813
1814        /// Sets all the options, replacing any prior values.
1815        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1816            self.0.options = v.into();
1817            self
1818        }
1819
1820        /// Sends the request.
1821        ///
1822        /// # Long running operations
1823        ///
1824        /// This starts, but does not poll, a longrunning operation. More information
1825        /// on [update_custom_target_type][crate::client::CloudDeploy::update_custom_target_type].
1826        pub async fn send(self) -> Result<longrunning::model::Operation> {
1827            (*self.0.stub)
1828                .update_custom_target_type(self.0.request, self.0.options)
1829                .await
1830                .map(gax::response::Response::into_body)
1831        }
1832
1833        /// Creates a [Poller][lro::Poller] to work with `update_custom_target_type`.
1834        pub fn poller(
1835            self,
1836        ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1837        {
1838            type Operation = lro::internal::Operation<
1839                crate::model::CustomTargetType,
1840                crate::model::OperationMetadata,
1841            >;
1842            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1843            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1844
1845            let stub = self.0.stub.clone();
1846            let mut options = self.0.options.clone();
1847            options.set_retry_policy(gax::retry_policy::NeverRetry);
1848            let query = move |name| {
1849                let stub = stub.clone();
1850                let options = options.clone();
1851                async {
1852                    let op = GetOperation::new(stub)
1853                        .set_name(name)
1854                        .with_options(options)
1855                        .send()
1856                        .await?;
1857                    Ok(Operation::new(op))
1858                }
1859            };
1860
1861            let start = move || async {
1862                let op = self.send().await?;
1863                Ok(Operation::new(op))
1864            };
1865
1866            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1867        }
1868
1869        /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
1870        ///
1871        /// This is a **required** field for requests.
1872        pub fn set_update_mask<T>(mut self, v: T) -> Self
1873        where
1874            T: std::convert::Into<wkt::FieldMask>,
1875        {
1876            self.0.request.update_mask = std::option::Option::Some(v.into());
1877            self
1878        }
1879
1880        /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
1881        ///
1882        /// This is a **required** field for requests.
1883        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1884        where
1885            T: std::convert::Into<wkt::FieldMask>,
1886        {
1887            self.0.request.update_mask = v.map(|x| x.into());
1888            self
1889        }
1890
1891        /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
1892        ///
1893        /// This is a **required** field for requests.
1894        pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1895        where
1896            T: std::convert::Into<crate::model::CustomTargetType>,
1897        {
1898            self.0.request.custom_target_type = std::option::Option::Some(v.into());
1899            self
1900        }
1901
1902        /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
1903        ///
1904        /// This is a **required** field for requests.
1905        pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1906        where
1907            T: std::convert::Into<crate::model::CustomTargetType>,
1908        {
1909            self.0.request.custom_target_type = v.map(|x| x.into());
1910            self
1911        }
1912
1913        /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
1914        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1915            self.0.request.request_id = v.into();
1916            self
1917        }
1918
1919        /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
1920        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1921            self.0.request.allow_missing = v.into();
1922            self
1923        }
1924
1925        /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
1926        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1927            self.0.request.validate_only = v.into();
1928            self
1929        }
1930    }
1931
1932    #[doc(hidden)]
1933    impl gax::options::internal::RequestBuilder for UpdateCustomTargetType {
1934        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1935            &mut self.0.options
1936        }
1937    }
1938
1939    /// The request builder for [CloudDeploy::delete_custom_target_type][crate::client::CloudDeploy::delete_custom_target_type] calls.
1940    ///
1941    /// # Example
1942    /// ```no_run
1943    /// # use google_cloud_deploy_v1::builder;
1944    /// use builder::cloud_deploy::DeleteCustomTargetType;
1945    /// # tokio_test::block_on(async {
1946    /// use lro::Poller;
1947    ///
1948    /// let builder = prepare_request_builder();
1949    /// let response = builder.poller().until_done().await?;
1950    /// # gax::Result::<()>::Ok(()) });
1951    ///
1952    /// fn prepare_request_builder() -> DeleteCustomTargetType {
1953    ///   # panic!();
1954    ///   // ... details omitted ...
1955    /// }
1956    /// ```
1957    #[derive(Clone, Debug)]
1958    pub struct DeleteCustomTargetType(RequestBuilder<crate::model::DeleteCustomTargetTypeRequest>);
1959
1960    impl DeleteCustomTargetType {
1961        pub(crate) fn new(
1962            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1963        ) -> Self {
1964            Self(RequestBuilder::new(stub))
1965        }
1966
1967        /// Sets the full request, replacing any prior values.
1968        pub fn with_request<V: Into<crate::model::DeleteCustomTargetTypeRequest>>(
1969            mut self,
1970            v: V,
1971        ) -> Self {
1972            self.0.request = v.into();
1973            self
1974        }
1975
1976        /// Sets all the options, replacing any prior values.
1977        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1978            self.0.options = v.into();
1979            self
1980        }
1981
1982        /// Sends the request.
1983        ///
1984        /// # Long running operations
1985        ///
1986        /// This starts, but does not poll, a longrunning operation. More information
1987        /// on [delete_custom_target_type][crate::client::CloudDeploy::delete_custom_target_type].
1988        pub async fn send(self) -> Result<longrunning::model::Operation> {
1989            (*self.0.stub)
1990                .delete_custom_target_type(self.0.request, self.0.options)
1991                .await
1992                .map(gax::response::Response::into_body)
1993        }
1994
1995        /// Creates a [Poller][lro::Poller] to work with `delete_custom_target_type`.
1996        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1997            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1998            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1999            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2000
2001            let stub = self.0.stub.clone();
2002            let mut options = self.0.options.clone();
2003            options.set_retry_policy(gax::retry_policy::NeverRetry);
2004            let query = move |name| {
2005                let stub = stub.clone();
2006                let options = options.clone();
2007                async {
2008                    let op = GetOperation::new(stub)
2009                        .set_name(name)
2010                        .with_options(options)
2011                        .send()
2012                        .await?;
2013                    Ok(Operation::new(op))
2014                }
2015            };
2016
2017            let start = move || async {
2018                let op = self.send().await?;
2019                Ok(Operation::new(op))
2020            };
2021
2022            lro::internal::new_unit_response_poller(
2023                polling_error_policy,
2024                polling_backoff_policy,
2025                start,
2026                query,
2027            )
2028        }
2029
2030        /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
2031        ///
2032        /// This is a **required** field for requests.
2033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2034            self.0.request.name = v.into();
2035            self
2036        }
2037
2038        /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
2039        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040            self.0.request.request_id = v.into();
2041            self
2042        }
2043
2044        /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
2045        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2046            self.0.request.allow_missing = v.into();
2047            self
2048        }
2049
2050        /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
2051        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2052            self.0.request.validate_only = v.into();
2053            self
2054        }
2055
2056        /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
2057        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2058            self.0.request.etag = v.into();
2059            self
2060        }
2061    }
2062
2063    #[doc(hidden)]
2064    impl gax::options::internal::RequestBuilder for DeleteCustomTargetType {
2065        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2066            &mut self.0.options
2067        }
2068    }
2069
2070    /// The request builder for [CloudDeploy::list_releases][crate::client::CloudDeploy::list_releases] calls.
2071    ///
2072    /// # Example
2073    /// ```no_run
2074    /// # use google_cloud_deploy_v1::builder;
2075    /// use builder::cloud_deploy::ListReleases;
2076    /// # tokio_test::block_on(async {
2077    /// use gax::paginator::ItemPaginator;
2078    ///
2079    /// let builder = prepare_request_builder();
2080    /// let mut items = builder.by_item();
2081    /// while let Some(result) = items.next().await {
2082    ///   let item = result?;
2083    /// }
2084    /// # gax::Result::<()>::Ok(()) });
2085    ///
2086    /// fn prepare_request_builder() -> ListReleases {
2087    ///   # panic!();
2088    ///   // ... details omitted ...
2089    /// }
2090    /// ```
2091    #[derive(Clone, Debug)]
2092    pub struct ListReleases(RequestBuilder<crate::model::ListReleasesRequest>);
2093
2094    impl ListReleases {
2095        pub(crate) fn new(
2096            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2097        ) -> Self {
2098            Self(RequestBuilder::new(stub))
2099        }
2100
2101        /// Sets the full request, replacing any prior values.
2102        pub fn with_request<V: Into<crate::model::ListReleasesRequest>>(mut self, v: V) -> Self {
2103            self.0.request = v.into();
2104            self
2105        }
2106
2107        /// Sets all the options, replacing any prior values.
2108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2109            self.0.options = v.into();
2110            self
2111        }
2112
2113        /// Sends the request.
2114        pub async fn send(self) -> Result<crate::model::ListReleasesResponse> {
2115            (*self.0.stub)
2116                .list_releases(self.0.request, self.0.options)
2117                .await
2118                .map(gax::response::Response::into_body)
2119        }
2120
2121        /// Streams each page in the collection.
2122        pub fn by_page(
2123            self,
2124        ) -> impl gax::paginator::Paginator<crate::model::ListReleasesResponse, gax::error::Error>
2125        {
2126            use std::clone::Clone;
2127            let token = self.0.request.page_token.clone();
2128            let execute = move |token: String| {
2129                let mut builder = self.clone();
2130                builder.0.request = builder.0.request.set_page_token(token);
2131                builder.send()
2132            };
2133            gax::paginator::internal::new_paginator(token, execute)
2134        }
2135
2136        /// Streams each item in the collection.
2137        pub fn by_item(
2138            self,
2139        ) -> impl gax::paginator::ItemPaginator<crate::model::ListReleasesResponse, gax::error::Error>
2140        {
2141            use gax::paginator::Paginator;
2142            self.by_page().items()
2143        }
2144
2145        /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
2146        ///
2147        /// This is a **required** field for requests.
2148        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2149            self.0.request.parent = v.into();
2150            self
2151        }
2152
2153        /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
2154        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2155            self.0.request.page_size = v.into();
2156            self
2157        }
2158
2159        /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
2160        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2161            self.0.request.page_token = v.into();
2162            self
2163        }
2164
2165        /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
2166        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167            self.0.request.filter = v.into();
2168            self
2169        }
2170
2171        /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
2172        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173            self.0.request.order_by = v.into();
2174            self
2175        }
2176    }
2177
2178    #[doc(hidden)]
2179    impl gax::options::internal::RequestBuilder for ListReleases {
2180        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2181            &mut self.0.options
2182        }
2183    }
2184
2185    /// The request builder for [CloudDeploy::get_release][crate::client::CloudDeploy::get_release] calls.
2186    ///
2187    /// # Example
2188    /// ```no_run
2189    /// # use google_cloud_deploy_v1::builder;
2190    /// use builder::cloud_deploy::GetRelease;
2191    /// # tokio_test::block_on(async {
2192    ///
2193    /// let builder = prepare_request_builder();
2194    /// let response = builder.send().await?;
2195    /// # gax::Result::<()>::Ok(()) });
2196    ///
2197    /// fn prepare_request_builder() -> GetRelease {
2198    ///   # panic!();
2199    ///   // ... details omitted ...
2200    /// }
2201    /// ```
2202    #[derive(Clone, Debug)]
2203    pub struct GetRelease(RequestBuilder<crate::model::GetReleaseRequest>);
2204
2205    impl GetRelease {
2206        pub(crate) fn new(
2207            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2208        ) -> Self {
2209            Self(RequestBuilder::new(stub))
2210        }
2211
2212        /// Sets the full request, replacing any prior values.
2213        pub fn with_request<V: Into<crate::model::GetReleaseRequest>>(mut self, v: V) -> Self {
2214            self.0.request = v.into();
2215            self
2216        }
2217
2218        /// Sets all the options, replacing any prior values.
2219        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2220            self.0.options = v.into();
2221            self
2222        }
2223
2224        /// Sends the request.
2225        pub async fn send(self) -> Result<crate::model::Release> {
2226            (*self.0.stub)
2227                .get_release(self.0.request, self.0.options)
2228                .await
2229                .map(gax::response::Response::into_body)
2230        }
2231
2232        /// Sets the value of [name][crate::model::GetReleaseRequest::name].
2233        ///
2234        /// This is a **required** field for requests.
2235        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2236            self.0.request.name = v.into();
2237            self
2238        }
2239    }
2240
2241    #[doc(hidden)]
2242    impl gax::options::internal::RequestBuilder for GetRelease {
2243        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2244            &mut self.0.options
2245        }
2246    }
2247
2248    /// The request builder for [CloudDeploy::create_release][crate::client::CloudDeploy::create_release] calls.
2249    ///
2250    /// # Example
2251    /// ```no_run
2252    /// # use google_cloud_deploy_v1::builder;
2253    /// use builder::cloud_deploy::CreateRelease;
2254    /// # tokio_test::block_on(async {
2255    /// use lro::Poller;
2256    ///
2257    /// let builder = prepare_request_builder();
2258    /// let response = builder.poller().until_done().await?;
2259    /// # gax::Result::<()>::Ok(()) });
2260    ///
2261    /// fn prepare_request_builder() -> CreateRelease {
2262    ///   # panic!();
2263    ///   // ... details omitted ...
2264    /// }
2265    /// ```
2266    #[derive(Clone, Debug)]
2267    pub struct CreateRelease(RequestBuilder<crate::model::CreateReleaseRequest>);
2268
2269    impl CreateRelease {
2270        pub(crate) fn new(
2271            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2272        ) -> Self {
2273            Self(RequestBuilder::new(stub))
2274        }
2275
2276        /// Sets the full request, replacing any prior values.
2277        pub fn with_request<V: Into<crate::model::CreateReleaseRequest>>(mut self, v: V) -> Self {
2278            self.0.request = v.into();
2279            self
2280        }
2281
2282        /// Sets all the options, replacing any prior values.
2283        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2284            self.0.options = v.into();
2285            self
2286        }
2287
2288        /// Sends the request.
2289        ///
2290        /// # Long running operations
2291        ///
2292        /// This starts, but does not poll, a longrunning operation. More information
2293        /// on [create_release][crate::client::CloudDeploy::create_release].
2294        pub async fn send(self) -> Result<longrunning::model::Operation> {
2295            (*self.0.stub)
2296                .create_release(self.0.request, self.0.options)
2297                .await
2298                .map(gax::response::Response::into_body)
2299        }
2300
2301        /// Creates a [Poller][lro::Poller] to work with `create_release`.
2302        pub fn poller(
2303            self,
2304        ) -> impl lro::Poller<crate::model::Release, crate::model::OperationMetadata> {
2305            type Operation =
2306                lro::internal::Operation<crate::model::Release, crate::model::OperationMetadata>;
2307            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2308            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2309
2310            let stub = self.0.stub.clone();
2311            let mut options = self.0.options.clone();
2312            options.set_retry_policy(gax::retry_policy::NeverRetry);
2313            let query = move |name| {
2314                let stub = stub.clone();
2315                let options = options.clone();
2316                async {
2317                    let op = GetOperation::new(stub)
2318                        .set_name(name)
2319                        .with_options(options)
2320                        .send()
2321                        .await?;
2322                    Ok(Operation::new(op))
2323                }
2324            };
2325
2326            let start = move || async {
2327                let op = self.send().await?;
2328                Ok(Operation::new(op))
2329            };
2330
2331            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2332        }
2333
2334        /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
2335        ///
2336        /// This is a **required** field for requests.
2337        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2338            self.0.request.parent = v.into();
2339            self
2340        }
2341
2342        /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
2343        ///
2344        /// This is a **required** field for requests.
2345        pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346            self.0.request.release_id = v.into();
2347            self
2348        }
2349
2350        /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
2351        ///
2352        /// This is a **required** field for requests.
2353        pub fn set_release<T>(mut self, v: T) -> Self
2354        where
2355            T: std::convert::Into<crate::model::Release>,
2356        {
2357            self.0.request.release = std::option::Option::Some(v.into());
2358            self
2359        }
2360
2361        /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
2362        ///
2363        /// This is a **required** field for requests.
2364        pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
2365        where
2366            T: std::convert::Into<crate::model::Release>,
2367        {
2368            self.0.request.release = v.map(|x| x.into());
2369            self
2370        }
2371
2372        /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
2373        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2374            self.0.request.request_id = v.into();
2375            self
2376        }
2377
2378        /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
2379        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2380            self.0.request.validate_only = v.into();
2381            self
2382        }
2383
2384        /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
2385        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
2386        where
2387            T: std::iter::IntoIterator<Item = V>,
2388            V: std::convert::Into<std::string::String>,
2389        {
2390            use std::iter::Iterator;
2391            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
2392            self
2393        }
2394    }
2395
2396    #[doc(hidden)]
2397    impl gax::options::internal::RequestBuilder for CreateRelease {
2398        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2399            &mut self.0.options
2400        }
2401    }
2402
2403    /// The request builder for [CloudDeploy::abandon_release][crate::client::CloudDeploy::abandon_release] calls.
2404    ///
2405    /// # Example
2406    /// ```no_run
2407    /// # use google_cloud_deploy_v1::builder;
2408    /// use builder::cloud_deploy::AbandonRelease;
2409    /// # tokio_test::block_on(async {
2410    ///
2411    /// let builder = prepare_request_builder();
2412    /// let response = builder.send().await?;
2413    /// # gax::Result::<()>::Ok(()) });
2414    ///
2415    /// fn prepare_request_builder() -> AbandonRelease {
2416    ///   # panic!();
2417    ///   // ... details omitted ...
2418    /// }
2419    /// ```
2420    #[derive(Clone, Debug)]
2421    pub struct AbandonRelease(RequestBuilder<crate::model::AbandonReleaseRequest>);
2422
2423    impl AbandonRelease {
2424        pub(crate) fn new(
2425            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2426        ) -> Self {
2427            Self(RequestBuilder::new(stub))
2428        }
2429
2430        /// Sets the full request, replacing any prior values.
2431        pub fn with_request<V: Into<crate::model::AbandonReleaseRequest>>(mut self, v: V) -> Self {
2432            self.0.request = v.into();
2433            self
2434        }
2435
2436        /// Sets all the options, replacing any prior values.
2437        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2438            self.0.options = v.into();
2439            self
2440        }
2441
2442        /// Sends the request.
2443        pub async fn send(self) -> Result<crate::model::AbandonReleaseResponse> {
2444            (*self.0.stub)
2445                .abandon_release(self.0.request, self.0.options)
2446                .await
2447                .map(gax::response::Response::into_body)
2448        }
2449
2450        /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
2451        ///
2452        /// This is a **required** field for requests.
2453        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2454            self.0.request.name = v.into();
2455            self
2456        }
2457    }
2458
2459    #[doc(hidden)]
2460    impl gax::options::internal::RequestBuilder for AbandonRelease {
2461        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2462            &mut self.0.options
2463        }
2464    }
2465
2466    /// The request builder for [CloudDeploy::create_deploy_policy][crate::client::CloudDeploy::create_deploy_policy] calls.
2467    ///
2468    /// # Example
2469    /// ```no_run
2470    /// # use google_cloud_deploy_v1::builder;
2471    /// use builder::cloud_deploy::CreateDeployPolicy;
2472    /// # tokio_test::block_on(async {
2473    /// use lro::Poller;
2474    ///
2475    /// let builder = prepare_request_builder();
2476    /// let response = builder.poller().until_done().await?;
2477    /// # gax::Result::<()>::Ok(()) });
2478    ///
2479    /// fn prepare_request_builder() -> CreateDeployPolicy {
2480    ///   # panic!();
2481    ///   // ... details omitted ...
2482    /// }
2483    /// ```
2484    #[derive(Clone, Debug)]
2485    pub struct CreateDeployPolicy(RequestBuilder<crate::model::CreateDeployPolicyRequest>);
2486
2487    impl CreateDeployPolicy {
2488        pub(crate) fn new(
2489            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2490        ) -> Self {
2491            Self(RequestBuilder::new(stub))
2492        }
2493
2494        /// Sets the full request, replacing any prior values.
2495        pub fn with_request<V: Into<crate::model::CreateDeployPolicyRequest>>(
2496            mut self,
2497            v: V,
2498        ) -> Self {
2499            self.0.request = v.into();
2500            self
2501        }
2502
2503        /// Sets all the options, replacing any prior values.
2504        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2505            self.0.options = v.into();
2506            self
2507        }
2508
2509        /// Sends the request.
2510        ///
2511        /// # Long running operations
2512        ///
2513        /// This starts, but does not poll, a longrunning operation. More information
2514        /// on [create_deploy_policy][crate::client::CloudDeploy::create_deploy_policy].
2515        pub async fn send(self) -> Result<longrunning::model::Operation> {
2516            (*self.0.stub)
2517                .create_deploy_policy(self.0.request, self.0.options)
2518                .await
2519                .map(gax::response::Response::into_body)
2520        }
2521
2522        /// Creates a [Poller][lro::Poller] to work with `create_deploy_policy`.
2523        pub fn poller(
2524            self,
2525        ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2526            type Operation = lro::internal::Operation<
2527                crate::model::DeployPolicy,
2528                crate::model::OperationMetadata,
2529            >;
2530            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2531            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2532
2533            let stub = self.0.stub.clone();
2534            let mut options = self.0.options.clone();
2535            options.set_retry_policy(gax::retry_policy::NeverRetry);
2536            let query = move |name| {
2537                let stub = stub.clone();
2538                let options = options.clone();
2539                async {
2540                    let op = GetOperation::new(stub)
2541                        .set_name(name)
2542                        .with_options(options)
2543                        .send()
2544                        .await?;
2545                    Ok(Operation::new(op))
2546                }
2547            };
2548
2549            let start = move || async {
2550                let op = self.send().await?;
2551                Ok(Operation::new(op))
2552            };
2553
2554            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2555        }
2556
2557        /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
2558        ///
2559        /// This is a **required** field for requests.
2560        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2561            self.0.request.parent = v.into();
2562            self
2563        }
2564
2565        /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
2566        ///
2567        /// This is a **required** field for requests.
2568        pub fn set_deploy_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569            self.0.request.deploy_policy_id = v.into();
2570            self
2571        }
2572
2573        /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
2574        ///
2575        /// This is a **required** field for requests.
2576        pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2577        where
2578            T: std::convert::Into<crate::model::DeployPolicy>,
2579        {
2580            self.0.request.deploy_policy = std::option::Option::Some(v.into());
2581            self
2582        }
2583
2584        /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
2585        ///
2586        /// This is a **required** field for requests.
2587        pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2588        where
2589            T: std::convert::Into<crate::model::DeployPolicy>,
2590        {
2591            self.0.request.deploy_policy = v.map(|x| x.into());
2592            self
2593        }
2594
2595        /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
2596        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2597            self.0.request.request_id = v.into();
2598            self
2599        }
2600
2601        /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
2602        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2603            self.0.request.validate_only = v.into();
2604            self
2605        }
2606    }
2607
2608    #[doc(hidden)]
2609    impl gax::options::internal::RequestBuilder for CreateDeployPolicy {
2610        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2611            &mut self.0.options
2612        }
2613    }
2614
2615    /// The request builder for [CloudDeploy::update_deploy_policy][crate::client::CloudDeploy::update_deploy_policy] calls.
2616    ///
2617    /// # Example
2618    /// ```no_run
2619    /// # use google_cloud_deploy_v1::builder;
2620    /// use builder::cloud_deploy::UpdateDeployPolicy;
2621    /// # tokio_test::block_on(async {
2622    /// use lro::Poller;
2623    ///
2624    /// let builder = prepare_request_builder();
2625    /// let response = builder.poller().until_done().await?;
2626    /// # gax::Result::<()>::Ok(()) });
2627    ///
2628    /// fn prepare_request_builder() -> UpdateDeployPolicy {
2629    ///   # panic!();
2630    ///   // ... details omitted ...
2631    /// }
2632    /// ```
2633    #[derive(Clone, Debug)]
2634    pub struct UpdateDeployPolicy(RequestBuilder<crate::model::UpdateDeployPolicyRequest>);
2635
2636    impl UpdateDeployPolicy {
2637        pub(crate) fn new(
2638            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2639        ) -> Self {
2640            Self(RequestBuilder::new(stub))
2641        }
2642
2643        /// Sets the full request, replacing any prior values.
2644        pub fn with_request<V: Into<crate::model::UpdateDeployPolicyRequest>>(
2645            mut self,
2646            v: V,
2647        ) -> Self {
2648            self.0.request = v.into();
2649            self
2650        }
2651
2652        /// Sets all the options, replacing any prior values.
2653        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2654            self.0.options = v.into();
2655            self
2656        }
2657
2658        /// Sends the request.
2659        ///
2660        /// # Long running operations
2661        ///
2662        /// This starts, but does not poll, a longrunning operation. More information
2663        /// on [update_deploy_policy][crate::client::CloudDeploy::update_deploy_policy].
2664        pub async fn send(self) -> Result<longrunning::model::Operation> {
2665            (*self.0.stub)
2666                .update_deploy_policy(self.0.request, self.0.options)
2667                .await
2668                .map(gax::response::Response::into_body)
2669        }
2670
2671        /// Creates a [Poller][lro::Poller] to work with `update_deploy_policy`.
2672        pub fn poller(
2673            self,
2674        ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2675            type Operation = lro::internal::Operation<
2676                crate::model::DeployPolicy,
2677                crate::model::OperationMetadata,
2678            >;
2679            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2680            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2681
2682            let stub = self.0.stub.clone();
2683            let mut options = self.0.options.clone();
2684            options.set_retry_policy(gax::retry_policy::NeverRetry);
2685            let query = move |name| {
2686                let stub = stub.clone();
2687                let options = options.clone();
2688                async {
2689                    let op = GetOperation::new(stub)
2690                        .set_name(name)
2691                        .with_options(options)
2692                        .send()
2693                        .await?;
2694                    Ok(Operation::new(op))
2695                }
2696            };
2697
2698            let start = move || async {
2699                let op = self.send().await?;
2700                Ok(Operation::new(op))
2701            };
2702
2703            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2704        }
2705
2706        /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
2707        ///
2708        /// This is a **required** field for requests.
2709        pub fn set_update_mask<T>(mut self, v: T) -> Self
2710        where
2711            T: std::convert::Into<wkt::FieldMask>,
2712        {
2713            self.0.request.update_mask = std::option::Option::Some(v.into());
2714            self
2715        }
2716
2717        /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
2718        ///
2719        /// This is a **required** field for requests.
2720        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2721        where
2722            T: std::convert::Into<wkt::FieldMask>,
2723        {
2724            self.0.request.update_mask = v.map(|x| x.into());
2725            self
2726        }
2727
2728        /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
2729        ///
2730        /// This is a **required** field for requests.
2731        pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2732        where
2733            T: std::convert::Into<crate::model::DeployPolicy>,
2734        {
2735            self.0.request.deploy_policy = std::option::Option::Some(v.into());
2736            self
2737        }
2738
2739        /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
2740        ///
2741        /// This is a **required** field for requests.
2742        pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2743        where
2744            T: std::convert::Into<crate::model::DeployPolicy>,
2745        {
2746            self.0.request.deploy_policy = v.map(|x| x.into());
2747            self
2748        }
2749
2750        /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
2751        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2752            self.0.request.request_id = v.into();
2753            self
2754        }
2755
2756        /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
2757        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2758            self.0.request.allow_missing = v.into();
2759            self
2760        }
2761
2762        /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
2763        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2764            self.0.request.validate_only = v.into();
2765            self
2766        }
2767    }
2768
2769    #[doc(hidden)]
2770    impl gax::options::internal::RequestBuilder for UpdateDeployPolicy {
2771        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2772            &mut self.0.options
2773        }
2774    }
2775
2776    /// The request builder for [CloudDeploy::delete_deploy_policy][crate::client::CloudDeploy::delete_deploy_policy] calls.
2777    ///
2778    /// # Example
2779    /// ```no_run
2780    /// # use google_cloud_deploy_v1::builder;
2781    /// use builder::cloud_deploy::DeleteDeployPolicy;
2782    /// # tokio_test::block_on(async {
2783    /// use lro::Poller;
2784    ///
2785    /// let builder = prepare_request_builder();
2786    /// let response = builder.poller().until_done().await?;
2787    /// # gax::Result::<()>::Ok(()) });
2788    ///
2789    /// fn prepare_request_builder() -> DeleteDeployPolicy {
2790    ///   # panic!();
2791    ///   // ... details omitted ...
2792    /// }
2793    /// ```
2794    #[derive(Clone, Debug)]
2795    pub struct DeleteDeployPolicy(RequestBuilder<crate::model::DeleteDeployPolicyRequest>);
2796
2797    impl DeleteDeployPolicy {
2798        pub(crate) fn new(
2799            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2800        ) -> Self {
2801            Self(RequestBuilder::new(stub))
2802        }
2803
2804        /// Sets the full request, replacing any prior values.
2805        pub fn with_request<V: Into<crate::model::DeleteDeployPolicyRequest>>(
2806            mut self,
2807            v: V,
2808        ) -> Self {
2809            self.0.request = v.into();
2810            self
2811        }
2812
2813        /// Sets all the options, replacing any prior values.
2814        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2815            self.0.options = v.into();
2816            self
2817        }
2818
2819        /// Sends the request.
2820        ///
2821        /// # Long running operations
2822        ///
2823        /// This starts, but does not poll, a longrunning operation. More information
2824        /// on [delete_deploy_policy][crate::client::CloudDeploy::delete_deploy_policy].
2825        pub async fn send(self) -> Result<longrunning::model::Operation> {
2826            (*self.0.stub)
2827                .delete_deploy_policy(self.0.request, self.0.options)
2828                .await
2829                .map(gax::response::Response::into_body)
2830        }
2831
2832        /// Creates a [Poller][lro::Poller] to work with `delete_deploy_policy`.
2833        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2834            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2835            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2836            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2837
2838            let stub = self.0.stub.clone();
2839            let mut options = self.0.options.clone();
2840            options.set_retry_policy(gax::retry_policy::NeverRetry);
2841            let query = move |name| {
2842                let stub = stub.clone();
2843                let options = options.clone();
2844                async {
2845                    let op = GetOperation::new(stub)
2846                        .set_name(name)
2847                        .with_options(options)
2848                        .send()
2849                        .await?;
2850                    Ok(Operation::new(op))
2851                }
2852            };
2853
2854            let start = move || async {
2855                let op = self.send().await?;
2856                Ok(Operation::new(op))
2857            };
2858
2859            lro::internal::new_unit_response_poller(
2860                polling_error_policy,
2861                polling_backoff_policy,
2862                start,
2863                query,
2864            )
2865        }
2866
2867        /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
2868        ///
2869        /// This is a **required** field for requests.
2870        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2871            self.0.request.name = v.into();
2872            self
2873        }
2874
2875        /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
2876        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877            self.0.request.request_id = v.into();
2878            self
2879        }
2880
2881        /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
2882        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2883            self.0.request.allow_missing = v.into();
2884            self
2885        }
2886
2887        /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
2888        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2889            self.0.request.validate_only = v.into();
2890            self
2891        }
2892
2893        /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
2894        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2895            self.0.request.etag = v.into();
2896            self
2897        }
2898    }
2899
2900    #[doc(hidden)]
2901    impl gax::options::internal::RequestBuilder for DeleteDeployPolicy {
2902        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2903            &mut self.0.options
2904        }
2905    }
2906
2907    /// The request builder for [CloudDeploy::list_deploy_policies][crate::client::CloudDeploy::list_deploy_policies] calls.
2908    ///
2909    /// # Example
2910    /// ```no_run
2911    /// # use google_cloud_deploy_v1::builder;
2912    /// use builder::cloud_deploy::ListDeployPolicies;
2913    /// # tokio_test::block_on(async {
2914    /// use gax::paginator::ItemPaginator;
2915    ///
2916    /// let builder = prepare_request_builder();
2917    /// let mut items = builder.by_item();
2918    /// while let Some(result) = items.next().await {
2919    ///   let item = result?;
2920    /// }
2921    /// # gax::Result::<()>::Ok(()) });
2922    ///
2923    /// fn prepare_request_builder() -> ListDeployPolicies {
2924    ///   # panic!();
2925    ///   // ... details omitted ...
2926    /// }
2927    /// ```
2928    #[derive(Clone, Debug)]
2929    pub struct ListDeployPolicies(RequestBuilder<crate::model::ListDeployPoliciesRequest>);
2930
2931    impl ListDeployPolicies {
2932        pub(crate) fn new(
2933            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2934        ) -> Self {
2935            Self(RequestBuilder::new(stub))
2936        }
2937
2938        /// Sets the full request, replacing any prior values.
2939        pub fn with_request<V: Into<crate::model::ListDeployPoliciesRequest>>(
2940            mut self,
2941            v: V,
2942        ) -> Self {
2943            self.0.request = v.into();
2944            self
2945        }
2946
2947        /// Sets all the options, replacing any prior values.
2948        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2949            self.0.options = v.into();
2950            self
2951        }
2952
2953        /// Sends the request.
2954        pub async fn send(self) -> Result<crate::model::ListDeployPoliciesResponse> {
2955            (*self.0.stub)
2956                .list_deploy_policies(self.0.request, self.0.options)
2957                .await
2958                .map(gax::response::Response::into_body)
2959        }
2960
2961        /// Streams each page in the collection.
2962        pub fn by_page(
2963            self,
2964        ) -> impl gax::paginator::Paginator<crate::model::ListDeployPoliciesResponse, gax::error::Error>
2965        {
2966            use std::clone::Clone;
2967            let token = self.0.request.page_token.clone();
2968            let execute = move |token: String| {
2969                let mut builder = self.clone();
2970                builder.0.request = builder.0.request.set_page_token(token);
2971                builder.send()
2972            };
2973            gax::paginator::internal::new_paginator(token, execute)
2974        }
2975
2976        /// Streams each item in the collection.
2977        pub fn by_item(
2978            self,
2979        ) -> impl gax::paginator::ItemPaginator<
2980            crate::model::ListDeployPoliciesResponse,
2981            gax::error::Error,
2982        > {
2983            use gax::paginator::Paginator;
2984            self.by_page().items()
2985        }
2986
2987        /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
2988        ///
2989        /// This is a **required** field for requests.
2990        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991            self.0.request.parent = v.into();
2992            self
2993        }
2994
2995        /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
2996        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2997            self.0.request.page_size = v.into();
2998            self
2999        }
3000
3001        /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
3002        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3003            self.0.request.page_token = v.into();
3004            self
3005        }
3006
3007        /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
3008        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3009            self.0.request.filter = v.into();
3010            self
3011        }
3012
3013        /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
3014        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3015            self.0.request.order_by = v.into();
3016            self
3017        }
3018    }
3019
3020    #[doc(hidden)]
3021    impl gax::options::internal::RequestBuilder for ListDeployPolicies {
3022        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3023            &mut self.0.options
3024        }
3025    }
3026
3027    /// The request builder for [CloudDeploy::get_deploy_policy][crate::client::CloudDeploy::get_deploy_policy] calls.
3028    ///
3029    /// # Example
3030    /// ```no_run
3031    /// # use google_cloud_deploy_v1::builder;
3032    /// use builder::cloud_deploy::GetDeployPolicy;
3033    /// # tokio_test::block_on(async {
3034    ///
3035    /// let builder = prepare_request_builder();
3036    /// let response = builder.send().await?;
3037    /// # gax::Result::<()>::Ok(()) });
3038    ///
3039    /// fn prepare_request_builder() -> GetDeployPolicy {
3040    ///   # panic!();
3041    ///   // ... details omitted ...
3042    /// }
3043    /// ```
3044    #[derive(Clone, Debug)]
3045    pub struct GetDeployPolicy(RequestBuilder<crate::model::GetDeployPolicyRequest>);
3046
3047    impl GetDeployPolicy {
3048        pub(crate) fn new(
3049            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3050        ) -> Self {
3051            Self(RequestBuilder::new(stub))
3052        }
3053
3054        /// Sets the full request, replacing any prior values.
3055        pub fn with_request<V: Into<crate::model::GetDeployPolicyRequest>>(mut self, v: V) -> Self {
3056            self.0.request = v.into();
3057            self
3058        }
3059
3060        /// Sets all the options, replacing any prior values.
3061        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3062            self.0.options = v.into();
3063            self
3064        }
3065
3066        /// Sends the request.
3067        pub async fn send(self) -> Result<crate::model::DeployPolicy> {
3068            (*self.0.stub)
3069                .get_deploy_policy(self.0.request, self.0.options)
3070                .await
3071                .map(gax::response::Response::into_body)
3072        }
3073
3074        /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
3075        ///
3076        /// This is a **required** field for requests.
3077        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3078            self.0.request.name = v.into();
3079            self
3080        }
3081    }
3082
3083    #[doc(hidden)]
3084    impl gax::options::internal::RequestBuilder for GetDeployPolicy {
3085        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3086            &mut self.0.options
3087        }
3088    }
3089
3090    /// The request builder for [CloudDeploy::approve_rollout][crate::client::CloudDeploy::approve_rollout] calls.
3091    ///
3092    /// # Example
3093    /// ```no_run
3094    /// # use google_cloud_deploy_v1::builder;
3095    /// use builder::cloud_deploy::ApproveRollout;
3096    /// # tokio_test::block_on(async {
3097    ///
3098    /// let builder = prepare_request_builder();
3099    /// let response = builder.send().await?;
3100    /// # gax::Result::<()>::Ok(()) });
3101    ///
3102    /// fn prepare_request_builder() -> ApproveRollout {
3103    ///   # panic!();
3104    ///   // ... details omitted ...
3105    /// }
3106    /// ```
3107    #[derive(Clone, Debug)]
3108    pub struct ApproveRollout(RequestBuilder<crate::model::ApproveRolloutRequest>);
3109
3110    impl ApproveRollout {
3111        pub(crate) fn new(
3112            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3113        ) -> Self {
3114            Self(RequestBuilder::new(stub))
3115        }
3116
3117        /// Sets the full request, replacing any prior values.
3118        pub fn with_request<V: Into<crate::model::ApproveRolloutRequest>>(mut self, v: V) -> Self {
3119            self.0.request = v.into();
3120            self
3121        }
3122
3123        /// Sets all the options, replacing any prior values.
3124        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3125            self.0.options = v.into();
3126            self
3127        }
3128
3129        /// Sends the request.
3130        pub async fn send(self) -> Result<crate::model::ApproveRolloutResponse> {
3131            (*self.0.stub)
3132                .approve_rollout(self.0.request, self.0.options)
3133                .await
3134                .map(gax::response::Response::into_body)
3135        }
3136
3137        /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
3138        ///
3139        /// This is a **required** field for requests.
3140        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3141            self.0.request.name = v.into();
3142            self
3143        }
3144
3145        /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
3146        ///
3147        /// This is a **required** field for requests.
3148        pub fn set_approved<T: Into<bool>>(mut self, v: T) -> Self {
3149            self.0.request.approved = v.into();
3150            self
3151        }
3152
3153        /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
3154        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3155        where
3156            T: std::iter::IntoIterator<Item = V>,
3157            V: std::convert::Into<std::string::String>,
3158        {
3159            use std::iter::Iterator;
3160            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3161            self
3162        }
3163    }
3164
3165    #[doc(hidden)]
3166    impl gax::options::internal::RequestBuilder for ApproveRollout {
3167        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3168            &mut self.0.options
3169        }
3170    }
3171
3172    /// The request builder for [CloudDeploy::advance_rollout][crate::client::CloudDeploy::advance_rollout] calls.
3173    ///
3174    /// # Example
3175    /// ```no_run
3176    /// # use google_cloud_deploy_v1::builder;
3177    /// use builder::cloud_deploy::AdvanceRollout;
3178    /// # tokio_test::block_on(async {
3179    ///
3180    /// let builder = prepare_request_builder();
3181    /// let response = builder.send().await?;
3182    /// # gax::Result::<()>::Ok(()) });
3183    ///
3184    /// fn prepare_request_builder() -> AdvanceRollout {
3185    ///   # panic!();
3186    ///   // ... details omitted ...
3187    /// }
3188    /// ```
3189    #[derive(Clone, Debug)]
3190    pub struct AdvanceRollout(RequestBuilder<crate::model::AdvanceRolloutRequest>);
3191
3192    impl AdvanceRollout {
3193        pub(crate) fn new(
3194            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3195        ) -> Self {
3196            Self(RequestBuilder::new(stub))
3197        }
3198
3199        /// Sets the full request, replacing any prior values.
3200        pub fn with_request<V: Into<crate::model::AdvanceRolloutRequest>>(mut self, v: V) -> Self {
3201            self.0.request = v.into();
3202            self
3203        }
3204
3205        /// Sets all the options, replacing any prior values.
3206        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3207            self.0.options = v.into();
3208            self
3209        }
3210
3211        /// Sends the request.
3212        pub async fn send(self) -> Result<crate::model::AdvanceRolloutResponse> {
3213            (*self.0.stub)
3214                .advance_rollout(self.0.request, self.0.options)
3215                .await
3216                .map(gax::response::Response::into_body)
3217        }
3218
3219        /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
3220        ///
3221        /// This is a **required** field for requests.
3222        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3223            self.0.request.name = v.into();
3224            self
3225        }
3226
3227        /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
3228        ///
3229        /// This is a **required** field for requests.
3230        pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3231            self.0.request.phase_id = v.into();
3232            self
3233        }
3234
3235        /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
3236        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3237        where
3238            T: std::iter::IntoIterator<Item = V>,
3239            V: std::convert::Into<std::string::String>,
3240        {
3241            use std::iter::Iterator;
3242            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3243            self
3244        }
3245    }
3246
3247    #[doc(hidden)]
3248    impl gax::options::internal::RequestBuilder for AdvanceRollout {
3249        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3250            &mut self.0.options
3251        }
3252    }
3253
3254    /// The request builder for [CloudDeploy::cancel_rollout][crate::client::CloudDeploy::cancel_rollout] calls.
3255    ///
3256    /// # Example
3257    /// ```no_run
3258    /// # use google_cloud_deploy_v1::builder;
3259    /// use builder::cloud_deploy::CancelRollout;
3260    /// # tokio_test::block_on(async {
3261    ///
3262    /// let builder = prepare_request_builder();
3263    /// let response = builder.send().await?;
3264    /// # gax::Result::<()>::Ok(()) });
3265    ///
3266    /// fn prepare_request_builder() -> CancelRollout {
3267    ///   # panic!();
3268    ///   // ... details omitted ...
3269    /// }
3270    /// ```
3271    #[derive(Clone, Debug)]
3272    pub struct CancelRollout(RequestBuilder<crate::model::CancelRolloutRequest>);
3273
3274    impl CancelRollout {
3275        pub(crate) fn new(
3276            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3277        ) -> Self {
3278            Self(RequestBuilder::new(stub))
3279        }
3280
3281        /// Sets the full request, replacing any prior values.
3282        pub fn with_request<V: Into<crate::model::CancelRolloutRequest>>(mut self, v: V) -> Self {
3283            self.0.request = v.into();
3284            self
3285        }
3286
3287        /// Sets all the options, replacing any prior values.
3288        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3289            self.0.options = v.into();
3290            self
3291        }
3292
3293        /// Sends the request.
3294        pub async fn send(self) -> Result<crate::model::CancelRolloutResponse> {
3295            (*self.0.stub)
3296                .cancel_rollout(self.0.request, self.0.options)
3297                .await
3298                .map(gax::response::Response::into_body)
3299        }
3300
3301        /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
3302        ///
3303        /// This is a **required** field for requests.
3304        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305            self.0.request.name = v.into();
3306            self
3307        }
3308
3309        /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
3310        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3311        where
3312            T: std::iter::IntoIterator<Item = V>,
3313            V: std::convert::Into<std::string::String>,
3314        {
3315            use std::iter::Iterator;
3316            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3317            self
3318        }
3319    }
3320
3321    #[doc(hidden)]
3322    impl gax::options::internal::RequestBuilder for CancelRollout {
3323        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3324            &mut self.0.options
3325        }
3326    }
3327
3328    /// The request builder for [CloudDeploy::list_rollouts][crate::client::CloudDeploy::list_rollouts] calls.
3329    ///
3330    /// # Example
3331    /// ```no_run
3332    /// # use google_cloud_deploy_v1::builder;
3333    /// use builder::cloud_deploy::ListRollouts;
3334    /// # tokio_test::block_on(async {
3335    /// use gax::paginator::ItemPaginator;
3336    ///
3337    /// let builder = prepare_request_builder();
3338    /// let mut items = builder.by_item();
3339    /// while let Some(result) = items.next().await {
3340    ///   let item = result?;
3341    /// }
3342    /// # gax::Result::<()>::Ok(()) });
3343    ///
3344    /// fn prepare_request_builder() -> ListRollouts {
3345    ///   # panic!();
3346    ///   // ... details omitted ...
3347    /// }
3348    /// ```
3349    #[derive(Clone, Debug)]
3350    pub struct ListRollouts(RequestBuilder<crate::model::ListRolloutsRequest>);
3351
3352    impl ListRollouts {
3353        pub(crate) fn new(
3354            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3355        ) -> Self {
3356            Self(RequestBuilder::new(stub))
3357        }
3358
3359        /// Sets the full request, replacing any prior values.
3360        pub fn with_request<V: Into<crate::model::ListRolloutsRequest>>(mut self, v: V) -> Self {
3361            self.0.request = v.into();
3362            self
3363        }
3364
3365        /// Sets all the options, replacing any prior values.
3366        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3367            self.0.options = v.into();
3368            self
3369        }
3370
3371        /// Sends the request.
3372        pub async fn send(self) -> Result<crate::model::ListRolloutsResponse> {
3373            (*self.0.stub)
3374                .list_rollouts(self.0.request, self.0.options)
3375                .await
3376                .map(gax::response::Response::into_body)
3377        }
3378
3379        /// Streams each page in the collection.
3380        pub fn by_page(
3381            self,
3382        ) -> impl gax::paginator::Paginator<crate::model::ListRolloutsResponse, gax::error::Error>
3383        {
3384            use std::clone::Clone;
3385            let token = self.0.request.page_token.clone();
3386            let execute = move |token: String| {
3387                let mut builder = self.clone();
3388                builder.0.request = builder.0.request.set_page_token(token);
3389                builder.send()
3390            };
3391            gax::paginator::internal::new_paginator(token, execute)
3392        }
3393
3394        /// Streams each item in the collection.
3395        pub fn by_item(
3396            self,
3397        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRolloutsResponse, gax::error::Error>
3398        {
3399            use gax::paginator::Paginator;
3400            self.by_page().items()
3401        }
3402
3403        /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
3404        ///
3405        /// This is a **required** field for requests.
3406        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3407            self.0.request.parent = v.into();
3408            self
3409        }
3410
3411        /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
3412        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3413            self.0.request.page_size = v.into();
3414            self
3415        }
3416
3417        /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
3418        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3419            self.0.request.page_token = v.into();
3420            self
3421        }
3422
3423        /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
3424        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3425            self.0.request.filter = v.into();
3426            self
3427        }
3428
3429        /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
3430        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3431            self.0.request.order_by = v.into();
3432            self
3433        }
3434    }
3435
3436    #[doc(hidden)]
3437    impl gax::options::internal::RequestBuilder for ListRollouts {
3438        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3439            &mut self.0.options
3440        }
3441    }
3442
3443    /// The request builder for [CloudDeploy::get_rollout][crate::client::CloudDeploy::get_rollout] calls.
3444    ///
3445    /// # Example
3446    /// ```no_run
3447    /// # use google_cloud_deploy_v1::builder;
3448    /// use builder::cloud_deploy::GetRollout;
3449    /// # tokio_test::block_on(async {
3450    ///
3451    /// let builder = prepare_request_builder();
3452    /// let response = builder.send().await?;
3453    /// # gax::Result::<()>::Ok(()) });
3454    ///
3455    /// fn prepare_request_builder() -> GetRollout {
3456    ///   # panic!();
3457    ///   // ... details omitted ...
3458    /// }
3459    /// ```
3460    #[derive(Clone, Debug)]
3461    pub struct GetRollout(RequestBuilder<crate::model::GetRolloutRequest>);
3462
3463    impl GetRollout {
3464        pub(crate) fn new(
3465            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3466        ) -> Self {
3467            Self(RequestBuilder::new(stub))
3468        }
3469
3470        /// Sets the full request, replacing any prior values.
3471        pub fn with_request<V: Into<crate::model::GetRolloutRequest>>(mut self, v: V) -> Self {
3472            self.0.request = v.into();
3473            self
3474        }
3475
3476        /// Sets all the options, replacing any prior values.
3477        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3478            self.0.options = v.into();
3479            self
3480        }
3481
3482        /// Sends the request.
3483        pub async fn send(self) -> Result<crate::model::Rollout> {
3484            (*self.0.stub)
3485                .get_rollout(self.0.request, self.0.options)
3486                .await
3487                .map(gax::response::Response::into_body)
3488        }
3489
3490        /// Sets the value of [name][crate::model::GetRolloutRequest::name].
3491        ///
3492        /// This is a **required** field for requests.
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 gax::options::internal::RequestBuilder for GetRollout {
3501        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3502            &mut self.0.options
3503        }
3504    }
3505
3506    /// The request builder for [CloudDeploy::create_rollout][crate::client::CloudDeploy::create_rollout] calls.
3507    ///
3508    /// # Example
3509    /// ```no_run
3510    /// # use google_cloud_deploy_v1::builder;
3511    /// use builder::cloud_deploy::CreateRollout;
3512    /// # tokio_test::block_on(async {
3513    /// use lro::Poller;
3514    ///
3515    /// let builder = prepare_request_builder();
3516    /// let response = builder.poller().until_done().await?;
3517    /// # gax::Result::<()>::Ok(()) });
3518    ///
3519    /// fn prepare_request_builder() -> CreateRollout {
3520    ///   # panic!();
3521    ///   // ... details omitted ...
3522    /// }
3523    /// ```
3524    #[derive(Clone, Debug)]
3525    pub struct CreateRollout(RequestBuilder<crate::model::CreateRolloutRequest>);
3526
3527    impl CreateRollout {
3528        pub(crate) fn new(
3529            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3530        ) -> Self {
3531            Self(RequestBuilder::new(stub))
3532        }
3533
3534        /// Sets the full request, replacing any prior values.
3535        pub fn with_request<V: Into<crate::model::CreateRolloutRequest>>(mut self, v: V) -> Self {
3536            self.0.request = v.into();
3537            self
3538        }
3539
3540        /// Sets all the options, replacing any prior values.
3541        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3542            self.0.options = v.into();
3543            self
3544        }
3545
3546        /// Sends the request.
3547        ///
3548        /// # Long running operations
3549        ///
3550        /// This starts, but does not poll, a longrunning operation. More information
3551        /// on [create_rollout][crate::client::CloudDeploy::create_rollout].
3552        pub async fn send(self) -> Result<longrunning::model::Operation> {
3553            (*self.0.stub)
3554                .create_rollout(self.0.request, self.0.options)
3555                .await
3556                .map(gax::response::Response::into_body)
3557        }
3558
3559        /// Creates a [Poller][lro::Poller] to work with `create_rollout`.
3560        pub fn poller(
3561            self,
3562        ) -> impl lro::Poller<crate::model::Rollout, crate::model::OperationMetadata> {
3563            type Operation =
3564                lro::internal::Operation<crate::model::Rollout, crate::model::OperationMetadata>;
3565            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3566            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3567
3568            let stub = self.0.stub.clone();
3569            let mut options = self.0.options.clone();
3570            options.set_retry_policy(gax::retry_policy::NeverRetry);
3571            let query = move |name| {
3572                let stub = stub.clone();
3573                let options = options.clone();
3574                async {
3575                    let op = GetOperation::new(stub)
3576                        .set_name(name)
3577                        .with_options(options)
3578                        .send()
3579                        .await?;
3580                    Ok(Operation::new(op))
3581                }
3582            };
3583
3584            let start = move || async {
3585                let op = self.send().await?;
3586                Ok(Operation::new(op))
3587            };
3588
3589            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3590        }
3591
3592        /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
3593        ///
3594        /// This is a **required** field for requests.
3595        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596            self.0.request.parent = v.into();
3597            self
3598        }
3599
3600        /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
3601        ///
3602        /// This is a **required** field for requests.
3603        pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604            self.0.request.rollout_id = v.into();
3605            self
3606        }
3607
3608        /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
3609        ///
3610        /// This is a **required** field for requests.
3611        pub fn set_rollout<T>(mut self, v: T) -> Self
3612        where
3613            T: std::convert::Into<crate::model::Rollout>,
3614        {
3615            self.0.request.rollout = std::option::Option::Some(v.into());
3616            self
3617        }
3618
3619        /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
3620        ///
3621        /// This is a **required** field for requests.
3622        pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3623        where
3624            T: std::convert::Into<crate::model::Rollout>,
3625        {
3626            self.0.request.rollout = v.map(|x| x.into());
3627            self
3628        }
3629
3630        /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
3631        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3632            self.0.request.request_id = v.into();
3633            self
3634        }
3635
3636        /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
3637        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3638            self.0.request.validate_only = v.into();
3639            self
3640        }
3641
3642        /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
3643        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3644        where
3645            T: std::iter::IntoIterator<Item = V>,
3646            V: std::convert::Into<std::string::String>,
3647        {
3648            use std::iter::Iterator;
3649            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3650            self
3651        }
3652
3653        /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
3654        pub fn set_starting_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3655            self.0.request.starting_phase_id = v.into();
3656            self
3657        }
3658    }
3659
3660    #[doc(hidden)]
3661    impl gax::options::internal::RequestBuilder for CreateRollout {
3662        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3663            &mut self.0.options
3664        }
3665    }
3666
3667    /// The request builder for [CloudDeploy::ignore_job][crate::client::CloudDeploy::ignore_job] calls.
3668    ///
3669    /// # Example
3670    /// ```no_run
3671    /// # use google_cloud_deploy_v1::builder;
3672    /// use builder::cloud_deploy::IgnoreJob;
3673    /// # tokio_test::block_on(async {
3674    ///
3675    /// let builder = prepare_request_builder();
3676    /// let response = builder.send().await?;
3677    /// # gax::Result::<()>::Ok(()) });
3678    ///
3679    /// fn prepare_request_builder() -> IgnoreJob {
3680    ///   # panic!();
3681    ///   // ... details omitted ...
3682    /// }
3683    /// ```
3684    #[derive(Clone, Debug)]
3685    pub struct IgnoreJob(RequestBuilder<crate::model::IgnoreJobRequest>);
3686
3687    impl IgnoreJob {
3688        pub(crate) fn new(
3689            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3690        ) -> Self {
3691            Self(RequestBuilder::new(stub))
3692        }
3693
3694        /// Sets the full request, replacing any prior values.
3695        pub fn with_request<V: Into<crate::model::IgnoreJobRequest>>(mut self, v: V) -> Self {
3696            self.0.request = v.into();
3697            self
3698        }
3699
3700        /// Sets all the options, replacing any prior values.
3701        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3702            self.0.options = v.into();
3703            self
3704        }
3705
3706        /// Sends the request.
3707        pub async fn send(self) -> Result<crate::model::IgnoreJobResponse> {
3708            (*self.0.stub)
3709                .ignore_job(self.0.request, self.0.options)
3710                .await
3711                .map(gax::response::Response::into_body)
3712        }
3713
3714        /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
3715        ///
3716        /// This is a **required** field for requests.
3717        pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3718            self.0.request.rollout = v.into();
3719            self
3720        }
3721
3722        /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
3723        ///
3724        /// This is a **required** field for requests.
3725        pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3726            self.0.request.phase_id = v.into();
3727            self
3728        }
3729
3730        /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
3731        ///
3732        /// This is a **required** field for requests.
3733        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3734            self.0.request.job_id = v.into();
3735            self
3736        }
3737
3738        /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
3739        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3740        where
3741            T: std::iter::IntoIterator<Item = V>,
3742            V: std::convert::Into<std::string::String>,
3743        {
3744            use std::iter::Iterator;
3745            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3746            self
3747        }
3748    }
3749
3750    #[doc(hidden)]
3751    impl gax::options::internal::RequestBuilder for IgnoreJob {
3752        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3753            &mut self.0.options
3754        }
3755    }
3756
3757    /// The request builder for [CloudDeploy::retry_job][crate::client::CloudDeploy::retry_job] calls.
3758    ///
3759    /// # Example
3760    /// ```no_run
3761    /// # use google_cloud_deploy_v1::builder;
3762    /// use builder::cloud_deploy::RetryJob;
3763    /// # tokio_test::block_on(async {
3764    ///
3765    /// let builder = prepare_request_builder();
3766    /// let response = builder.send().await?;
3767    /// # gax::Result::<()>::Ok(()) });
3768    ///
3769    /// fn prepare_request_builder() -> RetryJob {
3770    ///   # panic!();
3771    ///   // ... details omitted ...
3772    /// }
3773    /// ```
3774    #[derive(Clone, Debug)]
3775    pub struct RetryJob(RequestBuilder<crate::model::RetryJobRequest>);
3776
3777    impl RetryJob {
3778        pub(crate) fn new(
3779            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3780        ) -> Self {
3781            Self(RequestBuilder::new(stub))
3782        }
3783
3784        /// Sets the full request, replacing any prior values.
3785        pub fn with_request<V: Into<crate::model::RetryJobRequest>>(mut self, v: V) -> Self {
3786            self.0.request = v.into();
3787            self
3788        }
3789
3790        /// Sets all the options, replacing any prior values.
3791        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3792            self.0.options = v.into();
3793            self
3794        }
3795
3796        /// Sends the request.
3797        pub async fn send(self) -> Result<crate::model::RetryJobResponse> {
3798            (*self.0.stub)
3799                .retry_job(self.0.request, self.0.options)
3800                .await
3801                .map(gax::response::Response::into_body)
3802        }
3803
3804        /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
3805        ///
3806        /// This is a **required** field for requests.
3807        pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3808            self.0.request.rollout = v.into();
3809            self
3810        }
3811
3812        /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
3813        ///
3814        /// This is a **required** field for requests.
3815        pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3816            self.0.request.phase_id = v.into();
3817            self
3818        }
3819
3820        /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
3821        ///
3822        /// This is a **required** field for requests.
3823        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824            self.0.request.job_id = v.into();
3825            self
3826        }
3827
3828        /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
3829        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3830        where
3831            T: std::iter::IntoIterator<Item = V>,
3832            V: std::convert::Into<std::string::String>,
3833        {
3834            use std::iter::Iterator;
3835            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3836            self
3837        }
3838    }
3839
3840    #[doc(hidden)]
3841    impl gax::options::internal::RequestBuilder for RetryJob {
3842        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3843            &mut self.0.options
3844        }
3845    }
3846
3847    /// The request builder for [CloudDeploy::list_job_runs][crate::client::CloudDeploy::list_job_runs] calls.
3848    ///
3849    /// # Example
3850    /// ```no_run
3851    /// # use google_cloud_deploy_v1::builder;
3852    /// use builder::cloud_deploy::ListJobRuns;
3853    /// # tokio_test::block_on(async {
3854    /// use gax::paginator::ItemPaginator;
3855    ///
3856    /// let builder = prepare_request_builder();
3857    /// let mut items = builder.by_item();
3858    /// while let Some(result) = items.next().await {
3859    ///   let item = result?;
3860    /// }
3861    /// # gax::Result::<()>::Ok(()) });
3862    ///
3863    /// fn prepare_request_builder() -> ListJobRuns {
3864    ///   # panic!();
3865    ///   // ... details omitted ...
3866    /// }
3867    /// ```
3868    #[derive(Clone, Debug)]
3869    pub struct ListJobRuns(RequestBuilder<crate::model::ListJobRunsRequest>);
3870
3871    impl ListJobRuns {
3872        pub(crate) fn new(
3873            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3874        ) -> Self {
3875            Self(RequestBuilder::new(stub))
3876        }
3877
3878        /// Sets the full request, replacing any prior values.
3879        pub fn with_request<V: Into<crate::model::ListJobRunsRequest>>(mut self, v: V) -> Self {
3880            self.0.request = v.into();
3881            self
3882        }
3883
3884        /// Sets all the options, replacing any prior values.
3885        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3886            self.0.options = v.into();
3887            self
3888        }
3889
3890        /// Sends the request.
3891        pub async fn send(self) -> Result<crate::model::ListJobRunsResponse> {
3892            (*self.0.stub)
3893                .list_job_runs(self.0.request, self.0.options)
3894                .await
3895                .map(gax::response::Response::into_body)
3896        }
3897
3898        /// Streams each page in the collection.
3899        pub fn by_page(
3900            self,
3901        ) -> impl gax::paginator::Paginator<crate::model::ListJobRunsResponse, gax::error::Error>
3902        {
3903            use std::clone::Clone;
3904            let token = self.0.request.page_token.clone();
3905            let execute = move |token: String| {
3906                let mut builder = self.clone();
3907                builder.0.request = builder.0.request.set_page_token(token);
3908                builder.send()
3909            };
3910            gax::paginator::internal::new_paginator(token, execute)
3911        }
3912
3913        /// Streams each item in the collection.
3914        pub fn by_item(
3915            self,
3916        ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobRunsResponse, gax::error::Error>
3917        {
3918            use gax::paginator::Paginator;
3919            self.by_page().items()
3920        }
3921
3922        /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
3923        ///
3924        /// This is a **required** field for requests.
3925        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926            self.0.request.parent = v.into();
3927            self
3928        }
3929
3930        /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
3931        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3932            self.0.request.page_size = v.into();
3933            self
3934        }
3935
3936        /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
3937        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3938            self.0.request.page_token = v.into();
3939            self
3940        }
3941
3942        /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
3943        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3944            self.0.request.filter = v.into();
3945            self
3946        }
3947
3948        /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
3949        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3950            self.0.request.order_by = v.into();
3951            self
3952        }
3953    }
3954
3955    #[doc(hidden)]
3956    impl gax::options::internal::RequestBuilder for ListJobRuns {
3957        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3958            &mut self.0.options
3959        }
3960    }
3961
3962    /// The request builder for [CloudDeploy::get_job_run][crate::client::CloudDeploy::get_job_run] calls.
3963    ///
3964    /// # Example
3965    /// ```no_run
3966    /// # use google_cloud_deploy_v1::builder;
3967    /// use builder::cloud_deploy::GetJobRun;
3968    /// # tokio_test::block_on(async {
3969    ///
3970    /// let builder = prepare_request_builder();
3971    /// let response = builder.send().await?;
3972    /// # gax::Result::<()>::Ok(()) });
3973    ///
3974    /// fn prepare_request_builder() -> GetJobRun {
3975    ///   # panic!();
3976    ///   // ... details omitted ...
3977    /// }
3978    /// ```
3979    #[derive(Clone, Debug)]
3980    pub struct GetJobRun(RequestBuilder<crate::model::GetJobRunRequest>);
3981
3982    impl GetJobRun {
3983        pub(crate) fn new(
3984            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3985        ) -> Self {
3986            Self(RequestBuilder::new(stub))
3987        }
3988
3989        /// Sets the full request, replacing any prior values.
3990        pub fn with_request<V: Into<crate::model::GetJobRunRequest>>(mut self, v: V) -> Self {
3991            self.0.request = v.into();
3992            self
3993        }
3994
3995        /// Sets all the options, replacing any prior values.
3996        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3997            self.0.options = v.into();
3998            self
3999        }
4000
4001        /// Sends the request.
4002        pub async fn send(self) -> Result<crate::model::JobRun> {
4003            (*self.0.stub)
4004                .get_job_run(self.0.request, self.0.options)
4005                .await
4006                .map(gax::response::Response::into_body)
4007        }
4008
4009        /// Sets the value of [name][crate::model::GetJobRunRequest::name].
4010        ///
4011        /// This is a **required** field for requests.
4012        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4013            self.0.request.name = v.into();
4014            self
4015        }
4016    }
4017
4018    #[doc(hidden)]
4019    impl gax::options::internal::RequestBuilder for GetJobRun {
4020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4021            &mut self.0.options
4022        }
4023    }
4024
4025    /// The request builder for [CloudDeploy::terminate_job_run][crate::client::CloudDeploy::terminate_job_run] calls.
4026    ///
4027    /// # Example
4028    /// ```no_run
4029    /// # use google_cloud_deploy_v1::builder;
4030    /// use builder::cloud_deploy::TerminateJobRun;
4031    /// # tokio_test::block_on(async {
4032    ///
4033    /// let builder = prepare_request_builder();
4034    /// let response = builder.send().await?;
4035    /// # gax::Result::<()>::Ok(()) });
4036    ///
4037    /// fn prepare_request_builder() -> TerminateJobRun {
4038    ///   # panic!();
4039    ///   // ... details omitted ...
4040    /// }
4041    /// ```
4042    #[derive(Clone, Debug)]
4043    pub struct TerminateJobRun(RequestBuilder<crate::model::TerminateJobRunRequest>);
4044
4045    impl TerminateJobRun {
4046        pub(crate) fn new(
4047            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4048        ) -> Self {
4049            Self(RequestBuilder::new(stub))
4050        }
4051
4052        /// Sets the full request, replacing any prior values.
4053        pub fn with_request<V: Into<crate::model::TerminateJobRunRequest>>(mut self, v: V) -> Self {
4054            self.0.request = v.into();
4055            self
4056        }
4057
4058        /// Sets all the options, replacing any prior values.
4059        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4060            self.0.options = v.into();
4061            self
4062        }
4063
4064        /// Sends the request.
4065        pub async fn send(self) -> Result<crate::model::TerminateJobRunResponse> {
4066            (*self.0.stub)
4067                .terminate_job_run(self.0.request, self.0.options)
4068                .await
4069                .map(gax::response::Response::into_body)
4070        }
4071
4072        /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
4073        ///
4074        /// This is a **required** field for requests.
4075        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4076            self.0.request.name = v.into();
4077            self
4078        }
4079
4080        /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
4081        pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
4082        where
4083            T: std::iter::IntoIterator<Item = V>,
4084            V: std::convert::Into<std::string::String>,
4085        {
4086            use std::iter::Iterator;
4087            self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
4088            self
4089        }
4090    }
4091
4092    #[doc(hidden)]
4093    impl gax::options::internal::RequestBuilder for TerminateJobRun {
4094        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4095            &mut self.0.options
4096        }
4097    }
4098
4099    /// The request builder for [CloudDeploy::get_config][crate::client::CloudDeploy::get_config] calls.
4100    ///
4101    /// # Example
4102    /// ```no_run
4103    /// # use google_cloud_deploy_v1::builder;
4104    /// use builder::cloud_deploy::GetConfig;
4105    /// # tokio_test::block_on(async {
4106    ///
4107    /// let builder = prepare_request_builder();
4108    /// let response = builder.send().await?;
4109    /// # gax::Result::<()>::Ok(()) });
4110    ///
4111    /// fn prepare_request_builder() -> GetConfig {
4112    ///   # panic!();
4113    ///   // ... details omitted ...
4114    /// }
4115    /// ```
4116    #[derive(Clone, Debug)]
4117    pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
4118
4119    impl GetConfig {
4120        pub(crate) fn new(
4121            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4122        ) -> Self {
4123            Self(RequestBuilder::new(stub))
4124        }
4125
4126        /// Sets the full request, replacing any prior values.
4127        pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
4128            self.0.request = v.into();
4129            self
4130        }
4131
4132        /// Sets all the options, replacing any prior values.
4133        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4134            self.0.options = v.into();
4135            self
4136        }
4137
4138        /// Sends the request.
4139        pub async fn send(self) -> Result<crate::model::Config> {
4140            (*self.0.stub)
4141                .get_config(self.0.request, self.0.options)
4142                .await
4143                .map(gax::response::Response::into_body)
4144        }
4145
4146        /// Sets the value of [name][crate::model::GetConfigRequest::name].
4147        ///
4148        /// This is a **required** field for requests.
4149        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4150            self.0.request.name = v.into();
4151            self
4152        }
4153    }
4154
4155    #[doc(hidden)]
4156    impl gax::options::internal::RequestBuilder for GetConfig {
4157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4158            &mut self.0.options
4159        }
4160    }
4161
4162    /// The request builder for [CloudDeploy::create_automation][crate::client::CloudDeploy::create_automation] calls.
4163    ///
4164    /// # Example
4165    /// ```no_run
4166    /// # use google_cloud_deploy_v1::builder;
4167    /// use builder::cloud_deploy::CreateAutomation;
4168    /// # tokio_test::block_on(async {
4169    /// use lro::Poller;
4170    ///
4171    /// let builder = prepare_request_builder();
4172    /// let response = builder.poller().until_done().await?;
4173    /// # gax::Result::<()>::Ok(()) });
4174    ///
4175    /// fn prepare_request_builder() -> CreateAutomation {
4176    ///   # panic!();
4177    ///   // ... details omitted ...
4178    /// }
4179    /// ```
4180    #[derive(Clone, Debug)]
4181    pub struct CreateAutomation(RequestBuilder<crate::model::CreateAutomationRequest>);
4182
4183    impl CreateAutomation {
4184        pub(crate) fn new(
4185            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4186        ) -> Self {
4187            Self(RequestBuilder::new(stub))
4188        }
4189
4190        /// Sets the full request, replacing any prior values.
4191        pub fn with_request<V: Into<crate::model::CreateAutomationRequest>>(
4192            mut self,
4193            v: V,
4194        ) -> Self {
4195            self.0.request = v.into();
4196            self
4197        }
4198
4199        /// Sets all the options, replacing any prior values.
4200        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4201            self.0.options = v.into();
4202            self
4203        }
4204
4205        /// Sends the request.
4206        ///
4207        /// # Long running operations
4208        ///
4209        /// This starts, but does not poll, a longrunning operation. More information
4210        /// on [create_automation][crate::client::CloudDeploy::create_automation].
4211        pub async fn send(self) -> Result<longrunning::model::Operation> {
4212            (*self.0.stub)
4213                .create_automation(self.0.request, self.0.options)
4214                .await
4215                .map(gax::response::Response::into_body)
4216        }
4217
4218        /// Creates a [Poller][lro::Poller] to work with `create_automation`.
4219        pub fn poller(
4220            self,
4221        ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4222            type Operation =
4223                lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4224            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4225            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4226
4227            let stub = self.0.stub.clone();
4228            let mut options = self.0.options.clone();
4229            options.set_retry_policy(gax::retry_policy::NeverRetry);
4230            let query = move |name| {
4231                let stub = stub.clone();
4232                let options = options.clone();
4233                async {
4234                    let op = GetOperation::new(stub)
4235                        .set_name(name)
4236                        .with_options(options)
4237                        .send()
4238                        .await?;
4239                    Ok(Operation::new(op))
4240                }
4241            };
4242
4243            let start = move || async {
4244                let op = self.send().await?;
4245                Ok(Operation::new(op))
4246            };
4247
4248            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4249        }
4250
4251        /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
4252        ///
4253        /// This is a **required** field for requests.
4254        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4255            self.0.request.parent = v.into();
4256            self
4257        }
4258
4259        /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
4260        ///
4261        /// This is a **required** field for requests.
4262        pub fn set_automation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4263            self.0.request.automation_id = v.into();
4264            self
4265        }
4266
4267        /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
4268        ///
4269        /// This is a **required** field for requests.
4270        pub fn set_automation<T>(mut self, v: T) -> Self
4271        where
4272            T: std::convert::Into<crate::model::Automation>,
4273        {
4274            self.0.request.automation = std::option::Option::Some(v.into());
4275            self
4276        }
4277
4278        /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
4279        ///
4280        /// This is a **required** field for requests.
4281        pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4282        where
4283            T: std::convert::Into<crate::model::Automation>,
4284        {
4285            self.0.request.automation = v.map(|x| x.into());
4286            self
4287        }
4288
4289        /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
4290        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291            self.0.request.request_id = v.into();
4292            self
4293        }
4294
4295        /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
4296        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4297            self.0.request.validate_only = v.into();
4298            self
4299        }
4300    }
4301
4302    #[doc(hidden)]
4303    impl gax::options::internal::RequestBuilder for CreateAutomation {
4304        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4305            &mut self.0.options
4306        }
4307    }
4308
4309    /// The request builder for [CloudDeploy::update_automation][crate::client::CloudDeploy::update_automation] calls.
4310    ///
4311    /// # Example
4312    /// ```no_run
4313    /// # use google_cloud_deploy_v1::builder;
4314    /// use builder::cloud_deploy::UpdateAutomation;
4315    /// # tokio_test::block_on(async {
4316    /// use lro::Poller;
4317    ///
4318    /// let builder = prepare_request_builder();
4319    /// let response = builder.poller().until_done().await?;
4320    /// # gax::Result::<()>::Ok(()) });
4321    ///
4322    /// fn prepare_request_builder() -> UpdateAutomation {
4323    ///   # panic!();
4324    ///   // ... details omitted ...
4325    /// }
4326    /// ```
4327    #[derive(Clone, Debug)]
4328    pub struct UpdateAutomation(RequestBuilder<crate::model::UpdateAutomationRequest>);
4329
4330    impl UpdateAutomation {
4331        pub(crate) fn new(
4332            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4333        ) -> Self {
4334            Self(RequestBuilder::new(stub))
4335        }
4336
4337        /// Sets the full request, replacing any prior values.
4338        pub fn with_request<V: Into<crate::model::UpdateAutomationRequest>>(
4339            mut self,
4340            v: V,
4341        ) -> Self {
4342            self.0.request = v.into();
4343            self
4344        }
4345
4346        /// Sets all the options, replacing any prior values.
4347        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4348            self.0.options = v.into();
4349            self
4350        }
4351
4352        /// Sends the request.
4353        ///
4354        /// # Long running operations
4355        ///
4356        /// This starts, but does not poll, a longrunning operation. More information
4357        /// on [update_automation][crate::client::CloudDeploy::update_automation].
4358        pub async fn send(self) -> Result<longrunning::model::Operation> {
4359            (*self.0.stub)
4360                .update_automation(self.0.request, self.0.options)
4361                .await
4362                .map(gax::response::Response::into_body)
4363        }
4364
4365        /// Creates a [Poller][lro::Poller] to work with `update_automation`.
4366        pub fn poller(
4367            self,
4368        ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4369            type Operation =
4370                lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4371            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4372            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4373
4374            let stub = self.0.stub.clone();
4375            let mut options = self.0.options.clone();
4376            options.set_retry_policy(gax::retry_policy::NeverRetry);
4377            let query = move |name| {
4378                let stub = stub.clone();
4379                let options = options.clone();
4380                async {
4381                    let op = GetOperation::new(stub)
4382                        .set_name(name)
4383                        .with_options(options)
4384                        .send()
4385                        .await?;
4386                    Ok(Operation::new(op))
4387                }
4388            };
4389
4390            let start = move || async {
4391                let op = self.send().await?;
4392                Ok(Operation::new(op))
4393            };
4394
4395            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4396        }
4397
4398        /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
4399        ///
4400        /// This is a **required** field for requests.
4401        pub fn set_update_mask<T>(mut self, v: T) -> Self
4402        where
4403            T: std::convert::Into<wkt::FieldMask>,
4404        {
4405            self.0.request.update_mask = std::option::Option::Some(v.into());
4406            self
4407        }
4408
4409        /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
4410        ///
4411        /// This is a **required** field for requests.
4412        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4413        where
4414            T: std::convert::Into<wkt::FieldMask>,
4415        {
4416            self.0.request.update_mask = v.map(|x| x.into());
4417            self
4418        }
4419
4420        /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
4421        ///
4422        /// This is a **required** field for requests.
4423        pub fn set_automation<T>(mut self, v: T) -> Self
4424        where
4425            T: std::convert::Into<crate::model::Automation>,
4426        {
4427            self.0.request.automation = std::option::Option::Some(v.into());
4428            self
4429        }
4430
4431        /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
4432        ///
4433        /// This is a **required** field for requests.
4434        pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4435        where
4436            T: std::convert::Into<crate::model::Automation>,
4437        {
4438            self.0.request.automation = v.map(|x| x.into());
4439            self
4440        }
4441
4442        /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
4443        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4444            self.0.request.request_id = v.into();
4445            self
4446        }
4447
4448        /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
4449        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4450            self.0.request.allow_missing = v.into();
4451            self
4452        }
4453
4454        /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
4455        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4456            self.0.request.validate_only = v.into();
4457            self
4458        }
4459    }
4460
4461    #[doc(hidden)]
4462    impl gax::options::internal::RequestBuilder for UpdateAutomation {
4463        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4464            &mut self.0.options
4465        }
4466    }
4467
4468    /// The request builder for [CloudDeploy::delete_automation][crate::client::CloudDeploy::delete_automation] calls.
4469    ///
4470    /// # Example
4471    /// ```no_run
4472    /// # use google_cloud_deploy_v1::builder;
4473    /// use builder::cloud_deploy::DeleteAutomation;
4474    /// # tokio_test::block_on(async {
4475    /// use lro::Poller;
4476    ///
4477    /// let builder = prepare_request_builder();
4478    /// let response = builder.poller().until_done().await?;
4479    /// # gax::Result::<()>::Ok(()) });
4480    ///
4481    /// fn prepare_request_builder() -> DeleteAutomation {
4482    ///   # panic!();
4483    ///   // ... details omitted ...
4484    /// }
4485    /// ```
4486    #[derive(Clone, Debug)]
4487    pub struct DeleteAutomation(RequestBuilder<crate::model::DeleteAutomationRequest>);
4488
4489    impl DeleteAutomation {
4490        pub(crate) fn new(
4491            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4492        ) -> Self {
4493            Self(RequestBuilder::new(stub))
4494        }
4495
4496        /// Sets the full request, replacing any prior values.
4497        pub fn with_request<V: Into<crate::model::DeleteAutomationRequest>>(
4498            mut self,
4499            v: V,
4500        ) -> Self {
4501            self.0.request = v.into();
4502            self
4503        }
4504
4505        /// Sets all the options, replacing any prior values.
4506        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4507            self.0.options = v.into();
4508            self
4509        }
4510
4511        /// Sends the request.
4512        ///
4513        /// # Long running operations
4514        ///
4515        /// This starts, but does not poll, a longrunning operation. More information
4516        /// on [delete_automation][crate::client::CloudDeploy::delete_automation].
4517        pub async fn send(self) -> Result<longrunning::model::Operation> {
4518            (*self.0.stub)
4519                .delete_automation(self.0.request, self.0.options)
4520                .await
4521                .map(gax::response::Response::into_body)
4522        }
4523
4524        /// Creates a [Poller][lro::Poller] to work with `delete_automation`.
4525        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4526            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4527            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4528            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4529
4530            let stub = self.0.stub.clone();
4531            let mut options = self.0.options.clone();
4532            options.set_retry_policy(gax::retry_policy::NeverRetry);
4533            let query = move |name| {
4534                let stub = stub.clone();
4535                let options = options.clone();
4536                async {
4537                    let op = GetOperation::new(stub)
4538                        .set_name(name)
4539                        .with_options(options)
4540                        .send()
4541                        .await?;
4542                    Ok(Operation::new(op))
4543                }
4544            };
4545
4546            let start = move || async {
4547                let op = self.send().await?;
4548                Ok(Operation::new(op))
4549            };
4550
4551            lro::internal::new_unit_response_poller(
4552                polling_error_policy,
4553                polling_backoff_policy,
4554                start,
4555                query,
4556            )
4557        }
4558
4559        /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
4560        ///
4561        /// This is a **required** field for requests.
4562        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4563            self.0.request.name = v.into();
4564            self
4565        }
4566
4567        /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
4568        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4569            self.0.request.request_id = v.into();
4570            self
4571        }
4572
4573        /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
4574        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4575            self.0.request.allow_missing = v.into();
4576            self
4577        }
4578
4579        /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
4580        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4581            self.0.request.validate_only = v.into();
4582            self
4583        }
4584
4585        /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
4586        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4587            self.0.request.etag = v.into();
4588            self
4589        }
4590    }
4591
4592    #[doc(hidden)]
4593    impl gax::options::internal::RequestBuilder for DeleteAutomation {
4594        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4595            &mut self.0.options
4596        }
4597    }
4598
4599    /// The request builder for [CloudDeploy::get_automation][crate::client::CloudDeploy::get_automation] calls.
4600    ///
4601    /// # Example
4602    /// ```no_run
4603    /// # use google_cloud_deploy_v1::builder;
4604    /// use builder::cloud_deploy::GetAutomation;
4605    /// # tokio_test::block_on(async {
4606    ///
4607    /// let builder = prepare_request_builder();
4608    /// let response = builder.send().await?;
4609    /// # gax::Result::<()>::Ok(()) });
4610    ///
4611    /// fn prepare_request_builder() -> GetAutomation {
4612    ///   # panic!();
4613    ///   // ... details omitted ...
4614    /// }
4615    /// ```
4616    #[derive(Clone, Debug)]
4617    pub struct GetAutomation(RequestBuilder<crate::model::GetAutomationRequest>);
4618
4619    impl GetAutomation {
4620        pub(crate) fn new(
4621            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4622        ) -> Self {
4623            Self(RequestBuilder::new(stub))
4624        }
4625
4626        /// Sets the full request, replacing any prior values.
4627        pub fn with_request<V: Into<crate::model::GetAutomationRequest>>(mut self, v: V) -> Self {
4628            self.0.request = v.into();
4629            self
4630        }
4631
4632        /// Sets all the options, replacing any prior values.
4633        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4634            self.0.options = v.into();
4635            self
4636        }
4637
4638        /// Sends the request.
4639        pub async fn send(self) -> Result<crate::model::Automation> {
4640            (*self.0.stub)
4641                .get_automation(self.0.request, self.0.options)
4642                .await
4643                .map(gax::response::Response::into_body)
4644        }
4645
4646        /// Sets the value of [name][crate::model::GetAutomationRequest::name].
4647        ///
4648        /// This is a **required** field for requests.
4649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4650            self.0.request.name = v.into();
4651            self
4652        }
4653    }
4654
4655    #[doc(hidden)]
4656    impl gax::options::internal::RequestBuilder for GetAutomation {
4657        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4658            &mut self.0.options
4659        }
4660    }
4661
4662    /// The request builder for [CloudDeploy::list_automations][crate::client::CloudDeploy::list_automations] calls.
4663    ///
4664    /// # Example
4665    /// ```no_run
4666    /// # use google_cloud_deploy_v1::builder;
4667    /// use builder::cloud_deploy::ListAutomations;
4668    /// # tokio_test::block_on(async {
4669    /// use gax::paginator::ItemPaginator;
4670    ///
4671    /// let builder = prepare_request_builder();
4672    /// let mut items = builder.by_item();
4673    /// while let Some(result) = items.next().await {
4674    ///   let item = result?;
4675    /// }
4676    /// # gax::Result::<()>::Ok(()) });
4677    ///
4678    /// fn prepare_request_builder() -> ListAutomations {
4679    ///   # panic!();
4680    ///   // ... details omitted ...
4681    /// }
4682    /// ```
4683    #[derive(Clone, Debug)]
4684    pub struct ListAutomations(RequestBuilder<crate::model::ListAutomationsRequest>);
4685
4686    impl ListAutomations {
4687        pub(crate) fn new(
4688            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4689        ) -> Self {
4690            Self(RequestBuilder::new(stub))
4691        }
4692
4693        /// Sets the full request, replacing any prior values.
4694        pub fn with_request<V: Into<crate::model::ListAutomationsRequest>>(mut self, v: V) -> Self {
4695            self.0.request = v.into();
4696            self
4697        }
4698
4699        /// Sets all the options, replacing any prior values.
4700        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4701            self.0.options = v.into();
4702            self
4703        }
4704
4705        /// Sends the request.
4706        pub async fn send(self) -> Result<crate::model::ListAutomationsResponse> {
4707            (*self.0.stub)
4708                .list_automations(self.0.request, self.0.options)
4709                .await
4710                .map(gax::response::Response::into_body)
4711        }
4712
4713        /// Streams each page in the collection.
4714        pub fn by_page(
4715            self,
4716        ) -> impl gax::paginator::Paginator<crate::model::ListAutomationsResponse, gax::error::Error>
4717        {
4718            use std::clone::Clone;
4719            let token = self.0.request.page_token.clone();
4720            let execute = move |token: String| {
4721                let mut builder = self.clone();
4722                builder.0.request = builder.0.request.set_page_token(token);
4723                builder.send()
4724            };
4725            gax::paginator::internal::new_paginator(token, execute)
4726        }
4727
4728        /// Streams each item in the collection.
4729        pub fn by_item(
4730            self,
4731        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAutomationsResponse, gax::error::Error>
4732        {
4733            use gax::paginator::Paginator;
4734            self.by_page().items()
4735        }
4736
4737        /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
4738        ///
4739        /// This is a **required** field for requests.
4740        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4741            self.0.request.parent = v.into();
4742            self
4743        }
4744
4745        /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
4746        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4747            self.0.request.page_size = v.into();
4748            self
4749        }
4750
4751        /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
4752        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4753            self.0.request.page_token = v.into();
4754            self
4755        }
4756
4757        /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
4758        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4759            self.0.request.filter = v.into();
4760            self
4761        }
4762
4763        /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
4764        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4765            self.0.request.order_by = v.into();
4766            self
4767        }
4768    }
4769
4770    #[doc(hidden)]
4771    impl gax::options::internal::RequestBuilder for ListAutomations {
4772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4773            &mut self.0.options
4774        }
4775    }
4776
4777    /// The request builder for [CloudDeploy::get_automation_run][crate::client::CloudDeploy::get_automation_run] calls.
4778    ///
4779    /// # Example
4780    /// ```no_run
4781    /// # use google_cloud_deploy_v1::builder;
4782    /// use builder::cloud_deploy::GetAutomationRun;
4783    /// # tokio_test::block_on(async {
4784    ///
4785    /// let builder = prepare_request_builder();
4786    /// let response = builder.send().await?;
4787    /// # gax::Result::<()>::Ok(()) });
4788    ///
4789    /// fn prepare_request_builder() -> GetAutomationRun {
4790    ///   # panic!();
4791    ///   // ... details omitted ...
4792    /// }
4793    /// ```
4794    #[derive(Clone, Debug)]
4795    pub struct GetAutomationRun(RequestBuilder<crate::model::GetAutomationRunRequest>);
4796
4797    impl GetAutomationRun {
4798        pub(crate) fn new(
4799            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4800        ) -> Self {
4801            Self(RequestBuilder::new(stub))
4802        }
4803
4804        /// Sets the full request, replacing any prior values.
4805        pub fn with_request<V: Into<crate::model::GetAutomationRunRequest>>(
4806            mut self,
4807            v: V,
4808        ) -> Self {
4809            self.0.request = v.into();
4810            self
4811        }
4812
4813        /// Sets all the options, replacing any prior values.
4814        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4815            self.0.options = v.into();
4816            self
4817        }
4818
4819        /// Sends the request.
4820        pub async fn send(self) -> Result<crate::model::AutomationRun> {
4821            (*self.0.stub)
4822                .get_automation_run(self.0.request, self.0.options)
4823                .await
4824                .map(gax::response::Response::into_body)
4825        }
4826
4827        /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
4828        ///
4829        /// This is a **required** field for requests.
4830        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831            self.0.request.name = v.into();
4832            self
4833        }
4834    }
4835
4836    #[doc(hidden)]
4837    impl gax::options::internal::RequestBuilder for GetAutomationRun {
4838        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4839            &mut self.0.options
4840        }
4841    }
4842
4843    /// The request builder for [CloudDeploy::list_automation_runs][crate::client::CloudDeploy::list_automation_runs] calls.
4844    ///
4845    /// # Example
4846    /// ```no_run
4847    /// # use google_cloud_deploy_v1::builder;
4848    /// use builder::cloud_deploy::ListAutomationRuns;
4849    /// # tokio_test::block_on(async {
4850    /// use gax::paginator::ItemPaginator;
4851    ///
4852    /// let builder = prepare_request_builder();
4853    /// let mut items = builder.by_item();
4854    /// while let Some(result) = items.next().await {
4855    ///   let item = result?;
4856    /// }
4857    /// # gax::Result::<()>::Ok(()) });
4858    ///
4859    /// fn prepare_request_builder() -> ListAutomationRuns {
4860    ///   # panic!();
4861    ///   // ... details omitted ...
4862    /// }
4863    /// ```
4864    #[derive(Clone, Debug)]
4865    pub struct ListAutomationRuns(RequestBuilder<crate::model::ListAutomationRunsRequest>);
4866
4867    impl ListAutomationRuns {
4868        pub(crate) fn new(
4869            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4870        ) -> Self {
4871            Self(RequestBuilder::new(stub))
4872        }
4873
4874        /// Sets the full request, replacing any prior values.
4875        pub fn with_request<V: Into<crate::model::ListAutomationRunsRequest>>(
4876            mut self,
4877            v: V,
4878        ) -> Self {
4879            self.0.request = v.into();
4880            self
4881        }
4882
4883        /// Sets all the options, replacing any prior values.
4884        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4885            self.0.options = v.into();
4886            self
4887        }
4888
4889        /// Sends the request.
4890        pub async fn send(self) -> Result<crate::model::ListAutomationRunsResponse> {
4891            (*self.0.stub)
4892                .list_automation_runs(self.0.request, self.0.options)
4893                .await
4894                .map(gax::response::Response::into_body)
4895        }
4896
4897        /// Streams each page in the collection.
4898        pub fn by_page(
4899            self,
4900        ) -> impl gax::paginator::Paginator<crate::model::ListAutomationRunsResponse, gax::error::Error>
4901        {
4902            use std::clone::Clone;
4903            let token = self.0.request.page_token.clone();
4904            let execute = move |token: String| {
4905                let mut builder = self.clone();
4906                builder.0.request = builder.0.request.set_page_token(token);
4907                builder.send()
4908            };
4909            gax::paginator::internal::new_paginator(token, execute)
4910        }
4911
4912        /// Streams each item in the collection.
4913        pub fn by_item(
4914            self,
4915        ) -> impl gax::paginator::ItemPaginator<
4916            crate::model::ListAutomationRunsResponse,
4917            gax::error::Error,
4918        > {
4919            use gax::paginator::Paginator;
4920            self.by_page().items()
4921        }
4922
4923        /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
4924        ///
4925        /// This is a **required** field for requests.
4926        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927            self.0.request.parent = v.into();
4928            self
4929        }
4930
4931        /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
4932        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4933            self.0.request.page_size = v.into();
4934            self
4935        }
4936
4937        /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
4938        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4939            self.0.request.page_token = v.into();
4940            self
4941        }
4942
4943        /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
4944        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4945            self.0.request.filter = v.into();
4946            self
4947        }
4948
4949        /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
4950        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4951            self.0.request.order_by = v.into();
4952            self
4953        }
4954    }
4955
4956    #[doc(hidden)]
4957    impl gax::options::internal::RequestBuilder for ListAutomationRuns {
4958        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4959            &mut self.0.options
4960        }
4961    }
4962
4963    /// The request builder for [CloudDeploy::cancel_automation_run][crate::client::CloudDeploy::cancel_automation_run] calls.
4964    ///
4965    /// # Example
4966    /// ```no_run
4967    /// # use google_cloud_deploy_v1::builder;
4968    /// use builder::cloud_deploy::CancelAutomationRun;
4969    /// # tokio_test::block_on(async {
4970    ///
4971    /// let builder = prepare_request_builder();
4972    /// let response = builder.send().await?;
4973    /// # gax::Result::<()>::Ok(()) });
4974    ///
4975    /// fn prepare_request_builder() -> CancelAutomationRun {
4976    ///   # panic!();
4977    ///   // ... details omitted ...
4978    /// }
4979    /// ```
4980    #[derive(Clone, Debug)]
4981    pub struct CancelAutomationRun(RequestBuilder<crate::model::CancelAutomationRunRequest>);
4982
4983    impl CancelAutomationRun {
4984        pub(crate) fn new(
4985            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4986        ) -> Self {
4987            Self(RequestBuilder::new(stub))
4988        }
4989
4990        /// Sets the full request, replacing any prior values.
4991        pub fn with_request<V: Into<crate::model::CancelAutomationRunRequest>>(
4992            mut self,
4993            v: V,
4994        ) -> Self {
4995            self.0.request = v.into();
4996            self
4997        }
4998
4999        /// Sets all the options, replacing any prior values.
5000        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5001            self.0.options = v.into();
5002            self
5003        }
5004
5005        /// Sends the request.
5006        pub async fn send(self) -> Result<crate::model::CancelAutomationRunResponse> {
5007            (*self.0.stub)
5008                .cancel_automation_run(self.0.request, self.0.options)
5009                .await
5010                .map(gax::response::Response::into_body)
5011        }
5012
5013        /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
5014        ///
5015        /// This is a **required** field for requests.
5016        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5017            self.0.request.name = v.into();
5018            self
5019        }
5020    }
5021
5022    #[doc(hidden)]
5023    impl gax::options::internal::RequestBuilder for CancelAutomationRun {
5024        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5025            &mut self.0.options
5026        }
5027    }
5028
5029    /// The request builder for [CloudDeploy::list_locations][crate::client::CloudDeploy::list_locations] calls.
5030    ///
5031    /// # Example
5032    /// ```no_run
5033    /// # use google_cloud_deploy_v1::builder;
5034    /// use builder::cloud_deploy::ListLocations;
5035    /// # tokio_test::block_on(async {
5036    /// use gax::paginator::ItemPaginator;
5037    ///
5038    /// let builder = prepare_request_builder();
5039    /// let mut items = builder.by_item();
5040    /// while let Some(result) = items.next().await {
5041    ///   let item = result?;
5042    /// }
5043    /// # gax::Result::<()>::Ok(()) });
5044    ///
5045    /// fn prepare_request_builder() -> ListLocations {
5046    ///   # panic!();
5047    ///   // ... details omitted ...
5048    /// }
5049    /// ```
5050    #[derive(Clone, Debug)]
5051    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5052
5053    impl ListLocations {
5054        pub(crate) fn new(
5055            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5056        ) -> Self {
5057            Self(RequestBuilder::new(stub))
5058        }
5059
5060        /// Sets the full request, replacing any prior values.
5061        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5062            mut self,
5063            v: V,
5064        ) -> Self {
5065            self.0.request = v.into();
5066            self
5067        }
5068
5069        /// Sets all the options, replacing any prior values.
5070        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5071            self.0.options = v.into();
5072            self
5073        }
5074
5075        /// Sends the request.
5076        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5077            (*self.0.stub)
5078                .list_locations(self.0.request, self.0.options)
5079                .await
5080                .map(gax::response::Response::into_body)
5081        }
5082
5083        /// Streams each page in the collection.
5084        pub fn by_page(
5085            self,
5086        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5087        {
5088            use std::clone::Clone;
5089            let token = self.0.request.page_token.clone();
5090            let execute = move |token: String| {
5091                let mut builder = self.clone();
5092                builder.0.request = builder.0.request.set_page_token(token);
5093                builder.send()
5094            };
5095            gax::paginator::internal::new_paginator(token, execute)
5096        }
5097
5098        /// Streams each item in the collection.
5099        pub fn by_item(
5100            self,
5101        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5102        {
5103            use gax::paginator::Paginator;
5104            self.by_page().items()
5105        }
5106
5107        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5108        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5109            self.0.request.name = v.into();
5110            self
5111        }
5112
5113        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5114        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115            self.0.request.filter = v.into();
5116            self
5117        }
5118
5119        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5120        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5121            self.0.request.page_size = v.into();
5122            self
5123        }
5124
5125        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5126        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5127            self.0.request.page_token = v.into();
5128            self
5129        }
5130    }
5131
5132    #[doc(hidden)]
5133    impl gax::options::internal::RequestBuilder for ListLocations {
5134        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5135            &mut self.0.options
5136        }
5137    }
5138
5139    /// The request builder for [CloudDeploy::get_location][crate::client::CloudDeploy::get_location] calls.
5140    ///
5141    /// # Example
5142    /// ```no_run
5143    /// # use google_cloud_deploy_v1::builder;
5144    /// use builder::cloud_deploy::GetLocation;
5145    /// # tokio_test::block_on(async {
5146    ///
5147    /// let builder = prepare_request_builder();
5148    /// let response = builder.send().await?;
5149    /// # gax::Result::<()>::Ok(()) });
5150    ///
5151    /// fn prepare_request_builder() -> GetLocation {
5152    ///   # panic!();
5153    ///   // ... details omitted ...
5154    /// }
5155    /// ```
5156    #[derive(Clone, Debug)]
5157    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5158
5159    impl GetLocation {
5160        pub(crate) fn new(
5161            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5162        ) -> Self {
5163            Self(RequestBuilder::new(stub))
5164        }
5165
5166        /// Sets the full request, replacing any prior values.
5167        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5168            self.0.request = v.into();
5169            self
5170        }
5171
5172        /// Sets all the options, replacing any prior values.
5173        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5174            self.0.options = v.into();
5175            self
5176        }
5177
5178        /// Sends the request.
5179        pub async fn send(self) -> Result<location::model::Location> {
5180            (*self.0.stub)
5181                .get_location(self.0.request, self.0.options)
5182                .await
5183                .map(gax::response::Response::into_body)
5184        }
5185
5186        /// Sets the value of [name][location::model::GetLocationRequest::name].
5187        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5188            self.0.request.name = v.into();
5189            self
5190        }
5191    }
5192
5193    #[doc(hidden)]
5194    impl gax::options::internal::RequestBuilder for GetLocation {
5195        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5196            &mut self.0.options
5197        }
5198    }
5199
5200    /// The request builder for [CloudDeploy::set_iam_policy][crate::client::CloudDeploy::set_iam_policy] calls.
5201    ///
5202    /// # Example
5203    /// ```no_run
5204    /// # use google_cloud_deploy_v1::builder;
5205    /// use builder::cloud_deploy::SetIamPolicy;
5206    /// # tokio_test::block_on(async {
5207    ///
5208    /// let builder = prepare_request_builder();
5209    /// let response = builder.send().await?;
5210    /// # gax::Result::<()>::Ok(()) });
5211    ///
5212    /// fn prepare_request_builder() -> SetIamPolicy {
5213    ///   # panic!();
5214    ///   // ... details omitted ...
5215    /// }
5216    /// ```
5217    #[derive(Clone, Debug)]
5218    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5219
5220    impl SetIamPolicy {
5221        pub(crate) fn new(
5222            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5223        ) -> Self {
5224            Self(RequestBuilder::new(stub))
5225        }
5226
5227        /// Sets the full request, replacing any prior values.
5228        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5229            self.0.request = v.into();
5230            self
5231        }
5232
5233        /// Sets all the options, replacing any prior values.
5234        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5235            self.0.options = v.into();
5236            self
5237        }
5238
5239        /// Sends the request.
5240        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5241            (*self.0.stub)
5242                .set_iam_policy(self.0.request, self.0.options)
5243                .await
5244                .map(gax::response::Response::into_body)
5245        }
5246
5247        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
5248        ///
5249        /// This is a **required** field for requests.
5250        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5251            self.0.request.resource = v.into();
5252            self
5253        }
5254
5255        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5256        ///
5257        /// This is a **required** field for requests.
5258        pub fn set_policy<T>(mut self, v: T) -> Self
5259        where
5260            T: std::convert::Into<iam_v1::model::Policy>,
5261        {
5262            self.0.request.policy = std::option::Option::Some(v.into());
5263            self
5264        }
5265
5266        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5267        ///
5268        /// This is a **required** field for requests.
5269        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5270        where
5271            T: std::convert::Into<iam_v1::model::Policy>,
5272        {
5273            self.0.request.policy = v.map(|x| x.into());
5274            self
5275        }
5276
5277        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5278        pub fn set_update_mask<T>(mut self, v: T) -> Self
5279        where
5280            T: std::convert::Into<wkt::FieldMask>,
5281        {
5282            self.0.request.update_mask = std::option::Option::Some(v.into());
5283            self
5284        }
5285
5286        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5287        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5288        where
5289            T: std::convert::Into<wkt::FieldMask>,
5290        {
5291            self.0.request.update_mask = v.map(|x| x.into());
5292            self
5293        }
5294    }
5295
5296    #[doc(hidden)]
5297    impl gax::options::internal::RequestBuilder for SetIamPolicy {
5298        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5299            &mut self.0.options
5300        }
5301    }
5302
5303    /// The request builder for [CloudDeploy::get_iam_policy][crate::client::CloudDeploy::get_iam_policy] calls.
5304    ///
5305    /// # Example
5306    /// ```no_run
5307    /// # use google_cloud_deploy_v1::builder;
5308    /// use builder::cloud_deploy::GetIamPolicy;
5309    /// # tokio_test::block_on(async {
5310    ///
5311    /// let builder = prepare_request_builder();
5312    /// let response = builder.send().await?;
5313    /// # gax::Result::<()>::Ok(()) });
5314    ///
5315    /// fn prepare_request_builder() -> GetIamPolicy {
5316    ///   # panic!();
5317    ///   // ... details omitted ...
5318    /// }
5319    /// ```
5320    #[derive(Clone, Debug)]
5321    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5322
5323    impl GetIamPolicy {
5324        pub(crate) fn new(
5325            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5326        ) -> Self {
5327            Self(RequestBuilder::new(stub))
5328        }
5329
5330        /// Sets the full request, replacing any prior values.
5331        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5332            self.0.request = v.into();
5333            self
5334        }
5335
5336        /// Sets all the options, replacing any prior values.
5337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5338            self.0.options = v.into();
5339            self
5340        }
5341
5342        /// Sends the request.
5343        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5344            (*self.0.stub)
5345                .get_iam_policy(self.0.request, self.0.options)
5346                .await
5347                .map(gax::response::Response::into_body)
5348        }
5349
5350        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
5351        ///
5352        /// This is a **required** field for requests.
5353        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5354            self.0.request.resource = v.into();
5355            self
5356        }
5357
5358        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5359        pub fn set_options<T>(mut self, v: T) -> Self
5360        where
5361            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5362        {
5363            self.0.request.options = std::option::Option::Some(v.into());
5364            self
5365        }
5366
5367        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5368        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5369        where
5370            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5371        {
5372            self.0.request.options = v.map(|x| x.into());
5373            self
5374        }
5375    }
5376
5377    #[doc(hidden)]
5378    impl gax::options::internal::RequestBuilder for GetIamPolicy {
5379        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5380            &mut self.0.options
5381        }
5382    }
5383
5384    /// The request builder for [CloudDeploy::test_iam_permissions][crate::client::CloudDeploy::test_iam_permissions] calls.
5385    ///
5386    /// # Example
5387    /// ```no_run
5388    /// # use google_cloud_deploy_v1::builder;
5389    /// use builder::cloud_deploy::TestIamPermissions;
5390    /// # tokio_test::block_on(async {
5391    ///
5392    /// let builder = prepare_request_builder();
5393    /// let response = builder.send().await?;
5394    /// # gax::Result::<()>::Ok(()) });
5395    ///
5396    /// fn prepare_request_builder() -> TestIamPermissions {
5397    ///   # panic!();
5398    ///   // ... details omitted ...
5399    /// }
5400    /// ```
5401    #[derive(Clone, Debug)]
5402    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5403
5404    impl TestIamPermissions {
5405        pub(crate) fn new(
5406            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5407        ) -> Self {
5408            Self(RequestBuilder::new(stub))
5409        }
5410
5411        /// Sets the full request, replacing any prior values.
5412        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5413            mut self,
5414            v: V,
5415        ) -> Self {
5416            self.0.request = v.into();
5417            self
5418        }
5419
5420        /// Sets all the options, replacing any prior values.
5421        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5422            self.0.options = v.into();
5423            self
5424        }
5425
5426        /// Sends the request.
5427        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5428            (*self.0.stub)
5429                .test_iam_permissions(self.0.request, self.0.options)
5430                .await
5431                .map(gax::response::Response::into_body)
5432        }
5433
5434        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
5435        ///
5436        /// This is a **required** field for requests.
5437        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5438            self.0.request.resource = v.into();
5439            self
5440        }
5441
5442        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
5443        ///
5444        /// This is a **required** field for requests.
5445        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5446        where
5447            T: std::iter::IntoIterator<Item = V>,
5448            V: std::convert::Into<std::string::String>,
5449        {
5450            use std::iter::Iterator;
5451            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5452            self
5453        }
5454    }
5455
5456    #[doc(hidden)]
5457    impl gax::options::internal::RequestBuilder for TestIamPermissions {
5458        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5459            &mut self.0.options
5460        }
5461    }
5462
5463    /// The request builder for [CloudDeploy::list_operations][crate::client::CloudDeploy::list_operations] calls.
5464    ///
5465    /// # Example
5466    /// ```no_run
5467    /// # use google_cloud_deploy_v1::builder;
5468    /// use builder::cloud_deploy::ListOperations;
5469    /// # tokio_test::block_on(async {
5470    /// use gax::paginator::ItemPaginator;
5471    ///
5472    /// let builder = prepare_request_builder();
5473    /// let mut items = builder.by_item();
5474    /// while let Some(result) = items.next().await {
5475    ///   let item = result?;
5476    /// }
5477    /// # gax::Result::<()>::Ok(()) });
5478    ///
5479    /// fn prepare_request_builder() -> ListOperations {
5480    ///   # panic!();
5481    ///   // ... details omitted ...
5482    /// }
5483    /// ```
5484    #[derive(Clone, Debug)]
5485    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5486
5487    impl ListOperations {
5488        pub(crate) fn new(
5489            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5490        ) -> Self {
5491            Self(RequestBuilder::new(stub))
5492        }
5493
5494        /// Sets the full request, replacing any prior values.
5495        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5496            mut self,
5497            v: V,
5498        ) -> Self {
5499            self.0.request = v.into();
5500            self
5501        }
5502
5503        /// Sets all the options, replacing any prior values.
5504        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5505            self.0.options = v.into();
5506            self
5507        }
5508
5509        /// Sends the request.
5510        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5511            (*self.0.stub)
5512                .list_operations(self.0.request, self.0.options)
5513                .await
5514                .map(gax::response::Response::into_body)
5515        }
5516
5517        /// Streams each page in the collection.
5518        pub fn by_page(
5519            self,
5520        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5521        {
5522            use std::clone::Clone;
5523            let token = self.0.request.page_token.clone();
5524            let execute = move |token: String| {
5525                let mut builder = self.clone();
5526                builder.0.request = builder.0.request.set_page_token(token);
5527                builder.send()
5528            };
5529            gax::paginator::internal::new_paginator(token, execute)
5530        }
5531
5532        /// Streams each item in the collection.
5533        pub fn by_item(
5534            self,
5535        ) -> impl gax::paginator::ItemPaginator<
5536            longrunning::model::ListOperationsResponse,
5537            gax::error::Error,
5538        > {
5539            use gax::paginator::Paginator;
5540            self.by_page().items()
5541        }
5542
5543        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5544        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5545            self.0.request.name = v.into();
5546            self
5547        }
5548
5549        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5550        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5551            self.0.request.filter = v.into();
5552            self
5553        }
5554
5555        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5556        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5557            self.0.request.page_size = v.into();
5558            self
5559        }
5560
5561        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5562        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5563            self.0.request.page_token = v.into();
5564            self
5565        }
5566    }
5567
5568    #[doc(hidden)]
5569    impl gax::options::internal::RequestBuilder for ListOperations {
5570        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5571            &mut self.0.options
5572        }
5573    }
5574
5575    /// The request builder for [CloudDeploy::get_operation][crate::client::CloudDeploy::get_operation] calls.
5576    ///
5577    /// # Example
5578    /// ```no_run
5579    /// # use google_cloud_deploy_v1::builder;
5580    /// use builder::cloud_deploy::GetOperation;
5581    /// # tokio_test::block_on(async {
5582    ///
5583    /// let builder = prepare_request_builder();
5584    /// let response = builder.send().await?;
5585    /// # gax::Result::<()>::Ok(()) });
5586    ///
5587    /// fn prepare_request_builder() -> GetOperation {
5588    ///   # panic!();
5589    ///   // ... details omitted ...
5590    /// }
5591    /// ```
5592    #[derive(Clone, Debug)]
5593    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5594
5595    impl GetOperation {
5596        pub(crate) fn new(
5597            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5598        ) -> Self {
5599            Self(RequestBuilder::new(stub))
5600        }
5601
5602        /// Sets the full request, replacing any prior values.
5603        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5604            mut self,
5605            v: V,
5606        ) -> Self {
5607            self.0.request = v.into();
5608            self
5609        }
5610
5611        /// Sets all the options, replacing any prior values.
5612        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5613            self.0.options = v.into();
5614            self
5615        }
5616
5617        /// Sends the request.
5618        pub async fn send(self) -> Result<longrunning::model::Operation> {
5619            (*self.0.stub)
5620                .get_operation(self.0.request, self.0.options)
5621                .await
5622                .map(gax::response::Response::into_body)
5623        }
5624
5625        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5626        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5627            self.0.request.name = v.into();
5628            self
5629        }
5630    }
5631
5632    #[doc(hidden)]
5633    impl gax::options::internal::RequestBuilder for GetOperation {
5634        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5635            &mut self.0.options
5636        }
5637    }
5638
5639    /// The request builder for [CloudDeploy::delete_operation][crate::client::CloudDeploy::delete_operation] calls.
5640    ///
5641    /// # Example
5642    /// ```no_run
5643    /// # use google_cloud_deploy_v1::builder;
5644    /// use builder::cloud_deploy::DeleteOperation;
5645    /// # tokio_test::block_on(async {
5646    ///
5647    /// let builder = prepare_request_builder();
5648    /// let response = builder.send().await?;
5649    /// # gax::Result::<()>::Ok(()) });
5650    ///
5651    /// fn prepare_request_builder() -> DeleteOperation {
5652    ///   # panic!();
5653    ///   // ... details omitted ...
5654    /// }
5655    /// ```
5656    #[derive(Clone, Debug)]
5657    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5658
5659    impl DeleteOperation {
5660        pub(crate) fn new(
5661            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5662        ) -> Self {
5663            Self(RequestBuilder::new(stub))
5664        }
5665
5666        /// Sets the full request, replacing any prior values.
5667        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5668            mut self,
5669            v: V,
5670        ) -> Self {
5671            self.0.request = v.into();
5672            self
5673        }
5674
5675        /// Sets all the options, replacing any prior values.
5676        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5677            self.0.options = v.into();
5678            self
5679        }
5680
5681        /// Sends the request.
5682        pub async fn send(self) -> Result<()> {
5683            (*self.0.stub)
5684                .delete_operation(self.0.request, self.0.options)
5685                .await
5686                .map(gax::response::Response::into_body)
5687        }
5688
5689        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5690        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5691            self.0.request.name = v.into();
5692            self
5693        }
5694    }
5695
5696    #[doc(hidden)]
5697    impl gax::options::internal::RequestBuilder for DeleteOperation {
5698        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5699            &mut self.0.options
5700        }
5701    }
5702
5703    /// The request builder for [CloudDeploy::cancel_operation][crate::client::CloudDeploy::cancel_operation] calls.
5704    ///
5705    /// # Example
5706    /// ```no_run
5707    /// # use google_cloud_deploy_v1::builder;
5708    /// use builder::cloud_deploy::CancelOperation;
5709    /// # tokio_test::block_on(async {
5710    ///
5711    /// let builder = prepare_request_builder();
5712    /// let response = builder.send().await?;
5713    /// # gax::Result::<()>::Ok(()) });
5714    ///
5715    /// fn prepare_request_builder() -> CancelOperation {
5716    ///   # panic!();
5717    ///   // ... details omitted ...
5718    /// }
5719    /// ```
5720    #[derive(Clone, Debug)]
5721    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5722
5723    impl CancelOperation {
5724        pub(crate) fn new(
5725            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5726        ) -> Self {
5727            Self(RequestBuilder::new(stub))
5728        }
5729
5730        /// Sets the full request, replacing any prior values.
5731        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5732            mut self,
5733            v: V,
5734        ) -> Self {
5735            self.0.request = v.into();
5736            self
5737        }
5738
5739        /// Sets all the options, replacing any prior values.
5740        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5741            self.0.options = v.into();
5742            self
5743        }
5744
5745        /// Sends the request.
5746        pub async fn send(self) -> Result<()> {
5747            (*self.0.stub)
5748                .cancel_operation(self.0.request, self.0.options)
5749                .await
5750                .map(gax::response::Response::into_body)
5751        }
5752
5753        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5754        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755            self.0.request.name = v.into();
5756            self
5757        }
5758    }
5759
5760    #[doc(hidden)]
5761    impl gax::options::internal::RequestBuilder for CancelOperation {
5762        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5763            &mut self.0.options
5764        }
5765    }
5766}