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