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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
296 self.0.options = v.into();
297 self
298 }
299
300 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
448 self.0.options = v.into();
449 self
450 }
451
452 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
612 self.0.options = v.into();
613 self
614 }
615
616 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
743 self.0.options = v.into();
744 self
745 }
746
747 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
812 self.0.options = v.into();
813 self
814 }
815
816 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
929 self.0.options = v.into();
930 self
931 }
932
933 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1037 self.0.options = v.into();
1038 self
1039 }
1040
1041 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1189 self.0.options = v.into();
1190 self
1191 }
1192
1193 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1353 self.0.options = v.into();
1354 self
1355 }
1356
1357 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481 self.0.options = v.into();
1482 self
1483 }
1484
1485 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1550 self.0.options = v.into();
1551 self
1552 }
1553
1554 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1665 self.0.options = v.into();
1666 self
1667 }
1668
1669 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1771 self.0.options = v.into();
1772 self
1773 }
1774
1775 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1919 self.0.options = v.into();
1920 self
1921 }
1922
1923 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2079 self.0.options = v.into();
2080 self
2081 }
2082
2083 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2203 self.0.options = v.into();
2204 self
2205 }
2206
2207 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2330 self.0.options = v.into();
2331 self
2332 }
2333
2334 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2453 self.0.options = v.into();
2454 self
2455 }
2456
2457 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 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 pub fn set_port<T: Into<i32>>(mut self, v: T) -> Self {
2475 self.0.request.port = v.into();
2476 self
2477 }
2478
2479 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2564 self.0.options = v.into();
2565 self
2566 }
2567
2568 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2669 self.0.options = v.into();
2670 self
2671 }
2672
2673 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2754 self.0.options = v.into();
2755 self
2756 }
2757
2758 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2838 self.0.options = v.into();
2839 self
2840 }
2841
2842 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2953 self.0.options = v.into();
2954 self
2955 }
2956
2957 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3018 self.0.options = v.into();
3019 self
3020 }
3021
3022 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3083 self.0.options = v.into();
3084 self
3085 }
3086
3087 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 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}