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