Skip to main content

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