Skip to main content

google_cloud_shell_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [CloudShellService][crate::client::CloudShellService].
18pub mod cloud_shell_service {
19    use crate::Result;
20
21    /// A builder for [CloudShellService][crate::client::CloudShellService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_shell_v1::*;
26    /// # use builder::cloud_shell_service::ClientBuilder;
27    /// # use client::CloudShellService;
28    /// let builder : ClientBuilder = CloudShellService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://cloudshell.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::CloudShellService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = CloudShellService;
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::CloudShellService] 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::CloudShellService>,
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::CloudShellService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CloudShellService::get_environment][crate::client::CloudShellService::get_environment] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_shell_v1::builder::cloud_shell_service::GetEnvironment;
79    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetEnvironment {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
92
93    impl GetEnvironment {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
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::GetEnvironmentRequest>>(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::Environment> {
114            (*self.0.stub)
115                .get_environment(self.0.request, self.0.options)
116                .await
117                .map(crate::Response::into_body)
118        }
119
120        /// Sets the value of [name][crate::model::GetEnvironmentRequest::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
129    #[doc(hidden)]
130    impl crate::RequestBuilder for GetEnvironment {
131        fn request_options(&mut self) -> &mut crate::RequestOptions {
132            &mut self.0.options
133        }
134    }
135
136    /// The request builder for [CloudShellService::start_environment][crate::client::CloudShellService::start_environment] calls.
137    ///
138    /// # Example
139    /// ```
140    /// # use google_cloud_shell_v1::builder::cloud_shell_service::StartEnvironment;
141    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
142    /// use google_cloud_lro::Poller;
143    ///
144    /// let builder = prepare_request_builder();
145    /// let response = builder.poller().until_done().await?;
146    /// # Ok(()) }
147    ///
148    /// fn prepare_request_builder() -> StartEnvironment {
149    ///   # panic!();
150    ///   // ... details omitted ...
151    /// }
152    /// ```
153    #[derive(Clone, Debug)]
154    pub struct StartEnvironment(RequestBuilder<crate::model::StartEnvironmentRequest>);
155
156    impl StartEnvironment {
157        pub(crate) fn new(
158            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
159        ) -> Self {
160            Self(RequestBuilder::new(stub))
161        }
162
163        /// Sets the full request, replacing any prior values.
164        pub fn with_request<V: Into<crate::model::StartEnvironmentRequest>>(
165            mut self,
166            v: V,
167        ) -> Self {
168            self.0.request = v.into();
169            self
170        }
171
172        /// Sets all the options, replacing any prior values.
173        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
174            self.0.options = v.into();
175            self
176        }
177
178        /// Sends the request.
179        ///
180        /// # Long running operations
181        ///
182        /// This starts, but does not poll, a longrunning operation. More information
183        /// on [start_environment][crate::client::CloudShellService::start_environment].
184        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
185            (*self.0.stub)
186                .start_environment(self.0.request, self.0.options)
187                .await
188                .map(crate::Response::into_body)
189        }
190
191        /// Creates a [Poller][google_cloud_lro::Poller] to work with `start_environment`.
192        pub fn poller(
193            self,
194        ) -> impl google_cloud_lro::Poller<
195            crate::model::StartEnvironmentResponse,
196            crate::model::StartEnvironmentMetadata,
197        > {
198            type Operation = google_cloud_lro::internal::Operation<
199                crate::model::StartEnvironmentResponse,
200                crate::model::StartEnvironmentMetadata,
201            >;
202            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
203            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
204            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
205            if let Some(ref mut details) = poller_options.tracing {
206                details.method_name = "google_cloud_shell_v1::client::CloudShellService::start_environment::until_done";
207            }
208
209            let stub = self.0.stub.clone();
210            let mut options = self.0.options.clone();
211            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
212            let query = move |name| {
213                let stub = stub.clone();
214                let options = options.clone();
215                async {
216                    let op = GetOperation::new(stub)
217                        .set_name(name)
218                        .with_options(options)
219                        .send()
220                        .await?;
221                    Ok(Operation::new(op))
222                }
223            };
224
225            let start = move || async {
226                let op = self.send().await?;
227                Ok(Operation::new(op))
228            };
229
230            use google_cloud_lro::internal::PollerExt;
231            {
232                google_cloud_lro::internal::new_poller(
233                    polling_error_policy,
234                    polling_backoff_policy,
235                    start,
236                    query,
237                )
238            }
239            .with_options(poller_options)
240        }
241
242        /// Sets the value of [name][crate::model::StartEnvironmentRequest::name].
243        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
244            self.0.request.name = v.into();
245            self
246        }
247
248        /// Sets the value of [access_token][crate::model::StartEnvironmentRequest::access_token].
249        pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
250            self.0.request.access_token = v.into();
251            self
252        }
253
254        /// Sets the value of [public_keys][crate::model::StartEnvironmentRequest::public_keys].
255        pub fn set_public_keys<T, V>(mut self, v: T) -> Self
256        where
257            T: std::iter::IntoIterator<Item = V>,
258            V: std::convert::Into<std::string::String>,
259        {
260            use std::iter::Iterator;
261            self.0.request.public_keys = v.into_iter().map(|i| i.into()).collect();
262            self
263        }
264    }
265
266    #[doc(hidden)]
267    impl crate::RequestBuilder for StartEnvironment {
268        fn request_options(&mut self) -> &mut crate::RequestOptions {
269            &mut self.0.options
270        }
271    }
272
273    /// The request builder for [CloudShellService::authorize_environment][crate::client::CloudShellService::authorize_environment] calls.
274    ///
275    /// # Example
276    /// ```
277    /// # use google_cloud_shell_v1::builder::cloud_shell_service::AuthorizeEnvironment;
278    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
279    /// use google_cloud_lro::Poller;
280    ///
281    /// let builder = prepare_request_builder();
282    /// let response = builder.poller().until_done().await?;
283    /// # Ok(()) }
284    ///
285    /// fn prepare_request_builder() -> AuthorizeEnvironment {
286    ///   # panic!();
287    ///   // ... details omitted ...
288    /// }
289    /// ```
290    #[derive(Clone, Debug)]
291    pub struct AuthorizeEnvironment(RequestBuilder<crate::model::AuthorizeEnvironmentRequest>);
292
293    impl AuthorizeEnvironment {
294        pub(crate) fn new(
295            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
296        ) -> Self {
297            Self(RequestBuilder::new(stub))
298        }
299
300        /// Sets the full request, replacing any prior values.
301        pub fn with_request<V: Into<crate::model::AuthorizeEnvironmentRequest>>(
302            mut self,
303            v: V,
304        ) -> Self {
305            self.0.request = v.into();
306            self
307        }
308
309        /// Sets all the options, replacing any prior values.
310        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
311            self.0.options = v.into();
312            self
313        }
314
315        /// Sends the request.
316        ///
317        /// # Long running operations
318        ///
319        /// This starts, but does not poll, a longrunning operation. More information
320        /// on [authorize_environment][crate::client::CloudShellService::authorize_environment].
321        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
322            (*self.0.stub)
323                .authorize_environment(self.0.request, self.0.options)
324                .await
325                .map(crate::Response::into_body)
326        }
327
328        /// Creates a [Poller][google_cloud_lro::Poller] to work with `authorize_environment`.
329        pub fn poller(
330            self,
331        ) -> impl google_cloud_lro::Poller<
332            crate::model::AuthorizeEnvironmentResponse,
333            crate::model::AuthorizeEnvironmentMetadata,
334        > {
335            type Operation = google_cloud_lro::internal::Operation<
336                crate::model::AuthorizeEnvironmentResponse,
337                crate::model::AuthorizeEnvironmentMetadata,
338            >;
339            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
340            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
341            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
342            if let Some(ref mut details) = poller_options.tracing {
343                details.method_name = "google_cloud_shell_v1::client::CloudShellService::authorize_environment::until_done";
344            }
345
346            let stub = self.0.stub.clone();
347            let mut options = self.0.options.clone();
348            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
349            let query = move |name| {
350                let stub = stub.clone();
351                let options = options.clone();
352                async {
353                    let op = GetOperation::new(stub)
354                        .set_name(name)
355                        .with_options(options)
356                        .send()
357                        .await?;
358                    Ok(Operation::new(op))
359                }
360            };
361
362            let start = move || async {
363                let op = self.send().await?;
364                Ok(Operation::new(op))
365            };
366
367            use google_cloud_lro::internal::PollerExt;
368            {
369                google_cloud_lro::internal::new_poller(
370                    polling_error_policy,
371                    polling_backoff_policy,
372                    start,
373                    query,
374                )
375            }
376            .with_options(poller_options)
377        }
378
379        /// Sets the value of [name][crate::model::AuthorizeEnvironmentRequest::name].
380        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
381            self.0.request.name = v.into();
382            self
383        }
384
385        /// Sets the value of [access_token][crate::model::AuthorizeEnvironmentRequest::access_token].
386        pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
387            self.0.request.access_token = v.into();
388            self
389        }
390
391        /// Sets the value of [id_token][crate::model::AuthorizeEnvironmentRequest::id_token].
392        pub fn set_id_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
393            self.0.request.id_token = v.into();
394            self
395        }
396
397        /// Sets the value of [expire_time][crate::model::AuthorizeEnvironmentRequest::expire_time].
398        pub fn set_expire_time<T>(mut self, v: T) -> Self
399        where
400            T: std::convert::Into<wkt::Timestamp>,
401        {
402            self.0.request.expire_time = std::option::Option::Some(v.into());
403            self
404        }
405
406        /// Sets or clears the value of [expire_time][crate::model::AuthorizeEnvironmentRequest::expire_time].
407        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
408        where
409            T: std::convert::Into<wkt::Timestamp>,
410        {
411            self.0.request.expire_time = v.map(|x| x.into());
412            self
413        }
414    }
415
416    #[doc(hidden)]
417    impl crate::RequestBuilder for AuthorizeEnvironment {
418        fn request_options(&mut self) -> &mut crate::RequestOptions {
419            &mut self.0.options
420        }
421    }
422
423    /// The request builder for [CloudShellService::add_public_key][crate::client::CloudShellService::add_public_key] calls.
424    ///
425    /// # Example
426    /// ```
427    /// # use google_cloud_shell_v1::builder::cloud_shell_service::AddPublicKey;
428    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
429    /// use google_cloud_lro::Poller;
430    ///
431    /// let builder = prepare_request_builder();
432    /// let response = builder.poller().until_done().await?;
433    /// # Ok(()) }
434    ///
435    /// fn prepare_request_builder() -> AddPublicKey {
436    ///   # panic!();
437    ///   // ... details omitted ...
438    /// }
439    /// ```
440    #[derive(Clone, Debug)]
441    pub struct AddPublicKey(RequestBuilder<crate::model::AddPublicKeyRequest>);
442
443    impl AddPublicKey {
444        pub(crate) fn new(
445            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
446        ) -> Self {
447            Self(RequestBuilder::new(stub))
448        }
449
450        /// Sets the full request, replacing any prior values.
451        pub fn with_request<V: Into<crate::model::AddPublicKeyRequest>>(mut self, v: V) -> Self {
452            self.0.request = v.into();
453            self
454        }
455
456        /// Sets all the options, replacing any prior values.
457        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
458            self.0.options = v.into();
459            self
460        }
461
462        /// Sends the request.
463        ///
464        /// # Long running operations
465        ///
466        /// This starts, but does not poll, a longrunning operation. More information
467        /// on [add_public_key][crate::client::CloudShellService::add_public_key].
468        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
469            (*self.0.stub)
470                .add_public_key(self.0.request, self.0.options)
471                .await
472                .map(crate::Response::into_body)
473        }
474
475        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_public_key`.
476        pub fn poller(
477            self,
478        ) -> impl google_cloud_lro::Poller<
479            crate::model::AddPublicKeyResponse,
480            crate::model::AddPublicKeyMetadata,
481        > {
482            type Operation = google_cloud_lro::internal::Operation<
483                crate::model::AddPublicKeyResponse,
484                crate::model::AddPublicKeyMetadata,
485            >;
486            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
487            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
488            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
489            if let Some(ref mut details) = poller_options.tracing {
490                details.method_name =
491                    "google_cloud_shell_v1::client::CloudShellService::add_public_key::until_done";
492            }
493
494            let stub = self.0.stub.clone();
495            let mut options = self.0.options.clone();
496            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
497            let query = move |name| {
498                let stub = stub.clone();
499                let options = options.clone();
500                async {
501                    let op = GetOperation::new(stub)
502                        .set_name(name)
503                        .with_options(options)
504                        .send()
505                        .await?;
506                    Ok(Operation::new(op))
507                }
508            };
509
510            let start = move || async {
511                let op = self.send().await?;
512                Ok(Operation::new(op))
513            };
514
515            use google_cloud_lro::internal::PollerExt;
516            {
517                google_cloud_lro::internal::new_poller(
518                    polling_error_policy,
519                    polling_backoff_policy,
520                    start,
521                    query,
522                )
523            }
524            .with_options(poller_options)
525        }
526
527        /// Sets the value of [environment][crate::model::AddPublicKeyRequest::environment].
528        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
529            self.0.request.environment = v.into();
530            self
531        }
532
533        /// Sets the value of [key][crate::model::AddPublicKeyRequest::key].
534        pub fn set_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
535            self.0.request.key = v.into();
536            self
537        }
538    }
539
540    #[doc(hidden)]
541    impl crate::RequestBuilder for AddPublicKey {
542        fn request_options(&mut self) -> &mut crate::RequestOptions {
543            &mut self.0.options
544        }
545    }
546
547    /// The request builder for [CloudShellService::remove_public_key][crate::client::CloudShellService::remove_public_key] calls.
548    ///
549    /// # Example
550    /// ```
551    /// # use google_cloud_shell_v1::builder::cloud_shell_service::RemovePublicKey;
552    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
553    /// use google_cloud_lro::Poller;
554    ///
555    /// let builder = prepare_request_builder();
556    /// let response = builder.poller().until_done().await?;
557    /// # Ok(()) }
558    ///
559    /// fn prepare_request_builder() -> RemovePublicKey {
560    ///   # panic!();
561    ///   // ... details omitted ...
562    /// }
563    /// ```
564    #[derive(Clone, Debug)]
565    pub struct RemovePublicKey(RequestBuilder<crate::model::RemovePublicKeyRequest>);
566
567    impl RemovePublicKey {
568        pub(crate) fn new(
569            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
570        ) -> Self {
571            Self(RequestBuilder::new(stub))
572        }
573
574        /// Sets the full request, replacing any prior values.
575        pub fn with_request<V: Into<crate::model::RemovePublicKeyRequest>>(mut self, v: V) -> Self {
576            self.0.request = v.into();
577            self
578        }
579
580        /// Sets all the options, replacing any prior values.
581        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
582            self.0.options = v.into();
583            self
584        }
585
586        /// Sends the request.
587        ///
588        /// # Long running operations
589        ///
590        /// This starts, but does not poll, a longrunning operation. More information
591        /// on [remove_public_key][crate::client::CloudShellService::remove_public_key].
592        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
593            (*self.0.stub)
594                .remove_public_key(self.0.request, self.0.options)
595                .await
596                .map(crate::Response::into_body)
597        }
598
599        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_public_key`.
600        pub fn poller(
601            self,
602        ) -> impl google_cloud_lro::Poller<
603            crate::model::RemovePublicKeyResponse,
604            crate::model::RemovePublicKeyMetadata,
605        > {
606            type Operation = google_cloud_lro::internal::Operation<
607                crate::model::RemovePublicKeyResponse,
608                crate::model::RemovePublicKeyMetadata,
609            >;
610            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
611            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
612            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
613            if let Some(ref mut details) = poller_options.tracing {
614                details.method_name = "google_cloud_shell_v1::client::CloudShellService::remove_public_key::until_done";
615            }
616
617            let stub = self.0.stub.clone();
618            let mut options = self.0.options.clone();
619            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
620            let query = move |name| {
621                let stub = stub.clone();
622                let options = options.clone();
623                async {
624                    let op = GetOperation::new(stub)
625                        .set_name(name)
626                        .with_options(options)
627                        .send()
628                        .await?;
629                    Ok(Operation::new(op))
630                }
631            };
632
633            let start = move || async {
634                let op = self.send().await?;
635                Ok(Operation::new(op))
636            };
637
638            use google_cloud_lro::internal::PollerExt;
639            {
640                google_cloud_lro::internal::new_poller(
641                    polling_error_policy,
642                    polling_backoff_policy,
643                    start,
644                    query,
645                )
646            }
647            .with_options(poller_options)
648        }
649
650        /// Sets the value of [environment][crate::model::RemovePublicKeyRequest::environment].
651        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
652            self.0.request.environment = v.into();
653            self
654        }
655
656        /// Sets the value of [key][crate::model::RemovePublicKeyRequest::key].
657        pub fn set_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
658            self.0.request.key = v.into();
659            self
660        }
661    }
662
663    #[doc(hidden)]
664    impl crate::RequestBuilder for RemovePublicKey {
665        fn request_options(&mut self) -> &mut crate::RequestOptions {
666            &mut self.0.options
667        }
668    }
669
670    /// The request builder for [CloudShellService::get_operation][crate::client::CloudShellService::get_operation] calls.
671    ///
672    /// # Example
673    /// ```
674    /// # use google_cloud_shell_v1::builder::cloud_shell_service::GetOperation;
675    /// # async fn sample() -> google_cloud_shell_v1::Result<()> {
676    ///
677    /// let builder = prepare_request_builder();
678    /// let response = builder.send().await?;
679    /// # Ok(()) }
680    ///
681    /// fn prepare_request_builder() -> GetOperation {
682    ///   # panic!();
683    ///   // ... details omitted ...
684    /// }
685    /// ```
686    #[derive(Clone, Debug)]
687    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
688
689    impl GetOperation {
690        pub(crate) fn new(
691            stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudShellService>,
692        ) -> Self {
693            Self(RequestBuilder::new(stub))
694        }
695
696        /// Sets the full request, replacing any prior values.
697        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
698            mut self,
699            v: V,
700        ) -> Self {
701            self.0.request = v.into();
702            self
703        }
704
705        /// Sets all the options, replacing any prior values.
706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
707            self.0.options = v.into();
708            self
709        }
710
711        /// Sends the request.
712        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
713            (*self.0.stub)
714                .get_operation(self.0.request, self.0.options)
715                .await
716                .map(crate::Response::into_body)
717        }
718
719        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
720        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
721            self.0.request.name = v.into();
722            self
723        }
724    }
725
726    #[doc(hidden)]
727    impl crate::RequestBuilder for GetOperation {
728        fn request_options(&mut self) -> &mut crate::RequestOptions {
729            &mut self.0.options
730        }
731    }
732}