1pub mod builds {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Builds;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Builds;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<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::Builds>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
90 pub struct SubmitBuild(RequestBuilder<crate::model::SubmitBuildRequest>);
91
92 impl SubmitBuild {
93 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
94 Self(RequestBuilder::new(stub))
95 }
96
97 pub fn with_request<V: Into<crate::model::SubmitBuildRequest>>(mut self, v: V) -> Self {
99 self.0.request = v.into();
100 self
101 }
102
103 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105 self.0.options = v.into();
106 self
107 }
108
109 pub async fn send(self) -> Result<crate::model::SubmitBuildResponse> {
111 (*self.0.stub)
112 .submit_build(self.0.request, self.0.options)
113 .await
114 .map(gax::response::Response::into_body)
115 }
116
117 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121 self.0.request.parent = v.into();
122 self
123 }
124
125 pub fn set_image_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
129 self.0.request.image_uri = v.into();
130 self
131 }
132
133 pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
135 self.0.request.service_account = v.into();
136 self
137 }
138
139 pub fn set_worker_pool<T: Into<std::string::String>>(mut self, v: T) -> Self {
141 self.0.request.worker_pool = v.into();
142 self
143 }
144
145 pub fn set_tags<T, V>(mut self, v: T) -> Self
147 where
148 T: std::iter::IntoIterator<Item = V>,
149 V: std::convert::Into<std::string::String>,
150 {
151 use std::iter::Iterator;
152 self.0.request.tags = v.into_iter().map(|i| i.into()).collect();
153 self
154 }
155
156 pub fn set_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.machine_type = v.into();
159 self
160 }
161
162 pub fn set_release_track<T: Into<api::model::LaunchStage>>(mut self, v: T) -> Self {
164 self.0.request.release_track = v.into();
165 self
166 }
167
168 pub fn set_client<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.client = v.into();
171 self
172 }
173
174 pub fn set_source<T: Into<Option<crate::model::submit_build_request::Source>>>(
179 mut self,
180 v: T,
181 ) -> Self {
182 self.0.request.source = v.into();
183 self
184 }
185
186 pub fn set_storage_source<
192 T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
193 >(
194 mut self,
195 v: T,
196 ) -> Self {
197 self.0.request = self.0.request.set_storage_source(v);
198 self
199 }
200
201 pub fn set_build_type<T: Into<Option<crate::model::submit_build_request::BuildType>>>(
206 mut self,
207 v: T,
208 ) -> Self {
209 self.0.request.build_type = v.into();
210 self
211 }
212
213 pub fn set_buildpack_build<
219 T: std::convert::Into<
220 std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>,
221 >,
222 >(
223 mut self,
224 v: T,
225 ) -> Self {
226 self.0.request = self.0.request.set_buildpack_build(v);
227 self
228 }
229
230 pub fn set_docker_build<
236 T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
237 >(
238 mut self,
239 v: T,
240 ) -> Self {
241 self.0.request = self.0.request.set_docker_build(v);
242 self
243 }
244 }
245
246 #[doc(hidden)]
247 impl gax::options::internal::RequestBuilder for SubmitBuild {
248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
249 &mut self.0.options
250 }
251 }
252
253 #[derive(Clone, Debug)]
275 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
276
277 impl ListOperations {
278 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
279 Self(RequestBuilder::new(stub))
280 }
281
282 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
284 mut self,
285 v: V,
286 ) -> Self {
287 self.0.request = v.into();
288 self
289 }
290
291 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
293 self.0.options = v.into();
294 self
295 }
296
297 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
299 (*self.0.stub)
300 .list_operations(self.0.request, self.0.options)
301 .await
302 .map(gax::response::Response::into_body)
303 }
304
305 pub fn by_page(
307 self,
308 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
309 {
310 use std::clone::Clone;
311 let token = self.0.request.page_token.clone();
312 let execute = move |token: String| {
313 let mut builder = self.clone();
314 builder.0.request = builder.0.request.set_page_token(token);
315 builder.send()
316 };
317 gax::paginator::internal::new_paginator(token, execute)
318 }
319
320 pub fn by_item(
322 self,
323 ) -> impl gax::paginator::ItemPaginator<
324 longrunning::model::ListOperationsResponse,
325 gax::error::Error,
326 > {
327 use gax::paginator::Paginator;
328 self.by_page().items()
329 }
330
331 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
333 self.0.request.name = v.into();
334 self
335 }
336
337 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.filter = v.into();
340 self
341 }
342
343 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
345 self.0.request.page_size = v.into();
346 self
347 }
348
349 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
351 self.0.request.page_token = v.into();
352 self
353 }
354
355 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
357 self.0.request.return_partial_success = v.into();
358 self
359 }
360 }
361
362 #[doc(hidden)]
363 impl gax::options::internal::RequestBuilder for ListOperations {
364 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
365 &mut self.0.options
366 }
367 }
368
369 #[derive(Clone, Debug)]
387 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
388
389 impl GetOperation {
390 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
391 Self(RequestBuilder::new(stub))
392 }
393
394 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
396 mut self,
397 v: V,
398 ) -> Self {
399 self.0.request = v.into();
400 self
401 }
402
403 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
405 self.0.options = v.into();
406 self
407 }
408
409 pub async fn send(self) -> Result<longrunning::model::Operation> {
411 (*self.0.stub)
412 .get_operation(self.0.request, self.0.options)
413 .await
414 .map(gax::response::Response::into_body)
415 }
416
417 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
419 self.0.request.name = v.into();
420 self
421 }
422 }
423
424 #[doc(hidden)]
425 impl gax::options::internal::RequestBuilder for GetOperation {
426 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
427 &mut self.0.options
428 }
429 }
430
431 #[derive(Clone, Debug)]
449 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
450
451 impl DeleteOperation {
452 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
453 Self(RequestBuilder::new(stub))
454 }
455
456 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
458 mut self,
459 v: V,
460 ) -> Self {
461 self.0.request = v.into();
462 self
463 }
464
465 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
467 self.0.options = v.into();
468 self
469 }
470
471 pub async fn send(self) -> Result<()> {
473 (*self.0.stub)
474 .delete_operation(self.0.request, self.0.options)
475 .await
476 .map(gax::response::Response::into_body)
477 }
478
479 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
481 self.0.request.name = v.into();
482 self
483 }
484 }
485
486 #[doc(hidden)]
487 impl gax::options::internal::RequestBuilder for DeleteOperation {
488 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
489 &mut self.0.options
490 }
491 }
492
493 #[derive(Clone, Debug)]
511 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
512
513 impl WaitOperation {
514 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
515 Self(RequestBuilder::new(stub))
516 }
517
518 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
520 mut self,
521 v: V,
522 ) -> Self {
523 self.0.request = v.into();
524 self
525 }
526
527 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
529 self.0.options = v.into();
530 self
531 }
532
533 pub async fn send(self) -> Result<longrunning::model::Operation> {
535 (*self.0.stub)
536 .wait_operation(self.0.request, self.0.options)
537 .await
538 .map(gax::response::Response::into_body)
539 }
540
541 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
543 self.0.request.name = v.into();
544 self
545 }
546
547 pub fn set_timeout<T>(mut self, v: T) -> Self
549 where
550 T: std::convert::Into<wkt::Duration>,
551 {
552 self.0.request.timeout = std::option::Option::Some(v.into());
553 self
554 }
555
556 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
558 where
559 T: std::convert::Into<wkt::Duration>,
560 {
561 self.0.request.timeout = v.map(|x| x.into());
562 self
563 }
564 }
565
566 #[doc(hidden)]
567 impl gax::options::internal::RequestBuilder for WaitOperation {
568 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
569 &mut self.0.options
570 }
571 }
572}
573
574pub mod executions {
575 use crate::Result;
576
577 pub type ClientBuilder =
591 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
592
593 pub(crate) mod client {
594 use super::super::super::client::Executions;
595 pub struct Factory;
596 impl gax::client_builder::internal::ClientFactory for Factory {
597 type Client = Executions;
598 type Credentials = gaxi::options::Credentials;
599 async fn build(
600 self,
601 config: gaxi::options::ClientConfig,
602 ) -> gax::client_builder::Result<Self::Client> {
603 Self::Client::new(config).await
604 }
605 }
606 }
607
608 #[derive(Clone, Debug)]
610 pub(crate) struct RequestBuilder<R: std::default::Default> {
611 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
612 request: R,
613 options: gax::options::RequestOptions,
614 }
615
616 impl<R> RequestBuilder<R>
617 where
618 R: std::default::Default,
619 {
620 pub(crate) fn new(
621 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
622 ) -> Self {
623 Self {
624 stub,
625 request: R::default(),
626 options: gax::options::RequestOptions::default(),
627 }
628 }
629 }
630
631 #[derive(Clone, Debug)]
649 pub struct GetExecution(RequestBuilder<crate::model::GetExecutionRequest>);
650
651 impl GetExecution {
652 pub(crate) fn new(
653 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
654 ) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<crate::model::GetExecutionRequest>>(mut self, v: V) -> Self {
660 self.0.request = v.into();
661 self
662 }
663
664 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
666 self.0.options = v.into();
667 self
668 }
669
670 pub async fn send(self) -> Result<crate::model::Execution> {
672 (*self.0.stub)
673 .get_execution(self.0.request, self.0.options)
674 .await
675 .map(gax::response::Response::into_body)
676 }
677
678 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
682 self.0.request.name = v.into();
683 self
684 }
685 }
686
687 #[doc(hidden)]
688 impl gax::options::internal::RequestBuilder for GetExecution {
689 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
690 &mut self.0.options
691 }
692 }
693
694 #[derive(Clone, Debug)]
716 pub struct ListExecutions(RequestBuilder<crate::model::ListExecutionsRequest>);
717
718 impl ListExecutions {
719 pub(crate) fn new(
720 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
721 ) -> Self {
722 Self(RequestBuilder::new(stub))
723 }
724
725 pub fn with_request<V: Into<crate::model::ListExecutionsRequest>>(mut self, v: V) -> Self {
727 self.0.request = v.into();
728 self
729 }
730
731 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
733 self.0.options = v.into();
734 self
735 }
736
737 pub async fn send(self) -> Result<crate::model::ListExecutionsResponse> {
739 (*self.0.stub)
740 .list_executions(self.0.request, self.0.options)
741 .await
742 .map(gax::response::Response::into_body)
743 }
744
745 pub fn by_page(
747 self,
748 ) -> impl gax::paginator::Paginator<crate::model::ListExecutionsResponse, gax::error::Error>
749 {
750 use std::clone::Clone;
751 let token = self.0.request.page_token.clone();
752 let execute = move |token: String| {
753 let mut builder = self.clone();
754 builder.0.request = builder.0.request.set_page_token(token);
755 builder.send()
756 };
757 gax::paginator::internal::new_paginator(token, execute)
758 }
759
760 pub fn by_item(
762 self,
763 ) -> impl gax::paginator::ItemPaginator<crate::model::ListExecutionsResponse, gax::error::Error>
764 {
765 use gax::paginator::Paginator;
766 self.by_page().items()
767 }
768
769 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
773 self.0.request.parent = v.into();
774 self
775 }
776
777 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
779 self.0.request.page_size = v.into();
780 self
781 }
782
783 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
785 self.0.request.page_token = v.into();
786 self
787 }
788
789 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
791 self.0.request.show_deleted = v.into();
792 self
793 }
794 }
795
796 #[doc(hidden)]
797 impl gax::options::internal::RequestBuilder for ListExecutions {
798 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
799 &mut self.0.options
800 }
801 }
802
803 #[derive(Clone, Debug)]
822 pub struct DeleteExecution(RequestBuilder<crate::model::DeleteExecutionRequest>);
823
824 impl DeleteExecution {
825 pub(crate) fn new(
826 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
827 ) -> Self {
828 Self(RequestBuilder::new(stub))
829 }
830
831 pub fn with_request<V: Into<crate::model::DeleteExecutionRequest>>(mut self, v: V) -> Self {
833 self.0.request = v.into();
834 self
835 }
836
837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
839 self.0.options = v.into();
840 self
841 }
842
843 pub async fn send(self) -> Result<longrunning::model::Operation> {
850 (*self.0.stub)
851 .delete_execution(self.0.request, self.0.options)
852 .await
853 .map(gax::response::Response::into_body)
854 }
855
856 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
858 type Operation =
859 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
860 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
861 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
862
863 let stub = self.0.stub.clone();
864 let mut options = self.0.options.clone();
865 options.set_retry_policy(gax::retry_policy::NeverRetry);
866 let query = move |name| {
867 let stub = stub.clone();
868 let options = options.clone();
869 async {
870 let op = GetOperation::new(stub)
871 .set_name(name)
872 .with_options(options)
873 .send()
874 .await?;
875 Ok(Operation::new(op))
876 }
877 };
878
879 let start = move || async {
880 let op = self.send().await?;
881 Ok(Operation::new(op))
882 };
883
884 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
885 }
886
887 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
891 self.0.request.name = v.into();
892 self
893 }
894
895 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
897 self.0.request.validate_only = v.into();
898 self
899 }
900
901 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.etag = v.into();
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl gax::options::internal::RequestBuilder for DeleteExecution {
910 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
934 pub struct CancelExecution(RequestBuilder<crate::model::CancelExecutionRequest>);
935
936 impl CancelExecution {
937 pub(crate) fn new(
938 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
939 ) -> Self {
940 Self(RequestBuilder::new(stub))
941 }
942
943 pub fn with_request<V: Into<crate::model::CancelExecutionRequest>>(mut self, v: V) -> Self {
945 self.0.request = v.into();
946 self
947 }
948
949 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
951 self.0.options = v.into();
952 self
953 }
954
955 pub async fn send(self) -> Result<longrunning::model::Operation> {
962 (*self.0.stub)
963 .cancel_execution(self.0.request, self.0.options)
964 .await
965 .map(gax::response::Response::into_body)
966 }
967
968 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
970 type Operation =
971 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
972 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
973 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
974
975 let stub = self.0.stub.clone();
976 let mut options = self.0.options.clone();
977 options.set_retry_policy(gax::retry_policy::NeverRetry);
978 let query = move |name| {
979 let stub = stub.clone();
980 let options = options.clone();
981 async {
982 let op = GetOperation::new(stub)
983 .set_name(name)
984 .with_options(options)
985 .send()
986 .await?;
987 Ok(Operation::new(op))
988 }
989 };
990
991 let start = move || async {
992 let op = self.send().await?;
993 Ok(Operation::new(op))
994 };
995
996 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
997 }
998
999 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.name = v.into();
1004 self
1005 }
1006
1007 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1009 self.0.request.validate_only = v.into();
1010 self
1011 }
1012
1013 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.0.request.etag = v.into();
1016 self
1017 }
1018 }
1019
1020 #[doc(hidden)]
1021 impl gax::options::internal::RequestBuilder for CancelExecution {
1022 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1023 &mut self.0.options
1024 }
1025 }
1026
1027 #[derive(Clone, Debug)]
1049 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1050
1051 impl ListOperations {
1052 pub(crate) fn new(
1053 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1054 ) -> Self {
1055 Self(RequestBuilder::new(stub))
1056 }
1057
1058 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1060 mut self,
1061 v: V,
1062 ) -> Self {
1063 self.0.request = v.into();
1064 self
1065 }
1066
1067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1069 self.0.options = v.into();
1070 self
1071 }
1072
1073 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1075 (*self.0.stub)
1076 .list_operations(self.0.request, self.0.options)
1077 .await
1078 .map(gax::response::Response::into_body)
1079 }
1080
1081 pub fn by_page(
1083 self,
1084 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1085 {
1086 use std::clone::Clone;
1087 let token = self.0.request.page_token.clone();
1088 let execute = move |token: String| {
1089 let mut builder = self.clone();
1090 builder.0.request = builder.0.request.set_page_token(token);
1091 builder.send()
1092 };
1093 gax::paginator::internal::new_paginator(token, execute)
1094 }
1095
1096 pub fn by_item(
1098 self,
1099 ) -> impl gax::paginator::ItemPaginator<
1100 longrunning::model::ListOperationsResponse,
1101 gax::error::Error,
1102 > {
1103 use gax::paginator::Paginator;
1104 self.by_page().items()
1105 }
1106
1107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1109 self.0.request.name = v.into();
1110 self
1111 }
1112
1113 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.0.request.filter = v.into();
1116 self
1117 }
1118
1119 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1121 self.0.request.page_size = v.into();
1122 self
1123 }
1124
1125 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1127 self.0.request.page_token = v.into();
1128 self
1129 }
1130
1131 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1133 self.0.request.return_partial_success = v.into();
1134 self
1135 }
1136 }
1137
1138 #[doc(hidden)]
1139 impl gax::options::internal::RequestBuilder for ListOperations {
1140 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1141 &mut self.0.options
1142 }
1143 }
1144
1145 #[derive(Clone, Debug)]
1163 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1164
1165 impl GetOperation {
1166 pub(crate) fn new(
1167 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1168 ) -> Self {
1169 Self(RequestBuilder::new(stub))
1170 }
1171
1172 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1174 mut self,
1175 v: V,
1176 ) -> Self {
1177 self.0.request = v.into();
1178 self
1179 }
1180
1181 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1183 self.0.options = v.into();
1184 self
1185 }
1186
1187 pub async fn send(self) -> Result<longrunning::model::Operation> {
1189 (*self.0.stub)
1190 .get_operation(self.0.request, self.0.options)
1191 .await
1192 .map(gax::response::Response::into_body)
1193 }
1194
1195 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1197 self.0.request.name = v.into();
1198 self
1199 }
1200 }
1201
1202 #[doc(hidden)]
1203 impl gax::options::internal::RequestBuilder for GetOperation {
1204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1205 &mut self.0.options
1206 }
1207 }
1208
1209 #[derive(Clone, Debug)]
1227 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1228
1229 impl DeleteOperation {
1230 pub(crate) fn new(
1231 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1232 ) -> Self {
1233 Self(RequestBuilder::new(stub))
1234 }
1235
1236 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1238 mut self,
1239 v: V,
1240 ) -> Self {
1241 self.0.request = v.into();
1242 self
1243 }
1244
1245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1247 self.0.options = v.into();
1248 self
1249 }
1250
1251 pub async fn send(self) -> Result<()> {
1253 (*self.0.stub)
1254 .delete_operation(self.0.request, self.0.options)
1255 .await
1256 .map(gax::response::Response::into_body)
1257 }
1258
1259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.0.request.name = v.into();
1262 self
1263 }
1264 }
1265
1266 #[doc(hidden)]
1267 impl gax::options::internal::RequestBuilder for DeleteOperation {
1268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1269 &mut self.0.options
1270 }
1271 }
1272
1273 #[derive(Clone, Debug)]
1291 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
1292
1293 impl WaitOperation {
1294 pub(crate) fn new(
1295 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1296 ) -> Self {
1297 Self(RequestBuilder::new(stub))
1298 }
1299
1300 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
1302 mut self,
1303 v: V,
1304 ) -> Self {
1305 self.0.request = v.into();
1306 self
1307 }
1308
1309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1311 self.0.options = v.into();
1312 self
1313 }
1314
1315 pub async fn send(self) -> Result<longrunning::model::Operation> {
1317 (*self.0.stub)
1318 .wait_operation(self.0.request, self.0.options)
1319 .await
1320 .map(gax::response::Response::into_body)
1321 }
1322
1323 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1325 self.0.request.name = v.into();
1326 self
1327 }
1328
1329 pub fn set_timeout<T>(mut self, v: T) -> Self
1331 where
1332 T: std::convert::Into<wkt::Duration>,
1333 {
1334 self.0.request.timeout = std::option::Option::Some(v.into());
1335 self
1336 }
1337
1338 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1340 where
1341 T: std::convert::Into<wkt::Duration>,
1342 {
1343 self.0.request.timeout = v.map(|x| x.into());
1344 self
1345 }
1346 }
1347
1348 #[doc(hidden)]
1349 impl gax::options::internal::RequestBuilder for WaitOperation {
1350 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1351 &mut self.0.options
1352 }
1353 }
1354}
1355
1356pub mod jobs {
1357 use crate::Result;
1358
1359 pub type ClientBuilder =
1373 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1374
1375 pub(crate) mod client {
1376 use super::super::super::client::Jobs;
1377 pub struct Factory;
1378 impl gax::client_builder::internal::ClientFactory for Factory {
1379 type Client = Jobs;
1380 type Credentials = gaxi::options::Credentials;
1381 async fn build(
1382 self,
1383 config: gaxi::options::ClientConfig,
1384 ) -> gax::client_builder::Result<Self::Client> {
1385 Self::Client::new(config).await
1386 }
1387 }
1388 }
1389
1390 #[derive(Clone, Debug)]
1392 pub(crate) struct RequestBuilder<R: std::default::Default> {
1393 stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>,
1394 request: R,
1395 options: gax::options::RequestOptions,
1396 }
1397
1398 impl<R> RequestBuilder<R>
1399 where
1400 R: std::default::Default,
1401 {
1402 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1403 Self {
1404 stub,
1405 request: R::default(),
1406 options: gax::options::RequestOptions::default(),
1407 }
1408 }
1409 }
1410
1411 #[derive(Clone, Debug)]
1430 pub struct CreateJob(RequestBuilder<crate::model::CreateJobRequest>);
1431
1432 impl CreateJob {
1433 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1434 Self(RequestBuilder::new(stub))
1435 }
1436
1437 pub fn with_request<V: Into<crate::model::CreateJobRequest>>(mut self, v: V) -> Self {
1439 self.0.request = v.into();
1440 self
1441 }
1442
1443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1445 self.0.options = v.into();
1446 self
1447 }
1448
1449 pub async fn send(self) -> Result<longrunning::model::Operation> {
1456 (*self.0.stub)
1457 .create_job(self.0.request, self.0.options)
1458 .await
1459 .map(gax::response::Response::into_body)
1460 }
1461
1462 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1464 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1465 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1466 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1467
1468 let stub = self.0.stub.clone();
1469 let mut options = self.0.options.clone();
1470 options.set_retry_policy(gax::retry_policy::NeverRetry);
1471 let query = move |name| {
1472 let stub = stub.clone();
1473 let options = options.clone();
1474 async {
1475 let op = GetOperation::new(stub)
1476 .set_name(name)
1477 .with_options(options)
1478 .send()
1479 .await?;
1480 Ok(Operation::new(op))
1481 }
1482 };
1483
1484 let start = move || async {
1485 let op = self.send().await?;
1486 Ok(Operation::new(op))
1487 };
1488
1489 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1490 }
1491
1492 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.parent = v.into();
1497 self
1498 }
1499
1500 pub fn set_job<T>(mut self, v: T) -> Self
1504 where
1505 T: std::convert::Into<crate::model::Job>,
1506 {
1507 self.0.request.job = std::option::Option::Some(v.into());
1508 self
1509 }
1510
1511 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1515 where
1516 T: std::convert::Into<crate::model::Job>,
1517 {
1518 self.0.request.job = v.map(|x| x.into());
1519 self
1520 }
1521
1522 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1526 self.0.request.job_id = v.into();
1527 self
1528 }
1529
1530 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1532 self.0.request.validate_only = v.into();
1533 self
1534 }
1535 }
1536
1537 #[doc(hidden)]
1538 impl gax::options::internal::RequestBuilder for CreateJob {
1539 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1540 &mut self.0.options
1541 }
1542 }
1543
1544 #[derive(Clone, Debug)]
1562 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
1563
1564 impl GetJob {
1565 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1566 Self(RequestBuilder::new(stub))
1567 }
1568
1569 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
1571 self.0.request = v.into();
1572 self
1573 }
1574
1575 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1577 self.0.options = v.into();
1578 self
1579 }
1580
1581 pub async fn send(self) -> Result<crate::model::Job> {
1583 (*self.0.stub)
1584 .get_job(self.0.request, self.0.options)
1585 .await
1586 .map(gax::response::Response::into_body)
1587 }
1588
1589 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1593 self.0.request.name = v.into();
1594 self
1595 }
1596 }
1597
1598 #[doc(hidden)]
1599 impl gax::options::internal::RequestBuilder for GetJob {
1600 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1601 &mut self.0.options
1602 }
1603 }
1604
1605 #[derive(Clone, Debug)]
1627 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
1628
1629 impl ListJobs {
1630 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1631 Self(RequestBuilder::new(stub))
1632 }
1633
1634 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
1636 self.0.request = v.into();
1637 self
1638 }
1639
1640 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1642 self.0.options = v.into();
1643 self
1644 }
1645
1646 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
1648 (*self.0.stub)
1649 .list_jobs(self.0.request, self.0.options)
1650 .await
1651 .map(gax::response::Response::into_body)
1652 }
1653
1654 pub fn by_page(
1656 self,
1657 ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
1658 {
1659 use std::clone::Clone;
1660 let token = self.0.request.page_token.clone();
1661 let execute = move |token: String| {
1662 let mut builder = self.clone();
1663 builder.0.request = builder.0.request.set_page_token(token);
1664 builder.send()
1665 };
1666 gax::paginator::internal::new_paginator(token, execute)
1667 }
1668
1669 pub fn by_item(
1671 self,
1672 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
1673 {
1674 use gax::paginator::Paginator;
1675 self.by_page().items()
1676 }
1677
1678 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1682 self.0.request.parent = v.into();
1683 self
1684 }
1685
1686 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1688 self.0.request.page_size = v.into();
1689 self
1690 }
1691
1692 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.0.request.page_token = v.into();
1695 self
1696 }
1697
1698 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1700 self.0.request.show_deleted = v.into();
1701 self
1702 }
1703 }
1704
1705 #[doc(hidden)]
1706 impl gax::options::internal::RequestBuilder for ListJobs {
1707 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1708 &mut self.0.options
1709 }
1710 }
1711
1712 #[derive(Clone, Debug)]
1731 pub struct UpdateJob(RequestBuilder<crate::model::UpdateJobRequest>);
1732
1733 impl UpdateJob {
1734 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1735 Self(RequestBuilder::new(stub))
1736 }
1737
1738 pub fn with_request<V: Into<crate::model::UpdateJobRequest>>(mut self, v: V) -> Self {
1740 self.0.request = v.into();
1741 self
1742 }
1743
1744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1746 self.0.options = v.into();
1747 self
1748 }
1749
1750 pub async fn send(self) -> Result<longrunning::model::Operation> {
1757 (*self.0.stub)
1758 .update_job(self.0.request, self.0.options)
1759 .await
1760 .map(gax::response::Response::into_body)
1761 }
1762
1763 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1765 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1766 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1767 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1768
1769 let stub = self.0.stub.clone();
1770 let mut options = self.0.options.clone();
1771 options.set_retry_policy(gax::retry_policy::NeverRetry);
1772 let query = move |name| {
1773 let stub = stub.clone();
1774 let options = options.clone();
1775 async {
1776 let op = GetOperation::new(stub)
1777 .set_name(name)
1778 .with_options(options)
1779 .send()
1780 .await?;
1781 Ok(Operation::new(op))
1782 }
1783 };
1784
1785 let start = move || async {
1786 let op = self.send().await?;
1787 Ok(Operation::new(op))
1788 };
1789
1790 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1791 }
1792
1793 pub fn set_job<T>(mut self, v: T) -> Self
1797 where
1798 T: std::convert::Into<crate::model::Job>,
1799 {
1800 self.0.request.job = std::option::Option::Some(v.into());
1801 self
1802 }
1803
1804 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1808 where
1809 T: std::convert::Into<crate::model::Job>,
1810 {
1811 self.0.request.job = v.map(|x| x.into());
1812 self
1813 }
1814
1815 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1817 self.0.request.validate_only = v.into();
1818 self
1819 }
1820
1821 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1823 self.0.request.allow_missing = v.into();
1824 self
1825 }
1826 }
1827
1828 #[doc(hidden)]
1829 impl gax::options::internal::RequestBuilder for UpdateJob {
1830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1831 &mut self.0.options
1832 }
1833 }
1834
1835 #[derive(Clone, Debug)]
1854 pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);
1855
1856 impl DeleteJob {
1857 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1858 Self(RequestBuilder::new(stub))
1859 }
1860
1861 pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
1863 self.0.request = v.into();
1864 self
1865 }
1866
1867 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1869 self.0.options = v.into();
1870 self
1871 }
1872
1873 pub async fn send(self) -> Result<longrunning::model::Operation> {
1880 (*self.0.stub)
1881 .delete_job(self.0.request, self.0.options)
1882 .await
1883 .map(gax::response::Response::into_body)
1884 }
1885
1886 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1888 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1889 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1890 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1891
1892 let stub = self.0.stub.clone();
1893 let mut options = self.0.options.clone();
1894 options.set_retry_policy(gax::retry_policy::NeverRetry);
1895 let query = move |name| {
1896 let stub = stub.clone();
1897 let options = options.clone();
1898 async {
1899 let op = GetOperation::new(stub)
1900 .set_name(name)
1901 .with_options(options)
1902 .send()
1903 .await?;
1904 Ok(Operation::new(op))
1905 }
1906 };
1907
1908 let start = move || async {
1909 let op = self.send().await?;
1910 Ok(Operation::new(op))
1911 };
1912
1913 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1914 }
1915
1916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1920 self.0.request.name = v.into();
1921 self
1922 }
1923
1924 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1926 self.0.request.validate_only = v.into();
1927 self
1928 }
1929
1930 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.0.request.etag = v.into();
1933 self
1934 }
1935 }
1936
1937 #[doc(hidden)]
1938 impl gax::options::internal::RequestBuilder for DeleteJob {
1939 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1940 &mut self.0.options
1941 }
1942 }
1943
1944 #[derive(Clone, Debug)]
1963 pub struct RunJob(RequestBuilder<crate::model::RunJobRequest>);
1964
1965 impl RunJob {
1966 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1967 Self(RequestBuilder::new(stub))
1968 }
1969
1970 pub fn with_request<V: Into<crate::model::RunJobRequest>>(mut self, v: V) -> Self {
1972 self.0.request = v.into();
1973 self
1974 }
1975
1976 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1978 self.0.options = v.into();
1979 self
1980 }
1981
1982 pub async fn send(self) -> Result<longrunning::model::Operation> {
1989 (*self.0.stub)
1990 .run_job(self.0.request, self.0.options)
1991 .await
1992 .map(gax::response::Response::into_body)
1993 }
1994
1995 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
1997 type Operation =
1998 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
1999 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2000 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2001
2002 let stub = self.0.stub.clone();
2003 let mut options = self.0.options.clone();
2004 options.set_retry_policy(gax::retry_policy::NeverRetry);
2005 let query = move |name| {
2006 let stub = stub.clone();
2007 let options = options.clone();
2008 async {
2009 let op = GetOperation::new(stub)
2010 .set_name(name)
2011 .with_options(options)
2012 .send()
2013 .await?;
2014 Ok(Operation::new(op))
2015 }
2016 };
2017
2018 let start = move || async {
2019 let op = self.send().await?;
2020 Ok(Operation::new(op))
2021 };
2022
2023 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2024 }
2025
2026 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.0.request.name = v.into();
2031 self
2032 }
2033
2034 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2036 self.0.request.validate_only = v.into();
2037 self
2038 }
2039
2040 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.0.request.etag = v.into();
2043 self
2044 }
2045
2046 pub fn set_overrides<T>(mut self, v: T) -> Self
2048 where
2049 T: std::convert::Into<crate::model::run_job_request::Overrides>,
2050 {
2051 self.0.request.overrides = std::option::Option::Some(v.into());
2052 self
2053 }
2054
2055 pub fn set_or_clear_overrides<T>(mut self, v: std::option::Option<T>) -> Self
2057 where
2058 T: std::convert::Into<crate::model::run_job_request::Overrides>,
2059 {
2060 self.0.request.overrides = v.map(|x| x.into());
2061 self
2062 }
2063 }
2064
2065 #[doc(hidden)]
2066 impl gax::options::internal::RequestBuilder for RunJob {
2067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2068 &mut self.0.options
2069 }
2070 }
2071
2072 #[derive(Clone, Debug)]
2090 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2091
2092 impl GetIamPolicy {
2093 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2094 Self(RequestBuilder::new(stub))
2095 }
2096
2097 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2099 self.0.request = v.into();
2100 self
2101 }
2102
2103 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2105 self.0.options = v.into();
2106 self
2107 }
2108
2109 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2111 (*self.0.stub)
2112 .get_iam_policy(self.0.request, self.0.options)
2113 .await
2114 .map(gax::response::Response::into_body)
2115 }
2116
2117 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121 self.0.request.resource = v.into();
2122 self
2123 }
2124
2125 pub fn set_options<T>(mut self, v: T) -> Self
2127 where
2128 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2129 {
2130 self.0.request.options = std::option::Option::Some(v.into());
2131 self
2132 }
2133
2134 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2136 where
2137 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2138 {
2139 self.0.request.options = v.map(|x| x.into());
2140 self
2141 }
2142 }
2143
2144 #[doc(hidden)]
2145 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2146 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2147 &mut self.0.options
2148 }
2149 }
2150
2151 #[derive(Clone, Debug)]
2169 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2170
2171 impl SetIamPolicy {
2172 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2173 Self(RequestBuilder::new(stub))
2174 }
2175
2176 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2190 (*self.0.stub)
2191 .set_iam_policy(self.0.request, self.0.options)
2192 .await
2193 .map(gax::response::Response::into_body)
2194 }
2195
2196 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.0.request.resource = v.into();
2201 self
2202 }
2203
2204 pub fn set_policy<T>(mut self, v: T) -> Self
2208 where
2209 T: std::convert::Into<iam_v1::model::Policy>,
2210 {
2211 self.0.request.policy = std::option::Option::Some(v.into());
2212 self
2213 }
2214
2215 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2219 where
2220 T: std::convert::Into<iam_v1::model::Policy>,
2221 {
2222 self.0.request.policy = v.map(|x| x.into());
2223 self
2224 }
2225
2226 pub fn set_update_mask<T>(mut self, v: T) -> Self
2228 where
2229 T: std::convert::Into<wkt::FieldMask>,
2230 {
2231 self.0.request.update_mask = std::option::Option::Some(v.into());
2232 self
2233 }
2234
2235 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2237 where
2238 T: std::convert::Into<wkt::FieldMask>,
2239 {
2240 self.0.request.update_mask = v.map(|x| x.into());
2241 self
2242 }
2243 }
2244
2245 #[doc(hidden)]
2246 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2248 &mut self.0.options
2249 }
2250 }
2251
2252 #[derive(Clone, Debug)]
2270 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2271
2272 impl TestIamPermissions {
2273 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2274 Self(RequestBuilder::new(stub))
2275 }
2276
2277 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2279 mut self,
2280 v: V,
2281 ) -> Self {
2282 self.0.request = v.into();
2283 self
2284 }
2285
2286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2288 self.0.options = v.into();
2289 self
2290 }
2291
2292 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2294 (*self.0.stub)
2295 .test_iam_permissions(self.0.request, self.0.options)
2296 .await
2297 .map(gax::response::Response::into_body)
2298 }
2299
2300 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2304 self.0.request.resource = v.into();
2305 self
2306 }
2307
2308 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2312 where
2313 T: std::iter::IntoIterator<Item = V>,
2314 V: std::convert::Into<std::string::String>,
2315 {
2316 use std::iter::Iterator;
2317 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2318 self
2319 }
2320 }
2321
2322 #[doc(hidden)]
2323 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2324 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2325 &mut self.0.options
2326 }
2327 }
2328
2329 #[derive(Clone, Debug)]
2351 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2352
2353 impl ListOperations {
2354 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2355 Self(RequestBuilder::new(stub))
2356 }
2357
2358 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2360 mut self,
2361 v: V,
2362 ) -> Self {
2363 self.0.request = v.into();
2364 self
2365 }
2366
2367 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2369 self.0.options = v.into();
2370 self
2371 }
2372
2373 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2375 (*self.0.stub)
2376 .list_operations(self.0.request, self.0.options)
2377 .await
2378 .map(gax::response::Response::into_body)
2379 }
2380
2381 pub fn by_page(
2383 self,
2384 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2385 {
2386 use std::clone::Clone;
2387 let token = self.0.request.page_token.clone();
2388 let execute = move |token: String| {
2389 let mut builder = self.clone();
2390 builder.0.request = builder.0.request.set_page_token(token);
2391 builder.send()
2392 };
2393 gax::paginator::internal::new_paginator(token, execute)
2394 }
2395
2396 pub fn by_item(
2398 self,
2399 ) -> impl gax::paginator::ItemPaginator<
2400 longrunning::model::ListOperationsResponse,
2401 gax::error::Error,
2402 > {
2403 use gax::paginator::Paginator;
2404 self.by_page().items()
2405 }
2406
2407 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.name = v.into();
2410 self
2411 }
2412
2413 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.0.request.filter = v.into();
2416 self
2417 }
2418
2419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2421 self.0.request.page_size = v.into();
2422 self
2423 }
2424
2425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.page_token = v.into();
2428 self
2429 }
2430
2431 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2433 self.0.request.return_partial_success = v.into();
2434 self
2435 }
2436 }
2437
2438 #[doc(hidden)]
2439 impl gax::options::internal::RequestBuilder for ListOperations {
2440 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2441 &mut self.0.options
2442 }
2443 }
2444
2445 #[derive(Clone, Debug)]
2463 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2464
2465 impl GetOperation {
2466 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2467 Self(RequestBuilder::new(stub))
2468 }
2469
2470 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2472 mut self,
2473 v: V,
2474 ) -> Self {
2475 self.0.request = v.into();
2476 self
2477 }
2478
2479 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2481 self.0.options = v.into();
2482 self
2483 }
2484
2485 pub async fn send(self) -> Result<longrunning::model::Operation> {
2487 (*self.0.stub)
2488 .get_operation(self.0.request, self.0.options)
2489 .await
2490 .map(gax::response::Response::into_body)
2491 }
2492
2493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2495 self.0.request.name = v.into();
2496 self
2497 }
2498 }
2499
2500 #[doc(hidden)]
2501 impl gax::options::internal::RequestBuilder for GetOperation {
2502 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2503 &mut self.0.options
2504 }
2505 }
2506
2507 #[derive(Clone, Debug)]
2525 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2526
2527 impl DeleteOperation {
2528 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2529 Self(RequestBuilder::new(stub))
2530 }
2531
2532 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2534 mut self,
2535 v: V,
2536 ) -> Self {
2537 self.0.request = v.into();
2538 self
2539 }
2540
2541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2543 self.0.options = v.into();
2544 self
2545 }
2546
2547 pub async fn send(self) -> Result<()> {
2549 (*self.0.stub)
2550 .delete_operation(self.0.request, self.0.options)
2551 .await
2552 .map(gax::response::Response::into_body)
2553 }
2554
2555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2557 self.0.request.name = v.into();
2558 self
2559 }
2560 }
2561
2562 #[doc(hidden)]
2563 impl gax::options::internal::RequestBuilder for DeleteOperation {
2564 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2565 &mut self.0.options
2566 }
2567 }
2568
2569 #[derive(Clone, Debug)]
2587 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
2588
2589 impl WaitOperation {
2590 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2591 Self(RequestBuilder::new(stub))
2592 }
2593
2594 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
2596 mut self,
2597 v: V,
2598 ) -> Self {
2599 self.0.request = v.into();
2600 self
2601 }
2602
2603 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2605 self.0.options = v.into();
2606 self
2607 }
2608
2609 pub async fn send(self) -> Result<longrunning::model::Operation> {
2611 (*self.0.stub)
2612 .wait_operation(self.0.request, self.0.options)
2613 .await
2614 .map(gax::response::Response::into_body)
2615 }
2616
2617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2619 self.0.request.name = v.into();
2620 self
2621 }
2622
2623 pub fn set_timeout<T>(mut self, v: T) -> Self
2625 where
2626 T: std::convert::Into<wkt::Duration>,
2627 {
2628 self.0.request.timeout = std::option::Option::Some(v.into());
2629 self
2630 }
2631
2632 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2634 where
2635 T: std::convert::Into<wkt::Duration>,
2636 {
2637 self.0.request.timeout = v.map(|x| x.into());
2638 self
2639 }
2640 }
2641
2642 #[doc(hidden)]
2643 impl gax::options::internal::RequestBuilder for WaitOperation {
2644 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2645 &mut self.0.options
2646 }
2647 }
2648}
2649
2650pub mod revisions {
2651 use crate::Result;
2652
2653 pub type ClientBuilder =
2667 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2668
2669 pub(crate) mod client {
2670 use super::super::super::client::Revisions;
2671 pub struct Factory;
2672 impl gax::client_builder::internal::ClientFactory for Factory {
2673 type Client = Revisions;
2674 type Credentials = gaxi::options::Credentials;
2675 async fn build(
2676 self,
2677 config: gaxi::options::ClientConfig,
2678 ) -> gax::client_builder::Result<Self::Client> {
2679 Self::Client::new(config).await
2680 }
2681 }
2682 }
2683
2684 #[derive(Clone, Debug)]
2686 pub(crate) struct RequestBuilder<R: std::default::Default> {
2687 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2688 request: R,
2689 options: gax::options::RequestOptions,
2690 }
2691
2692 impl<R> RequestBuilder<R>
2693 where
2694 R: std::default::Default,
2695 {
2696 pub(crate) fn new(
2697 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2698 ) -> Self {
2699 Self {
2700 stub,
2701 request: R::default(),
2702 options: gax::options::RequestOptions::default(),
2703 }
2704 }
2705 }
2706
2707 #[derive(Clone, Debug)]
2725 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
2726
2727 impl GetRevision {
2728 pub(crate) fn new(
2729 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2730 ) -> Self {
2731 Self(RequestBuilder::new(stub))
2732 }
2733
2734 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
2736 self.0.request = v.into();
2737 self
2738 }
2739
2740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2742 self.0.options = v.into();
2743 self
2744 }
2745
2746 pub async fn send(self) -> Result<crate::model::Revision> {
2748 (*self.0.stub)
2749 .get_revision(self.0.request, self.0.options)
2750 .await
2751 .map(gax::response::Response::into_body)
2752 }
2753
2754 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2758 self.0.request.name = v.into();
2759 self
2760 }
2761 }
2762
2763 #[doc(hidden)]
2764 impl gax::options::internal::RequestBuilder for GetRevision {
2765 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2766 &mut self.0.options
2767 }
2768 }
2769
2770 #[derive(Clone, Debug)]
2792 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
2793
2794 impl ListRevisions {
2795 pub(crate) fn new(
2796 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2797 ) -> Self {
2798 Self(RequestBuilder::new(stub))
2799 }
2800
2801 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
2803 self.0.request = v.into();
2804 self
2805 }
2806
2807 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2809 self.0.options = v.into();
2810 self
2811 }
2812
2813 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
2815 (*self.0.stub)
2816 .list_revisions(self.0.request, self.0.options)
2817 .await
2818 .map(gax::response::Response::into_body)
2819 }
2820
2821 pub fn by_page(
2823 self,
2824 ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
2825 {
2826 use std::clone::Clone;
2827 let token = self.0.request.page_token.clone();
2828 let execute = move |token: String| {
2829 let mut builder = self.clone();
2830 builder.0.request = builder.0.request.set_page_token(token);
2831 builder.send()
2832 };
2833 gax::paginator::internal::new_paginator(token, execute)
2834 }
2835
2836 pub fn by_item(
2838 self,
2839 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
2840 {
2841 use gax::paginator::Paginator;
2842 self.by_page().items()
2843 }
2844
2845 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2849 self.0.request.parent = v.into();
2850 self
2851 }
2852
2853 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2855 self.0.request.page_size = v.into();
2856 self
2857 }
2858
2859 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2861 self.0.request.page_token = v.into();
2862 self
2863 }
2864
2865 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2867 self.0.request.show_deleted = v.into();
2868 self
2869 }
2870 }
2871
2872 #[doc(hidden)]
2873 impl gax::options::internal::RequestBuilder for ListRevisions {
2874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2875 &mut self.0.options
2876 }
2877 }
2878
2879 #[derive(Clone, Debug)]
2898 pub struct DeleteRevision(RequestBuilder<crate::model::DeleteRevisionRequest>);
2899
2900 impl DeleteRevision {
2901 pub(crate) fn new(
2902 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2903 ) -> Self {
2904 Self(RequestBuilder::new(stub))
2905 }
2906
2907 pub fn with_request<V: Into<crate::model::DeleteRevisionRequest>>(mut self, v: V) -> Self {
2909 self.0.request = v.into();
2910 self
2911 }
2912
2913 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2915 self.0.options = v.into();
2916 self
2917 }
2918
2919 pub async fn send(self) -> Result<longrunning::model::Operation> {
2926 (*self.0.stub)
2927 .delete_revision(self.0.request, self.0.options)
2928 .await
2929 .map(gax::response::Response::into_body)
2930 }
2931
2932 pub fn poller(self) -> impl lro::Poller<crate::model::Revision, crate::model::Revision> {
2934 type Operation =
2935 lro::internal::Operation<crate::model::Revision, crate::model::Revision>;
2936 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2937 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2938
2939 let stub = self.0.stub.clone();
2940 let mut options = self.0.options.clone();
2941 options.set_retry_policy(gax::retry_policy::NeverRetry);
2942 let query = move |name| {
2943 let stub = stub.clone();
2944 let options = options.clone();
2945 async {
2946 let op = GetOperation::new(stub)
2947 .set_name(name)
2948 .with_options(options)
2949 .send()
2950 .await?;
2951 Ok(Operation::new(op))
2952 }
2953 };
2954
2955 let start = move || async {
2956 let op = self.send().await?;
2957 Ok(Operation::new(op))
2958 };
2959
2960 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2961 }
2962
2963 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 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2973 self.0.request.validate_only = v.into();
2974 self
2975 }
2976
2977 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2979 self.0.request.etag = v.into();
2980 self
2981 }
2982 }
2983
2984 #[doc(hidden)]
2985 impl gax::options::internal::RequestBuilder for DeleteRevision {
2986 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2987 &mut self.0.options
2988 }
2989 }
2990
2991 #[derive(Clone, Debug)]
3013 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3014
3015 impl ListOperations {
3016 pub(crate) fn new(
3017 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3018 ) -> Self {
3019 Self(RequestBuilder::new(stub))
3020 }
3021
3022 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3024 mut self,
3025 v: V,
3026 ) -> Self {
3027 self.0.request = v.into();
3028 self
3029 }
3030
3031 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3033 self.0.options = v.into();
3034 self
3035 }
3036
3037 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3039 (*self.0.stub)
3040 .list_operations(self.0.request, self.0.options)
3041 .await
3042 .map(gax::response::Response::into_body)
3043 }
3044
3045 pub fn by_page(
3047 self,
3048 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3049 {
3050 use std::clone::Clone;
3051 let token = self.0.request.page_token.clone();
3052 let execute = move |token: String| {
3053 let mut builder = self.clone();
3054 builder.0.request = builder.0.request.set_page_token(token);
3055 builder.send()
3056 };
3057 gax::paginator::internal::new_paginator(token, execute)
3058 }
3059
3060 pub fn by_item(
3062 self,
3063 ) -> impl gax::paginator::ItemPaginator<
3064 longrunning::model::ListOperationsResponse,
3065 gax::error::Error,
3066 > {
3067 use gax::paginator::Paginator;
3068 self.by_page().items()
3069 }
3070
3071 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3073 self.0.request.name = v.into();
3074 self
3075 }
3076
3077 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.0.request.filter = v.into();
3080 self
3081 }
3082
3083 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3085 self.0.request.page_size = v.into();
3086 self
3087 }
3088
3089 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3091 self.0.request.page_token = v.into();
3092 self
3093 }
3094
3095 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3097 self.0.request.return_partial_success = v.into();
3098 self
3099 }
3100 }
3101
3102 #[doc(hidden)]
3103 impl gax::options::internal::RequestBuilder for ListOperations {
3104 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3105 &mut self.0.options
3106 }
3107 }
3108
3109 #[derive(Clone, Debug)]
3127 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3128
3129 impl GetOperation {
3130 pub(crate) fn new(
3131 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3132 ) -> Self {
3133 Self(RequestBuilder::new(stub))
3134 }
3135
3136 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3138 mut self,
3139 v: V,
3140 ) -> Self {
3141 self.0.request = v.into();
3142 self
3143 }
3144
3145 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3147 self.0.options = v.into();
3148 self
3149 }
3150
3151 pub async fn send(self) -> Result<longrunning::model::Operation> {
3153 (*self.0.stub)
3154 .get_operation(self.0.request, self.0.options)
3155 .await
3156 .map(gax::response::Response::into_body)
3157 }
3158
3159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3161 self.0.request.name = v.into();
3162 self
3163 }
3164 }
3165
3166 #[doc(hidden)]
3167 impl gax::options::internal::RequestBuilder for GetOperation {
3168 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3169 &mut self.0.options
3170 }
3171 }
3172
3173 #[derive(Clone, Debug)]
3191 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3192
3193 impl DeleteOperation {
3194 pub(crate) fn new(
3195 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3196 ) -> Self {
3197 Self(RequestBuilder::new(stub))
3198 }
3199
3200 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3202 mut self,
3203 v: V,
3204 ) -> Self {
3205 self.0.request = v.into();
3206 self
3207 }
3208
3209 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3211 self.0.options = v.into();
3212 self
3213 }
3214
3215 pub async fn send(self) -> Result<()> {
3217 (*self.0.stub)
3218 .delete_operation(self.0.request, self.0.options)
3219 .await
3220 .map(gax::response::Response::into_body)
3221 }
3222
3223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.0.request.name = v.into();
3226 self
3227 }
3228 }
3229
3230 #[doc(hidden)]
3231 impl gax::options::internal::RequestBuilder for DeleteOperation {
3232 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3233 &mut self.0.options
3234 }
3235 }
3236
3237 #[derive(Clone, Debug)]
3255 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
3256
3257 impl WaitOperation {
3258 pub(crate) fn new(
3259 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3260 ) -> Self {
3261 Self(RequestBuilder::new(stub))
3262 }
3263
3264 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
3266 mut self,
3267 v: V,
3268 ) -> Self {
3269 self.0.request = v.into();
3270 self
3271 }
3272
3273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3275 self.0.options = v.into();
3276 self
3277 }
3278
3279 pub async fn send(self) -> Result<longrunning::model::Operation> {
3281 (*self.0.stub)
3282 .wait_operation(self.0.request, self.0.options)
3283 .await
3284 .map(gax::response::Response::into_body)
3285 }
3286
3287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3289 self.0.request.name = v.into();
3290 self
3291 }
3292
3293 pub fn set_timeout<T>(mut self, v: T) -> Self
3295 where
3296 T: std::convert::Into<wkt::Duration>,
3297 {
3298 self.0.request.timeout = std::option::Option::Some(v.into());
3299 self
3300 }
3301
3302 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3304 where
3305 T: std::convert::Into<wkt::Duration>,
3306 {
3307 self.0.request.timeout = v.map(|x| x.into());
3308 self
3309 }
3310 }
3311
3312 #[doc(hidden)]
3313 impl gax::options::internal::RequestBuilder for WaitOperation {
3314 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3315 &mut self.0.options
3316 }
3317 }
3318}
3319
3320pub mod services {
3321 use crate::Result;
3322
3323 pub type ClientBuilder =
3337 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3338
3339 pub(crate) mod client {
3340 use super::super::super::client::Services;
3341 pub struct Factory;
3342 impl gax::client_builder::internal::ClientFactory for Factory {
3343 type Client = Services;
3344 type Credentials = gaxi::options::Credentials;
3345 async fn build(
3346 self,
3347 config: gaxi::options::ClientConfig,
3348 ) -> gax::client_builder::Result<Self::Client> {
3349 Self::Client::new(config).await
3350 }
3351 }
3352 }
3353
3354 #[derive(Clone, Debug)]
3356 pub(crate) struct RequestBuilder<R: std::default::Default> {
3357 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
3358 request: R,
3359 options: gax::options::RequestOptions,
3360 }
3361
3362 impl<R> RequestBuilder<R>
3363 where
3364 R: std::default::Default,
3365 {
3366 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3367 Self {
3368 stub,
3369 request: R::default(),
3370 options: gax::options::RequestOptions::default(),
3371 }
3372 }
3373 }
3374
3375 #[derive(Clone, Debug)]
3394 pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
3395
3396 impl CreateService {
3397 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3398 Self(RequestBuilder::new(stub))
3399 }
3400
3401 pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
3403 self.0.request = v.into();
3404 self
3405 }
3406
3407 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3409 self.0.options = v.into();
3410 self
3411 }
3412
3413 pub async fn send(self) -> Result<longrunning::model::Operation> {
3420 (*self.0.stub)
3421 .create_service(self.0.request, self.0.options)
3422 .await
3423 .map(gax::response::Response::into_body)
3424 }
3425
3426 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3428 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3429 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3430 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3431
3432 let stub = self.0.stub.clone();
3433 let mut options = self.0.options.clone();
3434 options.set_retry_policy(gax::retry_policy::NeverRetry);
3435 let query = move |name| {
3436 let stub = stub.clone();
3437 let options = options.clone();
3438 async {
3439 let op = GetOperation::new(stub)
3440 .set_name(name)
3441 .with_options(options)
3442 .send()
3443 .await?;
3444 Ok(Operation::new(op))
3445 }
3446 };
3447
3448 let start = move || async {
3449 let op = self.send().await?;
3450 Ok(Operation::new(op))
3451 };
3452
3453 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3454 }
3455
3456 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.parent = v.into();
3461 self
3462 }
3463
3464 pub fn set_service<T>(mut self, v: T) -> Self
3468 where
3469 T: std::convert::Into<crate::model::Service>,
3470 {
3471 self.0.request.service = std::option::Option::Some(v.into());
3472 self
3473 }
3474
3475 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3479 where
3480 T: std::convert::Into<crate::model::Service>,
3481 {
3482 self.0.request.service = v.map(|x| x.into());
3483 self
3484 }
3485
3486 pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3490 self.0.request.service_id = v.into();
3491 self
3492 }
3493
3494 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3496 self.0.request.validate_only = v.into();
3497 self
3498 }
3499 }
3500
3501 #[doc(hidden)]
3502 impl gax::options::internal::RequestBuilder for CreateService {
3503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3504 &mut self.0.options
3505 }
3506 }
3507
3508 #[derive(Clone, Debug)]
3526 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
3527
3528 impl GetService {
3529 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3530 Self(RequestBuilder::new(stub))
3531 }
3532
3533 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
3535 self.0.request = v.into();
3536 self
3537 }
3538
3539 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3541 self.0.options = v.into();
3542 self
3543 }
3544
3545 pub async fn send(self) -> Result<crate::model::Service> {
3547 (*self.0.stub)
3548 .get_service(self.0.request, self.0.options)
3549 .await
3550 .map(gax::response::Response::into_body)
3551 }
3552
3553 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.0.request.name = v.into();
3558 self
3559 }
3560 }
3561
3562 #[doc(hidden)]
3563 impl gax::options::internal::RequestBuilder for GetService {
3564 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3565 &mut self.0.options
3566 }
3567 }
3568
3569 #[derive(Clone, Debug)]
3591 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
3592
3593 impl ListServices {
3594 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3595 Self(RequestBuilder::new(stub))
3596 }
3597
3598 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
3600 self.0.request = v.into();
3601 self
3602 }
3603
3604 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3606 self.0.options = v.into();
3607 self
3608 }
3609
3610 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
3612 (*self.0.stub)
3613 .list_services(self.0.request, self.0.options)
3614 .await
3615 .map(gax::response::Response::into_body)
3616 }
3617
3618 pub fn by_page(
3620 self,
3621 ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
3622 {
3623 use std::clone::Clone;
3624 let token = self.0.request.page_token.clone();
3625 let execute = move |token: String| {
3626 let mut builder = self.clone();
3627 builder.0.request = builder.0.request.set_page_token(token);
3628 builder.send()
3629 };
3630 gax::paginator::internal::new_paginator(token, execute)
3631 }
3632
3633 pub fn by_item(
3635 self,
3636 ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
3637 {
3638 use gax::paginator::Paginator;
3639 self.by_page().items()
3640 }
3641
3642 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3646 self.0.request.parent = v.into();
3647 self
3648 }
3649
3650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3652 self.0.request.page_size = v.into();
3653 self
3654 }
3655
3656 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3658 self.0.request.page_token = v.into();
3659 self
3660 }
3661
3662 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3664 self.0.request.show_deleted = v.into();
3665 self
3666 }
3667 }
3668
3669 #[doc(hidden)]
3670 impl gax::options::internal::RequestBuilder for ListServices {
3671 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3672 &mut self.0.options
3673 }
3674 }
3675
3676 #[derive(Clone, Debug)]
3695 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
3696
3697 impl UpdateService {
3698 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3699 Self(RequestBuilder::new(stub))
3700 }
3701
3702 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
3704 self.0.request = v.into();
3705 self
3706 }
3707
3708 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3710 self.0.options = v.into();
3711 self
3712 }
3713
3714 pub async fn send(self) -> Result<longrunning::model::Operation> {
3721 (*self.0.stub)
3722 .update_service(self.0.request, self.0.options)
3723 .await
3724 .map(gax::response::Response::into_body)
3725 }
3726
3727 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3729 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3730 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3731 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3732
3733 let stub = self.0.stub.clone();
3734 let mut options = self.0.options.clone();
3735 options.set_retry_policy(gax::retry_policy::NeverRetry);
3736 let query = move |name| {
3737 let stub = stub.clone();
3738 let options = options.clone();
3739 async {
3740 let op = GetOperation::new(stub)
3741 .set_name(name)
3742 .with_options(options)
3743 .send()
3744 .await?;
3745 Ok(Operation::new(op))
3746 }
3747 };
3748
3749 let start = move || async {
3750 let op = self.send().await?;
3751 Ok(Operation::new(op))
3752 };
3753
3754 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3755 }
3756
3757 pub fn set_update_mask<T>(mut self, v: T) -> Self
3759 where
3760 T: std::convert::Into<wkt::FieldMask>,
3761 {
3762 self.0.request.update_mask = std::option::Option::Some(v.into());
3763 self
3764 }
3765
3766 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3768 where
3769 T: std::convert::Into<wkt::FieldMask>,
3770 {
3771 self.0.request.update_mask = v.map(|x| x.into());
3772 self
3773 }
3774
3775 pub fn set_service<T>(mut self, v: T) -> Self
3779 where
3780 T: std::convert::Into<crate::model::Service>,
3781 {
3782 self.0.request.service = std::option::Option::Some(v.into());
3783 self
3784 }
3785
3786 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3790 where
3791 T: std::convert::Into<crate::model::Service>,
3792 {
3793 self.0.request.service = v.map(|x| x.into());
3794 self
3795 }
3796
3797 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3799 self.0.request.validate_only = v.into();
3800 self
3801 }
3802
3803 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3805 self.0.request.allow_missing = v.into();
3806 self
3807 }
3808 }
3809
3810 #[doc(hidden)]
3811 impl gax::options::internal::RequestBuilder for UpdateService {
3812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3813 &mut self.0.options
3814 }
3815 }
3816
3817 #[derive(Clone, Debug)]
3836 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
3837
3838 impl DeleteService {
3839 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3840 Self(RequestBuilder::new(stub))
3841 }
3842
3843 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
3845 self.0.request = v.into();
3846 self
3847 }
3848
3849 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3851 self.0.options = v.into();
3852 self
3853 }
3854
3855 pub async fn send(self) -> Result<longrunning::model::Operation> {
3862 (*self.0.stub)
3863 .delete_service(self.0.request, self.0.options)
3864 .await
3865 .map(gax::response::Response::into_body)
3866 }
3867
3868 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3870 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3871 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3872 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3873
3874 let stub = self.0.stub.clone();
3875 let mut options = self.0.options.clone();
3876 options.set_retry_policy(gax::retry_policy::NeverRetry);
3877 let query = move |name| {
3878 let stub = stub.clone();
3879 let options = options.clone();
3880 async {
3881 let op = GetOperation::new(stub)
3882 .set_name(name)
3883 .with_options(options)
3884 .send()
3885 .await?;
3886 Ok(Operation::new(op))
3887 }
3888 };
3889
3890 let start = move || async {
3891 let op = self.send().await?;
3892 Ok(Operation::new(op))
3893 };
3894
3895 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3896 }
3897
3898 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3902 self.0.request.name = v.into();
3903 self
3904 }
3905
3906 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3908 self.0.request.validate_only = v.into();
3909 self
3910 }
3911
3912 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3914 self.0.request.etag = v.into();
3915 self
3916 }
3917 }
3918
3919 #[doc(hidden)]
3920 impl gax::options::internal::RequestBuilder for DeleteService {
3921 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3922 &mut self.0.options
3923 }
3924 }
3925
3926 #[derive(Clone, Debug)]
3944 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3945
3946 impl GetIamPolicy {
3947 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3948 Self(RequestBuilder::new(stub))
3949 }
3950
3951 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3953 self.0.request = v.into();
3954 self
3955 }
3956
3957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3959 self.0.options = v.into();
3960 self
3961 }
3962
3963 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3965 (*self.0.stub)
3966 .get_iam_policy(self.0.request, self.0.options)
3967 .await
3968 .map(gax::response::Response::into_body)
3969 }
3970
3971 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3975 self.0.request.resource = v.into();
3976 self
3977 }
3978
3979 pub fn set_options<T>(mut self, v: T) -> Self
3981 where
3982 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3983 {
3984 self.0.request.options = std::option::Option::Some(v.into());
3985 self
3986 }
3987
3988 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3990 where
3991 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3992 {
3993 self.0.request.options = v.map(|x| x.into());
3994 self
3995 }
3996 }
3997
3998 #[doc(hidden)]
3999 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4000 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4001 &mut self.0.options
4002 }
4003 }
4004
4005 #[derive(Clone, Debug)]
4023 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4024
4025 impl SetIamPolicy {
4026 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4027 Self(RequestBuilder::new(stub))
4028 }
4029
4030 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4032 self.0.request = v.into();
4033 self
4034 }
4035
4036 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4038 self.0.options = v.into();
4039 self
4040 }
4041
4042 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4044 (*self.0.stub)
4045 .set_iam_policy(self.0.request, self.0.options)
4046 .await
4047 .map(gax::response::Response::into_body)
4048 }
4049
4050 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4054 self.0.request.resource = v.into();
4055 self
4056 }
4057
4058 pub fn set_policy<T>(mut self, v: T) -> Self
4062 where
4063 T: std::convert::Into<iam_v1::model::Policy>,
4064 {
4065 self.0.request.policy = std::option::Option::Some(v.into());
4066 self
4067 }
4068
4069 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4073 where
4074 T: std::convert::Into<iam_v1::model::Policy>,
4075 {
4076 self.0.request.policy = v.map(|x| x.into());
4077 self
4078 }
4079
4080 pub fn set_update_mask<T>(mut self, v: T) -> Self
4082 where
4083 T: std::convert::Into<wkt::FieldMask>,
4084 {
4085 self.0.request.update_mask = std::option::Option::Some(v.into());
4086 self
4087 }
4088
4089 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4091 where
4092 T: std::convert::Into<wkt::FieldMask>,
4093 {
4094 self.0.request.update_mask = v.map(|x| x.into());
4095 self
4096 }
4097 }
4098
4099 #[doc(hidden)]
4100 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4102 &mut self.0.options
4103 }
4104 }
4105
4106 #[derive(Clone, Debug)]
4124 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4125
4126 impl TestIamPermissions {
4127 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4128 Self(RequestBuilder::new(stub))
4129 }
4130
4131 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4133 mut self,
4134 v: V,
4135 ) -> Self {
4136 self.0.request = v.into();
4137 self
4138 }
4139
4140 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4142 self.0.options = v.into();
4143 self
4144 }
4145
4146 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4148 (*self.0.stub)
4149 .test_iam_permissions(self.0.request, self.0.options)
4150 .await
4151 .map(gax::response::Response::into_body)
4152 }
4153
4154 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4158 self.0.request.resource = v.into();
4159 self
4160 }
4161
4162 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4166 where
4167 T: std::iter::IntoIterator<Item = V>,
4168 V: std::convert::Into<std::string::String>,
4169 {
4170 use std::iter::Iterator;
4171 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4172 self
4173 }
4174 }
4175
4176 #[doc(hidden)]
4177 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4179 &mut self.0.options
4180 }
4181 }
4182
4183 #[derive(Clone, Debug)]
4205 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4206
4207 impl ListOperations {
4208 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4209 Self(RequestBuilder::new(stub))
4210 }
4211
4212 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4214 mut self,
4215 v: V,
4216 ) -> Self {
4217 self.0.request = v.into();
4218 self
4219 }
4220
4221 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4223 self.0.options = v.into();
4224 self
4225 }
4226
4227 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4229 (*self.0.stub)
4230 .list_operations(self.0.request, self.0.options)
4231 .await
4232 .map(gax::response::Response::into_body)
4233 }
4234
4235 pub fn by_page(
4237 self,
4238 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4239 {
4240 use std::clone::Clone;
4241 let token = self.0.request.page_token.clone();
4242 let execute = move |token: String| {
4243 let mut builder = self.clone();
4244 builder.0.request = builder.0.request.set_page_token(token);
4245 builder.send()
4246 };
4247 gax::paginator::internal::new_paginator(token, execute)
4248 }
4249
4250 pub fn by_item(
4252 self,
4253 ) -> impl gax::paginator::ItemPaginator<
4254 longrunning::model::ListOperationsResponse,
4255 gax::error::Error,
4256 > {
4257 use gax::paginator::Paginator;
4258 self.by_page().items()
4259 }
4260
4261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4263 self.0.request.name = v.into();
4264 self
4265 }
4266
4267 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4269 self.0.request.filter = v.into();
4270 self
4271 }
4272
4273 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4275 self.0.request.page_size = v.into();
4276 self
4277 }
4278
4279 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4281 self.0.request.page_token = v.into();
4282 self
4283 }
4284
4285 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4287 self.0.request.return_partial_success = v.into();
4288 self
4289 }
4290 }
4291
4292 #[doc(hidden)]
4293 impl gax::options::internal::RequestBuilder for ListOperations {
4294 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4295 &mut self.0.options
4296 }
4297 }
4298
4299 #[derive(Clone, Debug)]
4317 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4318
4319 impl GetOperation {
4320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4321 Self(RequestBuilder::new(stub))
4322 }
4323
4324 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4326 mut self,
4327 v: V,
4328 ) -> Self {
4329 self.0.request = v.into();
4330 self
4331 }
4332
4333 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4335 self.0.options = v.into();
4336 self
4337 }
4338
4339 pub async fn send(self) -> Result<longrunning::model::Operation> {
4341 (*self.0.stub)
4342 .get_operation(self.0.request, self.0.options)
4343 .await
4344 .map(gax::response::Response::into_body)
4345 }
4346
4347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4349 self.0.request.name = v.into();
4350 self
4351 }
4352 }
4353
4354 #[doc(hidden)]
4355 impl gax::options::internal::RequestBuilder for GetOperation {
4356 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4357 &mut self.0.options
4358 }
4359 }
4360
4361 #[derive(Clone, Debug)]
4379 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4380
4381 impl DeleteOperation {
4382 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4383 Self(RequestBuilder::new(stub))
4384 }
4385
4386 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4388 mut self,
4389 v: V,
4390 ) -> Self {
4391 self.0.request = v.into();
4392 self
4393 }
4394
4395 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4397 self.0.options = v.into();
4398 self
4399 }
4400
4401 pub async fn send(self) -> Result<()> {
4403 (*self.0.stub)
4404 .delete_operation(self.0.request, self.0.options)
4405 .await
4406 .map(gax::response::Response::into_body)
4407 }
4408
4409 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4411 self.0.request.name = v.into();
4412 self
4413 }
4414 }
4415
4416 #[doc(hidden)]
4417 impl gax::options::internal::RequestBuilder for DeleteOperation {
4418 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4419 &mut self.0.options
4420 }
4421 }
4422
4423 #[derive(Clone, Debug)]
4441 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4442
4443 impl WaitOperation {
4444 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4445 Self(RequestBuilder::new(stub))
4446 }
4447
4448 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4450 mut self,
4451 v: V,
4452 ) -> Self {
4453 self.0.request = v.into();
4454 self
4455 }
4456
4457 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4459 self.0.options = v.into();
4460 self
4461 }
4462
4463 pub async fn send(self) -> Result<longrunning::model::Operation> {
4465 (*self.0.stub)
4466 .wait_operation(self.0.request, self.0.options)
4467 .await
4468 .map(gax::response::Response::into_body)
4469 }
4470
4471 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4473 self.0.request.name = v.into();
4474 self
4475 }
4476
4477 pub fn set_timeout<T>(mut self, v: T) -> Self
4479 where
4480 T: std::convert::Into<wkt::Duration>,
4481 {
4482 self.0.request.timeout = std::option::Option::Some(v.into());
4483 self
4484 }
4485
4486 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4488 where
4489 T: std::convert::Into<wkt::Duration>,
4490 {
4491 self.0.request.timeout = v.map(|x| x.into());
4492 self
4493 }
4494 }
4495
4496 #[doc(hidden)]
4497 impl gax::options::internal::RequestBuilder for WaitOperation {
4498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4499 &mut self.0.options
4500 }
4501 }
4502}
4503
4504pub mod tasks {
4505 use crate::Result;
4506
4507 pub type ClientBuilder =
4521 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4522
4523 pub(crate) mod client {
4524 use super::super::super::client::Tasks;
4525 pub struct Factory;
4526 impl gax::client_builder::internal::ClientFactory for Factory {
4527 type Client = Tasks;
4528 type Credentials = gaxi::options::Credentials;
4529 async fn build(
4530 self,
4531 config: gaxi::options::ClientConfig,
4532 ) -> gax::client_builder::Result<Self::Client> {
4533 Self::Client::new(config).await
4534 }
4535 }
4536 }
4537
4538 #[derive(Clone, Debug)]
4540 pub(crate) struct RequestBuilder<R: std::default::Default> {
4541 stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>,
4542 request: R,
4543 options: gax::options::RequestOptions,
4544 }
4545
4546 impl<R> RequestBuilder<R>
4547 where
4548 R: std::default::Default,
4549 {
4550 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4551 Self {
4552 stub,
4553 request: R::default(),
4554 options: gax::options::RequestOptions::default(),
4555 }
4556 }
4557 }
4558
4559 #[derive(Clone, Debug)]
4577 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
4578
4579 impl GetTask {
4580 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4581 Self(RequestBuilder::new(stub))
4582 }
4583
4584 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
4586 self.0.request = v.into();
4587 self
4588 }
4589
4590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4592 self.0.options = v.into();
4593 self
4594 }
4595
4596 pub async fn send(self) -> Result<crate::model::Task> {
4598 (*self.0.stub)
4599 .get_task(self.0.request, self.0.options)
4600 .await
4601 .map(gax::response::Response::into_body)
4602 }
4603
4604 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4608 self.0.request.name = v.into();
4609 self
4610 }
4611 }
4612
4613 #[doc(hidden)]
4614 impl gax::options::internal::RequestBuilder for GetTask {
4615 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4616 &mut self.0.options
4617 }
4618 }
4619
4620 #[derive(Clone, Debug)]
4642 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
4643
4644 impl ListTasks {
4645 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4646 Self(RequestBuilder::new(stub))
4647 }
4648
4649 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
4651 self.0.request = v.into();
4652 self
4653 }
4654
4655 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4657 self.0.options = v.into();
4658 self
4659 }
4660
4661 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
4663 (*self.0.stub)
4664 .list_tasks(self.0.request, self.0.options)
4665 .await
4666 .map(gax::response::Response::into_body)
4667 }
4668
4669 pub fn by_page(
4671 self,
4672 ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
4673 {
4674 use std::clone::Clone;
4675 let token = self.0.request.page_token.clone();
4676 let execute = move |token: String| {
4677 let mut builder = self.clone();
4678 builder.0.request = builder.0.request.set_page_token(token);
4679 builder.send()
4680 };
4681 gax::paginator::internal::new_paginator(token, execute)
4682 }
4683
4684 pub fn by_item(
4686 self,
4687 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
4688 {
4689 use gax::paginator::Paginator;
4690 self.by_page().items()
4691 }
4692
4693 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4697 self.0.request.parent = v.into();
4698 self
4699 }
4700
4701 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4703 self.0.request.page_size = v.into();
4704 self
4705 }
4706
4707 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.page_token = v.into();
4710 self
4711 }
4712
4713 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
4715 self.0.request.show_deleted = v.into();
4716 self
4717 }
4718 }
4719
4720 #[doc(hidden)]
4721 impl gax::options::internal::RequestBuilder for ListTasks {
4722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4723 &mut self.0.options
4724 }
4725 }
4726
4727 #[derive(Clone, Debug)]
4749 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4750
4751 impl ListOperations {
4752 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4753 Self(RequestBuilder::new(stub))
4754 }
4755
4756 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4758 mut self,
4759 v: V,
4760 ) -> Self {
4761 self.0.request = v.into();
4762 self
4763 }
4764
4765 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4767 self.0.options = v.into();
4768 self
4769 }
4770
4771 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4773 (*self.0.stub)
4774 .list_operations(self.0.request, self.0.options)
4775 .await
4776 .map(gax::response::Response::into_body)
4777 }
4778
4779 pub fn by_page(
4781 self,
4782 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4783 {
4784 use std::clone::Clone;
4785 let token = self.0.request.page_token.clone();
4786 let execute = move |token: String| {
4787 let mut builder = self.clone();
4788 builder.0.request = builder.0.request.set_page_token(token);
4789 builder.send()
4790 };
4791 gax::paginator::internal::new_paginator(token, execute)
4792 }
4793
4794 pub fn by_item(
4796 self,
4797 ) -> impl gax::paginator::ItemPaginator<
4798 longrunning::model::ListOperationsResponse,
4799 gax::error::Error,
4800 > {
4801 use gax::paginator::Paginator;
4802 self.by_page().items()
4803 }
4804
4805 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807 self.0.request.name = v.into();
4808 self
4809 }
4810
4811 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.0.request.filter = v.into();
4814 self
4815 }
4816
4817 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4819 self.0.request.page_size = v.into();
4820 self
4821 }
4822
4823 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4825 self.0.request.page_token = v.into();
4826 self
4827 }
4828
4829 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4831 self.0.request.return_partial_success = v.into();
4832 self
4833 }
4834 }
4835
4836 #[doc(hidden)]
4837 impl gax::options::internal::RequestBuilder for ListOperations {
4838 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4839 &mut self.0.options
4840 }
4841 }
4842
4843 #[derive(Clone, Debug)]
4861 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4862
4863 impl GetOperation {
4864 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4865 Self(RequestBuilder::new(stub))
4866 }
4867
4868 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4870 mut self,
4871 v: V,
4872 ) -> Self {
4873 self.0.request = v.into();
4874 self
4875 }
4876
4877 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4879 self.0.options = v.into();
4880 self
4881 }
4882
4883 pub async fn send(self) -> Result<longrunning::model::Operation> {
4885 (*self.0.stub)
4886 .get_operation(self.0.request, self.0.options)
4887 .await
4888 .map(gax::response::Response::into_body)
4889 }
4890
4891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4893 self.0.request.name = v.into();
4894 self
4895 }
4896 }
4897
4898 #[doc(hidden)]
4899 impl gax::options::internal::RequestBuilder for GetOperation {
4900 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4901 &mut self.0.options
4902 }
4903 }
4904
4905 #[derive(Clone, Debug)]
4923 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4924
4925 impl DeleteOperation {
4926 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4927 Self(RequestBuilder::new(stub))
4928 }
4929
4930 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4932 mut self,
4933 v: V,
4934 ) -> Self {
4935 self.0.request = v.into();
4936 self
4937 }
4938
4939 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4941 self.0.options = v.into();
4942 self
4943 }
4944
4945 pub async fn send(self) -> Result<()> {
4947 (*self.0.stub)
4948 .delete_operation(self.0.request, self.0.options)
4949 .await
4950 .map(gax::response::Response::into_body)
4951 }
4952
4953 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4955 self.0.request.name = v.into();
4956 self
4957 }
4958 }
4959
4960 #[doc(hidden)]
4961 impl gax::options::internal::RequestBuilder for DeleteOperation {
4962 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4963 &mut self.0.options
4964 }
4965 }
4966
4967 #[derive(Clone, Debug)]
4985 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4986
4987 impl WaitOperation {
4988 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4989 Self(RequestBuilder::new(stub))
4990 }
4991
4992 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4994 mut self,
4995 v: V,
4996 ) -> Self {
4997 self.0.request = v.into();
4998 self
4999 }
5000
5001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5003 self.0.options = v.into();
5004 self
5005 }
5006
5007 pub async fn send(self) -> Result<longrunning::model::Operation> {
5009 (*self.0.stub)
5010 .wait_operation(self.0.request, self.0.options)
5011 .await
5012 .map(gax::response::Response::into_body)
5013 }
5014
5015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5017 self.0.request.name = v.into();
5018 self
5019 }
5020
5021 pub fn set_timeout<T>(mut self, v: T) -> Self
5023 where
5024 T: std::convert::Into<wkt::Duration>,
5025 {
5026 self.0.request.timeout = std::option::Option::Some(v.into());
5027 self
5028 }
5029
5030 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5032 where
5033 T: std::convert::Into<wkt::Duration>,
5034 {
5035 self.0.request.timeout = v.map(|x| x.into());
5036 self
5037 }
5038 }
5039
5040 #[doc(hidden)]
5041 impl gax::options::internal::RequestBuilder for WaitOperation {
5042 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5043 &mut self.0.options
5044 }
5045 }
5046}
5047
5048pub mod worker_pools {
5049 use crate::Result;
5050
5051 pub type ClientBuilder =
5065 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5066
5067 pub(crate) mod client {
5068 use super::super::super::client::WorkerPools;
5069 pub struct Factory;
5070 impl gax::client_builder::internal::ClientFactory for Factory {
5071 type Client = WorkerPools;
5072 type Credentials = gaxi::options::Credentials;
5073 async fn build(
5074 self,
5075 config: gaxi::options::ClientConfig,
5076 ) -> gax::client_builder::Result<Self::Client> {
5077 Self::Client::new(config).await
5078 }
5079 }
5080 }
5081
5082 #[derive(Clone, Debug)]
5084 pub(crate) struct RequestBuilder<R: std::default::Default> {
5085 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5086 request: R,
5087 options: gax::options::RequestOptions,
5088 }
5089
5090 impl<R> RequestBuilder<R>
5091 where
5092 R: std::default::Default,
5093 {
5094 pub(crate) fn new(
5095 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5096 ) -> Self {
5097 Self {
5098 stub,
5099 request: R::default(),
5100 options: gax::options::RequestOptions::default(),
5101 }
5102 }
5103 }
5104
5105 #[derive(Clone, Debug)]
5124 pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
5125
5126 impl CreateWorkerPool {
5127 pub(crate) fn new(
5128 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5129 ) -> Self {
5130 Self(RequestBuilder::new(stub))
5131 }
5132
5133 pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
5135 mut self,
5136 v: V,
5137 ) -> Self {
5138 self.0.request = v.into();
5139 self
5140 }
5141
5142 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5144 self.0.options = v.into();
5145 self
5146 }
5147
5148 pub async fn send(self) -> Result<longrunning::model::Operation> {
5155 (*self.0.stub)
5156 .create_worker_pool(self.0.request, self.0.options)
5157 .await
5158 .map(gax::response::Response::into_body)
5159 }
5160
5161 pub fn poller(
5163 self,
5164 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5165 type Operation =
5166 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5167 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5168 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5169
5170 let stub = self.0.stub.clone();
5171 let mut options = self.0.options.clone();
5172 options.set_retry_policy(gax::retry_policy::NeverRetry);
5173 let query = move |name| {
5174 let stub = stub.clone();
5175 let options = options.clone();
5176 async {
5177 let op = GetOperation::new(stub)
5178 .set_name(name)
5179 .with_options(options)
5180 .send()
5181 .await?;
5182 Ok(Operation::new(op))
5183 }
5184 };
5185
5186 let start = move || async {
5187 let op = self.send().await?;
5188 Ok(Operation::new(op))
5189 };
5190
5191 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5192 }
5193
5194 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5198 self.0.request.parent = v.into();
5199 self
5200 }
5201
5202 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5206 where
5207 T: std::convert::Into<crate::model::WorkerPool>,
5208 {
5209 self.0.request.worker_pool = std::option::Option::Some(v.into());
5210 self
5211 }
5212
5213 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
5217 where
5218 T: std::convert::Into<crate::model::WorkerPool>,
5219 {
5220 self.0.request.worker_pool = v.map(|x| x.into());
5221 self
5222 }
5223
5224 pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5228 self.0.request.worker_pool_id = v.into();
5229 self
5230 }
5231
5232 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5234 self.0.request.validate_only = v.into();
5235 self
5236 }
5237 }
5238
5239 #[doc(hidden)]
5240 impl gax::options::internal::RequestBuilder for CreateWorkerPool {
5241 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5242 &mut self.0.options
5243 }
5244 }
5245
5246 #[derive(Clone, Debug)]
5264 pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
5265
5266 impl GetWorkerPool {
5267 pub(crate) fn new(
5268 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5269 ) -> Self {
5270 Self(RequestBuilder::new(stub))
5271 }
5272
5273 pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
5275 self.0.request = v.into();
5276 self
5277 }
5278
5279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5281 self.0.options = v.into();
5282 self
5283 }
5284
5285 pub async fn send(self) -> Result<crate::model::WorkerPool> {
5287 (*self.0.stub)
5288 .get_worker_pool(self.0.request, self.0.options)
5289 .await
5290 .map(gax::response::Response::into_body)
5291 }
5292
5293 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5297 self.0.request.name = v.into();
5298 self
5299 }
5300 }
5301
5302 #[doc(hidden)]
5303 impl gax::options::internal::RequestBuilder for GetWorkerPool {
5304 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5305 &mut self.0.options
5306 }
5307 }
5308
5309 #[derive(Clone, Debug)]
5331 pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
5332
5333 impl ListWorkerPools {
5334 pub(crate) fn new(
5335 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5336 ) -> Self {
5337 Self(RequestBuilder::new(stub))
5338 }
5339
5340 pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
5342 self.0.request = v.into();
5343 self
5344 }
5345
5346 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5348 self.0.options = v.into();
5349 self
5350 }
5351
5352 pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
5354 (*self.0.stub)
5355 .list_worker_pools(self.0.request, self.0.options)
5356 .await
5357 .map(gax::response::Response::into_body)
5358 }
5359
5360 pub fn by_page(
5362 self,
5363 ) -> impl gax::paginator::Paginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
5364 {
5365 use std::clone::Clone;
5366 let token = self.0.request.page_token.clone();
5367 let execute = move |token: String| {
5368 let mut builder = self.clone();
5369 builder.0.request = builder.0.request.set_page_token(token);
5370 builder.send()
5371 };
5372 gax::paginator::internal::new_paginator(token, execute)
5373 }
5374
5375 pub fn by_item(
5377 self,
5378 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
5379 {
5380 use gax::paginator::Paginator;
5381 self.by_page().items()
5382 }
5383
5384 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.0.request.parent = v.into();
5389 self
5390 }
5391
5392 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5394 self.0.request.page_size = v.into();
5395 self
5396 }
5397
5398 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5400 self.0.request.page_token = v.into();
5401 self
5402 }
5403
5404 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
5406 self.0.request.show_deleted = v.into();
5407 self
5408 }
5409 }
5410
5411 #[doc(hidden)]
5412 impl gax::options::internal::RequestBuilder for ListWorkerPools {
5413 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5414 &mut self.0.options
5415 }
5416 }
5417
5418 #[derive(Clone, Debug)]
5437 pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
5438
5439 impl UpdateWorkerPool {
5440 pub(crate) fn new(
5441 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5442 ) -> Self {
5443 Self(RequestBuilder::new(stub))
5444 }
5445
5446 pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
5448 mut self,
5449 v: V,
5450 ) -> Self {
5451 self.0.request = v.into();
5452 self
5453 }
5454
5455 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5457 self.0.options = v.into();
5458 self
5459 }
5460
5461 pub async fn send(self) -> Result<longrunning::model::Operation> {
5468 (*self.0.stub)
5469 .update_worker_pool(self.0.request, self.0.options)
5470 .await
5471 .map(gax::response::Response::into_body)
5472 }
5473
5474 pub fn poller(
5476 self,
5477 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5478 type Operation =
5479 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5480 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5481 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5482
5483 let stub = self.0.stub.clone();
5484 let mut options = self.0.options.clone();
5485 options.set_retry_policy(gax::retry_policy::NeverRetry);
5486 let query = move |name| {
5487 let stub = stub.clone();
5488 let options = options.clone();
5489 async {
5490 let op = GetOperation::new(stub)
5491 .set_name(name)
5492 .with_options(options)
5493 .send()
5494 .await?;
5495 Ok(Operation::new(op))
5496 }
5497 };
5498
5499 let start = move || async {
5500 let op = self.send().await?;
5501 Ok(Operation::new(op))
5502 };
5503
5504 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5505 }
5506
5507 pub fn set_update_mask<T>(mut self, v: T) -> Self
5509 where
5510 T: std::convert::Into<wkt::FieldMask>,
5511 {
5512 self.0.request.update_mask = std::option::Option::Some(v.into());
5513 self
5514 }
5515
5516 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5518 where
5519 T: std::convert::Into<wkt::FieldMask>,
5520 {
5521 self.0.request.update_mask = v.map(|x| x.into());
5522 self
5523 }
5524
5525 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5529 where
5530 T: std::convert::Into<crate::model::WorkerPool>,
5531 {
5532 self.0.request.worker_pool = std::option::Option::Some(v.into());
5533 self
5534 }
5535
5536 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
5540 where
5541 T: std::convert::Into<crate::model::WorkerPool>,
5542 {
5543 self.0.request.worker_pool = v.map(|x| x.into());
5544 self
5545 }
5546
5547 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5549 self.0.request.validate_only = v.into();
5550 self
5551 }
5552
5553 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5555 self.0.request.allow_missing = v.into();
5556 self
5557 }
5558
5559 pub fn set_force_new_revision<T: Into<bool>>(mut self, v: T) -> Self {
5561 self.0.request.force_new_revision = v.into();
5562 self
5563 }
5564 }
5565
5566 #[doc(hidden)]
5567 impl gax::options::internal::RequestBuilder for UpdateWorkerPool {
5568 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5569 &mut self.0.options
5570 }
5571 }
5572
5573 #[derive(Clone, Debug)]
5592 pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
5593
5594 impl DeleteWorkerPool {
5595 pub(crate) fn new(
5596 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5597 ) -> Self {
5598 Self(RequestBuilder::new(stub))
5599 }
5600
5601 pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
5603 mut self,
5604 v: V,
5605 ) -> Self {
5606 self.0.request = v.into();
5607 self
5608 }
5609
5610 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5612 self.0.options = v.into();
5613 self
5614 }
5615
5616 pub async fn send(self) -> Result<longrunning::model::Operation> {
5623 (*self.0.stub)
5624 .delete_worker_pool(self.0.request, self.0.options)
5625 .await
5626 .map(gax::response::Response::into_body)
5627 }
5628
5629 pub fn poller(
5631 self,
5632 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5633 type Operation =
5634 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5635 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5636 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5637
5638 let stub = self.0.stub.clone();
5639 let mut options = self.0.options.clone();
5640 options.set_retry_policy(gax::retry_policy::NeverRetry);
5641 let query = move |name| {
5642 let stub = stub.clone();
5643 let options = options.clone();
5644 async {
5645 let op = GetOperation::new(stub)
5646 .set_name(name)
5647 .with_options(options)
5648 .send()
5649 .await?;
5650 Ok(Operation::new(op))
5651 }
5652 };
5653
5654 let start = move || async {
5655 let op = self.send().await?;
5656 Ok(Operation::new(op))
5657 };
5658
5659 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5660 }
5661
5662 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5666 self.0.request.name = v.into();
5667 self
5668 }
5669
5670 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5672 self.0.request.validate_only = v.into();
5673 self
5674 }
5675
5676 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.0.request.etag = v.into();
5679 self
5680 }
5681 }
5682
5683 #[doc(hidden)]
5684 impl gax::options::internal::RequestBuilder for DeleteWorkerPool {
5685 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5686 &mut self.0.options
5687 }
5688 }
5689
5690 #[derive(Clone, Debug)]
5708 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5709
5710 impl GetIamPolicy {
5711 pub(crate) fn new(
5712 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5713 ) -> Self {
5714 Self(RequestBuilder::new(stub))
5715 }
5716
5717 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5719 self.0.request = v.into();
5720 self
5721 }
5722
5723 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5725 self.0.options = v.into();
5726 self
5727 }
5728
5729 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5731 (*self.0.stub)
5732 .get_iam_policy(self.0.request, self.0.options)
5733 .await
5734 .map(gax::response::Response::into_body)
5735 }
5736
5737 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5741 self.0.request.resource = v.into();
5742 self
5743 }
5744
5745 pub fn set_options<T>(mut self, v: T) -> Self
5747 where
5748 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5749 {
5750 self.0.request.options = std::option::Option::Some(v.into());
5751 self
5752 }
5753
5754 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5756 where
5757 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5758 {
5759 self.0.request.options = v.map(|x| x.into());
5760 self
5761 }
5762 }
5763
5764 #[doc(hidden)]
5765 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5766 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5767 &mut self.0.options
5768 }
5769 }
5770
5771 #[derive(Clone, Debug)]
5789 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5790
5791 impl SetIamPolicy {
5792 pub(crate) fn new(
5793 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5794 ) -> Self {
5795 Self(RequestBuilder::new(stub))
5796 }
5797
5798 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5800 self.0.request = v.into();
5801 self
5802 }
5803
5804 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5806 self.0.options = v.into();
5807 self
5808 }
5809
5810 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5812 (*self.0.stub)
5813 .set_iam_policy(self.0.request, self.0.options)
5814 .await
5815 .map(gax::response::Response::into_body)
5816 }
5817
5818 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5822 self.0.request.resource = v.into();
5823 self
5824 }
5825
5826 pub fn set_policy<T>(mut self, v: T) -> Self
5830 where
5831 T: std::convert::Into<iam_v1::model::Policy>,
5832 {
5833 self.0.request.policy = std::option::Option::Some(v.into());
5834 self
5835 }
5836
5837 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5841 where
5842 T: std::convert::Into<iam_v1::model::Policy>,
5843 {
5844 self.0.request.policy = v.map(|x| x.into());
5845 self
5846 }
5847
5848 pub fn set_update_mask<T>(mut self, v: T) -> Self
5850 where
5851 T: std::convert::Into<wkt::FieldMask>,
5852 {
5853 self.0.request.update_mask = std::option::Option::Some(v.into());
5854 self
5855 }
5856
5857 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5859 where
5860 T: std::convert::Into<wkt::FieldMask>,
5861 {
5862 self.0.request.update_mask = v.map(|x| x.into());
5863 self
5864 }
5865 }
5866
5867 #[doc(hidden)]
5868 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5869 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5870 &mut self.0.options
5871 }
5872 }
5873
5874 #[derive(Clone, Debug)]
5892 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5893
5894 impl TestIamPermissions {
5895 pub(crate) fn new(
5896 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5897 ) -> Self {
5898 Self(RequestBuilder::new(stub))
5899 }
5900
5901 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5903 mut self,
5904 v: V,
5905 ) -> Self {
5906 self.0.request = v.into();
5907 self
5908 }
5909
5910 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5912 self.0.options = v.into();
5913 self
5914 }
5915
5916 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5918 (*self.0.stub)
5919 .test_iam_permissions(self.0.request, self.0.options)
5920 .await
5921 .map(gax::response::Response::into_body)
5922 }
5923
5924 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5928 self.0.request.resource = v.into();
5929 self
5930 }
5931
5932 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5936 where
5937 T: std::iter::IntoIterator<Item = V>,
5938 V: std::convert::Into<std::string::String>,
5939 {
5940 use std::iter::Iterator;
5941 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5942 self
5943 }
5944 }
5945
5946 #[doc(hidden)]
5947 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5948 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5949 &mut self.0.options
5950 }
5951 }
5952
5953 #[derive(Clone, Debug)]
5975 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5976
5977 impl ListOperations {
5978 pub(crate) fn new(
5979 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5980 ) -> Self {
5981 Self(RequestBuilder::new(stub))
5982 }
5983
5984 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5986 mut self,
5987 v: V,
5988 ) -> Self {
5989 self.0.request = v.into();
5990 self
5991 }
5992
5993 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5995 self.0.options = v.into();
5996 self
5997 }
5998
5999 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6001 (*self.0.stub)
6002 .list_operations(self.0.request, self.0.options)
6003 .await
6004 .map(gax::response::Response::into_body)
6005 }
6006
6007 pub fn by_page(
6009 self,
6010 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6011 {
6012 use std::clone::Clone;
6013 let token = self.0.request.page_token.clone();
6014 let execute = move |token: String| {
6015 let mut builder = self.clone();
6016 builder.0.request = builder.0.request.set_page_token(token);
6017 builder.send()
6018 };
6019 gax::paginator::internal::new_paginator(token, execute)
6020 }
6021
6022 pub fn by_item(
6024 self,
6025 ) -> impl gax::paginator::ItemPaginator<
6026 longrunning::model::ListOperationsResponse,
6027 gax::error::Error,
6028 > {
6029 use gax::paginator::Paginator;
6030 self.by_page().items()
6031 }
6032
6033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6035 self.0.request.name = v.into();
6036 self
6037 }
6038
6039 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6041 self.0.request.filter = v.into();
6042 self
6043 }
6044
6045 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6047 self.0.request.page_size = v.into();
6048 self
6049 }
6050
6051 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6053 self.0.request.page_token = v.into();
6054 self
6055 }
6056
6057 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6059 self.0.request.return_partial_success = v.into();
6060 self
6061 }
6062 }
6063
6064 #[doc(hidden)]
6065 impl gax::options::internal::RequestBuilder for ListOperations {
6066 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6067 &mut self.0.options
6068 }
6069 }
6070
6071 #[derive(Clone, Debug)]
6089 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6090
6091 impl GetOperation {
6092 pub(crate) fn new(
6093 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6094 ) -> Self {
6095 Self(RequestBuilder::new(stub))
6096 }
6097
6098 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6100 mut self,
6101 v: V,
6102 ) -> Self {
6103 self.0.request = v.into();
6104 self
6105 }
6106
6107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6109 self.0.options = v.into();
6110 self
6111 }
6112
6113 pub async fn send(self) -> Result<longrunning::model::Operation> {
6115 (*self.0.stub)
6116 .get_operation(self.0.request, self.0.options)
6117 .await
6118 .map(gax::response::Response::into_body)
6119 }
6120
6121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6123 self.0.request.name = v.into();
6124 self
6125 }
6126 }
6127
6128 #[doc(hidden)]
6129 impl gax::options::internal::RequestBuilder for GetOperation {
6130 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6131 &mut self.0.options
6132 }
6133 }
6134
6135 #[derive(Clone, Debug)]
6153 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6154
6155 impl DeleteOperation {
6156 pub(crate) fn new(
6157 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6158 ) -> Self {
6159 Self(RequestBuilder::new(stub))
6160 }
6161
6162 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6164 mut self,
6165 v: V,
6166 ) -> Self {
6167 self.0.request = v.into();
6168 self
6169 }
6170
6171 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6173 self.0.options = v.into();
6174 self
6175 }
6176
6177 pub async fn send(self) -> Result<()> {
6179 (*self.0.stub)
6180 .delete_operation(self.0.request, self.0.options)
6181 .await
6182 .map(gax::response::Response::into_body)
6183 }
6184
6185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6187 self.0.request.name = v.into();
6188 self
6189 }
6190 }
6191
6192 #[doc(hidden)]
6193 impl gax::options::internal::RequestBuilder for DeleteOperation {
6194 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6195 &mut self.0.options
6196 }
6197 }
6198
6199 #[derive(Clone, Debug)]
6217 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
6218
6219 impl WaitOperation {
6220 pub(crate) fn new(
6221 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6222 ) -> Self {
6223 Self(RequestBuilder::new(stub))
6224 }
6225
6226 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
6228 mut self,
6229 v: V,
6230 ) -> Self {
6231 self.0.request = v.into();
6232 self
6233 }
6234
6235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6237 self.0.options = v.into();
6238 self
6239 }
6240
6241 pub async fn send(self) -> Result<longrunning::model::Operation> {
6243 (*self.0.stub)
6244 .wait_operation(self.0.request, self.0.options)
6245 .await
6246 .map(gax::response::Response::into_body)
6247 }
6248
6249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6251 self.0.request.name = v.into();
6252 self
6253 }
6254
6255 pub fn set_timeout<T>(mut self, v: T) -> Self
6257 where
6258 T: std::convert::Into<wkt::Duration>,
6259 {
6260 self.0.request.timeout = std::option::Option::Some(v.into());
6261 self
6262 }
6263
6264 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6266 where
6267 T: std::convert::Into<wkt::Duration>,
6268 {
6269 self.0.request.timeout = v.map(|x| x.into());
6270 self
6271 }
6272 }
6273
6274 #[doc(hidden)]
6275 impl gax::options::internal::RequestBuilder for WaitOperation {
6276 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6277 &mut self.0.options
6278 }
6279 }
6280}