Skip to main content

google_cloud_workstations_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 [Workstations][crate::client::Workstations].
18pub mod workstations {
19    use crate::Result;
20
21    /// A builder for [Workstations][crate::client::Workstations].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_workstations_v1::*;
26    /// # use builder::workstations::ClientBuilder;
27    /// # use client::Workstations;
28    /// let builder : ClientBuilder = Workstations::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://workstations.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::Workstations;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = Workstations;
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::Workstations] 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::Workstations>,
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::Workstations>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Workstations::get_workstation_cluster][crate::client::Workstations::get_workstation_cluster] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_workstations_v1::builder::workstations::GetWorkstationCluster;
79    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetWorkstationCluster {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetWorkstationCluster(RequestBuilder<crate::model::GetWorkstationClusterRequest>);
92
93    impl GetWorkstationCluster {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
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::GetWorkstationClusterRequest>>(
102            mut self,
103            v: V,
104        ) -> Self {
105            self.0.request = v.into();
106            self
107        }
108
109        /// Sets all the options, replacing any prior values.
110        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111            self.0.options = v.into();
112            self
113        }
114
115        /// Sends the request.
116        pub async fn send(self) -> Result<crate::model::WorkstationCluster> {
117            (*self.0.stub)
118                .get_workstation_cluster(self.0.request, self.0.options)
119                .await
120                .map(crate::Response::into_body)
121        }
122
123        /// Sets the value of [name][crate::model::GetWorkstationClusterRequest::name].
124        ///
125        /// This is a **required** field for requests.
126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
127            self.0.request.name = v.into();
128            self
129        }
130    }
131
132    #[doc(hidden)]
133    impl crate::RequestBuilder for GetWorkstationCluster {
134        fn request_options(&mut self) -> &mut crate::RequestOptions {
135            &mut self.0.options
136        }
137    }
138
139    /// The request builder for [Workstations::list_workstation_clusters][crate::client::Workstations::list_workstation_clusters] calls.
140    ///
141    /// # Example
142    /// ```
143    /// # use google_cloud_workstations_v1::builder::workstations::ListWorkstationClusters;
144    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
145    /// use google_cloud_gax::paginator::ItemPaginator;
146    ///
147    /// let builder = prepare_request_builder();
148    /// let mut items = builder.by_item();
149    /// while let Some(result) = items.next().await {
150    ///   let item = result?;
151    /// }
152    /// # Ok(()) }
153    ///
154    /// fn prepare_request_builder() -> ListWorkstationClusters {
155    ///   # panic!();
156    ///   // ... details omitted ...
157    /// }
158    /// ```
159    #[derive(Clone, Debug)]
160    pub struct ListWorkstationClusters(
161        RequestBuilder<crate::model::ListWorkstationClustersRequest>,
162    );
163
164    impl ListWorkstationClusters {
165        pub(crate) fn new(
166            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
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::ListWorkstationClustersRequest>>(
173            mut self,
174            v: V,
175        ) -> Self {
176            self.0.request = v.into();
177            self
178        }
179
180        /// Sets all the options, replacing any prior values.
181        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
182            self.0.options = v.into();
183            self
184        }
185
186        /// Sends the request.
187        pub async fn send(self) -> Result<crate::model::ListWorkstationClustersResponse> {
188            (*self.0.stub)
189                .list_workstation_clusters(self.0.request, self.0.options)
190                .await
191                .map(crate::Response::into_body)
192        }
193
194        /// Streams each page in the collection.
195        pub fn by_page(
196            self,
197        ) -> impl google_cloud_gax::paginator::Paginator<
198            crate::model::ListWorkstationClustersResponse,
199            crate::Error,
200        > {
201            use std::clone::Clone;
202            let token = self.0.request.page_token.clone();
203            let execute = move |token: String| {
204                let mut builder = self.clone();
205                builder.0.request = builder.0.request.set_page_token(token);
206                builder.send()
207            };
208            google_cloud_gax::paginator::internal::new_paginator(token, execute)
209        }
210
211        /// Streams each item in the collection.
212        pub fn by_item(
213            self,
214        ) -> impl google_cloud_gax::paginator::ItemPaginator<
215            crate::model::ListWorkstationClustersResponse,
216            crate::Error,
217        > {
218            use google_cloud_gax::paginator::Paginator;
219            self.by_page().items()
220        }
221
222        /// Sets the value of [parent][crate::model::ListWorkstationClustersRequest::parent].
223        ///
224        /// This is a **required** field for requests.
225        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
226            self.0.request.parent = v.into();
227            self
228        }
229
230        /// Sets the value of [page_size][crate::model::ListWorkstationClustersRequest::page_size].
231        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
232            self.0.request.page_size = v.into();
233            self
234        }
235
236        /// Sets the value of [page_token][crate::model::ListWorkstationClustersRequest::page_token].
237        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.page_token = v.into();
239            self
240        }
241
242        /// Sets the value of [filter][crate::model::ListWorkstationClustersRequest::filter].
243        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
244            self.0.request.filter = v.into();
245            self
246        }
247    }
248
249    #[doc(hidden)]
250    impl crate::RequestBuilder for ListWorkstationClusters {
251        fn request_options(&mut self) -> &mut crate::RequestOptions {
252            &mut self.0.options
253        }
254    }
255
256    /// The request builder for [Workstations::create_workstation_cluster][crate::client::Workstations::create_workstation_cluster] calls.
257    ///
258    /// # Example
259    /// ```
260    /// # use google_cloud_workstations_v1::builder::workstations::CreateWorkstationCluster;
261    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
262    /// use google_cloud_lro::Poller;
263    ///
264    /// let builder = prepare_request_builder();
265    /// let response = builder.poller().until_done().await?;
266    /// # Ok(()) }
267    ///
268    /// fn prepare_request_builder() -> CreateWorkstationCluster {
269    ///   # panic!();
270    ///   // ... details omitted ...
271    /// }
272    /// ```
273    #[derive(Clone, Debug)]
274    pub struct CreateWorkstationCluster(
275        RequestBuilder<crate::model::CreateWorkstationClusterRequest>,
276    );
277
278    impl CreateWorkstationCluster {
279        pub(crate) fn new(
280            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
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::CreateWorkstationClusterRequest>>(
287            mut self,
288            v: V,
289        ) -> Self {
290            self.0.request = v.into();
291            self
292        }
293
294        /// Sets all the options, replacing any prior values.
295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
296            self.0.options = v.into();
297            self
298        }
299
300        /// Sends the request.
301        ///
302        /// # Long running operations
303        ///
304        /// This starts, but does not poll, a longrunning operation. More information
305        /// on [create_workstation_cluster][crate::client::Workstations::create_workstation_cluster].
306        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
307            (*self.0.stub)
308                .create_workstation_cluster(self.0.request, self.0.options)
309                .await
310                .map(crate::Response::into_body)
311        }
312
313        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_workstation_cluster`.
314        pub fn poller(
315            self,
316        ) -> impl google_cloud_lro::Poller<
317            crate::model::WorkstationCluster,
318            crate::model::OperationMetadata,
319        > {
320            type Operation = google_cloud_lro::internal::Operation<
321                crate::model::WorkstationCluster,
322                crate::model::OperationMetadata,
323            >;
324            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326
327            let stub = self.0.stub.clone();
328            let mut options = self.0.options.clone();
329            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
330            let query = move |name| {
331                let stub = stub.clone();
332                let options = options.clone();
333                async {
334                    let op = GetOperation::new(stub)
335                        .set_name(name)
336                        .with_options(options)
337                        .send()
338                        .await?;
339                    Ok(Operation::new(op))
340                }
341            };
342
343            let start = move || async {
344                let op = self.send().await?;
345                Ok(Operation::new(op))
346            };
347
348            google_cloud_lro::internal::new_poller(
349                polling_error_policy,
350                polling_backoff_policy,
351                start,
352                query,
353            )
354        }
355
356        /// Sets the value of [parent][crate::model::CreateWorkstationClusterRequest::parent].
357        ///
358        /// This is a **required** field for requests.
359        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
360            self.0.request.parent = v.into();
361            self
362        }
363
364        /// Sets the value of [workstation_cluster_id][crate::model::CreateWorkstationClusterRequest::workstation_cluster_id].
365        ///
366        /// This is a **required** field for requests.
367        pub fn set_workstation_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
368            self.0.request.workstation_cluster_id = v.into();
369            self
370        }
371
372        /// Sets the value of [workstation_cluster][crate::model::CreateWorkstationClusterRequest::workstation_cluster].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
376        where
377            T: std::convert::Into<crate::model::WorkstationCluster>,
378        {
379            self.0.request.workstation_cluster = std::option::Option::Some(v.into());
380            self
381        }
382
383        /// Sets or clears the value of [workstation_cluster][crate::model::CreateWorkstationClusterRequest::workstation_cluster].
384        ///
385        /// This is a **required** field for requests.
386        pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
387        where
388            T: std::convert::Into<crate::model::WorkstationCluster>,
389        {
390            self.0.request.workstation_cluster = v.map(|x| x.into());
391            self
392        }
393
394        /// Sets the value of [validate_only][crate::model::CreateWorkstationClusterRequest::validate_only].
395        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
396            self.0.request.validate_only = v.into();
397            self
398        }
399    }
400
401    #[doc(hidden)]
402    impl crate::RequestBuilder for CreateWorkstationCluster {
403        fn request_options(&mut self) -> &mut crate::RequestOptions {
404            &mut self.0.options
405        }
406    }
407
408    /// The request builder for [Workstations::update_workstation_cluster][crate::client::Workstations::update_workstation_cluster] calls.
409    ///
410    /// # Example
411    /// ```
412    /// # use google_cloud_workstations_v1::builder::workstations::UpdateWorkstationCluster;
413    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
414    /// use google_cloud_lro::Poller;
415    ///
416    /// let builder = prepare_request_builder();
417    /// let response = builder.poller().until_done().await?;
418    /// # Ok(()) }
419    ///
420    /// fn prepare_request_builder() -> UpdateWorkstationCluster {
421    ///   # panic!();
422    ///   // ... details omitted ...
423    /// }
424    /// ```
425    #[derive(Clone, Debug)]
426    pub struct UpdateWorkstationCluster(
427        RequestBuilder<crate::model::UpdateWorkstationClusterRequest>,
428    );
429
430    impl UpdateWorkstationCluster {
431        pub(crate) fn new(
432            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
433        ) -> Self {
434            Self(RequestBuilder::new(stub))
435        }
436
437        /// Sets the full request, replacing any prior values.
438        pub fn with_request<V: Into<crate::model::UpdateWorkstationClusterRequest>>(
439            mut self,
440            v: V,
441        ) -> Self {
442            self.0.request = v.into();
443            self
444        }
445
446        /// Sets all the options, replacing any prior values.
447        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
448            self.0.options = v.into();
449            self
450        }
451
452        /// Sends the request.
453        ///
454        /// # Long running operations
455        ///
456        /// This starts, but does not poll, a longrunning operation. More information
457        /// on [update_workstation_cluster][crate::client::Workstations::update_workstation_cluster].
458        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
459            (*self.0.stub)
460                .update_workstation_cluster(self.0.request, self.0.options)
461                .await
462                .map(crate::Response::into_body)
463        }
464
465        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_workstation_cluster`.
466        pub fn poller(
467            self,
468        ) -> impl google_cloud_lro::Poller<
469            crate::model::WorkstationCluster,
470            crate::model::OperationMetadata,
471        > {
472            type Operation = google_cloud_lro::internal::Operation<
473                crate::model::WorkstationCluster,
474                crate::model::OperationMetadata,
475            >;
476            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
477            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
478
479            let stub = self.0.stub.clone();
480            let mut options = self.0.options.clone();
481            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
482            let query = move |name| {
483                let stub = stub.clone();
484                let options = options.clone();
485                async {
486                    let op = GetOperation::new(stub)
487                        .set_name(name)
488                        .with_options(options)
489                        .send()
490                        .await?;
491                    Ok(Operation::new(op))
492                }
493            };
494
495            let start = move || async {
496                let op = self.send().await?;
497                Ok(Operation::new(op))
498            };
499
500            google_cloud_lro::internal::new_poller(
501                polling_error_policy,
502                polling_backoff_policy,
503                start,
504                query,
505            )
506        }
507
508        /// Sets the value of [workstation_cluster][crate::model::UpdateWorkstationClusterRequest::workstation_cluster].
509        ///
510        /// This is a **required** field for requests.
511        pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
512        where
513            T: std::convert::Into<crate::model::WorkstationCluster>,
514        {
515            self.0.request.workstation_cluster = std::option::Option::Some(v.into());
516            self
517        }
518
519        /// Sets or clears the value of [workstation_cluster][crate::model::UpdateWorkstationClusterRequest::workstation_cluster].
520        ///
521        /// This is a **required** field for requests.
522        pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
523        where
524            T: std::convert::Into<crate::model::WorkstationCluster>,
525        {
526            self.0.request.workstation_cluster = v.map(|x| x.into());
527            self
528        }
529
530        /// Sets the value of [update_mask][crate::model::UpdateWorkstationClusterRequest::update_mask].
531        ///
532        /// This is a **required** field for requests.
533        pub fn set_update_mask<T>(mut self, v: T) -> Self
534        where
535            T: std::convert::Into<wkt::FieldMask>,
536        {
537            self.0.request.update_mask = std::option::Option::Some(v.into());
538            self
539        }
540
541        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkstationClusterRequest::update_mask].
542        ///
543        /// This is a **required** field for requests.
544        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
545        where
546            T: std::convert::Into<wkt::FieldMask>,
547        {
548            self.0.request.update_mask = v.map(|x| x.into());
549            self
550        }
551
552        /// Sets the value of [validate_only][crate::model::UpdateWorkstationClusterRequest::validate_only].
553        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
554            self.0.request.validate_only = v.into();
555            self
556        }
557
558        /// Sets the value of [allow_missing][crate::model::UpdateWorkstationClusterRequest::allow_missing].
559        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
560            self.0.request.allow_missing = v.into();
561            self
562        }
563    }
564
565    #[doc(hidden)]
566    impl crate::RequestBuilder for UpdateWorkstationCluster {
567        fn request_options(&mut self) -> &mut crate::RequestOptions {
568            &mut self.0.options
569        }
570    }
571
572    /// The request builder for [Workstations::delete_workstation_cluster][crate::client::Workstations::delete_workstation_cluster] calls.
573    ///
574    /// # Example
575    /// ```
576    /// # use google_cloud_workstations_v1::builder::workstations::DeleteWorkstationCluster;
577    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
578    /// use google_cloud_lro::Poller;
579    ///
580    /// let builder = prepare_request_builder();
581    /// let response = builder.poller().until_done().await?;
582    /// # Ok(()) }
583    ///
584    /// fn prepare_request_builder() -> DeleteWorkstationCluster {
585    ///   # panic!();
586    ///   // ... details omitted ...
587    /// }
588    /// ```
589    #[derive(Clone, Debug)]
590    pub struct DeleteWorkstationCluster(
591        RequestBuilder<crate::model::DeleteWorkstationClusterRequest>,
592    );
593
594    impl DeleteWorkstationCluster {
595        pub(crate) fn new(
596            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
597        ) -> Self {
598            Self(RequestBuilder::new(stub))
599        }
600
601        /// Sets the full request, replacing any prior values.
602        pub fn with_request<V: Into<crate::model::DeleteWorkstationClusterRequest>>(
603            mut self,
604            v: V,
605        ) -> Self {
606            self.0.request = v.into();
607            self
608        }
609
610        /// Sets all the options, replacing any prior values.
611        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
612            self.0.options = v.into();
613            self
614        }
615
616        /// Sends the request.
617        ///
618        /// # Long running operations
619        ///
620        /// This starts, but does not poll, a longrunning operation. More information
621        /// on [delete_workstation_cluster][crate::client::Workstations::delete_workstation_cluster].
622        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
623            (*self.0.stub)
624                .delete_workstation_cluster(self.0.request, self.0.options)
625                .await
626                .map(crate::Response::into_body)
627        }
628
629        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_workstation_cluster`.
630        pub fn poller(
631            self,
632        ) -> impl google_cloud_lro::Poller<
633            crate::model::WorkstationCluster,
634            crate::model::OperationMetadata,
635        > {
636            type Operation = google_cloud_lro::internal::Operation<
637                crate::model::WorkstationCluster,
638                crate::model::OperationMetadata,
639            >;
640            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
641            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
642
643            let stub = self.0.stub.clone();
644            let mut options = self.0.options.clone();
645            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
646            let query = move |name| {
647                let stub = stub.clone();
648                let options = options.clone();
649                async {
650                    let op = GetOperation::new(stub)
651                        .set_name(name)
652                        .with_options(options)
653                        .send()
654                        .await?;
655                    Ok(Operation::new(op))
656                }
657            };
658
659            let start = move || async {
660                let op = self.send().await?;
661                Ok(Operation::new(op))
662            };
663
664            google_cloud_lro::internal::new_poller(
665                polling_error_policy,
666                polling_backoff_policy,
667                start,
668                query,
669            )
670        }
671
672        /// Sets the value of [name][crate::model::DeleteWorkstationClusterRequest::name].
673        ///
674        /// This is a **required** field for requests.
675        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
676            self.0.request.name = v.into();
677            self
678        }
679
680        /// Sets the value of [validate_only][crate::model::DeleteWorkstationClusterRequest::validate_only].
681        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
682            self.0.request.validate_only = v.into();
683            self
684        }
685
686        /// Sets the value of [etag][crate::model::DeleteWorkstationClusterRequest::etag].
687        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
688            self.0.request.etag = v.into();
689            self
690        }
691
692        /// Sets the value of [force][crate::model::DeleteWorkstationClusterRequest::force].
693        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
694            self.0.request.force = v.into();
695            self
696        }
697    }
698
699    #[doc(hidden)]
700    impl crate::RequestBuilder for DeleteWorkstationCluster {
701        fn request_options(&mut self) -> &mut crate::RequestOptions {
702            &mut self.0.options
703        }
704    }
705
706    /// The request builder for [Workstations::get_workstation_config][crate::client::Workstations::get_workstation_config] calls.
707    ///
708    /// # Example
709    /// ```
710    /// # use google_cloud_workstations_v1::builder::workstations::GetWorkstationConfig;
711    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
712    ///
713    /// let builder = prepare_request_builder();
714    /// let response = builder.send().await?;
715    /// # Ok(()) }
716    ///
717    /// fn prepare_request_builder() -> GetWorkstationConfig {
718    ///   # panic!();
719    ///   // ... details omitted ...
720    /// }
721    /// ```
722    #[derive(Clone, Debug)]
723    pub struct GetWorkstationConfig(RequestBuilder<crate::model::GetWorkstationConfigRequest>);
724
725    impl GetWorkstationConfig {
726        pub(crate) fn new(
727            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
728        ) -> Self {
729            Self(RequestBuilder::new(stub))
730        }
731
732        /// Sets the full request, replacing any prior values.
733        pub fn with_request<V: Into<crate::model::GetWorkstationConfigRequest>>(
734            mut self,
735            v: V,
736        ) -> Self {
737            self.0.request = v.into();
738            self
739        }
740
741        /// Sets all the options, replacing any prior values.
742        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
743            self.0.options = v.into();
744            self
745        }
746
747        /// Sends the request.
748        pub async fn send(self) -> Result<crate::model::WorkstationConfig> {
749            (*self.0.stub)
750                .get_workstation_config(self.0.request, self.0.options)
751                .await
752                .map(crate::Response::into_body)
753        }
754
755        /// Sets the value of [name][crate::model::GetWorkstationConfigRequest::name].
756        ///
757        /// This is a **required** field for requests.
758        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
759            self.0.request.name = v.into();
760            self
761        }
762    }
763
764    #[doc(hidden)]
765    impl crate::RequestBuilder for GetWorkstationConfig {
766        fn request_options(&mut self) -> &mut crate::RequestOptions {
767            &mut self.0.options
768        }
769    }
770
771    /// The request builder for [Workstations::list_workstation_configs][crate::client::Workstations::list_workstation_configs] calls.
772    ///
773    /// # Example
774    /// ```
775    /// # use google_cloud_workstations_v1::builder::workstations::ListWorkstationConfigs;
776    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
777    /// use google_cloud_gax::paginator::ItemPaginator;
778    ///
779    /// let builder = prepare_request_builder();
780    /// let mut items = builder.by_item();
781    /// while let Some(result) = items.next().await {
782    ///   let item = result?;
783    /// }
784    /// # Ok(()) }
785    ///
786    /// fn prepare_request_builder() -> ListWorkstationConfigs {
787    ///   # panic!();
788    ///   // ... details omitted ...
789    /// }
790    /// ```
791    #[derive(Clone, Debug)]
792    pub struct ListWorkstationConfigs(RequestBuilder<crate::model::ListWorkstationConfigsRequest>);
793
794    impl ListWorkstationConfigs {
795        pub(crate) fn new(
796            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
797        ) -> Self {
798            Self(RequestBuilder::new(stub))
799        }
800
801        /// Sets the full request, replacing any prior values.
802        pub fn with_request<V: Into<crate::model::ListWorkstationConfigsRequest>>(
803            mut self,
804            v: V,
805        ) -> Self {
806            self.0.request = v.into();
807            self
808        }
809
810        /// Sets all the options, replacing any prior values.
811        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
812            self.0.options = v.into();
813            self
814        }
815
816        /// Sends the request.
817        pub async fn send(self) -> Result<crate::model::ListWorkstationConfigsResponse> {
818            (*self.0.stub)
819                .list_workstation_configs(self.0.request, self.0.options)
820                .await
821                .map(crate::Response::into_body)
822        }
823
824        /// Streams each page in the collection.
825        pub fn by_page(
826            self,
827        ) -> impl google_cloud_gax::paginator::Paginator<
828            crate::model::ListWorkstationConfigsResponse,
829            crate::Error,
830        > {
831            use std::clone::Clone;
832            let token = self.0.request.page_token.clone();
833            let execute = move |token: String| {
834                let mut builder = self.clone();
835                builder.0.request = builder.0.request.set_page_token(token);
836                builder.send()
837            };
838            google_cloud_gax::paginator::internal::new_paginator(token, execute)
839        }
840
841        /// Streams each item in the collection.
842        pub fn by_item(
843            self,
844        ) -> impl google_cloud_gax::paginator::ItemPaginator<
845            crate::model::ListWorkstationConfigsResponse,
846            crate::Error,
847        > {
848            use google_cloud_gax::paginator::Paginator;
849            self.by_page().items()
850        }
851
852        /// Sets the value of [parent][crate::model::ListWorkstationConfigsRequest::parent].
853        ///
854        /// This is a **required** field for requests.
855        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
856            self.0.request.parent = v.into();
857            self
858        }
859
860        /// Sets the value of [page_size][crate::model::ListWorkstationConfigsRequest::page_size].
861        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
862            self.0.request.page_size = v.into();
863            self
864        }
865
866        /// Sets the value of [page_token][crate::model::ListWorkstationConfigsRequest::page_token].
867        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
868            self.0.request.page_token = v.into();
869            self
870        }
871
872        /// Sets the value of [filter][crate::model::ListWorkstationConfigsRequest::filter].
873        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
874            self.0.request.filter = v.into();
875            self
876        }
877    }
878
879    #[doc(hidden)]
880    impl crate::RequestBuilder for ListWorkstationConfigs {
881        fn request_options(&mut self) -> &mut crate::RequestOptions {
882            &mut self.0.options
883        }
884    }
885
886    /// The request builder for [Workstations::list_usable_workstation_configs][crate::client::Workstations::list_usable_workstation_configs] calls.
887    ///
888    /// # Example
889    /// ```
890    /// # use google_cloud_workstations_v1::builder::workstations::ListUsableWorkstationConfigs;
891    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
892    /// use google_cloud_gax::paginator::ItemPaginator;
893    ///
894    /// let builder = prepare_request_builder();
895    /// let mut items = builder.by_item();
896    /// while let Some(result) = items.next().await {
897    ///   let item = result?;
898    /// }
899    /// # Ok(()) }
900    ///
901    /// fn prepare_request_builder() -> ListUsableWorkstationConfigs {
902    ///   # panic!();
903    ///   // ... details omitted ...
904    /// }
905    /// ```
906    #[derive(Clone, Debug)]
907    pub struct ListUsableWorkstationConfigs(
908        RequestBuilder<crate::model::ListUsableWorkstationConfigsRequest>,
909    );
910
911    impl ListUsableWorkstationConfigs {
912        pub(crate) fn new(
913            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
914        ) -> Self {
915            Self(RequestBuilder::new(stub))
916        }
917
918        /// Sets the full request, replacing any prior values.
919        pub fn with_request<V: Into<crate::model::ListUsableWorkstationConfigsRequest>>(
920            mut self,
921            v: V,
922        ) -> Self {
923            self.0.request = v.into();
924            self
925        }
926
927        /// Sets all the options, replacing any prior values.
928        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
929            self.0.options = v.into();
930            self
931        }
932
933        /// Sends the request.
934        pub async fn send(self) -> Result<crate::model::ListUsableWorkstationConfigsResponse> {
935            (*self.0.stub)
936                .list_usable_workstation_configs(self.0.request, self.0.options)
937                .await
938                .map(crate::Response::into_body)
939        }
940
941        /// Streams each page in the collection.
942        pub fn by_page(
943            self,
944        ) -> impl google_cloud_gax::paginator::Paginator<
945            crate::model::ListUsableWorkstationConfigsResponse,
946            crate::Error,
947        > {
948            use std::clone::Clone;
949            let token = self.0.request.page_token.clone();
950            let execute = move |token: String| {
951                let mut builder = self.clone();
952                builder.0.request = builder.0.request.set_page_token(token);
953                builder.send()
954            };
955            google_cloud_gax::paginator::internal::new_paginator(token, execute)
956        }
957
958        /// Streams each item in the collection.
959        pub fn by_item(
960            self,
961        ) -> impl google_cloud_gax::paginator::ItemPaginator<
962            crate::model::ListUsableWorkstationConfigsResponse,
963            crate::Error,
964        > {
965            use google_cloud_gax::paginator::Paginator;
966            self.by_page().items()
967        }
968
969        /// Sets the value of [parent][crate::model::ListUsableWorkstationConfigsRequest::parent].
970        ///
971        /// This is a **required** field for requests.
972        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
973            self.0.request.parent = v.into();
974            self
975        }
976
977        /// Sets the value of [page_size][crate::model::ListUsableWorkstationConfigsRequest::page_size].
978        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
979            self.0.request.page_size = v.into();
980            self
981        }
982
983        /// Sets the value of [page_token][crate::model::ListUsableWorkstationConfigsRequest::page_token].
984        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
985            self.0.request.page_token = v.into();
986            self
987        }
988    }
989
990    #[doc(hidden)]
991    impl crate::RequestBuilder for ListUsableWorkstationConfigs {
992        fn request_options(&mut self) -> &mut crate::RequestOptions {
993            &mut self.0.options
994        }
995    }
996
997    /// The request builder for [Workstations::create_workstation_config][crate::client::Workstations::create_workstation_config] calls.
998    ///
999    /// # Example
1000    /// ```
1001    /// # use google_cloud_workstations_v1::builder::workstations::CreateWorkstationConfig;
1002    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1003    /// use google_cloud_lro::Poller;
1004    ///
1005    /// let builder = prepare_request_builder();
1006    /// let response = builder.poller().until_done().await?;
1007    /// # Ok(()) }
1008    ///
1009    /// fn prepare_request_builder() -> CreateWorkstationConfig {
1010    ///   # panic!();
1011    ///   // ... details omitted ...
1012    /// }
1013    /// ```
1014    #[derive(Clone, Debug)]
1015    pub struct CreateWorkstationConfig(
1016        RequestBuilder<crate::model::CreateWorkstationConfigRequest>,
1017    );
1018
1019    impl CreateWorkstationConfig {
1020        pub(crate) fn new(
1021            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1022        ) -> Self {
1023            Self(RequestBuilder::new(stub))
1024        }
1025
1026        /// Sets the full request, replacing any prior values.
1027        pub fn with_request<V: Into<crate::model::CreateWorkstationConfigRequest>>(
1028            mut self,
1029            v: V,
1030        ) -> Self {
1031            self.0.request = v.into();
1032            self
1033        }
1034
1035        /// Sets all the options, replacing any prior values.
1036        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1037            self.0.options = v.into();
1038            self
1039        }
1040
1041        /// Sends the request.
1042        ///
1043        /// # Long running operations
1044        ///
1045        /// This starts, but does not poll, a longrunning operation. More information
1046        /// on [create_workstation_config][crate::client::Workstations::create_workstation_config].
1047        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1048            (*self.0.stub)
1049                .create_workstation_config(self.0.request, self.0.options)
1050                .await
1051                .map(crate::Response::into_body)
1052        }
1053
1054        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_workstation_config`.
1055        pub fn poller(
1056            self,
1057        ) -> impl google_cloud_lro::Poller<
1058            crate::model::WorkstationConfig,
1059            crate::model::OperationMetadata,
1060        > {
1061            type Operation = google_cloud_lro::internal::Operation<
1062                crate::model::WorkstationConfig,
1063                crate::model::OperationMetadata,
1064            >;
1065            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1066            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1067
1068            let stub = self.0.stub.clone();
1069            let mut options = self.0.options.clone();
1070            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1071            let query = move |name| {
1072                let stub = stub.clone();
1073                let options = options.clone();
1074                async {
1075                    let op = GetOperation::new(stub)
1076                        .set_name(name)
1077                        .with_options(options)
1078                        .send()
1079                        .await?;
1080                    Ok(Operation::new(op))
1081                }
1082            };
1083
1084            let start = move || async {
1085                let op = self.send().await?;
1086                Ok(Operation::new(op))
1087            };
1088
1089            google_cloud_lro::internal::new_poller(
1090                polling_error_policy,
1091                polling_backoff_policy,
1092                start,
1093                query,
1094            )
1095        }
1096
1097        /// Sets the value of [parent][crate::model::CreateWorkstationConfigRequest::parent].
1098        ///
1099        /// This is a **required** field for requests.
1100        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1101            self.0.request.parent = v.into();
1102            self
1103        }
1104
1105        /// Sets the value of [workstation_config_id][crate::model::CreateWorkstationConfigRequest::workstation_config_id].
1106        ///
1107        /// This is a **required** field for requests.
1108        pub fn set_workstation_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1109            self.0.request.workstation_config_id = v.into();
1110            self
1111        }
1112
1113        /// Sets the value of [workstation_config][crate::model::CreateWorkstationConfigRequest::workstation_config].
1114        ///
1115        /// This is a **required** field for requests.
1116        pub fn set_workstation_config<T>(mut self, v: T) -> Self
1117        where
1118            T: std::convert::Into<crate::model::WorkstationConfig>,
1119        {
1120            self.0.request.workstation_config = std::option::Option::Some(v.into());
1121            self
1122        }
1123
1124        /// Sets or clears the value of [workstation_config][crate::model::CreateWorkstationConfigRequest::workstation_config].
1125        ///
1126        /// This is a **required** field for requests.
1127        pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1128        where
1129            T: std::convert::Into<crate::model::WorkstationConfig>,
1130        {
1131            self.0.request.workstation_config = v.map(|x| x.into());
1132            self
1133        }
1134
1135        /// Sets the value of [validate_only][crate::model::CreateWorkstationConfigRequest::validate_only].
1136        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1137            self.0.request.validate_only = v.into();
1138            self
1139        }
1140    }
1141
1142    #[doc(hidden)]
1143    impl crate::RequestBuilder for CreateWorkstationConfig {
1144        fn request_options(&mut self) -> &mut crate::RequestOptions {
1145            &mut self.0.options
1146        }
1147    }
1148
1149    /// The request builder for [Workstations::update_workstation_config][crate::client::Workstations::update_workstation_config] calls.
1150    ///
1151    /// # Example
1152    /// ```
1153    /// # use google_cloud_workstations_v1::builder::workstations::UpdateWorkstationConfig;
1154    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1155    /// use google_cloud_lro::Poller;
1156    ///
1157    /// let builder = prepare_request_builder();
1158    /// let response = builder.poller().until_done().await?;
1159    /// # Ok(()) }
1160    ///
1161    /// fn prepare_request_builder() -> UpdateWorkstationConfig {
1162    ///   # panic!();
1163    ///   // ... details omitted ...
1164    /// }
1165    /// ```
1166    #[derive(Clone, Debug)]
1167    pub struct UpdateWorkstationConfig(
1168        RequestBuilder<crate::model::UpdateWorkstationConfigRequest>,
1169    );
1170
1171    impl UpdateWorkstationConfig {
1172        pub(crate) fn new(
1173            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
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<crate::model::UpdateWorkstationConfigRequest>>(
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        ///
1195        /// # Long running operations
1196        ///
1197        /// This starts, but does not poll, a longrunning operation. More information
1198        /// on [update_workstation_config][crate::client::Workstations::update_workstation_config].
1199        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1200            (*self.0.stub)
1201                .update_workstation_config(self.0.request, self.0.options)
1202                .await
1203                .map(crate::Response::into_body)
1204        }
1205
1206        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_workstation_config`.
1207        pub fn poller(
1208            self,
1209        ) -> impl google_cloud_lro::Poller<
1210            crate::model::WorkstationConfig,
1211            crate::model::OperationMetadata,
1212        > {
1213            type Operation = google_cloud_lro::internal::Operation<
1214                crate::model::WorkstationConfig,
1215                crate::model::OperationMetadata,
1216            >;
1217            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1218            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1219
1220            let stub = self.0.stub.clone();
1221            let mut options = self.0.options.clone();
1222            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1223            let query = move |name| {
1224                let stub = stub.clone();
1225                let options = options.clone();
1226                async {
1227                    let op = GetOperation::new(stub)
1228                        .set_name(name)
1229                        .with_options(options)
1230                        .send()
1231                        .await?;
1232                    Ok(Operation::new(op))
1233                }
1234            };
1235
1236            let start = move || async {
1237                let op = self.send().await?;
1238                Ok(Operation::new(op))
1239            };
1240
1241            google_cloud_lro::internal::new_poller(
1242                polling_error_policy,
1243                polling_backoff_policy,
1244                start,
1245                query,
1246            )
1247        }
1248
1249        /// Sets the value of [workstation_config][crate::model::UpdateWorkstationConfigRequest::workstation_config].
1250        ///
1251        /// This is a **required** field for requests.
1252        pub fn set_workstation_config<T>(mut self, v: T) -> Self
1253        where
1254            T: std::convert::Into<crate::model::WorkstationConfig>,
1255        {
1256            self.0.request.workstation_config = std::option::Option::Some(v.into());
1257            self
1258        }
1259
1260        /// Sets or clears the value of [workstation_config][crate::model::UpdateWorkstationConfigRequest::workstation_config].
1261        ///
1262        /// This is a **required** field for requests.
1263        pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1264        where
1265            T: std::convert::Into<crate::model::WorkstationConfig>,
1266        {
1267            self.0.request.workstation_config = v.map(|x| x.into());
1268            self
1269        }
1270
1271        /// Sets the value of [update_mask][crate::model::UpdateWorkstationConfigRequest::update_mask].
1272        ///
1273        /// This is a **required** field for requests.
1274        pub fn set_update_mask<T>(mut self, v: T) -> Self
1275        where
1276            T: std::convert::Into<wkt::FieldMask>,
1277        {
1278            self.0.request.update_mask = std::option::Option::Some(v.into());
1279            self
1280        }
1281
1282        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkstationConfigRequest::update_mask].
1283        ///
1284        /// This is a **required** field for requests.
1285        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1286        where
1287            T: std::convert::Into<wkt::FieldMask>,
1288        {
1289            self.0.request.update_mask = v.map(|x| x.into());
1290            self
1291        }
1292
1293        /// Sets the value of [validate_only][crate::model::UpdateWorkstationConfigRequest::validate_only].
1294        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1295            self.0.request.validate_only = v.into();
1296            self
1297        }
1298
1299        /// Sets the value of [allow_missing][crate::model::UpdateWorkstationConfigRequest::allow_missing].
1300        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1301            self.0.request.allow_missing = v.into();
1302            self
1303        }
1304    }
1305
1306    #[doc(hidden)]
1307    impl crate::RequestBuilder for UpdateWorkstationConfig {
1308        fn request_options(&mut self) -> &mut crate::RequestOptions {
1309            &mut self.0.options
1310        }
1311    }
1312
1313    /// The request builder for [Workstations::delete_workstation_config][crate::client::Workstations::delete_workstation_config] calls.
1314    ///
1315    /// # Example
1316    /// ```
1317    /// # use google_cloud_workstations_v1::builder::workstations::DeleteWorkstationConfig;
1318    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1319    /// use google_cloud_lro::Poller;
1320    ///
1321    /// let builder = prepare_request_builder();
1322    /// let response = builder.poller().until_done().await?;
1323    /// # Ok(()) }
1324    ///
1325    /// fn prepare_request_builder() -> DeleteWorkstationConfig {
1326    ///   # panic!();
1327    ///   // ... details omitted ...
1328    /// }
1329    /// ```
1330    #[derive(Clone, Debug)]
1331    pub struct DeleteWorkstationConfig(
1332        RequestBuilder<crate::model::DeleteWorkstationConfigRequest>,
1333    );
1334
1335    impl DeleteWorkstationConfig {
1336        pub(crate) fn new(
1337            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1338        ) -> Self {
1339            Self(RequestBuilder::new(stub))
1340        }
1341
1342        /// Sets the full request, replacing any prior values.
1343        pub fn with_request<V: Into<crate::model::DeleteWorkstationConfigRequest>>(
1344            mut self,
1345            v: V,
1346        ) -> Self {
1347            self.0.request = v.into();
1348            self
1349        }
1350
1351        /// Sets all the options, replacing any prior values.
1352        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1353            self.0.options = v.into();
1354            self
1355        }
1356
1357        /// Sends the request.
1358        ///
1359        /// # Long running operations
1360        ///
1361        /// This starts, but does not poll, a longrunning operation. More information
1362        /// on [delete_workstation_config][crate::client::Workstations::delete_workstation_config].
1363        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1364            (*self.0.stub)
1365                .delete_workstation_config(self.0.request, self.0.options)
1366                .await
1367                .map(crate::Response::into_body)
1368        }
1369
1370        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_workstation_config`.
1371        pub fn poller(
1372            self,
1373        ) -> impl google_cloud_lro::Poller<
1374            crate::model::WorkstationConfig,
1375            crate::model::OperationMetadata,
1376        > {
1377            type Operation = google_cloud_lro::internal::Operation<
1378                crate::model::WorkstationConfig,
1379                crate::model::OperationMetadata,
1380            >;
1381            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1382            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1383
1384            let stub = self.0.stub.clone();
1385            let mut options = self.0.options.clone();
1386            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1387            let query = move |name| {
1388                let stub = stub.clone();
1389                let options = options.clone();
1390                async {
1391                    let op = GetOperation::new(stub)
1392                        .set_name(name)
1393                        .with_options(options)
1394                        .send()
1395                        .await?;
1396                    Ok(Operation::new(op))
1397                }
1398            };
1399
1400            let start = move || async {
1401                let op = self.send().await?;
1402                Ok(Operation::new(op))
1403            };
1404
1405            google_cloud_lro::internal::new_poller(
1406                polling_error_policy,
1407                polling_backoff_policy,
1408                start,
1409                query,
1410            )
1411        }
1412
1413        /// Sets the value of [name][crate::model::DeleteWorkstationConfigRequest::name].
1414        ///
1415        /// This is a **required** field for requests.
1416        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417            self.0.request.name = v.into();
1418            self
1419        }
1420
1421        /// Sets the value of [validate_only][crate::model::DeleteWorkstationConfigRequest::validate_only].
1422        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1423            self.0.request.validate_only = v.into();
1424            self
1425        }
1426
1427        /// Sets the value of [etag][crate::model::DeleteWorkstationConfigRequest::etag].
1428        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1429            self.0.request.etag = v.into();
1430            self
1431        }
1432
1433        /// Sets the value of [force][crate::model::DeleteWorkstationConfigRequest::force].
1434        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1435            self.0.request.force = v.into();
1436            self
1437        }
1438    }
1439
1440    #[doc(hidden)]
1441    impl crate::RequestBuilder for DeleteWorkstationConfig {
1442        fn request_options(&mut self) -> &mut crate::RequestOptions {
1443            &mut self.0.options
1444        }
1445    }
1446
1447    /// The request builder for [Workstations::get_workstation][crate::client::Workstations::get_workstation] calls.
1448    ///
1449    /// # Example
1450    /// ```
1451    /// # use google_cloud_workstations_v1::builder::workstations::GetWorkstation;
1452    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1453    ///
1454    /// let builder = prepare_request_builder();
1455    /// let response = builder.send().await?;
1456    /// # Ok(()) }
1457    ///
1458    /// fn prepare_request_builder() -> GetWorkstation {
1459    ///   # panic!();
1460    ///   // ... details omitted ...
1461    /// }
1462    /// ```
1463    #[derive(Clone, Debug)]
1464    pub struct GetWorkstation(RequestBuilder<crate::model::GetWorkstationRequest>);
1465
1466    impl GetWorkstation {
1467        pub(crate) fn new(
1468            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1469        ) -> Self {
1470            Self(RequestBuilder::new(stub))
1471        }
1472
1473        /// Sets the full request, replacing any prior values.
1474        pub fn with_request<V: Into<crate::model::GetWorkstationRequest>>(mut self, v: V) -> Self {
1475            self.0.request = v.into();
1476            self
1477        }
1478
1479        /// Sets all the options, replacing any prior values.
1480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481            self.0.options = v.into();
1482            self
1483        }
1484
1485        /// Sends the request.
1486        pub async fn send(self) -> Result<crate::model::Workstation> {
1487            (*self.0.stub)
1488                .get_workstation(self.0.request, self.0.options)
1489                .await
1490                .map(crate::Response::into_body)
1491        }
1492
1493        /// Sets the value of [name][crate::model::GetWorkstationRequest::name].
1494        ///
1495        /// This is a **required** field for requests.
1496        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497            self.0.request.name = v.into();
1498            self
1499        }
1500    }
1501
1502    #[doc(hidden)]
1503    impl crate::RequestBuilder for GetWorkstation {
1504        fn request_options(&mut self) -> &mut crate::RequestOptions {
1505            &mut self.0.options
1506        }
1507    }
1508
1509    /// The request builder for [Workstations::list_workstations][crate::client::Workstations::list_workstations] calls.
1510    ///
1511    /// # Example
1512    /// ```
1513    /// # use google_cloud_workstations_v1::builder::workstations::ListWorkstations;
1514    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1515    /// use google_cloud_gax::paginator::ItemPaginator;
1516    ///
1517    /// let builder = prepare_request_builder();
1518    /// let mut items = builder.by_item();
1519    /// while let Some(result) = items.next().await {
1520    ///   let item = result?;
1521    /// }
1522    /// # Ok(()) }
1523    ///
1524    /// fn prepare_request_builder() -> ListWorkstations {
1525    ///   # panic!();
1526    ///   // ... details omitted ...
1527    /// }
1528    /// ```
1529    #[derive(Clone, Debug)]
1530    pub struct ListWorkstations(RequestBuilder<crate::model::ListWorkstationsRequest>);
1531
1532    impl ListWorkstations {
1533        pub(crate) fn new(
1534            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1535        ) -> Self {
1536            Self(RequestBuilder::new(stub))
1537        }
1538
1539        /// Sets the full request, replacing any prior values.
1540        pub fn with_request<V: Into<crate::model::ListWorkstationsRequest>>(
1541            mut self,
1542            v: V,
1543        ) -> Self {
1544            self.0.request = v.into();
1545            self
1546        }
1547
1548        /// Sets all the options, replacing any prior values.
1549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1550            self.0.options = v.into();
1551            self
1552        }
1553
1554        /// Sends the request.
1555        pub async fn send(self) -> Result<crate::model::ListWorkstationsResponse> {
1556            (*self.0.stub)
1557                .list_workstations(self.0.request, self.0.options)
1558                .await
1559                .map(crate::Response::into_body)
1560        }
1561
1562        /// Streams each page in the collection.
1563        pub fn by_page(
1564            self,
1565        ) -> impl google_cloud_gax::paginator::Paginator<
1566            crate::model::ListWorkstationsResponse,
1567            crate::Error,
1568        > {
1569            use std::clone::Clone;
1570            let token = self.0.request.page_token.clone();
1571            let execute = move |token: String| {
1572                let mut builder = self.clone();
1573                builder.0.request = builder.0.request.set_page_token(token);
1574                builder.send()
1575            };
1576            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1577        }
1578
1579        /// Streams each item in the collection.
1580        pub fn by_item(
1581            self,
1582        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1583            crate::model::ListWorkstationsResponse,
1584            crate::Error,
1585        > {
1586            use google_cloud_gax::paginator::Paginator;
1587            self.by_page().items()
1588        }
1589
1590        /// Sets the value of [parent][crate::model::ListWorkstationsRequest::parent].
1591        ///
1592        /// This is a **required** field for requests.
1593        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1594            self.0.request.parent = v.into();
1595            self
1596        }
1597
1598        /// Sets the value of [page_size][crate::model::ListWorkstationsRequest::page_size].
1599        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1600            self.0.request.page_size = v.into();
1601            self
1602        }
1603
1604        /// Sets the value of [page_token][crate::model::ListWorkstationsRequest::page_token].
1605        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1606            self.0.request.page_token = v.into();
1607            self
1608        }
1609
1610        /// Sets the value of [filter][crate::model::ListWorkstationsRequest::filter].
1611        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1612            self.0.request.filter = v.into();
1613            self
1614        }
1615    }
1616
1617    #[doc(hidden)]
1618    impl crate::RequestBuilder for ListWorkstations {
1619        fn request_options(&mut self) -> &mut crate::RequestOptions {
1620            &mut self.0.options
1621        }
1622    }
1623
1624    /// The request builder for [Workstations::list_usable_workstations][crate::client::Workstations::list_usable_workstations] calls.
1625    ///
1626    /// # Example
1627    /// ```
1628    /// # use google_cloud_workstations_v1::builder::workstations::ListUsableWorkstations;
1629    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1630    /// use google_cloud_gax::paginator::ItemPaginator;
1631    ///
1632    /// let builder = prepare_request_builder();
1633    /// let mut items = builder.by_item();
1634    /// while let Some(result) = items.next().await {
1635    ///   let item = result?;
1636    /// }
1637    /// # Ok(()) }
1638    ///
1639    /// fn prepare_request_builder() -> ListUsableWorkstations {
1640    ///   # panic!();
1641    ///   // ... details omitted ...
1642    /// }
1643    /// ```
1644    #[derive(Clone, Debug)]
1645    pub struct ListUsableWorkstations(RequestBuilder<crate::model::ListUsableWorkstationsRequest>);
1646
1647    impl ListUsableWorkstations {
1648        pub(crate) fn new(
1649            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1650        ) -> Self {
1651            Self(RequestBuilder::new(stub))
1652        }
1653
1654        /// Sets the full request, replacing any prior values.
1655        pub fn with_request<V: Into<crate::model::ListUsableWorkstationsRequest>>(
1656            mut self,
1657            v: V,
1658        ) -> Self {
1659            self.0.request = v.into();
1660            self
1661        }
1662
1663        /// Sets all the options, replacing any prior values.
1664        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1665            self.0.options = v.into();
1666            self
1667        }
1668
1669        /// Sends the request.
1670        pub async fn send(self) -> Result<crate::model::ListUsableWorkstationsResponse> {
1671            (*self.0.stub)
1672                .list_usable_workstations(self.0.request, self.0.options)
1673                .await
1674                .map(crate::Response::into_body)
1675        }
1676
1677        /// Streams each page in the collection.
1678        pub fn by_page(
1679            self,
1680        ) -> impl google_cloud_gax::paginator::Paginator<
1681            crate::model::ListUsableWorkstationsResponse,
1682            crate::Error,
1683        > {
1684            use std::clone::Clone;
1685            let token = self.0.request.page_token.clone();
1686            let execute = move |token: String| {
1687                let mut builder = self.clone();
1688                builder.0.request = builder.0.request.set_page_token(token);
1689                builder.send()
1690            };
1691            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1692        }
1693
1694        /// Streams each item in the collection.
1695        pub fn by_item(
1696            self,
1697        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1698            crate::model::ListUsableWorkstationsResponse,
1699            crate::Error,
1700        > {
1701            use google_cloud_gax::paginator::Paginator;
1702            self.by_page().items()
1703        }
1704
1705        /// Sets the value of [parent][crate::model::ListUsableWorkstationsRequest::parent].
1706        ///
1707        /// This is a **required** field for requests.
1708        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1709            self.0.request.parent = v.into();
1710            self
1711        }
1712
1713        /// Sets the value of [page_size][crate::model::ListUsableWorkstationsRequest::page_size].
1714        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1715            self.0.request.page_size = v.into();
1716            self
1717        }
1718
1719        /// Sets the value of [page_token][crate::model::ListUsableWorkstationsRequest::page_token].
1720        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721            self.0.request.page_token = v.into();
1722            self
1723        }
1724    }
1725
1726    #[doc(hidden)]
1727    impl crate::RequestBuilder for ListUsableWorkstations {
1728        fn request_options(&mut self) -> &mut crate::RequestOptions {
1729            &mut self.0.options
1730        }
1731    }
1732
1733    /// The request builder for [Workstations::create_workstation][crate::client::Workstations::create_workstation] calls.
1734    ///
1735    /// # Example
1736    /// ```
1737    /// # use google_cloud_workstations_v1::builder::workstations::CreateWorkstation;
1738    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1739    /// use google_cloud_lro::Poller;
1740    ///
1741    /// let builder = prepare_request_builder();
1742    /// let response = builder.poller().until_done().await?;
1743    /// # Ok(()) }
1744    ///
1745    /// fn prepare_request_builder() -> CreateWorkstation {
1746    ///   # panic!();
1747    ///   // ... details omitted ...
1748    /// }
1749    /// ```
1750    #[derive(Clone, Debug)]
1751    pub struct CreateWorkstation(RequestBuilder<crate::model::CreateWorkstationRequest>);
1752
1753    impl CreateWorkstation {
1754        pub(crate) fn new(
1755            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1756        ) -> Self {
1757            Self(RequestBuilder::new(stub))
1758        }
1759
1760        /// Sets the full request, replacing any prior values.
1761        pub fn with_request<V: Into<crate::model::CreateWorkstationRequest>>(
1762            mut self,
1763            v: V,
1764        ) -> Self {
1765            self.0.request = v.into();
1766            self
1767        }
1768
1769        /// Sets all the options, replacing any prior values.
1770        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1771            self.0.options = v.into();
1772            self
1773        }
1774
1775        /// Sends the request.
1776        ///
1777        /// # Long running operations
1778        ///
1779        /// This starts, but does not poll, a longrunning operation. More information
1780        /// on [create_workstation][crate::client::Workstations::create_workstation].
1781        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1782            (*self.0.stub)
1783                .create_workstation(self.0.request, self.0.options)
1784                .await
1785                .map(crate::Response::into_body)
1786        }
1787
1788        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_workstation`.
1789        pub fn poller(
1790            self,
1791        ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1792        {
1793            type Operation = google_cloud_lro::internal::Operation<
1794                crate::model::Workstation,
1795                crate::model::OperationMetadata,
1796            >;
1797            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1798            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1799
1800            let stub = self.0.stub.clone();
1801            let mut options = self.0.options.clone();
1802            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1803            let query = move |name| {
1804                let stub = stub.clone();
1805                let options = options.clone();
1806                async {
1807                    let op = GetOperation::new(stub)
1808                        .set_name(name)
1809                        .with_options(options)
1810                        .send()
1811                        .await?;
1812                    Ok(Operation::new(op))
1813                }
1814            };
1815
1816            let start = move || async {
1817                let op = self.send().await?;
1818                Ok(Operation::new(op))
1819            };
1820
1821            google_cloud_lro::internal::new_poller(
1822                polling_error_policy,
1823                polling_backoff_policy,
1824                start,
1825                query,
1826            )
1827        }
1828
1829        /// Sets the value of [parent][crate::model::CreateWorkstationRequest::parent].
1830        ///
1831        /// This is a **required** field for requests.
1832        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1833            self.0.request.parent = v.into();
1834            self
1835        }
1836
1837        /// Sets the value of [workstation_id][crate::model::CreateWorkstationRequest::workstation_id].
1838        ///
1839        /// This is a **required** field for requests.
1840        pub fn set_workstation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1841            self.0.request.workstation_id = v.into();
1842            self
1843        }
1844
1845        /// Sets the value of [workstation][crate::model::CreateWorkstationRequest::workstation].
1846        ///
1847        /// This is a **required** field for requests.
1848        pub fn set_workstation<T>(mut self, v: T) -> Self
1849        where
1850            T: std::convert::Into<crate::model::Workstation>,
1851        {
1852            self.0.request.workstation = std::option::Option::Some(v.into());
1853            self
1854        }
1855
1856        /// Sets or clears the value of [workstation][crate::model::CreateWorkstationRequest::workstation].
1857        ///
1858        /// This is a **required** field for requests.
1859        pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
1860        where
1861            T: std::convert::Into<crate::model::Workstation>,
1862        {
1863            self.0.request.workstation = v.map(|x| x.into());
1864            self
1865        }
1866
1867        /// Sets the value of [validate_only][crate::model::CreateWorkstationRequest::validate_only].
1868        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1869            self.0.request.validate_only = v.into();
1870            self
1871        }
1872    }
1873
1874    #[doc(hidden)]
1875    impl crate::RequestBuilder for CreateWorkstation {
1876        fn request_options(&mut self) -> &mut crate::RequestOptions {
1877            &mut self.0.options
1878        }
1879    }
1880
1881    /// The request builder for [Workstations::update_workstation][crate::client::Workstations::update_workstation] calls.
1882    ///
1883    /// # Example
1884    /// ```
1885    /// # use google_cloud_workstations_v1::builder::workstations::UpdateWorkstation;
1886    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
1887    /// use google_cloud_lro::Poller;
1888    ///
1889    /// let builder = prepare_request_builder();
1890    /// let response = builder.poller().until_done().await?;
1891    /// # Ok(()) }
1892    ///
1893    /// fn prepare_request_builder() -> UpdateWorkstation {
1894    ///   # panic!();
1895    ///   // ... details omitted ...
1896    /// }
1897    /// ```
1898    #[derive(Clone, Debug)]
1899    pub struct UpdateWorkstation(RequestBuilder<crate::model::UpdateWorkstationRequest>);
1900
1901    impl UpdateWorkstation {
1902        pub(crate) fn new(
1903            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1904        ) -> Self {
1905            Self(RequestBuilder::new(stub))
1906        }
1907
1908        /// Sets the full request, replacing any prior values.
1909        pub fn with_request<V: Into<crate::model::UpdateWorkstationRequest>>(
1910            mut self,
1911            v: V,
1912        ) -> Self {
1913            self.0.request = v.into();
1914            self
1915        }
1916
1917        /// Sets all the options, replacing any prior values.
1918        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1919            self.0.options = v.into();
1920            self
1921        }
1922
1923        /// Sends the request.
1924        ///
1925        /// # Long running operations
1926        ///
1927        /// This starts, but does not poll, a longrunning operation. More information
1928        /// on [update_workstation][crate::client::Workstations::update_workstation].
1929        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1930            (*self.0.stub)
1931                .update_workstation(self.0.request, self.0.options)
1932                .await
1933                .map(crate::Response::into_body)
1934        }
1935
1936        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_workstation`.
1937        pub fn poller(
1938            self,
1939        ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1940        {
1941            type Operation = google_cloud_lro::internal::Operation<
1942                crate::model::Workstation,
1943                crate::model::OperationMetadata,
1944            >;
1945            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1946            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1947
1948            let stub = self.0.stub.clone();
1949            let mut options = self.0.options.clone();
1950            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1951            let query = move |name| {
1952                let stub = stub.clone();
1953                let options = options.clone();
1954                async {
1955                    let op = GetOperation::new(stub)
1956                        .set_name(name)
1957                        .with_options(options)
1958                        .send()
1959                        .await?;
1960                    Ok(Operation::new(op))
1961                }
1962            };
1963
1964            let start = move || async {
1965                let op = self.send().await?;
1966                Ok(Operation::new(op))
1967            };
1968
1969            google_cloud_lro::internal::new_poller(
1970                polling_error_policy,
1971                polling_backoff_policy,
1972                start,
1973                query,
1974            )
1975        }
1976
1977        /// Sets the value of [workstation][crate::model::UpdateWorkstationRequest::workstation].
1978        ///
1979        /// This is a **required** field for requests.
1980        pub fn set_workstation<T>(mut self, v: T) -> Self
1981        where
1982            T: std::convert::Into<crate::model::Workstation>,
1983        {
1984            self.0.request.workstation = std::option::Option::Some(v.into());
1985            self
1986        }
1987
1988        /// Sets or clears the value of [workstation][crate::model::UpdateWorkstationRequest::workstation].
1989        ///
1990        /// This is a **required** field for requests.
1991        pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
1992        where
1993            T: std::convert::Into<crate::model::Workstation>,
1994        {
1995            self.0.request.workstation = v.map(|x| x.into());
1996            self
1997        }
1998
1999        /// Sets the value of [update_mask][crate::model::UpdateWorkstationRequest::update_mask].
2000        ///
2001        /// This is a **required** field for requests.
2002        pub fn set_update_mask<T>(mut self, v: T) -> Self
2003        where
2004            T: std::convert::Into<wkt::FieldMask>,
2005        {
2006            self.0.request.update_mask = std::option::Option::Some(v.into());
2007            self
2008        }
2009
2010        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkstationRequest::update_mask].
2011        ///
2012        /// This is a **required** field for requests.
2013        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2014        where
2015            T: std::convert::Into<wkt::FieldMask>,
2016        {
2017            self.0.request.update_mask = v.map(|x| x.into());
2018            self
2019        }
2020
2021        /// Sets the value of [validate_only][crate::model::UpdateWorkstationRequest::validate_only].
2022        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2023            self.0.request.validate_only = v.into();
2024            self
2025        }
2026
2027        /// Sets the value of [allow_missing][crate::model::UpdateWorkstationRequest::allow_missing].
2028        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2029            self.0.request.allow_missing = v.into();
2030            self
2031        }
2032    }
2033
2034    #[doc(hidden)]
2035    impl crate::RequestBuilder for UpdateWorkstation {
2036        fn request_options(&mut self) -> &mut crate::RequestOptions {
2037            &mut self.0.options
2038        }
2039    }
2040
2041    /// The request builder for [Workstations::delete_workstation][crate::client::Workstations::delete_workstation] calls.
2042    ///
2043    /// # Example
2044    /// ```
2045    /// # use google_cloud_workstations_v1::builder::workstations::DeleteWorkstation;
2046    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2047    /// use google_cloud_lro::Poller;
2048    ///
2049    /// let builder = prepare_request_builder();
2050    /// let response = builder.poller().until_done().await?;
2051    /// # Ok(()) }
2052    ///
2053    /// fn prepare_request_builder() -> DeleteWorkstation {
2054    ///   # panic!();
2055    ///   // ... details omitted ...
2056    /// }
2057    /// ```
2058    #[derive(Clone, Debug)]
2059    pub struct DeleteWorkstation(RequestBuilder<crate::model::DeleteWorkstationRequest>);
2060
2061    impl DeleteWorkstation {
2062        pub(crate) fn new(
2063            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2064        ) -> Self {
2065            Self(RequestBuilder::new(stub))
2066        }
2067
2068        /// Sets the full request, replacing any prior values.
2069        pub fn with_request<V: Into<crate::model::DeleteWorkstationRequest>>(
2070            mut self,
2071            v: V,
2072        ) -> Self {
2073            self.0.request = v.into();
2074            self
2075        }
2076
2077        /// Sets all the options, replacing any prior values.
2078        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2079            self.0.options = v.into();
2080            self
2081        }
2082
2083        /// Sends the request.
2084        ///
2085        /// # Long running operations
2086        ///
2087        /// This starts, but does not poll, a longrunning operation. More information
2088        /// on [delete_workstation][crate::client::Workstations::delete_workstation].
2089        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2090            (*self.0.stub)
2091                .delete_workstation(self.0.request, self.0.options)
2092                .await
2093                .map(crate::Response::into_body)
2094        }
2095
2096        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_workstation`.
2097        pub fn poller(
2098            self,
2099        ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2100        {
2101            type Operation = google_cloud_lro::internal::Operation<
2102                crate::model::Workstation,
2103                crate::model::OperationMetadata,
2104            >;
2105            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2106            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2107
2108            let stub = self.0.stub.clone();
2109            let mut options = self.0.options.clone();
2110            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2111            let query = move |name| {
2112                let stub = stub.clone();
2113                let options = options.clone();
2114                async {
2115                    let op = GetOperation::new(stub)
2116                        .set_name(name)
2117                        .with_options(options)
2118                        .send()
2119                        .await?;
2120                    Ok(Operation::new(op))
2121                }
2122            };
2123
2124            let start = move || async {
2125                let op = self.send().await?;
2126                Ok(Operation::new(op))
2127            };
2128
2129            google_cloud_lro::internal::new_poller(
2130                polling_error_policy,
2131                polling_backoff_policy,
2132                start,
2133                query,
2134            )
2135        }
2136
2137        /// Sets the value of [name][crate::model::DeleteWorkstationRequest::name].
2138        ///
2139        /// This is a **required** field for requests.
2140        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2141            self.0.request.name = v.into();
2142            self
2143        }
2144
2145        /// Sets the value of [validate_only][crate::model::DeleteWorkstationRequest::validate_only].
2146        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2147            self.0.request.validate_only = v.into();
2148            self
2149        }
2150
2151        /// Sets the value of [etag][crate::model::DeleteWorkstationRequest::etag].
2152        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2153            self.0.request.etag = v.into();
2154            self
2155        }
2156    }
2157
2158    #[doc(hidden)]
2159    impl crate::RequestBuilder for DeleteWorkstation {
2160        fn request_options(&mut self) -> &mut crate::RequestOptions {
2161            &mut self.0.options
2162        }
2163    }
2164
2165    /// The request builder for [Workstations::start_workstation][crate::client::Workstations::start_workstation] calls.
2166    ///
2167    /// # Example
2168    /// ```
2169    /// # use google_cloud_workstations_v1::builder::workstations::StartWorkstation;
2170    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2171    /// use google_cloud_lro::Poller;
2172    ///
2173    /// let builder = prepare_request_builder();
2174    /// let response = builder.poller().until_done().await?;
2175    /// # Ok(()) }
2176    ///
2177    /// fn prepare_request_builder() -> StartWorkstation {
2178    ///   # panic!();
2179    ///   // ... details omitted ...
2180    /// }
2181    /// ```
2182    #[derive(Clone, Debug)]
2183    pub struct StartWorkstation(RequestBuilder<crate::model::StartWorkstationRequest>);
2184
2185    impl StartWorkstation {
2186        pub(crate) fn new(
2187            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2188        ) -> Self {
2189            Self(RequestBuilder::new(stub))
2190        }
2191
2192        /// Sets the full request, replacing any prior values.
2193        pub fn with_request<V: Into<crate::model::StartWorkstationRequest>>(
2194            mut self,
2195            v: V,
2196        ) -> Self {
2197            self.0.request = v.into();
2198            self
2199        }
2200
2201        /// Sets all the options, replacing any prior values.
2202        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2203            self.0.options = v.into();
2204            self
2205        }
2206
2207        /// Sends the request.
2208        ///
2209        /// # Long running operations
2210        ///
2211        /// This starts, but does not poll, a longrunning operation. More information
2212        /// on [start_workstation][crate::client::Workstations::start_workstation].
2213        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2214            (*self.0.stub)
2215                .start_workstation(self.0.request, self.0.options)
2216                .await
2217                .map(crate::Response::into_body)
2218        }
2219
2220        /// Creates a [Poller][google_cloud_lro::Poller] to work with `start_workstation`.
2221        pub fn poller(
2222            self,
2223        ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2224        {
2225            type Operation = google_cloud_lro::internal::Operation<
2226                crate::model::Workstation,
2227                crate::model::OperationMetadata,
2228            >;
2229            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2230            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2231
2232            let stub = self.0.stub.clone();
2233            let mut options = self.0.options.clone();
2234            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2235            let query = move |name| {
2236                let stub = stub.clone();
2237                let options = options.clone();
2238                async {
2239                    let op = GetOperation::new(stub)
2240                        .set_name(name)
2241                        .with_options(options)
2242                        .send()
2243                        .await?;
2244                    Ok(Operation::new(op))
2245                }
2246            };
2247
2248            let start = move || async {
2249                let op = self.send().await?;
2250                Ok(Operation::new(op))
2251            };
2252
2253            google_cloud_lro::internal::new_poller(
2254                polling_error_policy,
2255                polling_backoff_policy,
2256                start,
2257                query,
2258            )
2259        }
2260
2261        /// Sets the value of [name][crate::model::StartWorkstationRequest::name].
2262        ///
2263        /// This is a **required** field for requests.
2264        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2265            self.0.request.name = v.into();
2266            self
2267        }
2268
2269        /// Sets the value of [validate_only][crate::model::StartWorkstationRequest::validate_only].
2270        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2271            self.0.request.validate_only = v.into();
2272            self
2273        }
2274
2275        /// Sets the value of [etag][crate::model::StartWorkstationRequest::etag].
2276        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2277            self.0.request.etag = v.into();
2278            self
2279        }
2280
2281        /// Sets the value of [boost_config][crate::model::StartWorkstationRequest::boost_config].
2282        pub fn set_boost_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
2283            self.0.request.boost_config = v.into();
2284            self
2285        }
2286    }
2287
2288    #[doc(hidden)]
2289    impl crate::RequestBuilder for StartWorkstation {
2290        fn request_options(&mut self) -> &mut crate::RequestOptions {
2291            &mut self.0.options
2292        }
2293    }
2294
2295    /// The request builder for [Workstations::stop_workstation][crate::client::Workstations::stop_workstation] calls.
2296    ///
2297    /// # Example
2298    /// ```
2299    /// # use google_cloud_workstations_v1::builder::workstations::StopWorkstation;
2300    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2301    /// use google_cloud_lro::Poller;
2302    ///
2303    /// let builder = prepare_request_builder();
2304    /// let response = builder.poller().until_done().await?;
2305    /// # Ok(()) }
2306    ///
2307    /// fn prepare_request_builder() -> StopWorkstation {
2308    ///   # panic!();
2309    ///   // ... details omitted ...
2310    /// }
2311    /// ```
2312    #[derive(Clone, Debug)]
2313    pub struct StopWorkstation(RequestBuilder<crate::model::StopWorkstationRequest>);
2314
2315    impl StopWorkstation {
2316        pub(crate) fn new(
2317            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2318        ) -> Self {
2319            Self(RequestBuilder::new(stub))
2320        }
2321
2322        /// Sets the full request, replacing any prior values.
2323        pub fn with_request<V: Into<crate::model::StopWorkstationRequest>>(mut self, v: V) -> Self {
2324            self.0.request = v.into();
2325            self
2326        }
2327
2328        /// Sets all the options, replacing any prior values.
2329        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2330            self.0.options = v.into();
2331            self
2332        }
2333
2334        /// Sends the request.
2335        ///
2336        /// # Long running operations
2337        ///
2338        /// This starts, but does not poll, a longrunning operation. More information
2339        /// on [stop_workstation][crate::client::Workstations::stop_workstation].
2340        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2341            (*self.0.stub)
2342                .stop_workstation(self.0.request, self.0.options)
2343                .await
2344                .map(crate::Response::into_body)
2345        }
2346
2347        /// Creates a [Poller][google_cloud_lro::Poller] to work with `stop_workstation`.
2348        pub fn poller(
2349            self,
2350        ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2351        {
2352            type Operation = google_cloud_lro::internal::Operation<
2353                crate::model::Workstation,
2354                crate::model::OperationMetadata,
2355            >;
2356            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2357            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2358
2359            let stub = self.0.stub.clone();
2360            let mut options = self.0.options.clone();
2361            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2362            let query = move |name| {
2363                let stub = stub.clone();
2364                let options = options.clone();
2365                async {
2366                    let op = GetOperation::new(stub)
2367                        .set_name(name)
2368                        .with_options(options)
2369                        .send()
2370                        .await?;
2371                    Ok(Operation::new(op))
2372                }
2373            };
2374
2375            let start = move || async {
2376                let op = self.send().await?;
2377                Ok(Operation::new(op))
2378            };
2379
2380            google_cloud_lro::internal::new_poller(
2381                polling_error_policy,
2382                polling_backoff_policy,
2383                start,
2384                query,
2385            )
2386        }
2387
2388        /// Sets the value of [name][crate::model::StopWorkstationRequest::name].
2389        ///
2390        /// This is a **required** field for requests.
2391        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2392            self.0.request.name = v.into();
2393            self
2394        }
2395
2396        /// Sets the value of [validate_only][crate::model::StopWorkstationRequest::validate_only].
2397        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2398            self.0.request.validate_only = v.into();
2399            self
2400        }
2401
2402        /// Sets the value of [etag][crate::model::StopWorkstationRequest::etag].
2403        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2404            self.0.request.etag = v.into();
2405            self
2406        }
2407    }
2408
2409    #[doc(hidden)]
2410    impl crate::RequestBuilder for StopWorkstation {
2411        fn request_options(&mut self) -> &mut crate::RequestOptions {
2412            &mut self.0.options
2413        }
2414    }
2415
2416    /// The request builder for [Workstations::generate_access_token][crate::client::Workstations::generate_access_token] calls.
2417    ///
2418    /// # Example
2419    /// ```
2420    /// # use google_cloud_workstations_v1::builder::workstations::GenerateAccessToken;
2421    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2422    ///
2423    /// let builder = prepare_request_builder();
2424    /// let response = builder.send().await?;
2425    /// # Ok(()) }
2426    ///
2427    /// fn prepare_request_builder() -> GenerateAccessToken {
2428    ///   # panic!();
2429    ///   // ... details omitted ...
2430    /// }
2431    /// ```
2432    #[derive(Clone, Debug)]
2433    pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
2434
2435    impl GenerateAccessToken {
2436        pub(crate) fn new(
2437            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2438        ) -> Self {
2439            Self(RequestBuilder::new(stub))
2440        }
2441
2442        /// Sets the full request, replacing any prior values.
2443        pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
2444            mut self,
2445            v: V,
2446        ) -> Self {
2447            self.0.request = v.into();
2448            self
2449        }
2450
2451        /// Sets all the options, replacing any prior values.
2452        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2453            self.0.options = v.into();
2454            self
2455        }
2456
2457        /// Sends the request.
2458        pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
2459            (*self.0.stub)
2460                .generate_access_token(self.0.request, self.0.options)
2461                .await
2462                .map(crate::Response::into_body)
2463        }
2464
2465        /// Sets the value of [workstation][crate::model::GenerateAccessTokenRequest::workstation].
2466        ///
2467        /// This is a **required** field for requests.
2468        pub fn set_workstation<T: Into<std::string::String>>(mut self, v: T) -> Self {
2469            self.0.request.workstation = v.into();
2470            self
2471        }
2472
2473        /// Sets the value of [port][crate::model::GenerateAccessTokenRequest::port].
2474        pub fn set_port<T: Into<i32>>(mut self, v: T) -> Self {
2475            self.0.request.port = v.into();
2476            self
2477        }
2478
2479        /// Sets the value of [expiration][crate::model::GenerateAccessTokenRequest::expiration].
2480        ///
2481        /// Note that all the setters affecting `expiration` are
2482        /// mutually exclusive.
2483        pub fn set_expiration<
2484            T: Into<Option<crate::model::generate_access_token_request::Expiration>>,
2485        >(
2486            mut self,
2487            v: T,
2488        ) -> Self {
2489            self.0.request.expiration = v.into();
2490            self
2491        }
2492
2493        /// Sets the value of [expiration][crate::model::GenerateAccessTokenRequest::expiration]
2494        /// to hold a `ExpireTime`.
2495        ///
2496        /// Note that all the setters affecting `expiration` are
2497        /// mutually exclusive.
2498        pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
2499            mut self,
2500            v: T,
2501        ) -> Self {
2502            self.0.request = self.0.request.set_expire_time(v);
2503            self
2504        }
2505
2506        /// Sets the value of [expiration][crate::model::GenerateAccessTokenRequest::expiration]
2507        /// to hold a `Ttl`.
2508        ///
2509        /// Note that all the setters affecting `expiration` are
2510        /// mutually exclusive.
2511        pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
2512            mut self,
2513            v: T,
2514        ) -> Self {
2515            self.0.request = self.0.request.set_ttl(v);
2516            self
2517        }
2518    }
2519
2520    #[doc(hidden)]
2521    impl crate::RequestBuilder for GenerateAccessToken {
2522        fn request_options(&mut self) -> &mut crate::RequestOptions {
2523            &mut self.0.options
2524        }
2525    }
2526
2527    /// The request builder for [Workstations::set_iam_policy][crate::client::Workstations::set_iam_policy] calls.
2528    ///
2529    /// # Example
2530    /// ```
2531    /// # use google_cloud_workstations_v1::builder::workstations::SetIamPolicy;
2532    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2533    ///
2534    /// let builder = prepare_request_builder();
2535    /// let response = builder.send().await?;
2536    /// # Ok(()) }
2537    ///
2538    /// fn prepare_request_builder() -> SetIamPolicy {
2539    ///   # panic!();
2540    ///   // ... details omitted ...
2541    /// }
2542    /// ```
2543    #[derive(Clone, Debug)]
2544    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2545
2546    impl SetIamPolicy {
2547        pub(crate) fn new(
2548            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2549        ) -> Self {
2550            Self(RequestBuilder::new(stub))
2551        }
2552
2553        /// Sets the full request, replacing any prior values.
2554        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2555            mut self,
2556            v: V,
2557        ) -> Self {
2558            self.0.request = v.into();
2559            self
2560        }
2561
2562        /// Sets all the options, replacing any prior values.
2563        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2564            self.0.options = v.into();
2565            self
2566        }
2567
2568        /// Sends the request.
2569        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2570            (*self.0.stub)
2571                .set_iam_policy(self.0.request, self.0.options)
2572                .await
2573                .map(crate::Response::into_body)
2574        }
2575
2576        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2577        ///
2578        /// This is a **required** field for requests.
2579        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2580            self.0.request.resource = v.into();
2581            self
2582        }
2583
2584        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2585        ///
2586        /// This is a **required** field for requests.
2587        pub fn set_policy<T>(mut self, v: T) -> Self
2588        where
2589            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2590        {
2591            self.0.request.policy = std::option::Option::Some(v.into());
2592            self
2593        }
2594
2595        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2596        ///
2597        /// This is a **required** field for requests.
2598        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2599        where
2600            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2601        {
2602            self.0.request.policy = v.map(|x| x.into());
2603            self
2604        }
2605
2606        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2607        pub fn set_update_mask<T>(mut self, v: T) -> Self
2608        where
2609            T: std::convert::Into<wkt::FieldMask>,
2610        {
2611            self.0.request.update_mask = std::option::Option::Some(v.into());
2612            self
2613        }
2614
2615        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2616        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2617        where
2618            T: std::convert::Into<wkt::FieldMask>,
2619        {
2620            self.0.request.update_mask = v.map(|x| x.into());
2621            self
2622        }
2623    }
2624
2625    #[doc(hidden)]
2626    impl crate::RequestBuilder for SetIamPolicy {
2627        fn request_options(&mut self) -> &mut crate::RequestOptions {
2628            &mut self.0.options
2629        }
2630    }
2631
2632    /// The request builder for [Workstations::get_iam_policy][crate::client::Workstations::get_iam_policy] calls.
2633    ///
2634    /// # Example
2635    /// ```
2636    /// # use google_cloud_workstations_v1::builder::workstations::GetIamPolicy;
2637    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2638    ///
2639    /// let builder = prepare_request_builder();
2640    /// let response = builder.send().await?;
2641    /// # Ok(()) }
2642    ///
2643    /// fn prepare_request_builder() -> GetIamPolicy {
2644    ///   # panic!();
2645    ///   // ... details omitted ...
2646    /// }
2647    /// ```
2648    #[derive(Clone, Debug)]
2649    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2650
2651    impl GetIamPolicy {
2652        pub(crate) fn new(
2653            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2654        ) -> Self {
2655            Self(RequestBuilder::new(stub))
2656        }
2657
2658        /// Sets the full request, replacing any prior values.
2659        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2660            mut self,
2661            v: V,
2662        ) -> Self {
2663            self.0.request = v.into();
2664            self
2665        }
2666
2667        /// Sets all the options, replacing any prior values.
2668        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2669            self.0.options = v.into();
2670            self
2671        }
2672
2673        /// Sends the request.
2674        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2675            (*self.0.stub)
2676                .get_iam_policy(self.0.request, self.0.options)
2677                .await
2678                .map(crate::Response::into_body)
2679        }
2680
2681        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2682        ///
2683        /// This is a **required** field for requests.
2684        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685            self.0.request.resource = v.into();
2686            self
2687        }
2688
2689        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2690        pub fn set_options<T>(mut self, v: T) -> Self
2691        where
2692            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2693        {
2694            self.0.request.options = std::option::Option::Some(v.into());
2695            self
2696        }
2697
2698        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2699        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2700        where
2701            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2702        {
2703            self.0.request.options = v.map(|x| x.into());
2704            self
2705        }
2706    }
2707
2708    #[doc(hidden)]
2709    impl crate::RequestBuilder for GetIamPolicy {
2710        fn request_options(&mut self) -> &mut crate::RequestOptions {
2711            &mut self.0.options
2712        }
2713    }
2714
2715    /// The request builder for [Workstations::test_iam_permissions][crate::client::Workstations::test_iam_permissions] calls.
2716    ///
2717    /// # Example
2718    /// ```
2719    /// # use google_cloud_workstations_v1::builder::workstations::TestIamPermissions;
2720    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2721    ///
2722    /// let builder = prepare_request_builder();
2723    /// let response = builder.send().await?;
2724    /// # Ok(()) }
2725    ///
2726    /// fn prepare_request_builder() -> TestIamPermissions {
2727    ///   # panic!();
2728    ///   // ... details omitted ...
2729    /// }
2730    /// ```
2731    #[derive(Clone, Debug)]
2732    pub struct TestIamPermissions(
2733        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2734    );
2735
2736    impl TestIamPermissions {
2737        pub(crate) fn new(
2738            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2739        ) -> Self {
2740            Self(RequestBuilder::new(stub))
2741        }
2742
2743        /// Sets the full request, replacing any prior values.
2744        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2745            mut self,
2746            v: V,
2747        ) -> Self {
2748            self.0.request = v.into();
2749            self
2750        }
2751
2752        /// Sets all the options, replacing any prior values.
2753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2754            self.0.options = v.into();
2755            self
2756        }
2757
2758        /// Sends the request.
2759        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2760            (*self.0.stub)
2761                .test_iam_permissions(self.0.request, self.0.options)
2762                .await
2763                .map(crate::Response::into_body)
2764        }
2765
2766        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2767        ///
2768        /// This is a **required** field for requests.
2769        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770            self.0.request.resource = v.into();
2771            self
2772        }
2773
2774        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2775        ///
2776        /// This is a **required** field for requests.
2777        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2778        where
2779            T: std::iter::IntoIterator<Item = V>,
2780            V: std::convert::Into<std::string::String>,
2781        {
2782            use std::iter::Iterator;
2783            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2784            self
2785        }
2786    }
2787
2788    #[doc(hidden)]
2789    impl crate::RequestBuilder for TestIamPermissions {
2790        fn request_options(&mut self) -> &mut crate::RequestOptions {
2791            &mut self.0.options
2792        }
2793    }
2794
2795    /// The request builder for [Workstations::list_operations][crate::client::Workstations::list_operations] calls.
2796    ///
2797    /// # Example
2798    /// ```
2799    /// # use google_cloud_workstations_v1::builder::workstations::ListOperations;
2800    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2801    /// use google_cloud_gax::paginator::ItemPaginator;
2802    ///
2803    /// let builder = prepare_request_builder();
2804    /// let mut items = builder.by_item();
2805    /// while let Some(result) = items.next().await {
2806    ///   let item = result?;
2807    /// }
2808    /// # Ok(()) }
2809    ///
2810    /// fn prepare_request_builder() -> ListOperations {
2811    ///   # panic!();
2812    ///   // ... details omitted ...
2813    /// }
2814    /// ```
2815    #[derive(Clone, Debug)]
2816    pub struct ListOperations(
2817        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2818    );
2819
2820    impl ListOperations {
2821        pub(crate) fn new(
2822            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2823        ) -> Self {
2824            Self(RequestBuilder::new(stub))
2825        }
2826
2827        /// Sets the full request, replacing any prior values.
2828        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2829            mut self,
2830            v: V,
2831        ) -> Self {
2832            self.0.request = v.into();
2833            self
2834        }
2835
2836        /// Sets all the options, replacing any prior values.
2837        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2838            self.0.options = v.into();
2839            self
2840        }
2841
2842        /// Sends the request.
2843        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2844            (*self.0.stub)
2845                .list_operations(self.0.request, self.0.options)
2846                .await
2847                .map(crate::Response::into_body)
2848        }
2849
2850        /// Streams each page in the collection.
2851        pub fn by_page(
2852            self,
2853        ) -> impl google_cloud_gax::paginator::Paginator<
2854            google_cloud_longrunning::model::ListOperationsResponse,
2855            crate::Error,
2856        > {
2857            use std::clone::Clone;
2858            let token = self.0.request.page_token.clone();
2859            let execute = move |token: String| {
2860                let mut builder = self.clone();
2861                builder.0.request = builder.0.request.set_page_token(token);
2862                builder.send()
2863            };
2864            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2865        }
2866
2867        /// Streams each item in the collection.
2868        pub fn by_item(
2869            self,
2870        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2871            google_cloud_longrunning::model::ListOperationsResponse,
2872            crate::Error,
2873        > {
2874            use google_cloud_gax::paginator::Paginator;
2875            self.by_page().items()
2876        }
2877
2878        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2879        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880            self.0.request.name = v.into();
2881            self
2882        }
2883
2884        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2885        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886            self.0.request.filter = v.into();
2887            self
2888        }
2889
2890        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2891        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2892            self.0.request.page_size = v.into();
2893            self
2894        }
2895
2896        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2897        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2898            self.0.request.page_token = v.into();
2899            self
2900        }
2901
2902        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2903        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2904            self.0.request.return_partial_success = v.into();
2905            self
2906        }
2907    }
2908
2909    #[doc(hidden)]
2910    impl crate::RequestBuilder for ListOperations {
2911        fn request_options(&mut self) -> &mut crate::RequestOptions {
2912            &mut self.0.options
2913        }
2914    }
2915
2916    /// The request builder for [Workstations::get_operation][crate::client::Workstations::get_operation] calls.
2917    ///
2918    /// # Example
2919    /// ```
2920    /// # use google_cloud_workstations_v1::builder::workstations::GetOperation;
2921    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2922    ///
2923    /// let builder = prepare_request_builder();
2924    /// let response = builder.send().await?;
2925    /// # Ok(()) }
2926    ///
2927    /// fn prepare_request_builder() -> GetOperation {
2928    ///   # panic!();
2929    ///   // ... details omitted ...
2930    /// }
2931    /// ```
2932    #[derive(Clone, Debug)]
2933    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2934
2935    impl GetOperation {
2936        pub(crate) fn new(
2937            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2938        ) -> Self {
2939            Self(RequestBuilder::new(stub))
2940        }
2941
2942        /// Sets the full request, replacing any prior values.
2943        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2944            mut self,
2945            v: V,
2946        ) -> Self {
2947            self.0.request = v.into();
2948            self
2949        }
2950
2951        /// Sets all the options, replacing any prior values.
2952        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2953            self.0.options = v.into();
2954            self
2955        }
2956
2957        /// Sends the request.
2958        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2959            (*self.0.stub)
2960                .get_operation(self.0.request, self.0.options)
2961                .await
2962                .map(crate::Response::into_body)
2963        }
2964
2965        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2966        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2967            self.0.request.name = v.into();
2968            self
2969        }
2970    }
2971
2972    #[doc(hidden)]
2973    impl crate::RequestBuilder for GetOperation {
2974        fn request_options(&mut self) -> &mut crate::RequestOptions {
2975            &mut self.0.options
2976        }
2977    }
2978
2979    /// The request builder for [Workstations::delete_operation][crate::client::Workstations::delete_operation] calls.
2980    ///
2981    /// # Example
2982    /// ```
2983    /// # use google_cloud_workstations_v1::builder::workstations::DeleteOperation;
2984    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
2985    ///
2986    /// let builder = prepare_request_builder();
2987    /// let response = builder.send().await?;
2988    /// # Ok(()) }
2989    ///
2990    /// fn prepare_request_builder() -> DeleteOperation {
2991    ///   # panic!();
2992    ///   // ... details omitted ...
2993    /// }
2994    /// ```
2995    #[derive(Clone, Debug)]
2996    pub struct DeleteOperation(
2997        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2998    );
2999
3000    impl DeleteOperation {
3001        pub(crate) fn new(
3002            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3003        ) -> Self {
3004            Self(RequestBuilder::new(stub))
3005        }
3006
3007        /// Sets the full request, replacing any prior values.
3008        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3009            mut self,
3010            v: V,
3011        ) -> Self {
3012            self.0.request = v.into();
3013            self
3014        }
3015
3016        /// Sets all the options, replacing any prior values.
3017        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3018            self.0.options = v.into();
3019            self
3020        }
3021
3022        /// Sends the request.
3023        pub async fn send(self) -> Result<()> {
3024            (*self.0.stub)
3025                .delete_operation(self.0.request, self.0.options)
3026                .await
3027                .map(crate::Response::into_body)
3028        }
3029
3030        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3031        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3032            self.0.request.name = v.into();
3033            self
3034        }
3035    }
3036
3037    #[doc(hidden)]
3038    impl crate::RequestBuilder for DeleteOperation {
3039        fn request_options(&mut self) -> &mut crate::RequestOptions {
3040            &mut self.0.options
3041        }
3042    }
3043
3044    /// The request builder for [Workstations::cancel_operation][crate::client::Workstations::cancel_operation] calls.
3045    ///
3046    /// # Example
3047    /// ```
3048    /// # use google_cloud_workstations_v1::builder::workstations::CancelOperation;
3049    /// # async fn sample() -> google_cloud_workstations_v1::Result<()> {
3050    ///
3051    /// let builder = prepare_request_builder();
3052    /// let response = builder.send().await?;
3053    /// # Ok(()) }
3054    ///
3055    /// fn prepare_request_builder() -> CancelOperation {
3056    ///   # panic!();
3057    ///   // ... details omitted ...
3058    /// }
3059    /// ```
3060    #[derive(Clone, Debug)]
3061    pub struct CancelOperation(
3062        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3063    );
3064
3065    impl CancelOperation {
3066        pub(crate) fn new(
3067            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3068        ) -> Self {
3069            Self(RequestBuilder::new(stub))
3070        }
3071
3072        /// Sets the full request, replacing any prior values.
3073        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3074            mut self,
3075            v: V,
3076        ) -> Self {
3077            self.0.request = v.into();
3078            self
3079        }
3080
3081        /// Sets all the options, replacing any prior values.
3082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3083            self.0.options = v.into();
3084            self
3085        }
3086
3087        /// Sends the request.
3088        pub async fn send(self) -> Result<()> {
3089            (*self.0.stub)
3090                .cancel_operation(self.0.request, self.0.options)
3091                .await
3092                .map(crate::Response::into_body)
3093        }
3094
3095        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3096        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3097            self.0.request.name = v.into();
3098            self
3099        }
3100    }
3101
3102    #[doc(hidden)]
3103    impl crate::RequestBuilder for CancelOperation {
3104        fn request_options(&mut self) -> &mut crate::RequestOptions {
3105            &mut self.0.options
3106        }
3107    }
3108}