Skip to main content

google_cloud_dataproc_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [AutoscalingPolicyService][crate::client::AutoscalingPolicyService].
18pub mod autoscaling_policy_service {
19    use crate::Result;
20
21    /// A builder for [AutoscalingPolicyService][crate::client::AutoscalingPolicyService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_dataproc_v1::*;
26    /// # use builder::autoscaling_policy_service::ClientBuilder;
27    /// # use client::AutoscalingPolicyService;
28    /// let builder : ClientBuilder = AutoscalingPolicyService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://dataproc.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::AutoscalingPolicyService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = AutoscalingPolicyService;
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::AutoscalingPolicyService] 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::AutoscalingPolicyService>,
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(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AutoscalingPolicyService::create_autoscaling_policy][crate::client::AutoscalingPolicyService::create_autoscaling_policy] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::CreateAutoscalingPolicy;
79    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> CreateAutoscalingPolicy {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct CreateAutoscalingPolicy(
92        RequestBuilder<crate::model::CreateAutoscalingPolicyRequest>,
93    );
94
95    impl CreateAutoscalingPolicy {
96        pub(crate) fn new(
97            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
98        ) -> Self {
99            Self(RequestBuilder::new(stub))
100        }
101
102        /// Sets the full request, replacing any prior values.
103        pub fn with_request<V: Into<crate::model::CreateAutoscalingPolicyRequest>>(
104            mut self,
105            v: V,
106        ) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        pub async fn send(self) -> Result<crate::model::AutoscalingPolicy> {
119            (*self.0.stub)
120                .create_autoscaling_policy(self.0.request, self.0.options)
121                .await
122                .map(crate::Response::into_body)
123        }
124
125        /// Sets the value of [parent][crate::model::CreateAutoscalingPolicyRequest::parent].
126        ///
127        /// This is a **required** field for requests.
128        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
129            self.0.request.parent = v.into();
130            self
131        }
132
133        /// Sets the value of [policy][crate::model::CreateAutoscalingPolicyRequest::policy].
134        ///
135        /// This is a **required** field for requests.
136        pub fn set_policy<T>(mut self, v: T) -> Self
137        where
138            T: std::convert::Into<crate::model::AutoscalingPolicy>,
139        {
140            self.0.request.policy = std::option::Option::Some(v.into());
141            self
142        }
143
144        /// Sets or clears the value of [policy][crate::model::CreateAutoscalingPolicyRequest::policy].
145        ///
146        /// This is a **required** field for requests.
147        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
148        where
149            T: std::convert::Into<crate::model::AutoscalingPolicy>,
150        {
151            self.0.request.policy = v.map(|x| x.into());
152            self
153        }
154    }
155
156    #[doc(hidden)]
157    impl crate::RequestBuilder for CreateAutoscalingPolicy {
158        fn request_options(&mut self) -> &mut crate::RequestOptions {
159            &mut self.0.options
160        }
161    }
162
163    /// The request builder for [AutoscalingPolicyService::update_autoscaling_policy][crate::client::AutoscalingPolicyService::update_autoscaling_policy] calls.
164    ///
165    /// # Example
166    /// ```
167    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::UpdateAutoscalingPolicy;
168    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
169    ///
170    /// let builder = prepare_request_builder();
171    /// let response = builder.send().await?;
172    /// # Ok(()) }
173    ///
174    /// fn prepare_request_builder() -> UpdateAutoscalingPolicy {
175    ///   # panic!();
176    ///   // ... details omitted ...
177    /// }
178    /// ```
179    #[derive(Clone, Debug)]
180    pub struct UpdateAutoscalingPolicy(
181        RequestBuilder<crate::model::UpdateAutoscalingPolicyRequest>,
182    );
183
184    impl UpdateAutoscalingPolicy {
185        pub(crate) fn new(
186            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
187        ) -> Self {
188            Self(RequestBuilder::new(stub))
189        }
190
191        /// Sets the full request, replacing any prior values.
192        pub fn with_request<V: Into<crate::model::UpdateAutoscalingPolicyRequest>>(
193            mut self,
194            v: V,
195        ) -> Self {
196            self.0.request = v.into();
197            self
198        }
199
200        /// Sets all the options, replacing any prior values.
201        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
202            self.0.options = v.into();
203            self
204        }
205
206        /// Sends the request.
207        pub async fn send(self) -> Result<crate::model::AutoscalingPolicy> {
208            (*self.0.stub)
209                .update_autoscaling_policy(self.0.request, self.0.options)
210                .await
211                .map(crate::Response::into_body)
212        }
213
214        /// Sets the value of [policy][crate::model::UpdateAutoscalingPolicyRequest::policy].
215        ///
216        /// This is a **required** field for requests.
217        pub fn set_policy<T>(mut self, v: T) -> Self
218        where
219            T: std::convert::Into<crate::model::AutoscalingPolicy>,
220        {
221            self.0.request.policy = std::option::Option::Some(v.into());
222            self
223        }
224
225        /// Sets or clears the value of [policy][crate::model::UpdateAutoscalingPolicyRequest::policy].
226        ///
227        /// This is a **required** field for requests.
228        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
229        where
230            T: std::convert::Into<crate::model::AutoscalingPolicy>,
231        {
232            self.0.request.policy = v.map(|x| x.into());
233            self
234        }
235    }
236
237    #[doc(hidden)]
238    impl crate::RequestBuilder for UpdateAutoscalingPolicy {
239        fn request_options(&mut self) -> &mut crate::RequestOptions {
240            &mut self.0.options
241        }
242    }
243
244    /// The request builder for [AutoscalingPolicyService::get_autoscaling_policy][crate::client::AutoscalingPolicyService::get_autoscaling_policy] calls.
245    ///
246    /// # Example
247    /// ```
248    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::GetAutoscalingPolicy;
249    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
250    ///
251    /// let builder = prepare_request_builder();
252    /// let response = builder.send().await?;
253    /// # Ok(()) }
254    ///
255    /// fn prepare_request_builder() -> GetAutoscalingPolicy {
256    ///   # panic!();
257    ///   // ... details omitted ...
258    /// }
259    /// ```
260    #[derive(Clone, Debug)]
261    pub struct GetAutoscalingPolicy(RequestBuilder<crate::model::GetAutoscalingPolicyRequest>);
262
263    impl GetAutoscalingPolicy {
264        pub(crate) fn new(
265            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
266        ) -> Self {
267            Self(RequestBuilder::new(stub))
268        }
269
270        /// Sets the full request, replacing any prior values.
271        pub fn with_request<V: Into<crate::model::GetAutoscalingPolicyRequest>>(
272            mut self,
273            v: V,
274        ) -> Self {
275            self.0.request = v.into();
276            self
277        }
278
279        /// Sets all the options, replacing any prior values.
280        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
281            self.0.options = v.into();
282            self
283        }
284
285        /// Sends the request.
286        pub async fn send(self) -> Result<crate::model::AutoscalingPolicy> {
287            (*self.0.stub)
288                .get_autoscaling_policy(self.0.request, self.0.options)
289                .await
290                .map(crate::Response::into_body)
291        }
292
293        /// Sets the value of [name][crate::model::GetAutoscalingPolicyRequest::name].
294        ///
295        /// This is a **required** field for requests.
296        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
297            self.0.request.name = v.into();
298            self
299        }
300    }
301
302    #[doc(hidden)]
303    impl crate::RequestBuilder for GetAutoscalingPolicy {
304        fn request_options(&mut self) -> &mut crate::RequestOptions {
305            &mut self.0.options
306        }
307    }
308
309    /// The request builder for [AutoscalingPolicyService::list_autoscaling_policies][crate::client::AutoscalingPolicyService::list_autoscaling_policies] calls.
310    ///
311    /// # Example
312    /// ```
313    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::ListAutoscalingPolicies;
314    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
315    /// use google_cloud_gax::paginator::ItemPaginator;
316    ///
317    /// let builder = prepare_request_builder();
318    /// let mut items = builder.by_item();
319    /// while let Some(result) = items.next().await {
320    ///   let item = result?;
321    /// }
322    /// # Ok(()) }
323    ///
324    /// fn prepare_request_builder() -> ListAutoscalingPolicies {
325    ///   # panic!();
326    ///   // ... details omitted ...
327    /// }
328    /// ```
329    #[derive(Clone, Debug)]
330    pub struct ListAutoscalingPolicies(
331        RequestBuilder<crate::model::ListAutoscalingPoliciesRequest>,
332    );
333
334    impl ListAutoscalingPolicies {
335        pub(crate) fn new(
336            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
337        ) -> Self {
338            Self(RequestBuilder::new(stub))
339        }
340
341        /// Sets the full request, replacing any prior values.
342        pub fn with_request<V: Into<crate::model::ListAutoscalingPoliciesRequest>>(
343            mut self,
344            v: V,
345        ) -> Self {
346            self.0.request = v.into();
347            self
348        }
349
350        /// Sets all the options, replacing any prior values.
351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
352            self.0.options = v.into();
353            self
354        }
355
356        /// Sends the request.
357        pub async fn send(self) -> Result<crate::model::ListAutoscalingPoliciesResponse> {
358            (*self.0.stub)
359                .list_autoscaling_policies(self.0.request, self.0.options)
360                .await
361                .map(crate::Response::into_body)
362        }
363
364        /// Streams each page in the collection.
365        pub fn by_page(
366            self,
367        ) -> impl google_cloud_gax::paginator::Paginator<
368            crate::model::ListAutoscalingPoliciesResponse,
369            crate::Error,
370        > {
371            use std::clone::Clone;
372            let token = self.0.request.page_token.clone();
373            let execute = move |token: String| {
374                let mut builder = self.clone();
375                builder.0.request = builder.0.request.set_page_token(token);
376                builder.send()
377            };
378            google_cloud_gax::paginator::internal::new_paginator(token, execute)
379        }
380
381        /// Streams each item in the collection.
382        pub fn by_item(
383            self,
384        ) -> impl google_cloud_gax::paginator::ItemPaginator<
385            crate::model::ListAutoscalingPoliciesResponse,
386            crate::Error,
387        > {
388            use google_cloud_gax::paginator::Paginator;
389            self.by_page().items()
390        }
391
392        /// Sets the value of [parent][crate::model::ListAutoscalingPoliciesRequest::parent].
393        ///
394        /// This is a **required** field for requests.
395        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
396            self.0.request.parent = v.into();
397            self
398        }
399
400        /// Sets the value of [page_size][crate::model::ListAutoscalingPoliciesRequest::page_size].
401        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
402            self.0.request.page_size = v.into();
403            self
404        }
405
406        /// Sets the value of [page_token][crate::model::ListAutoscalingPoliciesRequest::page_token].
407        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
408            self.0.request.page_token = v.into();
409            self
410        }
411    }
412
413    #[doc(hidden)]
414    impl crate::RequestBuilder for ListAutoscalingPolicies {
415        fn request_options(&mut self) -> &mut crate::RequestOptions {
416            &mut self.0.options
417        }
418    }
419
420    /// The request builder for [AutoscalingPolicyService::delete_autoscaling_policy][crate::client::AutoscalingPolicyService::delete_autoscaling_policy] calls.
421    ///
422    /// # Example
423    /// ```
424    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::DeleteAutoscalingPolicy;
425    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
426    ///
427    /// let builder = prepare_request_builder();
428    /// let response = builder.send().await?;
429    /// # Ok(()) }
430    ///
431    /// fn prepare_request_builder() -> DeleteAutoscalingPolicy {
432    ///   # panic!();
433    ///   // ... details omitted ...
434    /// }
435    /// ```
436    #[derive(Clone, Debug)]
437    pub struct DeleteAutoscalingPolicy(
438        RequestBuilder<crate::model::DeleteAutoscalingPolicyRequest>,
439    );
440
441    impl DeleteAutoscalingPolicy {
442        pub(crate) fn new(
443            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
444        ) -> Self {
445            Self(RequestBuilder::new(stub))
446        }
447
448        /// Sets the full request, replacing any prior values.
449        pub fn with_request<V: Into<crate::model::DeleteAutoscalingPolicyRequest>>(
450            mut self,
451            v: V,
452        ) -> Self {
453            self.0.request = v.into();
454            self
455        }
456
457        /// Sets all the options, replacing any prior values.
458        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
459            self.0.options = v.into();
460            self
461        }
462
463        /// Sends the request.
464        pub async fn send(self) -> Result<()> {
465            (*self.0.stub)
466                .delete_autoscaling_policy(self.0.request, self.0.options)
467                .await
468                .map(crate::Response::into_body)
469        }
470
471        /// Sets the value of [name][crate::model::DeleteAutoscalingPolicyRequest::name].
472        ///
473        /// This is a **required** field for requests.
474        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
475            self.0.request.name = v.into();
476            self
477        }
478    }
479
480    #[doc(hidden)]
481    impl crate::RequestBuilder for DeleteAutoscalingPolicy {
482        fn request_options(&mut self) -> &mut crate::RequestOptions {
483            &mut self.0.options
484        }
485    }
486
487    /// The request builder for [AutoscalingPolicyService::set_iam_policy][crate::client::AutoscalingPolicyService::set_iam_policy] calls.
488    ///
489    /// # Example
490    /// ```
491    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::SetIamPolicy;
492    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
493    ///
494    /// let builder = prepare_request_builder();
495    /// let response = builder.send().await?;
496    /// # Ok(()) }
497    ///
498    /// fn prepare_request_builder() -> SetIamPolicy {
499    ///   # panic!();
500    ///   // ... details omitted ...
501    /// }
502    /// ```
503    #[derive(Clone, Debug)]
504    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
505
506    impl SetIamPolicy {
507        pub(crate) fn new(
508            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
509        ) -> Self {
510            Self(RequestBuilder::new(stub))
511        }
512
513        /// Sets the full request, replacing any prior values.
514        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
515            mut self,
516            v: V,
517        ) -> Self {
518            self.0.request = v.into();
519            self
520        }
521
522        /// Sets all the options, replacing any prior values.
523        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
524            self.0.options = v.into();
525            self
526        }
527
528        /// Sends the request.
529        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
530            (*self.0.stub)
531                .set_iam_policy(self.0.request, self.0.options)
532                .await
533                .map(crate::Response::into_body)
534        }
535
536        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
537        ///
538        /// This is a **required** field for requests.
539        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
540            self.0.request.resource = v.into();
541            self
542        }
543
544        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
545        ///
546        /// This is a **required** field for requests.
547        pub fn set_policy<T>(mut self, v: T) -> Self
548        where
549            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
550        {
551            self.0.request.policy = std::option::Option::Some(v.into());
552            self
553        }
554
555        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
556        ///
557        /// This is a **required** field for requests.
558        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
559        where
560            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
561        {
562            self.0.request.policy = v.map(|x| x.into());
563            self
564        }
565
566        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
567        pub fn set_update_mask<T>(mut self, v: T) -> Self
568        where
569            T: std::convert::Into<wkt::FieldMask>,
570        {
571            self.0.request.update_mask = std::option::Option::Some(v.into());
572            self
573        }
574
575        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
576        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
577        where
578            T: std::convert::Into<wkt::FieldMask>,
579        {
580            self.0.request.update_mask = v.map(|x| x.into());
581            self
582        }
583    }
584
585    #[doc(hidden)]
586    impl crate::RequestBuilder for SetIamPolicy {
587        fn request_options(&mut self) -> &mut crate::RequestOptions {
588            &mut self.0.options
589        }
590    }
591
592    /// The request builder for [AutoscalingPolicyService::get_iam_policy][crate::client::AutoscalingPolicyService::get_iam_policy] calls.
593    ///
594    /// # Example
595    /// ```
596    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::GetIamPolicy;
597    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
598    ///
599    /// let builder = prepare_request_builder();
600    /// let response = builder.send().await?;
601    /// # Ok(()) }
602    ///
603    /// fn prepare_request_builder() -> GetIamPolicy {
604    ///   # panic!();
605    ///   // ... details omitted ...
606    /// }
607    /// ```
608    #[derive(Clone, Debug)]
609    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
610
611    impl GetIamPolicy {
612        pub(crate) fn new(
613            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
614        ) -> Self {
615            Self(RequestBuilder::new(stub))
616        }
617
618        /// Sets the full request, replacing any prior values.
619        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
620            mut self,
621            v: V,
622        ) -> Self {
623            self.0.request = v.into();
624            self
625        }
626
627        /// Sets all the options, replacing any prior values.
628        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
629            self.0.options = v.into();
630            self
631        }
632
633        /// Sends the request.
634        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
635            (*self.0.stub)
636                .get_iam_policy(self.0.request, self.0.options)
637                .await
638                .map(crate::Response::into_body)
639        }
640
641        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
642        ///
643        /// This is a **required** field for requests.
644        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
645            self.0.request.resource = v.into();
646            self
647        }
648
649        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
650        pub fn set_options<T>(mut self, v: T) -> Self
651        where
652            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
653        {
654            self.0.request.options = std::option::Option::Some(v.into());
655            self
656        }
657
658        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
659        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
660        where
661            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
662        {
663            self.0.request.options = v.map(|x| x.into());
664            self
665        }
666    }
667
668    #[doc(hidden)]
669    impl crate::RequestBuilder for GetIamPolicy {
670        fn request_options(&mut self) -> &mut crate::RequestOptions {
671            &mut self.0.options
672        }
673    }
674
675    /// The request builder for [AutoscalingPolicyService::test_iam_permissions][crate::client::AutoscalingPolicyService::test_iam_permissions] calls.
676    ///
677    /// # Example
678    /// ```
679    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::TestIamPermissions;
680    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
681    ///
682    /// let builder = prepare_request_builder();
683    /// let response = builder.send().await?;
684    /// # Ok(()) }
685    ///
686    /// fn prepare_request_builder() -> TestIamPermissions {
687    ///   # panic!();
688    ///   // ... details omitted ...
689    /// }
690    /// ```
691    #[derive(Clone, Debug)]
692    pub struct TestIamPermissions(
693        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
694    );
695
696    impl TestIamPermissions {
697        pub(crate) fn new(
698            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
699        ) -> Self {
700            Self(RequestBuilder::new(stub))
701        }
702
703        /// Sets the full request, replacing any prior values.
704        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
705            mut self,
706            v: V,
707        ) -> Self {
708            self.0.request = v.into();
709            self
710        }
711
712        /// Sets all the options, replacing any prior values.
713        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
714            self.0.options = v.into();
715            self
716        }
717
718        /// Sends the request.
719        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
720            (*self.0.stub)
721                .test_iam_permissions(self.0.request, self.0.options)
722                .await
723                .map(crate::Response::into_body)
724        }
725
726        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
727        ///
728        /// This is a **required** field for requests.
729        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
730            self.0.request.resource = v.into();
731            self
732        }
733
734        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
735        ///
736        /// This is a **required** field for requests.
737        pub fn set_permissions<T, V>(mut self, v: T) -> Self
738        where
739            T: std::iter::IntoIterator<Item = V>,
740            V: std::convert::Into<std::string::String>,
741        {
742            use std::iter::Iterator;
743            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
744            self
745        }
746    }
747
748    #[doc(hidden)]
749    impl crate::RequestBuilder for TestIamPermissions {
750        fn request_options(&mut self) -> &mut crate::RequestOptions {
751            &mut self.0.options
752        }
753    }
754
755    /// The request builder for [AutoscalingPolicyService::list_operations][crate::client::AutoscalingPolicyService::list_operations] calls.
756    ///
757    /// # Example
758    /// ```
759    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::ListOperations;
760    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
761    /// use google_cloud_gax::paginator::ItemPaginator;
762    ///
763    /// let builder = prepare_request_builder();
764    /// let mut items = builder.by_item();
765    /// while let Some(result) = items.next().await {
766    ///   let item = result?;
767    /// }
768    /// # Ok(()) }
769    ///
770    /// fn prepare_request_builder() -> ListOperations {
771    ///   # panic!();
772    ///   // ... details omitted ...
773    /// }
774    /// ```
775    #[derive(Clone, Debug)]
776    pub struct ListOperations(
777        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
778    );
779
780    impl ListOperations {
781        pub(crate) fn new(
782            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
783        ) -> Self {
784            Self(RequestBuilder::new(stub))
785        }
786
787        /// Sets the full request, replacing any prior values.
788        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
789            mut self,
790            v: V,
791        ) -> Self {
792            self.0.request = v.into();
793            self
794        }
795
796        /// Sets all the options, replacing any prior values.
797        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
798            self.0.options = v.into();
799            self
800        }
801
802        /// Sends the request.
803        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
804            (*self.0.stub)
805                .list_operations(self.0.request, self.0.options)
806                .await
807                .map(crate::Response::into_body)
808        }
809
810        /// Streams each page in the collection.
811        pub fn by_page(
812            self,
813        ) -> impl google_cloud_gax::paginator::Paginator<
814            google_cloud_longrunning::model::ListOperationsResponse,
815            crate::Error,
816        > {
817            use std::clone::Clone;
818            let token = self.0.request.page_token.clone();
819            let execute = move |token: String| {
820                let mut builder = self.clone();
821                builder.0.request = builder.0.request.set_page_token(token);
822                builder.send()
823            };
824            google_cloud_gax::paginator::internal::new_paginator(token, execute)
825        }
826
827        /// Streams each item in the collection.
828        pub fn by_item(
829            self,
830        ) -> impl google_cloud_gax::paginator::ItemPaginator<
831            google_cloud_longrunning::model::ListOperationsResponse,
832            crate::Error,
833        > {
834            use google_cloud_gax::paginator::Paginator;
835            self.by_page().items()
836        }
837
838        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
839        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
840            self.0.request.name = v.into();
841            self
842        }
843
844        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
845        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
846            self.0.request.filter = v.into();
847            self
848        }
849
850        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
851        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
852            self.0.request.page_size = v.into();
853            self
854        }
855
856        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
857        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
858            self.0.request.page_token = v.into();
859            self
860        }
861
862        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
863        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
864            self.0.request.return_partial_success = v.into();
865            self
866        }
867    }
868
869    #[doc(hidden)]
870    impl crate::RequestBuilder for ListOperations {
871        fn request_options(&mut self) -> &mut crate::RequestOptions {
872            &mut self.0.options
873        }
874    }
875
876    /// The request builder for [AutoscalingPolicyService::get_operation][crate::client::AutoscalingPolicyService::get_operation] calls.
877    ///
878    /// # Example
879    /// ```
880    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::GetOperation;
881    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
882    ///
883    /// let builder = prepare_request_builder();
884    /// let response = builder.send().await?;
885    /// # Ok(()) }
886    ///
887    /// fn prepare_request_builder() -> GetOperation {
888    ///   # panic!();
889    ///   // ... details omitted ...
890    /// }
891    /// ```
892    #[derive(Clone, Debug)]
893    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
894
895    impl GetOperation {
896        pub(crate) fn new(
897            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
898        ) -> Self {
899            Self(RequestBuilder::new(stub))
900        }
901
902        /// Sets the full request, replacing any prior values.
903        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
904            mut self,
905            v: V,
906        ) -> Self {
907            self.0.request = v.into();
908            self
909        }
910
911        /// Sets all the options, replacing any prior values.
912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
913            self.0.options = v.into();
914            self
915        }
916
917        /// Sends the request.
918        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
919            (*self.0.stub)
920                .get_operation(self.0.request, self.0.options)
921                .await
922                .map(crate::Response::into_body)
923        }
924
925        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
926        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
927            self.0.request.name = v.into();
928            self
929        }
930    }
931
932    #[doc(hidden)]
933    impl crate::RequestBuilder for GetOperation {
934        fn request_options(&mut self) -> &mut crate::RequestOptions {
935            &mut self.0.options
936        }
937    }
938
939    /// The request builder for [AutoscalingPolicyService::delete_operation][crate::client::AutoscalingPolicyService::delete_operation] calls.
940    ///
941    /// # Example
942    /// ```
943    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::DeleteOperation;
944    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
945    ///
946    /// let builder = prepare_request_builder();
947    /// let response = builder.send().await?;
948    /// # Ok(()) }
949    ///
950    /// fn prepare_request_builder() -> DeleteOperation {
951    ///   # panic!();
952    ///   // ... details omitted ...
953    /// }
954    /// ```
955    #[derive(Clone, Debug)]
956    pub struct DeleteOperation(
957        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
958    );
959
960    impl DeleteOperation {
961        pub(crate) fn new(
962            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
963        ) -> Self {
964            Self(RequestBuilder::new(stub))
965        }
966
967        /// Sets the full request, replacing any prior values.
968        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
969            mut self,
970            v: V,
971        ) -> Self {
972            self.0.request = v.into();
973            self
974        }
975
976        /// Sets all the options, replacing any prior values.
977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
978            self.0.options = v.into();
979            self
980        }
981
982        /// Sends the request.
983        pub async fn send(self) -> Result<()> {
984            (*self.0.stub)
985                .delete_operation(self.0.request, self.0.options)
986                .await
987                .map(crate::Response::into_body)
988        }
989
990        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
991        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
992            self.0.request.name = v.into();
993            self
994        }
995    }
996
997    #[doc(hidden)]
998    impl crate::RequestBuilder for DeleteOperation {
999        fn request_options(&mut self) -> &mut crate::RequestOptions {
1000            &mut self.0.options
1001        }
1002    }
1003
1004    /// The request builder for [AutoscalingPolicyService::cancel_operation][crate::client::AutoscalingPolicyService::cancel_operation] calls.
1005    ///
1006    /// # Example
1007    /// ```
1008    /// # use google_cloud_dataproc_v1::builder::autoscaling_policy_service::CancelOperation;
1009    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1010    ///
1011    /// let builder = prepare_request_builder();
1012    /// let response = builder.send().await?;
1013    /// # Ok(()) }
1014    ///
1015    /// fn prepare_request_builder() -> CancelOperation {
1016    ///   # panic!();
1017    ///   // ... details omitted ...
1018    /// }
1019    /// ```
1020    #[derive(Clone, Debug)]
1021    pub struct CancelOperation(
1022        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1023    );
1024
1025    impl CancelOperation {
1026        pub(crate) fn new(
1027            stub: std::sync::Arc<dyn super::super::stub::dynamic::AutoscalingPolicyService>,
1028        ) -> Self {
1029            Self(RequestBuilder::new(stub))
1030        }
1031
1032        /// Sets the full request, replacing any prior values.
1033        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1034            mut self,
1035            v: V,
1036        ) -> Self {
1037            self.0.request = v.into();
1038            self
1039        }
1040
1041        /// Sets all the options, replacing any prior values.
1042        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1043            self.0.options = v.into();
1044            self
1045        }
1046
1047        /// Sends the request.
1048        pub async fn send(self) -> Result<()> {
1049            (*self.0.stub)
1050                .cancel_operation(self.0.request, self.0.options)
1051                .await
1052                .map(crate::Response::into_body)
1053        }
1054
1055        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1056        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1057            self.0.request.name = v.into();
1058            self
1059        }
1060    }
1061
1062    #[doc(hidden)]
1063    impl crate::RequestBuilder for CancelOperation {
1064        fn request_options(&mut self) -> &mut crate::RequestOptions {
1065            &mut self.0.options
1066        }
1067    }
1068}
1069
1070/// Request and client builders for [BatchController][crate::client::BatchController].
1071pub mod batch_controller {
1072    use crate::Result;
1073
1074    /// A builder for [BatchController][crate::client::BatchController].
1075    ///
1076    /// ```
1077    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1078    /// # use google_cloud_dataproc_v1::*;
1079    /// # use builder::batch_controller::ClientBuilder;
1080    /// # use client::BatchController;
1081    /// let builder : ClientBuilder = BatchController::builder();
1082    /// let client = builder
1083    ///     .with_endpoint("https://dataproc.googleapis.com")
1084    ///     .build().await?;
1085    /// # Ok(()) }
1086    /// ```
1087    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1088
1089    pub(crate) mod client {
1090        use super::super::super::client::BatchController;
1091        pub struct Factory;
1092        impl crate::ClientFactory for Factory {
1093            type Client = BatchController;
1094            type Credentials = gaxi::options::Credentials;
1095            async fn build(
1096                self,
1097                config: gaxi::options::ClientConfig,
1098            ) -> crate::ClientBuilderResult<Self::Client> {
1099                Self::Client::new(config).await
1100            }
1101        }
1102    }
1103
1104    /// Common implementation for [crate::client::BatchController] request builders.
1105    #[derive(Clone, Debug)]
1106    pub(crate) struct RequestBuilder<R: std::default::Default> {
1107        stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1108        request: R,
1109        options: crate::RequestOptions,
1110    }
1111
1112    impl<R> RequestBuilder<R>
1113    where
1114        R: std::default::Default,
1115    {
1116        pub(crate) fn new(
1117            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1118        ) -> Self {
1119            Self {
1120                stub,
1121                request: R::default(),
1122                options: crate::RequestOptions::default(),
1123            }
1124        }
1125    }
1126
1127    /// The request builder for [BatchController::create_batch][crate::client::BatchController::create_batch] calls.
1128    ///
1129    /// # Example
1130    /// ```
1131    /// # use google_cloud_dataproc_v1::builder::batch_controller::CreateBatch;
1132    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1133    /// use google_cloud_lro::Poller;
1134    ///
1135    /// let builder = prepare_request_builder();
1136    /// let response = builder.poller().until_done().await?;
1137    /// # Ok(()) }
1138    ///
1139    /// fn prepare_request_builder() -> CreateBatch {
1140    ///   # panic!();
1141    ///   // ... details omitted ...
1142    /// }
1143    /// ```
1144    #[derive(Clone, Debug)]
1145    pub struct CreateBatch(RequestBuilder<crate::model::CreateBatchRequest>);
1146
1147    impl CreateBatch {
1148        pub(crate) fn new(
1149            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1150        ) -> Self {
1151            Self(RequestBuilder::new(stub))
1152        }
1153
1154        /// Sets the full request, replacing any prior values.
1155        pub fn with_request<V: Into<crate::model::CreateBatchRequest>>(mut self, v: V) -> Self {
1156            self.0.request = v.into();
1157            self
1158        }
1159
1160        /// Sets all the options, replacing any prior values.
1161        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1162            self.0.options = v.into();
1163            self
1164        }
1165
1166        /// Sends the request.
1167        ///
1168        /// # Long running operations
1169        ///
1170        /// This starts, but does not poll, a longrunning operation. More information
1171        /// on [create_batch][crate::client::BatchController::create_batch].
1172        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1173            (*self.0.stub)
1174                .create_batch(self.0.request, self.0.options)
1175                .await
1176                .map(crate::Response::into_body)
1177        }
1178
1179        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_batch`.
1180        pub fn poller(
1181            self,
1182        ) -> impl google_cloud_lro::Poller<crate::model::Batch, crate::model::BatchOperationMetadata>
1183        {
1184            type Operation = google_cloud_lro::internal::Operation<
1185                crate::model::Batch,
1186                crate::model::BatchOperationMetadata,
1187            >;
1188            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1189            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1190            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1191            if let Some(ref mut details) = poller_options.tracing {
1192                details.method_name =
1193                    "google_cloud_dataproc_v1::client::BatchController::create_batch::until_done";
1194            }
1195
1196            let stub = self.0.stub.clone();
1197            let mut options = self.0.options.clone();
1198            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1199            let query = move |name| {
1200                let stub = stub.clone();
1201                let options = options.clone();
1202                async {
1203                    let op = GetOperation::new(stub)
1204                        .set_name(name)
1205                        .with_options(options)
1206                        .send()
1207                        .await?;
1208                    Ok(Operation::new(op))
1209                }
1210            };
1211
1212            let start = move || async {
1213                let op = self.send().await?;
1214                Ok(Operation::new(op))
1215            };
1216
1217            use google_cloud_lro::internal::PollerExt;
1218            {
1219                google_cloud_lro::internal::new_poller(
1220                    polling_error_policy,
1221                    polling_backoff_policy,
1222                    start,
1223                    query,
1224                )
1225            }
1226            .with_options(poller_options)
1227        }
1228
1229        /// Sets the value of [parent][crate::model::CreateBatchRequest::parent].
1230        ///
1231        /// This is a **required** field for requests.
1232        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1233            self.0.request.parent = v.into();
1234            self
1235        }
1236
1237        /// Sets the value of [batch][crate::model::CreateBatchRequest::batch].
1238        ///
1239        /// This is a **required** field for requests.
1240        pub fn set_batch<T>(mut self, v: T) -> Self
1241        where
1242            T: std::convert::Into<crate::model::Batch>,
1243        {
1244            self.0.request.batch = std::option::Option::Some(v.into());
1245            self
1246        }
1247
1248        /// Sets or clears the value of [batch][crate::model::CreateBatchRequest::batch].
1249        ///
1250        /// This is a **required** field for requests.
1251        pub fn set_or_clear_batch<T>(mut self, v: std::option::Option<T>) -> Self
1252        where
1253            T: std::convert::Into<crate::model::Batch>,
1254        {
1255            self.0.request.batch = v.map(|x| x.into());
1256            self
1257        }
1258
1259        /// Sets the value of [batch_id][crate::model::CreateBatchRequest::batch_id].
1260        pub fn set_batch_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261            self.0.request.batch_id = v.into();
1262            self
1263        }
1264
1265        /// Sets the value of [request_id][crate::model::CreateBatchRequest::request_id].
1266        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267            self.0.request.request_id = v.into();
1268            self
1269        }
1270    }
1271
1272    #[doc(hidden)]
1273    impl crate::RequestBuilder for CreateBatch {
1274        fn request_options(&mut self) -> &mut crate::RequestOptions {
1275            &mut self.0.options
1276        }
1277    }
1278
1279    /// The request builder for [BatchController::get_batch][crate::client::BatchController::get_batch] calls.
1280    ///
1281    /// # Example
1282    /// ```
1283    /// # use google_cloud_dataproc_v1::builder::batch_controller::GetBatch;
1284    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1285    ///
1286    /// let builder = prepare_request_builder();
1287    /// let response = builder.send().await?;
1288    /// # Ok(()) }
1289    ///
1290    /// fn prepare_request_builder() -> GetBatch {
1291    ///   # panic!();
1292    ///   // ... details omitted ...
1293    /// }
1294    /// ```
1295    #[derive(Clone, Debug)]
1296    pub struct GetBatch(RequestBuilder<crate::model::GetBatchRequest>);
1297
1298    impl GetBatch {
1299        pub(crate) fn new(
1300            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1301        ) -> Self {
1302            Self(RequestBuilder::new(stub))
1303        }
1304
1305        /// Sets the full request, replacing any prior values.
1306        pub fn with_request<V: Into<crate::model::GetBatchRequest>>(mut self, v: V) -> Self {
1307            self.0.request = v.into();
1308            self
1309        }
1310
1311        /// Sets all the options, replacing any prior values.
1312        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313            self.0.options = v.into();
1314            self
1315        }
1316
1317        /// Sends the request.
1318        pub async fn send(self) -> Result<crate::model::Batch> {
1319            (*self.0.stub)
1320                .get_batch(self.0.request, self.0.options)
1321                .await
1322                .map(crate::Response::into_body)
1323        }
1324
1325        /// Sets the value of [name][crate::model::GetBatchRequest::name].
1326        ///
1327        /// This is a **required** field for requests.
1328        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1329            self.0.request.name = v.into();
1330            self
1331        }
1332    }
1333
1334    #[doc(hidden)]
1335    impl crate::RequestBuilder for GetBatch {
1336        fn request_options(&mut self) -> &mut crate::RequestOptions {
1337            &mut self.0.options
1338        }
1339    }
1340
1341    /// The request builder for [BatchController::list_batches][crate::client::BatchController::list_batches] calls.
1342    ///
1343    /// # Example
1344    /// ```
1345    /// # use google_cloud_dataproc_v1::builder::batch_controller::ListBatches;
1346    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1347    /// use google_cloud_gax::paginator::ItemPaginator;
1348    ///
1349    /// let builder = prepare_request_builder();
1350    /// let mut items = builder.by_item();
1351    /// while let Some(result) = items.next().await {
1352    ///   let item = result?;
1353    /// }
1354    /// # Ok(()) }
1355    ///
1356    /// fn prepare_request_builder() -> ListBatches {
1357    ///   # panic!();
1358    ///   // ... details omitted ...
1359    /// }
1360    /// ```
1361    #[derive(Clone, Debug)]
1362    pub struct ListBatches(RequestBuilder<crate::model::ListBatchesRequest>);
1363
1364    impl ListBatches {
1365        pub(crate) fn new(
1366            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1367        ) -> Self {
1368            Self(RequestBuilder::new(stub))
1369        }
1370
1371        /// Sets the full request, replacing any prior values.
1372        pub fn with_request<V: Into<crate::model::ListBatchesRequest>>(mut self, v: V) -> Self {
1373            self.0.request = v.into();
1374            self
1375        }
1376
1377        /// Sets all the options, replacing any prior values.
1378        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1379            self.0.options = v.into();
1380            self
1381        }
1382
1383        /// Sends the request.
1384        pub async fn send(self) -> Result<crate::model::ListBatchesResponse> {
1385            (*self.0.stub)
1386                .list_batches(self.0.request, self.0.options)
1387                .await
1388                .map(crate::Response::into_body)
1389        }
1390
1391        /// Streams each page in the collection.
1392        pub fn by_page(
1393            self,
1394        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBatchesResponse, crate::Error>
1395        {
1396            use std::clone::Clone;
1397            let token = self.0.request.page_token.clone();
1398            let execute = move |token: String| {
1399                let mut builder = self.clone();
1400                builder.0.request = builder.0.request.set_page_token(token);
1401                builder.send()
1402            };
1403            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1404        }
1405
1406        /// Streams each item in the collection.
1407        pub fn by_item(
1408            self,
1409        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1410            crate::model::ListBatchesResponse,
1411            crate::Error,
1412        > {
1413            use google_cloud_gax::paginator::Paginator;
1414            self.by_page().items()
1415        }
1416
1417        /// Sets the value of [parent][crate::model::ListBatchesRequest::parent].
1418        ///
1419        /// This is a **required** field for requests.
1420        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421            self.0.request.parent = v.into();
1422            self
1423        }
1424
1425        /// Sets the value of [page_size][crate::model::ListBatchesRequest::page_size].
1426        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1427            self.0.request.page_size = v.into();
1428            self
1429        }
1430
1431        /// Sets the value of [page_token][crate::model::ListBatchesRequest::page_token].
1432        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.page_token = v.into();
1434            self
1435        }
1436
1437        /// Sets the value of [filter][crate::model::ListBatchesRequest::filter].
1438        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439            self.0.request.filter = v.into();
1440            self
1441        }
1442
1443        /// Sets the value of [order_by][crate::model::ListBatchesRequest::order_by].
1444        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445            self.0.request.order_by = v.into();
1446            self
1447        }
1448    }
1449
1450    #[doc(hidden)]
1451    impl crate::RequestBuilder for ListBatches {
1452        fn request_options(&mut self) -> &mut crate::RequestOptions {
1453            &mut self.0.options
1454        }
1455    }
1456
1457    /// The request builder for [BatchController::delete_batch][crate::client::BatchController::delete_batch] calls.
1458    ///
1459    /// # Example
1460    /// ```
1461    /// # use google_cloud_dataproc_v1::builder::batch_controller::DeleteBatch;
1462    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1463    ///
1464    /// let builder = prepare_request_builder();
1465    /// let response = builder.send().await?;
1466    /// # Ok(()) }
1467    ///
1468    /// fn prepare_request_builder() -> DeleteBatch {
1469    ///   # panic!();
1470    ///   // ... details omitted ...
1471    /// }
1472    /// ```
1473    #[derive(Clone, Debug)]
1474    pub struct DeleteBatch(RequestBuilder<crate::model::DeleteBatchRequest>);
1475
1476    impl DeleteBatch {
1477        pub(crate) fn new(
1478            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1479        ) -> Self {
1480            Self(RequestBuilder::new(stub))
1481        }
1482
1483        /// Sets the full request, replacing any prior values.
1484        pub fn with_request<V: Into<crate::model::DeleteBatchRequest>>(mut self, v: V) -> Self {
1485            self.0.request = v.into();
1486            self
1487        }
1488
1489        /// Sets all the options, replacing any prior values.
1490        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1491            self.0.options = v.into();
1492            self
1493        }
1494
1495        /// Sends the request.
1496        pub async fn send(self) -> Result<()> {
1497            (*self.0.stub)
1498                .delete_batch(self.0.request, self.0.options)
1499                .await
1500                .map(crate::Response::into_body)
1501        }
1502
1503        /// Sets the value of [name][crate::model::DeleteBatchRequest::name].
1504        ///
1505        /// This is a **required** field for requests.
1506        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1507            self.0.request.name = v.into();
1508            self
1509        }
1510    }
1511
1512    #[doc(hidden)]
1513    impl crate::RequestBuilder for DeleteBatch {
1514        fn request_options(&mut self) -> &mut crate::RequestOptions {
1515            &mut self.0.options
1516        }
1517    }
1518
1519    /// The request builder for [BatchController::set_iam_policy][crate::client::BatchController::set_iam_policy] calls.
1520    ///
1521    /// # Example
1522    /// ```
1523    /// # use google_cloud_dataproc_v1::builder::batch_controller::SetIamPolicy;
1524    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1525    ///
1526    /// let builder = prepare_request_builder();
1527    /// let response = builder.send().await?;
1528    /// # Ok(()) }
1529    ///
1530    /// fn prepare_request_builder() -> SetIamPolicy {
1531    ///   # panic!();
1532    ///   // ... details omitted ...
1533    /// }
1534    /// ```
1535    #[derive(Clone, Debug)]
1536    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1537
1538    impl SetIamPolicy {
1539        pub(crate) fn new(
1540            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1541        ) -> Self {
1542            Self(RequestBuilder::new(stub))
1543        }
1544
1545        /// Sets the full request, replacing any prior values.
1546        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1547            mut self,
1548            v: V,
1549        ) -> Self {
1550            self.0.request = v.into();
1551            self
1552        }
1553
1554        /// Sets all the options, replacing any prior values.
1555        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1556            self.0.options = v.into();
1557            self
1558        }
1559
1560        /// Sends the request.
1561        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1562            (*self.0.stub)
1563                .set_iam_policy(self.0.request, self.0.options)
1564                .await
1565                .map(crate::Response::into_body)
1566        }
1567
1568        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1569        ///
1570        /// This is a **required** field for requests.
1571        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572            self.0.request.resource = v.into();
1573            self
1574        }
1575
1576        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1577        ///
1578        /// This is a **required** field for requests.
1579        pub fn set_policy<T>(mut self, v: T) -> Self
1580        where
1581            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1582        {
1583            self.0.request.policy = std::option::Option::Some(v.into());
1584            self
1585        }
1586
1587        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1588        ///
1589        /// This is a **required** field for requests.
1590        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1591        where
1592            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1593        {
1594            self.0.request.policy = v.map(|x| x.into());
1595            self
1596        }
1597
1598        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1599        pub fn set_update_mask<T>(mut self, v: T) -> Self
1600        where
1601            T: std::convert::Into<wkt::FieldMask>,
1602        {
1603            self.0.request.update_mask = std::option::Option::Some(v.into());
1604            self
1605        }
1606
1607        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1608        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1609        where
1610            T: std::convert::Into<wkt::FieldMask>,
1611        {
1612            self.0.request.update_mask = v.map(|x| x.into());
1613            self
1614        }
1615    }
1616
1617    #[doc(hidden)]
1618    impl crate::RequestBuilder for SetIamPolicy {
1619        fn request_options(&mut self) -> &mut crate::RequestOptions {
1620            &mut self.0.options
1621        }
1622    }
1623
1624    /// The request builder for [BatchController::get_iam_policy][crate::client::BatchController::get_iam_policy] calls.
1625    ///
1626    /// # Example
1627    /// ```
1628    /// # use google_cloud_dataproc_v1::builder::batch_controller::GetIamPolicy;
1629    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1630    ///
1631    /// let builder = prepare_request_builder();
1632    /// let response = builder.send().await?;
1633    /// # Ok(()) }
1634    ///
1635    /// fn prepare_request_builder() -> GetIamPolicy {
1636    ///   # panic!();
1637    ///   // ... details omitted ...
1638    /// }
1639    /// ```
1640    #[derive(Clone, Debug)]
1641    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1642
1643    impl GetIamPolicy {
1644        pub(crate) fn new(
1645            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1646        ) -> Self {
1647            Self(RequestBuilder::new(stub))
1648        }
1649
1650        /// Sets the full request, replacing any prior values.
1651        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1652            mut self,
1653            v: V,
1654        ) -> Self {
1655            self.0.request = v.into();
1656            self
1657        }
1658
1659        /// Sets all the options, replacing any prior values.
1660        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1661            self.0.options = v.into();
1662            self
1663        }
1664
1665        /// Sends the request.
1666        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1667            (*self.0.stub)
1668                .get_iam_policy(self.0.request, self.0.options)
1669                .await
1670                .map(crate::Response::into_body)
1671        }
1672
1673        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1674        ///
1675        /// This is a **required** field for requests.
1676        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1677            self.0.request.resource = v.into();
1678            self
1679        }
1680
1681        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1682        pub fn set_options<T>(mut self, v: T) -> Self
1683        where
1684            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1685        {
1686            self.0.request.options = std::option::Option::Some(v.into());
1687            self
1688        }
1689
1690        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1691        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1692        where
1693            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1694        {
1695            self.0.request.options = v.map(|x| x.into());
1696            self
1697        }
1698    }
1699
1700    #[doc(hidden)]
1701    impl crate::RequestBuilder for GetIamPolicy {
1702        fn request_options(&mut self) -> &mut crate::RequestOptions {
1703            &mut self.0.options
1704        }
1705    }
1706
1707    /// The request builder for [BatchController::test_iam_permissions][crate::client::BatchController::test_iam_permissions] calls.
1708    ///
1709    /// # Example
1710    /// ```
1711    /// # use google_cloud_dataproc_v1::builder::batch_controller::TestIamPermissions;
1712    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1713    ///
1714    /// let builder = prepare_request_builder();
1715    /// let response = builder.send().await?;
1716    /// # Ok(()) }
1717    ///
1718    /// fn prepare_request_builder() -> TestIamPermissions {
1719    ///   # panic!();
1720    ///   // ... details omitted ...
1721    /// }
1722    /// ```
1723    #[derive(Clone, Debug)]
1724    pub struct TestIamPermissions(
1725        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1726    );
1727
1728    impl TestIamPermissions {
1729        pub(crate) fn new(
1730            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1731        ) -> Self {
1732            Self(RequestBuilder::new(stub))
1733        }
1734
1735        /// Sets the full request, replacing any prior values.
1736        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1737            mut self,
1738            v: V,
1739        ) -> Self {
1740            self.0.request = v.into();
1741            self
1742        }
1743
1744        /// Sets all the options, replacing any prior values.
1745        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1746            self.0.options = v.into();
1747            self
1748        }
1749
1750        /// Sends the request.
1751        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1752            (*self.0.stub)
1753                .test_iam_permissions(self.0.request, self.0.options)
1754                .await
1755                .map(crate::Response::into_body)
1756        }
1757
1758        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1759        ///
1760        /// This is a **required** field for requests.
1761        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1762            self.0.request.resource = v.into();
1763            self
1764        }
1765
1766        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1767        ///
1768        /// This is a **required** field for requests.
1769        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1770        where
1771            T: std::iter::IntoIterator<Item = V>,
1772            V: std::convert::Into<std::string::String>,
1773        {
1774            use std::iter::Iterator;
1775            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1776            self
1777        }
1778    }
1779
1780    #[doc(hidden)]
1781    impl crate::RequestBuilder for TestIamPermissions {
1782        fn request_options(&mut self) -> &mut crate::RequestOptions {
1783            &mut self.0.options
1784        }
1785    }
1786
1787    /// The request builder for [BatchController::list_operations][crate::client::BatchController::list_operations] calls.
1788    ///
1789    /// # Example
1790    /// ```
1791    /// # use google_cloud_dataproc_v1::builder::batch_controller::ListOperations;
1792    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1793    /// use google_cloud_gax::paginator::ItemPaginator;
1794    ///
1795    /// let builder = prepare_request_builder();
1796    /// let mut items = builder.by_item();
1797    /// while let Some(result) = items.next().await {
1798    ///   let item = result?;
1799    /// }
1800    /// # Ok(()) }
1801    ///
1802    /// fn prepare_request_builder() -> ListOperations {
1803    ///   # panic!();
1804    ///   // ... details omitted ...
1805    /// }
1806    /// ```
1807    #[derive(Clone, Debug)]
1808    pub struct ListOperations(
1809        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1810    );
1811
1812    impl ListOperations {
1813        pub(crate) fn new(
1814            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1815        ) -> Self {
1816            Self(RequestBuilder::new(stub))
1817        }
1818
1819        /// Sets the full request, replacing any prior values.
1820        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1821            mut self,
1822            v: V,
1823        ) -> Self {
1824            self.0.request = v.into();
1825            self
1826        }
1827
1828        /// Sets all the options, replacing any prior values.
1829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1830            self.0.options = v.into();
1831            self
1832        }
1833
1834        /// Sends the request.
1835        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1836            (*self.0.stub)
1837                .list_operations(self.0.request, self.0.options)
1838                .await
1839                .map(crate::Response::into_body)
1840        }
1841
1842        /// Streams each page in the collection.
1843        pub fn by_page(
1844            self,
1845        ) -> impl google_cloud_gax::paginator::Paginator<
1846            google_cloud_longrunning::model::ListOperationsResponse,
1847            crate::Error,
1848        > {
1849            use std::clone::Clone;
1850            let token = self.0.request.page_token.clone();
1851            let execute = move |token: String| {
1852                let mut builder = self.clone();
1853                builder.0.request = builder.0.request.set_page_token(token);
1854                builder.send()
1855            };
1856            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1857        }
1858
1859        /// Streams each item in the collection.
1860        pub fn by_item(
1861            self,
1862        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1863            google_cloud_longrunning::model::ListOperationsResponse,
1864            crate::Error,
1865        > {
1866            use google_cloud_gax::paginator::Paginator;
1867            self.by_page().items()
1868        }
1869
1870        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1871        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872            self.0.request.name = v.into();
1873            self
1874        }
1875
1876        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1877        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1878            self.0.request.filter = v.into();
1879            self
1880        }
1881
1882        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1883        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1884            self.0.request.page_size = v.into();
1885            self
1886        }
1887
1888        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1889        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890            self.0.request.page_token = v.into();
1891            self
1892        }
1893
1894        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1895        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1896            self.0.request.return_partial_success = v.into();
1897            self
1898        }
1899    }
1900
1901    #[doc(hidden)]
1902    impl crate::RequestBuilder for ListOperations {
1903        fn request_options(&mut self) -> &mut crate::RequestOptions {
1904            &mut self.0.options
1905        }
1906    }
1907
1908    /// The request builder for [BatchController::get_operation][crate::client::BatchController::get_operation] calls.
1909    ///
1910    /// # Example
1911    /// ```
1912    /// # use google_cloud_dataproc_v1::builder::batch_controller::GetOperation;
1913    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1914    ///
1915    /// let builder = prepare_request_builder();
1916    /// let response = builder.send().await?;
1917    /// # Ok(()) }
1918    ///
1919    /// fn prepare_request_builder() -> GetOperation {
1920    ///   # panic!();
1921    ///   // ... details omitted ...
1922    /// }
1923    /// ```
1924    #[derive(Clone, Debug)]
1925    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1926
1927    impl GetOperation {
1928        pub(crate) fn new(
1929            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1930        ) -> Self {
1931            Self(RequestBuilder::new(stub))
1932        }
1933
1934        /// Sets the full request, replacing any prior values.
1935        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1936            mut self,
1937            v: V,
1938        ) -> Self {
1939            self.0.request = v.into();
1940            self
1941        }
1942
1943        /// Sets all the options, replacing any prior values.
1944        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1945            self.0.options = v.into();
1946            self
1947        }
1948
1949        /// Sends the request.
1950        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1951            (*self.0.stub)
1952                .get_operation(self.0.request, self.0.options)
1953                .await
1954                .map(crate::Response::into_body)
1955        }
1956
1957        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1959            self.0.request.name = v.into();
1960            self
1961        }
1962    }
1963
1964    #[doc(hidden)]
1965    impl crate::RequestBuilder for GetOperation {
1966        fn request_options(&mut self) -> &mut crate::RequestOptions {
1967            &mut self.0.options
1968        }
1969    }
1970
1971    /// The request builder for [BatchController::delete_operation][crate::client::BatchController::delete_operation] calls.
1972    ///
1973    /// # Example
1974    /// ```
1975    /// # use google_cloud_dataproc_v1::builder::batch_controller::DeleteOperation;
1976    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
1977    ///
1978    /// let builder = prepare_request_builder();
1979    /// let response = builder.send().await?;
1980    /// # Ok(()) }
1981    ///
1982    /// fn prepare_request_builder() -> DeleteOperation {
1983    ///   # panic!();
1984    ///   // ... details omitted ...
1985    /// }
1986    /// ```
1987    #[derive(Clone, Debug)]
1988    pub struct DeleteOperation(
1989        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1990    );
1991
1992    impl DeleteOperation {
1993        pub(crate) fn new(
1994            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
1995        ) -> Self {
1996            Self(RequestBuilder::new(stub))
1997        }
1998
1999        /// Sets the full request, replacing any prior values.
2000        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2001            mut self,
2002            v: V,
2003        ) -> Self {
2004            self.0.request = v.into();
2005            self
2006        }
2007
2008        /// Sets all the options, replacing any prior values.
2009        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2010            self.0.options = v.into();
2011            self
2012        }
2013
2014        /// Sends the request.
2015        pub async fn send(self) -> Result<()> {
2016            (*self.0.stub)
2017                .delete_operation(self.0.request, self.0.options)
2018                .await
2019                .map(crate::Response::into_body)
2020        }
2021
2022        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2023        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2024            self.0.request.name = v.into();
2025            self
2026        }
2027    }
2028
2029    #[doc(hidden)]
2030    impl crate::RequestBuilder for DeleteOperation {
2031        fn request_options(&mut self) -> &mut crate::RequestOptions {
2032            &mut self.0.options
2033        }
2034    }
2035
2036    /// The request builder for [BatchController::cancel_operation][crate::client::BatchController::cancel_operation] calls.
2037    ///
2038    /// # Example
2039    /// ```
2040    /// # use google_cloud_dataproc_v1::builder::batch_controller::CancelOperation;
2041    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2042    ///
2043    /// let builder = prepare_request_builder();
2044    /// let response = builder.send().await?;
2045    /// # Ok(()) }
2046    ///
2047    /// fn prepare_request_builder() -> CancelOperation {
2048    ///   # panic!();
2049    ///   // ... details omitted ...
2050    /// }
2051    /// ```
2052    #[derive(Clone, Debug)]
2053    pub struct CancelOperation(
2054        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2055    );
2056
2057    impl CancelOperation {
2058        pub(crate) fn new(
2059            stub: std::sync::Arc<dyn super::super::stub::dynamic::BatchController>,
2060        ) -> Self {
2061            Self(RequestBuilder::new(stub))
2062        }
2063
2064        /// Sets the full request, replacing any prior values.
2065        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2066            mut self,
2067            v: V,
2068        ) -> 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        pub async fn send(self) -> Result<()> {
2081            (*self.0.stub)
2082                .cancel_operation(self.0.request, self.0.options)
2083                .await
2084                .map(crate::Response::into_body)
2085        }
2086
2087        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2088        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2089            self.0.request.name = v.into();
2090            self
2091        }
2092    }
2093
2094    #[doc(hidden)]
2095    impl crate::RequestBuilder for CancelOperation {
2096        fn request_options(&mut self) -> &mut crate::RequestOptions {
2097            &mut self.0.options
2098        }
2099    }
2100}
2101
2102/// Request and client builders for [ClusterController][crate::client::ClusterController].
2103pub mod cluster_controller {
2104    use crate::Result;
2105
2106    /// A builder for [ClusterController][crate::client::ClusterController].
2107    ///
2108    /// ```
2109    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2110    /// # use google_cloud_dataproc_v1::*;
2111    /// # use builder::cluster_controller::ClientBuilder;
2112    /// # use client::ClusterController;
2113    /// let builder : ClientBuilder = ClusterController::builder();
2114    /// let client = builder
2115    ///     .with_endpoint("https://dataproc.googleapis.com")
2116    ///     .build().await?;
2117    /// # Ok(()) }
2118    /// ```
2119    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2120
2121    pub(crate) mod client {
2122        use super::super::super::client::ClusterController;
2123        pub struct Factory;
2124        impl crate::ClientFactory for Factory {
2125            type Client = ClusterController;
2126            type Credentials = gaxi::options::Credentials;
2127            async fn build(
2128                self,
2129                config: gaxi::options::ClientConfig,
2130            ) -> crate::ClientBuilderResult<Self::Client> {
2131                Self::Client::new(config).await
2132            }
2133        }
2134    }
2135
2136    /// Common implementation for [crate::client::ClusterController] request builders.
2137    #[derive(Clone, Debug)]
2138    pub(crate) struct RequestBuilder<R: std::default::Default> {
2139        stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2140        request: R,
2141        options: crate::RequestOptions,
2142    }
2143
2144    impl<R> RequestBuilder<R>
2145    where
2146        R: std::default::Default,
2147    {
2148        pub(crate) fn new(
2149            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2150        ) -> Self {
2151            Self {
2152                stub,
2153                request: R::default(),
2154                options: crate::RequestOptions::default(),
2155            }
2156        }
2157    }
2158
2159    /// The request builder for [ClusterController::create_cluster][crate::client::ClusterController::create_cluster] calls.
2160    ///
2161    /// # Example
2162    /// ```
2163    /// # use google_cloud_dataproc_v1::builder::cluster_controller::CreateCluster;
2164    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2165    /// use google_cloud_lro::Poller;
2166    ///
2167    /// let builder = prepare_request_builder();
2168    /// let response = builder.poller().until_done().await?;
2169    /// # Ok(()) }
2170    ///
2171    /// fn prepare_request_builder() -> CreateCluster {
2172    ///   # panic!();
2173    ///   // ... details omitted ...
2174    /// }
2175    /// ```
2176    #[derive(Clone, Debug)]
2177    pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
2178
2179    impl CreateCluster {
2180        pub(crate) fn new(
2181            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2182        ) -> Self {
2183            Self(RequestBuilder::new(stub))
2184        }
2185
2186        /// Sets the full request, replacing any prior values.
2187        pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
2188            self.0.request = v.into();
2189            self
2190        }
2191
2192        /// Sets all the options, replacing any prior values.
2193        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2194            self.0.options = v.into();
2195            self
2196        }
2197
2198        /// Sends the request.
2199        ///
2200        /// # Long running operations
2201        ///
2202        /// This starts, but does not poll, a longrunning operation. More information
2203        /// on [create_cluster][crate::client::ClusterController::create_cluster].
2204        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2205            (*self.0.stub)
2206                .create_cluster(self.0.request, self.0.options)
2207                .await
2208                .map(crate::Response::into_body)
2209        }
2210
2211        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_cluster`.
2212        pub fn poller(
2213            self,
2214        ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::ClusterOperationMetadata>
2215        {
2216            type Operation = google_cloud_lro::internal::Operation<
2217                crate::model::Cluster,
2218                crate::model::ClusterOperationMetadata,
2219            >;
2220            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2221            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2222            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2223            if let Some(ref mut details) = poller_options.tracing {
2224                details.method_name = "google_cloud_dataproc_v1::client::ClusterController::create_cluster::until_done";
2225            }
2226
2227            let stub = self.0.stub.clone();
2228            let mut options = self.0.options.clone();
2229            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2230            let query = move |name| {
2231                let stub = stub.clone();
2232                let options = options.clone();
2233                async {
2234                    let op = GetOperation::new(stub)
2235                        .set_name(name)
2236                        .with_options(options)
2237                        .send()
2238                        .await?;
2239                    Ok(Operation::new(op))
2240                }
2241            };
2242
2243            let start = move || async {
2244                let op = self.send().await?;
2245                Ok(Operation::new(op))
2246            };
2247
2248            use google_cloud_lro::internal::PollerExt;
2249            {
2250                google_cloud_lro::internal::new_poller(
2251                    polling_error_policy,
2252                    polling_backoff_policy,
2253                    start,
2254                    query,
2255                )
2256            }
2257            .with_options(poller_options)
2258        }
2259
2260        /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
2261        ///
2262        /// This is a **required** field for requests.
2263        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264            self.0.request.project_id = v.into();
2265            self
2266        }
2267
2268        /// Sets the value of [region][crate::model::CreateClusterRequest::region].
2269        ///
2270        /// This is a **required** field for requests.
2271        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
2272            self.0.request.region = v.into();
2273            self
2274        }
2275
2276        /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
2277        ///
2278        /// This is a **required** field for requests.
2279        pub fn set_cluster<T>(mut self, v: T) -> Self
2280        where
2281            T: std::convert::Into<crate::model::Cluster>,
2282        {
2283            self.0.request.cluster = std::option::Option::Some(v.into());
2284            self
2285        }
2286
2287        /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
2288        ///
2289        /// This is a **required** field for requests.
2290        pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
2291        where
2292            T: std::convert::Into<crate::model::Cluster>,
2293        {
2294            self.0.request.cluster = v.map(|x| x.into());
2295            self
2296        }
2297
2298        /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
2299        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2300            self.0.request.request_id = v.into();
2301            self
2302        }
2303
2304        /// Sets the value of [action_on_failed_primary_workers][crate::model::CreateClusterRequest::action_on_failed_primary_workers].
2305        pub fn set_action_on_failed_primary_workers<T: Into<crate::model::FailureAction>>(
2306            mut self,
2307            v: T,
2308        ) -> Self {
2309            self.0.request.action_on_failed_primary_workers = v.into();
2310            self
2311        }
2312    }
2313
2314    #[doc(hidden)]
2315    impl crate::RequestBuilder for CreateCluster {
2316        fn request_options(&mut self) -> &mut crate::RequestOptions {
2317            &mut self.0.options
2318        }
2319    }
2320
2321    /// The request builder for [ClusterController::update_cluster][crate::client::ClusterController::update_cluster] calls.
2322    ///
2323    /// # Example
2324    /// ```
2325    /// # use google_cloud_dataproc_v1::builder::cluster_controller::UpdateCluster;
2326    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2327    /// use google_cloud_lro::Poller;
2328    ///
2329    /// let builder = prepare_request_builder();
2330    /// let response = builder.poller().until_done().await?;
2331    /// # Ok(()) }
2332    ///
2333    /// fn prepare_request_builder() -> UpdateCluster {
2334    ///   # panic!();
2335    ///   // ... details omitted ...
2336    /// }
2337    /// ```
2338    #[derive(Clone, Debug)]
2339    pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
2340
2341    impl UpdateCluster {
2342        pub(crate) fn new(
2343            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2344        ) -> Self {
2345            Self(RequestBuilder::new(stub))
2346        }
2347
2348        /// Sets the full request, replacing any prior values.
2349        pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
2350            self.0.request = v.into();
2351            self
2352        }
2353
2354        /// Sets all the options, replacing any prior values.
2355        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2356            self.0.options = v.into();
2357            self
2358        }
2359
2360        /// Sends the request.
2361        ///
2362        /// # Long running operations
2363        ///
2364        /// This starts, but does not poll, a longrunning operation. More information
2365        /// on [update_cluster][crate::client::ClusterController::update_cluster].
2366        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2367            (*self.0.stub)
2368                .update_cluster(self.0.request, self.0.options)
2369                .await
2370                .map(crate::Response::into_body)
2371        }
2372
2373        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_cluster`.
2374        pub fn poller(
2375            self,
2376        ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::ClusterOperationMetadata>
2377        {
2378            type Operation = google_cloud_lro::internal::Operation<
2379                crate::model::Cluster,
2380                crate::model::ClusterOperationMetadata,
2381            >;
2382            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2383            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2384            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2385            if let Some(ref mut details) = poller_options.tracing {
2386                details.method_name = "google_cloud_dataproc_v1::client::ClusterController::update_cluster::until_done";
2387            }
2388
2389            let stub = self.0.stub.clone();
2390            let mut options = self.0.options.clone();
2391            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2392            let query = move |name| {
2393                let stub = stub.clone();
2394                let options = options.clone();
2395                async {
2396                    let op = GetOperation::new(stub)
2397                        .set_name(name)
2398                        .with_options(options)
2399                        .send()
2400                        .await?;
2401                    Ok(Operation::new(op))
2402                }
2403            };
2404
2405            let start = move || async {
2406                let op = self.send().await?;
2407                Ok(Operation::new(op))
2408            };
2409
2410            use google_cloud_lro::internal::PollerExt;
2411            {
2412                google_cloud_lro::internal::new_poller(
2413                    polling_error_policy,
2414                    polling_backoff_policy,
2415                    start,
2416                    query,
2417                )
2418            }
2419            .with_options(poller_options)
2420        }
2421
2422        /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
2423        ///
2424        /// This is a **required** field for requests.
2425        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2426            self.0.request.project_id = v.into();
2427            self
2428        }
2429
2430        /// Sets the value of [region][crate::model::UpdateClusterRequest::region].
2431        ///
2432        /// This is a **required** field for requests.
2433        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
2434            self.0.request.region = v.into();
2435            self
2436        }
2437
2438        /// Sets the value of [cluster_name][crate::model::UpdateClusterRequest::cluster_name].
2439        ///
2440        /// This is a **required** field for requests.
2441        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442            self.0.request.cluster_name = v.into();
2443            self
2444        }
2445
2446        /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
2447        ///
2448        /// This is a **required** field for requests.
2449        pub fn set_cluster<T>(mut self, v: T) -> Self
2450        where
2451            T: std::convert::Into<crate::model::Cluster>,
2452        {
2453            self.0.request.cluster = std::option::Option::Some(v.into());
2454            self
2455        }
2456
2457        /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
2458        ///
2459        /// This is a **required** field for requests.
2460        pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
2461        where
2462            T: std::convert::Into<crate::model::Cluster>,
2463        {
2464            self.0.request.cluster = v.map(|x| x.into());
2465            self
2466        }
2467
2468        /// Sets the value of [graceful_decommission_timeout][crate::model::UpdateClusterRequest::graceful_decommission_timeout].
2469        pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
2470        where
2471            T: std::convert::Into<wkt::Duration>,
2472        {
2473            self.0.request.graceful_decommission_timeout = std::option::Option::Some(v.into());
2474            self
2475        }
2476
2477        /// Sets or clears the value of [graceful_decommission_timeout][crate::model::UpdateClusterRequest::graceful_decommission_timeout].
2478        pub fn set_or_clear_graceful_decommission_timeout<T>(
2479            mut self,
2480            v: std::option::Option<T>,
2481        ) -> Self
2482        where
2483            T: std::convert::Into<wkt::Duration>,
2484        {
2485            self.0.request.graceful_decommission_timeout = v.map(|x| x.into());
2486            self
2487        }
2488
2489        /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
2490        ///
2491        /// This is a **required** field for requests.
2492        pub fn set_update_mask<T>(mut self, v: T) -> Self
2493        where
2494            T: std::convert::Into<wkt::FieldMask>,
2495        {
2496            self.0.request.update_mask = std::option::Option::Some(v.into());
2497            self
2498        }
2499
2500        /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
2501        ///
2502        /// This is a **required** field for requests.
2503        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2504        where
2505            T: std::convert::Into<wkt::FieldMask>,
2506        {
2507            self.0.request.update_mask = v.map(|x| x.into());
2508            self
2509        }
2510
2511        /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
2512        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2513            self.0.request.request_id = v.into();
2514            self
2515        }
2516    }
2517
2518    #[doc(hidden)]
2519    impl crate::RequestBuilder for UpdateCluster {
2520        fn request_options(&mut self) -> &mut crate::RequestOptions {
2521            &mut self.0.options
2522        }
2523    }
2524
2525    /// The request builder for [ClusterController::stop_cluster][crate::client::ClusterController::stop_cluster] calls.
2526    ///
2527    /// # Example
2528    /// ```
2529    /// # use google_cloud_dataproc_v1::builder::cluster_controller::StopCluster;
2530    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2531    /// use google_cloud_lro::Poller;
2532    ///
2533    /// let builder = prepare_request_builder();
2534    /// let response = builder.poller().until_done().await?;
2535    /// # Ok(()) }
2536    ///
2537    /// fn prepare_request_builder() -> StopCluster {
2538    ///   # panic!();
2539    ///   // ... details omitted ...
2540    /// }
2541    /// ```
2542    #[derive(Clone, Debug)]
2543    pub struct StopCluster(RequestBuilder<crate::model::StopClusterRequest>);
2544
2545    impl StopCluster {
2546        pub(crate) fn new(
2547            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2548        ) -> Self {
2549            Self(RequestBuilder::new(stub))
2550        }
2551
2552        /// Sets the full request, replacing any prior values.
2553        pub fn with_request<V: Into<crate::model::StopClusterRequest>>(mut self, v: V) -> Self {
2554            self.0.request = v.into();
2555            self
2556        }
2557
2558        /// Sets all the options, replacing any prior values.
2559        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2560            self.0.options = v.into();
2561            self
2562        }
2563
2564        /// Sends the request.
2565        ///
2566        /// # Long running operations
2567        ///
2568        /// This starts, but does not poll, a longrunning operation. More information
2569        /// on [stop_cluster][crate::client::ClusterController::stop_cluster].
2570        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2571            (*self.0.stub)
2572                .stop_cluster(self.0.request, self.0.options)
2573                .await
2574                .map(crate::Response::into_body)
2575        }
2576
2577        /// Creates a [Poller][google_cloud_lro::Poller] to work with `stop_cluster`.
2578        pub fn poller(
2579            self,
2580        ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::ClusterOperationMetadata>
2581        {
2582            type Operation = google_cloud_lro::internal::Operation<
2583                crate::model::Cluster,
2584                crate::model::ClusterOperationMetadata,
2585            >;
2586            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2587            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2588            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2589            if let Some(ref mut details) = poller_options.tracing {
2590                details.method_name =
2591                    "google_cloud_dataproc_v1::client::ClusterController::stop_cluster::until_done";
2592            }
2593
2594            let stub = self.0.stub.clone();
2595            let mut options = self.0.options.clone();
2596            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2597            let query = move |name| {
2598                let stub = stub.clone();
2599                let options = options.clone();
2600                async {
2601                    let op = GetOperation::new(stub)
2602                        .set_name(name)
2603                        .with_options(options)
2604                        .send()
2605                        .await?;
2606                    Ok(Operation::new(op))
2607                }
2608            };
2609
2610            let start = move || async {
2611                let op = self.send().await?;
2612                Ok(Operation::new(op))
2613            };
2614
2615            use google_cloud_lro::internal::PollerExt;
2616            {
2617                google_cloud_lro::internal::new_poller(
2618                    polling_error_policy,
2619                    polling_backoff_policy,
2620                    start,
2621                    query,
2622                )
2623            }
2624            .with_options(poller_options)
2625        }
2626
2627        /// Sets the value of [project_id][crate::model::StopClusterRequest::project_id].
2628        ///
2629        /// This is a **required** field for requests.
2630        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2631            self.0.request.project_id = v.into();
2632            self
2633        }
2634
2635        /// Sets the value of [region][crate::model::StopClusterRequest::region].
2636        ///
2637        /// This is a **required** field for requests.
2638        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639            self.0.request.region = v.into();
2640            self
2641        }
2642
2643        /// Sets the value of [cluster_name][crate::model::StopClusterRequest::cluster_name].
2644        ///
2645        /// This is a **required** field for requests.
2646        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2647            self.0.request.cluster_name = v.into();
2648            self
2649        }
2650
2651        /// Sets the value of [cluster_uuid][crate::model::StopClusterRequest::cluster_uuid].
2652        pub fn set_cluster_uuid<T: Into<std::string::String>>(mut self, v: T) -> Self {
2653            self.0.request.cluster_uuid = v.into();
2654            self
2655        }
2656
2657        /// Sets the value of [request_id][crate::model::StopClusterRequest::request_id].
2658        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2659            self.0.request.request_id = v.into();
2660            self
2661        }
2662    }
2663
2664    #[doc(hidden)]
2665    impl crate::RequestBuilder for StopCluster {
2666        fn request_options(&mut self) -> &mut crate::RequestOptions {
2667            &mut self.0.options
2668        }
2669    }
2670
2671    /// The request builder for [ClusterController::start_cluster][crate::client::ClusterController::start_cluster] calls.
2672    ///
2673    /// # Example
2674    /// ```
2675    /// # use google_cloud_dataproc_v1::builder::cluster_controller::StartCluster;
2676    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2677    /// use google_cloud_lro::Poller;
2678    ///
2679    /// let builder = prepare_request_builder();
2680    /// let response = builder.poller().until_done().await?;
2681    /// # Ok(()) }
2682    ///
2683    /// fn prepare_request_builder() -> StartCluster {
2684    ///   # panic!();
2685    ///   // ... details omitted ...
2686    /// }
2687    /// ```
2688    #[derive(Clone, Debug)]
2689    pub struct StartCluster(RequestBuilder<crate::model::StartClusterRequest>);
2690
2691    impl StartCluster {
2692        pub(crate) fn new(
2693            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2694        ) -> Self {
2695            Self(RequestBuilder::new(stub))
2696        }
2697
2698        /// Sets the full request, replacing any prior values.
2699        pub fn with_request<V: Into<crate::model::StartClusterRequest>>(mut self, v: V) -> Self {
2700            self.0.request = v.into();
2701            self
2702        }
2703
2704        /// Sets all the options, replacing any prior values.
2705        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2706            self.0.options = v.into();
2707            self
2708        }
2709
2710        /// Sends the request.
2711        ///
2712        /// # Long running operations
2713        ///
2714        /// This starts, but does not poll, a longrunning operation. More information
2715        /// on [start_cluster][crate::client::ClusterController::start_cluster].
2716        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2717            (*self.0.stub)
2718                .start_cluster(self.0.request, self.0.options)
2719                .await
2720                .map(crate::Response::into_body)
2721        }
2722
2723        /// Creates a [Poller][google_cloud_lro::Poller] to work with `start_cluster`.
2724        pub fn poller(
2725            self,
2726        ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::ClusterOperationMetadata>
2727        {
2728            type Operation = google_cloud_lro::internal::Operation<
2729                crate::model::Cluster,
2730                crate::model::ClusterOperationMetadata,
2731            >;
2732            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2733            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2734            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2735            if let Some(ref mut details) = poller_options.tracing {
2736                details.method_name = "google_cloud_dataproc_v1::client::ClusterController::start_cluster::until_done";
2737            }
2738
2739            let stub = self.0.stub.clone();
2740            let mut options = self.0.options.clone();
2741            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2742            let query = move |name| {
2743                let stub = stub.clone();
2744                let options = options.clone();
2745                async {
2746                    let op = GetOperation::new(stub)
2747                        .set_name(name)
2748                        .with_options(options)
2749                        .send()
2750                        .await?;
2751                    Ok(Operation::new(op))
2752                }
2753            };
2754
2755            let start = move || async {
2756                let op = self.send().await?;
2757                Ok(Operation::new(op))
2758            };
2759
2760            use google_cloud_lro::internal::PollerExt;
2761            {
2762                google_cloud_lro::internal::new_poller(
2763                    polling_error_policy,
2764                    polling_backoff_policy,
2765                    start,
2766                    query,
2767                )
2768            }
2769            .with_options(poller_options)
2770        }
2771
2772        /// Sets the value of [project_id][crate::model::StartClusterRequest::project_id].
2773        ///
2774        /// This is a **required** field for requests.
2775        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2776            self.0.request.project_id = v.into();
2777            self
2778        }
2779
2780        /// Sets the value of [region][crate::model::StartClusterRequest::region].
2781        ///
2782        /// This is a **required** field for requests.
2783        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
2784            self.0.request.region = v.into();
2785            self
2786        }
2787
2788        /// Sets the value of [cluster_name][crate::model::StartClusterRequest::cluster_name].
2789        ///
2790        /// This is a **required** field for requests.
2791        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2792            self.0.request.cluster_name = v.into();
2793            self
2794        }
2795
2796        /// Sets the value of [cluster_uuid][crate::model::StartClusterRequest::cluster_uuid].
2797        pub fn set_cluster_uuid<T: Into<std::string::String>>(mut self, v: T) -> Self {
2798            self.0.request.cluster_uuid = v.into();
2799            self
2800        }
2801
2802        /// Sets the value of [request_id][crate::model::StartClusterRequest::request_id].
2803        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2804            self.0.request.request_id = v.into();
2805            self
2806        }
2807    }
2808
2809    #[doc(hidden)]
2810    impl crate::RequestBuilder for StartCluster {
2811        fn request_options(&mut self) -> &mut crate::RequestOptions {
2812            &mut self.0.options
2813        }
2814    }
2815
2816    /// The request builder for [ClusterController::delete_cluster][crate::client::ClusterController::delete_cluster] calls.
2817    ///
2818    /// # Example
2819    /// ```
2820    /// # use google_cloud_dataproc_v1::builder::cluster_controller::DeleteCluster;
2821    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2822    /// use google_cloud_lro::Poller;
2823    ///
2824    /// let builder = prepare_request_builder();
2825    /// let response = builder.poller().until_done().await?;
2826    /// # Ok(()) }
2827    ///
2828    /// fn prepare_request_builder() -> DeleteCluster {
2829    ///   # panic!();
2830    ///   // ... details omitted ...
2831    /// }
2832    /// ```
2833    #[derive(Clone, Debug)]
2834    pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
2835
2836    impl DeleteCluster {
2837        pub(crate) fn new(
2838            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2839        ) -> Self {
2840            Self(RequestBuilder::new(stub))
2841        }
2842
2843        /// Sets the full request, replacing any prior values.
2844        pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
2845            self.0.request = v.into();
2846            self
2847        }
2848
2849        /// Sets all the options, replacing any prior values.
2850        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2851            self.0.options = v.into();
2852            self
2853        }
2854
2855        /// Sends the request.
2856        ///
2857        /// # Long running operations
2858        ///
2859        /// This starts, but does not poll, a longrunning operation. More information
2860        /// on [delete_cluster][crate::client::ClusterController::delete_cluster].
2861        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2862            (*self.0.stub)
2863                .delete_cluster(self.0.request, self.0.options)
2864                .await
2865                .map(crate::Response::into_body)
2866        }
2867
2868        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_cluster`.
2869        pub fn poller(
2870            self,
2871        ) -> impl google_cloud_lro::Poller<(), crate::model::ClusterOperationMetadata> {
2872            type Operation = google_cloud_lro::internal::Operation<
2873                wkt::Empty,
2874                crate::model::ClusterOperationMetadata,
2875            >;
2876            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2877            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2878            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2879            if let Some(ref mut details) = poller_options.tracing {
2880                details.method_name = "google_cloud_dataproc_v1::client::ClusterController::delete_cluster::until_done";
2881            }
2882
2883            let stub = self.0.stub.clone();
2884            let mut options = self.0.options.clone();
2885            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2886            let query = move |name| {
2887                let stub = stub.clone();
2888                let options = options.clone();
2889                async {
2890                    let op = GetOperation::new(stub)
2891                        .set_name(name)
2892                        .with_options(options)
2893                        .send()
2894                        .await?;
2895                    Ok(Operation::new(op))
2896                }
2897            };
2898
2899            let start = move || async {
2900                let op = self.send().await?;
2901                Ok(Operation::new(op))
2902            };
2903
2904            use google_cloud_lro::internal::PollerExt;
2905            {
2906                google_cloud_lro::internal::new_unit_response_poller(
2907                    polling_error_policy,
2908                    polling_backoff_policy,
2909                    start,
2910                    query,
2911                )
2912            }
2913            .with_options(poller_options)
2914        }
2915
2916        /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
2917        ///
2918        /// This is a **required** field for requests.
2919        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920            self.0.request.project_id = v.into();
2921            self
2922        }
2923
2924        /// Sets the value of [region][crate::model::DeleteClusterRequest::region].
2925        ///
2926        /// This is a **required** field for requests.
2927        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
2928            self.0.request.region = v.into();
2929            self
2930        }
2931
2932        /// Sets the value of [cluster_name][crate::model::DeleteClusterRequest::cluster_name].
2933        ///
2934        /// This is a **required** field for requests.
2935        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2936            self.0.request.cluster_name = v.into();
2937            self
2938        }
2939
2940        /// Sets the value of [cluster_uuid][crate::model::DeleteClusterRequest::cluster_uuid].
2941        pub fn set_cluster_uuid<T: Into<std::string::String>>(mut self, v: T) -> Self {
2942            self.0.request.cluster_uuid = v.into();
2943            self
2944        }
2945
2946        /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
2947        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2948            self.0.request.request_id = v.into();
2949            self
2950        }
2951    }
2952
2953    #[doc(hidden)]
2954    impl crate::RequestBuilder for DeleteCluster {
2955        fn request_options(&mut self) -> &mut crate::RequestOptions {
2956            &mut self.0.options
2957        }
2958    }
2959
2960    /// The request builder for [ClusterController::get_cluster][crate::client::ClusterController::get_cluster] calls.
2961    ///
2962    /// # Example
2963    /// ```
2964    /// # use google_cloud_dataproc_v1::builder::cluster_controller::GetCluster;
2965    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
2966    ///
2967    /// let builder = prepare_request_builder();
2968    /// let response = builder.send().await?;
2969    /// # Ok(()) }
2970    ///
2971    /// fn prepare_request_builder() -> GetCluster {
2972    ///   # panic!();
2973    ///   // ... details omitted ...
2974    /// }
2975    /// ```
2976    #[derive(Clone, Debug)]
2977    pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
2978
2979    impl GetCluster {
2980        pub(crate) fn new(
2981            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
2982        ) -> Self {
2983            Self(RequestBuilder::new(stub))
2984        }
2985
2986        /// Sets the full request, replacing any prior values.
2987        pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
2988            self.0.request = v.into();
2989            self
2990        }
2991
2992        /// Sets all the options, replacing any prior values.
2993        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2994            self.0.options = v.into();
2995            self
2996        }
2997
2998        /// Sends the request.
2999        pub async fn send(self) -> Result<crate::model::Cluster> {
3000            (*self.0.stub)
3001                .get_cluster(self.0.request, self.0.options)
3002                .await
3003                .map(crate::Response::into_body)
3004        }
3005
3006        /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
3007        ///
3008        /// This is a **required** field for requests.
3009        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3010            self.0.request.project_id = v.into();
3011            self
3012        }
3013
3014        /// Sets the value of [region][crate::model::GetClusterRequest::region].
3015        ///
3016        /// This is a **required** field for requests.
3017        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
3018            self.0.request.region = v.into();
3019            self
3020        }
3021
3022        /// Sets the value of [cluster_name][crate::model::GetClusterRequest::cluster_name].
3023        ///
3024        /// This is a **required** field for requests.
3025        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3026            self.0.request.cluster_name = v.into();
3027            self
3028        }
3029    }
3030
3031    #[doc(hidden)]
3032    impl crate::RequestBuilder for GetCluster {
3033        fn request_options(&mut self) -> &mut crate::RequestOptions {
3034            &mut self.0.options
3035        }
3036    }
3037
3038    /// The request builder for [ClusterController::list_clusters][crate::client::ClusterController::list_clusters] calls.
3039    ///
3040    /// # Example
3041    /// ```
3042    /// # use google_cloud_dataproc_v1::builder::cluster_controller::ListClusters;
3043    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3044    /// use google_cloud_gax::paginator::ItemPaginator;
3045    ///
3046    /// let builder = prepare_request_builder();
3047    /// let mut items = builder.by_item();
3048    /// while let Some(result) = items.next().await {
3049    ///   let item = result?;
3050    /// }
3051    /// # Ok(()) }
3052    ///
3053    /// fn prepare_request_builder() -> ListClusters {
3054    ///   # panic!();
3055    ///   // ... details omitted ...
3056    /// }
3057    /// ```
3058    #[derive(Clone, Debug)]
3059    pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
3060
3061    impl ListClusters {
3062        pub(crate) fn new(
3063            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3064        ) -> Self {
3065            Self(RequestBuilder::new(stub))
3066        }
3067
3068        /// Sets the full request, replacing any prior values.
3069        pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
3070            self.0.request = v.into();
3071            self
3072        }
3073
3074        /// Sets all the options, replacing any prior values.
3075        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3076            self.0.options = v.into();
3077            self
3078        }
3079
3080        /// Sends the request.
3081        pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
3082            (*self.0.stub)
3083                .list_clusters(self.0.request, self.0.options)
3084                .await
3085                .map(crate::Response::into_body)
3086        }
3087
3088        /// Streams each page in the collection.
3089        pub fn by_page(
3090            self,
3091        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListClustersResponse, crate::Error>
3092        {
3093            use std::clone::Clone;
3094            let token = self.0.request.page_token.clone();
3095            let execute = move |token: String| {
3096                let mut builder = self.clone();
3097                builder.0.request = builder.0.request.set_page_token(token);
3098                builder.send()
3099            };
3100            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3101        }
3102
3103        /// Streams each item in the collection.
3104        pub fn by_item(
3105            self,
3106        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3107            crate::model::ListClustersResponse,
3108            crate::Error,
3109        > {
3110            use google_cloud_gax::paginator::Paginator;
3111            self.by_page().items()
3112        }
3113
3114        /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
3115        ///
3116        /// This is a **required** field for requests.
3117        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3118            self.0.request.project_id = v.into();
3119            self
3120        }
3121
3122        /// Sets the value of [region][crate::model::ListClustersRequest::region].
3123        ///
3124        /// This is a **required** field for requests.
3125        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
3126            self.0.request.region = v.into();
3127            self
3128        }
3129
3130        /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
3131        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132            self.0.request.filter = v.into();
3133            self
3134        }
3135
3136        /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
3137        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3138            self.0.request.page_size = v.into();
3139            self
3140        }
3141
3142        /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
3143        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3144            self.0.request.page_token = v.into();
3145            self
3146        }
3147    }
3148
3149    #[doc(hidden)]
3150    impl crate::RequestBuilder for ListClusters {
3151        fn request_options(&mut self) -> &mut crate::RequestOptions {
3152            &mut self.0.options
3153        }
3154    }
3155
3156    /// The request builder for [ClusterController::diagnose_cluster][crate::client::ClusterController::diagnose_cluster] calls.
3157    ///
3158    /// # Example
3159    /// ```
3160    /// # use google_cloud_dataproc_v1::builder::cluster_controller::DiagnoseCluster;
3161    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3162    /// use google_cloud_lro::Poller;
3163    ///
3164    /// let builder = prepare_request_builder();
3165    /// let response = builder.poller().until_done().await?;
3166    /// # Ok(()) }
3167    ///
3168    /// fn prepare_request_builder() -> DiagnoseCluster {
3169    ///   # panic!();
3170    ///   // ... details omitted ...
3171    /// }
3172    /// ```
3173    #[derive(Clone, Debug)]
3174    pub struct DiagnoseCluster(RequestBuilder<crate::model::DiagnoseClusterRequest>);
3175
3176    impl DiagnoseCluster {
3177        pub(crate) fn new(
3178            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3179        ) -> Self {
3180            Self(RequestBuilder::new(stub))
3181        }
3182
3183        /// Sets the full request, replacing any prior values.
3184        pub fn with_request<V: Into<crate::model::DiagnoseClusterRequest>>(mut self, v: V) -> Self {
3185            self.0.request = v.into();
3186            self
3187        }
3188
3189        /// Sets all the options, replacing any prior values.
3190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3191            self.0.options = v.into();
3192            self
3193        }
3194
3195        /// Sends the request.
3196        ///
3197        /// # Long running operations
3198        ///
3199        /// This starts, but does not poll, a longrunning operation. More information
3200        /// on [diagnose_cluster][crate::client::ClusterController::diagnose_cluster].
3201        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3202            (*self.0.stub)
3203                .diagnose_cluster(self.0.request, self.0.options)
3204                .await
3205                .map(crate::Response::into_body)
3206        }
3207
3208        /// Creates a [Poller][google_cloud_lro::Poller] to work with `diagnose_cluster`.
3209        pub fn poller(
3210            self,
3211        ) -> impl google_cloud_lro::Poller<
3212            crate::model::DiagnoseClusterResults,
3213            crate::model::ClusterOperationMetadata,
3214        > {
3215            type Operation = google_cloud_lro::internal::Operation<
3216                crate::model::DiagnoseClusterResults,
3217                crate::model::ClusterOperationMetadata,
3218            >;
3219            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3220            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3221            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3222            if let Some(ref mut details) = poller_options.tracing {
3223                details.method_name = "google_cloud_dataproc_v1::client::ClusterController::diagnose_cluster::until_done";
3224            }
3225
3226            let stub = self.0.stub.clone();
3227            let mut options = self.0.options.clone();
3228            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3229            let query = move |name| {
3230                let stub = stub.clone();
3231                let options = options.clone();
3232                async {
3233                    let op = GetOperation::new(stub)
3234                        .set_name(name)
3235                        .with_options(options)
3236                        .send()
3237                        .await?;
3238                    Ok(Operation::new(op))
3239                }
3240            };
3241
3242            let start = move || async {
3243                let op = self.send().await?;
3244                Ok(Operation::new(op))
3245            };
3246
3247            use google_cloud_lro::internal::PollerExt;
3248            {
3249                google_cloud_lro::internal::new_poller(
3250                    polling_error_policy,
3251                    polling_backoff_policy,
3252                    start,
3253                    query,
3254                )
3255            }
3256            .with_options(poller_options)
3257        }
3258
3259        /// Sets the value of [project_id][crate::model::DiagnoseClusterRequest::project_id].
3260        ///
3261        /// This is a **required** field for requests.
3262        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3263            self.0.request.project_id = v.into();
3264            self
3265        }
3266
3267        /// Sets the value of [region][crate::model::DiagnoseClusterRequest::region].
3268        ///
3269        /// This is a **required** field for requests.
3270        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
3271            self.0.request.region = v.into();
3272            self
3273        }
3274
3275        /// Sets the value of [cluster_name][crate::model::DiagnoseClusterRequest::cluster_name].
3276        ///
3277        /// This is a **required** field for requests.
3278        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3279            self.0.request.cluster_name = v.into();
3280            self
3281        }
3282
3283        /// Sets the value of [tarball_gcs_dir][crate::model::DiagnoseClusterRequest::tarball_gcs_dir].
3284        pub fn set_tarball_gcs_dir<T: Into<std::string::String>>(mut self, v: T) -> Self {
3285            self.0.request.tarball_gcs_dir = v.into();
3286            self
3287        }
3288
3289        /// Sets the value of [tarball_access][crate::model::DiagnoseClusterRequest::tarball_access].
3290        pub fn set_tarball_access<
3291            T: Into<crate::model::diagnose_cluster_request::TarballAccess>,
3292        >(
3293            mut self,
3294            v: T,
3295        ) -> Self {
3296            self.0.request.tarball_access = v.into();
3297            self
3298        }
3299
3300        /// Sets the value of [diagnosis_interval][crate::model::DiagnoseClusterRequest::diagnosis_interval].
3301        pub fn set_diagnosis_interval<T>(mut self, v: T) -> Self
3302        where
3303            T: std::convert::Into<google_cloud_type::model::Interval>,
3304        {
3305            self.0.request.diagnosis_interval = std::option::Option::Some(v.into());
3306            self
3307        }
3308
3309        /// Sets or clears the value of [diagnosis_interval][crate::model::DiagnoseClusterRequest::diagnosis_interval].
3310        pub fn set_or_clear_diagnosis_interval<T>(mut self, v: std::option::Option<T>) -> Self
3311        where
3312            T: std::convert::Into<google_cloud_type::model::Interval>,
3313        {
3314            self.0.request.diagnosis_interval = v.map(|x| x.into());
3315            self
3316        }
3317
3318        /// Sets the value of [jobs][crate::model::DiagnoseClusterRequest::jobs].
3319        pub fn set_jobs<T, V>(mut self, v: T) -> Self
3320        where
3321            T: std::iter::IntoIterator<Item = V>,
3322            V: std::convert::Into<std::string::String>,
3323        {
3324            use std::iter::Iterator;
3325            self.0.request.jobs = v.into_iter().map(|i| i.into()).collect();
3326            self
3327        }
3328
3329        /// Sets the value of [yarn_application_ids][crate::model::DiagnoseClusterRequest::yarn_application_ids].
3330        pub fn set_yarn_application_ids<T, V>(mut self, v: T) -> Self
3331        where
3332            T: std::iter::IntoIterator<Item = V>,
3333            V: std::convert::Into<std::string::String>,
3334        {
3335            use std::iter::Iterator;
3336            self.0.request.yarn_application_ids = v.into_iter().map(|i| i.into()).collect();
3337            self
3338        }
3339    }
3340
3341    #[doc(hidden)]
3342    impl crate::RequestBuilder for DiagnoseCluster {
3343        fn request_options(&mut self) -> &mut crate::RequestOptions {
3344            &mut self.0.options
3345        }
3346    }
3347
3348    /// The request builder for [ClusterController::set_iam_policy][crate::client::ClusterController::set_iam_policy] calls.
3349    ///
3350    /// # Example
3351    /// ```
3352    /// # use google_cloud_dataproc_v1::builder::cluster_controller::SetIamPolicy;
3353    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3354    ///
3355    /// let builder = prepare_request_builder();
3356    /// let response = builder.send().await?;
3357    /// # Ok(()) }
3358    ///
3359    /// fn prepare_request_builder() -> SetIamPolicy {
3360    ///   # panic!();
3361    ///   // ... details omitted ...
3362    /// }
3363    /// ```
3364    #[derive(Clone, Debug)]
3365    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3366
3367    impl SetIamPolicy {
3368        pub(crate) fn new(
3369            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3370        ) -> Self {
3371            Self(RequestBuilder::new(stub))
3372        }
3373
3374        /// Sets the full request, replacing any prior values.
3375        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3376            mut self,
3377            v: V,
3378        ) -> Self {
3379            self.0.request = v.into();
3380            self
3381        }
3382
3383        /// Sets all the options, replacing any prior values.
3384        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3385            self.0.options = v.into();
3386            self
3387        }
3388
3389        /// Sends the request.
3390        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3391            (*self.0.stub)
3392                .set_iam_policy(self.0.request, self.0.options)
3393                .await
3394                .map(crate::Response::into_body)
3395        }
3396
3397        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3398        ///
3399        /// This is a **required** field for requests.
3400        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3401            self.0.request.resource = v.into();
3402            self
3403        }
3404
3405        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3406        ///
3407        /// This is a **required** field for requests.
3408        pub fn set_policy<T>(mut self, v: T) -> Self
3409        where
3410            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3411        {
3412            self.0.request.policy = std::option::Option::Some(v.into());
3413            self
3414        }
3415
3416        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3417        ///
3418        /// This is a **required** field for requests.
3419        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3420        where
3421            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3422        {
3423            self.0.request.policy = v.map(|x| x.into());
3424            self
3425        }
3426
3427        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3428        pub fn set_update_mask<T>(mut self, v: T) -> Self
3429        where
3430            T: std::convert::Into<wkt::FieldMask>,
3431        {
3432            self.0.request.update_mask = std::option::Option::Some(v.into());
3433            self
3434        }
3435
3436        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3437        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3438        where
3439            T: std::convert::Into<wkt::FieldMask>,
3440        {
3441            self.0.request.update_mask = v.map(|x| x.into());
3442            self
3443        }
3444    }
3445
3446    #[doc(hidden)]
3447    impl crate::RequestBuilder for SetIamPolicy {
3448        fn request_options(&mut self) -> &mut crate::RequestOptions {
3449            &mut self.0.options
3450        }
3451    }
3452
3453    /// The request builder for [ClusterController::get_iam_policy][crate::client::ClusterController::get_iam_policy] calls.
3454    ///
3455    /// # Example
3456    /// ```
3457    /// # use google_cloud_dataproc_v1::builder::cluster_controller::GetIamPolicy;
3458    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3459    ///
3460    /// let builder = prepare_request_builder();
3461    /// let response = builder.send().await?;
3462    /// # Ok(()) }
3463    ///
3464    /// fn prepare_request_builder() -> GetIamPolicy {
3465    ///   # panic!();
3466    ///   // ... details omitted ...
3467    /// }
3468    /// ```
3469    #[derive(Clone, Debug)]
3470    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3471
3472    impl GetIamPolicy {
3473        pub(crate) fn new(
3474            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3475        ) -> Self {
3476            Self(RequestBuilder::new(stub))
3477        }
3478
3479        /// Sets the full request, replacing any prior values.
3480        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3481            mut self,
3482            v: V,
3483        ) -> Self {
3484            self.0.request = v.into();
3485            self
3486        }
3487
3488        /// Sets all the options, replacing any prior values.
3489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3490            self.0.options = v.into();
3491            self
3492        }
3493
3494        /// Sends the request.
3495        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3496            (*self.0.stub)
3497                .get_iam_policy(self.0.request, self.0.options)
3498                .await
3499                .map(crate::Response::into_body)
3500        }
3501
3502        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3503        ///
3504        /// This is a **required** field for requests.
3505        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3506            self.0.request.resource = v.into();
3507            self
3508        }
3509
3510        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3511        pub fn set_options<T>(mut self, v: T) -> Self
3512        where
3513            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3514        {
3515            self.0.request.options = std::option::Option::Some(v.into());
3516            self
3517        }
3518
3519        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3520        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3521        where
3522            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3523        {
3524            self.0.request.options = v.map(|x| x.into());
3525            self
3526        }
3527    }
3528
3529    #[doc(hidden)]
3530    impl crate::RequestBuilder for GetIamPolicy {
3531        fn request_options(&mut self) -> &mut crate::RequestOptions {
3532            &mut self.0.options
3533        }
3534    }
3535
3536    /// The request builder for [ClusterController::test_iam_permissions][crate::client::ClusterController::test_iam_permissions] calls.
3537    ///
3538    /// # Example
3539    /// ```
3540    /// # use google_cloud_dataproc_v1::builder::cluster_controller::TestIamPermissions;
3541    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3542    ///
3543    /// let builder = prepare_request_builder();
3544    /// let response = builder.send().await?;
3545    /// # Ok(()) }
3546    ///
3547    /// fn prepare_request_builder() -> TestIamPermissions {
3548    ///   # panic!();
3549    ///   // ... details omitted ...
3550    /// }
3551    /// ```
3552    #[derive(Clone, Debug)]
3553    pub struct TestIamPermissions(
3554        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3555    );
3556
3557    impl TestIamPermissions {
3558        pub(crate) fn new(
3559            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3560        ) -> Self {
3561            Self(RequestBuilder::new(stub))
3562        }
3563
3564        /// Sets the full request, replacing any prior values.
3565        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3566            mut self,
3567            v: V,
3568        ) -> Self {
3569            self.0.request = v.into();
3570            self
3571        }
3572
3573        /// Sets all the options, replacing any prior values.
3574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3575            self.0.options = v.into();
3576            self
3577        }
3578
3579        /// Sends the request.
3580        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3581            (*self.0.stub)
3582                .test_iam_permissions(self.0.request, self.0.options)
3583                .await
3584                .map(crate::Response::into_body)
3585        }
3586
3587        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3588        ///
3589        /// This is a **required** field for requests.
3590        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3591            self.0.request.resource = v.into();
3592            self
3593        }
3594
3595        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3596        ///
3597        /// This is a **required** field for requests.
3598        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3599        where
3600            T: std::iter::IntoIterator<Item = V>,
3601            V: std::convert::Into<std::string::String>,
3602        {
3603            use std::iter::Iterator;
3604            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3605            self
3606        }
3607    }
3608
3609    #[doc(hidden)]
3610    impl crate::RequestBuilder for TestIamPermissions {
3611        fn request_options(&mut self) -> &mut crate::RequestOptions {
3612            &mut self.0.options
3613        }
3614    }
3615
3616    /// The request builder for [ClusterController::list_operations][crate::client::ClusterController::list_operations] calls.
3617    ///
3618    /// # Example
3619    /// ```
3620    /// # use google_cloud_dataproc_v1::builder::cluster_controller::ListOperations;
3621    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3622    /// use google_cloud_gax::paginator::ItemPaginator;
3623    ///
3624    /// let builder = prepare_request_builder();
3625    /// let mut items = builder.by_item();
3626    /// while let Some(result) = items.next().await {
3627    ///   let item = result?;
3628    /// }
3629    /// # Ok(()) }
3630    ///
3631    /// fn prepare_request_builder() -> ListOperations {
3632    ///   # panic!();
3633    ///   // ... details omitted ...
3634    /// }
3635    /// ```
3636    #[derive(Clone, Debug)]
3637    pub struct ListOperations(
3638        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3639    );
3640
3641    impl ListOperations {
3642        pub(crate) fn new(
3643            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3644        ) -> Self {
3645            Self(RequestBuilder::new(stub))
3646        }
3647
3648        /// Sets the full request, replacing any prior values.
3649        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3650            mut self,
3651            v: V,
3652        ) -> Self {
3653            self.0.request = v.into();
3654            self
3655        }
3656
3657        /// Sets all the options, replacing any prior values.
3658        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3659            self.0.options = v.into();
3660            self
3661        }
3662
3663        /// Sends the request.
3664        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3665            (*self.0.stub)
3666                .list_operations(self.0.request, self.0.options)
3667                .await
3668                .map(crate::Response::into_body)
3669        }
3670
3671        /// Streams each page in the collection.
3672        pub fn by_page(
3673            self,
3674        ) -> impl google_cloud_gax::paginator::Paginator<
3675            google_cloud_longrunning::model::ListOperationsResponse,
3676            crate::Error,
3677        > {
3678            use std::clone::Clone;
3679            let token = self.0.request.page_token.clone();
3680            let execute = move |token: String| {
3681                let mut builder = self.clone();
3682                builder.0.request = builder.0.request.set_page_token(token);
3683                builder.send()
3684            };
3685            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3686        }
3687
3688        /// Streams each item in the collection.
3689        pub fn by_item(
3690            self,
3691        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3692            google_cloud_longrunning::model::ListOperationsResponse,
3693            crate::Error,
3694        > {
3695            use google_cloud_gax::paginator::Paginator;
3696            self.by_page().items()
3697        }
3698
3699        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3700        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3701            self.0.request.name = v.into();
3702            self
3703        }
3704
3705        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3706        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3707            self.0.request.filter = v.into();
3708            self
3709        }
3710
3711        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3712        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3713            self.0.request.page_size = v.into();
3714            self
3715        }
3716
3717        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3718        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3719            self.0.request.page_token = v.into();
3720            self
3721        }
3722
3723        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3724        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3725            self.0.request.return_partial_success = v.into();
3726            self
3727        }
3728    }
3729
3730    #[doc(hidden)]
3731    impl crate::RequestBuilder for ListOperations {
3732        fn request_options(&mut self) -> &mut crate::RequestOptions {
3733            &mut self.0.options
3734        }
3735    }
3736
3737    /// The request builder for [ClusterController::get_operation][crate::client::ClusterController::get_operation] calls.
3738    ///
3739    /// # Example
3740    /// ```
3741    /// # use google_cloud_dataproc_v1::builder::cluster_controller::GetOperation;
3742    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3743    ///
3744    /// let builder = prepare_request_builder();
3745    /// let response = builder.send().await?;
3746    /// # Ok(()) }
3747    ///
3748    /// fn prepare_request_builder() -> GetOperation {
3749    ///   # panic!();
3750    ///   // ... details omitted ...
3751    /// }
3752    /// ```
3753    #[derive(Clone, Debug)]
3754    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3755
3756    impl GetOperation {
3757        pub(crate) fn new(
3758            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3759        ) -> Self {
3760            Self(RequestBuilder::new(stub))
3761        }
3762
3763        /// Sets the full request, replacing any prior values.
3764        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3765            mut self,
3766            v: V,
3767        ) -> Self {
3768            self.0.request = v.into();
3769            self
3770        }
3771
3772        /// Sets all the options, replacing any prior values.
3773        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3774            self.0.options = v.into();
3775            self
3776        }
3777
3778        /// Sends the request.
3779        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3780            (*self.0.stub)
3781                .get_operation(self.0.request, self.0.options)
3782                .await
3783                .map(crate::Response::into_body)
3784        }
3785
3786        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3787        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3788            self.0.request.name = v.into();
3789            self
3790        }
3791    }
3792
3793    #[doc(hidden)]
3794    impl crate::RequestBuilder for GetOperation {
3795        fn request_options(&mut self) -> &mut crate::RequestOptions {
3796            &mut self.0.options
3797        }
3798    }
3799
3800    /// The request builder for [ClusterController::delete_operation][crate::client::ClusterController::delete_operation] calls.
3801    ///
3802    /// # Example
3803    /// ```
3804    /// # use google_cloud_dataproc_v1::builder::cluster_controller::DeleteOperation;
3805    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3806    ///
3807    /// let builder = prepare_request_builder();
3808    /// let response = builder.send().await?;
3809    /// # Ok(()) }
3810    ///
3811    /// fn prepare_request_builder() -> DeleteOperation {
3812    ///   # panic!();
3813    ///   // ... details omitted ...
3814    /// }
3815    /// ```
3816    #[derive(Clone, Debug)]
3817    pub struct DeleteOperation(
3818        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3819    );
3820
3821    impl DeleteOperation {
3822        pub(crate) fn new(
3823            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3824        ) -> Self {
3825            Self(RequestBuilder::new(stub))
3826        }
3827
3828        /// Sets the full request, replacing any prior values.
3829        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3830            mut self,
3831            v: V,
3832        ) -> Self {
3833            self.0.request = v.into();
3834            self
3835        }
3836
3837        /// Sets all the options, replacing any prior values.
3838        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3839            self.0.options = v.into();
3840            self
3841        }
3842
3843        /// Sends the request.
3844        pub async fn send(self) -> Result<()> {
3845            (*self.0.stub)
3846                .delete_operation(self.0.request, self.0.options)
3847                .await
3848                .map(crate::Response::into_body)
3849        }
3850
3851        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3852        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3853            self.0.request.name = v.into();
3854            self
3855        }
3856    }
3857
3858    #[doc(hidden)]
3859    impl crate::RequestBuilder for DeleteOperation {
3860        fn request_options(&mut self) -> &mut crate::RequestOptions {
3861            &mut self.0.options
3862        }
3863    }
3864
3865    /// The request builder for [ClusterController::cancel_operation][crate::client::ClusterController::cancel_operation] calls.
3866    ///
3867    /// # Example
3868    /// ```
3869    /// # use google_cloud_dataproc_v1::builder::cluster_controller::CancelOperation;
3870    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3871    ///
3872    /// let builder = prepare_request_builder();
3873    /// let response = builder.send().await?;
3874    /// # Ok(()) }
3875    ///
3876    /// fn prepare_request_builder() -> CancelOperation {
3877    ///   # panic!();
3878    ///   // ... details omitted ...
3879    /// }
3880    /// ```
3881    #[derive(Clone, Debug)]
3882    pub struct CancelOperation(
3883        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3884    );
3885
3886    impl CancelOperation {
3887        pub(crate) fn new(
3888            stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterController>,
3889        ) -> Self {
3890            Self(RequestBuilder::new(stub))
3891        }
3892
3893        /// Sets the full request, replacing any prior values.
3894        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3895            mut self,
3896            v: V,
3897        ) -> Self {
3898            self.0.request = v.into();
3899            self
3900        }
3901
3902        /// Sets all the options, replacing any prior values.
3903        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3904            self.0.options = v.into();
3905            self
3906        }
3907
3908        /// Sends the request.
3909        pub async fn send(self) -> Result<()> {
3910            (*self.0.stub)
3911                .cancel_operation(self.0.request, self.0.options)
3912                .await
3913                .map(crate::Response::into_body)
3914        }
3915
3916        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3917        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3918            self.0.request.name = v.into();
3919            self
3920        }
3921    }
3922
3923    #[doc(hidden)]
3924    impl crate::RequestBuilder for CancelOperation {
3925        fn request_options(&mut self) -> &mut crate::RequestOptions {
3926            &mut self.0.options
3927        }
3928    }
3929}
3930
3931/// Request and client builders for [JobController][crate::client::JobController].
3932pub mod job_controller {
3933    use crate::Result;
3934
3935    /// A builder for [JobController][crate::client::JobController].
3936    ///
3937    /// ```
3938    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3939    /// # use google_cloud_dataproc_v1::*;
3940    /// # use builder::job_controller::ClientBuilder;
3941    /// # use client::JobController;
3942    /// let builder : ClientBuilder = JobController::builder();
3943    /// let client = builder
3944    ///     .with_endpoint("https://dataproc.googleapis.com")
3945    ///     .build().await?;
3946    /// # Ok(()) }
3947    /// ```
3948    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3949
3950    pub(crate) mod client {
3951        use super::super::super::client::JobController;
3952        pub struct Factory;
3953        impl crate::ClientFactory for Factory {
3954            type Client = JobController;
3955            type Credentials = gaxi::options::Credentials;
3956            async fn build(
3957                self,
3958                config: gaxi::options::ClientConfig,
3959            ) -> crate::ClientBuilderResult<Self::Client> {
3960                Self::Client::new(config).await
3961            }
3962        }
3963    }
3964
3965    /// Common implementation for [crate::client::JobController] request builders.
3966    #[derive(Clone, Debug)]
3967    pub(crate) struct RequestBuilder<R: std::default::Default> {
3968        stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
3969        request: R,
3970        options: crate::RequestOptions,
3971    }
3972
3973    impl<R> RequestBuilder<R>
3974    where
3975        R: std::default::Default,
3976    {
3977        pub(crate) fn new(
3978            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
3979        ) -> Self {
3980            Self {
3981                stub,
3982                request: R::default(),
3983                options: crate::RequestOptions::default(),
3984            }
3985        }
3986    }
3987
3988    /// The request builder for [JobController::submit_job][crate::client::JobController::submit_job] calls.
3989    ///
3990    /// # Example
3991    /// ```
3992    /// # use google_cloud_dataproc_v1::builder::job_controller::SubmitJob;
3993    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
3994    ///
3995    /// let builder = prepare_request_builder();
3996    /// let response = builder.send().await?;
3997    /// # Ok(()) }
3998    ///
3999    /// fn prepare_request_builder() -> SubmitJob {
4000    ///   # panic!();
4001    ///   // ... details omitted ...
4002    /// }
4003    /// ```
4004    #[derive(Clone, Debug)]
4005    pub struct SubmitJob(RequestBuilder<crate::model::SubmitJobRequest>);
4006
4007    impl SubmitJob {
4008        pub(crate) fn new(
4009            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4010        ) -> Self {
4011            Self(RequestBuilder::new(stub))
4012        }
4013
4014        /// Sets the full request, replacing any prior values.
4015        pub fn with_request<V: Into<crate::model::SubmitJobRequest>>(mut self, v: V) -> Self {
4016            self.0.request = v.into();
4017            self
4018        }
4019
4020        /// Sets all the options, replacing any prior values.
4021        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4022            self.0.options = v.into();
4023            self
4024        }
4025
4026        /// Sends the request.
4027        pub async fn send(self) -> Result<crate::model::Job> {
4028            (*self.0.stub)
4029                .submit_job(self.0.request, self.0.options)
4030                .await
4031                .map(crate::Response::into_body)
4032        }
4033
4034        /// Sets the value of [project_id][crate::model::SubmitJobRequest::project_id].
4035        ///
4036        /// This is a **required** field for requests.
4037        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4038            self.0.request.project_id = v.into();
4039            self
4040        }
4041
4042        /// Sets the value of [region][crate::model::SubmitJobRequest::region].
4043        ///
4044        /// This is a **required** field for requests.
4045        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046            self.0.request.region = v.into();
4047            self
4048        }
4049
4050        /// Sets the value of [job][crate::model::SubmitJobRequest::job].
4051        ///
4052        /// This is a **required** field for requests.
4053        pub fn set_job<T>(mut self, v: T) -> Self
4054        where
4055            T: std::convert::Into<crate::model::Job>,
4056        {
4057            self.0.request.job = std::option::Option::Some(v.into());
4058            self
4059        }
4060
4061        /// Sets or clears the value of [job][crate::model::SubmitJobRequest::job].
4062        ///
4063        /// This is a **required** field for requests.
4064        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
4065        where
4066            T: std::convert::Into<crate::model::Job>,
4067        {
4068            self.0.request.job = v.map(|x| x.into());
4069            self
4070        }
4071
4072        /// Sets the value of [request_id][crate::model::SubmitJobRequest::request_id].
4073        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4074            self.0.request.request_id = v.into();
4075            self
4076        }
4077    }
4078
4079    #[doc(hidden)]
4080    impl crate::RequestBuilder for SubmitJob {
4081        fn request_options(&mut self) -> &mut crate::RequestOptions {
4082            &mut self.0.options
4083        }
4084    }
4085
4086    /// The request builder for [JobController::submit_job_as_operation][crate::client::JobController::submit_job_as_operation] calls.
4087    ///
4088    /// # Example
4089    /// ```
4090    /// # use google_cloud_dataproc_v1::builder::job_controller::SubmitJobAsOperation;
4091    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4092    /// use google_cloud_lro::Poller;
4093    ///
4094    /// let builder = prepare_request_builder();
4095    /// let response = builder.poller().until_done().await?;
4096    /// # Ok(()) }
4097    ///
4098    /// fn prepare_request_builder() -> SubmitJobAsOperation {
4099    ///   # panic!();
4100    ///   // ... details omitted ...
4101    /// }
4102    /// ```
4103    #[derive(Clone, Debug)]
4104    pub struct SubmitJobAsOperation(RequestBuilder<crate::model::SubmitJobRequest>);
4105
4106    impl SubmitJobAsOperation {
4107        pub(crate) fn new(
4108            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4109        ) -> Self {
4110            Self(RequestBuilder::new(stub))
4111        }
4112
4113        /// Sets the full request, replacing any prior values.
4114        pub fn with_request<V: Into<crate::model::SubmitJobRequest>>(mut self, v: V) -> Self {
4115            self.0.request = v.into();
4116            self
4117        }
4118
4119        /// Sets all the options, replacing any prior values.
4120        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4121            self.0.options = v.into();
4122            self
4123        }
4124
4125        /// Sends the request.
4126        ///
4127        /// # Long running operations
4128        ///
4129        /// This starts, but does not poll, a longrunning operation. More information
4130        /// on [submit_job_as_operation][crate::client::JobController::submit_job_as_operation].
4131        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4132            (*self.0.stub)
4133                .submit_job_as_operation(self.0.request, self.0.options)
4134                .await
4135                .map(crate::Response::into_body)
4136        }
4137
4138        /// Creates a [Poller][google_cloud_lro::Poller] to work with `submit_job_as_operation`.
4139        pub fn poller(
4140            self,
4141        ) -> impl google_cloud_lro::Poller<crate::model::Job, crate::model::JobMetadata> {
4142            type Operation =
4143                google_cloud_lro::internal::Operation<crate::model::Job, crate::model::JobMetadata>;
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 = "google_cloud_dataproc_v1::client::JobController::submit_job_as_operation::until_done";
4149            }
4150
4151            let stub = self.0.stub.clone();
4152            let mut options = self.0.options.clone();
4153            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4154            let query = move |name| {
4155                let stub = stub.clone();
4156                let options = options.clone();
4157                async {
4158                    let op = GetOperation::new(stub)
4159                        .set_name(name)
4160                        .with_options(options)
4161                        .send()
4162                        .await?;
4163                    Ok(Operation::new(op))
4164                }
4165            };
4166
4167            let start = move || async {
4168                let op = self.send().await?;
4169                Ok(Operation::new(op))
4170            };
4171
4172            use google_cloud_lro::internal::PollerExt;
4173            {
4174                google_cloud_lro::internal::new_poller(
4175                    polling_error_policy,
4176                    polling_backoff_policy,
4177                    start,
4178                    query,
4179                )
4180            }
4181            .with_options(poller_options)
4182        }
4183
4184        /// Sets the value of [project_id][crate::model::SubmitJobRequest::project_id].
4185        ///
4186        /// This is a **required** field for requests.
4187        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4188            self.0.request.project_id = v.into();
4189            self
4190        }
4191
4192        /// Sets the value of [region][crate::model::SubmitJobRequest::region].
4193        ///
4194        /// This is a **required** field for requests.
4195        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4196            self.0.request.region = v.into();
4197            self
4198        }
4199
4200        /// Sets the value of [job][crate::model::SubmitJobRequest::job].
4201        ///
4202        /// This is a **required** field for requests.
4203        pub fn set_job<T>(mut self, v: T) -> Self
4204        where
4205            T: std::convert::Into<crate::model::Job>,
4206        {
4207            self.0.request.job = std::option::Option::Some(v.into());
4208            self
4209        }
4210
4211        /// Sets or clears the value of [job][crate::model::SubmitJobRequest::job].
4212        ///
4213        /// This is a **required** field for requests.
4214        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
4215        where
4216            T: std::convert::Into<crate::model::Job>,
4217        {
4218            self.0.request.job = v.map(|x| x.into());
4219            self
4220        }
4221
4222        /// Sets the value of [request_id][crate::model::SubmitJobRequest::request_id].
4223        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4224            self.0.request.request_id = v.into();
4225            self
4226        }
4227    }
4228
4229    #[doc(hidden)]
4230    impl crate::RequestBuilder for SubmitJobAsOperation {
4231        fn request_options(&mut self) -> &mut crate::RequestOptions {
4232            &mut self.0.options
4233        }
4234    }
4235
4236    /// The request builder for [JobController::get_job][crate::client::JobController::get_job] calls.
4237    ///
4238    /// # Example
4239    /// ```
4240    /// # use google_cloud_dataproc_v1::builder::job_controller::GetJob;
4241    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4242    ///
4243    /// let builder = prepare_request_builder();
4244    /// let response = builder.send().await?;
4245    /// # Ok(()) }
4246    ///
4247    /// fn prepare_request_builder() -> GetJob {
4248    ///   # panic!();
4249    ///   // ... details omitted ...
4250    /// }
4251    /// ```
4252    #[derive(Clone, Debug)]
4253    pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
4254
4255    impl GetJob {
4256        pub(crate) fn new(
4257            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4258        ) -> Self {
4259            Self(RequestBuilder::new(stub))
4260        }
4261
4262        /// Sets the full request, replacing any prior values.
4263        pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
4264            self.0.request = v.into();
4265            self
4266        }
4267
4268        /// Sets all the options, replacing any prior values.
4269        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4270            self.0.options = v.into();
4271            self
4272        }
4273
4274        /// Sends the request.
4275        pub async fn send(self) -> Result<crate::model::Job> {
4276            (*self.0.stub)
4277                .get_job(self.0.request, self.0.options)
4278                .await
4279                .map(crate::Response::into_body)
4280        }
4281
4282        /// Sets the value of [project_id][crate::model::GetJobRequest::project_id].
4283        ///
4284        /// This is a **required** field for requests.
4285        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4286            self.0.request.project_id = v.into();
4287            self
4288        }
4289
4290        /// Sets the value of [region][crate::model::GetJobRequest::region].
4291        ///
4292        /// This is a **required** field for requests.
4293        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4294            self.0.request.region = v.into();
4295            self
4296        }
4297
4298        /// Sets the value of [job_id][crate::model::GetJobRequest::job_id].
4299        ///
4300        /// This is a **required** field for requests.
4301        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4302            self.0.request.job_id = v.into();
4303            self
4304        }
4305    }
4306
4307    #[doc(hidden)]
4308    impl crate::RequestBuilder for GetJob {
4309        fn request_options(&mut self) -> &mut crate::RequestOptions {
4310            &mut self.0.options
4311        }
4312    }
4313
4314    /// The request builder for [JobController::list_jobs][crate::client::JobController::list_jobs] calls.
4315    ///
4316    /// # Example
4317    /// ```
4318    /// # use google_cloud_dataproc_v1::builder::job_controller::ListJobs;
4319    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4320    /// use google_cloud_gax::paginator::ItemPaginator;
4321    ///
4322    /// let builder = prepare_request_builder();
4323    /// let mut items = builder.by_item();
4324    /// while let Some(result) = items.next().await {
4325    ///   let item = result?;
4326    /// }
4327    /// # Ok(()) }
4328    ///
4329    /// fn prepare_request_builder() -> ListJobs {
4330    ///   # panic!();
4331    ///   // ... details omitted ...
4332    /// }
4333    /// ```
4334    #[derive(Clone, Debug)]
4335    pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
4336
4337    impl ListJobs {
4338        pub(crate) fn new(
4339            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4340        ) -> Self {
4341            Self(RequestBuilder::new(stub))
4342        }
4343
4344        /// Sets the full request, replacing any prior values.
4345        pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
4346            self.0.request = v.into();
4347            self
4348        }
4349
4350        /// Sets all the options, replacing any prior values.
4351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4352            self.0.options = v.into();
4353            self
4354        }
4355
4356        /// Sends the request.
4357        pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
4358            (*self.0.stub)
4359                .list_jobs(self.0.request, self.0.options)
4360                .await
4361                .map(crate::Response::into_body)
4362        }
4363
4364        /// Streams each page in the collection.
4365        pub fn by_page(
4366            self,
4367        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::Error>
4368        {
4369            use std::clone::Clone;
4370            let token = self.0.request.page_token.clone();
4371            let execute = move |token: String| {
4372                let mut builder = self.clone();
4373                builder.0.request = builder.0.request.set_page_token(token);
4374                builder.send()
4375            };
4376            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4377        }
4378
4379        /// Streams each item in the collection.
4380        pub fn by_item(
4381            self,
4382        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
4383        {
4384            use google_cloud_gax::paginator::Paginator;
4385            self.by_page().items()
4386        }
4387
4388        /// Sets the value of [project_id][crate::model::ListJobsRequest::project_id].
4389        ///
4390        /// This is a **required** field for requests.
4391        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4392            self.0.request.project_id = v.into();
4393            self
4394        }
4395
4396        /// Sets the value of [region][crate::model::ListJobsRequest::region].
4397        ///
4398        /// This is a **required** field for requests.
4399        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4400            self.0.request.region = v.into();
4401            self
4402        }
4403
4404        /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
4405        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4406            self.0.request.page_size = v.into();
4407            self
4408        }
4409
4410        /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
4411        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4412            self.0.request.page_token = v.into();
4413            self
4414        }
4415
4416        /// Sets the value of [cluster_name][crate::model::ListJobsRequest::cluster_name].
4417        pub fn set_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4418            self.0.request.cluster_name = v.into();
4419            self
4420        }
4421
4422        /// Sets the value of [job_state_matcher][crate::model::ListJobsRequest::job_state_matcher].
4423        pub fn set_job_state_matcher<T: Into<crate::model::list_jobs_request::JobStateMatcher>>(
4424            mut self,
4425            v: T,
4426        ) -> Self {
4427            self.0.request.job_state_matcher = v.into();
4428            self
4429        }
4430
4431        /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
4432        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4433            self.0.request.filter = v.into();
4434            self
4435        }
4436    }
4437
4438    #[doc(hidden)]
4439    impl crate::RequestBuilder for ListJobs {
4440        fn request_options(&mut self) -> &mut crate::RequestOptions {
4441            &mut self.0.options
4442        }
4443    }
4444
4445    /// The request builder for [JobController::update_job][crate::client::JobController::update_job] calls.
4446    ///
4447    /// # Example
4448    /// ```
4449    /// # use google_cloud_dataproc_v1::builder::job_controller::UpdateJob;
4450    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4451    ///
4452    /// let builder = prepare_request_builder();
4453    /// let response = builder.send().await?;
4454    /// # Ok(()) }
4455    ///
4456    /// fn prepare_request_builder() -> UpdateJob {
4457    ///   # panic!();
4458    ///   // ... details omitted ...
4459    /// }
4460    /// ```
4461    #[derive(Clone, Debug)]
4462    pub struct UpdateJob(RequestBuilder<crate::model::UpdateJobRequest>);
4463
4464    impl UpdateJob {
4465        pub(crate) fn new(
4466            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4467        ) -> Self {
4468            Self(RequestBuilder::new(stub))
4469        }
4470
4471        /// Sets the full request, replacing any prior values.
4472        pub fn with_request<V: Into<crate::model::UpdateJobRequest>>(mut self, v: V) -> Self {
4473            self.0.request = v.into();
4474            self
4475        }
4476
4477        /// Sets all the options, replacing any prior values.
4478        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4479            self.0.options = v.into();
4480            self
4481        }
4482
4483        /// Sends the request.
4484        pub async fn send(self) -> Result<crate::model::Job> {
4485            (*self.0.stub)
4486                .update_job(self.0.request, self.0.options)
4487                .await
4488                .map(crate::Response::into_body)
4489        }
4490
4491        /// Sets the value of [project_id][crate::model::UpdateJobRequest::project_id].
4492        ///
4493        /// This is a **required** field for requests.
4494        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4495            self.0.request.project_id = v.into();
4496            self
4497        }
4498
4499        /// Sets the value of [region][crate::model::UpdateJobRequest::region].
4500        ///
4501        /// This is a **required** field for requests.
4502        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503            self.0.request.region = v.into();
4504            self
4505        }
4506
4507        /// Sets the value of [job_id][crate::model::UpdateJobRequest::job_id].
4508        ///
4509        /// This is a **required** field for requests.
4510        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4511            self.0.request.job_id = v.into();
4512            self
4513        }
4514
4515        /// Sets the value of [job][crate::model::UpdateJobRequest::job].
4516        ///
4517        /// This is a **required** field for requests.
4518        pub fn set_job<T>(mut self, v: T) -> Self
4519        where
4520            T: std::convert::Into<crate::model::Job>,
4521        {
4522            self.0.request.job = std::option::Option::Some(v.into());
4523            self
4524        }
4525
4526        /// Sets or clears the value of [job][crate::model::UpdateJobRequest::job].
4527        ///
4528        /// This is a **required** field for requests.
4529        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
4530        where
4531            T: std::convert::Into<crate::model::Job>,
4532        {
4533            self.0.request.job = v.map(|x| x.into());
4534            self
4535        }
4536
4537        /// Sets the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
4538        ///
4539        /// This is a **required** field for requests.
4540        pub fn set_update_mask<T>(mut self, v: T) -> Self
4541        where
4542            T: std::convert::Into<wkt::FieldMask>,
4543        {
4544            self.0.request.update_mask = std::option::Option::Some(v.into());
4545            self
4546        }
4547
4548        /// Sets or clears the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
4549        ///
4550        /// This is a **required** field for requests.
4551        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4552        where
4553            T: std::convert::Into<wkt::FieldMask>,
4554        {
4555            self.0.request.update_mask = v.map(|x| x.into());
4556            self
4557        }
4558    }
4559
4560    #[doc(hidden)]
4561    impl crate::RequestBuilder for UpdateJob {
4562        fn request_options(&mut self) -> &mut crate::RequestOptions {
4563            &mut self.0.options
4564        }
4565    }
4566
4567    /// The request builder for [JobController::cancel_job][crate::client::JobController::cancel_job] calls.
4568    ///
4569    /// # Example
4570    /// ```
4571    /// # use google_cloud_dataproc_v1::builder::job_controller::CancelJob;
4572    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4573    ///
4574    /// let builder = prepare_request_builder();
4575    /// let response = builder.send().await?;
4576    /// # Ok(()) }
4577    ///
4578    /// fn prepare_request_builder() -> CancelJob {
4579    ///   # panic!();
4580    ///   // ... details omitted ...
4581    /// }
4582    /// ```
4583    #[derive(Clone, Debug)]
4584    pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
4585
4586    impl CancelJob {
4587        pub(crate) fn new(
4588            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4589        ) -> Self {
4590            Self(RequestBuilder::new(stub))
4591        }
4592
4593        /// Sets the full request, replacing any prior values.
4594        pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
4595            self.0.request = v.into();
4596            self
4597        }
4598
4599        /// Sets all the options, replacing any prior values.
4600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4601            self.0.options = v.into();
4602            self
4603        }
4604
4605        /// Sends the request.
4606        pub async fn send(self) -> Result<crate::model::Job> {
4607            (*self.0.stub)
4608                .cancel_job(self.0.request, self.0.options)
4609                .await
4610                .map(crate::Response::into_body)
4611        }
4612
4613        /// Sets the value of [project_id][crate::model::CancelJobRequest::project_id].
4614        ///
4615        /// This is a **required** field for requests.
4616        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4617            self.0.request.project_id = v.into();
4618            self
4619        }
4620
4621        /// Sets the value of [region][crate::model::CancelJobRequest::region].
4622        ///
4623        /// This is a **required** field for requests.
4624        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4625            self.0.request.region = v.into();
4626            self
4627        }
4628
4629        /// Sets the value of [job_id][crate::model::CancelJobRequest::job_id].
4630        ///
4631        /// This is a **required** field for requests.
4632        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4633            self.0.request.job_id = v.into();
4634            self
4635        }
4636    }
4637
4638    #[doc(hidden)]
4639    impl crate::RequestBuilder for CancelJob {
4640        fn request_options(&mut self) -> &mut crate::RequestOptions {
4641            &mut self.0.options
4642        }
4643    }
4644
4645    /// The request builder for [JobController::delete_job][crate::client::JobController::delete_job] calls.
4646    ///
4647    /// # Example
4648    /// ```
4649    /// # use google_cloud_dataproc_v1::builder::job_controller::DeleteJob;
4650    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4651    ///
4652    /// let builder = prepare_request_builder();
4653    /// let response = builder.send().await?;
4654    /// # Ok(()) }
4655    ///
4656    /// fn prepare_request_builder() -> DeleteJob {
4657    ///   # panic!();
4658    ///   // ... details omitted ...
4659    /// }
4660    /// ```
4661    #[derive(Clone, Debug)]
4662    pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);
4663
4664    impl DeleteJob {
4665        pub(crate) fn new(
4666            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4667        ) -> Self {
4668            Self(RequestBuilder::new(stub))
4669        }
4670
4671        /// Sets the full request, replacing any prior values.
4672        pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
4673            self.0.request = v.into();
4674            self
4675        }
4676
4677        /// Sets all the options, replacing any prior values.
4678        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4679            self.0.options = v.into();
4680            self
4681        }
4682
4683        /// Sends the request.
4684        pub async fn send(self) -> Result<()> {
4685            (*self.0.stub)
4686                .delete_job(self.0.request, self.0.options)
4687                .await
4688                .map(crate::Response::into_body)
4689        }
4690
4691        /// Sets the value of [project_id][crate::model::DeleteJobRequest::project_id].
4692        ///
4693        /// This is a **required** field for requests.
4694        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4695            self.0.request.project_id = v.into();
4696            self
4697        }
4698
4699        /// Sets the value of [region][crate::model::DeleteJobRequest::region].
4700        ///
4701        /// This is a **required** field for requests.
4702        pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
4703            self.0.request.region = v.into();
4704            self
4705        }
4706
4707        /// Sets the value of [job_id][crate::model::DeleteJobRequest::job_id].
4708        ///
4709        /// This is a **required** field for requests.
4710        pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4711            self.0.request.job_id = v.into();
4712            self
4713        }
4714    }
4715
4716    #[doc(hidden)]
4717    impl crate::RequestBuilder for DeleteJob {
4718        fn request_options(&mut self) -> &mut crate::RequestOptions {
4719            &mut self.0.options
4720        }
4721    }
4722
4723    /// The request builder for [JobController::set_iam_policy][crate::client::JobController::set_iam_policy] calls.
4724    ///
4725    /// # Example
4726    /// ```
4727    /// # use google_cloud_dataproc_v1::builder::job_controller::SetIamPolicy;
4728    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4729    ///
4730    /// let builder = prepare_request_builder();
4731    /// let response = builder.send().await?;
4732    /// # Ok(()) }
4733    ///
4734    /// fn prepare_request_builder() -> SetIamPolicy {
4735    ///   # panic!();
4736    ///   // ... details omitted ...
4737    /// }
4738    /// ```
4739    #[derive(Clone, Debug)]
4740    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4741
4742    impl SetIamPolicy {
4743        pub(crate) fn new(
4744            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4745        ) -> Self {
4746            Self(RequestBuilder::new(stub))
4747        }
4748
4749        /// Sets the full request, replacing any prior values.
4750        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4751            mut self,
4752            v: V,
4753        ) -> Self {
4754            self.0.request = v.into();
4755            self
4756        }
4757
4758        /// Sets all the options, replacing any prior values.
4759        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4760            self.0.options = v.into();
4761            self
4762        }
4763
4764        /// Sends the request.
4765        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4766            (*self.0.stub)
4767                .set_iam_policy(self.0.request, self.0.options)
4768                .await
4769                .map(crate::Response::into_body)
4770        }
4771
4772        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4773        ///
4774        /// This is a **required** field for requests.
4775        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4776            self.0.request.resource = v.into();
4777            self
4778        }
4779
4780        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4781        ///
4782        /// This is a **required** field for requests.
4783        pub fn set_policy<T>(mut self, v: T) -> Self
4784        where
4785            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4786        {
4787            self.0.request.policy = std::option::Option::Some(v.into());
4788            self
4789        }
4790
4791        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4792        ///
4793        /// This is a **required** field for requests.
4794        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4795        where
4796            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4797        {
4798            self.0.request.policy = v.map(|x| x.into());
4799            self
4800        }
4801
4802        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4803        pub fn set_update_mask<T>(mut self, v: T) -> Self
4804        where
4805            T: std::convert::Into<wkt::FieldMask>,
4806        {
4807            self.0.request.update_mask = std::option::Option::Some(v.into());
4808            self
4809        }
4810
4811        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4812        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4813        where
4814            T: std::convert::Into<wkt::FieldMask>,
4815        {
4816            self.0.request.update_mask = v.map(|x| x.into());
4817            self
4818        }
4819    }
4820
4821    #[doc(hidden)]
4822    impl crate::RequestBuilder for SetIamPolicy {
4823        fn request_options(&mut self) -> &mut crate::RequestOptions {
4824            &mut self.0.options
4825        }
4826    }
4827
4828    /// The request builder for [JobController::get_iam_policy][crate::client::JobController::get_iam_policy] calls.
4829    ///
4830    /// # Example
4831    /// ```
4832    /// # use google_cloud_dataproc_v1::builder::job_controller::GetIamPolicy;
4833    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4834    ///
4835    /// let builder = prepare_request_builder();
4836    /// let response = builder.send().await?;
4837    /// # Ok(()) }
4838    ///
4839    /// fn prepare_request_builder() -> GetIamPolicy {
4840    ///   # panic!();
4841    ///   // ... details omitted ...
4842    /// }
4843    /// ```
4844    #[derive(Clone, Debug)]
4845    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4846
4847    impl GetIamPolicy {
4848        pub(crate) fn new(
4849            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4850        ) -> Self {
4851            Self(RequestBuilder::new(stub))
4852        }
4853
4854        /// Sets the full request, replacing any prior values.
4855        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4856            mut self,
4857            v: V,
4858        ) -> Self {
4859            self.0.request = v.into();
4860            self
4861        }
4862
4863        /// Sets all the options, replacing any prior values.
4864        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4865            self.0.options = v.into();
4866            self
4867        }
4868
4869        /// Sends the request.
4870        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4871            (*self.0.stub)
4872                .get_iam_policy(self.0.request, self.0.options)
4873                .await
4874                .map(crate::Response::into_body)
4875        }
4876
4877        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4878        ///
4879        /// This is a **required** field for requests.
4880        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4881            self.0.request.resource = v.into();
4882            self
4883        }
4884
4885        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4886        pub fn set_options<T>(mut self, v: T) -> Self
4887        where
4888            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4889        {
4890            self.0.request.options = std::option::Option::Some(v.into());
4891            self
4892        }
4893
4894        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4895        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4896        where
4897            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4898        {
4899            self.0.request.options = v.map(|x| x.into());
4900            self
4901        }
4902    }
4903
4904    #[doc(hidden)]
4905    impl crate::RequestBuilder for GetIamPolicy {
4906        fn request_options(&mut self) -> &mut crate::RequestOptions {
4907            &mut self.0.options
4908        }
4909    }
4910
4911    /// The request builder for [JobController::test_iam_permissions][crate::client::JobController::test_iam_permissions] calls.
4912    ///
4913    /// # Example
4914    /// ```
4915    /// # use google_cloud_dataproc_v1::builder::job_controller::TestIamPermissions;
4916    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4917    ///
4918    /// let builder = prepare_request_builder();
4919    /// let response = builder.send().await?;
4920    /// # Ok(()) }
4921    ///
4922    /// fn prepare_request_builder() -> TestIamPermissions {
4923    ///   # panic!();
4924    ///   // ... details omitted ...
4925    /// }
4926    /// ```
4927    #[derive(Clone, Debug)]
4928    pub struct TestIamPermissions(
4929        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4930    );
4931
4932    impl TestIamPermissions {
4933        pub(crate) fn new(
4934            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
4935        ) -> Self {
4936            Self(RequestBuilder::new(stub))
4937        }
4938
4939        /// Sets the full request, replacing any prior values.
4940        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4941            mut self,
4942            v: V,
4943        ) -> Self {
4944            self.0.request = v.into();
4945            self
4946        }
4947
4948        /// Sets all the options, replacing any prior values.
4949        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4950            self.0.options = v.into();
4951            self
4952        }
4953
4954        /// Sends the request.
4955        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4956            (*self.0.stub)
4957                .test_iam_permissions(self.0.request, self.0.options)
4958                .await
4959                .map(crate::Response::into_body)
4960        }
4961
4962        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4963        ///
4964        /// This is a **required** field for requests.
4965        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4966            self.0.request.resource = v.into();
4967            self
4968        }
4969
4970        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4971        ///
4972        /// This is a **required** field for requests.
4973        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4974        where
4975            T: std::iter::IntoIterator<Item = V>,
4976            V: std::convert::Into<std::string::String>,
4977        {
4978            use std::iter::Iterator;
4979            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4980            self
4981        }
4982    }
4983
4984    #[doc(hidden)]
4985    impl crate::RequestBuilder for TestIamPermissions {
4986        fn request_options(&mut self) -> &mut crate::RequestOptions {
4987            &mut self.0.options
4988        }
4989    }
4990
4991    /// The request builder for [JobController::list_operations][crate::client::JobController::list_operations] calls.
4992    ///
4993    /// # Example
4994    /// ```
4995    /// # use google_cloud_dataproc_v1::builder::job_controller::ListOperations;
4996    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
4997    /// use google_cloud_gax::paginator::ItemPaginator;
4998    ///
4999    /// let builder = prepare_request_builder();
5000    /// let mut items = builder.by_item();
5001    /// while let Some(result) = items.next().await {
5002    ///   let item = result?;
5003    /// }
5004    /// # Ok(()) }
5005    ///
5006    /// fn prepare_request_builder() -> ListOperations {
5007    ///   # panic!();
5008    ///   // ... details omitted ...
5009    /// }
5010    /// ```
5011    #[derive(Clone, Debug)]
5012    pub struct ListOperations(
5013        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5014    );
5015
5016    impl ListOperations {
5017        pub(crate) fn new(
5018            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
5019        ) -> Self {
5020            Self(RequestBuilder::new(stub))
5021        }
5022
5023        /// Sets the full request, replacing any prior values.
5024        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5025            mut self,
5026            v: V,
5027        ) -> Self {
5028            self.0.request = v.into();
5029            self
5030        }
5031
5032        /// Sets all the options, replacing any prior values.
5033        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5034            self.0.options = v.into();
5035            self
5036        }
5037
5038        /// Sends the request.
5039        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5040            (*self.0.stub)
5041                .list_operations(self.0.request, self.0.options)
5042                .await
5043                .map(crate::Response::into_body)
5044        }
5045
5046        /// Streams each page in the collection.
5047        pub fn by_page(
5048            self,
5049        ) -> impl google_cloud_gax::paginator::Paginator<
5050            google_cloud_longrunning::model::ListOperationsResponse,
5051            crate::Error,
5052        > {
5053            use std::clone::Clone;
5054            let token = self.0.request.page_token.clone();
5055            let execute = move |token: String| {
5056                let mut builder = self.clone();
5057                builder.0.request = builder.0.request.set_page_token(token);
5058                builder.send()
5059            };
5060            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5061        }
5062
5063        /// Streams each item in the collection.
5064        pub fn by_item(
5065            self,
5066        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5067            google_cloud_longrunning::model::ListOperationsResponse,
5068            crate::Error,
5069        > {
5070            use google_cloud_gax::paginator::Paginator;
5071            self.by_page().items()
5072        }
5073
5074        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5075        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5076            self.0.request.name = v.into();
5077            self
5078        }
5079
5080        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5081        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5082            self.0.request.filter = v.into();
5083            self
5084        }
5085
5086        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5087        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5088            self.0.request.page_size = v.into();
5089            self
5090        }
5091
5092        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5093        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5094            self.0.request.page_token = v.into();
5095            self
5096        }
5097
5098        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5099        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5100            self.0.request.return_partial_success = v.into();
5101            self
5102        }
5103    }
5104
5105    #[doc(hidden)]
5106    impl crate::RequestBuilder for ListOperations {
5107        fn request_options(&mut self) -> &mut crate::RequestOptions {
5108            &mut self.0.options
5109        }
5110    }
5111
5112    /// The request builder for [JobController::get_operation][crate::client::JobController::get_operation] calls.
5113    ///
5114    /// # Example
5115    /// ```
5116    /// # use google_cloud_dataproc_v1::builder::job_controller::GetOperation;
5117    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5118    ///
5119    /// let builder = prepare_request_builder();
5120    /// let response = builder.send().await?;
5121    /// # Ok(()) }
5122    ///
5123    /// fn prepare_request_builder() -> GetOperation {
5124    ///   # panic!();
5125    ///   // ... details omitted ...
5126    /// }
5127    /// ```
5128    #[derive(Clone, Debug)]
5129    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5130
5131    impl GetOperation {
5132        pub(crate) fn new(
5133            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
5134        ) -> Self {
5135            Self(RequestBuilder::new(stub))
5136        }
5137
5138        /// Sets the full request, replacing any prior values.
5139        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5140            mut self,
5141            v: V,
5142        ) -> Self {
5143            self.0.request = v.into();
5144            self
5145        }
5146
5147        /// Sets all the options, replacing any prior values.
5148        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5149            self.0.options = v.into();
5150            self
5151        }
5152
5153        /// Sends the request.
5154        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5155            (*self.0.stub)
5156                .get_operation(self.0.request, self.0.options)
5157                .await
5158                .map(crate::Response::into_body)
5159        }
5160
5161        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5162        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5163            self.0.request.name = v.into();
5164            self
5165        }
5166    }
5167
5168    #[doc(hidden)]
5169    impl crate::RequestBuilder for GetOperation {
5170        fn request_options(&mut self) -> &mut crate::RequestOptions {
5171            &mut self.0.options
5172        }
5173    }
5174
5175    /// The request builder for [JobController::delete_operation][crate::client::JobController::delete_operation] calls.
5176    ///
5177    /// # Example
5178    /// ```
5179    /// # use google_cloud_dataproc_v1::builder::job_controller::DeleteOperation;
5180    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5181    ///
5182    /// let builder = prepare_request_builder();
5183    /// let response = builder.send().await?;
5184    /// # Ok(()) }
5185    ///
5186    /// fn prepare_request_builder() -> DeleteOperation {
5187    ///   # panic!();
5188    ///   // ... details omitted ...
5189    /// }
5190    /// ```
5191    #[derive(Clone, Debug)]
5192    pub struct DeleteOperation(
5193        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5194    );
5195
5196    impl DeleteOperation {
5197        pub(crate) fn new(
5198            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
5199        ) -> Self {
5200            Self(RequestBuilder::new(stub))
5201        }
5202
5203        /// Sets the full request, replacing any prior values.
5204        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5205            mut self,
5206            v: V,
5207        ) -> Self {
5208            self.0.request = v.into();
5209            self
5210        }
5211
5212        /// Sets all the options, replacing any prior values.
5213        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5214            self.0.options = v.into();
5215            self
5216        }
5217
5218        /// Sends the request.
5219        pub async fn send(self) -> Result<()> {
5220            (*self.0.stub)
5221                .delete_operation(self.0.request, self.0.options)
5222                .await
5223                .map(crate::Response::into_body)
5224        }
5225
5226        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5227        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5228            self.0.request.name = v.into();
5229            self
5230        }
5231    }
5232
5233    #[doc(hidden)]
5234    impl crate::RequestBuilder for DeleteOperation {
5235        fn request_options(&mut self) -> &mut crate::RequestOptions {
5236            &mut self.0.options
5237        }
5238    }
5239
5240    /// The request builder for [JobController::cancel_operation][crate::client::JobController::cancel_operation] calls.
5241    ///
5242    /// # Example
5243    /// ```
5244    /// # use google_cloud_dataproc_v1::builder::job_controller::CancelOperation;
5245    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5246    ///
5247    /// let builder = prepare_request_builder();
5248    /// let response = builder.send().await?;
5249    /// # Ok(()) }
5250    ///
5251    /// fn prepare_request_builder() -> CancelOperation {
5252    ///   # panic!();
5253    ///   // ... details omitted ...
5254    /// }
5255    /// ```
5256    #[derive(Clone, Debug)]
5257    pub struct CancelOperation(
5258        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5259    );
5260
5261    impl CancelOperation {
5262        pub(crate) fn new(
5263            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobController>,
5264        ) -> Self {
5265            Self(RequestBuilder::new(stub))
5266        }
5267
5268        /// Sets the full request, replacing any prior values.
5269        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5270            mut self,
5271            v: V,
5272        ) -> Self {
5273            self.0.request = v.into();
5274            self
5275        }
5276
5277        /// Sets all the options, replacing any prior values.
5278        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5279            self.0.options = v.into();
5280            self
5281        }
5282
5283        /// Sends the request.
5284        pub async fn send(self) -> Result<()> {
5285            (*self.0.stub)
5286                .cancel_operation(self.0.request, self.0.options)
5287                .await
5288                .map(crate::Response::into_body)
5289        }
5290
5291        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5292        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5293            self.0.request.name = v.into();
5294            self
5295        }
5296    }
5297
5298    #[doc(hidden)]
5299    impl crate::RequestBuilder for CancelOperation {
5300        fn request_options(&mut self) -> &mut crate::RequestOptions {
5301            &mut self.0.options
5302        }
5303    }
5304}
5305
5306/// Request and client builders for [NodeGroupController][crate::client::NodeGroupController].
5307pub mod node_group_controller {
5308    use crate::Result;
5309
5310    /// A builder for [NodeGroupController][crate::client::NodeGroupController].
5311    ///
5312    /// ```
5313    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5314    /// # use google_cloud_dataproc_v1::*;
5315    /// # use builder::node_group_controller::ClientBuilder;
5316    /// # use client::NodeGroupController;
5317    /// let builder : ClientBuilder = NodeGroupController::builder();
5318    /// let client = builder
5319    ///     .with_endpoint("https://dataproc.googleapis.com")
5320    ///     .build().await?;
5321    /// # Ok(()) }
5322    /// ```
5323    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5324
5325    pub(crate) mod client {
5326        use super::super::super::client::NodeGroupController;
5327        pub struct Factory;
5328        impl crate::ClientFactory for Factory {
5329            type Client = NodeGroupController;
5330            type Credentials = gaxi::options::Credentials;
5331            async fn build(
5332                self,
5333                config: gaxi::options::ClientConfig,
5334            ) -> crate::ClientBuilderResult<Self::Client> {
5335                Self::Client::new(config).await
5336            }
5337        }
5338    }
5339
5340    /// Common implementation for [crate::client::NodeGroupController] request builders.
5341    #[derive(Clone, Debug)]
5342    pub(crate) struct RequestBuilder<R: std::default::Default> {
5343        stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5344        request: R,
5345        options: crate::RequestOptions,
5346    }
5347
5348    impl<R> RequestBuilder<R>
5349    where
5350        R: std::default::Default,
5351    {
5352        pub(crate) fn new(
5353            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5354        ) -> Self {
5355            Self {
5356                stub,
5357                request: R::default(),
5358                options: crate::RequestOptions::default(),
5359            }
5360        }
5361    }
5362
5363    /// The request builder for [NodeGroupController::create_node_group][crate::client::NodeGroupController::create_node_group] calls.
5364    ///
5365    /// # Example
5366    /// ```
5367    /// # use google_cloud_dataproc_v1::builder::node_group_controller::CreateNodeGroup;
5368    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5369    /// use google_cloud_lro::Poller;
5370    ///
5371    /// let builder = prepare_request_builder();
5372    /// let response = builder.poller().until_done().await?;
5373    /// # Ok(()) }
5374    ///
5375    /// fn prepare_request_builder() -> CreateNodeGroup {
5376    ///   # panic!();
5377    ///   // ... details omitted ...
5378    /// }
5379    /// ```
5380    #[derive(Clone, Debug)]
5381    pub struct CreateNodeGroup(RequestBuilder<crate::model::CreateNodeGroupRequest>);
5382
5383    impl CreateNodeGroup {
5384        pub(crate) fn new(
5385            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5386        ) -> Self {
5387            Self(RequestBuilder::new(stub))
5388        }
5389
5390        /// Sets the full request, replacing any prior values.
5391        pub fn with_request<V: Into<crate::model::CreateNodeGroupRequest>>(mut self, v: V) -> Self {
5392            self.0.request = v.into();
5393            self
5394        }
5395
5396        /// Sets all the options, replacing any prior values.
5397        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5398            self.0.options = v.into();
5399            self
5400        }
5401
5402        /// Sends the request.
5403        ///
5404        /// # Long running operations
5405        ///
5406        /// This starts, but does not poll, a longrunning operation. More information
5407        /// on [create_node_group][crate::client::NodeGroupController::create_node_group].
5408        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5409            (*self.0.stub)
5410                .create_node_group(self.0.request, self.0.options)
5411                .await
5412                .map(crate::Response::into_body)
5413        }
5414
5415        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_node_group`.
5416        pub fn poller(
5417            self,
5418        ) -> impl google_cloud_lro::Poller<
5419            crate::model::NodeGroup,
5420            crate::model::NodeGroupOperationMetadata,
5421        > {
5422            type Operation = google_cloud_lro::internal::Operation<
5423                crate::model::NodeGroup,
5424                crate::model::NodeGroupOperationMetadata,
5425            >;
5426            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5427            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5428            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5429            if let Some(ref mut details) = poller_options.tracing {
5430                details.method_name = "google_cloud_dataproc_v1::client::NodeGroupController::create_node_group::until_done";
5431            }
5432
5433            let stub = self.0.stub.clone();
5434            let mut options = self.0.options.clone();
5435            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5436            let query = move |name| {
5437                let stub = stub.clone();
5438                let options = options.clone();
5439                async {
5440                    let op = GetOperation::new(stub)
5441                        .set_name(name)
5442                        .with_options(options)
5443                        .send()
5444                        .await?;
5445                    Ok(Operation::new(op))
5446                }
5447            };
5448
5449            let start = move || async {
5450                let op = self.send().await?;
5451                Ok(Operation::new(op))
5452            };
5453
5454            use google_cloud_lro::internal::PollerExt;
5455            {
5456                google_cloud_lro::internal::new_poller(
5457                    polling_error_policy,
5458                    polling_backoff_policy,
5459                    start,
5460                    query,
5461                )
5462            }
5463            .with_options(poller_options)
5464        }
5465
5466        /// Sets the value of [parent][crate::model::CreateNodeGroupRequest::parent].
5467        ///
5468        /// This is a **required** field for requests.
5469        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5470            self.0.request.parent = v.into();
5471            self
5472        }
5473
5474        /// Sets the value of [node_group][crate::model::CreateNodeGroupRequest::node_group].
5475        ///
5476        /// This is a **required** field for requests.
5477        pub fn set_node_group<T>(mut self, v: T) -> Self
5478        where
5479            T: std::convert::Into<crate::model::NodeGroup>,
5480        {
5481            self.0.request.node_group = std::option::Option::Some(v.into());
5482            self
5483        }
5484
5485        /// Sets or clears the value of [node_group][crate::model::CreateNodeGroupRequest::node_group].
5486        ///
5487        /// This is a **required** field for requests.
5488        pub fn set_or_clear_node_group<T>(mut self, v: std::option::Option<T>) -> Self
5489        where
5490            T: std::convert::Into<crate::model::NodeGroup>,
5491        {
5492            self.0.request.node_group = v.map(|x| x.into());
5493            self
5494        }
5495
5496        /// Sets the value of [node_group_id][crate::model::CreateNodeGroupRequest::node_group_id].
5497        pub fn set_node_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5498            self.0.request.node_group_id = v.into();
5499            self
5500        }
5501
5502        /// Sets the value of [request_id][crate::model::CreateNodeGroupRequest::request_id].
5503        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5504            self.0.request.request_id = v.into();
5505            self
5506        }
5507    }
5508
5509    #[doc(hidden)]
5510    impl crate::RequestBuilder for CreateNodeGroup {
5511        fn request_options(&mut self) -> &mut crate::RequestOptions {
5512            &mut self.0.options
5513        }
5514    }
5515
5516    /// The request builder for [NodeGroupController::resize_node_group][crate::client::NodeGroupController::resize_node_group] calls.
5517    ///
5518    /// # Example
5519    /// ```
5520    /// # use google_cloud_dataproc_v1::builder::node_group_controller::ResizeNodeGroup;
5521    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5522    /// use google_cloud_lro::Poller;
5523    ///
5524    /// let builder = prepare_request_builder();
5525    /// let response = builder.poller().until_done().await?;
5526    /// # Ok(()) }
5527    ///
5528    /// fn prepare_request_builder() -> ResizeNodeGroup {
5529    ///   # panic!();
5530    ///   // ... details omitted ...
5531    /// }
5532    /// ```
5533    #[derive(Clone, Debug)]
5534    pub struct ResizeNodeGroup(RequestBuilder<crate::model::ResizeNodeGroupRequest>);
5535
5536    impl ResizeNodeGroup {
5537        pub(crate) fn new(
5538            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5539        ) -> Self {
5540            Self(RequestBuilder::new(stub))
5541        }
5542
5543        /// Sets the full request, replacing any prior values.
5544        pub fn with_request<V: Into<crate::model::ResizeNodeGroupRequest>>(mut self, v: V) -> Self {
5545            self.0.request = v.into();
5546            self
5547        }
5548
5549        /// Sets all the options, replacing any prior values.
5550        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5551            self.0.options = v.into();
5552            self
5553        }
5554
5555        /// Sends the request.
5556        ///
5557        /// # Long running operations
5558        ///
5559        /// This starts, but does not poll, a longrunning operation. More information
5560        /// on [resize_node_group][crate::client::NodeGroupController::resize_node_group].
5561        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5562            (*self.0.stub)
5563                .resize_node_group(self.0.request, self.0.options)
5564                .await
5565                .map(crate::Response::into_body)
5566        }
5567
5568        /// Creates a [Poller][google_cloud_lro::Poller] to work with `resize_node_group`.
5569        pub fn poller(
5570            self,
5571        ) -> impl google_cloud_lro::Poller<
5572            crate::model::NodeGroup,
5573            crate::model::NodeGroupOperationMetadata,
5574        > {
5575            type Operation = google_cloud_lro::internal::Operation<
5576                crate::model::NodeGroup,
5577                crate::model::NodeGroupOperationMetadata,
5578            >;
5579            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5580            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5581            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5582            if let Some(ref mut details) = poller_options.tracing {
5583                details.method_name = "google_cloud_dataproc_v1::client::NodeGroupController::resize_node_group::until_done";
5584            }
5585
5586            let stub = self.0.stub.clone();
5587            let mut options = self.0.options.clone();
5588            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5589            let query = move |name| {
5590                let stub = stub.clone();
5591                let options = options.clone();
5592                async {
5593                    let op = GetOperation::new(stub)
5594                        .set_name(name)
5595                        .with_options(options)
5596                        .send()
5597                        .await?;
5598                    Ok(Operation::new(op))
5599                }
5600            };
5601
5602            let start = move || async {
5603                let op = self.send().await?;
5604                Ok(Operation::new(op))
5605            };
5606
5607            use google_cloud_lro::internal::PollerExt;
5608            {
5609                google_cloud_lro::internal::new_poller(
5610                    polling_error_policy,
5611                    polling_backoff_policy,
5612                    start,
5613                    query,
5614                )
5615            }
5616            .with_options(poller_options)
5617        }
5618
5619        /// Sets the value of [name][crate::model::ResizeNodeGroupRequest::name].
5620        ///
5621        /// This is a **required** field for requests.
5622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5623            self.0.request.name = v.into();
5624            self
5625        }
5626
5627        /// Sets the value of [size][crate::model::ResizeNodeGroupRequest::size].
5628        ///
5629        /// This is a **required** field for requests.
5630        pub fn set_size<T: Into<i32>>(mut self, v: T) -> Self {
5631            self.0.request.size = v.into();
5632            self
5633        }
5634
5635        /// Sets the value of [request_id][crate::model::ResizeNodeGroupRequest::request_id].
5636        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5637            self.0.request.request_id = v.into();
5638            self
5639        }
5640
5641        /// Sets the value of [graceful_decommission_timeout][crate::model::ResizeNodeGroupRequest::graceful_decommission_timeout].
5642        pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
5643        where
5644            T: std::convert::Into<wkt::Duration>,
5645        {
5646            self.0.request.graceful_decommission_timeout = std::option::Option::Some(v.into());
5647            self
5648        }
5649
5650        /// Sets or clears the value of [graceful_decommission_timeout][crate::model::ResizeNodeGroupRequest::graceful_decommission_timeout].
5651        pub fn set_or_clear_graceful_decommission_timeout<T>(
5652            mut self,
5653            v: std::option::Option<T>,
5654        ) -> Self
5655        where
5656            T: std::convert::Into<wkt::Duration>,
5657        {
5658            self.0.request.graceful_decommission_timeout = v.map(|x| x.into());
5659            self
5660        }
5661    }
5662
5663    #[doc(hidden)]
5664    impl crate::RequestBuilder for ResizeNodeGroup {
5665        fn request_options(&mut self) -> &mut crate::RequestOptions {
5666            &mut self.0.options
5667        }
5668    }
5669
5670    /// The request builder for [NodeGroupController::get_node_group][crate::client::NodeGroupController::get_node_group] calls.
5671    ///
5672    /// # Example
5673    /// ```
5674    /// # use google_cloud_dataproc_v1::builder::node_group_controller::GetNodeGroup;
5675    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5676    ///
5677    /// let builder = prepare_request_builder();
5678    /// let response = builder.send().await?;
5679    /// # Ok(()) }
5680    ///
5681    /// fn prepare_request_builder() -> GetNodeGroup {
5682    ///   # panic!();
5683    ///   // ... details omitted ...
5684    /// }
5685    /// ```
5686    #[derive(Clone, Debug)]
5687    pub struct GetNodeGroup(RequestBuilder<crate::model::GetNodeGroupRequest>);
5688
5689    impl GetNodeGroup {
5690        pub(crate) fn new(
5691            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5692        ) -> Self {
5693            Self(RequestBuilder::new(stub))
5694        }
5695
5696        /// Sets the full request, replacing any prior values.
5697        pub fn with_request<V: Into<crate::model::GetNodeGroupRequest>>(mut self, v: V) -> Self {
5698            self.0.request = v.into();
5699            self
5700        }
5701
5702        /// Sets all the options, replacing any prior values.
5703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5704            self.0.options = v.into();
5705            self
5706        }
5707
5708        /// Sends the request.
5709        pub async fn send(self) -> Result<crate::model::NodeGroup> {
5710            (*self.0.stub)
5711                .get_node_group(self.0.request, self.0.options)
5712                .await
5713                .map(crate::Response::into_body)
5714        }
5715
5716        /// Sets the value of [name][crate::model::GetNodeGroupRequest::name].
5717        ///
5718        /// This is a **required** field for requests.
5719        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5720            self.0.request.name = v.into();
5721            self
5722        }
5723    }
5724
5725    #[doc(hidden)]
5726    impl crate::RequestBuilder for GetNodeGroup {
5727        fn request_options(&mut self) -> &mut crate::RequestOptions {
5728            &mut self.0.options
5729        }
5730    }
5731
5732    /// The request builder for [NodeGroupController::set_iam_policy][crate::client::NodeGroupController::set_iam_policy] calls.
5733    ///
5734    /// # Example
5735    /// ```
5736    /// # use google_cloud_dataproc_v1::builder::node_group_controller::SetIamPolicy;
5737    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5738    ///
5739    /// let builder = prepare_request_builder();
5740    /// let response = builder.send().await?;
5741    /// # Ok(()) }
5742    ///
5743    /// fn prepare_request_builder() -> SetIamPolicy {
5744    ///   # panic!();
5745    ///   // ... details omitted ...
5746    /// }
5747    /// ```
5748    #[derive(Clone, Debug)]
5749    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5750
5751    impl SetIamPolicy {
5752        pub(crate) fn new(
5753            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5754        ) -> Self {
5755            Self(RequestBuilder::new(stub))
5756        }
5757
5758        /// Sets the full request, replacing any prior values.
5759        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5760            mut self,
5761            v: V,
5762        ) -> Self {
5763            self.0.request = v.into();
5764            self
5765        }
5766
5767        /// Sets all the options, replacing any prior values.
5768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5769            self.0.options = v.into();
5770            self
5771        }
5772
5773        /// Sends the request.
5774        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5775            (*self.0.stub)
5776                .set_iam_policy(self.0.request, self.0.options)
5777                .await
5778                .map(crate::Response::into_body)
5779        }
5780
5781        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
5782        ///
5783        /// This is a **required** field for requests.
5784        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5785            self.0.request.resource = v.into();
5786            self
5787        }
5788
5789        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
5790        ///
5791        /// This is a **required** field for requests.
5792        pub fn set_policy<T>(mut self, v: T) -> Self
5793        where
5794            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5795        {
5796            self.0.request.policy = std::option::Option::Some(v.into());
5797            self
5798        }
5799
5800        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
5801        ///
5802        /// This is a **required** field for requests.
5803        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5804        where
5805            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5806        {
5807            self.0.request.policy = v.map(|x| x.into());
5808            self
5809        }
5810
5811        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
5812        pub fn set_update_mask<T>(mut self, v: T) -> Self
5813        where
5814            T: std::convert::Into<wkt::FieldMask>,
5815        {
5816            self.0.request.update_mask = std::option::Option::Some(v.into());
5817            self
5818        }
5819
5820        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
5821        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5822        where
5823            T: std::convert::Into<wkt::FieldMask>,
5824        {
5825            self.0.request.update_mask = v.map(|x| x.into());
5826            self
5827        }
5828    }
5829
5830    #[doc(hidden)]
5831    impl crate::RequestBuilder for SetIamPolicy {
5832        fn request_options(&mut self) -> &mut crate::RequestOptions {
5833            &mut self.0.options
5834        }
5835    }
5836
5837    /// The request builder for [NodeGroupController::get_iam_policy][crate::client::NodeGroupController::get_iam_policy] calls.
5838    ///
5839    /// # Example
5840    /// ```
5841    /// # use google_cloud_dataproc_v1::builder::node_group_controller::GetIamPolicy;
5842    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5843    ///
5844    /// let builder = prepare_request_builder();
5845    /// let response = builder.send().await?;
5846    /// # Ok(()) }
5847    ///
5848    /// fn prepare_request_builder() -> GetIamPolicy {
5849    ///   # panic!();
5850    ///   // ... details omitted ...
5851    /// }
5852    /// ```
5853    #[derive(Clone, Debug)]
5854    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5855
5856    impl GetIamPolicy {
5857        pub(crate) fn new(
5858            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5859        ) -> Self {
5860            Self(RequestBuilder::new(stub))
5861        }
5862
5863        /// Sets the full request, replacing any prior values.
5864        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5865            mut self,
5866            v: V,
5867        ) -> Self {
5868            self.0.request = v.into();
5869            self
5870        }
5871
5872        /// Sets all the options, replacing any prior values.
5873        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5874            self.0.options = v.into();
5875            self
5876        }
5877
5878        /// Sends the request.
5879        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5880            (*self.0.stub)
5881                .get_iam_policy(self.0.request, self.0.options)
5882                .await
5883                .map(crate::Response::into_body)
5884        }
5885
5886        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
5887        ///
5888        /// This is a **required** field for requests.
5889        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5890            self.0.request.resource = v.into();
5891            self
5892        }
5893
5894        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
5895        pub fn set_options<T>(mut self, v: T) -> Self
5896        where
5897            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5898        {
5899            self.0.request.options = std::option::Option::Some(v.into());
5900            self
5901        }
5902
5903        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
5904        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5905        where
5906            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5907        {
5908            self.0.request.options = v.map(|x| x.into());
5909            self
5910        }
5911    }
5912
5913    #[doc(hidden)]
5914    impl crate::RequestBuilder for GetIamPolicy {
5915        fn request_options(&mut self) -> &mut crate::RequestOptions {
5916            &mut self.0.options
5917        }
5918    }
5919
5920    /// The request builder for [NodeGroupController::test_iam_permissions][crate::client::NodeGroupController::test_iam_permissions] calls.
5921    ///
5922    /// # Example
5923    /// ```
5924    /// # use google_cloud_dataproc_v1::builder::node_group_controller::TestIamPermissions;
5925    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
5926    ///
5927    /// let builder = prepare_request_builder();
5928    /// let response = builder.send().await?;
5929    /// # Ok(()) }
5930    ///
5931    /// fn prepare_request_builder() -> TestIamPermissions {
5932    ///   # panic!();
5933    ///   // ... details omitted ...
5934    /// }
5935    /// ```
5936    #[derive(Clone, Debug)]
5937    pub struct TestIamPermissions(
5938        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5939    );
5940
5941    impl TestIamPermissions {
5942        pub(crate) fn new(
5943            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
5944        ) -> Self {
5945            Self(RequestBuilder::new(stub))
5946        }
5947
5948        /// Sets the full request, replacing any prior values.
5949        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5950            mut self,
5951            v: V,
5952        ) -> Self {
5953            self.0.request = v.into();
5954            self
5955        }
5956
5957        /// Sets all the options, replacing any prior values.
5958        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5959            self.0.options = v.into();
5960            self
5961        }
5962
5963        /// Sends the request.
5964        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5965            (*self.0.stub)
5966                .test_iam_permissions(self.0.request, self.0.options)
5967                .await
5968                .map(crate::Response::into_body)
5969        }
5970
5971        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
5972        ///
5973        /// This is a **required** field for requests.
5974        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5975            self.0.request.resource = v.into();
5976            self
5977        }
5978
5979        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
5980        ///
5981        /// This is a **required** field for requests.
5982        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5983        where
5984            T: std::iter::IntoIterator<Item = V>,
5985            V: std::convert::Into<std::string::String>,
5986        {
5987            use std::iter::Iterator;
5988            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5989            self
5990        }
5991    }
5992
5993    #[doc(hidden)]
5994    impl crate::RequestBuilder for TestIamPermissions {
5995        fn request_options(&mut self) -> &mut crate::RequestOptions {
5996            &mut self.0.options
5997        }
5998    }
5999
6000    /// The request builder for [NodeGroupController::list_operations][crate::client::NodeGroupController::list_operations] calls.
6001    ///
6002    /// # Example
6003    /// ```
6004    /// # use google_cloud_dataproc_v1::builder::node_group_controller::ListOperations;
6005    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6006    /// use google_cloud_gax::paginator::ItemPaginator;
6007    ///
6008    /// let builder = prepare_request_builder();
6009    /// let mut items = builder.by_item();
6010    /// while let Some(result) = items.next().await {
6011    ///   let item = result?;
6012    /// }
6013    /// # Ok(()) }
6014    ///
6015    /// fn prepare_request_builder() -> ListOperations {
6016    ///   # panic!();
6017    ///   // ... details omitted ...
6018    /// }
6019    /// ```
6020    #[derive(Clone, Debug)]
6021    pub struct ListOperations(
6022        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6023    );
6024
6025    impl ListOperations {
6026        pub(crate) fn new(
6027            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
6028        ) -> Self {
6029            Self(RequestBuilder::new(stub))
6030        }
6031
6032        /// Sets the full request, replacing any prior values.
6033        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6034            mut self,
6035            v: V,
6036        ) -> Self {
6037            self.0.request = v.into();
6038            self
6039        }
6040
6041        /// Sets all the options, replacing any prior values.
6042        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6043            self.0.options = v.into();
6044            self
6045        }
6046
6047        /// Sends the request.
6048        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6049            (*self.0.stub)
6050                .list_operations(self.0.request, self.0.options)
6051                .await
6052                .map(crate::Response::into_body)
6053        }
6054
6055        /// Streams each page in the collection.
6056        pub fn by_page(
6057            self,
6058        ) -> impl google_cloud_gax::paginator::Paginator<
6059            google_cloud_longrunning::model::ListOperationsResponse,
6060            crate::Error,
6061        > {
6062            use std::clone::Clone;
6063            let token = self.0.request.page_token.clone();
6064            let execute = move |token: String| {
6065                let mut builder = self.clone();
6066                builder.0.request = builder.0.request.set_page_token(token);
6067                builder.send()
6068            };
6069            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6070        }
6071
6072        /// Streams each item in the collection.
6073        pub fn by_item(
6074            self,
6075        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6076            google_cloud_longrunning::model::ListOperationsResponse,
6077            crate::Error,
6078        > {
6079            use google_cloud_gax::paginator::Paginator;
6080            self.by_page().items()
6081        }
6082
6083        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6085            self.0.request.name = v.into();
6086            self
6087        }
6088
6089        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6090        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6091            self.0.request.filter = v.into();
6092            self
6093        }
6094
6095        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6096        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6097            self.0.request.page_size = v.into();
6098            self
6099        }
6100
6101        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6102        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6103            self.0.request.page_token = v.into();
6104            self
6105        }
6106
6107        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6108        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6109            self.0.request.return_partial_success = v.into();
6110            self
6111        }
6112    }
6113
6114    #[doc(hidden)]
6115    impl crate::RequestBuilder for ListOperations {
6116        fn request_options(&mut self) -> &mut crate::RequestOptions {
6117            &mut self.0.options
6118        }
6119    }
6120
6121    /// The request builder for [NodeGroupController::get_operation][crate::client::NodeGroupController::get_operation] calls.
6122    ///
6123    /// # Example
6124    /// ```
6125    /// # use google_cloud_dataproc_v1::builder::node_group_controller::GetOperation;
6126    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6127    ///
6128    /// let builder = prepare_request_builder();
6129    /// let response = builder.send().await?;
6130    /// # Ok(()) }
6131    ///
6132    /// fn prepare_request_builder() -> GetOperation {
6133    ///   # panic!();
6134    ///   // ... details omitted ...
6135    /// }
6136    /// ```
6137    #[derive(Clone, Debug)]
6138    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6139
6140    impl GetOperation {
6141        pub(crate) fn new(
6142            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
6143        ) -> 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 [NodeGroupController::delete_operation][crate::client::NodeGroupController::delete_operation] calls.
6185    ///
6186    /// # Example
6187    /// ```
6188    /// # use google_cloud_dataproc_v1::builder::node_group_controller::DeleteOperation;
6189    /// # async fn sample() -> google_cloud_dataproc_v1::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(
6207            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
6208        ) -> Self {
6209            Self(RequestBuilder::new(stub))
6210        }
6211
6212        /// Sets the full request, replacing any prior values.
6213        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6214            mut self,
6215            v: V,
6216        ) -> Self {
6217            self.0.request = v.into();
6218            self
6219        }
6220
6221        /// Sets all the options, replacing any prior values.
6222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6223            self.0.options = v.into();
6224            self
6225        }
6226
6227        /// Sends the request.
6228        pub async fn send(self) -> Result<()> {
6229            (*self.0.stub)
6230                .delete_operation(self.0.request, self.0.options)
6231                .await
6232                .map(crate::Response::into_body)
6233        }
6234
6235        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
6236        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6237            self.0.request.name = v.into();
6238            self
6239        }
6240    }
6241
6242    #[doc(hidden)]
6243    impl crate::RequestBuilder for DeleteOperation {
6244        fn request_options(&mut self) -> &mut crate::RequestOptions {
6245            &mut self.0.options
6246        }
6247    }
6248
6249    /// The request builder for [NodeGroupController::cancel_operation][crate::client::NodeGroupController::cancel_operation] calls.
6250    ///
6251    /// # Example
6252    /// ```
6253    /// # use google_cloud_dataproc_v1::builder::node_group_controller::CancelOperation;
6254    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6255    ///
6256    /// let builder = prepare_request_builder();
6257    /// let response = builder.send().await?;
6258    /// # Ok(()) }
6259    ///
6260    /// fn prepare_request_builder() -> CancelOperation {
6261    ///   # panic!();
6262    ///   // ... details omitted ...
6263    /// }
6264    /// ```
6265    #[derive(Clone, Debug)]
6266    pub struct CancelOperation(
6267        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6268    );
6269
6270    impl CancelOperation {
6271        pub(crate) fn new(
6272            stub: std::sync::Arc<dyn super::super::stub::dynamic::NodeGroupController>,
6273        ) -> Self {
6274            Self(RequestBuilder::new(stub))
6275        }
6276
6277        /// Sets the full request, replacing any prior values.
6278        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6279            mut self,
6280            v: V,
6281        ) -> Self {
6282            self.0.request = v.into();
6283            self
6284        }
6285
6286        /// Sets all the options, replacing any prior values.
6287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6288            self.0.options = v.into();
6289            self
6290        }
6291
6292        /// Sends the request.
6293        pub async fn send(self) -> Result<()> {
6294            (*self.0.stub)
6295                .cancel_operation(self.0.request, self.0.options)
6296                .await
6297                .map(crate::Response::into_body)
6298        }
6299
6300        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6301        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6302            self.0.request.name = v.into();
6303            self
6304        }
6305    }
6306
6307    #[doc(hidden)]
6308    impl crate::RequestBuilder for CancelOperation {
6309        fn request_options(&mut self) -> &mut crate::RequestOptions {
6310            &mut self.0.options
6311        }
6312    }
6313}
6314
6315/// Request and client builders for [SessionTemplateController][crate::client::SessionTemplateController].
6316pub mod session_template_controller {
6317    use crate::Result;
6318
6319    /// A builder for [SessionTemplateController][crate::client::SessionTemplateController].
6320    ///
6321    /// ```
6322    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6323    /// # use google_cloud_dataproc_v1::*;
6324    /// # use builder::session_template_controller::ClientBuilder;
6325    /// # use client::SessionTemplateController;
6326    /// let builder : ClientBuilder = SessionTemplateController::builder();
6327    /// let client = builder
6328    ///     .with_endpoint("https://dataproc.googleapis.com")
6329    ///     .build().await?;
6330    /// # Ok(()) }
6331    /// ```
6332    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6333
6334    pub(crate) mod client {
6335        use super::super::super::client::SessionTemplateController;
6336        pub struct Factory;
6337        impl crate::ClientFactory for Factory {
6338            type Client = SessionTemplateController;
6339            type Credentials = gaxi::options::Credentials;
6340            async fn build(
6341                self,
6342                config: gaxi::options::ClientConfig,
6343            ) -> crate::ClientBuilderResult<Self::Client> {
6344                Self::Client::new(config).await
6345            }
6346        }
6347    }
6348
6349    /// Common implementation for [crate::client::SessionTemplateController] request builders.
6350    #[derive(Clone, Debug)]
6351    pub(crate) struct RequestBuilder<R: std::default::Default> {
6352        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6353        request: R,
6354        options: crate::RequestOptions,
6355    }
6356
6357    impl<R> RequestBuilder<R>
6358    where
6359        R: std::default::Default,
6360    {
6361        pub(crate) fn new(
6362            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6363        ) -> Self {
6364            Self {
6365                stub,
6366                request: R::default(),
6367                options: crate::RequestOptions::default(),
6368            }
6369        }
6370    }
6371
6372    /// The request builder for [SessionTemplateController::create_session_template][crate::client::SessionTemplateController::create_session_template] calls.
6373    ///
6374    /// # Example
6375    /// ```
6376    /// # use google_cloud_dataproc_v1::builder::session_template_controller::CreateSessionTemplate;
6377    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6378    ///
6379    /// let builder = prepare_request_builder();
6380    /// let response = builder.send().await?;
6381    /// # Ok(()) }
6382    ///
6383    /// fn prepare_request_builder() -> CreateSessionTemplate {
6384    ///   # panic!();
6385    ///   // ... details omitted ...
6386    /// }
6387    /// ```
6388    #[derive(Clone, Debug)]
6389    pub struct CreateSessionTemplate(RequestBuilder<crate::model::CreateSessionTemplateRequest>);
6390
6391    impl CreateSessionTemplate {
6392        pub(crate) fn new(
6393            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6394        ) -> Self {
6395            Self(RequestBuilder::new(stub))
6396        }
6397
6398        /// Sets the full request, replacing any prior values.
6399        pub fn with_request<V: Into<crate::model::CreateSessionTemplateRequest>>(
6400            mut self,
6401            v: V,
6402        ) -> Self {
6403            self.0.request = v.into();
6404            self
6405        }
6406
6407        /// Sets all the options, replacing any prior values.
6408        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6409            self.0.options = v.into();
6410            self
6411        }
6412
6413        /// Sends the request.
6414        pub async fn send(self) -> Result<crate::model::SessionTemplate> {
6415            (*self.0.stub)
6416                .create_session_template(self.0.request, self.0.options)
6417                .await
6418                .map(crate::Response::into_body)
6419        }
6420
6421        /// Sets the value of [parent][crate::model::CreateSessionTemplateRequest::parent].
6422        ///
6423        /// This is a **required** field for requests.
6424        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6425            self.0.request.parent = v.into();
6426            self
6427        }
6428
6429        /// Sets the value of [session_template][crate::model::CreateSessionTemplateRequest::session_template].
6430        ///
6431        /// This is a **required** field for requests.
6432        pub fn set_session_template<T>(mut self, v: T) -> Self
6433        where
6434            T: std::convert::Into<crate::model::SessionTemplate>,
6435        {
6436            self.0.request.session_template = std::option::Option::Some(v.into());
6437            self
6438        }
6439
6440        /// Sets or clears the value of [session_template][crate::model::CreateSessionTemplateRequest::session_template].
6441        ///
6442        /// This is a **required** field for requests.
6443        pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
6444        where
6445            T: std::convert::Into<crate::model::SessionTemplate>,
6446        {
6447            self.0.request.session_template = v.map(|x| x.into());
6448            self
6449        }
6450    }
6451
6452    #[doc(hidden)]
6453    impl crate::RequestBuilder for CreateSessionTemplate {
6454        fn request_options(&mut self) -> &mut crate::RequestOptions {
6455            &mut self.0.options
6456        }
6457    }
6458
6459    /// The request builder for [SessionTemplateController::update_session_template][crate::client::SessionTemplateController::update_session_template] calls.
6460    ///
6461    /// # Example
6462    /// ```
6463    /// # use google_cloud_dataproc_v1::builder::session_template_controller::UpdateSessionTemplate;
6464    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6465    ///
6466    /// let builder = prepare_request_builder();
6467    /// let response = builder.send().await?;
6468    /// # Ok(()) }
6469    ///
6470    /// fn prepare_request_builder() -> UpdateSessionTemplate {
6471    ///   # panic!();
6472    ///   // ... details omitted ...
6473    /// }
6474    /// ```
6475    #[derive(Clone, Debug)]
6476    pub struct UpdateSessionTemplate(RequestBuilder<crate::model::UpdateSessionTemplateRequest>);
6477
6478    impl UpdateSessionTemplate {
6479        pub(crate) fn new(
6480            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6481        ) -> Self {
6482            Self(RequestBuilder::new(stub))
6483        }
6484
6485        /// Sets the full request, replacing any prior values.
6486        pub fn with_request<V: Into<crate::model::UpdateSessionTemplateRequest>>(
6487            mut self,
6488            v: V,
6489        ) -> Self {
6490            self.0.request = v.into();
6491            self
6492        }
6493
6494        /// Sets all the options, replacing any prior values.
6495        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6496            self.0.options = v.into();
6497            self
6498        }
6499
6500        /// Sends the request.
6501        pub async fn send(self) -> Result<crate::model::SessionTemplate> {
6502            (*self.0.stub)
6503                .update_session_template(self.0.request, self.0.options)
6504                .await
6505                .map(crate::Response::into_body)
6506        }
6507
6508        /// Sets the value of [session_template][crate::model::UpdateSessionTemplateRequest::session_template].
6509        ///
6510        /// This is a **required** field for requests.
6511        pub fn set_session_template<T>(mut self, v: T) -> Self
6512        where
6513            T: std::convert::Into<crate::model::SessionTemplate>,
6514        {
6515            self.0.request.session_template = std::option::Option::Some(v.into());
6516            self
6517        }
6518
6519        /// Sets or clears the value of [session_template][crate::model::UpdateSessionTemplateRequest::session_template].
6520        ///
6521        /// This is a **required** field for requests.
6522        pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
6523        where
6524            T: std::convert::Into<crate::model::SessionTemplate>,
6525        {
6526            self.0.request.session_template = v.map(|x| x.into());
6527            self
6528        }
6529    }
6530
6531    #[doc(hidden)]
6532    impl crate::RequestBuilder for UpdateSessionTemplate {
6533        fn request_options(&mut self) -> &mut crate::RequestOptions {
6534            &mut self.0.options
6535        }
6536    }
6537
6538    /// The request builder for [SessionTemplateController::get_session_template][crate::client::SessionTemplateController::get_session_template] calls.
6539    ///
6540    /// # Example
6541    /// ```
6542    /// # use google_cloud_dataproc_v1::builder::session_template_controller::GetSessionTemplate;
6543    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6544    ///
6545    /// let builder = prepare_request_builder();
6546    /// let response = builder.send().await?;
6547    /// # Ok(()) }
6548    ///
6549    /// fn prepare_request_builder() -> GetSessionTemplate {
6550    ///   # panic!();
6551    ///   // ... details omitted ...
6552    /// }
6553    /// ```
6554    #[derive(Clone, Debug)]
6555    pub struct GetSessionTemplate(RequestBuilder<crate::model::GetSessionTemplateRequest>);
6556
6557    impl GetSessionTemplate {
6558        pub(crate) fn new(
6559            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6560        ) -> Self {
6561            Self(RequestBuilder::new(stub))
6562        }
6563
6564        /// Sets the full request, replacing any prior values.
6565        pub fn with_request<V: Into<crate::model::GetSessionTemplateRequest>>(
6566            mut self,
6567            v: V,
6568        ) -> 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::SessionTemplate> {
6581            (*self.0.stub)
6582                .get_session_template(self.0.request, self.0.options)
6583                .await
6584                .map(crate::Response::into_body)
6585        }
6586
6587        /// Sets the value of [name][crate::model::GetSessionTemplateRequest::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 GetSessionTemplate {
6598        fn request_options(&mut self) -> &mut crate::RequestOptions {
6599            &mut self.0.options
6600        }
6601    }
6602
6603    /// The request builder for [SessionTemplateController::list_session_templates][crate::client::SessionTemplateController::list_session_templates] calls.
6604    ///
6605    /// # Example
6606    /// ```
6607    /// # use google_cloud_dataproc_v1::builder::session_template_controller::ListSessionTemplates;
6608    /// # async fn sample() -> google_cloud_dataproc_v1::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() -> ListSessionTemplates {
6619    ///   # panic!();
6620    ///   // ... details omitted ...
6621    /// }
6622    /// ```
6623    #[derive(Clone, Debug)]
6624    pub struct ListSessionTemplates(RequestBuilder<crate::model::ListSessionTemplatesRequest>);
6625
6626    impl ListSessionTemplates {
6627        pub(crate) fn new(
6628            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
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::ListSessionTemplatesRequest>>(
6635            mut self,
6636            v: V,
6637        ) -> Self {
6638            self.0.request = v.into();
6639            self
6640        }
6641
6642        /// Sets all the options, replacing any prior values.
6643        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6644            self.0.options = v.into();
6645            self
6646        }
6647
6648        /// Sends the request.
6649        pub async fn send(self) -> Result<crate::model::ListSessionTemplatesResponse> {
6650            (*self.0.stub)
6651                .list_session_templates(self.0.request, self.0.options)
6652                .await
6653                .map(crate::Response::into_body)
6654        }
6655
6656        /// Streams each page in the collection.
6657        pub fn by_page(
6658            self,
6659        ) -> impl google_cloud_gax::paginator::Paginator<
6660            crate::model::ListSessionTemplatesResponse,
6661            crate::Error,
6662        > {
6663            use std::clone::Clone;
6664            let token = self.0.request.page_token.clone();
6665            let execute = move |token: String| {
6666                let mut builder = self.clone();
6667                builder.0.request = builder.0.request.set_page_token(token);
6668                builder.send()
6669            };
6670            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6671        }
6672
6673        /// Streams each item in the collection.
6674        pub fn by_item(
6675            self,
6676        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6677            crate::model::ListSessionTemplatesResponse,
6678            crate::Error,
6679        > {
6680            use google_cloud_gax::paginator::Paginator;
6681            self.by_page().items()
6682        }
6683
6684        /// Sets the value of [parent][crate::model::ListSessionTemplatesRequest::parent].
6685        ///
6686        /// This is a **required** field for requests.
6687        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688            self.0.request.parent = v.into();
6689            self
6690        }
6691
6692        /// Sets the value of [page_size][crate::model::ListSessionTemplatesRequest::page_size].
6693        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6694            self.0.request.page_size = v.into();
6695            self
6696        }
6697
6698        /// Sets the value of [page_token][crate::model::ListSessionTemplatesRequest::page_token].
6699        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700            self.0.request.page_token = v.into();
6701            self
6702        }
6703
6704        /// Sets the value of [filter][crate::model::ListSessionTemplatesRequest::filter].
6705        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6706            self.0.request.filter = v.into();
6707            self
6708        }
6709    }
6710
6711    #[doc(hidden)]
6712    impl crate::RequestBuilder for ListSessionTemplates {
6713        fn request_options(&mut self) -> &mut crate::RequestOptions {
6714            &mut self.0.options
6715        }
6716    }
6717
6718    /// The request builder for [SessionTemplateController::delete_session_template][crate::client::SessionTemplateController::delete_session_template] calls.
6719    ///
6720    /// # Example
6721    /// ```
6722    /// # use google_cloud_dataproc_v1::builder::session_template_controller::DeleteSessionTemplate;
6723    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6724    ///
6725    /// let builder = prepare_request_builder();
6726    /// let response = builder.send().await?;
6727    /// # Ok(()) }
6728    ///
6729    /// fn prepare_request_builder() -> DeleteSessionTemplate {
6730    ///   # panic!();
6731    ///   // ... details omitted ...
6732    /// }
6733    /// ```
6734    #[derive(Clone, Debug)]
6735    pub struct DeleteSessionTemplate(RequestBuilder<crate::model::DeleteSessionTemplateRequest>);
6736
6737    impl DeleteSessionTemplate {
6738        pub(crate) fn new(
6739            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6740        ) -> Self {
6741            Self(RequestBuilder::new(stub))
6742        }
6743
6744        /// Sets the full request, replacing any prior values.
6745        pub fn with_request<V: Into<crate::model::DeleteSessionTemplateRequest>>(
6746            mut self,
6747            v: V,
6748        ) -> Self {
6749            self.0.request = v.into();
6750            self
6751        }
6752
6753        /// Sets all the options, replacing any prior values.
6754        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6755            self.0.options = v.into();
6756            self
6757        }
6758
6759        /// Sends the request.
6760        pub async fn send(self) -> Result<()> {
6761            (*self.0.stub)
6762                .delete_session_template(self.0.request, self.0.options)
6763                .await
6764                .map(crate::Response::into_body)
6765        }
6766
6767        /// Sets the value of [name][crate::model::DeleteSessionTemplateRequest::name].
6768        ///
6769        /// This is a **required** field for requests.
6770        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6771            self.0.request.name = v.into();
6772            self
6773        }
6774    }
6775
6776    #[doc(hidden)]
6777    impl crate::RequestBuilder for DeleteSessionTemplate {
6778        fn request_options(&mut self) -> &mut crate::RequestOptions {
6779            &mut self.0.options
6780        }
6781    }
6782
6783    /// The request builder for [SessionTemplateController::set_iam_policy][crate::client::SessionTemplateController::set_iam_policy] calls.
6784    ///
6785    /// # Example
6786    /// ```
6787    /// # use google_cloud_dataproc_v1::builder::session_template_controller::SetIamPolicy;
6788    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6789    ///
6790    /// let builder = prepare_request_builder();
6791    /// let response = builder.send().await?;
6792    /// # Ok(()) }
6793    ///
6794    /// fn prepare_request_builder() -> SetIamPolicy {
6795    ///   # panic!();
6796    ///   // ... details omitted ...
6797    /// }
6798    /// ```
6799    #[derive(Clone, Debug)]
6800    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6801
6802    impl SetIamPolicy {
6803        pub(crate) fn new(
6804            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6805        ) -> Self {
6806            Self(RequestBuilder::new(stub))
6807        }
6808
6809        /// Sets the full request, replacing any prior values.
6810        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6811            mut self,
6812            v: V,
6813        ) -> Self {
6814            self.0.request = v.into();
6815            self
6816        }
6817
6818        /// Sets all the options, replacing any prior values.
6819        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6820            self.0.options = v.into();
6821            self
6822        }
6823
6824        /// Sends the request.
6825        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6826            (*self.0.stub)
6827                .set_iam_policy(self.0.request, self.0.options)
6828                .await
6829                .map(crate::Response::into_body)
6830        }
6831
6832        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6833        ///
6834        /// This is a **required** field for requests.
6835        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6836            self.0.request.resource = v.into();
6837            self
6838        }
6839
6840        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6841        ///
6842        /// This is a **required** field for requests.
6843        pub fn set_policy<T>(mut self, v: T) -> Self
6844        where
6845            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6846        {
6847            self.0.request.policy = std::option::Option::Some(v.into());
6848            self
6849        }
6850
6851        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6852        ///
6853        /// This is a **required** field for requests.
6854        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6855        where
6856            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6857        {
6858            self.0.request.policy = v.map(|x| x.into());
6859            self
6860        }
6861
6862        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6863        pub fn set_update_mask<T>(mut self, v: T) -> Self
6864        where
6865            T: std::convert::Into<wkt::FieldMask>,
6866        {
6867            self.0.request.update_mask = std::option::Option::Some(v.into());
6868            self
6869        }
6870
6871        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6872        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6873        where
6874            T: std::convert::Into<wkt::FieldMask>,
6875        {
6876            self.0.request.update_mask = v.map(|x| x.into());
6877            self
6878        }
6879    }
6880
6881    #[doc(hidden)]
6882    impl crate::RequestBuilder for SetIamPolicy {
6883        fn request_options(&mut self) -> &mut crate::RequestOptions {
6884            &mut self.0.options
6885        }
6886    }
6887
6888    /// The request builder for [SessionTemplateController::get_iam_policy][crate::client::SessionTemplateController::get_iam_policy] calls.
6889    ///
6890    /// # Example
6891    /// ```
6892    /// # use google_cloud_dataproc_v1::builder::session_template_controller::GetIamPolicy;
6893    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6894    ///
6895    /// let builder = prepare_request_builder();
6896    /// let response = builder.send().await?;
6897    /// # Ok(()) }
6898    ///
6899    /// fn prepare_request_builder() -> GetIamPolicy {
6900    ///   # panic!();
6901    ///   // ... details omitted ...
6902    /// }
6903    /// ```
6904    #[derive(Clone, Debug)]
6905    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6906
6907    impl GetIamPolicy {
6908        pub(crate) fn new(
6909            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6910        ) -> Self {
6911            Self(RequestBuilder::new(stub))
6912        }
6913
6914        /// Sets the full request, replacing any prior values.
6915        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6916            mut self,
6917            v: V,
6918        ) -> Self {
6919            self.0.request = v.into();
6920            self
6921        }
6922
6923        /// Sets all the options, replacing any prior values.
6924        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6925            self.0.options = v.into();
6926            self
6927        }
6928
6929        /// Sends the request.
6930        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6931            (*self.0.stub)
6932                .get_iam_policy(self.0.request, self.0.options)
6933                .await
6934                .map(crate::Response::into_body)
6935        }
6936
6937        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6938        ///
6939        /// This is a **required** field for requests.
6940        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6941            self.0.request.resource = v.into();
6942            self
6943        }
6944
6945        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6946        pub fn set_options<T>(mut self, v: T) -> Self
6947        where
6948            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6949        {
6950            self.0.request.options = std::option::Option::Some(v.into());
6951            self
6952        }
6953
6954        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6955        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6956        where
6957            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6958        {
6959            self.0.request.options = v.map(|x| x.into());
6960            self
6961        }
6962    }
6963
6964    #[doc(hidden)]
6965    impl crate::RequestBuilder for GetIamPolicy {
6966        fn request_options(&mut self) -> &mut crate::RequestOptions {
6967            &mut self.0.options
6968        }
6969    }
6970
6971    /// The request builder for [SessionTemplateController::test_iam_permissions][crate::client::SessionTemplateController::test_iam_permissions] calls.
6972    ///
6973    /// # Example
6974    /// ```
6975    /// # use google_cloud_dataproc_v1::builder::session_template_controller::TestIamPermissions;
6976    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
6977    ///
6978    /// let builder = prepare_request_builder();
6979    /// let response = builder.send().await?;
6980    /// # Ok(()) }
6981    ///
6982    /// fn prepare_request_builder() -> TestIamPermissions {
6983    ///   # panic!();
6984    ///   // ... details omitted ...
6985    /// }
6986    /// ```
6987    #[derive(Clone, Debug)]
6988    pub struct TestIamPermissions(
6989        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6990    );
6991
6992    impl TestIamPermissions {
6993        pub(crate) fn new(
6994            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
6995        ) -> Self {
6996            Self(RequestBuilder::new(stub))
6997        }
6998
6999        /// Sets the full request, replacing any prior values.
7000        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7001            mut self,
7002            v: V,
7003        ) -> Self {
7004            self.0.request = v.into();
7005            self
7006        }
7007
7008        /// Sets all the options, replacing any prior values.
7009        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7010            self.0.options = v.into();
7011            self
7012        }
7013
7014        /// Sends the request.
7015        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7016            (*self.0.stub)
7017                .test_iam_permissions(self.0.request, self.0.options)
7018                .await
7019                .map(crate::Response::into_body)
7020        }
7021
7022        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
7023        ///
7024        /// This is a **required** field for requests.
7025        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7026            self.0.request.resource = v.into();
7027            self
7028        }
7029
7030        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
7031        ///
7032        /// This is a **required** field for requests.
7033        pub fn set_permissions<T, V>(mut self, v: T) -> Self
7034        where
7035            T: std::iter::IntoIterator<Item = V>,
7036            V: std::convert::Into<std::string::String>,
7037        {
7038            use std::iter::Iterator;
7039            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7040            self
7041        }
7042    }
7043
7044    #[doc(hidden)]
7045    impl crate::RequestBuilder for TestIamPermissions {
7046        fn request_options(&mut self) -> &mut crate::RequestOptions {
7047            &mut self.0.options
7048        }
7049    }
7050
7051    /// The request builder for [SessionTemplateController::list_operations][crate::client::SessionTemplateController::list_operations] calls.
7052    ///
7053    /// # Example
7054    /// ```
7055    /// # use google_cloud_dataproc_v1::builder::session_template_controller::ListOperations;
7056    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7057    /// use google_cloud_gax::paginator::ItemPaginator;
7058    ///
7059    /// let builder = prepare_request_builder();
7060    /// let mut items = builder.by_item();
7061    /// while let Some(result) = items.next().await {
7062    ///   let item = result?;
7063    /// }
7064    /// # Ok(()) }
7065    ///
7066    /// fn prepare_request_builder() -> ListOperations {
7067    ///   # panic!();
7068    ///   // ... details omitted ...
7069    /// }
7070    /// ```
7071    #[derive(Clone, Debug)]
7072    pub struct ListOperations(
7073        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7074    );
7075
7076    impl ListOperations {
7077        pub(crate) fn new(
7078            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
7079        ) -> Self {
7080            Self(RequestBuilder::new(stub))
7081        }
7082
7083        /// Sets the full request, replacing any prior values.
7084        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7085            mut self,
7086            v: V,
7087        ) -> Self {
7088            self.0.request = v.into();
7089            self
7090        }
7091
7092        /// Sets all the options, replacing any prior values.
7093        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7094            self.0.options = v.into();
7095            self
7096        }
7097
7098        /// Sends the request.
7099        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7100            (*self.0.stub)
7101                .list_operations(self.0.request, self.0.options)
7102                .await
7103                .map(crate::Response::into_body)
7104        }
7105
7106        /// Streams each page in the collection.
7107        pub fn by_page(
7108            self,
7109        ) -> impl google_cloud_gax::paginator::Paginator<
7110            google_cloud_longrunning::model::ListOperationsResponse,
7111            crate::Error,
7112        > {
7113            use std::clone::Clone;
7114            let token = self.0.request.page_token.clone();
7115            let execute = move |token: String| {
7116                let mut builder = self.clone();
7117                builder.0.request = builder.0.request.set_page_token(token);
7118                builder.send()
7119            };
7120            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7121        }
7122
7123        /// Streams each item in the collection.
7124        pub fn by_item(
7125            self,
7126        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7127            google_cloud_longrunning::model::ListOperationsResponse,
7128            crate::Error,
7129        > {
7130            use google_cloud_gax::paginator::Paginator;
7131            self.by_page().items()
7132        }
7133
7134        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7135        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7136            self.0.request.name = v.into();
7137            self
7138        }
7139
7140        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7141        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7142            self.0.request.filter = v.into();
7143            self
7144        }
7145
7146        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7147        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7148            self.0.request.page_size = v.into();
7149            self
7150        }
7151
7152        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7153        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7154            self.0.request.page_token = v.into();
7155            self
7156        }
7157
7158        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7159        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7160            self.0.request.return_partial_success = v.into();
7161            self
7162        }
7163    }
7164
7165    #[doc(hidden)]
7166    impl crate::RequestBuilder for ListOperations {
7167        fn request_options(&mut self) -> &mut crate::RequestOptions {
7168            &mut self.0.options
7169        }
7170    }
7171
7172    /// The request builder for [SessionTemplateController::get_operation][crate::client::SessionTemplateController::get_operation] calls.
7173    ///
7174    /// # Example
7175    /// ```
7176    /// # use google_cloud_dataproc_v1::builder::session_template_controller::GetOperation;
7177    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7178    ///
7179    /// let builder = prepare_request_builder();
7180    /// let response = builder.send().await?;
7181    /// # Ok(()) }
7182    ///
7183    /// fn prepare_request_builder() -> GetOperation {
7184    ///   # panic!();
7185    ///   // ... details omitted ...
7186    /// }
7187    /// ```
7188    #[derive(Clone, Debug)]
7189    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7190
7191    impl GetOperation {
7192        pub(crate) fn new(
7193            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
7194        ) -> Self {
7195            Self(RequestBuilder::new(stub))
7196        }
7197
7198        /// Sets the full request, replacing any prior values.
7199        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7200            mut self,
7201            v: V,
7202        ) -> Self {
7203            self.0.request = v.into();
7204            self
7205        }
7206
7207        /// Sets all the options, replacing any prior values.
7208        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7209            self.0.options = v.into();
7210            self
7211        }
7212
7213        /// Sends the request.
7214        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7215            (*self.0.stub)
7216                .get_operation(self.0.request, self.0.options)
7217                .await
7218                .map(crate::Response::into_body)
7219        }
7220
7221        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7222        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7223            self.0.request.name = v.into();
7224            self
7225        }
7226    }
7227
7228    #[doc(hidden)]
7229    impl crate::RequestBuilder for GetOperation {
7230        fn request_options(&mut self) -> &mut crate::RequestOptions {
7231            &mut self.0.options
7232        }
7233    }
7234
7235    /// The request builder for [SessionTemplateController::delete_operation][crate::client::SessionTemplateController::delete_operation] calls.
7236    ///
7237    /// # Example
7238    /// ```
7239    /// # use google_cloud_dataproc_v1::builder::session_template_controller::DeleteOperation;
7240    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7241    ///
7242    /// let builder = prepare_request_builder();
7243    /// let response = builder.send().await?;
7244    /// # Ok(()) }
7245    ///
7246    /// fn prepare_request_builder() -> DeleteOperation {
7247    ///   # panic!();
7248    ///   // ... details omitted ...
7249    /// }
7250    /// ```
7251    #[derive(Clone, Debug)]
7252    pub struct DeleteOperation(
7253        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7254    );
7255
7256    impl DeleteOperation {
7257        pub(crate) fn new(
7258            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
7259        ) -> Self {
7260            Self(RequestBuilder::new(stub))
7261        }
7262
7263        /// Sets the full request, replacing any prior values.
7264        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7265            mut self,
7266            v: V,
7267        ) -> Self {
7268            self.0.request = v.into();
7269            self
7270        }
7271
7272        /// Sets all the options, replacing any prior values.
7273        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7274            self.0.options = v.into();
7275            self
7276        }
7277
7278        /// Sends the request.
7279        pub async fn send(self) -> Result<()> {
7280            (*self.0.stub)
7281                .delete_operation(self.0.request, self.0.options)
7282                .await
7283                .map(crate::Response::into_body)
7284        }
7285
7286        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7287        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7288            self.0.request.name = v.into();
7289            self
7290        }
7291    }
7292
7293    #[doc(hidden)]
7294    impl crate::RequestBuilder for DeleteOperation {
7295        fn request_options(&mut self) -> &mut crate::RequestOptions {
7296            &mut self.0.options
7297        }
7298    }
7299
7300    /// The request builder for [SessionTemplateController::cancel_operation][crate::client::SessionTemplateController::cancel_operation] calls.
7301    ///
7302    /// # Example
7303    /// ```
7304    /// # use google_cloud_dataproc_v1::builder::session_template_controller::CancelOperation;
7305    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7306    ///
7307    /// let builder = prepare_request_builder();
7308    /// let response = builder.send().await?;
7309    /// # Ok(()) }
7310    ///
7311    /// fn prepare_request_builder() -> CancelOperation {
7312    ///   # panic!();
7313    ///   // ... details omitted ...
7314    /// }
7315    /// ```
7316    #[derive(Clone, Debug)]
7317    pub struct CancelOperation(
7318        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7319    );
7320
7321    impl CancelOperation {
7322        pub(crate) fn new(
7323            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionTemplateController>,
7324        ) -> Self {
7325            Self(RequestBuilder::new(stub))
7326        }
7327
7328        /// Sets the full request, replacing any prior values.
7329        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7330            mut self,
7331            v: V,
7332        ) -> Self {
7333            self.0.request = v.into();
7334            self
7335        }
7336
7337        /// Sets all the options, replacing any prior values.
7338        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7339            self.0.options = v.into();
7340            self
7341        }
7342
7343        /// Sends the request.
7344        pub async fn send(self) -> Result<()> {
7345            (*self.0.stub)
7346                .cancel_operation(self.0.request, self.0.options)
7347                .await
7348                .map(crate::Response::into_body)
7349        }
7350
7351        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7352        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7353            self.0.request.name = v.into();
7354            self
7355        }
7356    }
7357
7358    #[doc(hidden)]
7359    impl crate::RequestBuilder for CancelOperation {
7360        fn request_options(&mut self) -> &mut crate::RequestOptions {
7361            &mut self.0.options
7362        }
7363    }
7364}
7365
7366/// Request and client builders for [SessionController][crate::client::SessionController].
7367pub mod session_controller {
7368    use crate::Result;
7369
7370    /// A builder for [SessionController][crate::client::SessionController].
7371    ///
7372    /// ```
7373    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7374    /// # use google_cloud_dataproc_v1::*;
7375    /// # use builder::session_controller::ClientBuilder;
7376    /// # use client::SessionController;
7377    /// let builder : ClientBuilder = SessionController::builder();
7378    /// let client = builder
7379    ///     .with_endpoint("https://dataproc.googleapis.com")
7380    ///     .build().await?;
7381    /// # Ok(()) }
7382    /// ```
7383    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7384
7385    pub(crate) mod client {
7386        use super::super::super::client::SessionController;
7387        pub struct Factory;
7388        impl crate::ClientFactory for Factory {
7389            type Client = SessionController;
7390            type Credentials = gaxi::options::Credentials;
7391            async fn build(
7392                self,
7393                config: gaxi::options::ClientConfig,
7394            ) -> crate::ClientBuilderResult<Self::Client> {
7395                Self::Client::new(config).await
7396            }
7397        }
7398    }
7399
7400    /// Common implementation for [crate::client::SessionController] request builders.
7401    #[derive(Clone, Debug)]
7402    pub(crate) struct RequestBuilder<R: std::default::Default> {
7403        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7404        request: R,
7405        options: crate::RequestOptions,
7406    }
7407
7408    impl<R> RequestBuilder<R>
7409    where
7410        R: std::default::Default,
7411    {
7412        pub(crate) fn new(
7413            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7414        ) -> Self {
7415            Self {
7416                stub,
7417                request: R::default(),
7418                options: crate::RequestOptions::default(),
7419            }
7420        }
7421    }
7422
7423    /// The request builder for [SessionController::create_session][crate::client::SessionController::create_session] calls.
7424    ///
7425    /// # Example
7426    /// ```
7427    /// # use google_cloud_dataproc_v1::builder::session_controller::CreateSession;
7428    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7429    /// use google_cloud_lro::Poller;
7430    ///
7431    /// let builder = prepare_request_builder();
7432    /// let response = builder.poller().until_done().await?;
7433    /// # Ok(()) }
7434    ///
7435    /// fn prepare_request_builder() -> CreateSession {
7436    ///   # panic!();
7437    ///   // ... details omitted ...
7438    /// }
7439    /// ```
7440    #[derive(Clone, Debug)]
7441    pub struct CreateSession(RequestBuilder<crate::model::CreateSessionRequest>);
7442
7443    impl CreateSession {
7444        pub(crate) fn new(
7445            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7446        ) -> Self {
7447            Self(RequestBuilder::new(stub))
7448        }
7449
7450        /// Sets the full request, replacing any prior values.
7451        pub fn with_request<V: Into<crate::model::CreateSessionRequest>>(mut self, v: V) -> Self {
7452            self.0.request = v.into();
7453            self
7454        }
7455
7456        /// Sets all the options, replacing any prior values.
7457        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7458            self.0.options = v.into();
7459            self
7460        }
7461
7462        /// Sends the request.
7463        ///
7464        /// # Long running operations
7465        ///
7466        /// This starts, but does not poll, a longrunning operation. More information
7467        /// on [create_session][crate::client::SessionController::create_session].
7468        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7469            (*self.0.stub)
7470                .create_session(self.0.request, self.0.options)
7471                .await
7472                .map(crate::Response::into_body)
7473        }
7474
7475        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_session`.
7476        pub fn poller(
7477            self,
7478        ) -> impl google_cloud_lro::Poller<crate::model::Session, crate::model::SessionOperationMetadata>
7479        {
7480            type Operation = google_cloud_lro::internal::Operation<
7481                crate::model::Session,
7482                crate::model::SessionOperationMetadata,
7483            >;
7484            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7485            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7486            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7487            if let Some(ref mut details) = poller_options.tracing {
7488                details.method_name = "google_cloud_dataproc_v1::client::SessionController::create_session::until_done";
7489            }
7490
7491            let stub = self.0.stub.clone();
7492            let mut options = self.0.options.clone();
7493            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7494            let query = move |name| {
7495                let stub = stub.clone();
7496                let options = options.clone();
7497                async {
7498                    let op = GetOperation::new(stub)
7499                        .set_name(name)
7500                        .with_options(options)
7501                        .send()
7502                        .await?;
7503                    Ok(Operation::new(op))
7504                }
7505            };
7506
7507            let start = move || async {
7508                let op = self.send().await?;
7509                Ok(Operation::new(op))
7510            };
7511
7512            use google_cloud_lro::internal::PollerExt;
7513            {
7514                google_cloud_lro::internal::new_poller(
7515                    polling_error_policy,
7516                    polling_backoff_policy,
7517                    start,
7518                    query,
7519                )
7520            }
7521            .with_options(poller_options)
7522        }
7523
7524        /// Sets the value of [parent][crate::model::CreateSessionRequest::parent].
7525        ///
7526        /// This is a **required** field for requests.
7527        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7528            self.0.request.parent = v.into();
7529            self
7530        }
7531
7532        /// Sets the value of [session][crate::model::CreateSessionRequest::session].
7533        ///
7534        /// This is a **required** field for requests.
7535        pub fn set_session<T>(mut self, v: T) -> Self
7536        where
7537            T: std::convert::Into<crate::model::Session>,
7538        {
7539            self.0.request.session = std::option::Option::Some(v.into());
7540            self
7541        }
7542
7543        /// Sets or clears the value of [session][crate::model::CreateSessionRequest::session].
7544        ///
7545        /// This is a **required** field for requests.
7546        pub fn set_or_clear_session<T>(mut self, v: std::option::Option<T>) -> Self
7547        where
7548            T: std::convert::Into<crate::model::Session>,
7549        {
7550            self.0.request.session = v.map(|x| x.into());
7551            self
7552        }
7553
7554        /// Sets the value of [session_id][crate::model::CreateSessionRequest::session_id].
7555        ///
7556        /// This is a **required** field for requests.
7557        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7558            self.0.request.session_id = v.into();
7559            self
7560        }
7561
7562        /// Sets the value of [request_id][crate::model::CreateSessionRequest::request_id].
7563        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7564            self.0.request.request_id = v.into();
7565            self
7566        }
7567    }
7568
7569    #[doc(hidden)]
7570    impl crate::RequestBuilder for CreateSession {
7571        fn request_options(&mut self) -> &mut crate::RequestOptions {
7572            &mut self.0.options
7573        }
7574    }
7575
7576    /// The request builder for [SessionController::get_session][crate::client::SessionController::get_session] calls.
7577    ///
7578    /// # Example
7579    /// ```
7580    /// # use google_cloud_dataproc_v1::builder::session_controller::GetSession;
7581    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7582    ///
7583    /// let builder = prepare_request_builder();
7584    /// let response = builder.send().await?;
7585    /// # Ok(()) }
7586    ///
7587    /// fn prepare_request_builder() -> GetSession {
7588    ///   # panic!();
7589    ///   // ... details omitted ...
7590    /// }
7591    /// ```
7592    #[derive(Clone, Debug)]
7593    pub struct GetSession(RequestBuilder<crate::model::GetSessionRequest>);
7594
7595    impl GetSession {
7596        pub(crate) fn new(
7597            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7598        ) -> Self {
7599            Self(RequestBuilder::new(stub))
7600        }
7601
7602        /// Sets the full request, replacing any prior values.
7603        pub fn with_request<V: Into<crate::model::GetSessionRequest>>(mut self, v: V) -> Self {
7604            self.0.request = v.into();
7605            self
7606        }
7607
7608        /// Sets all the options, replacing any prior values.
7609        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7610            self.0.options = v.into();
7611            self
7612        }
7613
7614        /// Sends the request.
7615        pub async fn send(self) -> Result<crate::model::Session> {
7616            (*self.0.stub)
7617                .get_session(self.0.request, self.0.options)
7618                .await
7619                .map(crate::Response::into_body)
7620        }
7621
7622        /// Sets the value of [name][crate::model::GetSessionRequest::name].
7623        ///
7624        /// This is a **required** field for requests.
7625        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7626            self.0.request.name = v.into();
7627            self
7628        }
7629    }
7630
7631    #[doc(hidden)]
7632    impl crate::RequestBuilder for GetSession {
7633        fn request_options(&mut self) -> &mut crate::RequestOptions {
7634            &mut self.0.options
7635        }
7636    }
7637
7638    /// The request builder for [SessionController::list_sessions][crate::client::SessionController::list_sessions] calls.
7639    ///
7640    /// # Example
7641    /// ```
7642    /// # use google_cloud_dataproc_v1::builder::session_controller::ListSessions;
7643    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7644    /// use google_cloud_gax::paginator::ItemPaginator;
7645    ///
7646    /// let builder = prepare_request_builder();
7647    /// let mut items = builder.by_item();
7648    /// while let Some(result) = items.next().await {
7649    ///   let item = result?;
7650    /// }
7651    /// # Ok(()) }
7652    ///
7653    /// fn prepare_request_builder() -> ListSessions {
7654    ///   # panic!();
7655    ///   // ... details omitted ...
7656    /// }
7657    /// ```
7658    #[derive(Clone, Debug)]
7659    pub struct ListSessions(RequestBuilder<crate::model::ListSessionsRequest>);
7660
7661    impl ListSessions {
7662        pub(crate) fn new(
7663            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7664        ) -> Self {
7665            Self(RequestBuilder::new(stub))
7666        }
7667
7668        /// Sets the full request, replacing any prior values.
7669        pub fn with_request<V: Into<crate::model::ListSessionsRequest>>(mut self, v: V) -> Self {
7670            self.0.request = v.into();
7671            self
7672        }
7673
7674        /// Sets all the options, replacing any prior values.
7675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7676            self.0.options = v.into();
7677            self
7678        }
7679
7680        /// Sends the request.
7681        pub async fn send(self) -> Result<crate::model::ListSessionsResponse> {
7682            (*self.0.stub)
7683                .list_sessions(self.0.request, self.0.options)
7684                .await
7685                .map(crate::Response::into_body)
7686        }
7687
7688        /// Streams each page in the collection.
7689        pub fn by_page(
7690            self,
7691        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSessionsResponse, crate::Error>
7692        {
7693            use std::clone::Clone;
7694            let token = self.0.request.page_token.clone();
7695            let execute = move |token: String| {
7696                let mut builder = self.clone();
7697                builder.0.request = builder.0.request.set_page_token(token);
7698                builder.send()
7699            };
7700            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7701        }
7702
7703        /// Streams each item in the collection.
7704        pub fn by_item(
7705            self,
7706        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7707            crate::model::ListSessionsResponse,
7708            crate::Error,
7709        > {
7710            use google_cloud_gax::paginator::Paginator;
7711            self.by_page().items()
7712        }
7713
7714        /// Sets the value of [parent][crate::model::ListSessionsRequest::parent].
7715        ///
7716        /// This is a **required** field for requests.
7717        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7718            self.0.request.parent = v.into();
7719            self
7720        }
7721
7722        /// Sets the value of [page_size][crate::model::ListSessionsRequest::page_size].
7723        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7724            self.0.request.page_size = v.into();
7725            self
7726        }
7727
7728        /// Sets the value of [page_token][crate::model::ListSessionsRequest::page_token].
7729        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7730            self.0.request.page_token = v.into();
7731            self
7732        }
7733
7734        /// Sets the value of [filter][crate::model::ListSessionsRequest::filter].
7735        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7736            self.0.request.filter = v.into();
7737            self
7738        }
7739    }
7740
7741    #[doc(hidden)]
7742    impl crate::RequestBuilder for ListSessions {
7743        fn request_options(&mut self) -> &mut crate::RequestOptions {
7744            &mut self.0.options
7745        }
7746    }
7747
7748    /// The request builder for [SessionController::terminate_session][crate::client::SessionController::terminate_session] calls.
7749    ///
7750    /// # Example
7751    /// ```
7752    /// # use google_cloud_dataproc_v1::builder::session_controller::TerminateSession;
7753    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7754    /// use google_cloud_lro::Poller;
7755    ///
7756    /// let builder = prepare_request_builder();
7757    /// let response = builder.poller().until_done().await?;
7758    /// # Ok(()) }
7759    ///
7760    /// fn prepare_request_builder() -> TerminateSession {
7761    ///   # panic!();
7762    ///   // ... details omitted ...
7763    /// }
7764    /// ```
7765    #[derive(Clone, Debug)]
7766    pub struct TerminateSession(RequestBuilder<crate::model::TerminateSessionRequest>);
7767
7768    impl TerminateSession {
7769        pub(crate) fn new(
7770            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7771        ) -> Self {
7772            Self(RequestBuilder::new(stub))
7773        }
7774
7775        /// Sets the full request, replacing any prior values.
7776        pub fn with_request<V: Into<crate::model::TerminateSessionRequest>>(
7777            mut self,
7778            v: V,
7779        ) -> Self {
7780            self.0.request = v.into();
7781            self
7782        }
7783
7784        /// Sets all the options, replacing any prior values.
7785        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7786            self.0.options = v.into();
7787            self
7788        }
7789
7790        /// Sends the request.
7791        ///
7792        /// # Long running operations
7793        ///
7794        /// This starts, but does not poll, a longrunning operation. More information
7795        /// on [terminate_session][crate::client::SessionController::terminate_session].
7796        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7797            (*self.0.stub)
7798                .terminate_session(self.0.request, self.0.options)
7799                .await
7800                .map(crate::Response::into_body)
7801        }
7802
7803        /// Creates a [Poller][google_cloud_lro::Poller] to work with `terminate_session`.
7804        pub fn poller(
7805            self,
7806        ) -> impl google_cloud_lro::Poller<crate::model::Session, crate::model::SessionOperationMetadata>
7807        {
7808            type Operation = google_cloud_lro::internal::Operation<
7809                crate::model::Session,
7810                crate::model::SessionOperationMetadata,
7811            >;
7812            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7813            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7814            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7815            if let Some(ref mut details) = poller_options.tracing {
7816                details.method_name = "google_cloud_dataproc_v1::client::SessionController::terminate_session::until_done";
7817            }
7818
7819            let stub = self.0.stub.clone();
7820            let mut options = self.0.options.clone();
7821            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7822            let query = move |name| {
7823                let stub = stub.clone();
7824                let options = options.clone();
7825                async {
7826                    let op = GetOperation::new(stub)
7827                        .set_name(name)
7828                        .with_options(options)
7829                        .send()
7830                        .await?;
7831                    Ok(Operation::new(op))
7832                }
7833            };
7834
7835            let start = move || async {
7836                let op = self.send().await?;
7837                Ok(Operation::new(op))
7838            };
7839
7840            use google_cloud_lro::internal::PollerExt;
7841            {
7842                google_cloud_lro::internal::new_poller(
7843                    polling_error_policy,
7844                    polling_backoff_policy,
7845                    start,
7846                    query,
7847                )
7848            }
7849            .with_options(poller_options)
7850        }
7851
7852        /// Sets the value of [name][crate::model::TerminateSessionRequest::name].
7853        ///
7854        /// This is a **required** field for requests.
7855        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7856            self.0.request.name = v.into();
7857            self
7858        }
7859
7860        /// Sets the value of [request_id][crate::model::TerminateSessionRequest::request_id].
7861        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7862            self.0.request.request_id = v.into();
7863            self
7864        }
7865    }
7866
7867    #[doc(hidden)]
7868    impl crate::RequestBuilder for TerminateSession {
7869        fn request_options(&mut self) -> &mut crate::RequestOptions {
7870            &mut self.0.options
7871        }
7872    }
7873
7874    /// The request builder for [SessionController::delete_session][crate::client::SessionController::delete_session] calls.
7875    ///
7876    /// # Example
7877    /// ```
7878    /// # use google_cloud_dataproc_v1::builder::session_controller::DeleteSession;
7879    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
7880    /// use google_cloud_lro::Poller;
7881    ///
7882    /// let builder = prepare_request_builder();
7883    /// let response = builder.poller().until_done().await?;
7884    /// # Ok(()) }
7885    ///
7886    /// fn prepare_request_builder() -> DeleteSession {
7887    ///   # panic!();
7888    ///   // ... details omitted ...
7889    /// }
7890    /// ```
7891    #[derive(Clone, Debug)]
7892    pub struct DeleteSession(RequestBuilder<crate::model::DeleteSessionRequest>);
7893
7894    impl DeleteSession {
7895        pub(crate) fn new(
7896            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
7897        ) -> Self {
7898            Self(RequestBuilder::new(stub))
7899        }
7900
7901        /// Sets the full request, replacing any prior values.
7902        pub fn with_request<V: Into<crate::model::DeleteSessionRequest>>(mut self, v: V) -> Self {
7903            self.0.request = v.into();
7904            self
7905        }
7906
7907        /// Sets all the options, replacing any prior values.
7908        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7909            self.0.options = v.into();
7910            self
7911        }
7912
7913        /// Sends the request.
7914        ///
7915        /// # Long running operations
7916        ///
7917        /// This starts, but does not poll, a longrunning operation. More information
7918        /// on [delete_session][crate::client::SessionController::delete_session].
7919        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7920            (*self.0.stub)
7921                .delete_session(self.0.request, self.0.options)
7922                .await
7923                .map(crate::Response::into_body)
7924        }
7925
7926        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_session`.
7927        pub fn poller(
7928            self,
7929        ) -> impl google_cloud_lro::Poller<crate::model::Session, crate::model::SessionOperationMetadata>
7930        {
7931            type Operation = google_cloud_lro::internal::Operation<
7932                crate::model::Session,
7933                crate::model::SessionOperationMetadata,
7934            >;
7935            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7936            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7937            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7938            if let Some(ref mut details) = poller_options.tracing {
7939                details.method_name = "google_cloud_dataproc_v1::client::SessionController::delete_session::until_done";
7940            }
7941
7942            let stub = self.0.stub.clone();
7943            let mut options = self.0.options.clone();
7944            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7945            let query = move |name| {
7946                let stub = stub.clone();
7947                let options = options.clone();
7948                async {
7949                    let op = GetOperation::new(stub)
7950                        .set_name(name)
7951                        .with_options(options)
7952                        .send()
7953                        .await?;
7954                    Ok(Operation::new(op))
7955                }
7956            };
7957
7958            let start = move || async {
7959                let op = self.send().await?;
7960                Ok(Operation::new(op))
7961            };
7962
7963            use google_cloud_lro::internal::PollerExt;
7964            {
7965                google_cloud_lro::internal::new_poller(
7966                    polling_error_policy,
7967                    polling_backoff_policy,
7968                    start,
7969                    query,
7970                )
7971            }
7972            .with_options(poller_options)
7973        }
7974
7975        /// Sets the value of [name][crate::model::DeleteSessionRequest::name].
7976        ///
7977        /// This is a **required** field for requests.
7978        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7979            self.0.request.name = v.into();
7980            self
7981        }
7982
7983        /// Sets the value of [request_id][crate::model::DeleteSessionRequest::request_id].
7984        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7985            self.0.request.request_id = v.into();
7986            self
7987        }
7988    }
7989
7990    #[doc(hidden)]
7991    impl crate::RequestBuilder for DeleteSession {
7992        fn request_options(&mut self) -> &mut crate::RequestOptions {
7993            &mut self.0.options
7994        }
7995    }
7996
7997    /// The request builder for [SessionController::set_iam_policy][crate::client::SessionController::set_iam_policy] calls.
7998    ///
7999    /// # Example
8000    /// ```
8001    /// # use google_cloud_dataproc_v1::builder::session_controller::SetIamPolicy;
8002    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8003    ///
8004    /// let builder = prepare_request_builder();
8005    /// let response = builder.send().await?;
8006    /// # Ok(()) }
8007    ///
8008    /// fn prepare_request_builder() -> SetIamPolicy {
8009    ///   # panic!();
8010    ///   // ... details omitted ...
8011    /// }
8012    /// ```
8013    #[derive(Clone, Debug)]
8014    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8015
8016    impl SetIamPolicy {
8017        pub(crate) fn new(
8018            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8019        ) -> Self {
8020            Self(RequestBuilder::new(stub))
8021        }
8022
8023        /// Sets the full request, replacing any prior values.
8024        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8025            mut self,
8026            v: V,
8027        ) -> Self {
8028            self.0.request = v.into();
8029            self
8030        }
8031
8032        /// Sets all the options, replacing any prior values.
8033        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8034            self.0.options = v.into();
8035            self
8036        }
8037
8038        /// Sends the request.
8039        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8040            (*self.0.stub)
8041                .set_iam_policy(self.0.request, self.0.options)
8042                .await
8043                .map(crate::Response::into_body)
8044        }
8045
8046        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
8047        ///
8048        /// This is a **required** field for requests.
8049        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8050            self.0.request.resource = v.into();
8051            self
8052        }
8053
8054        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8055        ///
8056        /// This is a **required** field for requests.
8057        pub fn set_policy<T>(mut self, v: T) -> Self
8058        where
8059            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8060        {
8061            self.0.request.policy = std::option::Option::Some(v.into());
8062            self
8063        }
8064
8065        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8066        ///
8067        /// This is a **required** field for requests.
8068        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8069        where
8070            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8071        {
8072            self.0.request.policy = v.map(|x| x.into());
8073            self
8074        }
8075
8076        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8077        pub fn set_update_mask<T>(mut self, v: T) -> Self
8078        where
8079            T: std::convert::Into<wkt::FieldMask>,
8080        {
8081            self.0.request.update_mask = std::option::Option::Some(v.into());
8082            self
8083        }
8084
8085        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8086        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8087        where
8088            T: std::convert::Into<wkt::FieldMask>,
8089        {
8090            self.0.request.update_mask = v.map(|x| x.into());
8091            self
8092        }
8093    }
8094
8095    #[doc(hidden)]
8096    impl crate::RequestBuilder for SetIamPolicy {
8097        fn request_options(&mut self) -> &mut crate::RequestOptions {
8098            &mut self.0.options
8099        }
8100    }
8101
8102    /// The request builder for [SessionController::get_iam_policy][crate::client::SessionController::get_iam_policy] calls.
8103    ///
8104    /// # Example
8105    /// ```
8106    /// # use google_cloud_dataproc_v1::builder::session_controller::GetIamPolicy;
8107    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8108    ///
8109    /// let builder = prepare_request_builder();
8110    /// let response = builder.send().await?;
8111    /// # Ok(()) }
8112    ///
8113    /// fn prepare_request_builder() -> GetIamPolicy {
8114    ///   # panic!();
8115    ///   // ... details omitted ...
8116    /// }
8117    /// ```
8118    #[derive(Clone, Debug)]
8119    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8120
8121    impl GetIamPolicy {
8122        pub(crate) fn new(
8123            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8124        ) -> Self {
8125            Self(RequestBuilder::new(stub))
8126        }
8127
8128        /// Sets the full request, replacing any prior values.
8129        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8130            mut self,
8131            v: V,
8132        ) -> Self {
8133            self.0.request = v.into();
8134            self
8135        }
8136
8137        /// Sets all the options, replacing any prior values.
8138        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8139            self.0.options = v.into();
8140            self
8141        }
8142
8143        /// Sends the request.
8144        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8145            (*self.0.stub)
8146                .get_iam_policy(self.0.request, self.0.options)
8147                .await
8148                .map(crate::Response::into_body)
8149        }
8150
8151        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
8152        ///
8153        /// This is a **required** field for requests.
8154        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8155            self.0.request.resource = v.into();
8156            self
8157        }
8158
8159        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8160        pub fn set_options<T>(mut self, v: T) -> Self
8161        where
8162            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8163        {
8164            self.0.request.options = std::option::Option::Some(v.into());
8165            self
8166        }
8167
8168        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8169        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8170        where
8171            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8172        {
8173            self.0.request.options = v.map(|x| x.into());
8174            self
8175        }
8176    }
8177
8178    #[doc(hidden)]
8179    impl crate::RequestBuilder for GetIamPolicy {
8180        fn request_options(&mut self) -> &mut crate::RequestOptions {
8181            &mut self.0.options
8182        }
8183    }
8184
8185    /// The request builder for [SessionController::test_iam_permissions][crate::client::SessionController::test_iam_permissions] calls.
8186    ///
8187    /// # Example
8188    /// ```
8189    /// # use google_cloud_dataproc_v1::builder::session_controller::TestIamPermissions;
8190    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8191    ///
8192    /// let builder = prepare_request_builder();
8193    /// let response = builder.send().await?;
8194    /// # Ok(()) }
8195    ///
8196    /// fn prepare_request_builder() -> TestIamPermissions {
8197    ///   # panic!();
8198    ///   // ... details omitted ...
8199    /// }
8200    /// ```
8201    #[derive(Clone, Debug)]
8202    pub struct TestIamPermissions(
8203        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8204    );
8205
8206    impl TestIamPermissions {
8207        pub(crate) fn new(
8208            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8209        ) -> Self {
8210            Self(RequestBuilder::new(stub))
8211        }
8212
8213        /// Sets the full request, replacing any prior values.
8214        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8215            mut self,
8216            v: V,
8217        ) -> Self {
8218            self.0.request = v.into();
8219            self
8220        }
8221
8222        /// Sets all the options, replacing any prior values.
8223        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8224            self.0.options = v.into();
8225            self
8226        }
8227
8228        /// Sends the request.
8229        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8230            (*self.0.stub)
8231                .test_iam_permissions(self.0.request, self.0.options)
8232                .await
8233                .map(crate::Response::into_body)
8234        }
8235
8236        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
8237        ///
8238        /// This is a **required** field for requests.
8239        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8240            self.0.request.resource = v.into();
8241            self
8242        }
8243
8244        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
8245        ///
8246        /// This is a **required** field for requests.
8247        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8248        where
8249            T: std::iter::IntoIterator<Item = V>,
8250            V: std::convert::Into<std::string::String>,
8251        {
8252            use std::iter::Iterator;
8253            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8254            self
8255        }
8256    }
8257
8258    #[doc(hidden)]
8259    impl crate::RequestBuilder for TestIamPermissions {
8260        fn request_options(&mut self) -> &mut crate::RequestOptions {
8261            &mut self.0.options
8262        }
8263    }
8264
8265    /// The request builder for [SessionController::list_operations][crate::client::SessionController::list_operations] calls.
8266    ///
8267    /// # Example
8268    /// ```
8269    /// # use google_cloud_dataproc_v1::builder::session_controller::ListOperations;
8270    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8271    /// use google_cloud_gax::paginator::ItemPaginator;
8272    ///
8273    /// let builder = prepare_request_builder();
8274    /// let mut items = builder.by_item();
8275    /// while let Some(result) = items.next().await {
8276    ///   let item = result?;
8277    /// }
8278    /// # Ok(()) }
8279    ///
8280    /// fn prepare_request_builder() -> ListOperations {
8281    ///   # panic!();
8282    ///   // ... details omitted ...
8283    /// }
8284    /// ```
8285    #[derive(Clone, Debug)]
8286    pub struct ListOperations(
8287        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8288    );
8289
8290    impl ListOperations {
8291        pub(crate) fn new(
8292            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8293        ) -> Self {
8294            Self(RequestBuilder::new(stub))
8295        }
8296
8297        /// Sets the full request, replacing any prior values.
8298        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8299            mut self,
8300            v: V,
8301        ) -> Self {
8302            self.0.request = v.into();
8303            self
8304        }
8305
8306        /// Sets all the options, replacing any prior values.
8307        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8308            self.0.options = v.into();
8309            self
8310        }
8311
8312        /// Sends the request.
8313        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8314            (*self.0.stub)
8315                .list_operations(self.0.request, self.0.options)
8316                .await
8317                .map(crate::Response::into_body)
8318        }
8319
8320        /// Streams each page in the collection.
8321        pub fn by_page(
8322            self,
8323        ) -> impl google_cloud_gax::paginator::Paginator<
8324            google_cloud_longrunning::model::ListOperationsResponse,
8325            crate::Error,
8326        > {
8327            use std::clone::Clone;
8328            let token = self.0.request.page_token.clone();
8329            let execute = move |token: String| {
8330                let mut builder = self.clone();
8331                builder.0.request = builder.0.request.set_page_token(token);
8332                builder.send()
8333            };
8334            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8335        }
8336
8337        /// Streams each item in the collection.
8338        pub fn by_item(
8339            self,
8340        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8341            google_cloud_longrunning::model::ListOperationsResponse,
8342            crate::Error,
8343        > {
8344            use google_cloud_gax::paginator::Paginator;
8345            self.by_page().items()
8346        }
8347
8348        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8349        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8350            self.0.request.name = v.into();
8351            self
8352        }
8353
8354        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8355        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8356            self.0.request.filter = v.into();
8357            self
8358        }
8359
8360        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8361        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8362            self.0.request.page_size = v.into();
8363            self
8364        }
8365
8366        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8367        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8368            self.0.request.page_token = v.into();
8369            self
8370        }
8371
8372        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8373        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8374            self.0.request.return_partial_success = v.into();
8375            self
8376        }
8377    }
8378
8379    #[doc(hidden)]
8380    impl crate::RequestBuilder for ListOperations {
8381        fn request_options(&mut self) -> &mut crate::RequestOptions {
8382            &mut self.0.options
8383        }
8384    }
8385
8386    /// The request builder for [SessionController::get_operation][crate::client::SessionController::get_operation] calls.
8387    ///
8388    /// # Example
8389    /// ```
8390    /// # use google_cloud_dataproc_v1::builder::session_controller::GetOperation;
8391    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8392    ///
8393    /// let builder = prepare_request_builder();
8394    /// let response = builder.send().await?;
8395    /// # Ok(()) }
8396    ///
8397    /// fn prepare_request_builder() -> GetOperation {
8398    ///   # panic!();
8399    ///   // ... details omitted ...
8400    /// }
8401    /// ```
8402    #[derive(Clone, Debug)]
8403    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8404
8405    impl GetOperation {
8406        pub(crate) fn new(
8407            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8408        ) -> Self {
8409            Self(RequestBuilder::new(stub))
8410        }
8411
8412        /// Sets the full request, replacing any prior values.
8413        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8414            mut self,
8415            v: V,
8416        ) -> Self {
8417            self.0.request = v.into();
8418            self
8419        }
8420
8421        /// Sets all the options, replacing any prior values.
8422        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8423            self.0.options = v.into();
8424            self
8425        }
8426
8427        /// Sends the request.
8428        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8429            (*self.0.stub)
8430                .get_operation(self.0.request, self.0.options)
8431                .await
8432                .map(crate::Response::into_body)
8433        }
8434
8435        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8436        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8437            self.0.request.name = v.into();
8438            self
8439        }
8440    }
8441
8442    #[doc(hidden)]
8443    impl crate::RequestBuilder for GetOperation {
8444        fn request_options(&mut self) -> &mut crate::RequestOptions {
8445            &mut self.0.options
8446        }
8447    }
8448
8449    /// The request builder for [SessionController::delete_operation][crate::client::SessionController::delete_operation] calls.
8450    ///
8451    /// # Example
8452    /// ```
8453    /// # use google_cloud_dataproc_v1::builder::session_controller::DeleteOperation;
8454    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8455    ///
8456    /// let builder = prepare_request_builder();
8457    /// let response = builder.send().await?;
8458    /// # Ok(()) }
8459    ///
8460    /// fn prepare_request_builder() -> DeleteOperation {
8461    ///   # panic!();
8462    ///   // ... details omitted ...
8463    /// }
8464    /// ```
8465    #[derive(Clone, Debug)]
8466    pub struct DeleteOperation(
8467        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8468    );
8469
8470    impl DeleteOperation {
8471        pub(crate) fn new(
8472            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8473        ) -> Self {
8474            Self(RequestBuilder::new(stub))
8475        }
8476
8477        /// Sets the full request, replacing any prior values.
8478        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8479            mut self,
8480            v: V,
8481        ) -> Self {
8482            self.0.request = v.into();
8483            self
8484        }
8485
8486        /// Sets all the options, replacing any prior values.
8487        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8488            self.0.options = v.into();
8489            self
8490        }
8491
8492        /// Sends the request.
8493        pub async fn send(self) -> Result<()> {
8494            (*self.0.stub)
8495                .delete_operation(self.0.request, self.0.options)
8496                .await
8497                .map(crate::Response::into_body)
8498        }
8499
8500        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
8501        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8502            self.0.request.name = v.into();
8503            self
8504        }
8505    }
8506
8507    #[doc(hidden)]
8508    impl crate::RequestBuilder for DeleteOperation {
8509        fn request_options(&mut self) -> &mut crate::RequestOptions {
8510            &mut self.0.options
8511        }
8512    }
8513
8514    /// The request builder for [SessionController::cancel_operation][crate::client::SessionController::cancel_operation] calls.
8515    ///
8516    /// # Example
8517    /// ```
8518    /// # use google_cloud_dataproc_v1::builder::session_controller::CancelOperation;
8519    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8520    ///
8521    /// let builder = prepare_request_builder();
8522    /// let response = builder.send().await?;
8523    /// # Ok(()) }
8524    ///
8525    /// fn prepare_request_builder() -> CancelOperation {
8526    ///   # panic!();
8527    ///   // ... details omitted ...
8528    /// }
8529    /// ```
8530    #[derive(Clone, Debug)]
8531    pub struct CancelOperation(
8532        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8533    );
8534
8535    impl CancelOperation {
8536        pub(crate) fn new(
8537            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionController>,
8538        ) -> Self {
8539            Self(RequestBuilder::new(stub))
8540        }
8541
8542        /// Sets the full request, replacing any prior values.
8543        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8544            mut self,
8545            v: V,
8546        ) -> Self {
8547            self.0.request = v.into();
8548            self
8549        }
8550
8551        /// Sets all the options, replacing any prior values.
8552        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8553            self.0.options = v.into();
8554            self
8555        }
8556
8557        /// Sends the request.
8558        pub async fn send(self) -> Result<()> {
8559            (*self.0.stub)
8560                .cancel_operation(self.0.request, self.0.options)
8561                .await
8562                .map(crate::Response::into_body)
8563        }
8564
8565        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8566        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8567            self.0.request.name = v.into();
8568            self
8569        }
8570    }
8571
8572    #[doc(hidden)]
8573    impl crate::RequestBuilder for CancelOperation {
8574        fn request_options(&mut self) -> &mut crate::RequestOptions {
8575            &mut self.0.options
8576        }
8577    }
8578}
8579
8580/// Request and client builders for [WorkflowTemplateService][crate::client::WorkflowTemplateService].
8581pub mod workflow_template_service {
8582    use crate::Result;
8583
8584    /// A builder for [WorkflowTemplateService][crate::client::WorkflowTemplateService].
8585    ///
8586    /// ```
8587    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8588    /// # use google_cloud_dataproc_v1::*;
8589    /// # use builder::workflow_template_service::ClientBuilder;
8590    /// # use client::WorkflowTemplateService;
8591    /// let builder : ClientBuilder = WorkflowTemplateService::builder();
8592    /// let client = builder
8593    ///     .with_endpoint("https://dataproc.googleapis.com")
8594    ///     .build().await?;
8595    /// # Ok(()) }
8596    /// ```
8597    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8598
8599    pub(crate) mod client {
8600        use super::super::super::client::WorkflowTemplateService;
8601        pub struct Factory;
8602        impl crate::ClientFactory for Factory {
8603            type Client = WorkflowTemplateService;
8604            type Credentials = gaxi::options::Credentials;
8605            async fn build(
8606                self,
8607                config: gaxi::options::ClientConfig,
8608            ) -> crate::ClientBuilderResult<Self::Client> {
8609                Self::Client::new(config).await
8610            }
8611        }
8612    }
8613
8614    /// Common implementation for [crate::client::WorkflowTemplateService] request builders.
8615    #[derive(Clone, Debug)]
8616    pub(crate) struct RequestBuilder<R: std::default::Default> {
8617        stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8618        request: R,
8619        options: crate::RequestOptions,
8620    }
8621
8622    impl<R> RequestBuilder<R>
8623    where
8624        R: std::default::Default,
8625    {
8626        pub(crate) fn new(
8627            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8628        ) -> Self {
8629            Self {
8630                stub,
8631                request: R::default(),
8632                options: crate::RequestOptions::default(),
8633            }
8634        }
8635    }
8636
8637    /// The request builder for [WorkflowTemplateService::create_workflow_template][crate::client::WorkflowTemplateService::create_workflow_template] calls.
8638    ///
8639    /// # Example
8640    /// ```
8641    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::CreateWorkflowTemplate;
8642    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8643    ///
8644    /// let builder = prepare_request_builder();
8645    /// let response = builder.send().await?;
8646    /// # Ok(()) }
8647    ///
8648    /// fn prepare_request_builder() -> CreateWorkflowTemplate {
8649    ///   # panic!();
8650    ///   // ... details omitted ...
8651    /// }
8652    /// ```
8653    #[derive(Clone, Debug)]
8654    pub struct CreateWorkflowTemplate(RequestBuilder<crate::model::CreateWorkflowTemplateRequest>);
8655
8656    impl CreateWorkflowTemplate {
8657        pub(crate) fn new(
8658            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8659        ) -> Self {
8660            Self(RequestBuilder::new(stub))
8661        }
8662
8663        /// Sets the full request, replacing any prior values.
8664        pub fn with_request<V: Into<crate::model::CreateWorkflowTemplateRequest>>(
8665            mut self,
8666            v: V,
8667        ) -> Self {
8668            self.0.request = v.into();
8669            self
8670        }
8671
8672        /// Sets all the options, replacing any prior values.
8673        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8674            self.0.options = v.into();
8675            self
8676        }
8677
8678        /// Sends the request.
8679        pub async fn send(self) -> Result<crate::model::WorkflowTemplate> {
8680            (*self.0.stub)
8681                .create_workflow_template(self.0.request, self.0.options)
8682                .await
8683                .map(crate::Response::into_body)
8684        }
8685
8686        /// Sets the value of [parent][crate::model::CreateWorkflowTemplateRequest::parent].
8687        ///
8688        /// This is a **required** field for requests.
8689        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8690            self.0.request.parent = v.into();
8691            self
8692        }
8693
8694        /// Sets the value of [template][crate::model::CreateWorkflowTemplateRequest::template].
8695        ///
8696        /// This is a **required** field for requests.
8697        pub fn set_template<T>(mut self, v: T) -> Self
8698        where
8699            T: std::convert::Into<crate::model::WorkflowTemplate>,
8700        {
8701            self.0.request.template = std::option::Option::Some(v.into());
8702            self
8703        }
8704
8705        /// Sets or clears the value of [template][crate::model::CreateWorkflowTemplateRequest::template].
8706        ///
8707        /// This is a **required** field for requests.
8708        pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
8709        where
8710            T: std::convert::Into<crate::model::WorkflowTemplate>,
8711        {
8712            self.0.request.template = v.map(|x| x.into());
8713            self
8714        }
8715    }
8716
8717    #[doc(hidden)]
8718    impl crate::RequestBuilder for CreateWorkflowTemplate {
8719        fn request_options(&mut self) -> &mut crate::RequestOptions {
8720            &mut self.0.options
8721        }
8722    }
8723
8724    /// The request builder for [WorkflowTemplateService::get_workflow_template][crate::client::WorkflowTemplateService::get_workflow_template] calls.
8725    ///
8726    /// # Example
8727    /// ```
8728    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::GetWorkflowTemplate;
8729    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8730    ///
8731    /// let builder = prepare_request_builder();
8732    /// let response = builder.send().await?;
8733    /// # Ok(()) }
8734    ///
8735    /// fn prepare_request_builder() -> GetWorkflowTemplate {
8736    ///   # panic!();
8737    ///   // ... details omitted ...
8738    /// }
8739    /// ```
8740    #[derive(Clone, Debug)]
8741    pub struct GetWorkflowTemplate(RequestBuilder<crate::model::GetWorkflowTemplateRequest>);
8742
8743    impl GetWorkflowTemplate {
8744        pub(crate) fn new(
8745            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8746        ) -> Self {
8747            Self(RequestBuilder::new(stub))
8748        }
8749
8750        /// Sets the full request, replacing any prior values.
8751        pub fn with_request<V: Into<crate::model::GetWorkflowTemplateRequest>>(
8752            mut self,
8753            v: V,
8754        ) -> Self {
8755            self.0.request = v.into();
8756            self
8757        }
8758
8759        /// Sets all the options, replacing any prior values.
8760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8761            self.0.options = v.into();
8762            self
8763        }
8764
8765        /// Sends the request.
8766        pub async fn send(self) -> Result<crate::model::WorkflowTemplate> {
8767            (*self.0.stub)
8768                .get_workflow_template(self.0.request, self.0.options)
8769                .await
8770                .map(crate::Response::into_body)
8771        }
8772
8773        /// Sets the value of [name][crate::model::GetWorkflowTemplateRequest::name].
8774        ///
8775        /// This is a **required** field for requests.
8776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8777            self.0.request.name = v.into();
8778            self
8779        }
8780
8781        /// Sets the value of [version][crate::model::GetWorkflowTemplateRequest::version].
8782        pub fn set_version<T: Into<i32>>(mut self, v: T) -> Self {
8783            self.0.request.version = v.into();
8784            self
8785        }
8786    }
8787
8788    #[doc(hidden)]
8789    impl crate::RequestBuilder for GetWorkflowTemplate {
8790        fn request_options(&mut self) -> &mut crate::RequestOptions {
8791            &mut self.0.options
8792        }
8793    }
8794
8795    /// The request builder for [WorkflowTemplateService::instantiate_workflow_template][crate::client::WorkflowTemplateService::instantiate_workflow_template] calls.
8796    ///
8797    /// # Example
8798    /// ```
8799    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::InstantiateWorkflowTemplate;
8800    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8801    /// use google_cloud_lro::Poller;
8802    ///
8803    /// let builder = prepare_request_builder();
8804    /// let response = builder.poller().until_done().await?;
8805    /// # Ok(()) }
8806    ///
8807    /// fn prepare_request_builder() -> InstantiateWorkflowTemplate {
8808    ///   # panic!();
8809    ///   // ... details omitted ...
8810    /// }
8811    /// ```
8812    #[derive(Clone, Debug)]
8813    pub struct InstantiateWorkflowTemplate(
8814        RequestBuilder<crate::model::InstantiateWorkflowTemplateRequest>,
8815    );
8816
8817    impl InstantiateWorkflowTemplate {
8818        pub(crate) fn new(
8819            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8820        ) -> Self {
8821            Self(RequestBuilder::new(stub))
8822        }
8823
8824        /// Sets the full request, replacing any prior values.
8825        pub fn with_request<V: Into<crate::model::InstantiateWorkflowTemplateRequest>>(
8826            mut self,
8827            v: V,
8828        ) -> Self {
8829            self.0.request = v.into();
8830            self
8831        }
8832
8833        /// Sets all the options, replacing any prior values.
8834        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8835            self.0.options = v.into();
8836            self
8837        }
8838
8839        /// Sends the request.
8840        ///
8841        /// # Long running operations
8842        ///
8843        /// This starts, but does not poll, a longrunning operation. More information
8844        /// on [instantiate_workflow_template][crate::client::WorkflowTemplateService::instantiate_workflow_template].
8845        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8846            (*self.0.stub)
8847                .instantiate_workflow_template(self.0.request, self.0.options)
8848                .await
8849                .map(crate::Response::into_body)
8850        }
8851
8852        /// Creates a [Poller][google_cloud_lro::Poller] to work with `instantiate_workflow_template`.
8853        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::WorkflowMetadata> {
8854            type Operation =
8855                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::WorkflowMetadata>;
8856            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8857            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8858            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8859            if let Some(ref mut details) = poller_options.tracing {
8860                details.method_name = "google_cloud_dataproc_v1::client::WorkflowTemplateService::instantiate_workflow_template::until_done";
8861            }
8862
8863            let stub = self.0.stub.clone();
8864            let mut options = self.0.options.clone();
8865            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8866            let query = move |name| {
8867                let stub = stub.clone();
8868                let options = options.clone();
8869                async {
8870                    let op = GetOperation::new(stub)
8871                        .set_name(name)
8872                        .with_options(options)
8873                        .send()
8874                        .await?;
8875                    Ok(Operation::new(op))
8876                }
8877            };
8878
8879            let start = move || async {
8880                let op = self.send().await?;
8881                Ok(Operation::new(op))
8882            };
8883
8884            use google_cloud_lro::internal::PollerExt;
8885            {
8886                google_cloud_lro::internal::new_unit_response_poller(
8887                    polling_error_policy,
8888                    polling_backoff_policy,
8889                    start,
8890                    query,
8891                )
8892            }
8893            .with_options(poller_options)
8894        }
8895
8896        /// Sets the value of [name][crate::model::InstantiateWorkflowTemplateRequest::name].
8897        ///
8898        /// This is a **required** field for requests.
8899        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8900            self.0.request.name = v.into();
8901            self
8902        }
8903
8904        /// Sets the value of [version][crate::model::InstantiateWorkflowTemplateRequest::version].
8905        pub fn set_version<T: Into<i32>>(mut self, v: T) -> Self {
8906            self.0.request.version = v.into();
8907            self
8908        }
8909
8910        /// Sets the value of [request_id][crate::model::InstantiateWorkflowTemplateRequest::request_id].
8911        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8912            self.0.request.request_id = v.into();
8913            self
8914        }
8915
8916        /// Sets the value of [parameters][crate::model::InstantiateWorkflowTemplateRequest::parameters].
8917        pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
8918        where
8919            T: std::iter::IntoIterator<Item = (K, V)>,
8920            K: std::convert::Into<std::string::String>,
8921            V: std::convert::Into<std::string::String>,
8922        {
8923            self.0.request.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8924            self
8925        }
8926    }
8927
8928    #[doc(hidden)]
8929    impl crate::RequestBuilder for InstantiateWorkflowTemplate {
8930        fn request_options(&mut self) -> &mut crate::RequestOptions {
8931            &mut self.0.options
8932        }
8933    }
8934
8935    /// The request builder for [WorkflowTemplateService::instantiate_inline_workflow_template][crate::client::WorkflowTemplateService::instantiate_inline_workflow_template] calls.
8936    ///
8937    /// # Example
8938    /// ```
8939    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::InstantiateInlineWorkflowTemplate;
8940    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
8941    /// use google_cloud_lro::Poller;
8942    ///
8943    /// let builder = prepare_request_builder();
8944    /// let response = builder.poller().until_done().await?;
8945    /// # Ok(()) }
8946    ///
8947    /// fn prepare_request_builder() -> InstantiateInlineWorkflowTemplate {
8948    ///   # panic!();
8949    ///   // ... details omitted ...
8950    /// }
8951    /// ```
8952    #[derive(Clone, Debug)]
8953    pub struct InstantiateInlineWorkflowTemplate(
8954        RequestBuilder<crate::model::InstantiateInlineWorkflowTemplateRequest>,
8955    );
8956
8957    impl InstantiateInlineWorkflowTemplate {
8958        pub(crate) fn new(
8959            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
8960        ) -> Self {
8961            Self(RequestBuilder::new(stub))
8962        }
8963
8964        /// Sets the full request, replacing any prior values.
8965        pub fn with_request<V: Into<crate::model::InstantiateInlineWorkflowTemplateRequest>>(
8966            mut self,
8967            v: V,
8968        ) -> Self {
8969            self.0.request = v.into();
8970            self
8971        }
8972
8973        /// Sets all the options, replacing any prior values.
8974        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8975            self.0.options = v.into();
8976            self
8977        }
8978
8979        /// Sends the request.
8980        ///
8981        /// # Long running operations
8982        ///
8983        /// This starts, but does not poll, a longrunning operation. More information
8984        /// on [instantiate_inline_workflow_template][crate::client::WorkflowTemplateService::instantiate_inline_workflow_template].
8985        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8986            (*self.0.stub)
8987                .instantiate_inline_workflow_template(self.0.request, self.0.options)
8988                .await
8989                .map(crate::Response::into_body)
8990        }
8991
8992        /// Creates a [Poller][google_cloud_lro::Poller] to work with `instantiate_inline_workflow_template`.
8993        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::WorkflowMetadata> {
8994            type Operation =
8995                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::WorkflowMetadata>;
8996            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8997            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8998            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8999            if let Some(ref mut details) = poller_options.tracing {
9000                details.method_name = "google_cloud_dataproc_v1::client::WorkflowTemplateService::instantiate_inline_workflow_template::until_done";
9001            }
9002
9003            let stub = self.0.stub.clone();
9004            let mut options = self.0.options.clone();
9005            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9006            let query = move |name| {
9007                let stub = stub.clone();
9008                let options = options.clone();
9009                async {
9010                    let op = GetOperation::new(stub)
9011                        .set_name(name)
9012                        .with_options(options)
9013                        .send()
9014                        .await?;
9015                    Ok(Operation::new(op))
9016                }
9017            };
9018
9019            let start = move || async {
9020                let op = self.send().await?;
9021                Ok(Operation::new(op))
9022            };
9023
9024            use google_cloud_lro::internal::PollerExt;
9025            {
9026                google_cloud_lro::internal::new_unit_response_poller(
9027                    polling_error_policy,
9028                    polling_backoff_policy,
9029                    start,
9030                    query,
9031                )
9032            }
9033            .with_options(poller_options)
9034        }
9035
9036        /// Sets the value of [parent][crate::model::InstantiateInlineWorkflowTemplateRequest::parent].
9037        ///
9038        /// This is a **required** field for requests.
9039        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9040            self.0.request.parent = v.into();
9041            self
9042        }
9043
9044        /// Sets the value of [template][crate::model::InstantiateInlineWorkflowTemplateRequest::template].
9045        ///
9046        /// This is a **required** field for requests.
9047        pub fn set_template<T>(mut self, v: T) -> Self
9048        where
9049            T: std::convert::Into<crate::model::WorkflowTemplate>,
9050        {
9051            self.0.request.template = std::option::Option::Some(v.into());
9052            self
9053        }
9054
9055        /// Sets or clears the value of [template][crate::model::InstantiateInlineWorkflowTemplateRequest::template].
9056        ///
9057        /// This is a **required** field for requests.
9058        pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
9059        where
9060            T: std::convert::Into<crate::model::WorkflowTemplate>,
9061        {
9062            self.0.request.template = v.map(|x| x.into());
9063            self
9064        }
9065
9066        /// Sets the value of [request_id][crate::model::InstantiateInlineWorkflowTemplateRequest::request_id].
9067        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9068            self.0.request.request_id = v.into();
9069            self
9070        }
9071    }
9072
9073    #[doc(hidden)]
9074    impl crate::RequestBuilder for InstantiateInlineWorkflowTemplate {
9075        fn request_options(&mut self) -> &mut crate::RequestOptions {
9076            &mut self.0.options
9077        }
9078    }
9079
9080    /// The request builder for [WorkflowTemplateService::update_workflow_template][crate::client::WorkflowTemplateService::update_workflow_template] calls.
9081    ///
9082    /// # Example
9083    /// ```
9084    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::UpdateWorkflowTemplate;
9085    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9086    ///
9087    /// let builder = prepare_request_builder();
9088    /// let response = builder.send().await?;
9089    /// # Ok(()) }
9090    ///
9091    /// fn prepare_request_builder() -> UpdateWorkflowTemplate {
9092    ///   # panic!();
9093    ///   // ... details omitted ...
9094    /// }
9095    /// ```
9096    #[derive(Clone, Debug)]
9097    pub struct UpdateWorkflowTemplate(RequestBuilder<crate::model::UpdateWorkflowTemplateRequest>);
9098
9099    impl UpdateWorkflowTemplate {
9100        pub(crate) fn new(
9101            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9102        ) -> Self {
9103            Self(RequestBuilder::new(stub))
9104        }
9105
9106        /// Sets the full request, replacing any prior values.
9107        pub fn with_request<V: Into<crate::model::UpdateWorkflowTemplateRequest>>(
9108            mut self,
9109            v: V,
9110        ) -> Self {
9111            self.0.request = v.into();
9112            self
9113        }
9114
9115        /// Sets all the options, replacing any prior values.
9116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9117            self.0.options = v.into();
9118            self
9119        }
9120
9121        /// Sends the request.
9122        pub async fn send(self) -> Result<crate::model::WorkflowTemplate> {
9123            (*self.0.stub)
9124                .update_workflow_template(self.0.request, self.0.options)
9125                .await
9126                .map(crate::Response::into_body)
9127        }
9128
9129        /// Sets the value of [template][crate::model::UpdateWorkflowTemplateRequest::template].
9130        ///
9131        /// This is a **required** field for requests.
9132        pub fn set_template<T>(mut self, v: T) -> Self
9133        where
9134            T: std::convert::Into<crate::model::WorkflowTemplate>,
9135        {
9136            self.0.request.template = std::option::Option::Some(v.into());
9137            self
9138        }
9139
9140        /// Sets or clears the value of [template][crate::model::UpdateWorkflowTemplateRequest::template].
9141        ///
9142        /// This is a **required** field for requests.
9143        pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
9144        where
9145            T: std::convert::Into<crate::model::WorkflowTemplate>,
9146        {
9147            self.0.request.template = v.map(|x| x.into());
9148            self
9149        }
9150    }
9151
9152    #[doc(hidden)]
9153    impl crate::RequestBuilder for UpdateWorkflowTemplate {
9154        fn request_options(&mut self) -> &mut crate::RequestOptions {
9155            &mut self.0.options
9156        }
9157    }
9158
9159    /// The request builder for [WorkflowTemplateService::list_workflow_templates][crate::client::WorkflowTemplateService::list_workflow_templates] calls.
9160    ///
9161    /// # Example
9162    /// ```
9163    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::ListWorkflowTemplates;
9164    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9165    /// use google_cloud_gax::paginator::ItemPaginator;
9166    ///
9167    /// let builder = prepare_request_builder();
9168    /// let mut items = builder.by_item();
9169    /// while let Some(result) = items.next().await {
9170    ///   let item = result?;
9171    /// }
9172    /// # Ok(()) }
9173    ///
9174    /// fn prepare_request_builder() -> ListWorkflowTemplates {
9175    ///   # panic!();
9176    ///   // ... details omitted ...
9177    /// }
9178    /// ```
9179    #[derive(Clone, Debug)]
9180    pub struct ListWorkflowTemplates(RequestBuilder<crate::model::ListWorkflowTemplatesRequest>);
9181
9182    impl ListWorkflowTemplates {
9183        pub(crate) fn new(
9184            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9185        ) -> Self {
9186            Self(RequestBuilder::new(stub))
9187        }
9188
9189        /// Sets the full request, replacing any prior values.
9190        pub fn with_request<V: Into<crate::model::ListWorkflowTemplatesRequest>>(
9191            mut self,
9192            v: V,
9193        ) -> Self {
9194            self.0.request = v.into();
9195            self
9196        }
9197
9198        /// Sets all the options, replacing any prior values.
9199        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9200            self.0.options = v.into();
9201            self
9202        }
9203
9204        /// Sends the request.
9205        pub async fn send(self) -> Result<crate::model::ListWorkflowTemplatesResponse> {
9206            (*self.0.stub)
9207                .list_workflow_templates(self.0.request, self.0.options)
9208                .await
9209                .map(crate::Response::into_body)
9210        }
9211
9212        /// Streams each page in the collection.
9213        pub fn by_page(
9214            self,
9215        ) -> impl google_cloud_gax::paginator::Paginator<
9216            crate::model::ListWorkflowTemplatesResponse,
9217            crate::Error,
9218        > {
9219            use std::clone::Clone;
9220            let token = self.0.request.page_token.clone();
9221            let execute = move |token: String| {
9222                let mut builder = self.clone();
9223                builder.0.request = builder.0.request.set_page_token(token);
9224                builder.send()
9225            };
9226            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9227        }
9228
9229        /// Streams each item in the collection.
9230        pub fn by_item(
9231            self,
9232        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9233            crate::model::ListWorkflowTemplatesResponse,
9234            crate::Error,
9235        > {
9236            use google_cloud_gax::paginator::Paginator;
9237            self.by_page().items()
9238        }
9239
9240        /// Sets the value of [parent][crate::model::ListWorkflowTemplatesRequest::parent].
9241        ///
9242        /// This is a **required** field for requests.
9243        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9244            self.0.request.parent = v.into();
9245            self
9246        }
9247
9248        /// Sets the value of [page_size][crate::model::ListWorkflowTemplatesRequest::page_size].
9249        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9250            self.0.request.page_size = v.into();
9251            self
9252        }
9253
9254        /// Sets the value of [page_token][crate::model::ListWorkflowTemplatesRequest::page_token].
9255        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9256            self.0.request.page_token = v.into();
9257            self
9258        }
9259    }
9260
9261    #[doc(hidden)]
9262    impl crate::RequestBuilder for ListWorkflowTemplates {
9263        fn request_options(&mut self) -> &mut crate::RequestOptions {
9264            &mut self.0.options
9265        }
9266    }
9267
9268    /// The request builder for [WorkflowTemplateService::delete_workflow_template][crate::client::WorkflowTemplateService::delete_workflow_template] calls.
9269    ///
9270    /// # Example
9271    /// ```
9272    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::DeleteWorkflowTemplate;
9273    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9274    ///
9275    /// let builder = prepare_request_builder();
9276    /// let response = builder.send().await?;
9277    /// # Ok(()) }
9278    ///
9279    /// fn prepare_request_builder() -> DeleteWorkflowTemplate {
9280    ///   # panic!();
9281    ///   // ... details omitted ...
9282    /// }
9283    /// ```
9284    #[derive(Clone, Debug)]
9285    pub struct DeleteWorkflowTemplate(RequestBuilder<crate::model::DeleteWorkflowTemplateRequest>);
9286
9287    impl DeleteWorkflowTemplate {
9288        pub(crate) fn new(
9289            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9290        ) -> Self {
9291            Self(RequestBuilder::new(stub))
9292        }
9293
9294        /// Sets the full request, replacing any prior values.
9295        pub fn with_request<V: Into<crate::model::DeleteWorkflowTemplateRequest>>(
9296            mut self,
9297            v: V,
9298        ) -> Self {
9299            self.0.request = v.into();
9300            self
9301        }
9302
9303        /// Sets all the options, replacing any prior values.
9304        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9305            self.0.options = v.into();
9306            self
9307        }
9308
9309        /// Sends the request.
9310        pub async fn send(self) -> Result<()> {
9311            (*self.0.stub)
9312                .delete_workflow_template(self.0.request, self.0.options)
9313                .await
9314                .map(crate::Response::into_body)
9315        }
9316
9317        /// Sets the value of [name][crate::model::DeleteWorkflowTemplateRequest::name].
9318        ///
9319        /// This is a **required** field for requests.
9320        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9321            self.0.request.name = v.into();
9322            self
9323        }
9324
9325        /// Sets the value of [version][crate::model::DeleteWorkflowTemplateRequest::version].
9326        pub fn set_version<T: Into<i32>>(mut self, v: T) -> Self {
9327            self.0.request.version = v.into();
9328            self
9329        }
9330    }
9331
9332    #[doc(hidden)]
9333    impl crate::RequestBuilder for DeleteWorkflowTemplate {
9334        fn request_options(&mut self) -> &mut crate::RequestOptions {
9335            &mut self.0.options
9336        }
9337    }
9338
9339    /// The request builder for [WorkflowTemplateService::set_iam_policy][crate::client::WorkflowTemplateService::set_iam_policy] calls.
9340    ///
9341    /// # Example
9342    /// ```
9343    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::SetIamPolicy;
9344    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9345    ///
9346    /// let builder = prepare_request_builder();
9347    /// let response = builder.send().await?;
9348    /// # Ok(()) }
9349    ///
9350    /// fn prepare_request_builder() -> SetIamPolicy {
9351    ///   # panic!();
9352    ///   // ... details omitted ...
9353    /// }
9354    /// ```
9355    #[derive(Clone, Debug)]
9356    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9357
9358    impl SetIamPolicy {
9359        pub(crate) fn new(
9360            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9361        ) -> Self {
9362            Self(RequestBuilder::new(stub))
9363        }
9364
9365        /// Sets the full request, replacing any prior values.
9366        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9367            mut self,
9368            v: V,
9369        ) -> Self {
9370            self.0.request = v.into();
9371            self
9372        }
9373
9374        /// Sets all the options, replacing any prior values.
9375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9376            self.0.options = v.into();
9377            self
9378        }
9379
9380        /// Sends the request.
9381        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9382            (*self.0.stub)
9383                .set_iam_policy(self.0.request, self.0.options)
9384                .await
9385                .map(crate::Response::into_body)
9386        }
9387
9388        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9389        ///
9390        /// This is a **required** field for requests.
9391        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9392            self.0.request.resource = v.into();
9393            self
9394        }
9395
9396        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9397        ///
9398        /// This is a **required** field for requests.
9399        pub fn set_policy<T>(mut self, v: T) -> Self
9400        where
9401            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9402        {
9403            self.0.request.policy = std::option::Option::Some(v.into());
9404            self
9405        }
9406
9407        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9408        ///
9409        /// This is a **required** field for requests.
9410        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9411        where
9412            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9413        {
9414            self.0.request.policy = v.map(|x| x.into());
9415            self
9416        }
9417
9418        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9419        pub fn set_update_mask<T>(mut self, v: T) -> Self
9420        where
9421            T: std::convert::Into<wkt::FieldMask>,
9422        {
9423            self.0.request.update_mask = std::option::Option::Some(v.into());
9424            self
9425        }
9426
9427        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9428        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9429        where
9430            T: std::convert::Into<wkt::FieldMask>,
9431        {
9432            self.0.request.update_mask = v.map(|x| x.into());
9433            self
9434        }
9435    }
9436
9437    #[doc(hidden)]
9438    impl crate::RequestBuilder for SetIamPolicy {
9439        fn request_options(&mut self) -> &mut crate::RequestOptions {
9440            &mut self.0.options
9441        }
9442    }
9443
9444    /// The request builder for [WorkflowTemplateService::get_iam_policy][crate::client::WorkflowTemplateService::get_iam_policy] calls.
9445    ///
9446    /// # Example
9447    /// ```
9448    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::GetIamPolicy;
9449    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9450    ///
9451    /// let builder = prepare_request_builder();
9452    /// let response = builder.send().await?;
9453    /// # Ok(()) }
9454    ///
9455    /// fn prepare_request_builder() -> GetIamPolicy {
9456    ///   # panic!();
9457    ///   // ... details omitted ...
9458    /// }
9459    /// ```
9460    #[derive(Clone, Debug)]
9461    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9462
9463    impl GetIamPolicy {
9464        pub(crate) fn new(
9465            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9466        ) -> Self {
9467            Self(RequestBuilder::new(stub))
9468        }
9469
9470        /// Sets the full request, replacing any prior values.
9471        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9472            mut self,
9473            v: V,
9474        ) -> Self {
9475            self.0.request = v.into();
9476            self
9477        }
9478
9479        /// Sets all the options, replacing any prior values.
9480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9481            self.0.options = v.into();
9482            self
9483        }
9484
9485        /// Sends the request.
9486        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9487            (*self.0.stub)
9488                .get_iam_policy(self.0.request, self.0.options)
9489                .await
9490                .map(crate::Response::into_body)
9491        }
9492
9493        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9494        ///
9495        /// This is a **required** field for requests.
9496        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9497            self.0.request.resource = v.into();
9498            self
9499        }
9500
9501        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9502        pub fn set_options<T>(mut self, v: T) -> Self
9503        where
9504            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9505        {
9506            self.0.request.options = std::option::Option::Some(v.into());
9507            self
9508        }
9509
9510        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9511        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9512        where
9513            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9514        {
9515            self.0.request.options = v.map(|x| x.into());
9516            self
9517        }
9518    }
9519
9520    #[doc(hidden)]
9521    impl crate::RequestBuilder for GetIamPolicy {
9522        fn request_options(&mut self) -> &mut crate::RequestOptions {
9523            &mut self.0.options
9524        }
9525    }
9526
9527    /// The request builder for [WorkflowTemplateService::test_iam_permissions][crate::client::WorkflowTemplateService::test_iam_permissions] calls.
9528    ///
9529    /// # Example
9530    /// ```
9531    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::TestIamPermissions;
9532    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9533    ///
9534    /// let builder = prepare_request_builder();
9535    /// let response = builder.send().await?;
9536    /// # Ok(()) }
9537    ///
9538    /// fn prepare_request_builder() -> TestIamPermissions {
9539    ///   # panic!();
9540    ///   // ... details omitted ...
9541    /// }
9542    /// ```
9543    #[derive(Clone, Debug)]
9544    pub struct TestIamPermissions(
9545        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9546    );
9547
9548    impl TestIamPermissions {
9549        pub(crate) fn new(
9550            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9551        ) -> Self {
9552            Self(RequestBuilder::new(stub))
9553        }
9554
9555        /// Sets the full request, replacing any prior values.
9556        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
9557            mut self,
9558            v: V,
9559        ) -> Self {
9560            self.0.request = v.into();
9561            self
9562        }
9563
9564        /// Sets all the options, replacing any prior values.
9565        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9566            self.0.options = v.into();
9567            self
9568        }
9569
9570        /// Sends the request.
9571        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9572            (*self.0.stub)
9573                .test_iam_permissions(self.0.request, self.0.options)
9574                .await
9575                .map(crate::Response::into_body)
9576        }
9577
9578        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
9579        ///
9580        /// This is a **required** field for requests.
9581        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9582            self.0.request.resource = v.into();
9583            self
9584        }
9585
9586        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
9587        ///
9588        /// This is a **required** field for requests.
9589        pub fn set_permissions<T, V>(mut self, v: T) -> Self
9590        where
9591            T: std::iter::IntoIterator<Item = V>,
9592            V: std::convert::Into<std::string::String>,
9593        {
9594            use std::iter::Iterator;
9595            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9596            self
9597        }
9598    }
9599
9600    #[doc(hidden)]
9601    impl crate::RequestBuilder for TestIamPermissions {
9602        fn request_options(&mut self) -> &mut crate::RequestOptions {
9603            &mut self.0.options
9604        }
9605    }
9606
9607    /// The request builder for [WorkflowTemplateService::list_operations][crate::client::WorkflowTemplateService::list_operations] calls.
9608    ///
9609    /// # Example
9610    /// ```
9611    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::ListOperations;
9612    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9613    /// use google_cloud_gax::paginator::ItemPaginator;
9614    ///
9615    /// let builder = prepare_request_builder();
9616    /// let mut items = builder.by_item();
9617    /// while let Some(result) = items.next().await {
9618    ///   let item = result?;
9619    /// }
9620    /// # Ok(()) }
9621    ///
9622    /// fn prepare_request_builder() -> ListOperations {
9623    ///   # panic!();
9624    ///   // ... details omitted ...
9625    /// }
9626    /// ```
9627    #[derive(Clone, Debug)]
9628    pub struct ListOperations(
9629        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9630    );
9631
9632    impl ListOperations {
9633        pub(crate) fn new(
9634            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9635        ) -> Self {
9636            Self(RequestBuilder::new(stub))
9637        }
9638
9639        /// Sets the full request, replacing any prior values.
9640        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9641            mut self,
9642            v: V,
9643        ) -> Self {
9644            self.0.request = v.into();
9645            self
9646        }
9647
9648        /// Sets all the options, replacing any prior values.
9649        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9650            self.0.options = v.into();
9651            self
9652        }
9653
9654        /// Sends the request.
9655        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9656            (*self.0.stub)
9657                .list_operations(self.0.request, self.0.options)
9658                .await
9659                .map(crate::Response::into_body)
9660        }
9661
9662        /// Streams each page in the collection.
9663        pub fn by_page(
9664            self,
9665        ) -> impl google_cloud_gax::paginator::Paginator<
9666            google_cloud_longrunning::model::ListOperationsResponse,
9667            crate::Error,
9668        > {
9669            use std::clone::Clone;
9670            let token = self.0.request.page_token.clone();
9671            let execute = move |token: String| {
9672                let mut builder = self.clone();
9673                builder.0.request = builder.0.request.set_page_token(token);
9674                builder.send()
9675            };
9676            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9677        }
9678
9679        /// Streams each item in the collection.
9680        pub fn by_item(
9681            self,
9682        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9683            google_cloud_longrunning::model::ListOperationsResponse,
9684            crate::Error,
9685        > {
9686            use google_cloud_gax::paginator::Paginator;
9687            self.by_page().items()
9688        }
9689
9690        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9691        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9692            self.0.request.name = v.into();
9693            self
9694        }
9695
9696        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9697        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9698            self.0.request.filter = v.into();
9699            self
9700        }
9701
9702        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9703        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9704            self.0.request.page_size = v.into();
9705            self
9706        }
9707
9708        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9709        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9710            self.0.request.page_token = v.into();
9711            self
9712        }
9713
9714        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9715        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9716            self.0.request.return_partial_success = v.into();
9717            self
9718        }
9719    }
9720
9721    #[doc(hidden)]
9722    impl crate::RequestBuilder for ListOperations {
9723        fn request_options(&mut self) -> &mut crate::RequestOptions {
9724            &mut self.0.options
9725        }
9726    }
9727
9728    /// The request builder for [WorkflowTemplateService::get_operation][crate::client::WorkflowTemplateService::get_operation] calls.
9729    ///
9730    /// # Example
9731    /// ```
9732    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::GetOperation;
9733    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9734    ///
9735    /// let builder = prepare_request_builder();
9736    /// let response = builder.send().await?;
9737    /// # Ok(()) }
9738    ///
9739    /// fn prepare_request_builder() -> GetOperation {
9740    ///   # panic!();
9741    ///   // ... details omitted ...
9742    /// }
9743    /// ```
9744    #[derive(Clone, Debug)]
9745    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9746
9747    impl GetOperation {
9748        pub(crate) fn new(
9749            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9750        ) -> Self {
9751            Self(RequestBuilder::new(stub))
9752        }
9753
9754        /// Sets the full request, replacing any prior values.
9755        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9756            mut self,
9757            v: V,
9758        ) -> Self {
9759            self.0.request = v.into();
9760            self
9761        }
9762
9763        /// Sets all the options, replacing any prior values.
9764        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9765            self.0.options = v.into();
9766            self
9767        }
9768
9769        /// Sends the request.
9770        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9771            (*self.0.stub)
9772                .get_operation(self.0.request, self.0.options)
9773                .await
9774                .map(crate::Response::into_body)
9775        }
9776
9777        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9778        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9779            self.0.request.name = v.into();
9780            self
9781        }
9782    }
9783
9784    #[doc(hidden)]
9785    impl crate::RequestBuilder for GetOperation {
9786        fn request_options(&mut self) -> &mut crate::RequestOptions {
9787            &mut self.0.options
9788        }
9789    }
9790
9791    /// The request builder for [WorkflowTemplateService::delete_operation][crate::client::WorkflowTemplateService::delete_operation] calls.
9792    ///
9793    /// # Example
9794    /// ```
9795    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::DeleteOperation;
9796    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9797    ///
9798    /// let builder = prepare_request_builder();
9799    /// let response = builder.send().await?;
9800    /// # Ok(()) }
9801    ///
9802    /// fn prepare_request_builder() -> DeleteOperation {
9803    ///   # panic!();
9804    ///   // ... details omitted ...
9805    /// }
9806    /// ```
9807    #[derive(Clone, Debug)]
9808    pub struct DeleteOperation(
9809        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
9810    );
9811
9812    impl DeleteOperation {
9813        pub(crate) fn new(
9814            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9815        ) -> Self {
9816            Self(RequestBuilder::new(stub))
9817        }
9818
9819        /// Sets the full request, replacing any prior values.
9820        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
9821            mut self,
9822            v: V,
9823        ) -> Self {
9824            self.0.request = v.into();
9825            self
9826        }
9827
9828        /// Sets all the options, replacing any prior values.
9829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9830            self.0.options = v.into();
9831            self
9832        }
9833
9834        /// Sends the request.
9835        pub async fn send(self) -> Result<()> {
9836            (*self.0.stub)
9837                .delete_operation(self.0.request, self.0.options)
9838                .await
9839                .map(crate::Response::into_body)
9840        }
9841
9842        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
9843        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9844            self.0.request.name = v.into();
9845            self
9846        }
9847    }
9848
9849    #[doc(hidden)]
9850    impl crate::RequestBuilder for DeleteOperation {
9851        fn request_options(&mut self) -> &mut crate::RequestOptions {
9852            &mut self.0.options
9853        }
9854    }
9855
9856    /// The request builder for [WorkflowTemplateService::cancel_operation][crate::client::WorkflowTemplateService::cancel_operation] calls.
9857    ///
9858    /// # Example
9859    /// ```
9860    /// # use google_cloud_dataproc_v1::builder::workflow_template_service::CancelOperation;
9861    /// # async fn sample() -> google_cloud_dataproc_v1::Result<()> {
9862    ///
9863    /// let builder = prepare_request_builder();
9864    /// let response = builder.send().await?;
9865    /// # Ok(()) }
9866    ///
9867    /// fn prepare_request_builder() -> CancelOperation {
9868    ///   # panic!();
9869    ///   // ... details omitted ...
9870    /// }
9871    /// ```
9872    #[derive(Clone, Debug)]
9873    pub struct CancelOperation(
9874        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9875    );
9876
9877    impl CancelOperation {
9878        pub(crate) fn new(
9879            stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkflowTemplateService>,
9880        ) -> Self {
9881            Self(RequestBuilder::new(stub))
9882        }
9883
9884        /// Sets the full request, replacing any prior values.
9885        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9886            mut self,
9887            v: V,
9888        ) -> Self {
9889            self.0.request = v.into();
9890            self
9891        }
9892
9893        /// Sets all the options, replacing any prior values.
9894        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9895            self.0.options = v.into();
9896            self
9897        }
9898
9899        /// Sends the request.
9900        pub async fn send(self) -> Result<()> {
9901            (*self.0.stub)
9902                .cancel_operation(self.0.request, self.0.options)
9903                .await
9904                .map(crate::Response::into_body)
9905        }
9906
9907        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
9908        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9909            self.0.request.name = v.into();
9910            self
9911        }
9912    }
9913
9914    #[doc(hidden)]
9915    impl crate::RequestBuilder for CancelOperation {
9916        fn request_options(&mut self) -> &mut crate::RequestOptions {
9917            &mut self.0.options
9918        }
9919    }
9920}