Skip to main content

google_cloud_deploy_v1/
builder.rs

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