Skip to main content

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