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