google_cloud_build_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod cloud_build {
18    use crate::Result;
19
20    /// A builder for [CloudBuild][crate::client::CloudBuild].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_build_v1::*;
25    /// # use builder::cloud_build::ClientBuilder;
26    /// # use client::CloudBuild;
27    /// let builder : ClientBuilder = CloudBuild::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://cloudbuild.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CloudBuild;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = CloudBuild;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::CloudBuild] 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::CloudBuild>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CloudBuild::create_build][crate::client::CloudBuild::create_build] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_build_v1::builder;
79    /// use builder::cloud_build::CreateBuild;
80    /// # tokio_test::block_on(async {
81    /// use lro::Poller;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let response = builder.poller().until_done().await?;
85    /// # gax::Result::<()>::Ok(()) });
86    ///
87    /// fn prepare_request_builder() -> CreateBuild {
88    ///   # panic!();
89    ///   // ... details omitted ...
90    /// }
91    /// ```
92    #[derive(Clone, Debug)]
93    pub struct CreateBuild(RequestBuilder<crate::model::CreateBuildRequest>);
94
95    impl CreateBuild {
96        pub(crate) fn new(
97            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
98        ) -> Self {
99            Self(RequestBuilder::new(stub))
100        }
101
102        /// Sets the full request, replacing any prior values.
103        pub fn with_request<V: Into<crate::model::CreateBuildRequest>>(mut self, v: V) -> Self {
104            self.0.request = v.into();
105            self
106        }
107
108        /// Sets all the options, replacing any prior values.
109        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110            self.0.options = v.into();
111            self
112        }
113
114        /// Sends the request.
115        ///
116        /// # Long running operations
117        ///
118        /// This starts, but does not poll, a longrunning operation. More information
119        /// on [create_build][crate::client::CloudBuild::create_build].
120        pub async fn send(self) -> Result<longrunning::model::Operation> {
121            (*self.0.stub)
122                .create_build(self.0.request, self.0.options)
123                .await
124                .map(gax::response::Response::into_body)
125        }
126
127        /// Creates a [Poller][lro::Poller] to work with `create_build`.
128        pub fn poller(
129            self,
130        ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
131            type Operation =
132                lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
133            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
134            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
135
136            let stub = self.0.stub.clone();
137            let mut options = self.0.options.clone();
138            options.set_retry_policy(gax::retry_policy::NeverRetry);
139            let query = move |name| {
140                let stub = stub.clone();
141                let options = options.clone();
142                async {
143                    let op = GetOperation::new(stub)
144                        .set_name(name)
145                        .with_options(options)
146                        .send()
147                        .await?;
148                    Ok(Operation::new(op))
149                }
150            };
151
152            let start = move || async {
153                let op = self.send().await?;
154                Ok(Operation::new(op))
155            };
156
157            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
158        }
159
160        /// Sets the value of [parent][crate::model::CreateBuildRequest::parent].
161        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162            self.0.request.parent = v.into();
163            self
164        }
165
166        /// Sets the value of [project_id][crate::model::CreateBuildRequest::project_id].
167        ///
168        /// This is a **required** field for requests.
169        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.project_id = v.into();
171            self
172        }
173
174        /// Sets the value of [build][crate::model::CreateBuildRequest::build].
175        ///
176        /// This is a **required** field for requests.
177        pub fn set_build<T>(mut self, v: T) -> Self
178        where
179            T: std::convert::Into<crate::model::Build>,
180        {
181            self.0.request.build = std::option::Option::Some(v.into());
182            self
183        }
184
185        /// Sets or clears the value of [build][crate::model::CreateBuildRequest::build].
186        ///
187        /// This is a **required** field for requests.
188        pub fn set_or_clear_build<T>(mut self, v: std::option::Option<T>) -> Self
189        where
190            T: std::convert::Into<crate::model::Build>,
191        {
192            self.0.request.build = v.map(|x| x.into());
193            self
194        }
195    }
196
197    #[doc(hidden)]
198    impl gax::options::internal::RequestBuilder for CreateBuild {
199        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
200            &mut self.0.options
201        }
202    }
203
204    /// The request builder for [CloudBuild::get_build][crate::client::CloudBuild::get_build] calls.
205    ///
206    /// # Example
207    /// ```no_run
208    /// # use google_cloud_build_v1::builder;
209    /// use builder::cloud_build::GetBuild;
210    /// # tokio_test::block_on(async {
211    ///
212    /// let builder = prepare_request_builder();
213    /// let response = builder.send().await?;
214    /// # gax::Result::<()>::Ok(()) });
215    ///
216    /// fn prepare_request_builder() -> GetBuild {
217    ///   # panic!();
218    ///   // ... details omitted ...
219    /// }
220    /// ```
221    #[derive(Clone, Debug)]
222    pub struct GetBuild(RequestBuilder<crate::model::GetBuildRequest>);
223
224    impl GetBuild {
225        pub(crate) fn new(
226            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
227        ) -> Self {
228            Self(RequestBuilder::new(stub))
229        }
230
231        /// Sets the full request, replacing any prior values.
232        pub fn with_request<V: Into<crate::model::GetBuildRequest>>(mut self, v: V) -> Self {
233            self.0.request = v.into();
234            self
235        }
236
237        /// Sets all the options, replacing any prior values.
238        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
239            self.0.options = v.into();
240            self
241        }
242
243        /// Sends the request.
244        pub async fn send(self) -> Result<crate::model::Build> {
245            (*self.0.stub)
246                .get_build(self.0.request, self.0.options)
247                .await
248                .map(gax::response::Response::into_body)
249        }
250
251        /// Sets the value of [name][crate::model::GetBuildRequest::name].
252        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
253            self.0.request.name = v.into();
254            self
255        }
256
257        /// Sets the value of [project_id][crate::model::GetBuildRequest::project_id].
258        ///
259        /// This is a **required** field for requests.
260        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
261            self.0.request.project_id = v.into();
262            self
263        }
264
265        /// Sets the value of [id][crate::model::GetBuildRequest::id].
266        ///
267        /// This is a **required** field for requests.
268        pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
269            self.0.request.id = v.into();
270            self
271        }
272    }
273
274    #[doc(hidden)]
275    impl gax::options::internal::RequestBuilder for GetBuild {
276        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
277            &mut self.0.options
278        }
279    }
280
281    /// The request builder for [CloudBuild::list_builds][crate::client::CloudBuild::list_builds] calls.
282    ///
283    /// # Example
284    /// ```no_run
285    /// # use google_cloud_build_v1::builder;
286    /// use builder::cloud_build::ListBuilds;
287    /// # tokio_test::block_on(async {
288    /// use gax::paginator::ItemPaginator;
289    ///
290    /// let builder = prepare_request_builder();
291    /// let mut items = builder.by_item();
292    /// while let Some(result) = items.next().await {
293    ///   let item = result?;
294    /// }
295    /// # gax::Result::<()>::Ok(()) });
296    ///
297    /// fn prepare_request_builder() -> ListBuilds {
298    ///   # panic!();
299    ///   // ... details omitted ...
300    /// }
301    /// ```
302    #[derive(Clone, Debug)]
303    pub struct ListBuilds(RequestBuilder<crate::model::ListBuildsRequest>);
304
305    impl ListBuilds {
306        pub(crate) fn new(
307            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
308        ) -> Self {
309            Self(RequestBuilder::new(stub))
310        }
311
312        /// Sets the full request, replacing any prior values.
313        pub fn with_request<V: Into<crate::model::ListBuildsRequest>>(mut self, v: V) -> Self {
314            self.0.request = v.into();
315            self
316        }
317
318        /// Sets all the options, replacing any prior values.
319        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
320            self.0.options = v.into();
321            self
322        }
323
324        /// Sends the request.
325        pub async fn send(self) -> Result<crate::model::ListBuildsResponse> {
326            (*self.0.stub)
327                .list_builds(self.0.request, self.0.options)
328                .await
329                .map(gax::response::Response::into_body)
330        }
331
332        /// Streams each page in the collection.
333        pub fn by_page(
334            self,
335        ) -> impl gax::paginator::Paginator<crate::model::ListBuildsResponse, gax::error::Error>
336        {
337            use std::clone::Clone;
338            let token = self.0.request.page_token.clone();
339            let execute = move |token: String| {
340                let mut builder = self.clone();
341                builder.0.request = builder.0.request.set_page_token(token);
342                builder.send()
343            };
344            gax::paginator::internal::new_paginator(token, execute)
345        }
346
347        /// Streams each item in the collection.
348        pub fn by_item(
349            self,
350        ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildsResponse, gax::error::Error>
351        {
352            use gax::paginator::Paginator;
353            self.by_page().items()
354        }
355
356        /// Sets the value of [parent][crate::model::ListBuildsRequest::parent].
357        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
358            self.0.request.parent = v.into();
359            self
360        }
361
362        /// Sets the value of [project_id][crate::model::ListBuildsRequest::project_id].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
366            self.0.request.project_id = v.into();
367            self
368        }
369
370        /// Sets the value of [page_size][crate::model::ListBuildsRequest::page_size].
371        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
372            self.0.request.page_size = v.into();
373            self
374        }
375
376        /// Sets the value of [page_token][crate::model::ListBuildsRequest::page_token].
377        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.page_token = v.into();
379            self
380        }
381
382        /// Sets the value of [filter][crate::model::ListBuildsRequest::filter].
383        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
384            self.0.request.filter = v.into();
385            self
386        }
387    }
388
389    #[doc(hidden)]
390    impl gax::options::internal::RequestBuilder for ListBuilds {
391        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
392            &mut self.0.options
393        }
394    }
395
396    /// The request builder for [CloudBuild::cancel_build][crate::client::CloudBuild::cancel_build] calls.
397    ///
398    /// # Example
399    /// ```no_run
400    /// # use google_cloud_build_v1::builder;
401    /// use builder::cloud_build::CancelBuild;
402    /// # tokio_test::block_on(async {
403    ///
404    /// let builder = prepare_request_builder();
405    /// let response = builder.send().await?;
406    /// # gax::Result::<()>::Ok(()) });
407    ///
408    /// fn prepare_request_builder() -> CancelBuild {
409    ///   # panic!();
410    ///   // ... details omitted ...
411    /// }
412    /// ```
413    #[derive(Clone, Debug)]
414    pub struct CancelBuild(RequestBuilder<crate::model::CancelBuildRequest>);
415
416    impl CancelBuild {
417        pub(crate) fn new(
418            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
419        ) -> Self {
420            Self(RequestBuilder::new(stub))
421        }
422
423        /// Sets the full request, replacing any prior values.
424        pub fn with_request<V: Into<crate::model::CancelBuildRequest>>(mut self, v: V) -> Self {
425            self.0.request = v.into();
426            self
427        }
428
429        /// Sets all the options, replacing any prior values.
430        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
431            self.0.options = v.into();
432            self
433        }
434
435        /// Sends the request.
436        pub async fn send(self) -> Result<crate::model::Build> {
437            (*self.0.stub)
438                .cancel_build(self.0.request, self.0.options)
439                .await
440                .map(gax::response::Response::into_body)
441        }
442
443        /// Sets the value of [name][crate::model::CancelBuildRequest::name].
444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
445            self.0.request.name = v.into();
446            self
447        }
448
449        /// Sets the value of [project_id][crate::model::CancelBuildRequest::project_id].
450        ///
451        /// This is a **required** field for requests.
452        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
453            self.0.request.project_id = v.into();
454            self
455        }
456
457        /// Sets the value of [id][crate::model::CancelBuildRequest::id].
458        ///
459        /// This is a **required** field for requests.
460        pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
461            self.0.request.id = v.into();
462            self
463        }
464    }
465
466    #[doc(hidden)]
467    impl gax::options::internal::RequestBuilder for CancelBuild {
468        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
469            &mut self.0.options
470        }
471    }
472
473    /// The request builder for [CloudBuild::retry_build][crate::client::CloudBuild::retry_build] calls.
474    ///
475    /// # Example
476    /// ```no_run
477    /// # use google_cloud_build_v1::builder;
478    /// use builder::cloud_build::RetryBuild;
479    /// # tokio_test::block_on(async {
480    /// use lro::Poller;
481    ///
482    /// let builder = prepare_request_builder();
483    /// let response = builder.poller().until_done().await?;
484    /// # gax::Result::<()>::Ok(()) });
485    ///
486    /// fn prepare_request_builder() -> RetryBuild {
487    ///   # panic!();
488    ///   // ... details omitted ...
489    /// }
490    /// ```
491    #[derive(Clone, Debug)]
492    pub struct RetryBuild(RequestBuilder<crate::model::RetryBuildRequest>);
493
494    impl RetryBuild {
495        pub(crate) fn new(
496            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
497        ) -> Self {
498            Self(RequestBuilder::new(stub))
499        }
500
501        /// Sets the full request, replacing any prior values.
502        pub fn with_request<V: Into<crate::model::RetryBuildRequest>>(mut self, v: V) -> Self {
503            self.0.request = v.into();
504            self
505        }
506
507        /// Sets all the options, replacing any prior values.
508        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
509            self.0.options = v.into();
510            self
511        }
512
513        /// Sends the request.
514        ///
515        /// # Long running operations
516        ///
517        /// This starts, but does not poll, a longrunning operation. More information
518        /// on [retry_build][crate::client::CloudBuild::retry_build].
519        pub async fn send(self) -> Result<longrunning::model::Operation> {
520            (*self.0.stub)
521                .retry_build(self.0.request, self.0.options)
522                .await
523                .map(gax::response::Response::into_body)
524        }
525
526        /// Creates a [Poller][lro::Poller] to work with `retry_build`.
527        pub fn poller(
528            self,
529        ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
530            type Operation =
531                lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
532            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
533            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
534
535            let stub = self.0.stub.clone();
536            let mut options = self.0.options.clone();
537            options.set_retry_policy(gax::retry_policy::NeverRetry);
538            let query = move |name| {
539                let stub = stub.clone();
540                let options = options.clone();
541                async {
542                    let op = GetOperation::new(stub)
543                        .set_name(name)
544                        .with_options(options)
545                        .send()
546                        .await?;
547                    Ok(Operation::new(op))
548                }
549            };
550
551            let start = move || async {
552                let op = self.send().await?;
553                Ok(Operation::new(op))
554            };
555
556            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
557        }
558
559        /// Sets the value of [name][crate::model::RetryBuildRequest::name].
560        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
561            self.0.request.name = v.into();
562            self
563        }
564
565        /// Sets the value of [project_id][crate::model::RetryBuildRequest::project_id].
566        ///
567        /// This is a **required** field for requests.
568        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
569            self.0.request.project_id = v.into();
570            self
571        }
572
573        /// Sets the value of [id][crate::model::RetryBuildRequest::id].
574        ///
575        /// This is a **required** field for requests.
576        pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
577            self.0.request.id = v.into();
578            self
579        }
580    }
581
582    #[doc(hidden)]
583    impl gax::options::internal::RequestBuilder for RetryBuild {
584        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
585            &mut self.0.options
586        }
587    }
588
589    /// The request builder for [CloudBuild::approve_build][crate::client::CloudBuild::approve_build] calls.
590    ///
591    /// # Example
592    /// ```no_run
593    /// # use google_cloud_build_v1::builder;
594    /// use builder::cloud_build::ApproveBuild;
595    /// # tokio_test::block_on(async {
596    /// use lro::Poller;
597    ///
598    /// let builder = prepare_request_builder();
599    /// let response = builder.poller().until_done().await?;
600    /// # gax::Result::<()>::Ok(()) });
601    ///
602    /// fn prepare_request_builder() -> ApproveBuild {
603    ///   # panic!();
604    ///   // ... details omitted ...
605    /// }
606    /// ```
607    #[derive(Clone, Debug)]
608    pub struct ApproveBuild(RequestBuilder<crate::model::ApproveBuildRequest>);
609
610    impl ApproveBuild {
611        pub(crate) fn new(
612            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
613        ) -> Self {
614            Self(RequestBuilder::new(stub))
615        }
616
617        /// Sets the full request, replacing any prior values.
618        pub fn with_request<V: Into<crate::model::ApproveBuildRequest>>(mut self, v: V) -> Self {
619            self.0.request = v.into();
620            self
621        }
622
623        /// Sets all the options, replacing any prior values.
624        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
625            self.0.options = v.into();
626            self
627        }
628
629        /// Sends the request.
630        ///
631        /// # Long running operations
632        ///
633        /// This starts, but does not poll, a longrunning operation. More information
634        /// on [approve_build][crate::client::CloudBuild::approve_build].
635        pub async fn send(self) -> Result<longrunning::model::Operation> {
636            (*self.0.stub)
637                .approve_build(self.0.request, self.0.options)
638                .await
639                .map(gax::response::Response::into_body)
640        }
641
642        /// Creates a [Poller][lro::Poller] to work with `approve_build`.
643        pub fn poller(
644            self,
645        ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
646            type Operation =
647                lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
648            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
649            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
650
651            let stub = self.0.stub.clone();
652            let mut options = self.0.options.clone();
653            options.set_retry_policy(gax::retry_policy::NeverRetry);
654            let query = move |name| {
655                let stub = stub.clone();
656                let options = options.clone();
657                async {
658                    let op = GetOperation::new(stub)
659                        .set_name(name)
660                        .with_options(options)
661                        .send()
662                        .await?;
663                    Ok(Operation::new(op))
664                }
665            };
666
667            let start = move || async {
668                let op = self.send().await?;
669                Ok(Operation::new(op))
670            };
671
672            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
673        }
674
675        /// Sets the value of [name][crate::model::ApproveBuildRequest::name].
676        ///
677        /// This is a **required** field for requests.
678        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
679            self.0.request.name = v.into();
680            self
681        }
682
683        /// Sets the value of [approval_result][crate::model::ApproveBuildRequest::approval_result].
684        pub fn set_approval_result<T>(mut self, v: T) -> Self
685        where
686            T: std::convert::Into<crate::model::ApprovalResult>,
687        {
688            self.0.request.approval_result = std::option::Option::Some(v.into());
689            self
690        }
691
692        /// Sets or clears the value of [approval_result][crate::model::ApproveBuildRequest::approval_result].
693        pub fn set_or_clear_approval_result<T>(mut self, v: std::option::Option<T>) -> Self
694        where
695            T: std::convert::Into<crate::model::ApprovalResult>,
696        {
697            self.0.request.approval_result = v.map(|x| x.into());
698            self
699        }
700    }
701
702    #[doc(hidden)]
703    impl gax::options::internal::RequestBuilder for ApproveBuild {
704        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
705            &mut self.0.options
706        }
707    }
708
709    /// The request builder for [CloudBuild::create_build_trigger][crate::client::CloudBuild::create_build_trigger] calls.
710    ///
711    /// # Example
712    /// ```no_run
713    /// # use google_cloud_build_v1::builder;
714    /// use builder::cloud_build::CreateBuildTrigger;
715    /// # tokio_test::block_on(async {
716    ///
717    /// let builder = prepare_request_builder();
718    /// let response = builder.send().await?;
719    /// # gax::Result::<()>::Ok(()) });
720    ///
721    /// fn prepare_request_builder() -> CreateBuildTrigger {
722    ///   # panic!();
723    ///   // ... details omitted ...
724    /// }
725    /// ```
726    #[derive(Clone, Debug)]
727    pub struct CreateBuildTrigger(RequestBuilder<crate::model::CreateBuildTriggerRequest>);
728
729    impl CreateBuildTrigger {
730        pub(crate) fn new(
731            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
732        ) -> Self {
733            Self(RequestBuilder::new(stub))
734        }
735
736        /// Sets the full request, replacing any prior values.
737        pub fn with_request<V: Into<crate::model::CreateBuildTriggerRequest>>(
738            mut self,
739            v: V,
740        ) -> Self {
741            self.0.request = v.into();
742            self
743        }
744
745        /// Sets all the options, replacing any prior values.
746        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
747            self.0.options = v.into();
748            self
749        }
750
751        /// Sends the request.
752        pub async fn send(self) -> Result<crate::model::BuildTrigger> {
753            (*self.0.stub)
754                .create_build_trigger(self.0.request, self.0.options)
755                .await
756                .map(gax::response::Response::into_body)
757        }
758
759        /// Sets the value of [parent][crate::model::CreateBuildTriggerRequest::parent].
760        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
761            self.0.request.parent = v.into();
762            self
763        }
764
765        /// Sets the value of [project_id][crate::model::CreateBuildTriggerRequest::project_id].
766        ///
767        /// This is a **required** field for requests.
768        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
769            self.0.request.project_id = v.into();
770            self
771        }
772
773        /// Sets the value of [trigger][crate::model::CreateBuildTriggerRequest::trigger].
774        ///
775        /// This is a **required** field for requests.
776        pub fn set_trigger<T>(mut self, v: T) -> Self
777        where
778            T: std::convert::Into<crate::model::BuildTrigger>,
779        {
780            self.0.request.trigger = std::option::Option::Some(v.into());
781            self
782        }
783
784        /// Sets or clears the value of [trigger][crate::model::CreateBuildTriggerRequest::trigger].
785        ///
786        /// This is a **required** field for requests.
787        pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
788        where
789            T: std::convert::Into<crate::model::BuildTrigger>,
790        {
791            self.0.request.trigger = v.map(|x| x.into());
792            self
793        }
794    }
795
796    #[doc(hidden)]
797    impl gax::options::internal::RequestBuilder for CreateBuildTrigger {
798        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
799            &mut self.0.options
800        }
801    }
802
803    /// The request builder for [CloudBuild::get_build_trigger][crate::client::CloudBuild::get_build_trigger] calls.
804    ///
805    /// # Example
806    /// ```no_run
807    /// # use google_cloud_build_v1::builder;
808    /// use builder::cloud_build::GetBuildTrigger;
809    /// # tokio_test::block_on(async {
810    ///
811    /// let builder = prepare_request_builder();
812    /// let response = builder.send().await?;
813    /// # gax::Result::<()>::Ok(()) });
814    ///
815    /// fn prepare_request_builder() -> GetBuildTrigger {
816    ///   # panic!();
817    ///   // ... details omitted ...
818    /// }
819    /// ```
820    #[derive(Clone, Debug)]
821    pub struct GetBuildTrigger(RequestBuilder<crate::model::GetBuildTriggerRequest>);
822
823    impl GetBuildTrigger {
824        pub(crate) fn new(
825            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
826        ) -> Self {
827            Self(RequestBuilder::new(stub))
828        }
829
830        /// Sets the full request, replacing any prior values.
831        pub fn with_request<V: Into<crate::model::GetBuildTriggerRequest>>(mut self, v: V) -> Self {
832            self.0.request = v.into();
833            self
834        }
835
836        /// Sets all the options, replacing any prior values.
837        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
838            self.0.options = v.into();
839            self
840        }
841
842        /// Sends the request.
843        pub async fn send(self) -> Result<crate::model::BuildTrigger> {
844            (*self.0.stub)
845                .get_build_trigger(self.0.request, self.0.options)
846                .await
847                .map(gax::response::Response::into_body)
848        }
849
850        /// Sets the value of [name][crate::model::GetBuildTriggerRequest::name].
851        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
852            self.0.request.name = v.into();
853            self
854        }
855
856        /// Sets the value of [project_id][crate::model::GetBuildTriggerRequest::project_id].
857        ///
858        /// This is a **required** field for requests.
859        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
860            self.0.request.project_id = v.into();
861            self
862        }
863
864        /// Sets the value of [trigger_id][crate::model::GetBuildTriggerRequest::trigger_id].
865        ///
866        /// This is a **required** field for requests.
867        pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
868            self.0.request.trigger_id = v.into();
869            self
870        }
871    }
872
873    #[doc(hidden)]
874    impl gax::options::internal::RequestBuilder for GetBuildTrigger {
875        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
876            &mut self.0.options
877        }
878    }
879
880    /// The request builder for [CloudBuild::list_build_triggers][crate::client::CloudBuild::list_build_triggers] calls.
881    ///
882    /// # Example
883    /// ```no_run
884    /// # use google_cloud_build_v1::builder;
885    /// use builder::cloud_build::ListBuildTriggers;
886    /// # tokio_test::block_on(async {
887    /// use gax::paginator::ItemPaginator;
888    ///
889    /// let builder = prepare_request_builder();
890    /// let mut items = builder.by_item();
891    /// while let Some(result) = items.next().await {
892    ///   let item = result?;
893    /// }
894    /// # gax::Result::<()>::Ok(()) });
895    ///
896    /// fn prepare_request_builder() -> ListBuildTriggers {
897    ///   # panic!();
898    ///   // ... details omitted ...
899    /// }
900    /// ```
901    #[derive(Clone, Debug)]
902    pub struct ListBuildTriggers(RequestBuilder<crate::model::ListBuildTriggersRequest>);
903
904    impl ListBuildTriggers {
905        pub(crate) fn new(
906            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
907        ) -> Self {
908            Self(RequestBuilder::new(stub))
909        }
910
911        /// Sets the full request, replacing any prior values.
912        pub fn with_request<V: Into<crate::model::ListBuildTriggersRequest>>(
913            mut self,
914            v: V,
915        ) -> Self {
916            self.0.request = v.into();
917            self
918        }
919
920        /// Sets all the options, replacing any prior values.
921        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
922            self.0.options = v.into();
923            self
924        }
925
926        /// Sends the request.
927        pub async fn send(self) -> Result<crate::model::ListBuildTriggersResponse> {
928            (*self.0.stub)
929                .list_build_triggers(self.0.request, self.0.options)
930                .await
931                .map(gax::response::Response::into_body)
932        }
933
934        /// Streams each page in the collection.
935        pub fn by_page(
936            self,
937        ) -> impl gax::paginator::Paginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
938        {
939            use std::clone::Clone;
940            let token = self.0.request.page_token.clone();
941            let execute = move |token: String| {
942                let mut builder = self.clone();
943                builder.0.request = builder.0.request.set_page_token(token);
944                builder.send()
945            };
946            gax::paginator::internal::new_paginator(token, execute)
947        }
948
949        /// Streams each item in the collection.
950        pub fn by_item(
951            self,
952        ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
953        {
954            use gax::paginator::Paginator;
955            self.by_page().items()
956        }
957
958        /// Sets the value of [parent][crate::model::ListBuildTriggersRequest::parent].
959        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
960            self.0.request.parent = v.into();
961            self
962        }
963
964        /// Sets the value of [project_id][crate::model::ListBuildTriggersRequest::project_id].
965        ///
966        /// This is a **required** field for requests.
967        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
968            self.0.request.project_id = v.into();
969            self
970        }
971
972        /// Sets the value of [page_size][crate::model::ListBuildTriggersRequest::page_size].
973        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
974            self.0.request.page_size = v.into();
975            self
976        }
977
978        /// Sets the value of [page_token][crate::model::ListBuildTriggersRequest::page_token].
979        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
980            self.0.request.page_token = v.into();
981            self
982        }
983    }
984
985    #[doc(hidden)]
986    impl gax::options::internal::RequestBuilder for ListBuildTriggers {
987        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
988            &mut self.0.options
989        }
990    }
991
992    /// The request builder for [CloudBuild::delete_build_trigger][crate::client::CloudBuild::delete_build_trigger] calls.
993    ///
994    /// # Example
995    /// ```no_run
996    /// # use google_cloud_build_v1::builder;
997    /// use builder::cloud_build::DeleteBuildTrigger;
998    /// # tokio_test::block_on(async {
999    ///
1000    /// let builder = prepare_request_builder();
1001    /// let response = builder.send().await?;
1002    /// # gax::Result::<()>::Ok(()) });
1003    ///
1004    /// fn prepare_request_builder() -> DeleteBuildTrigger {
1005    ///   # panic!();
1006    ///   // ... details omitted ...
1007    /// }
1008    /// ```
1009    #[derive(Clone, Debug)]
1010    pub struct DeleteBuildTrigger(RequestBuilder<crate::model::DeleteBuildTriggerRequest>);
1011
1012    impl DeleteBuildTrigger {
1013        pub(crate) fn new(
1014            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1015        ) -> Self {
1016            Self(RequestBuilder::new(stub))
1017        }
1018
1019        /// Sets the full request, replacing any prior values.
1020        pub fn with_request<V: Into<crate::model::DeleteBuildTriggerRequest>>(
1021            mut self,
1022            v: V,
1023        ) -> Self {
1024            self.0.request = v.into();
1025            self
1026        }
1027
1028        /// Sets all the options, replacing any prior values.
1029        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1030            self.0.options = v.into();
1031            self
1032        }
1033
1034        /// Sends the request.
1035        pub async fn send(self) -> Result<()> {
1036            (*self.0.stub)
1037                .delete_build_trigger(self.0.request, self.0.options)
1038                .await
1039                .map(gax::response::Response::into_body)
1040        }
1041
1042        /// Sets the value of [name][crate::model::DeleteBuildTriggerRequest::name].
1043        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044            self.0.request.name = v.into();
1045            self
1046        }
1047
1048        /// Sets the value of [project_id][crate::model::DeleteBuildTriggerRequest::project_id].
1049        ///
1050        /// This is a **required** field for requests.
1051        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052            self.0.request.project_id = v.into();
1053            self
1054        }
1055
1056        /// Sets the value of [trigger_id][crate::model::DeleteBuildTriggerRequest::trigger_id].
1057        ///
1058        /// This is a **required** field for requests.
1059        pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060            self.0.request.trigger_id = v.into();
1061            self
1062        }
1063    }
1064
1065    #[doc(hidden)]
1066    impl gax::options::internal::RequestBuilder for DeleteBuildTrigger {
1067        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1068            &mut self.0.options
1069        }
1070    }
1071
1072    /// The request builder for [CloudBuild::update_build_trigger][crate::client::CloudBuild::update_build_trigger] calls.
1073    ///
1074    /// # Example
1075    /// ```no_run
1076    /// # use google_cloud_build_v1::builder;
1077    /// use builder::cloud_build::UpdateBuildTrigger;
1078    /// # tokio_test::block_on(async {
1079    ///
1080    /// let builder = prepare_request_builder();
1081    /// let response = builder.send().await?;
1082    /// # gax::Result::<()>::Ok(()) });
1083    ///
1084    /// fn prepare_request_builder() -> UpdateBuildTrigger {
1085    ///   # panic!();
1086    ///   // ... details omitted ...
1087    /// }
1088    /// ```
1089    #[derive(Clone, Debug)]
1090    pub struct UpdateBuildTrigger(RequestBuilder<crate::model::UpdateBuildTriggerRequest>);
1091
1092    impl UpdateBuildTrigger {
1093        pub(crate) fn new(
1094            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1095        ) -> Self {
1096            Self(RequestBuilder::new(stub))
1097        }
1098
1099        /// Sets the full request, replacing any prior values.
1100        pub fn with_request<V: Into<crate::model::UpdateBuildTriggerRequest>>(
1101            mut self,
1102            v: V,
1103        ) -> Self {
1104            self.0.request = v.into();
1105            self
1106        }
1107
1108        /// Sets all the options, replacing any prior values.
1109        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1110            self.0.options = v.into();
1111            self
1112        }
1113
1114        /// Sends the request.
1115        pub async fn send(self) -> Result<crate::model::BuildTrigger> {
1116            (*self.0.stub)
1117                .update_build_trigger(self.0.request, self.0.options)
1118                .await
1119                .map(gax::response::Response::into_body)
1120        }
1121
1122        /// Sets the value of [project_id][crate::model::UpdateBuildTriggerRequest::project_id].
1123        ///
1124        /// This is a **required** field for requests.
1125        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1126            self.0.request.project_id = v.into();
1127            self
1128        }
1129
1130        /// Sets the value of [trigger_id][crate::model::UpdateBuildTriggerRequest::trigger_id].
1131        ///
1132        /// This is a **required** field for requests.
1133        pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1134            self.0.request.trigger_id = v.into();
1135            self
1136        }
1137
1138        /// Sets the value of [trigger][crate::model::UpdateBuildTriggerRequest::trigger].
1139        ///
1140        /// This is a **required** field for requests.
1141        pub fn set_trigger<T>(mut self, v: T) -> Self
1142        where
1143            T: std::convert::Into<crate::model::BuildTrigger>,
1144        {
1145            self.0.request.trigger = std::option::Option::Some(v.into());
1146            self
1147        }
1148
1149        /// Sets or clears the value of [trigger][crate::model::UpdateBuildTriggerRequest::trigger].
1150        ///
1151        /// This is a **required** field for requests.
1152        pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1153        where
1154            T: std::convert::Into<crate::model::BuildTrigger>,
1155        {
1156            self.0.request.trigger = v.map(|x| x.into());
1157            self
1158        }
1159
1160        /// Sets the value of [update_mask][crate::model::UpdateBuildTriggerRequest::update_mask].
1161        pub fn set_update_mask<T>(mut self, v: T) -> Self
1162        where
1163            T: std::convert::Into<wkt::FieldMask>,
1164        {
1165            self.0.request.update_mask = std::option::Option::Some(v.into());
1166            self
1167        }
1168
1169        /// Sets or clears the value of [update_mask][crate::model::UpdateBuildTriggerRequest::update_mask].
1170        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1171        where
1172            T: std::convert::Into<wkt::FieldMask>,
1173        {
1174            self.0.request.update_mask = v.map(|x| x.into());
1175            self
1176        }
1177    }
1178
1179    #[doc(hidden)]
1180    impl gax::options::internal::RequestBuilder for UpdateBuildTrigger {
1181        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1182            &mut self.0.options
1183        }
1184    }
1185
1186    /// The request builder for [CloudBuild::run_build_trigger][crate::client::CloudBuild::run_build_trigger] calls.
1187    ///
1188    /// # Example
1189    /// ```no_run
1190    /// # use google_cloud_build_v1::builder;
1191    /// use builder::cloud_build::RunBuildTrigger;
1192    /// # tokio_test::block_on(async {
1193    /// use lro::Poller;
1194    ///
1195    /// let builder = prepare_request_builder();
1196    /// let response = builder.poller().until_done().await?;
1197    /// # gax::Result::<()>::Ok(()) });
1198    ///
1199    /// fn prepare_request_builder() -> RunBuildTrigger {
1200    ///   # panic!();
1201    ///   // ... details omitted ...
1202    /// }
1203    /// ```
1204    #[derive(Clone, Debug)]
1205    pub struct RunBuildTrigger(RequestBuilder<crate::model::RunBuildTriggerRequest>);
1206
1207    impl RunBuildTrigger {
1208        pub(crate) fn new(
1209            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1210        ) -> Self {
1211            Self(RequestBuilder::new(stub))
1212        }
1213
1214        /// Sets the full request, replacing any prior values.
1215        pub fn with_request<V: Into<crate::model::RunBuildTriggerRequest>>(mut self, v: V) -> Self {
1216            self.0.request = v.into();
1217            self
1218        }
1219
1220        /// Sets all the options, replacing any prior values.
1221        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1222            self.0.options = v.into();
1223            self
1224        }
1225
1226        /// Sends the request.
1227        ///
1228        /// # Long running operations
1229        ///
1230        /// This starts, but does not poll, a longrunning operation. More information
1231        /// on [run_build_trigger][crate::client::CloudBuild::run_build_trigger].
1232        pub async fn send(self) -> Result<longrunning::model::Operation> {
1233            (*self.0.stub)
1234                .run_build_trigger(self.0.request, self.0.options)
1235                .await
1236                .map(gax::response::Response::into_body)
1237        }
1238
1239        /// Creates a [Poller][lro::Poller] to work with `run_build_trigger`.
1240        pub fn poller(
1241            self,
1242        ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
1243            type Operation =
1244                lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
1245            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1246            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1247
1248            let stub = self.0.stub.clone();
1249            let mut options = self.0.options.clone();
1250            options.set_retry_policy(gax::retry_policy::NeverRetry);
1251            let query = move |name| {
1252                let stub = stub.clone();
1253                let options = options.clone();
1254                async {
1255                    let op = GetOperation::new(stub)
1256                        .set_name(name)
1257                        .with_options(options)
1258                        .send()
1259                        .await?;
1260                    Ok(Operation::new(op))
1261                }
1262            };
1263
1264            let start = move || async {
1265                let op = self.send().await?;
1266                Ok(Operation::new(op))
1267            };
1268
1269            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1270        }
1271
1272        /// Sets the value of [name][crate::model::RunBuildTriggerRequest::name].
1273        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1274            self.0.request.name = v.into();
1275            self
1276        }
1277
1278        /// Sets the value of [project_id][crate::model::RunBuildTriggerRequest::project_id].
1279        ///
1280        /// This is a **required** field for requests.
1281        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1282            self.0.request.project_id = v.into();
1283            self
1284        }
1285
1286        /// Sets the value of [trigger_id][crate::model::RunBuildTriggerRequest::trigger_id].
1287        ///
1288        /// This is a **required** field for requests.
1289        pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1290            self.0.request.trigger_id = v.into();
1291            self
1292        }
1293
1294        /// Sets the value of [source][crate::model::RunBuildTriggerRequest::source].
1295        pub fn set_source<T>(mut self, v: T) -> Self
1296        where
1297            T: std::convert::Into<crate::model::RepoSource>,
1298        {
1299            self.0.request.source = std::option::Option::Some(v.into());
1300            self
1301        }
1302
1303        /// Sets or clears the value of [source][crate::model::RunBuildTriggerRequest::source].
1304        pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
1305        where
1306            T: std::convert::Into<crate::model::RepoSource>,
1307        {
1308            self.0.request.source = v.map(|x| x.into());
1309            self
1310        }
1311    }
1312
1313    #[doc(hidden)]
1314    impl gax::options::internal::RequestBuilder for RunBuildTrigger {
1315        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1316            &mut self.0.options
1317        }
1318    }
1319
1320    /// The request builder for [CloudBuild::receive_trigger_webhook][crate::client::CloudBuild::receive_trigger_webhook] calls.
1321    ///
1322    /// # Example
1323    /// ```no_run
1324    /// # use google_cloud_build_v1::builder;
1325    /// use builder::cloud_build::ReceiveTriggerWebhook;
1326    /// # tokio_test::block_on(async {
1327    ///
1328    /// let builder = prepare_request_builder();
1329    /// let response = builder.send().await?;
1330    /// # gax::Result::<()>::Ok(()) });
1331    ///
1332    /// fn prepare_request_builder() -> ReceiveTriggerWebhook {
1333    ///   # panic!();
1334    ///   // ... details omitted ...
1335    /// }
1336    /// ```
1337    #[derive(Clone, Debug)]
1338    pub struct ReceiveTriggerWebhook(RequestBuilder<crate::model::ReceiveTriggerWebhookRequest>);
1339
1340    impl ReceiveTriggerWebhook {
1341        pub(crate) fn new(
1342            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1343        ) -> Self {
1344            Self(RequestBuilder::new(stub))
1345        }
1346
1347        /// Sets the full request, replacing any prior values.
1348        pub fn with_request<V: Into<crate::model::ReceiveTriggerWebhookRequest>>(
1349            mut self,
1350            v: V,
1351        ) -> Self {
1352            self.0.request = v.into();
1353            self
1354        }
1355
1356        /// Sets all the options, replacing any prior values.
1357        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1358            self.0.options = v.into();
1359            self
1360        }
1361
1362        /// Sends the request.
1363        pub async fn send(self) -> Result<crate::model::ReceiveTriggerWebhookResponse> {
1364            (*self.0.stub)
1365                .receive_trigger_webhook(self.0.request, self.0.options)
1366                .await
1367                .map(gax::response::Response::into_body)
1368        }
1369
1370        /// Sets the value of [name][crate::model::ReceiveTriggerWebhookRequest::name].
1371        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1372            self.0.request.name = v.into();
1373            self
1374        }
1375
1376        /// Sets the value of [body][crate::model::ReceiveTriggerWebhookRequest::body].
1377        pub fn set_body<T>(mut self, v: T) -> Self
1378        where
1379            T: std::convert::Into<api::model::HttpBody>,
1380        {
1381            self.0.request.body = std::option::Option::Some(v.into());
1382            self
1383        }
1384
1385        /// Sets or clears the value of [body][crate::model::ReceiveTriggerWebhookRequest::body].
1386        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1387        where
1388            T: std::convert::Into<api::model::HttpBody>,
1389        {
1390            self.0.request.body = v.map(|x| x.into());
1391            self
1392        }
1393
1394        /// Sets the value of [project_id][crate::model::ReceiveTriggerWebhookRequest::project_id].
1395        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396            self.0.request.project_id = v.into();
1397            self
1398        }
1399
1400        /// Sets the value of [trigger][crate::model::ReceiveTriggerWebhookRequest::trigger].
1401        pub fn set_trigger<T: Into<std::string::String>>(mut self, v: T) -> Self {
1402            self.0.request.trigger = v.into();
1403            self
1404        }
1405
1406        /// Sets the value of [secret][crate::model::ReceiveTriggerWebhookRequest::secret].
1407        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
1408            self.0.request.secret = v.into();
1409            self
1410        }
1411    }
1412
1413    #[doc(hidden)]
1414    impl gax::options::internal::RequestBuilder for ReceiveTriggerWebhook {
1415        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1416            &mut self.0.options
1417        }
1418    }
1419
1420    /// The request builder for [CloudBuild::create_worker_pool][crate::client::CloudBuild::create_worker_pool] calls.
1421    ///
1422    /// # Example
1423    /// ```no_run
1424    /// # use google_cloud_build_v1::builder;
1425    /// use builder::cloud_build::CreateWorkerPool;
1426    /// # tokio_test::block_on(async {
1427    /// use lro::Poller;
1428    ///
1429    /// let builder = prepare_request_builder();
1430    /// let response = builder.poller().until_done().await?;
1431    /// # gax::Result::<()>::Ok(()) });
1432    ///
1433    /// fn prepare_request_builder() -> CreateWorkerPool {
1434    ///   # panic!();
1435    ///   // ... details omitted ...
1436    /// }
1437    /// ```
1438    #[derive(Clone, Debug)]
1439    pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
1440
1441    impl CreateWorkerPool {
1442        pub(crate) fn new(
1443            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1444        ) -> Self {
1445            Self(RequestBuilder::new(stub))
1446        }
1447
1448        /// Sets the full request, replacing any prior values.
1449        pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
1450            mut self,
1451            v: V,
1452        ) -> Self {
1453            self.0.request = v.into();
1454            self
1455        }
1456
1457        /// Sets all the options, replacing any prior values.
1458        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1459            self.0.options = v.into();
1460            self
1461        }
1462
1463        /// Sends the request.
1464        ///
1465        /// # Long running operations
1466        ///
1467        /// This starts, but does not poll, a longrunning operation. More information
1468        /// on [create_worker_pool][crate::client::CloudBuild::create_worker_pool].
1469        pub async fn send(self) -> Result<longrunning::model::Operation> {
1470            (*self.0.stub)
1471                .create_worker_pool(self.0.request, self.0.options)
1472                .await
1473                .map(gax::response::Response::into_body)
1474        }
1475
1476        /// Creates a [Poller][lro::Poller] to work with `create_worker_pool`.
1477        pub fn poller(
1478            self,
1479        ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::CreateWorkerPoolOperationMetadata>
1480        {
1481            type Operation = lro::internal::Operation<
1482                crate::model::WorkerPool,
1483                crate::model::CreateWorkerPoolOperationMetadata,
1484            >;
1485            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1486            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1487
1488            let stub = self.0.stub.clone();
1489            let mut options = self.0.options.clone();
1490            options.set_retry_policy(gax::retry_policy::NeverRetry);
1491            let query = move |name| {
1492                let stub = stub.clone();
1493                let options = options.clone();
1494                async {
1495                    let op = GetOperation::new(stub)
1496                        .set_name(name)
1497                        .with_options(options)
1498                        .send()
1499                        .await?;
1500                    Ok(Operation::new(op))
1501                }
1502            };
1503
1504            let start = move || async {
1505                let op = self.send().await?;
1506                Ok(Operation::new(op))
1507            };
1508
1509            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1510        }
1511
1512        /// Sets the value of [parent][crate::model::CreateWorkerPoolRequest::parent].
1513        ///
1514        /// This is a **required** field for requests.
1515        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1516            self.0.request.parent = v.into();
1517            self
1518        }
1519
1520        /// Sets the value of [worker_pool][crate::model::CreateWorkerPoolRequest::worker_pool].
1521        ///
1522        /// This is a **required** field for requests.
1523        pub fn set_worker_pool<T>(mut self, v: T) -> Self
1524        where
1525            T: std::convert::Into<crate::model::WorkerPool>,
1526        {
1527            self.0.request.worker_pool = std::option::Option::Some(v.into());
1528            self
1529        }
1530
1531        /// Sets or clears the value of [worker_pool][crate::model::CreateWorkerPoolRequest::worker_pool].
1532        ///
1533        /// This is a **required** field for requests.
1534        pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1535        where
1536            T: std::convert::Into<crate::model::WorkerPool>,
1537        {
1538            self.0.request.worker_pool = v.map(|x| x.into());
1539            self
1540        }
1541
1542        /// Sets the value of [worker_pool_id][crate::model::CreateWorkerPoolRequest::worker_pool_id].
1543        ///
1544        /// This is a **required** field for requests.
1545        pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546            self.0.request.worker_pool_id = v.into();
1547            self
1548        }
1549
1550        /// Sets the value of [validate_only][crate::model::CreateWorkerPoolRequest::validate_only].
1551        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1552            self.0.request.validate_only = v.into();
1553            self
1554        }
1555    }
1556
1557    #[doc(hidden)]
1558    impl gax::options::internal::RequestBuilder for CreateWorkerPool {
1559        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1560            &mut self.0.options
1561        }
1562    }
1563
1564    /// The request builder for [CloudBuild::get_worker_pool][crate::client::CloudBuild::get_worker_pool] calls.
1565    ///
1566    /// # Example
1567    /// ```no_run
1568    /// # use google_cloud_build_v1::builder;
1569    /// use builder::cloud_build::GetWorkerPool;
1570    /// # tokio_test::block_on(async {
1571    ///
1572    /// let builder = prepare_request_builder();
1573    /// let response = builder.send().await?;
1574    /// # gax::Result::<()>::Ok(()) });
1575    ///
1576    /// fn prepare_request_builder() -> GetWorkerPool {
1577    ///   # panic!();
1578    ///   // ... details omitted ...
1579    /// }
1580    /// ```
1581    #[derive(Clone, Debug)]
1582    pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
1583
1584    impl GetWorkerPool {
1585        pub(crate) fn new(
1586            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1587        ) -> Self {
1588            Self(RequestBuilder::new(stub))
1589        }
1590
1591        /// Sets the full request, replacing any prior values.
1592        pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
1593            self.0.request = v.into();
1594            self
1595        }
1596
1597        /// Sets all the options, replacing any prior values.
1598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1599            self.0.options = v.into();
1600            self
1601        }
1602
1603        /// Sends the request.
1604        pub async fn send(self) -> Result<crate::model::WorkerPool> {
1605            (*self.0.stub)
1606                .get_worker_pool(self.0.request, self.0.options)
1607                .await
1608                .map(gax::response::Response::into_body)
1609        }
1610
1611        /// Sets the value of [name][crate::model::GetWorkerPoolRequest::name].
1612        ///
1613        /// This is a **required** field for requests.
1614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1615            self.0.request.name = v.into();
1616            self
1617        }
1618    }
1619
1620    #[doc(hidden)]
1621    impl gax::options::internal::RequestBuilder for GetWorkerPool {
1622        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1623            &mut self.0.options
1624        }
1625    }
1626
1627    /// The request builder for [CloudBuild::delete_worker_pool][crate::client::CloudBuild::delete_worker_pool] calls.
1628    ///
1629    /// # Example
1630    /// ```no_run
1631    /// # use google_cloud_build_v1::builder;
1632    /// use builder::cloud_build::DeleteWorkerPool;
1633    /// # tokio_test::block_on(async {
1634    /// use lro::Poller;
1635    ///
1636    /// let builder = prepare_request_builder();
1637    /// let response = builder.poller().until_done().await?;
1638    /// # gax::Result::<()>::Ok(()) });
1639    ///
1640    /// fn prepare_request_builder() -> DeleteWorkerPool {
1641    ///   # panic!();
1642    ///   // ... details omitted ...
1643    /// }
1644    /// ```
1645    #[derive(Clone, Debug)]
1646    pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
1647
1648    impl DeleteWorkerPool {
1649        pub(crate) fn new(
1650            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1651        ) -> Self {
1652            Self(RequestBuilder::new(stub))
1653        }
1654
1655        /// Sets the full request, replacing any prior values.
1656        pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
1657            mut self,
1658            v: V,
1659        ) -> Self {
1660            self.0.request = v.into();
1661            self
1662        }
1663
1664        /// Sets all the options, replacing any prior values.
1665        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1666            self.0.options = v.into();
1667            self
1668        }
1669
1670        /// Sends the request.
1671        ///
1672        /// # Long running operations
1673        ///
1674        /// This starts, but does not poll, a longrunning operation. More information
1675        /// on [delete_worker_pool][crate::client::CloudBuild::delete_worker_pool].
1676        pub async fn send(self) -> Result<longrunning::model::Operation> {
1677            (*self.0.stub)
1678                .delete_worker_pool(self.0.request, self.0.options)
1679                .await
1680                .map(gax::response::Response::into_body)
1681        }
1682
1683        /// Creates a [Poller][lro::Poller] to work with `delete_worker_pool`.
1684        pub fn poller(
1685            self,
1686        ) -> impl lro::Poller<(), crate::model::DeleteWorkerPoolOperationMetadata> {
1687            type Operation = lro::internal::Operation<
1688                wkt::Empty,
1689                crate::model::DeleteWorkerPoolOperationMetadata,
1690            >;
1691            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1692            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1693
1694            let stub = self.0.stub.clone();
1695            let mut options = self.0.options.clone();
1696            options.set_retry_policy(gax::retry_policy::NeverRetry);
1697            let query = move |name| {
1698                let stub = stub.clone();
1699                let options = options.clone();
1700                async {
1701                    let op = GetOperation::new(stub)
1702                        .set_name(name)
1703                        .with_options(options)
1704                        .send()
1705                        .await?;
1706                    Ok(Operation::new(op))
1707                }
1708            };
1709
1710            let start = move || async {
1711                let op = self.send().await?;
1712                Ok(Operation::new(op))
1713            };
1714
1715            lro::internal::new_unit_response_poller(
1716                polling_error_policy,
1717                polling_backoff_policy,
1718                start,
1719                query,
1720            )
1721        }
1722
1723        /// Sets the value of [name][crate::model::DeleteWorkerPoolRequest::name].
1724        ///
1725        /// This is a **required** field for requests.
1726        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1727            self.0.request.name = v.into();
1728            self
1729        }
1730
1731        /// Sets the value of [etag][crate::model::DeleteWorkerPoolRequest::etag].
1732        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1733            self.0.request.etag = v.into();
1734            self
1735        }
1736
1737        /// Sets the value of [allow_missing][crate::model::DeleteWorkerPoolRequest::allow_missing].
1738        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1739            self.0.request.allow_missing = v.into();
1740            self
1741        }
1742
1743        /// Sets the value of [validate_only][crate::model::DeleteWorkerPoolRequest::validate_only].
1744        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1745            self.0.request.validate_only = v.into();
1746            self
1747        }
1748    }
1749
1750    #[doc(hidden)]
1751    impl gax::options::internal::RequestBuilder for DeleteWorkerPool {
1752        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1753            &mut self.0.options
1754        }
1755    }
1756
1757    /// The request builder for [CloudBuild::update_worker_pool][crate::client::CloudBuild::update_worker_pool] calls.
1758    ///
1759    /// # Example
1760    /// ```no_run
1761    /// # use google_cloud_build_v1::builder;
1762    /// use builder::cloud_build::UpdateWorkerPool;
1763    /// # tokio_test::block_on(async {
1764    /// use lro::Poller;
1765    ///
1766    /// let builder = prepare_request_builder();
1767    /// let response = builder.poller().until_done().await?;
1768    /// # gax::Result::<()>::Ok(()) });
1769    ///
1770    /// fn prepare_request_builder() -> UpdateWorkerPool {
1771    ///   # panic!();
1772    ///   // ... details omitted ...
1773    /// }
1774    /// ```
1775    #[derive(Clone, Debug)]
1776    pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
1777
1778    impl UpdateWorkerPool {
1779        pub(crate) fn new(
1780            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1781        ) -> Self {
1782            Self(RequestBuilder::new(stub))
1783        }
1784
1785        /// Sets the full request, replacing any prior values.
1786        pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
1787            mut self,
1788            v: V,
1789        ) -> Self {
1790            self.0.request = v.into();
1791            self
1792        }
1793
1794        /// Sets all the options, replacing any prior values.
1795        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1796            self.0.options = v.into();
1797            self
1798        }
1799
1800        /// Sends the request.
1801        ///
1802        /// # Long running operations
1803        ///
1804        /// This starts, but does not poll, a longrunning operation. More information
1805        /// on [update_worker_pool][crate::client::CloudBuild::update_worker_pool].
1806        pub async fn send(self) -> Result<longrunning::model::Operation> {
1807            (*self.0.stub)
1808                .update_worker_pool(self.0.request, self.0.options)
1809                .await
1810                .map(gax::response::Response::into_body)
1811        }
1812
1813        /// Creates a [Poller][lro::Poller] to work with `update_worker_pool`.
1814        pub fn poller(
1815            self,
1816        ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::UpdateWorkerPoolOperationMetadata>
1817        {
1818            type Operation = lro::internal::Operation<
1819                crate::model::WorkerPool,
1820                crate::model::UpdateWorkerPoolOperationMetadata,
1821            >;
1822            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1823            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1824
1825            let stub = self.0.stub.clone();
1826            let mut options = self.0.options.clone();
1827            options.set_retry_policy(gax::retry_policy::NeverRetry);
1828            let query = move |name| {
1829                let stub = stub.clone();
1830                let options = options.clone();
1831                async {
1832                    let op = GetOperation::new(stub)
1833                        .set_name(name)
1834                        .with_options(options)
1835                        .send()
1836                        .await?;
1837                    Ok(Operation::new(op))
1838                }
1839            };
1840
1841            let start = move || async {
1842                let op = self.send().await?;
1843                Ok(Operation::new(op))
1844            };
1845
1846            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1847        }
1848
1849        /// Sets the value of [worker_pool][crate::model::UpdateWorkerPoolRequest::worker_pool].
1850        ///
1851        /// This is a **required** field for requests.
1852        pub fn set_worker_pool<T>(mut self, v: T) -> Self
1853        where
1854            T: std::convert::Into<crate::model::WorkerPool>,
1855        {
1856            self.0.request.worker_pool = std::option::Option::Some(v.into());
1857            self
1858        }
1859
1860        /// Sets or clears the value of [worker_pool][crate::model::UpdateWorkerPoolRequest::worker_pool].
1861        ///
1862        /// This is a **required** field for requests.
1863        pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1864        where
1865            T: std::convert::Into<crate::model::WorkerPool>,
1866        {
1867            self.0.request.worker_pool = v.map(|x| x.into());
1868            self
1869        }
1870
1871        /// Sets the value of [update_mask][crate::model::UpdateWorkerPoolRequest::update_mask].
1872        pub fn set_update_mask<T>(mut self, v: T) -> Self
1873        where
1874            T: std::convert::Into<wkt::FieldMask>,
1875        {
1876            self.0.request.update_mask = std::option::Option::Some(v.into());
1877            self
1878        }
1879
1880        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkerPoolRequest::update_mask].
1881        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1882        where
1883            T: std::convert::Into<wkt::FieldMask>,
1884        {
1885            self.0.request.update_mask = v.map(|x| x.into());
1886            self
1887        }
1888
1889        /// Sets the value of [validate_only][crate::model::UpdateWorkerPoolRequest::validate_only].
1890        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1891            self.0.request.validate_only = v.into();
1892            self
1893        }
1894    }
1895
1896    #[doc(hidden)]
1897    impl gax::options::internal::RequestBuilder for UpdateWorkerPool {
1898        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1899            &mut self.0.options
1900        }
1901    }
1902
1903    /// The request builder for [CloudBuild::list_worker_pools][crate::client::CloudBuild::list_worker_pools] calls.
1904    ///
1905    /// # Example
1906    /// ```no_run
1907    /// # use google_cloud_build_v1::builder;
1908    /// use builder::cloud_build::ListWorkerPools;
1909    /// # tokio_test::block_on(async {
1910    /// use gax::paginator::ItemPaginator;
1911    ///
1912    /// let builder = prepare_request_builder();
1913    /// let mut items = builder.by_item();
1914    /// while let Some(result) = items.next().await {
1915    ///   let item = result?;
1916    /// }
1917    /// # gax::Result::<()>::Ok(()) });
1918    ///
1919    /// fn prepare_request_builder() -> ListWorkerPools {
1920    ///   # panic!();
1921    ///   // ... details omitted ...
1922    /// }
1923    /// ```
1924    #[derive(Clone, Debug)]
1925    pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
1926
1927    impl ListWorkerPools {
1928        pub(crate) fn new(
1929            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1930        ) -> Self {
1931            Self(RequestBuilder::new(stub))
1932        }
1933
1934        /// Sets the full request, replacing any prior values.
1935        pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
1936            self.0.request = v.into();
1937            self
1938        }
1939
1940        /// Sets all the options, replacing any prior values.
1941        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1942            self.0.options = v.into();
1943            self
1944        }
1945
1946        /// Sends the request.
1947        pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
1948            (*self.0.stub)
1949                .list_worker_pools(self.0.request, self.0.options)
1950                .await
1951                .map(gax::response::Response::into_body)
1952        }
1953
1954        /// Streams each page in the collection.
1955        pub fn by_page(
1956            self,
1957        ) -> impl gax::paginator::Paginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1958        {
1959            use std::clone::Clone;
1960            let token = self.0.request.page_token.clone();
1961            let execute = move |token: String| {
1962                let mut builder = self.clone();
1963                builder.0.request = builder.0.request.set_page_token(token);
1964                builder.send()
1965            };
1966            gax::paginator::internal::new_paginator(token, execute)
1967        }
1968
1969        /// Streams each item in the collection.
1970        pub fn by_item(
1971            self,
1972        ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1973        {
1974            use gax::paginator::Paginator;
1975            self.by_page().items()
1976        }
1977
1978        /// Sets the value of [parent][crate::model::ListWorkerPoolsRequest::parent].
1979        ///
1980        /// This is a **required** field for requests.
1981        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1982            self.0.request.parent = v.into();
1983            self
1984        }
1985
1986        /// Sets the value of [page_size][crate::model::ListWorkerPoolsRequest::page_size].
1987        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1988            self.0.request.page_size = v.into();
1989            self
1990        }
1991
1992        /// Sets the value of [page_token][crate::model::ListWorkerPoolsRequest::page_token].
1993        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1994            self.0.request.page_token = v.into();
1995            self
1996        }
1997    }
1998
1999    #[doc(hidden)]
2000    impl gax::options::internal::RequestBuilder for ListWorkerPools {
2001        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2002            &mut self.0.options
2003        }
2004    }
2005
2006    /// The request builder for [CloudBuild::get_default_service_account][crate::client::CloudBuild::get_default_service_account] calls.
2007    ///
2008    /// # Example
2009    /// ```no_run
2010    /// # use google_cloud_build_v1::builder;
2011    /// use builder::cloud_build::GetDefaultServiceAccount;
2012    /// # tokio_test::block_on(async {
2013    ///
2014    /// let builder = prepare_request_builder();
2015    /// let response = builder.send().await?;
2016    /// # gax::Result::<()>::Ok(()) });
2017    ///
2018    /// fn prepare_request_builder() -> GetDefaultServiceAccount {
2019    ///   # panic!();
2020    ///   // ... details omitted ...
2021    /// }
2022    /// ```
2023    #[derive(Clone, Debug)]
2024    pub struct GetDefaultServiceAccount(
2025        RequestBuilder<crate::model::GetDefaultServiceAccountRequest>,
2026    );
2027
2028    impl GetDefaultServiceAccount {
2029        pub(crate) fn new(
2030            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2031        ) -> Self {
2032            Self(RequestBuilder::new(stub))
2033        }
2034
2035        /// Sets the full request, replacing any prior values.
2036        pub fn with_request<V: Into<crate::model::GetDefaultServiceAccountRequest>>(
2037            mut self,
2038            v: V,
2039        ) -> Self {
2040            self.0.request = v.into();
2041            self
2042        }
2043
2044        /// Sets all the options, replacing any prior values.
2045        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2046            self.0.options = v.into();
2047            self
2048        }
2049
2050        /// Sends the request.
2051        pub async fn send(self) -> Result<crate::model::DefaultServiceAccount> {
2052            (*self.0.stub)
2053                .get_default_service_account(self.0.request, self.0.options)
2054                .await
2055                .map(gax::response::Response::into_body)
2056        }
2057
2058        /// Sets the value of [name][crate::model::GetDefaultServiceAccountRequest::name].
2059        ///
2060        /// This is a **required** field for requests.
2061        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062            self.0.request.name = v.into();
2063            self
2064        }
2065    }
2066
2067    #[doc(hidden)]
2068    impl gax::options::internal::RequestBuilder for GetDefaultServiceAccount {
2069        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2070            &mut self.0.options
2071        }
2072    }
2073
2074    /// The request builder for [CloudBuild::get_operation][crate::client::CloudBuild::get_operation] calls.
2075    ///
2076    /// # Example
2077    /// ```no_run
2078    /// # use google_cloud_build_v1::builder;
2079    /// use builder::cloud_build::GetOperation;
2080    /// # tokio_test::block_on(async {
2081    ///
2082    /// let builder = prepare_request_builder();
2083    /// let response = builder.send().await?;
2084    /// # gax::Result::<()>::Ok(()) });
2085    ///
2086    /// fn prepare_request_builder() -> GetOperation {
2087    ///   # panic!();
2088    ///   // ... details omitted ...
2089    /// }
2090    /// ```
2091    #[derive(Clone, Debug)]
2092    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2093
2094    impl GetOperation {
2095        pub(crate) fn new(
2096            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2097        ) -> Self {
2098            Self(RequestBuilder::new(stub))
2099        }
2100
2101        /// Sets the full request, replacing any prior values.
2102        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2103            mut self,
2104            v: V,
2105        ) -> Self {
2106            self.0.request = v.into();
2107            self
2108        }
2109
2110        /// Sets all the options, replacing any prior values.
2111        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2112            self.0.options = v.into();
2113            self
2114        }
2115
2116        /// Sends the request.
2117        pub async fn send(self) -> Result<longrunning::model::Operation> {
2118            (*self.0.stub)
2119                .get_operation(self.0.request, self.0.options)
2120                .await
2121                .map(gax::response::Response::into_body)
2122        }
2123
2124        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2125        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2126            self.0.request.name = v.into();
2127            self
2128        }
2129    }
2130
2131    #[doc(hidden)]
2132    impl gax::options::internal::RequestBuilder for GetOperation {
2133        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2134            &mut self.0.options
2135        }
2136    }
2137
2138    /// The request builder for [CloudBuild::cancel_operation][crate::client::CloudBuild::cancel_operation] calls.
2139    ///
2140    /// # Example
2141    /// ```no_run
2142    /// # use google_cloud_build_v1::builder;
2143    /// use builder::cloud_build::CancelOperation;
2144    /// # tokio_test::block_on(async {
2145    ///
2146    /// let builder = prepare_request_builder();
2147    /// let response = builder.send().await?;
2148    /// # gax::Result::<()>::Ok(()) });
2149    ///
2150    /// fn prepare_request_builder() -> CancelOperation {
2151    ///   # panic!();
2152    ///   // ... details omitted ...
2153    /// }
2154    /// ```
2155    #[derive(Clone, Debug)]
2156    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2157
2158    impl CancelOperation {
2159        pub(crate) fn new(
2160            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2161        ) -> Self {
2162            Self(RequestBuilder::new(stub))
2163        }
2164
2165        /// Sets the full request, replacing any prior values.
2166        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2167            mut self,
2168            v: V,
2169        ) -> Self {
2170            self.0.request = v.into();
2171            self
2172        }
2173
2174        /// Sets all the options, replacing any prior values.
2175        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2176            self.0.options = v.into();
2177            self
2178        }
2179
2180        /// Sends the request.
2181        pub async fn send(self) -> Result<()> {
2182            (*self.0.stub)
2183                .cancel_operation(self.0.request, self.0.options)
2184                .await
2185                .map(gax::response::Response::into_body)
2186        }
2187
2188        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2189        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190            self.0.request.name = v.into();
2191            self
2192        }
2193    }
2194
2195    #[doc(hidden)]
2196    impl gax::options::internal::RequestBuilder for CancelOperation {
2197        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2198            &mut self.0.options
2199        }
2200    }
2201}