1pub mod workstations {
19 use crate::Result;
20
21 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 #[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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
182 self.0.options = v.into();
183 self
184 }
185
186 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 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 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 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 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 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
243 #[doc(hidden)]
244 impl crate::RequestBuilder for ListWorkstationClusters {
245 fn request_options(&mut self) -> &mut crate::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateWorkstationCluster(
269 RequestBuilder<crate::model::CreateWorkstationClusterRequest>,
270 );
271
272 impl CreateWorkstationCluster {
273 pub(crate) fn new(
274 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
275 ) -> Self {
276 Self(RequestBuilder::new(stub))
277 }
278
279 pub fn with_request<V: Into<crate::model::CreateWorkstationClusterRequest>>(
281 mut self,
282 v: V,
283 ) -> Self {
284 self.0.request = v.into();
285 self
286 }
287
288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
290 self.0.options = v.into();
291 self
292 }
293
294 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
301 (*self.0.stub)
302 .create_workstation_cluster(self.0.request, self.0.options)
303 .await
304 .map(crate::Response::into_body)
305 }
306
307 pub fn poller(
309 self,
310 ) -> impl google_cloud_lro::Poller<
311 crate::model::WorkstationCluster,
312 crate::model::OperationMetadata,
313 > {
314 type Operation = google_cloud_lro::internal::Operation<
315 crate::model::WorkstationCluster,
316 crate::model::OperationMetadata,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320
321 let stub = self.0.stub.clone();
322 let mut options = self.0.options.clone();
323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
324 let query = move |name| {
325 let stub = stub.clone();
326 let options = options.clone();
327 async {
328 let op = GetOperation::new(stub)
329 .set_name(name)
330 .with_options(options)
331 .send()
332 .await?;
333 Ok(Operation::new(op))
334 }
335 };
336
337 let start = move || async {
338 let op = self.send().await?;
339 Ok(Operation::new(op))
340 };
341
342 google_cloud_lro::internal::new_poller(
343 polling_error_policy,
344 polling_backoff_policy,
345 start,
346 query,
347 )
348 }
349
350 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.parent = v.into();
355 self
356 }
357
358 pub fn set_workstation_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
362 self.0.request.workstation_cluster_id = v.into();
363 self
364 }
365
366 pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
370 where
371 T: std::convert::Into<crate::model::WorkstationCluster>,
372 {
373 self.0.request.workstation_cluster = std::option::Option::Some(v.into());
374 self
375 }
376
377 pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
381 where
382 T: std::convert::Into<crate::model::WorkstationCluster>,
383 {
384 self.0.request.workstation_cluster = v.map(|x| x.into());
385 self
386 }
387
388 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
390 self.0.request.validate_only = v.into();
391 self
392 }
393 }
394
395 #[doc(hidden)]
396 impl crate::RequestBuilder for CreateWorkstationCluster {
397 fn request_options(&mut self) -> &mut crate::RequestOptions {
398 &mut self.0.options
399 }
400 }
401
402 #[derive(Clone, Debug)]
420 pub struct UpdateWorkstationCluster(
421 RequestBuilder<crate::model::UpdateWorkstationClusterRequest>,
422 );
423
424 impl UpdateWorkstationCluster {
425 pub(crate) fn new(
426 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
427 ) -> Self {
428 Self(RequestBuilder::new(stub))
429 }
430
431 pub fn with_request<V: Into<crate::model::UpdateWorkstationClusterRequest>>(
433 mut self,
434 v: V,
435 ) -> Self {
436 self.0.request = v.into();
437 self
438 }
439
440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
442 self.0.options = v.into();
443 self
444 }
445
446 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
453 (*self.0.stub)
454 .update_workstation_cluster(self.0.request, self.0.options)
455 .await
456 .map(crate::Response::into_body)
457 }
458
459 pub fn poller(
461 self,
462 ) -> impl google_cloud_lro::Poller<
463 crate::model::WorkstationCluster,
464 crate::model::OperationMetadata,
465 > {
466 type Operation = google_cloud_lro::internal::Operation<
467 crate::model::WorkstationCluster,
468 crate::model::OperationMetadata,
469 >;
470 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
471 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 google_cloud_lro::internal::new_poller(
495 polling_error_policy,
496 polling_backoff_policy,
497 start,
498 query,
499 )
500 }
501
502 pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
506 where
507 T: std::convert::Into<crate::model::WorkstationCluster>,
508 {
509 self.0.request.workstation_cluster = std::option::Option::Some(v.into());
510 self
511 }
512
513 pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<crate::model::WorkstationCluster>,
519 {
520 self.0.request.workstation_cluster = v.map(|x| x.into());
521 self
522 }
523
524 pub fn set_update_mask<T>(mut self, v: T) -> Self
528 where
529 T: std::convert::Into<wkt::FieldMask>,
530 {
531 self.0.request.update_mask = std::option::Option::Some(v.into());
532 self
533 }
534
535 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<wkt::FieldMask>,
541 {
542 self.0.request.update_mask = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
548 self.0.request.validate_only = v.into();
549 self
550 }
551
552 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
554 self.0.request.allow_missing = v.into();
555 self
556 }
557 }
558
559 #[doc(hidden)]
560 impl crate::RequestBuilder for UpdateWorkstationCluster {
561 fn request_options(&mut self) -> &mut crate::RequestOptions {
562 &mut self.0.options
563 }
564 }
565
566 #[derive(Clone, Debug)]
584 pub struct DeleteWorkstationCluster(
585 RequestBuilder<crate::model::DeleteWorkstationClusterRequest>,
586 );
587
588 impl DeleteWorkstationCluster {
589 pub(crate) fn new(
590 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
591 ) -> Self {
592 Self(RequestBuilder::new(stub))
593 }
594
595 pub fn with_request<V: Into<crate::model::DeleteWorkstationClusterRequest>>(
597 mut self,
598 v: V,
599 ) -> Self {
600 self.0.request = v.into();
601 self
602 }
603
604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
606 self.0.options = v.into();
607 self
608 }
609
610 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
617 (*self.0.stub)
618 .delete_workstation_cluster(self.0.request, self.0.options)
619 .await
620 .map(crate::Response::into_body)
621 }
622
623 pub fn poller(
625 self,
626 ) -> impl google_cloud_lro::Poller<
627 crate::model::WorkstationCluster,
628 crate::model::OperationMetadata,
629 > {
630 type Operation = google_cloud_lro::internal::Operation<
631 crate::model::WorkstationCluster,
632 crate::model::OperationMetadata,
633 >;
634 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
635 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
636
637 let stub = self.0.stub.clone();
638 let mut options = self.0.options.clone();
639 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
640 let query = move |name| {
641 let stub = stub.clone();
642 let options = options.clone();
643 async {
644 let op = GetOperation::new(stub)
645 .set_name(name)
646 .with_options(options)
647 .send()
648 .await?;
649 Ok(Operation::new(op))
650 }
651 };
652
653 let start = move || async {
654 let op = self.send().await?;
655 Ok(Operation::new(op))
656 };
657
658 google_cloud_lro::internal::new_poller(
659 polling_error_policy,
660 polling_backoff_policy,
661 start,
662 query,
663 )
664 }
665
666 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
670 self.0.request.name = v.into();
671 self
672 }
673
674 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
676 self.0.request.validate_only = v.into();
677 self
678 }
679
680 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
682 self.0.request.etag = v.into();
683 self
684 }
685
686 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
688 self.0.request.force = v.into();
689 self
690 }
691 }
692
693 #[doc(hidden)]
694 impl crate::RequestBuilder for DeleteWorkstationCluster {
695 fn request_options(&mut self) -> &mut crate::RequestOptions {
696 &mut self.0.options
697 }
698 }
699
700 #[derive(Clone, Debug)]
717 pub struct GetWorkstationConfig(RequestBuilder<crate::model::GetWorkstationConfigRequest>);
718
719 impl GetWorkstationConfig {
720 pub(crate) fn new(
721 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
722 ) -> Self {
723 Self(RequestBuilder::new(stub))
724 }
725
726 pub fn with_request<V: Into<crate::model::GetWorkstationConfigRequest>>(
728 mut self,
729 v: V,
730 ) -> Self {
731 self.0.request = v.into();
732 self
733 }
734
735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
737 self.0.options = v.into();
738 self
739 }
740
741 pub async fn send(self) -> Result<crate::model::WorkstationConfig> {
743 (*self.0.stub)
744 .get_workstation_config(self.0.request, self.0.options)
745 .await
746 .map(crate::Response::into_body)
747 }
748
749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
753 self.0.request.name = v.into();
754 self
755 }
756 }
757
758 #[doc(hidden)]
759 impl crate::RequestBuilder for GetWorkstationConfig {
760 fn request_options(&mut self) -> &mut crate::RequestOptions {
761 &mut self.0.options
762 }
763 }
764
765 #[derive(Clone, Debug)]
786 pub struct ListWorkstationConfigs(RequestBuilder<crate::model::ListWorkstationConfigsRequest>);
787
788 impl ListWorkstationConfigs {
789 pub(crate) fn new(
790 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
791 ) -> Self {
792 Self(RequestBuilder::new(stub))
793 }
794
795 pub fn with_request<V: Into<crate::model::ListWorkstationConfigsRequest>>(
797 mut self,
798 v: V,
799 ) -> Self {
800 self.0.request = v.into();
801 self
802 }
803
804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
806 self.0.options = v.into();
807 self
808 }
809
810 pub async fn send(self) -> Result<crate::model::ListWorkstationConfigsResponse> {
812 (*self.0.stub)
813 .list_workstation_configs(self.0.request, self.0.options)
814 .await
815 .map(crate::Response::into_body)
816 }
817
818 pub fn by_page(
820 self,
821 ) -> impl google_cloud_gax::paginator::Paginator<
822 crate::model::ListWorkstationConfigsResponse,
823 crate::Error,
824 > {
825 use std::clone::Clone;
826 let token = self.0.request.page_token.clone();
827 let execute = move |token: String| {
828 let mut builder = self.clone();
829 builder.0.request = builder.0.request.set_page_token(token);
830 builder.send()
831 };
832 google_cloud_gax::paginator::internal::new_paginator(token, execute)
833 }
834
835 pub fn by_item(
837 self,
838 ) -> impl google_cloud_gax::paginator::ItemPaginator<
839 crate::model::ListWorkstationConfigsResponse,
840 crate::Error,
841 > {
842 use google_cloud_gax::paginator::Paginator;
843 self.by_page().items()
844 }
845
846 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
850 self.0.request.parent = v.into();
851 self
852 }
853
854 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
856 self.0.request.page_size = v.into();
857 self
858 }
859
860 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
862 self.0.request.page_token = v.into();
863 self
864 }
865 }
866
867 #[doc(hidden)]
868 impl crate::RequestBuilder for ListWorkstationConfigs {
869 fn request_options(&mut self) -> &mut crate::RequestOptions {
870 &mut self.0.options
871 }
872 }
873
874 #[derive(Clone, Debug)]
895 pub struct ListUsableWorkstationConfigs(
896 RequestBuilder<crate::model::ListUsableWorkstationConfigsRequest>,
897 );
898
899 impl ListUsableWorkstationConfigs {
900 pub(crate) fn new(
901 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
902 ) -> Self {
903 Self(RequestBuilder::new(stub))
904 }
905
906 pub fn with_request<V: Into<crate::model::ListUsableWorkstationConfigsRequest>>(
908 mut self,
909 v: V,
910 ) -> Self {
911 self.0.request = v.into();
912 self
913 }
914
915 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
917 self.0.options = v.into();
918 self
919 }
920
921 pub async fn send(self) -> Result<crate::model::ListUsableWorkstationConfigsResponse> {
923 (*self.0.stub)
924 .list_usable_workstation_configs(self.0.request, self.0.options)
925 .await
926 .map(crate::Response::into_body)
927 }
928
929 pub fn by_page(
931 self,
932 ) -> impl google_cloud_gax::paginator::Paginator<
933 crate::model::ListUsableWorkstationConfigsResponse,
934 crate::Error,
935 > {
936 use std::clone::Clone;
937 let token = self.0.request.page_token.clone();
938 let execute = move |token: String| {
939 let mut builder = self.clone();
940 builder.0.request = builder.0.request.set_page_token(token);
941 builder.send()
942 };
943 google_cloud_gax::paginator::internal::new_paginator(token, execute)
944 }
945
946 pub fn by_item(
948 self,
949 ) -> impl google_cloud_gax::paginator::ItemPaginator<
950 crate::model::ListUsableWorkstationConfigsResponse,
951 crate::Error,
952 > {
953 use google_cloud_gax::paginator::Paginator;
954 self.by_page().items()
955 }
956
957 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
961 self.0.request.parent = v.into();
962 self
963 }
964
965 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
967 self.0.request.page_size = v.into();
968 self
969 }
970
971 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.page_token = v.into();
974 self
975 }
976 }
977
978 #[doc(hidden)]
979 impl crate::RequestBuilder for ListUsableWorkstationConfigs {
980 fn request_options(&mut self) -> &mut crate::RequestOptions {
981 &mut self.0.options
982 }
983 }
984
985 #[derive(Clone, Debug)]
1003 pub struct CreateWorkstationConfig(
1004 RequestBuilder<crate::model::CreateWorkstationConfigRequest>,
1005 );
1006
1007 impl CreateWorkstationConfig {
1008 pub(crate) fn new(
1009 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1010 ) -> Self {
1011 Self(RequestBuilder::new(stub))
1012 }
1013
1014 pub fn with_request<V: Into<crate::model::CreateWorkstationConfigRequest>>(
1016 mut self,
1017 v: V,
1018 ) -> Self {
1019 self.0.request = v.into();
1020 self
1021 }
1022
1023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1025 self.0.options = v.into();
1026 self
1027 }
1028
1029 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1036 (*self.0.stub)
1037 .create_workstation_config(self.0.request, self.0.options)
1038 .await
1039 .map(crate::Response::into_body)
1040 }
1041
1042 pub fn poller(
1044 self,
1045 ) -> impl google_cloud_lro::Poller<
1046 crate::model::WorkstationConfig,
1047 crate::model::OperationMetadata,
1048 > {
1049 type Operation = google_cloud_lro::internal::Operation<
1050 crate::model::WorkstationConfig,
1051 crate::model::OperationMetadata,
1052 >;
1053 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1054 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1055
1056 let stub = self.0.stub.clone();
1057 let mut options = self.0.options.clone();
1058 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1059 let query = move |name| {
1060 let stub = stub.clone();
1061 let options = options.clone();
1062 async {
1063 let op = GetOperation::new(stub)
1064 .set_name(name)
1065 .with_options(options)
1066 .send()
1067 .await?;
1068 Ok(Operation::new(op))
1069 }
1070 };
1071
1072 let start = move || async {
1073 let op = self.send().await?;
1074 Ok(Operation::new(op))
1075 };
1076
1077 google_cloud_lro::internal::new_poller(
1078 polling_error_policy,
1079 polling_backoff_policy,
1080 start,
1081 query,
1082 )
1083 }
1084
1085 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1089 self.0.request.parent = v.into();
1090 self
1091 }
1092
1093 pub fn set_workstation_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1097 self.0.request.workstation_config_id = v.into();
1098 self
1099 }
1100
1101 pub fn set_workstation_config<T>(mut self, v: T) -> Self
1105 where
1106 T: std::convert::Into<crate::model::WorkstationConfig>,
1107 {
1108 self.0.request.workstation_config = std::option::Option::Some(v.into());
1109 self
1110 }
1111
1112 pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1116 where
1117 T: std::convert::Into<crate::model::WorkstationConfig>,
1118 {
1119 self.0.request.workstation_config = v.map(|x| x.into());
1120 self
1121 }
1122
1123 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1125 self.0.request.validate_only = v.into();
1126 self
1127 }
1128 }
1129
1130 #[doc(hidden)]
1131 impl crate::RequestBuilder for CreateWorkstationConfig {
1132 fn request_options(&mut self) -> &mut crate::RequestOptions {
1133 &mut self.0.options
1134 }
1135 }
1136
1137 #[derive(Clone, Debug)]
1155 pub struct UpdateWorkstationConfig(
1156 RequestBuilder<crate::model::UpdateWorkstationConfigRequest>,
1157 );
1158
1159 impl UpdateWorkstationConfig {
1160 pub(crate) fn new(
1161 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1162 ) -> Self {
1163 Self(RequestBuilder::new(stub))
1164 }
1165
1166 pub fn with_request<V: Into<crate::model::UpdateWorkstationConfigRequest>>(
1168 mut self,
1169 v: V,
1170 ) -> Self {
1171 self.0.request = v.into();
1172 self
1173 }
1174
1175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1177 self.0.options = v.into();
1178 self
1179 }
1180
1181 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1188 (*self.0.stub)
1189 .update_workstation_config(self.0.request, self.0.options)
1190 .await
1191 .map(crate::Response::into_body)
1192 }
1193
1194 pub fn poller(
1196 self,
1197 ) -> impl google_cloud_lro::Poller<
1198 crate::model::WorkstationConfig,
1199 crate::model::OperationMetadata,
1200 > {
1201 type Operation = google_cloud_lro::internal::Operation<
1202 crate::model::WorkstationConfig,
1203 crate::model::OperationMetadata,
1204 >;
1205 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1206 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1207
1208 let stub = self.0.stub.clone();
1209 let mut options = self.0.options.clone();
1210 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1211 let query = move |name| {
1212 let stub = stub.clone();
1213 let options = options.clone();
1214 async {
1215 let op = GetOperation::new(stub)
1216 .set_name(name)
1217 .with_options(options)
1218 .send()
1219 .await?;
1220 Ok(Operation::new(op))
1221 }
1222 };
1223
1224 let start = move || async {
1225 let op = self.send().await?;
1226 Ok(Operation::new(op))
1227 };
1228
1229 google_cloud_lro::internal::new_poller(
1230 polling_error_policy,
1231 polling_backoff_policy,
1232 start,
1233 query,
1234 )
1235 }
1236
1237 pub fn set_workstation_config<T>(mut self, v: T) -> Self
1241 where
1242 T: std::convert::Into<crate::model::WorkstationConfig>,
1243 {
1244 self.0.request.workstation_config = std::option::Option::Some(v.into());
1245 self
1246 }
1247
1248 pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1252 where
1253 T: std::convert::Into<crate::model::WorkstationConfig>,
1254 {
1255 self.0.request.workstation_config = v.map(|x| x.into());
1256 self
1257 }
1258
1259 pub fn set_update_mask<T>(mut self, v: T) -> Self
1263 where
1264 T: std::convert::Into<wkt::FieldMask>,
1265 {
1266 self.0.request.update_mask = std::option::Option::Some(v.into());
1267 self
1268 }
1269
1270 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1274 where
1275 T: std::convert::Into<wkt::FieldMask>,
1276 {
1277 self.0.request.update_mask = v.map(|x| x.into());
1278 self
1279 }
1280
1281 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1283 self.0.request.validate_only = v.into();
1284 self
1285 }
1286
1287 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1289 self.0.request.allow_missing = v.into();
1290 self
1291 }
1292 }
1293
1294 #[doc(hidden)]
1295 impl crate::RequestBuilder for UpdateWorkstationConfig {
1296 fn request_options(&mut self) -> &mut crate::RequestOptions {
1297 &mut self.0.options
1298 }
1299 }
1300
1301 #[derive(Clone, Debug)]
1319 pub struct DeleteWorkstationConfig(
1320 RequestBuilder<crate::model::DeleteWorkstationConfigRequest>,
1321 );
1322
1323 impl DeleteWorkstationConfig {
1324 pub(crate) fn new(
1325 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1326 ) -> Self {
1327 Self(RequestBuilder::new(stub))
1328 }
1329
1330 pub fn with_request<V: Into<crate::model::DeleteWorkstationConfigRequest>>(
1332 mut self,
1333 v: V,
1334 ) -> Self {
1335 self.0.request = v.into();
1336 self
1337 }
1338
1339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1341 self.0.options = v.into();
1342 self
1343 }
1344
1345 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1352 (*self.0.stub)
1353 .delete_workstation_config(self.0.request, self.0.options)
1354 .await
1355 .map(crate::Response::into_body)
1356 }
1357
1358 pub fn poller(
1360 self,
1361 ) -> impl google_cloud_lro::Poller<
1362 crate::model::WorkstationConfig,
1363 crate::model::OperationMetadata,
1364 > {
1365 type Operation = google_cloud_lro::internal::Operation<
1366 crate::model::WorkstationConfig,
1367 crate::model::OperationMetadata,
1368 >;
1369 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1370 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1371
1372 let stub = self.0.stub.clone();
1373 let mut options = self.0.options.clone();
1374 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1375 let query = move |name| {
1376 let stub = stub.clone();
1377 let options = options.clone();
1378 async {
1379 let op = GetOperation::new(stub)
1380 .set_name(name)
1381 .with_options(options)
1382 .send()
1383 .await?;
1384 Ok(Operation::new(op))
1385 }
1386 };
1387
1388 let start = move || async {
1389 let op = self.send().await?;
1390 Ok(Operation::new(op))
1391 };
1392
1393 google_cloud_lro::internal::new_poller(
1394 polling_error_policy,
1395 polling_backoff_policy,
1396 start,
1397 query,
1398 )
1399 }
1400
1401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1405 self.0.request.name = v.into();
1406 self
1407 }
1408
1409 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1411 self.0.request.validate_only = v.into();
1412 self
1413 }
1414
1415 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417 self.0.request.etag = v.into();
1418 self
1419 }
1420
1421 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1423 self.0.request.force = v.into();
1424 self
1425 }
1426 }
1427
1428 #[doc(hidden)]
1429 impl crate::RequestBuilder for DeleteWorkstationConfig {
1430 fn request_options(&mut self) -> &mut crate::RequestOptions {
1431 &mut self.0.options
1432 }
1433 }
1434
1435 #[derive(Clone, Debug)]
1452 pub struct GetWorkstation(RequestBuilder<crate::model::GetWorkstationRequest>);
1453
1454 impl GetWorkstation {
1455 pub(crate) fn new(
1456 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1457 ) -> Self {
1458 Self(RequestBuilder::new(stub))
1459 }
1460
1461 pub fn with_request<V: Into<crate::model::GetWorkstationRequest>>(mut self, v: V) -> Self {
1463 self.0.request = v.into();
1464 self
1465 }
1466
1467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1469 self.0.options = v.into();
1470 self
1471 }
1472
1473 pub async fn send(self) -> Result<crate::model::Workstation> {
1475 (*self.0.stub)
1476 .get_workstation(self.0.request, self.0.options)
1477 .await
1478 .map(crate::Response::into_body)
1479 }
1480
1481 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1485 self.0.request.name = v.into();
1486 self
1487 }
1488 }
1489
1490 #[doc(hidden)]
1491 impl crate::RequestBuilder for GetWorkstation {
1492 fn request_options(&mut self) -> &mut crate::RequestOptions {
1493 &mut self.0.options
1494 }
1495 }
1496
1497 #[derive(Clone, Debug)]
1518 pub struct ListWorkstations(RequestBuilder<crate::model::ListWorkstationsRequest>);
1519
1520 impl ListWorkstations {
1521 pub(crate) fn new(
1522 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1523 ) -> Self {
1524 Self(RequestBuilder::new(stub))
1525 }
1526
1527 pub fn with_request<V: Into<crate::model::ListWorkstationsRequest>>(
1529 mut self,
1530 v: V,
1531 ) -> Self {
1532 self.0.request = v.into();
1533 self
1534 }
1535
1536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1538 self.0.options = v.into();
1539 self
1540 }
1541
1542 pub async fn send(self) -> Result<crate::model::ListWorkstationsResponse> {
1544 (*self.0.stub)
1545 .list_workstations(self.0.request, self.0.options)
1546 .await
1547 .map(crate::Response::into_body)
1548 }
1549
1550 pub fn by_page(
1552 self,
1553 ) -> impl google_cloud_gax::paginator::Paginator<
1554 crate::model::ListWorkstationsResponse,
1555 crate::Error,
1556 > {
1557 use std::clone::Clone;
1558 let token = self.0.request.page_token.clone();
1559 let execute = move |token: String| {
1560 let mut builder = self.clone();
1561 builder.0.request = builder.0.request.set_page_token(token);
1562 builder.send()
1563 };
1564 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1565 }
1566
1567 pub fn by_item(
1569 self,
1570 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1571 crate::model::ListWorkstationsResponse,
1572 crate::Error,
1573 > {
1574 use google_cloud_gax::paginator::Paginator;
1575 self.by_page().items()
1576 }
1577
1578 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.0.request.parent = v.into();
1583 self
1584 }
1585
1586 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1588 self.0.request.page_size = v.into();
1589 self
1590 }
1591
1592 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1594 self.0.request.page_token = v.into();
1595 self
1596 }
1597 }
1598
1599 #[doc(hidden)]
1600 impl crate::RequestBuilder for ListWorkstations {
1601 fn request_options(&mut self) -> &mut crate::RequestOptions {
1602 &mut self.0.options
1603 }
1604 }
1605
1606 #[derive(Clone, Debug)]
1627 pub struct ListUsableWorkstations(RequestBuilder<crate::model::ListUsableWorkstationsRequest>);
1628
1629 impl ListUsableWorkstations {
1630 pub(crate) fn new(
1631 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1632 ) -> Self {
1633 Self(RequestBuilder::new(stub))
1634 }
1635
1636 pub fn with_request<V: Into<crate::model::ListUsableWorkstationsRequest>>(
1638 mut self,
1639 v: V,
1640 ) -> Self {
1641 self.0.request = v.into();
1642 self
1643 }
1644
1645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1647 self.0.options = v.into();
1648 self
1649 }
1650
1651 pub async fn send(self) -> Result<crate::model::ListUsableWorkstationsResponse> {
1653 (*self.0.stub)
1654 .list_usable_workstations(self.0.request, self.0.options)
1655 .await
1656 .map(crate::Response::into_body)
1657 }
1658
1659 pub fn by_page(
1661 self,
1662 ) -> impl google_cloud_gax::paginator::Paginator<
1663 crate::model::ListUsableWorkstationsResponse,
1664 crate::Error,
1665 > {
1666 use std::clone::Clone;
1667 let token = self.0.request.page_token.clone();
1668 let execute = move |token: String| {
1669 let mut builder = self.clone();
1670 builder.0.request = builder.0.request.set_page_token(token);
1671 builder.send()
1672 };
1673 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1674 }
1675
1676 pub fn by_item(
1678 self,
1679 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1680 crate::model::ListUsableWorkstationsResponse,
1681 crate::Error,
1682 > {
1683 use google_cloud_gax::paginator::Paginator;
1684 self.by_page().items()
1685 }
1686
1687 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.0.request.parent = v.into();
1692 self
1693 }
1694
1695 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1697 self.0.request.page_size = v.into();
1698 self
1699 }
1700
1701 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.page_token = v.into();
1704 self
1705 }
1706 }
1707
1708 #[doc(hidden)]
1709 impl crate::RequestBuilder for ListUsableWorkstations {
1710 fn request_options(&mut self) -> &mut crate::RequestOptions {
1711 &mut self.0.options
1712 }
1713 }
1714
1715 #[derive(Clone, Debug)]
1733 pub struct CreateWorkstation(RequestBuilder<crate::model::CreateWorkstationRequest>);
1734
1735 impl CreateWorkstation {
1736 pub(crate) fn new(
1737 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1738 ) -> Self {
1739 Self(RequestBuilder::new(stub))
1740 }
1741
1742 pub fn with_request<V: Into<crate::model::CreateWorkstationRequest>>(
1744 mut self,
1745 v: V,
1746 ) -> Self {
1747 self.0.request = v.into();
1748 self
1749 }
1750
1751 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1753 self.0.options = v.into();
1754 self
1755 }
1756
1757 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1764 (*self.0.stub)
1765 .create_workstation(self.0.request, self.0.options)
1766 .await
1767 .map(crate::Response::into_body)
1768 }
1769
1770 pub fn poller(
1772 self,
1773 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1774 {
1775 type Operation = google_cloud_lro::internal::Operation<
1776 crate::model::Workstation,
1777 crate::model::OperationMetadata,
1778 >;
1779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1781
1782 let stub = self.0.stub.clone();
1783 let mut options = self.0.options.clone();
1784 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1785 let query = move |name| {
1786 let stub = stub.clone();
1787 let options = options.clone();
1788 async {
1789 let op = GetOperation::new(stub)
1790 .set_name(name)
1791 .with_options(options)
1792 .send()
1793 .await?;
1794 Ok(Operation::new(op))
1795 }
1796 };
1797
1798 let start = move || async {
1799 let op = self.send().await?;
1800 Ok(Operation::new(op))
1801 };
1802
1803 google_cloud_lro::internal::new_poller(
1804 polling_error_policy,
1805 polling_backoff_policy,
1806 start,
1807 query,
1808 )
1809 }
1810
1811 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815 self.0.request.parent = v.into();
1816 self
1817 }
1818
1819 pub fn set_workstation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1823 self.0.request.workstation_id = v.into();
1824 self
1825 }
1826
1827 pub fn set_workstation<T>(mut self, v: T) -> Self
1831 where
1832 T: std::convert::Into<crate::model::Workstation>,
1833 {
1834 self.0.request.workstation = std::option::Option::Some(v.into());
1835 self
1836 }
1837
1838 pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
1842 where
1843 T: std::convert::Into<crate::model::Workstation>,
1844 {
1845 self.0.request.workstation = v.map(|x| x.into());
1846 self
1847 }
1848
1849 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1851 self.0.request.validate_only = v.into();
1852 self
1853 }
1854 }
1855
1856 #[doc(hidden)]
1857 impl crate::RequestBuilder for CreateWorkstation {
1858 fn request_options(&mut self) -> &mut crate::RequestOptions {
1859 &mut self.0.options
1860 }
1861 }
1862
1863 #[derive(Clone, Debug)]
1881 pub struct UpdateWorkstation(RequestBuilder<crate::model::UpdateWorkstationRequest>);
1882
1883 impl UpdateWorkstation {
1884 pub(crate) fn new(
1885 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1886 ) -> Self {
1887 Self(RequestBuilder::new(stub))
1888 }
1889
1890 pub fn with_request<V: Into<crate::model::UpdateWorkstationRequest>>(
1892 mut self,
1893 v: V,
1894 ) -> Self {
1895 self.0.request = v.into();
1896 self
1897 }
1898
1899 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1901 self.0.options = v.into();
1902 self
1903 }
1904
1905 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1912 (*self.0.stub)
1913 .update_workstation(self.0.request, self.0.options)
1914 .await
1915 .map(crate::Response::into_body)
1916 }
1917
1918 pub fn poller(
1920 self,
1921 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1922 {
1923 type Operation = google_cloud_lro::internal::Operation<
1924 crate::model::Workstation,
1925 crate::model::OperationMetadata,
1926 >;
1927 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1928 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1929
1930 let stub = self.0.stub.clone();
1931 let mut options = self.0.options.clone();
1932 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1933 let query = move |name| {
1934 let stub = stub.clone();
1935 let options = options.clone();
1936 async {
1937 let op = GetOperation::new(stub)
1938 .set_name(name)
1939 .with_options(options)
1940 .send()
1941 .await?;
1942 Ok(Operation::new(op))
1943 }
1944 };
1945
1946 let start = move || async {
1947 let op = self.send().await?;
1948 Ok(Operation::new(op))
1949 };
1950
1951 google_cloud_lro::internal::new_poller(
1952 polling_error_policy,
1953 polling_backoff_policy,
1954 start,
1955 query,
1956 )
1957 }
1958
1959 pub fn set_workstation<T>(mut self, v: T) -> Self
1963 where
1964 T: std::convert::Into<crate::model::Workstation>,
1965 {
1966 self.0.request.workstation = std::option::Option::Some(v.into());
1967 self
1968 }
1969
1970 pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
1974 where
1975 T: std::convert::Into<crate::model::Workstation>,
1976 {
1977 self.0.request.workstation = v.map(|x| x.into());
1978 self
1979 }
1980
1981 pub fn set_update_mask<T>(mut self, v: T) -> Self
1985 where
1986 T: std::convert::Into<wkt::FieldMask>,
1987 {
1988 self.0.request.update_mask = std::option::Option::Some(v.into());
1989 self
1990 }
1991
1992 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1996 where
1997 T: std::convert::Into<wkt::FieldMask>,
1998 {
1999 self.0.request.update_mask = v.map(|x| x.into());
2000 self
2001 }
2002
2003 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2005 self.0.request.validate_only = v.into();
2006 self
2007 }
2008
2009 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2011 self.0.request.allow_missing = v.into();
2012 self
2013 }
2014 }
2015
2016 #[doc(hidden)]
2017 impl crate::RequestBuilder for UpdateWorkstation {
2018 fn request_options(&mut self) -> &mut crate::RequestOptions {
2019 &mut self.0.options
2020 }
2021 }
2022
2023 #[derive(Clone, Debug)]
2041 pub struct DeleteWorkstation(RequestBuilder<crate::model::DeleteWorkstationRequest>);
2042
2043 impl DeleteWorkstation {
2044 pub(crate) fn new(
2045 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2046 ) -> Self {
2047 Self(RequestBuilder::new(stub))
2048 }
2049
2050 pub fn with_request<V: Into<crate::model::DeleteWorkstationRequest>>(
2052 mut self,
2053 v: V,
2054 ) -> Self {
2055 self.0.request = v.into();
2056 self
2057 }
2058
2059 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2061 self.0.options = v.into();
2062 self
2063 }
2064
2065 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2072 (*self.0.stub)
2073 .delete_workstation(self.0.request, self.0.options)
2074 .await
2075 .map(crate::Response::into_body)
2076 }
2077
2078 pub fn poller(
2080 self,
2081 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2082 {
2083 type Operation = google_cloud_lro::internal::Operation<
2084 crate::model::Workstation,
2085 crate::model::OperationMetadata,
2086 >;
2087 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2088 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2089
2090 let stub = self.0.stub.clone();
2091 let mut options = self.0.options.clone();
2092 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2093 let query = move |name| {
2094 let stub = stub.clone();
2095 let options = options.clone();
2096 async {
2097 let op = GetOperation::new(stub)
2098 .set_name(name)
2099 .with_options(options)
2100 .send()
2101 .await?;
2102 Ok(Operation::new(op))
2103 }
2104 };
2105
2106 let start = move || async {
2107 let op = self.send().await?;
2108 Ok(Operation::new(op))
2109 };
2110
2111 google_cloud_lro::internal::new_poller(
2112 polling_error_policy,
2113 polling_backoff_policy,
2114 start,
2115 query,
2116 )
2117 }
2118
2119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2123 self.0.request.name = v.into();
2124 self
2125 }
2126
2127 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2129 self.0.request.validate_only = v.into();
2130 self
2131 }
2132
2133 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2135 self.0.request.etag = v.into();
2136 self
2137 }
2138 }
2139
2140 #[doc(hidden)]
2141 impl crate::RequestBuilder for DeleteWorkstation {
2142 fn request_options(&mut self) -> &mut crate::RequestOptions {
2143 &mut self.0.options
2144 }
2145 }
2146
2147 #[derive(Clone, Debug)]
2165 pub struct StartWorkstation(RequestBuilder<crate::model::StartWorkstationRequest>);
2166
2167 impl StartWorkstation {
2168 pub(crate) fn new(
2169 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2170 ) -> Self {
2171 Self(RequestBuilder::new(stub))
2172 }
2173
2174 pub fn with_request<V: Into<crate::model::StartWorkstationRequest>>(
2176 mut self,
2177 v: V,
2178 ) -> Self {
2179 self.0.request = v.into();
2180 self
2181 }
2182
2183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2185 self.0.options = v.into();
2186 self
2187 }
2188
2189 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2196 (*self.0.stub)
2197 .start_workstation(self.0.request, self.0.options)
2198 .await
2199 .map(crate::Response::into_body)
2200 }
2201
2202 pub fn poller(
2204 self,
2205 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2206 {
2207 type Operation = google_cloud_lro::internal::Operation<
2208 crate::model::Workstation,
2209 crate::model::OperationMetadata,
2210 >;
2211 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2212 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2213
2214 let stub = self.0.stub.clone();
2215 let mut options = self.0.options.clone();
2216 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2217 let query = move |name| {
2218 let stub = stub.clone();
2219 let options = options.clone();
2220 async {
2221 let op = GetOperation::new(stub)
2222 .set_name(name)
2223 .with_options(options)
2224 .send()
2225 .await?;
2226 Ok(Operation::new(op))
2227 }
2228 };
2229
2230 let start = move || async {
2231 let op = self.send().await?;
2232 Ok(Operation::new(op))
2233 };
2234
2235 google_cloud_lro::internal::new_poller(
2236 polling_error_policy,
2237 polling_backoff_policy,
2238 start,
2239 query,
2240 )
2241 }
2242
2243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2247 self.0.request.name = v.into();
2248 self
2249 }
2250
2251 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2253 self.0.request.validate_only = v.into();
2254 self
2255 }
2256
2257 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2259 self.0.request.etag = v.into();
2260 self
2261 }
2262 }
2263
2264 #[doc(hidden)]
2265 impl crate::RequestBuilder for StartWorkstation {
2266 fn request_options(&mut self) -> &mut crate::RequestOptions {
2267 &mut self.0.options
2268 }
2269 }
2270
2271 #[derive(Clone, Debug)]
2289 pub struct StopWorkstation(RequestBuilder<crate::model::StopWorkstationRequest>);
2290
2291 impl StopWorkstation {
2292 pub(crate) fn new(
2293 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2294 ) -> Self {
2295 Self(RequestBuilder::new(stub))
2296 }
2297
2298 pub fn with_request<V: Into<crate::model::StopWorkstationRequest>>(mut self, v: V) -> Self {
2300 self.0.request = v.into();
2301 self
2302 }
2303
2304 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2306 self.0.options = v.into();
2307 self
2308 }
2309
2310 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2317 (*self.0.stub)
2318 .stop_workstation(self.0.request, self.0.options)
2319 .await
2320 .map(crate::Response::into_body)
2321 }
2322
2323 pub fn poller(
2325 self,
2326 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2327 {
2328 type Operation = google_cloud_lro::internal::Operation<
2329 crate::model::Workstation,
2330 crate::model::OperationMetadata,
2331 >;
2332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2334
2335 let stub = self.0.stub.clone();
2336 let mut options = self.0.options.clone();
2337 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2338 let query = move |name| {
2339 let stub = stub.clone();
2340 let options = options.clone();
2341 async {
2342 let op = GetOperation::new(stub)
2343 .set_name(name)
2344 .with_options(options)
2345 .send()
2346 .await?;
2347 Ok(Operation::new(op))
2348 }
2349 };
2350
2351 let start = move || async {
2352 let op = self.send().await?;
2353 Ok(Operation::new(op))
2354 };
2355
2356 google_cloud_lro::internal::new_poller(
2357 polling_error_policy,
2358 polling_backoff_policy,
2359 start,
2360 query,
2361 )
2362 }
2363
2364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.0.request.name = v.into();
2369 self
2370 }
2371
2372 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2374 self.0.request.validate_only = v.into();
2375 self
2376 }
2377
2378 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.0.request.etag = v.into();
2381 self
2382 }
2383 }
2384
2385 #[doc(hidden)]
2386 impl crate::RequestBuilder for StopWorkstation {
2387 fn request_options(&mut self) -> &mut crate::RequestOptions {
2388 &mut self.0.options
2389 }
2390 }
2391
2392 #[derive(Clone, Debug)]
2409 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
2410
2411 impl GenerateAccessToken {
2412 pub(crate) fn new(
2413 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2414 ) -> Self {
2415 Self(RequestBuilder::new(stub))
2416 }
2417
2418 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
2420 mut self,
2421 v: V,
2422 ) -> Self {
2423 self.0.request = v.into();
2424 self
2425 }
2426
2427 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2429 self.0.options = v.into();
2430 self
2431 }
2432
2433 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
2435 (*self.0.stub)
2436 .generate_access_token(self.0.request, self.0.options)
2437 .await
2438 .map(crate::Response::into_body)
2439 }
2440
2441 pub fn set_workstation<T: Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.0.request.workstation = v.into();
2446 self
2447 }
2448
2449 pub fn set_expiration<
2454 T: Into<Option<crate::model::generate_access_token_request::Expiration>>,
2455 >(
2456 mut self,
2457 v: T,
2458 ) -> Self {
2459 self.0.request.expiration = v.into();
2460 self
2461 }
2462
2463 pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
2469 mut self,
2470 v: T,
2471 ) -> Self {
2472 self.0.request = self.0.request.set_expire_time(v);
2473 self
2474 }
2475
2476 pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
2482 mut self,
2483 v: T,
2484 ) -> Self {
2485 self.0.request = self.0.request.set_ttl(v);
2486 self
2487 }
2488 }
2489
2490 #[doc(hidden)]
2491 impl crate::RequestBuilder for GenerateAccessToken {
2492 fn request_options(&mut self) -> &mut crate::RequestOptions {
2493 &mut self.0.options
2494 }
2495 }
2496
2497 #[derive(Clone, Debug)]
2514 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2515
2516 impl SetIamPolicy {
2517 pub(crate) fn new(
2518 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2519 ) -> Self {
2520 Self(RequestBuilder::new(stub))
2521 }
2522
2523 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2525 mut self,
2526 v: V,
2527 ) -> Self {
2528 self.0.request = v.into();
2529 self
2530 }
2531
2532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2534 self.0.options = v.into();
2535 self
2536 }
2537
2538 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2540 (*self.0.stub)
2541 .set_iam_policy(self.0.request, self.0.options)
2542 .await
2543 .map(crate::Response::into_body)
2544 }
2545
2546 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2550 self.0.request.resource = v.into();
2551 self
2552 }
2553
2554 pub fn set_policy<T>(mut self, v: T) -> Self
2558 where
2559 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2560 {
2561 self.0.request.policy = std::option::Option::Some(v.into());
2562 self
2563 }
2564
2565 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2569 where
2570 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2571 {
2572 self.0.request.policy = v.map(|x| x.into());
2573 self
2574 }
2575
2576 pub fn set_update_mask<T>(mut self, v: T) -> Self
2578 where
2579 T: std::convert::Into<wkt::FieldMask>,
2580 {
2581 self.0.request.update_mask = std::option::Option::Some(v.into());
2582 self
2583 }
2584
2585 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2587 where
2588 T: std::convert::Into<wkt::FieldMask>,
2589 {
2590 self.0.request.update_mask = v.map(|x| x.into());
2591 self
2592 }
2593 }
2594
2595 #[doc(hidden)]
2596 impl crate::RequestBuilder for SetIamPolicy {
2597 fn request_options(&mut self) -> &mut crate::RequestOptions {
2598 &mut self.0.options
2599 }
2600 }
2601
2602 #[derive(Clone, Debug)]
2619 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2620
2621 impl GetIamPolicy {
2622 pub(crate) fn new(
2623 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2624 ) -> Self {
2625 Self(RequestBuilder::new(stub))
2626 }
2627
2628 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2630 mut self,
2631 v: V,
2632 ) -> Self {
2633 self.0.request = v.into();
2634 self
2635 }
2636
2637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2639 self.0.options = v.into();
2640 self
2641 }
2642
2643 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2645 (*self.0.stub)
2646 .get_iam_policy(self.0.request, self.0.options)
2647 .await
2648 .map(crate::Response::into_body)
2649 }
2650
2651 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.0.request.resource = v.into();
2656 self
2657 }
2658
2659 pub fn set_options<T>(mut self, v: T) -> Self
2661 where
2662 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2663 {
2664 self.0.request.options = std::option::Option::Some(v.into());
2665 self
2666 }
2667
2668 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2670 where
2671 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2672 {
2673 self.0.request.options = v.map(|x| x.into());
2674 self
2675 }
2676 }
2677
2678 #[doc(hidden)]
2679 impl crate::RequestBuilder for GetIamPolicy {
2680 fn request_options(&mut self) -> &mut crate::RequestOptions {
2681 &mut self.0.options
2682 }
2683 }
2684
2685 #[derive(Clone, Debug)]
2702 pub struct TestIamPermissions(
2703 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2704 );
2705
2706 impl TestIamPermissions {
2707 pub(crate) fn new(
2708 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2709 ) -> Self {
2710 Self(RequestBuilder::new(stub))
2711 }
2712
2713 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2715 mut self,
2716 v: V,
2717 ) -> Self {
2718 self.0.request = v.into();
2719 self
2720 }
2721
2722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2724 self.0.options = v.into();
2725 self
2726 }
2727
2728 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2730 (*self.0.stub)
2731 .test_iam_permissions(self.0.request, self.0.options)
2732 .await
2733 .map(crate::Response::into_body)
2734 }
2735
2736 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2740 self.0.request.resource = v.into();
2741 self
2742 }
2743
2744 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2748 where
2749 T: std::iter::IntoIterator<Item = V>,
2750 V: std::convert::Into<std::string::String>,
2751 {
2752 use std::iter::Iterator;
2753 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2754 self
2755 }
2756 }
2757
2758 #[doc(hidden)]
2759 impl crate::RequestBuilder for TestIamPermissions {
2760 fn request_options(&mut self) -> &mut crate::RequestOptions {
2761 &mut self.0.options
2762 }
2763 }
2764
2765 #[derive(Clone, Debug)]
2786 pub struct ListOperations(
2787 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2788 );
2789
2790 impl ListOperations {
2791 pub(crate) fn new(
2792 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2793 ) -> Self {
2794 Self(RequestBuilder::new(stub))
2795 }
2796
2797 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2799 mut self,
2800 v: V,
2801 ) -> Self {
2802 self.0.request = v.into();
2803 self
2804 }
2805
2806 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2808 self.0.options = v.into();
2809 self
2810 }
2811
2812 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2814 (*self.0.stub)
2815 .list_operations(self.0.request, self.0.options)
2816 .await
2817 .map(crate::Response::into_body)
2818 }
2819
2820 pub fn by_page(
2822 self,
2823 ) -> impl google_cloud_gax::paginator::Paginator<
2824 google_cloud_longrunning::model::ListOperationsResponse,
2825 crate::Error,
2826 > {
2827 use std::clone::Clone;
2828 let token = self.0.request.page_token.clone();
2829 let execute = move |token: String| {
2830 let mut builder = self.clone();
2831 builder.0.request = builder.0.request.set_page_token(token);
2832 builder.send()
2833 };
2834 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2835 }
2836
2837 pub fn by_item(
2839 self,
2840 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2841 google_cloud_longrunning::model::ListOperationsResponse,
2842 crate::Error,
2843 > {
2844 use google_cloud_gax::paginator::Paginator;
2845 self.by_page().items()
2846 }
2847
2848 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2850 self.0.request.name = v.into();
2851 self
2852 }
2853
2854 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2856 self.0.request.filter = v.into();
2857 self
2858 }
2859
2860 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2862 self.0.request.page_size = v.into();
2863 self
2864 }
2865
2866 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2868 self.0.request.page_token = v.into();
2869 self
2870 }
2871
2872 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2874 self.0.request.return_partial_success = v.into();
2875 self
2876 }
2877 }
2878
2879 #[doc(hidden)]
2880 impl crate::RequestBuilder for ListOperations {
2881 fn request_options(&mut self) -> &mut crate::RequestOptions {
2882 &mut self.0.options
2883 }
2884 }
2885
2886 #[derive(Clone, Debug)]
2903 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2904
2905 impl GetOperation {
2906 pub(crate) fn new(
2907 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2908 ) -> Self {
2909 Self(RequestBuilder::new(stub))
2910 }
2911
2912 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2914 mut self,
2915 v: V,
2916 ) -> Self {
2917 self.0.request = v.into();
2918 self
2919 }
2920
2921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2923 self.0.options = v.into();
2924 self
2925 }
2926
2927 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2929 (*self.0.stub)
2930 .get_operation(self.0.request, self.0.options)
2931 .await
2932 .map(crate::Response::into_body)
2933 }
2934
2935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2937 self.0.request.name = v.into();
2938 self
2939 }
2940 }
2941
2942 #[doc(hidden)]
2943 impl crate::RequestBuilder for GetOperation {
2944 fn request_options(&mut self) -> &mut crate::RequestOptions {
2945 &mut self.0.options
2946 }
2947 }
2948
2949 #[derive(Clone, Debug)]
2966 pub struct DeleteOperation(
2967 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2968 );
2969
2970 impl DeleteOperation {
2971 pub(crate) fn new(
2972 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2973 ) -> Self {
2974 Self(RequestBuilder::new(stub))
2975 }
2976
2977 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2979 mut self,
2980 v: V,
2981 ) -> Self {
2982 self.0.request = v.into();
2983 self
2984 }
2985
2986 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2988 self.0.options = v.into();
2989 self
2990 }
2991
2992 pub async fn send(self) -> Result<()> {
2994 (*self.0.stub)
2995 .delete_operation(self.0.request, self.0.options)
2996 .await
2997 .map(crate::Response::into_body)
2998 }
2999
3000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3002 self.0.request.name = v.into();
3003 self
3004 }
3005 }
3006
3007 #[doc(hidden)]
3008 impl crate::RequestBuilder for DeleteOperation {
3009 fn request_options(&mut self) -> &mut crate::RequestOptions {
3010 &mut self.0.options
3011 }
3012 }
3013
3014 #[derive(Clone, Debug)]
3031 pub struct CancelOperation(
3032 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3033 );
3034
3035 impl CancelOperation {
3036 pub(crate) fn new(
3037 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3038 ) -> Self {
3039 Self(RequestBuilder::new(stub))
3040 }
3041
3042 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3044 mut self,
3045 v: V,
3046 ) -> Self {
3047 self.0.request = v.into();
3048 self
3049 }
3050
3051 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3053 self.0.options = v.into();
3054 self
3055 }
3056
3057 pub async fn send(self) -> Result<()> {
3059 (*self.0.stub)
3060 .cancel_operation(self.0.request, self.0.options)
3061 .await
3062 .map(crate::Response::into_body)
3063 }
3064
3065 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3067 self.0.request.name = v.into();
3068 self
3069 }
3070 }
3071
3072 #[doc(hidden)]
3073 impl crate::RequestBuilder for CancelOperation {
3074 fn request_options(&mut self) -> &mut crate::RequestOptions {
3075 &mut self.0.options
3076 }
3077 }
3078}