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