Skip to main content

google_cloud_deploy_v1/
builder.rs

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