google_cloud_run_v2/
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 builds {
18    use crate::Result;
19
20    /// A builder for [Builds][crate::client::Builds].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_run_v2::*;
25    /// # use builder::builds::ClientBuilder;
26    /// # use client::Builds;
27    /// let builder : ClientBuilder = Builds::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://run.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Builds;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = Builds;
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::Builds] 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::Builds>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: gax::options::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [Builds::submit_build][crate::client::Builds::submit_build] calls.
73    ///
74    /// # Example
75    /// ```no_run
76    /// # use google_cloud_run_v2::builder;
77    /// use builder::builds::SubmitBuild;
78    /// # tokio_test::block_on(async {
79    ///
80    /// let builder = prepare_request_builder();
81    /// let response = builder.send().await?;
82    /// # gax::Result::<()>::Ok(()) });
83    ///
84    /// fn prepare_request_builder() -> SubmitBuild {
85    ///   # panic!();
86    ///   // ... details omitted ...
87    /// }
88    /// ```
89    #[derive(Clone, Debug)]
90    pub struct SubmitBuild(RequestBuilder<crate::model::SubmitBuildRequest>);
91
92    impl SubmitBuild {
93        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
94            Self(RequestBuilder::new(stub))
95        }
96
97        /// Sets the full request, replacing any prior values.
98        pub fn with_request<V: Into<crate::model::SubmitBuildRequest>>(mut self, v: V) -> Self {
99            self.0.request = v.into();
100            self
101        }
102
103        /// Sets all the options, replacing any prior values.
104        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105            self.0.options = v.into();
106            self
107        }
108
109        /// Sends the request.
110        pub async fn send(self) -> Result<crate::model::SubmitBuildResponse> {
111            (*self.0.stub)
112                .submit_build(self.0.request, self.0.options)
113                .await
114                .map(gax::response::Response::into_body)
115        }
116
117        /// Sets the value of [parent][crate::model::SubmitBuildRequest::parent].
118        ///
119        /// This is a **required** field for requests.
120        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121            self.0.request.parent = v.into();
122            self
123        }
124
125        /// Sets the value of [image_uri][crate::model::SubmitBuildRequest::image_uri].
126        ///
127        /// This is a **required** field for requests.
128        pub fn set_image_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
129            self.0.request.image_uri = v.into();
130            self
131        }
132
133        /// Sets the value of [service_account][crate::model::SubmitBuildRequest::service_account].
134        pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
135            self.0.request.service_account = v.into();
136            self
137        }
138
139        /// Sets the value of [worker_pool][crate::model::SubmitBuildRequest::worker_pool].
140        pub fn set_worker_pool<T: Into<std::string::String>>(mut self, v: T) -> Self {
141            self.0.request.worker_pool = v.into();
142            self
143        }
144
145        /// Sets the value of [tags][crate::model::SubmitBuildRequest::tags].
146        pub fn set_tags<T, V>(mut self, v: T) -> Self
147        where
148            T: std::iter::IntoIterator<Item = V>,
149            V: std::convert::Into<std::string::String>,
150        {
151            use std::iter::Iterator;
152            self.0.request.tags = v.into_iter().map(|i| i.into()).collect();
153            self
154        }
155
156        /// Sets the value of [source][crate::model::SubmitBuildRequest::source].
157        ///
158        /// Note that all the setters affecting `source` are
159        /// mutually exclusive.
160        pub fn set_source<T: Into<Option<crate::model::submit_build_request::Source>>>(
161            mut self,
162            v: T,
163        ) -> Self {
164            self.0.request.source = v.into();
165            self
166        }
167
168        /// Sets the value of [source][crate::model::SubmitBuildRequest::source]
169        /// to hold a `StorageSource`.
170        ///
171        /// Note that all the setters affecting `source` are
172        /// mutually exclusive.
173        pub fn set_storage_source<
174            T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
175        >(
176            mut self,
177            v: T,
178        ) -> Self {
179            self.0.request = self.0.request.set_storage_source(v);
180            self
181        }
182
183        /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type].
184        ///
185        /// Note that all the setters affecting `build_type` are
186        /// mutually exclusive.
187        pub fn set_build_type<T: Into<Option<crate::model::submit_build_request::BuildType>>>(
188            mut self,
189            v: T,
190        ) -> Self {
191            self.0.request.build_type = v.into();
192            self
193        }
194
195        /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
196        /// to hold a `BuildpackBuild`.
197        ///
198        /// Note that all the setters affecting `build_type` are
199        /// mutually exclusive.
200        pub fn set_buildpack_build<
201            T: std::convert::Into<
202                    std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>,
203                >,
204        >(
205            mut self,
206            v: T,
207        ) -> Self {
208            self.0.request = self.0.request.set_buildpack_build(v);
209            self
210        }
211
212        /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
213        /// to hold a `DockerBuild`.
214        ///
215        /// Note that all the setters affecting `build_type` are
216        /// mutually exclusive.
217        pub fn set_docker_build<
218            T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
219        >(
220            mut self,
221            v: T,
222        ) -> Self {
223            self.0.request = self.0.request.set_docker_build(v);
224            self
225        }
226    }
227
228    #[doc(hidden)]
229    impl gax::options::internal::RequestBuilder for SubmitBuild {
230        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
231            &mut self.0.options
232        }
233    }
234
235    /// The request builder for [Builds::list_operations][crate::client::Builds::list_operations] calls.
236    ///
237    /// # Example
238    /// ```no_run
239    /// # use google_cloud_run_v2::builder;
240    /// use builder::builds::ListOperations;
241    /// # tokio_test::block_on(async {
242    /// use gax::paginator::ItemPaginator;
243    ///
244    /// let builder = prepare_request_builder();
245    /// let mut items = builder.by_item();
246    /// while let Some(result) = items.next().await {
247    ///   let item = result?;
248    /// }
249    /// # gax::Result::<()>::Ok(()) });
250    ///
251    /// fn prepare_request_builder() -> ListOperations {
252    ///   # panic!();
253    ///   // ... details omitted ...
254    /// }
255    /// ```
256    #[derive(Clone, Debug)]
257    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
258
259    impl ListOperations {
260        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
261            Self(RequestBuilder::new(stub))
262        }
263
264        /// Sets the full request, replacing any prior values.
265        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
266            mut self,
267            v: V,
268        ) -> Self {
269            self.0.request = v.into();
270            self
271        }
272
273        /// Sets all the options, replacing any prior values.
274        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
275            self.0.options = v.into();
276            self
277        }
278
279        /// Sends the request.
280        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
281            (*self.0.stub)
282                .list_operations(self.0.request, self.0.options)
283                .await
284                .map(gax::response::Response::into_body)
285        }
286
287        /// Streams each page in the collection.
288        pub fn by_page(
289            self,
290        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
291        {
292            use std::clone::Clone;
293            let token = self.0.request.page_token.clone();
294            let execute = move |token: String| {
295                let mut builder = self.clone();
296                builder.0.request = builder.0.request.set_page_token(token);
297                builder.send()
298            };
299            gax::paginator::internal::new_paginator(token, execute)
300        }
301
302        /// Streams each item in the collection.
303        pub fn by_item(
304            self,
305        ) -> impl gax::paginator::ItemPaginator<
306            longrunning::model::ListOperationsResponse,
307            gax::error::Error,
308        > {
309            use gax::paginator::Paginator;
310            self.by_page().items()
311        }
312
313        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
314        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
315            self.0.request.name = v.into();
316            self
317        }
318
319        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
320        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
321            self.0.request.filter = v.into();
322            self
323        }
324
325        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
326        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
327            self.0.request.page_size = v.into();
328            self
329        }
330
331        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
332        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
333            self.0.request.page_token = v.into();
334            self
335        }
336    }
337
338    #[doc(hidden)]
339    impl gax::options::internal::RequestBuilder for ListOperations {
340        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
341            &mut self.0.options
342        }
343    }
344
345    /// The request builder for [Builds::get_operation][crate::client::Builds::get_operation] calls.
346    ///
347    /// # Example
348    /// ```no_run
349    /// # use google_cloud_run_v2::builder;
350    /// use builder::builds::GetOperation;
351    /// # tokio_test::block_on(async {
352    ///
353    /// let builder = prepare_request_builder();
354    /// let response = builder.send().await?;
355    /// # gax::Result::<()>::Ok(()) });
356    ///
357    /// fn prepare_request_builder() -> GetOperation {
358    ///   # panic!();
359    ///   // ... details omitted ...
360    /// }
361    /// ```
362    #[derive(Clone, Debug)]
363    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
364
365    impl GetOperation {
366        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
367            Self(RequestBuilder::new(stub))
368        }
369
370        /// Sets the full request, replacing any prior values.
371        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
372            mut self,
373            v: V,
374        ) -> Self {
375            self.0.request = v.into();
376            self
377        }
378
379        /// Sets all the options, replacing any prior values.
380        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
381            self.0.options = v.into();
382            self
383        }
384
385        /// Sends the request.
386        pub async fn send(self) -> Result<longrunning::model::Operation> {
387            (*self.0.stub)
388                .get_operation(self.0.request, self.0.options)
389                .await
390                .map(gax::response::Response::into_body)
391        }
392
393        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
394        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
395            self.0.request.name = v.into();
396            self
397        }
398    }
399
400    #[doc(hidden)]
401    impl gax::options::internal::RequestBuilder for GetOperation {
402        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403            &mut self.0.options
404        }
405    }
406
407    /// The request builder for [Builds::delete_operation][crate::client::Builds::delete_operation] calls.
408    ///
409    /// # Example
410    /// ```no_run
411    /// # use google_cloud_run_v2::builder;
412    /// use builder::builds::DeleteOperation;
413    /// # tokio_test::block_on(async {
414    ///
415    /// let builder = prepare_request_builder();
416    /// let response = builder.send().await?;
417    /// # gax::Result::<()>::Ok(()) });
418    ///
419    /// fn prepare_request_builder() -> DeleteOperation {
420    ///   # panic!();
421    ///   // ... details omitted ...
422    /// }
423    /// ```
424    #[derive(Clone, Debug)]
425    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
426
427    impl DeleteOperation {
428        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
429            Self(RequestBuilder::new(stub))
430        }
431
432        /// Sets the full request, replacing any prior values.
433        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
434            mut self,
435            v: V,
436        ) -> Self {
437            self.0.request = v.into();
438            self
439        }
440
441        /// Sets all the options, replacing any prior values.
442        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
443            self.0.options = v.into();
444            self
445        }
446
447        /// Sends the request.
448        pub async fn send(self) -> Result<()> {
449            (*self.0.stub)
450                .delete_operation(self.0.request, self.0.options)
451                .await
452                .map(gax::response::Response::into_body)
453        }
454
455        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
456        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
457            self.0.request.name = v.into();
458            self
459        }
460    }
461
462    #[doc(hidden)]
463    impl gax::options::internal::RequestBuilder for DeleteOperation {
464        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
465            &mut self.0.options
466        }
467    }
468
469    /// The request builder for [Builds::wait_operation][crate::client::Builds::wait_operation] calls.
470    ///
471    /// # Example
472    /// ```no_run
473    /// # use google_cloud_run_v2::builder;
474    /// use builder::builds::WaitOperation;
475    /// # tokio_test::block_on(async {
476    ///
477    /// let builder = prepare_request_builder();
478    /// let response = builder.send().await?;
479    /// # gax::Result::<()>::Ok(()) });
480    ///
481    /// fn prepare_request_builder() -> WaitOperation {
482    ///   # panic!();
483    ///   // ... details omitted ...
484    /// }
485    /// ```
486    #[derive(Clone, Debug)]
487    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
488
489    impl WaitOperation {
490        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
491            Self(RequestBuilder::new(stub))
492        }
493
494        /// Sets the full request, replacing any prior values.
495        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
496            mut self,
497            v: V,
498        ) -> Self {
499            self.0.request = v.into();
500            self
501        }
502
503        /// Sets all the options, replacing any prior values.
504        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
505            self.0.options = v.into();
506            self
507        }
508
509        /// Sends the request.
510        pub async fn send(self) -> Result<longrunning::model::Operation> {
511            (*self.0.stub)
512                .wait_operation(self.0.request, self.0.options)
513                .await
514                .map(gax::response::Response::into_body)
515        }
516
517        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
518        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
519            self.0.request.name = v.into();
520            self
521        }
522
523        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
524        pub fn set_timeout<T>(mut self, v: T) -> Self
525        where
526            T: std::convert::Into<wkt::Duration>,
527        {
528            self.0.request.timeout = std::option::Option::Some(v.into());
529            self
530        }
531
532        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
533        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
534        where
535            T: std::convert::Into<wkt::Duration>,
536        {
537            self.0.request.timeout = v.map(|x| x.into());
538            self
539        }
540    }
541
542    #[doc(hidden)]
543    impl gax::options::internal::RequestBuilder for WaitOperation {
544        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
545            &mut self.0.options
546        }
547    }
548}
549
550pub mod executions {
551    use crate::Result;
552
553    /// A builder for [Executions][crate::client::Executions].
554    ///
555    /// ```
556    /// # tokio_test::block_on(async {
557    /// # use google_cloud_run_v2::*;
558    /// # use builder::executions::ClientBuilder;
559    /// # use client::Executions;
560    /// let builder : ClientBuilder = Executions::builder();
561    /// let client = builder
562    ///     .with_endpoint("https://run.googleapis.com")
563    ///     .build().await?;
564    /// # gax::client_builder::Result::<()>::Ok(()) });
565    /// ```
566    pub type ClientBuilder =
567        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
568
569    pub(crate) mod client {
570        use super::super::super::client::Executions;
571        pub struct Factory;
572        impl gax::client_builder::internal::ClientFactory for Factory {
573            type Client = Executions;
574            type Credentials = gaxi::options::Credentials;
575            async fn build(
576                self,
577                config: gaxi::options::ClientConfig,
578            ) -> gax::client_builder::Result<Self::Client> {
579                Self::Client::new(config).await
580            }
581        }
582    }
583
584    /// Common implementation for [crate::client::Executions] request builders.
585    #[derive(Clone, Debug)]
586    pub(crate) struct RequestBuilder<R: std::default::Default> {
587        stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
588        request: R,
589        options: gax::options::RequestOptions,
590    }
591
592    impl<R> RequestBuilder<R>
593    where
594        R: std::default::Default,
595    {
596        pub(crate) fn new(
597            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
598        ) -> Self {
599            Self {
600                stub,
601                request: R::default(),
602                options: gax::options::RequestOptions::default(),
603            }
604        }
605    }
606
607    /// The request builder for [Executions::get_execution][crate::client::Executions::get_execution] calls.
608    ///
609    /// # Example
610    /// ```no_run
611    /// # use google_cloud_run_v2::builder;
612    /// use builder::executions::GetExecution;
613    /// # tokio_test::block_on(async {
614    ///
615    /// let builder = prepare_request_builder();
616    /// let response = builder.send().await?;
617    /// # gax::Result::<()>::Ok(()) });
618    ///
619    /// fn prepare_request_builder() -> GetExecution {
620    ///   # panic!();
621    ///   // ... details omitted ...
622    /// }
623    /// ```
624    #[derive(Clone, Debug)]
625    pub struct GetExecution(RequestBuilder<crate::model::GetExecutionRequest>);
626
627    impl GetExecution {
628        pub(crate) fn new(
629            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
630        ) -> Self {
631            Self(RequestBuilder::new(stub))
632        }
633
634        /// Sets the full request, replacing any prior values.
635        pub fn with_request<V: Into<crate::model::GetExecutionRequest>>(mut self, v: V) -> Self {
636            self.0.request = v.into();
637            self
638        }
639
640        /// Sets all the options, replacing any prior values.
641        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
642            self.0.options = v.into();
643            self
644        }
645
646        /// Sends the request.
647        pub async fn send(self) -> Result<crate::model::Execution> {
648            (*self.0.stub)
649                .get_execution(self.0.request, self.0.options)
650                .await
651                .map(gax::response::Response::into_body)
652        }
653
654        /// Sets the value of [name][crate::model::GetExecutionRequest::name].
655        ///
656        /// This is a **required** field for requests.
657        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
658            self.0.request.name = v.into();
659            self
660        }
661    }
662
663    #[doc(hidden)]
664    impl gax::options::internal::RequestBuilder for GetExecution {
665        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
666            &mut self.0.options
667        }
668    }
669
670    /// The request builder for [Executions::list_executions][crate::client::Executions::list_executions] calls.
671    ///
672    /// # Example
673    /// ```no_run
674    /// # use google_cloud_run_v2::builder;
675    /// use builder::executions::ListExecutions;
676    /// # tokio_test::block_on(async {
677    /// use gax::paginator::ItemPaginator;
678    ///
679    /// let builder = prepare_request_builder();
680    /// let mut items = builder.by_item();
681    /// while let Some(result) = items.next().await {
682    ///   let item = result?;
683    /// }
684    /// # gax::Result::<()>::Ok(()) });
685    ///
686    /// fn prepare_request_builder() -> ListExecutions {
687    ///   # panic!();
688    ///   // ... details omitted ...
689    /// }
690    /// ```
691    #[derive(Clone, Debug)]
692    pub struct ListExecutions(RequestBuilder<crate::model::ListExecutionsRequest>);
693
694    impl ListExecutions {
695        pub(crate) fn new(
696            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
697        ) -> Self {
698            Self(RequestBuilder::new(stub))
699        }
700
701        /// Sets the full request, replacing any prior values.
702        pub fn with_request<V: Into<crate::model::ListExecutionsRequest>>(mut self, v: V) -> Self {
703            self.0.request = v.into();
704            self
705        }
706
707        /// Sets all the options, replacing any prior values.
708        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
709            self.0.options = v.into();
710            self
711        }
712
713        /// Sends the request.
714        pub async fn send(self) -> Result<crate::model::ListExecutionsResponse> {
715            (*self.0.stub)
716                .list_executions(self.0.request, self.0.options)
717                .await
718                .map(gax::response::Response::into_body)
719        }
720
721        /// Streams each page in the collection.
722        pub fn by_page(
723            self,
724        ) -> impl gax::paginator::Paginator<crate::model::ListExecutionsResponse, gax::error::Error>
725        {
726            use std::clone::Clone;
727            let token = self.0.request.page_token.clone();
728            let execute = move |token: String| {
729                let mut builder = self.clone();
730                builder.0.request = builder.0.request.set_page_token(token);
731                builder.send()
732            };
733            gax::paginator::internal::new_paginator(token, execute)
734        }
735
736        /// Streams each item in the collection.
737        pub fn by_item(
738            self,
739        ) -> impl gax::paginator::ItemPaginator<crate::model::ListExecutionsResponse, gax::error::Error>
740        {
741            use gax::paginator::Paginator;
742            self.by_page().items()
743        }
744
745        /// Sets the value of [parent][crate::model::ListExecutionsRequest::parent].
746        ///
747        /// This is a **required** field for requests.
748        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
749            self.0.request.parent = v.into();
750            self
751        }
752
753        /// Sets the value of [page_size][crate::model::ListExecutionsRequest::page_size].
754        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
755            self.0.request.page_size = v.into();
756            self
757        }
758
759        /// Sets the value of [page_token][crate::model::ListExecutionsRequest::page_token].
760        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
761            self.0.request.page_token = v.into();
762            self
763        }
764
765        /// Sets the value of [show_deleted][crate::model::ListExecutionsRequest::show_deleted].
766        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
767            self.0.request.show_deleted = v.into();
768            self
769        }
770    }
771
772    #[doc(hidden)]
773    impl gax::options::internal::RequestBuilder for ListExecutions {
774        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
775            &mut self.0.options
776        }
777    }
778
779    /// The request builder for [Executions::delete_execution][crate::client::Executions::delete_execution] calls.
780    ///
781    /// # Example
782    /// ```no_run
783    /// # use google_cloud_run_v2::builder;
784    /// use builder::executions::DeleteExecution;
785    /// # tokio_test::block_on(async {
786    /// use lro::Poller;
787    ///
788    /// let builder = prepare_request_builder();
789    /// let response = builder.poller().until_done().await?;
790    /// # gax::Result::<()>::Ok(()) });
791    ///
792    /// fn prepare_request_builder() -> DeleteExecution {
793    ///   # panic!();
794    ///   // ... details omitted ...
795    /// }
796    /// ```
797    #[derive(Clone, Debug)]
798    pub struct DeleteExecution(RequestBuilder<crate::model::DeleteExecutionRequest>);
799
800    impl DeleteExecution {
801        pub(crate) fn new(
802            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
803        ) -> Self {
804            Self(RequestBuilder::new(stub))
805        }
806
807        /// Sets the full request, replacing any prior values.
808        pub fn with_request<V: Into<crate::model::DeleteExecutionRequest>>(mut self, v: V) -> Self {
809            self.0.request = v.into();
810            self
811        }
812
813        /// Sets all the options, replacing any prior values.
814        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
815            self.0.options = v.into();
816            self
817        }
818
819        /// Sends the request.
820        ///
821        /// # Long running operations
822        ///
823        /// This starts, but does not poll, a longrunning operation. More information
824        /// on [delete_execution][crate::client::Executions::delete_execution].
825        pub async fn send(self) -> Result<longrunning::model::Operation> {
826            (*self.0.stub)
827                .delete_execution(self.0.request, self.0.options)
828                .await
829                .map(gax::response::Response::into_body)
830        }
831
832        /// Creates a [Poller][lro::Poller] to work with `delete_execution`.
833        pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
834            type Operation =
835                lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
836            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
837            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
838
839            let stub = self.0.stub.clone();
840            let mut options = self.0.options.clone();
841            options.set_retry_policy(gax::retry_policy::NeverRetry);
842            let query = move |name| {
843                let stub = stub.clone();
844                let options = options.clone();
845                async {
846                    let op = GetOperation::new(stub)
847                        .set_name(name)
848                        .with_options(options)
849                        .send()
850                        .await?;
851                    Ok(Operation::new(op))
852                }
853            };
854
855            let start = move || async {
856                let op = self.send().await?;
857                Ok(Operation::new(op))
858            };
859
860            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
861        }
862
863        /// Sets the value of [name][crate::model::DeleteExecutionRequest::name].
864        ///
865        /// This is a **required** field for requests.
866        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
867            self.0.request.name = v.into();
868            self
869        }
870
871        /// Sets the value of [validate_only][crate::model::DeleteExecutionRequest::validate_only].
872        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
873            self.0.request.validate_only = v.into();
874            self
875        }
876
877        /// Sets the value of [etag][crate::model::DeleteExecutionRequest::etag].
878        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
879            self.0.request.etag = v.into();
880            self
881        }
882    }
883
884    #[doc(hidden)]
885    impl gax::options::internal::RequestBuilder for DeleteExecution {
886        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
887            &mut self.0.options
888        }
889    }
890
891    /// The request builder for [Executions::cancel_execution][crate::client::Executions::cancel_execution] calls.
892    ///
893    /// # Example
894    /// ```no_run
895    /// # use google_cloud_run_v2::builder;
896    /// use builder::executions::CancelExecution;
897    /// # tokio_test::block_on(async {
898    /// use lro::Poller;
899    ///
900    /// let builder = prepare_request_builder();
901    /// let response = builder.poller().until_done().await?;
902    /// # gax::Result::<()>::Ok(()) });
903    ///
904    /// fn prepare_request_builder() -> CancelExecution {
905    ///   # panic!();
906    ///   // ... details omitted ...
907    /// }
908    /// ```
909    #[derive(Clone, Debug)]
910    pub struct CancelExecution(RequestBuilder<crate::model::CancelExecutionRequest>);
911
912    impl CancelExecution {
913        pub(crate) fn new(
914            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
915        ) -> Self {
916            Self(RequestBuilder::new(stub))
917        }
918
919        /// Sets the full request, replacing any prior values.
920        pub fn with_request<V: Into<crate::model::CancelExecutionRequest>>(mut self, v: V) -> Self {
921            self.0.request = v.into();
922            self
923        }
924
925        /// Sets all the options, replacing any prior values.
926        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
927            self.0.options = v.into();
928            self
929        }
930
931        /// Sends the request.
932        ///
933        /// # Long running operations
934        ///
935        /// This starts, but does not poll, a longrunning operation. More information
936        /// on [cancel_execution][crate::client::Executions::cancel_execution].
937        pub async fn send(self) -> Result<longrunning::model::Operation> {
938            (*self.0.stub)
939                .cancel_execution(self.0.request, self.0.options)
940                .await
941                .map(gax::response::Response::into_body)
942        }
943
944        /// Creates a [Poller][lro::Poller] to work with `cancel_execution`.
945        pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
946            type Operation =
947                lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
948            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
949            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
950
951            let stub = self.0.stub.clone();
952            let mut options = self.0.options.clone();
953            options.set_retry_policy(gax::retry_policy::NeverRetry);
954            let query = move |name| {
955                let stub = stub.clone();
956                let options = options.clone();
957                async {
958                    let op = GetOperation::new(stub)
959                        .set_name(name)
960                        .with_options(options)
961                        .send()
962                        .await?;
963                    Ok(Operation::new(op))
964                }
965            };
966
967            let start = move || async {
968                let op = self.send().await?;
969                Ok(Operation::new(op))
970            };
971
972            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
973        }
974
975        /// Sets the value of [name][crate::model::CancelExecutionRequest::name].
976        ///
977        /// This is a **required** field for requests.
978        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
979            self.0.request.name = v.into();
980            self
981        }
982
983        /// Sets the value of [validate_only][crate::model::CancelExecutionRequest::validate_only].
984        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
985            self.0.request.validate_only = v.into();
986            self
987        }
988
989        /// Sets the value of [etag][crate::model::CancelExecutionRequest::etag].
990        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
991            self.0.request.etag = v.into();
992            self
993        }
994    }
995
996    #[doc(hidden)]
997    impl gax::options::internal::RequestBuilder for CancelExecution {
998        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
999            &mut self.0.options
1000        }
1001    }
1002
1003    /// The request builder for [Executions::list_operations][crate::client::Executions::list_operations] calls.
1004    ///
1005    /// # Example
1006    /// ```no_run
1007    /// # use google_cloud_run_v2::builder;
1008    /// use builder::executions::ListOperations;
1009    /// # tokio_test::block_on(async {
1010    /// use gax::paginator::ItemPaginator;
1011    ///
1012    /// let builder = prepare_request_builder();
1013    /// let mut items = builder.by_item();
1014    /// while let Some(result) = items.next().await {
1015    ///   let item = result?;
1016    /// }
1017    /// # gax::Result::<()>::Ok(()) });
1018    ///
1019    /// fn prepare_request_builder() -> ListOperations {
1020    ///   # panic!();
1021    ///   // ... details omitted ...
1022    /// }
1023    /// ```
1024    #[derive(Clone, Debug)]
1025    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1026
1027    impl ListOperations {
1028        pub(crate) fn new(
1029            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1030        ) -> Self {
1031            Self(RequestBuilder::new(stub))
1032        }
1033
1034        /// Sets the full request, replacing any prior values.
1035        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1036            mut self,
1037            v: V,
1038        ) -> Self {
1039            self.0.request = v.into();
1040            self
1041        }
1042
1043        /// Sets all the options, replacing any prior values.
1044        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045            self.0.options = v.into();
1046            self
1047        }
1048
1049        /// Sends the request.
1050        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1051            (*self.0.stub)
1052                .list_operations(self.0.request, self.0.options)
1053                .await
1054                .map(gax::response::Response::into_body)
1055        }
1056
1057        /// Streams each page in the collection.
1058        pub fn by_page(
1059            self,
1060        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1061        {
1062            use std::clone::Clone;
1063            let token = self.0.request.page_token.clone();
1064            let execute = move |token: String| {
1065                let mut builder = self.clone();
1066                builder.0.request = builder.0.request.set_page_token(token);
1067                builder.send()
1068            };
1069            gax::paginator::internal::new_paginator(token, execute)
1070        }
1071
1072        /// Streams each item in the collection.
1073        pub fn by_item(
1074            self,
1075        ) -> impl gax::paginator::ItemPaginator<
1076            longrunning::model::ListOperationsResponse,
1077            gax::error::Error,
1078        > {
1079            use gax::paginator::Paginator;
1080            self.by_page().items()
1081        }
1082
1083        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1085            self.0.request.name = v.into();
1086            self
1087        }
1088
1089        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1090        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091            self.0.request.filter = v.into();
1092            self
1093        }
1094
1095        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1096        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1097            self.0.request.page_size = v.into();
1098            self
1099        }
1100
1101        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1102        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103            self.0.request.page_token = v.into();
1104            self
1105        }
1106    }
1107
1108    #[doc(hidden)]
1109    impl gax::options::internal::RequestBuilder for ListOperations {
1110        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1111            &mut self.0.options
1112        }
1113    }
1114
1115    /// The request builder for [Executions::get_operation][crate::client::Executions::get_operation] calls.
1116    ///
1117    /// # Example
1118    /// ```no_run
1119    /// # use google_cloud_run_v2::builder;
1120    /// use builder::executions::GetOperation;
1121    /// # tokio_test::block_on(async {
1122    ///
1123    /// let builder = prepare_request_builder();
1124    /// let response = builder.send().await?;
1125    /// # gax::Result::<()>::Ok(()) });
1126    ///
1127    /// fn prepare_request_builder() -> GetOperation {
1128    ///   # panic!();
1129    ///   // ... details omitted ...
1130    /// }
1131    /// ```
1132    #[derive(Clone, Debug)]
1133    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1134
1135    impl GetOperation {
1136        pub(crate) fn new(
1137            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1138        ) -> Self {
1139            Self(RequestBuilder::new(stub))
1140        }
1141
1142        /// Sets the full request, replacing any prior values.
1143        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1144            mut self,
1145            v: V,
1146        ) -> Self {
1147            self.0.request = v.into();
1148            self
1149        }
1150
1151        /// Sets all the options, replacing any prior values.
1152        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1153            self.0.options = v.into();
1154            self
1155        }
1156
1157        /// Sends the request.
1158        pub async fn send(self) -> Result<longrunning::model::Operation> {
1159            (*self.0.stub)
1160                .get_operation(self.0.request, self.0.options)
1161                .await
1162                .map(gax::response::Response::into_body)
1163        }
1164
1165        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1166        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1167            self.0.request.name = v.into();
1168            self
1169        }
1170    }
1171
1172    #[doc(hidden)]
1173    impl gax::options::internal::RequestBuilder for GetOperation {
1174        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1175            &mut self.0.options
1176        }
1177    }
1178
1179    /// The request builder for [Executions::delete_operation][crate::client::Executions::delete_operation] calls.
1180    ///
1181    /// # Example
1182    /// ```no_run
1183    /// # use google_cloud_run_v2::builder;
1184    /// use builder::executions::DeleteOperation;
1185    /// # tokio_test::block_on(async {
1186    ///
1187    /// let builder = prepare_request_builder();
1188    /// let response = builder.send().await?;
1189    /// # gax::Result::<()>::Ok(()) });
1190    ///
1191    /// fn prepare_request_builder() -> DeleteOperation {
1192    ///   # panic!();
1193    ///   // ... details omitted ...
1194    /// }
1195    /// ```
1196    #[derive(Clone, Debug)]
1197    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1198
1199    impl DeleteOperation {
1200        pub(crate) fn new(
1201            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1202        ) -> Self {
1203            Self(RequestBuilder::new(stub))
1204        }
1205
1206        /// Sets the full request, replacing any prior values.
1207        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1208            mut self,
1209            v: V,
1210        ) -> Self {
1211            self.0.request = v.into();
1212            self
1213        }
1214
1215        /// Sets all the options, replacing any prior values.
1216        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1217            self.0.options = v.into();
1218            self
1219        }
1220
1221        /// Sends the request.
1222        pub async fn send(self) -> Result<()> {
1223            (*self.0.stub)
1224                .delete_operation(self.0.request, self.0.options)
1225                .await
1226                .map(gax::response::Response::into_body)
1227        }
1228
1229        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1230        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1231            self.0.request.name = v.into();
1232            self
1233        }
1234    }
1235
1236    #[doc(hidden)]
1237    impl gax::options::internal::RequestBuilder for DeleteOperation {
1238        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1239            &mut self.0.options
1240        }
1241    }
1242
1243    /// The request builder for [Executions::wait_operation][crate::client::Executions::wait_operation] calls.
1244    ///
1245    /// # Example
1246    /// ```no_run
1247    /// # use google_cloud_run_v2::builder;
1248    /// use builder::executions::WaitOperation;
1249    /// # tokio_test::block_on(async {
1250    ///
1251    /// let builder = prepare_request_builder();
1252    /// let response = builder.send().await?;
1253    /// # gax::Result::<()>::Ok(()) });
1254    ///
1255    /// fn prepare_request_builder() -> WaitOperation {
1256    ///   # panic!();
1257    ///   // ... details omitted ...
1258    /// }
1259    /// ```
1260    #[derive(Clone, Debug)]
1261    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
1262
1263    impl WaitOperation {
1264        pub(crate) fn new(
1265            stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1266        ) -> Self {
1267            Self(RequestBuilder::new(stub))
1268        }
1269
1270        /// Sets the full request, replacing any prior values.
1271        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
1272            mut self,
1273            v: V,
1274        ) -> Self {
1275            self.0.request = v.into();
1276            self
1277        }
1278
1279        /// Sets all the options, replacing any prior values.
1280        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1281            self.0.options = v.into();
1282            self
1283        }
1284
1285        /// Sends the request.
1286        pub async fn send(self) -> Result<longrunning::model::Operation> {
1287            (*self.0.stub)
1288                .wait_operation(self.0.request, self.0.options)
1289                .await
1290                .map(gax::response::Response::into_body)
1291        }
1292
1293        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
1294        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1295            self.0.request.name = v.into();
1296            self
1297        }
1298
1299        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
1300        pub fn set_timeout<T>(mut self, v: T) -> Self
1301        where
1302            T: std::convert::Into<wkt::Duration>,
1303        {
1304            self.0.request.timeout = std::option::Option::Some(v.into());
1305            self
1306        }
1307
1308        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
1309        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1310        where
1311            T: std::convert::Into<wkt::Duration>,
1312        {
1313            self.0.request.timeout = v.map(|x| x.into());
1314            self
1315        }
1316    }
1317
1318    #[doc(hidden)]
1319    impl gax::options::internal::RequestBuilder for WaitOperation {
1320        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1321            &mut self.0.options
1322        }
1323    }
1324}
1325
1326pub mod jobs {
1327    use crate::Result;
1328
1329    /// A builder for [Jobs][crate::client::Jobs].
1330    ///
1331    /// ```
1332    /// # tokio_test::block_on(async {
1333    /// # use google_cloud_run_v2::*;
1334    /// # use builder::jobs::ClientBuilder;
1335    /// # use client::Jobs;
1336    /// let builder : ClientBuilder = Jobs::builder();
1337    /// let client = builder
1338    ///     .with_endpoint("https://run.googleapis.com")
1339    ///     .build().await?;
1340    /// # gax::client_builder::Result::<()>::Ok(()) });
1341    /// ```
1342    pub type ClientBuilder =
1343        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1344
1345    pub(crate) mod client {
1346        use super::super::super::client::Jobs;
1347        pub struct Factory;
1348        impl gax::client_builder::internal::ClientFactory for Factory {
1349            type Client = Jobs;
1350            type Credentials = gaxi::options::Credentials;
1351            async fn build(
1352                self,
1353                config: gaxi::options::ClientConfig,
1354            ) -> gax::client_builder::Result<Self::Client> {
1355                Self::Client::new(config).await
1356            }
1357        }
1358    }
1359
1360    /// Common implementation for [crate::client::Jobs] request builders.
1361    #[derive(Clone, Debug)]
1362    pub(crate) struct RequestBuilder<R: std::default::Default> {
1363        stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>,
1364        request: R,
1365        options: gax::options::RequestOptions,
1366    }
1367
1368    impl<R> RequestBuilder<R>
1369    where
1370        R: std::default::Default,
1371    {
1372        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1373            Self {
1374                stub,
1375                request: R::default(),
1376                options: gax::options::RequestOptions::default(),
1377            }
1378        }
1379    }
1380
1381    /// The request builder for [Jobs::create_job][crate::client::Jobs::create_job] calls.
1382    ///
1383    /// # Example
1384    /// ```no_run
1385    /// # use google_cloud_run_v2::builder;
1386    /// use builder::jobs::CreateJob;
1387    /// # tokio_test::block_on(async {
1388    /// use lro::Poller;
1389    ///
1390    /// let builder = prepare_request_builder();
1391    /// let response = builder.poller().until_done().await?;
1392    /// # gax::Result::<()>::Ok(()) });
1393    ///
1394    /// fn prepare_request_builder() -> CreateJob {
1395    ///   # panic!();
1396    ///   // ... details omitted ...
1397    /// }
1398    /// ```
1399    #[derive(Clone, Debug)]
1400    pub struct CreateJob(RequestBuilder<crate::model::CreateJobRequest>);
1401
1402    impl CreateJob {
1403        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1404            Self(RequestBuilder::new(stub))
1405        }
1406
1407        /// Sets the full request, replacing any prior values.
1408        pub fn with_request<V: Into<crate::model::CreateJobRequest>>(mut self, v: V) -> Self {
1409            self.0.request = v.into();
1410            self
1411        }
1412
1413        /// Sets all the options, replacing any prior values.
1414        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1415            self.0.options = v.into();
1416            self
1417        }
1418
1419        /// Sends the request.
1420        ///
1421        /// # Long running operations
1422        ///
1423        /// This starts, but does not poll, a longrunning operation. More information
1424        /// on [create_job][crate::client::Jobs::create_job].
1425        pub async fn send(self) -> Result<longrunning::model::Operation> {
1426            (*self.0.stub)
1427                .create_job(self.0.request, self.0.options)
1428                .await
1429                .map(gax::response::Response::into_body)
1430        }
1431
1432        /// Creates a [Poller][lro::Poller] to work with `create_job`.
1433        pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1434            type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1435            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1436            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1437
1438            let stub = self.0.stub.clone();
1439            let mut options = self.0.options.clone();
1440            options.set_retry_policy(gax::retry_policy::NeverRetry);
1441            let query = move |name| {
1442                let stub = stub.clone();
1443                let options = options.clone();
1444                async {
1445                    let op = GetOperation::new(stub)
1446                        .set_name(name)
1447                        .with_options(options)
1448                        .send()
1449                        .await?;
1450                    Ok(Operation::new(op))
1451                }
1452            };
1453
1454            let start = move || async {
1455                let op = self.send().await?;
1456                Ok(Operation::new(op))
1457            };
1458
1459            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1460        }
1461
1462        /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
1463        ///
1464        /// This is a **required** field for requests.
1465        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1466            self.0.request.parent = v.into();
1467            self
1468        }
1469
1470        /// Sets the value of [job][crate::model::CreateJobRequest::job].
1471        ///
1472        /// This is a **required** field for requests.
1473        pub fn set_job<T>(mut self, v: T) -> Self
1474        where
1475            T: std::convert::Into<crate::model::Job>,
1476        {
1477            self.0.request.job = std::option::Option::Some(v.into());
1478            self
1479        }
1480
1481        /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
1482        ///
1483        /// This is a **required** field for requests.
1484        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1485        where
1486            T: std::convert::Into<crate::model::Job>,
1487        {
1488            self.0.request.job = v.map(|x| x.into());
1489            self
1490        }
1491
1492        /// Sets the value of [job_id][crate::model::CreateJobRequest::job_id].
1493        ///
1494        /// This is a **required** field for requests.
1495        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496            self.0.request.job_id = v.into();
1497            self
1498        }
1499
1500        /// Sets the value of [validate_only][crate::model::CreateJobRequest::validate_only].
1501        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1502            self.0.request.validate_only = v.into();
1503            self
1504        }
1505    }
1506
1507    #[doc(hidden)]
1508    impl gax::options::internal::RequestBuilder for CreateJob {
1509        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1510            &mut self.0.options
1511        }
1512    }
1513
1514    /// The request builder for [Jobs::get_job][crate::client::Jobs::get_job] calls.
1515    ///
1516    /// # Example
1517    /// ```no_run
1518    /// # use google_cloud_run_v2::builder;
1519    /// use builder::jobs::GetJob;
1520    /// # tokio_test::block_on(async {
1521    ///
1522    /// let builder = prepare_request_builder();
1523    /// let response = builder.send().await?;
1524    /// # gax::Result::<()>::Ok(()) });
1525    ///
1526    /// fn prepare_request_builder() -> GetJob {
1527    ///   # panic!();
1528    ///   // ... details omitted ...
1529    /// }
1530    /// ```
1531    #[derive(Clone, Debug)]
1532    pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
1533
1534    impl GetJob {
1535        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1536            Self(RequestBuilder::new(stub))
1537        }
1538
1539        /// Sets the full request, replacing any prior values.
1540        pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
1541            self.0.request = v.into();
1542            self
1543        }
1544
1545        /// Sets all the options, replacing any prior values.
1546        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1547            self.0.options = v.into();
1548            self
1549        }
1550
1551        /// Sends the request.
1552        pub async fn send(self) -> Result<crate::model::Job> {
1553            (*self.0.stub)
1554                .get_job(self.0.request, self.0.options)
1555                .await
1556                .map(gax::response::Response::into_body)
1557        }
1558
1559        /// Sets the value of [name][crate::model::GetJobRequest::name].
1560        ///
1561        /// This is a **required** field for requests.
1562        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1563            self.0.request.name = v.into();
1564            self
1565        }
1566    }
1567
1568    #[doc(hidden)]
1569    impl gax::options::internal::RequestBuilder for GetJob {
1570        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1571            &mut self.0.options
1572        }
1573    }
1574
1575    /// The request builder for [Jobs::list_jobs][crate::client::Jobs::list_jobs] calls.
1576    ///
1577    /// # Example
1578    /// ```no_run
1579    /// # use google_cloud_run_v2::builder;
1580    /// use builder::jobs::ListJobs;
1581    /// # tokio_test::block_on(async {
1582    /// use gax::paginator::ItemPaginator;
1583    ///
1584    /// let builder = prepare_request_builder();
1585    /// let mut items = builder.by_item();
1586    /// while let Some(result) = items.next().await {
1587    ///   let item = result?;
1588    /// }
1589    /// # gax::Result::<()>::Ok(()) });
1590    ///
1591    /// fn prepare_request_builder() -> ListJobs {
1592    ///   # panic!();
1593    ///   // ... details omitted ...
1594    /// }
1595    /// ```
1596    #[derive(Clone, Debug)]
1597    pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
1598
1599    impl ListJobs {
1600        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1601            Self(RequestBuilder::new(stub))
1602        }
1603
1604        /// Sets the full request, replacing any prior values.
1605        pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
1606            self.0.request = v.into();
1607            self
1608        }
1609
1610        /// Sets all the options, replacing any prior values.
1611        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1612            self.0.options = v.into();
1613            self
1614        }
1615
1616        /// Sends the request.
1617        pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
1618            (*self.0.stub)
1619                .list_jobs(self.0.request, self.0.options)
1620                .await
1621                .map(gax::response::Response::into_body)
1622        }
1623
1624        /// Streams each page in the collection.
1625        pub fn by_page(
1626            self,
1627        ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
1628        {
1629            use std::clone::Clone;
1630            let token = self.0.request.page_token.clone();
1631            let execute = move |token: String| {
1632                let mut builder = self.clone();
1633                builder.0.request = builder.0.request.set_page_token(token);
1634                builder.send()
1635            };
1636            gax::paginator::internal::new_paginator(token, execute)
1637        }
1638
1639        /// Streams each item in the collection.
1640        pub fn by_item(
1641            self,
1642        ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
1643        {
1644            use gax::paginator::Paginator;
1645            self.by_page().items()
1646        }
1647
1648        /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
1649        ///
1650        /// This is a **required** field for requests.
1651        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1652            self.0.request.parent = v.into();
1653            self
1654        }
1655
1656        /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
1657        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1658            self.0.request.page_size = v.into();
1659            self
1660        }
1661
1662        /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
1663        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664            self.0.request.page_token = v.into();
1665            self
1666        }
1667
1668        /// Sets the value of [show_deleted][crate::model::ListJobsRequest::show_deleted].
1669        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1670            self.0.request.show_deleted = v.into();
1671            self
1672        }
1673    }
1674
1675    #[doc(hidden)]
1676    impl gax::options::internal::RequestBuilder for ListJobs {
1677        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1678            &mut self.0.options
1679        }
1680    }
1681
1682    /// The request builder for [Jobs::update_job][crate::client::Jobs::update_job] calls.
1683    ///
1684    /// # Example
1685    /// ```no_run
1686    /// # use google_cloud_run_v2::builder;
1687    /// use builder::jobs::UpdateJob;
1688    /// # tokio_test::block_on(async {
1689    /// use lro::Poller;
1690    ///
1691    /// let builder = prepare_request_builder();
1692    /// let response = builder.poller().until_done().await?;
1693    /// # gax::Result::<()>::Ok(()) });
1694    ///
1695    /// fn prepare_request_builder() -> UpdateJob {
1696    ///   # panic!();
1697    ///   // ... details omitted ...
1698    /// }
1699    /// ```
1700    #[derive(Clone, Debug)]
1701    pub struct UpdateJob(RequestBuilder<crate::model::UpdateJobRequest>);
1702
1703    impl UpdateJob {
1704        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1705            Self(RequestBuilder::new(stub))
1706        }
1707
1708        /// Sets the full request, replacing any prior values.
1709        pub fn with_request<V: Into<crate::model::UpdateJobRequest>>(mut self, v: V) -> Self {
1710            self.0.request = v.into();
1711            self
1712        }
1713
1714        /// Sets all the options, replacing any prior values.
1715        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1716            self.0.options = v.into();
1717            self
1718        }
1719
1720        /// Sends the request.
1721        ///
1722        /// # Long running operations
1723        ///
1724        /// This starts, but does not poll, a longrunning operation. More information
1725        /// on [update_job][crate::client::Jobs::update_job].
1726        pub async fn send(self) -> Result<longrunning::model::Operation> {
1727            (*self.0.stub)
1728                .update_job(self.0.request, self.0.options)
1729                .await
1730                .map(gax::response::Response::into_body)
1731        }
1732
1733        /// Creates a [Poller][lro::Poller] to work with `update_job`.
1734        pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1735            type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1736            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1737            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1738
1739            let stub = self.0.stub.clone();
1740            let mut options = self.0.options.clone();
1741            options.set_retry_policy(gax::retry_policy::NeverRetry);
1742            let query = move |name| {
1743                let stub = stub.clone();
1744                let options = options.clone();
1745                async {
1746                    let op = GetOperation::new(stub)
1747                        .set_name(name)
1748                        .with_options(options)
1749                        .send()
1750                        .await?;
1751                    Ok(Operation::new(op))
1752                }
1753            };
1754
1755            let start = move || async {
1756                let op = self.send().await?;
1757                Ok(Operation::new(op))
1758            };
1759
1760            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1761        }
1762
1763        /// Sets the value of [job][crate::model::UpdateJobRequest::job].
1764        ///
1765        /// This is a **required** field for requests.
1766        pub fn set_job<T>(mut self, v: T) -> Self
1767        where
1768            T: std::convert::Into<crate::model::Job>,
1769        {
1770            self.0.request.job = std::option::Option::Some(v.into());
1771            self
1772        }
1773
1774        /// Sets or clears the value of [job][crate::model::UpdateJobRequest::job].
1775        ///
1776        /// This is a **required** field for requests.
1777        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1778        where
1779            T: std::convert::Into<crate::model::Job>,
1780        {
1781            self.0.request.job = v.map(|x| x.into());
1782            self
1783        }
1784
1785        /// Sets the value of [validate_only][crate::model::UpdateJobRequest::validate_only].
1786        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1787            self.0.request.validate_only = v.into();
1788            self
1789        }
1790
1791        /// Sets the value of [allow_missing][crate::model::UpdateJobRequest::allow_missing].
1792        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1793            self.0.request.allow_missing = v.into();
1794            self
1795        }
1796    }
1797
1798    #[doc(hidden)]
1799    impl gax::options::internal::RequestBuilder for UpdateJob {
1800        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1801            &mut self.0.options
1802        }
1803    }
1804
1805    /// The request builder for [Jobs::delete_job][crate::client::Jobs::delete_job] calls.
1806    ///
1807    /// # Example
1808    /// ```no_run
1809    /// # use google_cloud_run_v2::builder;
1810    /// use builder::jobs::DeleteJob;
1811    /// # tokio_test::block_on(async {
1812    /// use lro::Poller;
1813    ///
1814    /// let builder = prepare_request_builder();
1815    /// let response = builder.poller().until_done().await?;
1816    /// # gax::Result::<()>::Ok(()) });
1817    ///
1818    /// fn prepare_request_builder() -> DeleteJob {
1819    ///   # panic!();
1820    ///   // ... details omitted ...
1821    /// }
1822    /// ```
1823    #[derive(Clone, Debug)]
1824    pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);
1825
1826    impl DeleteJob {
1827        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1828            Self(RequestBuilder::new(stub))
1829        }
1830
1831        /// Sets the full request, replacing any prior values.
1832        pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
1833            self.0.request = v.into();
1834            self
1835        }
1836
1837        /// Sets all the options, replacing any prior values.
1838        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1839            self.0.options = v.into();
1840            self
1841        }
1842
1843        /// Sends the request.
1844        ///
1845        /// # Long running operations
1846        ///
1847        /// This starts, but does not poll, a longrunning operation. More information
1848        /// on [delete_job][crate::client::Jobs::delete_job].
1849        pub async fn send(self) -> Result<longrunning::model::Operation> {
1850            (*self.0.stub)
1851                .delete_job(self.0.request, self.0.options)
1852                .await
1853                .map(gax::response::Response::into_body)
1854        }
1855
1856        /// Creates a [Poller][lro::Poller] to work with `delete_job`.
1857        pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1858            type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1859            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1860            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1861
1862            let stub = self.0.stub.clone();
1863            let mut options = self.0.options.clone();
1864            options.set_retry_policy(gax::retry_policy::NeverRetry);
1865            let query = move |name| {
1866                let stub = stub.clone();
1867                let options = options.clone();
1868                async {
1869                    let op = GetOperation::new(stub)
1870                        .set_name(name)
1871                        .with_options(options)
1872                        .send()
1873                        .await?;
1874                    Ok(Operation::new(op))
1875                }
1876            };
1877
1878            let start = move || async {
1879                let op = self.send().await?;
1880                Ok(Operation::new(op))
1881            };
1882
1883            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1884        }
1885
1886        /// Sets the value of [name][crate::model::DeleteJobRequest::name].
1887        ///
1888        /// This is a **required** field for requests.
1889        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890            self.0.request.name = v.into();
1891            self
1892        }
1893
1894        /// Sets the value of [validate_only][crate::model::DeleteJobRequest::validate_only].
1895        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1896            self.0.request.validate_only = v.into();
1897            self
1898        }
1899
1900        /// Sets the value of [etag][crate::model::DeleteJobRequest::etag].
1901        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902            self.0.request.etag = v.into();
1903            self
1904        }
1905    }
1906
1907    #[doc(hidden)]
1908    impl gax::options::internal::RequestBuilder for DeleteJob {
1909        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1910            &mut self.0.options
1911        }
1912    }
1913
1914    /// The request builder for [Jobs::run_job][crate::client::Jobs::run_job] calls.
1915    ///
1916    /// # Example
1917    /// ```no_run
1918    /// # use google_cloud_run_v2::builder;
1919    /// use builder::jobs::RunJob;
1920    /// # tokio_test::block_on(async {
1921    /// use lro::Poller;
1922    ///
1923    /// let builder = prepare_request_builder();
1924    /// let response = builder.poller().until_done().await?;
1925    /// # gax::Result::<()>::Ok(()) });
1926    ///
1927    /// fn prepare_request_builder() -> RunJob {
1928    ///   # panic!();
1929    ///   // ... details omitted ...
1930    /// }
1931    /// ```
1932    #[derive(Clone, Debug)]
1933    pub struct RunJob(RequestBuilder<crate::model::RunJobRequest>);
1934
1935    impl RunJob {
1936        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1937            Self(RequestBuilder::new(stub))
1938        }
1939
1940        /// Sets the full request, replacing any prior values.
1941        pub fn with_request<V: Into<crate::model::RunJobRequest>>(mut self, v: V) -> Self {
1942            self.0.request = v.into();
1943            self
1944        }
1945
1946        /// Sets all the options, replacing any prior values.
1947        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1948            self.0.options = v.into();
1949            self
1950        }
1951
1952        /// Sends the request.
1953        ///
1954        /// # Long running operations
1955        ///
1956        /// This starts, but does not poll, a longrunning operation. More information
1957        /// on [run_job][crate::client::Jobs::run_job].
1958        pub async fn send(self) -> Result<longrunning::model::Operation> {
1959            (*self.0.stub)
1960                .run_job(self.0.request, self.0.options)
1961                .await
1962                .map(gax::response::Response::into_body)
1963        }
1964
1965        /// Creates a [Poller][lro::Poller] to work with `run_job`.
1966        pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
1967            type Operation =
1968                lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
1969            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1970            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1971
1972            let stub = self.0.stub.clone();
1973            let mut options = self.0.options.clone();
1974            options.set_retry_policy(gax::retry_policy::NeverRetry);
1975            let query = move |name| {
1976                let stub = stub.clone();
1977                let options = options.clone();
1978                async {
1979                    let op = GetOperation::new(stub)
1980                        .set_name(name)
1981                        .with_options(options)
1982                        .send()
1983                        .await?;
1984                    Ok(Operation::new(op))
1985                }
1986            };
1987
1988            let start = move || async {
1989                let op = self.send().await?;
1990                Ok(Operation::new(op))
1991            };
1992
1993            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1994        }
1995
1996        /// Sets the value of [name][crate::model::RunJobRequest::name].
1997        ///
1998        /// This is a **required** field for requests.
1999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2000            self.0.request.name = v.into();
2001            self
2002        }
2003
2004        /// Sets the value of [validate_only][crate::model::RunJobRequest::validate_only].
2005        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2006            self.0.request.validate_only = v.into();
2007            self
2008        }
2009
2010        /// Sets the value of [etag][crate::model::RunJobRequest::etag].
2011        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2012            self.0.request.etag = v.into();
2013            self
2014        }
2015
2016        /// Sets the value of [overrides][crate::model::RunJobRequest::overrides].
2017        pub fn set_overrides<T>(mut self, v: T) -> Self
2018        where
2019            T: std::convert::Into<crate::model::run_job_request::Overrides>,
2020        {
2021            self.0.request.overrides = std::option::Option::Some(v.into());
2022            self
2023        }
2024
2025        /// Sets or clears the value of [overrides][crate::model::RunJobRequest::overrides].
2026        pub fn set_or_clear_overrides<T>(mut self, v: std::option::Option<T>) -> Self
2027        where
2028            T: std::convert::Into<crate::model::run_job_request::Overrides>,
2029        {
2030            self.0.request.overrides = v.map(|x| x.into());
2031            self
2032        }
2033    }
2034
2035    #[doc(hidden)]
2036    impl gax::options::internal::RequestBuilder for RunJob {
2037        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2038            &mut self.0.options
2039        }
2040    }
2041
2042    /// The request builder for [Jobs::get_iam_policy][crate::client::Jobs::get_iam_policy] calls.
2043    ///
2044    /// # Example
2045    /// ```no_run
2046    /// # use google_cloud_run_v2::builder;
2047    /// use builder::jobs::GetIamPolicy;
2048    /// # tokio_test::block_on(async {
2049    ///
2050    /// let builder = prepare_request_builder();
2051    /// let response = builder.send().await?;
2052    /// # gax::Result::<()>::Ok(()) });
2053    ///
2054    /// fn prepare_request_builder() -> GetIamPolicy {
2055    ///   # panic!();
2056    ///   // ... details omitted ...
2057    /// }
2058    /// ```
2059    #[derive(Clone, Debug)]
2060    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2061
2062    impl GetIamPolicy {
2063        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2064            Self(RequestBuilder::new(stub))
2065        }
2066
2067        /// Sets the full request, replacing any prior values.
2068        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2069            self.0.request = v.into();
2070            self
2071        }
2072
2073        /// Sets all the options, replacing any prior values.
2074        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2075            self.0.options = v.into();
2076            self
2077        }
2078
2079        /// Sends the request.
2080        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2081            (*self.0.stub)
2082                .get_iam_policy(self.0.request, self.0.options)
2083                .await
2084                .map(gax::response::Response::into_body)
2085        }
2086
2087        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2088        ///
2089        /// This is a **required** field for requests.
2090        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2091            self.0.request.resource = v.into();
2092            self
2093        }
2094
2095        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2096        pub fn set_options<T>(mut self, v: T) -> Self
2097        where
2098            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2099        {
2100            self.0.request.options = std::option::Option::Some(v.into());
2101            self
2102        }
2103
2104        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2105        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2106        where
2107            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2108        {
2109            self.0.request.options = v.map(|x| x.into());
2110            self
2111        }
2112    }
2113
2114    #[doc(hidden)]
2115    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2116        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2117            &mut self.0.options
2118        }
2119    }
2120
2121    /// The request builder for [Jobs::set_iam_policy][crate::client::Jobs::set_iam_policy] calls.
2122    ///
2123    /// # Example
2124    /// ```no_run
2125    /// # use google_cloud_run_v2::builder;
2126    /// use builder::jobs::SetIamPolicy;
2127    /// # tokio_test::block_on(async {
2128    ///
2129    /// let builder = prepare_request_builder();
2130    /// let response = builder.send().await?;
2131    /// # gax::Result::<()>::Ok(()) });
2132    ///
2133    /// fn prepare_request_builder() -> SetIamPolicy {
2134    ///   # panic!();
2135    ///   // ... details omitted ...
2136    /// }
2137    /// ```
2138    #[derive(Clone, Debug)]
2139    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2140
2141    impl SetIamPolicy {
2142        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2143            Self(RequestBuilder::new(stub))
2144        }
2145
2146        /// Sets the full request, replacing any prior values.
2147        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2148            self.0.request = v.into();
2149            self
2150        }
2151
2152        /// Sets all the options, replacing any prior values.
2153        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2154            self.0.options = v.into();
2155            self
2156        }
2157
2158        /// Sends the request.
2159        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2160            (*self.0.stub)
2161                .set_iam_policy(self.0.request, self.0.options)
2162                .await
2163                .map(gax::response::Response::into_body)
2164        }
2165
2166        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2167        ///
2168        /// This is a **required** field for requests.
2169        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2170            self.0.request.resource = v.into();
2171            self
2172        }
2173
2174        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2175        ///
2176        /// This is a **required** field for requests.
2177        pub fn set_policy<T>(mut self, v: T) -> Self
2178        where
2179            T: std::convert::Into<iam_v1::model::Policy>,
2180        {
2181            self.0.request.policy = std::option::Option::Some(v.into());
2182            self
2183        }
2184
2185        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2186        ///
2187        /// This is a **required** field for requests.
2188        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2189        where
2190            T: std::convert::Into<iam_v1::model::Policy>,
2191        {
2192            self.0.request.policy = v.map(|x| x.into());
2193            self
2194        }
2195
2196        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2197        pub fn set_update_mask<T>(mut self, v: T) -> Self
2198        where
2199            T: std::convert::Into<wkt::FieldMask>,
2200        {
2201            self.0.request.update_mask = std::option::Option::Some(v.into());
2202            self
2203        }
2204
2205        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2206        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2207        where
2208            T: std::convert::Into<wkt::FieldMask>,
2209        {
2210            self.0.request.update_mask = v.map(|x| x.into());
2211            self
2212        }
2213    }
2214
2215    #[doc(hidden)]
2216    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2217        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2218            &mut self.0.options
2219        }
2220    }
2221
2222    /// The request builder for [Jobs::test_iam_permissions][crate::client::Jobs::test_iam_permissions] calls.
2223    ///
2224    /// # Example
2225    /// ```no_run
2226    /// # use google_cloud_run_v2::builder;
2227    /// use builder::jobs::TestIamPermissions;
2228    /// # tokio_test::block_on(async {
2229    ///
2230    /// let builder = prepare_request_builder();
2231    /// let response = builder.send().await?;
2232    /// # gax::Result::<()>::Ok(()) });
2233    ///
2234    /// fn prepare_request_builder() -> TestIamPermissions {
2235    ///   # panic!();
2236    ///   // ... details omitted ...
2237    /// }
2238    /// ```
2239    #[derive(Clone, Debug)]
2240    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2241
2242    impl TestIamPermissions {
2243        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2244            Self(RequestBuilder::new(stub))
2245        }
2246
2247        /// Sets the full request, replacing any prior values.
2248        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2249            mut self,
2250            v: V,
2251        ) -> Self {
2252            self.0.request = v.into();
2253            self
2254        }
2255
2256        /// Sets all the options, replacing any prior values.
2257        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2258            self.0.options = v.into();
2259            self
2260        }
2261
2262        /// Sends the request.
2263        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2264            (*self.0.stub)
2265                .test_iam_permissions(self.0.request, self.0.options)
2266                .await
2267                .map(gax::response::Response::into_body)
2268        }
2269
2270        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2271        ///
2272        /// This is a **required** field for requests.
2273        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2274            self.0.request.resource = v.into();
2275            self
2276        }
2277
2278        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2279        ///
2280        /// This is a **required** field for requests.
2281        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2282        where
2283            T: std::iter::IntoIterator<Item = V>,
2284            V: std::convert::Into<std::string::String>,
2285        {
2286            use std::iter::Iterator;
2287            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2288            self
2289        }
2290    }
2291
2292    #[doc(hidden)]
2293    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2295            &mut self.0.options
2296        }
2297    }
2298
2299    /// The request builder for [Jobs::list_operations][crate::client::Jobs::list_operations] calls.
2300    ///
2301    /// # Example
2302    /// ```no_run
2303    /// # use google_cloud_run_v2::builder;
2304    /// use builder::jobs::ListOperations;
2305    /// # tokio_test::block_on(async {
2306    /// use gax::paginator::ItemPaginator;
2307    ///
2308    /// let builder = prepare_request_builder();
2309    /// let mut items = builder.by_item();
2310    /// while let Some(result) = items.next().await {
2311    ///   let item = result?;
2312    /// }
2313    /// # gax::Result::<()>::Ok(()) });
2314    ///
2315    /// fn prepare_request_builder() -> ListOperations {
2316    ///   # panic!();
2317    ///   // ... details omitted ...
2318    /// }
2319    /// ```
2320    #[derive(Clone, Debug)]
2321    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2322
2323    impl ListOperations {
2324        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2325            Self(RequestBuilder::new(stub))
2326        }
2327
2328        /// Sets the full request, replacing any prior values.
2329        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2330            mut self,
2331            v: V,
2332        ) -> Self {
2333            self.0.request = v.into();
2334            self
2335        }
2336
2337        /// Sets all the options, replacing any prior values.
2338        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2339            self.0.options = v.into();
2340            self
2341        }
2342
2343        /// Sends the request.
2344        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2345            (*self.0.stub)
2346                .list_operations(self.0.request, self.0.options)
2347                .await
2348                .map(gax::response::Response::into_body)
2349        }
2350
2351        /// Streams each page in the collection.
2352        pub fn by_page(
2353            self,
2354        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2355        {
2356            use std::clone::Clone;
2357            let token = self.0.request.page_token.clone();
2358            let execute = move |token: String| {
2359                let mut builder = self.clone();
2360                builder.0.request = builder.0.request.set_page_token(token);
2361                builder.send()
2362            };
2363            gax::paginator::internal::new_paginator(token, execute)
2364        }
2365
2366        /// Streams each item in the collection.
2367        pub fn by_item(
2368            self,
2369        ) -> impl gax::paginator::ItemPaginator<
2370            longrunning::model::ListOperationsResponse,
2371            gax::error::Error,
2372        > {
2373            use gax::paginator::Paginator;
2374            self.by_page().items()
2375        }
2376
2377        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2379            self.0.request.name = v.into();
2380            self
2381        }
2382
2383        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2384        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385            self.0.request.filter = v.into();
2386            self
2387        }
2388
2389        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2390        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2391            self.0.request.page_size = v.into();
2392            self
2393        }
2394
2395        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2396        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397            self.0.request.page_token = v.into();
2398            self
2399        }
2400    }
2401
2402    #[doc(hidden)]
2403    impl gax::options::internal::RequestBuilder for ListOperations {
2404        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2405            &mut self.0.options
2406        }
2407    }
2408
2409    /// The request builder for [Jobs::get_operation][crate::client::Jobs::get_operation] calls.
2410    ///
2411    /// # Example
2412    /// ```no_run
2413    /// # use google_cloud_run_v2::builder;
2414    /// use builder::jobs::GetOperation;
2415    /// # tokio_test::block_on(async {
2416    ///
2417    /// let builder = prepare_request_builder();
2418    /// let response = builder.send().await?;
2419    /// # gax::Result::<()>::Ok(()) });
2420    ///
2421    /// fn prepare_request_builder() -> GetOperation {
2422    ///   # panic!();
2423    ///   // ... details omitted ...
2424    /// }
2425    /// ```
2426    #[derive(Clone, Debug)]
2427    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2428
2429    impl GetOperation {
2430        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2431            Self(RequestBuilder::new(stub))
2432        }
2433
2434        /// Sets the full request, replacing any prior values.
2435        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2436            mut self,
2437            v: V,
2438        ) -> Self {
2439            self.0.request = v.into();
2440            self
2441        }
2442
2443        /// Sets all the options, replacing any prior values.
2444        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2445            self.0.options = v.into();
2446            self
2447        }
2448
2449        /// Sends the request.
2450        pub async fn send(self) -> Result<longrunning::model::Operation> {
2451            (*self.0.stub)
2452                .get_operation(self.0.request, self.0.options)
2453                .await
2454                .map(gax::response::Response::into_body)
2455        }
2456
2457        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2458        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2459            self.0.request.name = v.into();
2460            self
2461        }
2462    }
2463
2464    #[doc(hidden)]
2465    impl gax::options::internal::RequestBuilder for GetOperation {
2466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2467            &mut self.0.options
2468        }
2469    }
2470
2471    /// The request builder for [Jobs::delete_operation][crate::client::Jobs::delete_operation] calls.
2472    ///
2473    /// # Example
2474    /// ```no_run
2475    /// # use google_cloud_run_v2::builder;
2476    /// use builder::jobs::DeleteOperation;
2477    /// # tokio_test::block_on(async {
2478    ///
2479    /// let builder = prepare_request_builder();
2480    /// let response = builder.send().await?;
2481    /// # gax::Result::<()>::Ok(()) });
2482    ///
2483    /// fn prepare_request_builder() -> DeleteOperation {
2484    ///   # panic!();
2485    ///   // ... details omitted ...
2486    /// }
2487    /// ```
2488    #[derive(Clone, Debug)]
2489    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2490
2491    impl DeleteOperation {
2492        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2493            Self(RequestBuilder::new(stub))
2494        }
2495
2496        /// Sets the full request, replacing any prior values.
2497        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2498            mut self,
2499            v: V,
2500        ) -> Self {
2501            self.0.request = v.into();
2502            self
2503        }
2504
2505        /// Sets all the options, replacing any prior values.
2506        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2507            self.0.options = v.into();
2508            self
2509        }
2510
2511        /// Sends the request.
2512        pub async fn send(self) -> Result<()> {
2513            (*self.0.stub)
2514                .delete_operation(self.0.request, self.0.options)
2515                .await
2516                .map(gax::response::Response::into_body)
2517        }
2518
2519        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521            self.0.request.name = v.into();
2522            self
2523        }
2524    }
2525
2526    #[doc(hidden)]
2527    impl gax::options::internal::RequestBuilder for DeleteOperation {
2528        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2529            &mut self.0.options
2530        }
2531    }
2532
2533    /// The request builder for [Jobs::wait_operation][crate::client::Jobs::wait_operation] calls.
2534    ///
2535    /// # Example
2536    /// ```no_run
2537    /// # use google_cloud_run_v2::builder;
2538    /// use builder::jobs::WaitOperation;
2539    /// # tokio_test::block_on(async {
2540    ///
2541    /// let builder = prepare_request_builder();
2542    /// let response = builder.send().await?;
2543    /// # gax::Result::<()>::Ok(()) });
2544    ///
2545    /// fn prepare_request_builder() -> WaitOperation {
2546    ///   # panic!();
2547    ///   // ... details omitted ...
2548    /// }
2549    /// ```
2550    #[derive(Clone, Debug)]
2551    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
2552
2553    impl WaitOperation {
2554        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2555            Self(RequestBuilder::new(stub))
2556        }
2557
2558        /// Sets the full request, replacing any prior values.
2559        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
2560            mut self,
2561            v: V,
2562        ) -> Self {
2563            self.0.request = v.into();
2564            self
2565        }
2566
2567        /// Sets all the options, replacing any prior values.
2568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569            self.0.options = v.into();
2570            self
2571        }
2572
2573        /// Sends the request.
2574        pub async fn send(self) -> Result<longrunning::model::Operation> {
2575            (*self.0.stub)
2576                .wait_operation(self.0.request, self.0.options)
2577                .await
2578                .map(gax::response::Response::into_body)
2579        }
2580
2581        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
2582        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583            self.0.request.name = v.into();
2584            self
2585        }
2586
2587        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
2588        pub fn set_timeout<T>(mut self, v: T) -> Self
2589        where
2590            T: std::convert::Into<wkt::Duration>,
2591        {
2592            self.0.request.timeout = std::option::Option::Some(v.into());
2593            self
2594        }
2595
2596        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
2597        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2598        where
2599            T: std::convert::Into<wkt::Duration>,
2600        {
2601            self.0.request.timeout = v.map(|x| x.into());
2602            self
2603        }
2604    }
2605
2606    #[doc(hidden)]
2607    impl gax::options::internal::RequestBuilder for WaitOperation {
2608        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2609            &mut self.0.options
2610        }
2611    }
2612}
2613
2614pub mod revisions {
2615    use crate::Result;
2616
2617    /// A builder for [Revisions][crate::client::Revisions].
2618    ///
2619    /// ```
2620    /// # tokio_test::block_on(async {
2621    /// # use google_cloud_run_v2::*;
2622    /// # use builder::revisions::ClientBuilder;
2623    /// # use client::Revisions;
2624    /// let builder : ClientBuilder = Revisions::builder();
2625    /// let client = builder
2626    ///     .with_endpoint("https://run.googleapis.com")
2627    ///     .build().await?;
2628    /// # gax::client_builder::Result::<()>::Ok(()) });
2629    /// ```
2630    pub type ClientBuilder =
2631        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2632
2633    pub(crate) mod client {
2634        use super::super::super::client::Revisions;
2635        pub struct Factory;
2636        impl gax::client_builder::internal::ClientFactory for Factory {
2637            type Client = Revisions;
2638            type Credentials = gaxi::options::Credentials;
2639            async fn build(
2640                self,
2641                config: gaxi::options::ClientConfig,
2642            ) -> gax::client_builder::Result<Self::Client> {
2643                Self::Client::new(config).await
2644            }
2645        }
2646    }
2647
2648    /// Common implementation for [crate::client::Revisions] request builders.
2649    #[derive(Clone, Debug)]
2650    pub(crate) struct RequestBuilder<R: std::default::Default> {
2651        stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2652        request: R,
2653        options: gax::options::RequestOptions,
2654    }
2655
2656    impl<R> RequestBuilder<R>
2657    where
2658        R: std::default::Default,
2659    {
2660        pub(crate) fn new(
2661            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2662        ) -> Self {
2663            Self {
2664                stub,
2665                request: R::default(),
2666                options: gax::options::RequestOptions::default(),
2667            }
2668        }
2669    }
2670
2671    /// The request builder for [Revisions::get_revision][crate::client::Revisions::get_revision] calls.
2672    ///
2673    /// # Example
2674    /// ```no_run
2675    /// # use google_cloud_run_v2::builder;
2676    /// use builder::revisions::GetRevision;
2677    /// # tokio_test::block_on(async {
2678    ///
2679    /// let builder = prepare_request_builder();
2680    /// let response = builder.send().await?;
2681    /// # gax::Result::<()>::Ok(()) });
2682    ///
2683    /// fn prepare_request_builder() -> GetRevision {
2684    ///   # panic!();
2685    ///   // ... details omitted ...
2686    /// }
2687    /// ```
2688    #[derive(Clone, Debug)]
2689    pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
2690
2691    impl GetRevision {
2692        pub(crate) fn new(
2693            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2694        ) -> Self {
2695            Self(RequestBuilder::new(stub))
2696        }
2697
2698        /// Sets the full request, replacing any prior values.
2699        pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
2700            self.0.request = v.into();
2701            self
2702        }
2703
2704        /// Sets all the options, replacing any prior values.
2705        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2706            self.0.options = v.into();
2707            self
2708        }
2709
2710        /// Sends the request.
2711        pub async fn send(self) -> Result<crate::model::Revision> {
2712            (*self.0.stub)
2713                .get_revision(self.0.request, self.0.options)
2714                .await
2715                .map(gax::response::Response::into_body)
2716        }
2717
2718        /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2719        ///
2720        /// This is a **required** field for requests.
2721        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2722            self.0.request.name = v.into();
2723            self
2724        }
2725    }
2726
2727    #[doc(hidden)]
2728    impl gax::options::internal::RequestBuilder for GetRevision {
2729        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2730            &mut self.0.options
2731        }
2732    }
2733
2734    /// The request builder for [Revisions::list_revisions][crate::client::Revisions::list_revisions] calls.
2735    ///
2736    /// # Example
2737    /// ```no_run
2738    /// # use google_cloud_run_v2::builder;
2739    /// use builder::revisions::ListRevisions;
2740    /// # tokio_test::block_on(async {
2741    /// use gax::paginator::ItemPaginator;
2742    ///
2743    /// let builder = prepare_request_builder();
2744    /// let mut items = builder.by_item();
2745    /// while let Some(result) = items.next().await {
2746    ///   let item = result?;
2747    /// }
2748    /// # gax::Result::<()>::Ok(()) });
2749    ///
2750    /// fn prepare_request_builder() -> ListRevisions {
2751    ///   # panic!();
2752    ///   // ... details omitted ...
2753    /// }
2754    /// ```
2755    #[derive(Clone, Debug)]
2756    pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
2757
2758    impl ListRevisions {
2759        pub(crate) fn new(
2760            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2761        ) -> Self {
2762            Self(RequestBuilder::new(stub))
2763        }
2764
2765        /// Sets the full request, replacing any prior values.
2766        pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
2767            self.0.request = v.into();
2768            self
2769        }
2770
2771        /// Sets all the options, replacing any prior values.
2772        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2773            self.0.options = v.into();
2774            self
2775        }
2776
2777        /// Sends the request.
2778        pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
2779            (*self.0.stub)
2780                .list_revisions(self.0.request, self.0.options)
2781                .await
2782                .map(gax::response::Response::into_body)
2783        }
2784
2785        /// Streams each page in the collection.
2786        pub fn by_page(
2787            self,
2788        ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
2789        {
2790            use std::clone::Clone;
2791            let token = self.0.request.page_token.clone();
2792            let execute = move |token: String| {
2793                let mut builder = self.clone();
2794                builder.0.request = builder.0.request.set_page_token(token);
2795                builder.send()
2796            };
2797            gax::paginator::internal::new_paginator(token, execute)
2798        }
2799
2800        /// Streams each item in the collection.
2801        pub fn by_item(
2802            self,
2803        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
2804        {
2805            use gax::paginator::Paginator;
2806            self.by_page().items()
2807        }
2808
2809        /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2810        ///
2811        /// This is a **required** field for requests.
2812        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813            self.0.request.parent = v.into();
2814            self
2815        }
2816
2817        /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2818        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2819            self.0.request.page_size = v.into();
2820            self
2821        }
2822
2823        /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2824        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2825            self.0.request.page_token = v.into();
2826            self
2827        }
2828
2829        /// Sets the value of [show_deleted][crate::model::ListRevisionsRequest::show_deleted].
2830        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2831            self.0.request.show_deleted = v.into();
2832            self
2833        }
2834    }
2835
2836    #[doc(hidden)]
2837    impl gax::options::internal::RequestBuilder for ListRevisions {
2838        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2839            &mut self.0.options
2840        }
2841    }
2842
2843    /// The request builder for [Revisions::delete_revision][crate::client::Revisions::delete_revision] calls.
2844    ///
2845    /// # Example
2846    /// ```no_run
2847    /// # use google_cloud_run_v2::builder;
2848    /// use builder::revisions::DeleteRevision;
2849    /// # tokio_test::block_on(async {
2850    /// use lro::Poller;
2851    ///
2852    /// let builder = prepare_request_builder();
2853    /// let response = builder.poller().until_done().await?;
2854    /// # gax::Result::<()>::Ok(()) });
2855    ///
2856    /// fn prepare_request_builder() -> DeleteRevision {
2857    ///   # panic!();
2858    ///   // ... details omitted ...
2859    /// }
2860    /// ```
2861    #[derive(Clone, Debug)]
2862    pub struct DeleteRevision(RequestBuilder<crate::model::DeleteRevisionRequest>);
2863
2864    impl DeleteRevision {
2865        pub(crate) fn new(
2866            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2867        ) -> Self {
2868            Self(RequestBuilder::new(stub))
2869        }
2870
2871        /// Sets the full request, replacing any prior values.
2872        pub fn with_request<V: Into<crate::model::DeleteRevisionRequest>>(mut self, v: V) -> Self {
2873            self.0.request = v.into();
2874            self
2875        }
2876
2877        /// Sets all the options, replacing any prior values.
2878        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2879            self.0.options = v.into();
2880            self
2881        }
2882
2883        /// Sends the request.
2884        ///
2885        /// # Long running operations
2886        ///
2887        /// This starts, but does not poll, a longrunning operation. More information
2888        /// on [delete_revision][crate::client::Revisions::delete_revision].
2889        pub async fn send(self) -> Result<longrunning::model::Operation> {
2890            (*self.0.stub)
2891                .delete_revision(self.0.request, self.0.options)
2892                .await
2893                .map(gax::response::Response::into_body)
2894        }
2895
2896        /// Creates a [Poller][lro::Poller] to work with `delete_revision`.
2897        pub fn poller(self) -> impl lro::Poller<crate::model::Revision, crate::model::Revision> {
2898            type Operation =
2899                lro::internal::Operation<crate::model::Revision, crate::model::Revision>;
2900            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2901            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2902
2903            let stub = self.0.stub.clone();
2904            let mut options = self.0.options.clone();
2905            options.set_retry_policy(gax::retry_policy::NeverRetry);
2906            let query = move |name| {
2907                let stub = stub.clone();
2908                let options = options.clone();
2909                async {
2910                    let op = GetOperation::new(stub)
2911                        .set_name(name)
2912                        .with_options(options)
2913                        .send()
2914                        .await?;
2915                    Ok(Operation::new(op))
2916                }
2917            };
2918
2919            let start = move || async {
2920                let op = self.send().await?;
2921                Ok(Operation::new(op))
2922            };
2923
2924            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2925        }
2926
2927        /// Sets the value of [name][crate::model::DeleteRevisionRequest::name].
2928        ///
2929        /// This is a **required** field for requests.
2930        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2931            self.0.request.name = v.into();
2932            self
2933        }
2934
2935        /// Sets the value of [validate_only][crate::model::DeleteRevisionRequest::validate_only].
2936        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2937            self.0.request.validate_only = v.into();
2938            self
2939        }
2940
2941        /// Sets the value of [etag][crate::model::DeleteRevisionRequest::etag].
2942        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2943            self.0.request.etag = v.into();
2944            self
2945        }
2946    }
2947
2948    #[doc(hidden)]
2949    impl gax::options::internal::RequestBuilder for DeleteRevision {
2950        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2951            &mut self.0.options
2952        }
2953    }
2954
2955    /// The request builder for [Revisions::list_operations][crate::client::Revisions::list_operations] calls.
2956    ///
2957    /// # Example
2958    /// ```no_run
2959    /// # use google_cloud_run_v2::builder;
2960    /// use builder::revisions::ListOperations;
2961    /// # tokio_test::block_on(async {
2962    /// use gax::paginator::ItemPaginator;
2963    ///
2964    /// let builder = prepare_request_builder();
2965    /// let mut items = builder.by_item();
2966    /// while let Some(result) = items.next().await {
2967    ///   let item = result?;
2968    /// }
2969    /// # gax::Result::<()>::Ok(()) });
2970    ///
2971    /// fn prepare_request_builder() -> ListOperations {
2972    ///   # panic!();
2973    ///   // ... details omitted ...
2974    /// }
2975    /// ```
2976    #[derive(Clone, Debug)]
2977    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2978
2979    impl ListOperations {
2980        pub(crate) fn new(
2981            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2982        ) -> Self {
2983            Self(RequestBuilder::new(stub))
2984        }
2985
2986        /// Sets the full request, replacing any prior values.
2987        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2988            mut self,
2989            v: V,
2990        ) -> Self {
2991            self.0.request = v.into();
2992            self
2993        }
2994
2995        /// Sets all the options, replacing any prior values.
2996        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2997            self.0.options = v.into();
2998            self
2999        }
3000
3001        /// Sends the request.
3002        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3003            (*self.0.stub)
3004                .list_operations(self.0.request, self.0.options)
3005                .await
3006                .map(gax::response::Response::into_body)
3007        }
3008
3009        /// Streams each page in the collection.
3010        pub fn by_page(
3011            self,
3012        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3013        {
3014            use std::clone::Clone;
3015            let token = self.0.request.page_token.clone();
3016            let execute = move |token: String| {
3017                let mut builder = self.clone();
3018                builder.0.request = builder.0.request.set_page_token(token);
3019                builder.send()
3020            };
3021            gax::paginator::internal::new_paginator(token, execute)
3022        }
3023
3024        /// Streams each item in the collection.
3025        pub fn by_item(
3026            self,
3027        ) -> impl gax::paginator::ItemPaginator<
3028            longrunning::model::ListOperationsResponse,
3029            gax::error::Error,
3030        > {
3031            use gax::paginator::Paginator;
3032            self.by_page().items()
3033        }
3034
3035        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
3036        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3037            self.0.request.name = v.into();
3038            self
3039        }
3040
3041        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
3042        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043            self.0.request.filter = v.into();
3044            self
3045        }
3046
3047        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
3048        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3049            self.0.request.page_size = v.into();
3050            self
3051        }
3052
3053        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
3054        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055            self.0.request.page_token = v.into();
3056            self
3057        }
3058    }
3059
3060    #[doc(hidden)]
3061    impl gax::options::internal::RequestBuilder for ListOperations {
3062        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3063            &mut self.0.options
3064        }
3065    }
3066
3067    /// The request builder for [Revisions::get_operation][crate::client::Revisions::get_operation] calls.
3068    ///
3069    /// # Example
3070    /// ```no_run
3071    /// # use google_cloud_run_v2::builder;
3072    /// use builder::revisions::GetOperation;
3073    /// # tokio_test::block_on(async {
3074    ///
3075    /// let builder = prepare_request_builder();
3076    /// let response = builder.send().await?;
3077    /// # gax::Result::<()>::Ok(()) });
3078    ///
3079    /// fn prepare_request_builder() -> GetOperation {
3080    ///   # panic!();
3081    ///   // ... details omitted ...
3082    /// }
3083    /// ```
3084    #[derive(Clone, Debug)]
3085    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3086
3087    impl GetOperation {
3088        pub(crate) fn new(
3089            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3090        ) -> Self {
3091            Self(RequestBuilder::new(stub))
3092        }
3093
3094        /// Sets the full request, replacing any prior values.
3095        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3096            mut self,
3097            v: V,
3098        ) -> Self {
3099            self.0.request = v.into();
3100            self
3101        }
3102
3103        /// Sets all the options, replacing any prior values.
3104        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3105            self.0.options = v.into();
3106            self
3107        }
3108
3109        /// Sends the request.
3110        pub async fn send(self) -> Result<longrunning::model::Operation> {
3111            (*self.0.stub)
3112                .get_operation(self.0.request, self.0.options)
3113                .await
3114                .map(gax::response::Response::into_body)
3115        }
3116
3117        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
3118        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3119            self.0.request.name = v.into();
3120            self
3121        }
3122    }
3123
3124    #[doc(hidden)]
3125    impl gax::options::internal::RequestBuilder for GetOperation {
3126        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3127            &mut self.0.options
3128        }
3129    }
3130
3131    /// The request builder for [Revisions::delete_operation][crate::client::Revisions::delete_operation] calls.
3132    ///
3133    /// # Example
3134    /// ```no_run
3135    /// # use google_cloud_run_v2::builder;
3136    /// use builder::revisions::DeleteOperation;
3137    /// # tokio_test::block_on(async {
3138    ///
3139    /// let builder = prepare_request_builder();
3140    /// let response = builder.send().await?;
3141    /// # gax::Result::<()>::Ok(()) });
3142    ///
3143    /// fn prepare_request_builder() -> DeleteOperation {
3144    ///   # panic!();
3145    ///   // ... details omitted ...
3146    /// }
3147    /// ```
3148    #[derive(Clone, Debug)]
3149    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3150
3151    impl DeleteOperation {
3152        pub(crate) fn new(
3153            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3154        ) -> Self {
3155            Self(RequestBuilder::new(stub))
3156        }
3157
3158        /// Sets the full request, replacing any prior values.
3159        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3160            mut self,
3161            v: V,
3162        ) -> Self {
3163            self.0.request = v.into();
3164            self
3165        }
3166
3167        /// Sets all the options, replacing any prior values.
3168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3169            self.0.options = v.into();
3170            self
3171        }
3172
3173        /// Sends the request.
3174        pub async fn send(self) -> Result<()> {
3175            (*self.0.stub)
3176                .delete_operation(self.0.request, self.0.options)
3177                .await
3178                .map(gax::response::Response::into_body)
3179        }
3180
3181        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3182        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3183            self.0.request.name = v.into();
3184            self
3185        }
3186    }
3187
3188    #[doc(hidden)]
3189    impl gax::options::internal::RequestBuilder for DeleteOperation {
3190        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3191            &mut self.0.options
3192        }
3193    }
3194
3195    /// The request builder for [Revisions::wait_operation][crate::client::Revisions::wait_operation] calls.
3196    ///
3197    /// # Example
3198    /// ```no_run
3199    /// # use google_cloud_run_v2::builder;
3200    /// use builder::revisions::WaitOperation;
3201    /// # tokio_test::block_on(async {
3202    ///
3203    /// let builder = prepare_request_builder();
3204    /// let response = builder.send().await?;
3205    /// # gax::Result::<()>::Ok(()) });
3206    ///
3207    /// fn prepare_request_builder() -> WaitOperation {
3208    ///   # panic!();
3209    ///   // ... details omitted ...
3210    /// }
3211    /// ```
3212    #[derive(Clone, Debug)]
3213    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
3214
3215    impl WaitOperation {
3216        pub(crate) fn new(
3217            stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3218        ) -> Self {
3219            Self(RequestBuilder::new(stub))
3220        }
3221
3222        /// Sets the full request, replacing any prior values.
3223        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
3224            mut self,
3225            v: V,
3226        ) -> Self {
3227            self.0.request = v.into();
3228            self
3229        }
3230
3231        /// Sets all the options, replacing any prior values.
3232        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3233            self.0.options = v.into();
3234            self
3235        }
3236
3237        /// Sends the request.
3238        pub async fn send(self) -> Result<longrunning::model::Operation> {
3239            (*self.0.stub)
3240                .wait_operation(self.0.request, self.0.options)
3241                .await
3242                .map(gax::response::Response::into_body)
3243        }
3244
3245        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
3246        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247            self.0.request.name = v.into();
3248            self
3249        }
3250
3251        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
3252        pub fn set_timeout<T>(mut self, v: T) -> Self
3253        where
3254            T: std::convert::Into<wkt::Duration>,
3255        {
3256            self.0.request.timeout = std::option::Option::Some(v.into());
3257            self
3258        }
3259
3260        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
3261        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3262        where
3263            T: std::convert::Into<wkt::Duration>,
3264        {
3265            self.0.request.timeout = v.map(|x| x.into());
3266            self
3267        }
3268    }
3269
3270    #[doc(hidden)]
3271    impl gax::options::internal::RequestBuilder for WaitOperation {
3272        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3273            &mut self.0.options
3274        }
3275    }
3276}
3277
3278pub mod services {
3279    use crate::Result;
3280
3281    /// A builder for [Services][crate::client::Services].
3282    ///
3283    /// ```
3284    /// # tokio_test::block_on(async {
3285    /// # use google_cloud_run_v2::*;
3286    /// # use builder::services::ClientBuilder;
3287    /// # use client::Services;
3288    /// let builder : ClientBuilder = Services::builder();
3289    /// let client = builder
3290    ///     .with_endpoint("https://run.googleapis.com")
3291    ///     .build().await?;
3292    /// # gax::client_builder::Result::<()>::Ok(()) });
3293    /// ```
3294    pub type ClientBuilder =
3295        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3296
3297    pub(crate) mod client {
3298        use super::super::super::client::Services;
3299        pub struct Factory;
3300        impl gax::client_builder::internal::ClientFactory for Factory {
3301            type Client = Services;
3302            type Credentials = gaxi::options::Credentials;
3303            async fn build(
3304                self,
3305                config: gaxi::options::ClientConfig,
3306            ) -> gax::client_builder::Result<Self::Client> {
3307                Self::Client::new(config).await
3308            }
3309        }
3310    }
3311
3312    /// Common implementation for [crate::client::Services] request builders.
3313    #[derive(Clone, Debug)]
3314    pub(crate) struct RequestBuilder<R: std::default::Default> {
3315        stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
3316        request: R,
3317        options: gax::options::RequestOptions,
3318    }
3319
3320    impl<R> RequestBuilder<R>
3321    where
3322        R: std::default::Default,
3323    {
3324        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3325            Self {
3326                stub,
3327                request: R::default(),
3328                options: gax::options::RequestOptions::default(),
3329            }
3330        }
3331    }
3332
3333    /// The request builder for [Services::create_service][crate::client::Services::create_service] calls.
3334    ///
3335    /// # Example
3336    /// ```no_run
3337    /// # use google_cloud_run_v2::builder;
3338    /// use builder::services::CreateService;
3339    /// # tokio_test::block_on(async {
3340    /// use lro::Poller;
3341    ///
3342    /// let builder = prepare_request_builder();
3343    /// let response = builder.poller().until_done().await?;
3344    /// # gax::Result::<()>::Ok(()) });
3345    ///
3346    /// fn prepare_request_builder() -> CreateService {
3347    ///   # panic!();
3348    ///   // ... details omitted ...
3349    /// }
3350    /// ```
3351    #[derive(Clone, Debug)]
3352    pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
3353
3354    impl CreateService {
3355        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3356            Self(RequestBuilder::new(stub))
3357        }
3358
3359        /// Sets the full request, replacing any prior values.
3360        pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
3361            self.0.request = v.into();
3362            self
3363        }
3364
3365        /// Sets all the options, replacing any prior values.
3366        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3367            self.0.options = v.into();
3368            self
3369        }
3370
3371        /// Sends the request.
3372        ///
3373        /// # Long running operations
3374        ///
3375        /// This starts, but does not poll, a longrunning operation. More information
3376        /// on [create_service][crate::client::Services::create_service].
3377        pub async fn send(self) -> Result<longrunning::model::Operation> {
3378            (*self.0.stub)
3379                .create_service(self.0.request, self.0.options)
3380                .await
3381                .map(gax::response::Response::into_body)
3382        }
3383
3384        /// Creates a [Poller][lro::Poller] to work with `create_service`.
3385        pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3386            type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3387            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3388            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3389
3390            let stub = self.0.stub.clone();
3391            let mut options = self.0.options.clone();
3392            options.set_retry_policy(gax::retry_policy::NeverRetry);
3393            let query = move |name| {
3394                let stub = stub.clone();
3395                let options = options.clone();
3396                async {
3397                    let op = GetOperation::new(stub)
3398                        .set_name(name)
3399                        .with_options(options)
3400                        .send()
3401                        .await?;
3402                    Ok(Operation::new(op))
3403                }
3404            };
3405
3406            let start = move || async {
3407                let op = self.send().await?;
3408                Ok(Operation::new(op))
3409            };
3410
3411            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3412        }
3413
3414        /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
3415        ///
3416        /// This is a **required** field for requests.
3417        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3418            self.0.request.parent = v.into();
3419            self
3420        }
3421
3422        /// Sets the value of [service][crate::model::CreateServiceRequest::service].
3423        ///
3424        /// This is a **required** field for requests.
3425        pub fn set_service<T>(mut self, v: T) -> Self
3426        where
3427            T: std::convert::Into<crate::model::Service>,
3428        {
3429            self.0.request.service = std::option::Option::Some(v.into());
3430            self
3431        }
3432
3433        /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
3434        ///
3435        /// This is a **required** field for requests.
3436        pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3437        where
3438            T: std::convert::Into<crate::model::Service>,
3439        {
3440            self.0.request.service = v.map(|x| x.into());
3441            self
3442        }
3443
3444        /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
3445        ///
3446        /// This is a **required** field for requests.
3447        pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448            self.0.request.service_id = v.into();
3449            self
3450        }
3451
3452        /// Sets the value of [validate_only][crate::model::CreateServiceRequest::validate_only].
3453        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3454            self.0.request.validate_only = v.into();
3455            self
3456        }
3457    }
3458
3459    #[doc(hidden)]
3460    impl gax::options::internal::RequestBuilder for CreateService {
3461        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3462            &mut self.0.options
3463        }
3464    }
3465
3466    /// The request builder for [Services::get_service][crate::client::Services::get_service] calls.
3467    ///
3468    /// # Example
3469    /// ```no_run
3470    /// # use google_cloud_run_v2::builder;
3471    /// use builder::services::GetService;
3472    /// # tokio_test::block_on(async {
3473    ///
3474    /// let builder = prepare_request_builder();
3475    /// let response = builder.send().await?;
3476    /// # gax::Result::<()>::Ok(()) });
3477    ///
3478    /// fn prepare_request_builder() -> GetService {
3479    ///   # panic!();
3480    ///   // ... details omitted ...
3481    /// }
3482    /// ```
3483    #[derive(Clone, Debug)]
3484    pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
3485
3486    impl GetService {
3487        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3488            Self(RequestBuilder::new(stub))
3489        }
3490
3491        /// Sets the full request, replacing any prior values.
3492        pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
3493            self.0.request = v.into();
3494            self
3495        }
3496
3497        /// Sets all the options, replacing any prior values.
3498        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3499            self.0.options = v.into();
3500            self
3501        }
3502
3503        /// Sends the request.
3504        pub async fn send(self) -> Result<crate::model::Service> {
3505            (*self.0.stub)
3506                .get_service(self.0.request, self.0.options)
3507                .await
3508                .map(gax::response::Response::into_body)
3509        }
3510
3511        /// Sets the value of [name][crate::model::GetServiceRequest::name].
3512        ///
3513        /// This is a **required** field for requests.
3514        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3515            self.0.request.name = v.into();
3516            self
3517        }
3518    }
3519
3520    #[doc(hidden)]
3521    impl gax::options::internal::RequestBuilder for GetService {
3522        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3523            &mut self.0.options
3524        }
3525    }
3526
3527    /// The request builder for [Services::list_services][crate::client::Services::list_services] calls.
3528    ///
3529    /// # Example
3530    /// ```no_run
3531    /// # use google_cloud_run_v2::builder;
3532    /// use builder::services::ListServices;
3533    /// # tokio_test::block_on(async {
3534    /// use gax::paginator::ItemPaginator;
3535    ///
3536    /// let builder = prepare_request_builder();
3537    /// let mut items = builder.by_item();
3538    /// while let Some(result) = items.next().await {
3539    ///   let item = result?;
3540    /// }
3541    /// # gax::Result::<()>::Ok(()) });
3542    ///
3543    /// fn prepare_request_builder() -> ListServices {
3544    ///   # panic!();
3545    ///   // ... details omitted ...
3546    /// }
3547    /// ```
3548    #[derive(Clone, Debug)]
3549    pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
3550
3551    impl ListServices {
3552        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3553            Self(RequestBuilder::new(stub))
3554        }
3555
3556        /// Sets the full request, replacing any prior values.
3557        pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
3558            self.0.request = v.into();
3559            self
3560        }
3561
3562        /// Sets all the options, replacing any prior values.
3563        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3564            self.0.options = v.into();
3565            self
3566        }
3567
3568        /// Sends the request.
3569        pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
3570            (*self.0.stub)
3571                .list_services(self.0.request, self.0.options)
3572                .await
3573                .map(gax::response::Response::into_body)
3574        }
3575
3576        /// Streams each page in the collection.
3577        pub fn by_page(
3578            self,
3579        ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
3580        {
3581            use std::clone::Clone;
3582            let token = self.0.request.page_token.clone();
3583            let execute = move |token: String| {
3584                let mut builder = self.clone();
3585                builder.0.request = builder.0.request.set_page_token(token);
3586                builder.send()
3587            };
3588            gax::paginator::internal::new_paginator(token, execute)
3589        }
3590
3591        /// Streams each item in the collection.
3592        pub fn by_item(
3593            self,
3594        ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
3595        {
3596            use gax::paginator::Paginator;
3597            self.by_page().items()
3598        }
3599
3600        /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
3601        ///
3602        /// This is a **required** field for requests.
3603        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604            self.0.request.parent = v.into();
3605            self
3606        }
3607
3608        /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
3609        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3610            self.0.request.page_size = v.into();
3611            self
3612        }
3613
3614        /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
3615        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3616            self.0.request.page_token = v.into();
3617            self
3618        }
3619
3620        /// Sets the value of [show_deleted][crate::model::ListServicesRequest::show_deleted].
3621        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3622            self.0.request.show_deleted = v.into();
3623            self
3624        }
3625    }
3626
3627    #[doc(hidden)]
3628    impl gax::options::internal::RequestBuilder for ListServices {
3629        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3630            &mut self.0.options
3631        }
3632    }
3633
3634    /// The request builder for [Services::update_service][crate::client::Services::update_service] calls.
3635    ///
3636    /// # Example
3637    /// ```no_run
3638    /// # use google_cloud_run_v2::builder;
3639    /// use builder::services::UpdateService;
3640    /// # tokio_test::block_on(async {
3641    /// use lro::Poller;
3642    ///
3643    /// let builder = prepare_request_builder();
3644    /// let response = builder.poller().until_done().await?;
3645    /// # gax::Result::<()>::Ok(()) });
3646    ///
3647    /// fn prepare_request_builder() -> UpdateService {
3648    ///   # panic!();
3649    ///   // ... details omitted ...
3650    /// }
3651    /// ```
3652    #[derive(Clone, Debug)]
3653    pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
3654
3655    impl UpdateService {
3656        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3657            Self(RequestBuilder::new(stub))
3658        }
3659
3660        /// Sets the full request, replacing any prior values.
3661        pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
3662            self.0.request = v.into();
3663            self
3664        }
3665
3666        /// Sets all the options, replacing any prior values.
3667        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3668            self.0.options = v.into();
3669            self
3670        }
3671
3672        /// Sends the request.
3673        ///
3674        /// # Long running operations
3675        ///
3676        /// This starts, but does not poll, a longrunning operation. More information
3677        /// on [update_service][crate::client::Services::update_service].
3678        pub async fn send(self) -> Result<longrunning::model::Operation> {
3679            (*self.0.stub)
3680                .update_service(self.0.request, self.0.options)
3681                .await
3682                .map(gax::response::Response::into_body)
3683        }
3684
3685        /// Creates a [Poller][lro::Poller] to work with `update_service`.
3686        pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3687            type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3688            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3689            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3690
3691            let stub = self.0.stub.clone();
3692            let mut options = self.0.options.clone();
3693            options.set_retry_policy(gax::retry_policy::NeverRetry);
3694            let query = move |name| {
3695                let stub = stub.clone();
3696                let options = options.clone();
3697                async {
3698                    let op = GetOperation::new(stub)
3699                        .set_name(name)
3700                        .with_options(options)
3701                        .send()
3702                        .await?;
3703                    Ok(Operation::new(op))
3704                }
3705            };
3706
3707            let start = move || async {
3708                let op = self.send().await?;
3709                Ok(Operation::new(op))
3710            };
3711
3712            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3713        }
3714
3715        /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
3716        pub fn set_update_mask<T>(mut self, v: T) -> Self
3717        where
3718            T: std::convert::Into<wkt::FieldMask>,
3719        {
3720            self.0.request.update_mask = std::option::Option::Some(v.into());
3721            self
3722        }
3723
3724        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
3725        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3726        where
3727            T: std::convert::Into<wkt::FieldMask>,
3728        {
3729            self.0.request.update_mask = v.map(|x| x.into());
3730            self
3731        }
3732
3733        /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
3734        ///
3735        /// This is a **required** field for requests.
3736        pub fn set_service<T>(mut self, v: T) -> Self
3737        where
3738            T: std::convert::Into<crate::model::Service>,
3739        {
3740            self.0.request.service = std::option::Option::Some(v.into());
3741            self
3742        }
3743
3744        /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
3745        ///
3746        /// This is a **required** field for requests.
3747        pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3748        where
3749            T: std::convert::Into<crate::model::Service>,
3750        {
3751            self.0.request.service = v.map(|x| x.into());
3752            self
3753        }
3754
3755        /// Sets the value of [validate_only][crate::model::UpdateServiceRequest::validate_only].
3756        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3757            self.0.request.validate_only = v.into();
3758            self
3759        }
3760
3761        /// Sets the value of [allow_missing][crate::model::UpdateServiceRequest::allow_missing].
3762        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3763            self.0.request.allow_missing = v.into();
3764            self
3765        }
3766    }
3767
3768    #[doc(hidden)]
3769    impl gax::options::internal::RequestBuilder for UpdateService {
3770        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3771            &mut self.0.options
3772        }
3773    }
3774
3775    /// The request builder for [Services::delete_service][crate::client::Services::delete_service] calls.
3776    ///
3777    /// # Example
3778    /// ```no_run
3779    /// # use google_cloud_run_v2::builder;
3780    /// use builder::services::DeleteService;
3781    /// # tokio_test::block_on(async {
3782    /// use lro::Poller;
3783    ///
3784    /// let builder = prepare_request_builder();
3785    /// let response = builder.poller().until_done().await?;
3786    /// # gax::Result::<()>::Ok(()) });
3787    ///
3788    /// fn prepare_request_builder() -> DeleteService {
3789    ///   # panic!();
3790    ///   // ... details omitted ...
3791    /// }
3792    /// ```
3793    #[derive(Clone, Debug)]
3794    pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
3795
3796    impl DeleteService {
3797        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3798            Self(RequestBuilder::new(stub))
3799        }
3800
3801        /// Sets the full request, replacing any prior values.
3802        pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
3803            self.0.request = v.into();
3804            self
3805        }
3806
3807        /// Sets all the options, replacing any prior values.
3808        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3809            self.0.options = v.into();
3810            self
3811        }
3812
3813        /// Sends the request.
3814        ///
3815        /// # Long running operations
3816        ///
3817        /// This starts, but does not poll, a longrunning operation. More information
3818        /// on [delete_service][crate::client::Services::delete_service].
3819        pub async fn send(self) -> Result<longrunning::model::Operation> {
3820            (*self.0.stub)
3821                .delete_service(self.0.request, self.0.options)
3822                .await
3823                .map(gax::response::Response::into_body)
3824        }
3825
3826        /// Creates a [Poller][lro::Poller] to work with `delete_service`.
3827        pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3828            type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3829            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3830            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3831
3832            let stub = self.0.stub.clone();
3833            let mut options = self.0.options.clone();
3834            options.set_retry_policy(gax::retry_policy::NeverRetry);
3835            let query = move |name| {
3836                let stub = stub.clone();
3837                let options = options.clone();
3838                async {
3839                    let op = GetOperation::new(stub)
3840                        .set_name(name)
3841                        .with_options(options)
3842                        .send()
3843                        .await?;
3844                    Ok(Operation::new(op))
3845                }
3846            };
3847
3848            let start = move || async {
3849                let op = self.send().await?;
3850                Ok(Operation::new(op))
3851            };
3852
3853            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3854        }
3855
3856        /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
3857        ///
3858        /// This is a **required** field for requests.
3859        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3860            self.0.request.name = v.into();
3861            self
3862        }
3863
3864        /// Sets the value of [validate_only][crate::model::DeleteServiceRequest::validate_only].
3865        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3866            self.0.request.validate_only = v.into();
3867            self
3868        }
3869
3870        /// Sets the value of [etag][crate::model::DeleteServiceRequest::etag].
3871        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3872            self.0.request.etag = v.into();
3873            self
3874        }
3875    }
3876
3877    #[doc(hidden)]
3878    impl gax::options::internal::RequestBuilder for DeleteService {
3879        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3880            &mut self.0.options
3881        }
3882    }
3883
3884    /// The request builder for [Services::get_iam_policy][crate::client::Services::get_iam_policy] calls.
3885    ///
3886    /// # Example
3887    /// ```no_run
3888    /// # use google_cloud_run_v2::builder;
3889    /// use builder::services::GetIamPolicy;
3890    /// # tokio_test::block_on(async {
3891    ///
3892    /// let builder = prepare_request_builder();
3893    /// let response = builder.send().await?;
3894    /// # gax::Result::<()>::Ok(()) });
3895    ///
3896    /// fn prepare_request_builder() -> GetIamPolicy {
3897    ///   # panic!();
3898    ///   // ... details omitted ...
3899    /// }
3900    /// ```
3901    #[derive(Clone, Debug)]
3902    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3903
3904    impl GetIamPolicy {
3905        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3906            Self(RequestBuilder::new(stub))
3907        }
3908
3909        /// Sets the full request, replacing any prior values.
3910        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3911            self.0.request = v.into();
3912            self
3913        }
3914
3915        /// Sets all the options, replacing any prior values.
3916        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3917            self.0.options = v.into();
3918            self
3919        }
3920
3921        /// Sends the request.
3922        pub async fn send(self) -> Result<iam_v1::model::Policy> {
3923            (*self.0.stub)
3924                .get_iam_policy(self.0.request, self.0.options)
3925                .await
3926                .map(gax::response::Response::into_body)
3927        }
3928
3929        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
3930        ///
3931        /// This is a **required** field for requests.
3932        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3933            self.0.request.resource = v.into();
3934            self
3935        }
3936
3937        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
3938        pub fn set_options<T>(mut self, v: T) -> Self
3939        where
3940            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3941        {
3942            self.0.request.options = std::option::Option::Some(v.into());
3943            self
3944        }
3945
3946        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
3947        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3948        where
3949            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3950        {
3951            self.0.request.options = v.map(|x| x.into());
3952            self
3953        }
3954    }
3955
3956    #[doc(hidden)]
3957    impl gax::options::internal::RequestBuilder for GetIamPolicy {
3958        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3959            &mut self.0.options
3960        }
3961    }
3962
3963    /// The request builder for [Services::set_iam_policy][crate::client::Services::set_iam_policy] calls.
3964    ///
3965    /// # Example
3966    /// ```no_run
3967    /// # use google_cloud_run_v2::builder;
3968    /// use builder::services::SetIamPolicy;
3969    /// # tokio_test::block_on(async {
3970    ///
3971    /// let builder = prepare_request_builder();
3972    /// let response = builder.send().await?;
3973    /// # gax::Result::<()>::Ok(()) });
3974    ///
3975    /// fn prepare_request_builder() -> SetIamPolicy {
3976    ///   # panic!();
3977    ///   // ... details omitted ...
3978    /// }
3979    /// ```
3980    #[derive(Clone, Debug)]
3981    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3982
3983    impl SetIamPolicy {
3984        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3985            Self(RequestBuilder::new(stub))
3986        }
3987
3988        /// Sets the full request, replacing any prior values.
3989        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3990            self.0.request = v.into();
3991            self
3992        }
3993
3994        /// Sets all the options, replacing any prior values.
3995        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3996            self.0.options = v.into();
3997            self
3998        }
3999
4000        /// Sends the request.
4001        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4002            (*self.0.stub)
4003                .set_iam_policy(self.0.request, self.0.options)
4004                .await
4005                .map(gax::response::Response::into_body)
4006        }
4007
4008        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
4009        ///
4010        /// This is a **required** field for requests.
4011        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4012            self.0.request.resource = v.into();
4013            self
4014        }
4015
4016        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4017        ///
4018        /// This is a **required** field for requests.
4019        pub fn set_policy<T>(mut self, v: T) -> Self
4020        where
4021            T: std::convert::Into<iam_v1::model::Policy>,
4022        {
4023            self.0.request.policy = std::option::Option::Some(v.into());
4024            self
4025        }
4026
4027        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4028        ///
4029        /// This is a **required** field for requests.
4030        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4031        where
4032            T: std::convert::Into<iam_v1::model::Policy>,
4033        {
4034            self.0.request.policy = v.map(|x| x.into());
4035            self
4036        }
4037
4038        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4039        pub fn set_update_mask<T>(mut self, v: T) -> Self
4040        where
4041            T: std::convert::Into<wkt::FieldMask>,
4042        {
4043            self.0.request.update_mask = std::option::Option::Some(v.into());
4044            self
4045        }
4046
4047        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4048        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4049        where
4050            T: std::convert::Into<wkt::FieldMask>,
4051        {
4052            self.0.request.update_mask = v.map(|x| x.into());
4053            self
4054        }
4055    }
4056
4057    #[doc(hidden)]
4058    impl gax::options::internal::RequestBuilder for SetIamPolicy {
4059        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4060            &mut self.0.options
4061        }
4062    }
4063
4064    /// The request builder for [Services::test_iam_permissions][crate::client::Services::test_iam_permissions] calls.
4065    ///
4066    /// # Example
4067    /// ```no_run
4068    /// # use google_cloud_run_v2::builder;
4069    /// use builder::services::TestIamPermissions;
4070    /// # tokio_test::block_on(async {
4071    ///
4072    /// let builder = prepare_request_builder();
4073    /// let response = builder.send().await?;
4074    /// # gax::Result::<()>::Ok(()) });
4075    ///
4076    /// fn prepare_request_builder() -> TestIamPermissions {
4077    ///   # panic!();
4078    ///   // ... details omitted ...
4079    /// }
4080    /// ```
4081    #[derive(Clone, Debug)]
4082    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4083
4084    impl TestIamPermissions {
4085        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4086            Self(RequestBuilder::new(stub))
4087        }
4088
4089        /// Sets the full request, replacing any prior values.
4090        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4091            mut self,
4092            v: V,
4093        ) -> Self {
4094            self.0.request = v.into();
4095            self
4096        }
4097
4098        /// Sets all the options, replacing any prior values.
4099        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4100            self.0.options = v.into();
4101            self
4102        }
4103
4104        /// Sends the request.
4105        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4106            (*self.0.stub)
4107                .test_iam_permissions(self.0.request, self.0.options)
4108                .await
4109                .map(gax::response::Response::into_body)
4110        }
4111
4112        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
4113        ///
4114        /// This is a **required** field for requests.
4115        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116            self.0.request.resource = v.into();
4117            self
4118        }
4119
4120        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
4121        ///
4122        /// This is a **required** field for requests.
4123        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4124        where
4125            T: std::iter::IntoIterator<Item = V>,
4126            V: std::convert::Into<std::string::String>,
4127        {
4128            use std::iter::Iterator;
4129            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4130            self
4131        }
4132    }
4133
4134    #[doc(hidden)]
4135    impl gax::options::internal::RequestBuilder for TestIamPermissions {
4136        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4137            &mut self.0.options
4138        }
4139    }
4140
4141    /// The request builder for [Services::list_operations][crate::client::Services::list_operations] calls.
4142    ///
4143    /// # Example
4144    /// ```no_run
4145    /// # use google_cloud_run_v2::builder;
4146    /// use builder::services::ListOperations;
4147    /// # tokio_test::block_on(async {
4148    /// use gax::paginator::ItemPaginator;
4149    ///
4150    /// let builder = prepare_request_builder();
4151    /// let mut items = builder.by_item();
4152    /// while let Some(result) = items.next().await {
4153    ///   let item = result?;
4154    /// }
4155    /// # gax::Result::<()>::Ok(()) });
4156    ///
4157    /// fn prepare_request_builder() -> ListOperations {
4158    ///   # panic!();
4159    ///   // ... details omitted ...
4160    /// }
4161    /// ```
4162    #[derive(Clone, Debug)]
4163    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4164
4165    impl ListOperations {
4166        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4167            Self(RequestBuilder::new(stub))
4168        }
4169
4170        /// Sets the full request, replacing any prior values.
4171        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4172            mut self,
4173            v: V,
4174        ) -> Self {
4175            self.0.request = v.into();
4176            self
4177        }
4178
4179        /// Sets all the options, replacing any prior values.
4180        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4181            self.0.options = v.into();
4182            self
4183        }
4184
4185        /// Sends the request.
4186        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4187            (*self.0.stub)
4188                .list_operations(self.0.request, self.0.options)
4189                .await
4190                .map(gax::response::Response::into_body)
4191        }
4192
4193        /// Streams each page in the collection.
4194        pub fn by_page(
4195            self,
4196        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4197        {
4198            use std::clone::Clone;
4199            let token = self.0.request.page_token.clone();
4200            let execute = move |token: String| {
4201                let mut builder = self.clone();
4202                builder.0.request = builder.0.request.set_page_token(token);
4203                builder.send()
4204            };
4205            gax::paginator::internal::new_paginator(token, execute)
4206        }
4207
4208        /// Streams each item in the collection.
4209        pub fn by_item(
4210            self,
4211        ) -> impl gax::paginator::ItemPaginator<
4212            longrunning::model::ListOperationsResponse,
4213            gax::error::Error,
4214        > {
4215            use gax::paginator::Paginator;
4216            self.by_page().items()
4217        }
4218
4219        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4220        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4221            self.0.request.name = v.into();
4222            self
4223        }
4224
4225        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4226        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4227            self.0.request.filter = v.into();
4228            self
4229        }
4230
4231        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4232        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4233            self.0.request.page_size = v.into();
4234            self
4235        }
4236
4237        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4238        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4239            self.0.request.page_token = v.into();
4240            self
4241        }
4242    }
4243
4244    #[doc(hidden)]
4245    impl gax::options::internal::RequestBuilder for ListOperations {
4246        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4247            &mut self.0.options
4248        }
4249    }
4250
4251    /// The request builder for [Services::get_operation][crate::client::Services::get_operation] calls.
4252    ///
4253    /// # Example
4254    /// ```no_run
4255    /// # use google_cloud_run_v2::builder;
4256    /// use builder::services::GetOperation;
4257    /// # tokio_test::block_on(async {
4258    ///
4259    /// let builder = prepare_request_builder();
4260    /// let response = builder.send().await?;
4261    /// # gax::Result::<()>::Ok(()) });
4262    ///
4263    /// fn prepare_request_builder() -> GetOperation {
4264    ///   # panic!();
4265    ///   // ... details omitted ...
4266    /// }
4267    /// ```
4268    #[derive(Clone, Debug)]
4269    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4270
4271    impl GetOperation {
4272        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4273            Self(RequestBuilder::new(stub))
4274        }
4275
4276        /// Sets the full request, replacing any prior values.
4277        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4278            mut self,
4279            v: V,
4280        ) -> Self {
4281            self.0.request = v.into();
4282            self
4283        }
4284
4285        /// Sets all the options, replacing any prior values.
4286        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4287            self.0.options = v.into();
4288            self
4289        }
4290
4291        /// Sends the request.
4292        pub async fn send(self) -> Result<longrunning::model::Operation> {
4293            (*self.0.stub)
4294                .get_operation(self.0.request, self.0.options)
4295                .await
4296                .map(gax::response::Response::into_body)
4297        }
4298
4299        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4300        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4301            self.0.request.name = v.into();
4302            self
4303        }
4304    }
4305
4306    #[doc(hidden)]
4307    impl gax::options::internal::RequestBuilder for GetOperation {
4308        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4309            &mut self.0.options
4310        }
4311    }
4312
4313    /// The request builder for [Services::delete_operation][crate::client::Services::delete_operation] calls.
4314    ///
4315    /// # Example
4316    /// ```no_run
4317    /// # use google_cloud_run_v2::builder;
4318    /// use builder::services::DeleteOperation;
4319    /// # tokio_test::block_on(async {
4320    ///
4321    /// let builder = prepare_request_builder();
4322    /// let response = builder.send().await?;
4323    /// # gax::Result::<()>::Ok(()) });
4324    ///
4325    /// fn prepare_request_builder() -> DeleteOperation {
4326    ///   # panic!();
4327    ///   // ... details omitted ...
4328    /// }
4329    /// ```
4330    #[derive(Clone, Debug)]
4331    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4332
4333    impl DeleteOperation {
4334        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4335            Self(RequestBuilder::new(stub))
4336        }
4337
4338        /// Sets the full request, replacing any prior values.
4339        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4340            mut self,
4341            v: V,
4342        ) -> Self {
4343            self.0.request = v.into();
4344            self
4345        }
4346
4347        /// Sets all the options, replacing any prior values.
4348        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4349            self.0.options = v.into();
4350            self
4351        }
4352
4353        /// Sends the request.
4354        pub async fn send(self) -> Result<()> {
4355            (*self.0.stub)
4356                .delete_operation(self.0.request, self.0.options)
4357                .await
4358                .map(gax::response::Response::into_body)
4359        }
4360
4361        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
4362        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363            self.0.request.name = v.into();
4364            self
4365        }
4366    }
4367
4368    #[doc(hidden)]
4369    impl gax::options::internal::RequestBuilder for DeleteOperation {
4370        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4371            &mut self.0.options
4372        }
4373    }
4374
4375    /// The request builder for [Services::wait_operation][crate::client::Services::wait_operation] calls.
4376    ///
4377    /// # Example
4378    /// ```no_run
4379    /// # use google_cloud_run_v2::builder;
4380    /// use builder::services::WaitOperation;
4381    /// # tokio_test::block_on(async {
4382    ///
4383    /// let builder = prepare_request_builder();
4384    /// let response = builder.send().await?;
4385    /// # gax::Result::<()>::Ok(()) });
4386    ///
4387    /// fn prepare_request_builder() -> WaitOperation {
4388    ///   # panic!();
4389    ///   // ... details omitted ...
4390    /// }
4391    /// ```
4392    #[derive(Clone, Debug)]
4393    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4394
4395    impl WaitOperation {
4396        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4397            Self(RequestBuilder::new(stub))
4398        }
4399
4400        /// Sets the full request, replacing any prior values.
4401        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4402            mut self,
4403            v: V,
4404        ) -> Self {
4405            self.0.request = v.into();
4406            self
4407        }
4408
4409        /// Sets all the options, replacing any prior values.
4410        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4411            self.0.options = v.into();
4412            self
4413        }
4414
4415        /// Sends the request.
4416        pub async fn send(self) -> Result<longrunning::model::Operation> {
4417            (*self.0.stub)
4418                .wait_operation(self.0.request, self.0.options)
4419                .await
4420                .map(gax::response::Response::into_body)
4421        }
4422
4423        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
4424        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4425            self.0.request.name = v.into();
4426            self
4427        }
4428
4429        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
4430        pub fn set_timeout<T>(mut self, v: T) -> Self
4431        where
4432            T: std::convert::Into<wkt::Duration>,
4433        {
4434            self.0.request.timeout = std::option::Option::Some(v.into());
4435            self
4436        }
4437
4438        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
4439        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4440        where
4441            T: std::convert::Into<wkt::Duration>,
4442        {
4443            self.0.request.timeout = v.map(|x| x.into());
4444            self
4445        }
4446    }
4447
4448    #[doc(hidden)]
4449    impl gax::options::internal::RequestBuilder for WaitOperation {
4450        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4451            &mut self.0.options
4452        }
4453    }
4454}
4455
4456pub mod tasks {
4457    use crate::Result;
4458
4459    /// A builder for [Tasks][crate::client::Tasks].
4460    ///
4461    /// ```
4462    /// # tokio_test::block_on(async {
4463    /// # use google_cloud_run_v2::*;
4464    /// # use builder::tasks::ClientBuilder;
4465    /// # use client::Tasks;
4466    /// let builder : ClientBuilder = Tasks::builder();
4467    /// let client = builder
4468    ///     .with_endpoint("https://run.googleapis.com")
4469    ///     .build().await?;
4470    /// # gax::client_builder::Result::<()>::Ok(()) });
4471    /// ```
4472    pub type ClientBuilder =
4473        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4474
4475    pub(crate) mod client {
4476        use super::super::super::client::Tasks;
4477        pub struct Factory;
4478        impl gax::client_builder::internal::ClientFactory for Factory {
4479            type Client = Tasks;
4480            type Credentials = gaxi::options::Credentials;
4481            async fn build(
4482                self,
4483                config: gaxi::options::ClientConfig,
4484            ) -> gax::client_builder::Result<Self::Client> {
4485                Self::Client::new(config).await
4486            }
4487        }
4488    }
4489
4490    /// Common implementation for [crate::client::Tasks] request builders.
4491    #[derive(Clone, Debug)]
4492    pub(crate) struct RequestBuilder<R: std::default::Default> {
4493        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>,
4494        request: R,
4495        options: gax::options::RequestOptions,
4496    }
4497
4498    impl<R> RequestBuilder<R>
4499    where
4500        R: std::default::Default,
4501    {
4502        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4503            Self {
4504                stub,
4505                request: R::default(),
4506                options: gax::options::RequestOptions::default(),
4507            }
4508        }
4509    }
4510
4511    /// The request builder for [Tasks::get_task][crate::client::Tasks::get_task] calls.
4512    ///
4513    /// # Example
4514    /// ```no_run
4515    /// # use google_cloud_run_v2::builder;
4516    /// use builder::tasks::GetTask;
4517    /// # tokio_test::block_on(async {
4518    ///
4519    /// let builder = prepare_request_builder();
4520    /// let response = builder.send().await?;
4521    /// # gax::Result::<()>::Ok(()) });
4522    ///
4523    /// fn prepare_request_builder() -> GetTask {
4524    ///   # panic!();
4525    ///   // ... details omitted ...
4526    /// }
4527    /// ```
4528    #[derive(Clone, Debug)]
4529    pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
4530
4531    impl GetTask {
4532        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4533            Self(RequestBuilder::new(stub))
4534        }
4535
4536        /// Sets the full request, replacing any prior values.
4537        pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
4538            self.0.request = v.into();
4539            self
4540        }
4541
4542        /// Sets all the options, replacing any prior values.
4543        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4544            self.0.options = v.into();
4545            self
4546        }
4547
4548        /// Sends the request.
4549        pub async fn send(self) -> Result<crate::model::Task> {
4550            (*self.0.stub)
4551                .get_task(self.0.request, self.0.options)
4552                .await
4553                .map(gax::response::Response::into_body)
4554        }
4555
4556        /// Sets the value of [name][crate::model::GetTaskRequest::name].
4557        ///
4558        /// This is a **required** field for requests.
4559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4560            self.0.request.name = v.into();
4561            self
4562        }
4563    }
4564
4565    #[doc(hidden)]
4566    impl gax::options::internal::RequestBuilder for GetTask {
4567        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4568            &mut self.0.options
4569        }
4570    }
4571
4572    /// The request builder for [Tasks::list_tasks][crate::client::Tasks::list_tasks] calls.
4573    ///
4574    /// # Example
4575    /// ```no_run
4576    /// # use google_cloud_run_v2::builder;
4577    /// use builder::tasks::ListTasks;
4578    /// # tokio_test::block_on(async {
4579    /// use gax::paginator::ItemPaginator;
4580    ///
4581    /// let builder = prepare_request_builder();
4582    /// let mut items = builder.by_item();
4583    /// while let Some(result) = items.next().await {
4584    ///   let item = result?;
4585    /// }
4586    /// # gax::Result::<()>::Ok(()) });
4587    ///
4588    /// fn prepare_request_builder() -> ListTasks {
4589    ///   # panic!();
4590    ///   // ... details omitted ...
4591    /// }
4592    /// ```
4593    #[derive(Clone, Debug)]
4594    pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
4595
4596    impl ListTasks {
4597        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4598            Self(RequestBuilder::new(stub))
4599        }
4600
4601        /// Sets the full request, replacing any prior values.
4602        pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
4603            self.0.request = v.into();
4604            self
4605        }
4606
4607        /// Sets all the options, replacing any prior values.
4608        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4609            self.0.options = v.into();
4610            self
4611        }
4612
4613        /// Sends the request.
4614        pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
4615            (*self.0.stub)
4616                .list_tasks(self.0.request, self.0.options)
4617                .await
4618                .map(gax::response::Response::into_body)
4619        }
4620
4621        /// Streams each page in the collection.
4622        pub fn by_page(
4623            self,
4624        ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
4625        {
4626            use std::clone::Clone;
4627            let token = self.0.request.page_token.clone();
4628            let execute = move |token: String| {
4629                let mut builder = self.clone();
4630                builder.0.request = builder.0.request.set_page_token(token);
4631                builder.send()
4632            };
4633            gax::paginator::internal::new_paginator(token, execute)
4634        }
4635
4636        /// Streams each item in the collection.
4637        pub fn by_item(
4638            self,
4639        ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
4640        {
4641            use gax::paginator::Paginator;
4642            self.by_page().items()
4643        }
4644
4645        /// Sets the value of [parent][crate::model::ListTasksRequest::parent].
4646        ///
4647        /// This is a **required** field for requests.
4648        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4649            self.0.request.parent = v.into();
4650            self
4651        }
4652
4653        /// Sets the value of [page_size][crate::model::ListTasksRequest::page_size].
4654        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4655            self.0.request.page_size = v.into();
4656            self
4657        }
4658
4659        /// Sets the value of [page_token][crate::model::ListTasksRequest::page_token].
4660        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4661            self.0.request.page_token = v.into();
4662            self
4663        }
4664
4665        /// Sets the value of [show_deleted][crate::model::ListTasksRequest::show_deleted].
4666        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
4667            self.0.request.show_deleted = v.into();
4668            self
4669        }
4670    }
4671
4672    #[doc(hidden)]
4673    impl gax::options::internal::RequestBuilder for ListTasks {
4674        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4675            &mut self.0.options
4676        }
4677    }
4678
4679    /// The request builder for [Tasks::list_operations][crate::client::Tasks::list_operations] calls.
4680    ///
4681    /// # Example
4682    /// ```no_run
4683    /// # use google_cloud_run_v2::builder;
4684    /// use builder::tasks::ListOperations;
4685    /// # tokio_test::block_on(async {
4686    /// use gax::paginator::ItemPaginator;
4687    ///
4688    /// let builder = prepare_request_builder();
4689    /// let mut items = builder.by_item();
4690    /// while let Some(result) = items.next().await {
4691    ///   let item = result?;
4692    /// }
4693    /// # gax::Result::<()>::Ok(()) });
4694    ///
4695    /// fn prepare_request_builder() -> ListOperations {
4696    ///   # panic!();
4697    ///   // ... details omitted ...
4698    /// }
4699    /// ```
4700    #[derive(Clone, Debug)]
4701    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4702
4703    impl ListOperations {
4704        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4705            Self(RequestBuilder::new(stub))
4706        }
4707
4708        /// Sets the full request, replacing any prior values.
4709        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4710            mut self,
4711            v: V,
4712        ) -> Self {
4713            self.0.request = v.into();
4714            self
4715        }
4716
4717        /// Sets all the options, replacing any prior values.
4718        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4719            self.0.options = v.into();
4720            self
4721        }
4722
4723        /// Sends the request.
4724        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4725            (*self.0.stub)
4726                .list_operations(self.0.request, self.0.options)
4727                .await
4728                .map(gax::response::Response::into_body)
4729        }
4730
4731        /// Streams each page in the collection.
4732        pub fn by_page(
4733            self,
4734        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4735        {
4736            use std::clone::Clone;
4737            let token = self.0.request.page_token.clone();
4738            let execute = move |token: String| {
4739                let mut builder = self.clone();
4740                builder.0.request = builder.0.request.set_page_token(token);
4741                builder.send()
4742            };
4743            gax::paginator::internal::new_paginator(token, execute)
4744        }
4745
4746        /// Streams each item in the collection.
4747        pub fn by_item(
4748            self,
4749        ) -> impl gax::paginator::ItemPaginator<
4750            longrunning::model::ListOperationsResponse,
4751            gax::error::Error,
4752        > {
4753            use gax::paginator::Paginator;
4754            self.by_page().items()
4755        }
4756
4757        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4758        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4759            self.0.request.name = v.into();
4760            self
4761        }
4762
4763        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4764        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4765            self.0.request.filter = v.into();
4766            self
4767        }
4768
4769        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4770        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4771            self.0.request.page_size = v.into();
4772            self
4773        }
4774
4775        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4776        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4777            self.0.request.page_token = v.into();
4778            self
4779        }
4780    }
4781
4782    #[doc(hidden)]
4783    impl gax::options::internal::RequestBuilder for ListOperations {
4784        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4785            &mut self.0.options
4786        }
4787    }
4788
4789    /// The request builder for [Tasks::get_operation][crate::client::Tasks::get_operation] calls.
4790    ///
4791    /// # Example
4792    /// ```no_run
4793    /// # use google_cloud_run_v2::builder;
4794    /// use builder::tasks::GetOperation;
4795    /// # tokio_test::block_on(async {
4796    ///
4797    /// let builder = prepare_request_builder();
4798    /// let response = builder.send().await?;
4799    /// # gax::Result::<()>::Ok(()) });
4800    ///
4801    /// fn prepare_request_builder() -> GetOperation {
4802    ///   # panic!();
4803    ///   // ... details omitted ...
4804    /// }
4805    /// ```
4806    #[derive(Clone, Debug)]
4807    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4808
4809    impl GetOperation {
4810        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4811            Self(RequestBuilder::new(stub))
4812        }
4813
4814        /// Sets the full request, replacing any prior values.
4815        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4816            mut self,
4817            v: V,
4818        ) -> Self {
4819            self.0.request = v.into();
4820            self
4821        }
4822
4823        /// Sets all the options, replacing any prior values.
4824        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4825            self.0.options = v.into();
4826            self
4827        }
4828
4829        /// Sends the request.
4830        pub async fn send(self) -> Result<longrunning::model::Operation> {
4831            (*self.0.stub)
4832                .get_operation(self.0.request, self.0.options)
4833                .await
4834                .map(gax::response::Response::into_body)
4835        }
4836
4837        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4838        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4839            self.0.request.name = v.into();
4840            self
4841        }
4842    }
4843
4844    #[doc(hidden)]
4845    impl gax::options::internal::RequestBuilder for GetOperation {
4846        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4847            &mut self.0.options
4848        }
4849    }
4850
4851    /// The request builder for [Tasks::delete_operation][crate::client::Tasks::delete_operation] calls.
4852    ///
4853    /// # Example
4854    /// ```no_run
4855    /// # use google_cloud_run_v2::builder;
4856    /// use builder::tasks::DeleteOperation;
4857    /// # tokio_test::block_on(async {
4858    ///
4859    /// let builder = prepare_request_builder();
4860    /// let response = builder.send().await?;
4861    /// # gax::Result::<()>::Ok(()) });
4862    ///
4863    /// fn prepare_request_builder() -> DeleteOperation {
4864    ///   # panic!();
4865    ///   // ... details omitted ...
4866    /// }
4867    /// ```
4868    #[derive(Clone, Debug)]
4869    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4870
4871    impl DeleteOperation {
4872        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4873            Self(RequestBuilder::new(stub))
4874        }
4875
4876        /// Sets the full request, replacing any prior values.
4877        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4878            mut self,
4879            v: V,
4880        ) -> Self {
4881            self.0.request = v.into();
4882            self
4883        }
4884
4885        /// Sets all the options, replacing any prior values.
4886        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4887            self.0.options = v.into();
4888            self
4889        }
4890
4891        /// Sends the request.
4892        pub async fn send(self) -> Result<()> {
4893            (*self.0.stub)
4894                .delete_operation(self.0.request, self.0.options)
4895                .await
4896                .map(gax::response::Response::into_body)
4897        }
4898
4899        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
4900        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901            self.0.request.name = v.into();
4902            self
4903        }
4904    }
4905
4906    #[doc(hidden)]
4907    impl gax::options::internal::RequestBuilder for DeleteOperation {
4908        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4909            &mut self.0.options
4910        }
4911    }
4912
4913    /// The request builder for [Tasks::wait_operation][crate::client::Tasks::wait_operation] calls.
4914    ///
4915    /// # Example
4916    /// ```no_run
4917    /// # use google_cloud_run_v2::builder;
4918    /// use builder::tasks::WaitOperation;
4919    /// # tokio_test::block_on(async {
4920    ///
4921    /// let builder = prepare_request_builder();
4922    /// let response = builder.send().await?;
4923    /// # gax::Result::<()>::Ok(()) });
4924    ///
4925    /// fn prepare_request_builder() -> WaitOperation {
4926    ///   # panic!();
4927    ///   // ... details omitted ...
4928    /// }
4929    /// ```
4930    #[derive(Clone, Debug)]
4931    pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4932
4933    impl WaitOperation {
4934        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4935            Self(RequestBuilder::new(stub))
4936        }
4937
4938        /// Sets the full request, replacing any prior values.
4939        pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4940            mut self,
4941            v: V,
4942        ) -> Self {
4943            self.0.request = v.into();
4944            self
4945        }
4946
4947        /// Sets all the options, replacing any prior values.
4948        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4949            self.0.options = v.into();
4950            self
4951        }
4952
4953        /// Sends the request.
4954        pub async fn send(self) -> Result<longrunning::model::Operation> {
4955            (*self.0.stub)
4956                .wait_operation(self.0.request, self.0.options)
4957                .await
4958                .map(gax::response::Response::into_body)
4959        }
4960
4961        /// Sets the value of [name][longrunning::model::WaitOperationRequest::name].
4962        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4963            self.0.request.name = v.into();
4964            self
4965        }
4966
4967        /// Sets the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
4968        pub fn set_timeout<T>(mut self, v: T) -> Self
4969        where
4970            T: std::convert::Into<wkt::Duration>,
4971        {
4972            self.0.request.timeout = std::option::Option::Some(v.into());
4973            self
4974        }
4975
4976        /// Sets or clears the value of [timeout][longrunning::model::WaitOperationRequest::timeout].
4977        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4978        where
4979            T: std::convert::Into<wkt::Duration>,
4980        {
4981            self.0.request.timeout = v.map(|x| x.into());
4982            self
4983        }
4984    }
4985
4986    #[doc(hidden)]
4987    impl gax::options::internal::RequestBuilder for WaitOperation {
4988        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4989            &mut self.0.options
4990        }
4991    }
4992}