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 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327 if let Some(ref mut details) = poller_options.tracing {
328 details.method_name = "google_cloud_workstations_v1::client::Workstations::create_workstation_cluster::until_done";
329 }
330
331 let stub = self.0.stub.clone();
332 let mut options = self.0.options.clone();
333 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334 let query = move |name| {
335 let stub = stub.clone();
336 let options = options.clone();
337 async {
338 let op = GetOperation::new(stub)
339 .set_name(name)
340 .with_options(options)
341 .send()
342 .await?;
343 Ok(Operation::new(op))
344 }
345 };
346
347 let start = move || async {
348 let op = self.send().await?;
349 Ok(Operation::new(op))
350 };
351
352 use google_cloud_lro::internal::PollerExt;
353 {
354 google_cloud_lro::internal::new_poller(
355 polling_error_policy,
356 polling_backoff_policy,
357 start,
358 query,
359 )
360 }
361 .with_options(poller_options)
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_workstation_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.workstation_cluster_id = v.into();
377 self
378 }
379
380 pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<crate::model::WorkstationCluster>,
386 {
387 self.0.request.workstation_cluster = std::option::Option::Some(v.into());
388 self
389 }
390
391 pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
395 where
396 T: std::convert::Into<crate::model::WorkstationCluster>,
397 {
398 self.0.request.workstation_cluster = v.map(|x| x.into());
399 self
400 }
401
402 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
404 self.0.request.validate_only = v.into();
405 self
406 }
407 }
408
409 #[doc(hidden)]
410 impl crate::RequestBuilder for CreateWorkstationCluster {
411 fn request_options(&mut self) -> &mut crate::RequestOptions {
412 &mut self.0.options
413 }
414 }
415
416 #[derive(Clone, Debug)]
434 pub struct UpdateWorkstationCluster(
435 RequestBuilder<crate::model::UpdateWorkstationClusterRequest>,
436 );
437
438 impl UpdateWorkstationCluster {
439 pub(crate) fn new(
440 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
441 ) -> Self {
442 Self(RequestBuilder::new(stub))
443 }
444
445 pub fn with_request<V: Into<crate::model::UpdateWorkstationClusterRequest>>(
447 mut self,
448 v: V,
449 ) -> Self {
450 self.0.request = v.into();
451 self
452 }
453
454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
456 self.0.options = v.into();
457 self
458 }
459
460 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
467 (*self.0.stub)
468 .update_workstation_cluster(self.0.request, self.0.options)
469 .await
470 .map(crate::Response::into_body)
471 }
472
473 pub fn poller(
475 self,
476 ) -> impl google_cloud_lro::Poller<
477 crate::model::WorkstationCluster,
478 crate::model::OperationMetadata,
479 > {
480 type Operation = google_cloud_lro::internal::Operation<
481 crate::model::WorkstationCluster,
482 crate::model::OperationMetadata,
483 >;
484 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
485 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
486 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
487 if let Some(ref mut details) = poller_options.tracing {
488 details.method_name = "google_cloud_workstations_v1::client::Workstations::update_workstation_cluster::until_done";
489 }
490
491 let stub = self.0.stub.clone();
492 let mut options = self.0.options.clone();
493 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
494 let query = move |name| {
495 let stub = stub.clone();
496 let options = options.clone();
497 async {
498 let op = GetOperation::new(stub)
499 .set_name(name)
500 .with_options(options)
501 .send()
502 .await?;
503 Ok(Operation::new(op))
504 }
505 };
506
507 let start = move || async {
508 let op = self.send().await?;
509 Ok(Operation::new(op))
510 };
511
512 use google_cloud_lro::internal::PollerExt;
513 {
514 google_cloud_lro::internal::new_poller(
515 polling_error_policy,
516 polling_backoff_policy,
517 start,
518 query,
519 )
520 }
521 .with_options(poller_options)
522 }
523
524 pub fn set_workstation_cluster<T>(mut self, v: T) -> Self
528 where
529 T: std::convert::Into<crate::model::WorkstationCluster>,
530 {
531 self.0.request.workstation_cluster = std::option::Option::Some(v.into());
532 self
533 }
534
535 pub fn set_or_clear_workstation_cluster<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<crate::model::WorkstationCluster>,
541 {
542 self.0.request.workstation_cluster = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_update_mask<T>(mut self, v: T) -> Self
550 where
551 T: std::convert::Into<wkt::FieldMask>,
552 {
553 self.0.request.update_mask = std::option::Option::Some(v.into());
554 self
555 }
556
557 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
561 where
562 T: std::convert::Into<wkt::FieldMask>,
563 {
564 self.0.request.update_mask = v.map(|x| x.into());
565 self
566 }
567
568 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
570 self.0.request.validate_only = v.into();
571 self
572 }
573
574 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
576 self.0.request.allow_missing = v.into();
577 self
578 }
579 }
580
581 #[doc(hidden)]
582 impl crate::RequestBuilder for UpdateWorkstationCluster {
583 fn request_options(&mut self) -> &mut crate::RequestOptions {
584 &mut self.0.options
585 }
586 }
587
588 #[derive(Clone, Debug)]
606 pub struct DeleteWorkstationCluster(
607 RequestBuilder<crate::model::DeleteWorkstationClusterRequest>,
608 );
609
610 impl DeleteWorkstationCluster {
611 pub(crate) fn new(
612 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
613 ) -> Self {
614 Self(RequestBuilder::new(stub))
615 }
616
617 pub fn with_request<V: Into<crate::model::DeleteWorkstationClusterRequest>>(
619 mut self,
620 v: V,
621 ) -> Self {
622 self.0.request = v.into();
623 self
624 }
625
626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
628 self.0.options = v.into();
629 self
630 }
631
632 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
639 (*self.0.stub)
640 .delete_workstation_cluster(self.0.request, self.0.options)
641 .await
642 .map(crate::Response::into_body)
643 }
644
645 pub fn poller(
647 self,
648 ) -> impl google_cloud_lro::Poller<
649 crate::model::WorkstationCluster,
650 crate::model::OperationMetadata,
651 > {
652 type Operation = google_cloud_lro::internal::Operation<
653 crate::model::WorkstationCluster,
654 crate::model::OperationMetadata,
655 >;
656 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
657 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
658 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
659 if let Some(ref mut details) = poller_options.tracing {
660 details.method_name = "google_cloud_workstations_v1::client::Workstations::delete_workstation_cluster::until_done";
661 }
662
663 let stub = self.0.stub.clone();
664 let mut options = self.0.options.clone();
665 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
666 let query = move |name| {
667 let stub = stub.clone();
668 let options = options.clone();
669 async {
670 let op = GetOperation::new(stub)
671 .set_name(name)
672 .with_options(options)
673 .send()
674 .await?;
675 Ok(Operation::new(op))
676 }
677 };
678
679 let start = move || async {
680 let op = self.send().await?;
681 Ok(Operation::new(op))
682 };
683
684 use google_cloud_lro::internal::PollerExt;
685 {
686 google_cloud_lro::internal::new_poller(
687 polling_error_policy,
688 polling_backoff_policy,
689 start,
690 query,
691 )
692 }
693 .with_options(poller_options)
694 }
695
696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
700 self.0.request.name = v.into();
701 self
702 }
703
704 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
706 self.0.request.validate_only = v.into();
707 self
708 }
709
710 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.etag = v.into();
713 self
714 }
715
716 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
718 self.0.request.force = v.into();
719 self
720 }
721 }
722
723 #[doc(hidden)]
724 impl crate::RequestBuilder for DeleteWorkstationCluster {
725 fn request_options(&mut self) -> &mut crate::RequestOptions {
726 &mut self.0.options
727 }
728 }
729
730 #[derive(Clone, Debug)]
747 pub struct GetWorkstationConfig(RequestBuilder<crate::model::GetWorkstationConfigRequest>);
748
749 impl GetWorkstationConfig {
750 pub(crate) fn new(
751 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
752 ) -> Self {
753 Self(RequestBuilder::new(stub))
754 }
755
756 pub fn with_request<V: Into<crate::model::GetWorkstationConfigRequest>>(
758 mut self,
759 v: V,
760 ) -> Self {
761 self.0.request = v.into();
762 self
763 }
764
765 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
767 self.0.options = v.into();
768 self
769 }
770
771 pub async fn send(self) -> Result<crate::model::WorkstationConfig> {
773 (*self.0.stub)
774 .get_workstation_config(self.0.request, self.0.options)
775 .await
776 .map(crate::Response::into_body)
777 }
778
779 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
783 self.0.request.name = v.into();
784 self
785 }
786 }
787
788 #[doc(hidden)]
789 impl crate::RequestBuilder for GetWorkstationConfig {
790 fn request_options(&mut self) -> &mut crate::RequestOptions {
791 &mut self.0.options
792 }
793 }
794
795 #[derive(Clone, Debug)]
816 pub struct ListWorkstationConfigs(RequestBuilder<crate::model::ListWorkstationConfigsRequest>);
817
818 impl ListWorkstationConfigs {
819 pub(crate) fn new(
820 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
821 ) -> Self {
822 Self(RequestBuilder::new(stub))
823 }
824
825 pub fn with_request<V: Into<crate::model::ListWorkstationConfigsRequest>>(
827 mut self,
828 v: V,
829 ) -> Self {
830 self.0.request = v.into();
831 self
832 }
833
834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
836 self.0.options = v.into();
837 self
838 }
839
840 pub async fn send(self) -> Result<crate::model::ListWorkstationConfigsResponse> {
842 (*self.0.stub)
843 .list_workstation_configs(self.0.request, self.0.options)
844 .await
845 .map(crate::Response::into_body)
846 }
847
848 pub fn by_page(
850 self,
851 ) -> impl google_cloud_gax::paginator::Paginator<
852 crate::model::ListWorkstationConfigsResponse,
853 crate::Error,
854 > {
855 use std::clone::Clone;
856 let token = self.0.request.page_token.clone();
857 let execute = move |token: String| {
858 let mut builder = self.clone();
859 builder.0.request = builder.0.request.set_page_token(token);
860 builder.send()
861 };
862 google_cloud_gax::paginator::internal::new_paginator(token, execute)
863 }
864
865 pub fn by_item(
867 self,
868 ) -> impl google_cloud_gax::paginator::ItemPaginator<
869 crate::model::ListWorkstationConfigsResponse,
870 crate::Error,
871 > {
872 use google_cloud_gax::paginator::Paginator;
873 self.by_page().items()
874 }
875
876 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
880 self.0.request.parent = v.into();
881 self
882 }
883
884 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
886 self.0.request.page_size = v.into();
887 self
888 }
889
890 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
892 self.0.request.page_token = v.into();
893 self
894 }
895
896 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
898 self.0.request.filter = v.into();
899 self
900 }
901 }
902
903 #[doc(hidden)]
904 impl crate::RequestBuilder for ListWorkstationConfigs {
905 fn request_options(&mut self) -> &mut crate::RequestOptions {
906 &mut self.0.options
907 }
908 }
909
910 #[derive(Clone, Debug)]
931 pub struct ListUsableWorkstationConfigs(
932 RequestBuilder<crate::model::ListUsableWorkstationConfigsRequest>,
933 );
934
935 impl ListUsableWorkstationConfigs {
936 pub(crate) fn new(
937 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
938 ) -> Self {
939 Self(RequestBuilder::new(stub))
940 }
941
942 pub fn with_request<V: Into<crate::model::ListUsableWorkstationConfigsRequest>>(
944 mut self,
945 v: V,
946 ) -> Self {
947 self.0.request = v.into();
948 self
949 }
950
951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
953 self.0.options = v.into();
954 self
955 }
956
957 pub async fn send(self) -> Result<crate::model::ListUsableWorkstationConfigsResponse> {
959 (*self.0.stub)
960 .list_usable_workstation_configs(self.0.request, self.0.options)
961 .await
962 .map(crate::Response::into_body)
963 }
964
965 pub fn by_page(
967 self,
968 ) -> impl google_cloud_gax::paginator::Paginator<
969 crate::model::ListUsableWorkstationConfigsResponse,
970 crate::Error,
971 > {
972 use std::clone::Clone;
973 let token = self.0.request.page_token.clone();
974 let execute = move |token: String| {
975 let mut builder = self.clone();
976 builder.0.request = builder.0.request.set_page_token(token);
977 builder.send()
978 };
979 google_cloud_gax::paginator::internal::new_paginator(token, execute)
980 }
981
982 pub fn by_item(
984 self,
985 ) -> impl google_cloud_gax::paginator::ItemPaginator<
986 crate::model::ListUsableWorkstationConfigsResponse,
987 crate::Error,
988 > {
989 use google_cloud_gax::paginator::Paginator;
990 self.by_page().items()
991 }
992
993 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
997 self.0.request.parent = v.into();
998 self
999 }
1000
1001 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1003 self.0.request.page_size = v.into();
1004 self
1005 }
1006
1007 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.page_token = v.into();
1010 self
1011 }
1012 }
1013
1014 #[doc(hidden)]
1015 impl crate::RequestBuilder for ListUsableWorkstationConfigs {
1016 fn request_options(&mut self) -> &mut crate::RequestOptions {
1017 &mut self.0.options
1018 }
1019 }
1020
1021 #[derive(Clone, Debug)]
1039 pub struct CreateWorkstationConfig(
1040 RequestBuilder<crate::model::CreateWorkstationConfigRequest>,
1041 );
1042
1043 impl CreateWorkstationConfig {
1044 pub(crate) fn new(
1045 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1046 ) -> Self {
1047 Self(RequestBuilder::new(stub))
1048 }
1049
1050 pub fn with_request<V: Into<crate::model::CreateWorkstationConfigRequest>>(
1052 mut self,
1053 v: V,
1054 ) -> Self {
1055 self.0.request = v.into();
1056 self
1057 }
1058
1059 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1061 self.0.options = v.into();
1062 self
1063 }
1064
1065 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1072 (*self.0.stub)
1073 .create_workstation_config(self.0.request, self.0.options)
1074 .await
1075 .map(crate::Response::into_body)
1076 }
1077
1078 pub fn poller(
1080 self,
1081 ) -> impl google_cloud_lro::Poller<
1082 crate::model::WorkstationConfig,
1083 crate::model::OperationMetadata,
1084 > {
1085 type Operation = google_cloud_lro::internal::Operation<
1086 crate::model::WorkstationConfig,
1087 crate::model::OperationMetadata,
1088 >;
1089 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1090 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1091 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1092 if let Some(ref mut details) = poller_options.tracing {
1093 details.method_name = "google_cloud_workstations_v1::client::Workstations::create_workstation_config::until_done";
1094 }
1095
1096 let stub = self.0.stub.clone();
1097 let mut options = self.0.options.clone();
1098 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1099 let query = move |name| {
1100 let stub = stub.clone();
1101 let options = options.clone();
1102 async {
1103 let op = GetOperation::new(stub)
1104 .set_name(name)
1105 .with_options(options)
1106 .send()
1107 .await?;
1108 Ok(Operation::new(op))
1109 }
1110 };
1111
1112 let start = move || async {
1113 let op = self.send().await?;
1114 Ok(Operation::new(op))
1115 };
1116
1117 use google_cloud_lro::internal::PollerExt;
1118 {
1119 google_cloud_lro::internal::new_poller(
1120 polling_error_policy,
1121 polling_backoff_policy,
1122 start,
1123 query,
1124 )
1125 }
1126 .with_options(poller_options)
1127 }
1128
1129 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1133 self.0.request.parent = v.into();
1134 self
1135 }
1136
1137 pub fn set_workstation_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141 self.0.request.workstation_config_id = v.into();
1142 self
1143 }
1144
1145 pub fn set_workstation_config<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<crate::model::WorkstationConfig>,
1151 {
1152 self.0.request.workstation_config = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1160 where
1161 T: std::convert::Into<crate::model::WorkstationConfig>,
1162 {
1163 self.0.request.workstation_config = v.map(|x| x.into());
1164 self
1165 }
1166
1167 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1169 self.0.request.validate_only = v.into();
1170 self
1171 }
1172 }
1173
1174 #[doc(hidden)]
1175 impl crate::RequestBuilder for CreateWorkstationConfig {
1176 fn request_options(&mut self) -> &mut crate::RequestOptions {
1177 &mut self.0.options
1178 }
1179 }
1180
1181 #[derive(Clone, Debug)]
1199 pub struct UpdateWorkstationConfig(
1200 RequestBuilder<crate::model::UpdateWorkstationConfigRequest>,
1201 );
1202
1203 impl UpdateWorkstationConfig {
1204 pub(crate) fn new(
1205 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1206 ) -> Self {
1207 Self(RequestBuilder::new(stub))
1208 }
1209
1210 pub fn with_request<V: Into<crate::model::UpdateWorkstationConfigRequest>>(
1212 mut self,
1213 v: V,
1214 ) -> Self {
1215 self.0.request = v.into();
1216 self
1217 }
1218
1219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1221 self.0.options = v.into();
1222 self
1223 }
1224
1225 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1232 (*self.0.stub)
1233 .update_workstation_config(self.0.request, self.0.options)
1234 .await
1235 .map(crate::Response::into_body)
1236 }
1237
1238 pub fn poller(
1240 self,
1241 ) -> impl google_cloud_lro::Poller<
1242 crate::model::WorkstationConfig,
1243 crate::model::OperationMetadata,
1244 > {
1245 type Operation = google_cloud_lro::internal::Operation<
1246 crate::model::WorkstationConfig,
1247 crate::model::OperationMetadata,
1248 >;
1249 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1250 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1251 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1252 if let Some(ref mut details) = poller_options.tracing {
1253 details.method_name = "google_cloud_workstations_v1::client::Workstations::update_workstation_config::until_done";
1254 }
1255
1256 let stub = self.0.stub.clone();
1257 let mut options = self.0.options.clone();
1258 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1259 let query = move |name| {
1260 let stub = stub.clone();
1261 let options = options.clone();
1262 async {
1263 let op = GetOperation::new(stub)
1264 .set_name(name)
1265 .with_options(options)
1266 .send()
1267 .await?;
1268 Ok(Operation::new(op))
1269 }
1270 };
1271
1272 let start = move || async {
1273 let op = self.send().await?;
1274 Ok(Operation::new(op))
1275 };
1276
1277 use google_cloud_lro::internal::PollerExt;
1278 {
1279 google_cloud_lro::internal::new_poller(
1280 polling_error_policy,
1281 polling_backoff_policy,
1282 start,
1283 query,
1284 )
1285 }
1286 .with_options(poller_options)
1287 }
1288
1289 pub fn set_workstation_config<T>(mut self, v: T) -> Self
1293 where
1294 T: std::convert::Into<crate::model::WorkstationConfig>,
1295 {
1296 self.0.request.workstation_config = std::option::Option::Some(v.into());
1297 self
1298 }
1299
1300 pub fn set_or_clear_workstation_config<T>(mut self, v: std::option::Option<T>) -> Self
1304 where
1305 T: std::convert::Into<crate::model::WorkstationConfig>,
1306 {
1307 self.0.request.workstation_config = v.map(|x| x.into());
1308 self
1309 }
1310
1311 pub fn set_update_mask<T>(mut self, v: T) -> Self
1315 where
1316 T: std::convert::Into<wkt::FieldMask>,
1317 {
1318 self.0.request.update_mask = std::option::Option::Some(v.into());
1319 self
1320 }
1321
1322 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1326 where
1327 T: std::convert::Into<wkt::FieldMask>,
1328 {
1329 self.0.request.update_mask = v.map(|x| x.into());
1330 self
1331 }
1332
1333 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1335 self.0.request.validate_only = v.into();
1336 self
1337 }
1338
1339 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1341 self.0.request.allow_missing = v.into();
1342 self
1343 }
1344 }
1345
1346 #[doc(hidden)]
1347 impl crate::RequestBuilder for UpdateWorkstationConfig {
1348 fn request_options(&mut self) -> &mut crate::RequestOptions {
1349 &mut self.0.options
1350 }
1351 }
1352
1353 #[derive(Clone, Debug)]
1371 pub struct DeleteWorkstationConfig(
1372 RequestBuilder<crate::model::DeleteWorkstationConfigRequest>,
1373 );
1374
1375 impl DeleteWorkstationConfig {
1376 pub(crate) fn new(
1377 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1378 ) -> Self {
1379 Self(RequestBuilder::new(stub))
1380 }
1381
1382 pub fn with_request<V: Into<crate::model::DeleteWorkstationConfigRequest>>(
1384 mut self,
1385 v: V,
1386 ) -> Self {
1387 self.0.request = v.into();
1388 self
1389 }
1390
1391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1393 self.0.options = v.into();
1394 self
1395 }
1396
1397 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1404 (*self.0.stub)
1405 .delete_workstation_config(self.0.request, self.0.options)
1406 .await
1407 .map(crate::Response::into_body)
1408 }
1409
1410 pub fn poller(
1412 self,
1413 ) -> impl google_cloud_lro::Poller<
1414 crate::model::WorkstationConfig,
1415 crate::model::OperationMetadata,
1416 > {
1417 type Operation = google_cloud_lro::internal::Operation<
1418 crate::model::WorkstationConfig,
1419 crate::model::OperationMetadata,
1420 >;
1421 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1422 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1423 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1424 if let Some(ref mut details) = poller_options.tracing {
1425 details.method_name = "google_cloud_workstations_v1::client::Workstations::delete_workstation_config::until_done";
1426 }
1427
1428 let stub = self.0.stub.clone();
1429 let mut options = self.0.options.clone();
1430 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1431 let query = move |name| {
1432 let stub = stub.clone();
1433 let options = options.clone();
1434 async {
1435 let op = GetOperation::new(stub)
1436 .set_name(name)
1437 .with_options(options)
1438 .send()
1439 .await?;
1440 Ok(Operation::new(op))
1441 }
1442 };
1443
1444 let start = move || async {
1445 let op = self.send().await?;
1446 Ok(Operation::new(op))
1447 };
1448
1449 use google_cloud_lro::internal::PollerExt;
1450 {
1451 google_cloud_lro::internal::new_poller(
1452 polling_error_policy,
1453 polling_backoff_policy,
1454 start,
1455 query,
1456 )
1457 }
1458 .with_options(poller_options)
1459 }
1460
1461 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1465 self.0.request.name = v.into();
1466 self
1467 }
1468
1469 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1471 self.0.request.validate_only = v.into();
1472 self
1473 }
1474
1475 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1477 self.0.request.etag = v.into();
1478 self
1479 }
1480
1481 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1483 self.0.request.force = v.into();
1484 self
1485 }
1486 }
1487
1488 #[doc(hidden)]
1489 impl crate::RequestBuilder for DeleteWorkstationConfig {
1490 fn request_options(&mut self) -> &mut crate::RequestOptions {
1491 &mut self.0.options
1492 }
1493 }
1494
1495 #[derive(Clone, Debug)]
1512 pub struct GetWorkstation(RequestBuilder<crate::model::GetWorkstationRequest>);
1513
1514 impl GetWorkstation {
1515 pub(crate) fn new(
1516 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1517 ) -> Self {
1518 Self(RequestBuilder::new(stub))
1519 }
1520
1521 pub fn with_request<V: Into<crate::model::GetWorkstationRequest>>(mut self, v: V) -> Self {
1523 self.0.request = v.into();
1524 self
1525 }
1526
1527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1529 self.0.options = v.into();
1530 self
1531 }
1532
1533 pub async fn send(self) -> Result<crate::model::Workstation> {
1535 (*self.0.stub)
1536 .get_workstation(self.0.request, self.0.options)
1537 .await
1538 .map(crate::Response::into_body)
1539 }
1540
1541 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1545 self.0.request.name = v.into();
1546 self
1547 }
1548 }
1549
1550 #[doc(hidden)]
1551 impl crate::RequestBuilder for GetWorkstation {
1552 fn request_options(&mut self) -> &mut crate::RequestOptions {
1553 &mut self.0.options
1554 }
1555 }
1556
1557 #[derive(Clone, Debug)]
1578 pub struct ListWorkstations(RequestBuilder<crate::model::ListWorkstationsRequest>);
1579
1580 impl ListWorkstations {
1581 pub(crate) fn new(
1582 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1583 ) -> Self {
1584 Self(RequestBuilder::new(stub))
1585 }
1586
1587 pub fn with_request<V: Into<crate::model::ListWorkstationsRequest>>(
1589 mut self,
1590 v: V,
1591 ) -> Self {
1592 self.0.request = v.into();
1593 self
1594 }
1595
1596 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1598 self.0.options = v.into();
1599 self
1600 }
1601
1602 pub async fn send(self) -> Result<crate::model::ListWorkstationsResponse> {
1604 (*self.0.stub)
1605 .list_workstations(self.0.request, self.0.options)
1606 .await
1607 .map(crate::Response::into_body)
1608 }
1609
1610 pub fn by_page(
1612 self,
1613 ) -> impl google_cloud_gax::paginator::Paginator<
1614 crate::model::ListWorkstationsResponse,
1615 crate::Error,
1616 > {
1617 use std::clone::Clone;
1618 let token = self.0.request.page_token.clone();
1619 let execute = move |token: String| {
1620 let mut builder = self.clone();
1621 builder.0.request = builder.0.request.set_page_token(token);
1622 builder.send()
1623 };
1624 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1625 }
1626
1627 pub fn by_item(
1629 self,
1630 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1631 crate::model::ListWorkstationsResponse,
1632 crate::Error,
1633 > {
1634 use google_cloud_gax::paginator::Paginator;
1635 self.by_page().items()
1636 }
1637
1638 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.0.request.parent = v.into();
1643 self
1644 }
1645
1646 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1648 self.0.request.page_size = v.into();
1649 self
1650 }
1651
1652 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.0.request.page_token = v.into();
1655 self
1656 }
1657
1658 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.0.request.filter = v.into();
1661 self
1662 }
1663 }
1664
1665 #[doc(hidden)]
1666 impl crate::RequestBuilder for ListWorkstations {
1667 fn request_options(&mut self) -> &mut crate::RequestOptions {
1668 &mut self.0.options
1669 }
1670 }
1671
1672 #[derive(Clone, Debug)]
1693 pub struct ListUsableWorkstations(RequestBuilder<crate::model::ListUsableWorkstationsRequest>);
1694
1695 impl ListUsableWorkstations {
1696 pub(crate) fn new(
1697 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1698 ) -> Self {
1699 Self(RequestBuilder::new(stub))
1700 }
1701
1702 pub fn with_request<V: Into<crate::model::ListUsableWorkstationsRequest>>(
1704 mut self,
1705 v: V,
1706 ) -> Self {
1707 self.0.request = v.into();
1708 self
1709 }
1710
1711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1713 self.0.options = v.into();
1714 self
1715 }
1716
1717 pub async fn send(self) -> Result<crate::model::ListUsableWorkstationsResponse> {
1719 (*self.0.stub)
1720 .list_usable_workstations(self.0.request, self.0.options)
1721 .await
1722 .map(crate::Response::into_body)
1723 }
1724
1725 pub fn by_page(
1727 self,
1728 ) -> impl google_cloud_gax::paginator::Paginator<
1729 crate::model::ListUsableWorkstationsResponse,
1730 crate::Error,
1731 > {
1732 use std::clone::Clone;
1733 let token = self.0.request.page_token.clone();
1734 let execute = move |token: String| {
1735 let mut builder = self.clone();
1736 builder.0.request = builder.0.request.set_page_token(token);
1737 builder.send()
1738 };
1739 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1740 }
1741
1742 pub fn by_item(
1744 self,
1745 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1746 crate::model::ListUsableWorkstationsResponse,
1747 crate::Error,
1748 > {
1749 use google_cloud_gax::paginator::Paginator;
1750 self.by_page().items()
1751 }
1752
1753 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.0.request.parent = v.into();
1758 self
1759 }
1760
1761 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1763 self.0.request.page_size = v.into();
1764 self
1765 }
1766
1767 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1769 self.0.request.page_token = v.into();
1770 self
1771 }
1772 }
1773
1774 #[doc(hidden)]
1775 impl crate::RequestBuilder for ListUsableWorkstations {
1776 fn request_options(&mut self) -> &mut crate::RequestOptions {
1777 &mut self.0.options
1778 }
1779 }
1780
1781 #[derive(Clone, Debug)]
1799 pub struct CreateWorkstation(RequestBuilder<crate::model::CreateWorkstationRequest>);
1800
1801 impl CreateWorkstation {
1802 pub(crate) fn new(
1803 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1804 ) -> Self {
1805 Self(RequestBuilder::new(stub))
1806 }
1807
1808 pub fn with_request<V: Into<crate::model::CreateWorkstationRequest>>(
1810 mut self,
1811 v: V,
1812 ) -> Self {
1813 self.0.request = v.into();
1814 self
1815 }
1816
1817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1819 self.0.options = v.into();
1820 self
1821 }
1822
1823 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1830 (*self.0.stub)
1831 .create_workstation(self.0.request, self.0.options)
1832 .await
1833 .map(crate::Response::into_body)
1834 }
1835
1836 pub fn poller(
1838 self,
1839 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1840 {
1841 type Operation = google_cloud_lro::internal::Operation<
1842 crate::model::Workstation,
1843 crate::model::OperationMetadata,
1844 >;
1845 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1846 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1847 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1848 if let Some(ref mut details) = poller_options.tracing {
1849 details.method_name = "google_cloud_workstations_v1::client::Workstations::create_workstation::until_done";
1850 }
1851
1852 let stub = self.0.stub.clone();
1853 let mut options = self.0.options.clone();
1854 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1855 let query = move |name| {
1856 let stub = stub.clone();
1857 let options = options.clone();
1858 async {
1859 let op = GetOperation::new(stub)
1860 .set_name(name)
1861 .with_options(options)
1862 .send()
1863 .await?;
1864 Ok(Operation::new(op))
1865 }
1866 };
1867
1868 let start = move || async {
1869 let op = self.send().await?;
1870 Ok(Operation::new(op))
1871 };
1872
1873 use google_cloud_lro::internal::PollerExt;
1874 {
1875 google_cloud_lro::internal::new_poller(
1876 polling_error_policy,
1877 polling_backoff_policy,
1878 start,
1879 query,
1880 )
1881 }
1882 .with_options(poller_options)
1883 }
1884
1885 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889 self.0.request.parent = v.into();
1890 self
1891 }
1892
1893 pub fn set_workstation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1897 self.0.request.workstation_id = v.into();
1898 self
1899 }
1900
1901 pub fn set_workstation<T>(mut self, v: T) -> Self
1905 where
1906 T: std::convert::Into<crate::model::Workstation>,
1907 {
1908 self.0.request.workstation = std::option::Option::Some(v.into());
1909 self
1910 }
1911
1912 pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
1916 where
1917 T: std::convert::Into<crate::model::Workstation>,
1918 {
1919 self.0.request.workstation = v.map(|x| x.into());
1920 self
1921 }
1922
1923 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1925 self.0.request.validate_only = v.into();
1926 self
1927 }
1928 }
1929
1930 #[doc(hidden)]
1931 impl crate::RequestBuilder for CreateWorkstation {
1932 fn request_options(&mut self) -> &mut crate::RequestOptions {
1933 &mut self.0.options
1934 }
1935 }
1936
1937 #[derive(Clone, Debug)]
1955 pub struct UpdateWorkstation(RequestBuilder<crate::model::UpdateWorkstationRequest>);
1956
1957 impl UpdateWorkstation {
1958 pub(crate) fn new(
1959 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
1960 ) -> Self {
1961 Self(RequestBuilder::new(stub))
1962 }
1963
1964 pub fn with_request<V: Into<crate::model::UpdateWorkstationRequest>>(
1966 mut self,
1967 v: V,
1968 ) -> Self {
1969 self.0.request = v.into();
1970 self
1971 }
1972
1973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1975 self.0.options = v.into();
1976 self
1977 }
1978
1979 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1986 (*self.0.stub)
1987 .update_workstation(self.0.request, self.0.options)
1988 .await
1989 .map(crate::Response::into_body)
1990 }
1991
1992 pub fn poller(
1994 self,
1995 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
1996 {
1997 type Operation = google_cloud_lro::internal::Operation<
1998 crate::model::Workstation,
1999 crate::model::OperationMetadata,
2000 >;
2001 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2002 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2003 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2004 if let Some(ref mut details) = poller_options.tracing {
2005 details.method_name = "google_cloud_workstations_v1::client::Workstations::update_workstation::until_done";
2006 }
2007
2008 let stub = self.0.stub.clone();
2009 let mut options = self.0.options.clone();
2010 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2011 let query = move |name| {
2012 let stub = stub.clone();
2013 let options = options.clone();
2014 async {
2015 let op = GetOperation::new(stub)
2016 .set_name(name)
2017 .with_options(options)
2018 .send()
2019 .await?;
2020 Ok(Operation::new(op))
2021 }
2022 };
2023
2024 let start = move || async {
2025 let op = self.send().await?;
2026 Ok(Operation::new(op))
2027 };
2028
2029 use google_cloud_lro::internal::PollerExt;
2030 {
2031 google_cloud_lro::internal::new_poller(
2032 polling_error_policy,
2033 polling_backoff_policy,
2034 start,
2035 query,
2036 )
2037 }
2038 .with_options(poller_options)
2039 }
2040
2041 pub fn set_workstation<T>(mut self, v: T) -> Self
2045 where
2046 T: std::convert::Into<crate::model::Workstation>,
2047 {
2048 self.0.request.workstation = std::option::Option::Some(v.into());
2049 self
2050 }
2051
2052 pub fn set_or_clear_workstation<T>(mut self, v: std::option::Option<T>) -> Self
2056 where
2057 T: std::convert::Into<crate::model::Workstation>,
2058 {
2059 self.0.request.workstation = v.map(|x| x.into());
2060 self
2061 }
2062
2063 pub fn set_update_mask<T>(mut self, v: T) -> Self
2067 where
2068 T: std::convert::Into<wkt::FieldMask>,
2069 {
2070 self.0.request.update_mask = std::option::Option::Some(v.into());
2071 self
2072 }
2073
2074 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2078 where
2079 T: std::convert::Into<wkt::FieldMask>,
2080 {
2081 self.0.request.update_mask = v.map(|x| x.into());
2082 self
2083 }
2084
2085 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2087 self.0.request.validate_only = v.into();
2088 self
2089 }
2090
2091 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2093 self.0.request.allow_missing = v.into();
2094 self
2095 }
2096 }
2097
2098 #[doc(hidden)]
2099 impl crate::RequestBuilder for UpdateWorkstation {
2100 fn request_options(&mut self) -> &mut crate::RequestOptions {
2101 &mut self.0.options
2102 }
2103 }
2104
2105 #[derive(Clone, Debug)]
2123 pub struct DeleteWorkstation(RequestBuilder<crate::model::DeleteWorkstationRequest>);
2124
2125 impl DeleteWorkstation {
2126 pub(crate) fn new(
2127 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2128 ) -> Self {
2129 Self(RequestBuilder::new(stub))
2130 }
2131
2132 pub fn with_request<V: Into<crate::model::DeleteWorkstationRequest>>(
2134 mut self,
2135 v: V,
2136 ) -> Self {
2137 self.0.request = v.into();
2138 self
2139 }
2140
2141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2143 self.0.options = v.into();
2144 self
2145 }
2146
2147 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2154 (*self.0.stub)
2155 .delete_workstation(self.0.request, self.0.options)
2156 .await
2157 .map(crate::Response::into_body)
2158 }
2159
2160 pub fn poller(
2162 self,
2163 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2164 {
2165 type Operation = google_cloud_lro::internal::Operation<
2166 crate::model::Workstation,
2167 crate::model::OperationMetadata,
2168 >;
2169 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2170 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2171 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2172 if let Some(ref mut details) = poller_options.tracing {
2173 details.method_name = "google_cloud_workstations_v1::client::Workstations::delete_workstation::until_done";
2174 }
2175
2176 let stub = self.0.stub.clone();
2177 let mut options = self.0.options.clone();
2178 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2179 let query = move |name| {
2180 let stub = stub.clone();
2181 let options = options.clone();
2182 async {
2183 let op = GetOperation::new(stub)
2184 .set_name(name)
2185 .with_options(options)
2186 .send()
2187 .await?;
2188 Ok(Operation::new(op))
2189 }
2190 };
2191
2192 let start = move || async {
2193 let op = self.send().await?;
2194 Ok(Operation::new(op))
2195 };
2196
2197 use google_cloud_lro::internal::PollerExt;
2198 {
2199 google_cloud_lro::internal::new_poller(
2200 polling_error_policy,
2201 polling_backoff_policy,
2202 start,
2203 query,
2204 )
2205 }
2206 .with_options(poller_options)
2207 }
2208
2209 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.0.request.name = v.into();
2214 self
2215 }
2216
2217 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2219 self.0.request.validate_only = v.into();
2220 self
2221 }
2222
2223 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2225 self.0.request.etag = v.into();
2226 self
2227 }
2228 }
2229
2230 #[doc(hidden)]
2231 impl crate::RequestBuilder for DeleteWorkstation {
2232 fn request_options(&mut self) -> &mut crate::RequestOptions {
2233 &mut self.0.options
2234 }
2235 }
2236
2237 #[derive(Clone, Debug)]
2255 pub struct StartWorkstation(RequestBuilder<crate::model::StartWorkstationRequest>);
2256
2257 impl StartWorkstation {
2258 pub(crate) fn new(
2259 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2260 ) -> Self {
2261 Self(RequestBuilder::new(stub))
2262 }
2263
2264 pub fn with_request<V: Into<crate::model::StartWorkstationRequest>>(
2266 mut self,
2267 v: V,
2268 ) -> Self {
2269 self.0.request = v.into();
2270 self
2271 }
2272
2273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2275 self.0.options = v.into();
2276 self
2277 }
2278
2279 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2286 (*self.0.stub)
2287 .start_workstation(self.0.request, self.0.options)
2288 .await
2289 .map(crate::Response::into_body)
2290 }
2291
2292 pub fn poller(
2294 self,
2295 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2296 {
2297 type Operation = google_cloud_lro::internal::Operation<
2298 crate::model::Workstation,
2299 crate::model::OperationMetadata,
2300 >;
2301 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2302 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2303 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2304 if let Some(ref mut details) = poller_options.tracing {
2305 details.method_name = "google_cloud_workstations_v1::client::Workstations::start_workstation::until_done";
2306 }
2307
2308 let stub = self.0.stub.clone();
2309 let mut options = self.0.options.clone();
2310 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2311 let query = move |name| {
2312 let stub = stub.clone();
2313 let options = options.clone();
2314 async {
2315 let op = GetOperation::new(stub)
2316 .set_name(name)
2317 .with_options(options)
2318 .send()
2319 .await?;
2320 Ok(Operation::new(op))
2321 }
2322 };
2323
2324 let start = move || async {
2325 let op = self.send().await?;
2326 Ok(Operation::new(op))
2327 };
2328
2329 use google_cloud_lro::internal::PollerExt;
2330 {
2331 google_cloud_lro::internal::new_poller(
2332 polling_error_policy,
2333 polling_backoff_policy,
2334 start,
2335 query,
2336 )
2337 }
2338 .with_options(poller_options)
2339 }
2340
2341 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2345 self.0.request.name = v.into();
2346 self
2347 }
2348
2349 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2351 self.0.request.validate_only = v.into();
2352 self
2353 }
2354
2355 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.0.request.etag = v.into();
2358 self
2359 }
2360
2361 pub fn set_boost_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
2363 self.0.request.boost_config = v.into();
2364 self
2365 }
2366 }
2367
2368 #[doc(hidden)]
2369 impl crate::RequestBuilder for StartWorkstation {
2370 fn request_options(&mut self) -> &mut crate::RequestOptions {
2371 &mut self.0.options
2372 }
2373 }
2374
2375 #[derive(Clone, Debug)]
2393 pub struct StopWorkstation(RequestBuilder<crate::model::StopWorkstationRequest>);
2394
2395 impl StopWorkstation {
2396 pub(crate) fn new(
2397 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2398 ) -> Self {
2399 Self(RequestBuilder::new(stub))
2400 }
2401
2402 pub fn with_request<V: Into<crate::model::StopWorkstationRequest>>(mut self, v: V) -> Self {
2404 self.0.request = v.into();
2405 self
2406 }
2407
2408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2410 self.0.options = v.into();
2411 self
2412 }
2413
2414 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2421 (*self.0.stub)
2422 .stop_workstation(self.0.request, self.0.options)
2423 .await
2424 .map(crate::Response::into_body)
2425 }
2426
2427 pub fn poller(
2429 self,
2430 ) -> impl google_cloud_lro::Poller<crate::model::Workstation, crate::model::OperationMetadata>
2431 {
2432 type Operation = google_cloud_lro::internal::Operation<
2433 crate::model::Workstation,
2434 crate::model::OperationMetadata,
2435 >;
2436 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2437 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2438 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2439 if let Some(ref mut details) = poller_options.tracing {
2440 details.method_name = "google_cloud_workstations_v1::client::Workstations::stop_workstation::until_done";
2441 }
2442
2443 let stub = self.0.stub.clone();
2444 let mut options = self.0.options.clone();
2445 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2446 let query = move |name| {
2447 let stub = stub.clone();
2448 let options = options.clone();
2449 async {
2450 let op = GetOperation::new(stub)
2451 .set_name(name)
2452 .with_options(options)
2453 .send()
2454 .await?;
2455 Ok(Operation::new(op))
2456 }
2457 };
2458
2459 let start = move || async {
2460 let op = self.send().await?;
2461 Ok(Operation::new(op))
2462 };
2463
2464 use google_cloud_lro::internal::PollerExt;
2465 {
2466 google_cloud_lro::internal::new_poller(
2467 polling_error_policy,
2468 polling_backoff_policy,
2469 start,
2470 query,
2471 )
2472 }
2473 .with_options(poller_options)
2474 }
2475
2476 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2480 self.0.request.name = v.into();
2481 self
2482 }
2483
2484 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2486 self.0.request.validate_only = v.into();
2487 self
2488 }
2489
2490 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2492 self.0.request.etag = v.into();
2493 self
2494 }
2495 }
2496
2497 #[doc(hidden)]
2498 impl crate::RequestBuilder for StopWorkstation {
2499 fn request_options(&mut self) -> &mut crate::RequestOptions {
2500 &mut self.0.options
2501 }
2502 }
2503
2504 #[derive(Clone, Debug)]
2521 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
2522
2523 impl GenerateAccessToken {
2524 pub(crate) fn new(
2525 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2526 ) -> Self {
2527 Self(RequestBuilder::new(stub))
2528 }
2529
2530 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
2532 mut self,
2533 v: V,
2534 ) -> Self {
2535 self.0.request = v.into();
2536 self
2537 }
2538
2539 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2541 self.0.options = v.into();
2542 self
2543 }
2544
2545 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
2547 (*self.0.stub)
2548 .generate_access_token(self.0.request, self.0.options)
2549 .await
2550 .map(crate::Response::into_body)
2551 }
2552
2553 pub fn set_workstation<T: Into<std::string::String>>(mut self, v: T) -> Self {
2557 self.0.request.workstation = v.into();
2558 self
2559 }
2560
2561 pub fn set_port<T: Into<i32>>(mut self, v: T) -> Self {
2563 self.0.request.port = v.into();
2564 self
2565 }
2566
2567 pub fn set_expiration<
2572 T: Into<Option<crate::model::generate_access_token_request::Expiration>>,
2573 >(
2574 mut self,
2575 v: T,
2576 ) -> Self {
2577 self.0.request.expiration = v.into();
2578 self
2579 }
2580
2581 pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
2587 mut self,
2588 v: T,
2589 ) -> Self {
2590 self.0.request = self.0.request.set_expire_time(v);
2591 self
2592 }
2593
2594 pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
2600 mut self,
2601 v: T,
2602 ) -> Self {
2603 self.0.request = self.0.request.set_ttl(v);
2604 self
2605 }
2606 }
2607
2608 #[doc(hidden)]
2609 impl crate::RequestBuilder for GenerateAccessToken {
2610 fn request_options(&mut self) -> &mut crate::RequestOptions {
2611 &mut self.0.options
2612 }
2613 }
2614
2615 #[derive(Clone, Debug)]
2632 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2633
2634 impl SetIamPolicy {
2635 pub(crate) fn new(
2636 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2637 ) -> Self {
2638 Self(RequestBuilder::new(stub))
2639 }
2640
2641 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2643 mut self,
2644 v: V,
2645 ) -> Self {
2646 self.0.request = v.into();
2647 self
2648 }
2649
2650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2652 self.0.options = v.into();
2653 self
2654 }
2655
2656 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2658 (*self.0.stub)
2659 .set_iam_policy(self.0.request, self.0.options)
2660 .await
2661 .map(crate::Response::into_body)
2662 }
2663
2664 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2668 self.0.request.resource = v.into();
2669 self
2670 }
2671
2672 pub fn set_policy<T>(mut self, v: T) -> Self
2676 where
2677 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2678 {
2679 self.0.request.policy = std::option::Option::Some(v.into());
2680 self
2681 }
2682
2683 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2687 where
2688 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2689 {
2690 self.0.request.policy = v.map(|x| x.into());
2691 self
2692 }
2693
2694 pub fn set_update_mask<T>(mut self, v: T) -> Self
2696 where
2697 T: std::convert::Into<wkt::FieldMask>,
2698 {
2699 self.0.request.update_mask = std::option::Option::Some(v.into());
2700 self
2701 }
2702
2703 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2705 where
2706 T: std::convert::Into<wkt::FieldMask>,
2707 {
2708 self.0.request.update_mask = v.map(|x| x.into());
2709 self
2710 }
2711 }
2712
2713 #[doc(hidden)]
2714 impl crate::RequestBuilder for SetIamPolicy {
2715 fn request_options(&mut self) -> &mut crate::RequestOptions {
2716 &mut self.0.options
2717 }
2718 }
2719
2720 #[derive(Clone, Debug)]
2737 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2738
2739 impl GetIamPolicy {
2740 pub(crate) fn new(
2741 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2742 ) -> Self {
2743 Self(RequestBuilder::new(stub))
2744 }
2745
2746 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2748 mut self,
2749 v: V,
2750 ) -> Self {
2751 self.0.request = v.into();
2752 self
2753 }
2754
2755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2757 self.0.options = v.into();
2758 self
2759 }
2760
2761 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2763 (*self.0.stub)
2764 .get_iam_policy(self.0.request, self.0.options)
2765 .await
2766 .map(crate::Response::into_body)
2767 }
2768
2769 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2773 self.0.request.resource = v.into();
2774 self
2775 }
2776
2777 pub fn set_options<T>(mut self, v: T) -> Self
2779 where
2780 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2781 {
2782 self.0.request.options = std::option::Option::Some(v.into());
2783 self
2784 }
2785
2786 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2788 where
2789 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2790 {
2791 self.0.request.options = v.map(|x| x.into());
2792 self
2793 }
2794 }
2795
2796 #[doc(hidden)]
2797 impl crate::RequestBuilder for GetIamPolicy {
2798 fn request_options(&mut self) -> &mut crate::RequestOptions {
2799 &mut self.0.options
2800 }
2801 }
2802
2803 #[derive(Clone, Debug)]
2820 pub struct TestIamPermissions(
2821 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2822 );
2823
2824 impl TestIamPermissions {
2825 pub(crate) fn new(
2826 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2827 ) -> Self {
2828 Self(RequestBuilder::new(stub))
2829 }
2830
2831 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2833 mut self,
2834 v: V,
2835 ) -> Self {
2836 self.0.request = v.into();
2837 self
2838 }
2839
2840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2842 self.0.options = v.into();
2843 self
2844 }
2845
2846 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2848 (*self.0.stub)
2849 .test_iam_permissions(self.0.request, self.0.options)
2850 .await
2851 .map(crate::Response::into_body)
2852 }
2853
2854 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2858 self.0.request.resource = v.into();
2859 self
2860 }
2861
2862 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2866 where
2867 T: std::iter::IntoIterator<Item = V>,
2868 V: std::convert::Into<std::string::String>,
2869 {
2870 use std::iter::Iterator;
2871 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2872 self
2873 }
2874 }
2875
2876 #[doc(hidden)]
2877 impl crate::RequestBuilder for TestIamPermissions {
2878 fn request_options(&mut self) -> &mut crate::RequestOptions {
2879 &mut self.0.options
2880 }
2881 }
2882
2883 #[derive(Clone, Debug)]
2904 pub struct ListOperations(
2905 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2906 );
2907
2908 impl ListOperations {
2909 pub(crate) fn new(
2910 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
2911 ) -> Self {
2912 Self(RequestBuilder::new(stub))
2913 }
2914
2915 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2917 mut self,
2918 v: V,
2919 ) -> Self {
2920 self.0.request = v.into();
2921 self
2922 }
2923
2924 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2926 self.0.options = v.into();
2927 self
2928 }
2929
2930 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2932 (*self.0.stub)
2933 .list_operations(self.0.request, self.0.options)
2934 .await
2935 .map(crate::Response::into_body)
2936 }
2937
2938 pub fn by_page(
2940 self,
2941 ) -> impl google_cloud_gax::paginator::Paginator<
2942 google_cloud_longrunning::model::ListOperationsResponse,
2943 crate::Error,
2944 > {
2945 use std::clone::Clone;
2946 let token = self.0.request.page_token.clone();
2947 let execute = move |token: String| {
2948 let mut builder = self.clone();
2949 builder.0.request = builder.0.request.set_page_token(token);
2950 builder.send()
2951 };
2952 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2953 }
2954
2955 pub fn by_item(
2957 self,
2958 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2959 google_cloud_longrunning::model::ListOperationsResponse,
2960 crate::Error,
2961 > {
2962 use google_cloud_gax::paginator::Paginator;
2963 self.by_page().items()
2964 }
2965
2966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2968 self.0.request.name = v.into();
2969 self
2970 }
2971
2972 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.filter = v.into();
2975 self
2976 }
2977
2978 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2980 self.0.request.page_size = v.into();
2981 self
2982 }
2983
2984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2986 self.0.request.page_token = v.into();
2987 self
2988 }
2989
2990 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2992 self.0.request.return_partial_success = v.into();
2993 self
2994 }
2995 }
2996
2997 #[doc(hidden)]
2998 impl crate::RequestBuilder for ListOperations {
2999 fn request_options(&mut self) -> &mut crate::RequestOptions {
3000 &mut self.0.options
3001 }
3002 }
3003
3004 #[derive(Clone, Debug)]
3021 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3022
3023 impl GetOperation {
3024 pub(crate) fn new(
3025 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3026 ) -> Self {
3027 Self(RequestBuilder::new(stub))
3028 }
3029
3030 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3032 mut self,
3033 v: V,
3034 ) -> Self {
3035 self.0.request = v.into();
3036 self
3037 }
3038
3039 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3041 self.0.options = v.into();
3042 self
3043 }
3044
3045 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3047 (*self.0.stub)
3048 .get_operation(self.0.request, self.0.options)
3049 .await
3050 .map(crate::Response::into_body)
3051 }
3052
3053 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.0.request.name = v.into();
3056 self
3057 }
3058 }
3059
3060 #[doc(hidden)]
3061 impl crate::RequestBuilder for GetOperation {
3062 fn request_options(&mut self) -> &mut crate::RequestOptions {
3063 &mut self.0.options
3064 }
3065 }
3066
3067 #[derive(Clone, Debug)]
3084 pub struct DeleteOperation(
3085 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3086 );
3087
3088 impl DeleteOperation {
3089 pub(crate) fn new(
3090 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3091 ) -> Self {
3092 Self(RequestBuilder::new(stub))
3093 }
3094
3095 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3097 mut self,
3098 v: V,
3099 ) -> Self {
3100 self.0.request = v.into();
3101 self
3102 }
3103
3104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3106 self.0.options = v.into();
3107 self
3108 }
3109
3110 pub async fn send(self) -> Result<()> {
3112 (*self.0.stub)
3113 .delete_operation(self.0.request, self.0.options)
3114 .await
3115 .map(crate::Response::into_body)
3116 }
3117
3118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3120 self.0.request.name = v.into();
3121 self
3122 }
3123 }
3124
3125 #[doc(hidden)]
3126 impl crate::RequestBuilder for DeleteOperation {
3127 fn request_options(&mut self) -> &mut crate::RequestOptions {
3128 &mut self.0.options
3129 }
3130 }
3131
3132 #[derive(Clone, Debug)]
3149 pub struct CancelOperation(
3150 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3151 );
3152
3153 impl CancelOperation {
3154 pub(crate) fn new(
3155 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workstations>,
3156 ) -> Self {
3157 Self(RequestBuilder::new(stub))
3158 }
3159
3160 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3162 mut self,
3163 v: V,
3164 ) -> Self {
3165 self.0.request = v.into();
3166 self
3167 }
3168
3169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3171 self.0.options = v.into();
3172 self
3173 }
3174
3175 pub async fn send(self) -> Result<()> {
3177 (*self.0.stub)
3178 .cancel_operation(self.0.request, self.0.options)
3179 .await
3180 .map(crate::Response::into_body)
3181 }
3182
3183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3185 self.0.request.name = v.into();
3186 self
3187 }
3188 }
3189
3190 #[doc(hidden)]
3191 impl crate::RequestBuilder for CancelOperation {
3192 fn request_options(&mut self) -> &mut crate::RequestOptions {
3193 &mut self.0.options
3194 }
3195 }
3196}