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