Skip to main content

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