Skip to main content

google_cloud_functions_v2/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [FunctionService][crate::client::FunctionService].
18pub mod function_service {
19    use crate::Result;
20
21    /// A builder for [FunctionService][crate::client::FunctionService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_functions_v2::*;
26    /// # use builder::function_service::ClientBuilder;
27    /// # use client::FunctionService;
28    /// let builder : ClientBuilder = FunctionService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://cloudfunctions.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::FunctionService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = FunctionService;
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::FunctionService] 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::FunctionService>,
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::FunctionService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [FunctionService::get_function][crate::client::FunctionService::get_function] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_functions_v2::builder::function_service::GetFunction;
79    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetFunction {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetFunction(RequestBuilder<crate::model::GetFunctionRequest>);
92
93    impl GetFunction {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
96        ) -> Self {
97            Self(RequestBuilder::new(stub))
98        }
99
100        /// Sets the full request, replacing any prior values.
101        pub fn with_request<V: Into<crate::model::GetFunctionRequest>>(mut self, v: V) -> Self {
102            self.0.request = v.into();
103            self
104        }
105
106        /// Sets all the options, replacing any prior values.
107        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108            self.0.options = v.into();
109            self
110        }
111
112        /// Sends the request.
113        pub async fn send(self) -> Result<crate::model::Function> {
114            (*self.0.stub)
115                .get_function(self.0.request, self.0.options)
116                .await
117                .map(crate::Response::into_body)
118        }
119
120        /// Sets the value of [name][crate::model::GetFunctionRequest::name].
121        ///
122        /// This is a **required** field for requests.
123        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
124            self.0.request.name = v.into();
125            self
126        }
127
128        /// Sets the value of [revision][crate::model::GetFunctionRequest::revision].
129        pub fn set_revision<T: Into<std::string::String>>(mut self, v: T) -> Self {
130            self.0.request.revision = v.into();
131            self
132        }
133    }
134
135    #[doc(hidden)]
136    impl crate::RequestBuilder for GetFunction {
137        fn request_options(&mut self) -> &mut crate::RequestOptions {
138            &mut self.0.options
139        }
140    }
141
142    /// The request builder for [FunctionService::list_functions][crate::client::FunctionService::list_functions] calls.
143    ///
144    /// # Example
145    /// ```
146    /// # use google_cloud_functions_v2::builder::function_service::ListFunctions;
147    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
148    /// use google_cloud_gax::paginator::ItemPaginator;
149    ///
150    /// let builder = prepare_request_builder();
151    /// let mut items = builder.by_item();
152    /// while let Some(result) = items.next().await {
153    ///   let item = result?;
154    /// }
155    /// # Ok(()) }
156    ///
157    /// fn prepare_request_builder() -> ListFunctions {
158    ///   # panic!();
159    ///   // ... details omitted ...
160    /// }
161    /// ```
162    #[derive(Clone, Debug)]
163    pub struct ListFunctions(RequestBuilder<crate::model::ListFunctionsRequest>);
164
165    impl ListFunctions {
166        pub(crate) fn new(
167            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
168        ) -> Self {
169            Self(RequestBuilder::new(stub))
170        }
171
172        /// Sets the full request, replacing any prior values.
173        pub fn with_request<V: Into<crate::model::ListFunctionsRequest>>(mut self, v: V) -> Self {
174            self.0.request = v.into();
175            self
176        }
177
178        /// Sets all the options, replacing any prior values.
179        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
180            self.0.options = v.into();
181            self
182        }
183
184        /// Sends the request.
185        pub async fn send(self) -> Result<crate::model::ListFunctionsResponse> {
186            (*self.0.stub)
187                .list_functions(self.0.request, self.0.options)
188                .await
189                .map(crate::Response::into_body)
190        }
191
192        /// Streams each page in the collection.
193        pub fn by_page(
194            self,
195        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFunctionsResponse, crate::Error>
196        {
197            use std::clone::Clone;
198            let token = self.0.request.page_token.clone();
199            let execute = move |token: String| {
200                let mut builder = self.clone();
201                builder.0.request = builder.0.request.set_page_token(token);
202                builder.send()
203            };
204            google_cloud_gax::paginator::internal::new_paginator(token, execute)
205        }
206
207        /// Streams each item in the collection.
208        pub fn by_item(
209            self,
210        ) -> impl google_cloud_gax::paginator::ItemPaginator<
211            crate::model::ListFunctionsResponse,
212            crate::Error,
213        > {
214            use google_cloud_gax::paginator::Paginator;
215            self.by_page().items()
216        }
217
218        /// Sets the value of [parent][crate::model::ListFunctionsRequest::parent].
219        ///
220        /// This is a **required** field for requests.
221        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
222            self.0.request.parent = v.into();
223            self
224        }
225
226        /// Sets the value of [page_size][crate::model::ListFunctionsRequest::page_size].
227        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
228            self.0.request.page_size = v.into();
229            self
230        }
231
232        /// Sets the value of [page_token][crate::model::ListFunctionsRequest::page_token].
233        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
234            self.0.request.page_token = v.into();
235            self
236        }
237
238        /// Sets the value of [filter][crate::model::ListFunctionsRequest::filter].
239        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.filter = v.into();
241            self
242        }
243
244        /// Sets the value of [order_by][crate::model::ListFunctionsRequest::order_by].
245        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
246            self.0.request.order_by = v.into();
247            self
248        }
249    }
250
251    #[doc(hidden)]
252    impl crate::RequestBuilder for ListFunctions {
253        fn request_options(&mut self) -> &mut crate::RequestOptions {
254            &mut self.0.options
255        }
256    }
257
258    /// The request builder for [FunctionService::create_function][crate::client::FunctionService::create_function] calls.
259    ///
260    /// # Example
261    /// ```
262    /// # use google_cloud_functions_v2::builder::function_service::CreateFunction;
263    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
264    /// use google_cloud_lro::Poller;
265    ///
266    /// let builder = prepare_request_builder();
267    /// let response = builder.poller().until_done().await?;
268    /// # Ok(()) }
269    ///
270    /// fn prepare_request_builder() -> CreateFunction {
271    ///   # panic!();
272    ///   // ... details omitted ...
273    /// }
274    /// ```
275    #[derive(Clone, Debug)]
276    pub struct CreateFunction(RequestBuilder<crate::model::CreateFunctionRequest>);
277
278    impl CreateFunction {
279        pub(crate) fn new(
280            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
281        ) -> Self {
282            Self(RequestBuilder::new(stub))
283        }
284
285        /// Sets the full request, replacing any prior values.
286        pub fn with_request<V: Into<crate::model::CreateFunctionRequest>>(mut self, v: V) -> Self {
287            self.0.request = v.into();
288            self
289        }
290
291        /// Sets all the options, replacing any prior values.
292        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
293            self.0.options = v.into();
294            self
295        }
296
297        /// Sends the request.
298        ///
299        /// # Long running operations
300        ///
301        /// This starts, but does not poll, a longrunning operation. More information
302        /// on [create_function][crate::client::FunctionService::create_function].
303        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
304            (*self.0.stub)
305                .create_function(self.0.request, self.0.options)
306                .await
307                .map(crate::Response::into_body)
308        }
309
310        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_function`.
311        pub fn poller(
312            self,
313        ) -> impl google_cloud_lro::Poller<crate::model::Function, crate::model::OperationMetadata>
314        {
315            type Operation = google_cloud_lro::internal::Operation<
316                crate::model::Function,
317                crate::model::OperationMetadata,
318            >;
319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
321
322            let stub = self.0.stub.clone();
323            let mut options = self.0.options.clone();
324            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
325            let query = move |name| {
326                let stub = stub.clone();
327                let options = options.clone();
328                async {
329                    let op = GetOperation::new(stub)
330                        .set_name(name)
331                        .with_options(options)
332                        .send()
333                        .await?;
334                    Ok(Operation::new(op))
335                }
336            };
337
338            let start = move || async {
339                let op = self.send().await?;
340                Ok(Operation::new(op))
341            };
342
343            google_cloud_lro::internal::new_poller(
344                polling_error_policy,
345                polling_backoff_policy,
346                start,
347                query,
348            )
349        }
350
351        /// Sets the value of [parent][crate::model::CreateFunctionRequest::parent].
352        ///
353        /// This is a **required** field for requests.
354        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
355            self.0.request.parent = v.into();
356            self
357        }
358
359        /// Sets the value of [function][crate::model::CreateFunctionRequest::function].
360        ///
361        /// This is a **required** field for requests.
362        pub fn set_function<T>(mut self, v: T) -> Self
363        where
364            T: std::convert::Into<crate::model::Function>,
365        {
366            self.0.request.function = std::option::Option::Some(v.into());
367            self
368        }
369
370        /// Sets or clears the value of [function][crate::model::CreateFunctionRequest::function].
371        ///
372        /// This is a **required** field for requests.
373        pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
374        where
375            T: std::convert::Into<crate::model::Function>,
376        {
377            self.0.request.function = v.map(|x| x.into());
378            self
379        }
380
381        /// Sets the value of [function_id][crate::model::CreateFunctionRequest::function_id].
382        pub fn set_function_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
383            self.0.request.function_id = v.into();
384            self
385        }
386    }
387
388    #[doc(hidden)]
389    impl crate::RequestBuilder for CreateFunction {
390        fn request_options(&mut self) -> &mut crate::RequestOptions {
391            &mut self.0.options
392        }
393    }
394
395    /// The request builder for [FunctionService::update_function][crate::client::FunctionService::update_function] calls.
396    ///
397    /// # Example
398    /// ```
399    /// # use google_cloud_functions_v2::builder::function_service::UpdateFunction;
400    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
401    /// use google_cloud_lro::Poller;
402    ///
403    /// let builder = prepare_request_builder();
404    /// let response = builder.poller().until_done().await?;
405    /// # Ok(()) }
406    ///
407    /// fn prepare_request_builder() -> UpdateFunction {
408    ///   # panic!();
409    ///   // ... details omitted ...
410    /// }
411    /// ```
412    #[derive(Clone, Debug)]
413    pub struct UpdateFunction(RequestBuilder<crate::model::UpdateFunctionRequest>);
414
415    impl UpdateFunction {
416        pub(crate) fn new(
417            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
418        ) -> Self {
419            Self(RequestBuilder::new(stub))
420        }
421
422        /// Sets the full request, replacing any prior values.
423        pub fn with_request<V: Into<crate::model::UpdateFunctionRequest>>(mut self, v: V) -> Self {
424            self.0.request = v.into();
425            self
426        }
427
428        /// Sets all the options, replacing any prior values.
429        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
430            self.0.options = v.into();
431            self
432        }
433
434        /// Sends the request.
435        ///
436        /// # Long running operations
437        ///
438        /// This starts, but does not poll, a longrunning operation. More information
439        /// on [update_function][crate::client::FunctionService::update_function].
440        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
441            (*self.0.stub)
442                .update_function(self.0.request, self.0.options)
443                .await
444                .map(crate::Response::into_body)
445        }
446
447        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_function`.
448        pub fn poller(
449            self,
450        ) -> impl google_cloud_lro::Poller<crate::model::Function, crate::model::OperationMetadata>
451        {
452            type Operation = google_cloud_lro::internal::Operation<
453                crate::model::Function,
454                crate::model::OperationMetadata,
455            >;
456            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458
459            let stub = self.0.stub.clone();
460            let mut options = self.0.options.clone();
461            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
462            let query = move |name| {
463                let stub = stub.clone();
464                let options = options.clone();
465                async {
466                    let op = GetOperation::new(stub)
467                        .set_name(name)
468                        .with_options(options)
469                        .send()
470                        .await?;
471                    Ok(Operation::new(op))
472                }
473            };
474
475            let start = move || async {
476                let op = self.send().await?;
477                Ok(Operation::new(op))
478            };
479
480            google_cloud_lro::internal::new_poller(
481                polling_error_policy,
482                polling_backoff_policy,
483                start,
484                query,
485            )
486        }
487
488        /// Sets the value of [function][crate::model::UpdateFunctionRequest::function].
489        ///
490        /// This is a **required** field for requests.
491        pub fn set_function<T>(mut self, v: T) -> Self
492        where
493            T: std::convert::Into<crate::model::Function>,
494        {
495            self.0.request.function = std::option::Option::Some(v.into());
496            self
497        }
498
499        /// Sets or clears the value of [function][crate::model::UpdateFunctionRequest::function].
500        ///
501        /// This is a **required** field for requests.
502        pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
503        where
504            T: std::convert::Into<crate::model::Function>,
505        {
506            self.0.request.function = v.map(|x| x.into());
507            self
508        }
509
510        /// Sets the value of [update_mask][crate::model::UpdateFunctionRequest::update_mask].
511        pub fn set_update_mask<T>(mut self, v: T) -> Self
512        where
513            T: std::convert::Into<wkt::FieldMask>,
514        {
515            self.0.request.update_mask = std::option::Option::Some(v.into());
516            self
517        }
518
519        /// Sets or clears the value of [update_mask][crate::model::UpdateFunctionRequest::update_mask].
520        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
521        where
522            T: std::convert::Into<wkt::FieldMask>,
523        {
524            self.0.request.update_mask = v.map(|x| x.into());
525            self
526        }
527    }
528
529    #[doc(hidden)]
530    impl crate::RequestBuilder for UpdateFunction {
531        fn request_options(&mut self) -> &mut crate::RequestOptions {
532            &mut self.0.options
533        }
534    }
535
536    /// The request builder for [FunctionService::delete_function][crate::client::FunctionService::delete_function] calls.
537    ///
538    /// # Example
539    /// ```
540    /// # use google_cloud_functions_v2::builder::function_service::DeleteFunction;
541    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
542    /// use google_cloud_lro::Poller;
543    ///
544    /// let builder = prepare_request_builder();
545    /// let response = builder.poller().until_done().await?;
546    /// # Ok(()) }
547    ///
548    /// fn prepare_request_builder() -> DeleteFunction {
549    ///   # panic!();
550    ///   // ... details omitted ...
551    /// }
552    /// ```
553    #[derive(Clone, Debug)]
554    pub struct DeleteFunction(RequestBuilder<crate::model::DeleteFunctionRequest>);
555
556    impl DeleteFunction {
557        pub(crate) fn new(
558            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
559        ) -> Self {
560            Self(RequestBuilder::new(stub))
561        }
562
563        /// Sets the full request, replacing any prior values.
564        pub fn with_request<V: Into<crate::model::DeleteFunctionRequest>>(mut self, v: V) -> Self {
565            self.0.request = v.into();
566            self
567        }
568
569        /// Sets all the options, replacing any prior values.
570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
571            self.0.options = v.into();
572            self
573        }
574
575        /// Sends the request.
576        ///
577        /// # Long running operations
578        ///
579        /// This starts, but does not poll, a longrunning operation. More information
580        /// on [delete_function][crate::client::FunctionService::delete_function].
581        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
582            (*self.0.stub)
583                .delete_function(self.0.request, self.0.options)
584                .await
585                .map(crate::Response::into_body)
586        }
587
588        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_function`.
589        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
590            type Operation =
591                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
592            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
593            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
594
595            let stub = self.0.stub.clone();
596            let mut options = self.0.options.clone();
597            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
598            let query = move |name| {
599                let stub = stub.clone();
600                let options = options.clone();
601                async {
602                    let op = GetOperation::new(stub)
603                        .set_name(name)
604                        .with_options(options)
605                        .send()
606                        .await?;
607                    Ok(Operation::new(op))
608                }
609            };
610
611            let start = move || async {
612                let op = self.send().await?;
613                Ok(Operation::new(op))
614            };
615
616            google_cloud_lro::internal::new_unit_response_poller(
617                polling_error_policy,
618                polling_backoff_policy,
619                start,
620                query,
621            )
622        }
623
624        /// Sets the value of [name][crate::model::DeleteFunctionRequest::name].
625        ///
626        /// This is a **required** field for requests.
627        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
628            self.0.request.name = v.into();
629            self
630        }
631    }
632
633    #[doc(hidden)]
634    impl crate::RequestBuilder for DeleteFunction {
635        fn request_options(&mut self) -> &mut crate::RequestOptions {
636            &mut self.0.options
637        }
638    }
639
640    /// The request builder for [FunctionService::generate_upload_url][crate::client::FunctionService::generate_upload_url] calls.
641    ///
642    /// # Example
643    /// ```
644    /// # use google_cloud_functions_v2::builder::function_service::GenerateUploadUrl;
645    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
646    ///
647    /// let builder = prepare_request_builder();
648    /// let response = builder.send().await?;
649    /// # Ok(()) }
650    ///
651    /// fn prepare_request_builder() -> GenerateUploadUrl {
652    ///   # panic!();
653    ///   // ... details omitted ...
654    /// }
655    /// ```
656    #[derive(Clone, Debug)]
657    pub struct GenerateUploadUrl(RequestBuilder<crate::model::GenerateUploadUrlRequest>);
658
659    impl GenerateUploadUrl {
660        pub(crate) fn new(
661            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
662        ) -> Self {
663            Self(RequestBuilder::new(stub))
664        }
665
666        /// Sets the full request, replacing any prior values.
667        pub fn with_request<V: Into<crate::model::GenerateUploadUrlRequest>>(
668            mut self,
669            v: V,
670        ) -> Self {
671            self.0.request = v.into();
672            self
673        }
674
675        /// Sets all the options, replacing any prior values.
676        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
677            self.0.options = v.into();
678            self
679        }
680
681        /// Sends the request.
682        pub async fn send(self) -> Result<crate::model::GenerateUploadUrlResponse> {
683            (*self.0.stub)
684                .generate_upload_url(self.0.request, self.0.options)
685                .await
686                .map(crate::Response::into_body)
687        }
688
689        /// Sets the value of [parent][crate::model::GenerateUploadUrlRequest::parent].
690        ///
691        /// This is a **required** field for requests.
692        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
693            self.0.request.parent = v.into();
694            self
695        }
696
697        /// Sets the value of [kms_key_name][crate::model::GenerateUploadUrlRequest::kms_key_name].
698        pub fn set_kms_key_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
699            self.0.request.kms_key_name = v.into();
700            self
701        }
702
703        /// Sets the value of [environment][crate::model::GenerateUploadUrlRequest::environment].
704        pub fn set_environment<T: Into<crate::model::Environment>>(mut self, v: T) -> Self {
705            self.0.request.environment = v.into();
706            self
707        }
708    }
709
710    #[doc(hidden)]
711    impl crate::RequestBuilder for GenerateUploadUrl {
712        fn request_options(&mut self) -> &mut crate::RequestOptions {
713            &mut self.0.options
714        }
715    }
716
717    /// The request builder for [FunctionService::generate_download_url][crate::client::FunctionService::generate_download_url] calls.
718    ///
719    /// # Example
720    /// ```
721    /// # use google_cloud_functions_v2::builder::function_service::GenerateDownloadUrl;
722    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
723    ///
724    /// let builder = prepare_request_builder();
725    /// let response = builder.send().await?;
726    /// # Ok(()) }
727    ///
728    /// fn prepare_request_builder() -> GenerateDownloadUrl {
729    ///   # panic!();
730    ///   // ... details omitted ...
731    /// }
732    /// ```
733    #[derive(Clone, Debug)]
734    pub struct GenerateDownloadUrl(RequestBuilder<crate::model::GenerateDownloadUrlRequest>);
735
736    impl GenerateDownloadUrl {
737        pub(crate) fn new(
738            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
739        ) -> Self {
740            Self(RequestBuilder::new(stub))
741        }
742
743        /// Sets the full request, replacing any prior values.
744        pub fn with_request<V: Into<crate::model::GenerateDownloadUrlRequest>>(
745            mut self,
746            v: V,
747        ) -> Self {
748            self.0.request = v.into();
749            self
750        }
751
752        /// Sets all the options, replacing any prior values.
753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
754            self.0.options = v.into();
755            self
756        }
757
758        /// Sends the request.
759        pub async fn send(self) -> Result<crate::model::GenerateDownloadUrlResponse> {
760            (*self.0.stub)
761                .generate_download_url(self.0.request, self.0.options)
762                .await
763                .map(crate::Response::into_body)
764        }
765
766        /// Sets the value of [name][crate::model::GenerateDownloadUrlRequest::name].
767        ///
768        /// This is a **required** field for requests.
769        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
770            self.0.request.name = v.into();
771            self
772        }
773    }
774
775    #[doc(hidden)]
776    impl crate::RequestBuilder for GenerateDownloadUrl {
777        fn request_options(&mut self) -> &mut crate::RequestOptions {
778            &mut self.0.options
779        }
780    }
781
782    /// The request builder for [FunctionService::list_runtimes][crate::client::FunctionService::list_runtimes] calls.
783    ///
784    /// # Example
785    /// ```
786    /// # use google_cloud_functions_v2::builder::function_service::ListRuntimes;
787    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
788    ///
789    /// let builder = prepare_request_builder();
790    /// let response = builder.send().await?;
791    /// # Ok(()) }
792    ///
793    /// fn prepare_request_builder() -> ListRuntimes {
794    ///   # panic!();
795    ///   // ... details omitted ...
796    /// }
797    /// ```
798    #[derive(Clone, Debug)]
799    pub struct ListRuntimes(RequestBuilder<crate::model::ListRuntimesRequest>);
800
801    impl ListRuntimes {
802        pub(crate) fn new(
803            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
804        ) -> Self {
805            Self(RequestBuilder::new(stub))
806        }
807
808        /// Sets the full request, replacing any prior values.
809        pub fn with_request<V: Into<crate::model::ListRuntimesRequest>>(mut self, v: V) -> Self {
810            self.0.request = v.into();
811            self
812        }
813
814        /// Sets all the options, replacing any prior values.
815        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
816            self.0.options = v.into();
817            self
818        }
819
820        /// Sends the request.
821        pub async fn send(self) -> Result<crate::model::ListRuntimesResponse> {
822            (*self.0.stub)
823                .list_runtimes(self.0.request, self.0.options)
824                .await
825                .map(crate::Response::into_body)
826        }
827
828        /// Sets the value of [parent][crate::model::ListRuntimesRequest::parent].
829        ///
830        /// This is a **required** field for requests.
831        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
832            self.0.request.parent = v.into();
833            self
834        }
835
836        /// Sets the value of [filter][crate::model::ListRuntimesRequest::filter].
837        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
838            self.0.request.filter = v.into();
839            self
840        }
841    }
842
843    #[doc(hidden)]
844    impl crate::RequestBuilder for ListRuntimes {
845        fn request_options(&mut self) -> &mut crate::RequestOptions {
846            &mut self.0.options
847        }
848    }
849
850    /// The request builder for [FunctionService::list_locations][crate::client::FunctionService::list_locations] calls.
851    ///
852    /// # Example
853    /// ```
854    /// # use google_cloud_functions_v2::builder::function_service::ListLocations;
855    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
856    /// use google_cloud_gax::paginator::ItemPaginator;
857    ///
858    /// let builder = prepare_request_builder();
859    /// let mut items = builder.by_item();
860    /// while let Some(result) = items.next().await {
861    ///   let item = result?;
862    /// }
863    /// # Ok(()) }
864    ///
865    /// fn prepare_request_builder() -> ListLocations {
866    ///   # panic!();
867    ///   // ... details omitted ...
868    /// }
869    /// ```
870    #[derive(Clone, Debug)]
871    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
872
873    impl ListLocations {
874        pub(crate) fn new(
875            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
876        ) -> Self {
877            Self(RequestBuilder::new(stub))
878        }
879
880        /// Sets the full request, replacing any prior values.
881        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
882            mut self,
883            v: V,
884        ) -> Self {
885            self.0.request = v.into();
886            self
887        }
888
889        /// Sets all the options, replacing any prior values.
890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
891            self.0.options = v.into();
892            self
893        }
894
895        /// Sends the request.
896        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
897            (*self.0.stub)
898                .list_locations(self.0.request, self.0.options)
899                .await
900                .map(crate::Response::into_body)
901        }
902
903        /// Streams each page in the collection.
904        pub fn by_page(
905            self,
906        ) -> impl google_cloud_gax::paginator::Paginator<
907            google_cloud_location::model::ListLocationsResponse,
908            crate::Error,
909        > {
910            use std::clone::Clone;
911            let token = self.0.request.page_token.clone();
912            let execute = move |token: String| {
913                let mut builder = self.clone();
914                builder.0.request = builder.0.request.set_page_token(token);
915                builder.send()
916            };
917            google_cloud_gax::paginator::internal::new_paginator(token, execute)
918        }
919
920        /// Streams each item in the collection.
921        pub fn by_item(
922            self,
923        ) -> impl google_cloud_gax::paginator::ItemPaginator<
924            google_cloud_location::model::ListLocationsResponse,
925            crate::Error,
926        > {
927            use google_cloud_gax::paginator::Paginator;
928            self.by_page().items()
929        }
930
931        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
932        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
933            self.0.request.name = v.into();
934            self
935        }
936
937        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
938        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
939            self.0.request.filter = v.into();
940            self
941        }
942
943        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
944        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
945            self.0.request.page_size = v.into();
946            self
947        }
948
949        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
950        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
951            self.0.request.page_token = v.into();
952            self
953        }
954    }
955
956    #[doc(hidden)]
957    impl crate::RequestBuilder for ListLocations {
958        fn request_options(&mut self) -> &mut crate::RequestOptions {
959            &mut self.0.options
960        }
961    }
962
963    /// The request builder for [FunctionService::set_iam_policy][crate::client::FunctionService::set_iam_policy] calls.
964    ///
965    /// # Example
966    /// ```
967    /// # use google_cloud_functions_v2::builder::function_service::SetIamPolicy;
968    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
969    ///
970    /// let builder = prepare_request_builder();
971    /// let response = builder.send().await?;
972    /// # Ok(()) }
973    ///
974    /// fn prepare_request_builder() -> SetIamPolicy {
975    ///   # panic!();
976    ///   // ... details omitted ...
977    /// }
978    /// ```
979    #[derive(Clone, Debug)]
980    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
981
982    impl SetIamPolicy {
983        pub(crate) fn new(
984            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
985        ) -> Self {
986            Self(RequestBuilder::new(stub))
987        }
988
989        /// Sets the full request, replacing any prior values.
990        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
991            mut self,
992            v: V,
993        ) -> Self {
994            self.0.request = v.into();
995            self
996        }
997
998        /// Sets all the options, replacing any prior values.
999        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1000            self.0.options = v.into();
1001            self
1002        }
1003
1004        /// Sends the request.
1005        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1006            (*self.0.stub)
1007                .set_iam_policy(self.0.request, self.0.options)
1008                .await
1009                .map(crate::Response::into_body)
1010        }
1011
1012        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1013        ///
1014        /// This is a **required** field for requests.
1015        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1016            self.0.request.resource = v.into();
1017            self
1018        }
1019
1020        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1021        ///
1022        /// This is a **required** field for requests.
1023        pub fn set_policy<T>(mut self, v: T) -> Self
1024        where
1025            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1026        {
1027            self.0.request.policy = std::option::Option::Some(v.into());
1028            self
1029        }
1030
1031        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1032        ///
1033        /// This is a **required** field for requests.
1034        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1035        where
1036            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1037        {
1038            self.0.request.policy = v.map(|x| x.into());
1039            self
1040        }
1041
1042        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1043        pub fn set_update_mask<T>(mut self, v: T) -> Self
1044        where
1045            T: std::convert::Into<wkt::FieldMask>,
1046        {
1047            self.0.request.update_mask = std::option::Option::Some(v.into());
1048            self
1049        }
1050
1051        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1052        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1053        where
1054            T: std::convert::Into<wkt::FieldMask>,
1055        {
1056            self.0.request.update_mask = v.map(|x| x.into());
1057            self
1058        }
1059    }
1060
1061    #[doc(hidden)]
1062    impl crate::RequestBuilder for SetIamPolicy {
1063        fn request_options(&mut self) -> &mut crate::RequestOptions {
1064            &mut self.0.options
1065        }
1066    }
1067
1068    /// The request builder for [FunctionService::get_iam_policy][crate::client::FunctionService::get_iam_policy] calls.
1069    ///
1070    /// # Example
1071    /// ```
1072    /// # use google_cloud_functions_v2::builder::function_service::GetIamPolicy;
1073    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
1074    ///
1075    /// let builder = prepare_request_builder();
1076    /// let response = builder.send().await?;
1077    /// # Ok(()) }
1078    ///
1079    /// fn prepare_request_builder() -> GetIamPolicy {
1080    ///   # panic!();
1081    ///   // ... details omitted ...
1082    /// }
1083    /// ```
1084    #[derive(Clone, Debug)]
1085    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1086
1087    impl GetIamPolicy {
1088        pub(crate) fn new(
1089            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1090        ) -> Self {
1091            Self(RequestBuilder::new(stub))
1092        }
1093
1094        /// Sets the full request, replacing any prior values.
1095        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1096            mut self,
1097            v: V,
1098        ) -> Self {
1099            self.0.request = v.into();
1100            self
1101        }
1102
1103        /// Sets all the options, replacing any prior values.
1104        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1105            self.0.options = v.into();
1106            self
1107        }
1108
1109        /// Sends the request.
1110        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1111            (*self.0.stub)
1112                .get_iam_policy(self.0.request, self.0.options)
1113                .await
1114                .map(crate::Response::into_body)
1115        }
1116
1117        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1118        ///
1119        /// This is a **required** field for requests.
1120        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1121            self.0.request.resource = v.into();
1122            self
1123        }
1124
1125        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1126        pub fn set_options<T>(mut self, v: T) -> Self
1127        where
1128            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1129        {
1130            self.0.request.options = std::option::Option::Some(v.into());
1131            self
1132        }
1133
1134        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1135        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1136        where
1137            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1138        {
1139            self.0.request.options = v.map(|x| x.into());
1140            self
1141        }
1142    }
1143
1144    #[doc(hidden)]
1145    impl crate::RequestBuilder for GetIamPolicy {
1146        fn request_options(&mut self) -> &mut crate::RequestOptions {
1147            &mut self.0.options
1148        }
1149    }
1150
1151    /// The request builder for [FunctionService::test_iam_permissions][crate::client::FunctionService::test_iam_permissions] calls.
1152    ///
1153    /// # Example
1154    /// ```
1155    /// # use google_cloud_functions_v2::builder::function_service::TestIamPermissions;
1156    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
1157    ///
1158    /// let builder = prepare_request_builder();
1159    /// let response = builder.send().await?;
1160    /// # Ok(()) }
1161    ///
1162    /// fn prepare_request_builder() -> TestIamPermissions {
1163    ///   # panic!();
1164    ///   // ... details omitted ...
1165    /// }
1166    /// ```
1167    #[derive(Clone, Debug)]
1168    pub struct TestIamPermissions(
1169        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1170    );
1171
1172    impl TestIamPermissions {
1173        pub(crate) fn new(
1174            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1175        ) -> Self {
1176            Self(RequestBuilder::new(stub))
1177        }
1178
1179        /// Sets the full request, replacing any prior values.
1180        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1181            mut self,
1182            v: V,
1183        ) -> Self {
1184            self.0.request = v.into();
1185            self
1186        }
1187
1188        /// Sets all the options, replacing any prior values.
1189        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1190            self.0.options = v.into();
1191            self
1192        }
1193
1194        /// Sends the request.
1195        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1196            (*self.0.stub)
1197                .test_iam_permissions(self.0.request, self.0.options)
1198                .await
1199                .map(crate::Response::into_body)
1200        }
1201
1202        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1203        ///
1204        /// This is a **required** field for requests.
1205        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1206            self.0.request.resource = v.into();
1207            self
1208        }
1209
1210        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1211        ///
1212        /// This is a **required** field for requests.
1213        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1214        where
1215            T: std::iter::IntoIterator<Item = V>,
1216            V: std::convert::Into<std::string::String>,
1217        {
1218            use std::iter::Iterator;
1219            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1220            self
1221        }
1222    }
1223
1224    #[doc(hidden)]
1225    impl crate::RequestBuilder for TestIamPermissions {
1226        fn request_options(&mut self) -> &mut crate::RequestOptions {
1227            &mut self.0.options
1228        }
1229    }
1230
1231    /// The request builder for [FunctionService::list_operations][crate::client::FunctionService::list_operations] calls.
1232    ///
1233    /// # Example
1234    /// ```
1235    /// # use google_cloud_functions_v2::builder::function_service::ListOperations;
1236    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
1237    /// use google_cloud_gax::paginator::ItemPaginator;
1238    ///
1239    /// let builder = prepare_request_builder();
1240    /// let mut items = builder.by_item();
1241    /// while let Some(result) = items.next().await {
1242    ///   let item = result?;
1243    /// }
1244    /// # Ok(()) }
1245    ///
1246    /// fn prepare_request_builder() -> ListOperations {
1247    ///   # panic!();
1248    ///   // ... details omitted ...
1249    /// }
1250    /// ```
1251    #[derive(Clone, Debug)]
1252    pub struct ListOperations(
1253        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1254    );
1255
1256    impl ListOperations {
1257        pub(crate) fn new(
1258            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1259        ) -> Self {
1260            Self(RequestBuilder::new(stub))
1261        }
1262
1263        /// Sets the full request, replacing any prior values.
1264        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1265            mut self,
1266            v: V,
1267        ) -> Self {
1268            self.0.request = v.into();
1269            self
1270        }
1271
1272        /// Sets all the options, replacing any prior values.
1273        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1274            self.0.options = v.into();
1275            self
1276        }
1277
1278        /// Sends the request.
1279        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1280            (*self.0.stub)
1281                .list_operations(self.0.request, self.0.options)
1282                .await
1283                .map(crate::Response::into_body)
1284        }
1285
1286        /// Streams each page in the collection.
1287        pub fn by_page(
1288            self,
1289        ) -> impl google_cloud_gax::paginator::Paginator<
1290            google_cloud_longrunning::model::ListOperationsResponse,
1291            crate::Error,
1292        > {
1293            use std::clone::Clone;
1294            let token = self.0.request.page_token.clone();
1295            let execute = move |token: String| {
1296                let mut builder = self.clone();
1297                builder.0.request = builder.0.request.set_page_token(token);
1298                builder.send()
1299            };
1300            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1301        }
1302
1303        /// Streams each item in the collection.
1304        pub fn by_item(
1305            self,
1306        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1307            google_cloud_longrunning::model::ListOperationsResponse,
1308            crate::Error,
1309        > {
1310            use google_cloud_gax::paginator::Paginator;
1311            self.by_page().items()
1312        }
1313
1314        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1315        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1316            self.0.request.name = v.into();
1317            self
1318        }
1319
1320        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1321        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1322            self.0.request.filter = v.into();
1323            self
1324        }
1325
1326        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1327        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1328            self.0.request.page_size = v.into();
1329            self
1330        }
1331
1332        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1333        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1334            self.0.request.page_token = v.into();
1335            self
1336        }
1337
1338        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1339        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1340            self.0.request.return_partial_success = v.into();
1341            self
1342        }
1343    }
1344
1345    #[doc(hidden)]
1346    impl crate::RequestBuilder for ListOperations {
1347        fn request_options(&mut self) -> &mut crate::RequestOptions {
1348            &mut self.0.options
1349        }
1350    }
1351
1352    /// The request builder for [FunctionService::get_operation][crate::client::FunctionService::get_operation] calls.
1353    ///
1354    /// # Example
1355    /// ```
1356    /// # use google_cloud_functions_v2::builder::function_service::GetOperation;
1357    /// # async fn sample() -> google_cloud_functions_v2::Result<()> {
1358    ///
1359    /// let builder = prepare_request_builder();
1360    /// let response = builder.send().await?;
1361    /// # Ok(()) }
1362    ///
1363    /// fn prepare_request_builder() -> GetOperation {
1364    ///   # panic!();
1365    ///   // ... details omitted ...
1366    /// }
1367    /// ```
1368    #[derive(Clone, Debug)]
1369    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1370
1371    impl GetOperation {
1372        pub(crate) fn new(
1373            stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1374        ) -> Self {
1375            Self(RequestBuilder::new(stub))
1376        }
1377
1378        /// Sets the full request, replacing any prior values.
1379        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1380            mut self,
1381            v: V,
1382        ) -> Self {
1383            self.0.request = v.into();
1384            self
1385        }
1386
1387        /// Sets all the options, replacing any prior values.
1388        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1389            self.0.options = v.into();
1390            self
1391        }
1392
1393        /// Sends the request.
1394        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1395            (*self.0.stub)
1396                .get_operation(self.0.request, self.0.options)
1397                .await
1398                .map(crate::Response::into_body)
1399        }
1400
1401        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1402        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1403            self.0.request.name = v.into();
1404            self
1405        }
1406    }
1407
1408    #[doc(hidden)]
1409    impl crate::RequestBuilder for GetOperation {
1410        fn request_options(&mut self) -> &mut crate::RequestOptions {
1411            &mut self.0.options
1412        }
1413    }
1414}